You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem description:
I wrote 2 different scripts. one to install gitbucket on port 8001 and setting up virtualhost configurations and one to setup ufw firewall rules.
#!/bin/bash
sed -i -e 's/\r$//' /root/scripts/files/update_firewall.sh
# Show each command as executed to debug issues with certain commands.#set -x# Check if UFW is installedif!command -v ufw &>/dev/null;then# Install UFW silently using apt
apt update -qq
apt install -y -qq ufw
fi# Retrieve the Cloudflare IPv4 and IPv6 ranges
IP_RANGES_IPV4=$(curl -s https://www.cloudflare.com/ips-v4)
IP_RANGES_IPV6=$(curl -s https://www.cloudflare.com/ips-v6)# Flush existing firewall rules
ufw --force reset
# Set default policies
ufw default deny incoming
ufw default allow outgoing
# Allow loopback traffic
ufw allow in on lo
# Allow incoming connections from Cloudflarufw e IPv4 ranges on ports 1500, 1501, and 8001 (HTTP, HTTPS, Custom Port)whileread -r IP_RANGE;do
ufw allow in from "$IP_RANGE" to any port 1500 proto tcp
ufw allow in from "$IP_RANGE" to any port 1501 proto tcp
ufw allow in from "$IP_RANGE" to any port 8001 proto tcp
ufw allow in from "$IP_RANGE" to any port 80 proto tcp
ufw allow in from "$IP_RANGE" to any port 443 proto tcp
done<<<"$IP_RANGES_IPV4"# Allow incoming connections from Cloudflare IPv6 ranges on ports 1500, 1501, and 8001 (HTTP, HTTPS, Custom Port)whileread -r IP_RANGE;do
ufw allow in from "$IP_RANGE" to any port 1500
ufw allow in from "$IP_RANGE" to any port 1501
ufw allow in from "$IP_RANGE" to any port 8001
ufw allow in from "$IP_RANGE" to any port 80 proto tcp
ufw allow in from "$IP_RANGE" to any port 443 proto tcp
done<<<"$IP_RANGES_IPV6"# Add exception for SSH login
ufw allow in to [SERVERIP REDACTED] port [REDACTED PORT]
# Enable UFW
ufw --force enable
The issue is, that whenever i try to visit https://git.thevault.net.ru it shows the content of the mainpage https://thevault.net.ru (which is an forum) and not the gitbucket page. If i do curl in my vps on localhost:8001 i get the gitbucket website html structure.
On Cloudflare i added an A record proxied though cloudflare pointing to my public VPS IP.
The text was updated successfully, but these errors were encountered:
Issue
Impacted version: latest
Deployment mode: apache2
Problem description:
I wrote 2 different scripts. one to install gitbucket on port 8001 and setting up virtualhost configurations and one to setup ufw firewall rules.
Here is the gitbucket script:
Here the firewall script:
The issue is, that whenever i try to visit https://git.thevault.net.ru it shows the content of the mainpage https://thevault.net.ru (which is an forum) and not the gitbucket page. If i do curl in my vps on localhost:8001 i get the gitbucket website html structure.
On Cloudflare i added an A record proxied though cloudflare pointing to my public VPS IP.
The text was updated successfully, but these errors were encountered: