Skip to content
Merged
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
17 changes: 17 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,24 @@ permissions:
packages: write

jobs:
ci:
name: Verify CI passes
runs-on: [self-hosted, linux, x64]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'
- name: Install dependencies
run: pip install -r requirements.txt -r requirements-dev.txt --quiet
- name: Lint
run: ruff check . && ruff format --check .
- name: Test
run: pytest

release:
needs: ci
name: Bump version and release
runs-on: [self-hosted, linux, x64]
if: "!contains(github.event.head_commit.message, '[skip ci]')"
Expand Down
2 changes: 2 additions & 0 deletions app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -796,6 +796,8 @@ async def api_deploy(request: Request, slug: str, body: DeployRequest, worker_id
svc = catalog.get_service(slug)
if not svc:
raise HTTPException(status_code=404, detail=f"Service '{slug}' not found")
if svc.get("status") == "dead":
raise HTTPException(status_code=410, detail=f"Service '{slug}' is no longer available (dead/discontinued)")

docker_conf = svc.get("docker", {})
image = docker_conf.get("image")
Expand Down
3 changes: 3 additions & 0 deletions docs/guides/peer2profit.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Peer2Profit

> [!CAUTION]
> **Deprecated:** Peer2Profit is no longer operational and has been marked as dead in CashPilot. Deployment is blocked. This guide is kept for reference only.

> **Category:** Bandwidth Sharing | **Status:** Dead
> **Website:** [https://peer2profit.com](https://peer2profit.com)

Expand Down
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
pytest>=8.0
pytest-asyncio>=0.23
pytest-cov>=5.0
ruff>=0.11.0
tzdata>=2024.1
11 changes: 11 additions & 0 deletions tests/test_main_deploy_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,17 @@ def test_deploy_no_image(self, client):
resp = client.post("/api/deploy/grass", json={})
assert resp.status_code == 400

def test_deploy_dead_service(self, client):
svc = {"slug": "peer2profit", "name": "Peer2Profit", "status": "dead", "docker": {"image": "x"}}
with (
_auth_owner(),
patch("app.main.database.list_workers", new_callable=AsyncMock, return_value=[_online_worker()]),
patch("app.main.catalog.get_service", return_value=svc),
):
resp = client.post("/api/deploy/peer2profit", json={})
assert resp.status_code == 410
assert "no longer available" in resp.json()["detail"]

def test_deploy_no_auth(self, client):
with _no_auth():
resp = client.post("/api/deploy/honeygain", json={})
Expand Down
Loading