mirror of
https://github.com/byReqz/gotty-docker.git
synced 2024-12-25 03:01:49 +00:00
add allow_write value
This commit is contained in:
parent
66fe5e35ed
commit
80ca4a40cd
@ -6,6 +6,9 @@ fi
|
||||
if [ -n "$userpass" ];then
|
||||
creds="-c "$userpass""
|
||||
fi
|
||||
if [ "$allow_write" == "true" ];then
|
||||
allow_write="-w"
|
||||
fi
|
||||
if [ -z "$title" ];then
|
||||
title=gotty
|
||||
fi
|
||||
@ -20,7 +23,7 @@ if [ -z "$command" ];then
|
||||
fi
|
||||
|
||||
if [ "$use_tmux" == "false" ];then
|
||||
/gotty -p "$port" $creds --title-format "$title" "$command"
|
||||
/gotty -p "$port" $allow_write $creds --title-format "$title" "$command"
|
||||
else
|
||||
/gotty -p "$port" $creds --title-format "$title" tmux new-session -A -s "$title" "$command"
|
||||
/gotty -p "$port" $allow_write $creds --title-format "$title" tmux new-session -A -s "$title" "$command"
|
||||
fi
|
||||
|
@ -25,6 +25,7 @@ this is a dynamically built gotty container
|
||||
- pkgs - additional packages to install when the container is started (optional, def. none)
|
||||
- command - the command to run (required, def. none/pfetch)
|
||||
- use_tmux - either open a subshell for every page load (false) or just attach to a single shell started at the beginning (true) (optional, def. true)
|
||||
- allow_write - allow users to send input, should be used with auth (optional, def. false)
|
||||
|
||||
## compose
|
||||
this example can also be found in the repo
|
||||
|
@ -14,3 +14,4 @@ services:
|
||||
- pkgs=htop
|
||||
- command=htop
|
||||
- use_tmux=true
|
||||
- allow_write=false
|
||||
|
7
run.sh
7
run.sh
@ -6,6 +6,9 @@ fi
|
||||
if [ -n "$userpass" ];then
|
||||
creds="-c "$userpass""
|
||||
fi
|
||||
if [ "$allow_write" == "true" ];then
|
||||
allow_write="-w"
|
||||
fi
|
||||
if [ -z "$title" ];then
|
||||
title=gotty
|
||||
fi
|
||||
@ -20,7 +23,7 @@ if [ -z "$command" ];then
|
||||
fi
|
||||
|
||||
if [ "$use_tmux" == "false" ];then
|
||||
/gotty -p "$port" $creds --title-format "$title" "$command"
|
||||
/gotty -p "$port" $allow_write $creds --title-format "$title" "$command"
|
||||
else
|
||||
/gotty -p "$port" $creds --title-format "$title" tmux new-session -A -s "$title" "$command"
|
||||
/gotty -p "$port" $allow_write $creds --title-format "$title" tmux new-session -A -s "$title" "$command"
|
||||
fi
|
Loading…
Reference in New Issue
Block a user