Manual push Fri Jun 9 12:16:37 AM CEST 2023

This commit is contained in:
octospacc 2023-06-09 00:16:37 +02:00
parent d1e396e1ac
commit 5a5714ff49
19 changed files with 72 additions and 47 deletions

View File

@ -22,7 +22,7 @@ jobs:
sudo npm install -g tiddlywiki sudo npm install -g tiddlywiki
sudo pip3 install beautifulsoup4 html5lib sudo pip3 install beautifulsoup4 html5lib
bash ./Bootstrap.sh bash ./Bootstrap.sh
sh ./GitHub.Main.sh bash ./Deploy.Main.sh
- name: Deploy - name: Deploy
uses: JamesIves/github-pages-deploy-action@v4 uses: JamesIves/github-pages-deploy-action@v4

View File

@ -10,7 +10,7 @@ pages:
stage: deploy stage: deploy
script: | script: |
ash ./Bootstrap.sh ash ./Bootstrap.sh
ash ./GitLab.Main.sh ash ./Deploy.Main.sh
artifacts: artifacts:
paths: paths:
- public - public

3
Bootstrap.sh Normal file → Executable file
View File

@ -1,4 +1,5 @@
#!/bin/bash #!/bin/bash
set -e # Exit on any error
# Ensure important directories # Ensure important directories
mkdir -vp ./Repo mkdir -vp ./Repo
@ -25,7 +26,7 @@ cd ..
# Move the files of this repo to overwrite the extracted ones, then move everything back # 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 # 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/ mv ./Repo.tmp/* ./Repo/
# Move everything to the working directory, ready for the next CI steps # Move everything to the working directory, ready for the next CI steps

View File

@ -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

View File

@ -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

View File

