Added basic about page.
This commit is contained in:
parent
1bd9fcdc80
commit
7cda9517d4
|
|
@ -32,5 +32,6 @@
|
||||||
"secure": true,
|
"secure": true,
|
||||||
"address": "toke@42069.weed",
|
"address": "toke@42069.weed",
|
||||||
"pass": "CHANGE_ME"
|
"pass": "CHANGE_ME"
|
||||||
}
|
},
|
||||||
|
"aboutText":"<a href=\"https://ourfore.st/\">ourfore.st</a> is the one and only original canopy instance. Setup, ran, and administered by rainbownapkin herself. This site exists to provide a featureful, preformant, and comfy replacement for the TTN community."
|
||||||
}
|
}
|
||||||
|
|
@ -59,5 +59,7 @@
|
||||||
"secure": true,
|
"secure": true,
|
||||||
"address": "toke@42069.weed",
|
"address": "toke@42069.weed",
|
||||||
"pass": "CHANGE_ME"
|
"pass": "CHANGE_ME"
|
||||||
}
|
},
|
||||||
|
//Fills the 'about ${instanceName}' section on the /about page, lets users know about your specific instance
|
||||||
|
"aboutText":"<a href=\"https://ourfore.st/\">ourfore.st</a> is the one and only original canopy instance. Setup, ran, and administered by rainbownapkin herself. This site exists to provide a featureful, preformant, and comfy replacement for the TTN community."
|
||||||
}
|
}
|
||||||
27
src/controllers/aboutController.js
Normal file
27
src/controllers/aboutController.js
Normal file
|
|
@ -0,0 +1,27 @@
|
||||||
|
/*Canopy - The next generation of stoner streaming software
|
||||||
|
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as
|
||||||
|
published by the Free Software Foundation, either version 3 of the
|
||||||
|
License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see <https://www.gnu.org/licenses/>.*/
|
||||||
|
|
||||||
|
//Config
|
||||||
|
const config = require('../../config.json');
|
||||||
|
|
||||||
|
//Local Imports
|
||||||
|
const csrfUtils = require('../utils/csrfUtils');
|
||||||
|
|
||||||
|
//register page functions
|
||||||
|
module.exports.get = async function(req, res){
|
||||||
|
//Render page
|
||||||
|
return res.render('about', {aboutText: config.aboutText, instance: config.instanceName, user: req.session.user, csrfToken: csrfUtils.generateToken(req)});
|
||||||
|
}
|
||||||
34
src/routers/aboutRouter.js
Normal file
34
src/routers/aboutRouter.js
Normal file
|
|
@ -0,0 +1,34 @@
|
||||||
|
/*Canopy - The next generation of stoner streaming software
|
||||||
|
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as
|
||||||
|
published by the Free Software Foundation, either version 3 of the
|
||||||
|
License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see <https://www.gnu.org/licenses/>.*/
|
||||||
|
|
||||||
|
//npm imports
|
||||||
|
const { Router } = require('express');
|
||||||
|
|
||||||
|
|
||||||
|
//local imports
|
||||||
|
const aboutController = require("../controllers/aboutController");
|
||||||
|
const presenceUtils = require("../utils/presenceUtils");
|
||||||
|
|
||||||
|
//globals
|
||||||
|
const router = Router();
|
||||||
|
|
||||||
|
//Use presence middleware
|
||||||
|
router.use(presenceUtils.presenceMiddleware);
|
||||||
|
|
||||||
|
//routing functions
|
||||||
|
router.get('/', aboutController.get);
|
||||||
|
|
||||||
|
module.exports = router;
|
||||||
|
|
@ -54,6 +54,7 @@ const fileNotFoundController = require('./controllers/404Controller');
|
||||||
//Router
|
//Router
|
||||||
//Humie-Friendly
|
//Humie-Friendly
|
||||||
const indexRouter = require('./routers/indexRouter');
|
const indexRouter = require('./routers/indexRouter');
|
||||||
|
const aboutRouter = require('./routers/aboutRouter');
|
||||||
const registerRouter = require('./routers/registerRouter');
|
const registerRouter = require('./routers/registerRouter');
|
||||||
const loginRouter = require('./routers/loginRouter');
|
const loginRouter = require('./routers/loginRouter');
|
||||||
const profileRouter = require('./routers/profileRouter');
|
const profileRouter = require('./routers/profileRouter');
|
||||||
|
|
@ -179,6 +180,7 @@ app.use(sessionUtils.rememberMeMiddleware);
|
||||||
//Routes
|
//Routes
|
||||||
//Humie-Friendly
|
//Humie-Friendly
|
||||||
app.use('/', indexRouter);
|
app.use('/', indexRouter);
|
||||||
|
app.use('/about', aboutRouter);
|
||||||
app.use('/register', registerRouter);
|
app.use('/register', registerRouter);
|
||||||
app.use('/login', loginRouter);
|
app.use('/login', loginRouter);
|
||||||
app.use('/profile', profileRouter);
|
app.use('/profile', profileRouter);
|
||||||
|
|
|
||||||
49
src/views/about.ejs
Normal file
49
src/views/about.ejs
Normal file
|
|
@ -0,0 +1,49 @@
|
||||||
|
<%# Canopy - The next generation of stoner streaming software
|
||||||
|
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as
|
||||||
|
published by the Free Software Foundation, either version 3 of the
|
||||||
|
License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see <https://www.gnu.org/licenses/>. %>
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<%- include('partial/styles', {instance, user}); %>
|
||||||
|
<%- include('partial/csrfToken', {csrfToken}); %>
|
||||||
|
<link rel="stylesheet" type="text/css" href="css/about.css">
|
||||||
|
<title><%= instance %> - about</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<%- include('partial/navbar', {user}); %>
|
||||||
|
<div id="about-div">
|
||||||
|
<h1>About <%= instance %></h1>
|
||||||
|
<div class="dynamic-container" id="about-text">
|
||||||
|
<h2>About <%= instance %></h2>
|
||||||
|
<%# It's not XSS if the text came from the config made by the server admin. If you can't trust that, you're already fucked.%>
|
||||||
|
<p><%- aboutText %></p>
|
||||||
|
<h2>About Canopy</h2>
|
||||||
|
<p>Canopy is the software behind <%= instance %>. Originally written by rainbownapkin for the founding instance,
|
||||||
|
<a href="https://ourfore.st">ourfore.st</a>. Ourfore.st was originally a cytube instance, set up after the 2021
|
||||||
|
shutdown of TTN, a movie watching/weed smoking community related to the <a href="https://reddit.com/r/trees">r/trees</a>
|
||||||
|
subreddit.
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
After a years of service, thousands of lines worth of stapled on modifications, the shutdown of sister sites,
|
||||||
|
it was decided that the original cytube fork, fore.st, had been run past it's prime. In summer/fall 2024, work began on a
|
||||||
|
replacement. The resulting software became <a href="https://git.ourfore.st/rainbownapkin/canopy">Canopy</a>, which was
|
||||||
|
first used to run the ourfore.st instance in late 2025.</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
<footer>
|
||||||
|
<%- include('partial/scripts', {user}); %>
|
||||||
|
</footer>
|
||||||
|
</html>
|
||||||
|
|
@ -14,16 +14,19 @@ GNU Affero General Public License for more details.
|
||||||
You should have received a copy of the GNU Affero General Public License
|
You should have received a copy of the GNU Affero General Public License
|
||||||
along with this program. If not, see <https://www.gnu.org/licenses/>. %>
|
along with this program. If not, see <https://www.gnu.org/licenses/>. %>
|
||||||
<div id="navbar">
|
<div id="navbar">
|
||||||
<p class="navbar-item" id="instance-title"><a href="/" class="navbar-item"><%= instance %></a></p>
|
<span class="navbar-item">
|
||||||
|
<%#<a class="navbar-item" href="/" id="instance-title">%><%#= instance %><%#</a><p class="navbar-item"> - <a class="navbar-item" href="/about">about</a></p>%>
|
||||||
|
<a class="navbar-item" href="/" id="instance-title"><%= instance %></a>
|
||||||
|
</span>
|
||||||
<span class="navbar-item" id="right-controls">
|
<span class="navbar-item" id="right-controls">
|
||||||
<% if(user){ %>
|
<% if(user){ %>
|
||||||
<p class="navbar-item">Welcome, <a class="navbar-item" id="username" href="/profile"><%= user.user %></a> - <% if(user.rank == "admin"){ %><a href="/adminPanel" title="Admin Panel" class="bi bi-server navbar-item"></a> <% } %><a class="navbar-item" href="javascript:" id="logout-button">logout</a></p>
|
<p class="navbar-item">Welcome, <a class="navbar-item" id="username" href="/profile"><%= user.user %></a> - <% if(user.rank == "admin"){ %><a href="/adminPanel" title="Admin Panel" class="bi bi-server navbar-item"></a> - <% } %> <a class="navbar-item" href="/about">About</a> - <a class="navbar-item" href="javascript:" id="logout-button">Logout</a></p>
|
||||||
<% }else{ %>
|
<% }else{ %>
|
||||||
<p class="navbar-item">Remember Me:</p>
|
<p class="navbar-item">Remember Me:</p>
|
||||||
<input class="navbar-item login-prompt" id="remember-me" type="checkbox">
|
<input class="navbar-item login-prompt" id="remember-me" type="checkbox">
|
||||||
<input class="navbar-item login-prompt" id="username-prompt" placeholder="username">
|
<input class="navbar-item login-prompt" id="username-prompt" placeholder="username">
|
||||||
<input class="navbar-item login-prompt" id="password-prompt" placeholder="password" type="password">
|
<input class="navbar-item login-prompt" id="password-prompt" placeholder="password" type="password">
|
||||||
<p class="navbar-item"><a class="navbar-item" href="javascript:" id="login-button">Login</a> - <a class="navbar-item" href="/passwordReset">Forgot Password</a> - <a class="navbar-item" href="/register">Register</a></p>
|
<p class="navbar-item"><a class="navbar-item" href="javascript:" id="login-button">Login</a> - <a class="navbar-item" href="/passwordReset">Forgot Password</a> - <a class="navbar-item" href="/register">Register</a> - <a class="navbar-item" href="/about">About</a></p>
|
||||||
<% } %>
|
<% } %>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
39
www/css/about.css
Normal file
39
www/css/about.css
Normal file
|
|
@ -0,0 +1,39 @@
|
||||||
|
/*Canopy - The next generation of stoner streaming software
|
||||||
|
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as
|
||||||
|
published by the Free Software Foundation, either version 3 of the
|
||||||
|
License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see <https://www.gnu.org/licenses/>.*/
|
||||||
|
#about-div{
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (orientation: landscape){
|
||||||
|
#about-div{
|
||||||
|
margin: 0 25%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (orientation: portrait){
|
||||||
|
#about-div{
|
||||||
|
margin: 0 10%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
h1{
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
#about-text{
|
||||||
|
padding: 0 0.5em;
|
||||||
|
}
|
||||||
Loading…
Reference in a new issue