|
@@ -14,7 +14,7 @@
|
|
|
# --tz TIMEZONE Timezone (default: system timezone or UTC)
|
|
# --tz TIMEZONE Timezone (default: system timezone or UTC)
|
|
|
# --build Build from source instead of using pre-built image
|
|
# --build Build from source instead of using pre-built image
|
|
|
# --yes, -y Non-interactive mode, accept defaults
|
|
# --yes, -y Non-interactive mode, accept defaults
|
|
|
-# --redirect-990 Add iptables redirect from 990 -> 9990 (Linux only)
|
|
|
|
|
|
|
+# --redirect-990 (Deprecated, no longer needed — FTP binds to port 990 directly)
|
|
|
# --help, -h Show this help message
|
|
# --help, -h Show this help message
|
|
|
#
|
|
#
|
|
|
|
|
|
|
@@ -142,7 +142,7 @@ show_help() {
|
|
|
echo " --tz TIMEZONE Timezone (default: system timezone or UTC)"
|
|
echo " --tz TIMEZONE Timezone (default: system timezone or UTC)"
|
|
|
echo " --build Build from source instead of using pre-built image"
|
|
echo " --build Build from source instead of using pre-built image"
|
|
|
echo " --yes, -y Non-interactive mode, accept defaults"
|
|
echo " --yes, -y Non-interactive mode, accept defaults"
|
|
|
- echo " --redirect-990 Add iptables redirect from 990 -> 9990 (Linux only)"
|
|
|
|
|
|
|
+ echo " --redirect-990 (Deprecated, no longer needed)"
|
|
|
echo " --help, -h Show this help message"
|
|
echo " --help, -h Show this help message"
|
|
|
echo ""
|
|
echo ""
|
|
|
echo "Examples:"
|
|
echo "Examples:"
|
|
@@ -411,38 +411,13 @@ check_sudo() {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
configure_iptables_redirect() {
|
|
configure_iptables_redirect() {
|
|
|
- if [[ "$OS_TYPE" != "linux" ]]; then
|
|
|
|
|
- log_warn "iptables redirect only supported on Linux. Skipping."
|
|
|
|
|
- return
|
|
|
|
|
- fi
|
|
|
|
|
-
|
|
|
|
|
- if [[ "$REDIRECT_990" != "true" ]]; then
|
|
|
|
|
- return
|
|
|
|
|
- fi
|
|
|
|
|
-
|
|
|
|
|
- if ! check_sudo; then
|
|
|
|
|
- return
|
|
|
|
|
|
|
+ # Deprecated: FTP now binds directly to port 990 (requires CAP_NET_BIND_SERVICE).
|
|
|
|
|
+ # The iptables 990→9990 redirect is no longer needed and caused issues with
|
|
|
|
|
+ # multi-VP setups (REDIRECT rewrites dest IP to the interface's primary address).
|
|
|
|
|
+ if [[ "$REDIRECT_990" == "true" ]]; then
|
|
|
|
|
+ log_warn "The --redirect-990 flag is deprecated. FTP now binds directly to port 990."
|
|
|
|
|
+ log_warn "No iptables redirect is needed. Skipping."
|
|
|
fi
|
|
fi
|
|
|
-
|
|
|
|
|
- log_info "Configuring iptables redirect: 990 -> 9990"
|
|
|
|
|
-
|
|
|
|
|
- # Check if rule already exists
|
|
|
|
|
- if sudo iptables -t nat -C PREROUTING -p tcp --dport 990 -j REDIRECT --to-port 9990 2>/dev/null; then
|
|
|
|
|
- log_warn "PREROUTING rule already exists. Skipping."
|
|
|
|
|
- else
|
|
|
|
|
- sudo iptables -t nat -A PREROUTING -p tcp --dport 990 -j REDIRECT --to-port 9990
|
|
|
|
|
- log_success "Added PREROUTING redirect rule"
|
|
|
|
|
- fi
|
|
|
|
|
-
|
|
|
|
|
- if sudo iptables -t nat -C OUTPUT -o lo -p tcp --dport 990 -j REDIRECT --to-port 9990 2>/dev/null; then
|
|
|
|
|
- log_warn "OUTPUT rule already exists. Skipping."
|
|
|
|
|
- else
|
|
|
|
|
- sudo iptables -t nat -A OUTPUT -o lo -p tcp --dport 990 -j REDIRECT --to-port 9990
|
|
|
|
|
- log_success "Added OUTPUT redirect rule"
|
|
|
|
|
- fi
|
|
|
|
|
-
|
|
|
|
|
- log_warn "Note: iptables rules are NOT persistent after reboot."
|
|
|
|
|
- log_warn "To persist them, install iptables-persistent or use a firewall manager."
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
gather_config() {
|
|
gather_config() {
|
|
@@ -466,19 +441,7 @@ gather_config() {
|
|
|
prompt "Bind address" "$DEFAULT_BIND_ADDRESS" BIND_ADDRESS
|
|
prompt "Bind address" "$DEFAULT_BIND_ADDRESS" BIND_ADDRESS
|
|
|
fi
|
|
fi
|
|
|
|
|
|
|
|
- # Redirect port 990 -> 9990 (Linux only)
|
|
|
|
|
- if [[ "$OS_TYPE" == "linux" ]]; then
|
|
|
|
|
- if [[ "$NON_INTERACTIVE" == "true" ]]; then
|
|
|
|
|
- # In non-interactive mode, only set REDIRECT_990 if explicitly passed
|
|
|
|
|
- : # Do nothing, REDIRECT_990 is set only if --redirect-990 is passed
|
|
|
|
|
- elif [[ "$REDIRECT_990" != "true" ]]; then
|
|
|
|
|
- echo ""
|
|
|
|
|
- echo "Optional network configuration:"
|
|
|
|
|
- if prompt_yes_no "Add iptables redirect (990 -> 9990)?" "n"; then
|
|
|
|
|
- REDIRECT_990="true"
|
|
|
|
|
- fi
|
|
|
|
|
- fi
|
|
|
|
|
- fi
|
|
|
|
|
|
|
+ # Note: iptables redirect is no longer needed — FTP binds to port 990 directly.
|
|
|
|
|
|
|
|
# Timezone
|
|
# Timezone
|
|
|
detect_timezone
|
|
detect_timezone
|