Files
dotfiles/scripts/arch/server-gitea.sh
2026-09-02 23:33:20 -04:00

40 lines
1.1 KiB
Bash

#!/bin/bash
# ==============================================================================
# Auth: alex
# File: server-gitea.sh
# Revn: 09-02-2026 0.0.1
# Func: configure gitea as much as possible automatically
#
# TODO: write
# comment
# test
# ==============================================================================
# CHANGE LOG
# ------------------------------------------------------------------------------
# 09-02-2026: init
#
# ==============================================================================
# assumed to run as sudo
server-gitea() {
# initialize port arg with default port
PORT=3000
# if arg was given
if [[ $# -gt 0 ]]; then
PORT=$1 # change port
# change service file to include new port
sed -i -e "s/web/web -p $PORT/" /usr/lib/systemd/system/gitea.service
systemctl daemon-reload # reload systemctl with new port
fi
systemctl start gitea # start gitea
# get status and store logs
systemctl status gitea >> dotfiles/scripts/arch/server-gitea.log
# let gitea through firewall
ufw allow in on wlan0 from any to any port $PORT
}