Skip to content

Add setup and deployment scripts#64

Open
glennswest wants to merge 1 commit intobenavlabs:mainfrom
glennswest:feature/setup-deploy-scripts
Open

Add setup and deployment scripts#64
glennswest wants to merge 1 commit intobenavlabs:mainfrom
glennswest:feature/setup-deploy-scripts

Conversation

@glennswest
Copy link

Summary

Add two utility scripts to simplify CRUDAdmin application creation and deployment.

Scripts

setup_crudadmin_app.sh

Creates a new CRUDAdmin application from scratch:

  • OS Detection: Supports Debian/Ubuntu, RHEL/CentOS/Rocky, Fedora, Arch
  • Python Setup: Checks for Python 3.10+, installs if needed
  • Venv Support: Installs python3-venv and build tools if missing
  • Project Structure: Creates models/, schemas/, migrations/, templates/
  • Dependencies: Installs FastAPI, SQLAlchemy, Alembic, CRUDAdmin
  • Configuration:
    • Generates secure SECRET_KEY
    • Creates .env with configurable settings
    • Sets up Alembic for async migrations
  • Branding: Prompts for app name and customizes UI title

deploy_crudadmin_service.sh

Deploys an existing CRUDAdmin app as a systemd service:

  • Systemd Service: Creates service file with security hardening
  • Configuration: Host, port, workers customizable
  • Auto-start: Enables service on boot
  • Firewall: Optional ufw/firewalld port opening
  • Nginx: Optional reverse proxy setup with WebSocket support
  • SSL Ready: Instructions for certbot HTTPS

Usage

# Create new app
./scripts/setup_crudadmin_app.sh

# Deploy as service
sudo ./scripts/deploy_crudadmin_service.sh

Test plan

  • Test setup script on Debian/Ubuntu
  • Test setup script on RHEL-based distros
  • Test deploy script creates working systemd service
  • Test nginx reverse proxy configuration

Scripts:
- setup_crudadmin_app.sh: Creates new CRUDAdmin application
  - Installs Python venv support if needed (Debian, RHEL, Arch, etc.)
  - Creates virtual environment and installs dependencies
  - Sets up project structure with models, schemas, migrations
  - Configures SQLite database and Alembic
  - Prompts for app name and customizes branding
  - Generates secure SECRET_KEY

- deploy_crudadmin_service.sh: Deploys as systemd service
  - Creates systemd service file with security hardening
  - Configures uvicorn with host/port/workers
  - Optional firewall configuration (ufw/firewalld)
  - Optional nginx reverse proxy setup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants