Install by hand
These are the steps the installer runs, for when you need to change one. Run them in a root shell (sudo -i).
-
Install the system packages:
apt-get update apt-get install -y python3 python3-pip python3-venv python3-dev \ build-essential pkg-config libsqlcipher-dev libmagic1 openssl git make curl -
Install Rust, which builds the payload library:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y source "$HOME/.cargo/env" -
Create the service user:
useradd --system --no-create-home --shell /usr/sbin/nologin relaysms -
Clone the repository with its submodule:
git clone --recurse-submodules \ https://github.com/smswithoutborders/RelaySMS-Publisher.git \ /opt/relaysms/relaysms-publisher cd /opt/relaysms/relaysms-publisher -
Create the virtualenv and build the gRPC code and payload library:
python3 -m venv venv venv/bin/pip install --upgrade pip venv/bin/pip install -r requirements.txt make build -
Create
.envwith fresh encryption keys, then set what you need (see the settings reference):make .env chown root:relaysms .env chmod 640 .env -
Create the data directories. By default the SQLite database, Celery files and adapters all live under
data/:mkdir -p data/platforms/{adapters,venvs,config,state} chown -R relaysms: data chmod -R 750 dataIf
.envmoves any of these paths out ofdata/(SQLITE_DATABASE_PATH,CELERY_BROKER_DB_PATH,CELERY_RESULT_DB_PATH,CELERY_BEAT_SCHEDULE_PATHand the fourPLATFORMS_ADAPTERS_*directories), create its parent directory and add it toRW_PATHSin step 9. Everything else is read-only to the services.For MySQL, PostgreSQL or RabbitMQ, run its setup script now (Database, Celery broker).
-
Check the configuration and apply the database migrations, as the service user:
sudo -u relaysms venv/bin/python -m publisher config check sudo -u relaysms venv/bin/python -m alembic upgrade head -
Install and start the systemd units.
RW_PATHSlists the directories the services may write to:RW_PATHS="$(pwd)/data" for unit in deploy/systemd/*; do sed -e "s|/opt/relaysms/relaysms-publisher|$(pwd)|g" \ -e "s|__RW_PATHS__|$RW_PATHS|" \ "$unit" > "/etc/systemd/system/$(basename "$unit")" done systemctl daemon-reload systemctl enable --now relaysms-publisher.target
Next steps
Set up nginx and TLS, then continue with After installing.