Commit 6d9096e6 authored by Jérome Perrin's avatar Jérome Perrin Committed by Rafael Monnerat

slaprunner: do not create a shell wrapper for shellinabox

~/bin/bash was used sometimes in place of bash, but we can use the
"real" bash directly, not need for a wrapper.

Introduce a section to define the shell $PATH and $SHELL we want to reference
from other sections.

slapos.cookbook:shell recipe creates a wrapper copying environment of
user running slapos node instance, but we are trying to avoid this.
parent 2e9eb14b
......@@ -19,7 +19,7 @@ md5sum = 713db528880282d568278f09458d2aab
[template-runner]
filename = instance-runner.cfg
md5sum = 21ffa51b10d89ce81a43c202f1e5504a
md5sum = 75cb4012edf3f968d5be24ebaf4c45f8
[template-runner-import-script]
filename = template/runner-import.sh.jinja2
......
......@@ -167,7 +167,7 @@ minishell_cwd_file = $${directory:etc}/.minishell-cwd
minishell_history_file = $${directory:etc}/.minishell_history
software_info_json = $${runnerdirectory:home}/software_info.json
instance_info_json = $${runnerdirectory:home}/instance_info.json
path = $${shell:path}
path = $${shell-environment:path}
instance_name = $${slap-parameter:instance-name}
default_repository = $${slap-parameter:slapos-repository}
......@@ -226,7 +226,7 @@ template = inline:
PasswordAuthentication no
PubkeyAuthentication yes
AuthorizedKeysFile $${buildout:directory}/.ssh/authorized_keys
ForceCommand if [ -z "$SSH_ORIGINAL_COMMAND" ]; then ${bash:location}/bin/bash -l; else PATH=$${shell:path} eval "$SSH_ORIGINAL_COMMAND"; fi
ForceCommand if [ -z "$SSH_ORIGINAL_COMMAND" ]; then $${shell-environment:shell} -l; else PATH=$${shell-environment:path} eval "$SSH_ORIGINAL_COMMAND"; fi
Subsystem sftp ${openssh:location}/libexec/sftp-server
[runner-sshd-raw-server]
......@@ -424,7 +424,7 @@ recipe = slapos.cookbook:wrapper
command-line = $${gunicorn:bin_gunicorn} slapos.runner.run:app -p $${gunicorn:path_pid} -b unix:$${gunicorn:socket} -e RUNNER_CONFIG=$${slaprunner:slapos.cfg} --error-logfile $${directory:log}/$${:error-log-file} --timeout 200 --threads 3 --log-level error --preload
error-log-file = gunicorn-error.log
wrapper-path = $${gunicorn:bin_launcher}
environment = PATH=$${shell:path}
environment = PATH=$${shell-environment:path}
RUNNER_CONFIG=$${slaprunner:slapos.cfg}
LANG=en_GB.UTF-8
......@@ -640,15 +640,11 @@ template = inline:
--disable-ssl \
--disable-ssl-menu \
--unixdomain-only=$${:socket}:$(id -u):$(id -g):0600 \
--service "/:$(id -u):$(id -g):HOME:$${shell:wrapper} -l"
--service "/:$(id -u):$(id -g):HOME:$${shell-environment:shell} -l"
[shell]
recipe = slapos.cookbook:shell
wrapper = $${directory:bin}/bash
[shell-environment]
shell = ${bash:location}/bin/bash
home = $${buildout:directory}
path = ${nano:location}/bin:${vim:location}/bin:${screen:location}/bin:${git:location}/bin:${curl:location}/bin:${python2.7:location}/bin:${tig:location}/bin:${zip:location}/bin:${mosh:location}/bin:${bash:location}/bin:$${buildout:directory}/bin/:/usr/bin:/bin/
ps1 = "\\w> "
[prepare-software]
recipe = slapos.cookbook:wrapper
......@@ -709,7 +705,7 @@ recipe = slapos.recipe.template:jinja2
template = ${template-bash-profile:location}/${template-bash-profile:filename}
rendered = $${buildout:directory}/.bash_profile
context =
raw path $${shell:path}
raw path $${shell-environment:path}
key workdir runnerdirectory:home
#---------------------------
......@@ -724,7 +720,7 @@ exitcodes = 0
logfile = $${directory:log}/supervisord.log
no_logfile = NONE
numprocs = 1
path = $${shell:path}
path = $${shell-environment:path}
pidfile = $${directory:run}/supervisord.pid
ip = $${slaprunner:ipv4}
server = $${:ip}:$${:port}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment