Skip to main content

Dynamic Python System Deployment Tools

Project description

DynaPsys

DynaPsys is a comprehensive Python package for automated deployment and management of web applications, with a focus on React applications. It provides tools for deployment automation, DNS management through Cloudflare, and process management using PM2.

Features

  • Automated deployment server for web applications
  • Cloudflare DNS management integration
  • Git repository support
  • PM2 process management
  • Base64 deployment support
  • Comprehensive logging system

Installation

pip install dynapsys

Usage

Starting the Deployment Server

from dynapsys.deployment import run_server

# Start the server on port 8000 (default)
run_server()

# Or specify a custom port
run_server(port=8080)

Deploying an Application

Send a POST request to the deployment server:

curl -X POST http://localhost:8000 \
  -H "Content-Type: application/json" \
  -d '{
    "domain": "your-domain.com",
    "cf_token": "your-cloudflare-token",
    "source": "https://github.com/username/repo.git"
  }'

Using Individual Components

Git Operations

from dynapsys.git import clone_git_repo, is_valid_git_url

# Validate Git URL
if is_valid_git_url("https://github.com/username/repo.git"):
    # Clone repository
    clone_git_repo("https://github.com/username/repo.git", "/path/to/target")

DNS Management

from dynapsys.dns import update_cloudflare_dns

# Update DNS records
update_cloudflare_dns("your-domain.com", "your-cloudflare-token")

Requirements

  • Python 3.6+
  • Git
  • Node.js and npm (for React applications)
  • PM2 (for process management)
  • Cloudflare API token (for DNS management)

Configuration

The package uses environment variables for configuration:

  • DYNAPSYS_LOG_LEVEL: Logging level (default: DEBUG)
  • DYNAPSYS_LOG_FILE: Path to log file (default: deployment.log)
  • DYNAPSYS_SITES_DIR: Directory for deployed sites (default: /opt/reactjs/sites)

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the Apache 2 License - see the LICENSE file for details.

Changelog

See CHANGELOG.md for a list of changes.

Todo

See TODO.md for planned features and improvements.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dynapsys-0.1.0.tar.gz (19.5 kB view details)

Uploaded Source

Built Distribution

dynapsys-0.1.0-py3-none-any.whl (13.3 kB view details)

Uploaded Python 3

File details

Details for the file dynapsys-0.1.0.tar.gz.

File metadata

  • Download URL: dynapsys-0.1.0.tar.gz
  • Upload date:
  • Size: 19.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.3

File hashes

Hashes for dynapsys-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d066d0248335db9a2ce2a556184947393e7ad415e0da0b3aec73f4216ef2ec99
MD5 355746b36df870c7fbdf0d2f5b8c5182
BLAKE2b-256 63c872c16a0687331d8b84d29df5ca3eeb503a6a1452a7ce9c9fe7700d361c98

See more details on using hashes here.

File details

Details for the file dynapsys-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: dynapsys-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 13.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.3

File hashes

Hashes for dynapsys-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 51cf2a7c6e069c3544918580f8b55681242898a290fd523b83ae255de736a62f
MD5 2908cab68fbc9e1c2cdd3e891be47203
BLAKE2b-256 2040a6fc5a3d522add5e03d5fcdf6f83a2b5fc43e854c6420ad61037001f3391

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page