]> git.mxchange.org Git - fba.git/commitdiff
changed how the api is installed
authorEnju Aihara <9839590-EnjuAihara@users.noreply.gitlab.com>
Thu, 31 Mar 2022 17:31:34 +0000 (19:31 +0200)
committerEnju Aihara <9839590-EnjuAihara@users.noreply.gitlab.com>
Thu, 31 Mar 2022 17:31:34 +0000 (19:31 +0200)
README.md
services/fedi_block_api.service
services/fetch_blocks.service

index 117589c91946b853ad4514dbf37654f4618256ae..12efbcf031056536055728a4beabd19536f4cd73 100644 (file)
--- a/README.md
+++ b/README.md
@@ -10,16 +10,17 @@ Used to see which instances block yours.
 
 ## Installation
 
-### Copy the preloaded database to the live database
-
 ```bash
-cp blocks_preloaded.db blocks.db
+sudo useradd -m fba
+sudo mkdir -p /opt/fedi-block-api
+sudo chown -R fba:fba /opt/fedi-block-api
+sudo -Hu fba git clone https://gitlab.com/EnjuAihara/fedi-block-api.git /opt/fedi-block-api
+cd /opt/fedi-block-api
+sudo -Hu fba cp blocks_preloaded.db blocks.db
 ```
 
 ### Install the services
 
-Make sure to edit the `User` and `WorkingDirectory` in each service file accordingly.
-
 ```bash
 sudo cp services/* /etc/systemd/system
 ```
@@ -28,14 +29,14 @@ sudo cp services/* /etc/systemd/system
 
 ```bash
 cd apis
-yarn install
+sudo -Hu fba yarn install
 ```
 
 ### start the services
 
 ```bash
-systemctl start fetch_blocks
-systemctl start fedi_block_api
+systemctl enable --now fetch_blocks
+systemctl enable --now fedi_block_api
 ```
 
 ## Try it out
index 51f7407d6ae853f6d9ee1bac1a93218ccf385eb8..7b62676423e7a55a89153a6d5a5d1ad5e0122a10 100644 (file)
@@ -3,8 +3,11 @@ Description=Fedi block API
 
 [Service]
 Type=simple
-Restart=always
-RestartSec=1
-User=
-WorkingDirectory=/fedi-block-api/apis
+Restart=on-failure
+RestartSec=10
+User=fba
+WorkingDirectory=/opt/fedi-block-api/apis
 ExecStart=node fedi_block_api.js
+
+[Install]
+WantedBy=multi-user.target
index cca342d1e8214e5d09e1c2d922bb1c6a93b986b2..d5230f952624d142b0846eb826e9993961241643 100644 (file)
@@ -4,7 +4,10 @@ Description=Fetch blocks
 [Service]
 Type=simple
 Restart=always
-RestartSec=86400
-User=
-WorkingDirectory=/fedi-block-api
-ExecStart=python3 fetch_blocks.py 
+RestartSec=604800
+User=fba
+WorkingDirectory=/opt/fedi-block-api
+ExecStart=python3 fetch_blocks.py
+
+[Install]
+WantedBy=multi-user.target