From eb7eaa456ae810a2654ba90f99da2c9abd91daa7 Mon Sep 17 00:00:00 2001 From: n-i-x <440158+n-i-x@users.noreply.github.com> Date: Tue, 19 May 2020 23:06:47 -0400 Subject: [PATCH 1/8] Add --proxy-domain support --- root/etc/services.d/code-server/run | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/root/etc/services.d/code-server/run b/root/etc/services.d/code-server/run index 94896c6..2e91f05 100644 --- a/root/etc/services.d/code-server/run +++ b/root/etc/services.d/code-server/run @@ -1,19 +1,30 @@ #!/usr/bin/with-contenv bash +# Added by codeserver-golang +export PATH=$PATH:/usr/local/go/bin + if [ -n "${PASSWORD}" ]; then AUTH="password" else AUTH="none" echo "starting with no password" fi + code-server: + +if [ -z ${PROXY_DOMAIN+x} ]; then + PROXY_DOMAIN_ARG="" +else + PROXY_DOMAIN_ARG="--proxy-domain=${PROXY_DOMAIN}" +fi exec \ - s6-setuidgid abc \ - /app/code-server/code-server \ - --bind-addr 0.0.0.0:8443 \ - --user-data-dir /config/data \ - --extensions-dir /config/extensions \ - --disable-telemetry \ - --disable-updates \ - --auth "${AUTH}" \ - /config/workspace + s6-setuidgid abc \ + /app/code-server/code-server \ + --bind-addr 0.0.0.0:8443 \ + --user-data-dir /config/data \ + --extensions-dir /config/extensions \ + --disable-telemetry \ + --disable-updates \ + --auth "${AUTH}" \ + "${PROXY_DOMAIN_ARG}" \ + /config/workspace From f2c46c0e0de40f1872b39c71af7cf0586fbb005b Mon Sep 17 00:00:00 2001 From: n-i-x <440158+n-i-x@users.noreply.github.com> Date: Tue, 19 May 2020 23:12:42 -0400 Subject: [PATCH 2/8] Add --proxy-domain documentation --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 614f006..79a0827 100644 --- a/README.md +++ b/README.md @@ -81,6 +81,7 @@ docker create \ -e TZ=Europe/London \ -e PASSWORD=password `#optional` \ -e SUDO_PASSWORD=password `#optional` \ + -e PROXY_DOMAIN=code-server.my.domain `#optional` \ -p 8443:8443 \ -v /path/to/appdata/config:/config \ --restart unless-stopped \ @@ -105,6 +106,7 @@ services: - TZ=Europe/London - PASSWORD=password #optional - SUDO_PASSWORD=password #optional + - PROXY_DOMAIN=code-server.my.domain #optional volumes: - /path/to/appdata/config:/config ports: @@ -124,6 +126,7 @@ Container images are configured using parameters passed at runtime (such as thos | `-e TZ=Europe/London` | Specify a timezone to use EG Europe/London | | `-e PASSWORD=password` | Optional web gui password, if not provided, there will be no auth. | | `-e SUDO_PASSWORD=password` | If this optional variable is set, user will have sudo access in the code-server terminal with the specified password. | +| `-e PROXY_DOMAIN=code-server.my.domain` | If this optional variable is set, this domain will be proxied for subdomain proxying. See [Documentation](https://github.com/cdr/code-server/blob/master/doc/FAQ.md#sub-domains) | | `-v /config` | Contains all relevant configuration files. | ## Environment variables from files (Docker secrets) From 9ae8d18bd2f12cc2134399998cc3cb10772aa3df Mon Sep 17 00:00:00 2001 From: n-i-x <440158+n-i-x@users.noreply.github.com> Date: Tue, 19 May 2020 23:16:37 -0400 Subject: [PATCH 3/8] Update readme-vars.yml --- readme-vars.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/readme-vars.yml b/readme-vars.yml index 33e8825..33e8f9b 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -65,6 +65,7 @@ app_setup_block: | # changelog changelogs: + - { date: "20.05.20:", desc: "Add --domain-proxy support."} - { date: "29.04.20:", desc: "Update start arguments." } - { date: "01.04.20:", desc: "Structural changes required for v3." } - { date: "17.01.20:", desc: "Fix artifact url retrieval from github." } From af00f6d309ae4497cb6376751ce6a0f334a6b7b2 Mon Sep 17 00:00:00 2001 From: jrebey <55519905+jrebey@users.noreply.github.com> Date: Fri, 29 May 2020 10:24:32 -0400 Subject: [PATCH 4/8] remove golang mod PATH --- root/etc/services.d/code-server/run | 3 --- 1 file changed, 3 deletions(-) diff --git a/root/etc/services.d/code-server/run b/root/etc/services.d/code-server/run index 435648e..c59f45e 100644 --- a/root/etc/services.d/code-server/run +++ b/root/etc/services.d/code-server/run @@ -1,8 +1,5 @@ #!/usr/bin/with-contenv bash -# Added by codeserver-golang -export PATH=$PATH:/usr/local/go/bin - if [ -n "${PASSWORD}" ]; then AUTH="password" else From 2edc59783f3c76ad86808e496e7b235264711569 Mon Sep 17 00:00:00 2001 From: jrebey <55519905+jrebey@users.noreply.github.com> Date: Fri, 29 May 2020 10:25:32 -0400 Subject: [PATCH 5/8] editor set to spaces not tabs :/ --- root/etc/services.d/code-server/run | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/root/etc/services.d/code-server/run b/root/etc/services.d/code-server/run index c59f45e..4cf869d 100644 --- a/root/etc/services.d/code-server/run +++ b/root/etc/services.d/code-server/run @@ -22,5 +22,5 @@ exec \ --extensions-dir /config/extensions \ --disable-telemetry \ --auth "${AUTH}" \ - "${PROXY_DOMAIN_ARG}" \ + "${PROXY_DOMAIN_ARG}" \ /config/workspace From d413b7d2a603d6ce62ea14813a785c31664cfbe9 Mon Sep 17 00:00:00 2001 From: jrebey <55519905+jrebey@users.noreply.github.com> Date: Fri, 29 May 2020 10:26:24 -0400 Subject: [PATCH 6/8] remove weird code-server: --- root/etc/services.d/code-server/run | 1 - 1 file changed, 1 deletion(-) diff --git a/root/etc/services.d/code-server/run b/root/etc/services.d/code-server/run index 4cf869d..8d63daf 100644 --- a/root/etc/services.d/code-server/run +++ b/root/etc/services.d/code-server/run @@ -6,7 +6,6 @@ else AUTH="none" echo "starting with no password" fi - code-server: if [ -z ${PROXY_DOMAIN+x} ]; then PROXY_DOMAIN_ARG="" From 54d481ef55fb2a4390a853ea93f53c574f2910ee Mon Sep 17 00:00:00 2001 From: n-i-x <440158+n-i-x@users.noreply.github.com> Date: Fri, 29 May 2020 11:38:41 -0400 Subject: [PATCH 7/8] move readme stuff into readme-vars --- README.md | 1 - readme-vars.yml | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a321f0f..e60c6ce 100644 --- a/README.md +++ b/README.md @@ -127,7 +127,6 @@ Container images are configured using parameters passed at runtime (such as thos | `-e TZ=Europe/London` | Specify a timezone to use EG Europe/London | | `-e PASSWORD=password` | Optional web gui password, if not provided, there will be no auth. | | `-e SUDO_PASSWORD=password` | If this optional variable is set, user will have sudo access in the code-server terminal with the specified password. | -| `-e PROXY_DOMAIN=code-server.my.domain` | If this optional variable is set, this domain will be proxied for subdomain proxying. See [Documentation](https://github.com/cdr/code-server/blob/master/doc/FAQ.md#sub-domains) | | `-v /config` | Contains all relevant configuration files. | ## Environment variables from files (Docker secrets) diff --git a/readme-vars.yml b/readme-vars.yml index 9df9c18..f9649bf 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -49,6 +49,7 @@ opt_param_usage_include_env: true opt_param_env_vars: - { env_var: "PASSWORD", env_value: "password", desc: "Optional web gui password, if not provided, there will be no auth."} - { env_var: "SUDO_PASSWORD", env_value: "password", desc: "If this optional variable is set, user will have sudo access in the code-server terminal with the specified password."} + - { env_var: "PROXY_DOMAIN", env_value: "code-server.my.domain", desc: "If this optional variable is set, this domain will be proxied for subdomain proxying. See [Documentation](https://github.com/cdr/code-server/blob/master/doc/FAQ.md#sub-domains)" } optional_block_1: false optional_block_1_items: "" From 08841b0f51a925384ca2e42b5dfe8eddbb53b521 Mon Sep 17 00:00:00 2001 From: n-i-x <440158+n-i-x@users.noreply.github.com> Date: Fri, 29 May 2020 11:50:49 -0400 Subject: [PATCH 8/8] Remove docker-compose vars --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index e60c6ce..099d20f 100644 --- a/README.md +++ b/README.md @@ -82,7 +82,6 @@ docker create \ -e TZ=Europe/London \ -e PASSWORD=password `#optional` \ -e SUDO_PASSWORD=password `#optional` \ - -e PROXY_DOMAIN=code-server.my.domain `#optional` \ -p 8443:8443 \ -v /path/to/appdata/config:/config \ --restart unless-stopped \ @@ -107,7 +106,6 @@ services: - TZ=Europe/London - PASSWORD=password #optional - SUDO_PASSWORD=password #optional - - PROXY_DOMAIN=code-server.my.domain #optional volumes: - /path/to/appdata/config:/config ports: