From 2fbf20e4e318382993e905d30f42fb1fdaca4e1a Mon Sep 17 00:00:00 2001 From: ClaraCrazy Date: Wed, 7 Jan 2026 09:26:51 +0100 Subject: [PATCH] [Chore] Rename old route Also update readme --- README.md | 15 +++++++++++++- .../web/routes/{login.js => home.js} | 20 +++++++++---------- .../web/views/{login.twig => home.twig} | 0 infrastructure/web/web.js | 4 ++-- package.json | 2 +- 5 files changed, 27 insertions(+), 14 deletions(-) rename infrastructure/web/routes/{login.js => home.js} (78%) rename infrastructure/web/views/{login.twig => home.twig} (100%) diff --git a/README.md b/README.md index b27f272..71bc3e8 100644 --- a/README.md +++ b/README.md @@ -136,7 +136,20 @@ If desired, you can also move the config file somewhere else (change volume moun ----- -## Support me +## TODO: +- Tor mode: + - Light-weight mode that can run either standalone or alongside an http instance + - Provides a minimal, js-less instance for our friends on the other side <3 +- Admin Dashboard: + - Admin dashboard allows to edit (almost) all config entries + - Includes patch / refactor to allow for hotswapping (almost) all config entries. +- Polish: + - Lots of polish required, consolidating files etc. +
+ +----- + +## Support me ❤️ If you find this project useful, consider supporting its development! diff --git a/infrastructure/web/routes/login.js b/infrastructure/web/routes/home.js similarity index 78% rename from infrastructure/web/routes/login.js rename to infrastructure/web/routes/home.js index 0c6ce39..a81a72b 100644 --- a/infrastructure/web/routes/login.js +++ b/infrastructure/web/routes/home.js @@ -12,17 +12,17 @@ router.get('/', async(req, res, next) => { if (!mailProcessingService) { throw new Error('Mail processing service not available') } - debug('Login page requested') + debug('Home page requested') const context = templateContext.build(req, { username: randomWord() }) - res.render('login', { + res.render('home', { ...context, title: `${context.branding[0]} | Your temporary Inbox` }) } catch (error) { - debug('Error loading login page:', error.message) - console.error('Error while loading login page', error) + debug('Error loading home page:', error.message) + console.error('Error while loading home page', error) next(error) } }) @@ -49,26 +49,26 @@ router.post( } const errors = validationResult(req) if (!errors.isEmpty()) { - debug(`Login validation failed for ${req.body.username}@${req.body.domain}: ${errors.array().map(e => e.msg).join(', ')}`) + debug(`Home validation failed for ${req.body.username}@${req.body.domain}: ${errors.array().map(e => e.msg).join(', ')}`) const context = templateContext.build(req, { userInputError: true, username: randomWord() }) - return res.render('login', { + return res.render('home', { ...context, title: `${context.branding[0]} | Your temporary Inbox` }) } const inbox = `${req.body.username}@${req.body.domain}` - debug(`Login successful, redirecting to inbox: ${inbox}`) + debug(`Home validation successful, redirecting to inbox: ${inbox}`) res.redirect(`/inbox/${inbox}`) } catch (error) { - debug('Error processing login:', error.message) - console.error('Error while processing login', error) + debug('Error processing request:', error.message) + console.error('Error while processing request', error) next(error) } } ) -module.exports = router +module.exports = router \ No newline at end of file diff --git a/infrastructure/web/views/login.twig b/infrastructure/web/views/home.twig similarity index 100% rename from infrastructure/web/views/login.twig rename to infrastructure/web/views/home.twig diff --git a/infrastructure/web/web.js b/infrastructure/web/web.js index 559be3a..7cd28bf 100644 --- a/infrastructure/web/web.js +++ b/infrastructure/web/web.js @@ -13,7 +13,7 @@ const socketio = require('socket.io') const config = require('../../application/config') const createApiRouter = require('./api/router') const inboxRouter = require('./routes/inbox') -const loginRouter = require('./routes/login') +const homeRouter = require('./routes/home') const errorRouter = require('./routes/error') const lockRouter = require('./routes/lock') const authRouter = require('./routes/auth') @@ -185,7 +185,7 @@ app.use('/api/v1', (req, res, next) => { }) // Web routes -app.use('/', loginRouter) +app.use('/', homeRouter) if (config.user.authEnabled) { app.use('/', authRouter) app.use('/', accountRouter) diff --git a/package.json b/package.json index 0e702b9..adec2ce 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "48hr.email", - "version": "2.3.0", + "version": "2.3.2", "private": false, "description": "48hr.email is your favorite open-source tempmail client.", "keywords": [