From 0c12bf47d6afd9171288eb3580ec4d5aca225810 Mon Sep 17 00:00:00 2001 From: "Alexander \"Arav\" Andreev" Date: Sun, 28 Nov 2021 03:41:13 +0400 Subject: [PATCH] Fixed a clusterfuck with links. Added set of links to Git service. And made them dynamic on stuff page. --- homepage/index.js | 6 +++--- homepage/views/rss.pug | 2 +- homepage/views/stuff.pug | 15 +++++++-------- shared/util.js | 3 +++ 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/homepage/index.js b/homepage/index.js index b7d1231..f7b19d8 100644 --- a/homepage/index.js +++ b/homepage/index.js @@ -52,8 +52,7 @@ function setRoutes() { ctx.type = 'xml'; await ctx.render('rss', { doctype: 'xml', - protocol: ctx.protocol, - host: ctx.header.host, + schemahost: `${ctx.header.schema}://${ctx.header.host}`, author: "me@arav.top (Alexander \"Arav\" Andreev)", items: await mindflow.getPostsForRSS() }) @@ -61,7 +60,8 @@ function setRoutes() { .get('/stuff', async ctx => { await ctx.render('stuff', { title: "/ Stuff", - description: "Here I share my programs, scripts, articles, may be other stuff." + description: "Here I share my programs, scripts, articles, may be other stuff.", + git_site: util.getServiceByHost(ctx.request.host, "git") }) }) .get('/mindflow', async ctx => { diff --git a/homepage/views/rss.pug b/homepage/views/rss.pug index 649f743..d411e5c 100644 --- a/homepage/views/rss.pug +++ b/homepage/views/rss.pug @@ -5,7 +5,7 @@ rss(version='2.0') title Arav's dwelling description Updates on my websites and infrastructure. language en-gb - link #{protocol}://#{host}/ + link= schemahost each item in items item diff --git a/homepage/views/stuff.pug b/homepage/views/stuff.pug index 1ad0ad6..62926d5 100644 --- a/homepage/views/stuff.pug +++ b/homepage/views/stuff.pug @@ -44,7 +44,7 @@ block content td Go td GPLv3 td - a(href='http://git.arav.top/Arav/httpprocwatchd') source + a(href=git_site+'/Arav/httpprocwatchd') source tr td(colspan='5') p It is a process watcher that gives processes' statuses in a JSON format via HTTP GET request on /processes endpoint. Under the hood it calls a pgrep to get PIDs by process name. It is being used on about page to show wether service's running or not. @@ -54,9 +54,9 @@ block content td Python td MIT td - a(href='http://git.arav.top/Arav/PiggyBank') source + a(href=git_site+'/Arav/PiggyBank') source | - a(href='http://git.arav.top/Arav/PiggyBank/releases') releases + a(href=git_site+'/Arav/PiggyBank/releases') releases tr td(colspan='5') p One of the most autistic shit I ever made. :) @@ -68,9 +68,9 @@ block content td Python td MIT td - a(href='http://git.arav.top/Arav/ScrapTheChan') source + a(href=git_site+'/Arav/ScrapTheChan') source | - a(href='http://git.arav.top/Arav/ScrapTheChan/releases') releases + a(href=git_site+'/Arav/ScrapTheChan/releases') releases tr td(colspan='5') p Imageboards file scraper using theirs JSON API. Currently supported: 4chan.org, lainchan.org, 2ch.hk and 8kun.top. @@ -80,11 +80,10 @@ block content td Bash td MIT td - a(href='http://git.arav.top/Arav/opennic-extract-domains') source + a(href=git_site+'/Arav/opennic-extract-domains') source tr td(colspan='5') 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=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. - + 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. \ No newline at end of file diff --git a/shared/util.js b/shared/util.js index b9a9da9..5b0a11e 100644 --- a/shared/util.js +++ b/shared/util.js @@ -25,18 +25,21 @@ exports.getServiceByHost = (host, service="") => { switch (service) { case "radio": return "http://wsmkgnmhmzqm7kyzv7jnzzafvgm7xlmlfvzhgorpapd5or2arnhuktqd.onion"; case "files": return "http://qf5e43nlhvnrutmikuvbdfj3cmtthokpbaxtkm6mjlslttzvtgm4fxid.onion"; + case "git": return "http://qqitm7qlsbbubwmjos4cqzmvkqidg34rfnbyhuydhalep33fbvh22xyd.onion"; default: return "http://moq7aejnf4xk5k2bkaltli3ftkhusy2mbrd3pj23nrca343ku2mgk4yd.onion"; } else if (host.endsWith("i2p")) switch (service) { case "radio": return "http://radio.arav.i2p"; case "files": return "http://files.arav.i2p"; + case "git": return "http://git.arav.i2p"; default: return "http://arav.i2p"; } else switch (service) { case "radio": return "https://radio.arav.top"; case "files": return "https://files.arav.top"; + case "git": return "https://git.arav.top"; default: return "https://arav.top"; } }