github.com/status-im/status-go@v1.1.0/_assets/systemd/mailserver/README.md (about)

     1  # Status Mailserver
     2  
     3  This folder contains setup for running your own Status Mailserver.
     4  It uses [Systemd](https://www.freedesktop.org/wiki/Software/systemd/) for managing the Status Mailserver service.
     5  
     6  The steps it takes are:
     7  
     8  * Builds statusd
     9  * Generates `statusd` config
    10  * Generates `systemd` service
    11  * Starts the service
    12  
    13  # Usage
    14  
    15  To simply configure and start the service run `make`.
    16  
    17  In order to manage the new `statusd` service you use other `Makefile` targets:
    18  
    19  * `make info` - Info about service
    20  * `make enode` - Get enode address
    21  * `make enode-qr` - Get enode address as QR code
    22  * `make start` - Start the service
    23  * `make stop` - Stop the service
    24  * `make status` - Check service status
    25  * `make enable` - Enable the service
    26  * `make disable` - Disable the service
    27  * `make logs` - Read the service logs
    28  * `make clean` - Stop service and remove it
    29  
    30  All the above commands are just wrappers around the [`systemctl`](http://man7.org/linux/man-pages/man1/systemctl.1.html) and [`journalctl`](http://man7.org/linux/man-pages/man1/journalctl.1.html) commands.
    31  
    32  # Settings
    33  
    34  All settings are passed through environment variables:
    35  
    36  * `SERVICE_NAME` - Name of the `systemd` service to be created. (Default: `statusd`)
    37  * `LISTEN_PORT` - Mailserver TCP & UDP port, by default it's `30303` but you might want to use `443`.
    38  * `METRICS_PORT` - Port exposing metrics in [Prometheus](https://prometheus.io/docs/concepts/data_model/) format
    39  * `RPC_PORT` - Control port making it possible to use the [JSON-RPC API](https://github.com/ethereum/wiki/wiki/JSON-RPC).
    40  * `API_MODULES` - API modules to be made available via the `RPC_PORT`.
    41  * `DATA_PATH` - Location of Mailserver storage and keys. (Default: `/var/tmp/status-go-mail`)
    42  * `REGISTER_TOPIC` - Mynamic Mailserver discovery topic. (Default: `whispermail`)
    43  * `MAIL_PASSWORD` - Basic HTTP auth password for Mailserver. (Default: `status-offline-inbox`)
    44  * `LOG_LEVEL` - Set level of log messages to show. (`ERROR`, `WARN`, `INFO`, `DEBUG`, `TRACE`)
    45  
    46  The generated configuration file end up under `${DATA_PATH}/config.json`.
    47  
    48  # System Service
    49  
    50  By default this `Makefile` configures the Mailserver as a [systemd user service](https://www.freedesktop.org/software/systemd/man/user@.service.html). This is done to simplify the proces and remove the need for `sudo`. The disadvantage of this solution is that the service is stopped when the user logs out.
    51  
    52  In order to make your service a system service use `sudo make`.
    53  
    54  # Known Issues
    55  
    56  * `No journal files were opened due to insufficient permissions.` from `systemctl`
    57    - To see logs of a user systemd service you need to be a member of `systemd-journal` group.
    58    - Use: `bash usermod -a -G systemd-journal ${USER}`