KJ commited on
Commit ·
baf883f
1
Parent(s): cfbb7e9
adding remote port var
Browse files
app.py
CHANGED
|
@@ -21,6 +21,7 @@ MYSQL_USER = st.secrets["MYSQL_USER"]
|
|
| 21 |
MYSQL_PASSWORD = st.secrets["MYSQL_PASSWORD"]
|
| 22 |
MYSQL_DB = st.secrets["DB_NAME"]
|
| 23 |
MYSQL_PORT = int(st.secrets["MYSQL_PORT"])
|
|
|
|
| 24 |
|
| 25 |
# --- SSH Key File ---
|
| 26 |
with tempfile.NamedTemporaryFile(delete=False, suffix=".pem") as temp_file:
|
|
@@ -35,7 +36,7 @@ def start_ssh_tunnel():
|
|
| 35 |
(SSH_HOST, 22),
|
| 36 |
ssh_username=SSH_USER,
|
| 37 |
ssh_pkey=temp_file_path,
|
| 38 |
-
remote_bind_address=(REMOTE_BIND_HOST,
|
| 39 |
local_bind_address=(LOCAL_BIND_HOST, MYSQL_PORT)
|
| 40 |
)
|
| 41 |
tunnel.start()
|
|
|
|
| 21 |
MYSQL_PASSWORD = st.secrets["MYSQL_PASSWORD"]
|
| 22 |
MYSQL_DB = st.secrets["DB_NAME"]
|
| 23 |
MYSQL_PORT = int(st.secrets["MYSQL_PORT"])
|
| 24 |
+
REMOTE_BIND_PORT = int(st.secrets["REMOTE_BIND_PORT"])
|
| 25 |
|
| 26 |
# --- SSH Key File ---
|
| 27 |
with tempfile.NamedTemporaryFile(delete=False, suffix=".pem") as temp_file:
|
|
|
|
| 36 |
(SSH_HOST, 22),
|
| 37 |
ssh_username=SSH_USER,
|
| 38 |
ssh_pkey=temp_file_path,
|
| 39 |
+
remote_bind_address=(REMOTE_BIND_HOST, REMOTE_BIND_PORT),
|
| 40 |
local_bind_address=(LOCAL_BIND_HOST, MYSQL_PORT)
|
| 41 |
)
|
| 42 |
tunnel.start()
|