Commit Graph

51 Commits

Author SHA1 Message Date
Jose Diaz-Gonzalez
6a0701fa65 chore: revert doc change 2025-07-02 01:15:27 -04:00
Álvaro Justen (@turicas)
b97086a8bd domains:clear now removes ALL app domains 2025-07-01 20:11:48 -04:00
Jose Diaz-Gonzalez
c5847184c0 fix: call post-domains-update when domains are enabled/disabled for an app 2025-03-10 12:50:31 -04:00
Jose Diaz-Gonzalez
70d2f24e1d feat: add ability to disable vhosts for all apps
Closes #6967
2025-03-10 11:51:53 -04:00
Jose Diaz-Gonzalez
71214be1bd fix: ensure app clones have domains setup
Closes #6146
2023-08-27 23:00:18 -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
josegonzalez
fd1f80c485 feat: allow setting _ as domain name for default nginx routing
Closes #5845
2023-05-13 13:56:23 -04: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
c8a34f906a chore: remove unused ipv4/ipv6 regex fetch 2022-11-23 16:42:58 -05:00
Jose Diaz-Gonzalez
c68ae008cc fix: ensure permissions for global VHOST file are set to the dokku user on install 2022-05-10 12:44:01 -04:00
Jose Diaz-Gonzalez
6e7e69b19d fix: force grep to run in quiet mode in domains:add call 2021-08-08 14:50:44 -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
02a8409114 tests: fix shfmt issues 2021-02-13 02:05:44 -05:00
Jose Diaz-Gonzalez
08fdfd1e38 feat: drop internal calls to verify_app_name 2020-12-27 15:14:11 -05:00
Hugo Peixoto
d5b2d0d98e Stop using VHOST when listing app domains and urls 2020-07-19 16:29:35 +01:00
Hugo Peixoto
1b7761ce8d Refactor domain add functions 2020-07-19 16:29:11 +01: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
Jose Diaz-Gonzalez
61a306664f refactor: move domain manipulation into triggers
This allows other plugins to avoid understanding the underlying details of how domains might be integrated with.
2020-05-06 00:16:51 -04:00
Jose Diaz-Gonzalez
e19b52442b fix: remove deprecated egrep calls from codebase 2020-02-17 05:59:52 -05:00
Kazuhiro NISHIYAMA
082e9458e5 Simplify hostname_regex
`[a-z0-9\.\*-]+` includes `\.` and `[a-z0-9\*-]+`.
So I think `^([a-z0-9\.\*-]+\.)*[a-z0-9\*-]+$` means last char is `[a-z0-9\*-]`
and other optional chars are `[a-z0-9\.\*-]*`.
2019-05-23 23:23:10 +09:00
Jose Diaz-Gonzalez
919ba7ed93 fix: correct issue with clearing global domains
Also update tests
2019-05-23 06:18:22 -04:00
Jose Diaz-Gonzalez
b921aed073 feat: allow users to specify wildcard domains
Closes #3075
2019-05-20 21:03:55 -07:00
Jose Diaz-Gonzalez
2315a127ea Merge pull request #3540 from dokku/3529-better-default-vhost
Do not append the global domain for matching subdomains
2019-05-19 23:00:17 -07:00
Jose Diaz-Gonzalez
b429af8ff2 feat: do not append the global domain for matching subdomains
If the subdomain is url-like, assume it is a valid url and use it for the default domain name. This allows users to specify the default domain for an app even if that is a subdomain of a global vhost.

Closes #3529
2019-05-13 12:07:52 -04:00
Jose Diaz-Gonzalez
287f383f6c feat: add ability to clear global domains 2019-05-13 12:00:26 -04:00
Jose Diaz-Gonzalez
ef5a45c7cb feat: add DOKKU_QUIET_OUTPUT=1 to all config_set/config_unset calls
This makes build output a bit more digestable.
2019-03-13 02:05:18 -04:00
Jose Diaz-Gonzalez
c7b71b5d92 lint: remove unnecessary negation
Also use double-brackets where possible.

Fixes SC2236
2019-02-02 13:52:18 -05:00
Jose Diaz-Gonzalez
86795ddacc tests: run mvdan/shfmt on test runs
While I do not agree with _every_ style change, this will force Dokku to have consistent formatting across all shell scripts, which is arguably a Good Thing™.

