Skip to content

V9#18

Merged
zgr2575 merged 178 commits intomainfrom
V9
Apr 1, 2026
Merged

V9#18
zgr2575 merged 178 commits intomainfrom
V9

Conversation

@zgr2575
Copy link
Copy Markdown
Owner

@zgr2575 zgr2575 commented Apr 1, 2026

No description provided.

zgr2575 and others added 30 commits December 19, 2024 14:13
Co-authored-by: zgr2575 <62474113+zgr2575@users.noreply.github.com>
… features

Co-authored-by: zgr2575 <62474113+zgr2575@users.noreply.github.com>
Co-authored-by: zgr2575 <62474113+zgr2575@users.noreply.github.com>
Co-authored-by: zgr2575 <62474113+zgr2575@users.noreply.github.com>
Co-authored-by: zgr2575 <62474113+zgr2575@users.noreply.github.com>
…t dependency

Co-authored-by: zgr2575 <62474113+zgr2575@users.noreply.github.com>
…ed versions and improved build configuration

Co-authored-by: zgr2575 <62474113+zgr2575@users.noreply.github.com>
…downgrade

Co-authored-by: zgr2575 <62474113+zgr2575@users.noreply.github.com>
…es, and enhanced user experience

Co-authored-by: zgr2575 <62474113+zgr2575@users.noreply.github.com>
Co-authored-by: zgr2575 <62474113+zgr2575@users.noreply.github.com>
…ve error handling

Co-authored-by: zgr2575 <62474113+zgr2575@users.noreply.github.com>
…ttings integration

Co-authored-by: zgr2575 <62474113+zgr2575@users.noreply.github.com>
Co-authored-by: zgr2575 <62474113+zgr2575@users.noreply.github.com>
Co-authored-by: zgr2575 <62474113+zgr2575@users.noreply.github.com>
Co-authored-by: zgr2575 <62474113+zgr2575@users.noreply.github.com>
Co-authored-by: zgr2575 <62474113+zgr2575@users.noreply.github.com>
… working

Co-authored-by: zgr2575 <62474113+zgr2575@users.noreply.github.com>
…themes, loading, auth, onboarding

Co-authored-by: zgr2575 <62474113+zgr2575@users.noreply.github.com>
Co-authored-by: zgr2575 <62474113+zgr2575@users.noreply.github.com>
…themes

Co-authored-by: zgr2575 <62474113+zgr2575@users.noreply.github.com>
…v9 feature suite

Co-authored-by: zgr2575 <62474113+zgr2575@users.noreply.github.com>
…reenshot protection

Co-authored-by: zgr2575 <62474113+zgr2575@users.noreply.github.com>
…ent cookie-based settings

Co-authored-by: zgr2575 <62474113+zgr2575@users.noreply.github.com>
…particles, and settings persistence

Co-authored-by: zgr2575 <62474113+zgr2575@users.noreply.github.com>
…QoL features

Co-authored-by: zgr2575 <62474113+zgr2575@users.noreply.github.com>
…gs persistence issues

Co-authored-by: zgr2575 <62474113+zgr2575@users.noreply.github.com>
…mations

Co-authored-by: zgr2575 <62474113+zgr2575@users.noreply.github.com>
Co-authored-by: zgr2575 <62474113+zgr2575@users.noreply.github.com>
Copilot AI and others added 15 commits October 2, 2025 17:37
Co-authored-by: zgr2575 <62474113+zgr2575@users.noreply.github.com>
Co-authored-by: zgr2575 <62474113+zgr2575@users.noreply.github.com>
Co-authored-by: zgr2575 <62474113+zgr2575@users.noreply.github.com>
… of non-existent window.multiProxy

Co-authored-by: zgr2575 <62474113+zgr2575@users.noreply.github.com>
…king

Co-authored-by: zgr2575 <62474113+zgr2575@users.noreply.github.com>
…fc-2fdf17771979

Fix proxy initialization and settings page proxy status display with comprehensive debugging
This commit addresses multiple critical issues that were preventing the webproxy from working:

