Merge Dev to Main (Alpine 1.21 update) #5
2
.gitignore
vendored
2
.gitignore
vendored
@@ -3,6 +3,8 @@
|
|||||||
*.tar
|
*.tar
|
||||||
*.zip
|
*.zip
|
||||||
*.sh.kate-swp
|
*.sh.kate-swp
|
||||||
|
*.squashfs
|
||||||
|
*.qcow2
|
||||||
/distrobuilder
|
/distrobuilder
|
||||||
/bin
|
/bin
|
||||||
CT-Files/nginx/nginx_signing.rsa.pub
|
CT-Files/nginx/nginx_signing.rsa.pub
|
||||||
|
|||||||
10
.vscode/tasks.json
vendored
10
.vscode/tasks.json
vendored
@@ -14,6 +14,16 @@
|
|||||||
"isDefault": true
|
"isDefault": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
/* {
|
||||||
|
"label": "BuildVM",
|
||||||
|
"type": "shell",
|
||||||
|
"command": " export XZ_DEFAULTS='-T 0'; sudo ./distrobuilder build-incus CT-Build/${input:Distro}.yaml -o image.variant=${input:BuildVariant} --vm;sudo chown $SUDO_USER:$SUDO_USER -R *.tar.xz disk.qcow2 ;rm -f incus.tar.xz; mv -f disk.qcow2 bin/${input:Distro}-${input:BuildVariant}.qcow2",
|
||||||
|
"problemMatcher": [],
|
||||||
|
"group": {
|
||||||
|
"kind": "build",
|
||||||
|
"isDefault": true
|
||||||
|
}
|
||||||
|
},*/
|
||||||
{
|
{
|
||||||
"label": "SetupImgBuilder",
|
"label": "SetupImgBuilder",
|
||||||
"type": "shell",
|
"type": "shell",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
image:
|
image:
|
||||||
distribution: "alpinelinux"
|
distribution: "alpinelinux"
|
||||||
release: "3.20"
|
release: "3.21"
|
||||||
|
|
||||||
source:
|
source:
|
||||||
downloader: alpinelinux-http
|
downloader: alpinelinux-http
|
||||||
@@ -275,7 +275,6 @@ files:
|
|||||||
To setup this container run the FirstRun script `/opt/Setup/Scripts/FirstRun.sh`
|
To setup this container run the FirstRun script `/opt/Setup/Scripts/FirstRun.sh`
|
||||||
variants:
|
variants:
|
||||||
- nginx
|
- nginx
|
||||||
- heimdall
|
|
||||||
|
|
||||||
#PHP SetupScript
|
#PHP SetupScript
|
||||||
- path: /opt/Setup/Scripts/PHPTool.sh
|
- path: /opt/Setup/Scripts/PHPTool.sh
|
||||||
@@ -433,7 +432,8 @@ packages:
|
|||||||
|
|
||||||
#PKGS for Gitea
|
#PKGS for Gitea
|
||||||
- packages:
|
- packages:
|
||||||
- py3-pip
|
- curl
|
||||||
|
- jq
|
||||||
- xz
|
- xz
|
||||||
- git
|
- git
|
||||||
- bash
|
- bash
|
||||||
@@ -452,7 +452,7 @@ packages:
|
|||||||
#PKGS for Transfersh
|
#PKGS for Transfersh
|
||||||
- packages:
|
- packages:
|
||||||
- curl
|
- curl
|
||||||
- git
|
- jq
|
||||||
action: install
|
action: install
|
||||||
variants:
|
variants:
|
||||||
- transfersh
|
- transfersh
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
27,57 * * * * php83 /opt/freshrss/app/actualize_script.php 2>> /proc/1/fd/2 > /tmp/FreshRSS.log
|
27,57 * * * * phpPHPver /opt/freshrss/app/actualize_script.php 2>> /proc/1/fd/2 > /tmp/FreshRSS.log
|
||||||
@@ -1 +1 @@
|
|||||||
php83 php83-fpm php83-curl php83-gmp php83-intl php83-mbstring php83-xml php83-zip php83-ctype php83-dom php83-fileinfo php83-iconv php83-json php83-opcache php83-openssl php83-phar php83-session php83-simplexml php83-xmlreader php83-xmlwriter php83-xml php83-tokenizer php83-zlib php83-pdo_mysql
|
phpPHPver phpPHPver-fpm phpPHPver-curl phpPHPver-gmp phpPHPver-intl phpPHPver-mbstring phpPHPver-xml phpPHPver-zip phpPHPver-ctype phpPHPver-dom phpPHPver-fileinfo phpPHPver-iconv phpPHPver-json phpPHPver-opcache phpPHPver-openssl phpPHPver-phar phpPHPver-session phpPHPver-simplexml phpPHPver-xmlreader phpPHPver-xmlwriter phpPHPver-xml phpPHPver-tokenizer phpPHPver-zlib phpPHPver-pdo_mysql
|
||||||
@@ -8,9 +8,6 @@ mv /opt/Setup/Configs/nginx.conf /etc/nginx/nginx.conf
|
|||||||
ash /opt/Setup/Scripts/PHPTool.sh -d freshrss || exit 1
|
ash /opt/Setup/Scripts/PHPTool.sh -d freshrss || exit 1
|
||||||
rm /opt/Setup/Scripts/PHPTool.sh
|
rm /opt/Setup/Scripts/PHPTool.sh
|
||||||
|
|
||||||
#Configure Cron
|
|
||||||
mv /opt/Setup/Configs/crontab /etc/crontabs/nginx
|
|
||||||
|
|
||||||
#Install freshrss
|
#Install freshrss
|
||||||
mkdir -p /opt/freshrss
|
mkdir -p /opt/freshrss
|
||||||
wget https://github.com/FreshRSS/FreshRSS/tarball/latest -O /tmp/freshrss.tar.gz
|
wget https://github.com/FreshRSS/FreshRSS/tarball/latest -O /tmp/freshrss.tar.gz
|
||||||
|
|||||||
@@ -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
|
#!/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
|
#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}
|
giteaver=${giteaver//v}
|
||||||
|
|
||||||
|
|
||||||
@@ -23,12 +17,12 @@ mkdir -p /etc/gitea
|
|||||||
|
|
||||||
#Download Gitea binary
|
#Download Gitea binary
|
||||||
echo "Downloading 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 || exit 1
|
||||||
|
|
||||||
#Moving configs in place
|
#Moving configs in place
|
||||||
mv /opt/Setup/Configs/app.ini /etc/gitea/app.ini
|
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/Configs/gitea.service /etc/init.d/gitea
|
||||||
|
mv /opt/Setup/Scripts/Update-Gitea.sh /opt/Update-Gitea.sh
|
||||||
|
|
||||||
#Set folder permissions
|
#Set folder permissions
|
||||||
chown -R git:git /gitea-data
|
chown -R git:git /gitea-data
|
||||||
@@ -39,10 +33,4 @@ chmod -R 750 /var/lib/gitea/
|
|||||||
chmod +x /usr/local/bin/gitea
|
chmod +x /usr/local/bin/gitea
|
||||||
chmod +x /etc/init.d/gitea
|
chmod +x /etc/init.d/gitea
|
||||||
chmod 750 /etc/gitea
|
chmod 750 /etc/gitea
|
||||||
chmod 640 /etc/gitea/app.ini
|
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
|
|
||||||
@@ -1,3 +1,3 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# Update script for updating apps with ProxmoxHelper/ProxMoxToolKit
|
# 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
|
||||||
@@ -1 +1 @@
|
|||||||
php83 php83-ctype php83-curl php83-pdo_sqlite php83-mbstring php83-json php83-zip php83-xml php83-fpm php83-session php83-openssl php83-tokenizer php83-fileinfo php83-dom
|
phpPHPver phpPHPver-ctype phpPHPver-curl phpPHPver-pdo_sqlite phpPHPver-mbstring phpPHPver-json phpPHPver-zip phpPHPver-xml phpPHPver-fpm phpPHPver-session phpPHPver-openssl phpPHPver-tokenizer phpPHPver-fileinfo phpPHPver-dom
|
||||||
1
CT-Files/nextcloud/Configs/crontab
Normal file
1
CT-Files/nextcloud/Configs/crontab
Normal file
@@ -0,0 +1 @@
|
|||||||
|
*/5 * * * * phpPHPver -f /opt/nextcloud/cron.php > /dev/null 2>&1
|
||||||
@@ -1 +1 @@
|
|||||||
php83-pdo_mysql php83-pecl-imagick php83-cli php83-pecl-apcu php83-pecl-redis php83-fpm php83-cgi php83-common php83-mbstring php83-curl php83-gd php83-intl php83-soap php83-xml php83-zip php83-pear php83-session php83-posix php83-pdo php83-dom php83-simplexml php83-xmlreader php83-xmlwriter php83-opcache php83-pcntl php83-fileinfo php83-bcmath php83-gmp php83-sysvsem php83-exif php83-bz2 php83-sodium php83-ctype
|
phpPHPver-pdo_mysql phpPHPver-pecl-imagick phpPHPver-cli phpPHPver-pecl-apcu phpPHPver-pecl-redis phpPHPver-fpm phpPHPver-cgi phpPHPver-common phpPHPver-mbstring phpPHPver-curl phpPHPver-gd phpPHPver-intl phpPHPver-soap phpPHPver-xml phpPHPver-zip phpPHPver-pear phpPHPver-session phpPHPver-posix phpPHPver-pdo phpPHPver-dom phpPHPver-simplexml phpPHPver-xmlreader phpPHPver-xmlwriter phpPHPver-opcache phpPHPver-pcntl phpPHPver-fileinfo phpPHPver-bcmath phpPHPver-gmp phpPHPver-sysvsem phpPHPver-exif phpPHPver-bz2 phpPHPver-sodium phpPHPver-ctype phpPHPver-phar
|
||||||
@@ -18,24 +18,28 @@ if [ $ThisScriptConfigured = no ]; then
|
|||||||
echo "Script is not configured"
|
echo "Script is not configured"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
sudo -u nginx php83 /opt/nextcloud/occ maintenance:install --database mysql --database-name "$MysqlDatabase" --database-host "$MysqlIP" --database-port "$MysqlPort" --database-user "$MysqlUsername" --database-pass "$MysqlPassword" --database-table-space "" --admin-user "$NextcloudUsername" --admin-pass "$NexcloudPassword" --data-dir /var/nextcloud
|
sudo -u nginx phpPHPver /opt/nextcloud/occ maintenance:install --database mysql --database-name "$MysqlDatabase" --database-host "$MysqlIP" --database-port "$MysqlPort" --database-user "$MysqlUsername" --database-pass "$MysqlPassword" --database-table-space "" --admin-user "$NextcloudUsername" --admin-pass "$NexcloudPassword" --data-dir /var/nextcloud
|
||||||
|
|
||||||
sed -n -i '/#SetupBlockStart/{:a;N;/#SetupBlockEnd/!ba;N;s/.*//};p' /etc/nginx/nginx.conf
|
sed -n -i '/#SetupBlockStart/{:a;N;/#SetupBlockEnd/!ba;N;s/.*//};p' /etc/nginx/nginx.conf
|
||||||
service nginx reload
|
service nginx reload
|
||||||
|
|
||||||
sudo -u nginx php83 /opt/nextcloud/occ db:convert-filecache-bigint
|
sudo -u nginx phpPHPver /opt/nextcloud/occ db:convert-filecache-bigint
|
||||||
sudo -u nginx php83 /opt/nextcloud/occ db:add-missing-indices
|
sudo -u nginx phpPHPver /opt/nextcloud/occ db:add-missing-indices
|
||||||
#sudo -u nginx php83 /opt/nextcloud/occ app:disable firstrunwizard
|
#sudo -u nginx phpPHPver /opt/nextcloud/occ app:disable firstrunwizard
|
||||||
sudo -u nginx php83 /opt/nextcloud/occ config:system:set default_language --value=nl
|
sudo -u nginx phpPHPver /opt/nextcloud/occ config:system:set default_language --value=nl
|
||||||
sudo -u nginx php83 /opt/nextcloud/occ config:system:set default_locale --value=nl
|
sudo -u nginx phpPHPver /opt/nextcloud/occ config:system:set default_locale --value=nl
|
||||||
sudo -u nginx php83 /opt/nextcloud/occ config:system:set default_phone_region --value=nl
|
sudo -u nginx phpPHPver /opt/nextcloud/occ config:system:set default_phone_region --value=nl
|
||||||
sudo -u nginx php83 /opt/nextcloud/occ config:system:set skeletondirectory --value=
|
sudo -u nginx phpPHPver /opt/nextcloud/occ config:system:set skeletondirectory --value=
|
||||||
sudo -u nginx php83 /opt/nextcloud/occ config:system:set memcache.local --value='\OC\Memcache\APCu'
|
sudo -u nginx phpPHPver /opt/nextcloud/occ config:system:set memcache.local --value='\OC\Memcache\APCu'
|
||||||
sudo -u nginx php83 /opt/nextcloud/occ config:system:set trashbin_retention_obligation --value=30,30
|
sudo -u nginx phpPHPver /opt/nextcloud/occ config:system:set trashbin_retention_obligation --value=30,30
|
||||||
sudo -u nginx php83 /opt/nextcloud/occ config:system:set memcache.distributed --value='\OC\Memcache\Redis'
|
sudo -u nginx phpPHPver /opt/nextcloud/occ config:system:set memcache.distributed --value='\OC\Memcache\Redis'
|
||||||
sudo -u nginx php83 /opt/nextcloud/occ config:system:set memcache.locking --value='\OC\Memcache\Redis'
|
sudo -u nginx phpPHPver /opt/nextcloud/occ config:system:set memcache.locking --value='\OC\Memcache\Redis'
|
||||||
sudo -u nginx php83 /opt/nextcloud/occ config:system:set redis host --value=localhost
|
sudo -u nginx phpPHPver /opt/nextcloud/occ config:system:set redis host --value=localhost
|
||||||
sudo -u nginx php83 /opt/nextcloud/occ config:system:set redis port --value=6379
|
sudo -u nginx phpPHPver /opt/nextcloud/occ config:system:set redis port --value=6379
|
||||||
sudo -u nginx php83 /opt/nextcloud/occ config:system:set trusted_domains 1 --value="$(ifconfig | grep -A 1 'eth0' | tail -1 | cut -d ':' -f 2 | cut -d ' ' -f 1)"
|
sudo -u nginx phpPHPver /opt/nextcloud/occ config:system:set trusted_domains 1 --value="$(ifconfig | grep -A 1 'eth0' | tail -1 | cut -d ':' -f 2 | cut -d ' ' -f 1)"
|
||||||
sudo -u nginx php83 /opt/nextcloud/occ config:system:set overwrite.cli.url --value="$NextcloudWebProto://$(ifconfig | grep -A 1 'eth0' | tail -1 | cut -d ':' -f 2 | cut -d ' ' -f 1)"
|
sudo -u nginx phpPHPver /opt/nextcloud/occ config:system:set overwrite.cli.url --value="$NextcloudWebProto://$(ifconfig | grep -A 1 'eth0' | tail -1 | cut -d ':' -f 2 | cut -d ' ' -f 1)"
|
||||||
sudo -u nginx php83 /opt/nextcloud/occ config:system:set overwriteprotocol --value="$NextcloudWebProto"
|
sudo -u nginx phpPHPver /opt/nextcloud/occ config:system:set overwriteprotocol --value="$NextcloudWebProto"
|
||||||
|
sudo -u nginx phpPHPver /opt/nextcloud/occ config:system:set maintenance_window_start --type=integer --value=2
|
||||||
|
sudo -u nginx phpPHPver /opt/nextcloud/occ config:app:set settings profile_enabled_by_default --value="0"
|
||||||
|
sudo -u nginx phpPHPver /opt/nextcloud/occ background:cron
|
||||||
|
sudo -u nginx phpPHPver /opt/nextcloud/occ maintenance:repair --include-expensive
|
||||||
@@ -7,7 +7,7 @@ rm -rf /etc/nginx/conf.d
|
|||||||
mv /opt/Setup/Configs/nginx.conf /etc/nginx/nginx.conf
|
mv /opt/Setup/Configs/nginx.conf /etc/nginx/nginx.conf
|
||||||
|
|
||||||
#Setup PHP
|
#Setup PHP
|
||||||
ash /opt/Setup/Scripts/PHPTool.sh -d nextcloud || exit 1
|
ash /opt/Setup/Scripts/PHPTool.sh -dv 83 nextcloud || exit 1
|
||||||
rm /opt/Setup/Scripts/PHPTool.sh
|
rm /opt/Setup/Scripts/PHPTool.sh
|
||||||
|
|
||||||
|
|
||||||
@@ -17,7 +17,6 @@ tar jxf /opt/Setup/nextcloud.tar.bz2 -C /opt/nextcloud --strip 1
|
|||||||
rm -rf /opt/Setup/nextcloud.tar.bz2
|
rm -rf /opt/Setup/nextcloud.tar.bz2
|
||||||
chown -R nginx:nginx /opt/nextcloud
|
chown -R nginx:nginx /opt/nextcloud
|
||||||
chown -R nginx:nginx /var/nextcloud
|
chown -R nginx:nginx /var/nextcloud
|
||||||
echo "*/5 * * * * php83 -f /opt/nextcloud/cron.php > /dev/null 2>&1" >> /etc/crontabs/nginx
|
|
||||||
#Enable services on boot
|
#Enable services on boot
|
||||||
rc-update add nginx
|
rc-update add nginx
|
||||||
rc-update add valkey
|
rc-update add valkey
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# Update script for updating apps with ProxmoxHelper/ProxMoxToolKit
|
# Update script for updating apps with ProxmoxHelper/ProxMoxToolKit
|
||||||
sudo -u nginx php83 /opt/nextcloud/updater/updater.phar --no-interaction
|
CurPHP=phpPHPver
|
||||||
|
sudo -u nginx $CurPHP /opt/nextcloud/updater/updater.phar --no-interaction
|
||||||
@@ -11,6 +11,7 @@ npm install --prefix /opt/node/node-red/app node-red @node-red-contrib-themes/th
|
|||||||
pm2 install pm2-logrotate
|
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 start --name nodered --cwd /opt/node/node-red/app ./node_modules/node-red/red.js -- -u /opt/node/node-red/data
|
||||||
pm2 save
|
pm2 save
|
||||||
|
sleep 5
|
||||||
pm2 kill
|
pm2 kill
|
||||||
#Enable node-red dark theme
|
#Enable node-red dark theme
|
||||||
sed -i -e 's#//theme: "",#theme: "midnight-red",#g' /opt/node/node-red/data/settings.js
|
sed -i -e 's#//theme: "",#theme: "midnight-red",#g' /opt/node/node-red/data/settings.js
|
||||||
|
|||||||
@@ -4,11 +4,15 @@ addgroup transfersh
|
|||||||
adduser -S -s /bin/ash -h /home/transfersh -D -G transfersh transfersh
|
adduser -S -s /bin/ash -h /home/transfersh -D -G transfersh transfersh
|
||||||
mkdir -p /opt/transfer.sh/CustomTheme
|
mkdir -p /opt/transfer.sh/CustomTheme
|
||||||
#Get Resources
|
#Get Resources
|
||||||
CurrentVersion=$(curl -s https://api.github.com/repos/dutchcoders/transfer.sh/releases/latest | grep 'tag_name.*' | cut -d : -f 2,3 | tr -d \" |tr -d , |tr -d " " |tr -d : )
|
CurrentVersion=$(curl -s https://api.github.com/repos/dutchcoders/transfer.sh/releases/latest | jq -r .tag_name)
|
||||||
|
CurrentThemeVersion=$(curl -s https://git.bprieshof.nl/api/v1/repos/DarkTheme/brammp_transfer.sh-web/releases/latest |jq -r .tag_name)
|
||||||
echo $CurrentVersion > /opt/transfer.sh/Version
|
echo $CurrentVersion > /opt/transfer.sh/Version
|
||||||
|
echo $CurrentThemeVersion > /opt/transfer.sh/ThemeVersion
|
||||||
curl -L --retry 7 --retry-delay 5 https://github.com/dutchcoders/transfer.sh/releases/download/"$CurrentVersion"/transfersh-"$CurrentVersion"-linux-amd64 -o /opt/transfer.sh/transfersh-linux-amd64 || exit 1
|
curl -L --retry 7 --retry-delay 5 https://github.com/dutchcoders/transfer.sh/releases/download/"$CurrentVersion"/transfersh-"$CurrentVersion"-linux-amd64 -o /opt/transfer.sh/transfersh-linux-amd64 || exit 1
|
||||||
|
curl -L --retry 7 --retry-delay 5 https://git.bprieshof.nl/DarkTheme/brammp_transfer.sh-web/releases/download/"$CurrentThemeVersion"/brammp_transfer.sh-web-"$CurrentThemeVersion".tar.gz -o /tmp/brammp_transfer.sh-web.tar.gz || exit 1
|
||||||
#Install transfer.sh custom theme
|
#Install transfer.sh custom theme
|
||||||
git clone https://git.bprieshof.nl/DarkTheme/brammp_transfer.sh-web.git /opt/transfer.sh/CustomTheme
|
tar -zxf /tmp/brammp_transfer.sh-web.tar.gz -C /opt/transfer.sh/CustomTheme
|
||||||
|
rm /tmp/brammp_transfer.sh-web.tar.gz
|
||||||
#Configure transfer.sh
|
#Configure transfer.sh
|
||||||
mv /opt/Setup/Configs/transfersh.conf /opt/transfer.sh/transfersh.conf
|
mv /opt/Setup/Configs/transfersh.conf /opt/transfer.sh/transfersh.conf
|
||||||
mv /opt/Setup/Configs/transfersh.service /etc/init.d/transfersh
|
mv /opt/Setup/Configs/transfersh.service /etc/init.d/transfersh
|
||||||
@@ -17,4 +21,9 @@ chmod +x /etc/init.d/transfersh
|
|||||||
chmod +x /opt/transfer.sh/transfersh-linux-amd64
|
chmod +x /opt/transfer.sh/transfersh-linux-amd64
|
||||||
chown -R transfersh:transfersh /opt/transfer.sh
|
chown -R transfersh:transfersh /opt/transfer.sh
|
||||||
#Enable service
|
#Enable service
|
||||||
rc-update add transfersh
|
rc-update add transfersh
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#!/bin/ash
|
#!/bin/ash
|
||||||
CurtransfershVersion=$(curl -s https://api.github.com/repos/dutchcoders/transfer.sh/releases/latest | grep 'tag_name.*' | cut -d : -f 2,3 | tr -d \" |tr -d , |tr -d " " |tr -d : )
|
CurtransfershVersion=$(curl -s https://api.github.com/repos/dutchcoders/transfer.sh/releases/latest | jq -r .tag_name)
|
||||||
|
CurtransfershThemeVersion=$(curl -s https://git.bprieshof.nl/api/v1/repos/DarkTheme/brammp_transfer.sh-web/releases/latest |jq -r .tag_name)
|
||||||
|
|
||||||
if test "$CurtransfershVersion" = "$(cat /opt/transfer.sh/Version)" ; then
|
if test "$CurtransfershVersion" = "$(cat /opt/transfer.sh/Version)" ; then
|
||||||
echo 'Transfer.sh up-to-date'
|
echo 'Transfer.sh up-to-date'
|
||||||
@@ -7,10 +8,29 @@ if test "$CurtransfershVersion" = "$(cat /opt/transfer.sh/Version)" ; then
|
|||||||
else
|
else
|
||||||
echo 'Updating Transfer.sh'
|
echo 'Updating Transfer.sh'
|
||||||
service transfersh stop
|
service transfersh stop
|
||||||
|
if [ -f "/opt/transfer.sh/transfersh-linux-amd64.old" ]; then rm /opt/transfer.sh/transfersh-linux-amd64.old ;fi
|
||||||
mv /opt/transfer.sh/transfersh-linux-amd64 /opt/transfer.sh/transfersh-linux-amd64.old
|
mv /opt/transfer.sh/transfersh-linux-amd64 /opt/transfer.sh/transfersh-linux-amd64.old
|
||||||
curl -L -o /opt/transfer.sh/transfersh-linux-amd64 https://github.com/dutchcoders/transfer.sh/releases/download/"$CurtransfershVersion"/transfersh-"$CurtransfershVersion"-linux-amd64
|
curl -L -o /opt/transfer.sh/transfersh-linux-amd64 https://github.com/dutchcoders/transfer.sh/releases/download/"$CurtransfershVersion"/transfersh-"$CurtransfershVersion"-linux-amd64
|
||||||
chmod +x /opt/transfer.sh/transfersh-linux-amd64
|
chmod +x /opt/transfer.sh/transfersh-linux-amd64
|
||||||
chown transfersh:transfersh /opt/transfer.sh/transfersh-linux-amd64
|
chown transfersh:transfersh /opt/transfer.sh/transfersh-linux-amd64
|
||||||
echo "$CurtransfershVersion" > /opt/transfer.sh/Version
|
echo "$CurtransfershVersion" > /opt/transfer.sh/Version
|
||||||
service transfersh start
|
service transfersh start
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if test "$CurtransfershThemeVersion" = "$(cat /opt/transfer.sh/ThemeVersion)" ; then
|
||||||
|
echo 'Custom theme for Transfer.sh up-to-date'
|
||||||
|
exit
|
||||||
|
else
|
||||||
|
echo 'Updating Custom theme for Transfer.sh'
|
||||||
|
service transfersh stop
|
||||||
|
if [ -d "/opt/transfer.sh/CustomTheme.old" ]; then rm -rf /opt/transfer.sh/CustomTheme.old ;fi
|
||||||
|
mv /opt/transfer.sh/CustomTheme /opt/transfer.sh/CustomTheme.old
|
||||||
|
curl -L --retry 7 --retry-delay 5 https://git.bprieshof.nl/DarkTheme/brammp_transfer.sh-web/releases/download/"$CurtransfershThemeVersion"/brammp_transfer.sh-web-"$CurtransfershThemeVersion".tar.gz -o /tmp/brammp_transfer.sh-web.tar.gz || exit 1
|
||||||
|
tar -zxf /tmp/brammp_transfer.sh-web.tar.gz -C /opt/transfer.sh/CustomTheme
|
||||||
|
chown -R transfersh:transfersh /opt/transfer.sh/CustomTheme
|
||||||
|
rm /tmp/brammp_transfer.sh-web.tar.gz
|
||||||
|
echo "$CurtransfershThemeVersion" > /opt/transfer.sh/ThemeVersion
|
||||||
|
service transfersh start
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -12,8 +12,8 @@
|
|||||||
self=$0
|
self=$0
|
||||||
|
|
||||||
Configurations="nextcloud freshrss heimdall mailbackup"
|
Configurations="nextcloud freshrss heimdall mailbackup"
|
||||||
SupportedAlpineVersion=3.20
|
SupportedAlpineVersion=3.21
|
||||||
NewPHPVer=83
|
NewPHPVer=84
|
||||||
SkipAlpineRelCheck=false
|
SkipAlpineRelCheck=false
|
||||||
|
|
||||||
#Git configuration only used for Upgrades and Fresh mode
|
#Git configuration only used for Upgrades and Fresh mode
|
||||||
@@ -34,10 +34,11 @@ show_help () {
|
|||||||
Usage: $self [-dfpuh] <Config name>
|
Usage: $self [-dfpuh] <Config name>
|
||||||
|
|
||||||
Options:
|
Options:
|
||||||
-d, Distrobuilder: Install everything and use Local configs (non interactive)
|
-d, Distrobuilder: Install everything and use Local configs (non interactive)
|
||||||
-f, Fresh: Install everything and fetch config
|
-f, Fresh: Install everything and fetch config
|
||||||
-p, Purge: Remove all PHP packlages and back configuration (handy for distro release upgrades)
|
-p, Purge: Remove all PHP packlages and back configuration (handy for distro release upgrades)
|
||||||
-u, Upgrade: Run both Purge and Install steps
|
-u, Upgrade: Run both Purge and Install steps
|
||||||
|
-v <PhpVer>, Set PHPVersion: specify the PHP version version (example 84 for 8.4)
|
||||||
|
|
||||||
Cnfigurations:
|
Cnfigurations:
|
||||||
$Configurations
|
$Configurations
|
||||||
@@ -55,13 +56,14 @@ echo_exit (){
|
|||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
#Arugment/optin handeling
|
#Arugment/option handeling
|
||||||
while getopts 'dfpuh' opt; do
|
while getopts 'dfpuhv:' opt; do
|
||||||
case $opt in
|
case $opt in
|
||||||
d) set_mode distrobuilder;;
|
d) set_mode distrobuilder;;
|
||||||
f) set_mode fresh ;;
|
f) set_mode fresh ;;
|
||||||
p) set_mode purge ;;
|
p) set_mode purge ;;
|
||||||
u) set_mode upgrade ;;
|
u) set_mode upgrade ;;
|
||||||
|
v) NewPHPVer="${OPTARG}" ;;
|
||||||
h) show_help
|
h) show_help
|
||||||
exit ;;
|
exit ;;
|
||||||
*) show_help
|
*) show_help
|
||||||
@@ -93,23 +95,30 @@ fi
|
|||||||
|
|
||||||
#Backup PHP config and purge PHP packages
|
#Backup PHP config and purge PHP packages
|
||||||
run_Purge() {
|
run_Purge() {
|
||||||
#Check if PHP is installed
|
|
||||||
if ! command -v php &> /dev/null; then printf "ERROR: PHP is not installed\n\n"; exit 1;fi
|
|
||||||
#Get current PHP Version
|
#Get current PHP Version
|
||||||
OldPHPVer=$(grep php /etc/apk/world -m 1|sed -e "s/\-.*//" -e "s/php//")
|
OldPHPVer=$(grep php /etc/apk/world -m 1|sed -e "s/\-.*//" -e "s/php//")
|
||||||
|
#Check if PHP is installed
|
||||||
|
PHPInstalled=false
|
||||||
|
if command -v php$OldPHPVer &> /dev/null; then PHPInstalled=true;fi
|
||||||
|
if command -v php-fpm$OldPHPVer &> /dev/null; then PHPInstalled=true;fi
|
||||||
|
if ! $PHPInstalled; then printf "ERROR: PHP is not installed\n\n"; exit 1;fi
|
||||||
#Create Backup an its location
|
#Create Backup an its location
|
||||||
if [[ ! -d "/opt/PHPCfgBackup/" ]];then mkdir -p "/opt/PHPCfgBackup"; fi
|
if [[ ! -d "/opt/PHPCfgBackup/" ]];then mkdir -p "/opt/PHPCfgBackup"; fi
|
||||||
|
if [[ -f /etc/crontabs/nginx ]]; then cp /etc/crontabs/nginx /opt/PHPCfgBackup/crontabs-nginx; fi
|
||||||
|
service php-fpm$OldPHPVer stop
|
||||||
|
rc-update del php-fpm$OldPHPVer
|
||||||
tar -czf "/opt/PHPCfgBackup/PHP$OldPHPVer-Config.tar.gz" -C "/etc/php$OldPHPVer" ./
|
tar -czf "/opt/PHPCfgBackup/PHP$OldPHPVer-Config.tar.gz" -C "/etc/php$OldPHPVer" ./
|
||||||
rm -rf "/etc/php$OldPHPVer"
|
rm -rf "/etc/php$OldPHPVer"
|
||||||
|
|
||||||
#Set placeholder in Nginx for PHP Socket
|
#Set placeholder in Nginx for PHP Socket
|
||||||
sed -i -e 's/'$OldPHPVer'/PHPver/g' /etc/nginx/nginx.conf
|
sed -i "/fastcgi_pass unix:\/run\/php-/c\ \ fastcgi_pass unix:\/run\/php-fpmPHPver\/php-fpm.sock;" /etc/nginx/nginx.conf
|
||||||
#Purge PHP packages
|
#Purge PHP packages
|
||||||
apk del php*
|
apk del "php*"
|
||||||
}
|
}
|
||||||
|
|
||||||
#(re)install PHP packages
|
#(re)install PHP packages
|
||||||
run_Install() {
|
run_Install() {
|
||||||
|
sed -i -e "s/phpPHPver/php$NewPHPVer/g" $configStore/php.pkglist
|
||||||
cat $configStore/php.pkglist | xargs apk add
|
cat $configStore/php.pkglist | xargs apk add
|
||||||
#Configure Php-Fpm
|
#Configure Php-Fpm
|
||||||
echo ";Placeholder" > /etc/php$NewPHPVer/php-fpm.d/www.conf
|
echo ";Placeholder" > /etc/php$NewPHPVer/php-fpm.d/www.conf
|
||||||
@@ -118,22 +127,41 @@ run_Install() {
|
|||||||
printf "[Date]\ndate.timezone = Europe/Amsterdam" >/etc/php$NewPHPVer/conf.d/04_date_timezone.ini
|
printf "[Date]\ndate.timezone = Europe/Amsterdam" >/etc/php$NewPHPVer/conf.d/04_date_timezone.ini
|
||||||
|
|
||||||
#Configure Nginx PHP Socket
|
#Configure Nginx PHP Socket
|
||||||
sed -i -e 's/PHPver/'$NewPHPVer'/g' /etc/nginx/nginx.conf
|
sed -i "/fastcgi_pass unix:\/run\/php-/c\ \ fastcgi_pass unix:\/run\/php-fpm$NewPHPVer\/php-fpm.sock;" /etc/nginx/nginx.conf
|
||||||
|
|
||||||
#Unique settings for configuration
|
#Unique settings for configuration
|
||||||
case $config in
|
case $config in
|
||||||
nextcloud)
|
nextcloud)
|
||||||
echo runnig distrobuilder
|
|
||||||
#Configure Php-Cli
|
#Configure Php-Cli
|
||||||
sed -i '/memory_limit =/c\memory_limit = 512M' /etc/php$NewPHPVer/php.ini
|
sed -i '/memory_limit =/c\memory_limit = 512M' /etc/php$NewPHPVer/php.ini
|
||||||
echo "apc.enable_cli=1" >> /etc/php$NewPHPVer/php.ini
|
echo "apc.enable_cli=1" >> /etc/php$NewPHPVer/php.ini
|
||||||
|
if [[ -f /opt/ProxMoxToolKitAppUpdate.sh ]]; then
|
||||||
|
sed -i "/CurPHP=/c\CurPHP=php$NewPHPVer" /opt/ProxMoxToolKitAppUpdate.sh
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
#Configure Cron
|
||||||
|
if test -f $configStore/crontab; then
|
||||||
|
sed -i -e 's/PHPver/'$NewPHPVer'/g' $configStore/crontab
|
||||||
|
mv $configStore/crontab /etc/crontabs/nginx
|
||||||
|
fi
|
||||||
|
|
||||||
#Enable service(s) on boot
|
#Enable service(s) on boot
|
||||||
rc-update add php-fpm$NewPHPVer
|
rc-update add php-fpm$NewPHPVer
|
||||||
}
|
}
|
||||||
|
|
||||||
|
run_DistrobuilderOnly() {
|
||||||
|
#Do things only required when setting up using distrobuilder
|
||||||
|
##Unique settings for configuration
|
||||||
|
case $config in
|
||||||
|
nextcloud)
|
||||||
|
sed -i -e "s/phpPHPver/php$NewPHPVer/g" /opt/Setup/Scripts/FirstRun.sh #Update FirstRun setup
|
||||||
|
sed -i -e "s/phpPHPver/php$NewPHPVer/g" /opt/Setup/Scripts/PTKAppUpdate.sh #Update nextcloud update script
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
fetch_Config() {
|
fetch_Config() {
|
||||||
#Unique settings for configuration
|
#Unique settings for configuration
|
||||||
case $config in
|
case $config in
|
||||||
@@ -144,33 +172,45 @@ fetch_Config() {
|
|||||||
*)
|
*)
|
||||||
wget "$gitRepo"/raw/branch/"$gitBranch"/CT-Files/$config/Configs/php.conf -O /tmp/php.conf || echo_exit "ERROR: Config download failed"
|
wget "$gitRepo"/raw/branch/"$gitBranch"/CT-Files/$config/Configs/php.conf -O /tmp/php.conf || echo_exit "ERROR: Config download failed"
|
||||||
wget "$gitRepo"/raw/branch/"$gitBranch"/CT-Files/"$config"/Configs/php.pkglist -O /tmp/php.pkglist || echo_exit "ERROR: Config download failed"
|
wget "$gitRepo"/raw/branch/"$gitBranch"/CT-Files/"$config"/Configs/php.pkglist -O /tmp/php.pkglist || echo_exit "ERROR: Config download failed"
|
||||||
|
#Check if crontab conf exists,if so get it
|
||||||
|
if wget -q --spider "$gitRepo"/raw/branch/"$gitBranch"/CT-Files/$config/Configs/crontab 2>/dev/null;
|
||||||
|
then
|
||||||
|
wget "$gitRepo"/raw/branch/"$gitBranch"/CT-Files/"$config"/Configs/crontab -O /tmp/crontab || echo_exit "ERROR: Config download failed"
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
|
start_Services(){
|
||||||
|
service php-fpm$NewPHPVer start
|
||||||
|
service nginx restart
|
||||||
|
}
|
||||||
|
|
||||||
case $mode in
|
case $mode in
|
||||||
distrobuilder)
|
distrobuilder)
|
||||||
#Set config location
|
#Set config location
|
||||||
configStore=/opt/Setup/Configs
|
configStore=/opt/Setup/Configs
|
||||||
|
run_DistrobuilderOnly
|
||||||
run_Install
|
run_Install
|
||||||
;;
|
;;
|
||||||
fresh)
|
fresh)
|
||||||
fetch_Config
|
|
||||||
#Set config location
|
#Set config location
|
||||||
configStore=/tmp
|
configStore=/tmp
|
||||||
|
fetch_Config
|
||||||
run_Install
|
run_Install
|
||||||
|
start_Services
|
||||||
;;
|
;;
|
||||||
purge)
|
purge)
|
||||||
run_Purge
|
run_Purge
|
||||||
;;
|
;;
|
||||||
upgrade)
|
upgrade)
|
||||||
#Set config location
|
#Set config location
|
||||||
configStore=/opt/Setup/Configs
|
configStore=/tmp
|
||||||
fetch_Config
|
fetch_Config
|
||||||
service nginx stop
|
service nginx stop
|
||||||
run_Purge
|
run_Purge
|
||||||
run_Install
|
run_Install
|
||||||
service nginx start
|
start_Services
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
#Vars
|
|
||||||
|
|
||||||
#Goto ProjectRoot
|
|
||||||
cd "$( cd "$( dirname "$0" )" &> /dev/null && pwd )/.."
|
|
||||||
|
|
||||||
read -p "Old PHP version (example 82 for 8.2): " OldPHPVer
|
|
||||||
read -p "New PHP version (example 83 for 8.3): " NewPHPVer
|
|
||||||
|
|
||||||
sed -i -e "s/NewPHPVer=$OldPHPVer/NewPHPVer=$NewPHPVer/g" ./Scripts/AlpinePHPTool.sh
|
|
||||||
find ./CT-Files -name "php.pkglist" | xargs sed -i -e "s/php-fpm$OldPHPVer/php-fpm$NewPHPVer/g" -e "s/php$OldPHPVer/php$NewPHPVer/g"
|
|
||||||
Reference in New Issue
Block a user