Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker entrypoint checks ownership on the wrong path #261

Open
junkiebev opened this issue Sep 22, 2023 · 1 comment
Open

Docker entrypoint checks ownership on the wrong path #261

junkiebev opened this issue Sep 22, 2023 · 1 comment
Labels

Comments

@junkiebev
Copy link

junkiebev commented Sep 22, 2023

https://github.com/Graylog2/graylog-docker/blob/5da05dfaae6f98929297acf1c19209a447d73ecf/docker-entrypoint.sh#L76C1-L87C2

this function checks paths exist, and chowns them to graylog:graylog if they aren't already owned by graylog:graylog

setup() {
  # Create data directories
  for d in journal log plugin config contentpacks
  do
    dir=${GRAYLOG_HOME}/data/${d}
    [[ -d "${dir}" ]] || mkdir -p "${dir}"

    if [[ "$(stat --format='%U:%G' $dir)" != 'graylog:graylog' ]] && [[ -w "$dir" ]]; then
      chown -R graylog:graylog "$dir" || echo "Warning can not change owner to graylog:graylog"
    fi
  done
}

earlier in the script, you set a plugin directory with export GRAYLOG_PLUGIN_DIR=${GRAYLOG_HOME}/plugins-merged

should not
for d in journal log plugin config contentpacks
be changed to
for d in journal log ${GRAYLOG_PLUGIN_DIR} config contentpacks

It appears you are performing functions on a directory you don't use or care about. I wouldn't mind kicking in a PR, but before doing so I was curious if that was a conscious choice for backwards compatibility.

@kroepke
Copy link
Member

kroepke commented Sep 25, 2023

Hey, I'd say create that PR and we can discuss what the best option is :)
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants