mirror of
				https://github.com/byReqz/gotty-docker.git
				synced 2025-10-31 02:21:29 +00:00 
			
		
		
		
	add allow_write value
This commit is contained in:
		| @@ -6,6 +6,9 @@ fi | |||||||
| if [ -n "$userpass" ];then | if [ -n "$userpass" ];then | ||||||
| 	creds="-c "$userpass"" | 	creds="-c "$userpass"" | ||||||
| fi | fi | ||||||
|  | if [ "$allow_write" == "true" ];then | ||||||
|  | 	allow_write="-w" | ||||||
|  | fi | ||||||
| if [ -z "$title" ];then | if [ -z "$title" ];then | ||||||
| 	title=gotty | 	title=gotty | ||||||
| fi | fi | ||||||
| @@ -20,7 +23,7 @@ if [ -z "$command" ];then | |||||||
| fi | fi | ||||||
|  |  | ||||||
| if [ "$use_tmux" == "false" ];then | if [ "$use_tmux" == "false" ];then | ||||||
| 	/gotty -p "$port" $creds --title-format "$title" "$command" | 	/gotty -p "$port" $allow_write $creds --title-format "$title" "$command" | ||||||
| else | 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 | 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) | - pkgs - additional packages to install when the container is started (optional, def. none) | ||||||
| - command - the command to run (required, def. none/pfetch) | - 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) | - 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 | ## compose | ||||||
| this example can also be found in the repo | this example can also be found in the repo | ||||||
|   | |||||||
| @@ -14,3 +14,4 @@ services: | |||||||
|      - pkgs=htop |      - pkgs=htop | ||||||
|      - command=htop |      - command=htop | ||||||
|      - use_tmux=true |      - use_tmux=true | ||||||
|  |      - allow_write=false | ||||||
|   | |||||||
							
								
								
									
										7
									
								
								run.sh
									
									
									
									
									
								
							
							
						
						
									
										7
									
								
								run.sh
									
									
									
									
									
								
							| @@ -6,6 +6,9 @@ fi | |||||||
| if [ -n "$userpass" ];then | if [ -n "$userpass" ];then | ||||||
| 	creds="-c "$userpass"" | 	creds="-c "$userpass"" | ||||||
| fi | fi | ||||||
|  | if [ "$allow_write" == "true" ];then | ||||||
|  | 	allow_write="-w" | ||||||
|  | fi | ||||||
| if [ -z "$title" ];then | if [ -z "$title" ];then | ||||||
| 	title=gotty | 	title=gotty | ||||||
| fi | fi | ||||||
| @@ -20,7 +23,7 @@ if [ -z "$command" ];then | |||||||
| fi | fi | ||||||
|  |  | ||||||
| if [ "$use_tmux" == "false" ];then | if [ "$use_tmux" == "false" ];then | ||||||
| 	/gotty -p "$port" $creds --title-format "$title" "$command" | 	/gotty -p "$port" $allow_write $creds --title-format "$title" "$command" | ||||||
| else | 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 | fi | ||||||
		Reference in New Issue
	
	Block a user