From ded1c1f0cada7329922b88181b34d4302c650367 Mon Sep 17 00:00:00 2001 From: andreamada <45041528+andreamada@users.noreply.github.com> Date: Wed, 29 Apr 2026 10:47:24 +0200 Subject: [PATCH] Import existing serverkits files into ServerKit fork --- .gitattributes | 15 +- .github/FUNDING.yml | 4 +- .github/workflows/agent-release.yml | 133 +- .gitignore | 1 + CONTRIBUTORS.md | 2 +- LICENSE | 21 + README.md | 371 +---- VERSION | 2 +- agent/Dockerfile | 2 +- agent/cmd/agent/main.go | 3 +- agent/docker-compose.yml | 2 +- agent/go.mod | 5 +- agent/go.sum | 5 +- agent/internal/agent/agent.go | 96 +- agent/internal/agent/registration.go | 3 +- agent/internal/auth/auth.go | 6 +- agent/internal/config/config.go | 40 +- agent/internal/docker/client.go | 5 - agent/internal/updater/updater.go | 2 +- agent/internal/ws/client.go | 103 +- agent/scripts/install.sh | 6 +- backend/app/__init__.py | 142 +- backend/app/agent_gateway.py | 9 +- backend/app/api/apps.py | 82 +- backend/app/api/servers.py | 350 ++--- backend/app/api/system.py | 6 + backend/app/api/templates.py | 15 +- backend/app/api/workspaces.py | 10 + backend/app/middleware/api_analytics.py | 5 +- backend/app/middleware/api_key_auth.py | 3 + backend/app/middleware/security.py | 7 +- backend/app/models/__init__.py | 9 +- backend/app/models/application.py | 4 - backend/app/models/audit_log.py | 10 +- backend/app/models/server.py | 141 +- backend/app/paths.py | 28 + backend/app/services/agent_registry.py | 13 +- backend/app/services/remote_docker_service.py | 170 ++- backend/app/services/system_service.py | 31 +- backend/app/services/template_service.py | 241 --- backend/app/services/workspace_service.py | 7 + backend/app/sockets.py | 15 +- backend/cli.py | 123 +- backend/config.py | 31 +- backend/migrations/versions/001_baseline.py | 2 +- backend/requirements.txt | 12 +- backend/run.py | 6 +- check_users.py | 24 + clear_db.py | 19 + deploy/serverkit.service | 2 +- dev.ps1 | 127 +- dev.sh | 94 -- docker-compose.dev.yml | 81 + docker-compose.yml | 59 +- docs/DEPLOYMENT.md | 8 +- docs/LOCAL_DEVELOPMENT.md | 87 -- ensure_dev_state.py | 32 + frontend/Dockerfile | 32 +- frontend/package-lock.json | 5 +- frontend/package.json | 3 - frontend/src/App.jsx | 7 - frontend/src/components/CommandPalette.jsx | 1 - frontend/src/components/EmptyState.jsx | 18 +- .../src/components/EnvironmentVariables.jsx | 3 +- frontend/src/components/PrivateURLSection.jsx | 3 +- frontend/src/components/Sidebar.jsx | 19 +- .../src/components/service-detail/LogsTab.jsx | 3 +- .../src/components/settings/ApiKeyModal.jsx | 3 +- .../components/settings/IconReferenceTab.jsx | 3 +- .../components/settings/InvitationsTab.jsx | 3 +- .../src/components/settings/InviteModal.jsx | 3 +- .../settings/SecuritySettingsTab.jsx | 3 +- frontend/src/components/sidebarItems.js | 3 +- .../components/wordpress/BasicAuthModal.jsx | 3 +- .../workflow/panels/TriggerConfigPanel.jsx | 3 +- frontend/src/layouts/DashboardLayout.jsx | 3 - frontend/src/pages/Applications.jsx | 12 +- frontend/src/pages/Docker.jsx | 70 +- frontend/src/pages/Downloads.jsx | 13 +- frontend/src/pages/Git.jsx | 11 +- frontend/src/pages/Marketplace.jsx | 102 +- frontend/src/pages/ServerDetail.jsx | 126 +- frontend/src/pages/Servers.jsx | 1066 ++++--------- frontend/src/pages/Templates.jsx | 113 +- frontend/src/services/api/apps.js | 9 +- frontend/src/services/api/client.js | 3 +- frontend/src/services/api/index.js | 6 - frontend/src/services/api/servers.js | 14 +- frontend/src/services/socket.js | 2 +- frontend/src/styles/components/_build.scss | 30 + frontend/src/styles/components/_cards.scss | 26 +- frontend/src/styles/components/_deploy.scss | 6 +- .../src/styles/components/_empty-state.scss | 30 - frontend/src/styles/main.scss | 3 - frontend/src/styles/pages/_ftp-server.scss | 46 +- frontend/src/styles/pages/_marketplace.scss | 39 - frontend/src/styles/pages/_security.scss | 3 +- frontend/src/styles/pages/_servers.scss | 1342 +---------------- frontend/src/styles/pages/_settings.scss | 33 +- frontend/src/styles/pages/_templates.scss | 29 - frontend/src/styles/pages/_terminal.scss | 110 +- frontend/src/utils/clipboard.js | 15 + frontend/vite.config.js | 12 + install.sh | 23 +- scripts/install.ps1 | 15 +- scripts/install.sh | 97 +- serverkit | 47 +- serverkit-backend.service | 13 +- verify_db_final.py | 43 + 109 files changed, 1828 insertions(+), 4634 deletions(-) create mode 100644 LICENSE create mode 100644 check_users.py create mode 100644 clear_db.py create mode 100644 docker-compose.dev.yml create mode 100644 ensure_dev_state.py create mode 100644 frontend/src/utils/clipboard.js create mode 100644 verify_db_final.py diff --git a/.gitattributes b/.gitattributes index ebbf0f13..dfe07704 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,13 +1,2 @@ -* text=auto eol=lf - -*.sh text eol=lf -*.ps1 text eol=crlf -*.bat text eol=crlf -*.cmd text eol=crlf - -*.png binary -*.jpg binary -*.jpeg binary -*.gif binary -*.ico binary -*.pdf binary +# Auto detect text files and perform LF normalization +* text=auto diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 56460712..9855ea8f 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,6 +1,6 @@ # These are supported funding model platforms -github: [jhd3197] +github: [andreamada] patreon: # Replace with a single Patreon username open_collective: # Replace with a single Open Collective username ko_fi: # Replace with a single Ko-fi username @@ -10,6 +10,6 @@ liberapay: # Replace with a single Liberapay username issuehunt: # Replace with a single IssueHunt username lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry polar: # Replace with a single Polar username -buy_me_a_coffee: jhd3197 +buy_me_a_coffee: andreamada thanks_dev: # Replace with a single thanks.dev username custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] \ No newline at end of file diff --git a/.github/workflows/agent-release.yml b/.github/workflows/agent-release.yml index aa397e03..1afb3ce6 100644 --- a/.github/workflows/agent-release.yml +++ b/.github/workflows/agent-release.yml @@ -12,7 +12,7 @@ on: type: string env: - GO_VERSION: '1.23' + GO_VERSION: '1.21' jobs: build: @@ -190,107 +190,10 @@ jobs: path: packages/*.rpm retention-days: 5 - # Build Windows MSI - build-msi: - name: Build MSI Installer - runs-on: windows-latest - needs: build - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Get version - id: version - shell: bash - run: | - if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then - VERSION="${{ github.event.inputs.version }}" - else - VERSION="${GITHUB_REF#refs/tags/agent-v}" - fi - echo "version=$VERSION" >> $GITHUB_OUTPUT - - - name: Install WiX Toolset - run: | - dotnet tool install --global wix --version 5.0.2 - - - name: Download binary - uses: actions/download-artifact@v4 - with: - name: serverkit-agent-windows-amd64 - path: dist/ - - - name: Extract binary - shell: bash - run: | - cd dist - unzip serverkit-agent-${{ steps.version.outputs.version }}-windows-amd64.zip - - - name: Build MSI - shell: pwsh - run: | - cd agent/packaging/msi - .\build.ps1 -Version "${{ steps.version.outputs.version }}" -BinaryPath "..\..\..\dist\serverkit-agent-windows-amd64.exe" -OutputDir "..\..\..\packages" - - - name: Upload MSI - uses: actions/upload-artifact@v4 - with: - name: serverkit-agent-msi - path: packages/*.msi - retention-days: 5 - - # Build Docker image - build-docker: - name: Build Docker Image - runs-on: ubuntu-latest - needs: build - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Get version - id: version - run: | - if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then - VERSION="${{ github.event.inputs.version }}" - else - VERSION="${GITHUB_REF#refs/tags/agent-v}" - fi - echo "version=$VERSION" >> $GITHUB_OUTPUT - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Login to Docker Hub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - continue-on-error: true - - - name: Build and push Docker image - uses: docker/build-push-action@v5 - with: - context: ./agent - platforms: linux/amd64,linux/arm64 - push: ${{ secrets.DOCKERHUB_USERNAME != '' }} - tags: | - jhd3197/serverkit-agent:latest - jhd3197/serverkit-agent:${{ steps.version.outputs.version }} - build-args: | - VERSION=${{ steps.version.outputs.version }} - BUILD_TIME=${{ github.event.repository.updated_at }} - GIT_COMMIT=${{ github.sha }} - release: name: Create Release runs-on: ubuntu-latest - needs: [build, build-deb, build-rpm, build-msi, build-docker] + needs: [build, build-deb, build-rpm] permissions: contents: write @@ -322,8 +225,6 @@ jobs: find artifacts -type f -name "*.deb" -exec mv {} release/ \; # RPM packages find artifacts -type f -name "*.rpm" -exec mv {} release/ \; - # MSI installers - find artifacts -type f -name "*.msi" -exec mv {} release/ \; ls -la release/ - name: Generate checksums @@ -364,15 +265,9 @@ jobs: #### Windows Installer | Format | Architecture | Download | |--------|--------------|----------| - | MSI | x64 | `serverkit-agent-${{ steps.version.outputs.version }}-x64.msi` | - - > **New:** Run `serverkit-agent tray` to launch the **System Tray Application** which provides a visual indicator that the agent is running, along with quick access to status, logs, and service controls. The MSI installer auto-starts the tray on Windows login. + | ZIP | x64 | `serverkit-agent-${{ steps.version.outputs.version }}-windows-amd64.zip` | - #### Docker - ```bash - docker pull jhd3197/serverkit-agent:${{ steps.version.outputs.version }} - docker pull jhd3197/serverkit-agent:latest - ``` + > **New:** Run `serverkit-agent tray` to launch the **System Tray Application** which provides a visual indicator that the agent is running, along with quick access to status, logs, and service controls. ### Quick Install @@ -391,19 +286,11 @@ jobs: sudo systemctl start serverkit-agent ``` - **Windows (MSI):** - Download and run the MSI installer, then: + **Windows:** + Download and run the binary zip, then: ```powershell - serverkit-agent register --token "YOUR_TOKEN" --server "https://your-serverkit.com" - Start-Service ServerKitAgent - ``` - - **Docker:** - ```bash - docker run -d --name serverkit-agent \ - -v /var/run/docker.sock:/var/run/docker.sock:ro \ - -v serverkit-config:/etc/serverkit-agent \ - jhd3197/serverkit-agent:${{ steps.version.outputs.version }} + .\serverkit-agent.exe register --token "YOUR_TOKEN" --server "https://your-serverkit.com" + .\serverkit-agent.exe start ``` ### Verification @@ -422,7 +309,7 @@ jobs: summary: name: Build Summary runs-on: ubuntu-latest - needs: [build, build-deb, build-rpm, build-msi, build-docker, release] + needs: [build, build-deb, build-rpm, release] steps: - name: Get version @@ -457,8 +344,6 @@ jobs: echo "| DEB | arm64 | ✅ Built |" >> $GITHUB_STEP_SUMMARY echo "| RPM | x86_64 | ✅ Built |" >> $GITHUB_STEP_SUMMARY echo "| RPM | aarch64 | ✅ Built |" >> $GITHUB_STEP_SUMMARY - echo "| MSI | x64 | ✅ Built |" >> $GITHUB_STEP_SUMMARY - echo "| Docker | multi-arch | ✅ Built |" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY echo "### Release" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY diff --git a/.gitignore b/.gitignore index 29f74047..1df8cd72 100644 --- a/.gitignore +++ b/.gitignore @@ -96,3 +96,4 @@ nul SECURITY_AUDIT.md APP_IMPROVEMENTS.md *.png +frontend/.env.development diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 9e7d57a6..07dbb698 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -4,7 +4,7 @@ Thanks to everyone who has contributed to ServerKit! ## Core -- **Juan Denis** ([@jhd3197](https://github.com/jhd3197)) — Creator and maintainer +- **Juan Denis** ([@andreamada](https://github.com/andreamada)) — Creator and maintainer ## Contributors diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..9755ffb8 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 andreamada + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index b2c2ed4c..66bf3ebb 100644 --- a/README.md +++ b/README.md @@ -1,369 +1,2 @@ -
-
-
- - - -
- -
-
-
-
-
-
-
-
-
-
-
- Use these one-liner commands to download and install the agent. Replace YOUR_TOKEN with the server registration token.
+ Use these one-liner commands to download and install the agent. Replace YOUR_TOKEN with your server's registration token.
Run the registration command with your token:
-{`serverkit-agent register --token "YOUR_TOKEN" --server "${getBaseUrl()}"`}
+ serverkit-agent register --token "YOUR_TOKEN" --server "{getBaseUrl()}"
Paste a GitHub repo URL, release URL, or direct zip link.
-{plugin.description}
} - {plugin.error_message &&{plugin.error_message}
} -No plugins installed. Use the form above to install one from a URL.
-{server.description}
- )} ++ {server.hostname || server.ip_address} + {server.description && ` - ${server.description}`} +
The registration token expires in 24 hours. You can regenerate it from the server settings page. @@ -1194,12 +1178,6 @@ Install-ServerKitAgent -Server "${window.location.origin}" -Token "${token}"` : }; // Icons -const FolderTinyIcon = () => ( - -); - const RefreshIcon = () => (