diff --git a/.env-sample b/.env-sample new file mode 100644 index 0000000..9cf99a4 --- /dev/null +++ b/.env-sample @@ -0,0 +1,5 @@ +DB_ROOT_PASSWD='secret' +DB_USER='evote' +DB_USER_PASSWD='secret' +DB_NAME='evote' +NGINX_PORT=80 \ No newline at end of file diff --git a/.gitignore b/.gitignore index 9f45c3a..4c49bd7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1 @@ -RandomLib/vendor -RandomLib/composer.phar -data/slask.php -data/config.php -.DS_Store \ No newline at end of file +.env diff --git a/README.md b/README.md index dc97c45..6996d47 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,22 @@ A good strategy of handling the personal codes of a meeting is to create the ele ## Installation guide +### Quickstart for docker +This version of E-vote has been constructed to work with Docker in order for the setup to be quicker than before. Implementationdetails are outlined below. +Rename .env-sample to .env and change the default values. These are used in the setup of the website. Note that `NGINX_PORT` should only be changed if used behind a reverse proxy as the final url must access port 80. + +After that run it with +``` +docker-compose up +``` +This will download the base images (webserver and database), add the files from this project, configure these and then run it. As a final step, open the webbrowser and open `{baseurl}/install/setup.php` and complete the setup there. If developing locally, use `127.0.0.1` since `localhost` does not work. Database `host` will be `mysql`. + +#### Docker implementation +Docker-compose creates 3 containers, NGINX which is the webserver, PHP evaluates the PHP sites for NGINX, and mysql which is the database used. + +Each of these containers has their own dockerfile for configuring them. NGINX has to include multiple files for configuration, as well as the project files. PHP has to import functionallity to connect to the database, and the database needs a prefilled database. + +If the stack is stopped, the data is retained in volumes, and as such if started again will not need new setup. ### Running locally for development/testing If you are going to develop or test E-vote locally you can use PHP's built-in tools. Simply clone the repo, change directory to the one created by the clone and run diff --git a/app/.gitignore b/app/.gitignore new file mode 100644 index 0000000..9f45c3a --- /dev/null +++ b/app/.gitignore @@ -0,0 +1,5 @@ +RandomLib/vendor +RandomLib/composer.phar +data/slask.php +data/config.php +.DS_Store \ No newline at end of file diff --git a/LICENSE b/app/LICENSE similarity index 100% rename from LICENSE rename to app/LICENSE diff --git a/actions/adminpagehandler.php b/app/actions/adminpagehandler.php similarity index 100% rename from actions/adminpagehandler.php rename to app/actions/adminpagehandler.php diff --git a/actions/codeprint.php b/app/actions/codeprint.php similarity index 100% rename from actions/codeprint.php rename to app/actions/codeprint.php diff --git a/actions/csvcodesend.php b/app/actions/csvcodesend.php similarity index 100% rename from actions/csvcodesend.php rename to app/actions/csvcodesend.php diff --git a/actions/electionadminpagehandler.php b/app/actions/electionadminpagehandler.php similarity index 100% rename from actions/electionadminpagehandler.php rename to app/actions/electionadminpagehandler.php diff --git a/actions/genlastresult.php b/app/actions/genlastresult.php similarity index 100% rename from actions/genlastresult.php rename to app/actions/genlastresult.php diff --git a/actions/pollRoundStatus.php b/app/actions/pollRoundStatus.php similarity index 100% rename from actions/pollRoundStatus.php rename to app/actions/pollRoundStatus.php diff --git a/actions/useradminpagehandler.php b/app/actions/useradminpagehandler.php similarity index 100% rename from actions/useradminpagehandler.php rename to app/actions/useradminpagehandler.php diff --git a/actions/usersessionhandler.php b/app/actions/usersessionhandler.php similarity index 100% rename from actions/usersessionhandler.php rename to app/actions/usersessionhandler.php diff --git a/actions/votingpagehandler.php b/app/actions/votingpagehandler.php similarity index 100% rename from actions/votingpagehandler.php rename to app/actions/votingpagehandler.php diff --git a/css/bootstrap-theme.css b/app/css/bootstrap-theme.css similarity index 100% rename from css/bootstrap-theme.css rename to app/css/bootstrap-theme.css diff --git a/css/bootstrap-theme.css.map b/app/css/bootstrap-theme.css.map similarity index 100% rename from css/bootstrap-theme.css.map rename to app/css/bootstrap-theme.css.map diff --git a/css/bootstrap-theme.min.css b/app/css/bootstrap-theme.min.css similarity index 100% rename from css/bootstrap-theme.min.css rename to app/css/bootstrap-theme.min.css diff --git a/css/bootstrap.css b/app/css/bootstrap.css similarity index 100% rename from css/bootstrap.css rename to app/css/bootstrap.css diff --git a/css/bootstrap.css.map b/app/css/bootstrap.css.map similarity index 100% rename from css/bootstrap.css.map rename to app/css/bootstrap.css.map diff --git a/css/bootstrap.min.css b/app/css/bootstrap.min.css similarity index 100% rename from css/bootstrap.min.css rename to app/css/bootstrap.min.css diff --git a/css/evote.css b/app/css/evote.css similarity index 100% rename from css/evote.css rename to app/css/evote.css diff --git a/data/Dialogue.php b/app/data/Dialogue.php similarity index 100% rename from data/Dialogue.php rename to app/data/Dialogue.php diff --git a/data/RandomInfo.php b/app/data/RandomInfo.php similarity index 100% rename from data/RandomInfo.php rename to app/data/RandomInfo.php diff --git a/data/code_instr.txt b/app/data/code_instr.txt similarity index 100% rename from data/code_instr.txt rename to app/data/code_instr.txt diff --git a/data/evote.php b/app/data/evote.php similarity index 100% rename from data/evote.php rename to app/data/evote.php diff --git a/ecrypt.php b/app/ecrypt.php similarity index 100% rename from ecrypt.php rename to app/ecrypt.php diff --git a/evote_ascii.php b/app/evote_ascii.php similarity index 100% rename from evote_ascii.php rename to app/evote_ascii.php diff --git a/favicon.ico b/app/favicon.ico similarity index 100% rename from favicon.ico rename to app/favicon.ico diff --git a/fonts/glyphicons-halflings-regular.eot b/app/fonts/glyphicons-halflings-regular.eot similarity index 100% rename from fonts/glyphicons-halflings-regular.eot rename to app/fonts/glyphicons-halflings-regular.eot diff --git a/fonts/glyphicons-halflings-regular.svg b/app/fonts/glyphicons-halflings-regular.svg similarity index 100% rename from fonts/glyphicons-halflings-regular.svg rename to app/fonts/glyphicons-halflings-regular.svg diff --git a/fonts/glyphicons-halflings-regular.ttf b/app/fonts/glyphicons-halflings-regular.ttf similarity index 100% rename from fonts/glyphicons-halflings-regular.ttf rename to app/fonts/glyphicons-halflings-regular.ttf diff --git a/fonts/glyphicons-halflings-regular.woff b/app/fonts/glyphicons-halflings-regular.woff similarity index 100% rename from fonts/glyphicons-halflings-regular.woff rename to app/fonts/glyphicons-halflings-regular.woff diff --git a/fonts/glyphicons-halflings-regular.woff2 b/app/fonts/glyphicons-halflings-regular.woff2 similarity index 100% rename from fonts/glyphicons-halflings-regular.woff2 rename to app/fonts/glyphicons-halflings-regular.woff2 diff --git a/footer.php b/app/footer.php similarity index 100% rename from footer.php rename to app/footer.php diff --git a/fpdf/FAQ.htm b/app/fpdf/FAQ.htm similarity index 100% rename from fpdf/FAQ.htm rename to app/fpdf/FAQ.htm diff --git a/fpdf/changelog.htm b/app/fpdf/changelog.htm similarity index 100% rename from fpdf/changelog.htm rename to app/fpdf/changelog.htm diff --git a/fpdf/doc/__construct.htm b/app/fpdf/doc/__construct.htm similarity index 100% rename from fpdf/doc/__construct.htm rename to app/fpdf/doc/__construct.htm diff --git a/fpdf/doc/acceptpagebreak.htm b/app/fpdf/doc/acceptpagebreak.htm similarity index 100% rename from fpdf/doc/acceptpagebreak.htm rename to app/fpdf/doc/acceptpagebreak.htm diff --git a/fpdf/doc/addfont.htm b/app/fpdf/doc/addfont.htm similarity index 100% rename from fpdf/doc/addfont.htm rename to app/fpdf/doc/addfont.htm diff --git a/fpdf/doc/addlink.htm b/app/fpdf/doc/addlink.htm similarity index 100% rename from fpdf/doc/addlink.htm rename to app/fpdf/doc/addlink.htm diff --git a/fpdf/doc/addpage.htm b/app/fpdf/doc/addpage.htm similarity index 100% rename from fpdf/doc/addpage.htm rename to app/fpdf/doc/addpage.htm diff --git a/fpdf/doc/aliasnbpages.htm b/app/fpdf/doc/aliasnbpages.htm similarity index 100% rename from fpdf/doc/aliasnbpages.htm rename to app/fpdf/doc/aliasnbpages.htm diff --git a/fpdf/doc/cell.htm b/app/fpdf/doc/cell.htm similarity index 100% rename from fpdf/doc/cell.htm rename to app/fpdf/doc/cell.htm diff --git a/fpdf/doc/close.htm b/app/fpdf/doc/close.htm similarity index 100% rename from fpdf/doc/close.htm rename to app/fpdf/doc/close.htm diff --git a/fpdf/doc/error.htm b/app/fpdf/doc/error.htm similarity index 100% rename from fpdf/doc/error.htm rename to app/fpdf/doc/error.htm diff --git a/fpdf/doc/footer.htm b/app/fpdf/doc/footer.htm similarity index 100% rename from fpdf/doc/footer.htm rename to app/fpdf/doc/footer.htm diff --git a/fpdf/doc/getpageheight.htm b/app/fpdf/doc/getpageheight.htm similarity index 100% rename from fpdf/doc/getpageheight.htm rename to app/fpdf/doc/getpageheight.htm diff --git a/fpdf/doc/getpagewidth.htm b/app/fpdf/doc/getpagewidth.htm similarity index 100% rename from fpdf/doc/getpagewidth.htm rename to app/fpdf/doc/getpagewidth.htm diff --git a/fpdf/doc/getstringwidth.htm b/app/fpdf/doc/getstringwidth.htm similarity index 100% rename from fpdf/doc/getstringwidth.htm rename to app/fpdf/doc/getstringwidth.htm diff --git a/fpdf/doc/getx.htm b/app/fpdf/doc/getx.htm similarity index 100% rename from fpdf/doc/getx.htm rename to app/fpdf/doc/getx.htm diff --git a/fpdf/doc/gety.htm b/app/fpdf/doc/gety.htm similarity index 100% rename from fpdf/doc/gety.htm rename to app/fpdf/doc/gety.htm diff --git a/fpdf/doc/header.htm b/app/fpdf/doc/header.htm similarity index 100% rename from fpdf/doc/header.htm rename to app/fpdf/doc/header.htm diff --git a/fpdf/doc/image.htm b/app/fpdf/doc/image.htm similarity index 100% rename from fpdf/doc/image.htm rename to app/fpdf/doc/image.htm diff --git a/fpdf/doc/index.htm b/app/fpdf/doc/index.htm similarity index 100% rename from fpdf/doc/index.htm rename to app/fpdf/doc/index.htm diff --git a/fpdf/doc/line.htm b/app/fpdf/doc/line.htm similarity index 100% rename from fpdf/doc/line.htm rename to app/fpdf/doc/line.htm diff --git a/fpdf/doc/link.htm b/app/fpdf/doc/link.htm similarity index 100% rename from fpdf/doc/link.htm rename to app/fpdf/doc/link.htm diff --git a/fpdf/doc/ln.htm b/app/fpdf/doc/ln.htm similarity index 100% rename from fpdf/doc/ln.htm rename to app/fpdf/doc/ln.htm diff --git a/fpdf/doc/multicell.htm b/app/fpdf/doc/multicell.htm similarity index 100% rename from fpdf/doc/multicell.htm rename to app/fpdf/doc/multicell.htm diff --git a/fpdf/doc/output.htm b/app/fpdf/doc/output.htm similarity index 100% rename from fpdf/doc/output.htm rename to app/fpdf/doc/output.htm diff --git a/fpdf/doc/pageno.htm b/app/fpdf/doc/pageno.htm similarity index 100% rename from fpdf/doc/pageno.htm rename to app/fpdf/doc/pageno.htm diff --git a/fpdf/doc/rect.htm b/app/fpdf/doc/rect.htm similarity index 100% rename from fpdf/doc/rect.htm rename to app/fpdf/doc/rect.htm diff --git a/fpdf/doc/setauthor.htm b/app/fpdf/doc/setauthor.htm similarity index 100% rename from fpdf/doc/setauthor.htm rename to app/fpdf/doc/setauthor.htm diff --git a/fpdf/doc/setautopagebreak.htm b/app/fpdf/doc/setautopagebreak.htm similarity index 100% rename from fpdf/doc/setautopagebreak.htm rename to app/fpdf/doc/setautopagebreak.htm diff --git a/fpdf/doc/setcompression.htm b/app/fpdf/doc/setcompression.htm similarity index 100% rename from fpdf/doc/setcompression.htm rename to app/fpdf/doc/setcompression.htm diff --git a/fpdf/doc/setcreator.htm b/app/fpdf/doc/setcreator.htm similarity index 100% rename from fpdf/doc/setcreator.htm rename to app/fpdf/doc/setcreator.htm diff --git a/fpdf/doc/setdisplaymode.htm b/app/fpdf/doc/setdisplaymode.htm similarity index 100% rename from fpdf/doc/setdisplaymode.htm rename to app/fpdf/doc/setdisplaymode.htm diff --git a/fpdf/doc/setdrawcolor.htm b/app/fpdf/doc/setdrawcolor.htm similarity index 100% rename from fpdf/doc/setdrawcolor.htm rename to app/fpdf/doc/setdrawcolor.htm diff --git a/fpdf/doc/setfillcolor.htm b/app/fpdf/doc/setfillcolor.htm similarity index 100% rename from fpdf/doc/setfillcolor.htm rename to app/fpdf/doc/setfillcolor.htm diff --git a/fpdf/doc/setfont.htm b/app/fpdf/doc/setfont.htm similarity index 100% rename from fpdf/doc/setfont.htm rename to app/fpdf/doc/setfont.htm diff --git a/fpdf/doc/setfontsize.htm b/app/fpdf/doc/setfontsize.htm similarity index 100% rename from fpdf/doc/setfontsize.htm rename to app/fpdf/doc/setfontsize.htm diff --git a/fpdf/doc/setkeywords.htm b/app/fpdf/doc/setkeywords.htm similarity index 100% rename from fpdf/doc/setkeywords.htm rename to app/fpdf/doc/setkeywords.htm diff --git a/fpdf/doc/setleftmargin.htm b/app/fpdf/doc/setleftmargin.htm similarity index 100% rename from fpdf/doc/setleftmargin.htm rename to app/fpdf/doc/setleftmargin.htm diff --git a/fpdf/doc/setlinewidth.htm b/app/fpdf/doc/setlinewidth.htm similarity index 100% rename from fpdf/doc/setlinewidth.htm rename to app/fpdf/doc/setlinewidth.htm diff --git a/fpdf/doc/setlink.htm b/app/fpdf/doc/setlink.htm similarity index 100% rename from fpdf/doc/setlink.htm rename to app/fpdf/doc/setlink.htm diff --git a/fpdf/doc/setmargins.htm b/app/fpdf/doc/setmargins.htm similarity index 100% rename from fpdf/doc/setmargins.htm rename to app/fpdf/doc/setmargins.htm diff --git a/fpdf/doc/setrightmargin.htm b/app/fpdf/doc/setrightmargin.htm similarity index 100% rename from fpdf/doc/setrightmargin.htm rename to app/fpdf/doc/setrightmargin.htm diff --git a/fpdf/doc/setsubject.htm b/app/fpdf/doc/setsubject.htm similarity index 100% rename from fpdf/doc/setsubject.htm rename to app/fpdf/doc/setsubject.htm diff --git a/fpdf/doc/settextcolor.htm b/app/fpdf/doc/settextcolor.htm similarity index 100% rename from fpdf/doc/settextcolor.htm rename to app/fpdf/doc/settextcolor.htm diff --git a/fpdf/doc/settitle.htm b/app/fpdf/doc/settitle.htm similarity index 100% rename from fpdf/doc/settitle.htm rename to app/fpdf/doc/settitle.htm diff --git a/fpdf/doc/settopmargin.htm b/app/fpdf/doc/settopmargin.htm similarity index 100% rename from fpdf/doc/settopmargin.htm rename to app/fpdf/doc/settopmargin.htm diff --git a/fpdf/doc/setx.htm b/app/fpdf/doc/setx.htm similarity index 100% rename from fpdf/doc/setx.htm rename to app/fpdf/doc/setx.htm diff --git a/fpdf/doc/setxy.htm b/app/fpdf/doc/setxy.htm similarity index 100% rename from fpdf/doc/setxy.htm rename to app/fpdf/doc/setxy.htm diff --git a/fpdf/doc/sety.htm b/app/fpdf/doc/sety.htm similarity index 100% rename from fpdf/doc/sety.htm rename to app/fpdf/doc/sety.htm diff --git a/fpdf/doc/text.htm b/app/fpdf/doc/text.htm similarity index 100% rename from fpdf/doc/text.htm rename to app/fpdf/doc/text.htm diff --git a/fpdf/doc/write.htm b/app/fpdf/doc/write.htm similarity index 100% rename from fpdf/doc/write.htm rename to app/fpdf/doc/write.htm diff --git a/fpdf/font/courier.php b/app/fpdf/font/courier.php similarity index 100% rename from fpdf/font/courier.php rename to app/fpdf/font/courier.php diff --git a/fpdf/font/courierb.php b/app/fpdf/font/courierb.php similarity index 100% rename from fpdf/font/courierb.php rename to app/fpdf/font/courierb.php diff --git a/fpdf/font/courierbi.php b/app/fpdf/font/courierbi.php similarity index 100% rename from fpdf/font/courierbi.php rename to app/fpdf/font/courierbi.php diff --git a/fpdf/font/courieri.php b/app/fpdf/font/courieri.php similarity index 100% rename from fpdf/font/courieri.php rename to app/fpdf/font/courieri.php diff --git a/fpdf/font/helvetica.php b/app/fpdf/font/helvetica.php similarity index 100% rename from fpdf/font/helvetica.php rename to app/fpdf/font/helvetica.php diff --git a/fpdf/font/helveticab.php b/app/fpdf/font/helveticab.php similarity index 100% rename from fpdf/font/helveticab.php rename to app/fpdf/font/helveticab.php diff --git a/fpdf/font/helveticabi.php b/app/fpdf/font/helveticabi.php similarity index 100% rename from fpdf/font/helveticabi.php rename to app/fpdf/font/helveticabi.php diff --git a/fpdf/font/helveticai.php b/app/fpdf/font/helveticai.php similarity index 100% rename from fpdf/font/helveticai.php rename to app/fpdf/font/helveticai.php diff --git a/fpdf/font/symbol.php b/app/fpdf/font/symbol.php similarity index 100% rename from fpdf/font/symbol.php rename to app/fpdf/font/symbol.php diff --git a/fpdf/font/times.php b/app/fpdf/font/times.php similarity index 100% rename from fpdf/font/times.php rename to app/fpdf/font/times.php diff --git a/fpdf/font/timesb.php b/app/fpdf/font/timesb.php similarity index 100% rename from fpdf/font/timesb.php rename to app/fpdf/font/timesb.php diff --git a/fpdf/font/timesbi.php b/app/fpdf/font/timesbi.php similarity index 100% rename from fpdf/font/timesbi.php rename to app/fpdf/font/timesbi.php diff --git a/fpdf/font/timesi.php b/app/fpdf/font/timesi.php similarity index 100% rename from fpdf/font/timesi.php rename to app/fpdf/font/timesi.php diff --git a/fpdf/font/zapfdingbats.php b/app/fpdf/font/zapfdingbats.php similarity index 100% rename from fpdf/font/zapfdingbats.php rename to app/fpdf/font/zapfdingbats.php diff --git a/fpdf/fpdf.css b/app/fpdf/fpdf.css similarity index 100% rename from fpdf/fpdf.css rename to app/fpdf/fpdf.css diff --git a/fpdf/fpdf.php b/app/fpdf/fpdf.php similarity index 100% rename from fpdf/fpdf.php rename to app/fpdf/fpdf.php diff --git a/fpdf/install.txt b/app/fpdf/install.txt similarity index 100% rename from fpdf/install.txt rename to app/fpdf/install.txt diff --git a/fpdf/license.txt b/app/fpdf/license.txt similarity index 100% rename from fpdf/license.txt rename to app/fpdf/license.txt diff --git a/fpdf/makefont/cp1250.map b/app/fpdf/makefont/cp1250.map similarity index 100% rename from fpdf/makefont/cp1250.map rename to app/fpdf/makefont/cp1250.map diff --git a/fpdf/makefont/cp1251.map b/app/fpdf/makefont/cp1251.map similarity index 100% rename from fpdf/makefont/cp1251.map rename to app/fpdf/makefont/cp1251.map diff --git a/fpdf/makefont/cp1252.map b/app/fpdf/makefont/cp1252.map similarity index 100% rename from fpdf/makefont/cp1252.map rename to app/fpdf/makefont/cp1252.map diff --git a/fpdf/makefont/cp1253.map b/app/fpdf/makefont/cp1253.map similarity index 100% rename from fpdf/makefont/cp1253.map rename to app/fpdf/makefont/cp1253.map diff --git a/fpdf/makefont/cp1254.map b/app/fpdf/makefont/cp1254.map similarity index 100% rename from fpdf/makefont/cp1254.map rename to app/fpdf/makefont/cp1254.map diff --git a/fpdf/makefont/cp1255.map b/app/fpdf/makefont/cp1255.map similarity index 100% rename from fpdf/makefont/cp1255.map rename to app/fpdf/makefont/cp1255.map diff --git a/fpdf/makefont/cp1257.map b/app/fpdf/makefont/cp1257.map similarity index 100% rename from fpdf/makefont/cp1257.map rename to app/fpdf/makefont/cp1257.map diff --git a/fpdf/makefont/cp1258.map b/app/fpdf/makefont/cp1258.map similarity index 100% rename from fpdf/makefont/cp1258.map rename to app/fpdf/makefont/cp1258.map diff --git a/fpdf/makefont/cp874.map b/app/fpdf/makefont/cp874.map similarity index 100% rename from fpdf/makefont/cp874.map rename to app/fpdf/makefont/cp874.map diff --git a/fpdf/makefont/iso-8859-1.map b/app/fpdf/makefont/iso-8859-1.map similarity index 100% rename from fpdf/makefont/iso-8859-1.map rename to app/fpdf/makefont/iso-8859-1.map diff --git a/fpdf/makefont/iso-8859-11.map b/app/fpdf/makefont/iso-8859-11.map similarity index 100% rename from fpdf/makefont/iso-8859-11.map rename to app/fpdf/makefont/iso-8859-11.map diff --git a/fpdf/makefont/iso-8859-15.map b/app/fpdf/makefont/iso-8859-15.map similarity index 100% rename from fpdf/makefont/iso-8859-15.map rename to app/fpdf/makefont/iso-8859-15.map diff --git a/fpdf/makefont/iso-8859-16.map b/app/fpdf/makefont/iso-8859-16.map similarity index 100% rename from fpdf/makefont/iso-8859-16.map rename to app/fpdf/makefont/iso-8859-16.map diff --git a/fpdf/makefont/iso-8859-2.map b/app/fpdf/makefont/iso-8859-2.map similarity index 100% rename from fpdf/makefont/iso-8859-2.map rename to app/fpdf/makefont/iso-8859-2.map diff --git a/fpdf/makefont/iso-8859-4.map b/app/fpdf/makefont/iso-8859-4.map similarity index 100% rename from fpdf/makefont/iso-8859-4.map rename to app/fpdf/makefont/iso-8859-4.map diff --git a/fpdf/makefont/iso-8859-5.map b/app/fpdf/makefont/iso-8859-5.map similarity index 100% rename from fpdf/makefont/iso-8859-5.map rename to app/fpdf/makefont/iso-8859-5.map diff --git a/fpdf/makefont/iso-8859-7.map b/app/fpdf/makefont/iso-8859-7.map similarity index 100% rename from fpdf/makefont/iso-8859-7.map rename to app/fpdf/makefont/iso-8859-7.map diff --git a/fpdf/makefont/iso-8859-9.map b/app/fpdf/makefont/iso-8859-9.map similarity index 100% rename from fpdf/makefont/iso-8859-9.map rename to app/fpdf/makefont/iso-8859-9.map diff --git a/fpdf/makefont/koi8-r.map b/app/fpdf/makefont/koi8-r.map similarity index 100% rename from fpdf/makefont/koi8-r.map rename to app/fpdf/makefont/koi8-r.map diff --git a/fpdf/makefont/koi8-u.map b/app/fpdf/makefont/koi8-u.map similarity index 100% rename from fpdf/makefont/koi8-u.map rename to app/fpdf/makefont/koi8-u.map diff --git a/fpdf/makefont/makefont.php b/app/fpdf/makefont/makefont.php similarity index 100% rename from fpdf/makefont/makefont.php rename to app/fpdf/makefont/makefont.php diff --git a/fpdf/makefont/ttfparser.php b/app/fpdf/makefont/ttfparser.php similarity index 100% rename from fpdf/makefont/ttfparser.php rename to app/fpdf/makefont/ttfparser.php diff --git a/fpdf/tutorial/20k_c1.txt b/app/fpdf/tutorial/20k_c1.txt similarity index 100% rename from fpdf/tutorial/20k_c1.txt rename to app/fpdf/tutorial/20k_c1.txt diff --git a/fpdf/tutorial/20k_c2.txt b/app/fpdf/tutorial/20k_c2.txt similarity index 100% rename from fpdf/tutorial/20k_c2.txt rename to app/fpdf/tutorial/20k_c2.txt diff --git a/fpdf/tutorial/calligra.php b/app/fpdf/tutorial/calligra.php similarity index 100% rename from fpdf/tutorial/calligra.php rename to app/fpdf/tutorial/calligra.php diff --git a/fpdf/tutorial/calligra.ttf b/app/fpdf/tutorial/calligra.ttf similarity index 100% rename from fpdf/tutorial/calligra.ttf rename to app/fpdf/tutorial/calligra.ttf diff --git a/fpdf/tutorial/calligra.z b/app/fpdf/tutorial/calligra.z similarity index 100% rename from fpdf/tutorial/calligra.z rename to app/fpdf/tutorial/calligra.z diff --git a/fpdf/tutorial/countries.txt b/app/fpdf/tutorial/countries.txt similarity index 100% rename from fpdf/tutorial/countries.txt rename to app/fpdf/tutorial/countries.txt diff --git a/fpdf/tutorial/index.htm b/app/fpdf/tutorial/index.htm similarity index 100% rename from fpdf/tutorial/index.htm rename to app/fpdf/tutorial/index.htm diff --git a/fpdf/tutorial/logo.png b/app/fpdf/tutorial/logo.png similarity index 100% rename from fpdf/tutorial/logo.png rename to app/fpdf/tutorial/logo.png diff --git a/fpdf/tutorial/makefont.php b/app/fpdf/tutorial/makefont.php similarity index 100% rename from fpdf/tutorial/makefont.php rename to app/fpdf/tutorial/makefont.php diff --git a/fpdf/tutorial/tuto1.htm b/app/fpdf/tutorial/tuto1.htm similarity index 100% rename from fpdf/tutorial/tuto1.htm rename to app/fpdf/tutorial/tuto1.htm diff --git a/fpdf/tutorial/tuto1.php b/app/fpdf/tutorial/tuto1.php similarity index 100% rename from fpdf/tutorial/tuto1.php rename to app/fpdf/tutorial/tuto1.php diff --git a/fpdf/tutorial/tuto2.htm b/app/fpdf/tutorial/tuto2.htm similarity index 100% rename from fpdf/tutorial/tuto2.htm rename to app/fpdf/tutorial/tuto2.htm diff --git a/fpdf/tutorial/tuto2.php b/app/fpdf/tutorial/tuto2.php similarity index 100% rename from fpdf/tutorial/tuto2.php rename to app/fpdf/tutorial/tuto2.php diff --git a/fpdf/tutorial/tuto3.htm b/app/fpdf/tutorial/tuto3.htm similarity index 100% rename from fpdf/tutorial/tuto3.htm rename to app/fpdf/tutorial/tuto3.htm diff --git a/fpdf/tutorial/tuto3.php b/app/fpdf/tutorial/tuto3.php similarity index 100% rename from fpdf/tutorial/tuto3.php rename to app/fpdf/tutorial/tuto3.php diff --git a/fpdf/tutorial/tuto4.htm b/app/fpdf/tutorial/tuto4.htm similarity index 100% rename from fpdf/tutorial/tuto4.htm rename to app/fpdf/tutorial/tuto4.htm diff --git a/fpdf/tutorial/tuto4.php b/app/fpdf/tutorial/tuto4.php similarity index 100% rename from fpdf/tutorial/tuto4.php rename to app/fpdf/tutorial/tuto4.php diff --git a/fpdf/tutorial/tuto5.htm b/app/fpdf/tutorial/tuto5.htm similarity index 100% rename from fpdf/tutorial/tuto5.htm rename to app/fpdf/tutorial/tuto5.htm diff --git a/fpdf/tutorial/tuto5.php b/app/fpdf/tutorial/tuto5.php similarity index 100% rename from fpdf/tutorial/tuto5.php rename to app/fpdf/tutorial/tuto5.php diff --git a/fpdf/tutorial/tuto6.htm b/app/fpdf/tutorial/tuto6.htm similarity index 100% rename from fpdf/tutorial/tuto6.htm rename to app/fpdf/tutorial/tuto6.htm diff --git a/fpdf/tutorial/tuto6.php b/app/fpdf/tutorial/tuto6.php similarity index 100% rename from fpdf/tutorial/tuto6.php rename to app/fpdf/tutorial/tuto6.php diff --git a/fpdf/tutorial/tuto7.htm b/app/fpdf/tutorial/tuto7.htm similarity index 100% rename from fpdf/tutorial/tuto7.htm rename to app/fpdf/tutorial/tuto7.htm diff --git a/fpdf/tutorial/tuto7.php b/app/fpdf/tutorial/tuto7.php similarity index 100% rename from fpdf/tutorial/tuto7.php rename to app/fpdf/tutorial/tuto7.php diff --git a/index.php b/app/index.php similarity index 100% rename from index.php rename to app/index.php diff --git a/index/adjust/adjustpanel.php b/app/index/adjust/adjustpanel.php similarity index 100% rename from index/adjust/adjustpanel.php rename to app/index/adjust/adjustpanel.php diff --git a/index/adjust/stat.php b/app/index/adjust/stat.php similarity index 100% rename from index/adjust/stat.php rename to app/index/adjust/stat.php diff --git a/index/admin/electionControl.php b/app/index/admin/electionControl.php similarity index 100% rename from index/admin/electionControl.php rename to app/index/admin/electionControl.php diff --git a/index/admin/electionsinfo.php b/app/index/admin/electionsinfo.php similarity index 100% rename from index/admin/electionsinfo.php rename to app/index/admin/electionsinfo.php diff --git a/index/classes/MenuGenerator.php b/app/index/classes/MenuGenerator.php similarity index 100% rename from index/classes/MenuGenerator.php rename to app/index/classes/MenuGenerator.php diff --git a/index/classes/TableGenerator.php b/app/index/classes/TableGenerator.php similarity index 100% rename from index/classes/TableGenerator.php rename to app/index/classes/TableGenerator.php diff --git a/index/clear.php b/app/index/clear.php similarity index 100% rename from index/clear.php rename to app/index/clear.php diff --git a/index/electionadmin/electionadminpanel.php b/app/index/electionadmin/electionadminpanel.php similarity index 100% rename from index/electionadmin/electionadminpanel.php rename to app/index/electionadmin/electionadminpanel.php diff --git a/index/session/login.php b/app/index/session/login.php similarity index 100% rename from index/session/login.php rename to app/index/session/login.php diff --git a/index/session/logout.php b/app/index/session/logout.php similarity index 100% rename from index/session/logout.php rename to app/index/session/logout.php diff --git a/index/useradmin/changepassword.php b/app/index/useradmin/changepassword.php similarity index 100% rename from index/useradmin/changepassword.php rename to app/index/useradmin/changepassword.php diff --git a/index/useradmin/newuser.php b/app/index/useradmin/newuser.php similarity index 100% rename from index/useradmin/newuser.php rename to app/index/useradmin/newuser.php diff --git a/index/useradmin/useradminpanel.php b/app/index/useradmin/useradminpanel.php similarity index 100% rename from index/useradmin/useradminpanel.php rename to app/index/useradmin/useradminpanel.php diff --git a/index/vote/front.php b/app/index/vote/front.php similarity index 100% rename from index/vote/front.php rename to app/index/vote/front.php diff --git a/install/evote.sql b/app/install/evote.sql similarity index 100% rename from install/evote.sql rename to app/install/evote.sql diff --git a/install/setup.php b/app/install/setup.php similarity index 100% rename from install/setup.php rename to app/install/setup.php diff --git a/js/bootstrap.js b/app/js/bootstrap.js similarity index 100% rename from js/bootstrap.js rename to app/js/bootstrap.js diff --git a/js/bootstrap.min.js b/app/js/bootstrap.min.js similarity index 100% rename from js/bootstrap.min.js rename to app/js/bootstrap.min.js diff --git a/js/checkForNewRound.js b/app/js/checkForNewRound.js similarity index 100% rename from js/checkForNewRound.js rename to app/js/checkForNewRound.js diff --git a/js/checkIfRoundClosed.js b/app/js/checkIfRoundClosed.js similarity index 100% rename from js/checkIfRoundClosed.js rename to app/js/checkIfRoundClosed.js diff --git a/js/countdown.js b/app/js/countdown.js similarity index 100% rename from js/countdown.js rename to app/js/countdown.js diff --git a/js/npm.js b/app/js/npm.js similarity index 100% rename from js/npm.js rename to app/js/npm.js diff --git a/localization/getLocalizedText.php b/app/localization/getLocalizedText.php similarity index 100% rename from localization/getLocalizedText.php rename to app/localization/getLocalizedText.php diff --git a/localization/localizedTextLookupTable.php b/app/localization/localizedTextLookupTable.php similarity index 100% rename from localization/localizedTextLookupTable.php rename to app/localization/localizedTextLookupTable.php diff --git a/logo.jpg b/app/logo.jpg similarity index 100% rename from logo.jpg rename to app/logo.jpg diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..6690d17 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,34 @@ +version: '3' +services: + web: + build: + context: . + dockerfile: dockerfiles/NGINX.dockerfile + ports: + - "${NGINX_PORT}:80" + volumes: + - webfiles:/app + depends_on: + - php + - mysql + php: + build: + context: . + dockerfile: dockerfiles/PHP.dockerfile + volumes: + - webfiles:/app + mysql: + build: + context: . + dockerfile: dockerfiles/MYSQL.dockerfile + environment: + MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWD} + MYSQL_USER: ${DB_USER} + MYSQL_PASSWORD: ${DB_USER_PASSWD} + MYSQL_DATABASE: ${DB_NAME} + volumes: + - evote-mysqldata:/var/lib/mysql + +volumes: + webfiles: + evote-mysqldata: \ No newline at end of file diff --git a/dockerfiles/MYSQL.dockerfile b/dockerfiles/MYSQL.dockerfile new file mode 100644 index 0000000..9f980d3 --- /dev/null +++ b/dockerfiles/MYSQL.dockerfile @@ -0,0 +1,3 @@ +FROM mariadb:latest + +ADD app/install/evote.sql /docker-entrypoint-initdb.d/evote.sql \ No newline at end of file diff --git a/dockerfiles/NGINX.dockerfile b/dockerfiles/NGINX.dockerfile new file mode 100644 index 0000000..0601162 --- /dev/null +++ b/dockerfiles/NGINX.dockerfile @@ -0,0 +1,6 @@ +FROM nginx:latest +COPY nginxconf/nginx.conf /etc/nginx/conf.d/nginx.conf +COPY nginxconf/php.conf /etc/nginx/php.conf +COPY nginxconf/fastcgi_params /etc/nginx/fastcgi_params +COPY ./app/ /app/ +RUN chown -R www-data:www-data /app diff --git a/dockerfiles/PHP.dockerfile b/dockerfiles/PHP.dockerfile new file mode 100644 index 0000000..ca9b8b2 --- /dev/null +++ b/dockerfiles/PHP.dockerfile @@ -0,0 +1,3 @@ +FROM php:7.4.33-fpm + +RUN docker-php-ext-install pdo pdo_mysql mysqli \ No newline at end of file diff --git a/nginxconf/fastcgi_params b/nginxconf/fastcgi_params new file mode 100644 index 0000000..4b9008f --- /dev/null +++ b/nginxconf/fastcgi_params @@ -0,0 +1,25 @@ +fastcgi_param QUERY_STRING $query_string; +fastcgi_param REQUEST_METHOD $request_method; +fastcgi_param CONTENT_TYPE $content_type; +fastcgi_param CONTENT_LENGTH $content_length; + +fastcgi_param SCRIPT_NAME $fastcgi_script_name; +fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; +fastcgi_param PATH_INFO $fastcgi_path_info; +fastcgi_param REQUEST_URI $request_uri; +fastcgi_param DOCUMENT_URI $document_uri; +fastcgi_param DOCUMENT_ROOT $document_root; +fastcgi_param SERVER_PROTOCOL $server_protocol; +fastcgi_param HTTPS $https if_not_empty; + +fastcgi_param GATEWAY_INTERFACE CGI/1.1; +fastcgi_param SERVER_SOFTWARE nginx/$nginx_version; + +fastcgi_param REMOTE_ADDR $remote_addr; +fastcgi_param REMOTE_PORT $remote_port; +fastcgi_param SERVER_ADDR $server_addr; +fastcgi_param SERVER_PORT $server_port; +fastcgi_param SERVER_NAME $server_name; + +# PHP only, required if PHP was built with --enable-force-cgi-redirect +fastcgi_param REDIRECT_STATUS 200; \ No newline at end of file diff --git a/nginxconf/nginx.conf b/nginxconf/nginx.conf new file mode 100644 index 0000000..60f9c9d --- /dev/null +++ b/nginxconf/nginx.conf @@ -0,0 +1,23 @@ +server { + listen 80 default_server; +# server_name evote.; +# access_log //access.log; +# error_log //error.log; + root /app; + index index.html index.php; + + location ~ \.php$ { + include php.conf; + } + + + location / { + try_files $uri @evote; + } + + # Always rewrite to index.php + location @evote { + rewrite ^(.*)$ /index.php$1 break; + include php.conf; + } +} diff --git a/nginxconf/php.conf b/nginxconf/php.conf new file mode 100644 index 0000000..38a1a2a --- /dev/null +++ b/nginxconf/php.conf @@ -0,0 +1,4 @@ +fastcgi_split_path_info ^(.+\.php)(/.+)$; +fastcgi_pass php:9000; +fastcgi_index index.php; +include fastcgi_params; \ No newline at end of file