diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index dc39b65f..91390e43 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -23,7 +23,7 @@ jobs: permissions: contents: read packages: write - + steps: - name: Checkout repository uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4 diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 12958f12..4723453b 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -25,7 +25,7 @@ jobs: build: name: Build Documentation runs-on: ubuntu-latest - + steps: # Step 1: Get the code - name: 📥 Checkout code @@ -42,11 +42,11 @@ jobs: run: | # Create output directory mkdir -p _site - + # Copy all markdown files cp README.md _site/ cp -r docs _site/ - + # Create a simple HTML index that looks nice cat > _site/index.html << 'EOF' @@ -154,12 +154,12 @@ jobs:

🚀 Caddy Proxy Manager Plus

Make your websites easy to reach - No coding required!

- +

👋 Welcome!

- This documentation will help you get started with Caddy Proxy Manager Plus. + This documentation will help you get started with Caddy Proxy Manager Plus. Whether you're a complete beginner or an experienced developer, we've got you covered!

@@ -220,15 +220,15 @@ jobs: Stuck? Have questions? We're here to help!

- 💬 Ask a Question - 🐛 Report a Bug - ⭐ View on GitHub @@ -243,10 +243,10 @@ jobs: EOF - + # Convert markdown files to HTML using a simple converter npm install -g marked - + # Convert each markdown file for file in _site/docs/*.md; do if [ -f "$file" ]; then @@ -254,14 +254,14 @@ jobs: marked "$file" -o "_site/docs/${filename}.html" --gfm fi done - + # Convert README and CONTRIBUTING marked _site/README.md -o _site/README.html --gfm if [ -f "CONTRIBUTING.md" ]; then cp CONTRIBUTING.md _site/ marked _site/CONTRIBUTING.md -o _site/CONTRIBUTING.html --gfm fi - + # Add simple styling to all HTML files for html_file in _site/*.html _site/docs/*.html; do if [ -f "$html_file" ] && [ "$html_file" != "_site/index.html" ]; then @@ -296,10 +296,10 @@ jobs:
HEADER - + # Append original content cat "$html_file" >> "$temp_file" - + # Add footer cat >> "$temp_file" << 'FOOTER'
@@ -309,11 +309,11 @@ jobs: FOOTER - + mv "$temp_file" "$html_file" fi done - + echo "✅ Documentation site built successfully!" # Step 4: Upload the built site @@ -329,7 +329,7 @@ jobs: url: ${{ steps.deployment.outputs.page_url }} runs-on: ubuntu-latest needs: build - + steps: # Deploy to GitHub Pages - name: 🚀 Deploy to GitHub Pages diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b7c269c0..0ba65c12 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,7 +23,7 @@ jobs: run: | # Get previous tag PREV_TAG=$(git describe --tags --abbrev=0 $(git rev-list --tags --skip=1 --max-count=1) 2>/dev/null || echo "") - + if [ -z "$PREV_TAG" ]; then echo "First release - generating full changelog" CHANGELOG=$(git log --pretty=format:"- %s (%h)" --no-merges) @@ -31,7 +31,7 @@ jobs: echo "Generating changelog since $PREV_TAG" CHANGELOG=$(git log $PREV_TAG..HEAD --pretty=format:"- %s (%h)" --no-merges) fi - + # Save to file for GitHub release echo "$CHANGELOG" > CHANGELOG.txt echo "Generated changelog with $(echo "$CHANGELOG" | wc -l) commits" diff --git a/GHCR_MIGRATION_SUMMARY.md b/GHCR_MIGRATION_SUMMARY.md index 1fd10508..163b2da1 100644 --- a/GHCR_MIGRATION_SUMMARY.md +++ b/GHCR_MIGRATION_SUMMARY.md @@ -13,11 +13,11 @@ Updated all workflows and documentation to use GitHub Container Registry (GHCR) - **After**: GitHub Container Registry (`ghcr.io/wikid82/caddyproxymanagerplus`) ### Benefits of GHCR: -✅ **No extra accounts needed** - Uses your GitHub account -✅ **Automatic authentication** - Uses built-in `GITHUB_TOKEN` -✅ **Free for public repos** - No Docker Hub rate limits -✅ **Integrated with repo** - Packages show up on your GitHub profile -✅ **Better security** - No need to store Docker Hub credentials +✅ **No extra accounts needed** - Uses your GitHub account +✅ **Automatic authentication** - Uses built-in `GITHUB_TOKEN` +✅ **Free for public repos** - No Docker Hub rate limits +✅ **Integrated with repo** - Packages show up on your GitHub profile +✅ **Better security** - No need to store Docker Hub credentials ### Files Updated: @@ -35,7 +35,7 @@ env: REGISTRY: docker.io IMAGE_NAME: wikid82/caddy-proxy-manager-plus -# After +# After env: REGISTRY: ghcr.io IMAGE_NAME: ${{ github.repository }} diff --git a/PHASE_7_SUMMARY.md b/PHASE_7_SUMMARY.md index bc5ac61f..c1d9cfeb 100644 --- a/PHASE_7_SUMMARY.md +++ b/PHASE_7_SUMMARY.md @@ -277,6 +277,6 @@ The application is now **production-ready** with: --- -**Phase 7 Status**: ✅ **COMPLETE** -**Implementation Date**: January 18, 2025 +**Phase 7 Status**: ✅ **COMPLETE** +**Implementation Date**: January 18, 2025 **Total Implementation Time**: 7 phases completed diff --git a/docs/github-setup.md b/docs/github-setup.md index 9c233ac7..5f965edc 100644 --- a/docs/github-setup.md +++ b/docs/github-setup.md @@ -60,7 +60,7 @@ https://wikid82.github.io/CaddyProxyManagerPlus/ **Triggers when:** - ✅ You push to `main` branch → Creates `latest` tag -- ✅ You push to `development` branch → Creates `dev` tag +- ✅ You push to `development` branch → Creates `dev` tag - ✅ You create a version tag like `v1.0.0` → Creates version tags - ✅ You manually trigger it from GitHub UI @@ -237,7 +237,7 @@ Before pushing to production, make sure: - [ ] GitHub Pages is enabled with "GitHub Actions" source - [ ] You've tested the Docker build workflow (automatic on push) -- [ ] You've tested the docs deployment workflow +- [ ] You've tested the docs deployment workflow - [ ] Container package is set to "Public" visibility (optional, for easier pulls) - [ ] Documentation looks good on the published site - [ ] Docker image runs correctly diff --git a/frontend/.vite/deps_temp_c8b409d7/package.json b/frontend/.vite/deps_temp_c8b409d7/package.json new file mode 100644 index 00000000..3dbc1ca5 --- /dev/null +++ b/frontend/.vite/deps_temp_c8b409d7/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} diff --git a/frontend/package.json b/frontend/package.json index 07665a4f..beccc055 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -13,6 +13,9 @@ "test:coverage": "vitest --coverage" }, "dependencies": { + "@tanstack/react-query": "^5.62.8", + "axios": "^1.7.9", + "clsx": "^2.1.1", "react": "^18.3.1", "react-dom": "^18.3.1", "react-router-dom": "^6.30.2" diff --git a/frontend/src/hooks/__tests__/useImport.test.ts b/frontend/src/hooks/__tests__/useImport.test.ts index 634e6c1c..a81cbb3c 100644 --- a/frontend/src/hooks/__tests__/useImport.test.ts +++ b/frontend/src/hooks/__tests__/useImport.test.ts @@ -103,7 +103,7 @@ describe('useImport', () => { await result.current.commit({ 'test.com': 'skip' }) expect(api.importAPI.commit).toHaveBeenCalledWith('session-2', { 'test.com': 'skip' }) - + await waitFor(() => { expect(result.current.session).toBeNull() }) @@ -149,7 +149,7 @@ describe('useImport', () => { vi.mocked(api.importAPI.upload).mockResolvedValue({ session: mockSession }) vi.mocked(api.importAPI.status).mockResolvedValue({ has_pending: true, session: mockSession }) vi.mocked(api.importAPI.preview).mockResolvedValue({ hosts: [], conflicts: [], errors: [] }) - + const mockError = new Error('Commit failed') vi.mocked(api.importAPI.commit).mockRejectedValue(mockError) diff --git a/frontend/src/hooks/__tests__/useProxyHosts.test.ts b/frontend/src/hooks/__tests__/useProxyHosts.test.ts index 081fc16c..6be5b47f 100644 --- a/frontend/src/hooks/__tests__/useProxyHosts.test.ts +++ b/frontend/src/hooks/__tests__/useProxyHosts.test.ts @@ -63,7 +63,7 @@ describe('useProxyHosts', () => { vi.mocked(api.proxyHostsAPI.list).mockResolvedValue([]) const newHost = { domain_names: 'new.com', forward_host: 'localhost', forward_port: 9000 } const createdHost = { uuid: '3', ...newHost, enabled: true } - + vi.mocked(api.proxyHostsAPI.create).mockResolvedValue(createdHost) const { result } = renderHook(() => useProxyHosts()) @@ -81,7 +81,7 @@ describe('useProxyHosts', () => { it('updates an existing proxy host', async () => { const existingHost = { uuid: '1', domain_names: 'test.com', enabled: true, forward_host: 'localhost', forward_port: 8080 } vi.mocked(api.proxyHostsAPI.list).mockResolvedValue([existingHost]) - + const updatedHost = { ...existingHost, domain_names: 'updated.com' } vi.mocked(api.proxyHostsAPI.update).mockResolvedValue(updatedHost) diff --git a/frontend/src/hooks/__tests__/useRemoteServers.test.ts b/frontend/src/hooks/__tests__/useRemoteServers.test.ts index 69d155ef..1b122a05 100644 --- a/frontend/src/hooks/__tests__/useRemoteServers.test.ts +++ b/frontend/src/hooks/__tests__/useRemoteServers.test.ts @@ -87,7 +87,7 @@ describe('useRemoteServers', () => { vi.mocked(api.remoteServersAPI.list).mockResolvedValue([]) const newServer = { name: 'New Server', host: 'new.local', port: 5000, enabled: true, provider: 'generic' } const createdServer = { uuid: '4', ...newServer } - + vi.mocked(api.remoteServersAPI.create).mockResolvedValue(createdServer) const { result } = renderHook(() => useRemoteServers()) @@ -105,7 +105,7 @@ describe('useRemoteServers', () => { it('updates an existing remote server', async () => { const existingServer = { uuid: '1', name: 'Server 1', host: 'localhost', port: 8080, enabled: true } vi.mocked(api.remoteServersAPI.list).mockResolvedValue([existingServer]) - + const updatedServer = { ...existingServer, name: 'Updated Server' } vi.mocked(api.remoteServersAPI.update).mockResolvedValue(updatedServer) diff --git a/frontend/src/hooks/useImport.ts b/frontend/src/hooks/useImport.ts index 099bfd94..f01bb060 100644 --- a/frontend/src/hooks/useImport.ts +++ b/frontend/src/hooks/useImport.ts @@ -69,7 +69,7 @@ export function useImport() { const commit = async (resolutions: Record) => { if (!session) throw new Error('No active session') - + try { setLoading(true) setError(null) @@ -87,7 +87,7 @@ export function useImport() { const cancel = async () => { if (!session) return - + try { setLoading(true) setError(null) diff --git a/frontend/src/pages/Dashboard.tsx b/frontend/src/pages/Dashboard.tsx index 1d20dea5..83dd3f9f 100644 --- a/frontend/src/pages/Dashboard.tsx +++ b/frontend/src/pages/Dashboard.tsx @@ -27,26 +27,26 @@ export default function Dashboard() { return (

Dashboard

- +
Proxy Hosts
{hosts.length}
{enabledHosts} enabled
- +
Remote Servers
{servers.length}
{enabledServers} enabled
- +
SSL Certificates
0
Coming soon
- +
System Status
@@ -69,7 +69,7 @@ export default function Dashboard() {
Create a new reverse proxy
- + Register a backend server
- +
- +
{/* File Upload */}
diff --git a/frontend/src/services/api.ts b/frontend/src/services/api.ts index 83a0b752..3304be02 100644 --- a/frontend/src/services/api.ts +++ b/frontend/src/services/api.ts @@ -21,7 +21,7 @@ async function request(endpoint: string, options: RequestOptions = {}): Promi } const response = await fetch(url, config) - + if (!response.ok) { const error = await response.json().catch(() => ({ error: response.statusText })) throw new Error(error.error || `HTTP ${response.status}`)