Perseus is a powerful APK management system that allows you to store, version, and distribute Android application packages (APKs). It provides a RESTful API interface for pushing, pulling, and managing APK versions.
- APK Storage: Securely store APK files with SHA256 hash verification
- Version Management: Create and manage frozen versions of your APKs
- Version Tagging: Tag specific APK combinations as releases
- RESTful API: Simple and intuitive HTTP API interface
- Ensure you have Python 3.13 or higher installed
- Clone the repository:
git clone <repository-url> cd perseus-backend
- Install dependencies using Poetry:
poetry install
- Install Gunicorn (for production deployment):
pip install gunicorn
- Create a systemd service file at
/etc/systemd/system/perseus.service:
[Unit]
Description=Perseus Gunicorn Service
After=network.target
[Service]
User=<your-user>
WorkingDirectory=/path/to/perseus
ExecStart=/usr/bin/gunicorn --workers 2 --bind <ip-address>:<port> perseus:app
Restart=on-failure
Environment=PYTHONUNBUFFERED=1
Type=simple
[Install]
WantedBy=multi-user.target- Enable and start the service:
sudo systemctl enable perseus
sudo systemctl start perseus- Check service status:
sudo systemctl status perseusReplace the following placeholders:
<your-user>: System user to run the service/path/to/perseus: Absolute path to your Perseus installation<ip-address>: IP address to bind to (e.g., 0.0.0.0 for all interfaces)<port>: Port number to run the service on
Create a configuration file at /srv/perseus/perseus.conf or use the default configuration:
[repository]
name = /srv/perseus
[network]
ip_address = 0.0.0.0
port = 5000POST /api/v1/push- Upload a new APK file
- Request: multipart/form-data with 'file' and optional 'message'
- Response: Returns hash and path of stored APK
GET /api/v1/pull- Download latest frozen version of all APKs
GET /api/v1/pull/<version>- Download specific version of all APKs
GET /api/v1/pull/<version>/<app_name>- Download specific version of a single app
GET /api/v1/freeze/<version>- Create a new frozen version using latest APKs
GET /api/v1/versions- List all frozen versions with timestamps
GET /api/v1/apps- List all apps with their latest hashes and version tags
- Returns: App names, latest hashes, timestamps, and version tags
GET /api/v1/apps/all- List all apps with their complete version history
- Returns: Detailed version history including hashes, timestamps, and messages
GET /- Basic server status check
GET /api/v1/status- API status check
curl -X POST -F "[email protected]" -F "message=New feature release" http://localhost:5000/api/v1/pushcurl http://localhost:5000/api/v1/freeze/1.0.0curl http://localhost:5000/api/v1/pullcurl http://localhost:5000/api/v1/appsThe system uses SQLite with the following main tables:
apk_versions: Stores APK metadata (filename, hash, message)version_groups: Manages frozen versionsversion_apks: Maps APKs to version groups
- Python 3.13+
- Poetry for dependency management
- SQLite3
perseus/
├── app.py # Main application entry point
├── blueprints/ # API route definitions
│ └── api/
│ ├── default.py # Basic status endpoints
│ ├── push.py # Upload operations
│ ├── pull.py # Download operations
│ └── list.py # Listing operations
├── config/ # Configuration management
└── utils/
└── db/ # Database operations
This project is licensed under the Apache 2.0 License - see the LICENSE file for details.