diff --git a/config.example.json b/config.example.json index cb43df6..58445d8 100644 --- a/config.example.json +++ b/config.example.json @@ -32,5 +32,6 @@ "secure": true, "address": "toke@42069.weed", "pass": "CHANGE_ME" - } + }, + "aboutText":"ourfore.st 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." } \ No newline at end of file diff --git a/config.example.jsonc b/config.example.jsonc index 02fb88e..3f1bd0a 100644 --- a/config.example.jsonc +++ b/config.example.jsonc @@ -59,5 +59,7 @@ "secure": true, "address": "toke@42069.weed", "pass": "CHANGE_ME" - } + }, + //Fills the 'about ${instanceName}' section on the /about page, lets users know about your specific instance + "aboutText":"ourfore.st 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." } \ No newline at end of file diff --git a/src/controllers/aboutController.js b/src/controllers/aboutController.js new file mode 100644 index 0000000..2b32b84 --- /dev/null +++ b/src/controllers/aboutController.js @@ -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 .*/ + +//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)}); +} \ No newline at end of file diff --git a/src/routers/aboutRouter.js b/src/routers/aboutRouter.js new file mode 100644 index 0000000..8739880 --- /dev/null +++ b/src/routers/aboutRouter.js @@ -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 .*/ + +//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; diff --git a/src/server.js b/src/server.js index 3f47c43..da30147 100644 --- a/src/server.js +++ b/src/server.js @@ -54,6 +54,7 @@ const fileNotFoundController = require('./controllers/404Controller'); //Router //Humie-Friendly const indexRouter = require('./routers/indexRouter'); +const aboutRouter = require('./routers/aboutRouter'); const registerRouter = require('./routers/registerRouter'); const loginRouter = require('./routers/loginRouter'); const profileRouter = require('./routers/profileRouter'); @@ -179,6 +180,7 @@ app.use(sessionUtils.rememberMeMiddleware); //Routes //Humie-Friendly app.use('/', indexRouter); +app.use('/about', aboutRouter); app.use('/register', registerRouter); app.use('/login', loginRouter); app.use('/profile', profileRouter); diff --git a/src/views/about.ejs b/src/views/about.ejs new file mode 100644 index 0000000..8842ff0 --- /dev/null +++ b/src/views/about.ejs @@ -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 . %> + + + + <%- include('partial/styles', {instance, user}); %> + <%- include('partial/csrfToken', {csrfToken}); %> + + <%= instance %> - about + + + <%- include('partial/navbar', {user}); %> +
+

About <%= instance %>

+
+

About <%= instance %>

+ <%# 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.%> +

<%- aboutText %>

+

About Canopy

+

Canopy is the software behind <%= instance %>. Originally written by rainbownapkin for the founding instance, + ourfore.st. Ourfore.st was originally a cytube instance, set up after the 2021 + shutdown of TTN, a movie watching/weed smoking community related to the r/trees + subreddit. +
+
+ 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 Canopy, which was + first used to run the ourfore.st instance in late 2025.

+
+
+ +
+ <%- include('partial/scripts', {user}); %> +
+ diff --git a/src/views/partial/navbar.ejs b/src/views/partial/navbar.ejs index 3dc3065..aa9a56a 100644 --- a/src/views/partial/navbar.ejs +++ b/src/views/partial/navbar.ejs @@ -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 along with this program. If not, see . %> \ No newline at end of file diff --git a/www/css/about.css b/www/css/about.css new file mode 100644 index 0000000..52ce658 --- /dev/null +++ b/www/css/about.css @@ -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 .*/ +#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; +} \ No newline at end of file