hosting.md (1073B)
1 # Hosting 2 3 ## System user 4 5 You can use a system user with no login: 6 7 ``` 8 useradd -r cerca 9 usermod -s /bin/false cerca 10 ``` 11 12 ## Nginx configuration 13 14 ``` 15 server { 16 listen 80; 17 listen 443 ssl; 18 19 server_name <your-domain>; 20 21 location / { 22 proxy_set_header X-Real-IP $remote_addr; 23 proxy_pass http://127.0.0.1:8272; 24 } 25 26 # NOTE: only required if running cerca via a standalone binary 27 # vs. a git clone where it will have access to the assets dir 28 location /assets/ { 29 root <path-to-your-cerca-assets-dir>; 30 } 31 } 32 ``` 33 34 ## Systemd unit file 35 36 This can be placed at `/etc/systemd/system/cerca.service`: 37 38 ``` 39 [Unit] 40 Description=cerca 41 After=syslog.target network.target 42 43 [Service] 44 User=cerca 45 ExecStart=<path-to-cerca-binary> -config <path-to-cerca.toml> -authkey "<...>" -allowlist <path-to-allowlist.txt> -data <path-to-data-dir> 46 RemainAfterExit=no 47 Restart=always 48 RestartSec=5 49 50 [Install] 51 WantedBy=multi-user.target 52 ``` 53 54 Then you need to: 55 56 ``` 57 systemctl daemon-reload 58 systemctl start cerca 59 systemctl enable cerca 60 ``` 61 62 To tail logs: 63 64 ``` 65 journalctl -fu cerca 66 ```