4 Commits

Author SHA1 Message Date
eyedeekay
d0b5b3874e update service, initscripts 2025-03-08 19:59:25 -05:00
eyedeekay
59479597d5 update service initscripts 2025-03-08 19:54:48 -05:00
eyedeekay
e85229dc90 update gitignore 2025-03-08 19:40:50 -05:00
eyedeekay
504e7bddb9 disable docker 2025-03-08 19:36:31 -05:00
6 changed files with 62 additions and 15 deletions

View File

@@ -79,11 +79,11 @@ jobs:
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
# - 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
View File

@@ -2,6 +2,10 @@
/cert.pem
/key.pem
/_netdb
/i2pkeys
/onionkeys
/tlskeys
/tmp
i2pseeds.su3
*.pem
onion.key

View File

@@ -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=""

View File

@@ -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

View File

@@ -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

View File

@@ -2,4 +2,5 @@
# without it the reseed will fail to start.
[Service]
# Required: Set a valid email address
Environment="RESEED_EMAIL="