Fixed CT's NodeRed (Missing setting) and Gitea (Broken updater)

CT NodeRed: Fixed missing config file by adding 5sec wait time before ending pm2 on setup to generate it
CT Gitea: moved from `gitea-auto-update`  from to an basic sh script since it is broken on AlpineLinux
This commit is contained in:
2025-01-10 19:30:45 +01:00
parent bb07d31c83
commit a647ab711b
6 changed files with 35 additions and 28 deletions

View File

@@ -1,12 +1,6 @@
#!/bin/ash
#Vars
apiUrl=https://api.github.com/repos/go-gitea/gitea/releases/latest
#install Update tool
pip install --break-system-packages gitea-auto-update
#Get latest gitea version info
giteaver=$(python3 -c "import requests; print (requests.get('$apiUrl').json()['tag_name'])")
giteaver=$(curl --retry 7 --retry-delay 5 -Ls https://api.github.com/repos/go-gitea/gitea/releases/latest |jq -r .tag_name)
giteaver=${giteaver//v}
@@ -23,12 +17,12 @@ mkdir -p /etc/gitea
#Download Gitea binary
echo "Downloading gitea binary..."
python3 -c "import requests; url = 'https://dl.gitea.io/gitea/"$giteaver"/gitea-"$giteaver"-linux-amd64'; r = requests.get(url, allow_redirects=True); open('/usr/local/bin/gitea', 'wb').write(r.content)"
curl --retry 7 --retry-delay 5 -L https://dl.gitea.io/gitea/"$giteaver"/gitea-"$giteaver"-linux-amd64 -O /usr/local/bin/gitea
#Moving configs in place
mv /opt/Setup/Configs/app.ini /etc/gitea/app.ini
mv /opt/Setup/Configs/auto-update.ini /etc/gitea/auto-update.ini
mv /opt/Setup/Configs/gitea.service /etc/init.d/gitea
mv /opt/Setup/Scripts/Update-Gitea.sh /opt/Update-Gitea.sh
#Set folder permissions
chown -R git:git /gitea-data
@@ -39,10 +33,4 @@ chmod -R 750 /var/lib/gitea/
chmod +x /usr/local/bin/gitea
chmod +x /etc/init.d/gitea
chmod 750 /etc/gitea
chmod 640 /etc/gitea/app.ini
#Fix Gitea-auto-updater to support OpenRC
sed -i -e 's/systemctl start gitea.service/service gitea start/' -e 's/systemctl stop gitea.service/service gitea stop/' /usr/lib/python3.*/site-packages/gitea_auto_update/update.py
#Gitea update Sript
echo "gitea-auto-update --settings=/etc/gitea/auto-update.ini" > /opt/UpdateGitea.sh
chmod 640 /etc/gitea/app.ini