forked from faucetsdn/udmi
-
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.
Merge branch 'master' into documentation
- Loading branch information
Showing
35 changed files
with
563 additions
and
153 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
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,31 @@ | ||
#!/bin/bash -eu | ||
|
||
UDMI_ROOT=$(dirname $0)/.. | ||
cd $UDMI_ROOT | ||
|
||
source $UDMI_ROOT/etc/shell_common.sh | ||
|
||
if [[ $# != 1 ]]; then | ||
echo Usage: $0 site_model | ||
false | ||
fi | ||
|
||
site_path=$1 | ||
shift | ||
|
||
source $UDMI_ROOT/etc/mosquitto_ctrl.sh | ||
|
||
site_config=$site_path/cloud_iot_config.json | ||
registry_id=$(jq -r .registry_id $site_config) | ||
|
||
hash_pass=$(sha256sum < $site_path/reflector/rsa_private.pkcs8) | ||
SERV_PASS=${hash_pass:0:8} | ||
SERV_USER=/r/UDMI-REFLECT/d/$registry_id | ||
SERV_ID=$SERV_USER | ||
|
||
$MOSQUITTO_CTRL deleteClient $SERV_USER | ||
$MOSQUITTO_CTRL createClient $SERV_USER -p $SERV_PASS -c $SERV_ID | ||
$MOSQUITTO_CTRL addClientRole $SERV_USER service | ||
|
||
echo Registered sites: | ||
$MOSQUITTO_CTRL listClients | fgrep /r/UDMI-REFLECT/d/ |
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 |
---|---|---|
|
@@ -82,6 +82,7 @@ fi | |
# Format of cmdline project_id is {//PROVIDER/}PROJECT[@BROKER] (optional PROVIDER and BROKER) | ||
# e.g. bos-testing-dev or //gcp/bos-testing-dev or [email protected] | ||
project_target=${project_id##*/} | ||
udmi_prefix= | ||
|
||
if [[ -z $project_id ]]; then | ||
true using config file based configuration | ||
|
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,15 @@ | ||
#!/bin/bash -e | ||
|
||
# https://lucassardois.medium.com/handling-iot-data-with-mqtt-telegraf-influxdb-and-grafana-5a431480217 | ||
|
||
docker run --name influxdb \ | ||
-v $PWD/influxdb-data:/var/lib/influxdb \ | ||
influxdb | ||
|
||
docker run --rm --name telegraf \ | ||
-v $PWD/telegraf.conf:/etc/telegraf/telegraf.conf:ro \ | ||
telegraf | ||
|
||
docker run -d -p 3000:3000 --name grafana \ | ||
-v $PWD/grafana-data:/var/lib/grafana \ | ||
grafana/grafana |
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,5 @@ | ||
#!/bin/bash -e | ||
|
||
rm -f /tmp/pod_ready.txt | ||
|
||
sudo ETCD_CLUSTER=localhost SSL_SECRETS_DIR=/etc/mosquitto/certs udmis/bin/run udmis/etc/local_pod.json |
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,11 @@ | ||
# Common setup for running mosquitto_ctrl | ||
|
||
ETC_DIR=/etc/mosquitto | ||
CERT_DIR=$ETC_DIR/certs | ||
CA_CERT=$CERT_DIR/ca.crt | ||
|
||
AUTH_USER=scrumptious | ||
AUTH_PASS=aardvark | ||
|
||
CTRL_OPTS="-u $AUTH_USER -P $AUTH_PASS --cafile $CA_CERT --cert $CERT_DIR/rsa_private.crt --key $CERT_DIR/rsa_private.pem" | ||
MOSQUITTO_CTRL="sudo mosquitto_ctrl $CTRL_OPTS dynsec" |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -67,6 +67,7 @@ | |
"subType": { | ||
"enum": [ | ||
"invalid", | ||
"reflect", | ||
"events", | ||
"errors", | ||
"commands", | ||
|
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,3 +1,8 @@ | ||
{ | ||
"include": "prod_pod.json" | ||
"include": "prod_pod.json", | ||
"flows": { | ||
"distributor": { | ||
"enabled": "false" | ||
} | ||
} | ||
} |
Oops, something went wrong.