8 Commits
Author SHA1 Message Date
Casually9790 795ad8f699 Changed regex to basic email regex 2021-02-13 17:49:50 +01:00
catoandGitHub 470c722fca Update README.md 2021-02-13 17:49:20 +01:00
Casually9790 55be1d7b84 Privacy changes 2021-02-13 17:37:04 +01:00
catoandGitHub 1e40243d42 Update README.md 2021-02-13 17:34:13 +01:00
catoandGitHub 161959f798 Update README.md 2021-01-27 19:22:18 +01:00
Casually9790 cc8230fcee Merge branch 'testing' into main 2021-01-27 18:28:47 +01:00
catoandGitHub c890b66693 Update README.md 2021-01-27 18:26:05 +01:00
catoandGitHub c6e1a963be Update README.md 2021-01-27 18:21:29 +01:00
4 changed files with 36 additions and 14 deletions
+4
View File
@@ -37,3 +37,7 @@ build/
### Logging ### ### Logging ###
*.log *.log
### DataPrivacy ###
Databases
logs
+29 -3
View File
@@ -1,4 +1,30 @@
# AbizeitungVotingSystem # AbizeitungVotingSystem
Internet address: http://adolfinum-voting.tools/ <br> This project is a custom web server constructed to simplify the voting process for our senior book <br>
Server IP address: 192.168.2.159 <br> All private data got removed <br>
Port: 8000 <br> You are free to use this web server <br>
Be aware that this webserver isn't really securly build. To avoid complications use a DNS mask
# Requierments
MySql
# Installation
Clone the repo <br>
Run `cd AbizeitungVotingSystem` <br>
Add your mysql database credentials and email credentials to the application.properties file <br>
Run `mvn install -DskipTests`<br>
The .jar is located in the target folder<br>
Run the .jar as a deamon on your machine <br>
Webserver is reachable at host_ip:8000 <br>
(Check if your firewall allows traffic over port 8000 if website is not reachable)
# Usage
Add your email whitelist to the file `AbizeitungVotingSystem/src/main/resources/Email_Whitelist.txt` <br>
Add your Categories to the file `AbizeitungVotingSystem/src/main/resources/Categories.txt` <br>
Adjust the regex in `VotingController.java` and `start.html` to suit your needs <br>
<br>
To alternate between adding and voting mode with the two coresponding booleans in the `VotingController.java` file
# Contribution
Feel free to fork the repo and submit a pull-request. I will review and add it happily :)
@@ -76,16 +76,7 @@ public class VotingController {
@RequestMapping("/") @RequestMapping("/")
public String WelcomeSite() { public String WelcomeSite() {
LocalDate finishDate = LocalDate.of(2021, Month.JANUARY,24);
LocalDate now = LocalDate.now();
if(now.isAfter(finishDate)){
LOGGER.warn("passed");
return "errors/votingClosed.html";
} else {
LOGGER.warn("in Bounds");
return "start.html"; return "start.html";
}
} }
public void sendSimpleMessage(String to, String subject, String text) { public void sendSimpleMessage(String to, String subject, String text) {
@@ -98,7 +89,8 @@ public class VotingController {
@RequestMapping("/checkStatus") @RequestMapping("/checkStatus")
public String VerifyName(@RequestParam String name, Model model) { public String VerifyName(@RequestParam String name, Model model) {
if (name.strip().toLowerCase().matches("[a-z]+\\.[a-z]+@adolfinum+\\.de$")) { //Basic email regex
if (name.strip().toLowerCase().matches("[^@ \t\r\n]+@[^@ \t\r\n]+\.[^@ \t\r\n]+")) {
try { try {
LOGGER.warn(name); LOGGER.warn(name);
Voter voter = voterRepository.findByEmail(name.toLowerCase().strip()); Voter voter = voterRepository.findByEmail(name.toLowerCase().strip());
+1 -1
View File
@@ -18,7 +18,7 @@
function test() { function test() {
let input_field = document.getElementById("email_input"); let input_field = document.getElementById("email_input");
let input = input_field.value; let input = input_field.value;
if (!input.trim().match("[a-z]+\\.[a-z]+@adolfinum+\\.de$")) { if (!input.trim().match("[^@ \t\r\n]+@[^@ \t\r\n]+\.[^@ \t\r\n]+")) {
input_field.value = ""; input_field.value = "";
alert("Die Email-Adresse \"" + input + "\" entspricht nicht den Vorgaben"); alert("Die Email-Adresse \"" + input + "\" entspricht nicht den Vorgaben");
} }