mirror of
https://github.com/go-i2p/reseed-tools.git
synced 2025-09-15 14:47:45 -04:00
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
|
/cert.pem
|
||||||
/key.pem
|
/key.pem
|
||||||
/_netdb
|
/_netdb
|
||||||
|
/i2pkeys
|
||||||
|
/onionkeys
|
||||||
|
/tlskeys
|
||||||
|
/tmp
|
||||||
i2pseeds.su3
|
i2pseeds.su3
|
||||||
*.pem
|
*.pem
|
||||||
onion.key
|
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=""
|
export RESEED_EMAIL=""
|
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
### BEGIN INIT INFO
|
### BEGIN INIT INFO
|
||||||
# Provides: reseed
|
# Provides: reseed
|
||||||
# Required-Start: $local_fs $network $named $time $syslog
|
# Required-Start: $local_fs $network $named $time $syslog
|
||||||
@@ -13,21 +13,58 @@ RUNAS=i2psvc
|
|||||||
NETDBDIR=/var/lib/i2p/i2p-config/netDb
|
NETDBDIR=/var/lib/i2p/i2p-config/netDb
|
||||||
RUNDIR=/var/lib/i2p/i2p-config/reseed
|
RUNDIR=/var/lib/i2p/i2p-config/reseed
|
||||||
MORE_OPTIONS=""
|
MORE_OPTIONS=""
|
||||||
|
PIDFILE="$RUNDIR/reseed.pid"
|
||||||
|
TIMEOUT=60
|
||||||
if [ -f /etc/default/reseed ]; then
|
if [ -f /etc/default/reseed ]; then
|
||||||
. /etc/default/reseed
|
. /etc/default/reseed
|
||||||
fi
|
fi
|
||||||
RUNOPTS=" reseed --yes=true --netdb=$NETDBDIR $MORE_OPTIONS "
|
RUNOPTS=" reseed --yes=true --netdb=$NETDBDIR $MORE_OPTIONS "
|
||||||
|
|
||||||
start() {
|
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() {
|
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() {
|
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() {
|
restart() {
|
||||||
@@ -42,7 +79,7 @@ uninstall() {
|
|||||||
if [ "$SURE" = "yes" ]; then
|
if [ "$SURE" = "yes" ]; then
|
||||||
stop
|
stop
|
||||||
rm -f "$PIDFILE"
|
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
|
update-rc.d -f reseed remove
|
||||||
rm -fv "$0"
|
rm -fv "$0"
|
||||||
fi
|
fi
|
||||||
@@ -65,5 +102,5 @@ case "$1" in
|
|||||||
restart
|
restart
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Usage: $0 {start|stop|restart|uninstall}"
|
echo "Usage: $0 {start|stop|restart|uninstall|status}"
|
||||||
esac
|
esac
|
||||||
|
@@ -11,6 +11,10 @@ ExecStart=/usr/bin/reseed-tools reseed --yes=true --netdb=/var/lib/i2p/i2p-confi
|
|||||||
Restart=always
|
Restart=always
|
||||||
RestartSec=10
|
RestartSec=10
|
||||||
RuntimeMaxSec=43200
|
RuntimeMaxSec=43200
|
||||||
|
StandardOutput=journal
|
||||||
|
StandardError=journal
|
||||||
|
#MemoryMax=512M
|
||||||
|
#CPUQuota=50%
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
@@ -2,4 +2,5 @@
|
|||||||
# without it the reseed will fail to start.
|
# without it the reseed will fail to start.
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
|
# Required: Set a valid email address
|
||||||
Environment="RESEED_EMAIL="
|
Environment="RESEED_EMAIL="
|
Reference in New Issue
Block a user