147 Commits

Author SHA1 Message Date
Jose Diaz-Gonzalez
6bb20e9b27 chore: remove nginx checks for functionality that always exists
TLS 1.3, HTTP2 and GRPC are now standard in all operating systems where Dokku is supported.
2025-11-21 22:05:20 -05:00
Jose Diaz-Gonzalez
0033a52e28 fix: ignore extra strings on the nginx ubuntu version 2025-10-27 00:19:41 -04:00
Jose Diaz-Gonzalez
933a174dfd fix: use updated http2 directive for setting http2 support
Closes #7997
2025-10-19 23:51:17 -04:00
Jose Diaz-Gonzalez
0cb1adb38a fix: allow nginx commands when the scheduler is set to null 2024-11-03 00:01:19 -04:00
Jose Diaz-Gonzalez
90e8cac12f feat: implement nginx:show-config for k3s plugin
This allows users to see what nginx configs are in use for their applications.

Closes #7291
2024-10-21 22:09:09 -04:00
Jose Diaz-Gonzalez
51b951643b fix: respect the exit code and pass flags correctly when tailing nginx logs on k3s 2024-10-21 21:51:37 -04:00
Jose Diaz-Gonzalez
30a2da196b fix: use correct name for scheduler-proxy-logs trigger 2024-10-20 23:41:54 -04:00
Jose Diaz-Gonzalez
611006af73 feat: add support for non-local nginx implementations
If the scheduler is not docker-local, we will assume that a separate plugin trigger will pull access/error logs on our behalf. For k3s, the naive implementation is to pull logs from a single container (multiple ingress-nginx pods will be supported in a future release).

Closes #7268
2024-10-17 00:18:24 -04:00
Jose Diaz-Gonzalez
4d7f779c28 feat: add support for various timeout-related functions to nginx, openresty and k3s plugins
Closes #7267
2024-10-16 00:51:01 -04:00
Jose Diaz-Gonzalez
d3e5b573d7 feat: add logging when hsts nginx config is not using built-in template
Also updates logging for the app-config template.
2024-07-13 17:10:34 -04:00
Jose Diaz-Gonzalez
b99c25f090 feat: add support for setting underscores-in-headers for nginx, openresty, and k3s
Closes #6627
2024-02-27 13:49:44 -05:00
Jose Diaz-Gonzalez
d4b445985b refactor: consolidate property fetching for nginx plugin into golang codebase
Also update the documentation to include docs for all properties.
2024-02-06 00:42:48 -05:00
Jose Diaz-Gonzalez
f8ccf52079 refactor: only use detected port mapping if override is not specified
Previously, we would always set the port mapping during a dockerfile build, making it difficult for users to override mappings. We also only _sometimes_ updated the detected port mapping, further confusing issues when users were migrating from Dockerfile to Buildpacks for builds.

Now, we always detect the port mapping during the build process, and only use that detected port mapping if an override is not specified. This greatly simplifies the experience around port mapping, as now a user can create an app, set a port mapping, and that first deploy will respect the port mapping without an additional deploy.

The builder always has the best context for what the app should be listening on, and thus we can always specify a "default" port mapping at this stage. Users can override this map as desired later.

This change also results in the removal of a ton of internal code that is now centralized in the ports plugin.

Closes #4067
2023-08-05 10:58:57 -04:00
Jose Diaz-Gonzalez
3f127a7cc4 feat: inject docker labels when nginx proxy implementation is in use
This will allow users to switch to a docker label-based nginx proxy server transparently without rebuilds (after the first one), which would mimic how the caddy, haproxy, and traefik proxy implementations work.

