| Both sides previous revisionPrevious revisionNext revision | Previous revision |
| servers:linux:nginx:dokuwiki [2026/04/30 22:09] – [Server Block] Sean Rhone | servers:linux:nginx:dokuwiki [2026/05/08 13:52] (current) – Sean Rhone |
|---|
| <code> | <code> |
| [wiki] | [wiki] |
| listen = "/run/php-fpm/wiki.sock" | |
| |
| user = "wwwrun" | user = "wwwrun" |
| group = "www" | group = "www" |
| | |
| | listen = "/run/php-fpm/wiki.sock" |
| listen.owner = "wwwrun" | listen.owner = "wwwrun" |
| listen.group = "www" | listen.group = "www" |
| pm.process_idle_timeout = "30" | pm.process_idle_timeout = "30" |
| |
| php_value[log_errors] = "Off" | php_value[log_errors] = "0" |
| php_value[error_reporting] = "~E_ALL" | php_value[error_reporting] = "~E_ALL" |
| php_value[display_errors] = "Off" | php_value[display_errors] = "0" |
| php_value[display_startup_errors] = "Off" | php_value[display_startup_errors] = "0" |
| php_value[html_errors] = "Off" | php_value[html_errors] = "0" |
| |
| php_value[session.save_path] = "/var/lib/php8/sessions" | php_value[session.save_path] = "/var/lib/php8/sessions" |
| |
| echo '-- --' | sudo tee '/srv/www/wiki/conf/entities.local.conf' > '/dev/null' && sudo chown 'wwwrun':'www' '/srv/www/wiki/conf/entities.local.conf' | echo '-- --' | sudo tee '/srv/www/wiki/conf/entities.local.conf' > '/dev/null' && sudo chown 'wwwrun':'www' '/srv/www/wiki/conf/entities.local.conf' |
| |
| ====== Scripts ====== | |
| |
| ===== Git Fix ===== | |
| |
| * :!: Set email for ''user.email'' | |
| |
| sudo mkdir -p '/etc/nginx/scripts/wiki' && sudo -e '/etc/nginx/scripts/wiki/git-fix.sh' && sudo chmod '0500' '/etc/nginx/scripts/wiki/git-fix.sh' && sudo chown 'wwwrun':'www' '/etc/nginx/scripts/wiki/git-fix.sh' | |
| |
| <code> | |
| #!/bin/bash | |
| |
| cd '/tmp' | |
| |
| '/usr/bin/rm' -Rf '/srv/www/wiki/.git' | |
| '/usr/bin/git' -C '/srv/www/wiki' init --initial-branch='master' | |
| '/usr/bin/git' -C '/srv/www/wiki' add '.' | |
| |
| ######################################## | |
| '/usr/bin/git' -C '/srv/www/wiki' config 'user.email' 'espionage724@x' | |
| ######################################## | |
| |
| '/usr/bin/git' -C '/srv/www/wiki' commit --message='x' | |
| |
| '/usr/bin/git' -C '/srv/www/wiki' remote add 'origin' 'https://github.com/dokuwiki/dokuwiki.git' | |
| '/usr/bin/git' -C '/srv/www/wiki' pull --depth '1' --recurse-submodules 'origin' 'master' --rebase | |
| |
| '/usr/bin/git' -C '/srv/www/wiki' reset --hard 'origin/master' | |
| '/usr/bin/git' -C '/srv/www/wiki' gc --aggressive --prune='all' | |
| '/usr/bin/git' -C '/srv/www/wiki' fsck --full --strict | |
| |
| # End</code> | |
| |
| ==== Execute ==== | |
| |
| sudo su 'wwwrun' -s '/bin/bash' | |
| |
| '/etc/nginx/scripts/wiki/git-fix.sh' | |
| |
| exit | |
| |
| ====== Services ====== | ====== Services ====== |
| Type=oneshot | Type=oneshot |
| |
| WorkingDirectory=/srv/www/wiki | WorkingDirectory=/tmp |
| |
| ExecStart='/usr/bin/git' -C '/srv/www/wiki' reset --hard 'origin/master' | ExecStart='/usr/bin/git' -C '/srv/www/wiki' reset --hard 'origin/master' |
| |
| ExecStart='/usr/bin/php' '/srv/www/wiki/bin/indexer.php' --clear | ExecStart='/usr/bin/php' '/srv/www/wiki/bin/indexer.php' --clear |
| ExecStart='/usr/bin/touch' '/srv/www/wiki/conf/local.php' | |
| | ExecStartPost='/usr/bin/touch' '/srv/www/wiki/conf/local.php' |
| |
| # End</code> | # End</code> |
| ==== Service ==== | ==== Service ==== |
| |
| * TODO: [[linux:notes:ext4]] | * [[linux:notes:ext4|ext4 NAS]] |
| |
| mkdir -p ~/'backups' && sudo -e '/etc/systemd/system/wiki-fb.service' && sudo sed -i 's/CHANGEME/'$USER'/g' '/etc/systemd/system/wiki-fb.service' | mkdir -p ~/'backups' && sudo -e '/etc/systemd/system/wiki-fb.service' && sudo sed -i 's/CHANGEME/'$USER'/g' '/etc/systemd/system/wiki-fb.service' |
| Type=oneshot | Type=oneshot |
| |
| WorkingDirectory=/srv/www/wiki | WorkingDirectory=/tmp |
| |
| ExecStart='/usr/bin/bash' -c '"/usr/bin/tar" -czf "/home/CHANGEME/backups/dokuwiki-files-auto-"$$(date +%%Y-%%m-%%d)".tar.gz" -C "/srv/www/wiki" "data/pages" "data/meta" "data/media" "data/media_meta" "data/attic" "data/media_attic" "conf"' | ExecStart='/usr/bin/bash' -c '"/usr/bin/tar" -czf "/mnt/NAS1/Servers/Scheduled Backups/dokuwiki-files-auto-"$$(date +%%Y-%%m-%%d)".tar.gz" -C "/srv/www/wiki" "data/pages" "data/meta" "data/media" "data/media_meta" "data/attic" "data/media_attic" "conf"' |
| | |
| | #ExecStart='/usr/bin/bash' -c '"/usr/bin/tar" -czf "/home/CHANGEME/backups/dokuwiki-files-auto-"$$(date +%%Y-%%m-%%d)".tar.gz" -C "/srv/www/wiki" "data/pages" "data/meta" "data/media" "data/media_meta" "data/attic" "data/media_attic" "conf"' |
| |
| # End</code> | # End</code> |
| Type=oneshot | Type=oneshot |
| |
| WorkingDirectory=/srv/www/wiki | WorkingDirectory=/tmp |
| |
| ExecStart='/usr/bin/git' -C '/srv/www/wiki' gc --aggressive --prune='all' | ExecStart='/usr/bin/git' -C '/srv/www/wiki' gc --aggressive --prune='all' |
| sudo su 'wwwrun' -s '/bin/bash' | sudo su 'wwwrun' -s '/bin/bash' |
| |
| rm -Rf '/srv/www/wiki/.git' | cd '/tmp' && rm -Rf '/srv/www/wiki/.git' |
| |
| git -C '/srv/www/wiki' init --initial-branch='master' | git -C '/srv/www/wiki' init --initial-branch='master' |
| sudo su 'wwwrun' -s '/bin/bash' | sudo su 'wwwrun' -s '/bin/bash' |
| |
| cd '/srv/www/wiki' && '/usr/bin/php' '/srv/www/wiki/bin/indexer.php' --clear | cd '/tmp' && '/usr/bin/php' '/srv/www/wiki/bin/indexer.php' --clear |
| |
| exit | exit |
| ====== TODOs ====== | ====== TODOs ====== |
| |
| * https://www.dokuwiki.org/cli?s%5B%5D=wantedpages.php | ===== Find Orphaned Pages ===== |
| * https://www.dokuwiki.org/rewrite | |
| | * https://www.dokuwiki.org/cli#wantedpagesphp |
| | |
| | sudo su 'wwwrun' -s '/bin/bash' |
| | |
| | cd '/tmp' && '/usr/bin/php' '/srv/www/wiki/bin/wantedpages.php' |
| | |
| | cd '/tmp' && '/usr/bin/php' '/srv/www/wiki/bin/wantedpages.php' --help |
| | |
| | exit |
| |