Compare commits
7 commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 94f3065046 | |||
| 8ce81de224 | |||
| 61cf83ad7a | |||
| 859635b45a | |||
| 150e914ed4 | |||
| 80012a7b6a | |||
| d96dfc24f2 |
8 changed files with 89 additions and 21 deletions
24
.forgejo/workflows/lint.yml
Normal file
24
.forgejo/workflows/lint.yml
Normal file
|
|
@ -0,0 +1,24 @@
|
||||||
|
name: Lint
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
lint:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v6
|
||||||
|
|
||||||
|
- uses: actions/setup-go@v6
|
||||||
|
with:
|
||||||
|
go-version: '1.26'
|
||||||
|
|
||||||
|
- name: golangci-lint
|
||||||
|
uses: golangci/golangci-lint-action@v9
|
||||||
|
with:
|
||||||
|
version: latest
|
||||||
|
|
||||||
|
- name: Run Biome
|
||||||
|
run: npx @biomejs/biome@latest check .
|
||||||
56
.forgejo/workflows/release.yml
Normal file
56
.forgejo/workflows/release.yml
Normal file
|
|
@ -0,0 +1,56 @@
|
||||||
|
name: Build and Push Docker Image
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
packages: write
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v6
|
||||||
|
|
||||||
|
- name: Get version from VERSION file
|
||||||
|
id: version
|
||||||
|
run: echo "VERSION=$(cat VERSION)" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Create tag
|
||||||
|
run: |
|
||||||
|
git config user.name forgejo-actions
|
||||||
|
git config user.email forgejo-actions@lonecloud.dev
|
||||||
|
git tag -a v${{ steps.version.outputs.VERSION }} -m "Release v${{ steps.version.outputs.VERSION }}"
|
||||||
|
git push origin v${{ steps.version.outputs.VERSION }}
|
||||||
|
|
||||||
|
- name: Create Forgejo Release
|
||||||
|
run: |
|
||||||
|
curl -s -X POST "https://git.lonecloud.dev/api/v1/repos/${{ github.repository }}/releases" \
|
||||||
|
-H "Authorization: token ${{ secrets.FORGEJO_TOKEN }}" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-d "{\"tag_name\":\"v${{ steps.version.outputs.VERSION }}\",\"name\":\"v${{ steps.version.outputs.VERSION }}\",\"generate_release_notes\":true}"
|
||||||
|
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v4
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v4
|
||||||
|
|
||||||
|
- name: Login to Forgejo Container Registry
|
||||||
|
uses: docker/login-action@v4
|
||||||
|
with:
|
||||||
|
registry: git.lonecloud.dev
|
||||||
|
username: ${{ secrets.FORGEJO_USERNAME }}
|
||||||
|
password: ${{ secrets.FORGEJO_TOKEN }}
|
||||||
|
|
||||||
|
- name: Build and push
|
||||||
|
uses: docker/build-push-action@v7
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
push: true
|
||||||
|
platforms: linux/amd64,linux/arm64
|
||||||
|
no-cache: true
|
||||||
|
tags: |
|
||||||
|
git.lonecloud.dev/lone-cloud/snowflake-dashboard:latest
|
||||||
|
git.lonecloud.dev/lone-cloud/snowflake-dashboard:v${{ steps.version.outputs.VERSION }}
|
||||||
5
Makefile
5
Makefile
|
|
@ -20,6 +20,9 @@ test:
|
||||||
go test -v ./...
|
go test -v ./...
|
||||||
|
|
||||||
release:
|
release:
|
||||||
gh workflow run release.yml
|
curl -s -X POST "https://git.lonecloud.dev/api/v1/repos/lone-cloud/snowflake-dashboard/actions/workflows/release.yml/dispatches" \
|
||||||
|
-H "Authorization: token $$(cat ~/.config/forgejo-token)" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-d '{"ref":"master"}'
|
||||||
|
|
||||||
.PHONY: lint fix check dev build docker test release
|
.PHONY: lint fix check dev build docker test release
|
||||||
|
|
|
||||||
2
VERSION
2
VERSION
|
|
@ -1 +1 @@
|
||||||
1.10.1
|
1.10.3
|
||||||
11
dashboard.js
11
dashboard.js
|
|
@ -223,15 +223,8 @@ async function fetchStats() {
|
||||||
document.getElementById("total").textContent = total;
|
document.getElementById("total").textContent = total;
|
||||||
document.getElementById("timeouts").textContent = timeouts;
|
document.getElementById("timeouts").textContent = timeouts;
|
||||||
const rateEl = document.getElementById("success-rate-small");
|
const rateEl = document.getElementById("success-rate-small");
|
||||||
const statusLabel =
|
rateEl.textContent = `${successRate.toFixed(1)}%`;
|
||||||
successRate >= 70 ? "Good" : successRate >= 40 ? "Warning" : "Critical";
|
rateEl.className = "";
|
||||||
rateEl.innerHTML = `${successRate.toFixed(1)}% <span class="sr-only">(${statusLabel})</span>`;
|
|
||||||
rateEl.className =
|
|
||||||
successRate >= 70
|
|
||||||
? "success-rate"
|
|
||||||
: successRate >= 40
|
|
||||||
? "warn-rate"
|
|
||||||
: "error";
|
|
||||||
document.getElementById("tor-traffic").textContent =
|
document.getElementById("tor-traffic").textContent =
|
||||||
`${formatBytes(torInbound)} / ${formatBytes(torOutbound)}`;
|
`${formatBytes(torInbound)} / ${formatBytes(torOutbound)}`;
|
||||||
document.getElementById("memory").textContent = formatBytes(memory);
|
document.getElementById("memory").textContent = formatBytes(memory);
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
services:
|
services:
|
||||||
snowflake-dashboard:
|
snowflake-dashboard:
|
||||||
container_name: snowflake-dashboard
|
container_name: snowflake-dashboard
|
||||||
image: ghcr.io/lone-cloud/snowflake-dashboard:latest
|
image: git.lonecloud.dev/lone-cloud/snowflake-dashboard:latest
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
network_mode: host
|
network_mode: host
|
||||||
volumes:
|
volumes:
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
Rate</span>
|
Rate</span>
|
||||||
<span id="tip-success-rate" class="sr-only">Percentage of successful connections vs total
|
<span id="tip-success-rate" class="sr-only">Percentage of successful connections vs total
|
||||||
attempts</span>
|
attempts</span>
|
||||||
<span role="definition" class="success-rate" id="success-rate-small">-</span>
|
<span role="definition" id="success-rate-small">-</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="metric-row">
|
<div class="metric-row">
|
||||||
<span tabindex="0" role="term" class="metric-label" aria-describedby="tip-uptime" title="How long the Snowflake proxy has been running">Uptime</span>
|
<span tabindex="0" role="term" class="metric-label" aria-describedby="tip-uptime" title="How long the Snowflake proxy has been running">Uptime</span>
|
||||||
|
|
|
||||||
|
|
@ -231,14 +231,6 @@ tr:last-child td {
|
||||||
color: var(--error-color);
|
color: var(--error-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
.success-rate {
|
|
||||||
color: var(--success-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
.warn-rate {
|
|
||||||
color: var(--warn-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
.flag {
|
.flag {
|
||||||
font-size: 1.25rem;
|
font-size: 1.25rem;
|
||||||
margin-right: var(--space-2);
|
margin-right: var(--space-2);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue