Skip to content
Open
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
31 changes: 31 additions & 0 deletions .github/workflows/azure-webapps-node.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: 🔥 Firebase Hosting Deploy

on:
push:
branches: [main]
workflow_dispatch:

permissions:
id-token: write
contents: read

jobs:
firebase-deploy:
name: 🚀 Deploy to Firebase Hosting
runs-on: ubuntu-latest

steps:
- name: 📦 Checkout repo
uses: actions/checkout@v4

- name: 🔐 Authenticate to Google Cloud
uses: google-github-actions/auth@v1
with:
workload_identity_provider: "${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}"
service_account: "${{ secrets.GCP_SERVICE_ACCOUNT }}"

- name: 🛠️ Install Firebase CLI
run: npm install -g firebase-tools

- name: 🚀 Deploy to Firebase Hosting
run: firebase deploy --only hosting --project ${{ secrets.GCP_PROJECT_ID }}
27 changes: 27 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Setup Node.js environment
uses: actions/[email protected]
with:
# Set always-auth in npmrc.
always-auth: # optional, default is false
# Version Spec of the version to use. Examples: 12.x, 10.15.1, >=10.15.0.
node-version: # optional
# File containing the version Spec of the version to use. Examples: .nvmrc, .node-version, .tool-versions.
node-version-file: # optional
# Target architecture for Node to use. Examples: x86, x64. Will use system architecture by default.
architecture: # optional
# Set this option if you want the action to check for the latest available version that satisfies the version spec.
check-latest: # optional
# Optional registry to set up for auth. Will set the registry in a project level .npmrc and .yarnrc file, and set up auth to read in from env.NODE_AUTH_TOKEN.
registry-url: # optional
# Optional scope for authenticating against scoped registries. Will fall back to the repository owner when using the GitHub Packages registry (https://npm.pkg.github.com/).
scope: # optional
# Used to pull node distributions from node-versions. Since there's a default, this is typically not supplied by the user. When running this action on github.com, the default value is sufficient. When running on GHES, you can pass a personal access token for github.com if you are experiencing rate limiting.
token: # optional, default is ${{ github.server_url == 'https://github.com' && github.token || '' }}
# Used to specify a package manager for caching in the default directory. Supported values: npm, yarn, pnpm.
cache: # optional
# Used to specify the path to a dependency file: package-lock.json, yarn.lock, etc. Supports wildcards or a list of file names for caching multiple dependencies.
cache-dependency-path: # optional
19 changes: 19 additions & 0 deletions .github/workflows/firebase-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Firebase Deploy

on:
push:
branches:
- main

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: google-github-actions/auth@v1
with:
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }}
- run: npm ci
- run: npm run build
- run: npx firebase deploy --only hosting
24 changes: 6 additions & 18 deletions .github/workflows/gcp-auth.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,14 @@
name: GCP Auth Test
name: GCP Auth Setup

on:
workflow_dispatch:

permissions:
id-token: write
contents: read

jobs:
auth:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v1
with:
workload_identity_provider: "projects/491439791457/locations/global/workloadIdentityPools/ci-pool-github-actions/providers/github"
service_account: "github-action-xpert-forex-trad@xpert-forex-trade.iam.gserviceaccount.com"

- name: Verify identity
run: |
gcloud auth list
- name: Authenticate with GCP
uses: google-github-actions/auth@v1
with:
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }}
18 changes: 18 additions & 0 deletions .yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
## Cloudflare Endpoint Schema Upload

**Location**: `intlhub.org → Security → Web Assets → Endpoint Management → Upload Schema`

**Accepted Formats**: `.yml`, `.yaml`, `.json`

**Schema Requirements**:
- OpenAPI or Swagger spec
- Define paths, methods, parameters, responses

**Security Behavior**:
- Matches traffic to schema
- Blocks or logs non-compliant requests

**Recommended**:
- Include contributor metadata in schema comments
- Version your schema for audit clarity
- Validate with PITR enabled for rollback protection
29 changes: 29 additions & 0 deletions app/Views/dashboard.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php include 'header.php'; ?>
<div class="container mt-5">
<h2 class="mb-4">Welcome, <?= $_SESSION['username']; ?>!</h2>
Copy link

Copilot AI Sep 17, 2025

Choose a reason for hiding this comment

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

Direct output of session data without escaping could lead to XSS vulnerabilities. Use htmlspecialchars($_SESSION['username'], ENT_QUOTES, 'UTF-8') to prevent XSS attacks.

