summaryrefslogtreecommitdiff
path: root/Bastillefile
blob: 9de56546f5e23407441c7c1a0d955563697fd2cd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Simple Gitea installation for the Macon

# Overlay usr/local/etc/gitea/conf/app.ini, which configures Gitea
OVERLAY usr

# Prepare a mount point and mount the host's gitea data. This is the user
# database and git repositories.
CMD mkdir -p /var/db/gitea && echo Created dir /var/db/gitea
CMD mkdir -p /var/git && echo Created dir /var/git
FSTAB /zroot/gitea /var/db/gitea nullfs rw 0 0
FSTAB /zroot/git /var/git nullfs rw 0 0

# Create a git user for Gitea. *Must* be the same UID that owns the data mount.
CMD pw useradd -n git -m -u 210 && echo Created user "git"

# Install Gitea
PKG gitea

# Generate all secrets Gitea needs to run and insert them into the config file.
CMD sed -i .bak "s/^JWT_SECRET.*=.*$/JWT_SECRET = $(gitea generate secret JWT_SECRET)/g" /usr/local/etc/gitea/conf/app.ini
CMD sed -i .bak "s/^INTERNAL_TOKEN.*=.*$/INTERNAL_TOKEN = $(gitea generate secret INTERNAL_TOKEN)/g" /usr/local/etc/gitea/conf/app.ini
CMD sed -i .bak "s/^SECRET_KEY.*=.*$/SECRET_KEY = $(gitea generate secret SECRET_KEY)/g" /usr/local/etc/gitea/conf/app.ini

# Enable and start Gitea on 127.0.0.1:3000
SYSRC gitea_enable=YES
SERVICE gitea start