mirror of
https://github.com/jupyterhub/the-littlest-jupyterhub.git
synced 2025-12-18 21:54:05 +08:00
maint: let installer ensure /etc/sudoers.d directory exists
This commit is contained in:
@@ -24,8 +24,6 @@ RUN find /etc/systemd/system \
|
||||
-not -name '*systemd-user-sessions*' \
|
||||
-exec rm \{} \;
|
||||
|
||||
RUN mkdir -p /etc/sudoers.d
|
||||
|
||||
RUN systemctl set-default multi-user.target
|
||||
|
||||
STOPSIGNAL SIGRTMIN+3
|
||||
|
||||
@@ -126,6 +126,7 @@ def ensure_usergroups():
|
||||
user.ensure_group("jupyterhub-users")
|
||||
|
||||
logger.info("Granting passwordless sudo to JupyterHub admins...")
|
||||
os.makedirs("/etc/sudoers.d/", exist_ok=True)
|
||||
with open("/etc/sudoers.d/jupyterhub-admins", "w") as f:
|
||||
# JupyterHub admins should have full passwordless sudo access
|
||||
f.write("%jupyterhub-admins ALL = (ALL) NOPASSWD: ALL\n")
|
||||
|
||||
Reference in New Issue
Block a user