Skip to content

compare br Master fix work flow non poof jop e2e cypress don't truest google chome & dev google nodejs cloud verify POW POR POA.#37

Closed
Dargon789 wants to merge 36 commits intomainfrom
master
Closed

compare br Master fix work flow non poof jop e2e cypress don't truest google chome & dev google nodejs cloud verify POW POR POA.#37
Dargon789 wants to merge 36 commits intomainfrom
master

Conversation

@Dargon789
Copy link
Owner

@Dargon789 Dargon789 commented Oct 2, 2025

Summary by Sourcery

Restrict and secure acceleration service endpoints, fix a frontend redirect bug, and introduce a suite of CI/CD workflows along with updated documentation and issue templates.

Bug Fixes:

  • Fix demo redirect URL to use the actual path segment instead of params.next.

Enhancements:

  • Whitelist allowed service proxy paths in acceleration routes and return 400 on invalid requests.

CI:

  • Add Google GKE deployment workflow.
  • Add Octopus Deploy deployment workflow.
  • Add Next.js, Jekyll, and static GitHub Pages deployment workflows.
  • Add basic CI, Rust, and CircleCI pipeline configurations.

Documentation:

  • Add security policy document (SECURITY.md).
  • Enhance GitHub issue templates with standardized front-matter fields and emoji.

