Skip to content

Commit

Permalink
fix: _phpv
Browse files Browse the repository at this point in the history
  • Loading branch information
MPThLee authored Dec 30, 2023
1 parent bb6ef9e commit cc4bf49
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 11 deletions.
11 changes: 7 additions & 4 deletions cron/generate-backup
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
#!/bin/bash

# PHP Version
_phpv=81

# TODO: Why not move this to other dockers?

# Get AWS Environment...
cat /etc/aws.env | sed 's/^\(.*\)$/export \1/g' | grep -E "^export AWS" | cat - > /etc/aws.env.sh
source /etc/aws.env.sh
rm /etc/aws.env.sh

DB_NAME="$(php -r 'require "/setting/secret.php"; echo $wgDBname;')"
DB_HOSTNAME="$(php -r 'require "/setting/secret.php"; echo $wgDBserver;')"
DB_USERNAME="$(php -r 'require "/setting/secret.php"; echo $wgDBuser;')"
DB_PASSWORD="$(php -r 'require "/setting/secret.php"; echo $wgDBpassword;')"
DB_NAME="$(php$_phpv -r 'require "/setting/secret.php"; echo $wgDBname;')"
DB_HOSTNAME="$(php$_phpv -r 'require "/setting/secret.php"; echo $wgDBserver;')"
DB_USERNAME="$(php$_phpv -r 'require "/setting/secret.php"; echo $wgDBuser;')"
DB_PASSWORD="$(php$_phpv -r 'require "/setting/secret.php"; echo $wgDBpassword;')"

namebase=shinywiki-backup-
datestamp=`date +'%Y-%m-%d'`
Expand Down
5 changes: 4 additions & 1 deletion cron/generate-dumps
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@
# Settings
# --------

# PHP Version
_phpv=81

datestamp=`date +'%Y-%m-%d'`
php="sudo -u nginx -g www-data php"
php="sudo -u nginx -g www-data php$_phpv"
wikiname="shinywiki"
tempdir="/tmp/wiki-dumps-$datestamp"
workingdir="/srv/wiki"
Expand Down
5 changes: 4 additions & 1 deletion cron/generate-sitemap
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
#!/bin/sh

# PHP Version
_phpv=81

cd /srv/wiki

sudo -u nginx -g www-data \
php w/maintenance/generateSitemap.php \
php$_phpv w/maintenance/generateSitemap.php \
--memory-limit=50M \
--fspath=sitemap \
--identifier=shinywiki \
Expand Down
9 changes: 6 additions & 3 deletions cron/run-jobs
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
#!/bin/sh

# PHP Version
_phpv=81

cd /srv/wiki/w

mkdir /var/log/mw
sudo -u nginx -g www-data php maintenance/runJobs.php --type="enotifNotify" >> /var/log/mw/runJobs.log 2>&1
sudo -u nginx -g www-data php maintenance/runJobs.php --type="htmlCacheUpdate" --maxjobs=50 >> /var/log/mw/runJobs.log 2>&1
sudo -u nginx -g www-data php maintenance/runJobs.php --maxtime=3600 >> /var/log/mw/runJobs.log 2>&1
sudo -u nginx -g www-data php$_phpv maintenance/runJobs.php --type="enotifNotify" >> /var/log/mw/runJobs.log 2>&1
sudo -u nginx -g www-data php$_phpv maintenance/runJobs.php --type="htmlCacheUpdate" --maxjobs=50 >> /var/log/mw/runJobs.log 2>&1
sudo -u nginx -g www-data php$_phpv maintenance/runJobs.php --maxtime=3600 >> /var/log/mw/runJobs.log 2>&1
5 changes: 4 additions & 1 deletion cron/run-transcode-jobs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#!/bin/sh

# PHP Version
_phpv=81

cd /srv/wiki/w

mkdir /var/log/mw
sudo -u nginx -g www-data php maintenance/runJobs.php --type="webVideoTranscode" >> /var/log/mw/runJobs.log 2>&1
sudo -u nginx -g www-data php$_phpv maintenance/runJobs.php --type="webVideoTranscode" >> /var/log/mw/runJobs.log 2>&1
5 changes: 4 additions & 1 deletion cron/update-sfs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#!/bin/bash

sudo -u nginx -g www-data php /srv/wiki/w/extensions/StopForumSpam/maintenance/updateDenyList.php
# PHP Version
_phpv=81

sudo -u nginx -g www-data php$_phpv /srv/wiki/w/extensions/StopForumSpam/maintenance/updateDenyList.php

0 comments on commit cc4bf49

Please sign in to comment.