-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bec29c4
commit ab3a2b2
Showing
14 changed files
with
147 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,7 @@ LABEL maintainer="[email protected]" | |
|
||
ENV TZ="Etc/UTC" \ | ||
DEBIAN_FRONTEND="noninteractive" \ | ||
DEBIAN_PACKAGES="bash git python3-pip python3-setuptools" | ||
DEBIAN_PACKAGES="bash curl git python3-pip python3-setuptools vim" | ||
|
||
# copy the app | ||
COPY . /app | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
############################################################################### | ||
# | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
# | ||
############################################################################### | ||
|
||
FROM eclipse-mosquitto:latest | ||
|
||
COPY mosquitto.conf /mosquitto/config/mosquitto.conf | ||
COPY acl.conf /mosquitto/config/acl.conf | ||
COPY entrypoint.sh /docker-entrypoint.sh | ||
|
||
RUN chmod +x /docker-entrypoint.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
user everyone | ||
topic read gdc-reports/# | ||
|
||
user _USERNAME | ||
topic readwrite # | ||
topic read $SYS/# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/sh | ||
|
||
USERNAME=`echo $WIS2_GDC_BROKER_URL |awk -F/ '{print $3}' | awk -F@ '{print $1}' | awk -F: '{print $1}'` | ||
PASSWORD=`echo $WIS2_GDC_BROKER_URL |awk -F/ '{print $3}' | awk -F@ '{print $1}' | awk -F: '{print $2}'` | ||
|
||
echo "Setting mosquitto authentication" | ||
|
||
echo "USERNAME: $USERNAME" | ||
echo "PASSWORD: $PASSWORD" | ||
|
||
if [ ! -e "/mosquitto/config/password.txt" ]; then | ||
echo "Adding wis2-gc users to mosquitto password file" | ||
mosquitto_passwd -b -c /mosquitto/config/password.txt $USERNAME $PASSWORD | ||
mosquitto_passwd -b /mosquitto/config/password.txt everyone everyone | ||
chmod 644 /mosquitto/config/password.txt | ||
else | ||
echo "Mosquitto password file already exists. Skipping wis2box user addition." | ||
fi | ||
|
||
|
||
sed -i "s#_USERNAME#$USERNAME#" /mosquitto/config/acl.conf | ||
|
||
/usr/sbin/mosquitto -c /mosquitto/config/mosquitto.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
persistence true | ||
persistence_location /mosquitto/data/ | ||
log_dest file /mosquitto/log/mosquitto.log | ||
log_dest stdout | ||
log_timestamp_format %Y-%m-%dT%H:%M:%S | ||
password_file /mosquitto/config/password.txt | ||
max_queued_messages 1000 | ||
|
||
# ACLs | ||
acl_file /mosquitto/config/acl.conf | ||
|
||
## MQTT Listener | ||
listener 1883 | ||
protocol mqtt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
export WIS2_GDC_API_URL=http://localhost | ||
export WIS2_GDC_BACKEND_TYPE=Elasticsearch | ||
export WIS2_GDC_BACKEND_CONNECTION=http://elasticsearch:9200/wis2-discovery-metadata | ||
export WIS2_GDC_GB=mqtt://everyone:everyone@localhost:1883 | ||
export WIS2_GDC_BROKER_URL=mqtt://wis2-gdc:wis2-gdc@mosquitto:1883 | ||
export WIS2_GDC_GB=mqtts://everyone:[email protected]:8883 | ||
export WIS2_GDC_GB_TOPIC=origin/a/wis2/+/+/metadata/# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
export WIS2_GDC_API_URL=http://localhost | ||
export WIS2_GDC_BACKEND_TYPE=Elasticsearch | ||
export WIS2_GDC_BACKEND_CONNECTION=http://localhost:9200/wis2-discovery-metadata | ||
export WIS2_GDC_BROKER_URL=mqtt://wis2-gdc:wis2-gdc@localhost:1883 | ||
export WIS2_GDC_GB=mqtt://everyone:everyone@localhost:1883 | ||
export WIS2_GDC_GB_TOPIC=origin/a/wis2/+/+/metadata/# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters