Commit Graph

90 Commits

Author SHA1 Message Date
Jose Diaz-Gonzalez
cb063234a9 refactor: set the plugin name as the first argument to the service-action trigger
This is a breaking change, but is necessary as otherwise it is impossible to know which datastore plugin a team is meant for.
2022-07-10 15:29:11 -04:00
Jose Diaz-Gonzalez
fa10fa6a47 feat: implement service filtering
If a user implements the user-auth-service trigger in a plugin and that plugin does not echo the passed in app(s) on stdout, the app is assumed to not exist. This mirrors the functionality for applications in regards to auth filtering.

This may still need auditing to ensure it covers everything and doesn't cause issues, but local testing implies that everything is working as expected.
2022-07-07 02:54:14 -04:00
Jose Diaz-Gonzalez
76f2df71f4 fix: pin the image and image version of a created service at creation time
This will help ensure that users upgrading to a new plugin version who stop/start databases will always get the same version. This is particularly important for datastores such as elasticsearch and postgres that have more involved upgraded processes.
2021-09-13 02:28:41 -04:00
Jose Diaz-Gonzalez
daedb8e811 feat: allow setting shm-size on created containers
Refs dokku/dokku-postgres#188
Closes dokku/dokku-postgres#201
2021-09-13 00:46:48 -04:00
Jose Diaz-Gonzalez
27fab12470 Merge pull request #114 from Cellane/fix-export
Fix encoding issues when exporting database
2021-09-12 22:43:30 -04:00
Jose Diaz-Gonzalez
be56940b0f feat: add ability to set container config options during create/clone/upgrade actions
Also add to documentation where possible.

