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:
@@ -1,10 +0,0 @@
|
||||
[Gitea]
|
||||
site=http://localhost:3000/api/v1/version
|
||||
apiUrl=https://api.github.com/repos/go-gitea/gitea/releases/latest
|
||||
system=linux-amd64
|
||||
file=/usr/local/bin/gitea
|
||||
tmpDir=/tmp/
|
||||
buildFromSource=
|
||||
sourceDir=
|
||||
logFile=/var/log/gitupdate.log
|
||||
|
||||
@@ -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
|
||||
@@ -1,3 +1,3 @@
|
||||
#!/bin/sh
|
||||
# Update script for updating apps with ProxmoxHelper/ProxMoxToolKit
|
||||
ash /opt/UpdateGitea.sh
|
||||
ash /opt/Update-Gitea.sh
|
||||
27
CT-Files/gitea/Scripts/Update-Gitea.sh
Normal file
27
CT-Files/gitea/Scripts/Update-Gitea.sh
Normal file
@@ -0,0 +1,27 @@
|
||||
#!/bin/ash
|
||||
#Check if Gitea is running
|
||||
case $(service gitea status) in
|
||||
*started*);;
|
||||
*)
|
||||
echo "Gitea is not running, exiting"
|
||||
exit ;;
|
||||
esac
|
||||
|
||||
#Check internet connection
|
||||
if ! ping -c 2 api.github.com &> /dev/null; then echo "No internet connection detected, exiting";exit ;fi
|
||||
|
||||
#Get latest vesion
|
||||
NewGiteaVer=$(curl --retry 7 --retry-delay 5 -Ls https://api.github.com/repos/go-gitea/gitea/releases/latest |jq -r .tag_name)
|
||||
CurGiteaVer=$(curl --retry 7 --retry-delay 5 -Ls http://localhost:3000/api/v1/version |jq -r .version)
|
||||
#Compare versions to check for update
|
||||
if [ "$NewGiteaVer" = "$CurGiteaVer" ] ; then
|
||||
echo 'Gitea up-to-date'
|
||||
exit
|
||||
else
|
||||
echo 'Updating Gitea'
|
||||
service gitea stop
|
||||
mv /usr/local/bin/gitea /usr/local/bin/gitea.old
|
||||
curl --retry 7 --retry-delay 5 -L https://dl.gitea.io/gitea/"${NewGiteaVer//v}"/gitea-"${NewGiteaVer//v}"-linux-amd64 -o /usr/local/bin/gitea
|
||||
chmod +x /usr/local/bin/gitea
|
||||
service gitea start
|
||||
fi
|
||||
@@ -11,6 +11,7 @@ npm install --prefix /opt/node/node-red/app node-red @node-red-contrib-themes/th
|
||||
pm2 install pm2-logrotate
|
||||
pm2 start --name nodered --cwd /opt/node/node-red/app ./node_modules/node-red/red.js -- -u /opt/node/node-red/data
|
||||
pm2 save
|
||||
sleep 5
|
||||
pm2 kill
|
||||
#Enable node-red dark theme
|
||||
sed -i -e 's#//theme: "",#theme: "midnight-red",#g' /opt/node/node-red/data/settings.js
|
||||
|
||||
Reference in New Issue
Block a user