diff --git a/src/user/system/CaptainManager.ts b/src/user/system/CaptainManager.ts index ff5cd06..d75c67e 100644 --- a/src/user/system/CaptainManager.ts +++ b/src/user/system/CaptainManager.ts @@ -659,10 +659,12 @@ class CaptainManager { Logger.d('SSH Client :: ready') // TODO also run ufw allow stuff conn.exec( - dockerApi.createJoinCommand( - captainIpAddress, - token - ), + CaptainConstants.disableFirewallCommand + + ' ' + + dockerApi.createJoinCommand( + captainIpAddress, + token + ), function(err, stream) { if (err) { Logger.e(err) diff --git a/src/utils/CaptainConstants.ts b/src/utils/CaptainConstants.ts index 82cbf57..c057ffe 100644 --- a/src/utils/CaptainConstants.ts +++ b/src/utils/CaptainConstants.ts @@ -7,8 +7,12 @@ const CAPTAIN_DATA_DIRECTORY = CAPTAIN_BASE_DIRECTORY + '/data' // data that sit const CAPTAIN_ROOT_DIRECTORY_TEMP = CAPTAIN_BASE_DIRECTORY + '/temp' const CAPTAIN_ROOT_DIRECTORY_GENERATED = CAPTAIN_BASE_DIRECTORY + '/generated' -const CONSTANT_FILE_OVERRIDE_BUILD = path.join(__dirname, '../../config-override.json') -const CONSTANT_FILE_OVERRIDE_USER = CAPTAIN_DATA_DIRECTORY + '/config-override.json' +const CONSTANT_FILE_OVERRIDE_BUILD = path.join( + __dirname, + '../../config-override.json' +) +const CONSTANT_FILE_OVERRIDE_USER = + CAPTAIN_DATA_DIRECTORY + '/config-override.json' const configs = { publishedNameOnDockerHub: 'caprover/caprover', @@ -134,6 +138,11 @@ let data = { headerAuth: 'x-captain-auth', headerNamespace: 'x-namespace', + + // ********************* ETC ************************ + + disableFirewallCommand: + 'ufw allow 80,443,3000,996,7946,4789,2377/tcp; ufw allow 7946,4789,2377/udp; ', } function overrideFromFile(fileName: string) { diff --git a/src/utils/CaptainInstaller.ts b/src/utils/CaptainInstaller.ts index aa1fbe3..7f18a10 100644 --- a/src/utils/CaptainInstaller.ts +++ b/src/utils/CaptainInstaller.ts @@ -131,8 +131,7 @@ function checkPortOrThrow(ipAddr: string, portToTest: number) { 'A simple solution on Ubuntu systems is to run "ufw disable"' ) console.log('Or just allowing necessary ports:') - console.log(' ufw allow 80,443,3000,996,7946,4789,2377/tcp') - console.log(' ufw allow 7946,4789,2377/udp') + console.log(CaptainConstants.disableFirewallCommand) console.log(' ') console.log(' ') console.log('See docs for more details on how to fix firewall issues')