added automatic Key Generation for Empty .env Keys

This commit is contained in:
2025-12-03 20:38:40 +01:00
parent 61d94a264f
commit 14b3eb4559
9 changed files with 106 additions and 329 deletions

35
bin/setup_gitea.sh Executable file
View File

@@ -0,0 +1,35 @@
# clone the repository
git clone https://git.nxs.solutions/Fast/gitea.git lib
# ask the user for the location where to setup Fast
read -p "Enter the full path where you want to set up Fast (e.g., /opt/gitea): " GITEA_PATH
# if the user input is empty, use /opt/fast as default
if [ -z "$GITEA_PATH" ]; then
GITEA_PATH="/opt/gitea"
fi
# create the directory if it doesn't exist
sudo mkdir -p "$GITEA_PATH"
sudo cp -r lib/* $GITEA_PATH
sudo rm -r lib
sudo chown -R $USER:root $GITEA_PATH
echo "Gitea has been set up at $GITEA_PATH"
# write GITEA_PATH to fast .env
source $USER/.bashrc
if [ -z "$FAST_PATH" ]; then
echo "FAST_PATH is not set. Please run setup_fast.sh first."
exit 1
else
echo "GITEA_PATH=$GITEA_PATH" >> $FAST_PATH/.env
fi
cd $GITEA_PATH
./setup.sh
echo "Gitea setup script completed."