Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
d0b5b3874e | ||
![]() |
59479597d5 | ||
![]() |
e85229dc90 | ||
![]() |
504e7bddb9 | ||
![]() |
2e7e2e1289 | ||
![]() |
3fabc7efbd |
89
.github/workflows/release.yaml
vendored
Normal file
89
.github/workflows/release.yaml
vendored
Normal file
@@ -0,0 +1,89 @@
|
||||
name: Release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build-and-release:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: '1.21'
|
||||
cache: true
|
||||
|
||||
- name: Install build dependencies
|
||||
run: |
|
||||
sudo add-apt-repository -y ppa:i2p-maintainers/i2p
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y make git fakeroot checkinstall i2p i2p-router
|
||||
|
||||
- name: Build binaries
|
||||
run: |
|
||||
# Build for various platforms
|
||||
GOOS=linux GOARCH=amd64 make build
|
||||
GOOS=linux GOARCH=386 make build
|
||||
GOOS=linux GOARCH=arm make build
|
||||
GOOS=linux GOARCH=arm64 make build
|
||||
GOOS=openbsd GOARCH=amd64 make build
|
||||
GOOS=freebsd GOARCH=386 make build
|
||||
GOOS=freebsd GOARCH=amd64 make build
|
||||
GOOS=windows GOARCH=amd64 make build
|
||||
GOOS=windows GOARCH=386 make build
|
||||
|
||||
- name: Build Debian packages
|
||||
run: |
|
||||
# Build .deb packages
|
||||
sudo -u i2psvc mkdir -p /var/lib/i2p/i2p-config/reseed
|
||||
sudo mkdir -p /etc/systemd/system/reseed.service.d/
|
||||
sudo bash -c "GOOS=linux GOARCH=amd64 make checkinstall"
|
||||
sudo bash -c "GOOS=linux GOARCH=386 make checkinstall"
|
||||
sudo bash -c "GOOS=linux GOARCH=arm make checkinstall"
|
||||
sudo bash -c "GOOS=linux GOARCH=arm64 make checkinstall"
|
||||
|
||||
#- name: Build plugins
|
||||
#run: |
|
||||
## Build plugins for various platforms
|
||||
#GOOS=linux GOARCH=amd64 make su3s
|
||||
#GOOS=linux GOARCH=386 make su3s
|
||||
#GOOS=linux GOARCH=arm make su3s
|
||||
#GOOS=linux GOARCH=arm64 make su3s
|
||||
#GOOS=openbsd GOARCH=amd64 make su3s
|
||||
#GOOS=freebsd GOARCH=386 make su3s
|
||||
#GOOS=freebsd GOARCH=amd64 make su3s
|
||||
#GOOS=windows GOARCH=amd64 make su3s
|
||||
#GOOS=windows GOARCH=386 make su3s
|
||||
|
||||
- name: Create Release
|
||||
id: create_release
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
body_path: CHANGELOG.md
|
||||
files: |
|
||||
reseed-tools-*
|
||||
*.deb
|
||||
*.su3
|
||||
generate_release_notes: false
|
||||
draft: false
|
||||
prerelease: false
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
# - name: Build and push Docker image
|
||||
# if: success()
|
||||
# run: |
|
||||
# docker login -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }} ghcr.io
|
||||
# docker build -t ghcr.io/${{ github.repository }}:${{ github.ref_name }} .
|
||||
# docker push ghcr.io/${{ github.repository }}:${{ github.ref_name }}
|
||||
# docker tag ghcr.io/${{ github.repository }}:${{ github.ref_name }} ghcr.io/${{ github.repository }}:latest
|
||||
# docker push ghcr.io/${{ github.repository }}:latest
|
4
.gitignore
vendored
4
.gitignore
vendored
@@ -2,6 +2,10 @@
|
||||
/cert.pem
|
||||
/key.pem
|
||||
/_netdb
|
||||
/i2pkeys
|
||||
/onionkeys
|
||||
/tlskeys
|
||||
/tmp
|
||||
i2pseeds.su3
|
||||
*.pem
|
||||
onion.key
|
||||
|
@@ -1,2 +1,3 @@
|
||||
#Edit the contact/signing email used by your reseed server here
|
||||
# Edit the contact/signing email used by your reseed server here
|
||||
# Required: Set a valid email address
|
||||
export RESEED_EMAIL=""
|
@@ -1,4 +1,4 @@
|
||||
#!/bin/sh
|
||||
#!/bin/bash
|
||||
### BEGIN INIT INFO
|
||||
# Provides: reseed
|
||||
# Required-Start: $local_fs $network $named $time $syslog
|
||||
@@ -13,21 +13,58 @@ RUNAS=i2psvc
|
||||
NETDBDIR=/var/lib/i2p/i2p-config/netDb
|
||||
RUNDIR=/var/lib/i2p/i2p-config/reseed
|
||||
MORE_OPTIONS=""
|
||||
PIDFILE="$RUNDIR/reseed.pid"
|
||||
TIMEOUT=60
|
||||
if [ -f /etc/default/reseed ]; then
|
||||
. /etc/default/reseed
|
||||
fi
|
||||
RUNOPTS=" reseed --yes=true --netdb=$NETDBDIR $MORE_OPTIONS "
|
||||
|
||||
start() {
|
||||
start-stop-daemon --background --user $RUNAS --chuid $RUNAS --exec $SCRIPT --chdir $RUNDIR --make-pidfile --pidfile $RUNDIR/reseed.pid --start -- $RUNOPTS
|
||||
if [ ! -d "$RUNDIR" ]; then
|
||||
mkdir -p "$RUNDIR"
|
||||
chown $RUNAS:$RUNAS "$RUNDIR"
|
||||
fi
|
||||
if [ -z "$RESEED_EMAIL" ]; then
|
||||
echo "Error: RESEED_EMAIL not configured" >&2
|
||||
return 1
|
||||
fi
|
||||
start-stop-daemon --background \
|
||||
--user $RUNAS \
|
||||
--chuid $RUNAS \
|
||||
--exec $SCRIPT \
|
||||
--chdir $RUNDIR \
|
||||
--make-pidfile \
|
||||
--pidfile $PIDFILE \
|
||||
--start \
|
||||
--startas $SCRIPT -- $RUNOPTS
|
||||
|
||||
for i in $(seq 1 $TIMEOUT); do
|
||||
if status >/dev/null; then
|
||||
return 0
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
stop() {
|
||||
start-stop-daemon --background --user $RUNAS --exec $SCRIPT --chdir $RUNDIR --remove-pidfile --pidfile $RUNDIR/reseed.pid --stop
|
||||
start-stop-daemon \
|
||||
--user $RUNAS \
|
||||
--exec $SCRIPT \
|
||||
--chdir $RUNDIR \
|
||||
--remove-pidfile \
|
||||
--pidfile $RUNDIR/reseed.pid \
|
||||
--stop
|
||||
}
|
||||
|
||||
status() {
|
||||
start-stop-daemon --background --user $RUNAS --exec $SCRIPT --chdir $RUNDIR --pidfile $RUNDIR/reseed.pid --status
|
||||
start-stop-daemon \
|
||||
--user $RUNAS \
|
||||
--exec $SCRIPT \
|
||||
--chdir $RUNDIR \
|
||||
--pidfile $RUNDIR/reseed.pid \
|
||||
--status
|
||||
}
|
||||
|
||||
restart() {
|
||||
@@ -42,7 +79,7 @@ uninstall() {
|
||||
if [ "$SURE" = "yes" ]; then
|
||||
stop
|
||||
rm -f "$PIDFILE"
|
||||
echo "Notice: log file is not be removed: '$LOGFILE'" >&2
|
||||
echo "Notice: log file is not removed" >&2
|
||||
update-rc.d -f reseed remove
|
||||
rm -fv "$0"
|
||||
fi
|
||||
@@ -65,5 +102,5 @@ case "$1" in
|
||||
restart
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart|uninstall}"
|
||||
echo "Usage: $0 {start|stop|restart|uninstall|status}"
|
||||
esac
|
||||
|
@@ -11,6 +11,10 @@ ExecStart=/usr/bin/reseed-tools reseed --yes=true --netdb=/var/lib/i2p/i2p-confi
|
||||
Restart=always
|
||||
RestartSec=10
|
||||
RuntimeMaxSec=43200
|
||||
StandardOutput=journal
|
||||
StandardError=journal
|
||||
#MemoryMax=512M
|
||||
#CPUQuota=50%
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
@@ -2,4 +2,5 @@
|
||||
# without it the reseed will fail to start.
|
||||
|
||||
[Service]
|
||||
# Required: Set a valid email address
|
||||
Environment="RESEED_EMAIL="
|
Reference in New Issue
Block a user