wiki-copy - Making a static, archival copy of Votorla’s pollwiki cum streetwiki ( Copyright 2018, Michael Allan. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Votorola Software"), to deal in the Votorola Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicence, and/or sell copies of the Votorola Software, and to permit persons to whom the Votorola Software is furnished to do so, subject to the following conditions: The preceding copyright notice and this permission notice shall be included in all copies or substantial portions of the Votorola Software. THE VOTOROLA SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE VOTOROLA SOFTWARE OR THE USE OR OTHER DEALINGS IN THE VOTOROLA SOFTWARE. ──────────────────────────────────────────────────────────────────────────────────────────────────── Directory slashing` ( https://httpd.apache.org/docs/2.4/mod/mod_dir.html#directoryslash - wiki pages with subpages - or otherwise serving as slash-delimited prefixes for other pages - will here get trailing-slash equivalents - which they lacked in the original wiki - moreover these will now be the canonical names - therefore this won't be an easy transformation to undo - not once the transformed copy is public - not without breaking (subsequently formed) external, slashed references to the directories ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ I n s t r u c t i o n s ` - result: http://reluk.ca/w/ - instructions written according to my project setup - mutatis mutandis, adjust according to yours ──────────────────────────────────────────────────────────────────────────────────────────────────── 1. Prepare server` = restore a root with the wiki installed - from archival copy obsidian-root-2018-04-04.tar.xz - to a partition on obsidian ( e.g. to the root-copy partition of the backup drive = boot obsidian to the restored root + mounting its root from havoc < ~/sys/host/obsidian/obsidian.task § Archival copies of root § to mount ... - corrections to configuration - transcribed from § Redact § semi-manual redaction root@obsidian> e /var/www/localhost/htdocs/mediawiki/LocalSettings.php = replace "system/host/u" with "sys/host/obsidian" =root@obsidian> /etc/init.d/apache2 start - runtime corrections < http://reluk.ca/w/MediaWiki:Common.js = remove the loading of the "Outcast toolset switch" - including the entailed toolset "Crossforum Theatre stage" - why - the values of WAP query parameter *wCallback* vary indeterminately at runtime ( http://reluk.ca/project/votorola/_/javadoc/votorola/a/web/wap/WAP.html - GWT tagging each with a unique ordinal, as it must ( e.g. 'P3' in http://reluk.ca:8080/v/wap?wCall=cCount&cPoll=G%2Fp%2FMetaGov&wNonce=s8z015&cBase&wCallback=__gwt_jsonp__.P3.onSuccess ( http://reluk.ca/sys/host/havoc/opt/gwt/2.5.0+mca.2/doc/javadoc/com/google/gwt/jsonp/client/JsonpRequestBuilder.html - the WAP cannot be statically copied ∴ the stage cannot function statically ∴ the static copy excludes the stage ( also the vote-server, where the stage alone enables a choice of which poll to view ( http://reluk.ca/w/Stuff:Votorola/t/Votorola_vote-server ∴ the static copy needs no toolset switch - updating obsolete references - this method has proved painful = consider moving to (§) redact instead - especially as other such link updates will likely be wanted in future < http://reluk.ca/w/Special:ReplaceText - Original text: zelea.com/system/host/u - Replacement text: reluk.ca/sys/host/obsidian - Check: All = Continue / = Replace / =root@obsidian> php /var/www/localhost/htdocs/mediawiki/maintenance/runJobs.php --type replaceText // it's failing, so: = follow the links and update by manual editing < http://reluk.ca/w/Special:ReplaceText - Original text: system/host/u - Replacement text: sys/host/obsidian - Check: All = do as above < http://reluk.ca/w/Special:ReplaceText - Original text: t.reluk.ca - Replacement text: reluk.ca - Check: All = do as above < http://reluk.ca/w/Special:ReplaceText - Original text: t.zelea.com/wiki - Replacement text: reluk.ca/w - Check: All = do as above < http://reluk.ca/w/Special:ReplaceText - Original text: t.zelea.com - Replacement text: reluk.ca - Check: All = do as above < http://reluk.ca/w/Special:ReplaceText - Original text: u.zelea.com - Replacement text: reluk.ca - Check: All = do as above ──────────────────────────────────────────────────────────────────────────────────────────────────── 2. Copy` < blocking clients root@obsidian> e /etc/conf.d/net = comment out the "default via" routing line =root@obsidian> /etc/init.d/net.enp2s1 restart =mike> sudo mount /mnt/spare > lsl /mnt/spare/tmp/x /mnt/spare/tmp/y = ensure both are empty =mike> pushd /mnt/spare/tmp/x => lsl - if repeating the procedure & there's an unwanted copy here, then clear it away: =mike> (d=../y; rm --recursive $d/*; mv * $d/) - if monitoring is wanted - in a wide terminal somewhere => tail --follow=name --retry /tmp/wiki-copy-wget.log - in a spare terminal =mike> ~/code/votorola/switch/repo/votorola/s/wiki-copy/wget + expect initial failure - likely syntax errors - I broke the *wget* call into multiple calls, and the changes are not tested =mike> popd < unblocking clients ( the reverse of § blocking clients = *uncomment* the line & restart the interface =mike> mv /tmp/wiki-copy-wget.log /mnt/spare/tmp/x/wget.log > lsl /mnt/spare/tmp/x = replace with copy date - all 2018-05-16, here and below =mike> mkdir /mnt/spare/wiki-copy-wget/2018-05-16 =mike> mv /mnt/spare/tmp/x/* /mnt/spare/wiki-copy-wget/2018-05-16/ =mike> chmod --recursive a-w /mnt/spare/wiki-copy-wget/2018-05-16/* =mike> echo 'Made by wiki-copy/wget, http://reluk.ca/project/votorola/s/wiki-copy' > /mnt/spare/wiki-copy-wget/2018-05-16/README =mike> sudo umount /mnt/spare ──────────────────────────────────────────────────────────────────────────────────────────────────── 3. Install` = boot obsidian to its normal root =mike> sudo mount /mnt/lan/obsidian-unbak =mike> rm --force --recursive /mnt/lan/obsidian-unbak/var/www/public/wiki-copy =mike> sudo mount /mnt/spare =mike> cp --recursive --verbose /mnt/spare/wiki-copy-wget/2018-05-16 /mnt/lan/obsidian-unbak/var/www/public/wiki-copy =mike> sudo umount /mnt/spare =mike> sudo umount /mnt/lan/obsidian-unbak =mike@obsidian> chmod --recursive u+w /var/unbak/var/www/public/wiki-copy ( locally, where it runs much faster than on havoc =mike@obsidian> chmod --recursive u-w /var/unbak/var/www/public/wiki-copy/wget.log ──────────────────────────────────────────────────────────────────────────────────────────────────── 4. Redact` ( ~/code/votorola/switch/repo/votorola/s/wiki-copy/redact # good examples of JavaScript form < ~/work/wayic/read/readable.js - Nashorn < ~/sys/bin/screen-share < ~/project/waymaker/Waymaker.js < ~/project/waymaker/spec/build/* =mike> sudo mount /mnt/lan/obsidian-unbak - semi-manual redaction < pending next copy ( see § Prepare server § corrections > e /usr/local/bin/zz-ed = set to * § Sys '/mnt/lan/obsidian-unbak/var/www/public/wiki-copy', * § Editorial commands $mod_count += ( $line =~ s;^()$;$1sys/host/obsidian$2;g ); => zz-ed =mike> ~/code/votorola/switch/repo/votorola/s/wiki-copy/redact =mike> sudo umount /mnt/lan/obsidian-unbak ──────────────────────────────────────────────────────────────────────────────────────────────────── 5. Archive` - archiving a backup copy of the raw, unredacted copy - backing up the immediate product of § Copy, that is - because its production is costly = consider first using the redacted copy long enough to prove it before proceeding further =mike> sudo mount /mnt/spare => XZ_OPT='-9 --threads=0' nice tar --create --xz --totals --file=/tmp/wiki-copy-wget-2018-05-16.tar.xz --directory=/mnt/spare/wiki-copy-wget/2018-05-16 . ( --threads=0 : the same as the processor count => chmod u-w /tmp/wiki-copy-wget-2018-05-16.tar.xz =root> mv /tmp/wiki-copy-wget-2018-05-16.tar.xz /mnt/spare/backup/ > lsl /mnt/spare/backup/wiki-copy-wget-* = decide the disc format ( zz-txt § Optical disc § capacity = insert disc | CD-R => cdrecord -media-info => mkisofs -o /tmp/backup.iso -r /mnt/spare/backup/wiki-copy-wget-2018-05-16.tar.xz ( -r : sanitized Rock Ridge extensions => cdrecord -v [speed=0] /tmp/backup.iso ( speed=0 : if disc is of doubtable quality => eject && eject -t => mount /mnt/cdrom ( in order to verify => cmp /mnt/cdrom/wiki-copy-wget-2018-05-16.tar.xz /mnt/spare/backup/wiki-copy-wget-2018-05-16.tar.xz ( expect no output => umount /mnt/cdrom => rm /tmp/backup.iso =mike> sudo umount /mnt/spare = label the disc ' wiki-copy wget ' 2018-05-16