53 Commits

Author SHA1 Message Date
eyedeekay
1276269c8f disable cgo in modded nightly 2025-07-22 19:14:03 -04:00
eyedeekay
f9b4b18c8e update select-cache after multiple bugfixes 2025-07-22 15:23:38 -04:00
eyedeekay
5bba5f19db update modules 2025-07-21 21:44:38 -04:00
eyedeekay
b130467749 update modules 2025-07-21 21:44:30 -04:00
eyedeekay
3358037c8d update modules 2025-07-18 17:38:19 -04:00
eyedeekay
58dbfb3508 Fix metalistener setup 2025-05-26 21:15:06 -04:00
eyedeekay
71e284e48e make nightlies also latest 2025-05-26 18:52:19 -04:00
eyedeekay
2e0ae88b04 update package again 2025-05-26 18:38:30 -04:00
eyedeekay
56f11fa5e4 update module 2025-05-26 18:13:43 -04:00
eyedeekay
d912d5f90a oops grep syntax, duh 2025-05-26 17:23:52 -04:00
eyedeekay
7a032cfa07 add vanilla builders 2025-05-26 17:21:27 -04:00
eyedeekay
aba0d5f227 add vanilla builders 2025-05-26 17:19:02 -04:00
eyedeekay
8d4fd28ecd add vanilla builders 2025-05-26 17:18:13 -04:00
eyedeekay
aa66a4479d add vanilla builders 2025-05-26 17:16:11 -04:00
eyedeekay
ee938a6537 update metalistener 2025-05-26 17:14:48 -04:00
eyedeekay
57af8b01e0 Add windows back, add mod back 2025-05-26 16:34:07 -04:00
eyedeekay
d65e11dac1 disable windows 2025-05-26 08:13:37 -04:00
idk
040db09e7b Update gitea-nightly.yml 2025-05-26 03:52:23 -04:00
eyedeekay
e23d6ff6da Merge branch 'main' of github.com:go-i2p/go-gitlooseleaf 2025-05-25 23:49:32 -04:00
eyedeekay
e2a864668f update module againT 2025-05-25 23:48:44 -04:00
idk
6704652570 Revert, tidy is required 2025-05-23 01:27:51 +00:00
idk
a330adb44d Try and avoid generating go modules 2025-05-23 01:23:26 +00:00
idk
0a9880b906 Update README.md 2025-05-22 00:15:44 -04:00
idk
9715b9aae8 Update Makefile 2025-05-22 00:13:40 -04:00
idk
5f84fd9f8c Update Makefile 2025-05-22 00:11:45 -04:00
idk
33fdaaef42 Update README.md 2025-05-22 00:00:52 -04:00
idk
a6ea21aa77 Update gitea-nightly-debian.yml 2025-05-21 23:48:23 -04:00
idk
3b37a8f893 Update gitea-debian.yml 2025-05-21 23:47:54 -04:00
idk
1718b5eb26 Update gitea-debian.yml 2025-05-21 23:40:43 -04:00
eyedeekay
ec0a18584e i dunno, it's late, feed it to an llm and see if it sees anything I did not already get today 2025-05-21 23:23:58 -04:00
eyedeekay
8d4a10329f don't expose deb 2025-05-21 22:54:15 -04:00
eyedeekay
da594ce8cd don't expose deb 2025-05-21 22:39:57 -04:00
eyedeekay
2190589cc6 fix broken path 2025-05-21 18:38:00 -04:00
eyedeekay
21da0f09d3 fix path generation in makefile 2025-05-21 17:32:08 -04:00
eyedeekay
316c71d06c generate Debian packages 2025-05-21 17:24:03 -04:00
eyedeekay
45a461d669 generate Debian packages 2025-05-21 17:16:15 -04:00
eyedeekay
9feb5d2895 update module 2025-05-21 15:59:25 -04:00
eyedeekay
c2d7ff16f2 concatenate required modules to go.mod during build 2025-05-21 13:45:46 -04:00
eyedeekay
617e3ac8c3 concatenate required modules to go.mod during build 2025-05-21 13:37:01 -04:00
eyedeekay
c277a9a437 enforce modules versions 2025-05-21 13:30:32 -04:00
eyedeekay
ae61e33202 enforce modules versions 2025-05-21 13:27:04 -04:00
eyedeekay
547b5cb747 update meta-listener module 2025-05-21 13:05:17 -04:00
eyedeekay
e50b8c82e4 Fix Makefile 2025-05-21 11:44:11 -04:00
eyedeekay
efab5ff9b1 update meta-listener now that I'm 100% sure it is not the problem 2025-05-21 10:55:47 -04:00
eyedeekay
a3579ee83d update indirect modules 2025-05-18 10:36:43 -04:00
eyedeekay
8fee567d0c revert module version to 3 2025-05-18 00:39:40 -04:00
eyedeekay
7afb74dc29 fix some paths I think? The alias thing is confusing 2025-05-09 23:41:21 -04:00
eyedeekay
942e8c2d81 use wildcard to get artifact 2025-05-09 20:07:25 -04:00
eyedeekay
21a817fe01 use wildcard to get artifact 2025-05-09 19:54:47 -04:00
eyedeekay
35d0604a38 use wildcard to get artifact 2025-05-09 19:50:13 -04:00
eyedeekay
a79a3f0290 use wildcard to get artifact 2025-05-09 19:45:26 -04:00
eyedeekay
f118698957 Merge branch 'main' of github.com:go-i2p/go-gitlooseleaf 2025-05-09 17:27:00 -04:00
eyedeekay
432d9fb280 fix artifact name 2025-05-09 17:26:28 -04:00
19 changed files with 1443 additions and 162 deletions

View File

@@ -80,6 +80,7 @@ jobs:
cp -v ../net_mirror_dialer.go modules/graceful/net_mirror_dialer.go cp -v ../net_mirror_dialer.go modules/graceful/net_mirror_dialer.go
cp -v ../net_mirror_unix.go modules/graceful/net_mirror_unix.go cp -v ../net_mirror_unix.go modules/graceful/net_mirror_unix.go
cp -v ../net_mirror_windows.go modules/graceful/net_mirror_windows.go cp -v ../net_mirror_windows.go modules/graceful/net_mirror_windows.go
grep -v 'github.com/go-i2p/go-gitlooseleaf' ../go.mod | grep -v 'go 1.2' | grep -v '// indirect' >> go.mod
go mod tidy go mod tidy
make build make build
env: env:
@@ -91,19 +92,20 @@ jobs:
shell: bash shell: bash
run: | run: |
cd forgejo-source cd forgejo-source
ARTIFACT_NAME="gitea-${{ runner.os }}" ARTIFACT_NAME="forgejo-${{ runner.os }}"
ls -lah
if [ "${{ runner.os }}" = "Windows" ]; then if [ "${{ runner.os }}" = "Windows" ]; then
mv gitea.exe "${ARTIFACT_NAME}.exe" mv -v gitea.exe "${ARTIFACT_NAME}.exe"
else else
mv gitea "${ARTIFACT_NAME}" mv -v gitea "${ARTIFACT_NAME}"
fi fi
- name: Upload Build Artifact - name: Upload Build Artifact
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: gitea-${{ runner.os }} name: forgejo-${{ runner.os }}
path: | path: |
forgejo-source/gitea-${{ runner.os }}* forgejo-source/forgejo-${{ runner.os }}*
retention-days: 1 retention-days: 1
release: release:

View File

@@ -1,4 +1,4 @@
name: Forgejo Nightly Build name: Modded Forgejo Nightly Build
on: on:
push: # Run on any push push: # Run on any push
schedule: schedule:
@@ -46,6 +46,7 @@ jobs:
cp -v ../net_mirror_dialer.go modules/graceful/net_mirror_dialer.go cp -v ../net_mirror_dialer.go modules/graceful/net_mirror_dialer.go
cp -v ../net_mirror_unix.go modules/graceful/net_mirror_unix.go cp -v ../net_mirror_unix.go modules/graceful/net_mirror_unix.go
cp -v ../net_mirror_windows.go modules/graceful/net_mirror_windows.go cp -v ../net_mirror_windows.go modules/graceful/net_mirror_windows.go
grep -v 'github.com/go-i2p/go-gitlooseleaf' ../go.mod | grep -v 'go 1.2' | grep -v '// indirect' >> go.mod
go mod tidy go mod tidy
make build make build
env: env:
@@ -57,19 +58,20 @@ jobs:
shell: bash shell: bash
run: | run: |
cd forgejo-source cd forgejo-source
ARTIFACT_NAME="gitea-${{ runner.os }}" ARTIFACT_NAME="forgejo-${{ runner.os }}"
ls -lah
if [ "${{ runner.os }}" = "Windows" ]; then if [ "${{ runner.os }}" = "Windows" ]; then
mv gitea.exe "${ARTIFACT_NAME}.exe" mv -v gitea.exe "${ARTIFACT_NAME}.exe"
else else
mv gitea "${ARTIFACT_NAME}" mv -v gitea "${ARTIFACT_NAME}"
fi fi
- name: Upload Build Artifact - name: Upload Build Artifact
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: gitea-${{ runner.os }} name: forgejo-${{ runner.os }}
path: | path: |
forgejo-source/gitea-${{ runner.os }}* forgejo-source/forgejo-${{ runner.os }}*
retention-days: 1 retention-days: 1
release: release:
@@ -87,11 +89,12 @@ jobs:
uses: ncipollo/release-action@v1 uses: ncipollo/release-action@v1
with: with:
tag: forgejo-nightly tag: forgejo-nightly
name: "Forgejo Nightly Build (${{ steps.date.outputs.date }})" name: "Modded Forgejo Nightly Build (${{ steps.date.outputs.date }})"
body: "Automated nightly build of Forgejo from main branch, built on ${{ steps.date.outputs.date }}" body: "Automated nightly build of modded Forgejo from main branch, built on ${{ steps.date.outputs.date }}"
artifacts: "forgejo-Linux/*, forgejo-Windows/*, forgejo-macOS/*" artifacts: "forgejo-Linux/*, forgejo-Windows/*, forgejo-macOS/*"
draft: false draft: false
prerelease: true prerelease: true
allowUpdates: true allowUpdates: true
removeArtifacts: false removeArtifacts: false
replacesArtifacts: true replacesArtifacts: true
makeLatest: true

