Skip to content

feat(cli): add --compartment flag for private conduit pairing#17

Merged
ssmirr merged 1 commit intomasterfrom
compartmentid
Feb 14, 2026
Merged

feat(cli): add --compartment flag for private conduit pairing#17
ssmirr merged 1 commit intomasterfrom
compartmentid

Conversation

@ssmirr
Copy link
Owner

@ssmirr ssmirr commented Feb 14, 2026

Add a --compartment cli flag that accepts a human-readable name and derives a personal compartment ID from it. Both the conduit proxy and connecting clients must use the same compartment name to be matched by the Psiphon broker.

The flag value is converted to a 32-byte compartment ID using SHA-256, then base64-encoded (without padding) to match the format expected by tunnel-core's InproxyProxyPersonalCompartmentID config field.

Usage:
conduit start --compartment yourcompartmentname

Without the flag, the conduit operates as a public proxy available to all clients. With the flag, only clients configured with the same compartment name will be paired with this conduit.

Changes:

  • cmd/start.go: add --compartment string flag
  • internal/config/config.go: add Compartment option, CompartmentID config field, and SHA-256 derivation in LoadOrCreate()
  • internal/conduit/service.go: set InproxyProxyPersonalCompartmentID in psiphon config, log 'Personal compartment: enabled' at startup

Add a --compartment flag that accepts a human-readable name (e.g.,
'shirokhorshid') and derives a personal compartment ID from it. Both
the conduit proxy and connecting clients must use the same compartment
name to be matched by the Psiphon broker.

The flag value is converted to a 32-byte compartment ID using SHA-256,
then base64-encoded (without padding) to match the format expected by
tunnel-core's InproxyProxyPersonalCompartmentID config field.

Usage:
  conduit start --compartment shirokhorshid

Without the flag, the conduit operates as a public proxy available to
all clients. With the flag, only clients configured with the same
compartment name will be paired with this conduit.

Changes:
- cmd/start.go: add --compartment string flag
- internal/config/config.go: add Compartment option, CompartmentID
  config field, and SHA-256 derivation in LoadOrCreate()
- internal/conduit/service.go: set InproxyProxyPersonalCompartmentID
  in psiphon config, log 'Personal compartment: enabled' at startup
@ssmirr ssmirr merged commit 3cab0e9 into master Feb 14, 2026
4 checks passed
@ssmirr ssmirr deleted the compartmentid branch February 14, 2026 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant