Compare commits

...

4 Commits

Author SHA1 Message Date
9365864e4d Bugfix Workflow
All checks were successful
release-tag / release-image (push) Successful in 2m27s
build-binaries / build (, amd64, linux) (push) Successful in 53s
build-binaries / build (, arm, 7, linux) (push) Successful in 45s
build-binaries / build (, arm64, linux) (push) Successful in 45s
build-binaries / build (.exe, amd64, windows) (push) Successful in 47s
build-binaries / release (push) Successful in 22s
2025-10-05 10:32:09 +02:00
c094b36af9 v1.0.0
Some checks failed
release-tag / release-image (push) Successful in 4m8s
build-binaries / build (, amd64, linux) (push) Failing after 40s
build-binaries / build (, arm, 7, linux) (push) Failing after 37s
build-binaries / build (, arm64, linux) (push) Failing after 37s
build-binaries / build (.exe, amd64, windows) (push) Failing after 36s
build-binaries / release (push) Has been skipped
2025-10-05 10:01:28 +02:00
eff64482a1 RC-1 2025-10-04 18:05:27 +02:00
b526c20f93 ok ohne admin 2025-10-04 14:28:45 +02:00
6 changed files with 2082 additions and 0 deletions

View File

@@ -0,0 +1,51 @@
name: release-tag
on:
push:
branches:
- 'main'
jobs:
release-image:
runs-on: ubuntu-fast
env:
DOCKER_ORG: ${{ vars.DOCKER_ORG }}
DOCKER_LATEST: latest
RUNNER_TOOL_CACHE: /toolcache
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker BuildX
uses: docker/setup-buildx-action@v2
with: # replace it with your local IP
config-inline: |
[registry."${{ vars.DOCKER_REGISTRY }}"]
http = true
insecure = true
- name: Login to DockerHub
uses: docker/login-action@v2
with:
registry: ${{ vars.DOCKER_REGISTRY }} # replace it with your local IP
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Get Meta
id: meta
run: |
echo REPO_NAME=$(echo ${GITHUB_REPOSITORY} | awk -F"/" '{print $2}') >> $GITHUB_OUTPUT
echo REPO_VERSION=$(git describe --tags --always | sed 's/^v//') >> $GITHUB_OUTPUT
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile
platforms: |
linux/amd64
push: true
tags: | # replace it with your local IP and tags
${{ vars.DOCKER_REGISTRY }}/${{ env.DOCKER_ORG }}/${{ steps.meta.outputs.REPO_NAME }}:${{ steps.meta.outputs.REPO_VERSION }}
${{ vars.DOCKER_REGISTRY }}/${{ env.DOCKER_ORG }}/${{ steps.meta.outputs.REPO_NAME }}:${{ env.DOCKER_LATEST }}

View File

@@ -0,0 +1,124 @@
# Git(tea) Actions workflow: Build and publish standalone binaries **plus** bundled `static/` assets
# ────────────────────────────────────────────────────────────────────
# ✧ Builds the Gobased WoL server for four targets **and** packt das Verzeichnis
# `static` zusammen mit der Binary, sodass es relativ zur ausführbaren Datei
# liegt (wichtig für die eingebauten BootstrapAssets & favicon).
#
# • linux/amd64 → wol-server-linux-amd64.tar.gz
# • linux/arm64 → wol-server-linux-arm64.tar.gz
# • linux/arm/v7 → wol-server-linux-armv7.tar.gz
# • windows/amd64 → wol-server-windows-amd64.zip
#
# ✧ Artefakte landen im Workflow und bei TagPush (vX.Y.Z) als ReleaseAssets.
#
# Secrets/variables:
# GITEA_TOKEN optional, falls default token keine ReleaseRechte hat.
# ────────────────────────────────────────────────────────────────────
name: build-binaries
on:
push:
branches: [ "main" ]
tags: [ "v*" ]
jobs:
build:
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-fast
strategy:
matrix:
include:
- goos: linux
goarch: amd64
ext: ""
- goos: linux
goarch: arm64
ext: ""
- goos: linux
goarch: arm
goarm: "7"
ext: ""
- goos: windows
goarch: amd64
ext: ".exe"
env:
GO_VERSION: "1.24"
BINARY_NAME: advocacy-watchlist
steps:
- name: Checkout source
uses: actions/checkout@v3
- name: Set up Go ${{ env.GO_VERSION }}
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
cache: true
- name: Build ${{ matrix.goos }}/${{ matrix.goarch }}${{ matrix.goarm && format('/v{0}', matrix.goarm) || '' }}
shell: bash
run: |
set -e
mkdir -p dist/package
if [ -n "${{ matrix.goarm }}" ]; then export GOARM=${{ matrix.goarm }}; fi
CGO_ENABLED=0 GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -trimpath -ldflags "-s -w" \
-o "dist/package/${BINARY_NAME}${{ matrix.ext }}" .
# Assets: statisches Verzeichnis beilegen
# cp -r static dist/package/
- name: Package archive with static assets
shell: bash
run: |
set -e
cd dist
if [ "${{ matrix.goos }}" == "windows" ]; then
ZIP_NAME="${BINARY_NAME}-windows-amd64.zip"
(cd package && zip -r "../$ZIP_NAME" .)
else
ARCH_SUFFIX="${{ matrix.goarch }}"
if [ "${{ matrix.goarch }}" == "arm" ]; then ARCH_SUFFIX="armv${{ matrix.goarm }}"; fi
TAR_NAME="${BINARY_NAME}-${{ matrix.goos }}-${ARCH_SUFFIX}.tar.gz"
tar -czf "$TAR_NAME" -C package .
fi
- name: Upload workflow artifact
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.goos }}-${{ matrix.goarch }}${{ matrix.goarm && format('v{0}', matrix.goarm) || '' }}
path: dist/*.tar.gz
if-no-files-found: ignore
- uses: actions/upload-artifact@v3
with:
name: windows-amd64
path: dist/*.zip
if-no-files-found: ignore
# Release Schritt für TagPushes
release:
if: startsWith(github.ref, 'refs/tags/')
needs: build
runs-on: ubuntu-fast
permissions:
contents: write
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
with:
path: ./dist
- name: Create / Update release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITEA_TOKEN || github.token }}
with:
name: "Release ${{ github.ref_name }}"
tag_name: ${{ github.ref_name }}
draft: false
prerelease: false
files: |
dist/**/advocacy-watchlist-*.tar.gz
dist/**/advocacy-watchlist-*.zip