The command used to reprocess everything is:

```shell
shfmt -l -bn -ci -i 2 -w .
```
2019-01-07 01:25:55 -05:00
Jose Diaz-Gonzalez
bf84f13938 refactor: move all vhost related functions to the domains plugin
These should never have been in common, and more directly relate to domain handling than anything else.

As this is a BC-break, merging will need to wait until the next minor.
2018-02-24 14:52:06 -05:00
Jose Diaz-Gonzalez
7c30babdec fix: Ensure VHOST files exist before executing commands against them
Closes #2609
2017-02-19 19:57:09 -05:00
Ilya Semenov
6a9b3f6df2 Add domains:set and domains:set-global commands 2016-11-28 22:44:06 +07:00
Kazuhiro NISHIYAMA
ccc44b0c16 Fix bug when VHOST without newline 2016-11-14 22:21:41 +09:00
Mirko Geissler
bdc3353a5c Remove domains:set-global command 2016-07-05 09:49:26 +02:00
Mirko Geissler
fa9c09ee7d Make description plural 2016-07-05 09:47:22 +02:00
Mirko Geissler
371949f4ec Create default app domain for every global domain 2016-07-05 09:45:17 +02:00
Mirko Geissler
164f48913f Add domains_add_global and domains_remove_global 2016-07-05 09:45:17 +02:00
Mirko Geissler
6286962c5c Use local 2016-07-05 09:45:17 +02:00
Mirko Geissler
0ae459a933 Remove unused local 2016-07-05 09:45:17 +02:00
Michael Hobbs
9a29cc59a8 reject invalid domains in domains:add. closes #2231 2016-06-10 13:10:11 -07:00
Michael Hanselmann
e0f6435d86 Fix removal of domains with schema
In at least one case a customer of ours added a domain including
a schema, as in “http://domain.tld/”. That is obviously incorrect, but
then they couldn't remove it using the dokku command:

  $ dokku domains:remove app7 http://domain.tld/
  sed: -e expression #1, char 9: unknown command: `/'

This patch changes the sed command to use the "\CregexpC" syntax. The
character used is a vertical pipe, which is far less likely to be used
in a URL. After the change:

  $ dokku domains:remove app7 http://domain.tld/
  -----> Removed http://domain.tld/ from app7

Signed-off-by: Michael Hanselmann <hansmi@vshn.ch>
2016-06-08 11:34:30 +02:00
Jeroen van Baarsen
86ef6ae5d1 Make sure we shift by 1 to remove the app_name from the $@ var 2016-05-10 21:31:53 +02:00
Jeroen van Baarsen
4f621916a7 Dont fail when adding a duplicated domain
Currently we exit when trying to add a duplicated domain, even if we give a list
of domain names. This behaviour is not as it suppose to work.

**Expected behaviour**
When adding a domain, and the domain already exists, just skip that domain, and
continue with the world. This is no problem since we are already in the state we
want to be in.

**New behaviour**
When you try to add a domain that is already added, we notify the user of this
by showing a log message: `Skipping: example.com already added to example app`,
and then we continue with the list of domain names.

Fixes #2165
2016-05-10 08:58:15 +02:00
Michael Hobbs
987c5cfb9c use declare for description variable 2016-03-08 15:30:34 -05:00
Michael S. Hobbs
89f289b433 subcommand restructure and bashstyle refactor. closes #1579 2016-03-03 22:11:35 -08:00
Michael Hobbs
d1b87bd7b7 cleanup shellcheck SC2086 2016-02-23 07:50:06 -08:00
Michael Hobbs
9842d7498b nginx-vhosts rewrite 2016-02-18 18:38:54 -08:00
Michael Hobbs
3e18d9aff9 create functions for app/global vhost detection. make VHOST setting more explicit 2015-09-18 16:48:18 -07:00
Michael Hobbs
4dd4d7c567 initial pass at nginx proxy without VHOST. closes #1123 2015-09-17 19:09:38 -07:00
Michael Hobbs
8095df79f6 implement core plugin mgmt using plugn. add tests. 2015-09-15 02:17:28 -07:00
Jose Diaz-Gonzalez
ad72a137e1 Fix sourcing of functions 2015-09-15 02:16:40 -07:00