Compare commits

..

2 Commits

Author SHA1 Message Date
ab9b6fc372 Refactored config location 2020-10-22 20:19:19 +02:00
888ac26781 Refactored... still works 2020-10-22 20:11:57 +02:00
15 changed files with 13 additions and 133 deletions

View File

@ -4,8 +4,6 @@ log_type all
listener 1883
cafile /mosquitto/config/ca.crt
#keyfile /mosquitto/config/mqtt.example.com.key
#certfile /mosquitto/config/mqtt.example.com.crt
require_certificate true
use_identity_as_username true

View File

@ -5,8 +5,9 @@
[mqtt]
#Topic is required
BrokerHost=broker
BrokerPort=8883
BrokerPort=1883
Topic=torch/+/wake
RequireCertificate=False
CaFile=ca.crt
KeyFile=subscriber.key
CertFile=subscriber.crt
@ -17,4 +18,4 @@ Filename=torch_clients.json
[web]
#Port is optional and defaults to 8080
Port=3434
Port=8080

View File

@ -7,15 +7,15 @@ services:
context: ./tor
args:
- SVC_PORT=1883
- SVC_HOST=mqtt.example.com
- SVC_HOST=broker
networks:
- tor_net
mqtt.example.com:
broker:
image: eclipse-mosquitto
volumes:
- broker_data:/mosquitto/data
- ./broker-config:/mosquitto/config
- ./config:/mosquitto/config:ro
ports:
- "1883:1883"
- "8883:8883"
@ -26,16 +26,16 @@ services:
subscriber:
build: './subscriber'
volumes:
- sub_data:/data
- ./sub-config:/etc/torch
- client_data:/data
- ./config:/etc/torch:ro
ports:
- "9999:3434"
- "7700:8080"
networks:
- broker_net
volumes:
broker_data:
sub_data:
client_data:
networks:
tor_net:

View File

@ -1,23 +0,0 @@
-----BEGIN CERTIFICATE-----
MIID6zCCAtOgAwIBAgIUQJye5MbZVMpOpu87TmmlN/KOBj0wDQYJKoZIhvcNAQEL
BQAwgYQxCzAJBgNVBAYTAlVTMQswCQYDVQQIDAJOWTERMA8GA1UEBwwITmV3IFlv
cmsxFTATBgNVBAoMDEV4YW1wbGUgSW5jLjEcMBoGA1UEAwwTY2EubXF0dC5leGFt
cGxlLmNvbTEgMB4GCSqGSIb3DQEJARYRYWRtaW5AZXhhbXBsZS5jb20wHhcNMjAx
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QBD6XIQamv91Ne2bT89LHpcp1LjbaCz+UAxg=
-----END CERTIFICATE-----

View File

@ -1,21 +0,0 @@
##############################################################################
# Sample torch-sub.conf file
##############################################################################
[mqtt]
#Topic is required
BrokerHost=mqtt.example.com
BrokerPort=8883
Topic=torch/+/wake
RequireCertificate=True
CaFile=ca.crt
KeyFile=subscriber.key
CertFile=subscriber.crt
[database]
#Filename is optional and defaults to 'clients.json'
Filename=torch_clients.json
[web]
#Port is optional and defaults to 8080
Port=3434

View File

@ -1,16 +1,13 @@
FROM python:3
#WORKDIR /usr/src
#RUN git clone https://git.rudefox.io/bj/torch-subscriber-simple.git
ADD torch-subscriber-simple /usr/src/torch-sub
WORKDIR /usr/src/torch-sub
WORKDIR /usr/src
RUN git clone https://git.rudefox.io/bj/torch-subscriber-simple.git
WORKDIR /usr/src/torch-subscriber-simple
RUN pip3 install --no-cache-dir -r requirements.txt && \
python3 setup.py install
WORKDIR /data
EXPOSE 8080
VOLUME [ "/etc/torch", "/data" ]
ENTRYPOINT [ "torch-sub" ]

@ -1 +0,0 @@
Subproject commit 1eee40a30e88c070f54d456546b1daeaf7da0479

View File

@ -1,23 +0,0 @@
-----BEGIN CERTIFICATE-----
MIID6zCCAtOgAwIBAgIUQJye5MbZVMpOpu87TmmlN/KOBj0wDQYJKoZIhvcNAQEL
BQAwgYQxCzAJBgNVBAYTAlVTMQswCQYDVQQIDAJOWTERMA8GA1UEBwwITmV3IFlv
cmsxFTATBgNVBAoMDEV4YW1wbGUgSW5jLjEcMBoGA1UEAwwTY2EubXF0dC5leGFt
cGxlLmNvbTEgMB4GCSqGSIb3DQEJARYRYWRtaW5AZXhhbXBsZS5jb20wHhcNMjAx
MDA2MTA1OTE4WhcNMzAxMDA0MTA1OTE4WjCBhDELMAkGA1UEBhMCVVMxCzAJBgNV
BAgMAk5ZMREwDwYDVQQHDAhOZXcgWW9yazEVMBMGA1UECgwMRXhhbXBsZSBJbmMu
MRwwGgYDVQQDDBNjYS5tcXR0LmV4Y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