Commit Graph

96 Commits

Author SHA1 Message Date
Jose Diaz-Gonzalez
646356d086 refactor: use DOCKER_BIN env var instead of calling docker directly
This will allow us to alias the docker binary with podman for most actions - other than updating running containers.
2023-02-07 03:53:08 -05:00
Jose Diaz-Gonzalez
b50752d009 refactor: use namespaced docker commands for interacting with the docker binary 2023-02-07 03:39:42 -05:00
Jose Diaz-Gonzalez
725ec8ff59 chore: run shfmt 2022-07-25 01:15:32 -04:00
Jose Diaz-Gonzalez
9c72f9a8e0 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
099764aa40 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
7e73273ad3 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:42 -04:00
Jose Diaz-Gonzalez
d9a8bc3357 feat: allow setting shm-size on created containers
Refs dokku/dokku-postgres#188
Closes dokku/dokku-postgres#201
2021-09-13 00:46:49 -04:00
Jose Diaz-Gonzalez
720ddea579 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
658e04df6f fix: allow non-english characters in :connect shell
Closes dokku/dokku-mysql#116
2021-09-12 08:24:53 -04:00
Jose Diaz-Gonzalez
9b6d6430fb feat: add the ability to constrain memory on service start/clone
Refs dokku/dokku-redis#86
2021-09-12 07:43:03 -04:00
Jose Diaz-Gonzalez
2e0e2db647 chore: show a better error message when the image is missing
Refs dokku/dokku-clickhouse#4
2021-09-12 00:54:24 -04:00
Jose Diaz-Gonzalez
bb2ba3807a feat: add plugin trigger for service creation and deletion 2021-02-25 19:54:59 -05:00
Tomáš Hromada
4170c0b993 Don't fill $SERVICE as username in service_url()
The URL generated by this plugin is invalid, but since Redis on versions 5 and lower didn't have a notion of usernames, it pretty much went unnoticed. 

Let's fix this by not setting the $SERVICE as the username in the service_url returned by this plugin.

I believe that clients ignore the username (otherwise the Redis connection wouldn't go through), so this should be a non-breaking change.

Fixes #155
2020-11-21 20:53:49 +01:00
Jose Diaz-Gonzalez
e43904641b 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
9ace27266c 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:04 -04:00
Jose Diaz-Gonzalez
3bfcb5bc2c chore: update dokku/wait version 2019-12-27 16:57:13 -05:00
V. Anastassiou
068145b46e Modify export command to use BGSAVE. 2019-09-19 13:40:28 -04:00
Jose Diaz-Gonzalez
86e7d53749 chore: move to helper functions for fetching passwords 2019-07-11 16:34:35 -07:00
Jose Diaz-Gonzalez
46bd7f534f feat: update ambassador, s3backup, and wait images 2019-07-11 14:31:47 -07:00
Jose Diaz-Gonzalez
0c4db51565 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:55 -04:00
Jose Diaz-Gonzalez
6bab5bad28 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
7ddd0c9201 chore: run shfmt 2019-05-30 11:06:25 -04:00
Jose Diaz-Gonzalez
9554b9a43f feat: switch to updated wait image 2019-03-25 12:46:42 -04:00
Jose Diaz-Gonzalez
6dce29fca8 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:36 -04:00
Jose Diaz-Gonzalez
7ce772224a fix: correct the validation message 2019-03-09 16:39:35 -05:00
Jose Diaz-Gonzalez
35d5e9cab4 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:24 -05:00
Jose Diaz-Gonzalez
876ff0c330 chore: minor consolidation in functions files 2019-03-09 15:54:24 -05:00
Jose Diaz-Gonzalez
c5c681a95d 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
5fb9de0d7d Revert "Adds --sysctl vm.overcommit_memory=1 flag" 2018-10-11 14:24:24 -04:00
Jose Diaz-Gonzalez
a357a81180 Merge pull request #108 from ChrisHacker/master
Adds --sysctl vm.overcommit_memory=1 flag
2018-10-10 23:19:09 -04:00
Jose Diaz-Gonzalez
e3be8f1715 feat: add ability to upgrade service image and image-version 2018-10-10 00:14:14 -04:00
Chris
0dcc65963b Adds --sysctl vm.overcommit_memory=1 flag
Added in service_create_container call
2018-08-07 13:48:25 -05:00
Jose Diaz-Gonzalez
8ac361f930 refactor: make variable as dns hostname more clear 2018-04-24 02:54:58 -04:00
Jose Diaz-Gonzalez
fdb90b85a3 refactor: move unimplemented command detection into config file 2018-04-24 00:27:28 -04:00
Jose Diaz-Gonzalez
d675c99b80 refactor: allow usage of the same variable to disable docker pulls 2018-04-23 06:57:00 -04:00
Jody McIntyre
956e22962e feat: allow skipping pulling an image for the redis plugin when REDIS_DISABLE_PULL=true 2018-04-11 10:47:05 -04:00
Jody McIntyre
deb9317edf Support a separate data root for Docker binds
We run Dokku, and therefore dokku redis, in its own Docker container.
In order to make this work we map a path from the host into the
container as `/var/lib/dokku/services/redis`. Unfortunately the path
on the host is user-configurable, and generally _won't_ be the same
as the path in the container. This means that when we run `docker`
commands (e.g. to spin up Redis containers), the directory used for
bind mounts (the `-v` option) needs to be different.

This commit allows us to do this, but keeps the existing behaviour
(the redis root for Docker binds is the same as the redis root for
other uses) by default.
2018-04-10 20:44:59 -04:00
Jose Diaz-Gonzalez
08cd26d394 Update functions 2018-04-10 15:54:32 -04:00
Jody McIntyre
8cc870a1bb Support locally-installed redis.conf 2018-04-04 15:42:22 -04:00
Jose Diaz-Gonzalez
b493c6a2a5 feat: add support for enhanced help output 2017-09-11 01:25:41 -04:00
Jose Diaz-Gonzalez
b2066c32c0 fix: warn that a specified password may not be as secure as the autogenerated one 2017-08-26 05:49:56 -04:00
Jose Diaz-Gonzalez
d4c9a4044f Parse arguments in service_create calls
Refs #64
2017-08-26 05:43:02 -04:00
Jose Diaz-Gonzalez
d57adde26c Use PLUGIN_IMAGE_VERSION for env var 2017-08-26 05:42:32 -04:00
Jose Diaz-Gonzalez
ae495c4761 fix: set password when exporting redis data
Closes #80
2017-07-13 03:21:20 -06:00
fzerorubigd
a0a9326f39 pass password to redis-cli instance on connect sub-command 2017-04-22 22:33:12 +04:30
Jose Diaz-Gonzalez
fdc927203c feat: add s3 backup support 2016-10-31 11:39:36 -06:00
Jose Diaz-Gonzalez
919832ba2a Implement AUTH. Closes #58
This change makes password authentication required
for redis usage, and removes anonymous access. Users
will need to change their underlying clients to enable
writing the auth token for authenticating, otherwise
requests will fail.

This is a non-optional change, and improves security
for users who wish to expose their redis installations
outside of their network.
2016-09-21 01:44:57 -06:00
Jose Diaz-Gonzalez
92c2957bfc Pin dokkupaas/wait:0.2 2016-09-21 01:27:05 -06:00
Jose Diaz-Gonzalez
065a29386c Move link file creation up 2016-08-29 10:52:35 -04:00
Jose Diaz-Gonzalez
8629623be6 Refactor common functions into separate file 2016-08-29 02:36:20 -04:00