Skip to content
Closed
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
43 changes: 43 additions & 0 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Simple workflow for deploying static content to GitHub Pages
name: Deploy static content to Pages

on:
# Runs on pushes targeting the default branch
push:
branches: ["master"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload entire repository
path: '.'
Comment on lines +38 to +40
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: uploading entire repository exposes all source code, environment files, and potential secrets publicly on GitHub Pages

Suggested change
with:
# Upload entire repository
path: '.'
with:
# Upload only documentation directory
path: 'docs'
Prompt To Fix With AI
This is a comment left during a code review.
Path: .github/workflows/static.yml
Line: 38:40

Comment:
**logic:** uploading entire repository exposes all source code, environment files, and potential secrets publicly on GitHub Pages

```suggestion
        with:
          # Upload only documentation directory
          path: 'docs'
```

How can I resolve this? If you propose a fix, please make it concise.

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ RUN npm ci --production
# Create plugins directory
RUN mkdir -p plugins

# Install wget for healthcheck
RUN apk add --no-cache wget

# Expose API port
EXPOSE 3000

Expand Down
52 changes: 31 additions & 21 deletions bin/holo.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
*/

import { spawn } from 'child_process';
import { randomBytes } from 'crypto';
import { readFile, writeFile, access, mkdir } from 'fs/promises';
import { constants } from 'fs';
import { resolve, dirname } from 'path';
Expand Down Expand Up @@ -211,9 +212,11 @@ RATE_LIMIT_MAX=100

function generateApiKey() {
const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
const charsLength = chars.length;
const bytes = randomBytes(32); // 32 bytes of cryptographically secure entropy
let key = 'holo_';
for (let i = 0; i < 32; i++) {
key += chars.charAt(Math.floor(Math.random() * chars.length));
key += chars.charAt(bytes[i] % charsLength);
}
return key;
}
Expand Down Expand Up @@ -246,24 +249,31 @@ Examples:
const args = process.argv.slice(2);
const command = args[0];

switch (command) {
case 'start':
commandStart(args.slice(1));
break;
case 'doctor':
commandDoctor();
break;
case 'init':
commandInit();
break;
case 'help':
case '--help':
case '-h':
case undefined:
showHelp();
break;
default:
log(`Unknown command: ${command}`, 'red');
showHelp();
(async () => {
try {
switch (command) {
case 'start':
await commandStart(args.slice(1));
break;
case 'doctor':
await commandDoctor();
break;
case 'init':
await commandInit();
break;
case 'help':
case '--help':
case '-h':
case undefined:
showHelp();
break;
default:
log(`Unknown command: ${command}`, 'red');
showHelp();
process.exit(1);
}
} catch (err) {
log(`Error: ${err.message}`, 'red');
process.exit(1);
}
}
})();
Loading
Loading