Compare commits
15 Commits
1.0.4-rc1
...
d183e0a4b6
| Author | SHA1 | Date | |
|---|---|---|---|
| d183e0a4b6 | |||
| b25ebaaec0 | |||
| ae5b40512c | |||
| 92635a356c | |||
| 235269bdb6 | |||
| 5d4b0ec2c9 | |||
| a21cb60aeb | |||
| e604870e26 | |||
| c3e35258a1 | |||
| d2a56e36c7 | |||
| 3bfca4e2b0 | |||
| f5d68aec4a | |||
| 38c637cc67 | |||
| f29c90897f | |||
| efb65b6da3 |
@@ -24,40 +24,88 @@ jobs:
|
||||
echo "tag=next-$version-$current_date" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Resolve Gitea Server IP
|
||||
id: gitea_ip
|
||||
run: |
|
||||
ip=$(getent hosts gitea-server | awk '{ print $1 }')
|
||||
echo "ip=$ip" >> $GITHUB_OUTPUT
|
||||
echo "Resolved Gitea server IP: $ip"
|
||||
|
||||
- name: Build Backend Docker Image
|
||||
run: |
|
||||
docker build -t ${{ steps.gitea_ip.outputs.ip }}:3000/ryan/backend:${{ steps.vars.outputs.tag }} ./backend
|
||||
docker build -t git.ryankegel.com:3000/ryan/backend:${{ steps.vars.outputs.tag }} ./backend
|
||||
|
||||
- name: Build Frontend Docker Image
|
||||
run: |
|
||||
docker build -t ${{ steps.gitea_ip.outputs.ip }}:3000/ryan/frontend:${{ steps.vars.outputs.tag }} ./frontend/vue-app
|
||||
docker build -t git.ryankegel.com:3000/ryan/frontend:${{ steps.vars.outputs.tag }} ./frontend/vue-app
|
||||
|
||||
- name: Log in to Registry
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: ${{ steps.gitea_ip.outputs.ip }}:3000
|
||||
registry: git.ryankegel.com:3000
|
||||
username: ryan #${{ secrets.REGISTRY_USERNAME }} # Stored as a Gitea secret
|
||||
password: 0x013h #${{ secrets.REGISTRY_TOKEN }} # Stored as a Gitea secret (use a PAT here)
|
||||
|
||||
- name: Push Backend Image to Gitea Registry
|
||||
run: |
|
||||
docker push ${{ steps.gitea_ip.outputs.ip }}:3000/ryan/backend:${{ steps.vars.outputs.tag }}
|
||||
for i in {1..3}; do
|
||||
echo "Attempt $i to push backend image..."
|
||||
if docker push git.ryankegel.com:3000/ryan/backend:${{ steps.vars.outputs.tag }}; then
|
||||
echo "Backend push succeeded on attempt $i"
|
||||
break
|
||||
else
|
||||
echo "Backend push failed on attempt $i"
|
||||
if [ $i -lt 3 ]; then
|
||||
sleep 10
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
done
|
||||
if [ "${{ gitea.ref }}" == "refs/heads/master" ]; then
|
||||
docker tag ${{ steps.gitea_ip.outputs.ip }}:3000/ryan/backend:${{ steps.vars.outputs.tag }} ${{ steps.gitea_ip.outputs.ip }}:3000/ryan/backend:latest
|
||||
docker push ${{ steps.gitea_ip.outputs.ip }}:3000/ryan/backend:latest
|
||||
docker tag git.ryankegel.com:3000/ryan/backend:${{ steps.vars.outputs.tag }} git.ryankegel.com:3000/ryan/backend:latest
|
||||
docker push git.ryankegel.com:3000/ryan/backend:latest
|
||||
elif [ "${{ gitea.ref }}" == "refs/heads/next" ]; then
|
||||
docker tag git.ryankegel.com:3000/ryan/backend:${{ steps.vars.outputs.tag }} git.ryankegel.com:3000/ryan/backend:next
|
||||
docker push git.ryankegel.com:3000/ryan/backend:next
|
||||
fi
|
||||
|
||||
- name: Push Frontend Image to Gitea Registry
|
||||
run: |
|
||||
docker push ${{ steps.gitea_ip.outputs.ip }}:3000/ryan/frontend:${{ steps.vars.outputs.tag }}
|
||||
if [ "${{ gitea.ref }}" == "refs/heads/master" ]; then
|
||||
docker tag ${{ steps.gitea_ip.outputs.ip }}:3000/ryan/frontend:${{ steps.vars.outputs.tag }} ${{ steps.gitea_ip.outputs.ip }}:3000/ryan/frontend:latest
|
||||
docker push ${{ steps.gitea_ip.outputs.ip }}:3000/ryan/frontend:latest
|
||||
for i in {1..3}; do
|
||||
echo "Attempt $i to push frontend image..."
|
||||
if docker push git.ryankegel.com:3000/ryan/frontend:${{ steps.vars.outputs.tag }}; then
|
||||
echo "Frontend push succeeded on attempt $i"
|
||||
break
|
||||
else
|
||||
echo "Frontend push failed on attempt $i"
|
||||
if [ $i -lt 3 ]; then
|
||||
sleep 10
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
done
|
||||
if [ "${{ gitea.ref }}" == "refs/heads/master" ]; then
|
||||
docker tag git.ryankegel.com:3000/ryan/frontend:${{ steps.vars.outputs.tag }} git.ryankegel.com:3000/ryan/frontend:latest
|
||||
docker push git.ryankegel.com:3000/ryan/frontend:latest
|
||||
elif [ "${{ gitea.ref }}" == "refs/heads/next" ]; then
|
||||
docker tag git.ryankegel.com:3000/ryan/frontend:${{ steps.vars.outputs.tag }} git.ryankegel.com:3000/ryan/frontend:next
|
||||
docker push git.ryankegel.com:3000/ryan/frontend:next
|
||||
fi
|
||||
|
||||
- name: Deploy Test Environment
|
||||
uses: appleboy/ssh-action@v1.0.3 # Or equivalent Gitea action; adjust version if needed
|
||||
with:
|
||||
host: ${{ secrets.DEPLOY_TEST_HOST }}
|
||||
username: ${{ secrets.DEPLOY_TEST_USER }}
|
||||
key: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||
port: 22 # Default SSH port; change if different
|
||||
script: |
|
||||
cd /tmp
|
||||
# Pull the repository to get the latest docker-compose.dev.yml
|
||||
if [ -d "chore" ]; then
|
||||
cd chore
|
||||
git pull origin next || true # Pull latest changes; ignore if it fails (e.g., first run)
|
||||
else
|
||||
git clone --branch next https://git.ryankegel.com/ryan/chore.git
|
||||
cd chore
|
||||
fi
|
||||
echo "Bringing down previous test environment..."
|
||||
docker-compose -f docker-compose.test.yml down --volumes --remove-orphans || true
|
||||
echo "Starting new test environment..."
|
||||
docker-compose -f docker-compose.test.yml pull # Ensure latest images are pulled
|
||||
docker-compose -f docker-compose.test.yml up -d
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# file: config/version.py
|
||||
import os
|
||||
|
||||
BASE_VERSION = "1.0.4" # update manually when releasing features
|
||||
BASE_VERSION = "1.0.4RC2" # update manually when releasing features
|
||||
|
||||
def get_full_version() -> str:
|
||||
"""
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import logging
|
||||
import sys
|
||||
import os
|
||||
|
||||
from flask import Flask, request, jsonify
|
||||
from flask_cors import CORS
|
||||
@@ -49,7 +50,7 @@ app.config.update(
|
||||
MAIL_USERNAME='ryan.kegel@gmail.com',
|
||||
MAIL_PASSWORD='ruyj hxjf nmrz buar',
|
||||
MAIL_DEFAULT_SENDER='ryan.kegel@gmail.com',
|
||||
FRONTEND_URL='https://localhost:5173', # Adjust as needed
|
||||
FRONTEND_URL=os.environ.get('FRONTEND_URL', 'https://localhost:5173'), # Dynamic via env var, defaults to localhost
|
||||
SECRET_KEY='supersecretkey' # Replace with a secure key in production
|
||||
)
|
||||
|
||||
|
||||
Binary file not shown.
29
docker-compose.test.yml
Normal file
29
docker-compose.test.yml
Normal file
@@ -0,0 +1,29 @@
|
||||
# yaml
|
||||
version: "3.8"
|
||||
|
||||
services:
|
||||
chore-test-app-backend: # Test backend service name
|
||||
image: git.ryankegel.com:3000/ryan/backend:next # Use latest next tag
|
||||
ports:
|
||||
- "5004:5000" # Host 5004 -> Container 5000
|
||||
environment:
|
||||
- FLASK_ENV=development
|
||||
- FRONTEND_URL=https://devserver.lan:446 # Add this for test env
|
||||
# Add volumes, networks, etc., as needed
|
||||
|
||||
chore-test-app-frontend: # Test frontend service name
|
||||
image: git.ryankegel.com:3000/ryan/frontend:next # Use latest next tag
|
||||
ports:
|
||||
- "446:443" # Host 446 -> Container 443 (HTTPS)
|
||||
environment:
|
||||
- BACKEND_HOST=chore-test-app-backend # Points to internal backend service
|
||||
depends_on:
|
||||
- chore-test-app-backend
|
||||
# Add volumes, networks, etc., as needed
|
||||
|
||||
networks:
|
||||
chore-test-app-net:
|
||||
driver: bridge
|
||||
|
||||
volumes:
|
||||
chore-test-app-backend-data: {}
|
||||
@@ -1,26 +1,32 @@
|
||||
# yaml
|
||||
version: '3.8'
|
||||
version: "3.8"
|
||||
|
||||
services:
|
||||
chore-app-backend:
|
||||
image: devserver.lan:5900/chore-app-backend:production
|
||||
container_name: chore-app-backend
|
||||
restart: unless-stopped
|
||||
expose:
|
||||
- "5000"
|
||||
networks:
|
||||
- chore-app-net
|
||||
volumes:
|
||||
- chore-app-backend-data:/app/data # persists backend data
|
||||
|
||||
chore-app-frontend:
|
||||
image: devserver.lan:5900/chore-app-frontend:production
|
||||
container_name: chore-app-frontend
|
||||
restart: unless-stopped
|
||||
chore-app-backend: # Production backend service name
|
||||
image: git.ryankegel.com:3000/ryan/backend:latest # Or specific version tag
|
||||
container_name: chore-app-backend-prod # Added for easy identification
|
||||
ports:
|
||||
- "4600:443"
|
||||
- "5001:5000" # Host 5001 -> Container 5000
|
||||
environment:
|
||||
- FLASK_ENV=production
|
||||
volumes:
|
||||
- chore-app-backend-data:/app/data # Assuming backend data storage; adjust path as needed
|
||||
networks:
|
||||
- chore-app-net
|
||||
# Add other volumes, networks, etc., as needed
|
||||
|
||||
chore-app-frontend: # Production frontend service name
|
||||
image: git.ryankegel.com:3000/ryan/frontend:latest # Or specific version tag
|
||||
container_name: chore-app-frontend-prod # Added for easy identification
|
||||
ports:
|
||||
- "443:443" # Host 443 -> Container 443 (HTTPS)
|
||||
environment:
|
||||
- BACKEND_HOST=chore-app-backend # Points to internal backend service
|
||||
depends_on:
|
||||
- chore-app-backend
|
||||
networks:
|
||||
- chore-app-net
|
||||
# Add volumes, networks, etc., as needed
|
||||
|
||||
networks:
|
||||
chore-app-net:
|
||||
|
||||
@@ -9,11 +9,18 @@ RUN npm run build
|
||||
# Stage 2: Serve with nginx
|
||||
FROM nginx:alpine
|
||||
COPY --from=build /app/dist /usr/share/nginx/html
|
||||
COPY nginx.conf /etc/nginx/nginx.conf
|
||||
COPY nginx.conf.template /etc/nginx/nginx.conf.template
|
||||
# Copy SSL certificate and key
|
||||
COPY 192.168.1.102+1.pem /etc/nginx/ssl/server.crt
|
||||
COPY 192.168.1.102+1-key.pem /etc/nginx/ssl/server.key
|
||||
|
||||
EXPOSE 80
|
||||
EXPOSE 443
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
# Copy nginx.conf
|
||||
COPY nginx.conf.template /etc/nginx/nginx.conf.template
|
||||
|
||||
# Set default BACKEND_HOST (can be overridden at runtime)
|
||||
ENV BACKEND_HOST=chore-app-backend
|
||||
|
||||
# Use sed to replace $BACKEND_HOST with the env value, then start Nginx
|
||||
CMD ["/bin/sh", "-c", "sed 's/\\$BACKEND_HOST/'\"$BACKEND_HOST\"'/g' /etc/nginx/nginx.conf.template > /etc/nginx/nginx.conf && nginx -g 'daemon off;'"]
|
||||
|
||||
@@ -17,15 +17,15 @@ http {
|
||||
ssl_ciphers HIGH:!aNULL:!MD5;
|
||||
|
||||
location /api/ {
|
||||
proxy_pass http://chore-app-backend:5000/;
|
||||
proxy_pass http://$BACKEND_HOST:5000/;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
|
||||
location /events {
|
||||
proxy_pass http://chore-app-backend:5000/events;
|
||||
location /events {
|
||||
proxy_pass http://$BACKEND_HOST:5000/events;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header Connection '';
|
||||
proxy_http_version 1.1;
|
||||
@@ -34,7 +34,7 @@ location /events {
|
||||
proxy_cache off;
|
||||
proxy_read_timeout 36000s;
|
||||
proxy_send_timeout 36000s;
|
||||
}
|
||||
}
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
|
||||
43
frontend/vue-app/nginx.conf.template
Normal file
43
frontend/vue-app/nginx.conf.template
Normal file
@@ -0,0 +1,43 @@
|
||||
events {}
|
||||
|
||||
http {
|
||||
include /etc/nginx/mime.types;
|
||||
default_type application/octet-stream;
|
||||
|
||||
server {
|
||||
client_max_body_size 2M;
|
||||
listen 443 ssl;
|
||||
server_name _;
|
||||
root /usr/share/nginx/html;
|
||||
|
||||
ssl_certificate /etc/nginx/ssl/server.crt;
|
||||
ssl_certificate_key /etc/nginx/ssl/server.key;
|
||||
|
||||
ssl_protocols TLSv1.2 TLSv1.3;
|
||||
ssl_ciphers HIGH:!aNULL:!MD5;
|
||||
|
||||
location /api/ {
|
||||
proxy_pass http://$BACKEND_HOST:5000/;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
|
||||
location /events {
|
||||
proxy_pass http://$BACKEND_HOST:5000/events;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header Connection '';
|
||||
proxy_http_version 1.1;
|
||||
chunked_transfer_encoding off;
|
||||
proxy_buffering off;
|
||||
proxy_cache off;
|
||||
proxy_read_timeout 36000s;
|
||||
proxy_send_timeout 36000s;
|
||||
}
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -74,7 +74,7 @@
|
||||
--fab-hover-bg: #5a67d8;
|
||||
--fab-active-bg: #4c51bf;
|
||||
--message-block-color: #fdfdfd;
|
||||
--sub-message-color: #c1d0f1;
|
||||
--sub-message-color: #9eaac4;
|
||||
--sign-in-btn-bg: #fff;
|
||||
--sign-in-btn-color: #2563eb;
|
||||
--sign-in-btn-border: #2563eb;
|
||||
|
||||
@@ -136,7 +136,7 @@
|
||||
>. Please open the email and follow the instructions to verify your account.
|
||||
</p>
|
||||
<div class="card-actions">
|
||||
<button class="form-btn" @click="goToLogin">Go to Sign In</button>
|
||||
<button class="btn btn-primary" @click="goToLogin">Sign In</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user