@ -35,4 +35,10 @@ After this, I installed Windows 10 (a build from 2019 I have on a burned DVD alw
!! Hardening Windows !! 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) [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.

View File

@ -2,7 +2,7 @@
. ./Src.*.sh || true . ./Src.*.sh || true
# Update time of last edit # Update time of last edit
sh ./OcttKB.EmptyDate.sh || true sh ./EmptySetDate.sh || true
# Ensure important directories # Ensure important directories
rm -rf ./Output.tmp || true rm -rf ./Output.tmp || true

View File

@ -3,5 +3,5 @@ creator: Octt
modified: 20230417120312165 modified: 20230417120312165
modifier: Octt modifier: Octt
tags: tags:
title: $:/OcttKB/Repo/GitHub.Main.sh title: $:/OcttKB/Repo/Deploy.Main.sh
type: text/plain type: text/plain

View File

@ -10,9 +10,9 @@ tiddlywiki \
--rendertiddler $:/core/templates/alltiddlers.template.html Static.html text/plain --rendertiddler $:/core/templates/alltiddlers.template.html Static.html text/plain
# Apply patches to the static HTML # Apply patches to the static HTML
python3 ../PatchStatic.py python3 ../PatchStatic.py ./Static.html
# Deploy copies of immediately previous versions # Deploy copies of immediately previous versions
Url="https://kb.octt.eu.org" 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 wget -O ./-2.html "$Url/-1.html" || true

View File

@ -0,0 +1,6 @@
created: 20230414104412035
creator: Octt
modified: 20230414104554549
modifier: Octt
title: $:/OcttKB/Repo/EmptySetDate.sh
type: text/plain

View File

@ -1,3 +1,4 @@
#!/bin/sh #!/bin/sh
. ./Src.*.sh || true . ./Src.*.sh || true
sh ./BuildSPA.sh
sh ./DeployAll.sh sh ./DeployAll.sh

View File

@ -1,12 +1,35 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
from base64 import b64encode
from bs4 import BeautifulSoup from bs4 import BeautifulSoup
from re import sub 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'''\
<!DOCTYPE html>
<html>
<body>{Content}</body>
</html>
'''
def Fix1(m): def Fix1(m):
return f'<details><a name="{m.group(1)}"></a><summary>{m.group(2)}</summary>' return f'<details><a name="{m.group(1)}"></a><summary>{m.group(2)}</summary>'
Source = str(BeautifulSoup(open(File, 'r'), 'html5lib')); def SafeIframe(m):
SrcData = m.group(2)
SrcData = b64encodeStr(MkHtml(f'<a href="{SrcData}">Click to load: {SrcData}</a>'))
return f'<iframe {m.group(1)} src="{B64Prefix}{SrcData}"></iframe>'
open(File, 'w').write(sub('<details><a name="(.+)"><summary>(.+)<\/summary>\s*<\/a>', Fix1, Source)); Html = str(BeautifulSoup(open(File, 'r'), 'html5lib'))
Html = sub('<details><a name="(.+)"><summary>(.+)<\/summary>\s*<\/a>', Fix1, Html)
Html = sub('<iframe( +)src="(.+)"><\/iframe>', SafeIframe, Html)
Html = sub('<iframe (.+) src="(.+)"><\/iframe>', SafeIframe, Html)
open(File, 'w').write(Html)

View File

@ -18,9 +18,9 @@ TryCrossRepoSync(){
CommitMsg0="$("OcttKB Cross-Repo Sync" | ToLower)" CommitMsg0="$("OcttKB Cross-Repo Sync" | ToLower)"
[ "$CommitCheck" != "$CommitMsg0 (html to raw)" ] && \ [ "$CommitCheck" != "$CommitMsg0 (html to raw)" ] && \
[ "$CommitCheck" != "$CommitMsg0 (raw to html)" ] && \ [ "$CommitCheck" != "$CommitMsg0 (raw to html)" ] && \
[ "$CommitCheck" != "$CommitMsg0 (htm to raw)" ] && \ [ "$CommitCheck" != "$CommitMsg0 (htm to raw)" ] && \
[ "$CommitCheck" != "$CommitMsg0 (raw to htm)" ] && \ [ "$CommitCheck" != "$CommitMsg0 (raw to htm)" ] && \
[ "$CommitCheck" != "$CommitMsg0 (web to raw)" ] && \ [ "$CommitCheck" != "$CommitMsg0 (web to raw)" ] && \
[ "$CommitCheck" != "$CommitMsg0 (raw to web)" ] && \ [ "$CommitCheck" != "$CommitMsg0 (raw to web)" ] && \
sh ./GitLab.CrossRepoSync.sh || true sh ./GitLab.CrossRepoSync.sh || true
} }

View File

@ -1,5 +1,3 @@
#!/bin/sh #!/bin/sh
ToLower(){ ToLower(){ echo "$1" | tr "[:upper:]" "[:lower:]"; }
echo "$1" | tr "[:upper:]" "[:lower:]"
}

View File

@ -54,7 +54,9 @@ title: $:/Styles/Breadcrumbs
.tc-static-story-river > .tc-tiddler-frame > .tc-tiddler-title details > summary, .tc-static-story-river > .tc-tiddler-frame > .tc-tiddler-title details > summary,
.View-Breadcrumbs details > summary { .View-Breadcrumbs details > summary {
width: fit-content;
list-style: none; list-style: none;
cursor: pointer;
} }
tc-table-of-contents tc-table-of-contents

View File

@ -14,4 +14,4 @@
"tiddlywiki/starlight", "tiddlywiki/starlight",
"tiddlywiki/vanilla" "tiddlywiki/vanilla"
] ]
} }

View File

@ -1,14 +1,27 @@
#!/bin/sh #!/bin/sh
set -e # Exit on any error
cd "$( dirname "$( realpath "$0" )" )" cd "$( dirname "$( realpath "$0" )" )"
pull() { pull(){
git pull git pull
} }
push() { push(){
git add . git add .
git commit -m "Manual push $(date)" git commit -m "Manual push $(date)"
git push git push
} }
$1 deploy(){
Path="$1"
[ -n "$Path" ] || Path="/tmp/OcttKB-Deploy"
echo "Local Deploy to: $Path"
sleep 5
rm -rf "$Path"
cp -r . "$Path"
cd "$Path"
bash ./Bootstrap.sh
bash ./Deploy.Main.sh
}
$@