Queue
A queueing system to be used at labs at EWI (tudelft.nl).
Requirements
- Java 8+
Project setup
In order to have the project setup properly for development a few steps need to be taken.
- First the config file should be moved from the template into the actual properties file
by executing
cp src/main/resources/application.yaml.template src/main/resources/application.yaml
from the root directory of the project. - Follow these instructions to submit your work
Run website from IDE
- Install IntelliJ IDEA Professional (free for students)
- Import project from Gradle model
- For IntelliJ to run the project make sure are running jdk 8.
- Start the project by right-clicking
QueueApplication
and clicking 'Run' - Visit http://localhost:8081/
- Finally visit http://localhost:8081/login to login.
Various test users credentials can be found in the
DataBaseLoader
class.
Run website from CLI
gradle build
sudo java -jar build/libs/queue-0.0.1-SNAPSHOT.jar
- Visit http://localhost:8081/
- Finally visit http://localhost:8081/login to login.
Various test users credentials can be found in the
DataBaseLoader
class.
Deployment
The deploy/
directory contains an Ansible playbook that can be used to provision the machine. Specifically, it contains:
- an nginx site config (
default
) with an upstream for tomcat on port 8080 together with config for a letsencrypt generated SSL certificate. - a SystemD configuration (
queue.service
) that runs the jar at/var/www/queue/queue-0.0.1-SNAPSHOT.jar
as root on startup and logs to/var/log/queue.log
. - an ansible config that installs Oracle java 8, nginx, postgres, haveged, the SystemD job, the jar, and starts the services.
- an
application.yaml
file with application-specific configuration, such as the database settings.
To run the playbook, first replace the hostname and your SSH key in deploy/hosts
, then run ./deploy/run.sh
.
Note that the current application.yaml
contains spring.jpa.hibernate.ddl-auto=create
which will drop and create the database upon reboot!
Configuration
See application.yaml
. Chrome does not yet fully support the Web Push API and uses GCM to handle sending and delivery of push messages. To use the GCM API you need a GCM API key. This page explains how to obtain one.
You can place an application.yaml
on the classpath which overrides the application.yaml
in the jar itself.
Nowadays, Chrome supports VAPID (Voluntary Application Identification) for Web Push API and it is no longer necessary to obtain an API key. The Web Push library should be updated to the latest version that I'm maintaining at https://github.com/MartijnDwars/web-push. For VAPID, we need to generate yet another keypair..