From 50a0e110fcbbbbe749e5277b74573db01699553e Mon Sep 17 00:00:00 2001 From: Ralf Kirchner Date: Sat, 2 Aug 2025 12:38:38 +0200 Subject: [PATCH] chore(base): Projektstruktur mit Gitea und Changelog-Support eingerichtet --- .chglog/CHANGELOG.tpl.md | 38 +++++++++++++ .chglog/config.yml | 37 +++++++++++++ .gitea/workflows/release.yml | 100 +++++++++++++++++++++++++++++++++++ .gitignore | 9 ++++ README.md | 45 ++++++++++++++++ adguard-ai-blocklist.txt | 94 ++++++++++++++++++++++++++++++++ 6 files changed, 323 insertions(+) create mode 100755 .chglog/CHANGELOG.tpl.md create mode 100755 .chglog/config.yml create mode 100644 .gitea/workflows/release.yml create mode 100644 .gitignore create mode 100644 README.md create mode 100644 adguard-ai-blocklist.txt diff --git a/.chglog/CHANGELOG.tpl.md b/.chglog/CHANGELOG.tpl.md new file mode 100755 index 0000000..58c5193 --- /dev/null +++ b/.chglog/CHANGELOG.tpl.md @@ -0,0 +1,38 @@ +{{ with index .Versions 0 }} + +## {{ if .Tag.Previous }}[{{ .Tag.Name }}]({{ $.Info.RepositoryURL }}/compare/{{ .Tag.Previous.Name }}...{{ .Tag.Name }}){{ else }}{{ .Tag.Name }}{{ end }} ({{ datetime "2006-01-02" .Tag.Date }}) + +{{ range .CommitGroups -}} +### {{ .Title }} + +{{ range .Commits -}} +* {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }} ([{{ .Hash.Short }}]({{ $.Info.RepositoryURL }}/commit/{{ .Hash.Short }})) +{{ end }} +{{ end -}} + +{{- if .RevertCommits -}} +### Reverts + +{{ range .RevertCommits -}} +* {{ .Revert.Header }} ([{{ .Hash.Short }}]({{ $.Info.RepositoryURL }}/commit/{{ .Hash.Short }})) +{{ end }} +{{ end -}} + +{{- if .MergeCommits -}} +### Pull Requests + +{{ range .MergeCommits -}} +* {{ .Header }} ([{{ .Hash.Short }}]({{ $.Info.RepositoryURL }}/commit/{{ .Hash.Short }})) +{{ end }} +{{ end -}} + +{{- if .NoteGroups -}} +{{ range .NoteGroups -}} +### {{ .Title }} + +{{ range .Notes }} +{{ .Body }} +{{ end }} +{{ end -}} +{{ end -}} +{{ end }} diff --git a/.chglog/config.yml b/.chglog/config.yml new file mode 100755 index 0000000..4e8fc61 --- /dev/null +++ b/.chglog/config.yml @@ -0,0 +1,37 @@ +style: github +template: CHANGELOG.tpl.md + +info: + title: CHANGELOG + repository_url: https://dev.ksite.de/ralf.kirchner/ai-domian-blocklist + +options: + commits: + sort_by: "date" # Optional, default is OK too + exclude_merge_commits: false + + commit_groups: + group_by: "Type" + title_maps: + feat: Features + fix: Bug Fixes + perf: Performance Improvements + refactor: Code Refactoring + docs: Documentation + chore: Maintenance + test: Tests + build: Build System + ci: Continuous Integration + style: Code Style + + header: + pattern: "^(\\w*)(?:\\(([\\w\\$\\.\\-\\*\\s]*)\\))?\\:\\s(.*)$" + pattern_maps: + - Type + - Scope + - Subject + + notes: + keywords: + - BREAKING CHANGE + - DEPRECATED diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml new file mode 100644 index 0000000..8b2fae4 --- /dev/null +++ b/.gitea/workflows/release.yml @@ -0,0 +1,100 @@ +name: Create Release + +on: + push: + tags: + - 'v*' # Nur bei Tags wie v1.0.0, v2.0.0 + +jobs: + release: + runs-on: ubuntu-latest + + steps: + - name: Enable debug output + run: set -x + + - name: Checkout full history including tags + uses: actions/checkout@v3 + with: + fetch-depth: 0 + fetch-tags: true + + - name: Show environment variables for debugging + run: | + echo "GIT_REMOTE_URL=$(git config --get remote.origin.url)" + echo "GITHUB_REF=$GITHUB_REF" + + - name: Extract OWNER and REPO from git remote URL + id: repo-info + run: | + REMOTE_URL=$(git config --get remote.origin.url) + OWNER=$(echo "$REMOTE_URL" | sed -E 's#.*/([^/]+)/([^/]+)(\.git)?#\1#') + REPO=$(echo "$REMOTE_URL" | sed -E 's#.*/([^/]+)/([^/]+)(\.git)?#\2#') + echo "OWNER=$OWNER" >> $GITHUB_ENV + echo "REPO=$REPO" >> $GITHUB_ENV + + - name: Install git-chglog binary (no Go needed) + run: | + GIT_CHGLOG_VERSION="0.15.1" + curl -sSL "https://github.com/git-chglog/git-chglog/releases/download/v${GIT_CHGLOG_VERSION}/git-chglog_${GIT_CHGLOG_VERSION}_linux_amd64.tar.gz" -o git-chglog.tar.gz + tar -xzf git-chglog.tar.gz + chmod +x git-chglog + sudo mv git-chglog /usr/local/bin/ + + - name: Determine current and previous tag + id: tags + run: | + CURRENT_TAG="${GITHUB_REF##*/}" + PREVIOUS_TAG=$(git describe --tags --abbrev=0 "${CURRENT_TAG}^" 2>/dev/null || true) + + echo "CURRENT_TAG=$CURRENT_TAG" + echo "PREVIOUS_TAG=$PREVIOUS_TAG" + + echo "CURRENT_TAG=$CURRENT_TAG" >> $GITHUB_ENV + echo "PREVIOUS_TAG=$PREVIOUS_TAG" >> $GITHUB_ENV + + - name: Generate CHANGELOG.md + run: | + # Optional: kompletter Changelog (nicht für Release-Body) + git-chglog -o CHANGELOG.md + + # Nur der relevante Abschnitt zwischen Tags + if [ -n "$PREVIOUS_TAG" ]; then + git-chglog "$PREVIOUS_TAG..$CURRENT_TAG" > RELEASE_BODY.md + else + git-chglog "$CURRENT_TAG" > RELEASE_BODY.md + fi + + echo "Release changelog content:" + cat RELEASE_BODY.md + + - name: Replace issue references with Markdown links + env: + OWNER: ${{ env.OWNER }} + REPO: ${{ env.REPO }} + run: | + sed -i -E "s/([^\\[])#([0-9]+)/\1[#\2](https:\/\/dev.ksite.de\/${OWNER}\/${REPO}\/issues\/\2)/g" RELEASE_BODY.md + + - name: Create Gitea Release via API + env: + TOKEN: ${{ secrets.TOKEN }} + OWNER: ${{ env.OWNER }} + REPO: ${{ env.REPO }} + CURRENT_TAG: ${{ env.CURRENT_TAG }} + run: | + # Base64-encode und sicher escapen für JSON + BODY=$(base64 -w0 RELEASE_BODY.md) + DECODED_BODY=$(echo "$BODY" | base64 -d | jq -Rs .) + + echo "Creating release for tag $CURRENT_TAG" + + curl -s -X POST "https://dev.ksite.de/api/v1/repos/${OWNER}/${REPO}/releases" \ + -H "Content-Type: application/json" \ + -H "Authorization: token $TOKEN" \ + -d @- < DNS-Blocklisten**. +3. Füge den Link zur `adguard-ai-blocklist.txt` als benutzerdefinierte Liste hinzu: [https://dev.ksite.de/ralf.kirchner/ai-domian-blocklist/adguard-ai-blocklist.txt](https://dev.ksite.de/ralf.kirchner/ai-domian-blocklist/adguard-ai-blocklist.txt) +4. Liste aktivieren und DNS-Cache leeren. + + + +## Hinweis + +Einige Dienste (z. B. Notion, Khan Academy) werden **komplett blockiert**, nicht nur deren KI-Funktionalität. Überprüfe die Liste vor produktivem Einsatz in Netzwerken mit Misch-Nutzung. + diff --git a/adguard-ai-blocklist.txt b/adguard-ai-blocklist.txt new file mode 100644 index 0000000..681a6c4 --- /dev/null +++ b/adguard-ai-blocklist.txt @@ -0,0 +1,94 @@ +# ========================================================== +# KI-Blockliste für AdGuard, Pi-hole & DNS-Filter +# ========================================================== +# Beschreibung: +# Blockiert Domains bekannter KI-Dienste, Chatbots und KI-APIs, +# um deren Nutzung im Netzwerk zu unterbinden. +# +# Ersteller: Ralf Kirchner (@ksite.de) +# Projekt: https://dev.ksite.de/ralf.kirchner/ai-domian-blocklist +# Erstellt: 2025-08-02 +# Format: AdGuard-kompatibel (||domain^) +# Lizenz: MIT +# +# Hinweis: +# Diese Liste kann zu Einschränkungen bei Diensten führen, die +# auch legitime Inhalte neben KI bereitstellen (z. B. Notion). +# Verwende sie mit Bedacht in produktiven Netzwerken. +# ========================================================== + +||chat.openai.com^ +||api.openai.com^ +||platform.openai.com^ +||auth0.openai.com^ +||cdn.openai.com^ + +||bard.google.com^ +||gemini.google.com^ +||generativelanguage.googleapis.com^ +||aistudio.google.com^ + +||copilot.microsoft.com^ +||copilot.office.com^ +||copilotstudio.microsoft.com^ + +||claude.ai^ +||api.anthropic.com^ +||console.anthropic.com^ + +||perplexity.ai^ +||api.perplexity.ai^ + +||huggingface.co^ +||api-inference.huggingface.co^ +||hf.space^ + +||you.com^ +||api.you.com^ +||search.you.com^ + +||poe.com^ +||api.poe.com^ +||gpt4.poe.com^ + +||character.ai^ +||beta.character.ai^ +||cdn.character.ai^ + +||replika.ai^ +||api.replika.ai^ + +||writesonic.com^ +||chatsonic.com^ +||api.writesonic.com^ +||app.writesonic.com^ + +||jasper.ai^ +||app.jasper.ai^ +||api.jasper.ai^ + +||copy.ai^ +||app.copy.ai^ + +||sudowrite.com^ +||app.sudowrite.com^ + +||deepai.org^ +||api.deepai.org^ + +||phind.com^ +||api.phind.com^ + +||aidungeon.com^ +||play.aidungeon.io^ + +||notion.so^ +||api.notion.com^ + +||forefront.ai^ +||chat.forefront.ai^ + +||khanacademy.org^ +||api.khanacademy.org^ +||khanmigo.khanacademy.org^ +