Skip to content

Commit

Permalink
Add support for swarm file based secrets
Browse files Browse the repository at this point in the history
Signed-off-by: Thibault Jamet <tjamet@users.noreply.github.com>
  • Loading branch information
tjamet committed Nov 6, 2017
1 parent c877787 commit 0123d29
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ The following environment variables are supported. You can pass environment vari
|--------------------------|---------------|
|`SUMO_ACCESS_ID` |Passes the Access ID.|
|`SUMO_ACCESS_KEY` |Passes the Access Key.|
|`SUMO_ACCESS_ID_FILE` |Passes a bound file path containing Access ID.|
|`SUMO_ACCESS_KEY_FILE` |Passes a bound file path containing Access Key.|
|`SUMO_CLOBBER` | When true, if there is an existing collector with the same name, that collector will be deleted.<br><br>Default: false|
|`SUMO_COLLECTOR_NAME` |Configures the name of the collector. The default is set dynamically to the value in `/etc/hostname`.|
|`SUMO_COLLECTOR_NAME_PREFIX`|Configures a prefix to the collector name. Useful when overriding `SUMO_COLLECTOR_NAME` with the Docker hostname.<br><br>Default: "collector_container-"<br><br>If you do not want a prefix, set the variable as follows: <br><br>`SUMO_COLLECTOR_NAME_PREFIX = ""`|
Expand Down
13 changes: 12 additions & 1 deletion run.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
#!/bin/bash


if [[ $SUMO_ACCESS_ID_FILE ]]; then
export SUMO_ACCESS_ID=$(cat $SUMO_ACCESS_ID_FILE)
fi

if [[ $SUMO_ACCESS_KEY_FILE ]]; then
export SUMO_ACCESS_KEY=$(cat $SUMO_ACCESS_KEY_FILE)
fi


SUMO_GENERATE_USER_PROPERTIES=${SUMO_GENERATE_USER_PROPERTIES:=true}
SUMO_ACCESS_ID=${SUMO_ACCESS_ID:=$1}
SUMO_ACCESS_KEY=${SUMO_ACCESS_KEY:=$2}
Expand All @@ -11,7 +21,8 @@ SUMO_SYNC_SOURCES=${SUMO_SYNC_SOURCES:=false}
generate_user_properties_file() {
if [ -z "$SUMO_ACCESS_ID" ] || [ -z "$SUMO_ACCESS_KEY" ]; then
echo "FATAL: Please provide credentials, either via the SUMO_ACCESS_ID and SUMO_ACCESS_KEY environment variables,"
echo " or as the first two command line arguments!"
echo " as the first two command line arguments,"
echo " or in files references by SUMO_ACCESS_ID_FILE and SUMO_ACCESS_KEY_FILE!"
exit 1
fi

Expand Down

0 comments on commit 0123d29

Please sign in to comment.