misc changes I should just finish this

This commit is contained in:
Enstrayed
2025-08-31 20:05:29 -07:00
parent 1cab7e9869
commit 3bc0861f21
12 changed files with 35 additions and 18 deletions

View File

@@ -47,5 +47,9 @@ fs.readdir("./routes", (err, files) => {
}
})
// app.use(function(req,res,next) {
// res.status(404).send("miau")
// })
process.stdout.write(`>>> EnstrayedAPI ${globalVersion} | Started ${startTime} on ${process.env.API_PORT ?? 8081}`)
app.listen(process.env.API_PORT ?? 8081)

View File

@@ -7,7 +7,7 @@ import { marked } from "marked"
var timeSinceLastQuery = Date.now()-10000
var cachedResult = ""
app.get("/indexbeta", (rreq, rres) => {
app.get("/", (rreq, rres) => {
if (Date.now() < timeSinceLastQuery+10000) {
rres.send(cachedResult)
} else {
@@ -17,9 +17,9 @@ app.get("/indexbeta", (rreq, rres) => {
}
})
app.get("/", (rreq, rres) => {
rres.sendFile(process.cwd()+"/website/templates/construction.html")
})
// app.get("/", (rreq, rres) => {
// rres.sendFile(process.cwd()+"/website/templates/construction.html")
// })
app.get("/static/*", (rreq,rres) => {
rres.sendFile(process.cwd()+"/website/static/"+rreq.url.replace("/static/",""))

View File

@@ -13,7 +13,7 @@ app.get("/helpdesk/articles/*", (rreq, rres) => {
if (rreq.url.endsWith(".md")) {
let file = fs.readFileSync(process.cwd() + "/website/helpdesk/templates/article.html", "utf-8")
file = file.replace("<!--SSR_REPLACE_URL-->", `https://enstrayed.com${rreq.url}`)
file = file.replaceAll("<!--SSR_REPLACE_TITLE-->", rreq.url.replace("/posts/", "").slice(9).replace(/-/g, " ").replace(".md", ""))
file = file.replaceAll("<!--SSR_REPLACE_TITLE-->", rreq.url.replace("/helpdesk/articles/", "").replace(/(-|_)/g, " ").replace(".md", ""))
file = file.replace("<!--SSR_REPLACE_BODY-->", marked.parse(fs.readFileSync(process.cwd() + "/website/helpdesk/kbas/" + rreq.url.replace("/helpdesk/articles/", ""), "utf-8")))
rres.send(file)
} else {
@@ -29,4 +29,8 @@ app.get("/api/helpdesk/forms/*", (rreq, rres) => {
rres.sendFile(process.cwd()+"/website/helpdesk/forms/"+rreq.url.replace("/api/helpdesk/forms/",""))
})
app.get("/helpdesk/static/*", (rreq,rres) => {
rres.sendFile(process.cwd()+"/website/helpdesk/static/"+rreq.url.replace("/helpdesk/static/",""))
})
export { app }

View File

@@ -19,8 +19,14 @@ body {
flex-direction: row;
gap: 2em;
align-items: center;
padding: 1em 2em;
}
.headerbarTitle {
font-size: xx-large;
color: black;
text-decoration: none;
}
.headerbarright {
margin-left: auto;
@@ -100,3 +106,4 @@ dialog > button {
dialog::backdrop {
background-color: rgba(0, 0, 0, 0.5);
}

View File

@@ -4,8 +4,8 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Enstrayed Helpdesk - <!--SSR_REPLACE_TITLE--></title>
<link rel="stylesheet" href="/static/helpdesk/helpdesk.css">
<script src="/static/helpdesk/login.js"></script>
<link rel="stylesheet" href="/helpdesk/static/helpdesk.css">
<script src="/helpdesk/static/login.js"></script>
</head>
<body>

View File

@@ -4,13 +4,13 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Enstrayed Helpdesk</title>
<link rel="stylesheet" href="/static/helpdesk/helpdesk.css">
<script src="/static/helpdesk/login.js"></script>
<link rel="stylesheet" href="/helpdesk/static/helpdesk.css">
<script src="/helpdesk/static/login.js"></script>
</head>
<body>
<div class="headerbar">
<h1>Enstrayed Helpdesk</h1>
<a href="/helpdesk" class="headerbarTitle">Enstrayed Helpdesk</a>
<a href="/helpdesk/ticket/new">Open Ticket</a>
<a href="/helpdesk/articles">Knowledgebase</a>

View File

@@ -4,8 +4,8 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Enstrayed Helpdesk: New Ticket</title>
<link rel="stylesheet" href="/static/helpdesk/helpdesk.css">
<script src="/static/helpdesk/login.js"></script>
<link rel="stylesheet" href="/helpdesk/static/helpdesk.css">
<script src="/helpdesk/static/login.js"></script>
<script>
document.addEventListener('DOMContentLoaded', function() {
document.getElementById('formSelection').value = 'none'
@@ -29,8 +29,8 @@
<body>
<div class="headerbar">
<h1>Enstrayed Helpdesk</h1>
<a href="/helpdesk">Main Page</a>
<a href="/helpdesk" class="headerbarTitle">Enstrayed Helpdesk</a>
<a>Open Ticket</a>
<a href="/helpdesk/articles">Knowledgebase</a>
<div class="headerbarright">

View File

@@ -1,2 +0,0 @@
# Knowledgebase Moved
As of 2025-01-11, all knowledgebase articles have been moved to [helpdesk.enstrayed.com](https://helpdesk.enstrayed.com).

View File

@@ -2,6 +2,9 @@
This page covers the steps I went through to setup the UniFi Network controller on an Orange Pi Zero 3. For no reason obvious to me, this process was overcomplicated and very annoying.
# 2025-08 Update
This article is somewhat out of date now as Ubiquiti has [introduced UniFi OS](https://blog.ui.com/article/introducing-unifi-os-server) which changes how the Network controller is deployed. I have personally switched over to it and recommend it over all of this mess.
## Background / The Problem
I purchased the Orange Pi Zero 3 because it was cheap and I wanted to move my UniFi controller out of the Docker container on my main server. The idea was to create a DIY UniFi CloudKey, hence I called mine `shitty-cloudkey`. On the surface, this is rather trivial; Ubiquiti's apt repository includes `arm64` packages and the UniFi controller itself is a Java application, making it rather portable.

View File

@@ -7,6 +7,7 @@ html {
body {
margin: 2em 0 0 0;
font-family: 'Segoe UI Variable Text', sans-serif;
line-height: 1.3;
background-color: #202020;
color: #F1F1F1;

View File

@@ -41,7 +41,7 @@
</div>
<div>
<span>I need help with an Enstrayed.com web service</span><br>
<a href="https://helpdesk.enstrayed.com"><img src="/dynamic/icon/external/7CB342" alt="">Click here to visit the Helpdesk</a>
<a href="/helpdesk"><img src="/dynamic/icon/external/7CB342" alt="">Click here to visit the Helpdesk</a>
</div>
<div>
<a href="/urltoolbox"><img src="/dynamic/icon/link/7CB342" alt="">URL Toolbox</a>