cerca

lean forum software (pmc local branch)
Log | Files | Refs | README | LICENSE

commit 7c6cc98cc5a2d1c0dd10dbb32b67af51e513293b
parent 1f4d8ff974ed2314293e5bdc051bfa9f17031c0e
Author: decentral1se <cellarspoon@riseup.net>
Date:   Tue, 10 Sep 2024 12:04:28 +0200

docs: first run at hosting docs

Diffstat:
Adocs/hosting.md | 66++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 66 insertions(+), 0 deletions(-)

diff --git a/docs/hosting.md b/docs/hosting.md @@ -0,0 +1,66 @@ +# Hosting + +## System user + +You can use a system user with no login: + +``` +useradd -r cerca +usermod -s /bin/false cerca +``` + +## Nginx configuration + +``` +server { + listen 80; + listen 443 ssl; + + server_name <your-domain>; + + location / { + proxy_set_header X-Real-IP $remote_addr; + proxy_pass http://127.0.0.1:8272; + } + + # NOTE: only required if running cerca via a standalone binary + # vs. a git clone where it will have access to the assets dir + location /assets/ { + root <path-to-your-cerca-assets-dir>; + } +} +``` + +## Systemd unit file + +This can be placed at `/etc/systemd/system/cerca.service`: + +``` +[Unit] +Description=cerca +After=syslog.target network.target + +[Service] +User=cerca +ExecStart=<path-to-cerca-binary> -config <path-to-cerca.toml> -authkey "<...>" -allowlist <path-to-allowlist.txt> -data <path-to-data-dir> +RemainAfterExit=no +Restart=always +RestartSec=5 + +[Install] +WantedBy=multi-user.target +``` + +Then you need to: + +``` +systemctl daemon-reload +systemctl start cerca +systemctl enable cerca +``` + +To tail logs: + +``` +journalctl -fu cerca +```