Skip to content

Commit a195e62

Browse files
authored
Merge pull request #49 from MedAziz11/develop
Develop
2 parents facfceb + 93c5694 commit a195e62

File tree

5 files changed

+59
-46
lines changed

5 files changed

+59
-46
lines changed

.github/workflows/main.yml

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,22 +28,22 @@ jobs:
2828

2929
# Set up Docker Buildx for building images with BuildKit
3030
- name: Set up Docker Buildx
31-
uses: docker/setup-buildx-action@v1
31+
uses: docker/setup-buildx-action@v2
3232

3333
# Cache Docker layers for faster builds
34-
- name: Cache Docker layers
35-
uses: actions/cache@v2
36-
with:
37-
path: ${{ env.CACHE_PATH }}
38-
key: ${{ runner.os }}-buildx-${{ github.ref }}-${{ hashFiles('**/Dockerfile') }}
39-
restore-keys: |
40-
${{ runner.os }}-buildx-${{ github.ref }}-
41-
${{ runner.os }}-buildx-
34+
# - name: Cache Docker layers
35+
# uses: actions/cache@v3
36+
# with:
37+
# path: ${{ env.CACHE_PATH }}
38+
# key: ${{ runner.os }}-buildx-${{ github.ref }}-${{ hashFiles('**/Dockerfile') }}
39+
# restore-keys: |
40+
# ${{ runner.os }}-buildx-${{ github.ref }}-
41+
# ${{ runner.os }}-buildx-
4242

4343
# Log in to Docker Hub using the provided secrets
4444
- name: Login to Docker Hub
4545
if: github.event_name != 'pull_request'
46-
uses: docker/login-action@v1
46+
uses: docker/login-action@v2
4747
with:
4848
username: ${{ secrets.DOCKER_USERNAME }}
4949
password: ${{ secrets.DOCKER_PASSWORD }}
@@ -69,18 +69,19 @@ jobs:
6969
echo "Error: Unexpected branch or tag"
7070
exit 1
7171
fi
72+
73+
echo "tags=${TAGS}" >> $GITHUB_OUTPUT
7274
73-
echo "::set-output name=tags::${TAGS}"
7475
7576
# Build, test, and push the Docker image
7677
- name: Build, Test, and Push Docker image
77-
uses: docker/build-push-action@v2
78+
uses: docker/build-push-action@v4
7879
with:
7980
context: .
8081
platforms: linux/amd64,linux/arm64
8182
push: ${{ github.event_name != 'pull_request' }}
8283
tags: ${{ steps.image_tags.outputs.tags }}
83-
cache-from: type=local,src=${{ env.CACHE_PATH }}
84+
# cache-from: type=local,src=${{ env.CACHE_PATH }}
8485
cache-to: type=local,dest=${{ env.CACHE_PATH }}
8586

8687
# FUTURE TESTS?

Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ RUN addgroup -S appgroup && adduser -S appuser -G appgroup -s /bin/sh
3838
# Copy Python packages and the virtual environment from the builder stage
3939
COPY --from=builder --chown=appuser:appgroup /app /app
4040

41+
# Create /db directory to prevent permission issues
42+
RUN mkdir /db && \
43+
chown appuser:appgroup /db
44+
4145
# Set the working directory to /app
4246
WORKDIR /app
4347

README.md

Lines changed: 37 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,19 @@
1515

1616
### Environment Variables :
1717

18+
#### Required
1819
You have to define these ENV VARS in order to connect to your KUMA server.
1920

20-
KUMA_SERVER=<your_kuma_server>
21-
KUMA_USERNAME=<your_kuma_username>
22-
KUMA_PASSWORD=<your_kuma_password>
23-
ADMIN_PASSWORD=<your admin password so you can connect with via the api>
21+
KUMA_SERVER: The URL of your Uptime Kuma instance. ex: https://uptime.example.com
22+
KUMA_USERNAME: The username of your Uptime Kuma user
23+
KUMA_PASSWORD: The password of your Uptime Kuma user
24+
ADMIN_PASSWORD: An admin password to access the API
25+
26+
#### Optional
27+
Additional configuration variables available
28+
29+
ACCESS_TOKEN_EXPIRATION: Minutes the access token should be valid. Defaults to 8 days.
30+
SECRET_KEY: A secret value to encode JWTs with
2431

2532
#### Note:
2633

@@ -46,33 +53,34 @@ You can simply create a docker compose file like this :
4653
```yaml
4754
version: "3.9"
4855
services:
49-
kuma:
50-
container_name: uptime-kuma
51-
image: louislam/uptime-kuma:latest
52-
ports:
53-
- "3001:3001"
54-
restart: always
55-
volumes:
56-
- uptime-kuma:/app/data
57-
58-
api:
59-
container_name: backend
60-
image: medaziz11/uptimekuma_restapi
61-
volumes:
62-
- ./db:/db
63-
restart: always
64-
environment:
65-
- KUMA_SERVER=http://kuma:3001
66-
- KUMA_USERNAME=test
67-
- KUMA_PASSWORD=123test.
68-
- ADMIN_PASSWORD=admin
69-
depends_on:
70-
- kuma
71-
ports:
72-
- "8000:8000"
56+
kuma:
57+
container_name: uptime-kuma
58+
image: louislam/uptime-kuma:latest
59+
ports:
60+
- "3001:3001"
61+
restart: always
62+
volumes:
63+
- uptime-kuma:/app/data
64+
65+
api:
66+
container_name: backend
67+
image: medaziz11/uptimekuma_restapi
68+
volumes:
69+
- api:/db
70+
restart: always
71+
environment:
72+
- KUMA_SERVER=http://kuma:3001
73+
- KUMA_USERNAME=test
74+
- KUMA_PASSWORD=123test.
75+
- ADMIN_PASSWORD=admin
76+
depends_on:
77+
- kuma
78+
ports:
79+
- "8000:8000"
7380

7481
volumes:
75-
uptime-kuma:
82+
uptime-kuma:
83+
api:
7684
```
7785
7886
### In order for the example to work: You have to run kuma first then create your kuma username and password then re-run the compose file.

docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ services:
1212
build: .
1313
# image: medaziz11/uptimekuma_restapi:1.2
1414
volumes:
15-
- ./db:/db:rwx
15+
- api:/db
1616
restart: always
1717
environment:
1818
- KUMA_SERVER=${KUMA_SERVER:-http://kuma:3001}
@@ -26,4 +26,4 @@ services:
2626

2727
volumes:
2828
uptime-kuma:
29-
api-db:
29+
api:

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ python-engineio==4.3.4
2121
python-multipart==0.0.5
2222
python-socketio==5.7.1
2323
pytz==2022.4
24-
PyYAML==6.0
24+
pyyaml!=6.0.0,!=5.4.0,!=5.4.1
2525
requests==2.28.1
2626
six==1.16.0
2727
sniffio==1.3.0
@@ -36,4 +36,4 @@ websocket-client==1.4.1
3636
websockets==10.3
3737
asyncio==3.4.3
3838
gunicorn==20.1.0
39-
uvicorn==0.21.1
39+
uvicorn==0.21.1

0 commit comments

Comments
 (0)