From 5b8851b6c268d0e93c158908fbfae9f8473db5ff Mon Sep 17 00:00:00 2001 From: Orangerot Date: Wed, 19 Jun 2024 00:14:49 +0200 Subject: Initial commit --- pse-server/README.md | 150 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 150 insertions(+) create mode 100644 pse-server/README.md (limited to 'pse-server/README.md') diff --git a/pse-server/README.md b/pse-server/README.md new file mode 100644 index 0000000..0c7b04b --- /dev/null +++ b/pse-server/README.md @@ -0,0 +1,150 @@ +# Podcast Synchronisation made Efficient Server +> Gpodder Server written in Java Spring Boot + +## About + +The aim of this software project is to provide a synchronization server for +podcasts that is to be used by so-called podcatchers and that is as lean and +efficient as possible compared to other synchronizations Server. + +## Getting Started + +## Pre requirements + +- MariaDB-Server 10.6 +- Java JDK 17 + +### MariaDB + +Start the MariaDB Server and login as root to manage the databases. +```sh +$ sudo systemctl start mariadb # start mariadb +$ sudo mariadb --password # log in as root +``` + +Create Database and User. +```sql +create database demo; -- Creates the new database +create user 'pse'@'localhost' identified by 'PSEsq1702!mdb'; -- Creates the user +grant all on demo.* to 'pse'@'localhost'; -- Gives all privileges to the new user on the newly created database +``` + +### Spring Boot + +Compile and run the Spring Boot Project +```sh +$ mvn spring-boot:run +``` + +Compile to JAR for production +```sh +$ mvn package -B -DskipTests +``` + +Execute jar +``` +$ java -jar target/server.jar +``` + +### Configuration + +You can configuration by editing the files under `src/main/resources/`. + +``` +src/main/resources +├── application.properties # main config file +├── PasswordResetMail.txt # Mail text for reseting password +├── security.properties # keys for signing cookies/links +└── VerificationMail.txt # Mail text for verifying account +``` + +All configurations in the application.properties can also be set using +environment variables by putting all letters of the setting to uppercase and +replacing any non-word character to an underscore. + +``` +application.properties +---------------------- +spring.mail.host= +spring.mail.port=587 +spring.mail.username= +spring.mail.password= + +enivorment variables +-------------------- +export SPRING_MAIL_HOST= +export SPRING_MAIL_PORT=587 +export SPRING_MAIL_USERNAME= +export SPRING_MAIL_PASSWORD= +``` + +## Docker-Compose (Java Spring + Database) + +> Note that you are running this backend standalone! +> Checkout `pse-docker` to run both front- and backend. + +Build the composition +```sh +$ docker compose build +``` + +Run the composition +```sh +$ docker compose run +``` + +The port is automatically exposed to port 80. +You can configure the composition by editing the `.env` and `docker-compose.yml` +files. + +## Docker (just Java Spring) + +> Note that you are running this server standalone! +> Checkout `pse-docker` to run both front- and backend. +> You need to connect to a Database to the image as well. + +The docker image can be build using +```sh +$ docker build -t pse-server . +``` + +Then the image can be run using +```sh +$ docker run -p 80:8080 -it pse-server +``` + +Here you can change the configuration by editing the `Dockerfile` by setting +ENV VARS: +``` +ENV SPRING_MAIL_HOST= +ENV SPRING_MAIL_PORT=587 +ENV SPRING_MAIL_USERNAME= +ENV SPRING_MAIL_PASSWORD= +ENV EMAIL_DASHBOARD_BASE_URL=http:// +ENV EMAIL_VERIFICATION_URL=http:///api/2/auth/%s/verify.json +ENV EMAIL_RESET_URL_PATH=/resetPassword +``` + +These can also be set by supplying them when starting the image +```sh +$ docker run -p 80:8080 -it pse-server -e "SPRING_MAIL_HOST=" +``` + +Or you can use the env vars from the host by only writing the name of the var +```sh +$ docker run -p 80:8080 -it pse-server -e SPRING_MAIL_HOST +``` + +## Used Dependencies + +- Spring Web +- Spring Security +- Spring Mail Sender +- Spring Data JPA +- Lombok +- Rome (RSS parsing/fetching) + +## License + +This project is licensed under the AGPL-3 License - see the `LICENSE` file for details + -- cgit v1.2.3