diff --git a/docker-compose-things-local.yml b/docker-compose-things-local.yml index 374365b..883b47b 100644 --- a/docker-compose-things-local.yml +++ b/docker-compose-things-local.yml @@ -29,6 +29,10 @@ services: dockerfile: ./http/express/Dockerfile-simple labels: - traefik.http.routers.http-express-calculator-simple.rule=PathPrefix(`/http-express-calculator-simple`) + - traefik.http.routers.http-express-calculator-simple.entrypoints=web + - traefik.http.routers.http-express-calculator-simple-secure.rule=PathPrefix(`/http-express-calculator-simple`) + - traefik.http.routers.http-express-calculator-simple-secure.entrypoints=websecure + - traefik.http.routers.http-express-calculator-simple-secure.tls=true - traefik.http.services.http-express-calculator-simple.loadbalancer.server.port=${WEB_PORT_OUT} environment: - HOSTNAME=${STACK_HOSTNAME} @@ -104,8 +108,12 @@ services: context: . dockerfile: ./things/advanced-coffee-machine/http/ts/Dockerfile labels: - - traefik.http.routers.http-advanced-coffee-machine.rule=PathPrefix(`/http-advanced-coffee-machine`) - - traefik.http.services.http-advanced-coffee-machine.loadbalancer.server.port=${WEB_PORT_OUT} + - traefik.http.routers.http-advanced-coffee-machine.rule=PathPrefix(`/http-advanced-coffee-machine`) + - traefik.http.routers.http-advanced-coffee-machine.entrypoints=web + - traefik.http.routers.http-advanced-coffee-machine-secure.rule=PathPrefix(`/http-advanced-coffee-machine`) + - traefik.http.routers.http-advanced-coffee-machine-secure.entrypoints=websecure + - traefik.http.routers.http-advanced-coffee-machine-secure.tls=true + - traefik.http.services.http-advanced-coffee-machine.loadbalancer.server.port=${WEB_PORT_OUT} environment: - HOSTNAME=${STACK_HOSTNAME} - PORT=${WEB_PORT_OUT} @@ -118,6 +126,10 @@ services: dockerfile: ./http/ts/Dockerfile labels: - traefik.http.routers.http-data-schema-thing.rule=PathPrefix(`/http-data-schema-thing`) + - traefik.http.routers.http-data-schema-thing.entrypoints=web + - traefik.http.routers.http-data-schema-thing-secure.rule=PathPrefix(`/http-data-schema-thing`) + - traefik.http.routers.http-data-schema-thing-secure.entrypoints=websecure + - traefik.http.routers.http-data-schema-thing-secure.tls=true - traefik.http.services.http-data-schema-thing.loadbalancer.server.port=${WEB_PORT_OUT} environment: - HOSTNAME=${STACK_HOSTNAME} diff --git a/docker-compose-things.yml b/docker-compose-things.yml index 885399e..ddd69ec 100644 --- a/docker-compose-things.yml +++ b/docker-compose-things.yml @@ -39,6 +39,10 @@ services: image: thingweb/test-things-http-express-calculator-simple labels: - traefik.http.routers.http-express-calculator-simple.rule=PathPrefix(`/http-express-calculator-simple`) + - traefik.http.routers.http-express-calculator-simple.entrypoints=web + - traefik.http.routers.http-express-calculator-simple-secure.rule=PathPrefix(`/http-express-calculator-simple`) + - traefik.http.routers.http-express-calculator-simple-secure.entrypoints=websecure + - traefik.http.routers.http-express-calculator-simple-secure.tls=true - traefik.http.services.http-express-calculator-simple.loadbalancer.server.port=${WEB_PORT_OUT} environment: - HOSTNAME=${STACK_HOSTNAME} @@ -145,6 +149,10 @@ services: image: thingweb/test-things-http-advanced-coffee-machine labels: - traefik.http.routers.http-advanced-coffee-machine.rule=PathPrefix(`/http-advanced-coffee-machine`) + - traefik.http.routers.http-advanced-coffee-machine.entrypoints=web + - traefik.http.routers.http-advanced-coffee-machine-secure.rule=PathPrefix(`/http-advanced-coffee-machine`) + - traefik.http.routers.http-advanced-coffee-machine-secure.entrypoints=websecure + - traefik.http.routers.http-advanced-coffee-machine-secure.tls=true - traefik.http.services.http-advanced-coffee-machine.loadbalancer.server.port=${WEB_PORT_OUT} environment: - HOSTNAME=${STACK_HOSTNAME} @@ -164,6 +172,10 @@ services: image: thingweb/test-things-http-data-schema-thing labels: - traefik.http.routers.http-data-schema-thing.rule=PathPrefix(`/http-data-schema-thing`) + - traefik.http.routers.http-data-schema-thing.entrypoints=web + - traefik.http.routers.http-data-schema-thing-secure.rule=PathPrefix(`/http-data-schema-thing`) + - traefik.http.routers.http-data-schema-thing-secure.entrypoints=websecure + - traefik.http.routers.http-data-schema-thing-secure.tls=true - traefik.http.services.http-data-schema-thing.loadbalancer.server.port=${WEB_PORT_OUT} environment: - HOSTNAME=${STACK_HOSTNAME} diff --git a/things/advanced-coffee-machine/http/ts/src/main.ts b/things/advanced-coffee-machine/http/ts/src/main.ts index efc6387..4a88b68 100644 --- a/things/advanced-coffee-machine/http/ts/src/main.ts +++ b/things/advanced-coffee-machine/http/ts/src/main.ts @@ -107,7 +107,7 @@ if (tmPath != null && tmPath !== "") { const placeholderReplacer = new JsonPlaceholderReplacer(); placeholderReplacer.addVariableMap({ - PROTOCOL: "http", + PROTOCOL: "https", THING_NAME: thingName, HOSTNAME: hostname, PORT_NUMBER: portNumber, @@ -122,7 +122,7 @@ thingDescription = { const servient = new Servient(); servient.addServer( new HttpServer({ - baseUri: `http://${hostname}:${portNumber}`, + baseUri: `https://${hostname}:${portNumber}`, port: portNumber, }) ); diff --git a/things/data-schema-thing/http/ts/src/main.ts b/things/data-schema-thing/http/ts/src/main.ts index 2606828..5cac952 100644 --- a/things/data-schema-thing/http/ts/src/main.ts +++ b/things/data-schema-thing/http/ts/src/main.ts @@ -91,7 +91,7 @@ if (tmPath != null && tmPath !== "") { const placeholderReplacer = new JsonPlaceholderReplacer(); placeholderReplacer.addVariableMap({ - PROTOCOL: "http", + PROTOCOL: "https", THING_NAME: thingName, HOSTNAME: hostname, PORT_NUMBER: portNumber, @@ -203,7 +203,7 @@ setObject({ id: 123, name: "abc" }); const servient = new Servient(); servient.addServer( new HttpServer({ - baseUri: `http://${hostname}:${portNumber}`, + baseUri: `https://${hostname}:${portNumber}`, port: portNumber, }) );