From c3b116987188c695e373fcad4dd0f3ce432f5046 Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Fri, 19 Jan 2024 15:42:10 +0300 Subject: [PATCH 1/9] docs: update docs to set SupportLinks --- docs/admin/appearance.md | 70 ++++++++++++++-------------------------- 1 file changed, 24 insertions(+), 46 deletions(-) diff --git a/docs/admin/appearance.md b/docs/admin/appearance.md index b1bd1aa7b4aa8..315c9cf2363f9 100644 --- a/docs/admin/appearance.md +++ b/docs/admin/appearance.md @@ -48,65 +48,43 @@ server. ![support links](../images/admin/support-links.png) -Custom links can be set in the deployment configuration using the -`-c ` flag to `coder server`. - -```yaml -supportLinks: - - name: "On-call 🔥" - target: "http://on-call.example.internal" - icon: "bug" - - name: "😉 Getting started with Go!" - target: "https://go.dev/" - - name: "Community" - target: "https://github.com/coder/coder" - icon: "chat" -``` - ### Icons -The link icons are optional, and limited to: `bug`, `chat`, and `docs`. +The link icons are optional, and can be set to any url or bultin icon, additionally `bug`, `chat`, and `docs` are availble as three special icons. -### Kubernetes configuration +### Configuration -To pass in the `supportLinks` YAML file above into your Coder Kubernetes -deployment, follow the steps below. +
+ +#### Kubernetes -#### 1. Create Kubernetes Secret From File - -Run the below command to create the YAML file as a Kubernetes secret in your -cluster: - -```console -kubectl create secret generic coder-support-links -n --from-file=config.yaml -``` - -#### 2. Mount Secret as Volume in Helm Chart - -Next, update your Helm chart values as follows: +To configure support links in your Coder Kubernetes +deployment, update your Helm chart values as follows: ```yaml coder: env: - - name: CODER_CONFIG_PATH - value: /etc/coder/config.yaml - volumes: - - name: coder-config - secret: - secretName: coder-support-links - volumeMounts: - - name: coder-config - mountPath: /etc/coder/ + - name: CODER_SUPPORT_LINKS + value: > + [{"name": "Hello GitHub", "target": "https://github.com/coder/coder", "icon": "bug"}, + {"name": "Hello Slack", "target": "https://codercom.slack.com/archives/C014JH42DBJ", "icon": "/icon/slack.svg"}, + {"name": "Hello Discord", "target": "https://discord.gg/coder", "icon": "/icon/discord.svg"}, + {"name": "Hello Foobar", "target": "https://foo.com/bar", "icon": "/emojis/1f3e1.png"}] ``` -#### 3. Upgrade Coder - -Lastly, upgrade Coder using the following command: - -```console -helm upgrade coder coder-v2/coder -n -f +#### System package +if running as a sytem servive, set an envrionment variable `CODER_SUPPORT_LINKS` in `/etc/coder.d/coder.env` as follows, +```env +CODER_SUPPORT_LINKS='[{"name": "Hello GitHub", "target": "https://github.com/coder/coder", "icon": "bug"}, {"name": "Hello Slack", "target": "https://codercom.slack.com/archives/C014JH42DBJ", "icon": "https://raw.githubusercontent.com/coder/coder/main/site/static/icon/slack.svg"}, {"name": "Hello Discord", "target": "https://discord.gg/coder", "icon": "https://raw.githubusercontent.com/coder/coder/main/site/static/icon/discord.svg"}, {"name": "Hello Foobar", "target": "https://discord.gg/coder", "icon": "/emojis/1f3e1.png"}]' +``` +For CLI, use. +```shell +export CODER_SUPPORT_LINKS='[{"name": "Hello GitHub", "target": "https://github.com/coder/coder", "icon": "bug"}, {"name": "Hello Slack", "target": "https://codercom.slack.com/archives/C014JH42DBJ", "icon": "https://raw.githubusercontent.com/coder/coder/main/site/static/icon/slack.svg"}, {"name": "Hello Discord", "target": "https://discord.gg/coder", "icon": "https://raw.githubusercontent.com/coder/coder/main/site/static/icon/discord.svg"}, {"name": "Hello Foobar", "target": "https://discord.gg/coder", "icon": "/emojis/1f3e1.png"}]' +coder-server ``` +
+ ## Up next - [Enterprise](../enterprise.md) From c69da038a80c96ef9bf3c6129198dd166eadaec8 Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Fri, 19 Jan 2024 15:44:50 +0300 Subject: [PATCH 2/9] Add files via upload --- site/static/icon/github.svg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/static/icon/github.svg b/site/static/icon/github.svg index c679c236fd224..d5e64918546d9 100644 --- a/site/static/icon/github.svg +++ b/site/static/icon/github.svg @@ -1 +1 @@ - + \ No newline at end of file From c7154fc7d95799e80faa11938334e69ad82b9dde Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Fri, 19 Jan 2024 13:05:05 +0300 Subject: [PATCH 3/9] `make fmt` --- docs/admin/appearance.md | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/docs/admin/appearance.md b/docs/admin/appearance.md index 315c9cf2363f9..c21d49aff4728 100644 --- a/docs/admin/appearance.md +++ b/docs/admin/appearance.md @@ -50,7 +50,8 @@ server. ### Icons -The link icons are optional, and can be set to any url or bultin icon, additionally `bug`, `chat`, and `docs` are availble as three special icons. +The link icons are optional, and can be set to any url or builtin icon, +additionally `bug`, `chat`, and `docs` are available as three special icons. ### Configuration @@ -58,26 +59,36 @@ The link icons are optional, and can be set to any url or bultin icon, additiona #### Kubernetes -To configure support links in your Coder Kubernetes -deployment, update your Helm chart values as follows: +To configure support links in your Coder Kubernetes deployment, update your Helm +chart values as follows: ```yaml coder: env: - - name: CODER_SUPPORT_LINKS - value: > - [{"name": "Hello GitHub", "target": "https://github.com/coder/coder", "icon": "bug"}, - {"name": "Hello Slack", "target": "https://codercom.slack.com/archives/C014JH42DBJ", "icon": "/icon/slack.svg"}, - {"name": "Hello Discord", "target": "https://discord.gg/coder", "icon": "/icon/discord.svg"}, - {"name": "Hello Foobar", "target": "https://foo.com/bar", "icon": "/emojis/1f3e1.png"}] + - name: CODER_SUPPORT_LINKS + value: > + [{"name": "Hello GitHub", "target": "https://github.com/coder/coder", + "icon": "bug"}, + {"name": "Hello Slack", "target": + "https://codercom.slack.com/archives/C014JH42DBJ", "icon": + "/icon/slack.svg"}, + {"name": "Hello Discord", "target": "https://discord.gg/coder", "icon": + "/icon/discord.svg"}, + {"name": "Hello Foobar", "target": "https://foo.com/bar", "icon": + "/emojis/1f3e1.png"}] ``` #### System package -if running as a sytem servive, set an envrionment variable `CODER_SUPPORT_LINKS` in `/etc/coder.d/coder.env` as follows, + +if running as a system service, set an environment variable `CODER_SUPPORT_LINKS` +in `/etc/coder.d/coder.env` as follows, + ```env CODER_SUPPORT_LINKS='[{"name": "Hello GitHub", "target": "https://github.com/coder/coder", "icon": "bug"}, {"name": "Hello Slack", "target": "https://codercom.slack.com/archives/C014JH42DBJ", "icon": "https://raw.githubusercontent.com/coder/coder/main/site/static/icon/slack.svg"}, {"name": "Hello Discord", "target": "https://discord.gg/coder", "icon": "https://raw.githubusercontent.com/coder/coder/main/site/static/icon/discord.svg"}, {"name": "Hello Foobar", "target": "https://discord.gg/coder", "icon": "/emojis/1f3e1.png"}]' ``` -For CLI, use. + +For CLI, use, + ```shell export CODER_SUPPORT_LINKS='[{"name": "Hello GitHub", "target": "https://github.com/coder/coder", "icon": "bug"}, {"name": "Hello Slack", "target": "https://codercom.slack.com/archives/C014JH42DBJ", "icon": "https://raw.githubusercontent.com/coder/coder/main/site/static/icon/slack.svg"}, {"name": "Hello Discord", "target": "https://discord.gg/coder", "icon": "https://raw.githubusercontent.com/coder/coder/main/site/static/icon/discord.svg"}, {"name": "Hello Foobar", "target": "https://discord.gg/coder", "icon": "/emojis/1f3e1.png"}]' coder-server From 9015207db174fff2a8cde46409eb6dbe67465dfa Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Fri, 19 Jan 2024 13:13:44 +0300 Subject: [PATCH 4/9] fixup! --- docs/admin/appearance.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/admin/appearance.md b/docs/admin/appearance.md index c21d49aff4728..bd168a75acf9c 100644 --- a/docs/admin/appearance.md +++ b/docs/admin/appearance.md @@ -80,8 +80,8 @@ coder: #### System package -if running as a system service, set an environment variable `CODER_SUPPORT_LINKS` -in `/etc/coder.d/coder.env` as follows, +if running as a system service, set an environment variable +`CODER_SUPPORT_LINKS` in `/etc/coder.d/coder.env` as follows, ```env CODER_SUPPORT_LINKS='[{"name": "Hello GitHub", "target": "https://github.com/coder/coder", "icon": "bug"}, {"name": "Hello Slack", "target": "https://codercom.slack.com/archives/C014JH42DBJ", "icon": "https://raw.githubusercontent.com/coder/coder/main/site/static/icon/slack.svg"}, {"name": "Hello Discord", "target": "https://discord.gg/coder", "icon": "https://raw.githubusercontent.com/coder/coder/main/site/static/icon/discord.svg"}, {"name": "Hello Foobar", "target": "https://discord.gg/coder", "icon": "/emojis/1f3e1.png"}]' From 367b5097a76d3b01584a34a0fcd09309e1aa3939 Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Fri, 19 Jan 2024 16:14:20 +0300 Subject: [PATCH 5/9] Delete site/static/icon/github.svg --- site/static/icon/github.svg | 1 - 1 file changed, 1 deletion(-) delete mode 100644 site/static/icon/github.svg diff --git a/site/static/icon/github.svg b/site/static/icon/github.svg deleted file mode 100644 index d5e64918546d9..0000000000000 --- a/site/static/icon/github.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file From 6c561277766d9925dd3b65ed809144b919f7a385 Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Fri, 19 Jan 2024 16:14:44 +0300 Subject: [PATCH 6/9] Discard changes to site/static/icon/github.svg --- site/static/icon/github.svg | 1 + 1 file changed, 1 insertion(+) create mode 100644 site/static/icon/github.svg diff --git a/site/static/icon/github.svg b/site/static/icon/github.svg new file mode 100644 index 0000000000000..c679c236fd224 --- /dev/null +++ b/site/static/icon/github.svg @@ -0,0 +1 @@ + From 27be04ba4eadb4454d48d41ba0e0523266e74adc Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Fri, 19 Jan 2024 13:23:49 +0300 Subject: [PATCH 7/9] add link to icons --- docs/admin/appearance.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/admin/appearance.md b/docs/admin/appearance.md index bd168a75acf9c..a768e73d3478b 100644 --- a/docs/admin/appearance.md +++ b/docs/admin/appearance.md @@ -50,8 +50,9 @@ server. ### Icons -The link icons are optional, and can be set to any url or builtin icon, -additionally `bug`, `chat`, and `docs` are available as three special icons. +The link icons are optional, and can be set to any url or +[builtin icon](../templates/icons.md), additionally `bug`, `chat`, and `docs` +are available as three special icons. ### Configuration From 4161b6b4fdae4a0bf2630766f5b1c5a015165eba Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Fri, 19 Jan 2024 13:38:52 +0300 Subject: [PATCH 8/9] Update link icons and add instructions for setting icons for external authentication providers --- docs/admin/appearance.md | 4 ++-- docs/templates/icons.md | 10 +++++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/docs/admin/appearance.md b/docs/admin/appearance.md index a768e73d3478b..125a895f4bced 100644 --- a/docs/admin/appearance.md +++ b/docs/admin/appearance.md @@ -51,8 +51,8 @@ server. ### Icons The link icons are optional, and can be set to any url or -[builtin icon](../templates/icons.md), additionally `bug`, `chat`, and `docs` -are available as three special icons. +[builtin icon](../templates/icons.md#bundled-icons), additionally `bug`, `chat`, +and `docs` are available as three special icons. ### Configuration diff --git a/docs/templates/icons.md b/docs/templates/icons.md index a9072c3f14a01..71544334d7333 100644 --- a/docs/templates/icons.md +++ b/docs/templates/icons.md @@ -36,7 +36,15 @@ come bundled with your Coder deployment. - [**Authentication Providers**](https://coder.com/docs/v2/latest/admin/external-auth): - - Use icons for external authentication providers to make them recognizable + - Use icons for external authentication providers to make them recognizable. + You can set an icon for each provider by setting the + `CODER_EXTERNAL_AUTH_X_ICON` environment variable, where `X` is the number + of the provider. + + ```env + CODER_EXTERNAL_AUTH_0_ICON=/icon/github.svg + CODER_EXTERNAL_AUTH_1_ICON=/icon/google.svg + ``` ## Bundled icons From 996cfc8eee0b08a47292b126c77405f9d6a9729a Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Fri, 19 Jan 2024 13:40:01 +0300 Subject: [PATCH 9/9] Add support for using icons in support links --- docs/templates/icons.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/templates/icons.md b/docs/templates/icons.md index 71544334d7333..0dc129c90a738 100644 --- a/docs/templates/icons.md +++ b/docs/templates/icons.md @@ -46,6 +46,11 @@ come bundled with your Coder deployment. CODER_EXTERNAL_AUTH_1_ICON=/icon/google.svg ``` +- [**Support Links**](../admin/appearance#support-links): + + - Use icons for support links to make them recognizable. You can set the + `icon` field for each link in `CODER_SUPPORT_LINKS` array. + ## Bundled icons Coder is distributed with a bundle of icons for popular cloud providers and