Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 28edcb21aa | |||
| a5c3db32d3 | |||
|
|
f8d5d4a69b | ||
|
|
3af3c76678 | ||
|
|
44ed0e19d0 | ||
|
|
535e3958cb | ||
|
|
35a84ffb7c | ||
|
|
b1ac3d6f58 | ||
|
|
4de76c34c2 | ||
|
|
3bc0861f21 | ||
|
|
1cab7e9869 | ||
|
|
b0e4e0f26c | ||
|
|
fb0953c50c | ||
|
|
d3e0e34989 |
1
.gitignore
vendored
@@ -2,3 +2,4 @@ node_modules/
|
||||
bun.lockb
|
||||
todo.txt
|
||||
proto.js
|
||||
.env
|
||||
9
Dockerfile
Normal file
@@ -0,0 +1,9 @@
|
||||
FROM node:22
|
||||
|
||||
USER node
|
||||
WORKDIR /app
|
||||
|
||||
RUN git clone https://github.com/enstrayed/enstrayedapi .
|
||||
RUN npm install
|
||||
|
||||
ENTRYPOINT [ "node", "index.js" ]
|
||||
44
README.md
@@ -1,38 +1,10 @@
|
||||
## Note for Visitors
|
||||
* This README mainly contains information for operation but not usage. API documentation is available [here](https://enstrayed.com/posts/20240409-API-Documentation.html).
|
||||
* Have feedback or experiencing a problem with an endpoint? Please [open a GitHub issue](https://github.com/Enstrayed/enstrayedapi/issues/new).
|
||||
* Security problem? [Open a ticket here](https://helpdesk.enstrayed.com/open.php) with the topic set as 'Responsible Disclosure'.
|
||||
## Note for passersby
|
||||
* If you have feedback or are experiencing a problem, [click here](https://enstrayed.com/helpdesk/ticket/new?form=TBD).
|
||||
* If you need to report a security issue, [click here](https://enstrayed.com/helpdesk/ticket/new?form=TBD).
|
||||
* This code is unlicensed but I don't really care if you use parts of it (I don't know why you would though).
|
||||
|
||||
## Configuration
|
||||
TODO: Rewrite
|
||||
|
||||
<details> <summary>Configuration Template</summary>
|
||||
|
||||
```json
|
||||
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
## Docker
|
||||
TODO: Rewrite & add Komodo TOML files
|
||||
|
||||
```dockerfile
|
||||
FROM node:22
|
||||
WORKDIR /app
|
||||
|
||||
RUN git clone https://github.com/enstrayed/enstrayedapi .
|
||||
RUN npm install
|
||||
|
||||
USER node
|
||||
ENTRYPOINT [ "node", "index.js" ]
|
||||
```
|
||||
|
||||
<details> <summary>Docker Compose File</summary>
|
||||
|
||||
```yaml
|
||||
|
||||
```
|
||||
|
||||
</details>
|
||||
## Links
|
||||
* [Published API Documentation](https://enstrayed.com/posts/99999999-API-Documentation.html)
|
||||
* [Internal Use Endpoints](https://git.enstrayed.com/enstrayed/enstrayedapi/wiki/Internal-Use-Endpoints)
|
||||
* [Configuration Reference](https://git.enstrayed.com/enstrayed/enstrayedapi/wiki/Configuration)
|
||||
* [Komodo Configuration](https://git.enstrayed.com/enstrayed/enstrayedapi/wiki/Komodo)
|
||||
17
archive/Enstrayed_Cloud-App_Passwords.md
Normal file
@@ -0,0 +1,17 @@
|
||||
# Using App Passwords on Enstrayed Cloud
|
||||
|
||||
App Passwords are credentials used to access your Enstrayed Cloud account from a specific application or device. They are created automatically for many Nextcloud clients, or can be created manually using the steps below.
|
||||
|
||||
**As Enstrayed Cloud exclusively uses ECLS for sign on, you will need to create app passwords for any device that does not support browser login.**
|
||||
|
||||
To create an App Password:
|
||||
|
||||
1. Login to Enstrayed Cloud
|
||||
2. Select your profile image in the top right of the page and select 'Personal Settings'<br>
|
||||

|
||||
3. In the sidebar on the left side of the page, select 'Security'<br>
|
||||

|
||||
4. Enter a description for the app password, such as the device name or application, then select 'Create new app password'<br>
|
||||

|
||||
5. You will be presented with a username and unique password; You will use these credentials to access Enstrayed Cloud from your application.<br>
|
||||

|
||||
107
archive/contactcard/contactcard.html
Normal file
@@ -0,0 +1,107 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Contact Card</title>
|
||||
<style>
|
||||
html {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
body {
|
||||
display: grid;
|
||||
place-items: center;
|
||||
background-color: #111;
|
||||
font-family: Georgia, 'Times New Roman', Times, serif;
|
||||
}
|
||||
|
||||
.theCardItself {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
/* align-items: center; */
|
||||
max-width: 34ch;
|
||||
background-image: url("/static/pages/contactcard-assets/nordwood-themes-R53t-Tg6J4c-unsplash.jpg");
|
||||
background-size: cover;
|
||||
padding: 1em;
|
||||
gap: 1em;
|
||||
|
||||
}
|
||||
|
||||
.linkButton {
|
||||
display: flex;
|
||||
gap: 0.5em;
|
||||
align-content: center;
|
||||
padding: 0.75em;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.linkButtonText {
|
||||
font-size: 1.75em;
|
||||
font-family: 'Segoe UI', --apple-system, sans-serif;
|
||||
}
|
||||
|
||||
.signalButton {
|
||||
background-color: #3b45fd;
|
||||
|
||||
}
|
||||
|
||||
.twitterButton {
|
||||
background-color: #00a2f5;
|
||||
}
|
||||
|
||||
.immichButton {
|
||||
background-color: #000;
|
||||
color: #accbfa;
|
||||
}
|
||||
|
||||
.linkButtonContainer {
|
||||
width: 100%;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.mainContainer {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
max-width: 60ch;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="theCardItself">
|
||||
<img src="https://i.enstrayed.com/contactphoto.jpg" alt="Contact Photo"
|
||||
style="border-radius: 100%; width: 10em;">
|
||||
|
||||
<span style="font-size: 3em;">@Enstrayed</span>
|
||||
<span>It seems you scanned my badge! Here's where to find me elsewhere:</span>
|
||||
|
||||
<a href="https://twitter.com/enstrayed" class="linkButtonContainer">
|
||||
<div class="linkButton twitterButton">
|
||||
<img src="/dynamic/icon/twitter/ffffff" style="width: 1lh;">
|
||||
<span class="linkButtonText">Twitter</span>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
<a href="https://signal.me/#eu/rSUBnWj8pO74gg0tWsm05bYbuoOHPtlNbjL5h7BLng9ff9_K_jVMKoz5glHr3Oco"
|
||||
class="linkButtonContainer">
|
||||
<div class="linkButton signalButton">
|
||||
<img src="/dynamic/icon/signal/ffffff" style="width: 1lh;">
|
||||
<span class="linkButtonText">Signal</span>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
<span>Here's the photos I took while in Reno:</span>
|
||||
|
||||
<a href="https://photos.enstrayed.com/share/MkDPxuQJJrbU_yISKey-BwVsdnnIkzEQEjMN2Gk1XfCnXtzp9ZtOGub4kN_VTJLzwnI"
|
||||
class="linkButtonContainer">
|
||||
<div class="linkButton immichButton">
|
||||
<img src="/static/pages/contactcard-assets/immich.svg" style="width: 1lh;">
|
||||
<span class="linkButtonText">BLFC Photo Album</span>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
29
archive/contactcard/immich.svg
Normal file
@@ -0,0 +1,29 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 28.3.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Flower" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="100 95 590 580" style="enable-background:new 0 0 792 792;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.st0{fill:#FA2921;}
|
||||
.st1{fill:#ED79B5;}
|
||||
.st2{fill:#FFB400;}
|
||||
.st3{fill:#1E83F7;}
|
||||
.st4{fill:#18C249;}
|
||||
</style>
|
||||
<g id="Flower_00000077325900055813483940000000694823054982625702_">
|
||||
<path class="st0" d="M375.48,267.63c38.64,34.21,69.78,70.87,89.82,105.42c34.42-61.56,57.42-134.71,57.71-181.3
|
||||
c0-0.33,0-0.63,0-0.91c0-68.94-68.77-95.77-128.01-95.77s-128.01,26.83-128.01,95.77c0,0.94,0,2.2,0,3.72
|
||||
C300.01,209.24,339.15,235.47,375.48,267.63z"/>
|
||||
<path class="st1" d="M164.7,455.63c24.15-26.87,61.2-55.99,103.01-80.61c44.48-26.18,88.97-44.47,128.02-52.84
|
||||
c-47.91-51.76-110.37-96.24-154.6-110.91c-0.31-0.1-0.6-0.19-0.86-0.28c-65.57-21.3-112.34,35.81-130.64,92.15
|
||||
c-18.3,56.34-14.04,130.04,51.53,151.34C162.05,454.77,163.25,455.16,164.7,455.63z"/>
|
||||
<path class="st2" d="M681.07,302.19c-18.3-56.34-65.07-113.45-130.64-92.15c-0.9,0.29-2.1,0.68-3.54,1.15
|
||||
c-3.75,35.93-16.6,81.27-35.96,125.76c-20.59,47.32-45.84,88.27-72.51,118c69.18,13.72,145.86,12.98,190.26-1.14
|
||||
c0.31-0.1,0.6-0.2,0.86-0.28C695.11,432.22,699.37,358.52,681.07,302.19z"/>
|
||||
<path class="st3" d="M336.54,510.71c-11.15-50.39-14.8-98.36-10.7-138.08c-64.03,29.57-125.63,75.23-153.26,112.76
|
||||
c-0.19,0.26-0.37,0.51-0.53,0.73c-40.52,55.78-0.66,117.91,47.27,152.72c47.92,34.82,119.33,53.54,159.86-2.24
|
||||
c0.56-0.76,1.3-1.78,2.19-3.01C363.28,602.32,347.02,558.08,336.54,510.71z"/>
|
||||
<path class="st4" d="M617.57,482.52c-35.33,7.54-82.42,9.33-130.72,4.66c-51.37-4.96-98.11-16.32-134.63-32.5
|
||||
c8.33,70.03,32.73,142.73,59.88,180.6c0.19,0.26,0.37,0.51,0.53,0.73c40.52,55.78,111.93,37.06,159.86,2.24
|
||||
c47.92-34.82,87.79-96.95,47.27-152.72C619.2,484.77,618.46,483.75,617.57,482.52z"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.0 KiB |
BIN
archive/contactcard/nordwood-themes-R53t-Tg6J4c-unsplash.jpg
Normal file
|
After Width: | Height: | Size: 714 KiB |
@@ -1,34 +0,0 @@
|
||||
import { globalConfig, app } from "../index.js"
|
||||
import { logRequest } from "../liberals/logging.js"
|
||||
|
||||
app.delete("/api/token", (rreq,rres) => {
|
||||
fetch(`${globalConfig.couchdbHost}/auth/sessions`).then(res => res.json()).then(fetchRes => {
|
||||
if (fetchRes.sessions[rreq.get("Authorization")]) {
|
||||
delete fetchRes.sessions[rreq.get("Authorization")]
|
||||
fetch(`${globalConfig.couchdbHost}/auth/sessions`, {
|
||||
method: "PUT",
|
||||
headers: {
|
||||
"If-Match": fetchRes._rev
|
||||
},
|
||||
body: JSON.stringify({
|
||||
sessions: fetchRes.sessions
|
||||
})
|
||||
|
||||
}).then(res => {
|
||||
if (res.status == 201) {
|
||||
rres.sendStatus(200)
|
||||
} else {
|
||||
logRequest(rres,rreq,500,`Token invalidation may have failed: ${res.status} ${res.statusText}`)
|
||||
rres.sendStatus(500)
|
||||
}
|
||||
}).catch(fetchError => {
|
||||
logRequest(rres,rreq,500,fetchError)
|
||||
rres.sendStatus(500)
|
||||
})
|
||||
} else {
|
||||
rres.sendStatus(400)
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
export default {app}
|
||||
22
index.js
@@ -6,21 +6,25 @@ import cookieParser from 'cookie-parser'
|
||||
|
||||
const app = express()
|
||||
|
||||
if (!process.env.DATABASE_URI) {
|
||||
console.log("FATAL: DATABASE_URI must be set")
|
||||
if (!process.env.DATABASE_URL) {
|
||||
try {
|
||||
process.loadEnvFile("./.env")
|
||||
} catch {
|
||||
console.log("FATAL: DATABASE_URL was not defined or found in env file")
|
||||
process.exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
const db = postgres(process.env.DATABASE_URI)
|
||||
const db = postgres(process.env.DATABASE_URL)
|
||||
|
||||
const globalConfig = await db`select content from config where id = ${process.env.CONFIG_OVERRIDE ?? 'production'}`.then(response => {return response[0]["content"]}).catch(error => {
|
||||
const globalConfig = await db`select content from config where id = ${process.env.CONFIG_OVERRIDE ?? 'production'}`.then(response => { return response[0]["content"] }).catch(error => {
|
||||
console.log(`FATAL: Error occured in downloading configuration: ${error}`)
|
||||
process.exit(1)
|
||||
})
|
||||
|
||||
const globalVersion = execSync(`git show --oneline -s`).toString().split(" ")[0]
|
||||
// Returns ISO 8601 Date & 24hr time for UTC-7/PDT
|
||||
const startTime = new Date(new Date().getTime() - 25200000).toISOString().slice(0,19).replace('T',' ')
|
||||
const startTime = new Date(new Date().getTime() - 25200000).toISOString().slice(0, 19).replace('T', ' ')
|
||||
|
||||
export { app, fs, db, globalConfig, globalVersion }
|
||||
|
||||
@@ -28,7 +32,7 @@ app.use(json()) // Allows receiving JSON bodies
|
||||
// see important note: https://expressjs.com/en/api.html#express.json
|
||||
app.use(cookieParser()) // Allows receiving cookies
|
||||
|
||||
process.on('SIGTERM', function() {
|
||||
process.on('SIGTERM', function () {
|
||||
console.log("Received SIGTERM, exiting...")
|
||||
process.exit(0)
|
||||
})
|
||||
@@ -41,11 +45,15 @@ fs.readdir("./routes", (err, files) => {
|
||||
let importedRoutes = []
|
||||
files.forEach(file => {
|
||||
import(`./routes/${file}`)
|
||||
importedRoutes.push(file.slice(0,-3))
|
||||
importedRoutes.push(file.slice(0, -3))
|
||||
})
|
||||
process.stdout.write(` | Imported ${importedRoutes} \n`)
|
||||
}
|
||||
})
|
||||
|
||||
// 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)
|
||||
@@ -33,7 +33,7 @@ async function checkTokenNew(request, scope) {
|
||||
if (!request.cookies["APIToken"] && !request.get("Authorization")) {
|
||||
return { result: false, owner: "", ownerId: "" }
|
||||
} else {
|
||||
return await db`select s.*, u.username from sessions s join users u on s.owner = u.id where s.token = ${request.get("Authorization") ?? request.cookies["APIToken"]}`.then(response => {
|
||||
return await db`select * from sessions where token = ${request.get("Authorization") ?? request.cookies["APIToken"]}`.then(response => {
|
||||
if (response.length === 0) {
|
||||
return { result: false, owner: response[0]?.username, ownerId: response[0]?.owner }
|
||||
} else if (response[0]?.scopes.split(",").includes(scope)) {
|
||||
|
||||
49
liberals/directoryparsing.js
Normal file
@@ -0,0 +1,49 @@
|
||||
import { fs } from "../index.js"
|
||||
|
||||
function parsePosts() {
|
||||
let files = fs.readdirSync(process.cwd()+"/website/posts")
|
||||
let result = ""
|
||||
|
||||
for (let x in files) {
|
||||
if (files[x].endsWith(".html") === false && files[x].endsWith(".md") === false ) { break } // If file/dir is not .html or .md then ignore
|
||||
|
||||
let date = files[x].split("-")[0]
|
||||
if (date < 10000000 || date > 99999999) { break } // If date does not fit ISO8601 format then ignore
|
||||
|
||||
date = date.replace(/.{2}/g,"$&-").replace("-","").slice(0,-1) // Insert a dash every 2 characters, remove the first dash, remove the last character
|
||||
|
||||
let name = files[x].slice(9).replace(/-/g," ").replace(".html","").replace(".md","") // Strip Date, replace seperator with space & remove file extension
|
||||
|
||||
result = `<li>${date} <a href="/posts/${files[x]}">${name}</a></li>`+result
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
function parseKbas() {
|
||||
let files = fs.readdirSync(process.cwd()+"/website/helpdesk/kbas")
|
||||
let pages = {}
|
||||
let result = ""
|
||||
|
||||
for (let x in files) {
|
||||
if (files[x].endsWith(".html") === false && files[x].endsWith(".md") === false ) { break } // If file/dir is not .html or .md then ignore
|
||||
|
||||
if (!Array.isArray(pages[files[x].split("-")[0]])) { // check if category array does not exist
|
||||
pages[files[x].split("-")[0]] = [] // create it
|
||||
}
|
||||
|
||||
pages[files[x].split("-")[0]].push(files[x])
|
||||
}
|
||||
|
||||
for (let y in pages) {
|
||||
result += `<h1>${y}</h1><div class="linkColumn">`
|
||||
for (let z in pages[y]) {
|
||||
result += `<a href="/helpdesk/articles/${pages[y][z]}"><img src="/dynamic/icon/post/366FFF">${pages[y][z].split("-")[1].split(".")[0].replace(/_/g," ")}</a>`
|
||||
}
|
||||
result += `</div>`
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
export { parseKbas, parsePosts}
|
||||
@@ -32,7 +32,7 @@ async function queryLastfm() {
|
||||
}
|
||||
}
|
||||
}).catch(fetchError => {
|
||||
console.log("libnowplaying.js: Fetch failed! "+fetchError)
|
||||
console.log("libnowplaying.js: Fetch failed! " + fetchError)
|
||||
return {}
|
||||
})
|
||||
}
|
||||
@@ -42,6 +42,7 @@ async function queryLastfm() {
|
||||
* @returns {object} Object containing response in JSON and HTML (as string)
|
||||
*/
|
||||
async function queryJellyfin() {
|
||||
try {
|
||||
return await fetch(`${globalConfig.nowplaying.jellyfin.host}/Sessions`, {
|
||||
headers: {
|
||||
"Authorization": `MediaBrowser Token=${globalConfig.nowplaying.jellyfin.apiKey}`
|
||||
@@ -58,14 +59,17 @@ async function queryJellyfin() {
|
||||
"artistName": response[x].NowPlayingItem.Artists[0],
|
||||
"albumName": response[x].NowPlayingItem.Album ?? `${response[x].NowPlayingItem.Name} (Single)`,
|
||||
"artUrl": `${globalConfig.nowplaying.jellyfin.hostPublic}/Items/${response[x].NowPlayingItem.Id}/Images/Primary`,
|
||||
"link": `https://www.last.fm/music/${response[x].NowPlayingItem.Artists[0].replaceAll(" ","+")}/_/${response[x].NowPlayingItem.Name.replaceAll(" ","+")}`
|
||||
"link": `https://www.last.fm/music/${response[x].NowPlayingItem.Artists[0].replaceAll(" ", "+")}/_/${response[x].NowPlayingItem.Name.replaceAll(" ", "+")}`
|
||||
},
|
||||
"html": `<img src="${globalConfig.nowplaying.jellyfin.hostPublic}/Items/${response[x].NowPlayingItem.Id}/Images/Primary" alt="Album Art"> <div> <span class="nowPlayingLine1">I'm listening to</span> <span class="nowPlayingLine2">${response[x].NowPlayingItem.Name} by ${response[x].NowPlayingItem.Artists[0]}</span> <span class="nowPlayingLine3">from ${response[x].NowPlayingItem.Album ?? `${response[x].NowPlayingItem.Name} (Single)`}</span> <a class="nowPlayingLine4" href="https://www.last.fm/music/${response[x].NowPlayingItem.Artists[0].replaceAll(" ","+")}/_/${response[x].NowPlayingItem.Name.replaceAll(" ","+")}">View on Last.fm</a></div>`
|
||||
"html": `<img src="${globalConfig.nowplaying.jellyfin.hostPublic}/Items/${response[x].NowPlayingItem.Id}/Images/Primary" alt="Album Art"> <div> <span class="nowPlayingLine1">I'm listening to</span> <span class="nowPlayingLine2">${response[x].NowPlayingItem.Name} by ${response[x].NowPlayingItem.Artists[0]}</span> <span class="nowPlayingLine3">from ${response[x].NowPlayingItem.Album ?? `${response[x].NowPlayingItem.Name} (Single)`}</span> <a class="nowPlayingLine4" href="https://www.last.fm/music/${response[x].NowPlayingItem.Artists[0].replaceAll(" ", "+")}/_/${response[x].NowPlayingItem.Name.replaceAll(" ", "+")}">View on Last.fm</a></div>`
|
||||
}
|
||||
}
|
||||
|
||||
return notPlayingAnythingPlaceholder
|
||||
})
|
||||
} catch {
|
||||
return notPlayingAnythingPlaceholder
|
||||
}
|
||||
}
|
||||
|
||||
export { queryLastfm, queryJellyfin }
|
||||
@@ -6,8 +6,8 @@ import { randomStringBase62, getHumanReadableUserAgent } from "../liberals/misc.
|
||||
app.get("/api/auth/whoami", (rreq,rres) => {
|
||||
if (!rreq.cookies["APIToken"] && !rreq.get("Authorization")) {
|
||||
rres.send({ "loggedIn": false, "username": "", "scopes": "" })
|
||||
} else {
|
||||
db`select s.scopes, u.username from sessions s join users u on s.owner = u.id where s.token = ${rreq.cookies["APIToken"] ?? rreq.get("Authorization")}`.then(dbRes => {
|
||||
} else { // select
|
||||
db`select scopes,username from sessions where token = ${rreq.cookies["APIToken"] ?? rreq.get("Authorization")}`.then(dbRes => {
|
||||
if (dbRes.length > 0 && dbRes.length < 2) {
|
||||
rres.send({ "loggedIn": true, "username": dbRes[0]?.username, "scopes": dbRes[0]?.scopes.split(",") })
|
||||
} else {
|
||||
@@ -75,7 +75,7 @@ app.get("/api/auth/callback", (rreq,rres) => {
|
||||
let newExpiration = Date.now() + 86400
|
||||
let newComment = `Login token for ${getHumanReadableUserAgent(rreq.get("User-Agent"))} on ${rreq.get("cf-connecting-ip") ?? rreq.ip}`
|
||||
|
||||
db`insert into sessions (token,owner,scopes,expires,comment) values (${newToken},(select id from users where oidc_username = ${fetchRes2.username}),${fetchRes2.enstrayedapi_scopes},${newExpiration},${newComment});`.then(dbRes1 => {
|
||||
db`insert into sessions (token,username,scopes,expires,comment) values (${newToken},${fetchRes2.username},${fetchRes2.enstrayedapi_scopes},${newExpiration},${newComment});`.then(dbRes1 => {
|
||||
if (rreq.query.state.split("_")[0] === "redirect") {
|
||||
let newDestination = atob(rreq.query.state.split("_")[1].replace("-","/"))
|
||||
rres.setHeader("Set-Cookie", `APIToken=${newToken}; Domain=${rreq.hostname}; Expires=${new Date(newExpiration).toUTCString()}; Path=/`).redirect(newDestination)
|
||||
|
||||
19
routes/dynamic.js
Normal file
@@ -0,0 +1,19 @@
|
||||
import { app, fs } from "../index.js"
|
||||
|
||||
app.get("/dynamic/icon/*", (rreq, rres) => {
|
||||
try {
|
||||
let file = fs.readFileSync(process.cwd()+`/website/dynamic/icons/${rreq.path.split("/")[3]}.svg`,"utf-8")
|
||||
file = file.replace("<!--DYN_REPLACECOLOR-->", "#"+rreq.path.split("/")[4].slice(0,6))
|
||||
rres.setHeader("Content-Type","image/svg+xml").send(file)
|
||||
} catch {
|
||||
rres.sendStatus(404)
|
||||
}
|
||||
})
|
||||
|
||||
app.get("/dynamic/background/*", (rreq,rres) => {
|
||||
if (rreq.headers["accept"].includes("image/jxl")) {
|
||||
rres.setHeader("Content-Type", "image/jxl").sendFile( `${process.cwd()}/website/dynamic/backgrounds/${rreq.path.split("/")[3]}.jxl`)
|
||||
} else {
|
||||
rres.setHeader("Content-Type", "image/jpeg").sendFile( `${process.cwd()}/website/dynamic/backgrounds/${rreq.path.split("/")[3]}.jpg`)
|
||||
}
|
||||
})
|
||||
@@ -1,25 +1,23 @@
|
||||
import { app, globalConfig, fs, globalVersion } from "../index.js" // Get globals from index
|
||||
import { execSync } from 'child_process'
|
||||
import { checkToken } from "../liberals/auth.js"
|
||||
import { logRequest } from "../liberals/logging.js"
|
||||
import { parsePosts } from "../liberals/directoryparsing.js"
|
||||
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 {
|
||||
let indexFile = fs.readFileSync(process.cwd()+"/website/templates/newindextemplate.html","utf-8")
|
||||
cachedResult = indexFile.replace("<!--SSR_BLOGPOSTS-->",parseFiles()).replace("<!--SSR_APIVERSION-->",`<sup>API Version ${globalVersion}</sup>`)
|
||||
cachedResult = indexFile.replace("<!--SSR_BLOGPOSTS-->",parsePosts()).replace("<!--SSR_APIVERSION-->",`<sup>API Version ${globalVersion}</sup>`)
|
||||
rres.send(cachedResult)
|
||||
}
|
||||
})
|
||||
|
||||
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/",""))
|
||||
@@ -43,24 +41,4 @@ app.get("/posts/*", (rreq,rres) => {
|
||||
|
||||
})
|
||||
|
||||
function parseFiles() {
|
||||
let files = fs.readdirSync(process.cwd()+"/website/posts")
|
||||
let result = ""
|
||||
|
||||
for (let x in files) {
|
||||
if (files[x].endsWith(".html") === false && files[x].endsWith(".md") === false ) { break } // If file/dir is not .html or .md then ignore
|
||||
|
||||
let date = files[x].split("-")[0]
|
||||
if (date < 10000000 || date > 99999999) { break } // If date does not fit ISO8601 format then ignore
|
||||
|
||||
date = date.replace(/.{2}/g,"$&-").replace("-","").slice(0,-1) // Insert a dash every 2 characters, remove the first dash, remove the last character
|
||||
|
||||
let name = files[x].slice(9).replace(/-/g," ").replace(".html","").replace(".md","") // Strip Date, replace seperator with space & remove file extension
|
||||
|
||||
result = `<li>${date} <a href="/posts/${files[x]}">${name}</a></li>`+result
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
export {app}
|
||||
@@ -1,11 +1,29 @@
|
||||
import { app } from "../index.js"
|
||||
import { app, fs } from "../index.js"
|
||||
import { parseKbas } from "../liberals/directoryparsing.js"
|
||||
import { marked } from "marked"
|
||||
|
||||
app.get("/helpdesk", (rreq, rres) => {
|
||||
rres.sendFile(process.cwd()+"/website/helpdesk/templates/landing.html")
|
||||
})
|
||||
|
||||
app.get("/helpdesk/articles", (rreq, rres) => {
|
||||
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-->", "Knowledgebase")
|
||||
file = file.replace("<!--SSR_REPLACE_BODY-->", parseKbas())
|
||||
rres.send(file)
|
||||
})
|
||||
|
||||
app.get("/helpdesk/articles/*", (rreq, rres) => {
|
||||
rres.sendFile(process.cwd()+"/website/helpdesk/kbas/"+rreq.url.replace("/helpdesk/articles/",""))
|
||||
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("/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 {
|
||||
rres.sendFile(process.cwd() + "/website/helpdesk/kbas" + rreq.url.replace("/helpdesk/articles/", ""))
|
||||
}
|
||||
})
|
||||
|
||||
app.get("/helpdesk/ticket/new", (rreq,rres) => {
|
||||
@@ -13,7 +31,18 @@ app.get("/helpdesk/ticket/new", (rreq,rres) => {
|
||||
})
|
||||
|
||||
app.get("/api/helpdesk/forms/*", (rreq, rres) => {
|
||||
rres.sendFile(process.cwd()+"/website/helpdesk/forms/"+rreq.url.replace("/api/helpdesk/forms/",""))
|
||||
fs.readFile(process.cwd()+"/website/helpdesk/forms/"+rreq.url.replace("/api/helpdesk/forms/","")+".json","utf-8", (error, data) => {
|
||||
if (error) {
|
||||
rres.status(400).send("Unable to retrieve requested form")
|
||||
} else {
|
||||
rres.type('json').send(data)
|
||||
}
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
app.get("/helpdesk/static/*", (rreq,rres) => {
|
||||
rres.sendFile(process.cwd()+"/website/helpdesk/static/"+rreq.url.replace("/helpdesk/static/",""))
|
||||
})
|
||||
|
||||
export { app }
|
||||
@@ -1,6 +1,6 @@
|
||||
import { app } from "../index.js"
|
||||
|
||||
app.get("/api/ip", (rreq,rres) => {
|
||||
app.get("/ip", (rreq,rres) => {
|
||||
let jsonResponse = {
|
||||
"IP": rreq.get("cf-connecting-ip") || rreq.ip,
|
||||
"Country": rreq.get("cf-ipcountry") || "not_cloudflare",
|
||||
|
||||
BIN
website/dynamic/backgrounds/main.jpg
Normal file
|
After Width: | Height: | Size: 305 KiB |
BIN
website/dynamic/backgrounds/main.jxl
Normal file
@@ -1,3 +1,3 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="#366FFF" viewBox="0 0 16 16">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="<!--DYN_REPLACECOLOR-->" viewBox="0 0 16 16">
|
||||
<path fill-rule="evenodd" d="M15 2a1 1 0 0 0-1-1H2a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1zM0 2a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2zm4.5 5.5a.5.5 0 0 0 0 1h5.793l-2.147 2.146a.5.5 0 0 0 .708.708l3-3a.5.5 0 0 0 0-.708l-3-3a.5.5 0 1 0-.708.708L10.293 7.5z"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 400 B After Width: | Height: | Size: 416 B |
@@ -1,4 +1,4 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="#366FFF" viewBox="0 0 16 16">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="<!--DYN_REPLACECOLOR-->" viewBox="0 0 16 16">
|
||||
<path fill-rule="evenodd" d="M8.636 3.5a.5.5 0 0 0-.5-.5H1.5A1.5 1.5 0 0 0 0 4.5v10A1.5 1.5 0 0 0 1.5 16h10a1.5 1.5 0 0 0 1.5-1.5V7.864a.5.5 0 0 0-1 0V14.5a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h6.636a.5.5 0 0 0 .5-.5"/>
|
||||
<path fill-rule="evenodd" d="M16 .5a.5.5 0 0 0-.5-.5h-5a.5.5 0 0 0 0 1h3.793L6.146 9.146a.5.5 0 1 0 .708.708L15 1.707V5.5a.5.5 0 0 0 1 0z"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 490 B After Width: | Height: | Size: 506 B |
@@ -1,3 +1,3 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="#366FFF" viewBox="0 0 16 16">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="<!--DYN_REPLACECOLOR-->" viewBox="0 0 16 16">
|
||||
<path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27s1.36.09 2 .27c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 682 B After Width: | Height: | Size: 698 B |
@@ -1,4 +1,4 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="#366FFF" viewBox="2.5 2 11 11">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="<!--DYN_REPLACECOLOR-->" viewBox="2.5 2 11 11">
|
||||
<path d="M4.715 6.542 3.343 7.914a3 3 0 1 0 4.243 4.243l1.828-1.829A3 3 0 0 0 8.586 5.5L8 6.086a1 1 0 0 0-.154.199 2 2 0 0 1 .861 3.337L6.88 11.45a2 2 0 1 1-2.83-2.83l.793-.792a4 4 0 0 1-.128-1.287z"/>
|
||||
<path d="M6.586 4.672A3 3 0 0 0 7.414 9.5l.775-.776a2 2 0 0 1-.896-3.346L9.12 3.55a2 2 0 1 1 2.83 2.83l-.793.792c.112.42.155.855.128 1.287l1.372-1.372a3 3 0 1 0-4.243-4.243z"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 489 B After Width: | Height: | Size: 505 B |
@@ -1,4 +1,4 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="#366FFF" viewBox="0 0 16 16">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="<!--DYN_REPLACECOLOR-->" viewBox="0 0 16 16">
|
||||
<path d="M5.5 7a.5.5 0 0 0 0 1h5a.5.5 0 0 0 0-1zM5 9.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 0 1h-5a.5.5 0 0 1-.5-.5m0 2a.5.5 0 0 1 .5-.5h2a.5.5 0 0 1 0 1h-2a.5.5 0 0 1-.5-.5"/>
|
||||
<path d="M9.5 0H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V4.5zm0 1v2A1.5 1.5 0 0 0 11 4.5h2V14a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1z"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 431 B After Width: | Height: | Size: 447 B |
3
website/dynamic/icons/signal.svg
Normal file
@@ -0,0 +1,3 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="<!--DYN_REPLACECOLOR-->" viewBox="0 0 16 16">
|
||||
<path d="m6.08.234.179.727a7.3 7.3 0 0 0-2.01.832l-.383-.643A7.9 7.9 0 0 1 6.079.234zm3.84 0L9.742.96a7.3 7.3 0 0 1 2.01.832l.388-.643A8 8 0 0 0 9.92.234m-8.77 3.63a8 8 0 0 0-.916 2.215l.727.18a7.3 7.3 0 0 1 .832-2.01l-.643-.386zM.75 8a7 7 0 0 1 .081-1.086L.091 6.8a8 8 0 0 0 0 2.398l.74-.112A7 7 0 0 1 .75 8m11.384 6.848-.384-.64a7.2 7.2 0 0 1-2.007.831l.18.728a8 8 0 0 0 2.211-.919M15.251 8q0 .547-.082 1.086l.74.112a8 8 0 0 0 0-2.398l-.74.114q.082.54.082 1.086m.516 1.918-.728-.18a7.3 7.3 0 0 1-.832 2.012l.643.387a8 8 0 0 0 .917-2.219m-6.68 5.25c-.72.11-1.453.11-2.173 0l-.112.742a8 8 0 0 0 2.396 0l-.112-.741zm4.75-2.868a7.2 7.2 0 0 1-1.537 1.534l.446.605a8 8 0 0 0 1.695-1.689zM12.3 2.163c.587.432 1.105.95 1.537 1.537l.604-.45a8 8 0 0 0-1.69-1.691zM2.163 3.7A7.2 7.2 0 0 1 3.7 2.163l-.45-.604a8 8 0 0 0-1.691 1.69l.604.45zm12.688.163-.644.387c.377.623.658 1.3.832 2.007l.728-.18a8 8 0 0 0-.916-2.214M6.913.831a7.3 7.3 0 0 1 2.172 0l.112-.74a8 8 0 0 0-2.396 0zM2.547 14.64 1 15l.36-1.549-.729-.17-.361 1.548a.75.75 0 0 0 .9.902l1.548-.357zM.786 12.612l.732.168.25-1.073A7.2 7.2 0 0 1 .96 9.74l-.727.18a8 8 0 0 0 .736 1.902l-.184.79zm3.5 1.623-1.073.25.17.731.79-.184c.6.327 1.239.574 1.902.737l.18-.728a7.2 7.2 0 0 1-1.962-.811zM8 1.5a6.5 6.5 0 0 0-6.498 6.502 6.5 6.5 0 0 0 .998 3.455l-.625 2.668L4.54 13.5a6.502 6.502 0 0 0 6.93-11A6.5 6.5 0 0 0 8 1.5"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.5 KiB |
@@ -1,3 +1,3 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="#366FFF" viewBox="0 0 16 16">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="<!--DYN_REPLACECOLOR-->" viewBox="0 0 16 16">
|
||||
<path d="M5.026 15c6.038 0 9.341-5.003 9.341-9.334q.002-.211-.006-.422A6.7 6.7 0 0 0 16 3.542a6.7 6.7 0 0 1-1.889.518 3.3 3.3 0 0 0 1.447-1.817 6.5 6.5 0 0 1-2.087.793A3.286 3.286 0 0 0 7.875 6.03a9.32 9.32 0 0 1-6.767-3.429 3.29 3.29 0 0 0 1.018 4.382A3.3 3.3 0 0 1 .64 6.575v.045a3.29 3.29 0 0 0 2.632 3.218 3.2 3.2 0 0 1-.865.115 3 3 0 0 1-.614-.057 3.28 3.28 0 0 0 3.067 2.277A6.6 6.6 0 0 1 .78 13.58a6 6 0 0 1-.78-.045A9.34 9.34 0 0 0 5.026 15"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 559 B After Width: | Height: | Size: 575 B |
@@ -1,14 +0,0 @@
|
||||
{
|
||||
"anonymousSubmission": false,
|
||||
"form": {
|
||||
"description": {
|
||||
"type": "span",
|
||||
"content": "Important: <ul> <li>Your Enstrayed Cloud quota does NOT affect your EOES mailbox quota.</li> <li>Your request will be reviewed and may be denied for any reason.</li> </ul>"
|
||||
},
|
||||
"newquota": {
|
||||
"type": "text",
|
||||
"content": "New quota (in GB)",
|
||||
"required": true
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,10 +4,6 @@
|
||||
"type": "text",
|
||||
"content": "What is your name?"
|
||||
},
|
||||
"email": {
|
||||
"type": "text",
|
||||
"content": "What is a good email address to reach you at?"
|
||||
},
|
||||
"message": {
|
||||
"type": "bigtext",
|
||||
"content": "Please enter your message below."
|
||||
|
||||
@@ -5,6 +5,5 @@
|
||||
"general_techsupport": "General Technical Support",
|
||||
"ecls_deleteaccount": "ECLS: Delete Account",
|
||||
"ecls_passwordreset": "ECLS: Password Reset",
|
||||
"ecls_personalinfochange": "ECLS: Personal Information Change",
|
||||
"enstrayedcloud_quotachange": "Enstrayed Cloud: Quota Change"
|
||||
"ecls_personalinfochange": "ECLS: Personal Information Change"
|
||||
}
|
||||
11
website/helpdesk/kbas/ECLS-Change_Password.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# Change your ECLS password
|
||||
|
||||
1. Login to your ECLS account at https://login.enstrayed.com
|
||||
2. Select the settings icon in the top right of your screen <br>
|
||||

|
||||
3. Enter your new password twice and press 'Save' to change your password <br>
|
||||

|
||||
|
||||
## I can't login to my ECLS account
|
||||
|
||||
[Click here for information about how to reset your ECLS password](https://enstrayed.com/helpdesk/articles/ECLS-Reset_Password.md)
|
||||
9
website/helpdesk/kbas/ECLS-Reset_Password.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# Reset your ECLS Password
|
||||
|
||||
**Important!** If you use Discord to sign into ECLS, you should change your password through the user interface instead of using account recovery.
|
||||
|
||||
You can visit [this page](https://login.enstrayed.com/if/flow/recovery/) to have a password reset link sent to the email associated with your ECLS account.
|
||||
|
||||
**Please make sure to check your spam folder.**
|
||||
|
||||
If you are unable to access that email address, [open a ticket](/helpdesk/ticket/new) with the topic "ECLS Account Recovery" instead.
|
||||
10
website/helpdesk/kbas/EOES-What_is_EOES.md
Normal file
@@ -0,0 +1,10 @@
|
||||
# What is EOES?
|
||||
|
||||
EOES, short for Enstrayed Orenco Email System, is the mail server that handles all mail for enstrayed.com.
|
||||
|
||||
## Why did a message from @enstrayed.com end up in spam?
|
||||
|
||||
The short and oversimplified answer is that Email services provided by large tech coporations, such as Google (Gmail/Workspace) and Microsoft (Outlook/Exchange), attempt to fight spam by turning Email into an exclusive club. Only companies that pay them, or have enough money to pay people to negotiate with them, are allowed to freely send Emails to them.
|
||||
|
||||
The more nuanced answer is that they pretty much don't have a choice. Email is a very old standard, with its protocols being first introduced in the 1980s. There have been revisions and improvements since then, however these can only help so much. Because of this, fighting spam is a cat and mouse game, even moreso at the scale companies like Google and Microsoft deal with.
|
||||
|
||||
7
website/helpdesk/kbas/Jellyfin-Logging_In.md
Normal file
@@ -0,0 +1,7 @@
|
||||
# Logging into Jellyfin
|
||||
|
||||
Jellyfin uses your ECLS username and password to login.
|
||||
|
||||
* If you have two-factor authentication enabled, you will not need to append a code to the password field to login.
|
||||
* If you have not previously used Jellyfin, you will need to login once for your account to be automatically created.
|
||||
* For devices like TVs, it's recommended to use Quick Connect to login instead. You can access Quick Connect in Jellyfin by selecting the profile icon in the top right of your screen and selecting 'Quick Connect' from the list.
|
||||
@@ -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;
|
||||
@@ -51,6 +57,10 @@ body {
|
||||
margin: 0 0 0.5em 0;
|
||||
}
|
||||
|
||||
.helpdeskScopeOnly {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.linkColumn {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@@ -81,3 +91,31 @@ dialog > button {
|
||||
dialog::backdrop {
|
||||
background-color: rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
|
||||
#formarea > div > input {
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
#formarea > div > textarea {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* Article Specific */
|
||||
.articlecontent {
|
||||
background-color: #fff;
|
||||
padding: 2em;
|
||||
margin: 2em 0 2em;
|
||||
max-width: 100ch;
|
||||
}
|
||||
|
||||
.articlecontent > h1 {
|
||||
margin: 0 0 0.5em;
|
||||
}
|
||||
|
||||
.articlecontent > ol > li {
|
||||
margin: 0 0 0.2em;
|
||||
}
|
||||
|
||||
.articlecontent img {
|
||||
max-width: 100%;
|
||||
}
|
||||
@@ -12,6 +12,14 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||
if (jsonRes.loggedIn) {
|
||||
globalLoggedIn = true
|
||||
document.getElementById("loginButton").innerText = `Logout ${jsonRes.username}`
|
||||
|
||||
if (jsonRes.scopes.includes("helpdesk")) {
|
||||
let targetElements = document.getElementsByClassName("helpdeskScopeOnly")
|
||||
// cant do a for loop since targetElements dynamically updates, this is easier but stupid
|
||||
while (targetElements.length > 0) {
|
||||
targetElements[0].classList.toggle("helpdeskScopeOnly")
|
||||
}
|
||||
}
|
||||
} else {
|
||||
globalLoggedIn = false
|
||||
document.getElementById("loginButton").innerText = `Login`
|
||||
@@ -24,8 +32,7 @@ function loginFunction() {
|
||||
if (globalLoggedIn === true) {
|
||||
fetch(`/api/auth/logout`).then(fetchRes => {
|
||||
if (fetchRes.status === 200) {
|
||||
globalLoggedIn = false
|
||||
document.getElementById("loginButton").innerText = `Login`
|
||||
location.reload()
|
||||
} else {
|
||||
fetchRes.text().then(textRes => {
|
||||
useGlobalDialog("Error", `An error occurred during logout: ${textRes}`)
|
||||
@@ -41,6 +48,13 @@ function loginFunction() {
|
||||
if (jsonRes.loggedIn) {
|
||||
globalLoggedIn = true
|
||||
document.getElementById("loginButton").innerText = `Logout ${jsonRes.username}`
|
||||
|
||||
if (jsonRes.scopes.includes("helpdesk")) {
|
||||
let targetElements = document.getElementsByClassName("helpdeskScopeOnly")
|
||||
while (targetElements.length > 0) {
|
||||
targetElements[0].classList.toggle("helpdeskScopeOnly")
|
||||
}
|
||||
}
|
||||
} else {
|
||||
useGlobalDialog("Error", `You are not logged in. Please try logging in again.`)
|
||||
}
|
||||
33
website/helpdesk/templates/article.html
Normal file
@@ -0,0 +1,33 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<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="/helpdesk/static/helpdesk.css">
|
||||
<script src="/helpdesk/static/login.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="headerbar">
|
||||
<a href="/helpdesk" class="headerbarTitle">Enstrayed Helpdesk</a>
|
||||
<a href="/helpdesk/ticket/new">New Request</a>
|
||||
<a href="/helpdesk/articles">Knowledgebase</a>
|
||||
|
||||
<div class="headerbarright">
|
||||
<button id="loginButton" onclick="loginFunction()">Login</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="maincontent">
|
||||
<div class="articlecontent">
|
||||
<a href="/helpdesk/articles">Return to Knowledgebase</a>
|
||||
<!--SSR_REPLACE_BODY-->
|
||||
</div>
|
||||
</div>
|
||||
<dialog id="globalDialog">
|
||||
<h2 id="globalDialogHeader">Warning</h2>
|
||||
<p id="globalDialogText">This is a warning</p>
|
||||
<button onclick="document.getElementById('globalDialog').close()">Dismiss</button>
|
||||
</dialog>
|
||||
</body>
|
||||
</html>
|
||||
@@ -4,15 +4,16 @@
|
||||
<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/ticket/new">Open Ticket</a>
|
||||
<a href="/helpdesk" class="headerbarTitle">Enstrayed Helpdesk</a>
|
||||
<a href="/helpdesk/ticket/new">New Request</a>
|
||||
<a href="/helpdesk/articles">Knowledgebase</a>
|
||||
<a href="/helpdesk/ticket/list" class="helpdeskScopeOnly">Ticket List</a>
|
||||
|
||||
<div class="headerbarright">
|
||||
<button id="loginButton" onclick="loginFunction()">Login</button>
|
||||
@@ -22,46 +23,47 @@
|
||||
<div class="cardrow">
|
||||
<div>
|
||||
<h1>How can I help you?</h1>
|
||||
<div class="linkColumn">
|
||||
<p>If you are needing assistance, please reach out via a previously established<br>contact method or send an email to helpdesk (at) enstrayed (dot) com.</p>
|
||||
<!-- <div class="linkColumn">
|
||||
<div>
|
||||
<span>I'm filing a legal request, such as a DMCA takedown or other legal matter</span><br>
|
||||
<a href=""><img src="/static/icons/arrow-right.svg" alt="">Click here to start a Legal Request</a>
|
||||
<a href=""><img src="/dynamic/icon/arrow-right/366FFF" alt="">Click here to start a Legal Request</a>
|
||||
</div>
|
||||
<div>
|
||||
<span>I'm responsibly disclosing a problem, such a security vulnerability</span><br>
|
||||
<a href=""><img src="/static/icons/arrow-right.svg" alt="">Click here to start a Responsible Disclosure</a>
|
||||
<a href=""><img src="/dynamic/icon/arrow-right/366FFF" alt="">Click here to start a Responsible Disclosure</a>
|
||||
</div>
|
||||
<div>
|
||||
<span>I need help logging into my ECLS account</span><br>
|
||||
<a href=""><img src="/static/icons/external.svg" alt="">Click here to reset your ECLS password</a><br>
|
||||
<a href=""><img src="/static/icons/arrow-right.svg" alt="">Click here to start ECLS account recovery</a>
|
||||
<a href=""><img src="/dynamic/icon/external/366FFF" alt="">Click here to reset your ECLS password</a><br>
|
||||
<a href=""><img src="/dynamic/icon/arrow-right/366FFF" alt="">Click here to start ECLS account recovery</a>
|
||||
</div>
|
||||
<div>
|
||||
<span>I have another question or need to get in contact</span><br>
|
||||
<a href=""><img src="/static/icons/arrow-right.svg" alt="">Click here to start a General Inquiry</a>
|
||||
</div>
|
||||
<a href=""><img src="/dynamic/icon/arrow-right/366FFF" alt="">Click here to start a General Inquiry</a>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
<div>
|
||||
<h1>Popular Articles</h1>
|
||||
<div class="linkColumn">
|
||||
<!-- <div class="linkColumn">
|
||||
<div>
|
||||
<span>How do I use Security Keys in ECLS?</span><br>
|
||||
<a href=""><img src="/static/icons/post.svg" alt="">Important ECLS FIDO2/Webauthn/Passkey Information</a>
|
||||
<a href=""><img src="/dynamic/icon/post/366FFF" alt="">Important ECLS FIDO2/Webauthn/Passkey Information</a>
|
||||
</div>
|
||||
<div>
|
||||
<span>How do I login to Jellyfin?</span><br>
|
||||
<a href=""><img src="/static/icons/post.svg" alt="">Logging into Jellyfin</a>
|
||||
<a href=""><img src="/dynamic/icon/post/366FFF" alt="">Logging into Jellyfin</a>
|
||||
</div>
|
||||
<div>
|
||||
<span>How do I change my ECLS password?</span><br>
|
||||
<a href=""><img src="/static/icons/post.svg" alt="">Change ECLS Password</a>
|
||||
<a href=""><img src="/dynamic/icon/post/366FFF" alt="">Change ECLS Password</a>
|
||||
</div>
|
||||
<div>
|
||||
<span>How do I use federation features in Enstrayed Cloud?</span><br>
|
||||
<a href=""><img src="/static/icons/post.svg" alt="">Enstrayed Cloud Federation Features</a>
|
||||
</div>
|
||||
<a href=""><img src="/dynamic/icon/post/366FFF" alt="">Enstrayed Cloud Federation Features</a>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -4,16 +4,14 @@
|
||||
<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'
|
||||
document.getElementById('formSelection').addEventListener('change', function() {
|
||||
useGlobalDialog(`Info`, `You selected ${this.value}`)
|
||||
})
|
||||
|
||||
fetch(`/api/helpdesk/forms/manifest.json`).then(fetchRes => {
|
||||
|
||||
fetch(`/api/helpdesk/forms/manifest`).then(fetchRes => {
|
||||
fetchRes.json().then(jsonRes => {
|
||||
for (let x in jsonRes) {
|
||||
let newElement = document.createElement('option')
|
||||
@@ -23,30 +21,66 @@
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
document.getElementById('formSelection').addEventListener('change', function() {
|
||||
document.getElementById("formarea").innerHTML = ""
|
||||
fetch(`/api/helpdesk/forms/${this.value}`).then(fetchRes => {
|
||||
fetchRes.json().then(jsonRes => {
|
||||
for (x in jsonRes.form) {
|
||||
let newElem
|
||||
switch (jsonRes.form[x].type) {
|
||||
case "text":
|
||||
newElem = document.createElement('div')
|
||||
newElem.innerHTML = `<label for="${"formarea_"+x}">${jsonRes.form[x].content}</label><br><input type="text" id="${"formarea_"+x}">`
|
||||
|
||||
document.getElementById("formarea").appendChild(newElem)
|
||||
break;
|
||||
|
||||
case "bigtext":
|
||||
newElem = document.createElement('div')
|
||||
newElem.innerHTML = `<label for="${"formarea_"+x}">${jsonRes.form[x].content}</label><br><textarea id="${"formarea_"+x}" ></textarea>`
|
||||
|
||||
document.getElementById("formarea").appendChild(newElem)
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="headerbar">
|
||||
<h1>Enstrayed Helpdesk</h1>
|
||||
<a href="/helpdesk">Main Page</a>
|
||||
<a href="/helpdesk" class="headerbarTitle">Enstrayed Helpdesk</a>
|
||||
<a>New Request</a>
|
||||
<a href="/helpdesk/articles">Knowledgebase</a>
|
||||
|
||||
<div class="headerbarright">
|
||||
<button id="loginButton" onclick="loginFunction()">Login</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="maincontent">
|
||||
<div class="newticketmaincontent">
|
||||
<h2>New Ticket</h2>
|
||||
<h1>This page is still a WORK IN PROGRESS and does not function.</h1>
|
||||
<h2>New Request</h2>
|
||||
<div>
|
||||
<label for="formSelection">Please select a form: </label>
|
||||
<select name="Form Selection" id="formSelection">
|
||||
<option value="none" disabled selected>-- Choose From List --</option>
|
||||
</select>
|
||||
</div>
|
||||
<hr>
|
||||
|
||||
<div id="formarea">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<dialog id="globalDialog">
|
||||
<h2 id="globalDialogHeader">Warning</h2>
|
||||
<p id="globalDialogText">This is a warning</p>
|
||||
|
||||
@@ -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).
|
||||
57
website/posts/20250619-UniFi-Network-on-Orange-Pi-Zero-3.md
Normal file
@@ -0,0 +1,57 @@
|
||||
# Setting up the UniFi Network Controller on an Orange Pi Zero 3
|
||||
|
||||
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.
|
||||
|
||||
The problem is that the UniFi controller depends on MongoDB for its database, and [MongoDB's system requirements](https://www.mongodb.com/docs/manual/administration/production-notes/#arm64) require the ARM V8.4-A microarchitecture at minimum (in english: Cortex A73 cores or later). The Zero 3 has Cortex A53 cores, which do not have the instruction sets required. I never really investigated the reasoning for this, but given that this makes Mongo's published builds incompatible with the Raspberry Pi 4, I find it rather strange, since that doesn't really strike me as an especially old SBC?
|
||||
|
||||
## Part 1: Installing Armbian
|
||||
I'll be honest, I normally don't mess around with SBCs so had no idea what the go-to distro was for RasPi clones. After what was probably less than 30 seconds of searching, I decided to use Armbian since it did exactly what I needed: Debian 12 ready to go.
|
||||
|
||||
1. the boring shit
|
||||
* `winget install balena.etcher`
|
||||
1. Download https://dl.armbian.com/orangepizero3/Bookworm_current_minimal
|
||||
2. select the file, select your sd card, press flash, blah blah blah
|
||||
2. the slightly less boring shit
|
||||
1. plug in the SD card, ethernet & power, wait for it to startup
|
||||
2. go to your dhcp server and find whatever IP it grabbed for itself
|
||||
3. `ssh root@<that ip address>`, default password is `1234` (Thank you armbian devs for letting you do the install process remotely)
|
||||
4. Go through the setup process, now is a great time to do a `apt update && apt upgrade`, set a hostname and possibly static IP address
|
||||
5. reboot for good measure
|
||||
|
||||
## Part 2: Installing MongoDB the dumb way
|
||||
|
||||
1. Download and install `libssl1.1`, I don't actually know if this is required anymore but it stops apt from complaining
|
||||
1. `curl -OL https://archive.debian.org/debian/pool/main/o/openssl/libssl1.1_1.1.1n-0+deb10u3_arm64.deb`
|
||||
2. `sudo dpkg -i libs<tab complete>`
|
||||
2. Download and install some old version of MongoDB I found; Won't actually be using the binary from this, but it gives us the systemd unit file and resolves the dependency in apt
|
||||
1. `curl -OL https://repo.mongodb.org/apt/ubuntu/dists/bionic/mongodb-org/4.4/multiverse/binary-arm64/mongodb-org-server_4.4.29_arm64.deb`
|
||||
2. `sudo dpkg -i mong<tab complete>`
|
||||
3. Download a `mongod` binary that actually works from a [MongoDB employee's personal GitHub](https://github.com/themattman/mongodb-raspberrypi-binaries) yes really
|
||||
* You may want to check for a more up to date build but w/e, select the one marked `pi4`
|
||||
1. `curl -OL https://github.com/themattman/mongodb-raspberrypi-binaries/releases/download/r7.0.14-rpi-unofficial/mongodb.ce.pi4.r7.0.14.tar.gz`
|
||||
2. `tar xvf mong<tab complete>`
|
||||
3. `sudo mv mongod /usr/bin/mongod`
|
||||
* Side note that I discovered later: UniFi manages the mongod process directly so you can keep the systemd service disabled.
|
||||
|
||||
## Part 3: Installing UniFi Network
|
||||
This next section is loosly modified from Ubiquiti's official setup instructions: https://help.ui.com/hc/en-us/articles/220066768-Updating-and-Installing-Self-Hosted-UniFi-Network-Servers-Linux
|
||||
|
||||
1. `sudo apt-get update && sudo apt-get install ca-certificates apt-transport-https`
|
||||
2. `echo 'deb [ arch=amd64,arm64 ] https://www.ui.com/downloads/unifi/debian stable ubiquiti' | sudo tee /etc/apt/sources.list.d/100-ubnt-unifi.list`
|
||||
3. `curl -L -o /etc/apt/trusted.gpg.d/unifi-repo.gpg https://dl.ui.com/unifi/unifi-repo.gpg`
|
||||
4. `sudo apt update`
|
||||
5. `sudo apt install unifi`
|
||||
|
||||
## The End
|
||||
UniFi should be up and running by this point, if it isn't then bash it with `sudo systemctl restart unifi` until it shows something at `https://<ip here>:8443`. If that still doesnt work, `sudo cat /usr/lib/unifi/logs/server.log` may provide a clue, or maybe it wont. FEW MORE THINGS:
|
||||
|
||||
* If you are migrating from another UniFi network install, FOR THE LOVE OF GOD DO NOT USE THE RESTORE BUTTON DURING THE INITIAL SETUP. Go through the setup process, *set your password*, and then go into Settings > System > Backups and use the restore button there.
|
||||
* If you, like me, did the above and found out that everything breaks, you can factory reset it by changing `is_default=` to `true` in `/var/lib/unifi/system.properties`. Don't forget to change it back after you run through the setup again.
|
||||
* I shat out this article at 1 AM so basically did no proof-reading or fact checking so the section about MongoDB's system requirements is probably wrong, LOL.
|
||||
* Armbian has a lot of warnings about using community editions and I got a rather loud warning during my install saying that I was using an automated build that wasn't for production use. It wasn't marked as such on the website and frankly I don't care. I have to assume this is supposed to be normie-proofing but it, like this entire ordeal, strikes me as bizarre. Recommendation: make sure to take backups somewhat often.
|
||||
@@ -16,22 +16,14 @@
|
||||
<body>
|
||||
<a href="/">Return to enstrayed.com</a>
|
||||
<h1>API Documentation</h1>
|
||||
<p>This page was last updated 2025-04-26.</p>
|
||||
|
||||
<p>Source Code & Issue Tracker: <a href="https://github.com/enstrayed/enstrayedapi">github.com/enstrayed/enstrayedapi</a></p>
|
||||
<p>This page was last updated 2025-12-15.</p>
|
||||
|
||||
<hr>
|
||||
|
||||
<div class="inlineheader">
|
||||
<h2>Important Note</h2>
|
||||
</div>
|
||||
|
||||
<p>Multiple API endpoints are being rewritten/added, especially relating to authentication & authorization, as part of a database change to Postgres. These changes are being made in the <a href="https://github.com/Enstrayed/enstrayedapi/tree/new-db">new-db</a> branch.</p>
|
||||
|
||||
<h2>Attention: This page is overdue for a rewrite and the information currently presented may not be accurate.</h2>
|
||||
|
||||
<div class="inlineheader">
|
||||
<h2>/api/nowplaying</h2>
|
||||
<a href="https://github.com/Enstrayed/enstrayedapi/blob/main/routes/nowplaying.js">nowplaying.js</a>
|
||||
<a href="https://git.enstrayed.com/enstrayed/enstrayedapi/src/branch/main/routes/nowplaying.js">nowplaying.js</a>
|
||||
<div>
|
||||
<span>GET</span>
|
||||
</div>
|
||||
@@ -41,7 +33,7 @@
|
||||
|
||||
<div class="inlineheader">
|
||||
<h2>/api/nowplayingbeta</h2>
|
||||
<a href="https://github.com/Enstrayed/enstrayedapi/blob/main/routes/nowplaying.js">nowplaying.js</a>
|
||||
<a href="https://git.enstrayed.com/enstrayed/enstrayedapi/src/branch/main/routes/nowplaying.js">nowplaying.js</a>
|
||||
<div>
|
||||
<span>GET</span>
|
||||
</div>
|
||||
@@ -51,7 +43,7 @@
|
||||
|
||||
<div class="inlineheader">
|
||||
<h2>/api/etyd/*</h2>
|
||||
<a href="https://github.com/Enstrayed/enstrayedapi/blob/main/routes/etyd.js">etyd.js</a>
|
||||
<a href="https://git.enstrayed.com/enstrayed/enstrayedapi/src/branch/main/routes/etyd.js">etyd.js</a>
|
||||
<div>
|
||||
<span>GET</span>
|
||||
<span>POST</span>
|
||||
@@ -72,7 +64,7 @@
|
||||
|
||||
<div class="inlineheader">
|
||||
<h2>/api/sendemail</h2>
|
||||
<a href="https://github.com/Enstrayed/enstrayedapi/blob/main/routes/mailjet.js#L3">mailjet.js</a>
|
||||
<a href="https://git.enstrayed.com/enstrayed/enstrayedapi/src/branch/main/routes/email.js">email.js</a>
|
||||
<div>
|
||||
<span>POST</span>
|
||||
</div>
|
||||
@@ -92,8 +84,8 @@
|
||||
}</code></pre>
|
||||
|
||||
<div class="inlineheader">
|
||||
<h2>/api/ip</h2>
|
||||
<a href="https://github.com/Enstrayed/enstrayedapi/blob/main/routes/ip.js">ip.js</a>
|
||||
<h2>/ip</h2>
|
||||
<a href="https://git.enstrayed.com/enstrayed/enstrayedapi/src/branch/main/routes/ip.js">ip.js</a>
|
||||
<div><span>GET</span></div>
|
||||
</div>
|
||||
|
||||
@@ -101,7 +93,7 @@
|
||||
|
||||
<div class="inlineheader">
|
||||
<h2>/api/headers</h2>
|
||||
<a href="https://github.com/Enstrayed/enstrayedapi/blob/main/routes/ip.js">ip.js</a>
|
||||
<a href="https://git.enstrayed.com/enstrayed/enstrayedapi/src/branch/main/routes/ip.js">ip.js</a>
|
||||
<div><span>GET</span></div>
|
||||
</div>
|
||||
|
||||
@@ -109,37 +101,17 @@
|
||||
|
||||
<div class="inlineheader">
|
||||
<h2>/api/auth/whoami</h2>
|
||||
<a href="https://github.com/Enstrayed/enstrayedapi/blob/new-db/routes/auth.js">auth.js:6</a>
|
||||
<a href="https://git.enstrayed.com/enstrayed/enstrayedapi/src/branch/main/routes/auth.js">auth.js</a>
|
||||
<div><span>GET</span></div>
|
||||
</div>
|
||||
<p>Returns JSON with the username of the token owner as well as what scopes the token has access to.</p>
|
||||
|
||||
<div class="inlineheader">
|
||||
<h2 id="jumplink_authlogin">/api/auth/login</h2>
|
||||
<a href="https://github.com/Enstrayed/enstrayedapi/blob/new-db/routes/auth.js">auth.js:23</a>
|
||||
<div><span>GET</span></div>
|
||||
</div>
|
||||
<p>Redirects the user to ECLS to login. The <code>state</code> parameter can be used to specify how the login flow will behave. The accepted "states" are:</p>
|
||||
<ul>
|
||||
<li><code>redirect</code> - Redirects the user to a page after logging in. This paramter requires the <code>destination</code> paramter to also be set with the URL the user will be redirected to.</li>
|
||||
<li><code>display</code> - Displays the generated token to the user after login. Currently, this still writes the new token to the <code>APIToken</code> cookie, though this is planned to change.</li>
|
||||
<li><code>close</code> - This will close the page after logging in. This requires the page to be opened with JavaScript otherwise it will not automatically close.</li>
|
||||
</ul>
|
||||
|
||||
<div class="inlineheader">
|
||||
<h2>/api/auth/logout</h2>
|
||||
<a href="https://github.com/Enstrayed/enstrayedapi/blob/new-db/routes/auth.js">auth.js:40</a>
|
||||
<a href="https://git.enstrayed.com/enstrayed/enstrayedapi/src/branch/main/routes/auth.js">auth.js</a>
|
||||
<div><span>GET</span></div>
|
||||
</div>
|
||||
<p>Invalidates the token used to access the endpoint.</p>
|
||||
|
||||
<div class="inlineheader">
|
||||
<h2>/api/auth/callback</h2>
|
||||
<a href="https://github.com/Enstrayed/enstrayedapi/blob/new-db/routes/auth.js">auth.js:57</a>
|
||||
<div><span>GET</span></div>
|
||||
</div>
|
||||
<p><b>Internal Use Only. </b>This is the endpoint used by ECLS to finish the login flow. It will write the newly created token to the <code>APIToken</code> cookie as well as performing the action set by <code>state</code>, see <a href="#jumplink_authlogin">login endpoint</a>.</p>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,13 +1,24 @@
|
||||
html {
|
||||
background-color: #0f0f0f;
|
||||
background-image: url('/dynamic/background/main');
|
||||
background-size: cover;
|
||||
background-position-y: 50%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
font-family: 'Segoe UI Variable', sans-serif;
|
||||
font-family: 'Segoe UI Variable Text', sans-serif;
|
||||
height: 100%;
|
||||
|
||||
background-color: #282828;
|
||||
|
||||
|
||||
display: grid;
|
||||
place-items: center;
|
||||
|
||||
backdrop-filter: blur(10px);
|
||||
|
||||
color: #fff;
|
||||
|
||||
}
|
||||
|
||||
@@ -18,13 +29,18 @@ body {
|
||||
gap: 2.5em;
|
||||
|
||||
padding: 2em;
|
||||
background-color: #fdfdfd;
|
||||
box-shadow: 0 0 1em 0 #202020;
|
||||
background-color: #0f0f0f;
|
||||
box-shadow: 0 0 1em 0 #0f0f0f;
|
||||
|
||||
|
||||
position: relative;
|
||||
margin-top: 96px;
|
||||
}
|
||||
|
||||
.mainContent > div > h1, h2 {
|
||||
margin: 0 0 0.5em;
|
||||
}
|
||||
|
||||
.linkColumn {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@@ -47,7 +63,6 @@ body {
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
gap: 0.2em;
|
||||
max-width: 14em;
|
||||
}
|
||||
|
||||
#nowplaying .nowPlayingLine2 {
|
||||
@@ -63,19 +78,27 @@ body {
|
||||
}
|
||||
|
||||
.blogPostsList > ul {
|
||||
list-style-image: url('/static/icons/post.svg');
|
||||
list-style-image: url('/dynamic/icon/post/7CB342');
|
||||
list-style-position: inside;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
gap: 0.5em;
|
||||
}
|
||||
|
||||
.blogPostsList > ul > li {
|
||||
margin: 0.5em 0 0;
|
||||
font-family: Consolas, monospace;
|
||||
}
|
||||
|
||||
.blogPostsList > ul > li > a {
|
||||
font-family: 'Segoe UI Variable', sans-serif;
|
||||
}
|
||||
|
||||
a, a:link {
|
||||
color: #366FFF;
|
||||
color: #7CB342;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
color: #ff8266;
|
||||
color: #9CCC65;
|
||||
}
|
||||
|
||||
a > img {
|
||||
|
||||
@@ -6,7 +6,8 @@ html {
|
||||
|
||||
body {
|
||||
margin: 2em 0 0 0;
|
||||
font-family: 'Segoe UI Variable', sans-serif;
|
||||
font-family: 'Segoe UI Variable Text', sans-serif;
|
||||
line-height: 1.3;
|
||||
|
||||
background-color: #202020;
|
||||
color: #F1F1F1;
|
||||
@@ -41,3 +42,22 @@ a:hover {
|
||||
color: white;
|
||||
background-color: #f06445;
|
||||
}
|
||||
|
||||
p {
|
||||
line-height: 120%;
|
||||
}
|
||||
|
||||
code {
|
||||
background: #181818;
|
||||
line-height: 130%;
|
||||
padding: 0 0.1rem 0;
|
||||
font-family: Consolas, monospace;
|
||||
}
|
||||
|
||||
pre code {
|
||||
display: block;
|
||||
overflow-x: auto;
|
||||
white-space: pre-wrap;
|
||||
background: #181818;
|
||||
padding: 1rem;
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
<svg width="256" height="256" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M2 16C2 8.28 8.28 2 16 2C23.72 2 30 8.28 30 16C30 23.72 23.72 30 16 30C8.28 30 2 23.72 2 16ZM4.04121 15H8.03076C8.13807 13.2596 8.52434 11.5753 9.1599 10H5.60892C4.74358 11.4936 4.191 13.1903 4.04121 15ZM10.0353 15H15V10H11.3456C10.6097 11.5521 10.1595 13.2429 10.0353 15ZM15 17H10.0353C10.1595 18.7571 10.6097 20.4479 11.3456 22H15V17ZM15 24H12.506C13.2065 25.0055 14.0427 25.9242 15 26.73V24ZM19.0053 27.6195C21.3304 27.0184 23.3836 25.7366 24.9392 24H21.8647C21.0976 25.3284 20.1372 26.548 19.0053 27.6195ZM22.8399 22H26.39V22.0019C27.256 20.5078 27.8089 18.8105 27.9588 17H23.9692C23.8619 18.7406 23.4756 20.4251 22.8399 22ZM21.9647 17H17V22H20.6544C21.3903 20.4479 21.8405 18.7571 21.9647 17ZM23.9692 15H27.9588C27.8089 13.1895 27.256 11.4922 26.39 9.99813V10H22.8401C23.4757 11.5753 23.8619 13.2596 23.9692 15ZM20.6544 10H17V15H21.9647C21.8405 13.2429 21.3903 11.5521 20.6544 10ZM21.8655 8H24.9392C23.3853 6.26532 21.3348 4.98441 19.0129 4.38249C20.1418 5.45442 21.0999 6.67328 21.8655 8ZM17 5.27004V8H19.494C18.7934 6.99455 17.9573 6.07585 17 5.27004ZM15 5.27001C14.0427 6.07583 13.2065 6.99454 12.506 8H15V5.27001ZM17 24V26.73C17.9573 25.9242 18.7935 25.0055 19.494 24H17ZM5.60892 22H9.16297C8.52579 20.4243 8.1385 18.7398 8.03086 17H4.04121C4.191 18.8097 4.74358 20.5064 5.60892 22ZM13.0014 27.6212C11.8688 26.5485 10.9075 25.3282 10.1396 24H7.0608C8.61787 25.7382 10.6736 27.0208 13.0014 27.6212ZM10.1345 8C10.9 6.67329 11.8581 5.45443 12.987 4.3825C10.6651 4.98443 8.61466 6.26533 7.0608 8H10.1345Z" fill="#FF5A36"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 1.6 KiB |
@@ -16,6 +16,7 @@
|
||||
height: 100%;
|
||||
color: #fff;
|
||||
background-color: #0b0b0b;
|
||||
font-family: sans-serif;
|
||||
}
|
||||
|
||||
body > div {
|
||||
@@ -35,7 +36,7 @@
|
||||
<h1>Under Construction</h1>
|
||||
<p>
|
||||
This page is undergoing a revamp and will be available again soon.<br>
|
||||
All API endpoints are still available. Documentation is available <a href="/posts/20240409-API-Documentation.html">here</a>.
|
||||
All API endpoints are still available. Documentation is available <a href="/posts/99999999-API-Documentation.html">here</a>.
|
||||
</p>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -17,14 +17,6 @@
|
||||
<script>
|
||||
fetch("/api/nowplayingbeta?format=html").then(response => response.text()).then(response => {document.getElementById("nowplaying").innerHTML = response})
|
||||
</script>
|
||||
<script>
|
||||
function rerollBlogPostsHeaderText() {
|
||||
let adjectives = [ "Assorted", "Random", "Various", "Miscellaneous", "Different", "Eclectic", "Mixed", "Profound"];
|
||||
document.getElementById("blogPostsHeader").innerHTML = adjectives[Math.floor(Math.random() * adjectives.length)] + " Notes";
|
||||
}
|
||||
|
||||
rerollBlogPostsHeaderText();
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@@ -37,40 +29,39 @@
|
||||
<div class="linkColumn">
|
||||
<div>
|
||||
<span>I received an Email from @enstrayed.com</span><br>
|
||||
<a href="https://helpdesk.enstrayed.com"><img src="/static/icons/external.svg" alt="">Click here for information about EOES</a>
|
||||
<a href="/helpdesk/articles/EOES-What_is_EOES.md"><img src="/dynamic/icon/external/7CB342" alt="">Click here for information about EOES</a>
|
||||
</div>
|
||||
<div>
|
||||
<span>I need help with an Enstrayed.com web service</span><br>
|
||||
<a href="https://helpdesk.enstrayed.com"><img src="/static/icons/external.svg" 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="/static/icons/link.svg" alt="">URL Toolbox</a>
|
||||
<span>I'd like to get in contact</span><br>
|
||||
<a href="https://twitter.com/enstrayed"><img src="/dynamic/icon/twitter/7CB342" alt="">@Enstrayed on Twitter</a>
|
||||
</div>
|
||||
<!-- <div>
|
||||
<a href="/urltoolbox"><img src="/dynamic/icon/link/7CB342" alt="">URL Toolbox</a>
|
||||
</div> -->
|
||||
<div>
|
||||
<a href="/posts/20240409-API-Documentation.html"><img src="/static/icons/link.svg" alt="">API Documentation</a>
|
||||
</div>
|
||||
<div>
|
||||
<a href="https://downloads.enstrayed.com"><img src="/static/icons/link.svg" alt="">Downloads</a>
|
||||
</div>
|
||||
<div class="apiVersion">
|
||||
<!--SSR_APIVERSION-->
|
||||
<a href="https://files.enstrayed.com/public/"><img src="/dynamic/icon/link/7CB342" alt="">Downloads</a>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<!-- <img src="/static/snow-leopard.svg" alt="Snow Leopard Icon" width="64"> -->
|
||||
<h1>@Enstrayed</h1>
|
||||
<div class="linkColumn marginBottom1em">
|
||||
<a href="https://twitter.com/enstrayed"><img src="/static/icons/twitter.svg" alt="">Twitter</a>
|
||||
<a href="https://github.com/enstrayed"><img src="/static/icons/github.svg" alt="">GitHub</a>
|
||||
</div>
|
||||
|
||||
<h1 id="blogPostsHeader">/posts/</h1>
|
||||
<div class="blogPostsList">
|
||||
<h2 id="blogPostsHeader" onclick="rerollBlogPostsHeaderText()">Notes</h2>
|
||||
|
||||
<ul>
|
||||
<!--SSR_BLOGPOSTS-->
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="apiVersion">
|
||||
<!--SSR_APIVERSION-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||