From 57b6736265470d03e7289124632883cac813e2c8 Mon Sep 17 00:00:00 2001 From: WilliamMiceli Date: Tue, 21 May 2019 17:20:05 -0400 Subject: [PATCH 01/14] Added Wiki.js template --- templates/Wiki.js/0/README.md | 1 + templates/Wiki.js/0/docker-compose.yml | 53 +++++++++++++++++++++++++ templates/Wiki.js/0/rancher-compose.yml | 42 ++++++++++++++++++++ templates/Wiki.js/config.yml | 8 ++++ 4 files changed, 104 insertions(+) create mode 100644 templates/Wiki.js/0/README.md create mode 100644 templates/Wiki.js/0/docker-compose.yml create mode 100644 templates/Wiki.js/0/rancher-compose.yml create mode 100644 templates/Wiki.js/config.yml diff --git a/templates/Wiki.js/0/README.md b/templates/Wiki.js/0/README.md new file mode 100644 index 0000000..7048c02 --- /dev/null +++ b/templates/Wiki.js/0/README.md @@ -0,0 +1 @@ +# Wiki.js \ No newline at end of file diff --git a/templates/Wiki.js/0/docker-compose.yml b/templates/Wiki.js/0/docker-compose.yml new file mode 100644 index 0000000..00497f3 --- /dev/null +++ b/templates/Wiki.js/0/docker-compose.yml @@ -0,0 +1,53 @@ +version: '2' + +services: + mongo: + image: mongo:latest + command: 'mongod --smallfiles' + dns: # Using Cloudflare DNS + - 1.1.1.1 + - 1.0.0.1 + environment: + MONGO_LOG_DIR: /dev/null + labels: + io.rancher.container.pull_image: always + {{- if .Values.HOST_LABEL}} + io.rancher.scheduler.affinity:host_label: ${HOST_LABEL} + {{- end}} + restart: on-failure + volumes: + - /etc/localtime:/etc/localtime:ro # Syncronize time of container with the host system + - /etc/timezone:/etc/timezone:ro # Syncronize timezone of container with the host system + - /Rancher/${DATA_DIR}/Database/Data:/data/db + - /Rancher/${DATA_DIR}/Database/Dump:/dump + wikijs: + image: requarks/wiki:latest + dns: # Using Cloudflare DNS + - 1.1.1.1 + - 1.0.0.1 + environment: + WIKI_ADMIN_EMAIL: ${ADMIN_EMAIL} + labels: + io.rancher.container.pull_image: always + {{- if .Values.HOST_LABEL}} + io.rancher.scheduler.affinity:host_label: ${HOST_LABEL} + {{- end}} + traefik.enable: true + ### Start Web Segment + traefik.web.frontend.entryPoints: http, https + traefik.web.frontend.headers.forceSTSHeader: true + traefik.web.frontend.headers.referrerPolicy: no-referrer # Security enhancement (Prevents leaking of referer information) + traefik.web.frontend.headers.SSLRedirect: true + traefik.web.frontend.headers.STSPreload: true + traefik.web.frontend.headers.STSSeconds: 15552000 + traefik.web.frontend.passHostHeader: true + traefik.web.frontend.rule: "Host:${TRAEFIK_HOST}" # HostRegexp:${TRAEFIK_HOST},{subdomain:.+}.${TRAEFIK_HOST} + traefik.web.port: "3000" + ### End Web Segment + links: + - mongo + restart: on-failure + volumes: + - /etc/localtime:/etc/localtime:ro # Syncronize time of container with the host system + - /etc/timezone:/etc/timezone:ro # Syncronize timezone of container with the host system + - /Rancher/${DATA_DIR}/Wiki/config.yml:/var/wiki/config.yml diff --git a/templates/Wiki.js/0/rancher-compose.yml b/templates/Wiki.js/0/rancher-compose.yml new file mode 100644 index 0000000..4edc801 --- /dev/null +++ b/templates/Wiki.js/0/rancher-compose.yml @@ -0,0 +1,42 @@ +version: '2' +catalog: + name: XWiki + version: latest + # description: + # minimum_rancher_version: + # maximum_rancher_version: + # upgrade_from: + questions: + + - variable: "HOST_LABEL" + label: "Host Label Key/Value Pair" + description: | + The Label Key/Value pair of the host which containers should be deployed + default: "host.id=Host1" + required: false + type: string + + - variable: "TRAEFIK_HOST" + label: "Public Host Domain" + description: | + The host that Traefik will use to provide public access. + Separate multiple domains by using a comma. + default: "subdomain.domain.tld" + required: true + type: string + + - variable: "ADMIN_EMAIL" + label: "Administrator Email" + description: | + The email address for the main administrator + default: "user@tld.com" + required: true + type: string + + - variable: "DATA_DIR" + label: "Data Directory" + description: | + The directory to store persistent data for the stack. + default: "Personal/Wiki.js" + required: true + type: string \ No newline at end of file diff --git a/templates/Wiki.js/config.yml b/templates/Wiki.js/config.yml new file mode 100644 index 0000000..5b99ffb --- /dev/null +++ b/templates/Wiki.js/config.yml @@ -0,0 +1,8 @@ +name: Wiki.js +description: | + +version: latest +category: Wiki +maintainer: WilliamMiceli +# license: +# projectURL: \ No newline at end of file From 6f442813981d5b0b871ecf138315264d085c1146 Mon Sep 17 00:00:00 2001 From: WilliamMiceli Date: Tue, 21 May 2019 18:04:06 -0400 Subject: [PATCH 02/14] Will try to use port 80 instead --- templates/Wiki.js/0/docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/Wiki.js/0/docker-compose.yml b/templates/Wiki.js/0/docker-compose.yml index 00497f3..4e99e6d 100644 --- a/templates/Wiki.js/0/docker-compose.yml +++ b/templates/Wiki.js/0/docker-compose.yml @@ -42,7 +42,7 @@ services: traefik.web.frontend.headers.STSSeconds: 15552000 traefik.web.frontend.passHostHeader: true traefik.web.frontend.rule: "Host:${TRAEFIK_HOST}" # HostRegexp:${TRAEFIK_HOST},{subdomain:.+}.${TRAEFIK_HOST} - traefik.web.port: "3000" + traefik.web.port: "80" ### End Web Segment links: - mongo From b3f33e06a864e8e16a999e71bb4f4a7f9e7b3a32 Mon Sep 17 00:00:00 2001 From: WilliamMiceli Date: Tue, 21 May 2019 19:16:01 -0400 Subject: [PATCH 03/14] Trying with port 443 --- templates/Wiki.js/0/docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/Wiki.js/0/docker-compose.yml b/templates/Wiki.js/0/docker-compose.yml index 4e99e6d..c0ccb2a 100644 --- a/templates/Wiki.js/0/docker-compose.yml +++ b/templates/Wiki.js/0/docker-compose.yml @@ -42,7 +42,7 @@ services: traefik.web.frontend.headers.STSSeconds: 15552000 traefik.web.frontend.passHostHeader: true traefik.web.frontend.rule: "Host:${TRAEFIK_HOST}" # HostRegexp:${TRAEFIK_HOST},{subdomain:.+}.${TRAEFIK_HOST} - traefik.web.port: "80" + traefik.web.port: "443" ### End Web Segment links: - mongo From 908c63843bea826422d9a2158ea24bae1fd8fb32 Mon Sep 17 00:00:00 2001 From: WilliamMiceli Date: Tue, 21 May 2019 19:25:29 -0400 Subject: [PATCH 04/14] Back to port 80; added host ports for debugging --- templates/Wiki.js/0/docker-compose.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/templates/Wiki.js/0/docker-compose.yml b/templates/Wiki.js/0/docker-compose.yml index c0ccb2a..163e108 100644 --- a/templates/Wiki.js/0/docker-compose.yml +++ b/templates/Wiki.js/0/docker-compose.yml @@ -42,10 +42,12 @@ services: traefik.web.frontend.headers.STSSeconds: 15552000 traefik.web.frontend.passHostHeader: true traefik.web.frontend.rule: "Host:${TRAEFIK_HOST}" # HostRegexp:${TRAEFIK_HOST},{subdomain:.+}.${TRAEFIK_HOST} - traefik.web.port: "443" + traefik.web.port: "80" ### End Web Segment links: - mongo + ports: + - "80:80" restart: on-failure volumes: - /etc/localtime:/etc/localtime:ro # Syncronize time of container with the host system From a437bb975473116fbb85ae9442d57e965eb2ebeb Mon Sep 17 00:00:00 2001 From: WilliamMiceli Date: Tue, 21 May 2019 19:37:28 -0400 Subject: [PATCH 05/14] I was probably getting a bit carried away... --- templates/Wiki.js/0/docker-compose.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/Wiki.js/0/docker-compose.yml b/templates/Wiki.js/0/docker-compose.yml index 163e108..de3581a 100644 --- a/templates/Wiki.js/0/docker-compose.yml +++ b/templates/Wiki.js/0/docker-compose.yml @@ -2,8 +2,8 @@ version: '2' services: mongo: - image: mongo:latest - command: 'mongod --smallfiles' + image: mongo:3 + command: '--smallfiles --bind_ip ::,0.0.0.0' dns: # Using Cloudflare DNS - 1.1.1.1 - 1.0.0.1 From 9f58143f75a7f63a033a0f0c1d1d46394384bf59 Mon Sep 17 00:00:00 2001 From: WilliamMiceli Date: Tue, 21 May 2019 20:45:57 -0400 Subject: [PATCH 06/14] Version 1 only --- templates/Wiki.js/0/rancher-compose.yml | 2 +- templates/Wiki.js/config.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/Wiki.js/0/rancher-compose.yml b/templates/Wiki.js/0/rancher-compose.yml index 4edc801..e6ac1cb 100644 --- a/templates/Wiki.js/0/rancher-compose.yml +++ b/templates/Wiki.js/0/rancher-compose.yml @@ -1,7 +1,7 @@ version: '2' catalog: name: XWiki - version: latest + version: 1 # description: # minimum_rancher_version: # maximum_rancher_version: diff --git a/templates/Wiki.js/config.yml b/templates/Wiki.js/config.yml index 5b99ffb..c7d80d1 100644 --- a/templates/Wiki.js/config.yml +++ b/templates/Wiki.js/config.yml @@ -1,7 +1,7 @@ name: Wiki.js description: | -version: latest +version: 1 category: Wiki maintainer: WilliamMiceli # license: From f46a932ad20fcf80138b349119f943b75acd0bad Mon Sep 17 00:00:00 2001 From: WilliamMiceli Date: Tue, 21 May 2019 20:46:12 -0400 Subject: [PATCH 07/14] Only one domain is allowed it seems --- templates/Wiki.js/0/rancher-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/Wiki.js/0/rancher-compose.yml b/templates/Wiki.js/0/rancher-compose.yml index e6ac1cb..acd7393 100644 --- a/templates/Wiki.js/0/rancher-compose.yml +++ b/templates/Wiki.js/0/rancher-compose.yml @@ -20,7 +20,7 @@ catalog: label: "Public Host Domain" description: | The host that Traefik will use to provide public access. - Separate multiple domains by using a comma. + Only one domain is allowed by Wiki.js default: "subdomain.domain.tld" required: true type: string From d0e0d35e82207fc8bc9b658e16933ef34d40035b Mon Sep 17 00:00:00 2001 From: WilliamMiceli Date: Tue, 21 May 2019 20:46:36 -0400 Subject: [PATCH 08/14] Testing using environment variables --- templates/Wiki.js/0/docker-compose.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/templates/Wiki.js/0/docker-compose.yml b/templates/Wiki.js/0/docker-compose.yml index de3581a..026fef3 100644 --- a/templates/Wiki.js/0/docker-compose.yml +++ b/templates/Wiki.js/0/docker-compose.yml @@ -21,12 +21,17 @@ services: - /Rancher/${DATA_DIR}/Database/Data:/data/db - /Rancher/${DATA_DIR}/Database/Dump:/dump wikijs: - image: requarks/wiki:latest + image: requarks/wiki:latest #v1 Only dns: # Using Cloudflare DNS - 1.1.1.1 - 1.0.0.1 environment: WIKI_ADMIN_EMAIL: ${ADMIN_EMAIL} + # TITLE: + HOST: https://${TRAEFIK_HOST} # The public-facing view + PORT: 80 # Port to listen on internally + PUBLIC: false + MONGO_URI: mongodb://mongo:27017/wiki labels: io.rancher.container.pull_image: always {{- if .Values.HOST_LABEL}} @@ -41,7 +46,7 @@ services: traefik.web.frontend.headers.STSPreload: true traefik.web.frontend.headers.STSSeconds: 15552000 traefik.web.frontend.passHostHeader: true - traefik.web.frontend.rule: "Host:${TRAEFIK_HOST}" # HostRegexp:${TRAEFIK_HOST},{subdomain:.+}.${TRAEFIK_HOST} + traefik.web.frontend.rule: "Host:${TRAEFIK_HOST}" traefik.web.port: "80" ### End Web Segment links: From 52c7902f722283b4ba3c2230c85ad5eeaa73d57e Mon Sep 17 00:00:00 2001 From: WilliamMiceli Date: Tue, 21 May 2019 20:51:59 -0400 Subject: [PATCH 09/14] That variable didn't take, trying "DB" --- templates/Wiki.js/0/docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/Wiki.js/0/docker-compose.yml b/templates/Wiki.js/0/docker-compose.yml index 026fef3..47bbbc6 100644 --- a/templates/Wiki.js/0/docker-compose.yml +++ b/templates/Wiki.js/0/docker-compose.yml @@ -31,7 +31,7 @@ services: HOST: https://${TRAEFIK_HOST} # The public-facing view PORT: 80 # Port to listen on internally PUBLIC: false - MONGO_URI: mongodb://mongo:27017/wiki + DB: mongodb://mongo:27017/wiki labels: io.rancher.container.pull_image: always {{- if .Values.HOST_LABEL}} From fff38de7a776cce21fc82d09ebaa7501ec652b8a Mon Sep 17 00:00:00 2001 From: WilliamMiceli Date: Tue, 21 May 2019 20:55:45 -0400 Subject: [PATCH 10/14] Environment variables not working; removed --- templates/Wiki.js/0/docker-compose.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/templates/Wiki.js/0/docker-compose.yml b/templates/Wiki.js/0/docker-compose.yml index 47bbbc6..fe001e7 100644 --- a/templates/Wiki.js/0/docker-compose.yml +++ b/templates/Wiki.js/0/docker-compose.yml @@ -27,11 +27,6 @@ services: - 1.0.0.1 environment: WIKI_ADMIN_EMAIL: ${ADMIN_EMAIL} - # TITLE: - HOST: https://${TRAEFIK_HOST} # The public-facing view - PORT: 80 # Port to listen on internally - PUBLIC: false - DB: mongodb://mongo:27017/wiki labels: io.rancher.container.pull_image: always {{- if .Values.HOST_LABEL}} From 3b5d1b02271a77a8f075af0b0beee3cb62736943 Mon Sep 17 00:00:00 2001 From: WilliamMiceli Date: Wed, 22 May 2019 09:01:38 -0400 Subject: [PATCH 11/14] Made things very explicitly "Version 1" of Wiki.js --- templates/Wiki.js-v1/0/README.md | 3 +++ templates/{Wiki.js => Wiki.js-v1}/0/docker-compose.yml | 2 +- templates/{Wiki.js => Wiki.js-v1}/0/rancher-compose.yml | 4 ++-- templates/{Wiki.js => Wiki.js-v1}/config.yml | 4 ++-- templates/Wiki.js/0/README.md | 1 - 5 files changed, 8 insertions(+), 6 deletions(-) create mode 100644 templates/Wiki.js-v1/0/README.md rename templates/{Wiki.js => Wiki.js-v1}/0/docker-compose.yml (97%) rename templates/{Wiki.js => Wiki.js-v1}/0/rancher-compose.yml (96%) rename templates/{Wiki.js => Wiki.js-v1}/config.yml (70%) delete mode 100644 templates/Wiki.js/0/README.md diff --git a/templates/Wiki.js-v1/0/README.md b/templates/Wiki.js-v1/0/README.md new file mode 100644 index 0000000..9407c84 --- /dev/null +++ b/templates/Wiki.js-v1/0/README.md @@ -0,0 +1,3 @@ +# Wiki.js (v1) + +Default admin password: "admin123" \ No newline at end of file diff --git a/templates/Wiki.js/0/docker-compose.yml b/templates/Wiki.js-v1/0/docker-compose.yml similarity index 97% rename from templates/Wiki.js/0/docker-compose.yml rename to templates/Wiki.js-v1/0/docker-compose.yml index fe001e7..659a0db 100644 --- a/templates/Wiki.js/0/docker-compose.yml +++ b/templates/Wiki.js-v1/0/docker-compose.yml @@ -21,7 +21,7 @@ services: - /Rancher/${DATA_DIR}/Database/Data:/data/db - /Rancher/${DATA_DIR}/Database/Dump:/dump wikijs: - image: requarks/wiki:latest #v1 Only + image: requarks/wiki:latest # v1 Only dns: # Using Cloudflare DNS - 1.1.1.1 - 1.0.0.1 diff --git a/templates/Wiki.js/0/rancher-compose.yml b/templates/Wiki.js-v1/0/rancher-compose.yml similarity index 96% rename from templates/Wiki.js/0/rancher-compose.yml rename to templates/Wiki.js-v1/0/rancher-compose.yml index acd7393..dcae4dc 100644 --- a/templates/Wiki.js/0/rancher-compose.yml +++ b/templates/Wiki.js-v1/0/rancher-compose.yml @@ -1,7 +1,7 @@ version: '2' catalog: - name: XWiki - version: 1 + name: Wiki.js (v1) + version: latest # description: # minimum_rancher_version: # maximum_rancher_version: diff --git a/templates/Wiki.js/config.yml b/templates/Wiki.js-v1/config.yml similarity index 70% rename from templates/Wiki.js/config.yml rename to templates/Wiki.js-v1/config.yml index c7d80d1..5bd5b6d 100644 --- a/templates/Wiki.js/config.yml +++ b/templates/Wiki.js-v1/config.yml @@ -1,7 +1,7 @@ -name: Wiki.js +name: Wiki.js (v1) description: | -version: 1 +version: latest category: Wiki maintainer: WilliamMiceli # license: diff --git a/templates/Wiki.js/0/README.md b/templates/Wiki.js/0/README.md deleted file mode 100644 index 7048c02..0000000 --- a/templates/Wiki.js/0/README.md +++ /dev/null @@ -1 +0,0 @@ -# Wiki.js \ No newline at end of file From 4d1ae1c9b66a098e0648a7b1e189f249c0a9a21d Mon Sep 17 00:00:00 2001 From: WilliamMiceli Date: Wed, 22 May 2019 09:10:09 -0400 Subject: [PATCH 12/14] Ports no longer needed for debugging --- templates/Wiki.js-v1/0/docker-compose.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/templates/Wiki.js-v1/0/docker-compose.yml b/templates/Wiki.js-v1/0/docker-compose.yml index 659a0db..b4dd3e2 100644 --- a/templates/Wiki.js-v1/0/docker-compose.yml +++ b/templates/Wiki.js-v1/0/docker-compose.yml @@ -46,8 +46,6 @@ services: ### End Web Segment links: - mongo - ports: - - "80:80" restart: on-failure volumes: - /etc/localtime:/etc/localtime:ro # Syncronize time of container with the host system From be2416f26acc87803b4394098ecf5ee02a039eab Mon Sep 17 00:00:00 2001 From: William Miceli <1-WilliamMiceli@git.williammiceli.systems> Date: Tue, 28 May 2019 18:32:39 -0400 Subject: [PATCH 13/14] Added wildcard subdomain matching --- templates/GitLab/0/docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/GitLab/0/docker-compose.yml b/templates/GitLab/0/docker-compose.yml index 20f15de..6ed3671 100644 --- a/templates/GitLab/0/docker-compose.yml +++ b/templates/GitLab/0/docker-compose.yml @@ -28,7 +28,7 @@ services: traefik.web.frontend.headers.STSPreload: true traefik.web.frontend.headers.STSSeconds: 15552000 traefik.web.frontend.passHostHeader: true - traefik.web.frontend.rule: Host:${TRAEFIK_HOST} + traefik.web.frontend.rule: HostRegexp:${TRAEFIK_HOST},{subdomain:.+}.${TRAEFIK_HOST} traefik.web.port: "80" ### End Web Segment ### Start SSH Segment From 1bd49955fcd8f1c59d814198e55d9b75f01ce3b0 Mon Sep 17 00:00:00 2001 From: William Miceli <1-WilliamMiceli@git.williammiceli.systems> Date: Tue, 28 May 2019 18:33:12 -0400 Subject: [PATCH 14/14] Changed default host to "Host1" --- templates/GitLab/0/rancher-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/GitLab/0/rancher-compose.yml b/templates/GitLab/0/rancher-compose.yml index 7606f17..d8f5c53 100644 --- a/templates/GitLab/0/rancher-compose.yml +++ b/templates/GitLab/0/rancher-compose.yml @@ -12,7 +12,7 @@ catalog: label: "Host Label Key/Value Pair" description: | The Label Key/Value pair of the host which containers should be deployed - default: "host.id=Host2" + default: "host.id=Host1" required: false type: string