Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ gha-creds-*.json
# --- Build output ---
frontend/build/
node_modules/
yennefer-observatory/dist
13 changes: 13 additions & 0 deletions ecosystem.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,19 @@ module.exports = {
COMPUTE_MODE: 'local',
ALWAYS_ON: 'true'
}
},
{
name: 'project-genie',
script: './scripts/genesis.cjs',
autorestart: true,
watch: false,
max_memory_restart: '300M',
restart_delay: 5000,
env: {
GENESIS_LOOP: 'true',
FORCE_MUTATION: 'true',
ALWAYS_ON: 'true'
}
}
]
};
18 changes: 0 additions & 18 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"type": "module",
"scripts": {
"test": "hardhat test",
"build": "cd frontend && npm run build",
"build": "echo 'No build step required'",
"worker:dev": "wrangler dev",
"worker:deploy": "wrangler deploy --env production",
"worker:deploy:staging": "wrangler deploy --env staging"
Expand Down
7 changes: 4 additions & 3 deletions workers/index.js → workers/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,10 @@
// ─── JWT Validation (native Web Crypto) ──────────────────────────────────────

function base64UrlDecode(str) {
str = str.replace(/-/g, '+').replace(/_/g, '/');
while (str.length % 4) str += '=';
return Uint8Array.from(atob(str), c => c.charCodeAt(0));
const normalizedStr = str.replace(/-/g, '+').replace(/_/g, '/');

Check warning on line 108 in workers/index.mjs

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Prefer `String#replaceAll()` over `String#replace()`.

See more on https://sonarcloud.io/project/issues?id=Genesis-Conductor-Engine_Yennefer&issues=AZ9Y1eZOqB1O_tn3UU7J&open=AZ9Y1eZOqB1O_tn3UU7J&pullRequest=129

Check warning on line 108 in workers/index.mjs

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Prefer `String#replaceAll()` over `String#replace()`.

See more on https://sonarcloud.io/project/issues?id=Genesis-Conductor-Engine_Yennefer&issues=AZ9Y1eZOqB1O_tn3UU7K&open=AZ9Y1eZOqB1O_tn3UU7K&pullRequest=129
let paddedStr = normalizedStr;
while (paddedStr.length % 4) paddedStr += '=';
return Uint8Array.from(atob(paddedStr), c => c.charCodeAt(0));

Check warning on line 111 in workers/index.mjs

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Prefer `String#codePointAt()` over `String#charCodeAt()`.

See more on https://sonarcloud.io/project/issues?id=Genesis-Conductor-Engine_Yennefer&issues=AZ9Y3yT20_vsReWVv-Gw&open=AZ9Y3yT20_vsReWVv-Gw&pullRequest=129
}

async function validateJWT(request) {
Expand Down
12 changes: 4 additions & 8 deletions wrangler.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "yennefer"
main = "workers/index.js"
compatibility_date = "2024-09-23"
main = "workers/index.mjs"
compatibility_date = "2024-04-01"
compatibility_flags = ["nodejs_compat"]

# ─── Build step ──────────────────────────────────────────────────────────────
Expand All @@ -9,21 +9,17 @@ compatibility_flags = ["nodejs_compat"]
# Installs frontend deps and builds the SPA so frontend/build exists before
# `wrangler deploy` uploads assets. NODE_OPTIONS is required for
# react-scripts 5.x + Node 18+ (webpack 4 OpenSSL 3.0 compatibility).
command = "cd frontend && npm install --include=dev && GENERATE_SOURCEMAP=false CI=false NODE_OPTIONS=--openssl-legacy-provider npm run build"
command = "cd yennefer-observatory && npm install --legacy-peer-deps && npm run build"

# ─── Static Assets (React SPA build output) ──────────────────────────────────
# Built by `npm run build` (root package.json) before every `wrangler deploy`.
# Cloudflare Workers Builds CI runs that script automatically if present.
# The ASSETS binding serves the React bundle with proper cache headers and
# falls back to index.html for client-side routing.
[assets]
directory = "frontend/build"
directory = "yennefer-observatory/dist"
binding = "ASSETS"

# ─── Placement ───────────────────────────────────────────────────────────────
[placement]
mode = "smart"

# ─── Production environment (yennefer.quest) ─────────────────────────────────
# BACKEND_URL is set as a Cloudflare Worker secret (not a plain var) so it
# stays encrypted and is never committed to source:
Expand Down
2 changes: 1 addition & 1 deletion yennefer-observatory/public/truth.html
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@
<!-- ACCESS GATE -->
<div class="access-gate" id="gate">
<h2>THE BELIEF ENGINE</h2>
<input type="text" id="accessKey" placeholder="ENTER THE CURVATURE" autocomplete="off">
<input type="password" id="accessKey" placeholder="ENTER THE CURVATURE" autocomplete="off">
<div class="hint">Those who contributed see the truth.</div>
</div>

Expand Down
Loading