32 Commits

Author SHA1 Message Date
Jose Diaz-Gonzalez
6ce10b5be6 fix: ensure compose projects are spawned from the /tmp directory
A recent update to compose executes a stat call in the current working directory, which may have incorrect permissions for execution once the user is changed to the dokku user. This change forces all compose commands to execute in the /tmp directory by using a helper function to execute compose up/down.

Closes #7705
2025-05-24 23:31:41 -04:00
Jose Diaz-Gonzalez
b97e8f3601 feat: add ability to ship k3s container logs via vector
If a global vector-sink property on the logs plugin is set, we will use that to configure a log sink (defaulting to console output otherwise). Note that the actual configuration still needs to be a valid DSN representing a Vector log sink.

While this does not support pinning log sinks to specific apps, it opens up integration for those who use a single k3s cluster in shared tenancy.
2025-04-14 04:35:21 -04:00
Jose Diaz-Gonzalez
869f9a0346 feat: allow specifying a custom app label alias when shipping logs via vector
Closes #7354
2025-01-03 23:38:20 -05:00
Jose Diaz-Gonzalez
1c0bd39d42 feat: ensure referenced images get updated by dependabot
Dokku uses a few external images for various bits of functionality, but these must be manually updated every so often due to being referenced in code.

By moving the references to Dockerfiles, we can take advantage of dependabot to issue automatic PRs when they are out of date.
2024-02-25 00:54:11 -05:00
Jose Diaz-Gonzalez
3c6cc68086 refactor: capture output by default
This is almost certainly the correct default for Dokku. While it's a BC break and might cause an increase in memory usage, the api is mostly internal and therefore this is safe to use.
2024-02-12 20:28:31 -05:00
Jose Diaz-Gonzalez
5e1089973e refactor: use type-specific functions for writing contents to a file 2024-02-06 01:39:44 -05:00
Jose Diaz-Gonzalez
c49322bd34 feat: manage vector container via compose
Using compose instead of manual docker calls allows folks to customize the vector container by using a custom compose.yml template file. This opens us up to more customizations while aligning container management with how we do other external containers (such as for the proxy plugins).

Refs #5784
2024-01-26 06:46:18 -05:00
Jose Diaz-Gonzalez
fb73474675 refactor: allow setting a custom mode when writing a slice to a file 2024-01-18 19:11:53 -05:00
Jose Diaz-Gonzalez
1d0d050596 feat: mount the vector data directory instead of the vector file
This allows users to provide extra configuration files for Vector, such as when using the GCP Operations log sink.

Closes #4971
2023-08-05 10:58:57 -04:00
Jose Diaz-Gonzalez
6cbe93c245 refactor: move all golang code for managing data directories to common plugin
Additionally, ensure the golang plugins handle setup/teardown of plugin and app-specific data directories during install, rename, and clone phases.
2023-01-08 23:36:12 -05:00
Jose Diaz-Gonzalez
bbbdfbffe5 fix: add support for escaped plus (+) signs in vector configurations
Closes #5502
2022-12-04 15:40:46 -05:00
Jose Diaz-Gonzalez
f60e0d7c8a feat: update vector image
Also drop value for --watch-config flag, as this is now properly parsed as a boolean value.

Refs #5197
2022-08-10 16:46:56 -04:00
Jose Diaz-Gonzalez
51cd7fd85e fix: use original app name when setting include_labels for vector source
Closes #5221
2022-06-25 01:06:28 -04:00
Jose Diaz-Gonzalez
2ba5c9df50 Revert "fix: Vector fails to start container due to --watch-config flag" 2022-05-26 10:22:32 -04:00
Pablo Orellana
0a895b2d11 remove --watch-config argument on startVectorContainer 2022-05-25 07:44:38 +02: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
Andrey Bulava
8d640ac958 Set RestartPolicy:"unless-stopped" for the vector container. 2022-04-26 13:42:10 +03:00
Jose Diaz-Gonzalez
2a02aa0b9b fix: ensure vector component sources have valid names
The dot (.) character is invalid.

Closes #5044
2022-02-27 18:20:44 -05:00
Jose Diaz-Gonzalez
01e317259b refactor: use default sink variable
This allows us to update the sink at the same time as updating the vector integration.
2021-10-24 15:14:37 -04:00
Jose Diaz-Gonzalez
0997fd3347 fix: add support for url-encoded vector-sink config values
We additionally force-replace \u0026 with an ampersand to ensure we properly support & in config values (such as for URIs).
2021-09-10 23:04:41 -04:00
Jose Diaz-Gonzalez
2c4fec77bb refactor: force-set the type and inputs for a vector sink
Previously, a user could inadvertently override the type or the inputs value by specifying those in their config. Instead, we force-set these so that users do not have potentially invalid config.
2021-09-10 23:03:29 -04:00
Jose Diaz-Gonzalez
18a6ba90f9 fix: add the correct log mount for app logs
As per documentation, the `/var/log/dokku/apps` should be mounted from the host to the container. The existing mount was `/var/log/dokku` mounted to `/var/logs/dokku/apps`.

The broken mount will be removed in the next minor.
2021-03-12 06:31:01 -05:00
Jose Diaz-Gonzalez
dfc98ecc0f fix: allow underscores in vector schemes
Also unify tests for global and non-global logs:set calls
2021-01-23 19:00:33 -05:00
Jose Diaz-Gonzalez
441f7ab22a fix: pass 1 to --watch-config flag
Apparently this needs a value...
2021-01-07 00:12:23 -05:00
Jose Diaz-Gonzalez
714b27f8a4 chore: quiet output of starting container
We check if the container is running later, so there isn't a need for us to see the containerID here
2021-01-07 00:08:05 -05:00
Jose Diaz-Gonzalez
2d841f47eb fix: handle case where there are no apps 2021-01-06 22:45:47 -05:00
Jose Diaz-Gonzalez
711945147b refactor: use --watch-config instead of signaling the container to reload config 2021-01-04 21:48:28 -05:00
Jose Diaz-Gonzalez
0b3a6687f6 feat: actually mount the apps log dir
Also fix it so that the log directory is mountable from a custom path on the host if running dokku within a container.
2021-01-04 21:45:26 -05:00
Jose Diaz-Gonzalez
94696e81fa fix: ensure the vector container does not exit when no configured sinks are in place 2021-01-04 01:12:25 -05:00
Jose Diaz-Gonzalez
43d6a2ad94 feat: add ability to set a global vector sink 2021-01-04 01:11:49 -05:00
Jose Diaz-Gonzalez
f5fa94cc9c chore: remove dburl usage
dburl adds aliases for everything, which breaks if two schemes are similar enough (anything with `aws_` as a prefix broke scheme registration). It does not appear to add anything, so we'll drop that dependency.

Also remove go-jsonmerge, as this was refactored to use structs instead of byte manipulation...
2021-01-04 00:42:13 -05:00
Jose Diaz-Gonzalez
fd85b1f605 feat: add vector integration
This currently is missing a few features:

- global sinks
- logrotation

But works fairly well otherwise.
2021-01-04 00:30:22 -05:00