Skip to content

Commit

Permalink
Fix pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
lr101 committed Aug 28, 2024
1 parent b4e7f79 commit 77d48b7
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 67 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ RUN mvn clean install
#Run
FROM openjdk:17-jdk-slim
WORKDIR /app
COPY --from=build /tmp/target/*jar /app/app.jar
COPY --from=builder /tmp/target/*jar /app/app.jar
EXPOSE 8080
ENTRYPOINT ["java", "-jar", "app.jar"]
88 changes: 23 additions & 65 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,68 +1,26 @@
Setting up environmental variables: \
Intelij: Run -> Edit Configurations... -> Environment Variables
```
DB_USER=[user];DB_PASSWORD=[password]
```
Using a database via ssh-tunnel:
```
DB_USER=postgres;DB_PASSWORD=root;SSH_Key=[keyContent];...//TODO
```

Port forwarding:
```
sudo apt-get install iptables
sudo nano /etc/rc.local
```
And add this line before exit 0
```
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080
```
Service starten mit:
```
sudo systemctl start rc.local
```


Service erstellt in:
```
sudo nano /etc/systemd/system/server.service
```
```
[Unit]
Description=Spring Server for sensors
After=network.target
StartLimitIntervalSec=0
[Service]
Restart=always
RestartSec=20
User=pi
Environment=DB_USER=[user] #TODO
Environment=DB_PASSWORD=[psw] #TODO
Environment=DATASOURCE_URL=jdbc:postgresql://127.0.0.1:5432/postgres
ExecStart=java -jar $PWD/SpringServer-1.jar
[Install]
WantedBy=multi-user.target
```
Service starten mit:
```
sudo systemctl start server.service
```
Service für nach boot autostart:
```
sudo systemctl enable server
```
Einstellungen speichern mit:
```
sudo systemctl daemon-reload
```
# TempServer

## Setup

This service is run via docker:

1. Create `.env` file in a folder:
```
POSTGRES_USER=<db_user>
POSTGRES_PASSWORD=<db_password>
DB_URL=jdbc:postgresql://db:5432/tempserver
INFLUXDB_URL=http://indluxdb:8086
INFLUXDB_TOKEN=<influx_token>
INFLUXDB_BUCKET=tempserver
INFLUXDB_ORG=<org>
```
Fill in your own values for connecting to existing postgresdb or influxdb instances. Create your own influxdb token via the influx ui.
2. Copy the `docker-compose.yml` file into the same folder
3. Run the docker compose file (remove db or influxdb services if not needed):
```shell
docker compose up -d
```

Ardiono IDE ESP8266 Library: http://arduino.esp8266.com/stable/package_esp8266com_index.json

Tile CSS: https://1linelayouts.glitch.me/

sudo nano /var/log/postgresql/postgresql-13-main.log - to see postgres logs

postgres login unix: sudo su - postgres
-> Probleme in "/pg_hba.conf" der Datenbank müssen Loginmethoden für die Lokale Benutzung verändert werden.
Tile CSS: https://1linelayouts.glitch.me/
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
services:
temp-server:
container_name: temp-server
build: .
image: lr.dev.projects/temp-server:latest
restart: unless-stopped
ports:
- 8081:8081
Expand Down

0 comments on commit 77d48b7

Please sign in to comment.