Compare commits
8
Commits
testing
...
795ad8f699
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
795ad8f699 | ||
|
|
470c722fca | ||
|
|
55be1d7b84 | ||
|
|
1e40243d42 | ||
|
|
161959f798 | ||
|
|
cc8230fcee | ||
|
|
c890b66693 | ||
|
|
c6e1a963be |
@@ -37,3 +37,7 @@ build/
|
|||||||
|
|
||||||
### Logging ###
|
### Logging ###
|
||||||
*.log
|
*.log
|
||||||
|
|
||||||
|
### DataPrivacy ###
|
||||||
|
Databases
|
||||||
|
logs
|
||||||
|
|||||||
@@ -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 :)
|
||||||
|
|||||||
+2
-10
@@ -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());
|
||||||
|
|||||||
@@ -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");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user