-
Notifications
You must be signed in to change notification settings - Fork 5
Your feature branchIntegrate Firebase CI + Docker Node Setup + Initial Bot Scaffolding #30
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
base: main
Are you sure you want to change the base?
Changes from 11 commits
51a3911
34e7eea
e8c659f
6f5a626
63e7e70
b96bcb1
160acd1
9531f28
067ccb3
6e49eb4
6192edf
e3d55d4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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: "projects/491439791457/locations/global/workloadIdentityPools/github-pool/providers/github-provider" | ||
| service_account: "[email protected]" | ||
|
|
||
| - name: π οΈ Install Firebase CLI | ||
| run: npm install -g firebase-tools | ||
|
|
||
| - name: π Deploy to Firebase Hosting | ||
| run: firebase deploy --only hosting --project xpert-forex-trade | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,24 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - 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 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+1
to
+24
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - 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 | |
| name: Build and Setup Node.js | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| 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 |
| 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 |
| 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 }} |
| 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 | ||
|
Comment on lines
+1
to
+18
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This file is named with a |
||
| 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> | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The user's name is directly rendered from the session without any output escaping. This is a critical Cross-Site Scripting (XSS) vulnerability. If a username contains malicious HTML or JavaScript, it will be executed in the browser. You should always escape dynamic data rendered in HTML. The PR description mentions this is pending, but it's crucial to address it before merging.1 <h2 class="mb-4">Welcome, <?= htmlspecialchars($_SESSION['username'], ENT_QUOTES, 'UTF-8'); ?>!</h2>Style Guide ReferencesFootnotes
|
||||||
|
|
||||||
| <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']; ?> | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The data for open trades is rendered without escaping, which poses a Cross-Site Scripting (XSS) risk. Any data that originates from the database and could have been influenced by user input should be treated as untrusted. Please escape all variables before outputting them to the page.1 <?= htmlspecialchars($trade['pair'], ENT_QUOTES, 'UTF-8'); ?> - <?= htmlspecialchars($trade['direction'], ENT_QUOTES, 'UTF-8'); ?> - $<?= htmlspecialchars($trade['amount'], ENT_QUOTES, 'UTF-8'); ?>Style Guide ReferencesFootnotes
|
||||||
| <?= $trade['pair']; ?> - <?= $trade['direction']; ?> - $<?= $trade['amount']; ?> | |
| <?= htmlspecialchars($trade['pair']); ?> - <?= htmlspecialchars($trade['direction']); ?> - $<?= htmlspecialchars($trade['amount']); ?> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar to the open trades list, the trade history data is outputted without escaping. This is also a Cross-Site Scripting (XSS) vulnerability. All dynamic data should be escaped to prevent malicious script execution.1
<?= htmlspecialchars($trade['pair'], ENT_QUOTES, 'UTF-8'); ?> - <?= htmlspecialchars($trade['type'], ENT_QUOTES, 'UTF-8'); ?> - <?= htmlspecialchars($trade['created_at'], ENT_QUOTES, 'UTF-8'); ?>Style Guide References
Footnotes
-
OWASP Top 10 recommends sanitizing all user-controllable data to prevent XSS attacks. Using functions like
htmlspecialchars()is a standard practice in PHP for this purpose. β©
Copilot
AI
Sep 4, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
User data is being output without proper escaping, creating potential XSS vulnerabilities. Use htmlspecialchars() to escape output: - -
| <?= $trade['pair']; ?> - <?= $trade['type']; ?> - <?= $trade['created_at']; ?> | |
| <?= htmlspecialchars($trade['pair']); ?> - <?= htmlspecialchars($trade['type']); ?> - <?= htmlspecialchars($trade['created_at']); ?> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| xpert_telegram_bot/ | ||
| βββ bot.py β Paste this code here | ||
| βββ handlers/ | ||
| βββ config/ | ||
| βββ logs/ | ||
| βββ .env | ||
| βββ requirements.txt | ||
| βββ diagnostics.py | ||
|
Comment on lines
+1
to
+8
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Comment on lines
+1
to
+8
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| <!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>© <?= date('Y'); ?> Xpert-Forex-Tradex. All rights reserved.</small> | ||
|
||
| </footer> | ||
xpertforextradeinc marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| </body> | ||
| </html> | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hardcoded GCP project details should be moved to GitHub secrets for security. Use ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }} and ${{ secrets.GCP_SERVICE_ACCOUNT }} instead of hardcoded values.