diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fe5831f..8c9dc3a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -22,7 +22,7 @@ jobs: sudo npm install -g tiddlywiki sudo pip3 install beautifulsoup4 html5lib bash ./Bootstrap.sh - sh ./GitHub.Main.sh + bash ./Deploy.Main.sh - name: Deploy uses: JamesIves/github-pages-deploy-action@v4 diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 94123ca..b9a2ded 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -10,7 +10,7 @@ pages: stage: deploy script: | ash ./Bootstrap.sh - ash ./GitLab.Main.sh + ash ./Deploy.Main.sh artifacts: paths: - public diff --git a/Bootstrap.sh b/Bootstrap.sh old mode 100644 new mode 100755 index 9ace6c8..2b95c77 --- a/Bootstrap.sh +++ b/Bootstrap.sh @@ -1,4 +1,5 @@ #!/bin/bash +set -e # Exit on any error # Ensure important directories mkdir -vp ./Repo @@ -25,7 +26,7 @@ cd .. # Move the files of this repo to overwrite the extracted ones, then move everything back # This is so, if present, files from the repo are preferred, if needed in case of emergency -mv ./Repo/* ./Repo.tmp/ +mv ./Repo/* ./Repo.tmp/ || true mv ./Repo.tmp/* ./Repo/ # Move everything to the working directory, ready for the next CI steps diff --git a/GitLab.CrossRepoSync.sh.old b/GitLab.CrossRepoSync.sh.old deleted file mode 100644 index d66d45b..0000000 --- a/GitLab.CrossRepoSync.sh.old +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -TargetRepo="OcttKB.Web" -git clone --depth 1 https://gitlab.com/octtspacc/$TargetRepo ./Repo-$TargetRepo -cd ./Repo-$TargetRepo -cp -v ../Output.tmp/index.html ./public/index.html -git add . -git commit -m "OcttKB Cross-Repo Sync (Raw to HTML)" -git push diff --git a/GitLab.Main.sh b/GitLab.Main.sh deleted file mode 100755 index 611451a..0000000 --- a/GitLab.Main.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh -. ./Src.*.sh || true -sh ./OcttKB.EmptyDate.sh || true - -# Ensure important directories -rm -rf ./Output.tmp || true - -# Build HTML TiddlyWiki -tiddlywiki \ - ./Wiki-OcttKB \ - --verbose \ - --output ./Output.tmp \ - --rendertiddler "$:/core/save/all" "index.html" "text/plain" - -mkdir -vp ./public -cp -v ./Output.tmp/index.html ./public/index.html -sh ./Main.sh diff --git a/Wiki-OcttKB/tiddlers/Normal/SEB 3.5.0 on Linux (VM Bypass).tid b/Wiki-OcttKB/tiddlers/Normal/SEB 3.5.0 on Linux (VM Bypass).tid index 675f160..2add054 100644 --- a/Wiki-OcttKB/tiddlers/Normal/SEB 3.5.0 on Linux (VM Bypass).tid +++ b/Wiki-OcttKB/tiddlers/Normal/SEB 3.5.0 on Linux (VM Bypass).tid @@ -35,4 +35,10 @@ After this, I installed Windows 10 (a build from 2019 I have on a burned DVD alw !! Hardening Windows +In this case "hardening" is meant as enhancing the privacy of our Windows against third-party apps, which we need to evade VM detection; we don't mean it as making the system more secure or robust for an exam purpose, which is something neutral to us (we as examinees don't care about it, it does neither benefit nor harm us). + [TODO] (https://pastebin.com/XEn7BykP) + +!! No abuse + +Be careful of only using this information if you actually need to run SEB on Linux or have other issues. Do not abuse the guide to create a VM for doing the exam and then getting out of it mid-session to use the host system normally and cheat. The procedure is not intended for cheating and if we start using it to do that, examiners will push for the holes that allow VM detection to be patched. If we only use it for valid reasons of OS compatibility, likely no one will protest and we will not be forced to use an OS we don't like as host on our computers. If you have to cheat at the written exam then you will fail the oral exam anyways, so study and don't use this method for cheating. diff --git a/Wiki-OcttKB/tiddlers/System/$__OcttKB_Repo_BuildSPA.sh.txt b/Wiki-OcttKB/tiddlers/System/$__OcttKB_Repo_BuildSPA.sh.txt index 22ccee2..115f19b 100644 --- a/Wiki-OcttKB/tiddlers/System/$__OcttKB_Repo_BuildSPA.sh.txt +++ b/Wiki-OcttKB/tiddlers/System/$__OcttKB_Repo_BuildSPA.sh.txt @@ -2,7 +2,7 @@ . ./Src.*.sh || true # Update time of last edit -sh ./OcttKB.EmptyDate.sh || true +sh ./EmptySetDate.sh || true # Ensure important directories rm -rf ./Output.tmp || true diff --git a/Wiki-OcttKB/tiddlers/System/$__OcttKB_Repo_GitHub.Main.sh.txt b/Wiki-OcttKB/tiddlers/System/$__OcttKB_Repo_Deploy.Main.sh.txt similarity index 100% rename from Wiki-OcttKB/tiddlers/System/$__OcttKB_Repo_GitHub.Main.sh.txt rename to Wiki-OcttKB/tiddlers/System/$__OcttKB_Repo_Deploy.Main.sh.txt diff --git a/Wiki-OcttKB/tiddlers/System/$__OcttKB_Repo_GitHub.Main.sh.txt.meta b/Wiki-OcttKB/tiddlers/System/$__OcttKB_Repo_Deploy.Main.sh.txt.meta similarity index 62% rename from Wiki-OcttKB/tiddlers/System/$__OcttKB_Repo_GitHub.Main.sh.txt.meta rename to Wiki-OcttKB/tiddlers/System/$__OcttKB_Repo_Deploy.Main.sh.txt.meta index defa977..f956200 100644 --- a/Wiki-OcttKB/tiddlers/System/$__OcttKB_Repo_GitHub.Main.sh.txt.meta +++ b/Wiki-OcttKB/tiddlers/System/$__OcttKB_Repo_Deploy.Main.sh.txt.meta @@ -3,5 +3,5 @@ creator: Octt modified: 20230417120312165 modifier: Octt tags: -title: $:/OcttKB/Repo/GitHub.Main.sh -type: text/plain \ No newline at end of file +title: $:/OcttKB/Repo/Deploy.Main.sh +type: text/plain diff --git a/Wiki-OcttKB/tiddlers/System/$__OcttKB_Repo_DeployAll.sh.txt b/Wiki-OcttKB/tiddlers/System/$__OcttKB_Repo_DeployAll.sh.txt index a60893d..48d6a8e 100644 --- a/Wiki-OcttKB/tiddlers/System/$__OcttKB_Repo_DeployAll.sh.txt +++ b/Wiki-OcttKB/tiddlers/System/$__OcttKB_Repo_DeployAll.sh.txt @@ -10,9 +10,9 @@ tiddlywiki \ --rendertiddler $:/core/templates/alltiddlers.template.html Static.html text/plain # Apply patches to the static HTML -python3 ../PatchStatic.py +python3 ../PatchStatic.py ./Static.html # Deploy copies of immediately previous versions Url="https://kb.octt.eu.org" -wget -O ./-1.html "$Url" || true +wget -O ./-1.html "$Url" || true wget -O ./-2.html "$Url/-1.html" || true diff --git a/OcttKB.EmptyDate.sh b/Wiki-OcttKB/tiddlers/System/$__OcttKB_Repo_EmptySetDate.sh.txt old mode 100755 new mode 100644 similarity index 100% rename from OcttKB.EmptyDate.sh rename to Wiki-OcttKB/tiddlers/System/$__OcttKB_Repo_EmptySetDate.sh.txt diff --git a/Wiki-OcttKB/tiddlers/System/$__OcttKB_Repo_EmptySetDate.sh.txt.meta b/Wiki-OcttKB/tiddlers/System/$__OcttKB_Repo_EmptySetDate.sh.txt.meta new file mode 100644 index 0000000..af39c54 --- /dev/null +++ b/Wiki-OcttKB/tiddlers/System/$__OcttKB_Repo_EmptySetDate.sh.txt.meta @@ -0,0 +1,6 @@ +created: 20230414104412035 +creator: Octt +modified: 20230414104554549 +modifier: Octt +title: $:/OcttKB/Repo/EmptySetDate.sh +type: text/plain diff --git a/Wiki-OcttKB/tiddlers/System/$__OcttKB_Repo_Main.sh.txt b/Wiki-OcttKB/tiddlers/System/$__OcttKB_Repo_Main.sh.txt index f1446ff..a23e871 100644 --- a/Wiki-OcttKB/tiddlers/System/$__OcttKB_Repo_Main.sh.txt +++ b/Wiki-OcttKB/tiddlers/System/$__OcttKB_Repo_Main.sh.txt @@ -1,3 +1,4 @@ #!/bin/sh . ./Src.*.sh || true +sh ./BuildSPA.sh sh ./DeployAll.sh diff --git a/Wiki-OcttKB/tiddlers/System/$__OcttKB_Repo_PatchStatic.py.txt b/Wiki-OcttKB/tiddlers/System/$__OcttKB_Repo_PatchStatic.py.txt index 5e7c90c..04d1a36 100644 --- a/Wiki-OcttKB/tiddlers/System/$__OcttKB_Repo_PatchStatic.py.txt +++ b/Wiki-OcttKB/tiddlers/System/$__OcttKB_Repo_PatchStatic.py.txt @@ -1,12 +1,35 @@ #!/usr/bin/env python3 +from base64 import b64encode from bs4 import BeautifulSoup from re import sub +from sys import argv -File = 'Static.html' +File = argv[-1] +B64Prefix = 'data:text/html;base64,' + +def b64encodeStr(Data): + return b64encode(Data.encode()).decode() + +def MkHtml(Content:str): + return f'''\ + + + {Content} + +''' def Fix1(m): return f'
{m.group(2)}' -Source = str(BeautifulSoup(open(File, 'r'), 'html5lib')); +def SafeIframe(m): + SrcData = m.group(2) + SrcData = b64encodeStr(MkHtml(f'Click to load: {SrcData}')) + return f'' -open(File, 'w').write(sub('
(.+)<\/summary>\s*<\/a>', Fix1, Source)); +Html = str(BeautifulSoup(open(File, 'r'), 'html5lib')) + +Html = sub('
(.+)<\/summary>\s*<\/a>', Fix1, Html) +Html = sub('<\/iframe>', SafeIframe, Html) +Html = sub('