diff --git a/LICENSE b/LICENSE index f288702..ed990f8 100644 --- a/LICENSE +++ b/LICENSE @@ -618,57 +618,4 @@ an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU 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 General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. + END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/notes.md b/notes.md index a4d9168..ff3d4d1 100644 --- a/notes.md +++ b/notes.md @@ -7,6 +7,9 @@ - Seat numbering!! +- Website: Add ids to titles + + - Update files to import when deploying for included json files instead of secret.json files - Fix text field overflow (text too big for box) @@ -17,4 +20,62 @@ - FUTURE: Add Admin profile (page to change account settings per person like changing pwd) - FUTURE add multi-language support - FUTURE: Guest purchase -- FUTURE: add webpack (or any other minifying tool) to project website to decrease file size (OPTIONAL) \ No newline at end of file +- FUTURE: add webpack (or any other minifying tool) to project website to decrease file size (OPTIONAL) + + + +GPL Stuff: + +How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + libreevent - Free and Open Source Event Management and Ticketing + Solution + Copyright (C) 2023 Janis Hutz + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + libreevent Copyright (C) 2023 Janis Hutz + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/src/server/app.js b/src/server/app.js index 5e48fc1..05c9aa5 100644 --- a/src/server/app.js +++ b/src/server/app.js @@ -52,10 +52,11 @@ const settings = JSON.parse( fs.readFileSync( path.join( __dirname + '/config/se // Vue SSR and gets its support files (e.g. CSS and JS files) from // the /home/supportFiles/:file route plus its assets from the /otherAssets/:file // route). - -app.get( '/', ( req, res ) => { - res.sendFile( path.join( __dirname + '/ui/home/active/en/index.html' ) ); -} ); +if ( settings.init ) { + app.get( '/', ( req, res ) => { + res.sendFile( path.join( __dirname + '/ui/home/active/en/index.html' ) ); + } ); +} // Set up static routes for static file serving (performance wise not @@ -94,6 +95,7 @@ if ( settings.init ) { require( './backend/payments/paymentRoutes.js' )( app, settings ); // payment routes require( './backend/plugins/pluginLoader.js' )( app, settings ); // plugin loader } else { + console.log( '[ Setup ] Loading setup routes' ); require( './setup/setupRoutes.js' )( app, settings ); // setup routes file = path.join( __dirname + '/webapp/setup/dist/index.html' ); } diff --git a/src/server/config/settings.config.json b/src/server/config/settings.config.json index 55e24b6..d5cfc2c 100644 --- a/src/server/config/settings.config.json +++ b/src/server/config/settings.config.json @@ -1 +1 @@ -{"init":true,"twoFA":"enforce","setupKey":"hello world","twoFAMode":"enhanced","db":"json","payments":"stripe","name":"libreevent","yourDomain":"http://localhost:8080","mailSender":"libreevent ","maxTickets":10,"currency":"CHF","gcInterval":300,"ticketTimeout":900,"startPage":"default","version":"1.0.0"} \ No newline at end of file +{"init":false,"twoFA":"enforce","setupKey":"hello world","twoFAMode":"enhanced","db":"json","payments":"stripe","name":"libreevent","yourDomain":"http://localhost:8080","mailSender":"libreevent ","maxTickets":10,"currency":"CHF","gcInterval":300,"ticketTimeout":900,"startPage":"default","version":"1.0.0"} \ No newline at end of file diff --git a/src/server/setup/homePageCompiler.js b/src/server/setup/homePageCompiler.js deleted file mode 100644 index e69de29..0000000 diff --git a/src/server/setup/setupRoutes.js b/src/server/setup/setupRoutes.js index 6cff442..a1a1bd8 100644 --- a/src/server/setup/setupRoutes.js +++ b/src/server/setup/setupRoutes.js @@ -8,19 +8,34 @@ */ let db = null; +const fs = require( 'fs' ); +const path = require( 'path' ); +const bodyParser = require( 'body-parser' ); // const db = require( '../backend/db/db.js' ); module.exports = ( app, settings ) => { /* - Admin login route that checks the password + Setup start route that checks if setup key was correct */ - app.get( '/setup/start', ( request, response ) => { - if ( request.query.token === settings.setupToken ) { + app.post( '/setup/start', bodyParser.json(), ( request, response ) => { + if ( request.body.token === '' + fs.readFileSync( path.join( __dirname + '/../setupkey.txt' ) ) ) { response.send( 'ok' ); } else { - response.send( 'incorrect' ); + response.status( 400 ).send( 'incorrect' ); } } ); + app.get( '/setup/getKeyStatus', ( req, res ) => { + if ( req.session.setupKeyOk ) { + res.send( 'ok' ); + } else { + res.status( 403 ).send( 'not authorized' ); + } + } ); + + app.get( '/test/login', ( req, res ) => { + req.session.setupKeyOk = true; + res.send( 'ok' ); + } ); }; \ No newline at end of file diff --git a/src/server/setupkey.txt b/src/server/setupkey.txt index e69de29..5f4e52e 100644 --- a/src/server/setupkey.txt +++ b/src/server/setupkey.txt @@ -0,0 +1 @@ +klbjdfgsgsdjhlfkgfshjkgsfhjsiutuitpwergvuilavlsuv \ No newline at end of file diff --git a/src/webapp/setup/src/router/setupRoutes.js b/src/webapp/setup/src/router/setupRoutes.js index b3fd90d..2d32ac6 100644 --- a/src/webapp/setup/src/router/setupRoutes.js +++ b/src/webapp/setup/src/router/setupRoutes.js @@ -43,15 +43,6 @@ export default { setupAuthRequired: true, } }, - { - path: 'page', - name: 'setupPage', - component: () => import( '../views/SetupPageView.vue' ), - meta: { - title: 'Landing page :: Setup - libreevent', - setupAuthRequired: true, - } - }, { path: 'complete', name: 'setupComplete', diff --git a/src/webapp/setup/src/views/HomeView.vue b/src/webapp/setup/src/views/HomeView.vue index a9b4f95..1e83ae2 100644 --- a/src/webapp/setup/src/views/HomeView.vue +++ b/src/webapp/setup/src/views/HomeView.vue @@ -14,24 +14,55 @@

Let's start the setup by entering the setup key below! You may define a setup key in the setupkey.txt file of libreevent. See here for more instructions


- +
+ diff --git a/src/webapp/setup/src/views/SetupPageView.vue b/src/webapp/setup/src/views/SetupPageView.vue deleted file mode 100644 index 00f117f..0000000 --- a/src/webapp/setup/src/views/SetupPageView.vue +++ /dev/null @@ -1,51 +0,0 @@ - - - - - diff --git a/src/webapp/setup/src/views/SetupRootView.vue b/src/webapp/setup/src/views/SetupRootView.vue index 715b832..13bc59d 100644 --- a/src/webapp/setup/src/views/SetupRootView.vue +++ b/src/webapp/setup/src/views/SetupRootView.vue @@ -169,8 +169,8 @@ } }, proceed () { - this.backendStore.addVisitedSetupPages( 'page', true ); - this.$router.push( 'page' ); + this.backendStore.addVisitedSetupPages( 'complete', true ); + this.$router.push( 'complete' ); } }, }; diff --git a/src/webapp/setup/src/views/SetupView.vue b/src/webapp/setup/src/views/SetupView.vue index b1ad7a1..9c05ed5 100644 --- a/src/webapp/setup/src/views/SetupView.vue +++ b/src/webapp/setup/src/views/SetupView.vue @@ -15,8 +15,6 @@ Basic Setup | Root account Root account | - Landing page - Landing page | Complete Complete @@ -45,6 +43,17 @@ }, created () { this.backendStore.loadVisitedSetupPages(); + fetch( '/setup/getKeyStatus' ).then( res => { + if ( res.status === 200 ) { + res.text().then( text => { + if ( text != 'ok' ) { + this.$router.push( '/' ); + } + } ); + } else { + this.$router.push( '/' ); + } + } ); }, };