-
Notifications
You must be signed in to change notification settings - Fork 79
Remote Hosting, Dockerfile build, message endpoint and dashboard auth #4
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
Open
voarsh2
wants to merge
21
commits into
snipeship:main
Choose a base branch
from
voarsh2:remote-run
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
6fa1fe8
docs(README): real quick start
snipeship 245c509
chore(repo): rename claudeflare to ccflare and update package setup
snipeship 0953994
refactor(core): rename claudeflare to ccflare project-wide
snipeship b1a5d4b
Merge branch 'chore/rename'
snipeship f8968e2
docs(package.json): update project description
snipeship b663bc6
Merge branch 'chore/rename'
snipeship de65bd8
Dockerfile for building
voarsh 423208e
Docker build fixes
voarsh 12e49dc
Dockerfile: update DB path
voarsh cbe4cf6
Remote deploy: basic key auth
voarsh 17e1462
feat: implement SQLite retry mechanism and distributed filesystem opt…
voarsh e79080e
feat: protect dashboard with API key authentication… incl resources
voarsh c45c5fb
perf: optimize requests page performance and eliminate N+1 queries
voarsh 0c77eb6
perf: fix requests page performance by eliminating JSON parsing bottl…
voarsh 582d190
SQllite Repair scripts
voarsh b2ec9a8
fix: implement lazy loading and database resilience improvements
voarsh ba3b32e
Merge branch 'main' into remote-run
voarsh 29d08dc
stale merge cleanup
voarsh ca93c7b
merge misses
voarsh 505389d
Improves database configuration and resilience
voarsh f1a0a68
Merge origin/main into remote-run
voarsh 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
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 |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| apps/ | ||
| packages/ | ||
| docs/ | ||
| node_modules/ | ||
| bun.lock | ||
| .git/ | ||
| .gitignore | ||
| CLAUDE.md | ||
| tsconfig.json | ||
| biome.json | ||
| *.ts | ||
| *.tsx |
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 |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| # Multi-stage build for ccflare | ||
| FROM oven/bun:1-alpine AS builder | ||
|
|
||
| WORKDIR /app | ||
|
|
||
| # Copy package files for dependency caching | ||
| COPY package.json bun.lock* ./ | ||
|
|
||
| # Copy all source code (required for workspace dependencies) | ||
| COPY . . | ||
|
|
||
| # Install dependencies | ||
| RUN bun install --frozen-lockfile | ||
|
|
||
| # Build the project | ||
| RUN bun run build | ||
|
|
||
| # Production stage | ||
| FROM oven/bun:1-alpine AS runner | ||
|
|
||
| WORKDIR /app | ||
|
|
||
| # Install SQLite tools for database repair and debugging | ||
| RUN apk add --no-cache sqlite | ||
|
|
||
| # Create non-root user | ||
| RUN addgroup -g 1001 -S ccflare && \ | ||
| adduser -S ccflare -u 1001 -G ccflare | ||
|
|
||
| # Copy built application | ||
| COPY --from=builder --chown=ccflare:ccflare /app . | ||
|
|
||
| # Copy repair scripts | ||
| COPY --chown=ccflare:ccflare scripts/ /app/scripts/ | ||
| RUN find /app/scripts -name '*.sh' -type f -exec chmod +x {} + 2>/dev/null || true | ||
|
|
||
| # Create data directory for SQLite database | ||
| RUN mkdir -p /app/data && chown ccflare:ccflare /app/data | ||
|
|
||
| # Switch to non-root user | ||
| USER ccflare | ||
|
|
||
| # Set API key for authentication (change this in production!) | ||
| ENV API_KEY=ccflare-default-key | ||
|
|
||
| # Set database path to persistent volume mount | ||
| ENV ccflare_DB_PATH=/app/data/ccflare.db | ||
|
|
||
| # Expose port | ||
| EXPOSE 8080 | ||
|
|
||
| # Start the server (not TUI) | ||
| CMD ["bun", "run", "server"] |
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 |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| apiVersion: v1 | ||
| kind: PersistentVolumeClaim | ||
| metadata: | ||
| name: ccflare-data | ||
| namespace: coder | ||
| spec: | ||
| accessModes: | ||
| - ReadWriteMany | ||
| resources: | ||
| requests: | ||
| storage: 10Gi | ||
| storageClassName: ceph-filesystem | ||
| --- | ||
| apiVersion: apps/v1 | ||
| kind: Deployment | ||
| metadata: | ||
| name: ccflare | ||
| namespace: coder | ||
| labels: | ||
| app: ccflare | ||
| spec: | ||
| replicas: 1 | ||
| selector: | ||
| matchLabels: | ||
| app: ccflare | ||
| template: | ||
| metadata: | ||
| labels: | ||
| app: ccflare | ||
| spec: | ||
| securityContext: | ||
| runAsUser: 1001 | ||
| runAsGroup: 1001 | ||
| fsGroup: 1001 | ||
| containers: | ||
| - name: ccflare | ||
| image: 192.168.96.61:30009/library/ccflare-fork:latest | ||
| ports: | ||
| - containerPort: 8080 | ||
| volumeMounts: | ||
| - name: ccflare-data | ||
| mountPath: /app/data | ||
| volumes: | ||
| - name: ccflare-data | ||
| persistentVolumeClaim: | ||
| claimName: ccflare-data | ||
| --- | ||
| apiVersion: v1 | ||
| kind: Service | ||
| metadata: | ||
| name: ccflare-service | ||
| namespace: coder | ||
| spec: | ||
| selector: | ||
| app: ccflare | ||
| ports: | ||
| - port: 8080 | ||
| targetPort: 8080 | ||
| type: ClusterIP |
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 |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| // ccflare - Claude load balancer proxy | ||
| // Placeholder package - implementation coming soon | ||
| module.exports = {}; |
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.
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.
Dockerfile not working, it is showing a
Not Foundpage when accessinglocalhost:8080.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.
Also, do not hardcode the API key in the Dockerfile, it is a very bad security practice.
Uh oh!
There was an error while loading. Please reload this page.
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.
Thanks, Mr. Not Reviewer. It's a draft, and it's taken a long time to get any of my PR's merged or worked on...
It does work.
You didn't specify the path correctly. The default needs:
/ccflare-default-key/in your browser. But if you knew how to code properly you'd see that trailing issueThere 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.
Hey, don't feel attacked when receiving feedback, we're all trying to make ccflare better.
As a matter of fact, security by obscurity is not the best of the ideas, which in this PR, seems to be your suggestion. There is no real security barrier when someone finally discovers the path. There should be a real authentication, access control, or something similar.
Finally, you are changing the path of how someone would access their already working ccflare instance, which is considered a breaking change.
You are suggesting changes on a publicly accessible platform, expect comments from other "Not Reviewers".
Thanks!
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.
I will spend some time when I have a minute to go over this (and do some clean up; docs; etc.) & get it merged.