**Webproxy Fixes:**
1. Fixed service worker unregistering on every page load - now reuses existing active service workers instead of destroying them
2. Fixed service worker script loading order - bundle.js now loads before config.js to ensure Ultraviolet library is available
3. Added checkFinalStatus() call to proxy initialization to verify system is working
4. Fixed URL encoding to use proper Ultraviolet encoder instead of broken btoa() implementation

**UI Fixes:**
5. Fixed go.html: getElementById("browser-iframe") → getElementById("ifra") - was causing iframe height calculation to fail
6. Added missing toggleHiddenGames() function in games.html
7. Implemented user blocking tracking in admin dashboard (replaced TODO)

**Technical Details:**
- proxy-init.js: Service worker now checks if registration exists and is active before unregistering
- sw.js: Reordered importScripts to load Ultraviolet bundle before config that depends on it
- proxy-init.js: encodeUrl() now uses __uv$config.encodeUrl() when available
- admin.js: Added getBlockedUsersCount() method to AdminStore class
- routes/admin.js: Stats endpoint now returns actual blocked user count

These fixes resolve the issue where webproxy would never work due to service worker constantly being destroyed and improper initialization order.
This commit addresses critical UX issues and implements missing features:

**UX Improvements:**
1. Replaced all alert() calls with modern showNotification() system
   - index.html: Beta enable/disable now uses notifications
   - h.js: Popup blocker warning uses notification system

2. Fixed games/apps page long list glitch
   - apps.html: Fixed selector from ".container-apps .app-item, .container-apps > div" to ".container-apps > .app-item"
   - games.html: Same fix to prevent duplicate selections
   - Added search result counter with proper visibility toggle

3. Fixed about:blank mode jankiness
   - h.js: Complete rewrite with proper error handling
   - Added loading indicator during iframe setup
   - Added timeout delays for proper popup initialization
   - Better error messages and fallback handling

**Implemented Missing Features:**
4. Plugin Store - Replaced "Coming soon" with informative modal
   - Shows instructions for manual plugin installation
   - Links to plugin documentation

5. Browser Page Menu - Implemented functional page menu
   - Reload, duplicate, pin, and close tab options
   - Proper modal interface with clean UI

**Code Quality:**
6. Removed excessive debug console.log statements
   - settings.html: Consolidated all [PROXY DEBUG] logs under DEBUG_PROXY flag
   - Removed ~20+ console.log statements from production code
   - Added conditional logging for debugging when needed

7. Hide developer-only features from regular users
   - settings.html: Added automatic hiding of screenshot protection and ad controls
   - Features only visible when developer-mode cookie is set
   - Cleaner UI for regular users

**Technical Details:**
- All modified files passed syntax validation
- Improved error handling with try-catch blocks
- Better user feedback with success/error notifications
- Reduced console noise in production

These fixes significantly improve the user experience and resolve reported glitches.
The games/apps grid was not wrapping properly because of double grid nesting.
The outer #games-grid and #apps-grid containers were creating their own grid,
which was constraining the inner .container-apps grid.

Changed #games-grid and #apps-grid from display:grid to display:block to let
the .container-apps handle the grid layout properly. Now items wrap correctly
across the full available width.
Added global modal handler system that properly manages modal display:
- Created modal-handler.js with ModalHandler class
- Creates dynamic overlay backdrop for modals
- Handles ESC key and click-outside-to-close
- Wires up all modal buttons (theme creator, import, pause, etc.)
- Added export theme functionality directly to button
- Modals now properly open/close with smooth animations

Fixes issue where settings modals (theme creator, import, pause)
were not opening when buttons were clicked.
Harden proxy routing by allowing `/scram/` through startup auth middleware
@zgr2575 zgr2575 requested a review from Copilot April 1, 2026 14:54
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 1, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
algebra Ready Ready Preview, Comment Apr 1, 2026 3:06pm

Request Review

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates SlowGuardian to a v9 “new architecture” entry point, expands runtime configuration for new features (auth, developer mode, AdSense, plugins), and adds tooling/docs/CI to support the v9 codebase.