See https://github.com/dokku/nginx-docker-proxy for an example server implementation.
2023-08-05 10:58:57 -04:00
Jose Diaz-Gonzalez
48d5820b8c refactor: deprecate proxy-configure-ports plugin trigger in favor of ports-configure
This also rewrites the logic to be in golang, which will make it easier to refactor portions of it to use the property system going forward.
2023-08-05 10:58:57 -04:00
Jose Diaz-Gonzalez
121e4737a8 refactor: move code that fetches raw tcp ports for dockerfile deploys to ports plugin 2023-08-05 10:58:57 -04:00
Jose Diaz-Gonzalez
914475f3e4 refactor: use ports-get plugn trigger for fetching port mappings
This removes use of ports internals from other plugins, which will make it easier to refactor the underlying property storage.
2023-08-05 10:58:57 -04:00
Jose Diaz-Gonzalez
ef25a9b0d8 refactor: standardize on shorthand for redirecting all output to /dev/null
The shorthand is more prevalent in this codebase, and is something that bash supports, so we should just use the same thing everywhere.

Note that we do not use shorthand redirect in Makefile as shell parsing is a bit different in Make and the shorthand redirect doesn't seem to be properly supported, causing CI errors.
2023-08-05 10:58:57 -04:00
Jose Diaz-Gonzalez
dac566e75e refactor: move all shellcheck disable definitions to .shellcheckrc file
This makes standard use of shellcheck work without needing to provide extra configuration anywhere.

Also remove use of inline 'shellcheck disable' calls that are already defined in the .shellcheckrc and don't need to be set inline.
2023-08-05 10:58:57 -04:00
Jose Diaz-Gonzalez
ca1ab188fe chore: drop SPDY
This hasn't been supported by browsers in quite a while and nginx will set a warning as of Ubuntu 20.04 when the header is referenced.
2022-12-29 01:59:54 -05:00
Jose Diaz-Gonzalez
edd6e476b3 refactor: simplify how url generation works
The URLS file is no longer necessary as urls are now generated directly from the app VHOST file.

This also moves all the url generation logic to the domains plugin.
2022-12-02 02:19:59 -05:00
Jose Diaz-Gonzalez
67c243b0ba fix: keep track of case where current deployment does not have a custom nginx.conf.sigil 2022-11-24 00:51:58 -05:00
Jose Diaz-Gonzalez
e3fa0c4bc4 refactor: move nginx.conf.sigil files into app-specific directories 2022-11-23 20:16:28 -05:00
Jose Diaz-Gonzalez
140c1e4d4c feat: scope the custom config to the current DOKKU_PID 2022-11-23 19:43:29 -05:00
Jose Diaz-Gonzalez
b166db90e6 fix: do not reuse app-specific nginx.conf.sigil globally 2022-11-23 19:41:56 -05:00
Jose Diaz-Gonzalez
17814d4847 refactor: only extract the nginx.conf.sigil from the source code and not an app path
The previous method was a bit more difficult for users to interact with as they needed to ensure the file was at a certain path in the built image. This change divorces the file from the built artifact, better aligning the nginx.conf.sigil handling with the rest of Dokku's monorepo support.

A side effect of this is now building proxy configurations does not require access to the built image.

Closes #5207
2022-11-23 19:32:53 -05:00
Jose Diaz-Gonzalez
4ef260f57a fix: ignore https mappings when no ssl certificate exists
This fixes issues where users may somehow add an https mapping but are missing an ssl certificate, causing nginx to not load properly. We now ignore the mapping and warn users of the misconfiguration.

Closes #5368
2022-10-22 17:47:54 -04:00
Jose Diaz-Gonzalez
b605de522c refactor: split out proxy port configuration into it's own trigger
This will allow it to be called by plugins other than the nginx-vhosts one.
2022-08-10 04:23:05 -04:00
Jose Diaz-Gonzalez
268c318bc5 fix: ensure we do not filter apps for certain commands and triggers
Some things must pull *all* apps vs filtered apps (mostly things that write out config files or install triggers). Using an unflitered list is best.

Also, we default to filtering, which should be what most usage needs.
2022-05-15 15:47:13 -04:00
Femi Omojola
c75fe998e2 shfmt fixes 2021-12-31 00:48:47 -05:00
fomojola
55d8e2db81 Formatting fixes 2021-12-30 22:56:47 -05:00
fomojola
c209787de8 Conditionally restart NGINX
Before restarting nginx, check if the current app is using a proxy and if the selected proxy is in fact NGINX. Only then should we bother invoking the nginx reload.