Dargon789 and others added 30 commits July 4, 2025 23:01
Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
…o v23.3.0 (#8)

* ops: Add more mempool servers to elements.conf

* ops: Bump elements to v23.3.0

---------

Co-authored-by: wiz <j@wiz.biz>
Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
…in permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
…in permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
…gery

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
…in permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
Add a CircleCI configuration to run Rust formatting checks and tests via cargo.yml

CI:

Introduce a build-and-test job using cimg/rust:1.90.0 to run cargo fmt and cargo test
Add caching for Cargo dependencies and build artifacts

Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
* Update issue templates

* Update .github/ISSUE_TEMPLATE/00-bug-issue.md

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>

* Update .github/ISSUE_TEMPLATE/30-feature-request.md

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>

* Update .github/ISSUE_TEMPLATE/custom.md

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>

---------

Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Dargon789 and others added 5 commits October 2, 2025 14:45
Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
…gery

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
…scripting

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
@sourcery-ai
Copy link

sourcery-ai bot commented Oct 2, 2025

Reviewer's Guide

This PR hardens service proxy routes with explicit path whitelisting, adjusts GitHub issue templates, fixes a front-end redirect bug, tidies an existing CI config, and adds a suite of CI/CD workflows alongside a new security policy.

Sequence diagram for hardened service proxy route with path whitelisting

sequenceDiagram
participant Client
participant AccelerationRoutes
participant logger
participant MempoolService

Client->>AccelerationRoutes: Request to /api/v1/services/{path}
AccelerationRoutes->>AccelerationRoutes: Extract userPath
AccelerationRoutes->>AccelerationRoutes: Check allowedPaths whitelist
alt Path allowed
    AccelerationRoutes->>MempoolService: Forward request to whitelisted path
    MempoolService-->>AccelerationRoutes: Return response
    AccelerationRoutes-->>Client: Send response
else Path not allowed
    AccelerationRoutes->>logger: Log invalid path
    AccelerationRoutes-->>Client: Return 400 error
end
Loading

Class diagram for updated AccelerationRoutes service proxy methods

classDiagram
class AccelerationRoutes {
  - $getAcceleratorAccelerationsHistoryAggregated(req, res)
  - $getAcceleratorAccelerationsStats(req, res)
  - $getAcceleratorEstimate(req, res)
  + allowedPaths: {accelerations, accelerations/history, accelerations/stats, estimate}
}
class logger {
  + err(message, tag)
}
AccelerationRoutes --> logger: logs errors
Loading

File-Level Changes

Change Details Files
Secure and validate accelerator route paths in the backend
  • Define an allowedPaths map listing permitted endpoints
  • Extract userPath from the incoming URL and look up safePath
  • Log and return a 400 error for invalid paths
  • Construct the external service URL using safePath instead of raw originalUrl
backend/src/api/acceleration/acceleration.routes.ts
Enhance GitHub issue templates with metadata fields
  • Wrap the name field in quotes for proper YAML parsing
  • Add title, labels, and assignees fields to bug and feature templates
  • Introduce a custom issue template file with standard front matter
.github/ISSUE_TEMPLATE/00-bug-issue.md
.github/ISSUE_TEMPLATE/30-feature-request.md
.github/ISSUE_TEMPLATE/custom.md
Fix demo redirect URL logic in the frontend
  • Replace use of params.next with the computed path[index] value in window.location.replace
frontend/src/app/shared/common.utils.ts
Correct formatting in the existing CI workflow
  • Remove stray backslash and ensure newline at end of file
.github/workflows/ci.yml
Add comprehensive CI/CD workflows for multiple environments
  • Google Cloud GKE build and deploy (google.yml)
  • Octopus Deploy pipeline (octopusdeploy.yml)
  • Next.js site deployment to GitHub Pages (nextjs.yml)
  • Jekyll site deployment to GitHub Pages (jekyll-gh-pages.yml)
  • Static content deployment to GitHub Pages (static.yml)
  • Basic custom CI workflow (ci_own.yml)
  • Rust build workflow via GitHub Actions (rust.yml)
  • CircleCI workflows for Rust/Cargo and a simple hello job (.circleci/cargo.yml, .circleci/config.yml)
.github/workflows/google.yml
.github/workflows/octopusdeploy.yml
.github/workflows/nextjs.yml
.github/workflows/jekyll-gh-pages.yml
.github/workflows/static.yml
.github/workflows/ci_own.yml
.github/workflows/rust.yml
.circleci/cargo.yml
.circleci/config.yml
Introduce a project security policy
  • Add SECURITY.md with supported versions table and vulnerability reporting guidance
SECURITY.md

Possibly linked issues

  • Create cargo.yml #24: The PR adds the .circleci/cargo.yml file, implementing the Rust build-and-test job with formatting, testing, and caching, as requested in the issue.

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@gemini-code-assist
Copy link

Summary of Changes

Hello @Dargon789, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a series of enhancements across the project's infrastructure, documentation, and application code. It establishes continuous integration for Rust components, improves the project's issue management by standardizing GitHub templates, and formalizes the security vulnerability reporting process. Furthermore, it strengthens the backend's resilience against malformed requests through path validation and corrects a minor frontend navigation issue.

Highlights

  • CI/CD Setup for Rust: New CircleCI configuration has been added specifically for Rust projects, enabling automated build, test, and formatting checks with caching for improved efficiency.
  • GitHub Issue Template Enhancements: Existing bug report and feature request templates have been updated to include default titles, labels, and assignees, streamlining the issue creation process. A new generic custom issue template was also added.
  • Security Policy Document: A new SECURITY.md file has been introduced, providing clear guidelines on supported versions and the process for reporting security vulnerabilities.
  • Backend API Path Validation: Input validation has been implemented for several API routes in acceleration.routes.ts to ensure that only whitelisted paths are processed, enhancing security and preventing invalid requests.
  • Frontend Redirect Logic Fix: A bug in the handleDemoRedirect function within common.utils.ts has been resolved, correcting the URL used for redirection to ensure proper navigation.
Ignored Files
  • Ignored by pattern: .github/workflows/** (8)
    • .github/workflows/ci.yml
    • .github/workflows/ci_own.yml
    • .github/workflows/google.yml
    • .github/workflows/jekyll-gh-pages.yml
    • .github/workflows/nextjs.yml
    • .github/workflows/octopusdeploy.yml
    • .github/workflows/rust.yml
    • .github/workflows/static.yml
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

sourcery-ai[bot]
sourcery-ai bot previously approved these changes Oct 2, 2025
Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes and they look great!

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location> `backend/src/api/acceleration/acceleration.routes.ts:42-47` </location>
<code_context>

   private async $getAcceleratorAccelerationsHistoryAggregated(req: Request, res: Response): Promise<void> {
-    const url = `${config.MEMPOOL_SERVICES.API}/${req.originalUrl.replace('/api/v1/services/', '')}`;
+    const allowedPaths = {
+      'accelerations': 'accelerations',
+      'accelerations/history': 'accelerations/history',
+      'accelerations/stats': 'accelerations/stats',
+      'estimate': 'estimate',
+    };
+    const userPath = req.originalUrl.replace('/api/v1/services/', '');
+    const safePath = allowedPaths[userPath];
</code_context>

<issue_to_address>
**suggestion:** Consider extracting allowedPaths to a shared constant to avoid repetition.

Since allowedPaths is used in multiple methods, moving it to a shared constant will improve maintainability and reduce code duplication.

Suggested implementation:

```typescript
const ALLOWED_PATHS: Record<string, string> = {
  'accelerations': 'accelerations',
  'accelerations/history': 'accelerations/history',
  'accelerations/stats': 'accelerations/stats',
  'estimate': 'estimate',
};

  private async $getAcceleratorAccelerationsHistoryAggregated(req: Request, res: Response): Promise<void> {
    const userPath = req.originalUrl.replace('/api/v1/services/', '');
    const safePath = ALLOWED_PATHS[userPath];

```

If other methods in this file use the same allowed paths logic, update them to use the new `ALLOWED_PATHS` constant instead of their own local copies.
</issue_to_address>

### Comment 2
<location> `backend/src/api/acceleration/acceleration.routes.ts:48` </location>
<code_context>
+      'accelerations/stats': 'accelerations/stats',
+      'estimate': 'estimate',
+    };
+    const userPath = req.originalUrl.replace('/api/v1/services/', '');
+    const safePath = allowedPaths[userPath];
+    if (!safePath) {
</code_context>

<issue_to_address>
**issue:** Path extraction logic may be fragile if query parameters or trailing slashes are present.

req.originalUrl.replace may not reliably extract the intended path if query parameters or trailing slashes are present. Use req.path or a URL parser for more accurate path extraction.
</issue_to_address>

### Comment 3
<location> `.github/workflows/google.yml:104-106` </location>
<code_context>
+          docker push "${DOCKER_TAG}"
+
+      # Set up kustomize
+      - name: 'Set up Kustomize'
+        run: |-
+          curl -sfLo kustomize https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2Fv5.4.3/kustomize_v5.4.3_linux_amd64.tar.gz
+          chmod u+x ./kustomize
+
</code_context>

<issue_to_address>
**issue (bug_risk):** The Kustomize setup downloads a tar.gz but does not extract it, which may cause execution issues.

The downloaded tar.gz should be extracted before applying chmod to ensure the kustomize binary is executable.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces several changes, including new CircleCI configurations, updated GitHub issue templates, and a security policy. The security fix in backend/src/api/acceleration/acceleration.routes.ts to prevent path traversal is a crucial improvement. However, this fix introduces significant code duplication across three methods, which should be refactored for better maintainability. Additionally, the CircleCI setup has issues: cargo.yml contains duplicated steps, and the presence of a seemingly redundant config.yml template file is confusing. The other changes to issue templates and the security policy are good additions.

Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
@Dargon789 Dargon789 disabled auto-merge October 2, 2025 22:40
@Dargon789 Dargon789 enabled auto-merge (rebase) October 2, 2025 22:44
@Dargon789 Dargon789 closed this Oct 2, 2025
auto-merge was automatically disabled October 2, 2025 22:45

Pull request was closed

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.

1 participant