Servicio de SystemD

This commit is contained in:
rené montes
2020-06-12 10:51:06 -03:00
parent 7cad9d9d09
commit fad77d530e
3 changed files with 46 additions and 1 deletions

View File

@ -1,3 +1,19 @@
# Opciones
PORT ?= 3001
BIND ?= 127.0.0.1
RUN ?= nobody
# Hacer que las opciones estén disponibles
export
rap-inbox: shard.lock src/rap-inbox.cr
crystal build --release $^
strip --strip-all $@
service := /etc/systemd/system/rap-inbox.service
$(service): contrib/rap-inbox.service.in
test -w $(dir $@)
envsubst < $< > $@
systemctl daemon-reload
service: $(service)

View File

@ -2,7 +2,7 @@
Recibe archivos de hosts de tinc para la red autónoma pirata.
## Instalación
## Compilación
Instalar Crystal 0.35 o posterior.
@ -10,6 +10,24 @@ Instalar Crystal 0.35 o posterior.
make rap-inbox
```
## Instalación
Clonar este repositorio en un directorio que pueda ser escrito por
`nobody` o algún usuario del sistema sin otros privilegios.
```bash
git clone https://0xacab.org/pip/rap-inbox /srv/http/rap.partidopirata.com.ar
chown -R nobody:nobody /srv/http/rap.partidopirata.com.ar
```
Luego instalar y habilitar el servicio:
```
cd /srv/http/rap.partidopirata.com.ar
make service
systemctl enable --now rap-inbox.service
```
## Uso
RAP Inbox está pensadx para alojarse en un nodo público de la RAP, de

View File

@ -0,0 +1,11 @@
[Unit]
Description=RAP Inbox
After=network.target
[Service]
Environment=KEMAL_ENV=production
Type=simple
User=${RUN}
WorkingDirectory=${PWD}
ExecStart=${PWD}/rap-inbox -b ${BIND} -p ${PORT}
Restart=on-failure