Skip to content
Merged
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
4 changes: 2 additions & 2 deletions .example.env
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ NEXT_PUBLIC_APP_NAME=GhostClass

# ⚠️ App version displayed in footer and health checks
# 🔨 Build-time (Infisical `/build-time` folder)
NEXT_PUBLIC_APP_VERSION=4.7.0
NEXT_PUBLIC_APP_VERSION=4.7.1

# ⚠️ Your production domain WITHOUT https://
# All URL-based variables are derived from this.
Expand Down Expand Up @@ -379,7 +379,7 @@ REQUEST_SIGNATURE_MAX_AGE=600

# ⚠️ Minimum supported app version required to bypass forced update
# 🚀 Runtime (Infisical `/runtime` folder → Server Env Var)
MIN_APP_VERSION=4.7.0
MIN_APP_VERSION=4.7.1

# ℹ️ Enforce Firebase App Check for all mobile clients in production
# Valid: "true", "false" (default: false in dev, true recommended in prod)
Expand Down
8 changes: 1 addition & 7 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,14 @@ updates:
directory: "/"
schedule:
interval: "weekly"
patterns:
- "*"
open-pull-requests-limit: 0
ignore:
# ESLint v10 is not yet supported by typescript-eslint
# Keep ESLint at v9 until typescript-eslint adds v10 support
- dependency-name: "eslint"
update-types: ["version-update:semver-major"]
- dependency-name: "@eslint/js"
update-types: ["version-update:semver-major"]
multi-ecosystem-group: "all-dependencies"
open-pull-requests-limit: 0

- package-ecosystem: "docker"
directory: "/"
Expand All @@ -36,7 +33,6 @@ updates:
patterns:
- "*"
multi-ecosystem-group: "all-dependencies"
open-pull-requests-limit: 0

- package-ecosystem: "github-actions"
directory: "/"
Expand All @@ -45,7 +41,6 @@ updates:
patterns:
- "*"
multi-ecosystem-group: "all-dependencies"
open-pull-requests-limit: 0

- package-ecosystem: "pub"
directory: "/mobile"
Expand All @@ -54,7 +49,6 @@ updates:
patterns:
- "*"
multi-ecosystem-group: "all-dependencies"
open-pull-requests-limit: 0

- package-ecosystem: "pip"
directory: "/.github"
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ jobs:
set -euo pipefail
set +x
if [ -n "${GOOGLE_SERVICES_JSON_BASE64:-}" ]; then
echo "::add-mask::$GOOGLE_SERVICES_JSON_BASE64"
while IFS= read -r line; do
[ -n "$line" ] && echo "::add-mask::$line"
done <<< "$GOOGLE_SERVICES_JSON_BASE64"
printf '%s' "$GOOGLE_SERVICES_JSON_BASE64" | base64 --decode > android/app/google-services.json
echo "✓ Recreated android/app/google-services.json from secret"
elif [ -f android/app/google-services.json ]; then
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,11 @@ jobs:

: "${GOOGLE_SERVICES_JSON_BASE64:?GOOGLE_SERVICES_JSON_BASE64 environment variable or secret is required}"

[ -n "$GOOGLE_SERVICES_JSON_BASE64" ] && echo "::add-mask::$GOOGLE_SERVICES_JSON_BASE64"
if [ -n "$GOOGLE_SERVICES_JSON_BASE64" ]; then
while IFS= read -r line; do
[ -n "$line" ] && echo "::add-mask::$line"
done <<< "$GOOGLE_SERVICES_JSON_BASE64"
fi

