blob: 0c7b04bc1886b6f541d3ac4b9ad947c4398b86c6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
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=<YOUR MAIL HOST SMTP>
spring.mail.port=587
spring.mail.username=<YOUR MAIL ADDRESS>
spring.mail.password=<YOUR MAIL PASSWORD>
enivorment variables
--------------------
export SPRING_MAIL_HOST=<YOUR MAIL HOST SMTP>
export SPRING_MAIL_PORT=587
export SPRING_MAIL_USERNAME=<YOUR MAIL ADDRESS>
export SPRING_MAIL_PASSWORD=<YOUR 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=<YOUR MAIL HOST SMTP>
ENV SPRING_MAIL_PORT=587
ENV SPRING_MAIL_USERNAME=<YOUR MAIL ADDRESS>
ENV SPRING_MAIL_PASSWORD=<YOUR MAIL PASSWORD>
ENV EMAIL_DASHBOARD_BASE_URL=http://<YOUR FRONTEND DOMAIN>
ENV EMAIL_VERIFICATION_URL=http://<YOUR BACKEND DOMAIN>/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=<YOUR MAIL HOST SMTP>"
```
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
|