Updated links. Added modifying links' hostnames based on host of visited site.

This commit is contained in:
Alexander Andreev 2021-02-11 02:57:18 +04:00
parent e44321a2eb
commit 9000d3b2f7
Signed by: Arav
GPG Key ID: 610DF2574456329F
8 changed files with 41 additions and 20 deletions

View File

@ -65,6 +65,7 @@ function setRoutes(router) {
await ctx.render('mindflow', {
title: "/ Mindflow",
description: "Here I will post updates on my infrastructure, my very important opinions and thoughts.",
files_site: util.getServiceByHost(ctx.request.host, "files"),
tz: util.getTimezone(ctx),
diary: await mindflow.getPosts("Diary"),
updates: await mindflow.getPosts("Update")
@ -84,6 +85,7 @@ function setRoutes(router) {
await ctx.render('about', {
title: "/ About",
description: "This is a page where I'm telling about me and my home server.",
files_site: util.getServiceByHost(ctx.request.host, "files"),
services: await getProcesses()
})
})

View File

@ -95,7 +95,7 @@ function setRoutes(router) {
await ctx.render('index', {
title: "/ Files",
description: "File share.",
host: util.getBaseHost(ctx.header.host),
main_site: util.getServiceByHost(ctx.header.host),
current_path: makeCurrentPathField(decodeURI(ctx.originalUrl)),
items: await getDirectoryList(file_path, ctx.originalUrl) });
} else {

View File

@ -15,7 +15,7 @@ function setRoutes(router) {
await ctx.render('index', {
title: "/ Radio",
description: "Internet-radio broadcasting from under my desk.",
host: util.getBaseHost(ctx.header.host)
main_site: util.getServiceByHost(ctx.header.host)
});
})
.get('/filelist', async ctx => {

35
util.js
View File

@ -14,15 +14,34 @@ function datetime(date, format=formats.post_date, timezone="UTC") {
return moment.utc(date).tz(timezone).format(format);
}
exports.getServiceByHost = (host, service="") => {
if (host.endsWith("onion"))
switch (service) {
case "radio": return "http://wsmkgnmhmzqm7kyzv7jnzzafvgm7xlmlfvzhgorpapd5or2arnhuktqd.onion";
case "files": return "http://qf5e43nlhvnrutmikuvbdfj3cmtthokpbaxtkm6mjlslttzvtgm4fxid.onion";
default: return "http://moq7aejnf4xk5k2bkaltli3ftkhusy2mbrd3pj23nrca343ku2mgk4yd.onion";
}
else if (host.endsWith("i2p"))
switch (service) {
case "radio": return "http://plkybcgxt4cdanot75cy3pbnqlbqcsrib2fmrpsnug4bqphqvfda.b32.i2p";
case "files": return "http://gajftpr47ze6ao7e3q2tb5xmcqneyaczu4edzvwwg2qzmnernpka.b32.i2p";
default: return "http://t42fkp6zp5dfqywantq3zp427ig3q2onrmfv246tyaztpg4ckb5a.b32.i2p";
}
else
switch (service) {
case "radio": return "https://radio.arav.top";
case "files": return "https://files.arav.top";
default: return "https://arav.top";
}
}
exports.getBaseHost = (host) => {
switch (host) {
case host.endsWith("onion"):
return `http://moq7aejnf4xk5k2bkaltli3ftkhusy2mbrd3pj23nrca343ku2mgk4yd.onion`;
case host.endsWith("b32.i2p"):
return `http://t42fkp6zp5dfqywantq3zp427ig3q2onrmfv246tyaztpg4ckb5a.b32.i2p`;
default:
return "https://arav.top";
}
if (host.endsWith("onion"))
return `http://moq7aejnf4xk5k2bkaltli3ftkhusy2mbrd3pj23nrca343ku2mgk4yd.onion`;
else if (host.endsWith("i2p"))
return `http://t42fkp6zp5dfqywantq3zp427ig3q2onrmfv246tyaztpg4ckb5a.b32.i2p`;
else
return "https://arav.top";
}
exports.getTimezone = getTimezone;

View File

@ -50,9 +50,9 @@ block content
p
a(href='https://radio.arav.top') radio.arav.top
| .
a(href='http://moq7aejnf4xk5k2bkaltli3ftkhusy2mbrd3pj23nrca343ku2mgk4yd.onion/radio/') onion
a(href='http://wsmkgnmhmzqm7kyzv7jnzzafvgm7xlmlfvzhgorpapd5or2arnhuktqd.onion') onion
| .
a(href='http://t42fkp6zp5dfqywantq3zp427ig3q2onrmfv246tyaztpg4ckb5a.b32.i2p/radio/') i2p
a(href='http://plkybcgxt4cdanot75cy3pbnqlbqcsrib2fmrpsnug4bqphqvfda.b32.i2p') i2p
p Runs using Liquidsoap through Icecast, which goes through NGiNX. I broadcast almost everything I have. Sorry, but I'm too lazy to make some kind of broadcasting program to stream so I just randomise the playlist and throw new music there from time to time.
div
h3 FTP and HTTP file share
@ -62,9 +62,9 @@ block content
| ://
a(href='https://files.arav.top') files.arav.top
| .
a(href='http://moq7aejnf4xk5k2bkaltli3ftkhusy2mbrd3pj23nrca343ku2mgk4yd.onion/files/') onion
a(href='http://qf5e43nlhvnrutmikuvbdfj3cmtthokpbaxtkm6mjlslttzvtgm4fxid.onion') onion
| .
a(href='http://t42fkp6zp5dfqywantq3zp427ig3q2onrmfv246tyaztpg4ckb5a.b32.i2p/files/') i2p
a(href='http://gajftpr47ze6ao7e3q2tb5xmcqneyaczu4edzvwwg2qzmnernpka.b32.i2p') i2p
p vsFTPd. And now available through HTTP.
p There you'll find music, videos, films, animes, TV shows, books, games, programs, drivers (a very few), OS images (Winblows :)). Go check it out!
div
@ -102,7 +102,7 @@ block content
div
h3 Mumble
+isServiceUp("murmurd")
p #[a(href="mumble://arav.top") mumble://arav.top].#[a(href="mumble://moq7aejnf4xk5k2bkaltli3ftkhusy2mbrd3pj23nrca343ku2mgk4yd.onion") onion]
p #[a(href="mumble://arav.top") mumble://arav.top]
p It's private, but you still can join an entrance room where you can only write messages. A certificate is necessary.
div
h3 TeamSpeak 3
@ -122,8 +122,8 @@ block content
h3 Minecraft
+isServiceUp("forge-1.16.4")
p.highlighted arav.top:25565
p Version is 1.16.4 currently. I homebrew clients for it. Here is #[a(href="https://files.arav.top/games/minecraft/aravsdwelling-minecraft-1.16.4.exe") an installer for Windows] I make with NSIS. And a #[a(href="https://files.arav.top/games/minecraft/aravsdwelling-minecraft-1.16.4.zip") ZIP archive] that is for both Windows and Linux. You'll need to set a PLAYER and MC_DIR variables in scripts. And change JVM_PARAMS to your preferences (-Xmx usually needs to be adjusted).
p And you can get #[a(href="https://files.arav.top/programs/windows/installators/jre-8u281-windows-x64.exe") jre-8u281-windows-x64.exe] from my file share.
p Version is 1.16.4 currently. I homebrew clients for it. Here is #[a(href=files_site+"/games/minecraft/aravsdwelling-minecraft-1.16.4.exe") an installer for Windows] I make with NSIS. And a #[a(href=files_site+"/games/minecraft/aravsdwelling-minecraft-1.16.4.zip") ZIP archive] that is for both Windows and Linux. You'll need to set a PLAYER and MC_DIR variables in scripts. And change JVM_PARAMS to your preferences (-Xmx usually needs to be adjusted).
p And you can get #[a(href=files_site+"/programs/windows/installators/jre-8u281-windows-x64.exe") jre-8u281-windows-x64.exe] from my file share.
p SHA-1 hash for a Windows installer is D9D97BA99C74176D47C9E163A0E6B723145E5040.
p SHA-1 hash for a ZIP archive is F743FEB9CF8F6C7A0477904C33CD65163E20E049.
div

View File

@ -82,5 +82,5 @@ block content
p Bash script for BIND9 that extracts domains from zone files of OpenNIC and forms a list of domains that have an IP-address.
section#music
h2 Music
p There was a period in my life when I was playing with audio sequencers. I lost all project files and only 3 tracks survived in mp3. <a href="https://files.arav.top/music/My%20tracks,%20that%20survived/">You can get them here</a>. I've maybe like 15-20-ish project files ever created and just like 5 of them was finished.
p There was a period in my life when I was playing with audio sequencers. I lost all project files and only 3 tracks survived in mp3. #[a(href=files_site+"/music/My%20tracks,%20that%20survived/") You can get them here]. I've maybe like 15-20-ish project files ever created and just like 5 of them was finished.

View File

@ -2,7 +2,7 @@ extends base.pug
block nav
nav
a(href=host) Back to main website
a(href=main_site) Back to main website
h1 Files
block content

View File

@ -5,7 +5,7 @@ block head
block nav
nav
a(href=host) Back to main website
a(href=main_site) Back to main website
h1 Radio
block content