Compare commits

...

2 commits

Author SHA1 Message Date
my 3ef119c549 Merge branch 'main' of https://git.hackersanddesigners.nl/hrk/Braids-docs 2026-01-16 15:53:52 +01:00
my 4891579ebf code blocks 2026-01-16 15:51:54 +01:00

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`
/etc/fstab
UUID=<uuid> /media/ssd ext4 defaults,no-fail 0 2
Edit /etc/fstab and add:
`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,15 +55,16 @@ 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:
> sudo mkdir -p /opt/stacks/forgejo
> cd /opt/stacks/forgejo
> nano compose.yaml
```bash
sudo mkdir -p /opt/stacks/forgejo
cd /opt/stacks/forgejo
nano compose.yaml
```
```yaml
services:
@ -109,25 +110,27 @@ 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
@ -137,7 +140,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
@ -154,7 +157,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
@ -165,10 +168,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]
@ -176,21 +179,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:
```