-
Notifications
You must be signed in to change notification settings - Fork 142
Migrate to Vite + other updates #345
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
Merged
Merged
Changes from 8 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
f2be36a
Functional
quietbits 547bc08
Updated workflows
quietbits 7529802
Fix
quietbits 2d88b93
Fix PR preview
quietbits 7b01c16
Fix path
quietbits 1c1bec6
Tweak charts
quietbits 86431d5
Cleanup
quietbits f7dcf1d
Update routes
quietbits 5ede8a6
More cleanup
quietbits d43dcfc
Fix
quietbits a0f2204
Fixes
quietbits File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,24 @@ | ||
| module.exports = { | ||
| extends: ["@stellar/eslint-config"], | ||
| env: { | ||
| browser: true, | ||
| es2021: true, | ||
| node: true, | ||
| }, | ||
| extends: ["eslint:recommended", "prettier"], | ||
| parser: "@typescript-eslint/parser", | ||
| parserOptions: { | ||
| ecmaVersion: 12, | ||
| sourceType: "module", | ||
| }, | ||
| plugins: ["@typescript-eslint"], | ||
| rules: { | ||
| "no-console": "off", | ||
| "import/no-unresolved": "off", | ||
| "no-await-in-loop": "off", | ||
| "no-constant-condition": "off", | ||
| "@typescript-eslint/naming-convention": ["warn"], | ||
| "@typescript-eslint/no-unused-vars": ["warn", { argsIgnorePattern: "^_" }], | ||
| "no-unused-vars": ["error", { argsIgnorePattern: "^_" }], | ||
| "prefer-const": "warn", | ||
| "no-var": "warn", | ||
| eqeqeq: "warn", | ||
| }, | ||
| ignorePatterns: ["node_modules/", "dist/", "*.min.js"], | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,29 +1,55 @@ | ||
| name: Test and build | ||
| name: Test and Build | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - master | ||
| - master | ||
| - main | ||
| pull_request: | ||
|
|
||
| jobs: | ||
| build: | ||
| test-and-build: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| services: | ||
| redis: | ||
| image: redis | ||
| image: redis:7-alpine | ||
| # Set health checks to wait until redis has started | ||
| options: >- | ||
| --health-cmd "redis-cli ping" | ||
| --health-interval 10s | ||
| --health-timeout 5s | ||
| --health-retries 5 | ||
| --health-cmd "redis-cli ping" --health-interval 10s --health-timeout | ||
| 5s --health-retries 5 | ||
| ports: | ||
| - 6379:6379 | ||
| - 6379:6379 | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v2 | ||
| - uses: actions/setup-node@v2 | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: "22" | ||
| cache: "npm" | ||
|
|
||
| - name: Install dependencies | ||
| run: npm install --legacy-peer-deps | ||
| # Note: Using --legacy-peer-deps due to muicss package compatibility with React 18 | ||
|
|
||
| - name: Run linter | ||
| run: npx eslint backend/ --ext .ts | ||
|
|
||
| - name: Run tests | ||
| run: npm test | ||
| env: | ||
| DEV: true | ||
|
|
||
| - name: Build application | ||
| run: npm run build | ||
|
|
||
| - name: Upload build artifacts | ||
| uses: actions/upload-artifact@v4 | ||
| if: success() | ||
| with: | ||
| node-version: 16 | ||
| - run: yarn install | ||
| - run: yarn test | ||
| - run: yarn build | ||
| name: build-files | ||
| path: dist/ | ||
| retention-days: 7 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,10 @@ | ||
| /node_modules | ||
| /.tmp | ||
| /dist | ||
| *.eslintcache | ||
| *service-account.json | ||
| *.env | ||
| /.vscode | ||
| /.idea | ||
| /.kiro | ||
| /.cursor | ||
| dump.rdb |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| .tmp | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| web: node app.js | ||
| web: npx tsx backend/app.ts |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Check warning
Code scanning / CodeQL
Exposure of private files Medium
Copilot Autofix
AI 4 months ago
In general, the problem is that
express.staticis configured with"."(the process working directory) in some environments, which can unintentionally expose files outside the intended build output. To fix this, we should never serve"."or any directory derived fromprocess.cwd(); instead, we should always use a known, explicit path to the built static assets, and ensure that this path cannot “expand” to include private files.The best minimal fix without changing existing behavior is:
staticDir = "."in Docker.staticDirfrom__dirnameto the knowndistdirectory (which the rest of the code already expects viaindex.htmlindist).STATIC_DIR) if needed, but still resolve it from__dirname(notprocess.cwd()).express.static(dotfiles deny, limited extensions, security headers).Concretely, in
backend/routes.ts:staticDirto the intended distribution folder, e.g.path.join(__dirname, "..", "..", "dist"). If you want a Docker-specific path, it should still be explicit (e.g."/usr/share/app/dist"), but not".".index.html, headers) unchanged.No new imports are required;
pathis already imported, andfsis required locally in the existing code.