Fixes https://github.com/dokku/dokku/issues/4987
2021-12-30 22:49:57 -05:00
Jose Diaz-Gonzalez
c045b1ca6b chore: capitalize certain log messages for aesthetic reasons 2021-09-05 00:36:58 -04:00
Jose Diaz-Gonzalez
a1c768b9b3 refactor: drop web installer in favor of setup via cli
This makes the installation a bit more secure by ensuring a user does not accidentally expose a way for unauthorized users to add new ssh keys to the system.

Additionally, this removes the extra HOSTNAME file to make the initial install process easier (that file was not modifiable by any dokku commands.

Closes #2247
2021-08-07 16:36:41 -04:00
Jose Diaz-Gonzalez
9ecfa843f0 feat: add support for routing an app to a specified host:port
This is useful when there is a service not managed by Dokku but should be exposed via the Dokku routing layer. As an example, some binaries (consul, nomad, vault) expose web uis, and are traditionally run on the host directly vs in a container.

Closes #4665
2021-08-06 01:29:25 -04:00
Jose Diaz-Gonzalez
8fc0cb67ec chore: drop unnecessary line stripping
Since this comes out of ps-current-scale, we can ensure the contents are always valid.
2021-08-01 16:33:42 -04:00
Jose Diaz-Gonzalez
550a0bd07b fix: properly parse input from ps-current-scale 2021-08-01 01:53:46 -04:00
Jose Diaz-Gonzalez
213f7d224c refactor: use ps-current-scale instead of parsing DOKKU_SCALE file when iterating over deployed processes 2021-08-01 01:43:35 -04:00
Jose Diaz-Gonzalez
f7e218637e feat: add ability to specify X-Forwarded-Ssl header for proxied requests
Closes #4401
2021-02-20 00:03:25 -05:00
Jose Diaz-Gonzalez
277e9691e1 feat: add ability to set client max body size via nginx:set
This simplifies increasing upload size by making it a property, and is backwards compatible with installations that have set that in a custom file.
2021-01-21 01:41:34 -05:00
Bjorn Post
a6062d4ab4 feat: make feature more generic, also add support for setting -port and -proto values via nginx:set, refs #4339 2021-01-19 21:40:47 +01:00
Bjorn Post
7cd6f7666c feat: configure trust x-forwarded-for headers via nginx:set iso trust by default, refs #4339 2021-01-18 21:09:00 +01:00
Jose Diaz-Gonzalez
90c68ba02f fix: correct position of app name check for nginx:validate-config 2020-12-29 02:46:18 -05:00
Jose Diaz-Gonzalez
08fdfd1e38 feat: drop internal calls to verify_app_name 2020-12-27 15:14:11 -05:00
Andrew Kane
c0581a0e37 feat: add ability to change the access log format 2020-11-30 21:59:36 -08:00
Jose Diaz-Gonzalez
1b4559c4a4 chore: drop unused ps import 2020-11-21 20:57:33 -05:00
Yihao
30414cbd0c feat: Allow controlling nginx proxy-buffer-size, proxy-buffering, proxy-buffers, proxy-busy-buffers-size 2020-09-19 09:51:55 +09:30
Jose Diaz-Gonzalez
becf7c1f86 feat: allow customizing the various nginx templates
This will let custom distributions of Dokku to override the internal templates without needing to repackage Dokku or overwrite core files.
2020-09-06 13:57:35 -04:00
Jose Diaz-Gonzalez
f5ba843cf3 feat: add ability to disable custom ninx.conf.sigil extraction
Closes #4087
2020-09-04 11:29:23 -04:00
Hugo Peixoto
2160a8b64e Use *_PATH consistently
GLOBAL_VHOST_PATH and GLOBAL_VHOST_FILE were used to represent the same
thing. Same for APP_URLS_PATH and APP_VHOST_PATH.

This normalizes all of those to _PATH.
2020-07-16 05:40:56 +01:00