Closes dokku/dokku-mongo#131
2021-09-12 22:16:14 -04:00
Jose Diaz-Gonzalez
d4e550fa77 fix: allow non-english characters in :connect shell
Closes dokku/dokku-mysql#116
2021-09-12 08:25:16 -04:00
Jose Diaz-Gonzalez
c3e3495ff8 Merge branch 'master' into fix-export 2021-09-12 07:55:45 -04:00
Jose Diaz-Gonzalez
4441a63d5c feat: add the ability to constrain memory on service start/clone
Refs dokku/dokku-redis#86
2021-09-12 07:43:01 -04:00
Jose Diaz-Gonzalez
1e24241722 fix: force set memory limit in megabytes
The --memory flag is used by memcached in a form sans the unit, so we'll just force the unit and document it as such.
2021-09-12 07:21:01 -04:00
Jose Diaz-Gonzalez
ed649843c5 fix: correct lint error and ensure arg gets properly expanded 2021-09-12 07:19:26 -04:00
Jose Diaz-Gonzalez
2bdba0519d Merge pull request #120 from fruitl00p/patch-2
Support memory limit
2021-09-12 07:16:48 -04:00
Jose Diaz-Gonzalez
b5cb24fc6c chore: show a better error message when the image is missing
Refs dokku/dokku-clickhouse#4
2021-09-12 00:54:23 -04:00
Jose Diaz-Gonzalez
a309b0d1fe feat: add plugin trigger for service creation and deletion 2021-02-25 19:54:59 -05:00
Robin Speekenbrink
89cfdd7f0e Support memory limit
This adds the `--memory` / `-m` support for creating new mysql services.
2020-10-06 14:39:09 +02:00
Robin Speekenbrink
c2e58c773e Faster exporting for innodb tables
Since InnoDB is the standard, i'd like to add the option `--single-transaction --quick` to the mysqldump command. This should speed up larger database exports without tearing the environment up whilst doing so... 
(see https://dev.mysql.com/doc/refman/5.7/en/mysqldump.html#option_mysqldump_single-transaction)

Another way would be to allow for custom config to be loaded which inludes a optional `[mysqldump]` section... 

Another (even better perhaps) solution would be to have non-s3-backup command that utilizes the i.e. percona xtrabackup as the backup mechanism (and restore) but that changes from simple SQL backups to more advanced full database stuff...
2020-09-25 10:20:32 +02:00
Jose Diaz-Gonzalez
49c00a0479 fix: allow config directory to be configurable
For postgres, the config directory doesn't actually exist, so adding this configurability allows the plugin's info command to report correctly.
2020-05-16 02:49:34 -04:00
Jose Diaz-Gonzalez
3e7269293e feat: move all image names to config file
This allows us to more quickly update the image versions in use for tertiary images.
2020-03-30 20:09:03 -04:00
Milan Vit
6e448e9f02 Fix encoding issues when exporting database 2020-01-29 10:27:39 +09:00
Jose Diaz-Gonzalez
dc3bb16cfe chore: update dokku/wait version 2019-12-27 16:57:13 -05:00
Jose Diaz-Gonzalez
c585944582 chore: move to helper functions for fetching passwords 2019-07-11 16:34:35 -07:00
Jose Diaz-Gonzalez
3c28a9f2a7 feat: update ambassador, s3backup, and wait images 2019-07-11 14:31:47 -07:00
Jose Diaz-Gonzalez
4f7e01973a fix: ensure the tracked container id is up to date
If the ID file contained an incorrect value, calling :start would say the service is started but :info would still show the container as missing.

Also fix an issue where docker inspect leaked stderr when the container was missing.

Refs dokku/dokku-redis#133
2019-06-11 15:44:54 -04:00
Jose Diaz-Gonzalez
ce916eb846 feat: re-allow dashes in names
This PR allows dashes in service names, while still sanitizing them before they are used as database names. If the datastore is pre-existing, the datatabase name is assumed to be the same as the service name, and returned appropriately.
2019-05-30 17:03:48 -04:00
Jose Diaz-Gonzalez
6fe30de9f2 chore: run shfmt 2019-05-30 11:06:25 -04:00
Jose Diaz-Gonzalez
686f692cb2 feat: switch to updated wait image 2019-03-25 12:46:42 -04:00
Jose Diaz-Gonzalez
be0dbe5c5c fix: correct handling of container retrieval
In the previous method, if the container was renamed or there were multiple names attached to the container, fetching the container ID would fail as the regex would only match at the end. Instead of using grep, use the docker 'filter' functionality to fetch the container ID as appropriate.
2019-03-25 12:37:35 -04:00
Jose Diaz-Gonzalez
fc3f6a8a52 fix: correct the validation message 2019-03-09 16:39:34 -05:00
Jose Diaz-Gonzalez
1551ec61e7 fix: Strictly validate service names
We previously allowed a wide range of service names. As the service name is sometimes used to name databases, the name was actually more restricted than any character, resulting in services that wouldn't start. Going forward, only alphanumeric and underscore characters are allowed.

This only impacts service creation. Any services with invalid names should be migrated to a new service, with the data exported and imported as normal.

Closes dokku/dokku-redis#99
Closes dokku/dokku-mysql#47
Closes dokku/dokku-mongo#86
Closes dokku/dokku-redis#81
2019-03-09 15:54:21 -05:00
Jose Diaz-Gonzalez
1b797f8024 chore: minor consolidation in functions files 2019-03-09 15:54:21 -05:00
Jose Diaz-Gonzalez
39a7864022 fix: correct issues where docker ps is truncated
This should actually be refactored to avoid the grep call completely, but the current fix will correct the issue for now.

Refs dokku/dokku-postgres#131
2018-12-02 14:29:24 -05:00
Jose Diaz-Gonzalez
284ffa3177 feat: add ability to upgrade service image and image-version 2018-10-10 00:13:59 -04:00
Jose Diaz-Gonzalez
c83e0a56d2 refactor: make variable as dns hostname more clear 2018-04-24 02:54:46 -04:00
Jose Diaz-Gonzalez
02b0c1c7f9 refactor: move unimplemented command detection into config file 2018-04-24 00:27:17 -04:00
Jose Diaz-Gonzalez
94221b71ce refactor: allow usage of the same variable to disable docker pulls 2018-04-23 06:56:41 -04:00
Jose Diaz-Gonzalez
606fc7f9be feat: use custom env var to disable pull actions 2018-04-11 15:11:39 -04:00
Jose Diaz-Gonzalez
793087097d feat: support a separate data root for Docker bind mounts
This does not fix the :backup subcommand, which uses a temporary directory mounted to /backup.
2018-04-10 23:22:30 -04:00
Dheeraj Panyam
f92d6c2120 Update functions 2018-02-18 12:28:04 +05:30
Dheeraj Panyam
397a349b23 service_import ( change user from mysql to root)
change user from mysql to root
2018-02-18 10:26:50 +05:30
Dheeraj Panyam
b3e7735d0d service_import()
service_import() {
  local SERVICE="$1"
  SERVICE_ROOT="$PLUGIN_DATA_ROOT/$SERVICE"
  SERVICE_NAME="$(get_service_name "$SERVICE")"
  ROOTPASSWORD="$(cat "$SERVICE_ROOT/ROOTPASSWORD")"

  if [[ -t 0 ]]; then
    dokku_log_fail "No data provided on stdin."
  fi
  docker exec -i "$SERVICE_NAME" mysql --user=mysql --password="$ROOTPASSWORD" "$SERVICE"
}
2018-02-17 23:42:50 +05:30
Jose Diaz-Gonzalez
e5bead2f82 feat: add support for enhanced help output 2017-09-11 01:25:25 -04:00
Jose Diaz-Gonzalez
afcfc0253c feat: add ability to specify custom flags on clone/create
Refs dokku/dokku-redis#64
2017-08-26 18:10:31 -04:00
Youri van der Lans
db956c3bbf Suppress mysqldump password error. 2017-03-14 14:50:43 +01:00
Jose Diaz-Gonzalez
cc5fac0376 feat: add s3 backup support 2016-10-31 11:39:25 -06:00
Tomas Srna
e979c8d414 Use utf8 character set as default 2016-10-10 11:41:14 +02:00
Jose Diaz-Gonzalez
85ceaee1d1 Pin dokkupaas/wait:0.2 2016-09-21 01:27:01 -06:00
Jose Diaz-Gonzalez
757ae311f9 Move link creation up 2016-08-29 10:47:23 -04:00
Jose Diaz-Gonzalez
87084e7135 Refactor common functions into separate file 2016-08-29 02:36:09 -04:00
Jose Diaz-Gonzalez
ff5459d299 Add --internal-ip flag to info command 2016-08-28 23:24:20 -04:00
Jose Diaz-Gonzalez
0b7be2d039 Fix expose tests 2016-08-28 22:15:07 -04:00