Skip to content

fix: re-enable uname support; fix build chain vulnerability issue; ...#56

Open
Gunzinger wants to merge 1 commit into
mumble-voip:masterfrom
Gunzinger:fix/uname-regression
Open

fix: re-enable uname support; fix build chain vulnerability issue; ...#56
Gunzinger wants to merge 1 commit into
mumble-voip:masterfrom
Gunzinger:fix/uname-regression

Conversation

@Gunzinger
Copy link
Copy Markdown

@Gunzinger Gunzinger commented Jan 17, 2025

  • fix: re-enable uname support
  • fix: remove build chain vulnerability issue with su-exec by using a fixed commit hash
  • chore: reduce variable duplication in Dockerfile
  • chore/fix: add switch to disable mumble ICE integration without using a config file
  • chore: address shellcheck warnings
  • chore: fix some spelling errors

learnings:

  • alpine container would need the shadow package for usermod and groupmod
  • if we forego alpine support completely, we could stop using su-exec entirely and work with setpriv; e.g.: setpriv --euid="${PUID}" --egid="${PGID}" --inh-caps=-all -- "${server_invocation[@]}" for the server invocation

todo:

  • add example docker-compose.yaml files into the repository with different common(?) configurations
  • expand README with informations about certificate usage / validity without warning signs on the user side, how to use with letsencrypt (+autorenewal of certs)

…h su-exec, reduce variable duplication in Dockerfile; add switch to disable mumble ICE integration without using a config file; address shellcheck warnings; fix some spelling errors
@Gunzinger
Copy link
Copy Markdown
Author

PUID / PGID could be removed entirely as it is a redundant with the usage of --user <uid>:<gid> in a docker run command, see: https://docs.docker.com/reference/cli/docker/container/run/#:~:text=Username%20or%20UID
Or for compose syntax: https://docs.docker.com/reference/compose-file/services/#:~:text=user:%20root

Copy link
Copy Markdown
Member

@Krzmbrzl Krzmbrzl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If possible, I would prefer having individual commits for independent changesets. Atm, there are at least the following changesets in this PR

  • Add possibility to inject additional build flags (cmake arguments & build number)
  • Fix supply-chain vulnerability
  • Fix uname support
  • Misc fixes in README (typos, HTML attributes)
  • Option to disable Ice
  • Various shell refactorings (though for some of them I am not sure if they are objectively better or mainly changed due to subjective preference)

Also, I think for the time being, we don't have to think about Alpine support as it doesn't provide a package for zeroc-ice, which we need. Thus, I think it would make a lot of sense to switch to using setpriv instead of su-exec.

Comment thread entrypoint.sh
readonly CONFIG_REGEX="^(\;|\#)?\ *([a-zA-Z_0-9]+)=.*"
CONFIG_FILE="${DATA_DIR}/mumble_server_config.ini"

# shellcheck disable=SC2034
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be removed

Comment thread entrypoint.sh
Comment on lines +148 to +153
set_config "ice" "\"tcp -h 127.0.0.1 -p 6502\"" true
{ # Add ICE section
echo -e "\n[Ice]"
echo "Ice.Warn.UnknownProperties=1"
echo "Ice.MessageSizeMax=65536"
} >> "$CONFIG_FILE"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent indentation

Comment thread entrypoint.sh
Comment on lines +178 to +193
if [[ "$(id -u)" = 0 && ( "${PUID}" != 0 || "${MUMBLE_UNAME_ENABLE}" == true ) && "${MUMBLE_CHOWN_DATA}" == true ]]; then
if [[ "${MUMBLE_UNAME_ENABLE}" == true ]]; then
# if we are here, root with uname enabled
if [[ ( "$(id -u mumble)" -ne ${MUMBLE_UNAME_UID} ) || ( "$(getent group mumble | cut -d: -f3 )" -ne ${MUMBLE_UNAME_GID} ) ]]; then
# MUMBLE_UNAME_UID or MUMBLE_UNAME_GID have changed -> adjust mumble/uname uid+gid
groupmod -og "${MUMBLE_UNAME_GID}" mumble
usermod -ou "${MUMBLE_UNAME_UID}" -g "${MUMBLE_UNAME_GID}" mumble
fi
set_config "uname" "mumble"
chown -R "${MUMBLE_UNAME_UID}":"${MUMBLE_UNAME_GID}" /data
echo "Running Mumble server as uid=${MUMBLE_UNAME_UID} gid=${MUMBLE_UNAME_GID}"
else
# if we are here, root with puid
chown -R "${PUID}":"${PGID}" /data
echo "Running Mumble server as uid=${PUID} gid=${PGID}"
fi
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent indentation (we use tabs)

Comment thread entrypoint.sh
Comment on lines +204 to +209
if [[ "$(id -u)" = 0 && "${PUID}" != "$(id -u)" && ! "${MUMBLE_UNAME_ENABLE}" == true ]]; then
su-exec "${PUID}":"${PGID}" "${server_invocation[@]}"
else
# start up with root (or we are in a rootless context/container started with --user parameter)
exec "${server_invocation[@]}"
fi
fi No newline at end of file
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't change indentation or trailing newlines

@Krzmbrzl
Copy link
Copy Markdown
Member

PUID / PGID could be removed entirely as it is a redundant with the usage of --user :

Removing these optin would likely break existing workflows that set these variables instead of making use of the --user option, no? If that's the case, I would like to keep them but maybe remove them from the README and instead advertise the --user option?


As for your TODO list: I think we should put most usage docs and examples in particular into the wiki instead of the README.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants