Update the Docker entrypoint UID and GUID code

Update the ownership of files when the UID of GUID are changed.
GitLab issue #650.

Allow changing the GID of the mayan user to existing values.
GitLab issue #652. Thanks to Fabian (@ruffy91) for both reports.

Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
This commit is contained in:
Roberto Rosario
2019-08-23 03:37:40 -04:00
parent 7a8dad5a3c
commit 2af136356d
3 changed files with 33 additions and 3 deletions

View File

@@ -17,6 +17,14 @@
* Increase mailing profile password field max length
from 48 to 128 characters. GitLab issue #657.
Thanks to sigsec (@sigsec) for the report.
* Update the Docker entrypoint to update the ownership
of files when the UID of GUID are changed.
GitLab issue #650. Thanks to Fabian (@ruffy91)
for the report.
* Update the Docker entrypoint to allow changing
the GID of the mayan user to existing values.
GitLab issue #652. Thanks to Fabian (@ruffy91)
for the report.
3.2.6 (2019-07-10)
==================

View File

@@ -8,6 +8,9 @@ CONCURRENCY_ARGUMENT=--concurrency=
DEFAULT_USER_UID=1000
DEFAULT_USER_GUID=1000
MAYAN_USER_UID=${MAYAN_USER_UID:-${DEFAULT_USER_UID}}
MAYAN_USER_GUID=${MAYAN_USER_GUID:-${DEFAULT_USER_GUID}}
export MAYAN_DEFAULT_BROKER_URL=redis://127.0.0.1:6379/0
export MAYAN_DEFAULT_CELERY_RESULT_BACKEND=redis://127.0.0.1:6379/0
@@ -30,9 +33,18 @@ MAYAN_WORKER_FAST_CONCURRENCY=${MAYAN_WORKER_FAST_CONCURRENCY:-1}
MAYAN_WORKER_MEDIUM_CONCURRENCY=${MAYAN_WORKER_MEDIUM_CONCURRENCY:-1}
MAYAN_WORKER_SLOW_CONCURRENCY=${MAYAN_WORKER_SLOW_CONCURRENCY:-1}
echo "mayan: changing uid/guid"
usermod mayan -u ${MAYAN_USER_UID:-${DEFAULT_USER_UID}}
groupmod mayan -g ${MAYAN_USER_GUID:-${DEFAULT_USER_GUID}}
update_uid_gid() {
echo "mayan: update_uid_gid()"
groupmod mayan -g ${MAYAN_USER_GUID} 2>/dev/null || true
usermod mayan -u ${MAYAN_USER_UID} -g ${MAYAN_USER_GUID} 2>/dev/null
if [ ${MAYAN_USER_UID} -ne ${DEFAULT_USER_UID} ] || [ ${MAYAN_USER_GUID} -ne ${DEFAULT_USER_GUID} ]; then
echo "mayan: Updating file ownership. This might take a while if there are many documents."
chown mayan:mayan ${MAYAN_INSTALL_DIR} ${MAYAN_STATIC_ROOT} ${MAYAN_MEDIA_ROOT}
fi
}
update_uid_gid
if [ "$MAYAN_WORKER_FAST_CONCURRENCY" -eq 0 ]; then
MAYAN_WORKER_FAST_CONCURRENCY=

View File

@@ -24,6 +24,14 @@ Changes
- Increase mailing profile password field max length
from 48 to 128 characters. GitLab issue #657.
Thanks to sigsec (@sigsec) for the report.
- Update the Docker entrypoint to update the ownership
of files when the UID of GUID are changed.
GitLab issue #650. Thanks to Fabian (@ruffy91)
for the report.
- Update the Docker entrypoint to allow changing
the GID of the mayan user to existing values.
GitLab issue #652. Thanks to Fabian (@ruffy91)
for the report.
Removals
--------
@@ -116,6 +124,8 @@ Backward incompatible changes
Bugs fixed or issues closed
---------------------------
- :gitlab-issue:`650` Permission denied when MAYAN_USER_UID and MAYAN_USER_GUID are set
- :gitlab-issue:`652` MAYAN_USER_GUID cannot be set to specific values
- :gitlab-issue:`654` Internal Server Error, Document Checkout
- :gitlab-issue:`655` Index setup tree view shows two times the "enabled" field instead of "Link documents"
- :gitlab-issue:`657` Mailer password length restriction is too short