Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
147 commits
Select commit Hold shift + click to select a range
21f383a
Bringing over John's CyberCafe prototype work.
ccameron-gb Mar 18, 2025
f05ff4c
Rename index.php to page.php
Grey-box-johnfischer Mar 24, 2025
cebf608
Rename index.php to page.php
Grey-box-johnfischer Mar 24, 2025
3315092
Rename index.php to page.php
Grey-box-johnfischer Mar 24, 2025
36812af
Rename index.php to page.php
Grey-box-johnfischer Mar 24, 2025
551696d
Rename index.php to page.php
Grey-box-johnfischer Mar 24, 2025
e71f641
removed some echo lines
Grey-box-johnfischer Mar 24, 2025
73f48ef
debugging check_internet_sessions
Grey-box-johnfischer Mar 24, 2025
82513a6
changed table from PREROUTING to POSTROUTING
Grey-box-johnfischer Mar 24, 2025
aefcdf7
Delete Backend/archive directory
Grey-box-johnfischer Mar 24, 2025
08b4009
made /home the landing page
Grey-box-johnfischer Mar 24, 2025
21eddba
changed navigation, added remove old session functionality
Grey-box-johnfischer Mar 24, 2025
e35b568
changes to navigation, page style, verification structure
Grey-box-johnfischer Mar 24, 2025
8967792
New admin pages for managment
Grey-box-johnfischer Mar 24, 2025
3c3b598
Can only visit page now if logged out, layout changes
Grey-box-johnfischer Mar 24, 2025
4a57cf4
assets folder added
Grey-box-johnfischer Mar 24, 2025
6f72c37
minor changes, layout changes
Grey-box-johnfischer Mar 24, 2025
627eee7
updated primary keys for tables
Grey-box-johnfischer Mar 26, 2025
e05df5a
Add files via upload
Grey-box-johnfischer Apr 22, 2025
3aa10d4
Add files via upload
Grey-box-johnfischer Apr 22, 2025
b2ce97f
Adding lighttpd config to backend directory
Grey-box-johnfischer Apr 22, 2025
27e633c
debugging
Grey-box-johnfischer Apr 22, 2025
78c9245
Many changes/improvments
Grey-box-johnfischer Apr 22, 2025
b18f0d9
lots of debugging
Grey-box-johnfischer May 4, 2025
41a9679
Add files via upload
Grey-box-johnfischer May 4, 2025
b2fed86
Add files via upload
Grey-box-johnfischer May 4, 2025
530eebc
Add files via upload
Grey-box-johnfischer May 4, 2025
ea3e8df
Add files via upload
Grey-box-johnfischer May 4, 2025
9766bd9
Add files via upload
Grey-box-johnfischer May 4, 2025
28faea1
Add files via upload
Grey-box-johnfischer May 4, 2025
4b2cdd6
Add files via upload
Grey-box-johnfischer May 4, 2025
a2d5dcb
Rename Cybercafe_commandLine.sh to cybercafe.sh
Grey-box-johnfischer May 5, 2025
9f5f824
Add files via upload
Grey-box-johnfischer May 5, 2025
1b9d6d9
Delete Backend/cybercafe
Grey-box-johnfischer May 5, 2025
4f93835
Add files via upload
Grey-box-johnfischer May 5, 2025
135c460
Update createDatabaseEntries.sh
Grey-box-johnfischer May 5, 2025
a55bc8c
Add files via upload
Grey-box-johnfischer May 5, 2025
80c7d12
Add files via upload
Grey-box-johnfischer May 5, 2025
3bce64d
Add files via upload
Grey-box-johnfischer May 5, 2025
258e176
Add files via upload
Grey-box-johnfischer May 5, 2025
fbd4e43
Add files via upload
Grey-box-johnfischer May 5, 2025
506ae45
Add files via upload
Grey-box-johnfischer May 5, 2025
3ba22f0
Add files via upload
Grey-box-johnfischer May 5, 2025
74e20cb
Add files via upload
Grey-box-johnfischer May 5, 2025
5ca8f45
Add files via upload
Grey-box-johnfischer May 5, 2025
189af19
Merge pull request #12 from grey-box:john-prototype
Daniel-Lopez246 Nov 15, 2025
5a177ae
Merged Implementation of check_hotspot_status.
dylannguyen-cyber Nov 20, 2025
1efd2f6
Reverted original code of check_hotspot_status.
dylannguyen-cyber Nov 20, 2025
4ffb569
Enhance captive webserver management and add testing script
Daniel-Lopez246 Nov 21, 2025
7cdbfaa
Merged hotspot status detection function (Event-Driven + Timestamp Gu…
dylannguyen-cyber Nov 22, 2025
c0d685e
Reverted to Original Code (problems with Git)
dylannguyen-cyber Nov 22, 2025
13c7b79
Revert to Original Code (problems with VSCode and Git)
dylannguyen-cyber Nov 22, 2025
fff9f53
Updated internetSessionFunctions to now include Chris' shutdown_infra…
AmalKrishna1 Nov 22, 2025
6156751
Merged Implemented of hotspot detetion function. (Event-Driven + Time…
dylannguyen-cyber Nov 22, 2025
0d7cced
Revert To Original Code (hopefully one last time)
dylannguyen-cyber Nov 22, 2025
45dde6f
Merged Implementation of check hotspot detection function (Event-driv…
dylannguyen-cyber Nov 22, 2025
f388bec
Again. Revert,.,.,,,
dylannguyen-cyber Nov 22, 2025
ce4065a
Merge branch 'Feature/Utility-Library-(ASU-CIDSE-2025-Fall)' into GBS…
dylannguyen-cyber Nov 23, 2025
e578007
GBSA-8390: Merge shutdown_infrastructure (Chris teardown + John mirro…
x-anudeep Nov 24, 2025
f9f227d
Merge pull request #18 from grey-box/GBSA-8403
AmalKrishna1 Nov 24, 2025
1af4731
Merged startup logic from daemon into setupFunctions
Nov 24, 2025
603a14b
Fully merged implementation of check_hotspot_status detection functio…
dylannguyen-cyber Nov 25, 2025
771c7ab
Merge branch 'GBSA-8388' of https://github.com/grey-box/Project_Cyber…
dylannguyen-cyber Nov 25, 2025
d4b47a9
Fully merged implementation of check_hotspot_status detection functio…
dylannguyen-cyber Nov 25, 2025
2c09389
Deleted duplicate statements outside of function.
dylannguyen-cyber Nov 25, 2025
a980fd7
Merge pull request #22 from grey-box/GBSA-8390
x-anudeep Nov 25, 2025
ec74d38
GBSA-8388 - Fully Merged Implementation of check_hotspot_status (Even…
dylannguyen-cyber Nov 25, 2025
12d9c39
GBSA-8391 - Merge pull request #17 from grey-box/GBSA-8391
Daniel-Lopez246 Nov 25, 2025
158504d
Merge branch 'Feature/Utility-Library-(ASU-CIDSE-2025-Fall)' into GBS…
ShreyasMahen Jan 28, 2026
620cfc1
GBSA-8694 Add Backend Bash test runner (test/run)
Daniel-Lopez246 Jan 28, 2026
4bfbb68
GBSA-8694 - Enhance test runner to support .bats files
Daniel-Lopez246 Jan 31, 2026
1436888
GBSA-8694 - Add assertion helper functions and initial smoke test for…
Daniel-Lopez246 Jan 31, 2026
6327ed2
GBSA-8694 - Add env.sh for test environment setup and enhance smoke_t…
Daniel-Lopez246 Feb 2, 2026
601bfc2
GBSA-8694 - Enhance documentation in assert.sh, env.sh, and smoke_tes…
Daniel-Lopez246 Feb 2, 2026
ecfbce0
GBSA-8694 - changed run into proper run.sh file
Daniel-Lopez246 Feb 2, 2026
240703a
GBSA-8699 - Implemented check_hotspot_status bats function considerin…
dylannguyen-cyber Feb 2, 2026
5d68989
GBSA-8699 - Implemented an automated testing script for check_hotspot…
dylannguyen-cyber Feb 2, 2026
5c8a73f
Add BATS test and shell test for `delete_user_iptable_rules.`
AmalKrishna1 Feb 2, 2026
8be3ad9
Fixing the issue where the bats function relied on specific paths for…
AmalKrishna1 Feb 3, 2026
1a9c70b
Updated delete_user_iptables_rules to follow a standardized variable …
AmalKrishna1 Feb 3, 2026
166edfb
Merge pull request #25 from dylannguyen-cyber/Feature/Utility-Library…
Daniel-Lopez246 Feb 3, 2026
56d0ef4
Update test script usage instructions
Daniel-Lopez246 Feb 3, 2026
95dd721
Updated the tests to account for the new changes to the function.
AmalKrishna1 Feb 5, 2026
52b21db
Add BATS tests for shutdown_infrastructure (idempotent, dry-run safe)
x-anudeep Feb 6, 2026
57c86d3
Expand shutdown_infrastructure BATS tests with edge-case coverage
x-anudeep Feb 6, 2026
137050d
Add CI workflow for ShellCheck and unit tests
ShreyasMahen Feb 6, 2026
dcbe01a
Merge pull request #27 from ShreyasMahen/Feature/Utility-Library-(ASU…
Daniel-Lopez246 Feb 11, 2026
baca482
Merge pull request #24 from ShreyasMahen/GBSA-392
dylannguyen-cyber Feb 13, 2026
4d7b2bf
Revert "GBSA-392: Merged startup logic from daemon into setupFunctions"
dylannguyen-cyber Feb 13, 2026
fb04834
Add T95 preflight validation script for integration readiness checks
Daniel-Lopez246 Feb 13, 2026
6e880c6
Fix set command in T95 preflight validation script for consistency
Daniel-Lopez246 Feb 13, 2026
0db6833
Improve root requirement error message in T95 preflight validation sc…
Daniel-Lopez246 Feb 13, 2026
5c87f81
Remove check_listeners function from T95 preflight validation script
Daniel-Lopez246 Feb 13, 2026
4ce483c
Refactor preflight validation script to improve command requirement c…
Daniel-Lopez246 Feb 13, 2026
e814b50
Update timestamp format in error logging for consistency in Cybercafe…
Daniel-Lopez246 Feb 13, 2026
4db3488
Refactor preflight validation script: consolidate command checks and …
Daniel-Lopez246 Feb 13, 2026
5b5437c
Refactor restore_t95_baseline.sh: improve readability and streamline …
Daniel-Lopez246 Feb 13, 2026
e427933
Merge pull request #28 from grey-box/revert-24-GBSA-392
dylannguyen-cyber Feb 18, 2026
fe0a22e
Adding new sql file for test data. Adding bats automated script AND b…
AmalKrishna1 Feb 20, 2026
63e9628
GBSA-8698 - Fully implemented BATs file for start_captive_webserver …
dylannguyen-cyber Feb 20, 2026
cda0d3c
Resolving conflicts on mimicking the lighttpd process stub.
dylannguyen-cyber Feb 20, 2026
58c8fac
Resolving conflicts on imdempotency on happy paths to ensure the path…
dylannguyen-cyber Feb 20, 2026
c211fc7
Fixed any extra syntax errors and whitespaces to allow shellcheck.
dylannguyen-cyber Feb 20, 2026
0ee40a1
Reverted to Original because something broke the code.
dylannguyen-cyber Feb 20, 2026
7fde730
Fully resolved finding lighttpd processes in idempotent behavior and …
dylannguyen-cyber Feb 20, 2026
9221566
Merge pull request #29 from dylannguyen-cyber/Feature/Utility-Library…
dylannguyen-cyber Feb 20, 2026
655067f
Merge branch 'Feature/Utility-Library-(ASU-CIDSE-2025-Fall)' into GBS…
Daniel-Lopez246 Feb 20, 2026
7d07859
Merge pull request #31 from grey-box/GBSA-8829
Daniel-Lopez246 Feb 20, 2026
ee5af5c
Updated the test files and function to resolve shellcheck errors and …
AmalKrishna1 Feb 20, 2026
710aaa8
Add BATS tests for setup_infrastructure function
x-anudeep Feb 20, 2026
7999426
setup_infrastructure BATS coverage to 15 tests(Stable)
x-anudeep Feb 20, 2026
bf40b1a
Possible resolution to the captive_webserver issues.
AmalKrishna1 Feb 20, 2026
b5e06a6
Sprint 8: Implement CyberCafe infrastructure logging, helper utilitie…
x-anudeep Mar 16, 2026
83531e4
Refactor shebang lines to use /usr/bin/env bash for better portabilit…
Daniel-Lopez246 Mar 24, 2026
ce1886e
Refactor script includes to use BASE_DIR for improved path handling
Daniel-Lopez246 Mar 24, 2026
1ba6e7f
Fix CI pipeline by ensuring correct directory context for ShellCheck …
Daniel-Lopez246 Mar 24, 2026
023024f
Fix ShellCheck command to use relative paths for improved script dete…
Daniel-Lopez246 Mar 24, 2026
62dc0a3
Refactor scripts for improved error handling and consistency
Daniel-Lopez246 Mar 25, 2026
dd016ce
Refactor scripts to improve error handling and consistency in iptable…
Daniel-Lopez246 Mar 25, 2026
932e443
Refactor session age and idle time calculations for improved clarity …
Daniel-Lopez246 Mar 25, 2026
d0a8b87
Refactor test setup for improved directory context and path handling
Daniel-Lopez246 Mar 25, 2026
d1cbb32
GBSA-9261 - Merge pull request #42 from grey-box/fix/ci-pipeline
Daniel-Lopez246 Mar 25, 2026
5db7c2a
Fix SQL query parameter in remove_session function and update iptable…
Daniel-Lopez246 Mar 26, 2026
9ad59ad
Merge pull request #43 from grey-box/fix/ci-pipeline
Daniel-Lopez246 Mar 26, 2026
4a693db
Added lifecycle E2E test and fixed path issues for cross-platform exe…
x-anudeep Mar 30, 2026
7b69564
GBSA-9479 - Implemented orchestrator.sh for one-command lifecycle exe…
dylannguyen-cyber Apr 3, 2026
af892a2
Potential fix from the CI pipeline where the running string can run u…
dylannguyen-cyber Apr 3, 2026
46698ab
Fixing shellcheck warnings SC2015 and SC2086 on quoting the base_path…
dylannguyen-cyber Apr 3, 2026
82e6486
Fixing the quoting warning of shellcheck, Removed cat since tail can …
dylannguyen-cyber Apr 3, 2026
c9ccf18
GBSA-9477 - Fix multiple issues for a stable demo.
Daniel-Lopez246 Apr 6, 2026
bbc748a
Fixed shellcheck errors
Daniel-Lopez246 Apr 7, 2026
14afc00
Kept the cat formatting for error log and disabled shellcheck error t…
dylannguyen-cyber Apr 7, 2026
6d5c28f
GBSA-9479 - Implemented orchestrator.sh for one-command lifecycle exe…
dylannguyen-cyber Apr 8, 2026
ba72e7c
remove debug comments
Daniel-Lopez246 Apr 8, 2026
91d8e02
removed double quotes from in Cybercafe_setupFunctions.sh in shutdow…
Daniel-Lopez246 Apr 8, 2026
5b2f1a9
Merge branch 'Feature/Utility-Library-(ASU-CIDSE-2025-Fall)' into GBS…
Daniel-Lopez246 Apr 8, 2026
cf22450
Add shellcheck disable for iptables commands
Daniel-Lopez246 Apr 8, 2026
34e88bf
Merge pull request #49 from grey-box/GBSA-9477/fix-for-demo
Daniel-Lopez246 Apr 8, 2026
750b2bf
Fixed some pathing issues in order for it to work in su mode
Daniel-Lopez246 Apr 8, 2026
45014e8
Added mock session for it to display
Daniel-Lopez246 Apr 9, 2026
c06c0d7
Remove debug echo command in command_list_sessions
Daniel-Lopez246 Apr 9, 2026
d60d73c
Update database and script paths in global.php
Daniel-Lopez246 Apr 9, 2026
46bfa9b
Update database and script paths in globalfunctions.php
Daniel-Lopez246 Apr 9, 2026
7e5c5d2
Added full functionality checks in run status
dylannguyen-cyber Apr 9, 2026
3972aa5
Fixed syntax with a comment
dylannguyen-cyber Apr 10, 2026
02e7c50
Updated ReadMe with a system overview and instructions.
AmalKrishna1 Apr 10, 2026
d6e032e
fix(test-runner): replace mapfile with portable implementation for cr…
x-anudeep Apr 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: CI - ShellCheck & Tests

on:
pull_request:

jobs:
ci:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y shellcheck bats

- name: Run ShellCheck on Backend scripts
run: |
cd Backend
shellcheck -x *.sh test/*.sh

- name: Run test runner
run: |
chmod +x Backend/test/run.sh
bash Backend/test/run.sh

204 changes: 0 additions & 204 deletions Backend/CyberCafe_Daemon.sh

This file was deleted.

Empty file added Backend/CyberCafe_Database.db
Empty file.
44 changes: 44 additions & 0 deletions Backend/Cybercafe_daemon.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/data/data/com.termux/files/usr/bin/bash
#Organization: Grey-box
#Project: Cybercafe
#File: daemon
#Description: Main script that is run at start. This script is invoked by Cybercafe_commandLine.sh

###INCLUDES###
BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
. "$BASE_DIR/cybercafe.conf"
. "$BASE_DIR/Cybercafe_setupFunctions.sh"
. "$BASE_DIR/Cybercafe_internetSessionFunctions.sh"

### START OF PROGRAM EXECUTION ###
while true; do
trap 'echo -e "$(date) Error in Cybercafe_daemon.sh: Line ${LINENO}\n" >> error.log' ERR > /dev/null 2>> error.log

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The trap command is placed inside the while loop, which causes it to be re-registered on every iteration. It is more efficient to define the trap once before entering the loop.

check_hotspot_status

#Case 1: Hotspot up and was up in previous check
if [[ $HS_STATUS == 'up' ]] && [[ $HS_STATUS_PREV == 'up' ]]; then
check_internet_sessions

#Case 2: Hotspot up and was down in previous check
elif [[ $HS_STATUS == 'up' ]] && [[ $HS_STATUS_PREV == 'down' ]]; then
setup_infrastructure

#Case 3: Hotspot down and was up in previous check
elif [[ $HS_STATUS == 'down' ]] && [[ $HS_STATUS_PREV == 'up' ]]; then
# Assume hotspot has recently gone down. Clean up.
clear_internet_sessions
shutdown_infrastructure

#Case 4: Hotspot down and was down in previous check
else
:
fi

if [[ -f ./shutdown.confirmed ]]; then
clear_internet_sessions
shutdown_infrastructure
exit
fi

sleep 2
done
Loading
Loading