Changes:

  • Replaces the legacy index.js server bootstrap with a minimal entry point that delegates to startServer().
  • Adds formatting/linting configuration (Prettier + ESLint) and introduces a GitHub Actions workflow for service worker / proxy endpoint checks.
  • Adds extensive v9 user/developer documentation and roadmaps, plus substantially updates the main README.

Reviewed changes

Copilot reviewed 22 out of 1153 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
index.js Simplifies legacy entry point to call the new server architecture entry (startServer).
eslint.config.js Adds ESLint flat-config rules/globals and ignore patterns.
docs/user/getting-started.md Adds end-user setup and first-run instructions for v9.
docs/developer/plugins.md Adds plugin authoring guide and example test snippets.
docs/developer/architecture.md Documents v9 modular architecture and request flow.
docs/AUTH_SPOTIFY_GUIDE.md Documents MongoDB auth and Spotify integration.
docs/ADSENSE-SETUP.md Documents AdSense configuration and usage.
config.js Expands config for v9 features (KeyAuth, developer mode, proxy, AdSense, flags).
SECURITY.md Reformats security policy text for readability.
ROADMAP.md Adds v9 roadmap and targets.
README.md Major rewrite describing v9 features, setup, docs, and deployment options.
PROXY_SETUP.md Documents dual proxy setup (UV + Scramjet) and premium gating.
PRODUCTION_ROADMAP.md Adds production readiness checklist and phased plan.
FUTURE_ROADMAP_V10.md Adds forward-looking v10 planning document.
CONTRIBUTING.md Reformats contributing guidelines.
CODE_OF_CONDUCT.md Reformats Contributor Covenant text for readability.
.prettierrc.json Adds Prettier defaults and overrides (HTML/MD).
.github/workflows/test-sw.yml Adds CI workflow to start server and validate SW/proxy endpoints + optional Puppeteer run.
.github/ISSUE_TEMPLATE/feature_request.md Reformats feature request template for readability.
.github/ISSUE_TEMPLATE/bug_report.md Reformats bug report template for readability.
.eslintrc.json Adds legacy ESLint config alongside flat-config.
.env.example Adds environment variable template for v9 features.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread config.js Outdated
Comment on lines +18 to +35
enabled: true, // Set to true to enable KeyAuth authentication
name: "slowguardian", // Your KeyAuth application name
ownerId: "TgewInK5Uy", // Your KeyAuth owner ID
secret: process.env.KEYAUTH_SECRET || "", // Your KeyAuth application secret
version: "1.0", // Your application version in KeyAuth
requireLicense: false, // Set to true if users need license keys
allowRegistration: true, // Allow new user registrations
sessionTimeout: 24 * 60 * 60 * 1000, // Session timeout in milliseconds (24 hours)
},

