Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
J
Jupyter Docker Stacks
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
Jupyter Docker Stacks
Commits
6fa67cc5
Commit
6fa67cc5
authored
Jan 04, 2018
by
Peter Parente
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Append $CONDA_DIR/bin to sudo secure_path
Retain behavior when su was used instead
parent
2c80cf35
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
1 deletion
+15
-1
base-notebook/start.sh
base-notebook/start.sh
+2
-1
base-notebook/test/test_container_options.py
base-notebook/test/test_container_options.py
+13
-0
No files found.
base-notebook/start.sh
View file @
6fa67cc5
...
@@ -48,8 +48,9 @@ if [ $(id -u) == 0 ] ; then
...
@@ -48,8 +48,9 @@ if [ $(id -u) == 0 ] ; then
# Enable sudo if requested
# Enable sudo if requested
if
[[
"
$GRANT_SUDO
"
==
"1"
||
"
$GRANT_SUDO
"
==
'yes'
]]
;
then
if
[[
"
$GRANT_SUDO
"
==
"1"
||
"
$GRANT_SUDO
"
==
'yes'
]]
;
then
echo
"Granting
$NB_USER
sudo access"
echo
"Granting
$NB_USER
sudo access
and appending
$CONDA_DIR
/bin to sudo PATH
"
echo
"
$NB_USER
ALL=(ALL) NOPASSWD:ALL"
>
/etc/sudoers.d/notebook
echo
"
$NB_USER
ALL=(ALL) NOPASSWD:ALL"
>
/etc/sudoers.d/notebook
sed
-ri
"s#Defaults
\s
+secure_path=
\"
([^
\"
]+)
\"
#Defaults secure_path=
\"\1
:
$CONDA_DIR
/bin
\"
#"
/etc/sudoers
fi
fi
# Exec the command as NB_USER with the PATH and the rest of
# Exec the command as NB_USER with the PATH and the rest of
...
...
base-notebook/test/test_container_options.py
View file @
6fa67cc5
...
@@ -71,6 +71,19 @@ def test_sudo(container):
...
@@ -71,6 +71,19 @@ def test_sudo(container):
assert
rv
==
0
assert
rv
==
0
assert
'uid=0(root)'
in
c
.
logs
(
stdout
=
True
)
.
decode
(
'utf-8'
)
assert
'uid=0(root)'
in
c
.
logs
(
stdout
=
True
)
.
decode
(
'utf-8'
)
def
test_sudo_path
(
container
):
"""Container should include /opt/conda/bin in the sudo secure_path."""
c
=
container
.
run
(
tty
=
True
,
user
=
'root'
,
environment
=
[
'GRANT_SUDO=yes'
],
command
=
[
'start.sh'
,
'sudo'
,
'jupyter'
,
'--version'
]
)
rv
=
c
.
wait
(
timeout
=
10
)
assert
rv
==
0
def
test_group_add
(
container
,
tmpdir
):
def
test_group_add
(
container
,
tmpdir
):
"""Container should run with the specified uid, gid, and secondary
"""Container should run with the specified uid, gid, and secondary
group.
group.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment