summaryrefslogtreecommitdiff
path: root/Bastillefile
diff options
context:
space:
mode:
authorAdam T. Carpenter <atc@53hor.net>2021-01-29 14:38:05 -0500
committerAdam T. Carpenter <atc@53hor.net>2021-01-29 14:38:05 -0500
commit948ed7ef4b92f9c76bdc119790c404f6a01c9aba (patch)
tree2829d55882d15e5864a7f382822726cfece14b85 /Bastillefile
downloadgitea-948ed7ef4b92f9c76bdc119790c404f6a01c9aba.tar.xz
gitea-948ed7ef4b92f9c76bdc119790c404f6a01c9aba.zip
init
Diffstat (limited to 'Bastillefile')
-rw-r--r--Bastillefile26
1 files changed, 26 insertions, 0 deletions
diff --git a/Bastillefile b/Bastillefile
new file mode 100644
index 0000000..9de5654
--- /dev/null
+++ b/Bastillefile
@@ -0,0 +1,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