Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PEP458: Add minimal RSTUF service configuration #15241

Merged
merged 5 commits into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ initdb: .state/docker-build-base
docker compose run --rm web psql -h db -d postgres -U postgres -c "SELECT pg_terminate_backend(pid) FROM pg_stat_activity WHERE datname ='warehouse';"
docker compose run --rm web psql -h db -d postgres -U postgres -c "DROP DATABASE IF EXISTS warehouse"
docker compose run --rm web psql -h db -d postgres -U postgres -c "CREATE DATABASE warehouse ENCODING 'UTF8'"
docker compose run --rm web psql -h db -d postgres -U postgres -c "DROP DATABASE IF EXISTS rstuf"
docker compose run --rm web psql -h db -d postgres -U postgres -c "CREATE DATABASE rstuf ENCODING 'UTF8'"
docker compose run --rm web bash -c "xz -d -f -k dev/$(DB).sql.xz --stdout | psql -h db -d warehouse -U postgres -v ON_ERROR_STOP=1 -1 -f -"
docker compose run --rm web psql -h db -d warehouse -U postgres -c "UPDATE users SET name='Ee Durbin' WHERE username='ewdurbin'"
$(MAKE) runmigrations
Expand Down
3 changes: 0 additions & 3 deletions dev/environment
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,6 @@ TOKEN_REMEMBER_DEVICE_SECRET="an insecure remember device auth secret key"

WAREHOUSE_LEGACY_DOMAIN=pypi.python.org

VAULT_URL="http://vault:8200"
VAULT_TOKEN="an insecure vault access token"

GITHUB_TOKEN_SCANNING_META_API_URL="http://notgithub:8000/meta/public_keys/token_scanning"
TWOFACTORREQUIREMENT_ENABLED=true
TWOFACTORMANDATE_AVAILABLE=true
Expand Down
3 changes: 0 additions & 3 deletions dev/vault/config.hcl

This file was deleted.

52 changes: 0 additions & 52 deletions dev/vault/entry.sh

This file was deleted.

46 changes: 27 additions & 19 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,10 @@ volumes:
packages-archive:
sponsorlogos:
policies:
vault:
caches:
rstuf-metadata:

services:
vault:
# NOTE: pinned for consistency with whats available in our deployment
image: vault:1.12.3
restart: on-failure
entrypoint: /bin/sh
command: /etc/vault/entry.sh
stop_signal: SIGINT
kairoaraujo marked this conversation as resolved.
Show resolved Hide resolved
environment:
VAULT_DEV_LISTEN_ADDRESS: 0.0.0.0:8200
VAULT_DEV_ROOT_TOKEN_ID: "an insecure vault access token"
ports:
- "8200:8200"
cap_add:
- IPC_LOCK
volumes:
- vault:/vault/file
- ./dev/vault:/etc/vault

db:
image: postgres:14.4
ports:
Expand Down Expand Up @@ -160,6 +142,32 @@ services:
ARCHIVE_FILES_BACKEND: "warehouse.packaging.services.LocalArchiveFileStorage path=/var/opt/warehouse/packages-archive/ url=http://files:9001/packages-archive/{path}"
SIMPLE_BACKEND: "warehouse.packaging.services.LocalSimpleStorage path=/var/opt/warehouse/simple/ url=http://files:9001/simple/{path}"

rstuf-api:
image: ghcr.io/repository-service-tuf/repository-service-tuf-api:v0.9.0b1
ewdurbin marked this conversation as resolved.
Show resolved Hide resolved
ports:
- 8001:80
environment:
- RSTUF_BROKER_SERVER=redis://redis/1
- RSTUF_REDIS_SERVER=redis://redis
- RSTUF_REDIS_SERVER_DB_RESULT=1
- RSTUF_REDIS_SERVER_DB_REPO_SETTINGS=2

rstuf-worker:
image: ghcr.io/repository-service-tuf/repository-service-tuf-worker:v0.11.0b1
volumes:
- rstuf-metadata:/var/opt/repository-service-tuf/storage
environment:
- RSTUF_STORAGE_BACKEND=LocalStorage
- RSTUF_LOCAL_STORAGE_BACKEND_PATH=/var/opt/repository-service-tuf/storage
- RSTUF_BROKER_SERVER=redis://redis/1
- RSTUF_REDIS_SERVER=redis://redis
- RSTUF_REDIS_SERVER_DB_RESULT=1
- RSTUF_REDIS_SERVER_DB_REPO_SETTINGS=2
- RSTUF_SQL_SERVER=postgresql://postgres@db:5432/rstuf
depends_on:
db:
condition: service_healthy

static:
build:
context: .
Expand Down