@@ -29,7 +29,7 @@ cmd_doctor() {
2929 echo " "
3030
3131 # Config validation (if config exists)
32- if [ -f " shipnode.conf " ]; then
32+ if [ -f " $SHIPNODE_CONFIG_FILE " ]; then
3333 info " Configuration validation:"
3434 check_health_check_path || has_warnings=true
3535 echo " "
@@ -106,21 +106,21 @@ cmd_doctor_security() {
106106 fi
107107}
108108
109- # Check if shipnode.conf exists and required vars are set
109+ # Check if config file exists and required vars are set
110110check_local_config () {
111- if [ ! -f " shipnode.conf " ]; then
112- echo " ✗ shipnode.conf not found"
111+ if [ ! -f " $SHIPNODE_CONFIG_FILE " ]; then
112+ echo " ✗ $SHIPNODE_CONFIG_FILE not found"
113113 return 1
114114 fi
115115
116116 # Try to load config
117117 set +e
118- source shipnode.conf 2> /dev/null
118+ source " $SHIPNODE_CONFIG_FILE " 2> /dev/null
119119 local source_result=$?
120120 set -e
121121
122122 if [ $source_result -ne 0 ]; then
123- echo " ✗ shipnode.conf has syntax errors"
123+ echo " ✗ $SHIPNODE_CONFIG_FILE has syntax errors"
124124 return 1
125125 fi
126126
@@ -132,11 +132,11 @@ check_local_config() {
132132 [ -z " $REMOTE_PATH " ] && missing_vars+=(" REMOTE_PATH" )
133133
134134 if [ ${# missing_vars[@]} -gt 0 ]; then
135- echo " ✗ shipnode.conf missing required variables: ${missing_vars[*]} "
135+ echo " ✗ $SHIPNODE_CONFIG_FILE missing required variables: ${missing_vars[*]} "
136136 return 1
137137 fi
138138
139- echo " ✓ shipnode.conf exists and is valid"
139+ echo " ✓ $SHIPNODE_CONFIG_FILE exists and is valid"
140140 return 0
141141}
142142
@@ -176,12 +176,12 @@ check_local_package_json() {
176176
177177# Check if HEALTH_CHECK_PATH starts with / (if set)
178178check_health_check_path () {
179- if [ ! -f " shipnode.conf " ]; then
179+ if [ ! -f " $SHIPNODE_CONFIG_FILE " ]; then
180180 return 0
181181 fi
182182
183183 set +e
184- source shipnode.conf 2> /dev/null
184+ source " $SHIPNODE_CONFIG_FILE " 2> /dev/null
185185 set -e
186186
187187 if [ -n " $HEALTH_CHECK_PATH " ] && [[ ! " $HEALTH_CHECK_PATH " =~ ^/ ]]; then
@@ -195,13 +195,13 @@ check_health_check_path() {
195195
196196# Test SSH connection
197197check_ssh_connection () {
198- if [ ! -f " shipnode.conf " ]; then
199- echo " ✗ Cannot test SSH - shipnode.conf not found"
198+ if [ ! -f " $SHIPNODE_CONFIG_FILE " ]; then
199+ echo " ✗ Cannot test SSH - $SHIPNODE_CONFIG_FILE not found"
200200 return 1
201201 fi
202202
203203 set +e
204- source shipnode.conf 2> /dev/null
204+ source " $SHIPNODE_CONFIG_FILE " 2> /dev/null
205205 set -e
206206
207207 if [ -z " $SSH_USER " ] || [ -z " $SSH_HOST " ]; then
@@ -223,12 +223,12 @@ check_ssh_connection() {
223223
224224# Check remote environment (batched checks)
225225check_remote_environment () {
226- if [ ! -f " shipnode.conf " ]; then
226+ if [ ! -f " $SHIPNODE_CONFIG_FILE " ]; then
227227 return 1
228228 fi
229229
230230 set +e
231- source shipnode.conf 2> /dev/null
231+ source " $SHIPNODE_CONFIG_FILE " 2> /dev/null
232232 set -e
233233
234234 local ssh_port=" ${SSH_PORT:- 22} "
@@ -352,12 +352,12 @@ REMOTE_CHECKS
352352
353353# Quiet SSH connection check (no output)
354354check_ssh_connection_quiet () {
355- if [ ! -f " shipnode.conf " ]; then
355+ if [ ! -f " $SHIPNODE_CONFIG_FILE " ]; then
356356 return 1
357357 fi
358358
359359 set +e
360- source shipnode.conf 2> /dev/null
360+ source " $SHIPNODE_CONFIG_FILE " 2> /dev/null
361361 set -e
362362
363363 if [ -z " $SSH_USER " ] || [ -z " $SSH_HOST " ]; then
@@ -371,21 +371,21 @@ check_ssh_connection_quiet() {
371371check_local_file_permissions () {
372372 local has_issues=false
373373
374- # Check shipnode.conf permissions
375- if [ -f " shipnode.conf " ]; then
374+ # Check config file permissions
375+ if [ -f " $SHIPNODE_CONFIG_FILE " ]; then
376376 local conf_perms
377- conf_perms=$( stat -c " %a" shipnode.conf 2> /dev/null || stat -f " %Lp" shipnode.conf 2> /dev/null)
377+ conf_perms=$( stat -c " %a" " $SHIPNODE_CONFIG_FILE " 2> /dev/null || stat -f " %Lp" " $SHIPNODE_CONFIG_FILE " 2> /dev/null)
378378 if [ -n " $conf_perms " ]; then
379379 # Check if permissions are too permissive (readable by group/others)
380380 local other_read=$(( conf_perms % 10 / 1 ))
381381 local group_read=$(( (conf_perms / 10 ) % 10 / 1 ))
382382
383383 if [ " $other_read " -ge 4 ] || [ " $group_read " -ge 4 ]; then
384- echo " ⚠ shipnode.conf has overly permissive permissions ($conf_perms )"
385- echo " Recommendation: Run 'chmod 600 shipnode.conf '"
384+ echo " ⚠ $SHIPNODE_CONFIG_FILE has overly permissive permissions ($conf_perms )"
385+ echo " Recommendation: Run 'chmod 600 $SHIPNODE_CONFIG_FILE '"
386386 has_issues=true
387387 else
388- echo " ✓ shipnode.conf permissions are secure ($conf_perms )"
388+ echo " ✓ $SHIPNODE_CONFIG_FILE permissions are secure ($conf_perms )"
389389 fi
390390 fi
391391 fi
0 commit comments