Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: improve variables security #3

Merged
merged 1 commit into from
Jun 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading