This website is powered by wiki.js
Used the built in Let's Encrypt support. https://docs.requarks.io/install/config#https
Enable redirecting HTTP requests to HTTPS in Settings -> SSL
Settings -> Authentication
I added Google, GitHub, and Discord
This is so that the only password stored on the server is the admin password. All other accounts will be saved as read-only public-info oauth client keys.
Also hide the local login option (except if ?all added to URL) in Settings -> Security
Set up git backup so that all changes are recorded to a git repository.
Basic search only checks titles and page descriptions.
To also search page contents:
Use Windows Task Scheduler to run the server after boot.
Something like this:
C:\Windows\System32\cmd.exe /K "node server >c:\stuff\wiki_log.txt 2>&1"
c:\wiki
GoDaddy instructions for setting up DNS:
Sign in and select the custom domain you want to use.
In the Domains section, select Manage All, then select DNS | Manage Zones.
For Domain Name, enter your custom domain, then select Search.
From the DNS Management page, select Add, then select A in the Type list.
Complete the fields of the A entry:
Type: Leave A selected.
Host: Enter @
Points to: Enter the Public IP Address or FQDN of your VM.
TTL: Leave one hour selected.
Select Save.
Next go to General settings and change the site URL to the new domain; in this case: https://happycherry.net
https://jrudlin.github.io/2018/10/27/domain-name-registration-transfer-to-azure-app-service-domains/
{
location: "Global",
properties: {
contactAdmin: "Oleks Korshak",
contactBilling: "Oleks Korshak",
contactRegistrant: "Oleks Korshak",
contactTech: "Oleks Korshak",
privacy: "True",
autoRenew: "True",
authCode: "##################",
Consent: {
agreedAt: "2021-09-20T23:30:00",
agreedBy: "73.109.22.118", // <- your ip address goes here
agreementKeys: ["DNPA","DNTA"]
}
}
}
Added custom javascript to display featured and random page cards on welcome page. Use 'featured' tag to include page in featured and use 'wip' tag to exclude from random
embedded css:
.contents .v-navigation-drawer {
left: calc(0%)!important
}
.contents .v-main {
padding-left: calc(0% + 256px)!important;
width: calc(100%)!important
}
.contents .login-sd {
width: 300px;
height: unset
}
.contents .column-container {
column-width: 36rem;
margin-top: 1rem
}
.contents .card {
border-style: solid;
border-width: 2px;
border-radius: .5rem;
width: 36rem;
margin: 0 0 1rem 0;
padding: 1.25rem;
-webkit-column-break-inside: avoid;
page-break-inside: avoid;
break-inside: avoid;
text-align: center;
}
.contents .card-img-top {
width: 36rem
}
.contents .card * {
margin: 0!important
}
.contents .card :after {
content: none!important
}
.contents .card a {
text-decoration: none
}
embedded javascript:
<script>
// adapted from https://github.com/madodig/wikijs-customization
function log(obj){console.log(obj);}
var addSiteTitleNavigation = true;
var removeQueryByTag = true;
var removeBreadcrumbs = true;
var removeTagCard = true;
var removeBookmarkCard = true;
var removeHistoryCard = true;
var mo = new MutationObserver(moCallback);
var moConfig = { attributes: true, childList: true, subtree: true, characterDataOldValue: true, attributeOldValue: true };
var moTarget = document;
moStart();
function moStart() {
mo.observe(moTarget, moConfig);
}
function moStop() {
mo.disconnect();
}
function moCallback(mutations, mutationObserver) {
header = document.querySelector("header[data-booted='true']");
navigation = document.querySelector("nav[data-booted='true']");
main = document.querySelector("main[data-booted='true']");
footer = document.querySelector("footer[data-booted='true']");
btnToTop = document.querySelector("i.mdi-arrow-up");
if(header) {
updateHeader(header);
}
if(navigation) {
updateNavigation(navigation);
}
if(main) {
updateMain(main);
}
if(footer) {
updateFooter(footer);
}
if(btnToTop) {
updateButtonToTop(btnToTop);
}
}
function updateHeader(header) {
if (addSiteTitleNavigation) {
var subHeading = header.querySelector("span.subheading");
if (subHeading) {
subHeading.style.cssText = "cursor: pointer;";
subHeading.addEventListener("click", function () {
window.location = "/";
});
addSiteTitleNavigation = false;
}
}
if(removeQueryByTag) {
var queryByTag = header.querySelector("div.v-toolbar__content a[href='/t']");
if(queryByTag) {
queryByTag.remove();
removeQueryByTag = false;
}
}
}
function updateNavigation(navigation) {
}
function updateMain(main) {
breadcrumbs = main.querySelector("header");
if (removeBreadcrumbs) {
if (breadcrumbs) {
if (breadcrumbs.nextSibling) {
breadcrumbs.nextSibling.remove();
}
breadcrumbs.remove();
removeBreadcrumbs = false;
}
}
var vCards = main.querySelectorAll("div.v-card.v-sheet");
Array.from(vCards).forEach((vCard) => {
if (removeTagCard && vCard.innerHTML.includes("mdi-tag")) {
vCard.remove();
removeTagCard = false;
}
if (removeBookmarkCard && vCard.innerHTML.includes("mdi-bookmark")) {
vCard.remove();
removeBookmarkCard = false;
}
if (removeHistoryCard && (vCard.innerHTML.includes("mdi-history") || (vCard.innerHTML.includes("caption") && !vCard.innerHTML.includes('role="listitem"') && !vCard.innerHTML.includes("mdi-tag")))) {
vCard.remove();
removeHistoryCard = false;
}
});
// moves table of contents to right side
sideColumn = main.querySelector("div.flex.page-col-sd.lg3.xl2");
if (sideColumn && sideColumn.nextElementSibling) {
insertAfter(sideColumn, sideColumn.nextElementSibling);
var pageHeader = main.querySelector("div.offset-lg-3.offset-xl-2");
if (pageHeader) {
pageHeader.classList.remove("offset-lg-3", "offset-xl-2");
}
}
}
function updateFooter(footer) {
footer.remove();
}
function updateButtonToTop(btnToTop) {
}
function insertAfter(el, referenceNode) {
referenceNode.parentNode.insertBefore(el, referenceNode.nextSibling);
}
</script>
https://wiki.akky.me/en/blog/wikijs-favicon
Buy ssl certificate from azure portal
Verify domain ownership following portal instructions (I hosted a temporary simple python http server in order to serve the appropriate file at the path C:\ssl.well-known\pki-validation\godaddy.html)
python -m http.server 80
in C:\ssl\
Download the certificate as a pfx file and add the ssl info to the config.yml for kswiki
Add 443 exception to the firewall
Add 443 rule to the VM networking settings
Enable automatic https redirect in the wiki ssl settings
And voila!
Update the wiki.js config.yml file to use the new certificates:
ssl:
enabled: true
port: 443
provider: custom
format: pem
key: C:\Certbot\live\happycherry.net\privkey.pem
cert: C:\Certbot\live\happycherry.net\cert.pem
passphrase: null
dhparam: null
Enable redirecting HTTP requests to HTTPS in Settings -> SSL