-
Notifications
You must be signed in to change notification settings - Fork 2
Simplify the permission management and add new section to add redirection #14
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
mukezhz
wants to merge
32
commits into
avashForReal:staging
Choose a base branch
from
mukezhz:main
base: staging
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
32 commits
Select commit
Hold shift + click to select a range
008b62e
feat: add basic api docs template in existing project
mukezhz 8bfbd28
feat: add comprehensive API documentation for authentication, endpoin…
mukezhz f5ed05a
feat: update sidebar and TOC for API documentation, remove unused cus…
mukezhz de06566
fix: update proxy description for clarity in the UI
mukezhz 9cb9574
refactor: remove unused imports from docs layout and page components
mukezhz 5244e72
refactor: remove unused variable assignment in delete user confirmati…
mukezhz 796a683
refactor: remove deprecated dependencies and update version specifica…
mukezhz 99ed0d6
feat: add next-contentlayer dependency to package.json and pnpm-lock.…
mukezhz 8b2fa3b
fix: update import paths for contentlayer to reflect new structure
mukezhz 33fd0ca
fix: correct dev script in package.json and add missing comma in next…
mukezhz 2bb17ce
fix: adjust padding and margin in header component for improved layout
mukezhz 8349d50
fix: update layout styles in Docs and Home components for better resp…
mukezhz 78a3694
fix: add author URLs to meta configuration for better attribution
mukezhz 34f0aa8
fix: add versions support to domain schema and related templates for …
mukezhz 00fd74f
fix: add advanced settings for HTTP protocol versions in AddProxyDial…
mukezhz 87b3bf0
fix: update Dockerfile and add docker-compose configuration for impro…
mukezhz 6aef12e
fix: ensure OpenSSL is installed in the production stage of the Docke…
mukezhz 11369d4
fix: make SERVICE_NAME optional in environment variables schema
mukezhz 47ba953
fix: update permission checks and resource actions for user and API m…
mukezhz 64e66ae
fix: update permission checks to use OR logic for user access in rout…
mukezhz 2e979fe
fix: remove debug logging from permission check in auth store
mukezhz 3805e21
fix: update permission checks to use user_management permissions acro…
mukezhz 6846412
fix: enhance permission checks to support view/manage logic across us…
mukezhz 0c5a2de
fix: update permission checks to use proxy_management permissions and…
mukezhz 1bfe7af
fix: refactor permission checks to utilize Resources for improved rea…
mukezhz 21f13eb
feat: add redirection dialog and integrate with proxies actions
mukezhz 4bb596b
fix: update ProxyRecord to make incomingAddress clickable with proper…
mukezhz b507828
fix: update ProxiesActions layout for better responsiveness and enhan…
mukezhz f766759
fix: enhance documentation with emojis for better readability and cla…
mukezhz 3bc1ca9
fix: update documentation to clarify API endpoints and improve descri…
mukezhz aee5445
Refactor API routes and services for user management
mukezhz 01be8be
chore: update feature section of readme
mukezhz 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 |
---|---|---|
|
@@ -9,4 +9,6 @@ db/ | |
.idea/ | ||
docker-compose.yml | ||
Dockerfile | ||
.next | ||
.next | ||
.contentlayer/ | ||
docker-compose.* |
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 |
---|---|---|
|
@@ -43,4 +43,5 @@ next-env.d.ts | |
db | ||
caddy_config | ||
caddy_data | ||
test | ||
test | ||
.contentlayer |
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,9 @@ | ||
DOCKER_REPO := ttl.sh | ||
DOCKER_IMAGE := caddycontrol | ||
DOCKER_TAG := 5m | ||
|
||
push: | ||
docker build --platform linux/amd64 -t $(DOCKER_REPO)/$(DOCKER_IMAGE):$(DOCKER_TAG) . | ||
docker push $(DOCKER_REPO)/$(DOCKER_IMAGE):$(DOCKER_TAG) | ||
|
||
.PHONY: push |
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,48 @@ | ||
export const meta = { | ||
metadataBase: new URL('https://caddy-control.vercel.app'), | ||
title: 'Caddy Control - Documentation', | ||
description: | ||
'Open-source solution for domain routing and proxy management! 🚀', | ||
authors: [ | ||
{ name: 'Mukesh Kumar Chaudhary', url: 'https://mukesh.name.np' }, | ||
{ name: 'Avash Ghimire', url: 'https://avashghimire.com.np' } | ||
], | ||
keywords: [ | ||
'Caddy Control', | ||
'Next.js', | ||
'Proxy', | ||
'Caddy', | ||
'Documentation', | ||
], | ||
publisher: 'Mukesh Kumar Chaudhary', | ||
creator: 'Mukesh Kumar Chaudhary', | ||
openGraph: { | ||
type: 'website', | ||
title: 'Caddy Control - Documentation', | ||
description: | ||
'Open-source solution for domain routing and proxy management! 🚀', | ||
images: [ | ||
{ | ||
url: '/logo.png', | ||
width: 1200, | ||
height: 630, | ||
alt: 'Caddy Control Documentation', | ||
}, | ||
], | ||
}, | ||
twitter: { | ||
card: 'summary_large_image', | ||
title: 'Caddy Control - Documentation', | ||
description: | ||
'Open-source solution for domain routing and proxy management! 🚀', | ||
images: ['/logo.png'], | ||
creator: '@mukezhz', | ||
}, | ||
alternates: { | ||
canonical: 'https://caddy-control.vercel.app', | ||
}, | ||
robots: 'index, follow', | ||
hreflang: { | ||
en: 'https://caddy-control.vercel.app', | ||
}, | ||
}; |
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,42 @@ | ||
import { BookOpen, Code, FileCode, Rocket } from 'lucide-react'; | ||
|
||
export const sidebarNav = [ | ||
{ | ||
title: 'Getting Started', | ||
icon: <Rocket className="h-5 w-5" />, | ||
defaultOpen: true, | ||
pages: [ | ||
{ | ||
title: 'Introduction', | ||
href: '/docs/getting-started/introduction', | ||
}, | ||
{ | ||
title: 'Installation', | ||
href: '/docs/getting-started/installation', | ||
}, | ||
{ | ||
title: 'Quick Start', | ||
href: '/docs/getting-started/quick-start', | ||
}, | ||
], | ||
}, | ||
{ | ||
title: 'API Reference', | ||
icon: <Code className="h-5 w-5" />, | ||
defaultOpen: true, | ||
pages: [ | ||
{ | ||
title: 'Overview', | ||
href: '/docs/api/overview', | ||
}, | ||
{ | ||
title: 'Authentication', | ||
href: '/docs/api/authentication', | ||
}, | ||
{ | ||
title: 'Endpoints', | ||
href: '/docs/api/endpoints', | ||
}, | ||
], | ||
}, | ||
]; |
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,150 @@ | ||
type TocPage = { | ||
title: string; | ||
href: string; | ||
}; | ||
|
||
type TocSection = { | ||
title: string; | ||
href: string; | ||
pages?: TocPage[]; | ||
}; | ||
|
||
type TocData = { | ||
[key: string]: TocSection[]; | ||
}; | ||
|
||
// TOC Data for Caddy Control documentation | ||
export const TocData: TocData = { | ||
'getting-started/introduction': [ | ||
{ | ||
title: 'Welcome to Caddy Control', | ||
href: '/docs/getting-started/introduction#welcome-to-caddy-control', | ||
pages: [ | ||
{ | ||
title: 'Why Choose Caddy Control', | ||
href: '/docs/getting-started/introduction#why-choose-caddy-control', | ||
}, | ||
{ | ||
title: 'Features', | ||
href: '/docs/getting-started/introduction#features', | ||
}, | ||
{ | ||
title: 'Technologies', | ||
href: '/docs/getting-started/introduction#technologies-behind-caddy-control', | ||
}, | ||
], | ||
}, | ||
], | ||
'getting-started/installation': [ | ||
{ | ||
title: 'Installation Guide', | ||
href: '/docs/getting-started/installation#installation-guide', | ||
pages: [ | ||
{ | ||
title: 'Local Development Setup', | ||
href: '/docs/getting-started/installation#local-development-setup', | ||
}, | ||
{ | ||
title: 'Production Deployment with Docker', | ||
href: '/docs/getting-started/installation#production-deployment-with-docker', | ||
}, | ||
{ | ||
title: 'Verifying Your Installation', | ||
href: '/docs/getting-started/installation#verifying-your-installation', | ||
}, | ||
], | ||
}, | ||
], | ||
'getting-started/quick-start': [ | ||
{ | ||
title: 'Quick Start Guide', | ||
href: '/docs/getting-started/quick-start#quick-start-guide', | ||
pages: [ | ||
{ | ||
title: 'Managing Domains', | ||
href: '/docs/getting-started/quick-start#managing-domains', | ||
}, | ||
{ | ||
title: 'Next Steps', | ||
href: '/docs/getting-started/quick-start#next-steps', | ||
}, | ||
], | ||
}, | ||
], | ||
'api/overview': [ | ||
{ | ||
title: 'API Overview', | ||
href: '/docs/api/overview#api-overview', | ||
pages: [ | ||
{ | ||
title: 'Base URL', | ||
href: '/docs/api/overview#base-url', | ||
}, | ||
{ | ||
title: 'Authentication', | ||
href: '/docs/api/overview#authentication', | ||
}, | ||
{ | ||
title: 'Response Format', | ||
href: '/docs/api/overview#response-format', | ||
}, | ||
{ | ||
title: 'Rate Limiting', | ||
href: '/docs/api/overview#rate-limiting', | ||
}, | ||
{ | ||
title: 'Best Practices', | ||
href: '/docs/api/overview#best-practices', | ||
}, | ||
], | ||
}, | ||
], | ||
'api/authentication': [ | ||
{ | ||
title: 'API Authentication', | ||
href: '/docs/api/authentication#api-authentication', | ||
pages: [ | ||
{ | ||
title: 'API Key Authentication', | ||
href: '/docs/api/authentication#api-key-authentication', | ||
}, | ||
{ | ||
title: 'Managing API Keys', | ||
href: '/docs/api/authentication#managing-api-keys', | ||
}, | ||
{ | ||
title: 'Best Practices', | ||
href: '/docs/api/authentication#best-practices-for-api-key-management', | ||
}, | ||
], | ||
}, | ||
], | ||
'api/endpoints': [ | ||
{ | ||
title: 'API Endpoints', | ||
href: '/docs/api/endpoints#api-endpoints', | ||
pages: [ | ||
{ | ||
title: 'Domain Management', | ||
href: '/docs/api/endpoints#domain-management', | ||
}, | ||
{ | ||
title: 'Caddy Configuration', | ||
href: '/docs/api/endpoints#caddy-configuration', | ||
}, | ||
{ | ||
title: 'API Key Management', | ||
href: '/docs/api/endpoints#api-key-management', | ||
}, | ||
{ | ||
title: 'Error Codes', | ||
href: '/docs/api/endpoints#error-codes', | ||
}, | ||
{ | ||
title: 'Pagination', | ||
href: '/docs/api/endpoints#pagination', | ||
}, | ||
], | ||
}, | ||
], | ||
}; |
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 @@ | ||
# This doc will show button component |
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 @@ | ||
# Welcome to installation |
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,38 @@ | ||
// contentlayer.config.ts | ||
import { defineDocumentType, makeSource } from "contentlayer2/source-files"; | ||
import remarkGfm from "remark-gfm"; | ||
import { codeImport } from "remark-code-import"; | ||
import rehypeSlug from "rehype-slug"; | ||
import highlight from "rehype-highlight"; | ||
|
||
export const Post = defineDocumentType(() => ({ | ||
name: "Docs", | ||
contentType: "mdx", | ||
filePathPattern: `**/*.mdx`, | ||
markdown: { fileExtensions: ["mdx", "md"] }, // Ensure it watches these files | ||
fields: { | ||
title: { type: "string", required: true }, | ||
description: { type: "string", required: false }, | ||
date: { type: "date", required: false }, | ||
}, | ||
computedFields: { | ||
url: { | ||
type: "string", | ||
resolve: (post) => `/docs/${post._raw.flattenedPath}`, | ||
}, | ||
slug: { | ||
type: "string", | ||
resolve: (doc) => doc._raw.flattenedPath, | ||
}, | ||
}, | ||
})); | ||
|
||
export default makeSource({ | ||
contentDirPath: "docs", | ||
documentTypes: [Post], | ||
mdx: { | ||
remarkPlugins: [remarkGfm, codeImport], | ||
rehypePlugins: [rehypeSlug, highlight], | ||
}, | ||
disableImportAliasWarning: true, | ||
}); |
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,15 @@ | ||||||||||||||||
services: | ||||||||||||||||
caddycontrol: | ||||||||||||||||
image: itbeeazy/caddy-control:1.0.0 | ||||||||||||||||
container_name: caddycontrol | ||||||||||||||||
restart: unless-stopped | ||||||||||||||||
volumes: | ||||||||||||||||
- ./db:/app/db | ||||||||||||||||
environment: | ||||||||||||||||
- NODE_ENV=production | ||||||||||||||||
- APP_HOST=demo.example.com | ||||||||||||||||
- CADDY_SERVER_IP=127.0.0.1 | ||||||||||||||||
- CADDY_ADMIN_URL=http://localhost:2019 | ||||||||||||||||
- JWT_SECRET=alksdlaksdjasd | ||||||||||||||||
network_mode: host | ||||||||||||||||
|
||||||||||||||||
Comment on lines
+14
to
+15
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. Using 'network_mode: host' may expose the host network if not strictly required. Review whether this setting is necessary for production or if a bridge network could offer better isolation.
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
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.
Hardcoding JWT_SECRET in the configuration poses a security risk. Consider using a secure secrets management solution or injecting this variable during deployment.
Copilot uses AI. Check for mistakes.