Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
4502814
Initial plan
Copilot Dec 8, 2025
8c36558
Add backend core infrastructure and services
Copilot Dec 8, 2025
63b0817
Add API endpoints, templates, Docker setup, and CI workflow
Copilot Dec 8, 2025
afa8635
Fix database health check and add smoke tests
Copilot Dec 8, 2025
e26cc56
Address code review feedback and security issues
Copilot Dec 8, 2025
c4b9659
Fix bcrypt password length limit and logging request_id errors
Copilot Dec 8, 2025
6cfb223
Restore original Flask CSS design to FastAPI templates
Copilot Dec 8, 2025
43ae22a
Fix critical bugs: get_session_id errors, panel API integration, and …
Copilot Dec 8, 2025
106df5d
Redesign panel pages with modern card-based UI
Copilot Dec 8, 2025
0f55d5d
Major UI redesign: split-pane builder, credit system, admin pricing c…
Copilot Dec 8, 2025
34ef613
time fix
macery12 Dec 8, 2025
b0c1690
Fix pricing defaults and admin pricing update functionality
Copilot Dec 8, 2025
2b4b5fd
Load nests/eggs/nodes from config.json, fix logging errors, improve w…
Copilot Dec 8, 2025
8ff25be
Update builder.py
macery12 Dec 8, 2025
f914aaf
Add password recovery with recovery codes and fix builder credential …
Copilot Dec 9, 2025
3836877
Add Alembic auto-migrations system to handle schema changes
Copilot Dec 9, 2025
0127a77
Fix pydantic-settings dependency and cleanup project structure
Copilot Dec 9, 2025
7020708
Update requirements.txt
macery12 Dec 9, 2025
3c6c73f
Merge branch 'copilot/refactor-flask-to-fastapi' of https://github.co…
macery12 Dec 9, 2025
c1c6948
Fix SECRET_KEY validation error and add database reset utilities
Copilot Dec 9, 2025
f644f9d
Fix 500 errors caused by config module initialization issues
Copilot Dec 10, 2025
110d2b9
Fix template and static file paths to work correctly in Docker
Copilot Dec 10, 2025
c428779
Add diagnostic logging for path resolution debugging
Copilot Dec 10, 2025
079b098
Implement comprehensive DEBUG mode for troubleshooting 500 errors
Copilot Dec 10, 2025
e1ba1c4
Fix DEBUG mode HTTP request logging to use INFO level
Copilot Dec 10, 2025
3320457
Implement file-based DEBUG logging with rotation
Copilot Dec 10, 2025
259362f
Fix admin billables 500 error and ensure DEBUG logs directory creation
Copilot Dec 10, 2025
daa9687
Fix UnboundLocalError for Path variable in lifespan function
Copilot Dec 10, 2025
3b57019
Fix DEBUG log file permission denied error
Copilot Dec 10, 2025
4e150f1
Fix log permissions with bind mounts and secure Redis
Copilot Dec 10, 2025
712370b
Fix admin billables route with enhanced error handling and consistent…
Copilot Dec 10, 2025
b04f527
Add missing user_id column to orders table via migration
Copilot Dec 10, 2025
bac5f7d
Fix migration user_id, recovery code display, and auth error UX
Copilot Dec 10, 2025
2da2fba
Code cleanup: Remove old Flask README and optimize imports
Copilot Dec 10, 2025
1313214
Phase 1: Service refactor - models, schemas, minimal logging
Copilot Dec 10, 2025
7903bc9
Fix missing imports across all API modules
Copilot Dec 10, 2025
fdca224
Add comprehensive features documentation (FEATURES.md)
Copilot Dec 11, 2025
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
41 changes: 41 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Application Settings
# IMPORTANT: Generate a secure SECRET_KEY with: openssl rand -hex 32
SECRET_KEY=changeme-please-use-a-secure-random-key-in-production
HOST=0.0.0.0
PORT=5000
LOG_LEVEL=INFO

# Debug Mode
# Set to 'true' for extensive debugging logs (helpful for troubleshooting)
# πŸ†• When enabled, all logs written to /app/logs/debug.log (10MB rotation, 3 backups)
# Logs include: HTTP requests/responses, exceptions with stack traces, file system info
# View logs: docker exec m12hosting_backend_dev tail -f /app/logs/debug.log
# WARNING: DEBUG mode logs sensitive information - only use in development!
DEBUG=false

# Database
DATABASE_URL=sqlite:///./data/app.db

# Redis (for sessions)
REDIS_URL=redis://redis:6379/0

# Session Configuration
SESSION_EXPIRY_SECONDS=86400
COOKIE_SECURE=false # Set to true in production with HTTPS

# Encryption (for panel credentials)
# Generate with: python -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())"
FERNET_KEY=

# Admin Bootstrap (optional)
# If set, creates this admin user on first startup
ADMIN_USERNAME=
ADMIN_PASSWORD=

# Discord Integration
DISCORD_WEBHOOK_URL=
DISCORD_INVITE_URL=
DISCORD_GUILD_ID=

# Panel Configuration
CONFIG_JSON_URL=
89 changes: 89 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: CI

on:
push:
branches: [ "main", "copilot/*" ]
pull_request:
branches: [ "main" ]

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Install dependencies
run: |
cd backend
pip install -r requirements.txt

- name: Run ruff linter
run: |
cd backend
ruff check app/ || true

build:
name: Build Docker Image
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build backend image
uses: docker/build-push-action@v6
with:
context: ./backend
file: ./backend/Dockerfile
push: false
tags: m12hosting-backend:test
cache-from: type=gha
cache-to: type=gha,mode=max

# Optional: push to registry if secrets are configured
push:
name: Push to Registry
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
needs: [lint, build]
permissions:
contents: read
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to GHCR
if: ${{ github.event_name != 'pull_request' }}
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v6
with:
context: ./backend
file: ./backend/Dockerfile
push: true
tags: |
ghcr.io/${{ github.repository_owner }}/m12hosting-backend:latest
ghcr.io/${{ github.repository_owner }}/m12hosting-backend:${{ github.sha }}
platforms: linux/amd64,linux/arm64
71 changes: 71 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -205,3 +205,74 @@ cython_debug/
marimo/_static/
marimo/_lsp/
__marimo__/
# Python
__pycache__/
*.py[cod]
*$py.class
*.so
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg

# Virtual environments
venv/
ENV/
env/
.venv

# Environment variables
.env
.env.local
.env.*.local

# Database
*.db
*.sqlite
*.sqlite3
backend/data/
backend_data/
backend_logs/

# Keep migration files
!backend/alembic/versions/*.py

# IDE
.vscode/
.idea/
*.swp
*.swo
*~

# OS
.DS_Store
Thumbs.db

# Logs
*.log
logs/

# Testing
.pytest_cache/
.coverage
htmlcov/

# Docker
*.pid
*.sock

# Alembic bytecode
backend/alembic/__pycache__/
backend/alembic/versions/__pycache__/
Loading