changed how the api is installed
This commit is contained in:
parent
a3f1348b6e
commit
b6ef7be08f
17
README.md
17
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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user