Commit Graph

313 Commits

Author SHA1 Message Date
Jose Diaz-Gonzalez
5d5d56c560 refactor: remove public exposure of DOKKU_APP_TYPE in favor of builder detected property
The DOKKU_APP_TYPE has long since ceased to be the correct way to specify the builder for the application. It's only usage has been during the detection phase, specifically to ensure that the herokuish plugin injects the correct docker arguments during the build. As such, it is safe to migrate away to a property in a patch release.

Users that seek to set a specific builder should use 'dokku builder:set $APP selected' instead.

Refs #7863
2025-08-21 23:59:41 -04:00
Jose Diaz-Gonzalez
577f46153f refactor: use helper go functions to handle extracting files from a repository
This standardizes the extraction code and makes it easier to reuse in future implementations of file extraction.

Additionally, this adds a way to extract folders from codebases.
2025-07-23 18:16:16 -04:00
Jose Diaz-Gonzalez
becba49c87 refactor: always use golang version of CopyFromImage 2024-12-16 01:47:00 -05:00
Jose Diaz-Gonzalez
83b89453a5 feat: write current process id to all acquired lock files
This allows us to check on what process created a lock.

Additionally, we now always have a DOKKU_PID value, even when running in cron (which does not have access to BASH_PID.
2024-03-14 08:18:35 -04:00
Jose Diaz-Gonzalez
50958fc448 refactor: remove git:unlock command
This is no longer necessary with improvements elsewhere in Dokku.
2024-03-13 06:24:30 -04:00
Jose Diaz-Gonzalez
0d6bde2eff Merge pull request #6156 from dokku/migrate-lock-path
Migrate the app deploy lock to the data directory
2024-03-12 22:24:55 -04:00
Jose Diaz-Gonzalez
87bde84115 fix: handle case where most builders didn't detect amd64 images on arm64
Images would build but then fail to be tagged, causing deployment problems on arm64 architectures for a small number of images.

Also fix a minor issue in the nixpacks builder that caused any pre-release-builder triggers that consumed the image to get an empty string instead.
2024-03-06 19:02:08 -05:00
Tasos Maschalidis
f574c1d0a3 Handle DOKKU_FORCE_TTY in has_tty function 2024-02-11 00:57:44 +02:00
Jose Diaz-Gonzalez
db476d3b51 chore: run shfmt 2024-02-09 14:53:45 -05:00
Jose Diaz-Gonzalez
f0c6f45596 fix: correctly namespace the lock file 2024-02-09 14:38:43 -05:00
Jose Diaz-Gonzalez
b7a3ef2f8a fix: use correct path for lock 2024-02-09 14:34:32 -05:00
Jose Diaz-Gonzalez
126a3ed509 chore: remove deprecated proxy-ports functions and and plugin subcommands
These were deprecated in 0.31.0 in favor of the ports plugin.
2023-10-16 00:18:39 -04:00
Jose Diaz-Gonzalez
ffc64e7d8b feat: add a shell function to check if a plugin trigger exists 2023-10-15 20:25:08 -04:00
Jose Diaz-Gonzalez
625ea14c8f feat: add openresty proxy implementation
This plugin is mostly compatible with the nginx plugin, but runs the proxy within a docker container. Users do not have direct access to add custom openresty configuration at this time, but instead receive the ability to setup automatic ssl on first request via letsencrypt integration.
2023-08-05 20:59:01 -04: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
192f7cf768 refactor: move code for fetching an available port to the ports plugin
Also translate the code to golang.
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
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
e628e21879 chore: remove deprecated --rm-container and--rm global flags 2023-02-12 13:09:00 -05:00
Jose Diaz-Gonzalez
d27c8f09d1 chore: remove deprecated common functions 2023-02-12 13:08:45 -05:00
Jose Diaz-Gonzalez
a2444b453d chore: remove deprecated --detach flag
This option was deprecated in Dokku 0.25.0.
2023-01-16 01:19:39 -05:00
Jose Diaz-Gonzalez
80fd9bbd4b fix: run linting 2022-12-02 16:00:32 -05:00
Jose Diaz-Gonzalez
c2ebf48524 refactor: use a single implementation for checking cnb/herokuish images
Also use a plugin trigger for testing whether an image is herokuish or not rather than trying to mess around with sourced files.
2022-12-02 15:54:48 -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
daa4ee829e fix: run shfmt 2022-11-22 20:34:23 -05:00
Jose Diaz-Gonzalez
c74e6ce216 refactor: use a common wrapper function to migrate config vars to properties 2022-11-22 20:27:43 -05:00
Jose Diaz-Gonzalez
4a9bdd6dc2 fix: add missing {{end}} to docker format template 2022-11-07 10:07:48 -05:00
Jose Diaz-Gonzalez
3ff5e0e3a6 fix: error out if commands using compose are executed
Refs #5335
2022-11-05 23:44:51 -04:00
Jose Diaz-Gonzalez
a71e4219be fix: set the correct image source type based on label
We also have a special carveout for herokuish as folks may deploy built images with it.
2022-08-09 02:11:32 -04:00
Jose Diaz-Gonzalez
cfc1cfb305 feat: export DOKKU_COMMAND for use in authentication systems
Some auth systems may decide that an app is not available for use by a particular command vs making them wholly available or not. Exporting the variable here allows such systems to function correctly.
2022-07-17 17:58:37 -04:00
Jose Diaz-Gonzalez
db4d8dba88 refactor: consolidate app name verification into golang binary
This change ensures we only have to change this logic once in order to get them to apply to both languages in the codebase.
2022-05-29 11:32:24 -04:00
Jose Diaz-Gonzalez
b3d7174a7a fix: filter apps when verifying app names
This ensures folks can't interact with apps that are hidden from them via the filtering performed in app listing.
2022-05-27 23:28:59 -04:00
Jose Diaz-Gonzalez
f87cd22340 feat: allow returning an unfiltered list of users
This is useful for upgrades or commands that _must_ perform against all apps.
2022-05-15 15:33:19 -04:00
Jose Diaz-Gonzalez
3daf33d5c2 fix: correct shfmt issue 2022-04-20 20:09:16 -04:00
Jose Diaz-Gonzalez
157297ab87 feat: ensure the image tag is correct if a build fails
Either retag the original image or remove the tag completely.
2022-04-20 20:09:16 -04:00
Jose Diaz-Gonzalez
63d7d28036 fix: correct a few shellcheck issues 2022-04-20 20:09:16 -04:00
Jose Diaz-Gonzalez
49d08a8fb6 fix: pass along failed build status when building from image 2022-04-16 02:44:51 -04:00
Jose Diaz-Gonzalez
62a3eff5bb refactor: move apps listing from common plugin to apps plugin
This helps centralize app-related listing fetching.
2022-02-26 00:37:51 -05:00
Jose Diaz-Gonzalez
b48b79f5ca feat: allow specifying a single process type to restart
This changes restarts to drop the 'release' part that currently gets triggered, which also helps reduce the possibility that a new image layer will be added due to predeploy deploy triggers.

Note that the old method essentially halfway-rebuilt the app (which was what added the extra layer). This refactor removes that, which is a bc-break.

Additionally, scaling processes will result in deploying _only_ restarting the processes being scaled.

Closes #2184
2021-10-09 18:46:17 -04:00
Jose Diaz-Gonzalez
d1a16717b3 chore: remove deprecated tar plugin
This plugin was deprecated in 0.24.0 in favor of git:from-archive. Users should migrate to the new command.
2021-10-09 18:43:53 -04:00
Jose Diaz-Gonzalez
3c6396fbca feat: implement the scheduler plugin
This also performs a one-time migration of the DOKKU_SCHEDULER values the scheduler plugin properties.

Closes #4739
2021-10-09 18:31:59 -04:00
Jose Diaz-Gonzalez
257abfaee8 refactor: move pre-deploy call to post-release-builder
Some of the hooks should happen before we push images out...
2021-08-14 01:58:35 -04:00
Jose Diaz-Gonzalez
7bf61b401f fix: call pre-deploy before deploy but after release
The dokku_release command adds more "stuff" by virtue of calling builder-release (the herokuish builder injects env vars).

This more closely matches previous order of operations.

Closes #4737
2021-08-12 17:35:54 -04:00
Jose Diaz-Gonzalez
e1f1531d42 refactor: call golang version of docker cleanup from shell
This ensures there is only a single implementation.
2021-08-08 01:56:43 -04:00
Jose Diaz-Gonzalez
f0ca3fef54 fix: correct count check for user-auth trigger
There are cases where the user-auth plugin exists but the events plugin is not enabled, and this accounts for that.
2021-08-07 17:55:56 -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
e0a513650e Merge pull request #4715 from dokku/2574-use-sslip
Switch from xip.io to sslip.io
2021-08-06 02:15:53 -04:00
Jose Diaz-Gonzalez
ecb8a02356 feat: switch from xip.io to sslip.io
xip.io appears to be unsupported after an exodus at basecamp. Switching to sslip.io seems like a decent move.

Refs #2574
2021-08-05 23:30:58 -04:00
Jose Diaz-Gonzalez
30a15aaa7a fix: respect pre-deploy task image manipulation
This requires a bc-incompatible break in terms of what triggers the pre-deploy hook (dokku internals vs schedulers).
2021-08-05 04:17:21 -04:00
Jose Diaz-Gonzalez
14b511d673 fix: correct lint error 2021-07-27 13:16:33 -04:00