Baseline md2vk: docs, audit log, docker 8420, openspec, deploy

This commit is contained in:
estorozhenko
2026-09-18 22:05:01 +00:00
commit 09e960a3a9
39 changed files with 3716 additions and 0 deletions
+53
View File
@@ -0,0 +1,53 @@
.PHONY: dev install run clean test
dev: install
TOKEN_ENCRYPTION_KEY_FILE=secrets/token_encryption_key \
uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload
install:
python3 -m venv venv && \
. venv/bin/activate && \
pip install -r requirements.txt
run:
TOKEN_ENCRYPTION_KEY_FILE=secrets/token_encryption_key \
uvicorn app.main:app --host 0.0.0.0 --port 8000
test:
. venv/bin/activate && \
TOKEN_ENCRYPTION_KEY_FILE=secrets/token_encryption_key \
python3 -m pytest tests/ -v
clean:
rm -rf venv/ __pycache__ .pytest_cache
find . -name '*.pyc' -delete
docker-build:
docker compose build
docker-up:
docker compose up -d
docker-down:
docker compose down
key:
python3 -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())"
user:
TOKEN_ENCRYPTION_KEY_FILE=secrets/token_encryption_key \
python3 -c "
import asyncio
from app.database import init_db, async_session_factory
from app.models import User
from app.security import generate_api_key
async def create():
await init_db()
async with async_session_factory() as session:
key, h = generate_api_key()
u = User(api_key_hash=h, display_name='admin')
session.add(u)
await session.commit()
print(f'User created. API key: {key}')
asyncio.run(create())
"