diff --git a/site/features.md b/site/features.md index c4c4a3e7..b818e732 100644 --- a/site/features.md +++ b/site/features.md @@ -131,23 +131,23 @@ sharing it between applications: ### Security In order to connect containers across untrusted networks, weave peers -can be told to encrypt traffic by supplying a `-password` or -`-passwordfile` option when launching weave, e.g. +can be told to encrypt traffic by supplying a `-password` option or +`WEAVE_PASSWORD` environment variable when launching weave, e.g. host1# weave launch -password wEaVe or - host1# weave launch -passwordfile /path/to/file + host1# export WEAVE_PASSWORD=wEaVe + host1# weave launch -where the file must contain a single line like this: - - WEAVE_PASSWORD=wEaVe +_NOTE: The command line option takes precedence over the environment +variable._ The same password must be specified for all weave peers; it is a component in the creation of ephemeral session keys for connections -between peers. See the -[crypto documentation](how-it-works.html#crypto) for more details. +between peers. See the [crypto documentation](how-it-works.html#crypto) +for more details. ### Host network integration diff --git a/weave b/weave index 7eee3689..887a0c42 100755 --- a/weave +++ b/weave @@ -6,7 +6,7 @@ SCRIPT_VERSION="(unreleased version)" usage() { echo "Usage:" echo "weave setup" - echo "weave launch [-password | -passwordfile ] ..." + echo "weave launch [-password ] ..." echo "weave launch-dns " echo "weave connect " echo "weave run [--with-dns] ..." @@ -471,19 +471,15 @@ case "$COMMAND" in fi if [ "$1" = "-password" ] ; then [ $# -gt 1 ] || usage - PASSWORD_ARGS="-e WEAVE_PASSWORD=$2" - shift 2 - elif [ "$1" = "-passwordfile" ] ; then - [ $# -gt 1 ] || usage - PASSWORD_ARGS="--env-file=$2" + WEAVE_PASSWORD="$2" + export WEAVE_PASSWORD shift 2 fi # Set WEAVE_DOCKER_ARGS in the environment in order to supply # additional parameters, such as resource limits, to docker # when launching the weave container. CONTAINER=$(docker run --privileged -d --name=$CONTAINER_NAME \ - -p $PORT:$PORT/tcp -p $PORT:$PORT/udp \ - ${PASSWORD_ARGS:-"-e WEAVE_PASSWORD"} \ + -p $PORT:$PORT/tcp -p $PORT:$PORT/udp -e WEAVE_PASSWORD \ $WEAVE_DOCKER_ARGS $IMAGE -name $MACADDR -iface $CONTAINER_IFNAME "$@") with_container_netns $CONTAINER launch >/dev/null echo $CONTAINER