8
Dockerfile Normal file
View File

@@ -0,0 +1,8 @@
FROM golang:1.24.4
WORKDIR /app
COPY go.mod ./
RUN go mod download
COPY *.go ./
RUN CGO_ENABLED=0 GOOS=linux go build -o /goprg
EXPOSE 8080
CMD ["/goprg"]

556
data.json Normal file
View File

@@ -0,0 +1,556 @@
{
"users": [
{
"username": "admin",
"password_hash": "hBaSLUNhYTfD8t5QgMBAyRgb/IsdpOzG70XzIaPWPik=:LeiXx83tVF0Vb08KjNwT/A==",
"is_admin": true,
"created_at": 1759592823
},
{
"username": "jbergner",
"password_hash": "xO0T3HChR2wCqr2/EdGBh5DImelVl1WQZ7pji+MFW84=:yhjVxufYiqdzq0XQZBcRtQ==",
"is_admin": true,
"created_at": 1759593689
},
{
"username": "B1tK1ll3r",
"password_hash": "y+KukuKzR+/5XKQdiUyvHYcwgbTJanzSwnZ/YTFB0XM=:bquVapMq6at57Ta5z2UCKw==",
"is_admin": false,
"created_at": 1759611544
}
],
"reports": [
{
"id": 5,
"name": "SOLHELFROST",
"status": "Bestätigt",
"reported_by": "admin",
"confirmed_by": "B1tK1ll3r",
"created_at": 1759612138,
"confirmed_at": 1759612167,
"reasons": [
{
"id": 5,
"text": "Griefing mit Polaris",
"added_by": "admin",
"added_at": 1759612138
}
]
}
],
"audit": [
{
"time": 1759652627,
"actor": "",
"action": "logout",
"details": "",
"ip": "127.0.0.1"
},
{
"time": 1759651126,
"actor": "admin",
"action": "login",
"details": "Erfolg",
"ip": "127.0.0.1"
},
{
"time": 1759614492,
"actor": "",
"action": "logout",
"details": "",
"ip": "127.0.0.1"
},
{
"time": 1759614266,
"actor": "jbergner",
"action": "login",
"details": "Erfolg",
"ip": "127.0.0.1"
},
{
"time": 1759613631,
"actor": "",
"action": "logout",
"details": "",
"ip": "127.0.0.1"
},
{
"time": 1759613314,
"actor": "admin",
"action": "login",
"details": "Erfolg",
"ip": "127.0.0.1"
},
{
"time": 1759612170,
"actor": "",
"action": "logout",
"details": "",
"ip": "127.0.0.1"
},
{
"time": 1759612167,
"actor": "B1tK1ll3r",
"action": "confirm",
"details": "ID 5 · SOLHELFROST",
"ip": "127.0.0.1"
},
{
"time": 1759612164,
"actor": "B1tK1ll3r",
"action": "login",
"details": "Erfolg",
"ip": "127.0.0.1"
},
{
"time": 1759612150,
"actor": "",
"action": "logout",
"details": "",
"ip": "127.0.0.1"
},
{
"time": 1759612138,
"actor": "admin",
"action": "report",
"details": "ID 5 · SOLHELFROST",
"ip": "127.0.0.1"
},
{
"time": 1759612060,
"actor": "admin",
"action": "login",
"details": "Erfolg",
"ip": "127.0.0.1"
},
{
"time": 1759612020,
"actor": "",
"action": "logout",
"details": "",
"ip": "127.0.0.1"
},
{
"time": 1759611994,
"actor": "admin",
"action": "delete",
"details": "ID 4 · Jan Bergner",
"ip": "127.0.0.1"
},
{
"time": 1759611990,
"actor": "admin",
"action": "login",
"details": "Erfolg",
"ip": "127.0.0.1"
},
{
"time": 1759611575,
"actor": "jbergner",
"action": "delete",
"details": "ID 3 · B1tK1ll3r",
"ip": "127.0.0.1"
},
{
"time": 1759611564,
"actor": "jbergner",
"action": "login",
"details": "Erfolg",
"ip": "127.0.0.1"
},
{
"time": 1759611559,
"actor": "",
"action": "logout",
"details": "",
"ip": "127.0.0.1"
},
{
"time": 1759611553,
"actor": "B1tK1ll3r",
"action": "login",
"details": "Erfolg",
"ip": "127.0.0.1"
},
{
"time": 1759611547,
"actor": "",
"action": "logout",
"details": "",
"ip": "127.0.0.1"
},
{
"time": 1759611544,
"actor": "jbergner",
"action": "user_create",
"details": "B1tK1ll3r",
"ip": "127.0.0.1"
},
{
"time": 1759594548,
"actor": "jbergner",
"action": "login",
"details": "Erfolg",
"ip": "127.0.0.1"
},
{
"time": 1759594542,
"actor": "",
"action": "logout",
"details": "",
"ip": "127.0.0.1"
},
{
"time": 1759594537,
"actor": "admin",
"action": "user_toggle_admin",
"details": "jbergner",
"ip": "127.0.0.1"
},
{
"time": 1759594531,
"actor": "admin",
"action": "login",
"details": "Erfolg",
"ip": "127.0.0.1"
},
{
"time": 1759594526,
"actor": "",
"action": "logout",
"details": "",
"ip": "127.0.0.1"
},
{
"time": 1759594412,
"actor": "jbergner",
"action": "confirm",
"details": "ID 4 · Jan Bergner",
"ip": "127.0.0.1"
},
{
"time": 1759594402,
"actor": "jbergner",
"action": "login",
"details": "Erfolg",
"ip": "127.0.0.1"
},
{
"time": 1759593988,
"actor": "admin",
"action": "report",
"details": "ID 4 · Jan Bergner",
"ip": "127.0.0.1"
},
{
"time": 1759593979,
"actor": "admin",
"action": "login",
"details": "Erfolg",
"ip": "127.0.0.1"
},
{
"time": 1759593901,
"actor": "jbergner",
"action": "confirm",
"details": "ID 3 · B1tK1ll3r",
"ip": "127.0.0.1"
},
{
"time": 1759593892,
"actor": "jbergner",
"action": "pw_change",
"details": "",
"ip": "127.0.0.1"
},
{
"time": 1759593884,
"actor": "jbergner",
"action": "login",
"details": "Erfolg",
"ip": "127.0.0.1"
},
{
"time": 1759593880,
"actor": "",
"action": "logout",
"details": "",
"ip": "127.0.0.1"
},
{
"time": 1759593872,
"actor": "admin",
"action": "user_resetpw",
"details": "jbergner",
"ip": "127.0.0.1"
},
{
"time": 1759593867,
"actor": "admin",
"action": "login",
"details": "Erfolg",
"ip": "127.0.0.1"
},
{
"time": 1759593779,
"actor": "jbergner",
"action": "login",
"details": "Fehlgeschlagen",
"ip": "127.0.0.1"
},
{
"time": 1759593771,
"actor": "jbergner",
"action": "login",
"details": "Fehlgeschlagen",
"ip": "127.0.0.1"
},
{
"time": 1759593765,
"actor": "",
"action": "logout",
"details": "",
"ip": "127.0.0.1"
},
{
"time": 1759593752,
"actor": "admin",
"action": "user_resetpw",
"details": "jbergner",
"ip": "127.0.0.1"
},
{
"time": 1759593745,
"actor": "admin",
"action": "login",
"details": "Erfolg",
"ip": "127.0.0.1"
},
{
"time": 1759593739,
"actor": "jbergner",
"action": "login",
"details": "Fehlgeschlagen",
"ip": "127.0.0.1"
},
{
"time": 1759593734,
"actor": "",
"action": "logout",
"details": "",
"ip": "127.0.0.1"
},
{
"time": 1759593715,
"actor": "admin",
"action": "user_resetpw",
"details": "jbergner",
"ip": "127.0.0.1"
},
{
"time": 1759593710,
"actor": "admin",
"action": "login",
"details": "Erfolg",
"ip": "127.0.0.1"
},
{
"time": 1759593702,
"actor": "jbergner",
"action": "login",
"details": "Fehlgeschlagen",
"ip": "127.0.0.1"
},
{
"time": 1759593697,
"actor": "jbergner",
"action": "login",
"details": "Fehlgeschlagen",
"ip": "127.0.0.1"
},
{
"time": 1759593692,
"actor": "",
"action": "logout",
"details": "",
"ip": "127.0.0.1"
},
{
"time": 1759593689,
"actor": "admin",
"action": "user_create",
"details": "jbergner",
"ip": "127.0.0.1"
},
{
"time": 1759593682,
"actor": "admin",
"action": "login",
"details": "Erfolg",
"ip": "127.0.0.1"
},
{
"time": 1759593677,
"actor": "jbergner",
"action": "login",
"details": "Fehlgeschlagen",
"ip": "127.0.0.1"
},
{
"time": 1759593672,
"actor": "jbergner",
"action": "login",
"details": "Fehlgeschlagen",
"ip": "127.0.0.1"
},
{
"time": 1759593668,
"actor": "",
"action": "logout",
"details": "",
"ip": "127.0.0.1"
},
{
"time": 1759593661,
"actor": "admin",
"action": "report",
"details": "ID 3 · B1tK1ll3r",
"ip": "127.0.0.1"
},
{
"time": 1759593652,
"actor": "admin",
"action": "login",
"details": "Erfolg",
"ip": "127.0.0.1"
},
{
"time": 1759593441,
"actor": "admin",
"action": "login",
"details": "Erfolg",
"ip": "127.0.0.1"
},
{
"time": 1759593436,
"actor": "",
"action": "logout",
"details": "",
"ip": "127.0.0.1"
},
{
"time": 1759593433,
"actor": "admin",
"action": "pw_change",
"details": "",
"ip": "127.0.0.1"
},
{
"time": 1759593403,
"actor": "admin",
"action": "delete",
"details": "ID 1 · B1tK1ll3r",
"ip": "127.0.0.1"
},
{
"time": 1759593401,
"actor": "admin",
"action": "delete",
"details": "ID 2 · Jan Bergner",
"ip": "127.0.0.1"
},
{
"time": 1759593393,
"actor": "admin",
"action": "reason_delete",
"details": "Report 2, Reason 3",
"ip": "127.0.0.1"
},
{
"time": 1759593388,
"actor": "admin",
"action": "report",
"details": "ID 2 · Jan Bergner",
"ip": "127.0.0.1"
},
{
"time": 1759593380,
"actor": "admin",
"action": "login",
"details": "Erfolg",
"ip": "127.0.0.1"
},
{
"time": 1759593252,
"actor": "admin",
"action": "reason_delete",
"details": "Report 1, Reason 1",
"ip": "127.0.0.1"
},
{
"time": 1759593250,
"actor": "admin",
"action": "reason_delete",
"details": "Report 1, Reason 2",
"ip": "127.0.0.1"
},
{
"time": 1759593246,
"actor": "admin",
"action": "login",
"details": "Erfolg",
"ip": "127.0.0.1"
},
{
"time": 1759592953,
"actor": "admin",
"action": "reason_delete_failed",
"details": "Report 0, Reason 2",
"ip": "127.0.0.1"
},
{
"time": 1759592948,
"actor": "admin",
"action": "reason_delete_failed",
"details": "Report 0, Reason 1",
"ip": "127.0.0.1"
},
{
"time": 1759592946,
"actor": "admin",
"action": "reason_add",
"details": "Report 1",
"ip": "127.0.0.1"
},
{
"time": 1759592871,
"actor": "admin",
"action": "reason_delete_failed",
"details": "Report 0, Reason 1",
"ip": "127.0.0.1"
},
{
"time": 1759592869,
"actor": "admin",
"action": "reason_add",
"details": "Report 1",
"ip": "127.0.0.1"
},
{
"time": 1759592866,
"actor": "admin",
"action": "report",
"details": "ID 1 · B1tK1ll3r",
"ip": "127.0.0.1"
},
{
"time": 1759592833,
"actor": "admin",
"action": "login",
"details": "Erfolg",
"ip": "127.0.0.1"
}
],
"next_id": 6,
"next_rid": 6
}

3
go.mod Normal file
View File

@@ -0,0 +1,3 @@
module git.send.nrw/sendnrw/advocacy-watchlist
go 1.24.4

1340
main.go Normal file

File diff suppressed because it is too large Load Diff