-
Notifications
You must be signed in to change notification settings - Fork 10
Merge Feature/utility library (asu cidse 2025 fall) into main #53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Daniel-Lopez246
merged 147 commits into
main
from
Feature/Utility-Library-(ASU-CIDSE-2025-Fall)
Apr 22, 2026
Merged
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 f05ff4c
Rename index.php to page.php
Grey-box-johnfischer cebf608
Rename index.php to page.php
Grey-box-johnfischer 3315092
Rename index.php to page.php
Grey-box-johnfischer 36812af
Rename index.php to page.php
Grey-box-johnfischer 551696d
Rename index.php to page.php
Grey-box-johnfischer e71f641
removed some echo lines
Grey-box-johnfischer 73f48ef
debugging check_internet_sessions
Grey-box-johnfischer 82513a6
changed table from PREROUTING to POSTROUTING
Grey-box-johnfischer aefcdf7
Delete Backend/archive directory
Grey-box-johnfischer 08b4009
made /home the landing page
Grey-box-johnfischer 21eddba
changed navigation, added remove old session functionality
Grey-box-johnfischer e35b568
changes to navigation, page style, verification structure
Grey-box-johnfischer 8967792
New admin pages for managment
Grey-box-johnfischer 3c3b598
Can only visit page now if logged out, layout changes
Grey-box-johnfischer 4a57cf4
assets folder added
Grey-box-johnfischer 6f72c37
minor changes, layout changes
Grey-box-johnfischer 627eee7
updated primary keys for tables
Grey-box-johnfischer e05df5a
Add files via upload
Grey-box-johnfischer 3aa10d4
Add files via upload
Grey-box-johnfischer b2ce97f
Adding lighttpd config to backend directory
Grey-box-johnfischer 27e633c
debugging
Grey-box-johnfischer 78c9245
Many changes/improvments
Grey-box-johnfischer b18f0d9
lots of debugging
Grey-box-johnfischer 41a9679
Add files via upload
Grey-box-johnfischer b2fed86
Add files via upload
Grey-box-johnfischer 530eebc
Add files via upload
Grey-box-johnfischer ea3e8df
Add files via upload
Grey-box-johnfischer 9766bd9
Add files via upload
Grey-box-johnfischer 28faea1
Add files via upload
Grey-box-johnfischer 4b2cdd6
Add files via upload
Grey-box-johnfischer a2d5dcb
Rename Cybercafe_commandLine.sh to cybercafe.sh
Grey-box-johnfischer 9f5f824
Add files via upload
Grey-box-johnfischer 1b9d6d9
Delete Backend/cybercafe
Grey-box-johnfischer 4f93835
Add files via upload
Grey-box-johnfischer 135c460
Update createDatabaseEntries.sh
Grey-box-johnfischer a55bc8c
Add files via upload
Grey-box-johnfischer 80c7d12
Add files via upload
Grey-box-johnfischer 3bce64d
Add files via upload
Grey-box-johnfischer 258e176
Add files via upload
Grey-box-johnfischer fbd4e43
Add files via upload
Grey-box-johnfischer 506ae45
Add files via upload
Grey-box-johnfischer 3ba22f0
Add files via upload
Grey-box-johnfischer 74e20cb
Add files via upload
Grey-box-johnfischer 5ca8f45
Add files via upload
Grey-box-johnfischer 189af19
Merge pull request #12 from grey-box:john-prototype
Daniel-Lopez246 5a177ae
Merged Implementation of check_hotspot_status.
dylannguyen-cyber 1efd2f6
Reverted original code of check_hotspot_status.
dylannguyen-cyber 4ffb569
Enhance captive webserver management and add testing script
Daniel-Lopez246 7cdbfaa
Merged hotspot status detection function (Event-Driven + Timestamp Gu…
dylannguyen-cyber c0d685e
Reverted to Original Code (problems with Git)
dylannguyen-cyber 13c7b79
Revert to Original Code (problems with VSCode and Git)
dylannguyen-cyber fff9f53
Updated internetSessionFunctions to now include Chris' shutdown_infra…
AmalKrishna1 6156751
Merged Implemented of hotspot detetion function. (Event-Driven + Time…
dylannguyen-cyber 0d7cced
Revert To Original Code (hopefully one last time)
dylannguyen-cyber 45dde6f
Merged Implementation of check hotspot detection function (Event-driv…
dylannguyen-cyber f388bec
Again. Revert,.,.,,,
dylannguyen-cyber ce4065a
Merge branch 'Feature/Utility-Library-(ASU-CIDSE-2025-Fall)' into GBS…
dylannguyen-cyber e578007
GBSA-8390: Merge shutdown_infrastructure (Chris teardown + John mirro…
x-anudeep f9f227d
Merge pull request #18 from grey-box/GBSA-8403
AmalKrishna1 1af4731
Merged startup logic from daemon into setupFunctions
603a14b
Fully merged implementation of check_hotspot_status detection functio…
dylannguyen-cyber 771c7ab
Merge branch 'GBSA-8388' of https://github.com/grey-box/Project_Cyber…
dylannguyen-cyber d4b47a9
Fully merged implementation of check_hotspot_status detection functio…
dylannguyen-cyber 2c09389
Deleted duplicate statements outside of function.
dylannguyen-cyber a980fd7
Merge pull request #22 from grey-box/GBSA-8390
x-anudeep ec74d38
GBSA-8388 - Fully Merged Implementation of check_hotspot_status (Even…
dylannguyen-cyber 12d9c39
GBSA-8391 - Merge pull request #17 from grey-box/GBSA-8391
Daniel-Lopez246 158504d
Merge branch 'Feature/Utility-Library-(ASU-CIDSE-2025-Fall)' into GBS…
ShreyasMahen 620cfc1
GBSA-8694 Add Backend Bash test runner (test/run)
Daniel-Lopez246 4bfbb68
GBSA-8694 - Enhance test runner to support .bats files
Daniel-Lopez246 1436888
GBSA-8694 - Add assertion helper functions and initial smoke test for…
Daniel-Lopez246 6327ed2
GBSA-8694 - Add env.sh for test environment setup and enhance smoke_t…
Daniel-Lopez246 601bfc2
GBSA-8694 - Enhance documentation in assert.sh, env.sh, and smoke_tes…
Daniel-Lopez246 ecfbce0
GBSA-8694 - changed run into proper run.sh file
Daniel-Lopez246 240703a
GBSA-8699 - Implemented check_hotspot_status bats function considerin…
dylannguyen-cyber 5d68989
GBSA-8699 - Implemented an automated testing script for check_hotspot…
dylannguyen-cyber 5c8a73f
Add BATS test and shell test for `delete_user_iptable_rules.`
AmalKrishna1 8be3ad9
Fixing the issue where the bats function relied on specific paths for…
AmalKrishna1 1a9c70b
Updated delete_user_iptables_rules to follow a standardized variable …
AmalKrishna1 166edfb
Merge pull request #25 from dylannguyen-cyber/Feature/Utility-Library…
Daniel-Lopez246 56d0ef4
Update test script usage instructions
Daniel-Lopez246 95dd721
Updated the tests to account for the new changes to the function.
AmalKrishna1 52b21db
Add BATS tests for shutdown_infrastructure (idempotent, dry-run safe)
x-anudeep 57c86d3
Expand shutdown_infrastructure BATS tests with edge-case coverage
x-anudeep 137050d
Add CI workflow for ShellCheck and unit tests
ShreyasMahen dcbe01a
Merge pull request #27 from ShreyasMahen/Feature/Utility-Library-(ASU…
Daniel-Lopez246 baca482
Merge pull request #24 from ShreyasMahen/GBSA-392
dylannguyen-cyber 4d7b2bf
Revert "GBSA-392: Merged startup logic from daemon into setupFunctions"
dylannguyen-cyber fb04834
Add T95 preflight validation script for integration readiness checks
Daniel-Lopez246 6e880c6
Fix set command in T95 preflight validation script for consistency
Daniel-Lopez246 0db6833
Improve root requirement error message in T95 preflight validation sc…
Daniel-Lopez246 5c87f81
Remove check_listeners function from T95 preflight validation script
Daniel-Lopez246 4ce483c
Refactor preflight validation script to improve command requirement c…
Daniel-Lopez246 e814b50
Update timestamp format in error logging for consistency in Cybercafe…
Daniel-Lopez246 4db3488
Refactor preflight validation script: consolidate command checks and …
Daniel-Lopez246 5b5437c
Refactor restore_t95_baseline.sh: improve readability and streamline …
Daniel-Lopez246 e427933
Merge pull request #28 from grey-box/revert-24-GBSA-392
dylannguyen-cyber fe0a22e
Adding new sql file for test data. Adding bats automated script AND b…
AmalKrishna1 63e9628
GBSA-8698 - Fully implemented BATs file for start_captive_webserver …
dylannguyen-cyber cda0d3c
Resolving conflicts on mimicking the lighttpd process stub.
dylannguyen-cyber 58c8fac
Resolving conflicts on imdempotency on happy paths to ensure the path…
dylannguyen-cyber c211fc7
Fixed any extra syntax errors and whitespaces to allow shellcheck.
dylannguyen-cyber 0ee40a1
Reverted to Original because something broke the code.
dylannguyen-cyber 7fde730
Fully resolved finding lighttpd processes in idempotent behavior and …
dylannguyen-cyber 9221566
Merge pull request #29 from dylannguyen-cyber/Feature/Utility-Library…
dylannguyen-cyber 655067f
Merge branch 'Feature/Utility-Library-(ASU-CIDSE-2025-Fall)' into GBS…
Daniel-Lopez246 7d07859
Merge pull request #31 from grey-box/GBSA-8829
Daniel-Lopez246 ee5af5c
Updated the test files and function to resolve shellcheck errors and …
AmalKrishna1 710aaa8
Add BATS tests for setup_infrastructure function
x-anudeep 7999426
setup_infrastructure BATS coverage to 15 tests(Stable)
x-anudeep bf40b1a
Possible resolution to the captive_webserver issues.
AmalKrishna1 b5e06a6
Sprint 8: Implement CyberCafe infrastructure logging, helper utilitie…
x-anudeep 83531e4
Refactor shebang lines to use /usr/bin/env bash for better portabilit…
Daniel-Lopez246 ce1886e
Refactor script includes to use BASE_DIR for improved path handling
Daniel-Lopez246 1ba6e7f
Fix CI pipeline by ensuring correct directory context for ShellCheck …
Daniel-Lopez246 023024f
Fix ShellCheck command to use relative paths for improved script dete…
Daniel-Lopez246 62dc0a3
Refactor scripts for improved error handling and consistency
Daniel-Lopez246 dd016ce
Refactor scripts to improve error handling and consistency in iptable…
Daniel-Lopez246 932e443
Refactor session age and idle time calculations for improved clarity …
Daniel-Lopez246 d0a8b87
Refactor test setup for improved directory context and path handling
Daniel-Lopez246 d1cbb32
GBSA-9261 - Merge pull request #42 from grey-box/fix/ci-pipeline
Daniel-Lopez246 5db7c2a
Fix SQL query parameter in remove_session function and update iptable…
Daniel-Lopez246 9ad59ad
Merge pull request #43 from grey-box/fix/ci-pipeline
Daniel-Lopez246 4a693db
Added lifecycle E2E test and fixed path issues for cross-platform exe…
x-anudeep 7b69564
GBSA-9479 - Implemented orchestrator.sh for one-command lifecycle exe…
dylannguyen-cyber af892a2
Potential fix from the CI pipeline where the running string can run u…
dylannguyen-cyber 46698ab
Fixing shellcheck warnings SC2015 and SC2086 on quoting the base_path…
dylannguyen-cyber 82e6486
Fixing the quoting warning of shellcheck, Removed cat since tail can …
dylannguyen-cyber c9ccf18
GBSA-9477 - Fix multiple issues for a stable demo.
Daniel-Lopez246 bbc748a
Fixed shellcheck errors
Daniel-Lopez246 14afc00
Kept the cat formatting for error log and disabled shellcheck error t…
dylannguyen-cyber 6d5c28f
GBSA-9479 - Implemented orchestrator.sh for one-command lifecycle exe…
dylannguyen-cyber ba72e7c
remove debug comments
Daniel-Lopez246 91d8e02
removed double quotes from in Cybercafe_setupFunctions.sh in shutdow…
Daniel-Lopez246 5b2f1a9
Merge branch 'Feature/Utility-Library-(ASU-CIDSE-2025-Fall)' into GBS…
Daniel-Lopez246 cf22450
Add shellcheck disable for iptables commands
Daniel-Lopez246 34e88bf
Merge pull request #49 from grey-box/GBSA-9477/fix-for-demo
Daniel-Lopez246 750b2bf
Fixed some pathing issues in order for it to work in su mode
Daniel-Lopez246 45014e8
Added mock session for it to display
Daniel-Lopez246 c06c0d7
Remove debug echo command in command_list_sessions
Daniel-Lopez246 d60d73c
Update database and script paths in global.php
Daniel-Lopez246 46bfa9b
Update database and script paths in globalfunctions.php
Daniel-Lopez246 7e5c5d2
Added full functionality checks in run status
dylannguyen-cyber 3972aa5
Fixed syntax with a comment
dylannguyen-cyber 02e7c50
Updated ReadMe with a system overview and instructions.
AmalKrishna1 d6e032e
fix(test-runner): replace mapfile with portable implementation for cr…
x-anudeep File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
|
|
This file was deleted.
Oops, something went wrong.
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
| 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 | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
trapcommand is placed inside thewhileloop, which causes it to be re-registered on every iteration. It is more efficient to define the trap once before entering the loop.