diff --git a/mosquitto/README.md b/mosquitto/README.md index e6744b6..9a4da5d 100644 --- a/mosquitto/README.md +++ b/mosquitto/README.md @@ -50,8 +50,9 @@ $ touch data/mosquitto.conf data/pwfile $ docker-compose up -d $ docker-compose exec mosquitto sh >>> cd /etc/mosquitto ->>> echo username:password >> data/pwfile ->>> mosquitto_passwd -U passwd +>>> mosquitto_passwd -b pwfile username password +>>> cat pwfile +username:$6$IuF7JUzS1k/QoF3y$YpiClom7/== >>> exit $ docker-compose restart $ docker-compose logs -f diff --git a/mosquitto/arm/data/mosquitto.conf b/mosquitto/arm/data/mosquitto.conf new file mode 100644 index 0000000..24b117a --- /dev/null +++ b/mosquitto/arm/data/mosquitto.conf @@ -0,0 +1,14 @@ +listener 8080 +protocol websockets +log_dest stdout +allow_anonymous false +password_file /etc/mosquitto/pwfile +persistence true +persistence_location /var/lib/mosquitto + +###### ENABLE TLS ###### +#port 8883 +#cafile /var/lib/mosquitto/ca.crt +#certfile /var/lib/mosquitto/server.crt +#keyfile /var/lib/mosquitto/server.key +#require_certificate false diff --git a/mosquitto/data/passwd b/mosquitto/arm/data/pwfile similarity index 100% rename from mosquitto/data/passwd rename to mosquitto/arm/data/pwfile diff --git a/mosquitto/arm/docker-compose.yml b/mosquitto/arm/docker-compose.yml index 976a1ec..ffee206 100644 --- a/mosquitto/arm/docker-compose.yml +++ b/mosquitto/arm/docker-compose.yml @@ -2,4 +2,10 @@ mosquitto: image: easypi/mosquitto-arm ports: - "1883:1883" + - "8080:8080" + - "8883:8883" + volumes: + - ./data/mosquitto.conf:/etc/mosquitto/mosquitto.conf + - ./data/pwfile:/etc/mosquitto/pwfile + - ./data:/var/lib/mosquitto restart: always diff --git a/mosquitto/data/pwfile b/mosquitto/data/pwfile new file mode 100644 index 0000000..e69de29 diff --git a/mosquitto/docker-compose.yml b/mosquitto/docker-compose.yml index 950429c..38a1129 100644 --- a/mosquitto/docker-compose.yml +++ b/mosquitto/docker-compose.yml @@ -6,5 +6,6 @@ mosquitto: - "8883:8883" volumes: - ./data/mosquitto.conf:/etc/mosquitto/mosquitto.conf + - ./data/pwfile:/etc/mosquitto/pwfile - ./data:/var/lib/mosquitto restart: always diff --git a/nginx/arm/docker-compose.yml b/nginx/arm/docker-compose.yml index 8382371..eb1272e 100644 --- a/nginx/arm/docker-compose.yml +++ b/nginx/arm/docker-compose.yml @@ -1,8 +1,7 @@ nginx: image: easypi/nginx-arm - ports: - - "80:80" volumes: - - ./nginx/nginx.conf:/etc/nginx/nginx.conf - - ./html:/usr/share/nginx/html + - ./data/default.conf:/etc/nginx/conf.d/default.conf + - ./data/ssl:/etc/nginx/ssl + net: host restart: always