-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathconfig-database-dev.yaml
More file actions
75 lines (64 loc) · 2.27 KB
/
config-database-dev.yaml
File metadata and controls
75 lines (64 loc) · 2.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# Example configuration for local development with PostgreSQL database
#
# This configuration is optimized for local development with a PostgreSQL database.
# It uses pgpass file for password management and disables SSL for simplicity.
#
# Two-User Security Model:
# This configuration uses two separate database users for security:
# - thv_user: Application user with limited privileges (SELECT, INSERT, UPDATE, DELETE)
# - thv_migrator: Migration user with elevated privileges (CREATE, ALTER, DROP)
#
# Prerequisites:
# 1. PostgreSQL running locally (or via docker-compose)
# 2. Database created: createdb toolhive_registry
# 3. Users created with appropriate privileges
# 4. pgpass file created with credentials for both users
#
# Setup pgpass file (~/.pgpass or set PGPASSFILE env var):
# localhost:5432:toolhive_registry:thv_user:your_app_password
# localhost:5432:toolhive_registry:thv_migrator:your_migration_password
#
# Make sure to set permissions: chmod 600 ~/.pgpass
#
# Usage:
# thv-registry-api serve --config examples/config-database-dev.yaml
#
# Note: Database migrations run automatically when the server starts
# Sources configuration (can have multiple sources)
sources:
- name: toolhive
# Git repository configuration
git:
repository: https://github.com/stacklok/toolhive-catalog.git
branch: main
path: pkg/catalog/toolhive/data/registry-legacy.json
# Per-registry automatic synchronization policy
syncPolicy:
# More frequent syncs for development
interval: "5m"
registries:
- name: default
sources: ["toolhive"]
auth:
mode: anonymous
# PostgreSQL database configuration for development
# Uses two-user security model: separate users for operations and migrations
database:
# Local PostgreSQL instance
host: localhost
port: 5432
# Application user (limited privileges)
# Password provided via pgpass file
user: thv_user
# Migration user (elevated privileges for schema changes)
# Optional: defaults to 'user' if not set
# Password provided via pgpass file
migrationUser: thv_migrator
# Database name
database: toolhive_registry
# Disable SSL for local development (NOT for production!)
sslMode: disable
# Connection pool settings
maxOpenConns: 10
maxIdleConns: 2
connMaxLifetime: "30m"