-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathpgconsole.example.toml
More file actions
266 lines (250 loc) · 8.9 KB
/
Copy pathpgconsole.example.toml
File metadata and controls
266 lines (250 loc) · 8.9 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
# pgconsole.toml - Database connections configuration
# Copy this file to pgconsole.toml and update with your connections
# =============================================================================
# General settings
# =============================================================================
# [general]
# external_url = "https://pgconsole.example.com" # Required when OAuth providers are enabled
#
# # Banner (optional) - displays at the top of the page, cannot be dismissed
# [general.banner]
# text = "System maintenance scheduled for Sunday 2am UTC"
# link = "https://status.example.com" # Optional - makes entire banner clickable (opens in new tab)
# color = "#7c3aed" # Optional
# =============================================================================
# Audit log settings
# =============================================================================
# Audit entries are retained in memory for the /audit-log page. By default they
# are retained indefinitely until server restart. Set retention_days to prune
# entries older than the configured number of days.
#
# [general.audit]
# retention_days = 30
# =============================================================================
# Branding
# =============================================================================
# Replace the pgconsole logo with your own.
#
# [branding]
# logo = "https://example.com/your-logo.svg"
# logo_link = "https://internal.example.com" # Optional - where the logo links to (default: /)
# =============================================================================
# AI providers for Text-to-SQL (optional)
# =============================================================================
# Supported vendors: openai, anthropic, google, openai-compatible
#
# [[ai.providers]]
# id = "gpt4"
# name = "GPT-4o"
# vendor = "openai"
# model = "gpt-4o"
# api_key = "sk-..."
#
# # openai-compatible: any provider implementing the OpenAI API
# # (Groq, OpenRouter, Together, Ollama, vLLM, LiteLLM, ...). base_url is required.
# [[ai.providers]]
# id = "groq"
# name = "Llama 3.3 70B"
# vendor = "openai-compatible"
# model = "llama-3.3-70b-versatile"
# api_key = "gsk_..."
# base_url = "https://api.groq.com/openai/v1"
#
# # api_key may be omitted for local providers that run without authentication
# [[ai.providers]]
# id = "ollama"
# name = "Ollama (local)"
# vendor = "openai-compatible"
# model = "llama3.3"
# base_url = "http://localhost:11434/v1"
#
# [[ai.providers]]
# id = "claude"
# name = "Claude Sonnet"
# vendor = "anthropic"
# model = "claude-sonnet-4-20250514"
# api_key = "sk-ant-..."
#
# [[ai.providers]]
# id = "gemini"
# name = "Gemini Pro"
# vendor = "google"
# model = "gemini-1.5-pro"
# api_key = "AIza..."
# =============================================================================
# Labels for organizing connections
# =============================================================================
[[labels]]
id = "dev"
name = "Development"
color = "#3b82f6" # blue
[[labels]]
id = "staging"
name = "Staging"
color = "#f59e0b" # amber
[[labels]]
id = "prod"
name = "Production"
color = "#ef4444" # red
[[labels]]
id = "critical"
name = "Critical"
color = "#dc2626" # dark red
# =============================================================================
# Connections
# =============================================================================
[[connections]]
id = "local"
name = "Local Development"
host = "localhost"
port = 5432
database = "postgres"
username = "postgres"
password = "postgres"
labels = ["dev"]
[[connections]]
id = "staging"
name = "Staging"
host = "staging.example.com"
port = 5432
database = "myapp"
username = "app_user"
password = "staging_password"
ssl_mode = "require"
labels = ["staging"]
# Example with full SSL configuration and timeouts
# [[connections]]
# id = "production"
# name = "Production"
# host = "prod.example.com"
# port = 5432
# database = "myapp"
# username = "app_user"
# password = "prod_password"
# ssl_mode = "verify-full"
# ssl_ca = "/path/to/ca.crt"
# ssl_cert = "/path/to/client.crt"
# ssl_key = "/path/to/client.key"
# labels = ["prod", "critical"]
# lock_timeout = "5s" # Optional - abort if lock not acquired within duration
# statement_timeout = "30s" # Optional - abort queries exceeding duration
# lazy = true # Optional - skip connection test on startup
# =============================================================================
# Authentication (optional - if omitted, no authentication is required)
# =============================================================================
# [auth]
# jwt_secret = "your-secret-key-at-least-32-characters-long" # openssl rand -hex 32
# signin_expiry = "7d" # session duration: h=hours, d=days, w=weeks (default: 7d)
#
# # OAuth providers (optional)
# [[auth.providers]]
# type = "google"
# client_id = "your-google-client-id.apps.googleusercontent.com"
# client_secret = "your-google-client-secret"
#
# [[auth.providers]]
# type = "keycloak"
# issuer_url = "https://keycloak.example.com/realms/myrealm"
# client_id = "pgconsole"
# client_secret = "your-keycloak-client-secret"
#
# [[auth.providers]]
# type = "okta"
# issuer_url = "https://your-org.okta.com/oauth2/default"
# client_id = "your-okta-client-id"
# client_secret = "your-okta-client-secret"
#
# =============================================================================
# Users (required when auth is enabled)
# =============================================================================
# Each user needs an email. Password present = basic auth login.
# No password = SSO-only (must match an OAuth provider login).
#
# [[users]]
# email = "admin@example.com"
# password = "admin123"
#
# [[users]]
# email = "developer@example.com"
# password = "dev456"
#
# [[users]]
# email = "alice@example.com" # SSO-only user (no password)
#
# User groups (optional)
# Members are user emails
# [[groups]]
# id = "dev-team"
# name = "Development Team"
# members = ["developer@example.com", "alice@example.com"]
#
# [[groups]]
# id = "dba"
# name = "Database Administrators"
# members = ["admin@example.com"]
# =============================================================================
# Agents (optional) - non-human principals for the MCP server
# =============================================================================
# Each agent authenticates to the MCP endpoint (/mcp) with a bearer token:
# Authorization: Bearer <token>
# An agent is one of two kinds:
#
# 1. Pure agent (no on_behalf_of) - a standalone service account.
# Authorized by [[iam]] rules whose members include "agent:<id>".
# Do NOT set permissions/connections here; grant access via [[iam]] instead.
#
# 2. Delegated agent (on_behalf_of set) - acts for a user, inheriting that
# user's permissions. The optional permissions/connections fields are caps
# that further narrow (intersect with) the user's grant.
#
# Fields: id (required), token (required), name (optional, defaults to id),
# on_behalf_of (user email), permissions (delegated only), connections (delegated only)
#
# # Pure agent - authorize it with an [[iam]] rule using member "agent:<id>" (see below)
# [[agents]]
# id = "ci-bot"
# name = "CI Pipeline"
# token = "generate-a-long-random-secret" # openssl rand -hex 32
#
# # Delegated agent - acts as alice, capped to read-only on the local connection
# [[agents]]
# id = "alice-assistant"
# name = "Alice's Assistant"
# token = "another-long-random-secret"
# on_behalf_of = "alice@example.com" # must match a [[users]] email
# permissions = ["read"] # cap: intersected with alice's IAM grant
# connections = ["local"] # cap: connection IDs the agent may touch
# =============================================================================
# IAM Rules (optional - requires auth to be enabled)
# =============================================================================
# Controls what users can do on each connection
# Permissions: read (SELECT), write (INSERT/UPDATE/DELETE), ddl (CREATE/ALTER/DROP),
# admin (full access), explain (EXPLAIN), execute (CALL), export (CSV export)
# Use "*" to grant all permissions at once
# Members: "user:<email>", "group:<id>", "agent:<id>", or "*" (all human users; a pure
# agent matches only explicit "agent:<id>" rules, never "*"/"user:"/"group:",
# while a delegated agent inherits its user's matches)
# Connection: specific connection id or "*" for all connections
# Multiple matching rules are unioned (user gets all permissions from all matching rules)
# Default deny: no matching rule = no access (connection hidden from user)
#
# [[iam]]
# connection = "*"
# permissions = ["read"]
# members = ["*"]
#
# [[iam]]
# connection = "local"
# permissions = ["*"]
# members = ["user:admin@example.com", "group:dba"]
#
# [[iam]]
# connection = "staging"
# permissions = ["read", "write"]
# members = ["group:dev-team"]
#
# # Authorize a pure agent (see the Agents section above)
# [[iam]]
# connection = "staging"
# permissions = ["read", "ddl"]
# members = ["agent:ci-bot"]