View File

@@ -0,0 +1,93 @@
name: Forgejo Nightly Build
on:
push: # Run on any push
schedule:
- cron: '0 0 * * *' # Runs daily at midnight UTC
workflow_dispatch: # Allow manual triggers
permissions:
contents: write # Required for creating releases
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
timeout-minutes: 120 # 2-hour timeout
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.24.3'
cache: true
- name: Setup node.js
uses: actions/setup-node@v3
with:
node-version: '20'
cache: 'npm'
- name: Checkout Forgejo Source
run: |
git clone https://codeberg.org/forgejo/forgejo.git forgejo-source
cd forgejo-source
git checkout forgejo
- name: Build Forgejo
working-directory: forgejo-source
run: |
make clean
make build
env:
TAGS: bindata sqlite sqlite_unlock_notify netgo osusergo
GOFLAGS: -ldflags="-extldflags=-static"
CO_ENABLED: 0
- name: Prepare Artifact
shell: bash
run: |
cd forgejo-source
ARTIFACT_NAME="forgejo-${{ runner.os }}"
ls -lah
if [ "${{ runner.os }}" = "Windows" ]; then
mv -v gitea.exe "${ARTIFACT_NAME}.exe"
else
mv -v gitea "${ARTIFACT_NAME}"
fi
- name: Upload Build Artifact
uses: actions/upload-artifact@v4
with:
name: forgejo-${{ runner.os }}
path: |
forgejo-source/forgejo-${{ runner.os }}*
retention-days: 1
release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download All Artifacts
uses: actions/download-artifact@v4
- name: Get Current Date
id: date
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
- name: Create or Update Nightly Release
uses: ncipollo/release-action@v1
with:
tag: forgejo-nightly-vanilla
name: "Standard Forgejo Nightly Build (${{ steps.date.outputs.date }})"
body: "Automated nightly build of Forgejo from main branch, built on ${{ steps.date.outputs.date }}"
artifacts: "forgejo-Linux/*, forgejo-Windows/*, forgejo-macOS/*"
draft: false
prerelease: true
allowUpdates: true
removeArtifacts: false
replacesArtifacts: true

View File

@@ -79,6 +79,7 @@ jobs:
cp -v ../net_mirror_dialer.go modules/graceful/net_mirror_dialer.go cp -v ../net_mirror_dialer.go modules/graceful/net_mirror_dialer.go
cp -v ../net_mirror_unix.go modules/graceful/net_mirror_unix.go cp -v ../net_mirror_unix.go modules/graceful/net_mirror_unix.go
cp -v ../net_mirror_windows.go modules/graceful/net_mirror_windows.go cp -v ../net_mirror_windows.go modules/graceful/net_mirror_windows.go
grep -v 'github.com/go-i2p/go-gitlooseleaf' ../go.mod | grep -v 'go 1.2' | grep -v '// indirect' >> go.mod
go mod tidy go mod tidy
make build make build
env: env:

85
.github/workflows/gitea-debian.yml vendored Normal file
View File

