Skip to content

Commit

Permalink
Manual push Fri Jun 9 12:16:37 AM CEST 2023
Browse files Browse the repository at this point in the history
  • Loading branch information
octospacc committed Jun 8, 2023
1 parent d1e396e commit 5a5714f
Show file tree
Hide file tree
Showing 19 changed files with 72 additions and 47 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pages:
stage: deploy
script: |
ash ./Bootstrap.sh
ash ./GitLab.Main.sh
ash ./Deploy.Main.sh
artifacts:
paths:
- public
3 changes: 2 additions & 1 deletion Bootstrap.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
set -e # Exit on any error

# Ensure important directories
mkdir -vp ./Repo
Expand All @@ -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
Expand Down
8 changes: 0 additions & 8 deletions GitLab.CrossRepoSync.sh.old

This file was deleted.

17 changes: 0 additions & 17 deletions GitLab.Main.sh

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -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.
2 changes: 1 addition & 1 deletion Wiki-OcttKB/tiddlers/System/$__OcttKB_Repo_BuildSPA.sh.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ creator: Octt
modified: 20230417120312165
modifier: Octt
tags:
title: $:/OcttKB/Repo/GitHub.Main.sh
type: text/plain
title: $:/OcttKB/Repo/Deploy.Main.sh
type: text/plain
4 changes: 2 additions & 2 deletions Wiki-OcttKB/tiddlers/System/$__OcttKB_Repo_DeployAll.sh.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
created: 20230414104412035
creator: Octt
modified: 20230414104554549
modifier: Octt
title: $:/OcttKB/Repo/EmptySetDate.sh
type: text/plain
1 change: 1 addition & 0 deletions Wiki-OcttKB/tiddlers/System/$__OcttKB_Repo_Main.sh.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/sh
. ./Src.*.sh || true
sh ./BuildSPA.sh
sh ./DeployAll.sh
29 changes: 26 additions & 3 deletions Wiki-OcttKB/tiddlers/System/$__OcttKB_Repo_PatchStatic.py.txt
Original file line number Diff line number Diff line change
@@ -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'''\
<!DOCTYPE html>
<html>
<body>{Content}</body>
</html>
'''

def Fix1(m):
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>'

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(sub('<details><a name="(.+)"><summary>(.+)<\/summary>\s*<\/a>', Fix1, Source));
open(File, 'w').write(Html)
8 changes: 4 additions & 4 deletions Wiki-OcttKB/tiddlers/System/$__OcttKB_Repo_Src.Git.sh.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ TryCrossRepoSync(){
CommitMsg0="$("OcttKB Cross-Repo Sync" | ToLower)"
[ "$CommitCheck" != "$CommitMsg0 (html to raw)" ] && \
[ "$CommitCheck" != "$CommitMsg0 (raw to html)" ] && \
[ "$CommitCheck" != "$CommitMsg0 (htm to raw)" ] && \
[ "$CommitCheck" != "$CommitMsg0 (raw to htm)" ] && \
[ "$CommitCheck" != "$CommitMsg0 (web to raw)" ] && \
[ "$CommitCheck" != "$CommitMsg0 (raw to web)" ] && \
[ "$CommitCheck" != "$CommitMsg0 (htm to raw)" ] && \
[ "$CommitCheck" != "$CommitMsg0 (raw to htm)" ] && \
[ "$CommitCheck" != "$CommitMsg0 (web to raw)" ] && \
[ "$CommitCheck" != "$CommitMsg0 (raw to web)" ] && \
sh ./GitLab.CrossRepoSync.sh || true
}
4 changes: 1 addition & 3 deletions Wiki-OcttKB/tiddlers/System/$__OcttKB_Repo_Src.Misc.sh.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/bin/sh

ToLower(){
echo "$1" | tr "[:upper:]" "[:lower:]"
}
ToLower(){ echo "$1" | tr "[:upper:]" "[:lower:]"; }
2 changes: 2 additions & 0 deletions Wiki-OcttKB/tiddlers/System/$__Styles_Breadcrumbs.tid
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ title: $:/Styles/Breadcrumbs

.tc-static-story-river > .tc-tiddler-frame > .tc-tiddler-title details > summary,
.View-Breadcrumbs details > summary {
width: fit-content;
list-style: none;
cursor: pointer;
}

tc-table-of-contents
Expand Down
2 changes: 1 addition & 1 deletion Wiki-OcttKB/tiddlywiki.info
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
"tiddlywiki/starlight",
"tiddlywiki/vanilla"
]
}
}
19 changes: 16 additions & 3 deletions local.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,27 @@
#!/bin/sh
set -e # Exit on any error
cd "$( dirname "$( realpath "$0" )" )"

pull() {
pull(){
git pull
}

push() {
push(){
git add .
git commit -m "Manual push $(date)"
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
}

$@

0 comments on commit 5a5714f

Please sign in to comment.