-
-
Notifications
You must be signed in to change notification settings - Fork 0
Encryption key generation failure in web export #607
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
Open
ikostan
wants to merge
102
commits into
main
Choose a base branch
from
encryption-key-generation-failure-in-web-export
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 19 commits
Commits
Show all changes
102 commits
Select commit
Hold shift + click to select a range
1c1da75
Remove AI plugin, fix web check, add test script
ikostan 5f1e9ba
Update test_injection.sh
ikostan af567a9
Update project.godot
ikostan 3dcf5f2
Bump DavidAnson/markdownlint-cli2-action from 23.0.0 to 23.2.0
dependabot[bot] 4c725c3
Bump release-drafter/release-drafter from 7.2.0 to 7.3.0
dependabot[bot] 9c896c7
Bump urllib3 from 2.6.3 to 2.7.0 in the pip group across 1 directory
dependabot[bot] 0bfee27
Merge pull request #604 from ikostan/dependabot/github_actions/DavidA…
ikostan f0c90cd
Merge pull request #605 from ikostan/dependabot/github_actions/releas…
ikostan 352e44b
Merge pull request #606 from ikostan/dependabot/pip/pip-c30c77f42d
ikostan 4d7d861
Merge branch 'encryption-key-generation-failure-in-web-export' of htt…
ikostan 632bb35
Add error handling for directory change.
ikostan 9122662
Restore project.godot automatically after injection/export.
ikostan 946f69e
Add explicit error handling for salt injection and patch steps.
ikostan 2351da0
Update test_injection.sh
ikostan 4069a07
Use CI-injected salt; remove JS eval
ikostan 7794236
Update globals.gd
ikostan b77ebea
Update globals.gd
ikostan 9b9f7e7
Use CI salt placeholder and auto-remove corrupted saves
ikostan 4ddd331
Update globals.gd
ikostan 6d4598e
Replace AWK-based salt injection with sed
ikostan 0e7629e
style: format code with Black and isort
deepsource-autofix[bot] 76d3f75
Update deploy_to_itch.yml
ikostan ef094ca
Update test_salt_injection.py
ikostan ff9bb38
Centralize salt injection into single script
ikostan 5b41101
style: format code with Black and isort
deepsource-autofix[bot] 510e383
One-line docstring should fit on one line with quotes
ikostan 0a443a4
Add test cleanup and modernize encryption tests
ikostan c56cd0e
🚨 issue (security): Treating all web builds as automated tests weaken…
ikostan 972cacb
Update test_salt_injection.py
ikostan 69e2b1e
style: format code with Black and isort
deepsource-autofix[bot] 5acee0b
Update globals.gd
ikostan 5965881
Merge branch 'encryption-key-generation-failure-in-web-export' of htt…
ikostan fbf1b7e
suggestion (bug_risk): Handle failure cases when auto-deleting corrup…
ikostan a2776a3
Update run_browser_tests.sh
ikostan 7f3b3a1
Update browser tests: disable plugins, inject salt
ikostan f8d82fd
Update browser_test.yml
ikostan 60d126f
Increase timeouts and harden CI browser test script
ikostan d70c09c
Update back_flow_test.py
ikostan 0a82016
Update back_flow_test.py
ikostan e660d4f
Add CI flag and secure test HTTP server
ikostan 4cf704d
Update browser_test.yml
ikostan 912bf49
Update test_injection.sh
ikostan 18ac35e
Update test_encryption_logging.gd
ikostan d387493
suggestion (bug_risk): The sed pattern for disabling plugins may be o…
ikostan 7d0bcd5
Scope sed replacement to [editor_plugins] section
ikostan aeb6ac3
suggestion (testing): Add tests for error/edge cases in salt injectio…
ikostan 08bb8b1
style: format code with Black and isort
deepsource-autofix[bot] 0653f14
Update test_salt_injection.py
ikostan d2240f6
Merge branch 'encryption-key-generation-failure-in-web-export' of htt…
ikostan f150267
Update test_salt_injection.py
ikostan 6e02079
Unused import stat
ikostan c075f20
Refactor CI salt injection tests to pytest
ikostan 63934b4
style: format code with Black and isort
deepsource-autofix[bot] f770f9a
CI: improve salt injection tests & workflow
ikostan b843bc5
Improve salt injection tests: robustness & strictness
ikostan 93c6446
style: format code with Black and isort
deepsource-autofix[bot] 62a5fe4
Update test_ci_scripts.yml
ikostan d95a499
'subprocess.run' used without explicitly defining the value for 'che…
ikostan 45c1ac7
prevent accidental data loss when an antivirus or the operating syste…
ikostan e574c14
style: format code with Black and isort
deepsource-autofix[bot] f4055a6
Update globals.gd
ikostan 59d8805
Merge branch 'encryption-key-generation-failure-in-web-export' of htt…
ikostan 9ee7ea2
Duplicated ci Flag Injection
ikostan 1fb1bad
Update test_ci_scripts.yml
ikostan 4e62afc
ci: enforce UTF-8 and add CI test fixtures
ikostan fa3d0eb
style: format code with Black and isort
deepsource-autofix[bot] ca18765
Inject CI flag per-preset and improve tests
ikostan 8e2a0c1
style: format code with Black and isort
deepsource-autofix[bot] 57f71b4
Update browser_test.yml
ikostan f9be6de
Do not overwrite backup on repeated CI injection
ikostan bb45197
style: format code with Black and isort
deepsource-autofix[bot] 1d273ef
Unused import tempfile
ikostan e75ced5
Merge branch 'encryption-key-generation-failure-in-web-export' of htt…
ikostan f4c9c82
Update test_ci_flag_injection.py
ikostan b84beca
Update test_ci_flag_injection.py
ikostan 55d61fb
style: format code with Black and isort
deepsource-autofix[bot] e1b06a9
Use r""" if any backslashes in a docstring
ikostan 1a4c934
Update audio_flow_test.py
ikostan dff39f6
Update globals.gd
ikostan 30958dd
Inject CI flag under [preset.N]; update tests & CI
ikostan 3651f6e
style: format code with Black and isort
deepsource-autofix[bot] 704fc3a
Update test_ci_scripts.yml
ikostan 4c1b4a2
Replace hardcoded timeouts with TEST_TIMEOUT
ikostan 203dfdb
suggestion (testing): Consider adding a test that explicitly covers C…
ikostan b5c37b2
Merge branch 'encryption-key-generation-failure-in-web-export' of htt…
ikostan f818978
Update test_ci_flag_injection.py
ikostan 6706aa2
🚨 suggestion (security): Logging the CI/test flag at INFO for every e…
ikostan 12a63e3
style: format code with Black and isort
deepsource-autofix[bot] 30bea46
issue (bug_risk): Accessing sys.stdout.encoding without a None check …
ikostan 7b90208
Merge branch 'encryption-key-generation-failure-in-web-export' of htt…
ikostan 7b24cea
Update test_injection.sh
ikostan 5df68b9
Update tests/ci/test_salt_injection.py
ikostan a6023f0
Update test_salt_injection.py
ikostan a84fe07
Update browser_test.yml
ikostan c7cef19
macOS / BSD sed compatibility (test_injection.sh & inject_salt.sh)
ikostan 83de3c4
suggestion (testing): Relax assertion on exact error message for empt…
ikostan 3547227
Update test_injection.sh
ikostan d09b838
Update test_ci_flag_injection.py
ikostan 7736e07
style: format code with Black and isort
deepsource-autofix[bot] dbf4db2
Update test_injection.sh
ikostan 16dc801
Add CI utilities and refactor scripts
ikostan 2329305
Use ci_utils.sh to disable editor plugins
ikostan 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
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
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
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
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 |
|---|---|---|
|
|
@@ -31,4 +31,4 @@ setuptools==80.10.2 | |
| six==1.17.0 | ||
| text-unidecode==1.3 | ||
| typing_extensions==4.15.0 | ||
| urllib3==2.6.3 | ||
| urllib3==2.7.0 | ||
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
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,104 @@ | ||
| #!/bin/bash | ||
| # test_injection.sh | ||
|
|
||
| cleanup() { | ||
| if [ -f "globals.gd.backup" ]; then | ||
| echo "🧹 Cleaning up: Restoring globals.gd from backup..." | ||
| mv -f "globals.gd.backup" scripts/core/globals.gd | ||
| fi | ||
| if [ -f "project.godot.backup" ]; then | ||
| echo "🧹 Cleaning up: Restoring project.godot from backup..." | ||
| mv -f "project.godot.backup" project.godot | ||
| fi | ||
| } | ||
| trap cleanup EXIT INT TERM | ||
|
|
||
| GODOT_CMD="godot" | ||
| RAW_SECRET='T3st_S@lt!_2026#"\' | ||
| export PRODUCTION_SALT="$RAW_SECRET" | ||
|
|
||
| echo "==========================================" | ||
| echo " Starting Local CI/CD Simulation" | ||
| echo "==========================================" | ||
|
|
||
| if [ ! -f "scripts/core/globals.gd" ] || [ ! -f "project.godot" ]; then | ||
| echo "❌ ERROR: Required project files not found!" | ||
| exit 1 | ||
| fi | ||
|
|
||
| cp scripts/core/globals.gd globals.gd.backup | ||
| cp project.godot project.godot.backup | ||
|
|
||
| echo "🗑️ Wiping previous web export files..." | ||
| rm -rf export/web/* | ||
| mkdir -p export/web | ||
|
|
||
| echo "🔌 Disabling editor plugins (GUT) to prevent headless crashes..." | ||
| sed -i 's/^enabled=PackedStringArray.*/enabled=PackedStringArray()/' project.godot | ||
|
|
||
| echo "⚙️ Injecting secret directly into GDScript bytecode..." | ||
| GODOT_ESCAPED=$(printf '%s' "$PRODUCTION_SALT" | sed 's/\\/\\\\/g; s/"/\\"/g') | ||
| SED_ESCAPED=$(printf '%s' "$GODOT_ESCAPED" | sed 's/\\/\\\\/g; s/&/\\&/g; s/|/\\|/g') | ||
|
|
||
| # Replace the safe placeholder with the real secret | ||
| sed -i "s|\"CI_INJECT_SALT_HERE\"|\"$SED_ESCAPED\"|g" scripts/core/globals.gd | ||
|
|
||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| echo "🎮 Exporting Godot project (Web preset)..." | ||
| $GODOT_CMD --verbose --headless --export-release "Web" export/web/index.html > export_log.txt 2>&1 & | ||
| GODOT_PID=$! | ||
|
|
||
| SECONDS=0 | ||
| SPINNER="-\|/" | ||
| i=0 | ||
| while kill -0 $GODOT_PID 2>/dev/null; do | ||
| i=$(( (i+1) % 4 )) | ||
| printf "\r⚙️ Godot is working... %s (Elapsed Time: %d seconds)" "${SPINNER:$i:1}" "$SECONDS" | ||
| sleep 1 | ||
| done | ||
|
|
||
| printf "\r✅ Export process finished! (Total time: %d seconds) \n" "$SECONDS" | ||
|
|
||
| wait $GODOT_PID | ||
| if [ $? -ne 0 ]; then | ||
| echo "❌ FATAL: Godot engine crashed during export." | ||
| echo "📄 Printing the last 20 lines of the crash log:" | ||
| tail -n 20 export_log.txt | ||
| exit 1 | ||
| fi | ||
|
|
||
| if [ ! -f "export/web/index.pck" ]; then | ||
| echo "❌ Export failed. index.pck not found." | ||
| exit 1 | ||
| fi | ||
|
|
||
| if [ -f "./.github/scripts/patch_index_js.sh" ]; then | ||
| bash ./.github/scripts/patch_index_js.sh "export/web" || { | ||
| echo "❌ ERROR: patch_index_js.sh failed." | ||
| exit 1 | ||
| } | ||
| fi | ||
|
|
||
| echo "✅ Build pipeline completed successfully." | ||
|
|
||
| echo "==========================================" | ||
| echo " Starting Local Game Server" | ||
| echo "==========================================" | ||
| cat << 'EOF' > export/web/serve.py | ||
| import http.server | ||
| PORT = 8080 | ||
| class Handler(http.server.SimpleHTTPRequestHandler): | ||
| def end_headers(self): | ||
| self.send_header("Cross-Origin-Opener-Policy", "same-origin") | ||
| self.send_header("Cross-Origin-Embedder-Policy", "require-corp") | ||
| super().end_headers() | ||
| if __name__ == '__main__': | ||
| with http.server.ThreadingHTTPServer(("", PORT), Handler) as httpd: | ||
| print(f"🚀 Game server running! Open http://localhost:{PORT} in your browser.") | ||
| httpd.serve_forever() | ||
| EOF | ||
|
|
||
| cd export/web || { | ||
| echo "❌ ERROR: Failed to change to export/web directory!" | ||
| exit 1 | ||
| } | ||
| python3 serve.py | ||
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.
Uh oh!
There was an error while loading. Please reload this page.