master
branch 3)master
support)su -
pkg install git php84-filter php84-gd php84-sodium php84-zip php84-xml php84-session php84-bz2 php84-intl php84-mbstring php84-zlib
su -
git clone --branch 'master' --depth '1' --recurse-submodules 'https://github.com/splitbrain/dokuwiki.git' '/usr/local/www/wiki' && chown -R 'www':'www' '/usr/local/www/wiki' && sync
su -
ee '/usr/local/etc/php-fpm.d/wiki.conf' && service 'php_fpm' restart
[wiki] ; User/Group user = www group = www ; Socket listen = 127.0.0.1:9002 listen.allowed_clients = 127.0.0.1 ; Process Management pm = ondemand pm.max_children = 4 pm.process_idle_timeout = 30 ; General php_value[date.timezone] = "America/New_York" ; End
su -
ee '/usr/local/etc/nginx/default.d/wiki.conf'
# PHP-FPM location ~ \.(php|phar)(/.*)?$ { fastcgi_split_path_info ^(.+\.(?:php|phar))(/.*)$; fastcgi_intercept_errors on; fastcgi_index doku.php; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param HTTPS on; fastcgi_pass 127.0.0.1:9002; }
su -
ee '/usr/local/etc/nginx/vhosts.d/wiki.conf' && service 'nginx' reload && sync
server { listen '443' 'ssl'; http2 'on'; server_name 'wiki.realmofespionage.xyz'; root '/usr/local/www/wiki'; index 'doku.php'; include '/usr/local/etc/nginx/default.d/wiki.conf'; include '/usr/local/etc/nginx/default.d/headers.conf'; client_max_body_size '10M'; add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; img-src 'self' data:" always; # access_log /var/log/nginx/wiki-access.log; # error_log /var/log/nginx/wiki-error.log; # location = /install.php { # deny all; # } # location ~ /(conf|bin|inc)/ { # deny all; # } # location ~ /data/ { # internal; # } location / { try_files $uri $uri/ @dokuwiki; } location @dokuwiki { rewrite ^/_media/(.*) /lib/exe/fetch.php?media=$1 last; rewrite ^/_detail/(.*) /lib/exe/detail.php?media=$1 last; rewrite ^/_export/([^/]+)/(.*) /doku.php?do=export_$1&id=$2 last; rewrite ^/(.*) /doku.php?id=$1&$args last; } }
#484848
#3d8bff
100em
5)sudo -e '/etc/nginx/vhosts.d/wiki.conf' && sudo systemctl reload 'nginx'
.htaccess
echo '-- --' | sudo tee '/var/www/wiki/conf/entities.local.conf' > '/dev/null' && sudo chown 'nginx':'nginx' '/var/www/wiki/conf/entities.local.conf' && sync
su -
su -m 'www' -c "'/usr/local/bin/git' -C '/usr/local/www/wiki' pull origin 'master'"
su -
su -m 'www' -c "cd '/usr/local/www/wiki' && '/usr/local/www/wiki/bin/indexer.php' --clear"
sudo -e '/etc/systemd/system/wiki-up.service'
[Service] User=nginx Group=nginx Type=oneshot ExecStart='/usr/bin/git' -C '/var/www/wiki' pull origin 'master' ExecStartPost='/usr/bin/touch' '/var/www/wiki/conf/local.php' ExecStartPost='/usr/bin/sync' # End
00:30:00
sudo -e '/etc/systemd/system/wiki-up.timer' && sudo systemctl daemon-reload && sudo systemctl enable 'wiki-up.timer' --now && sudo systemctl start 'wiki-up' && sudo systemctl status 'wiki-up' -l
[Unit] Description=DokuWiki Git Updater After=network-online.target Wants=network-online.target [Timer] OnCalendar=*-*-* 00:30:00 Persistent=true [Install] WantedBy=timers.target # End
ExecStart
would remove page edits older than 90 dayssudo -e '/etc/systemd/system/wiki-m.service'
[Service] User=nginx Group=nginx Type=oneshot WorkingDirectory=/var/www/wiki ExecStart='/usr/bin/git' -C '/var/www/wiki' gc --aggressive --prune='all' ExecStart='/usr/bin/git' -C '/var/www/wiki' fsck --full --strict #ExecStart='/usr/bin/bash' -c "find '/var/www/wiki/data'/{attic,cache,locks,media_attic}/ -type 'f' -mtime +'90' -delete" ExecStart='/usr/bin/bash' -c "find '/var/www/wiki/data'/{attic,cache,index,locks,media,media_attic,media_meta,meta,pages,tmp}/ -mindepth '1' -type 'd' -empty -delete" ExecStart='/usr/bin/php' '/var/www/wiki/bin/indexer.php' --clear ExecStartPost='/usr/bin/sync' # End
01
day of every month at 01:00:00
sudo -e '/etc/systemd/system/wiki-m.timer' && sudo systemctl daemon-reload && sudo systemctl enable 'wiki-m.timer' --now
[Unit] Description=DokuWiki Maintenance [Timer] OnCalendar=*-*-01 01:00:00 Persistent=true [Install] WantedBy=timers.target # End
ExecStart
s are additional backup locations that expect vsftpd~/backups
foldermkdir -p ~/'backups' && sudo -e '/etc/systemd/system/wiki-fb.service' && sudo sed -i 's/CHANGEME/'$USER'/g' '/etc/systemd/system/wiki-fb.service'
[Service] Type=oneshot WorkingDirectory=/var/www/wiki ExecStart='/usr/bin/bash' -c '"/usr/bin/tar" -czf "/home/CHANGEME/backups/dokuwiki-files-auto-"$$(date +%%Y-%%m-%%d)".tar.gz" "data/pages" "data/meta" "data/media" "data/media_meta" "data/attic" "data/media_attic" "conf"' #ExecStart='/usr/bin/bash' -c '"/usr/bin/tar" -czf "/var/ftp/nas1/Servers/Scheduled Backups/dokuwiki-files-auto-"$$(date +%%Y-%%m-%%d)".tar.gz" "data/pages" "data/meta" "data/media" "data/media_meta" "data/attic" "data/media_attic" "conf"' #ExecStart='/usr/bin/bash' -c '"/usr/bin/tar" -czf "/srv/ftp/nas2/Servers/Scheduled Backups/dokuwiki-files-auto-"$$(date +%%Y-%%m-%%d)".tar.gz" "data/pages" "data/meta" "data/media" "data/media_meta" "data/attic" "data/media_attic" "conf"' ExecStartPost='/usr/bin/sync' # End
01:30:00
sudo -e '/etc/systemd/system/wiki-fb.timer' && sudo systemctl daemon-reload && sudo systemctl enable 'wiki-fb.timer' --now && sudo systemctl start 'wiki-fb' && sudo systemctl status 'wiki-fb' -l
[Unit] Description=DokuWiki Files Backup [Timer] OnCalendar=*-*-* 01:30:00 Persistent=true [Install] WantedBy=timers.target # End
su -
cd '/usr/local/www/wiki' && tar -cvzf '/home/espionage724/dokuwiki-files-manual-'$(date +%Y-%m-%d)'.tar.gz' 'data/pages' 'data/meta' 'data/media' 'data/media_meta' 'data/attic' 'data/media_attic' 'conf' && sync
scp espionage724@192.168.1.152:~/'dokuwiki-files-'*'.tar.gz' ~/'Downloads' && sync
scp ~/'Downloads/dokuwiki-files-'*'.tar.gz' espionage724@192.168.1.152:~
rm ~/'Downloads/dokuwiki-files-'*'.tar.gz' && sync
su -
service 'nginx' stop
su -
ls '/home/'*'/dokuwiki-files-'*'.tar.gz' && rm -Rf '/usr/local/www/wiki/data/pages' '/usr/local/www/wiki/data/meta' '/usr/local/www/wiki/data/media' '/usr/local/www/wiki/data/media_meta' '/usr/local/www/wiki/data/attic' '/usr/local/www/wiki/data/media_attic' '/usr/local/www/wiki/conf'
su -
cd '/usr/local/www/wiki' && tar -xvzf '/home/'*'/dokuwiki-files-'*'.tar.gz' 'data/pages' 'data/meta' 'data/media' 'data/media_meta' 'data/attic' 'data/media_attic' 'conf' && chown -R 'www':'www' '/usr/local/www/wiki' && cd ~ && sync
su -
service 'nginx' start
rm -R ~/'dokuwiki-files-'*'.tar.gz' && sync