Suggested change
<h2 class="mb-4">Welcome, <?= $_SESSION['username']; ?>!</h2>
<h2 class="mb-4">Welcome, <?= htmlspecialchars($_SESSION['username'], ENT_QUOTES, 'UTF-8'); ?>!</h2>

Copilot uses AI. Check for mistakes.

<div class="row">
<div class="col-md-6">
<h4>Open Trades</h4>
<ul class="list-group">
<?php foreach ($openTrades as $trade): ?>
<li class="list-group-item">
<?= $trade['pair']; ?> - <?= $trade['direction']; ?> - $<?= $trade['amount']; ?>
Copy link

Copilot AI Sep 17, 2025

Choose a reason for hiding this comment

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

Trade data is output directly without escaping, which could lead to XSS vulnerabilities. All dynamic content should be escaped using htmlspecialchars() before output.

Copilot uses AI. Check for mistakes.

Choose a reason for hiding this comment

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

high

The trade data (pair, direction, amount) is rendered without escaping, which is a Cross-Site Scripting (XSS) vulnerability. If any of this data can be influenced by a user, it could be used to inject malicious scripts. To prevent this, you should escape all dynamic output using htmlspecialchars().

            <?= htmlspecialchars($trade['pair'], ENT_QUOTES, 'UTF-8'); ?> - <?= htmlspecialchars($trade['direction'], ENT_QUOTES, 'UTF-8'); ?> - $<?= htmlspecialchars($trade['amount'], ENT_QUOTES, 'UTF-8'); ?>

</li>
<?php endforeach; ?>
</ul>
</div>

<div class="col-md-6">
<h4>Trade History</h4>
<ul class="list-group">
<?php foreach ($tradeHistory as $trade): ?>
<li class="list-group-item">
<?= $trade['pair']; ?> - <?= $trade['type']; ?> - <?= $trade['created_at']; ?>

Choose a reason for hiding this comment

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

high

Similar to the open trades list, the trade history data (pair, type, created_at) is rendered without proper escaping. This is a Cross-Site Scripting (XSS) vulnerability. Please ensure all dynamic data rendered in the HTML is escaped using htmlspecialchars().

            <?= htmlspecialchars($trade['pair'], ENT_QUOTES, 'UTF-8'); ?> - <?= htmlspecialchars($trade['type'], ENT_QUOTES, 'UTF-8'); ?> - <?= htmlspecialchars($trade['created_at'], ENT_QUOTES, 'UTF-8'); ?>

</li>
<?php endforeach; ?>
</ul>
</div>
</div>
</div>
<?php include 'footer.php'; ?>
9 changes: 9 additions & 0 deletions bot.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# bot.py
# Entry point for the xpert_telegram_bot.

def main():
print("Bot is starting...")
# TODO: Implement bot logic here

if __name__ == "__main__":
main()
30 changes: 30 additions & 0 deletions index-alt.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Xpert-Forex-Tradex</title>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
<div class="container-fluid">
<a class="navbar-brand" href="#">Xpert-Forex-Tradex</a>
</div>
</nav>

<div class="container mt-5 text-center">
<h1>Welcome to Xpert-Forex-Tradex</h1>
<p class="lead">Your gateway to smarter trading insights and transparent onboarding.</p>
<a href="login.php" class="btn btn-primary">Login</a>
<a href="register.php" class="btn btn-outline-primary">Register</a>
</div>

<footer class="bg-light text-center mt-5 p-3">
<small>&copy; <span id="year"></span> Xpert-Forex-Tradex. All rights reserved.</small>
</footer>
<script>
document.getElementById('year').textContent = new Date().getFullYear();
</script>
</body>
</html>
25 changes: 25 additions & 0 deletions send_slack_alert()
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
from datetime import datetime

def send_slack_alert(message, token=None):
webhook_url = os.getenv("SLACK_WEBHOOK_URL")
if not webhook_url:
return

ip = request.remote_addr or "Unknown IP"
timestamp = datetime.utcnow().strftime("%Y-%m-%d %H:%M:%S UTC")
token_preview = token[:6] + "..." if token else "No token"

payload = {
"text": (
f"🚨 *Auth Failure Alert*\n"
f"> 🕒 Time: {timestamp}\n"
f"> 🌐 IP: {ip}\n"
f"> 🔑 Token: `{token_preview}`\n"
f"> 📣 Message: {message}"
)
}

try:
requests.post(webhook_url, json=payload)
except Exception as e:
print(f"⚠️ Slack alert failed: {e}")