Compare commits

...

2 commits

4 changed files with 56 additions and 44 deletions

View file

@ -1,5 +1,5 @@
# Setup caddy config # Setup caddy config
mkdir /etc/caddy mkdir -p /etc/caddy
cp -R ./caddy/* /etc/caddy cp -R ./caddy/* /etc/caddy
# Setup caddy service # Setup caddy service

View file

@ -1,9 +1,12 @@
# Check if already installed
if [[ $(which caddy) != "/usr/bin/caddy" ]]; then
# Install prerequistes # Install prerequistes
nala install -y debian-keyring debian-archive-keyring apt-transport-https curl nala install -y debian-keyring debian-archive-keyring apt-transport-https curl
# Install sources and keys # Install sources and keys
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
fi
# Install caddy # Install or upgrade caddy
nala install -y caddy nala install -y caddy

View file

@ -1,6 +1,8 @@
# Get latest forgejo tag # Get latest forgejo tag
LATEST=curl -fsS https://codeberg.org/forgejo/forgejo/releases/latest | grep -o "[0-9].[0-9].[0-9]" LATEST=curl -fsS https://codeberg.org/forgejo/forgejo/releases/latest | grep -o "[0-9].[0-9].[0-9]" | head -1
# Check if already installed
if [[ $(forgejo -v 2> /dev/null | grep -o "[0-9].[0-9].[0-9]" | head -1) != $LATEST ]]; then
# Download forgejo # Download forgejo
wget "https://codeberg.org/forgejo/forgejo/releases/download/$LATEST/forgejo-$LATEST-linux-amd64" wget "https://codeberg.org/forgejo/forgejo/releases/download/$LATEST/forgejo-$LATEST-linux-amd64"
chmod +x "forgejo-$LATEST-linux-amd64" chmod +x "forgejo-$LATEST-linux-amd64"
@ -23,13 +25,14 @@ useradd --system \
# Setup forgejo directories # Setup forgejo directories
mv "forgejo-$LATEST-linux-amd64" /usr/local/bin/forgejo mv "forgejo-$LATEST-linux-amd64" /usr/local/bin/forgejo
fi
## Working directory ## Working directory
mkdir /var/lib/forgejo mkdir -p /var/lib/forgejo
chown forgejo:forgejo /var/lib/forgejo && chmod 750 /var/lib/forgejo chown forgejo:forgejo /var/lib/forgejo && chmod 750 /var/lib/forgejo
## Config directory ## Config directory
mkdir /etc/forgejo mkdir -p /etc/forgejo
chown root:forgejo /etc/forgejo && chmod 540 /etc/forgejo chown root:forgejo /etc/forgejo && chmod 540 /etc/forgejo
# Check requirements # Check requirements

View file

@ -1,3 +1,8 @@
# Check if already installed
if [[ $(which deno) == "/usr/local/bin/deno" ]]; then
# Upgrade deno
deno upgrade
else
# Install deno # Install deno
curl -fsSL https://deno.land/install.sh | DENO_INSTALL=/usr/local sh curl -fsSL https://deno.land/install.sh | DENO_INSTALL=/usr/local sh
@ -11,6 +16,7 @@ useradd --system \
--shell /usr/sbin/nologin \ --shell /usr/sbin/nologin \
--comment "Deno js engine" \ --comment "Deno js engine" \
deno deno
fi
# Clone website repo # Clone website repo
mkdir -p /srv/www mkdir -p /srv/www