// Developer Mode Settings - ADMIN CONFIGURATION
developerMode: {
enabled: true, // Enable developer/admin features
defaultAdminCredentials: {
username: "admin",
password: "SlowGuardian2025!", // CHANGE THIS IN PRODUCTION!
},
features: {
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

Config enables privileged/auth features by default and hard-codes an admin password/KeyAuth ownerId in-repo. This is unsafe for real deployments and also makes it easy to accidentally run production with default credentials. Recommendation: default developerMode.enabled and keyauth.enabled to false, source admin credentials from environment variables (or require explicit setup), and fail startup if default credentials are detected (or if KeyAuth is enabled without a non-empty secret).

Copilot uses AI. Check for mistakes.
Comment thread README.md Outdated
Comment on lines +156 to +160
### Default Admin Access

- **URL**: `http://localhost:8080/developer`
- **Username**: `admin`
- **Password**: `SlowGuardian2025!`
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

Publishing a real default admin username/password in README encourages insecure deployments and increases the chance the same credentials get reused in production. Safer approach: remove the concrete password value, document environment-variable based setup (e.g., ADMIN_USERNAME/ADMIN_PASSWORD), and require the password to be set on first boot (or refuse to start developer mode until changed).

Copilot uses AI. Check for mistakes.
Comment thread docs/developer/plugins.md
Comment on lines +346 to +360
// test/plugin.test.js
import plugin from "../plugins/my-plugin/index.js";
import { describe, it, expect } from "node:test";

describe("My Plugin", () => {
it("should have correct metadata", () => {
expect(plugin.name).toBe("my-plugin");
expect(plugin.version).toBe("1.0.0");
});

it("should handle routes correctly", () => {
const route = plugin.routes[0];
expect(route.path).toBe("/api/my-plugin/hello");
});
});
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

This test example is not valid for Node’s built-in node:test: it doesn’t export expect, and toBe is Jest-style. Update the guide to either (a) use node:assert/strict assertions with node:test, or (b) explicitly use Jest (and show the correct imports/setup) so developers can run the example as written.

Copilot uses AI. Check for mistakes.
Comment thread docs/developer/plugins.md
Comment on lines +368 to +377
import request from "supertest";
import app from "../index.js";

describe("Plugin Integration", () => {
it("should respond to plugin routes", async () => {
const response = await request(app).get("/api/my-plugin/hello").expect(200);

expect(response.body.message).toBe("Hello from my plugin!");
});
});
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

This integration test example assumes index.js exports an Express app, but index.js in this PR only calls startServer() and exports nothing. Adjust the documentation to reflect the new architecture (e.g., export an app factory from server.js, or show how to create a test instance of the server/app that Supertest can target).

Copilot uses AI. Check for mistakes.
Comment thread .github/workflows/test-sw.yml Outdated
- name: Install Chrome for Puppeteer
run: |
sudo apt-get update
sudo apt-get install -y chromium-browser
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

chromium-browser frequently isn’t available on ubuntu-latest via apt (it’s commonly a snap package), which can break CI. Prefer installing chromium (apt package) or use browser-actions/setup-chrome / install google-chrome-stable, and configure Puppeteer to use the installed executable path if needed.

Suggested change
sudo apt-get install -y chromium-browser
sudo apt-get install -y chromium

Copilot uses AI. Check for mistakes.
Comment thread .eslintrc.json
Comment on lines +1 to +31
{
"env": {
"node": true,
"es2022": true,
"browser": true
},
"extends": ["eslint:recommended"],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"rules": {
"no-unused-vars": ["error", { "argsIgnorePattern": "^_" }],
"no-console": "off",
"prefer-const": "error",
"no-var": "error",
"eqeqeq": ["error", "always"],
"curly": ["error", "all"],
"brace-style": ["error", "1tbs"],
"indent": ["error", 2],
"quotes": ["error", "double"],
"semi": ["error", "always"]
},
"ignorePatterns": [
"static/assets/scripts/**",
"static/m/**",
"static/dy/**",
"static/sw.js",
"node_modules/**"
]
}
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

The PR introduces both eslint.config.js (flat config) and .eslintrc.json (legacy config). Having both commonly causes confusion and inconsistent lint results between CLI/editor/CI depending on ESLint version and tooling. Recommendation: standardize on one configuration format (prefer flat config for ESLint v9+) and remove or clearly document the other as legacy/editor-only (with instructions on how it’s intended to be used).

Suggested change
{
"env": {
"node": true,
"es2022": true,
"browser": true
},
"extends": ["eslint:recommended"],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"rules": {
"no-unused-vars": ["error", { "argsIgnorePattern": "^_" }],
"no-console": "off",
"prefer-const": "error",
"no-var": "error",
"eqeqeq": ["error", "always"],
"curly": ["error", "all"],
"brace-style": ["error", "1tbs"],
"indent": ["error", 2],
"quotes": ["error", "double"],
"semi": ["error", "always"]
},
"ignorePatterns": [
"static/assets/scripts/**",
"static/m/**",
"static/dy/**",
"static/sw.js",
"node_modules/**"
]
}
{
"x-legacyNote": "Primary ESLint configuration is eslint.config.js. This .eslintrc.json is kept only for legacy/editor tooling that does not yet support flat config and should be kept in sync or treated as secondary.",
"env": {
"node": true,
"es2022": true,
"browser": true
},
"extends": ["eslint:recommended"],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"rules": {
"no-unused-vars": ["error", { "argsIgnorePattern": "^_" }],
"no-console": "off",
"prefer-const": "error",
"no-var": "error",
"eqeqeq": ["error", "always"],
"curly": ["error", "all"],
"brace-style": ["error", "1tbs"],
"indent": ["error", 2],
"quotes": ["error", "double"],
"semi": ["error", "always"]
},
"ignorePatterns": [
"static/assets/scripts/**",
"static/m/**",
"static/dy/**",
"static/sw.js",
"node_modules/**"
]
}

Copilot uses AI. Check for mistakes.
Comment thread SECURITY.md Outdated
Comment on lines +17 to +18
Create an issue and label it with security and how severe, describe the issue, and show steps to
reproduce or exploit the flaw.
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

Requesting security reports via public GitHub issues can lead to inadvertent disclosure of exploitable vulnerabilities. Update the policy to provide a private reporting channel (security email and/or GitHub Security Advisories) and ask reporters to avoid publishing exploit details publicly until a fix is available.

Suggested change
Create an issue and label it with security and how severe, describe the issue, and show steps to
reproduce or exploit the flaw.
If you discover a security vulnerability, please report it via a private channel such as a
GitHub Security Advisory or by emailing our security contact at `security@example.com`. Include
as much detail as possible to help us reproduce the issue (affected versions, configuration,
and step-by-step instructions), but **do not** open a public GitHub issue or share exploit
details publicly until we have confirmed the vulnerability and released a fix.

Copilot uses AI. Check for mistakes.
Comment thread CONTRIBUTING.md Outdated
Comment on lines +2 to +3
JavaScript and/or HTML5 projects on Git Hub. The code you commit will be reviewed and/or reverted if
it doesn't meet SlowGuardians quality standards. Additionally, you must go through a screening
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

Correct branding/grammar: 'Git Hub' should be 'GitHub', and 'SlowGuardians' should be 'SlowGuardian's' (possessive).

Suggested change
JavaScript and/or HTML5 projects on Git Hub. The code you commit will be reviewed and/or reverted if
it doesn't meet SlowGuardians quality standards. Additionally, you must go through a screening
JavaScript and/or HTML5 projects on GitHub. The code you commit will be reviewed and/or reverted if
it doesn't meet SlowGuardian's quality standards. Additionally, you must go through a screening

Copilot uses AI. Check for mistakes.
@zgr2575
Copy link
Copy Markdown
Owner Author

zgr2575 commented Apr 1, 2026

@copilot apply changes based on the comments in this thread

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 1, 2026

@copilot apply changes based on the comments in this thread

Applied all changes from the review thread in commit 89827c8:

  • config.js: developerMode.enabled and keyauth.enabled now default to false; hardcoded credentials and owner ID replaced with ADMIN_USERNAME, ADMIN_PASSWORD, KEYAUTH_OWNER_ID, and KEYAUTH_APP_NAME env vars
  • server.js: startup validation added — server refuses to start if developer mode or KeyAuth is enabled without the required env vars set
  • README.md: removed hardcoded password, documents env-var setup and the startup guard
  • docs/developer/plugins.md: unit test example updated to use node:test + node:assert/strict; integration test updated to use createSlowGuardianServer() from server.js
  • .github/workflows/test-sw.yml: chromium-browserchromium
  • .eslintrc.json: added x-legacyNote explaining the dual flat/legacy config setup
  • SECURITY.md: updated to direct reporters to GitHub Security Advisories instead of public issues
  • CONTRIBUTING.md: fixed "Git Hub" → "GitHub" and "SlowGuardians" → "SlowGuardian's"

@zgr2575 zgr2575 merged commit 2f4290b into main Apr 1, 2026
2 checks passed
@zgr2575 zgr2575 deleted the V9 branch April 1, 2026 15:08
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