From 948ed7ef4b92f9c76bdc119790c404f6a01c9aba Mon Sep 17 00:00:00 2001 From: "Adam T. Carpenter" Date: Fri, 29 Jan 2021 14:38:05 -0500 Subject: init --- Bastillefile | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 Bastillefile (limited to 'Bastillefile') 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 -- cgit v1.2.3