mirror of
https://github.com/caprover/caprover
synced 2026-09-24 07:35:36 +00:00
Added automatic ufw disable to Captain node join
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user