Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1ee0df9e7f | |||
| 3068f748b0 | |||
| 724108bbbd | |||
| 6b82b06f62 |
@@ -6,6 +6,19 @@
|
||||
|
||||
***
|
||||
|
||||
### Release 23.03.2
|
||||
|
||||
This release mitigates the problems with the edge use case, when users bind the whole `$HOME` directory to an external folder on the host computer.
|
||||
|
||||
Please note that I recommend to avoid doing that. If you really want to, then your best bet is using the Docker volumes. That is the only option I've found, which works across the environments. In the sibling discussion thread [#39](https://github.com/accetto/ubuntu-vnc-xfce-g3/discussions/39) I've described the way, how to initialize a bound `$HOME` folder, if you really want to give it a try.
|
||||
|
||||
Main changes:
|
||||
|
||||
- file `.initial_sudo_password` has been moved from the `$HOME` to the `$STARTUPDIR` folder
|
||||
- file `.initial_sudo_password` is not deleted, but cleared after the container user is created
|
||||
- startup scripts have been adjusted and improved
|
||||
- readme files have been updated
|
||||
|
||||
### Release 23.03.1
|
||||
|
||||
This is a maintenance release aiming to improve the scripts and documentation.
|
||||
|
||||
@@ -325,17 +325,16 @@ COPY ./xfce/src/home/readme*.md "${HOME}"/
|
||||
### Note that the line 'chmod 666 /etc/passwd /etc/group' sets the "softer" permissions only temporary.
|
||||
### It allows the user generator startup script to configure the user and the group correctly.
|
||||
### The script will set the permissions of both files back to the default '644'.
|
||||
### The script will aslo delete the file '.initial_sudo_password' after using it.
|
||||
### However, note that the initial sudo password will be persisted in the image history.
|
||||
### The script will also clear the file '.initial_sudo_password' after using it.
|
||||
### However, note that the initial sudo password will still be persisted in the image history.
|
||||
### You have to change it inside the container, if you want to keep it really secret.
|
||||
### Note that all this will not be done, if the startup script will not be executed.
|
||||
|
||||
RUN \
|
||||
chmod 666 /etc/passwd /etc/group \
|
||||
&& echo "${HEADLESS_USER_NAME}:x:${HEADLESS_USER_ID}:${HEADLESS_USER_GROUP_ID}:Default:${HOME}:/bin/bash" >> /etc/passwd \
|
||||
&& echo "${HEADLESS_USER_NAME} ALL=(ALL:ALL) ALL" | sudo tee /etc/sudoers.d/"${HEADLESS_USER_NAME}" \
|
||||
&& echo "${ARG_SUDO_INITIAL_PW:-headless}" > "${HOME}"/.initial_sudo_password \
|
||||
&& echo "${HEADLESS_USER_NAME}:$(cat "${HOME}"/.initial_sudo_password)" | chpasswd \
|
||||
&& echo "${ARG_SUDO_INITIAL_PW:-headless}" > "${STARTUPDIR}"/.initial_sudo_password \
|
||||
&& echo "${HEADLESS_USER_NAME}:$(cat "${STARTUPDIR}"/.initial_sudo_password)" | chpasswd \
|
||||
&& ln -s "${HOME}"/readme.md "${HOME}"/Desktop/README \
|
||||
&& "${STARTUPDIR}"/set_user_permissions.sh "${STARTUPDIR}" "${HOME}"
|
||||
|
||||
|
||||
@@ -88,7 +88,10 @@ main() {
|
||||
fi
|
||||
|
||||
### create container user
|
||||
generate_container_user
|
||||
if [[ -s "${STARTUPDIR}"/.initial_sudo_password ]] ; then
|
||||
|
||||
generate_container_user
|
||||
fi
|
||||
|
||||
if [[ "$?" != "0" ]] ; then
|
||||
|
||||
|
||||
@@ -69,16 +69,19 @@ generate_container_user() {
|
||||
fi
|
||||
fi
|
||||
|
||||
### make the newly created user the owner of the following folders including their content
|
||||
cat "${HOME}"/.initial_sudo_password | sudo -S chown -R "${user_id}:${group_id}" "${STARTUPDIR}" "${HOME}" 2>/dev/null
|
||||
if [[ -s "${STARTUPDIR}"/.initial_sudo_password ]] ; then
|
||||
|
||||
### set the file permissions of the following to the system default and
|
||||
### note that this will also disable this user generator for the future runs (see the outer if-condition above)
|
||||
cat "${HOME}"/.initial_sudo_password | sudo -S chmod 644 /etc/passwd /etc/group 2>/dev/null
|
||||
### make the newly created user the owner of the following folders including their content
|
||||
cat "${STARTUPDIR}"/.initial_sudo_password | sudo -S chown -R "${user_id}:${group_id}" "${STARTUPDIR}" "${HOME}" 2>/dev/null
|
||||
|
||||
### remove the file containing the initial sudo password
|
||||
### be aware that the initial sudo password is still part of the Docker image (see the image history and ARG_SUDO_PW)
|
||||
### however, you can change it afterwards inside the container
|
||||
cat "${HOME}"/.initial_sudo_password | sudo -S rm -f "${HOME}"/.initial_sudo_password 2>/dev/null
|
||||
### set the file permissions of the following to the system default and
|
||||
### note that this will also disable this user generator for the future runs (see the outer if-condition above)
|
||||
cat "${STARTUPDIR}"/.initial_sudo_password | sudo -S chmod 644 /etc/passwd /etc/group 2>/dev/null
|
||||
|
||||
### remove the file containing the initial sudo password
|
||||
### be aware that the initial sudo password is still part of the Docker image (see the image history and ARG_SUDO_PW)
|
||||
### however, you can change it afterwards inside the container
|
||||
cat "${STARTUPDIR}"/.initial_sudo_password | sudo -S echo -n "" > "${STARTUPDIR}"/.initial_sudo_password
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -397,9 +397,11 @@ During this one-time task the startup script needs to modify the container files
|
||||
|
||||
The created user gets permissions for `sudo` and the ownership to the content of the home and startup folders.
|
||||
|
||||
The temporary file `~/.initial_sudo_password` is also deleted after creating the user.
|
||||
The temporary file `${STARTUPDIR}/.initial_sudo_password` is cleared after creating the user.
|
||||
|
||||
There is the script `~/tests/test-01.sh` that allows quick check of the current permissions.
|
||||
However, note that the initial `sudo` password will still be persisted in the image history. You have to change it inside the container, if you want to keep it really secret.
|
||||
|
||||
There is the test script `~/tests/test-01.sh` that allows quick check of the current permissions.
|
||||
|
||||
#### Other considerations
|
||||
|
||||
|
||||
@@ -395,9 +395,11 @@ During this one-time task the startup script needs to modify the container files
|
||||
|
||||
The created user gets permissions for `sudo` and the ownership to the content of the home and startup folders.
|
||||
|
||||
The temporary file `~/.initial_sudo_password` is also deleted after creating the user.
|
||||
The temporary file `${STARTUPDIR}/.initial_sudo_password` is cleared after creating the user.
|
||||
|
||||
There is the script `~/tests/test-01.sh` that allows quick check of the current permissions.
|
||||
However, note that the initial `sudo` password will still be persisted in the image history. You have to change it inside the container, if you want to keep it really secret.
|
||||
|
||||
There is the test script `~/tests/test-01.sh` that allows quick check of the current permissions.
|
||||
|
||||
#### Other considerations
|
||||
|
||||
|
||||
@@ -385,9 +385,11 @@ During this one-time task the startup script needs to modify the container files
|
||||
|
||||
The created user gets permissions for `sudo` and the ownership to the content of the home and startup folders.
|
||||
|
||||
The temporary file `~/.initial_sudo_password` is also deleted after creating the user.
|
||||
The temporary file `${STARTUPDIR}/.initial_sudo_password` is cleared after creating the user.
|
||||
|
||||
There is the script `~/tests/test-01.sh` that allows quick check of the current permissions.
|
||||
However, note that the initial `sudo` password will still be persisted in the image history. You have to change it inside the container, if you want to keep it really secret.
|
||||
|
||||
There is the test script `~/tests/test-01.sh` that allows quick check of the current permissions.
|
||||
|
||||
#### Other considerations
|
||||
|
||||
|
||||
Reference in New Issue
Block a user