Skip to content

GBSA-392: Merged startup logic from daemon into setupFunctions#24

Merged
dylannguyen-cyber merged 2 commits intogrey-box:Feature/Utility-Library-(ASU-CIDSE-2025-Fall)from
ShreyasMahen:GBSA-392
Feb 13, 2026
Merged

GBSA-392: Merged startup logic from daemon into setupFunctions#24
dylannguyen-cyber merged 2 commits intogrey-box:Feature/Utility-Library-(ASU-CIDSE-2025-Fall)from
ShreyasMahen:GBSA-392

Conversation

@ShreyasMahen
Copy link
Copy Markdown
Contributor

This PR merges the startup logic from CyberCafe_Daemon.sh into Cybercafe_setupFunctions.sh as required for GBSA-392.
Only one file was changed under Backend/.

@x-anudeep x-anudeep self-requested a review November 25, 2025 00:56
Copy link
Copy Markdown
Collaborator

@Daniel-Lopez246 Daniel-Lopez246 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please go back and only make the necessary changes within your assigned function, or else you will cause merging errors!

@Daniel-Lopez246 Daniel-Lopez246 self-requested a review January 28, 2026 21:01
Copy link
Copy Markdown
Collaborator

@Daniel-Lopez246 Daniel-Lopez246 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolve merge conflicts

@roomote-v0
Copy link
Copy Markdown

roomote-v0 Bot commented Jan 28, 2026

Rooviewer Clock   See task on Roo Cloud

Review completed. This PR has critical issues that prevent it from functioning correctly. The merge is incomplete and introduces syntax errors.

Issues Found:

  • The first setup_infrastructure function (lines 84-120) is missing its closing brace }, causing a bash syntax error
  • The traffic control (TC) setup code from the daemon (htb qdisc configuration) was not included in the merge
  • The merged function is incomplete - it should include TC setup followed by captive portal startup and then a closing brace

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

Comment on lines +84 to +120
function setup_infrastructure {
trap 'echo -e "$(date) Error in Cybercafe_setupFunctions.sh: Line ${LINENO}\n" >> error.log' ERR > /dev/null 2>> error.log

LOCAL_IP=$(ifconfig $HS_INTERFACE | grep 'inet addr' | awk '{print $2}' | cut -d: -f2) > /dev/null 2>> error.log

############################################################
# iptmon_tx
############################################################
iptables -t mangle -C FORWARD -i ${HS_INTERFACE} -j iptmon_tx > /dev/null 2>> error.log
if [[ $? -ne 0 ]]; then
iptables -t mangle -N iptmon_tx > /dev/null 2>> error.log
iptables -t mangle -A FORWARD -i ${HS_INTERFACE} -j iptmon_tx > /dev/null 2>> error.log
fi

############################################################
# iptmon_rx
############################################################
iptables -t mangle -C POSTROUTING -o ${HS_INTERFACE} -j iptmon_rx > /dev/null 2>> error.log
if [[ $? -ne 0 ]]; then
iptables -t mangle -N iptmon_rx > /dev/null 2>> error.log
iptables -t mangle -I iptmon_rx 1 -s ${LOCAL_IP} -j RETURN > /dev/null 2>> error.log
iptables -t mangle -A POSTROUTING -o ${HS_INTERFACE} -j iptmon_rx > /dev/null 2>> error.log
fi

############################################################
# NAT redirect rules (captive portal)
############################################################
iptables -t nat -C PREROUTING -p tcp -i ${HS_INTERFACE} -j DNAT --to-destination ${LOCAL_IP}:80 > /dev/null 2>> error.log
if [[ $? -ne 0 ]]; then
iptables -t nat -I PREROUTING 1 -p tcp -i ${HS_INTERFACE} -j DNAT --to-destination ${LOCAL_IP}:80 > /dev/null 2>> error.log

iptables -t nat -A PREROUTING -p udp -i ${HS_INTERFACE} -d ${LOCAL_IP} --dport 53 -j RETURN > /dev/null 2>> error.log
iptables -t nat -A PREROUTING -p udp -i ${HS_INTERFACE} -s 0.0.0.0/32 -d 255.255.255.255/32 --dport 67 -j RETURN > /dev/null 2>> error.log

iptables -t filter -I FORWARD 1 -p all -i ${HS_INTERFACE} -j DROP > /dev/null 2>> error.log
iptables -t filter -I FORWARD 1 -p all -o ${HS_INTERFACE} ! -s ${LOCAL_IP} -j DROP > /dev/null 2>> error.log
fi
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The first setup_infrastructure function definition starting at line 84 is missing its closing brace. This creates a syntax error that will cause the script to fail when sourced or executed. The function body ends at line 120 but there's no closing } before the duplicate function definition at line 124.

Fix it with Roo Code or mention @roomote and request a fix.


iptables -t filter -I FORWARD 1 -p all -i ${HS_INTERFACE} -j DROP > /dev/null 2>> error.log
iptables -t filter -I FORWARD 1 -p all -o ${HS_INTERFACE} ! -s ${LOCAL_IP} -j DROP > /dev/null 2>> error.log
fi
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incomplete merge detected: The traffic control (TC) setup code that was supposed to be merged from the daemon is missing here. According to the PR diff, this function should include TC qdisc/class configuration (lines setting up htb queuing with rate limits). The function is also missing its closing brace, causing a syntax error. The complete merged version should include TC setup and the captive portal start logic, followed by a closing }.

Fix it with Roo Code or mention @roomote and request a fix.

@dylannguyen-cyber dylannguyen-cyber merged commit baca482 into grey-box:Feature/Utility-Library-(ASU-CIDSE-2025-Fall) Feb 13, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants