Convert SFTP Client to use local internal docker IPs for connection.

This removes the need for SFTP-Links to be online!
This commit is contained in:
MCHost
2025-06-25 02:45:37 -04:00
parent ac3542628b
commit 4c32ebae09
2 changed files with 62 additions and 15 deletions

View File

@ -622,10 +622,16 @@ document.addEventListener('DOMContentLoaded', () => {
}
function updateSftpCacheUI(message) {
console.log(message)
if (message.data?.hostname && message.data?.port && message.data?.user && message.data?.password) {
// For testing, this is currently configured to be internally networked to port 22 for the given container.
// The IP Address is sent from server side on page load, in theory, this should allow us to always allow
// SFTP Client to WORK! Even if SFTP Holesail ports are down!
// To Revert, move hostname to message.data.hostname and port to message.data.port
// Doing so will configure the connection to the Jump node.
sftpCredentials = {
hostname: message.data.hostname,
port: message.data.port,
hostname: message.data.ipAddress,
port: 22,
user: message.data.user,
password: message.data.password
};
@ -1562,10 +1568,11 @@ document.addEventListener('DOMContentLoaded', () => {
}
async function connectSftp() {
if (!isSftpOnline) {
showNotification('SFTP is offline. Please try again later.', 'error', 'sftp-offline');
return;
}
// Only enable this if we are using Jump Box based SFTP Connections
// if (!isSftpOnline) {
// showNotification('SFTP is offline. Please try again later.', 'error', 'sftp-offline');
// return;
// }
if (!sftpCredentials) {
showNotification('SFTP credentials not available.', 'error', 'sftp-credentials');