docker compose -f ./docker-compose/docker-compose.prod.yml up -d
POST /generate
Parameter | Type | Description |
---|---|---|
secret_message |
string |
Required. Sectet message |
passphrase |
string |
Required. Passphrase |
ttl |
int |
Optional. Secret lifetime in seconds |
POST /secrets/{secret_key}
Parameter | Type | Description |
---|---|---|
secret_key |
string |
Required. Generated secret code that used to get the secret |
passphrase |
string |
Required. Passphrase |
Depending on the app run, copy the values from *-example.env to .env
for run prod version
for local dev with db in container
docker compose -f ./docker-compose/docker-compose.db.yml up -d --build
pdm install
pdm start
- create migration
pdm run alembic revision -m *migration_name* --autogenerate
- run migrations
pdm run alembic upgrade head
- downgrade migration
pdm run alembic downgrade -1 # or -2 or base or hash of the migration
in pytest.ini
for github action set: POSTGRES_DSN=postgresql+asyncpg://ots:ots@ots_db/postgres
for local dev db in container only set: POSTGRES_DSN=postgresql+asyncpg://onetimesecret:onetimesecret@localhost:65432/onetimesecret
- run tests
pdm run pytest
- run test coverage
pdm run pytest --cov=src --cov-fail-under=80