mkdir -p app
printf '%s' "$GOOGLE_SERVICES_JSON_BASE64" | base64 --decode > app/google-services.json
Expand All @@ -749,6 +753,7 @@ jobs:
if [ -z "${FIREBASE_API_KEY_ANDROID:-}" ]; then
DERIVED_KEY=$(jq -r '.client[0].api_key[0].current_key // empty' app/google-services.json)
if [ -n "$DERIVED_KEY" ]; then
echo "::add-mask::$DERIVED_KEY"
echo "FIREBASE_API_KEY_ANDROID=$DERIVED_KEY" >> "$GITHUB_ENV"
echo "✓ Derived FIREBASE_API_KEY_ANDROID directly from google-services.json"
fi
Expand All @@ -757,6 +762,7 @@ jobs:
if [ -z "${FIREBASE_PROJECT_ID:-}" ]; then
DERIVED_PROJECT_ID=$(jq -r '.project_info.project_id // empty' app/google-services.json)
if [ -n "$DERIVED_PROJECT_ID" ]; then
echo "::add-mask::$DERIVED_PROJECT_ID"
echo "FIREBASE_PROJECT_ID=$DERIVED_PROJECT_ID" >> "$GITHUB_ENV"
echo "✓ Derived FIREBASE_PROJECT_ID directly from google-services.json"
fi
Expand Down
2 changes: 1 addition & 1 deletion mobile/lib/config/app_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class AppConfig {

/// Current application version
static String get appVersion =>
const String.fromEnvironment('APP_VERSION', defaultValue: '4.7.0');
const String.fromEnvironment('APP_VERSION', defaultValue: '4.7.1');

/// Commit SHA injected by CI for release builds.
static String get appCommitSha =>
Expand Down
2 changes: 1 addition & 1 deletion mobile/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix.
version: 4.7.0+1
version: 4.7.1+1
environment:
sdk: ^3.11.4

Expand Down
4 changes: 2 additions & 2 deletions 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
@@ -1,6 +1,6 @@
{
"name": "ghostclass",
"version": "4.7.0",
"version": "4.7.1",
"private": true,
"engines": {
"node": ">=22.12.0",
Expand Down
2 changes: 1 addition & 1 deletion public/openapi/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ openapi: 3.1.0

info:
title: GhostClass API
version: 4.7.0
version: 4.7.1
description: |
**GhostClass API** provides endpoints for authentication, profile synchronization,
attendance integrations with EzyGo, telemetry, and build provenance.
Expand Down
56 changes: 45 additions & 11 deletions scripts/fetch-build-time-vars.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,20 @@ async function fetchSecrets(
return secrets;
}

/**
* Helper to mask single or multi-line values in GitHub Actions logs.
*/
function maskValue(val) {
if (!val) return;
const str = String(val);
for (const line of str.split(/\r?\n/)) {
const trimmed = line.trim();
if (trimmed.length > 0) {
console.log(`::add-mask::${trimmed}`);
}
}
}

/**
* Exports secrets to GITHUB_ENV and registers masks for sensitive values.
*/
Expand All @@ -117,6 +131,11 @@ function exportSecrets(secrets) {

// Define exactly which keys should be masked in GitHub logs
const keysToMask = [
"GOOGLE_SERVICES_JSON_BASE64",
"MOBILE_SENTRY_AUTH_TOKEN",
"FIREBASE_API_KEY_ANDROID",
"FIREBASE_API_KEY_IOS",
"NEXT_PUBLIC_MOBILE_SENTRY_DSN",
"NEXT_PUBLIC_BACKEND_URL",
"NEXT_PUBLIC_SUPABASE_URL",
"NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY",
Expand All @@ -125,6 +144,8 @@ function exportSecrets(secrets) {
"NEXT_PUBLIC_SENTRY_DSN",
"NEXT_PUBLIC_TURNSTILE_SITE_KEY",
"NEXT_PUBLIC_GA_ID",
"FIREBASE_PROJECT_ID",
"FIREBASE_STORAGE_BUCKET",
];

// Explicitly omit dev URLs/keys from masking
Expand All @@ -133,30 +154,43 @@ function exportSecrets(secrets) {
"NEXT_PUBLIC_SUPABASE_DEV_PUBLISHABLE_KEY",
];

// Also mask any key matching sensitive token/secret patterns
const sensitivePattern = /(_KEY|_SECRET|_TOKEN|_PASSWORD|_AUTH|_DSN|_BASE64)$/i;

function shouldMask(key) {
if (keysToOmitFromMasking.includes(key)) return false;
if (keysToMask.includes(key)) return true;
return sensitivePattern.test(key);
}

if (githubEnvFile) {
console.log(`📝 Exporting variables to GITHUB_ENV...`);
for (const secret of secrets) {
if (
keysToMask.includes(secret.secretKey) &&
!keysToOmitFromMasking.includes(secret.secretKey) &&
shouldMask(secret.secretKey) &&
secret.secretValue
) {
console.log(`::add-mask::${secret.secretValue}`);
maskValue(secret.secretValue);
}
if (secret.secretValue && String(secret.secretValue).includes("\n")) {
const delimiter = `EOF_${Date.now()}_${Math.random().toString(36).substring(2, 8)}`;
fs.appendFileSync(
githubEnvFile,
`${secret.secretKey}<<${delimiter}\n${secret.secretValue}\n${delimiter}\n`,
);
} else {
fs.appendFileSync(
githubEnvFile,
`${secret.secretKey}=${secret.secretValue || ""}\n`,
);
}
fs.appendFileSync(
githubEnvFile,
`${secret.secretKey}=${secret.secretValue}\n`,
);
console.log(` + ${secret.secretKey}`);
}
console.log(`🎉 Variables exported successfully!`);
} else {
console.log(`ℹ️ GITHUB_ENV is not set. Values loaded:`);
for (const secret of secrets) {
if (
keysToMask.includes(secret.secretKey) &&
!keysToOmitFromMasking.includes(secret.secretKey)
) {
if (shouldMask(secret.secretKey)) {
console.log(` ${secret.secretKey}=[MASKED]`);
} else {
console.log(` ${secret.secretKey}=${secret.secretValue}`);
Expand Down
Loading