Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
01153a9ee8 | ||
![]() |
eb0703485f | ||
![]() |
dac3888397 | ||
![]() |
83918dfff8 | ||
![]() |
54271fb852 | ||
![]() |
d5e81baf12 | ||
![]() |
8dfdb5b9d2 |
65
Makefile
Normal file
65
Makefile
Normal file
@@ -0,0 +1,65 @@
|
||||
|
||||
VERSION=0.0.2
|
||||
APP=i2p-tools-1
|
||||
USER_GH=eyedeekay
|
||||
|
||||
GOOS?=$(shell uname -s | tr A-Z a-z)
|
||||
GOARCH?="amd64"
|
||||
|
||||
echo:
|
||||
@echo "type make version to do release $(APP) $(VERSION) $(GOOS) $(GOARCH) "
|
||||
|
||||
version:
|
||||
cat README.md | gothub release -s $(GITHUB_TOKEN) -u $(USER_GH) -r $(APP) -t v$(VERSION) -d -
|
||||
|
||||
edit:
|
||||
cat README.md | gothub edit -s $(GITHUB_TOKEN) -u $(USER_GH) -r $(APP) -t v$(VERSION) -d -
|
||||
|
||||
upload: binary tar
|
||||
gothub upload -s $(GITHUB_TOKEN) -u $(USER_GH) -r $(APP) -t v$(VERSION) -f ../i2p-tools.tar.xz -n "i2p-tools.tar.xz"
|
||||
|
||||
build:
|
||||
go build -v -tags netgo \
|
||||
-ldflags '-w -extldflags "-static"' -o i2p-tools-$(GOOS)-$(GOARCH)
|
||||
|
||||
clean:
|
||||
rm i2p-tools-* *.key *.i2pKeys *.crt *.crl *.pem tmp -rf
|
||||
|
||||
binary:
|
||||
GOOS=darwin GOARCH=amd64 make build
|
||||
GOOS=linux GOARCH=386 make build
|
||||
GOOS=linux GOARCH=amd64 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
|
||||
|
||||
tar:
|
||||
tar --exclude="./.git" --exclude="./tmp" -cvf ../i2p-tools.tar.xz .
|
||||
|
||||
install:
|
||||
install -m755 i2p-tools-$(GOOS)-$(GOARCH) /usr/local/bin/i2p-tools
|
||||
install -m755 etc/init.d/reseed /etc/init.d/reseed
|
||||
|
||||
### You shouldn't need to use these now that the go mod require rule is fixed,
|
||||
## but I'm leaving them in here because it made it easier to test that both
|
||||
## versions behaved the same way. -idk
|
||||
|
||||
build-fork:
|
||||
go build -o i2p-tools-idk
|
||||
|
||||
build-unfork:
|
||||
go build -o i2p-tools-md
|
||||
|
||||
fork:
|
||||
sed -i 's|MDrollette/i2p-tools|eyedeekay/i2p-tools-1|g' main.go cmd/*.go reseed/*.go su3/*.go
|
||||
make gofmt build-fork
|
||||
|
||||
unfork:
|
||||
sed -i 's|eyedeekay/i2p-tools-1|MDrollette/i2p-tools|g' main.go cmd/*.go reseed/*.go su3/*.go
|
||||
sed -i 's|RTradeLtd/i2p-tools-1|MDrollette/i2p-tools|g' main.go cmd/*.go reseed/*.go su3/*.go
|
||||
make gofmt build-unfork
|
||||
|
||||
gofmt:
|
||||
gofmt -w main.go cmd/*.go reseed/*.go su3/*.go
|
80
etc/init.d/reseed
Normal file
80
etc/init.d/reseed
Normal file
@@ -0,0 +1,80 @@
|
||||
#!/bin/sh
|
||||
### BEGIN INIT INFO
|
||||
# Provides: samcatd
|
||||
# Required-Start: $local_fs $network $named $time $syslog
|
||||
# Required-Stop: $local_fs $network $named $time $syslog
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
# Description: <DESCRIPTION>
|
||||
### END INIT INFO
|
||||
|
||||
SCRIPT='/usr/local/bin/i2p-tools'
|
||||
RUNAS=i2psvc
|
||||
NETDBDIR=/var/lib/i2p/i2p-config/netDb
|
||||
RUNDIR=/var/lib/i2p/i2p-config/reseed
|
||||
SIGNER=you@mail.i2p
|
||||
MORE_OPTIONS=""
|
||||
if [ -f /etc/default/reseed ]; then
|
||||
source /etc/default/reseed
|
||||
fi
|
||||
RUNOPTS=" reseed --signer=$SIGNER --netdb=$NETDBDIR $MORE_OPTIONS "
|
||||
|
||||
rundir(){
|
||||
if [ !-d $RUNDIR ]; then
|
||||
install -d -oi2psvc -m2770 $RUNDIR
|
||||
fi
|
||||
cd $RUNDIR
|
||||
}
|
||||
|
||||
start() {
|
||||
rundir
|
||||
su - $RUNAS $SCRIPT $RUNOPTS --restart=start
|
||||
}
|
||||
|
||||
stop() {
|
||||
rundir
|
||||
su - $RUNAS $SCRIPT $RUNOPTS --restart=stop
|
||||
}
|
||||
|
||||
start() {
|
||||
rundir
|
||||
su - $RUNAS $SCRIPT $RUNOPTS --restart=restart
|
||||
}
|
||||
|
||||
status() {
|
||||
rundir
|
||||
su - $RUNAS $SCRIPT $RUNOPTS --restart=status
|
||||
}
|
||||
|
||||
uninstall() {
|
||||
echo -n "Are you really sure you want to uninstall this service? That cannot be undone. [yes|No] "
|
||||
local SURE
|
||||
read SURE
|
||||
if [ "$SURE" = "yes" ]; then
|
||||
stop
|
||||
rm -f "$PIDFILE"
|
||||
echo "Notice: log file is not be removed: '$LOGFILE'" >&2
|
||||
update-rc.d -f reseed remove
|
||||
rm -fv "$0"
|
||||
fi
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
start
|
||||
;;
|
||||
stop)
|
||||
stop
|
||||
;;
|
||||
status)
|
||||
status
|
||||
;;
|
||||
uninstall)
|
||||
uninstall
|
||||
;;
|
||||
restart)
|
||||
restart
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart|uninstall}"
|
||||
esac
|
@@ -3,6 +3,7 @@
|
||||
* incorporate libp2p(ipfs) listener from RTradeLtd/i2p-tools-1 master
|
||||
* in-network(I2P) reseeds in case there's a point to that.
|
||||
* self-supervising reseed service, if it crashes it will restart itself
|
||||
* add an initscript
|
||||
|
||||
2019-06-27
|
||||
* automatically configuring Tor Onionv3 Server
|
||||
|
Reference in New Issue
Block a user