@@ -0,0 +1,85 @@
# Uses the stable build of Gitea to create a Debian package with pkginstall
# Triggered an hour after the Gitea stable build
# Runs on Ubuntu 22.04
name: Gitea Debian Build
on:
push: # Run on any push
schedule:
- cron: '0 1 * * *' # Runs daily at 1 UTC
workflow_dispatch: # Allow manual triggers
permissions:
contents: write # Required for creating releases
jobs:
build:
strategy:
matrix:
os: [ubuntu-22.04]
runs-on: ${{ matrix.os }}
timeout-minutes: 120 # 2-hour timeout
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.24.3'
cache: true
- name: Get version
id: get_version
run: |
if [[ $GITHUB_REF == refs/tags/* ]]; then
VERSION=${GITHUB_REF#refs/tags/v}
else
VERSION=0.0.1-$(git rev-parse --short HEAD)
fi
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Sleep for 15 minutes
run: sleep 900
- name: Generate pkg contents in "/build"
run: |
sudo BASE=build make install
./pkginstall build \
--name go-gitlooseleaf \
--version ${{ steps.get_version.outputs.version }} \
--maintainer "idk <idk@i2pmail.org>" \
--description "A modded gitea for hidden services" \
--source ./build \
--verbose
- name: Upload Build Artifact
uses: actions/upload-artifact@v4
with:
path: "*.deb"
name: gitea-debian-${{ steps.get_version.outputs.version }}.deb
release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download All Artifacts
uses: actions/download-artifact@v4
- name: Get Current Date
id: date
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
# - name: Update Release
# uses: softprops/action-gh-release@v2
# with:
# tag_name: ${{ needs.check-release.outputs.new_tag }}
# name: "Gitea ${{ needs.check-release.outputs.new_tag }}"
# body: "Automated build of Gitea ${{ needs.check-release.outputs.new_tag }}"
# files: "*.deb"
# draft: false
# prerelease: false
# allowUpdates: true
# removeArtifacts: false
# replacesArtifacts: true

View File

@@ -0,0 +1,83 @@
# Uses the nightly build of Gitea to create a Debian package with pkginstall
# Triggered an hour after the Gitea nightly build
# Runs on Ubuntu 22.04
name: Gitea Nightly Debian Build
on:
push: # Run on any push
schedule:
- cron: '0 1 * * *' # Runs daily at 1 UTC
workflow_dispatch: # Allow manual triggers
permissions:
contents: write # Required for creating releases
jobs:
build:
strategy:
matrix:
os: [ubuntu-22.04]
runs-on: ${{ matrix.os }}
timeout-minutes: 120 # 2-hour timeout
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.24.3'
cache: true
- name: Get version
id: get_version
run: |
if [[ $GITHUB_REF == refs/tags/* ]]; then
VERSION=${GITHUB_REF#refs/tags/v}
else
VERSION=0.0.1-$(git rev-parse --short HEAD)
fi
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Sleep for 15 minutes
run: sleep 900
- name: Generate pkg contents in "/build"
run: |
sudo BASE=build make install
./pkginstall build \
--name go-gitlooseleaf \
--version ${{ steps.get_version.outputs.version }} \
--maintainer "idk <idk@i2pmail.org>" \
--description "A modded gitea for hidden services" \
--source ./build \
--verbose
- name: Upload Build Artifact
uses: actions/upload-artifact@v4
with:
path: "*.deb"
name: gitea-nightly-debian-0.0.1-${{ steps.get_version.outputs.version }}.deb
release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download All Artifacts
uses: actions/download-artifact@v4
- name: Get Current Date
id: date
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
# - name: Create or Update Nightly Release
# uses: ncipollo/release-action@v1
# with:
# tag: nightly
# artifacts: "*.deb"
# draft: false
# prerelease: true
# allowUpdates: true
# removeArtifacts: false
# replacesArtifacts: true

View File

@@ -1,4 +1,4 @@
name: Gitea Nightly Build name: Modded Gitea Nightly Build
on: on:
push: # Run on any push push: # Run on any push
schedule: schedule:
@@ -41,12 +41,13 @@ jobs:
cp -v ../net_mirror_dialer.go modules/graceful/net_mirror_dialer.go cp -v ../net_mirror_dialer.go modules/graceful/net_mirror_dialer.go
cp -v ../net_mirror_unix.go modules/graceful/net_mirror_unix.go cp -v ../net_mirror_unix.go modules/graceful/net_mirror_unix.go
cp -v ../net_mirror_windows.go modules/graceful/net_mirror_windows.go cp -v ../net_mirror_windows.go modules/graceful/net_mirror_windows.go
grep -v 'github.com/go-i2p/go-gitlooseleaf' ../go.mod | grep -v 'go 1.2' | grep -v '// indirect' >> go.mod
go mod tidy go mod tidy
make build make build
env: env:
TAGS: bindata sqlite sqlite_unlock_notify netgo osusergo TAGS: bindata sqlite sqlite_unlock_notify netgo osusergo
GOFLAGS: -ldflags="-extldflags=-static" GOFLAGS: -ldflags="-extldflags=-static"
CO_ENABLED: 0 #CGO_ENABLED: 0
- name: Prepare Artifact - name: Prepare Artifact
shell: bash shell: bash
@@ -82,11 +83,12 @@ jobs:
uses: ncipollo/release-action@v1 uses: ncipollo/release-action@v1
with: with:
tag: nightly tag: nightly
name: "Gitea Nightly Build (${{ steps.date.outputs.date }})" name: "Modded Gitea Nightly Build (${{ steps.date.outputs.date }})"
body: "Automated nightly build of Gitea from main branch, built on ${{ steps.date.outputs.date }}" body: "Automated nightly build of modded Gitea from main branch, built on ${{ steps.date.outputs.date }}"
artifacts: "gitea-Linux/*, gitea-Windows/*, gitea-macOS/*" artifacts: "gitea-Linux/*, gitea-Windows/*, gitea-macOS/*"
draft: false draft: false
prerelease: true prerelease: true
allowUpdates: true allowUpdates: true
removeArtifacts: false removeArtifacts: false
replacesArtifacts: true replacesArtifacts: true
makeLatest: true

View File

@@ -0,0 +1,86 @@
name: Gitea Nightly Build
on:
push: # Run on any push
schedule:
- cron: '0 0 * * *' # Runs daily at midnight UTC
workflow_dispatch: # Allow manual triggers
permissions:
contents: write # Required for creating releases
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
timeout-minutes: 120 # 2-hour timeout
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.24'
cache: true
- name: Checkout Gitea Source
uses: actions/checkout@v4
with:
repository: go-gitea/gitea
ref: main # Always use the latest main branch
path: gitea-source
- name: Build Gitea
working-directory: gitea-source
run: |
make clean
make build
env:
TAGS: bindata sqlite sqlite_unlock_notify netgo osusergo
GOFLAGS: -ldflags="-extldflags=-static"
- name: Prepare Artifact
shell: bash
run: |
cd gitea-source
ARTIFACT_NAME="gitea-${{ runner.os }}"
if [ "${{ runner.os }}" = "Windows" ]; then
mv gitea.exe "${ARTIFACT_NAME}.exe"
else
mv gitea "${ARTIFACT_NAME}"
fi
- name: Upload Build Artifact
uses: actions/upload-artifact@v4
with:
name: gitea-${{ runner.os }}
path: |
gitea-source/gitea-${{ runner.os }}*
retention-days: 1
release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download All Artifacts
uses: actions/download-artifact@v4
- name: Get Current Date
id: date
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
- name: Create or Update Nightly Release
uses: ncipollo/release-action@v1
with:
tag: nightly-vanilla
name: "Standard Gitea Nightly Build (${{ steps.date.outputs.date }})"
body: "Automated nightly build of Gitea from main branch, built on ${{ steps.date.outputs.date }}"
artifacts: "gitea-Linux/*, gitea-Windows/*, gitea-macOS/*"
draft: false
prerelease: true
allowUpdates: true
removeArtifacts: false
replacesArtifacts: true

2
.gitignore vendored
View File

@@ -1 +1 @@
downloads /downloads

134
Makefile
View File

@@ -1,105 +1,99 @@
.PHONY: all download setup-user install-binary install-systemd enable disable uninstall clean help .PHONY: all download setup-user install-binary install-systemd enable disable uninstall clean help
# Installation paths # Installation paths
BINARY_PATH = /usr/local/bin/gitea BINARY_PATH = ${BASE}/usr/local/bin/gitea
SYSTEMD_PATH = /etc/systemd/system SYSTEMD_PATH = ${BASE}/etc/systemd/system
CONFIG_PATH = /etc/gitea CONFIG_PATH = ${BASE}/etc/gitea
DATA_PATH = /var/lib/gitea DATA_PATH = ${BASE}/var/lib/gitea
# Default target # Default target
all: help all: help
help: help:
@echo "GitLooseLeaf - Modified Gitea with multi-protocol support" @echo "GitLooseLeaf - Modified Gitea with multi-protocol support"
@echo "" @echo ""
@echo "Usage:" @echo "Usage:"
@echo " make download - Download the latest gitea binary" @echo " make download - Download the latest gitea binary"
@echo " make setup-user - Create git user and required directories" @echo " make setup-user - Create git user and required directories"
@echo " make install-binary - Install Gitea binary" @echo " make install-binary - Install Gitea binary"
@echo " make install-systemd - Install systemd service files" @echo " make install-systemd - Install systemd service files"
@echo " make enable - Enable and start Gitea service" @echo " make enable - Enable and start Gitea service"
@echo " make disable - Disable and stop Gitea service" @echo " make disable - Disable and stop Gitea service"
@echo " make install - Complete installation (all above steps)" @echo " make install - Complete installation (all above steps)"
@echo " make uninstall - Remove Gitea" @echo " make uninstall - Remove Gitea"
@echo " make clean - Clean up downloaded files" @echo " make clean - Clean up downloaded files"
@echo "" @echo ""
@echo "Note: Many commands require root privileges (use sudo)" @echo "Note: Many commands require root privileges (use sudo)"
# Download latest Gitea binary # Download latest Gitea binary
download: download:
@echo "Downloading latest Gitea binary..." @echo "Downloading latest Gitea binary..."
mkdir -p downloads mkdir -p downloads
GITEA_URL="https://github.com/go-i2p/go-gitlooseleaf/releases/download/nightly/gitea-Linux"; \ GITEA_URL="https://github.com/go-i2p/go-gitlooseleaf/releases/download/nightly/gitea-Linux"; \
wget -O downloads/gitea "$$GITEA_URL" || curl -L -o downloads/gitea "$$GITEA_URL" wget -O downloads/gitea "$$GITEA_URL" || curl -L -o downloads/gitea "$$GITEA_URL"
chmod +x downloads/gitea chmod +x downloads/gitea
# Setup git user and directories # Setup git user and directories
setup-user: setup-user:
@echo "Setting up git user and directories..." @echo "Setting up git user and directories..."
id -u git &>/dev/null || adduser \ ./preinst
--system \ mkdir -p $(BASE)/usr/local/bin
--shell /bin/bash \ mkdir -p $(SYSTEMD_PATH)
--gecos 'Git Version Control' \ mkdir -p $(DATA_PATH)/custom
--group \ mkdir -p $(DATA_PATH)/data
--disabled-password \ mkdir -p $(DATA_PATH)/log
--home /home/git \ mkdir -p $(CONFIG_PATH)
git ./postinst
mkdir -p $(DATA_PATH)/{custom,data,log}
mkdir -p $(CONFIG_PATH)
chown -R git:git $(DATA_PATH)/
chmod -R 750 $(DATA_PATH)/
chown root:git $(CONFIG_PATH)
chmod 770 $(CONFIG_PATH)
# Install Gitea binary # Install Gitea binary
install-binary: download install-binary: download
@echo "Installing Gitea binary..." @echo "Installing Gitea binary..."
cp downloads/gitea $(BINARY_PATH) cp downloads/gitea $(BINARY_PATH)
chmod +x $(BINARY_PATH) chmod +x $(BINARY_PATH)
setcap CAP_NET_BIND_SERVICE=+eip $(BINARY_PATH) setcap CAP_NET_BIND_SERVICE=+eip $(BINARY_PATH)
# Install systemd service files # Install systemd service files
install-systemd: install-systemd:
@echo "Installing systemd service files..." @echo "Installing systemd service files..."
mkdir -p $(SYSTEMD_PATH)/gitea.service.d mkdir -p $(SYSTEMD_PATH)/gitea.service.d
cp etc/systemd/system/gitea.service $(SYSTEMD_PATH)/ cp etc/systemd/system/gitea.service $(SYSTEMD_PATH)/
cp etc/systemd/system/gitea.service.d/user-config.conf $(SYSTEMD_PATH)/gitea.service.d/ cp etc/systemd/system/gitea.service.d/user-config.conf $(SYSTEMD_PATH)/gitea.service.d/
systemctl daemon-reload systemctl daemon-reload
# Enable and start Gitea service # Enable and start Gitea service
enable: enable:
@echo "Enabling and starting Gitea service..." @echo "Enabling and starting Gitea service..."
systemctl enable gitea.service systemctl enable gitea.service
systemctl start gitea.service systemctl start gitea.service
@echo "Gitea service started successfully!" @echo "Gitea service started successfully!"
@echo "Please configure your email in $(SYSTEMD_PATH)/gitea.service.d/user-config.conf" @echo "Please configure your email in $(SYSTEMD_PATH)/gitea.service.d/user-config.conf"
@echo "Then restart with: systemctl restart gitea.service" @echo "Then restart with: systemctl restart gitea.service"
# Disable and stop Gitea service # Disable and stop Gitea service
disable: disable:
@echo "Disabling and stopping Gitea service..." @echo "Disabling and stopping Gitea service..."
systemctl disable gitea.service systemctl disable gitea.service
systemctl stop gitea.service systemctl stop gitea.service
# Complete installation # Complete installation
install: setup-user install-binary install-systemd enable install: setup-user install-binary install-systemd enable
@echo "Installation complete!" @echo "Installation complete!"
@echo "You can now access Gitea at:" @echo "You can now access Gitea at:"
@echo "- HTTPS: https://$(shell hostname):3000" @echo "- HTTPS: https://$(shell hostname):3000"
@echo "- I2P/Tor: Check logs for actual addresses: journalctl -u gitea" @echo "- I2P/Tor: Check logs for actual addresses: journalctl -u gitea"
# Uninstall Gitea # Uninstall Gitea
uninstall: disable uninstall: disable
@echo "Uninstalling Gitea..." @echo "Uninstalling Gitea..."
rm -f $(BINARY_PATH) rm -f $(BINARY_PATH)
rm -f $(SYSTEMD_PATH)/gitea.service rm -f $(SYSTEMD_PATH)/gitea.service
rm -rf $(SYSTEMD_PATH)/gitea.service.d rm -rf $(SYSTEMD_PATH)/gitea.service.d
systemctl daemon-reload systemctl daemon-reload
@echo "Gitea has been uninstalled." @echo "Gitea has been uninstalled."
@echo "Note: User and data directories were not removed." @echo "Note: User and data directories were not removed."
@echo "To completely remove, delete: $(CONFIG_PATH) and $(DATA_PATH)" @echo "To completely remove, delete: $(CONFIG_PATH) and $(DATA_PATH)"
# Clean up # Clean up
clean: clean:
@echo "Cleaning up..." @echo "Cleaning up..."
rm -rf downloads rm -rf downloads

118
README.md
View File

@@ -1,40 +1,34 @@
# go-gitlooseleaf # go-gitlooseleaf
A soft-fork of Gitea that enables simultaneous multi-protocol access via standard TLS, I2P, and Tor onion services. This repository contains only the network interface modules and CI configuration needed to build custom Gitea binaries. A soft-fork of Gitea that enables simultaneous multi-protocol access via standard TLS, I2P, and Tor onion services. This project enhances access to Gitea repositories across diverse network environments without compromising core functionality.
## Features
- **Multi-Protocol Access**: Access your Gitea instance simultaneously through:
- Standard HTTPS/TLS connections
- I2P (Invisible Internet Project) network
- Tor onion services
- **Complete Protocol Support**: All Git operations work seamlessly across all networks:
- Web interface for browsing and management
- Git operations over HTTPS
- Git operations over SSH (when using Gitea's built-in SSH server)
- **Minimal Configuration**: Requires minimal changes to standard Gitea setup
- **Censorship Resistance**: Maintains repository availability even when specific networks are blocked
## How It Works ## How It Works
This project leverages GitHub Actions to automatically build a modified version of Gitea that can simultaneously serve content over multiple protocols: go-gitlooseleaf leverages Gitea's modular network architecture to enable multi-protocol access without modifying the core codebase. The implementation replaces Gitea's network interfaces with protocol-aware alternatives:
- Standard HTTPS/TLS connections
- I2P (Invisible Internet Project) network
- Tor onion services
The beauty of this approach is that it requires no changes to Gitea's core codebase, as Gitea intelligently encapsulates network operations through abstraction: 1. **Network Listeners**: Gitea uses `graceful.GetListener()` (defined in `modules/graceful/server.go`) for all incoming connections, which we replace with our multi-protocol implementation
2. **Automatic Protocol Detection**: The system automatically detects and routes connections through the appropriate protocol
1. **Network Listeners**: Gitea uses `graceful.GetListener()` (defined in `modules/graceful/server.go`) for all incoming connections 3. **Rate Limiting**: Built-in protection against excessive connection attempts
2. **Network Clients**: Gitea's HTTP client connections can be configured with custom transport implementations
We take advantage of these abstractions by replacing the default implementations with our multi-protocol versions during the build process.
## Implementation Details ## Implementation Details
The network listener replacement works because Gitea's default `GetListener()` implementations (`DefaultGetListener()`) are defined in platform-specific files: The network listener replacement works by providing a custom implementation of Gitea's `GetListener()` function:
- `modules/graceful/net_unix.go` for Unix-like systems
- `modules/graceful/net_windows.go` for Windows
Our implementation introduces a `MultiGetListener()` function that handles TLS, I2P, and Tor connections using the `go-meta-listener` package, while still supporting Unix sockets for internal functions.
Similarly, we replace the default HTTP client with a version that can route traffic through the appropriate network (TLS, I2P, or Tor) based on the destination.
## Current Implementation
The current implementation in `net_mirror.go` uses:
- `go-meta-listener/mirror` for listening on multiple protocols
- Rate limiting through `go-i2p/go-limit`
- Environment variables (`EMAIL`, `HOSTNAME`) for configuration
```go ```go
// This implements the GetListener function for TLS, I2P, and Onion // MultiGetListener handles connections across TLS, I2P, and Tor
func MultiGetListener(network, address string) (net.Listener, error) { func MultiGetListener(network, address string) (net.Listener, error) {
// Support for Unix sockets remains unchanged // Support for Unix sockets remains unchanged
if network == "unix" || network == "unixpacket" { if network == "unix" || network == "unixpacket" {
@@ -51,7 +45,7 @@ func MultiGetListener(network, address string) (net.Listener, error) {
return nil, err return nil, err
} }
// Apply rate limiting // Apply rate limiting for protection
return limitedlistener.NewLimitedListener(ml, return limitedlistener.NewLimitedListener(ml,
limitedlistener.WithMaxConnections(500), // concurrent connections limitedlistener.WithMaxConnections(500), // concurrent connections
limitedlistener.WithRateLimit(24), // connections per second limitedlistener.WithRateLimit(24), // connections per second
@@ -59,20 +53,41 @@ func MultiGetListener(network, address string) (net.Listener, error) {
} }
``` ```
## Usage Caveats ## Configuration
While the HTTP interface works seamlessly across all three protocols, other Gitea communication channels require additional configuration: ### Basic Setup
1. **SMTP Client**: If configured, email connections from Gitea will need proper routing: 1. **Environment Variables**:
- For I2P: Use local ports like `127.0.0.1:7659/7660`
- For Tor: Configure appropriate SOCKS proxy settings
2. **SSH Connections**: Git operations over SSH require additional configuration to properly route through anonymity networks. These settings depend on your specific deployment environment.
3. **Environment Variables**:
- `EMAIL`: Used for TLS certificate generation (required for HTTPS) - `EMAIL`: Used for TLS certificate generation (required for HTTPS)
- `HOSTNAME`: Server hostname (defaults to local machine name if not set) - `HOSTNAME`: Server hostname (defaults to local machine name if not set)
2. **Gitea Configuration** (app.ini):
```ini
[server]
START_SSH_SERVER = true # Enable built-in SSH server for multi-protocol SSH support
SSH_PORT = 22 # Must end with "22" for automatic SSH mirroring (e.g., 22, 2222, 10022)
```
### Network Addresses
Your Gitea instance will be available at:
- HTTPS: `https://yourdomain.com`
- Tor: `http://youronionaddress.onion` (automatically generated)
- I2P: `http://youri2paddress.i2p` (automatically generated)
Access using Git clients:
```bash
# Clone via HTTPS
git clone https://yourdomain.com/username/repo.git
git clone http://youronionaddress.onion/username/repo.git
git clone http://youri2paddress.i2p/username/repo.git
# Clone via SSH (when using built-in SSH server)
git clone git@yourdomain.com:username/repo.git
git clone git@youronionaddress.onion:username/repo.git
git clone git@youri2paddress.i2p:username/repo.git
```
## Installation ## Installation
You can: You can:
@@ -80,8 +95,37 @@ You can:
2. Use the included `install.sh` script to set up a system service 2. Use the included `install.sh` script to set up a system service
3. Build from source using the GitHub Actions workflows as a reference 3. Build from source using the GitHub Actions workflows as a reference
## Use Cases
- **Self-hosting enthusiasts**: Offer your personal Git repositories through multiple networks with a single installation
- **Code hobbyists**: Share your projects with friends regardless of their network constraints or preferences
- **Organizations in regions with network restrictions**: Ensure repository access despite local network limitations
- **Open source projects**: Maximize availability of your codebase to contributors worldwide
- **Educational institutions**: Provide consistent access to course materials and student repositories
- **Privacy-conscious development**: Enable contribution without requiring standard TLS connections
## FAQ
**Q: Does this affect Gitea's performance?**
A: There is minimal performance impact for standard TLS connections. I2P and Tor connections will have the typical latency associated with these networks.
**Q: How do I view my .onion and .i2p addresses?**
A: After starting the service, addresses are displayed in the logs and stored in `./certs/hostname.onion` and `./certs/hostname.i2p`.
**Q: Can users have different identities on different protocols?**
A: No, user accounts are shared across all protocols. This is an availability enhancement, not an anonymity solution.
**Q: Is this compatible with Gitea upgrades?**
A: Each version is built against a specific Gitea release. Check the releases page for compatibility information.
**Q: Do I need to run Tor and I2P services separately?**
A: Yes, you need to run Tor and I2P routers.
**Q: Why must the SSH port end with "22"?**
A: The automatic protocol detection for SSH connections relies on recognizing the port number pattern. Any port ending in "22" (such as 22, 2222, 10022) will work correctly.
## License ## License
Both this modification and Gitea itself are licensed under the MIT license. Both this modification and Gitea itself are licensed under the MIT license.
- See [LICENSE](LICENSE) for this project's license - See [LICENSE](LICENSE) for this project's license
- See [LICENSE-gitea.md](LICENSE-gitea.md) for the Gitea license from https://github.com/go-gitea/gitea - See [LICENSE-gitea.md](LICENSE-gitea.md) for the Gitea license

722
eval.md Normal file
View File

@@ -0,0 +1,722 @@
Project Path: /home/idk/go/src/github.com/go-i2p/go-gitlooseleaf
Source Tree:
```
go-gitlooseleaf
├── go.sum
├── net_mirror.go
├── net_mirror_dialer.go
├── go.mod
├── LICENSE
├── postinst
├── download.sh
├── net_mirror_unix.go
├── env.sh
├── etc
│ └── systemd
│ └── system
│ ├── gitea.service
│ └── gitea.service.d
│ └── user-config.conf
├── package-lock.json
├── preinst
├── README.md
├── Makefile
├── net_mirror_windows.go
├── install.sh
└── LICENSE-gitea.md
```
`/home/idk/go/src/github.com/go-i2p/go-gitlooseleaf/go.sum`:
```````sum
github.com/cretz/bine v0.2.0 h1:8GiDRGlTgz+o8H9DSnsl+5MeBK4HsExxgl6WgzOCuZo=
github.com/cretz/bine v0.2.0/go.mod h1:WU4o9QR9wWp8AVKtTM1XD5vUHkEqnf2vVSo6dBqbetI=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/go-i2p/go-limit v0.0.0-20250203203118-210616857c15 h1:ASjMbwlepoDQfrhv+H2B5ICBPJU5ES1JzmOxzPDx3YQ=
github.com/go-i2p/go-limit v0.0.0-20250203203118-210616857c15/go.mod h1:4jjmVRhvKj47sQ6B6wdDhN1IrEZunE6KwkYLQx/BeVE=
github.com/go-i2p/go-meta-dialer v0.0.0-20250501024057-715e91be3cfe h1:9Rxw2KtMCRKZHI4WavUAaatzKmc64V6kiYvcyTMHjeU=
github.com/go-i2p/go-meta-dialer v0.0.0-20250501024057-715e91be3cfe/go.mod h1:++xHSOvnGymRSyFbi9A9hztcfwKfU6/nJAtVxrNo8Zo=
github.com/go-i2p/go-meta-listener v0.0.5-0.20250521170131-2058a4309616 h1:EDx3FrzeGSjtYiH6GAF/lKNseNVDDHqR2OY/hQfiOqo=
github.com/go-i2p/go-meta-listener v0.0.5-0.20250521170131-2058a4309616/go.mod h1:wF/MCCfB40gZyT9WtuYWQkUOPrnoTzA+NG0zpsy3s4M=
github.com/go-i2p/i2pkeys v0.0.0-20241108200332-e4f5ccdff8c4/go.mod h1:m5TlHjPZrU5KbTd7Lr+I2rljyC6aJ88HdkeMQXV0U0E=
github.com/go-i2p/i2pkeys v0.33.92 h1:e2vx3vf7tNesaJ8HmAlGPOcfiGM86jzeIGxh27I9J2Y=
github.com/go-i2p/i2pkeys v0.33.92/go.mod h1:BRURQ/twxV0WKjZlFSKki93ivBi+MirZPWudfwTzMpE=
github.com/go-i2p/onramp v0.33.92 h1:Dk3A0SGpdEw829rSjW2LqN8o16pUvuhiN0vn36z7Gpc=
github.com/go-i2p/onramp v0.33.92/go.mod h1:5sfB8H2xk05gAS2K7XAUZ7ekOfwGJu3tWF0fqdXzJG4=
github.com/go-i2p/sam3 v0.33.92 h1:TVpi4GH7Yc7nZBiE1QxLjcZfnC4fI/80zxQz1Rk36BA=
github.com/go-i2p/sam3 v0.33.92/go.mod h1:oDuV145l5XWKKafeE4igJHTDpPwA0Yloz9nyKKh92eo=
github.com/opd-ai/wileedot v0.0.0-20241217172720-521d4175e624 h1:FXCTQV93+31Yj46zpYbd41es+EYgT7qi4RK6KSVrGQM=
github.com/opd-ai/wileedot v0.0.0-20241217172720-521d4175e624/go.mod h1:ftKSvvGC9FnxZeuL3B4MB6q/DOzVSV0kET08YUyDwbM=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8=
golang.org/x/crypto v0.38.0 h1:jt+WWG8IZlBnVbomuhg2Mdq0+BBQaHbtqHEFEigjUV8=
golang.org/x/crypto v0.38.0/go.mod h1:MvrbAqul58NNYPKnOra203SB9vpuZW0e+RRZV+Ggqjw=
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.40.0 h1:79Xs7wF06Gbdcg4kdCCIQArK11Z1hr5POQ6+fIYHNuY=
golang.org/x/net v0.40.0/go.mod h1:y0hY0exeL2Pku80/zKK7tpntoX23cqL3Oa6njdgRtds=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw=
golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.25.0 h1:qVyWApTSYLk/drJRO5mDlNYskwQznZmkpV2c8q9zls4=
golang.org/x/text v0.25.0/go.mod h1:WEdwpYrmk1qmdHvhkSTNPm3app7v4rsT8F2UD6+VHIA=
golang.org/x/time v0.11.0 h1:/bpjEDfN9tkoN/ryeYHnv5hcMlc8ncjMcM4XBk5NWV0=
golang.org/x/time v0.11.0/go.mod h1:CDIdPxbZBQxdj6cxyCIdrNogrJKMJ7pr37NYpMcMDSg=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
```````
`/home/idk/go/src/github.com/go-i2p/go-gitlooseleaf/net_mirror.go`:
```````go
// copy this file to modules/graceful/net_anon.go before building gitea
package graceful
import (
"fmt"
"log"
"net"
"net/http"
"os"
"github.com/go-i2p/go-meta-listener/mirror"
limitedlistener "github.com/go-i2p/go-limit"
)
func hostname() string {
hostname := os.Getenv("HOSTNAME")
if hostname == "" {
// get the local hostname
// this is a fallback for when the HOSTNAME environment variable is not set
hostname, err := os.Hostname()
if err != nil {
log.Printf("Warning: %s", err)
}
if hostname == "" {
// this is a fallback for when the hostname is not set
hostname = "localhost"
}
}
return hostname
}
var mirrorListener, mirrorErr = mirror.NewMirror(hostname())
// This implements the GetListener function for TLS, I2P, and Onion. Note the exemption for Unix sockets.
func MultiGetListener(network, address string) (net.Listener, error) {
if mirrorErr != nil {
return nil, mirrorErr
}
EMAIL := os.Getenv("EMAIL")
if EMAIL == "" {
log.Printf("Warning: %s", fmt.Errorf("EMAIL environment variable not set, TLS not possible"))
} else {
log.Printf("Using %s as email for TLS", EMAIL)
}
// Add a deferral to say that we've tried to grab a listener
defer GetManager().InformCleanup()
switch network {
case "unix", "unixpacket":
// I2P isn't really a replacement for the stuff you use Unix sockets for and it's also not an anonymity risk, so treat them normally
unixAddr, err := ResolveUnixAddr(network, address)
if err != nil {
return nil, err
}
return GetListenerUnixWrapper(network, unixAddr)
default:
ml, err := mirrorListener.Listen(address, EMAIL, "./certs", true)
if err != nil {
return nil, err
}
return limitedlistener.NewLimitedListener(ml,
limitedlistener.WithMaxConnections(500), // max concurrent
limitedlistener.WithRateLimit(24), // per second
), nil
}
}
// We use `init() to ensure that the appropriate Listeners and Dialers are correctly placed at runtime
func init() {
GetListener = MultiGetListener
httpClient := &http.Client{
Transport: &http.Transport{
Dial: Dial,
},
}
http.DefaultClient = httpClient
http.DefaultTransport = httpClient.Transport
}
```````
`/home/idk/go/src/github.com/go-i2p/go-gitlooseleaf/net_mirror_dialer.go`:
```````go
package graceful
import (
"net"
metadialer "github.com/go-i2p/go-meta-dialer"
)
func Dial(network, addr string) (net.Conn, error) {
if metadialer.ANON {
metadialer.ANON = false
}
return metadialer.Dial(network, addr)
}
```````
`/home/idk/go/src/github.com/go-i2p/go-gitlooseleaf/go.mod`:
```````mod
require (
github.com/go-i2p/go-limit v0.0.0-20250203203118-210616857c15
github.com/go-i2p/go-meta-dialer v0.0.0-20250501024057-715e91be3cfe
github.com/go-i2p/go-meta-listener v0.0.5
)
require (
github.com/cretz/bine v0.2.0 // indirect
github.com/go-i2p/i2pkeys v0.33.92 // indirect
github.com/go-i2p/onramp v0.33.92 // indirect
github.com/go-i2p/sam3 v0.33.92 // indirect
github.com/opd-ai/wileedot v0.0.0-20241217172720-521d4175e624 // indirect
)
```````
`/home/idk/go/src/github.com/go-i2p/go-gitlooseleaf/LICENSE`:
```````
MIT License
Copyright (c) 2025 I2P For Go
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.
```````
`/home/idk/go/src/github.com/go-i2p/go-gitlooseleaf/postinst`:
```````
# only if we're root
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root" 1>&2
exit 1
fi
BINARY_PATH=${BASE}/usr/local/bin/gitea
SYSTEMD_PATH=${BASE}/etc/systemd/system
CONFIG_PATH=${BASE}/etc/gitea
DATA_PATH=${BASE}/var/lib/gitea
echo chown -R git:git "$DATA_PATH/"
echo chmod -R 750 "$DATA_PATH/"
echo chown root:git "$CONFIG_PATH"
echo chmod 770 "$CONFIG_PATH"
```````
`/home/idk/go/src/github.com/go-i2p/go-gitlooseleaf/download.sh`:
```````sh
#!/bin/bash
# Set GitHub repo info
OWNER="go-i2p"
REPO="go-gittisane"
echo "Fetching latest release info from GitHub..."
# Get latest release data
RELEASE_DATA=$(curl -s "https://api.github.com/repos/$OWNER/$REPO/releases/latest")
# Extract version number
VERSION=$(echo "$RELEASE_DATA" | grep -Po '"tag_name": "\K.*?(?=")')
echo "Latest version: $VERSION"
# Create downloads directory
mkdir -p downloads
cd downloads
# Download each asset
echo "$RELEASE_DATA" | grep -Po '"browser_download_url": "\K.*?(?=")' | while read -r url; do
filename=$(basename "$url")
echo "Downloading $filename..."
curl -L -o "$filename" "$url"
# Make Linux/macOS binaries executable
if [[ "$filename" != *".exe" ]]; then
chmod +x "$filename"
fi
done
echo "Download complete! Files are in the 'downloads' directory"
```````
`/home/idk/go/src/github.com/go-i2p/go-gitlooseleaf/net_mirror_unix.go`:
```````go
// Copyright 2019 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT
// This code is heavily inspired by the archived gofacebook/gracenet/net.go handler
//go:build !windows
package graceful
import (
"fmt"
"net"
)
func ResolveUnixAddr(network, address string) (net.Addr, error) {
switch network {
case "unix", "unixpacket":
return net.ResolveUnixAddr(network, address)
default:
return nil, fmt.Errorf("unknown network type %s", network)
}
}
func GetListenerUnixWrapper(network string, addr net.Addr) (net.Listener, error) {
switch addr.(type) {
case *net.UnixAddr:
return GetListenerUnix(network, addr.(*net.UnixAddr))
default:
return nil, fmt.Errorf("unknown address type %T", addr)
}
}
```````
`/home/idk/go/src/github.com/go-i2p/go-gitlooseleaf/env.sh`:
```````sh
#! /usr/bin/env bash
cd downloads
export HOSTNAME=localhost
export GITEA_WORK_DIR=$(pwd)
export GITEA_CUSTOM="$GITEA_WORK_DIR/custom"
./gitea web --config app.ini
```````
`/home/idk/go/src/github.com/go-i2p/go-gitlooseleaf/etc/systemd/system/gitea.service`:
```````service
[Unit]
Description=Gitea (Modified with multi-protocol TLS/I2P/Tor support)
Documentation=https://github.com/go-i2p/go-gitlooseleaf
After=network.target postgresql.service mysql.service mariadb.service
Wants=network.target
[Service]
Type=simple
User=git
Group=git
WorkingDirectory=/home/git
ExecStart=/usr/local/bin/gitea web --config /etc/gitea/app.ini
Restart=always
RestartSec=10
Environment=USER=git HOME=/home/git GITEA_WORK_DIR=/var/lib/gitea
# Hardening measures
ProtectSystem=full
PrivateTmp=true
PrivateDevices=true
NoNewPrivileges=true
ReadWritePaths=/var/lib/gitea /etc/gitea /home/git
AmbientCapabilities=CAP_NET_BIND_SERVICE
# Load user-modifiable configuration from drop-in directory
# This will automatically include all .conf files in gitea.service.d/
[Install]
WantedBy=multi-user.target
```````
`/home/idk/go/src/github.com/go-i2p/go-gitlooseleaf/etc/systemd/system/gitea.service.d/user-config.conf`:
```````conf
[Service]
# User-configurable environment variables for multi-protocol support
# Required for TLS certificate generation - CHANGE THIS!
Environment="EMAIL=your-email@example.com"
# Optional: Set explicit hostname (defaults to system hostname if not set)
# Environment="HOSTNAME=your-hostname"
# Optional: Performance tuning
# Environment="MAX_CONNECTIONS=500"
# Environment="RATE_LIMIT=24"
# Optional: Certificate directory
# Environment="CERT_DIR=/var/lib/gitea/certs"
# Optional: Additional environment variables for database, etc.
# Environment="GITEA_DATABASE_TYPE=postgres"
# Environment="GITEA_DATABASE_HOST=localhost:5432"
# Environment="GITEA_DATABASE_NAME=gitea"
# Environment="GITEA_DATABASE_USER=gitea"
# Environment="GITEA_DATABASE_PASSWD=gitea"
```````
`/home/idk/go/src/github.com/go-i2p/go-gitlooseleaf/preinst`:
```````
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root" 1>&2
exit 1
fi
BINARY_PATH=${BASE}/usr/local/bin/gitea
SYSTEMD_PATH=${BASE}/etc/systemd/system
CONFIG_PATH=${BASE}/etc/gitea
DATA_PATH=${BASE}/var/lib/gitea
echo "id -u git &>/dev/null || adduser \
--system \
--shell /bin/bash \
--gecos 'Git Version Control' \
--group \
--disabled-password \
--home /home/git \
git"
```````
`/home/idk/go/src/github.com/go-i2p/go-gitlooseleaf/README.md`:
```````md
# go-gitlooseleaf
A soft-fork of Gitea that enables simultaneous multi-protocol access via standard TLS, I2P, and Tor onion services. This repository contains only the network interface modules and CI configuration needed to build custom Gitea binaries.
## How It Works
This project leverages GitHub Actions to automatically build a modified version of Gitea that can simultaneously serve content over multiple protocols:
- Standard HTTPS/TLS connections
- I2P (Invisible Internet Project) network
- Tor onion services
The beauty of this approach is that it requires no changes to Gitea's core codebase, as Gitea intelligently encapsulates network operations through abstraction:
1. **Network Listeners**: Gitea uses `graceful.GetListener()` (defined in `modules/graceful/server.go`) for all incoming connections
2. **Network Clients**: Gitea's HTTP client connections can be configured with custom transport implementations
We take advantage of these abstractions by replacing the default implementations with our multi-protocol versions during the build process.
## Implementation Details
The network listener replacement works because Gitea's default `GetListener()` implementations (`DefaultGetListener()`) are defined in platform-specific files:
- `modules/graceful/net_unix.go` for Unix-like systems
- `modules/graceful/net_windows.go` for Windows
Our implementation introduces a `MultiGetListener()` function that handles TLS, I2P, and Tor connections using the `go-meta-listener` package, while still supporting Unix sockets for internal functions.
Similarly, we replace the default HTTP client with a version that can route traffic through the appropriate network (TLS, I2P, or Tor) based on the destination.
## Current Implementation
The current implementation in `net_mirror.go` uses:
- `go-meta-listener/mirror` for listening on multiple protocols
- Rate limiting through `go-i2p/go-limit`
- Environment variables (`EMAIL`, `HOSTNAME`) for configuration
```go
// This implements the GetListener function for TLS, I2P, and Onion
func MultiGetListener(network, address string) (net.Listener, error) {
// Support for Unix sockets remains unchanged
if network == "unix" || network == "unixpacket" {
unixAddr, err := ResolveUnixAddr(network, address)
if err != nil {
return nil, err
}
return GetListenerUnixWrapper(network, unixAddr)
}
// For TCP connections, create a multi-protocol mirror listener
ml, err := mirrorListener.Listen(address, os.Getenv("EMAIL"), "./certs", true)
if err != nil {
return nil, err
}
// Apply rate limiting
return limitedlistener.NewLimitedListener(ml,
limitedlistener.WithMaxConnections(500), // concurrent connections
limitedlistener.WithRateLimit(24), // connections per second
), nil
}
```
## Usage Caveats
While the HTTP interface works seamlessly across all three protocols, other Gitea communication channels require additional configuration:
1. **SMTP Client**: If configured, email connections from Gitea will need proper routing:
- For I2P: Use local ports like `127.0.0.1:7659/7660`
- For Tor: Configure appropriate SOCKS proxy settings
2. **SSH Connections**: Git operations over SSH require additional configuration to properly route through anonymity networks. These settings depend on your specific deployment environment.
3. **Environment Variables**:
- `EMAIL`: Used for TLS certificate generation (required for HTTPS)
- `HOSTNAME`: Server hostname (defaults to local machine name if not set)
## Installation
You can:
1. Download prebuilt binaries from the [releases page](https://github.com/go-i2p/go-gitlooseleaf/releases)
2. Use the included `install.sh` script to set up a system service
3. Build from source using the GitHub Actions workflows as a reference
## License
Both this modification and Gitea itself are licensed under the MIT license.
- See [LICENSE](LICENSE) for this project's license
- See [LICENSE-gitea.md](LICENSE-gitea.md) for the Gitea license from https://github.com/go-gitea/gitea
```````
`/home/idk/go/src/github.com/go-i2p/go-gitlooseleaf/Makefile`:
```````
.PHONY: all download setup-user install-binary install-systemd enable disable uninstall clean help
# Installation paths
BINARY_PATH = ${BASE}/usr/local/bin/gitea
SYSTEMD_PATH = ${BASE}/etc/systemd/system
CONFIG_PATH = ${BASE}/etc/gitea
DATA_PATH = ${BASE}/var/lib/gitea
# Default target
all: help
help:
@echo "GitLooseLeaf - Modified Gitea with multi-protocol support"
@echo ""
@echo "Usage:"
@echo " make download - Download the latest gitea binary"
@echo " make setup-user - Create git user and required directories"
@echo " make install-binary - Install Gitea binary"
@echo " make install-systemd - Install systemd service files"
@echo " make enable - Enable and start Gitea service"
@echo " make disable - Disable and stop Gitea service"
@echo " make install - Complete installation (all above steps)"
@echo " make uninstall - Remove Gitea"
@echo " make clean - Clean up downloaded files"
@echo ""
@echo "Note: Many commands require root privileges (use sudo)"
# Download latest Gitea binary
download:
@echo "Downloading latest Gitea binary..."
mkdir -p downloads
GITEA_URL="https://github.com/go-i2p/go-gitlooseleaf/releases/download/nightly/gitea-Linux"; \
wget -O downloads/gitea "$$GITEA_URL" || curl -L -o downloads/gitea "$$GITEA_URL"
chmod +x downloads/gitea
# Setup git user and directories
setup-user:
@echo "Setting up git user and directories..."
./preinst
mkdir -p $(DATA_PATH)/custom
mkdir -p $(DATA_PATH)/data
mkdir -p $(DATA_PATH)/log
mkdir -p $(CONFIG_PATH)
./postinst
# Install Gitea binary
install-binary: download
@echo "Installing Gitea binary..."
cp downloads/gitea $(BINARY_PATH)
chmod +x $(BINARY_PATH)
setcap CAP_NET_BIND_SERVICE=+eip $(BINARY_PATH)
# Install systemd service files
install-systemd:
@echo "Installing systemd service files..."
mkdir -p $(SYSTEMD_PATH)/gitea.service.d
cp etc/systemd/system/gitea.service $(SYSTEMD_PATH)/
cp etc/systemd/system/gitea.service.d/user-config.conf $(SYSTEMD_PATH)/gitea.service.d/
systemctl daemon-reload
# Enable and start Gitea service
enable:
@echo "Enabling and starting Gitea service..."
systemctl enable gitea.service
systemctl start gitea.service
@echo "Gitea service started successfully!"
@echo "Please configure your email in $(SYSTEMD_PATH)/gitea.service.d/user-config.conf"
@echo "Then restart with: systemctl restart gitea.service"
# Disable and stop Gitea service
disable:
@echo "Disabling and stopping Gitea service..."
systemctl disable gitea.service
systemctl stop gitea.service
# Complete installation
install: setup-user install-binary install-systemd enable
@echo "Installation complete!"
@echo "You can now access Gitea at:"
@echo "- HTTPS: https://$(shell hostname):3000"
@echo "- I2P/Tor: Check logs for actual addresses: journalctl -u gitea"
# Uninstall Gitea
uninstall: disable
@echo "Uninstalling Gitea..."
rm -f $(BINARY_PATH)
rm -f $(SYSTEMD_PATH)/gitea.service
rm -rf $(SYSTEMD_PATH)/gitea.service.d
systemctl daemon-reload
@echo "Gitea has been uninstalled."
@echo "Note: User and data directories were not removed."
@echo "To completely remove, delete: $(CONFIG_PATH) and $(DATA_PATH)"
# Clean up
clean:
@echo "Cleaning up..."
rm -rf downloads
```````
`/home/idk/go/src/github.com/go-i2p/go-gitlooseleaf/net_mirror_windows.go`:
```````go
// Copyright 2019 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT
// This code is heavily inspired by the archived gofacebook/gracenet/net.go handler
//go:build windows
package graceful
import "net"
func ResolveUnixAddr(network, address string) (net.Addr, error) {
switch network {
case "unix", "unixpacket":
return net.ResolveUnixAddr(network, address)
case "tcp", "tcp4", "tcp6":
return net.ResolveTCPAddr(network, address)
case "udp", "udp4", "udp6":
return net.ResolveUDPAddr(network, address)
default:
return nil, net.UnknownNetworkError(network)
}
}
func GetListenerUnixWrapper(network string, addr net.Addr) (net.Listener, error) {
return net.Listen(network, addr.String())
}
```````
`/home/idk/go/src/github.com/go-i2p/go-gitlooseleaf/install.sh`:
```````sh
#! /usr/bin/env sh
# AS ROOT
adduser \
--system \
--shell /bin/bash \
--gecos 'Git Version Control' \
--group \
--disabled-password \
--home /home/git \
git
mkdir -p /var/lib/gitea/{custom,data,log}
chown -R git:git /var/lib/gitea/
chmod -R 750 /var/lib/gitea/
mkdir /etc/gitea
chown root:git /etc/gitea
chmod 770 /etc/gitea
killall gitea
sleep 3s
GITEA_URL=https://github.com/go-i2p/go-gitlooseleaf/releases/download/nightly/gitea-Linux
wget -O /usr/local/bin/gitea "$GITEA_URL"
chmod +x /usr/local/bin/gitea
setcap CAP_NET_BIND_SERVICE=+eip /usr/local/bin/gitea
su - git
```````
`/home/idk/go/src/github.com/go-i2p/go-gitlooseleaf/LICENSE-gitea.md`:
```````md
Copyright (c) 2016 The Gitea Authors
Copyright (c) 2015 The Gogs Authors
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.
```````

53
go.mod
View File

@@ -1,27 +1,52 @@
module github.com/go-i2p/go-gittisane module github.com/go-i2p/go-gitlooseleaf
go 1.24.2 go 1.24.2
require ( require (
github.com/go-i2p/go-limit v0.0.0-20250203203118-210616857c15 code.gitea.io/gitea v1.24.3
github.com/go-i2p/go-meta-dialer v0.0.0-20250501024057-715e91be3cfe github.com/go-i2p/go-limit v0.0.0-20250718212214-52e5c6fec5d8
github.com/go-i2p/go-meta-listener v0.0.4-0.20250505194551-6b30e62ee419 github.com/go-i2p/go-meta-dialer v0.0.0-20250527012419-b550471a50a5
github.com/go-i2p/go-meta-listener v0.0.8-0.20250722005411-61419dc4a141
github.com/go-i2p/go-select-cache v0.0.0-20250722003334-fba8c5bb610f
) )
require ( require (
github.com/42wim/httpsig v1.2.3 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/cretz/bine v0.2.0 // indirect github.com/cretz/bine v0.2.0 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
github.com/go-i2p/i2pkeys v0.33.10-0.20241113193422-e10de5e60708 // indirect github.com/dustin/go-humanize v1.0.1 // indirect
github.com/go-i2p/i2pkeys v0.33.92 // indirect
github.com/go-i2p/logger v0.0.0-20241123010126-3050657e5d0c // indirect
github.com/go-i2p/onramp v0.33.92 // indirect github.com/go-i2p/onramp v0.33.92 // indirect
github.com/go-i2p/sam3 v0.33.9 // indirect github.com/go-i2p/sam3 v0.33.92 // indirect
github.com/gobwas/glob v0.2.3 // indirect
github.com/golang-jwt/jwt/v5 v5.2.3 // indirect
github.com/golang/snappy v1.0.0 // indirect
github.com/google/pprof v0.0.0-20250630185457-6e76a2b096b5 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-sqlite3 v1.14.28 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/nxadm/tail v1.4.11 // indirect
github.com/oklog/ulid/v2 v2.1.1 // indirect
github.com/opd-ai/wileedot v0.0.0-20241217172720-521d4175e624 // indirect github.com/opd-ai/wileedot v0.0.0-20241217172720-521d4175e624 // indirect
github.com/patrickmn/go-cache v2.1.0+incompatible // indirect
github.com/pkg/errors v0.9.1 // indirect github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/redis/go-redis/v9 v9.11.0 // indirect
github.com/samber/lo v1.51.0 // indirect
github.com/samber/oops v1.19.0 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect github.com/sirupsen/logrus v1.9.3 // indirect
github.com/stretchr/testify v1.10.0 // indirect github.com/syndtr/goleveldb v1.0.0 // indirect
golang.org/x/crypto v0.32.0 // indirect go.opentelemetry.io/otel v1.37.0 // indirect
golang.org/x/net v0.34.0 // indirect go.opentelemetry.io/otel/trace v1.37.0 // indirect
golang.org/x/sys v0.29.0 // indirect golang.org/x/crypto v0.40.0 // indirect
golang.org/x/text v0.21.0 // indirect golang.org/x/net v0.42.0 // indirect
golang.org/x/time v0.9.0 // indirect golang.org/x/sys v0.34.0 // indirect
golang.org/x/text v0.27.0 // indirect
golang.org/x/time v0.12.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
) )

132
go.sum
View File

@@ -1,57 +1,149 @@
code.gitea.io/gitea v1.24.3 h1:oKRO/ANVKFxKg7JNNTamVOjlu3IYWEhFW3b4Btsy/80=
code.gitea.io/gitea v1.24.3/go.mod h1:ZVUHkQWAzYNx30ousZMpr75aRXlt9VHMEtN5uJpj+vY=
github.com/42wim/httpsig v1.2.3 h1:xb0YyWhkYj57SPtfSttIobJUPJZB9as1nsfo7KWVcEs=
github.com/42wim/httpsig v1.2.3/go.mod h1:nZq9OlYKDrUBhptd77IHx4/sZZD+IxTBADvAPI9G/EM=
github.com/bsm/ginkgo/v2 v2.12.0 h1:Ny8MWAHyOepLGlLKYmXG4IEkioBysk6GpaRTLC8zwWs=
github.com/bsm/ginkgo/v2 v2.12.0/go.mod h1:SwYbGRRDovPVboqFv0tPTcG1sN61LM1Z4ARdbAV9g4c=
github.com/bsm/gomega v1.27.10 h1:yeMWxP2pV2fG3FgAODIY8EiRE3dy0aeFYt4l7wh6yKA=
github.com/bsm/gomega v1.27.10/go.mod h1:JyEr/xRbxbtgWNi8tIEVPUYZ5Dzef52k01W3YH0H+O0=
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/cretz/bine v0.2.0 h1:8GiDRGlTgz+o8H9DSnsl+5MeBK4HsExxgl6WgzOCuZo= github.com/cretz/bine v0.2.0 h1:8GiDRGlTgz+o8H9DSnsl+5MeBK4HsExxgl6WgzOCuZo=
github.com/cretz/bine v0.2.0/go.mod h1:WU4o9QR9wWp8AVKtTM1XD5vUHkEqnf2vVSo6dBqbetI= github.com/cretz/bine v0.2.0/go.mod h1:WU4o9QR9wWp8AVKtTM1XD5vUHkEqnf2vVSo6dBqbetI=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/go-i2p/go-limit v0.0.0-20250203203118-210616857c15 h1:ASjMbwlepoDQfrhv+H2B5ICBPJU5ES1JzmOxzPDx3YQ= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78=
github.com/go-i2p/go-limit v0.0.0-20250203203118-210616857c15/go.mod h1:4jjmVRhvKj47sQ6B6wdDhN1IrEZunE6KwkYLQx/BeVE= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc=
github.com/go-i2p/go-meta-dialer v0.0.0-20250501024057-715e91be3cfe h1:9Rxw2KtMCRKZHI4WavUAaatzKmc64V6kiYvcyTMHjeU= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=
github.com/go-i2p/go-meta-dialer v0.0.0-20250501024057-715e91be3cfe/go.mod h1:++xHSOvnGymRSyFbi9A9hztcfwKfU6/nJAtVxrNo8Zo= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
github.com/go-i2p/go-meta-listener v0.0.4-0.20250505194551-6b30e62ee419 h1:zMq0nZ6wmJktnRwy1hFXzDTSKlZ4Cah2jdzvtp9tH2k= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/go-i2p/go-meta-listener v0.0.4-0.20250505194551-6b30e62ee419/go.mod h1:wF/MCCfB40gZyT9WtuYWQkUOPrnoTzA+NG0zpsy3s4M= github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw=
github.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k=
github.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=
github.com/go-i2p/go-limit v0.0.0-20250718212214-52e5c6fec5d8 h1:eKJ5X3wWYg/ln8C2G9Ibp3bUn8Qg8sYe28Uthypmb9g=
github.com/go-i2p/go-limit v0.0.0-20250718212214-52e5c6fec5d8/go.mod h1:4jjmVRhvKj47sQ6B6wdDhN1IrEZunE6KwkYLQx/BeVE=
github.com/go-i2p/go-meta-dialer v0.0.0-20250527012419-b550471a50a5 h1:Y+zm4rSJrweLQcE1/4zoJBZ/7GYumTNm6swcs9ejC/I=
github.com/go-i2p/go-meta-dialer v0.0.0-20250527012419-b550471a50a5/go.mod h1:++xHSOvnGymRSyFbi9A9hztcfwKfU6/nJAtVxrNo8Zo=
github.com/go-i2p/go-meta-listener v0.0.8-0.20250722005411-61419dc4a141 h1:1+Jr+1l1tko2BpM41mhOCsQ7e+Y/x8Re/Jmrrwz+0LI=
github.com/go-i2p/go-meta-listener v0.0.8-0.20250722005411-61419dc4a141/go.mod h1:lWBcqf1Se/3yrc3dtglP7jHKNRKTIiZzEP+aW0qamzg=
github.com/go-i2p/go-select-cache v0.0.0-20250722003334-fba8c5bb610f h1:Zh5oyecB8nONOlVlrGHXCqkk3gam7/6I/LR+BYF2Wuc=
github.com/go-i2p/go-select-cache v0.0.0-20250722003334-fba8c5bb610f/go.mod h1:ABhJNyNBEHNbLYhRoqOsxHAkOKCFR41SSpwdKNfx8RU=
github.com/go-i2p/i2pkeys v0.0.0-20241108200332-e4f5ccdff8c4/go.mod h1:m5TlHjPZrU5KbTd7Lr+I2rljyC6aJ88HdkeMQXV0U0E= github.com/go-i2p/i2pkeys v0.0.0-20241108200332-e4f5ccdff8c4/go.mod h1:m5TlHjPZrU5KbTd7Lr+I2rljyC6aJ88HdkeMQXV0U0E=
github.com/go-i2p/i2pkeys v0.33.10-0.20241113193422-e10de5e60708 h1:Tiy9IBwi21maNpK74yCdHursJJMkyH7w87tX1nXGWzg= github.com/go-i2p/i2pkeys v0.33.92 h1:e2vx3vf7tNesaJ8HmAlGPOcfiGM86jzeIGxh27I9J2Y=
github.com/go-i2p/i2pkeys v0.33.10-0.20241113193422-e10de5e60708/go.mod h1:m5TlHjPZrU5KbTd7Lr+I2rljyC6aJ88HdkeMQXV0U0E= github.com/go-i2p/i2pkeys v0.33.92/go.mod h1:BRURQ/twxV0WKjZlFSKki93ivBi+MirZPWudfwTzMpE=
github.com/go-i2p/logger v0.0.0-20241123010126-3050657e5d0c h1:VTiECn3dFEmUlZjto+wOwJ7SSJTHPLyNprQMR5HzIMI=
github.com/go-i2p/logger v0.0.0-20241123010126-3050657e5d0c/go.mod h1:te7Zj3g3oMeIl8uBXAgO62UKmZ6m6kHRNg1Mm+X8Hzk=
github.com/go-i2p/onramp v0.33.92 h1:Dk3A0SGpdEw829rSjW2LqN8o16pUvuhiN0vn36z7Gpc= github.com/go-i2p/onramp v0.33.92 h1:Dk3A0SGpdEw829rSjW2LqN8o16pUvuhiN0vn36z7Gpc=
github.com/go-i2p/onramp v0.33.92/go.mod h1:5sfB8H2xk05gAS2K7XAUZ7ekOfwGJu3tWF0fqdXzJG4= github.com/go-i2p/onramp v0.33.92/go.mod h1:5sfB8H2xk05gAS2K7XAUZ7ekOfwGJu3tWF0fqdXzJG4=
github.com/go-i2p/sam3 v0.33.9 h1:3a+gunx75DFc6jxloUZTAVJbdP6736VU1dy2i7I9fKA= github.com/go-i2p/sam3 v0.33.92 h1:TVpi4GH7Yc7nZBiE1QxLjcZfnC4fI/80zxQz1Rk36BA=
github.com/go-i2p/sam3 v0.33.9/go.mod h1:oDuV145l5XWKKafeE4igJHTDpPwA0Yloz9nyKKh92eo= github.com/go-i2p/sam3 v0.33.92/go.mod h1:oDuV145l5XWKKafeE4igJHTDpPwA0Yloz9nyKKh92eo=
github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y=
github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8=
github.com/golang-jwt/jwt/v5 v5.2.3 h1:kkGXqQOBSDDWRhWNXTFpqGSCMyh/PLnqUvMGJPDJDs0=
github.com/golang-jwt/jwt/v5 v5.2.3/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/golang/snappy v1.0.0 h1:Oy607GVXHs7RtbggtPBnr2RmDArIsAefDwvrdWvRhGs=
github.com/golang/snappy v1.0.0/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/pprof v0.0.0-20250630185457-6e76a2b096b5 h1:xhMrHhTJ6zxu3gA4enFM9MLn9AY7613teCdFnlUVbSQ=
github.com/google/pprof v0.0.0-20250630185457-6e76a2b096b5/go.mod h1:5hDyRhoBCxViHszMt12TnOpEI4VVi+U8Gm9iphldiMA=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs=
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8=
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/mattn/go-sqlite3 v1.14.28 h1:ThEiQrnbtumT+QMknw63Befp/ce/nUPgBPMlRFEum7A=
github.com/mattn/go-sqlite3 v1.14.28/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/nxadm/tail v1.4.11 h1:8feyoE3OzPrcshW5/MJ4sGESc5cqmGkGCWlco4l0bqY=
github.com/nxadm/tail v1.4.11/go.mod h1:OTaG3NK980DZzxbRq6lEuzgU+mug70nY11sMd4JXXHc=
github.com/oklog/ulid/v2 v2.1.1 h1:suPZ4ARWLOJLegGFiZZ1dFAkqzhMjL3J1TzI+5wHz8s=
github.com/oklog/ulid/v2 v2.1.1/go.mod h1:rcEKHmBBKfef9DhnvX7y1HZBYxjXb0cP5ExxNsTT1QQ=
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE=
github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU=
github.com/onsi/gomega v1.4.3 h1:RE1xgDvH7imwFD45h+u2SgIfERHlS2yNG4DObb5BSKU=
github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/opd-ai/wileedot v0.0.0-20241217172720-521d4175e624 h1:FXCTQV93+31Yj46zpYbd41es+EYgT7qi4RK6KSVrGQM= github.com/opd-ai/wileedot v0.0.0-20241217172720-521d4175e624 h1:FXCTQV93+31Yj46zpYbd41es+EYgT7qi4RK6KSVrGQM=
github.com/opd-ai/wileedot v0.0.0-20241217172720-521d4175e624/go.mod h1:ftKSvvGC9FnxZeuL3B4MB6q/DOzVSV0kET08YUyDwbM= github.com/opd-ai/wileedot v0.0.0-20241217172720-521d4175e624/go.mod h1:ftKSvvGC9FnxZeuL3B4MB6q/DOzVSV0kET08YUyDwbM=
github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc=
github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ=
github.com/pborman/getopt v0.0.0-20170112200414-7148bc3a4c30/go.mod h1:85jBQOZwpVEaDAr341tbn15RS4fCAsIst0qp7i8ex1o=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/redis/go-redis/v9 v9.11.0 h1:E3S08Gl/nJNn5vkxd2i78wZxWAPNZgUNTp8WIJUAiIs=
github.com/redis/go-redis/v9 v9.11.0/go.mod h1:huWgSWd8mW6+m0VPhJjSSQ+d6Nh1VICQ6Q5lHuCH/Iw=
github.com/samber/lo v1.51.0 h1:kysRYLbHy/MB7kQZf5DSN50JHmMsNEdeY24VzJFu7wI=
github.com/samber/lo v1.51.0/go.mod h1:4+MXEGsJzbKGaUEQFKBq2xtfuznW9oz/WrgyzMzRoM0=
github.com/samber/oops v1.19.0 h1:sfZAwC8MmTXBRRyNc4Z1utuTPBx+hFKF5fJ9DEQRZfw=
github.com/samber/oops v1.19.0/go.mod h1:+f+61dbiMxEMQ8gw/zTxW2pk+YGobaDM4glEHQtPOww=
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/syndtr/goleveldb v1.0.0 h1:fBdIW9lB4Iz0n9khmH8w27SJ3QEJ7+IgjPEwGSZiFdE=
github.com/syndtr/goleveldb v1.0.0/go.mod h1:ZVVdQEZoIme9iO1Ch2Jdy24qqXrMMOU6lpPAyBWyWuQ=
go.opentelemetry.io/otel v1.37.0 h1:9zhNfelUvx0KBfu/gb+ZgeAfAgtWrfHJZcAqFC228wQ=
go.opentelemetry.io/otel v1.37.0/go.mod h1:ehE/umFRLnuLa/vSccNq9oS1ErUlkkK71gMcN34UG8I=
go.opentelemetry.io/otel/trace v1.37.0 h1:HLdcFNbRQBE2imdSEgm/kwqmQj1Or1l/7bW6mxVK7z4=
go.opentelemetry.io/otel/trace v1.37.0/go.mod h1:TlgrlQ+PtQO5XFerSPUYG0JSgGyryXewPGyayAWSBS0=
golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8=
golang.org/x/crypto v0.32.0 h1:euUpcYgM8WcP71gNpTqQCn6rC2t6ULUPiOzfWaXVVfc= golang.org/x/crypto v0.40.0 h1:r4x+VvoG5Fm+eJcxMaY8CQM7Lb0l1lsmjGBQ6s8BfKM=
golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc= golang.org/x/crypto v0.40.0/go.mod h1:Qr1vMER5WyS2dfPHAlsOj01wgLbsyWtFn/aY+5+ZdxY=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0= golang.org/x/net v0.42.0 h1:jzkYrhi3YQWD6MLBJcsklgQsoAcw89EcZbJw8Z614hs=
golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k= golang.org/x/net v0.42.0/go.mod h1:FF1RA5d3u7nAYA4z2TkclSCKh68eSXtiFwcWQpPXdt8=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= golang.org/x/sys v0.34.0 h1:H5Y5sJ2L2JRdyv7ROF1he/lPdvFsd0mJHFw2ThKHxLA=
golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.34.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.33.0 h1:NuFncQrRcaRvVmgRkvM3j/F00gWIAlcmlB8ACEKmGIg=
golang.org/x/term v0.33.0/go.mod h1:s18+ql9tYWp1IfpV9DmCtQDDSRBUjKaw9M1eAv5UeF0=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= golang.org/x/text v0.27.0 h1:4fGWRpyh641NLlecmyl4LOe6yDdfaYNrGb2zdfo4JV4=
golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/text v0.27.0/go.mod h1:1D28KMCvyooCX9hBiosv5Tz/+YLxj0j7XhWjpSUF7CU=
golang.org/x/time v0.9.0 h1:EsRrnYcQiGH+5FfbgvV4AP7qEZstoyrHB0DzarOQ4ZY= golang.org/x/time v0.12.0 h1:ScB/8o8olJvc+CQPWrK3fPZNfh7qgwCrY0zJmoEQLSE=
golang.org/x/time v0.9.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/time v0.12.0/go.mod h1:CDIdPxbZBQxdj6cxyCIdrNogrJKMJ7pr37NYpMcMDSg=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA=
gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

0
install.sh Normal file → Executable file
View File

View File

@@ -7,10 +7,13 @@ import (
"net" "net"
"net/http" "net/http"
"os" "os"
"path/filepath"
"github.com/go-i2p/go-meta-listener/mirror" "github.com/go-i2p/go-meta-listener/mirror"
"code.gitea.io/gitea/modules/setting"
limitedlistener "github.com/go-i2p/go-limit" limitedlistener "github.com/go-i2p/go-limit"
selectcache "github.com/go-i2p/go-select-cache"
) )
func hostname() string { func hostname() string {
@@ -55,14 +58,20 @@ func MultiGetListener(network, address string) (net.Listener, error) {
return GetListenerUnixWrapper(network, unixAddr) return GetListenerUnixWrapper(network, unixAddr)
default: default:
ml, err := mirrorListener.Listen(address, EMAIL, "./certs", true) ml, err := mirrorListener.Listen(address, EMAIL)
mirror.CERT_DIR = filepath.Join(setting.CustomPath, "certs")
mirror.HIDDEN_TLS = true
if err != nil { if err != nil {
return nil, err return nil, err
} }
return limitedlistener.NewLimitedListener(ml, config := selectcache.DefaultCacheConfig()
config.MaxMemoryMB = 512
config.MaxEntries = 10000
// Wrap with caching listener
return selectcache.NewCachingListener(limitedlistener.NewLimitedListener(ml,
limitedlistener.WithMaxConnections(500), // max concurrent limitedlistener.WithMaxConnections(500), // max concurrent
limitedlistener.WithRateLimit(24), // per second limitedlistener.WithRateLimit(24), // per second
), nil ), config), nil
} }
} }

6
package-lock.json generated
View File

@@ -0,0 +1,6 @@
{
"name": "go-gitlooseleaf",
"lockfileVersion": 3,
"requires": true,
"packages": {}
}

16
postinst Executable file
View File

@@ -0,0 +1,16 @@
# only if we're root
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root" 1>&2
exit 1
fi
BINARY_PATH=${BASE}/usr/local/bin/gitea
SYSTEMD_PATH=${BASE}/etc/systemd/system
CONFIG_PATH=${BASE}/etc/gitea
DATA_PATH=${BASE}/var/lib/gitea
echo chown -R git:git "$DATA_PATH/"
echo chmod -R 750 "$DATA_PATH/"
echo chown root:git "$CONFIG_PATH"
echo chmod 770 "$CONFIG_PATH"

18
preinst Executable file
View File

@@ -0,0 +1,18 @@
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root" 1>&2
exit 1
fi
BINARY_PATH=${BASE}/usr/local/bin/gitea
SYSTEMD_PATH=${BASE}/etc/systemd/system
CONFIG_PATH=${BASE}/etc/gitea
DATA_PATH=${BASE}/var/lib/gitea
echo "id -u git &>/dev/null || adduser \
--system \
--shell /bin/bash \
--gecos 'Git Version Control' \
--group \
--disabled-password \
--home /home/git \
git"