Skip to content
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
3 changes: 3 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ services:
- RUST_BACKTRACE=1
- IRMA_SERVER=http://irma-server:8088
- DATABASE_URL=postgres://devuser:devpassword@postgres:5432/devdb
# allowed-origins is required (no default); dev explicitly opts into
# the wildcard so local cross-origin requests work.
- PKG_ALLOWED_ORIGINS=*
networks:
- pg-network
depends_on:
Expand Down
1 change: 1 addition & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ fi
exec /usr/local/bin/pg-pkg server \
${IRMA_TOKEN:+-t "$IRMA_TOKEN"} \
-i "${IRMA_SERVER:-https://is.yivi.app}" \
${PKG_ALLOWED_ORIGINS:+--allowed-origins "$PKG_ALLOWED_ORIGINS"} \
--ibe-secret-path "$KEYS_DIR/pkg_ibe.sec" \
--ibe-public-path "$KEYS_DIR/pkg_ibe.pub" \
--ibs-secret-path "$KEYS_DIR/pkg_ibs.sec" \
Expand Down
10 changes: 6 additions & 4 deletions pg-pkg/src/opts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,16 @@ pub struct ServerOpts {
pub ibs_public_path: String,

/// Comma-separated list of origins allowed to make cross-origin requests
/// to the PKG. The special value `*` allows any origin (the historical
/// default), but is discouraged for production deployments that handle
/// key material. Example:
/// to the PKG. This option is required and has no default: the server
/// refuses to start unless an allowlist is supplied, so CORS is never
/// silently open to all origins in production. The special value `*`
/// allows any origin, but must be opted into explicitly and is discouraged
/// for deployments that handle key material. Example:
/// `--allowed-origins https://postguard.eu,https://postguard.nl`.
#[clap(
long,
env = "PKG_ALLOWED_ORIGINS",
default_value = "*",
required = true,
Comment thread
dobby-coder[bot] marked this conversation as resolved.
value_delimiter = ','
)]
pub allowed_origins: Vec<String>,
Expand Down
Loading