Skip to content

Commit fb07bda

Browse files
committed
update dockerfile
1 parent 3428c8b commit fb07bda

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

Dockerfile

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,16 @@ ARG HTTPPROTOCOL=http
2828
ENV PROTOCOL=$HTTPPROTOCOL
2929
RUN echo "the HTTP/S protocol is set to $PROTOCOL"
3030

31+
ARG HTTPBASICAUTH=True
32+
ENV BASICAUTH=$HTTPBASICAUTH
33+
RUN echo "the HTTP/S basic authentication is set to $BASICAUTH"
34+
35+
ARG AUTHUSER=None
36+
ENV BASICAUTHUSER=$AUTHUSER
37+
38+
ARG AUTHPASSW=NotSet
39+
ENV BASICAUTHPASSW=$AUTHPASSW
40+
3141
ARG HTTPPORT=None
3242
ENV PORT=$HTTPPORT
3343
RUN echo "the OpentTSDB API HTTP/S port is set to $PORT"
@@ -129,7 +139,7 @@ RUN chown -R $UID:$GID /opt/IBM/bridge && \
129139
# Switch user
130140
USER $GID
131141

132-
CMD ["sh", "-c", "python3 zimonGrafanaIntf.py -c 10 -s $SERVER -r $PROTOCOL -p $PORT -e $PROMETHEUS -P $SERVERPORT -t $TLSKEYPATH -l $LOGPATH --tlsKeyFile $TLSKEYFILE --tlsCertFile $TLSCERTFILE --apiKeyName $APIKEYNAME --apiKeyValue $APIKEYVALUE"]
142+
CMD ["sh", "-c", "python3 zimonGrafanaIntf.py -c 10 -s $SERVER -r $PROTOCOL -b $BASICAUTH -u $BASICAUTHUSER -a BASICAUTHPASSW -p $PORT -e $PROMETHEUS -P $SERVERPORT -t $TLSKEYPATH -l $LOGPATH -k $TLSKEYFILE -m $TLSCERTFILE -n $APIKEYNAME -v $APIKEYVALUE"]
133143

134144
EXPOSE 4242 8443 9250
135145

source/confParser.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,8 @@ def parse_cmd_args(argv):
234234
help='port number listening on OpenTSDB API HTTP(S) connections (Default from config.ini: 4242, if enabled)')
235235
parser.add_argument('-r', '--protocol', action="store", choices=["http", "https"], default=None,
236236
help='Connection protocol HTTP/HTTPS (Default from config.ini: "http")')
237+
parser.add_argument('-b', '--enabled', action="store", choices=["True", "False"], default=None,
238+
help='Controls if HTTP/S basic authentication should be enabled or not (Default from config.ini: "True")')
237239
parser.add_argument('-u', '--username', action="store", default=None,
238240
help='HTTP/S basic authentication user name(Default from config.ini: \'scale_admin\')')
239241
parser.add_argument('-a', '--password', action=Password, nargs='?', dest='password', default=None,

tests/test_parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def test_case02():
1313

1414

1515
def test_case03():
16-
result = os.system('python ./source/zimonGrafanaIntf.py -b')
16+
result = os.system('python ./source/zimonGrafanaIntf.py -w')
1717
assert result > 0
1818

1919

0 commit comments

Comments
 (0)