add support for multi postgrest instances

fro/pi3#59
This commit is contained in:
fro
2025-12-29 15:15:35 -05:00
parent 93b48d8b98
commit 84236528c4
4 changed files with 31 additions and 7 deletions

View File

@@ -2,3 +2,4 @@ db-uri = "postgresql://[USERNAME]:[PASSWORD]@[HOST_CONNECTION_STRING]"
db-schemas = "www"
db-anon-role = "anonymous"
#jwt-secret = "myownlittlecleansecret"
server-port = 3000

View File

@@ -1,11 +1,11 @@
[Unit]
Description=PostgREST
Description=PostgREST BM
After=network.target
[Service]
User=postgrest
Group=postgrest
ExecStart=/usr/local/bin/postgrest /etc/postgrest/config
ExecStart=/usr/local/bin/postgrest /etc/postgrest/config_bm
ExecReload=/bin/kill -SIGUSR1 $MAINPID
[Install]

View File

@@ -0,0 +1,12 @@
[Unit]
Description=PostgREST FWD
After=network.target
[Service]
User=postgrest
Group=postgrest
ExecStart=/usr/local/bin/postgrest /etc/postgrest/config_fwd
ExecReload=/bin/kill -SIGUSR1 $MAINPID
[Install]
WantedBy=multi-user.target

View File

@@ -10,11 +10,22 @@ then
useradd -M -U -d /nonexistent -s /usr/sbin/nologin postgrest
cd /tmp
wget -O postgrest.service https://gi.op.fo/fro/srv-pub/raw/branch/trunk/cfg/pgr/postgrest.service
cp postgrest.service /etc/systemd/system/
systemctl enable postgrest
systemctl start postgrest
systemctl status postgrest
# fwd service
wget -O postgrest.service https://gi.op.fo/fro/srv-pub/raw/branch/trunk/cfg/pgr/postgrest_fwd.service
cp postgrest_fwd.service /etc/systemd/system/
systemctl enable postgrest_fwd
systemctl start postgrest_fwd
systemctl status postgrest_fwd
# boquete marketplace service
#wget -O postgrest.service https://gi.op.fo/fro/srv-pub/raw/branch/trunk/cfg/pgr/postgrest_bm.service
#cp postgrest_bm.service /etc/systemd/system/
#systemctl enable postgrest_bm
#systemctl start postgrest_bm
#systemctl status postgrest_bm
fi