Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

Proxy autoconfig #1099

Merged
merged 1 commit into from
Jul 16, 2015
Merged

Proxy autoconfig #1099

merged 1 commit into from
Jul 16, 2015

Conversation

paulbellamy
Copy link
Contributor

Use the docker daemon's -H flags as the proxy's default.

No support for auto-configuring TLS. For that we would have to do the procfs and flag parsing in the weave script (so that we could mount the certs into the proxy container).

This is possibly a bit linux-specific, as the layout of procfs is not standardized.

Fixes #1055

@rade rade removed their assignment Jul 7, 2015
@paulbellamy
Copy link
Contributor Author

per f2f discussion w/ @rade:

let's add TLS support via a binary where the weave script can do:

if [ -x $SOME_BINARY ]; then
  PROXY_VOLUMES=$($SOME_BINARY)
fi

This way, --local will work, but not support TLS autoconfiguration.

@rade
Copy link
Member

rade commented Jul 8, 2015

command_exists $SOME_BINARY && $($SOME_BINARY) || true

@paulbellamy paulbellamy force-pushed the 1055-proxy-autoconfig branch 2 times, most recently from 968bc87 to d72c05c Compare July 13, 2015 13:21
if command_exists proxyvolumes ; then
PROXY_VOLUMES=${PROXY_VOLUMES:-$(proxyvolumes "$@")}
fi
}

This comment was marked as abuse.

This comment was marked as abuse.

--tlscacert $PWD/tls/ca.pem \
--tlscert $PWD/tls/$HOST1.pem \
--tlskey $PWD/tls/$HOST1-key.pem \
2>&1 >/dev/null

This comment was marked as abuse.

This comment was marked as abuse.

This comment was marked as abuse.

@paulbellamy
Copy link
Contributor Author

doesn't work with systemd as docker launches with: -H fd://

@paulbellamy
Copy link
Contributor Author

per f2f discussion w/ @rade:

Configuring based on the daemon is a bit of a hack, so let's configure where to listen based on the client.
The three cases are:

  1. They connect via unix socket. We should listen on unix:///var/run/weave.sock
  2. They connect via plain TCP. We should listen on tcp://0.0.0.0:12375
  3. They connect via TLS. We should throw an error telling them to configure the proxy manually.

@paulbellamy paulbellamy force-pushed the 1055-proxy-autoconfig branch 2 times, most recently from 70aa01d to f9e8bef Compare July 15, 2015 15:23
@paulbellamy paulbellamy assigned rade and unassigned paulbellamy Jul 15, 2015

host1$ weave launch-proxy -H tcp://127.0.0.1:9999

Multiple -H arguments can be specified. If you are working with a remote
docker daemon, then any firewalls inbetween need to be configured to permit
If you are connecting via TLS, you will need to specify `-H`. Multiple

This comment was marked as abuse.

@rade rade assigned paulbellamy and unassigned rade Jul 15, 2015
}

if clientTLSEnabled && !(c.TLSConfig.Enabled || c.TLSConfig.Verify) {
log.Fatalln("Cannot autoconfigure the proxy when using TLS. Please specify -H")

This comment was marked as abuse.

}

if clientTLSEnabled && !(c.TLSConfig.Enabled || c.TLSConfig.Verify) {
log.Fatalln("Cannot autoconfigure proxy listen address when launching via TLS")

This comment was marked as abuse.


if [ -z "$PROXY_HOST" ]; then
if [ -n "$CLIENT_TLS_ENABLED" -a -z "$PROXY_TLS_ENABLED" ]; then
echo "When launching proxy via TLS, -H and/or TLS options are required." >&2

This comment was marked as abuse.

This comment was marked as abuse.

@rade
Copy link
Member

rade commented Jul 16, 2015

rest LGTM

@rade rade assigned paulbellamy and unassigned rade Jul 16, 2015
paulbellamy added a commit that referenced this pull request Jul 16, 2015
@paulbellamy paulbellamy merged commit 0865f4c into master Jul 16, 2015
@paulbellamy paulbellamy deleted the 1055-proxy-autoconfig branch July 16, 2015 12:33
@rade rade modified the milestone: 1.1.0 Jul 21, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants