misc changes I should just finish this
This commit is contained in:
4
index.js
4
index.js
@@ -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}`)
|
process.stdout.write(`>>> EnstrayedAPI ${globalVersion} | Started ${startTime} on ${process.env.API_PORT ?? 8081}`)
|
||||||
app.listen(process.env.API_PORT ?? 8081)
|
app.listen(process.env.API_PORT ?? 8081)
|
||||||
@@ -7,7 +7,7 @@ import { marked } from "marked"
|
|||||||
var timeSinceLastQuery = Date.now()-10000
|
var timeSinceLastQuery = Date.now()-10000
|
||||||
var cachedResult = ""
|
var cachedResult = ""
|
||||||
|
|
||||||
app.get("/indexbeta", (rreq, rres) => {
|
app.get("/", (rreq, rres) => {
|
||||||
if (Date.now() < timeSinceLastQuery+10000) {
|
if (Date.now() < timeSinceLastQuery+10000) {
|
||||||
rres.send(cachedResult)
|
rres.send(cachedResult)
|
||||||
} else {
|
} else {
|
||||||
@@ -17,9 +17,9 @@ app.get("/indexbeta", (rreq, rres) => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
app.get("/", (rreq, rres) => {
|
// app.get("/", (rreq, rres) => {
|
||||||
rres.sendFile(process.cwd()+"/website/templates/construction.html")
|
// rres.sendFile(process.cwd()+"/website/templates/construction.html")
|
||||||
})
|
// })
|
||||||
|
|
||||||
app.get("/static/*", (rreq,rres) => {
|
app.get("/static/*", (rreq,rres) => {
|
||||||
rres.sendFile(process.cwd()+"/website/static/"+rreq.url.replace("/static/",""))
|
rres.sendFile(process.cwd()+"/website/static/"+rreq.url.replace("/static/",""))
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ app.get("/helpdesk/articles/*", (rreq, rres) => {
|
|||||||
if (rreq.url.endsWith(".md")) {
|
if (rreq.url.endsWith(".md")) {
|
||||||
let file = fs.readFileSync(process.cwd() + "/website/helpdesk/templates/article.html", "utf-8")
|
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.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")))
|
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)
|
rres.send(file)
|
||||||
} else {
|
} 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/",""))
|
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 }
|
export { app }
|
||||||
@@ -19,8 +19,14 @@ body {
|
|||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
gap: 2em;
|
gap: 2em;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
padding: 1em 2em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.headerbarTitle {
|
||||||
|
font-size: xx-large;
|
||||||
|
color: black;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
.headerbarright {
|
.headerbarright {
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
@@ -99,4 +105,5 @@ dialog > button {
|
|||||||
|
|
||||||
dialog::backdrop {
|
dialog::backdrop {
|
||||||
background-color: rgba(0, 0, 0, 0.5);
|
background-color: rgba(0, 0, 0, 0.5);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4,8 +4,8 @@
|
|||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>Enstrayed Helpdesk - <!--SSR_REPLACE_TITLE--></title>
|
<title>Enstrayed Helpdesk - <!--SSR_REPLACE_TITLE--></title>
|
||||||
<link rel="stylesheet" href="/static/helpdesk/helpdesk.css">
|
<link rel="stylesheet" href="/helpdesk/static/helpdesk.css">
|
||||||
<script src="/static/helpdesk/login.js"></script>
|
<script src="/helpdesk/static/login.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
|
|||||||
@@ -4,13 +4,13 @@
|
|||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>Enstrayed Helpdesk</title>
|
<title>Enstrayed Helpdesk</title>
|
||||||
<link rel="stylesheet" href="/static/helpdesk/helpdesk.css">
|
<link rel="stylesheet" href="/helpdesk/static/helpdesk.css">
|
||||||
<script src="/static/helpdesk/login.js"></script>
|
<script src="/helpdesk/static/login.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<div class="headerbar">
|
<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/ticket/new">Open Ticket</a>
|
||||||
<a href="/helpdesk/articles">Knowledgebase</a>
|
<a href="/helpdesk/articles">Knowledgebase</a>
|
||||||
|
|
||||||
|
|||||||
@@ -4,8 +4,8 @@
|
|||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>Enstrayed Helpdesk: New Ticket</title>
|
<title>Enstrayed Helpdesk: New Ticket</title>
|
||||||
<link rel="stylesheet" href="/static/helpdesk/helpdesk.css">
|
<link rel="stylesheet" href="/helpdesk/static/helpdesk.css">
|
||||||
<script src="/static/helpdesk/login.js"></script>
|
<script src="/helpdesk/static/login.js"></script>
|
||||||
<script>
|
<script>
|
||||||
document.addEventListener('DOMContentLoaded', function() {
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
document.getElementById('formSelection').value = 'none'
|
document.getElementById('formSelection').value = 'none'
|
||||||
@@ -29,8 +29,8 @@
|
|||||||
<body>
|
<body>
|
||||||
|
|
||||||
<div class="headerbar">
|
<div class="headerbar">
|
||||||
<h1>Enstrayed Helpdesk</h1>
|
<a href="/helpdesk" class="headerbarTitle">Enstrayed Helpdesk</a>
|
||||||
<a href="/helpdesk">Main Page</a>
|
<a>Open Ticket</a>
|
||||||
<a href="/helpdesk/articles">Knowledgebase</a>
|
<a href="/helpdesk/articles">Knowledgebase</a>
|
||||||
|
|
||||||
<div class="headerbarright">
|
<div class="headerbarright">
|
||||||
|
|||||||
@@ -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).
|
|
||||||
@@ -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.
|
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
|
## 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.
|
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.
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ html {
|
|||||||
body {
|
body {
|
||||||
margin: 2em 0 0 0;
|
margin: 2em 0 0 0;
|
||||||
font-family: 'Segoe UI Variable Text', sans-serif;
|
font-family: 'Segoe UI Variable Text', sans-serif;
|
||||||
|
line-height: 1.3;
|
||||||
|
|
||||||
background-color: #202020;
|
background-color: #202020;
|
||||||
color: #F1F1F1;
|
color: #F1F1F1;
|
||||||
|
|||||||
@@ -41,7 +41,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<span>I need help with an Enstrayed.com web service</span><br>
|
<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>
|
||||||
<div>
|
<div>
|
||||||
<a href="/urltoolbox"><img src="/dynamic/icon/link/7CB342" alt="">URL Toolbox</a>
|
<a href="/urltoolbox"><img src="/dynamic/icon/link/7CB342" alt="">URL Toolbox</a>
|
||||||
|
|||||||
Reference in New Issue
Block a user