From 398deb3beb62d63b05935766948251bb9e659ebd Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Wed, 21 Oct 2026 18:49:26 -0400 Subject: [PATCH] chore: fix pre-existing gofmt and markdown lint issues Markdown lint in CI now checks nested docs, which it previously skipped because the `**/*.md` glob was expanded by the shell without globstar. --- .github/workflows/lint.yml | 2 +- docs/advanced-usage/deployment-tasks.md | 2 +- docs/advanced-usage/registry-management.md | 3 +- docs/appendices/0.35.0-migration-guide.md | 3 + docs/appendices/file-formats/app-json.md | 5 ++ docs/community/plugins.md | 1 - .../builders/herokuish-buildpacks.md | 3 +- docs/deployment/builders/railpack.md | 17 ++-- .../continuous-integration/woodpecker-ci.md | 2 +- docs/deployment/schedulers/k3s.md | 2 +- docs/getting-started/advanced-installation.md | 1 + docs/getting-started/troubleshooting.md | 6 +- docs/networking/proxies/traefik.md | 20 ++--- docs/processes/one-off-tasks.md | 1 - docs/processes/process-management.md | 4 +- docs/processes/scheduled-cron-tasks.md | 1 - plugins/builder/report.go | 8 +- .../buildpacks/src/subcommands/subcommands.go | 2 +- plugins/buildpacks/subcommands.go | 6 +- plugins/common/report_test.go | 4 +- plugins/docker-options/dockeroptions.go | 9 ++- plugins/nginx-vhosts/template_test.go | 78 +++++++++---------- plugins/ports/proxy.go | 1 - plugins/ps/report.go | 42 +++++----- plugins/scheduler-k3s/k8s_test.go | 10 +-- plugins/scheduler-k3s/triggers_test.go | 6 +- 26 files changed, 124 insertions(+), 115 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 092b9acee..e7a25e4ff 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -40,7 +40,7 @@ jobs: - name: Install markdownlint-cli run: npm install -g markdownlint-cli@0.35.0 - name: Run markdown-lint - run: markdownlint -c .github/linters/.markdown-lint.yml *.md **/*.md + run: markdownlint -c .github/linters/.markdown-lint.yml --ignore tests/apps '**/*.md' packer: name: packer diff --git a/docs/advanced-usage/deployment-tasks.md b/docs/advanced-usage/deployment-tasks.md index 1c278a803..0065b0ffc 100644 --- a/docs/advanced-usage/deployment-tasks.md +++ b/docs/advanced-usage/deployment-tasks.md @@ -67,7 +67,7 @@ Sometimes it may be desirable to set a different path for a given app, e.g. when dokku app-json:set node-js-app appjson-path .dokku/app.json ``` -The value is the path to the desired file *relative* to the base search directory, and will never be treated as absolute paths in any context. If that file does not exist within the repository, Dokku will continue the build process as if the repository has no `app.json`. +The value is the path to the desired file _relative_ to the base search directory, and will never be treated as absolute paths in any context. If that file does not exist within the repository, Dokku will continue the build process as if the repository has no `app.json`. The default value may be set by passing an empty value for the option: diff --git a/docs/advanced-usage/registry-management.md b/docs/advanced-usage/registry-management.md index 265878aaf..85380dec4 100644 --- a/docs/advanced-usage/registry-management.md +++ b/docs/advanced-usage/registry-management.md @@ -243,7 +243,7 @@ dokku registry:set --global push-on-release When `push-on-release` is enabled, Dokku treats the remote registry as the canonical store for app images. If a local image disappears - for example because a `docker image prune` cron ran, the host rebooted, or an operator removed it manually - subsequent commands that need the image (`ps:restart`, `ps:scale`, `dokku run`, `domains:add`, `certs:add`, etc.) will pull the missing tag back from the registry automatically. Per-app registry credentials configured via `registry:login` are honored during the pull. This recovery covers the deployed numeric tag pushed by the registry plugin - a missing `latest` tag will be ignored. -### Push extra tags +### Push extra tags To push the image on release with extra tags, set the `push-extra-tags` to a comma-separated list of tags via the `registry:set` command. The default value for this property is empty. Setting the property will result in the image being tagged with extra tags every release. @@ -251,6 +251,7 @@ To push the image on release with extra tags, set the `push-extra-tags` to a com # multiple-tags dokku registry:set node-js-app push-extra-tags foo,bar ``` + The `push-extra-tags` can be set to a single tag too. ```shell diff --git a/docs/appendices/0.35.0-migration-guide.md b/docs/appendices/0.35.0-migration-guide.md index e12bbc383..2ee7642c7 100644 --- a/docs/appendices/0.35.0-migration-guide.md +++ b/docs/appendices/0.35.0-migration-guide.md @@ -6,11 +6,14 @@ - The default image used for Cloud Native Buildpack builds is now `heroku/builder:24`, and is based on both the `heroku-24` stack as well as Ubuntu 24.04. Users that wish to stick with the old, `heroku-22`/Ubuntu 22.04 builder may specify `heroku/buildpacks:22` as their builder image. Please see the [cloud native buildpack deployment documentation](/docs/deployment/builders/cloud-native-buildpacks.md#customizing-the-buildpack-stack-builder) for more information on how to specify a custom buildpack stack builder. - The default image used for Herokuish Buildpack builds is now `gliderlabs/herokuish:latest-24`, and is based on both the `heroku-24` stack as well as Ubuntu 24.04. Users that wish to stick with the old, `heroku-22`/Ubuntu 22.04 builder may specify `gliderlabs/herokuish:latest-22` as their builder image. Please see the [herokuish buildpack deployment documentation](/docs/deployment/builders/herokuish-buildpacks.md#customizing-the-buildpack-stack-builder) for more information on how to specify a custom buildpack stack builder. - The `vector` image used by Dokku for enhanced logging support has been upgraded from 0.39.x to 0.41.x. To take advantage of the new image, execute the following commands: + ``` dokku logs:vector-stop dokku logs:vector-start ``` + - The `openresty` image used by Dokku for proxying via openresty has been upgraded from 0.8.0 to 0.9.0. To take advantage of the new image, execute the following commands: + ``` dokku openresty:stop dokku openresty:start diff --git a/docs/appendices/file-formats/app-json.md b/docs/appendices/file-formats/app-json.md index d5017b82e..8448d85d7 100644 --- a/docs/appendices/file-formats/app-json.md +++ b/docs/appendices/file-formats/app-json.md @@ -90,6 +90,7 @@ Environment variables from `app.json` are processed during the first deploy, bef 4. **Optional variables without a value**: Skipped silently if no TTY is available On subsequent deploys: + - Variables are NOT re-set unless `sync: true` is specified - Variables with `sync: true` are always set to their configured value, overwriting any manual changes - Variables that already have values are not modified @@ -97,6 +98,7 @@ On subsequent deploys: ### Examples **Simple default value:** + ```json { "env": { @@ -106,6 +108,7 @@ On subsequent deploys: ``` **Generated secret (recommended for API keys, tokens, etc.):** + ```json { "env": { @@ -118,6 +121,7 @@ On subsequent deploys: ``` **Required variable that must be provided:** + ```json { "env": { @@ -130,6 +134,7 @@ On subsequent deploys: ``` **Variable that stays in sync with app.json:** + ```json { "env": { diff --git a/docs/community/plugins.md b/docs/community/plugins.md index a2cca48ab..c738954d8 100644 --- a/docs/community/plugins.md +++ b/docs/community/plugins.md @@ -268,7 +268,6 @@ The following plugins are no longer maintained by their developers. [calyhre]: https://github.com/calyhre [cameron-martin]: https://github.com/cameron-martin [candlewaster]: https://notabug.org/candlewaster -[cedricziel]: https://github.com/cedricziel [cef]: https://github.com/cef [cheif]: https://github.com/cheif [cjblomqvist]: https://github.com/cjblomqvist diff --git a/docs/deployment/builders/herokuish-buildpacks.md b/docs/deployment/builders/herokuish-buildpacks.md index b18b39fed..aeb61505a 100644 --- a/docs/deployment/builders/herokuish-buildpacks.md +++ b/docs/deployment/builders/herokuish-buildpacks.md @@ -207,7 +207,6 @@ See the [buildpack management documentation](/docs/deployment/builders/buildpack See the [buildpack management documentation](/docs/deployment/builders/buildpack-management.md#using-a-specific-buildpack-version) for more information on how to using a specific buildpack version - ### Displaying buildpack reports for an app See the [buildpack management documentation](/docs/deployment/builders/buildpack-management.md#displaying-buildpack-reports-for-an-app) for more information on how to display buildpack reports for an app. @@ -218,4 +217,4 @@ See the [buildpack management documentation](/docs/deployment/builders/buildpack | Property | Scope | Default | Report flags | Description | |---|---|---|---|---| -| `allowed` | app + global | `true` | `--builder-herokuish-allowed`, `--builder-herokuish-global-allowed`, `--builder-herokuish-computed-allowed` | When `false`, the herokuish builder is skipped during builder detection for this app | \ No newline at end of file +| `allowed` | app + global | `true` | `--builder-herokuish-allowed`, `--builder-herokuish-global-allowed`, `--builder-herokuish-computed-allowed` | When `false`, the herokuish builder is skipped during builder detection for this app | diff --git a/docs/deployment/builders/railpack.md b/docs/deployment/builders/railpack.md index ac289b536..8d1b96348 100644 --- a/docs/deployment/builders/railpack.md +++ b/docs/deployment/builders/railpack.md @@ -13,14 +13,17 @@ Before using Railpacks, the following steps must be taken: - Install the `railpack` cli: The `railpack` cli tool is not included by default with Dokku or as a dependency. It must also be installed as shown on [this page](https://railpack.com/installation). - Create a `buildkit` builder: Railpack uses buildkit. - ```shell - docker run --rm --privileged -d --name buildkit moby/buildkit - ``` + + ```shell + docker run --rm --privileged -d --name buildkit moby/buildkit + ``` + - Set the buildkit builder: Update the `/etc/default/dokku` file to set `BUILDKIT_HOST`: - ```shell - touch /etc/default/dokku - echo "export BUILDKIT_HOST='docker-container://buildkit'" >> /etc/default/dokku - ``` + + ```shell + touch /etc/default/dokku + echo "export BUILDKIT_HOST='docker-container://buildkit'" >> /etc/default/dokku + ``` ### Detection diff --git a/docs/deployment/continuous-integration/woodpecker-ci.md b/docs/deployment/continuous-integration/woodpecker-ci.md index 4c6fcda6a..cf286f394 100644 --- a/docs/deployment/continuous-integration/woodpecker-ci.md +++ b/docs/deployment/continuous-integration/woodpecker-ci.md @@ -26,4 +26,4 @@ steps: ``` - The standard `clone` stage is replaced with one that performs a complete clone of the repository (the default is a shallow clone, which dokku would reject). -- A `GIT_REMOTE_URL` and a `SSH_PRIVATE_KEY` (with help of the `from_secret` directive) suffice to carry out a deployment. \ No newline at end of file +- A `GIT_REMOTE_URL` and a `SSH_PRIVATE_KEY` (with help of the `from_secret` directive) suffice to carry out a deployment. diff --git a/docs/deployment/schedulers/k3s.md b/docs/deployment/schedulers/k3s.md index 1a9e7ce87..9883af10e 100644 --- a/docs/deployment/schedulers/k3s.md +++ b/docs/deployment/schedulers/k3s.md @@ -957,7 +957,7 @@ dokku docker-options:add node-js-app deploy "--sysctl net.ipv4.ip_unprivileged_p Passing a non-namespaced sysctl this way fails the deploy rather than silently dropping the value, since it provably cannot take effect within a pod. Note this differs from the `docker-local` scheduler, where such an option is passed straight through to `docker run`. -Kubernetes further splits namespaced sysctls into a *safe* list that any pod may set, and everything else. A sysctl outside the safe list - `net.core.somaxconn`, for example - is rejected at pod admission unless the node's kubelet was started with a matching `allowed-unsafe-sysctls` value, which can be supplied at cluster initialization or when joining a node. +Kubernetes further splits namespaced sysctls into a _safe_ list that any pod may set, and everything else. A sysctl outside the safe list - `net.core.somaxconn`, for example - is rejected at pod admission unless the node's kubelet was started with a matching `allowed-unsafe-sysctls` value, which can be supplied at cluster initialization or when joining a node. ```shell dokku scheduler-k3s:initialize --kubelet-args allowed-unsafe-sysctls=net.core.somaxconn diff --git a/docs/getting-started/advanced-installation.md b/docs/getting-started/advanced-installation.md index 36e83f685..f18a2908d 100644 --- a/docs/getting-started/advanced-installation.md +++ b/docs/getting-started/advanced-installation.md @@ -97,6 +97,7 @@ free echo "/var/swap.img none swap sw 0 0" >> /etc/fstab ``` + Note: it may be necessary to call swapoff, mkswap and swapon explicitly: `sudo /sbin/swapoff /var/swap.img`, etc. [Reference](https://www.digitalocean.com/community/tutorials/how-to-configure-virtual-memory-swap-file-on-a-vps) diff --git a/docs/getting-started/troubleshooting.md b/docs/getting-started/troubleshooting.md index e95c1ebbc..8bd5fb7a3 100644 --- a/docs/getting-started/troubleshooting.md +++ b/docs/getting-started/troubleshooting.md @@ -226,22 +226,20 @@ sudo ufw disable ### I can't connect to my application because the server is sending an invalid response, or can't provide a secure connection -This is normally a config problem with your app, rather than an issue with Dokku. +This is normally a config problem with your app, rather than an issue with Dokku. One common cause is an application configured to enforce secure connections/HSTS, but SSL is not set up. In Ruby on Rails, if your `application.rb` or `config/environments/production.rb` include the line `configure.force_ssl = true`, try commenting that line out and redeploying. If this solves the issue temporarily, longer-term you should consider [configuring SSL](/docs/configuration/ssl.md). - ### I deployed a new application, but an existing application is being served when I visit it This problem has the same cause as the previous issue: your application is attempting to enforce SSL, but SSL is not configured. Disabling SSL enforcement should solve the problem. -The underlying cause is best understood with an example. Let's say you already have `https://apples.example.com/` working, and you're trying to deploy `bananas.example.com/`. But whenever you visit `bananas.example.com` you see `apples.example.com` instead. This is caused by `bananas.example.com` forcing SSL: +The underlying cause is best understood with an example. Let's say you already have `https://apples.example.com/` working, and you're trying to deploy `bananas.example.com/`. But whenever you visit `bananas.example.com` you see `apples.example.com` instead. This is caused by `bananas.example.com` forcing SSL: 1. Your browser sends a request to `http://bananas.example.com`. 1. `bananas.example.com` issues a redirect to `https://bananas.example.com`. 1. Your browser sends a request to `https://bananas.example.com`. But you haven't configured SSL for `bananas.example.com` yet! So this request ends up routed to `https://apples.example.com`, which _does_ have an SSL config. - ### My application deploys properly, but won't load in browser "connection refused" This could be a result of a bad proxy configuration (`http:5000:5000` may be incorrect). Run `dokku ports:report node-js-app` to check if your app has the correct proxy configuration. It should show something like the following. diff --git a/docs/networking/proxies/traefik.md b/docs/networking/proxies/traefik.md index 580ea5e18..3a508578a 100644 --- a/docs/networking/proxies/traefik.md +++ b/docs/networking/proxies/traefik.md @@ -241,22 +241,22 @@ By default, Traefik uses TLS-ALPN-01 challenge for obtaining certificates. To sw 1. Set the challenge mode to `dns`: -```shell -dokku traefik:set --global challenge-mode dns -``` + ```shell + dokku traefik:set --global challenge-mode dns + ``` 2. Set your DNS provider: -```shell -dokku traefik:set --global dns-provider cloudflare -``` + ```shell + dokku traefik:set --global dns-provider cloudflare + ``` 3. Configure the required environment variables for your DNS provider. Each DNS provider requires specific environment variables. The variable names should be prefixed with `dns-provider-`: -```shell -dokku traefik:set --global dns-provider-cf_api_email user@example.com -dokku traefik:set --global dns-provider-cf_api_key your-api-key -``` + ```shell + dokku traefik:set --global dns-provider-cf_api_email user@example.com + dokku traefik:set --global dns-provider-cf_api_key your-api-key + ``` The `dns-provider-` prefix will be stripped and the variable name will be uppercased when passed to the Traefik container. For example, `dns-provider-cf_api_email` becomes `CF_API_EMAIL`. diff --git a/docs/processes/one-off-tasks.md b/docs/processes/one-off-tasks.md index dd221faa7..1cc10d526 100644 --- a/docs/processes/one-off-tasks.md +++ b/docs/processes/one-off-tasks.md @@ -31,7 +31,6 @@ One off containers are removed at the end of process execution. In addition, one-off containers also run for a max of 24 hours (86400 seconds) by default, after which they are reaped. This can be changed by setting the `--ttl-seconds` argument: - ```shell # runs for 10 minutes dokku run --ttl-seconds 600 node-js-app npm run mytask diff --git a/docs/processes/process-management.md b/docs/processes/process-management.md index 190cd1f81..6ee9f9c37 100644 --- a/docs/processes/process-management.md +++ b/docs/processes/process-management.md @@ -127,7 +127,7 @@ The `ps` plugin provides a number of settings that can be used to managed deploy | Name | Description | Global Default | |-----------------------|---------------------------------------------------|--------------------| -| `stop-timeout` | Configurable grace period given to the `docker stop` command. If a container has not stopped by this time, a `kill -9` signal or equivalent is sent in order to force-terminate the container. Both the `ps:stop` and `apps:destroy` commands *also* respect this value. If not specified, the Docker defaults for the [`docker stop` command](https://docs.docker.com/engine/reference/commandline/stop/) will be used. | `30` | +| `stop-timeout` | Configurable grace period given to the `docker stop` command. If a container has not stopped by this time, a `kill -9` signal or equivalent is sent in order to force-terminate the container. Both the `ps:stop` and `apps:destroy` commands _also_ respect this value. If not specified, the Docker defaults for the [`docker stop` command](https://docs.docker.com/engine/reference/commandline/stop/) will be used. | `30` | All settings can be set via the `ps:set` command. Using `stop-timeout` as an example: @@ -216,7 +216,7 @@ Sometimes it may be desirable to set a different path for a given app, e.g. when dokku ps:set node-js-app procfile-path .dokku/Procfile ``` -The value is the path to the desired file *relative* to the base search directory, and will never be treated as absolute paths in any context. If that file does not exist within the repository, Dokku will continue the build process as if the repository has no `Procfile`. +The value is the path to the desired file _relative_ to the base search directory, and will never be treated as absolute paths in any context. If that file does not exist within the repository, Dokku will continue the build process as if the repository has no `Procfile`. The default value may be set by passing an empty value for the option: diff --git a/docs/processes/scheduled-cron-tasks.md b/docs/processes/scheduled-cron-tasks.md index 86ab44d2d..dfd80db53 100644 --- a/docs/processes/scheduled-cron-tasks.md +++ b/docs/processes/scheduled-cron-tasks.md @@ -40,7 +40,6 @@ A cron task takes the following properties: - `schedule`: A [cron-compatible](https://en.wikipedia.org/wiki/Cron#Overview) scheduling definition upon which to run the command. Seconds are generally not supported. - `concurrency_policy`: A string (default: `allow`), that controls whether the cron task can be run concurrently with another invocation of itself. Valid options are `allow` (allow concurrency), `forbid` (exit the new cron task if there is an existing one), `replace` (delete any existing cron task and start the new one). - Zero or more cron tasks can be specified per app. Cron tasks are validated after the build artifact is created but before the app is deployed, and the cron schedule is updated during the post-deploy phase. Cron tasks can run for a maximum of 24 hours, after which they are reaped from the system. The `docker-local` scheduler reaps expired tasks via the `dokku ps:retire` pass that runs every 5 minutes, so a task may overrun its deadline by up to 5 minutes. The `k3s` scheduler enforces the deadline directly through the job's `activeDeadlineSeconds`. diff --git a/plugins/builder/report.go b/plugins/builder/report.go index f7d2d263d..10a1ba48a 100644 --- a/plugins/builder/report.go +++ b/plugins/builder/report.go @@ -15,10 +15,10 @@ func ReportSingleApp(appName string, format string, infoFlag string) error { var flags map[string]common.ReportFunc if appName == "--global" { flags = map[string]common.ReportFunc{ - "--builder-global-selected": reportGlobalSelected, - "--builder-global-build-dir": reportGlobalBuildDir, - "--builder-global-skip-cleanup": reportGlobalSkipCleanup, - "--builder-computed-skip-cleanup": reportComputedSkipCleanup, + "--builder-global-selected": reportGlobalSelected, + "--builder-global-build-dir": reportGlobalBuildDir, + "--builder-global-skip-cleanup": reportGlobalSkipCleanup, + "--builder-computed-skip-cleanup": reportComputedSkipCleanup, } } else { flags = map[string]common.ReportFunc{ diff --git a/plugins/buildpacks/src/subcommands/subcommands.go b/plugins/buildpacks/src/subcommands/subcommands.go index 8f110e20b..0e25c029f 100644 --- a/plugins/buildpacks/src/subcommands/subcommands.go +++ b/plugins/buildpacks/src/subcommands/subcommands.go @@ -36,7 +36,7 @@ func main() { args.Parse(os.Args[2:]) appName := args.Arg(0) if *branch == "" { - *branch = common.PropertyGet("git", appName, "deploy-branch") + *branch = common.PropertyGet("git", appName, "deploy-branch") } err = buildpacks.CommandDetect(appName, *branch) case "list": diff --git a/plugins/buildpacks/subcommands.go b/plugins/buildpacks/subcommands.go index f57b97c17..fb9e7fa93 100644 --- a/plugins/buildpacks/subcommands.go +++ b/plugins/buildpacks/subcommands.go @@ -39,9 +39,9 @@ func CommandDetect(appName string, branch string) (err error) { workDir := common.AppRoot(appName) checkedOutDir, err := checkoutBareGitRepo(workDir, branch) - if err != nil { - return err - } + if err != nil { + return err + } defer func() { if err := os.RemoveAll(checkedOutDir); err != nil { common.LogWarn(fmt.Sprintf("Failed to remove temporary directory %s: %v", checkedOutDir, err)) diff --git a/plugins/common/report_test.go b/plugins/common/report_test.go index 747d58d68..9759367f1 100644 --- a/plugins/common/report_test.go +++ b/plugins/common/report_test.go @@ -208,8 +208,8 @@ func TestReportSingleAppJSONNonPluginPrefixKey(t *testing.T) { // Keys that don't start with --- should pass through with // only the leading "--" stripped, regardless of TrimPrefix. infoFlags := map[string]string{ - "--build-id": "abc123", - "--builds-retention": "5", + "--build-id": "abc123", + "--builds-retention": "5", } out := captureStdout(t, func() { diff --git a/plugins/docker-options/dockeroptions.go b/plugins/docker-options/dockeroptions.go index c6bdfe55a..92a9ac34c 100644 --- a/plugins/docker-options/dockeroptions.go +++ b/plugins/docker-options/dockeroptions.go @@ -154,9 +154,12 @@ func joinShellTokens(tokens []string) string { // quoteShellArg returns s wrapped in single quotes when it contains characters // the shell would otherwise interpret (whitespace, quotes, expansion sigils, // globs, redirections, etc.). Embedded single quotes are escaped with the -// standard `'\''` close-escape-open sequence. Tokens free of such characters -// are returned verbatim so the stored representation stays human-readable for -// the common case. +// standard close-escape-open sequence: +// +// '\'' +// +// Tokens free of such characters are returned verbatim so the stored +// representation stays human-readable for the common case. func quoteShellArg(s string) string { if s == "" { return "''" diff --git a/plugins/nginx-vhosts/template_test.go b/plugins/nginx-vhosts/template_test.go index 5e7817357..f1699656f 100644 --- a/plugins/nginx-vhosts/template_test.go +++ b/plugins/nginx-vhosts/template_test.go @@ -22,43 +22,43 @@ func templatePath(t *testing.T) string { func defaultVars() map[string]interface{} { return map[string]interface{}{ - "APP": "app", - "DOKKU_ROOT": "/home/dokku", - "DOKKU_LIB_ROOT": "/var/lib/dokku", - "NOSSL_SERVER_NAME": "app.example.com", - "SSL_SERVER_NAME": "", - "SSL_INUSE": "", - "APP_SSL_PATH": "/home/dokku/app/tls", - "DOKKU_APP_WEB_LISTENERS": "127.0.0.1:5000", - "PROXY_PORT_MAP": "http:80:5000", - "PROXY_UPSTREAM_PORTS": "5000", - "PROXY_PORT": "80", - "PROXY_SSL_PORT": "443", - "PROXY_KEEPALIVE": "", - "NGINX_BIND_ADDRESS_IP4": "", - "NGINX_BIND_ADDRESS_IP6": "::", - "NGINX_ACCESS_LOG_PATH": "/var/log/nginx/app-access.log", - "NGINX_ACCESS_LOG_FORMAT": "", - "NGINX_ERROR_LOG_PATH": "/var/log/nginx/app-error.log", - "NGINX_UNDERSCORE_IN_HEADERS": "off", - "CLIENT_BODY_TIMEOUT": "60s", - "CLIENT_HEADER_TIMEOUT": "60s", - "CLIENT_MAX_BODY_SIZE": "1m", - "KEEPALIVE_TIMEOUT": "75s", - "LINGERING_TIMEOUT": "5s", - "SEND_TIMEOUT": "60s", - "PROXY_CONNECT_TIMEOUT": "60s", - "PROXY_READ_TIMEOUT": "60s", - "PROXY_SEND_TIMEOUT": "60s", - "PROXY_BUFFER_SIZE": "4k", - "PROXY_BUFFERING": "on", - "PROXY_BUFFERS": "8 4k", - "PROXY_BUSY_BUFFERS_SIZE": "8k", - "PROXY_X_FORWARDED_FOR": "$remote_addr", - "PROXY_X_FORWARDED_PORT": "$server_port", - "PROXY_X_FORWARDED_PROTO": "$scheme", - "PROXY_X_FORWARDED_SSL": "", - "HTTP2_DIRECTIVE_SUPPORTED": "true", + "APP": "app", + "DOKKU_ROOT": "/home/dokku", + "DOKKU_LIB_ROOT": "/var/lib/dokku", + "NOSSL_SERVER_NAME": "app.example.com", + "SSL_SERVER_NAME": "", + "SSL_INUSE": "", + "APP_SSL_PATH": "/home/dokku/app/tls", + "DOKKU_APP_WEB_LISTENERS": "127.0.0.1:5000", + "PROXY_PORT_MAP": "http:80:5000", + "PROXY_UPSTREAM_PORTS": "5000", + "PROXY_PORT": "80", + "PROXY_SSL_PORT": "443", + "PROXY_KEEPALIVE": "", + "NGINX_BIND_ADDRESS_IP4": "", + "NGINX_BIND_ADDRESS_IP6": "::", + "NGINX_ACCESS_LOG_PATH": "/var/log/nginx/app-access.log", + "NGINX_ACCESS_LOG_FORMAT": "", + "NGINX_ERROR_LOG_PATH": "/var/log/nginx/app-error.log", + "NGINX_UNDERSCORE_IN_HEADERS": "off", + "CLIENT_BODY_TIMEOUT": "60s", + "CLIENT_HEADER_TIMEOUT": "60s", + "CLIENT_MAX_BODY_SIZE": "1m", + "KEEPALIVE_TIMEOUT": "75s", + "LINGERING_TIMEOUT": "5s", + "SEND_TIMEOUT": "60s", + "PROXY_CONNECT_TIMEOUT": "60s", + "PROXY_READ_TIMEOUT": "60s", + "PROXY_SEND_TIMEOUT": "60s", + "PROXY_BUFFER_SIZE": "4k", + "PROXY_BUFFERING": "on", + "PROXY_BUFFERS": "8 4k", + "PROXY_BUSY_BUFFERS_SIZE": "8k", + "PROXY_X_FORWARDED_FOR": "$remote_addr", + "PROXY_X_FORWARDED_PORT": "$server_port", + "PROXY_X_FORWARDED_PROTO": "$scheme", + "PROXY_X_FORWARDED_SSL": "", + "HTTP2_DIRECTIVE_SUPPORTED": "true", } } @@ -266,8 +266,8 @@ func TestTemplate_XForwardedSSL(t *testing.T) { func TestTemplate_NginxConfDIncludeAlways(t *testing.T) { cases := []struct { - name string - mutate func(map[string]interface{}) + name string + mutate func(map[string]interface{}) }{ {"http", func(v map[string]interface{}) {}}, {"http_redirect", func(v map[string]interface{}) { diff --git a/plugins/ports/proxy.go b/plugins/ports/proxy.go index c8855b6e4..8daf37c43 100644 --- a/plugins/ports/proxy.go +++ b/plugins/ports/proxy.go @@ -4,7 +4,6 @@ import ( "fmt" ) - // PortMap is a struct that contains a scheme:host-port:container-port mapping type PortMap struct { // ContainerPort is the port on the container diff --git a/plugins/ps/report.go b/plugins/ps/report.go index cc1842527..0ca8a69ba 100644 --- a/plugins/ps/report.go +++ b/plugins/ps/report.go @@ -30,27 +30,27 @@ func ReportSingleApp(appName string, format string, infoFlag string) error { } } else { flags = map[string]common.ReportFunc{ - "--deployed": reportDeployed, - "--processes": reportProcesses, - "--ps-can-scale": reportCanScale, - "--ps-computed-dockerfile-start-cmd": reportComputedDockerfileStartCmd, - "--ps-computed-procfile-path": reportComputedProcfilePath, - "--ps-computed-restart-policy": reportComputedRestartPolicy, - "--ps-computed-skip-deploy": reportComputedSkipDeploy, - "--ps-computed-start-cmd": reportComputedStartCmd, - "--ps-computed-stop-timeout-seconds": reportComputedStopTimeoutSeconds, - "--ps-dockerfile-start-cmd": reportDockerfileStartCmd, - "--ps-global-procfile-path": reportGlobalProcfilePath, - "--ps-global-restart-policy": reportGlobalRestartPolicy, - "--ps-global-skip-deploy": reportGlobalSkipDeploy, - "--ps-global-stop-timeout-seconds": reportGlobalStopTimeoutSeconds, - "--ps-procfile-path": reportProcfilePath, - "--ps-restart-policy": reportRestartPolicy, - "--ps-skip-deploy": reportSkipDeploy, - "--ps-start-cmd": reportStartCmd, - "--ps-stop-timeout-seconds": reportStopTimeoutSeconds, - "--restore": reportRestore, - "--running": reportRunningState, + "--deployed": reportDeployed, + "--processes": reportProcesses, + "--ps-can-scale": reportCanScale, + "--ps-computed-dockerfile-start-cmd": reportComputedDockerfileStartCmd, + "--ps-computed-procfile-path": reportComputedProcfilePath, + "--ps-computed-restart-policy": reportComputedRestartPolicy, + "--ps-computed-skip-deploy": reportComputedSkipDeploy, + "--ps-computed-start-cmd": reportComputedStartCmd, + "--ps-computed-stop-timeout-seconds": reportComputedStopTimeoutSeconds, + "--ps-dockerfile-start-cmd": reportDockerfileStartCmd, + "--ps-global-procfile-path": reportGlobalProcfilePath, + "--ps-global-restart-policy": reportGlobalRestartPolicy, + "--ps-global-skip-deploy": reportGlobalSkipDeploy, + "--ps-global-stop-timeout-seconds": reportGlobalStopTimeoutSeconds, + "--ps-procfile-path": reportProcfilePath, + "--ps-restart-policy": reportRestartPolicy, + "--ps-skip-deploy": reportSkipDeploy, + "--ps-start-cmd": reportStartCmd, + "--ps-stop-timeout-seconds": reportStopTimeoutSeconds, + "--restore": reportRestore, + "--running": reportRunningState, } extraFlags := addStatusFlags(appName, infoFlag) diff --git a/plugins/scheduler-k3s/k8s_test.go b/plugins/scheduler-k3s/k8s_test.go index 8ac3ad35c..a5028c98c 100644 --- a/plugins/scheduler-k3s/k8s_test.go +++ b/plugins/scheduler-k3s/k8s_test.go @@ -41,11 +41,11 @@ func TestGetLowestNodeVersion(t *testing.T) { } cases := []struct { - name string - nodes []*corev1.Node - selector string - want string - wantErr string + name string + nodes []*corev1.Node + selector string + want string + wantErr string }{ { name: "single control-plane node returns its kubelet version", diff --git a/plugins/scheduler-k3s/triggers_test.go b/plugins/scheduler-k3s/triggers_test.go index c12748810..fd19e804a 100644 --- a/plugins/scheduler-k3s/triggers_test.go +++ b/plugins/scheduler-k3s/triggers_test.go @@ -88,7 +88,7 @@ func TestMigrateChartPropertiesToMapFormatPreservesExistingNonOverlappingKeys(t setupChartMigrationTest(t) Expect(common.PropertyMapWrite("scheduler-k3s", "--global", "chart-overrides.cert-manager", map[string]string{ - "installCRDs": "true", + "installCRDs": "true", "service.annotations.prometheus.io/scrape": "true", })).To(Succeed()) Expect(common.PropertyWrite("scheduler-k3s", "--global", "chart.cert-manager.installCRDs", "false")).To(Succeed()) @@ -99,9 +99,9 @@ func TestMigrateChartPropertiesToMapFormatPreservesExistingNonOverlappingKeys(t got, err := common.PropertyMapGet("scheduler-k3s", "--global", "chart-overrides.cert-manager") Expect(err).NotTo(HaveOccurred()) Expect(got).To(Equal(map[string]string{ - "installCRDs": "false", + "installCRDs": "false", "service.annotations.prometheus.io/scrape": "true", - "version": "1.13.3", + "version": "1.13.3", })) }