Compare commits

..

No commits in common. "3ef119c54949e2dfc336df18efcec9f50f97065d" and "8ed6987a294414bbd8c8be0084697e2e5a1e6bcb" have entirely different histories.

View file

@ -23,30 +23,30 @@ I am going to pretend i did this in the right order. We first setup the SSD, so
### Set up the SSD.
Create mount directory:
`sudo mkdir /media/ssd `
> sudo mkdir /media/ssd
Test mount.
`sudo mount /dev/sda1 /media/ssd`
Test mount
> sudo mount /dev/sda1 /media/ssd
If it works add it to fstab
To get uuid
`lsblk -f`
> lsblk -f
Edit /etc/fstab and add:
`UUID=<uuid> /media/ssd ext4 defaults,no-fail 0 2`
/etc/fstab
UUID=<uuid> /media/ssd ext4 defaults,no-fail 0 2
No-fail so the raspi boot even if the disk unplugged.
No-fail so the raspi boot even if the disk unplugged
### Then install Forgejo
Following: https://pimylifeup.com/raspberry-pi-forgejo/
Install docker with:
`curl -sSL https://get.docker.com | sh`
> curl -sSL https://get.docker.com | sh
Create user (in current user group)
`sudo usermod -aG docker $USER`
> sudo usermod -aG docker $USER
Logout
> logout
@ -55,16 +55,15 @@ Check if the group exist
> groups
test:
`docker run hello-world`
> docker run hello-world
Docker should now be set up.
Create a directory for the installation:
```bash
sudo mkdir -p /opt/stacks/forgejo
cd /opt/stacks/forgejo
nano compose.yaml
```
> sudo mkdir -p /opt/stacks/forgejo
> cd /opt/stacks/forgejo
> nano compose.yaml
```yaml
services:
@ -110,27 +109,25 @@ networks:
external: false
```
`docker compose up -d`
> docker compose up -d
It should now be accessible at <ip>:3000
Now we have to set up tinc proxying, but in this case it was already setup for another service. So only nginx config on the tinc edge node and creating a certificate.
` sudo certbot --nginx -d git.hackersanddesigners.nl`
> sudo certbot --nginx -d git.hackersanddesigners.nl
And configure nginx in /etc/nginx/sites-available/forgejo.conf:
Set the newly created domain in the Forgejo config with:
` nano /media/ssd/forgejo/gitea/conf/app.ini`
> nano /media/ssd/forgejo/gitea/conf/app.ini
And change the domains:
```
ROOT_URL = https://git.hackersanddesigners.nl
DOMAIN = git.hackersanddesigners.nl
```
And restart the service
` docker compose restart`
> docker compose restart
We shoudl now have a running instance of Forgejo
@ -140,7 +137,7 @@ We shoudl now have a running instance of Forgejo
Setup web hooks like this: https://www.shawenyao.com/Voice-Controlled-Raspberry-Pi/
` sudo apt install webhook`
> sudo apt install webhook
configure
> sudo nano /etc/webhook.conf
@ -157,7 +154,7 @@ configure
```
Create the shell script
` sudo nano /usr/local/bin/deploy-git-site.sh`
> sudo nano /usr/local/bin/deploy-git-site.sh
```sh
#!/usr/bin/env bash
@ -168,10 +165,10 @@ git pull --ff-only
```
Make it executable
` sudo chmod +x /usr/local/bin/deploy-braids.py`
> sudo chmod +x /usr/local/bin/deploy-braids.py
Edit the web hook:
` sudo systemctl edit webhook`
> sudo systemctl edit webhook
Add:
```
[Service]
@ -179,21 +176,21 @@ ExecStart=
ExecStart=/usr/bin/webhook -hooks /etc/webhook.conf -ip 0.0.0.0 -port 9010 -verbose
```
` sudo systemctl daemon-reload`
` sudo systemctl enable --now webhook`
` sudo systemctl restart webhook`
> sudo systemctl daemon-reload
> sudo systemctl enable --now webhook
> sudo systemctl restart webhook
Check for errors:
` sudo systemctl status webhook --no-pager`
> sudo systemctl status webhook --no-pager
Allow the webhook to connect to localhost, add to compose.yaml
` - FORGEJO__WEBHOOK__ALLOWED_HOST_LIST=private,loopback`
> - FORGEJO__WEBHOOK__ALLOWED_HOST_LIST=private,loopback
We have to call the webhook on the IP of the docker host. Get it with:
` ip -4 addr show docker0`
> ip -4 addr show docker0
Gave:
```