Skip to content

Commit

Permalink
feat: improve variables security
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacek Kaczmarek committed Jun 8, 2024
1 parent a67ef90 commit e17e14f
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 8 deletions.
13 changes: 12 additions & 1 deletion .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,23 @@ jobs:

steps:
- uses: actions/checkout@v4

- name: Update db url
run: sed -i 's/<db_url>/${{ secrets.DB_URL }}/' src/main/resources/application.properties

- name: Update db username
run: sed -i 's/<db_username>/${{ secrets.DB_USERNAME }}/' src/main/resources/application.properties

- name: Update db password
run: sed -i 's/<db_password>/${{ secrets.DB_PASSWORD }}/' src/main/resources/application.properties

- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'temurin'
cache: maven

- name: Build with Maven
run: mvn clean install --batch-mode

Expand All @@ -37,4 +48,4 @@ jobs:
password: ${{ secrets.VPS_PASSWORD }}
script: |
cd /srv/Server-Monitoring-Tool &&
sudo ./update.sh
sudo ./update.sh
15 changes: 9 additions & 6 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
spring.datasource.url=jdbc:h2:mem:DockerMonitor
# Database
spring.datasource.driverClassName=org.h2.Driver
spring.datasource.username=sa
spring.datasource.password=password
spring.application.name=DockerMonitor
server.port=8052
spring.datasource.url=<db_url>
spring.datasource.username=<db_username>
spring.datasource.password=<db_password>

# Swagger
springfox.documentation.swagger-ui.enabled=true
springfox.documentation.swagger-ui.operations-sorter=method
springdoc.swagger-ui.path=/swagger-ui.html
springdoc.swagger-ui.path=/swagger-ui.html

# App
spring.application.name=DockerMonitor
server.port=8052
1 change: 0 additions & 1 deletion update.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
sudo docker system prune &&
sudo git pull -f && sudo docker compose down && sudo docker compose up -d --build

0 comments on commit e17e14f

Please sign in to comment.