ssh tunnel env switch and logging
This commit is contained in:
		@@ -140,10 +140,11 @@ services:
 | 
				
			|||||||
      context: sshtun
 | 
					      context: sshtun
 | 
				
			||||||
      dockerfile: Dockerfile
 | 
					      dockerfile: Dockerfile
 | 
				
			||||||
    restart: always
 | 
					    restart: always
 | 
				
			||||||
 | 
					    environment:
 | 
				
			||||||
 | 
					      - USE_TUN=${USE_TUN}
 | 
				
			||||||
    ports:
 | 
					    ports:
 | 
				
			||||||
      - "22222:22"
 | 
					      - "22222:22"
 | 
				
			||||||
    expose:
 | 
					    expose:
 | 
				
			||||||
      - "11111"
 | 
					 | 
				
			||||||
      - "11112"
 | 
					      - "11112"
 | 
				
			||||||
    networks:
 | 
					    networks:
 | 
				
			||||||
      - frontnet
 | 
					      - frontnet
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -140,10 +140,11 @@ services:
 | 
				
			|||||||
      context: sshtun
 | 
					      context: sshtun
 | 
				
			||||||
      dockerfile: Dockerfile
 | 
					      dockerfile: Dockerfile
 | 
				
			||||||
    restart: always
 | 
					    restart: always
 | 
				
			||||||
 | 
					    environment:
 | 
				
			||||||
 | 
					      - USE_TUN=${USE_TUN}
 | 
				
			||||||
    ports:
 | 
					    ports:
 | 
				
			||||||
      - "22222:22"
 | 
					      - "22222:22"
 | 
				
			||||||
    expose:
 | 
					    expose:
 | 
				
			||||||
      - "11111"
 | 
					 | 
				
			||||||
      - "11112"
 | 
					      - "11112"
 | 
				
			||||||
    networks:
 | 
					    networks:
 | 
				
			||||||
      - frontnet
 | 
					      - frontnet
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -140,10 +140,11 @@ services:
 | 
				
			|||||||
      context: sshtun
 | 
					      context: sshtun
 | 
				
			||||||
      dockerfile: Dockerfile
 | 
					      dockerfile: Dockerfile
 | 
				
			||||||
    restart: always
 | 
					    restart: always
 | 
				
			||||||
 | 
					    environment:
 | 
				
			||||||
 | 
					      - USE_TUN=${USE_TUN}
 | 
				
			||||||
    ports:
 | 
					    ports:
 | 
				
			||||||
      - "22222:22"
 | 
					      - "22222:22"
 | 
				
			||||||
    expose:
 | 
					    expose:
 | 
				
			||||||
      - "11111"
 | 
					 | 
				
			||||||
      - "11112"
 | 
					      - "11112"
 | 
				
			||||||
    networks:
 | 
					    networks:
 | 
				
			||||||
      - frontnet
 | 
					      - frontnet
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										3
									
								
								dotenv
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								dotenv
									
									
									
									
									
								
							@@ -13,6 +13,9 @@ BUILD_GPG_PP=
 | 
				
			|||||||
# Tor:
 | 
					# Tor:
 | 
				
			||||||
# true/false:
 | 
					# true/false:
 | 
				
			||||||
USE_TOR=false
 | 
					USE_TOR=false
 | 
				
			||||||
 | 
					# SSH Tun:
 | 
				
			||||||
 | 
					# true/false:
 | 
				
			||||||
 | 
					USE_TUN=false
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Backend:
 | 
					# Backend:
 | 
				
			||||||
FLASK_SECRET_KEY="flaskkey"
 | 
					FLASK_SECRET_KEY="flaskkey"
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,8 +1,14 @@
 | 
				
			|||||||
#!/bin/bash
 | 
					#!/bin/bash
 | 
				
			||||||
# Container goal:
 | 
					# Container goal: egress
 | 
				
			||||||
# autossh -N -R 11111:localhost:11434 -i sshtun/oilykey/<SOMEKEY> -p 22222 <SOMEURL>
 | 
					# first:	physical_box$ autossh -N -R 11111:localhost:11434 -i sshtun/oilykey/<SOMEKEY> -p 22222 <rem_vps_url>
 | 
				
			||||||
# forwards    rem_c_port:(operator_pc:op_pc_port) ...some args...  rem_host_p rem_host_url 
 | 
					# will forward rem_c_port:physical_box:physical_box_port ...some args...  rem_vps_p rem_vps_url
 | 
				
			||||||
 | 
					# then:		frontnet_c$ curl sshtun.frontnet:11112 --> physical_box:11434
 | 
				
			||||||
 | 
					
 | 
				
			||||||
nohup socat TCP-LISTEN:11112,fork TCP:localhost:11111 &
 | 
					if $USE_TUN ; then
 | 
				
			||||||
/usr/sbin/sshd -D
 | 
						echo "@@@@@@@@@@ SSH TUNNEL ENABLED BY ENV"
 | 
				
			||||||
 | 
						nohup socat TCP-LISTEN:11112,fork TCP:localhost:11111 &
 | 
				
			||||||
 | 
						/usr/sbin/sshd -De
 | 
				
			||||||
 | 
					else
 | 
				
			||||||
 | 
						echo "@@@@@@@@@@ SSH TUNNEL DISABLED BY ENV"
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user