From 92f889fe2e8662b8f66329ec1d32961942812605 Mon Sep 17 00:00:00 2001 From: Minteck Date: Wed, 3 Nov 2021 15:19:32 +0100 Subject: Finally fix Gitea --- htdocs/public/assets/css/main.css | 41 +++++++++++++++++++++++++++++++++ htdocs/public/assets/icons/about.svg | 4 ++++ htdocs/public/assets/icons/contact.svg | 4 ++++ htdocs/public/assets/icons/project.svg | 4 ++++ htdocs/public/assets/icons/projects.svg | 4 ++++ htdocs/public/index.ejs | 14 ++++++++--- htdocs/public/projects/index.ejs | 34 +++++++++++++++++++++++++++ server/gitea.js | 5 ++-- 8 files changed, 105 insertions(+), 5 deletions(-) create mode 100644 htdocs/public/assets/icons/about.svg create mode 100644 htdocs/public/assets/icons/contact.svg create mode 100644 htdocs/public/assets/icons/project.svg create mode 100644 htdocs/public/assets/icons/projects.svg create mode 100644 htdocs/public/projects/index.ejs diff --git a/htdocs/public/assets/css/main.css b/htdocs/public/assets/css/main.css index b9f63a8..06a24cd 100644 --- a/htdocs/public/assets/css/main.css +++ b/htdocs/public/assets/css/main.css @@ -104,6 +104,10 @@ a.big-button-bg2 { background: #222; } +a.big-button-bg3 { + background: #151515; +} + .big-button { transition: color 200ms, background 200ms, opacity 200ms; color: white; @@ -163,4 +167,41 @@ a.big-button-bg2 { html, body, #intro, #main { overflow-x: hidden; +} + +.project { + background: #151515; + border: 1px solid #333; + padding: 20px; + border-radius: 5px; +} + +.project-name { + margin: 10px 0; + text-align: center; +} + +.project-icon { + width: 64px; + height: 64px; + display: block; + margin-left: auto; + margin-right: auto; +} + +.project-description, .project-buttons { + text-align: center; +} + +.project-buttons { + margin-top: 30px; +} + +.main-icon { + width: 64px; + margin-top: 10px; +} + +.main-icon-sub { + margin-top: 10px; } \ No newline at end of file diff --git a/htdocs/public/assets/icons/about.svg b/htdocs/public/assets/icons/about.svg new file mode 100644 index 0000000..db1b903 --- /dev/null +++ b/htdocs/public/assets/icons/about.svg @@ -0,0 +1,4 @@ + + + \ No newline at end of file diff --git a/htdocs/public/assets/icons/contact.svg b/htdocs/public/assets/icons/contact.svg new file mode 100644 index 0000000..2444e8d --- /dev/null +++ b/htdocs/public/assets/icons/contact.svg @@ -0,0 +1,4 @@ + + + \ No newline at end of file diff --git a/htdocs/public/assets/icons/project.svg b/htdocs/public/assets/icons/project.svg new file mode 100644 index 0000000..06f4f19 --- /dev/null +++ b/htdocs/public/assets/icons/project.svg @@ -0,0 +1,4 @@ + + + \ No newline at end of file diff --git a/htdocs/public/assets/icons/projects.svg b/htdocs/public/assets/icons/projects.svg new file mode 100644 index 0000000..8ee009c --- /dev/null +++ b/htdocs/public/assets/icons/projects.svg @@ -0,0 +1,4 @@ + + + \ No newline at end of file diff --git a/htdocs/public/index.ejs b/htdocs/public/index.ejs index e4bdcb2..b5a8c25 100644 --- a/htdocs/public/index.ejs +++ b/htdocs/public/index.ejs @@ -36,15 +36,18 @@
-

Projects

+ +

Projects

The kind of weird stuff I do on my free time

-

Contact Me

+ +

Contact Me

So, you want to have a chat? With me? Nice! Come say hi.

-

About Me

+ +

About Me

Oh no, you don't know me! Don't worry, we can solve that!

@@ -234,6 +237,11 @@

I've been doing techy stuff for the last <%- new Date().getFullYear() - 2013 %> years now, that's loooong!

+
+

Privacy is a right!

+

I strive to respect people's privacy, and try not to use services or applications that violate your + privacy.

+
diff --git a/htdocs/public/projects/index.ejs b/htdocs/public/projects/index.ejs new file mode 100644 index 0000000..4dd2431 --- /dev/null +++ b/htdocs/public/projects/index.ejs @@ -0,0 +1,34 @@ +<% global.title = "Projects"; %> +<%- include(`${private}/header.ejs`) %> + +← Go back home + +
+ +

Projects

+

This is the page where all legal documents are posted. All the content is signed using a GPG key, it's very important + that you check for the validity of the legal content you see on this website, as it may have been compromised.

+ +
+ <% for (let project of JSON.parse(fs.readFileSync("./global/gitea.json").toString()).sort((a, b) => a.update - b.update).reverse()) { %> +
+ "> +

<%- project.name %>

+

<%- project.description %>

+

+ <% if (project.website !== null) { %> + Website + View + <% } else { %> + View + <% } %> +

+
+ <% } %> +
+ +<%- include(`${private}/footer.ejs`) %> \ No newline at end of file diff --git a/server/gitea.js b/server/gitea.js index 70606a7..b9caa4c 100644 --- a/server/gitea.js +++ b/server/gitea.js @@ -9,7 +9,7 @@ log.verbose("Initializing Gitea projects refresh...") function get(url) { return { - stdout: require('os').platform() === "win32" ? require('child_process').execSync("curl -s -A \"Sattelite/" + mpws.version + "\" -X GET \"https://source.minteck.org/" + url + "\" -H \"accept: application/json\" -H \"authorization: Basic " + fs.readFileSync(serverRoot + "/auth.txt") + "\"") : require('child_process').execSync("bash -c 'curl -s -A \"Sattelite/" + mpws.version + "\" -X GET \"https://source.minteck.org/" + url + "\" -H \"accept: application/json\" -H \"authorization: Basic " + fs.readFileSync(serverRoot + "/auth.txt") + "\"'") + stdout: require('child_process').execSync("curl -s -A \"Sattelite/" + mpws.version + "\" -X GET \"https://source.minteck.org/" + url + "\" -H \"accept: application/json\" -H \"authorization: Basic " + fs.readFileSync(serverRoot + "/auth.txt") + "\"").toString().trim() }; } @@ -78,9 +78,10 @@ function giteaRefresh() { if (!thisRepo.empty && !thisRepo.private && !thisRepo.internal) { thisRepo.name = repo_data.full_name.trim() !== "" ? repo_data.full_name : null; thisRepo.icon = repo_data.avatar_url.trim() !== "" ? repo_data.avatar_url : null; + thisRepo.description = repo_data.description.trim() !== "" ? repo_data.description : null; thisRepo.size = repo_data.size; thisRepo.website = repo_data.website.trim() !== "" ? repo_data.website : null; - thisRepo.update = repo_data.updated_at.trim() !== "" ? repo_data.updated_at : null; + thisRepo.update = new Date(repo_data.updated_at) - 1 + 1; sattelite_data = JSON.parse(get("/api/v1/repos/" + repo + "/contents/SatteliteGiteaData.txt").stdout.toString()); -- cgit