Cloud orchestration microservice based on FastAPI
Find a file
2025-12-14 17:55:20 +00:00
alembic feat: initial commit 2025-12-14 17:47:51 +00:00
entrypoints feat: initial commit 2025-12-14 17:47:51 +00:00
frontend feat: initial commit 2025-12-14 17:47:51 +00:00
gunicorn feat: initial commit 2025-12-14 17:47:51 +00:00
scripts/postgres feat: initial commit 2025-12-14 17:47:51 +00:00
src feat: initial commit 2025-12-14 17:47:51 +00:00
tests/tofu feat: initial commit 2025-12-14 17:47:51 +00:00
.env.example feat: initial commit 2025-12-14 17:47:51 +00:00
.gitignore feat: initial commit 2025-12-14 17:47:51 +00:00
alembic.ini feat: initial commit 2025-12-14 17:47:51 +00:00
docker-compose.prod.yml feat: initial commit 2025-12-14 17:47:51 +00:00
docker-compose.yml feat: initial commit 2025-12-14 17:47:51 +00:00
Dockerfile feat: initial commit 2025-12-14 17:47:51 +00:00
justfile feat: initial commit 2025-12-14 17:47:51 +00:00
LICENSE feat: initial commit 2025-12-14 17:47:51 +00:00
logging.ini feat: initial commit 2025-12-14 17:47:51 +00:00
logging_production.ini feat: initial commit 2025-12-14 17:47:51 +00:00
poetry.lock feat: initial commit 2025-12-14 17:47:51 +00:00
pyproject.toml feat: initial commit 2025-12-14 17:47:51 +00:00
README.md docs: add screenshot to README 2025-12-14 17:55:20 +00:00
screenshot.png docs: add screenshot to README 2025-12-14 17:55:20 +00:00

ilo pali lili

Backend for orchestrating deployment of censorship circumvention resources.

Local Development

Setup just

MacOS:

brew install just

Debian/Ubuntu:

apt install just

Others: link

Setup poetry

pip install poetry

Other ways: link

Setup Postgres (16.3)

just up

Copy the environment file and install dependencies

  1. cp .env.example .env
  2. poetry install

Run the uvicorn server

With default settings:

just run

With extra configs (e.g. logging file)

just run --log-config logging.ini

Linters

Format the code with ruff --fix and ruff format

just lint

Migrations

  • Create an automatic migration from changes in src/database.py
just mm *migration_name*
  • Run migrations
just migrate
  • Downgrade migrations
just downgrade downgrade -1  # or -2 or base or hash of the migration

Deployment

Deployment is done with Docker and Gunicorn. The Dockerfile is optimized for small size and fast builds with a non-root user. The gunicorn configuration is set to use the number of workers based on the number of CPU cores.

Example of running the app with docker compose:

docker compose -f docker-compose.prod.yml up -d --build

Conventions

This project uses the FastAPI best practices documented by GitHub user zhanymkanov and was originally created from their template.

Copyright © 2025 SR2 Communications Limited.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.