summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO35
-rw-r--r--.gitignore3
-rw-r--r--PKGBUILD84
-rw-r--r--chromium-i2p.sh58
-rw-r--r--i2p.install19
-rw-r--r--i2p.tmpfiles5
-rw-r--r--i2prouter.bash12
-rw-r--r--i2prouter.service26
-rw-r--r--i2prouter.sh117
-rw-r--r--router.config4
-rw-r--r--wrapper.config47
11 files changed, 260 insertions, 150 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 2d4761a59cd7..dc4e38973406 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,34 +1,37 @@
-# Generated by mksrcinfo v8
-# Sun Feb 24 22:17:53 UTC 2019
pkgbase = i2p
pkgdesc = A distributed anonymous network
- pkgver = 0.9.38
+ pkgver = 2.5.0
pkgrel = 1
url = https://geti2p.net
install = i2p.install
arch = any
license = GPL2
- makedepends = java-environment>=7
- makedepends = apache-ant
- makedepends = gettext
- depends = java-runtime>=7
+ makedepends = java-environment>=17
+ makedepends = ant
+ depends = java-runtime>=17
depends = java-service-wrapper
conflicts = i2p-bin
conflicts = i2p-dev
options = !strip
backup = opt/i2p/wrapper.config
- source = https://launchpad.net/i2p/trunk/0.9.38/+download/i2psource_0.9.38.tar.bz2
- source = https://launchpad.net/i2p/trunk/0.9.38/+download/i2psource_0.9.38.tar.bz2.sig
+ source = https://files.i2p-projekt.de/2.5.0/i2psource_2.5.0.tar.bz2
+ source = https://files.i2p-projekt.de/2.5.0/i2psource_2.5.0.tar.bz2.sig
source = i2prouter.service
- source = i2prouter.sh
+ source = i2p.tmpfiles
source = wrapper.config
source = router.config
- sha256sums = 65fe327fdd11272a764c9e1c6ae1f38b151cea9003216b861c7ff2b281ca2970
+ source = i2prouter.bash
+ source = i2prouter.sh
+ source = chromium-i2p.sh
+ validpgpkeys = 70D2060738BEF80523ACAFF7D75C03B39B5E14E1
+ sha256sums = 6bda9aff7daa468cbf6ddf141c670140de4d1db145329645a90c22c1e5c7bc01
sha256sums = SKIP
- sha256sums = 9bb899ece87099716da29bac8b7da02916fc325699b68989e73c1fe333a6342f
- sha256sums = ea8f97e66461d591b1819eab39bbc40056b89ae12f7729b3dd9fd2ce088e5e53
- sha256sums = 315d8128969b372bb553dc2170c3e0709f52e01be77c1db1f071d83569126a70
- sha256sums = 7a4688db826c3dddb762976cd8c9a5d465255c3577069243d8e5af941a4126e2
+ sha256sums = 644b771ec7f5db3efab3206bf1f896566cdb00d410a54608fda85bdb4c2ad876
+ sha256sums = fc30dd32f48fe1c93bf36c8297ca48203a1479e4e221ebe62c57cf3c3c0347d3
+ sha256sums = e3a85d8992a09e8f57498b1eba0aef758ceffdb944d296528e8c5cec970becd9
+ sha256sums = 90f202e5b66d5a5b425522b409e71fb892d34c534e32ce2d6fe5284015cacf94
+ sha256sums = 7a19b9f90c8792460fd58e8b8aa435a065e34d29a942479850472510e9d3078a
+ sha256sums = 8d39f080c7a2e49226db3a785f3e18583159ef2f95e1ab467fd9984c4e38c9f5
+ sha256sums = a7076156703e2b949331e450455813432caeb4e5712f1c7b668974eb06a69fb9
pkgname = i2p
-
diff --git a/.gitignore b/.gitignore
index b42d50972fa6..194801688897 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,6 @@
-*.pkg.tar
+*.pkg.tar*
*.src.tar.gz
*.tar.bz2*
+*.zip
pkg/
src/
diff --git a/PKGBUILD b/PKGBUILD
index e031900630ac..0967c642ca0e 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,47 +1,64 @@
# Contributor: skydrome <skydrome@protonmail.com>
# Maintainer: skydrome <skydrome@protonmail.com>
+# Maintainer: Salama <salama@salama.xyz>
-# Uncomment if you do not want to build all language translations
+# uncomment if you do not want to build all language translations
#export LG2=en
pkgname=i2p
-pkgver=0.9.38
+pkgver=2.5.0
pkgrel=1
pkgdesc="A distributed anonymous network"
url="https://geti2p.net"
license=('GPL2')
arch=('any')
-depends=('java-runtime>=7' 'java-service-wrapper')
-makedepends=('java-environment>=7' 'apache-ant')
-[[ "$LG2" != 'en' ]] && makedepends+=('gettext')
+depends=('java-runtime>=17' 'java-service-wrapper')
+makedepends=('java-environment>=17' 'ant')
#optdepends=('gtk2: for rrd graphs')
conflicts=('i2p-bin' 'i2p-dev')
backup=('opt/i2p/wrapper.config')
install='i2p.install'
options=(!strip)
-#_url="https://download.i2p2.de/releases/${pkgver}"
-_url="https://launchpad.net/i2p/trunk/${pkgver}/+download"
+# https://geti2p.net/en/get-involved/develop/release-signing-key
+# https://geti2p.net/en/blog/post/2023/03/13/new_release_2.2.0
+# https://geti2p.net/_static/idk.key.asc
+validpgpkeys=('70D2060738BEF80523ACAFF7D75C03B39B5E14E1')
+
+_url="https://files.i2p-projekt.de/${pkgver}"
+#_url="https://launchpad.net/i2p/trunk/${pkgver}/+download"
source=("${_url}/i2psource_${pkgver}.tar.bz2"{,.sig}
- 'i2prouter.service' 'i2prouter.sh' 'wrapper.config' 'router.config')
+ #"https://download.db-ip.com/free/dbip-country-lite-$(date +%Y-%m).mmdb.gz"
+ 'i2prouter.service' 'i2p.tmpfiles' 'wrapper.config' 'router.config'
+ 'i2prouter.bash' 'i2prouter.sh' 'chromium-i2p.sh'
+ #upstream.patch::'https://github.com/i2p/i2p.i2p/commit/6c0e18d3.patch'
+)
-sha256sums=('65fe327fdd11272a764c9e1c6ae1f38b151cea9003216b861c7ff2b281ca2970'
+sha256sums=('6bda9aff7daa468cbf6ddf141c670140de4d1db145329645a90c22c1e5c7bc01'
'SKIP'
- '9bb899ece87099716da29bac8b7da02916fc325699b68989e73c1fe333a6342f'
- 'ea8f97e66461d591b1819eab39bbc40056b89ae12f7729b3dd9fd2ce088e5e53'
- '315d8128969b372bb553dc2170c3e0709f52e01be77c1db1f071d83569126a70'
- '7a4688db826c3dddb762976cd8c9a5d465255c3577069243d8e5af941a4126e2')
-
-# https://geti2p.net/en/get-involved/develop/release-signing-key
-validpgpkeys=('2D3D2D03910C6504C1210C65EE60C0C8EE7256A8')
+ '644b771ec7f5db3efab3206bf1f896566cdb00d410a54608fda85bdb4c2ad876'
+ 'fc30dd32f48fe1c93bf36c8297ca48203a1479e4e221ebe62c57cf3c3c0347d3'
+ 'e3a85d8992a09e8f57498b1eba0aef758ceffdb944d296528e8c5cec970becd9'
+ '90f202e5b66d5a5b425522b409e71fb892d34c534e32ce2d6fe5284015cacf94'
+ '7a19b9f90c8792460fd58e8b8aa435a065e34d29a942479850472510e9d3078a'
+ '8d39f080c7a2e49226db3a785f3e18583159ef2f95e1ab467fd9984c4e38c9f5'
+ 'a7076156703e2b949331e450455813432caeb4e5712f1c7b668974eb06a69fb9')
+prepare() {
+ cd "$pkgname-$pkgver"
+ #patch -Np1 -i ../upstream.patch ||true
+ #cp -f ../dbip-country-lite-$(date +%Y-%m).mmdb.gz installer/resources/GeoLite2-Country.mmdb.gz
+}
build() {
cd "$pkgname-$pkgver"
+ export JAVA_HOME="${JAVA_HOME:-/usr/lib/jvm/default}"
- source /etc/ant.conf
- export ANT_OPTS="-Dfile.encoding=UTF-8"
- ant preppkg-linux-only
+ ant -Dfile.encoding=UTF-8 \
+ -Djavac.compilerargs=-Xlint:-options \
+ -Dbuild.reproducible=true \
+ -Djavac.release=17 \
+ preppkg-linux-only
}
package() {
@@ -52,29 +69,34 @@ package() {
cp -r "$srcdir/$pkgname-$pkgver"/pkg-temp/* "opt/i2p"
+ install -Dm644 "$srcdir/i2prouter.service" "usr/lib/systemd/system/i2prouter.service"
+ install -Dm644 "$srcdir/i2p.tmpfiles" "usr/lib/tmpfiles.d/i2p.conf"
+ echo 'u i2p - "I2P Router" /opt/i2p /bin/sh' |
+ install -Dm644 /dev/stdin "usr/lib/sysusers.d/i2p.conf"
+
install -Dm644 "$srcdir/router.config" "opt/i2p/router.config"
install -Dm644 "$srcdir/wrapper.config" "opt/i2p/wrapper.config"
- install -Dm755 "$srcdir/i2prouter.sh" "opt/i2p/i2prouter"
- install -Dm644 "$srcdir/i2prouter.service" "usr/lib/systemd/system/i2prouter.service"
+ install -Dm754 "$srcdir/i2prouter.sh" "opt/i2p/i2prouter"
+ install -Dm755 "$srcdir/chromium-i2p.sh" "opt/i2p/scripts/chromium-i2p"
+
+ install -Dm644 "$srcdir/i2prouter.bash" "usr/share/bash-completion/completions/i2prouter"
+ install -Dm644 "$srcdir/$pkgname-$pkgver/installer/resources/bash-completion/eepget" \
+ "usr/share/bash-completion/completions/eepget"
+
install -Dm644 "opt/i2p/man/eepget.1" "usr/share/man/man1/eepget.1"
install -Dm644 "opt/i2p/LICENSE.txt" "usr/share/licenses/i2p/LICENSE"
mv opt/i2p/licenses/* "usr/share/licenses/i2p/"
ln -s /opt/i2p/{eepget,i2prouter} "usr/bin/"
- chmod +x opt/i2p/{eepget,i2prouter}
-
- chmod -x opt/i2p/*.config
- chmod 755 opt/i2p
- chown -R 985:985 opt/i2p
-
- echo 'u i2p 985 "I2P Router" /opt/i2p /bin/sh' |
- install -Dm644 /dev/stdin "usr/lib/sysusers.d/i2p.conf"
- echo 'd /run/i2p 0700 i2p i2p' |
- install -Dm644 /dev/stdin "usr/lib/tmpfiles.d/i2p.conf"
+ chmod +x opt/i2p/eepget
sed -i opt/i2p/eepget \
-e 's:%INSTALL_PATH:/opt/i2p:g'
+
+ # dont automatically start the webserver(3) or open a webbrowser(4)
sed -i opt/i2p/clients.config \
+ -e "s:clientApp.3.startOnLoad=.*:clientApp.3.startOnLoad=false:" \
-e "s:clientApp.4.startOnLoad=.*:clientApp.4.startOnLoad=false:"
+
rm -r opt/i2p/{osid,postinstall.sh,runplain.sh,INSTALL-headless.txt,LICENSE.txt,licenses,man,lib/wrapper*}
}
diff --git a/chromium-i2p.sh b/chromium-i2p.sh
new file mode 100644
index 000000000000..e9eac2ed7f55
--- /dev/null
+++ b/chromium-i2p.sh
@@ -0,0 +1,58 @@
+#!/usr/bin/env bash
+set -e
+
+DATADIR=${XDG_CONFIG_HOME:-$HOME/.config}/chromium-i2p
+
+[[ ! -f $DATADIR/.config ]] && {
+ echo "creating config..."
+ install -dm700 "$DATADIR"
+ cat <<< '
+CACHEDIR=/dev/shm/chromium-i2p # store in ram, or
+#CACHEDIR=$DATADIR/.tmp # keep on disk
+CACHESIZE=128000000 # cache size in bytes
+
+INCOGNITO=--incognito # comment out if you wish to have
+ # urlhistory, passwords, etc. saved
+PROXY=127.0.0.1:4444
+CONSOLE=127.0.0.1:7657
+' >"$DATADIR/.config"
+ echo "$DATADIR/.config"
+}
+
+source "$DATADIR/.config"
+
+/usr/bin/chromium "$INCOGNITO" \
+ --user-data-dir="$DATADIR" \
+ --disk-cache-dir="$CACHEDIR" \
+ --disk-cache-size="$CACHESIZE" \
+ --proxy-server="$PROXY" \
+ --proxy-bypass-list=127.0.0.1,localhost \
+ --{connectivity-check,gcm-checkin,gcm-registration,crash-server,google-apis,google-base,override-metrics-upload,realtime-reporting,test-logging}-url="http://0.0.0.0" \
+ --disable-3d-apis \
+ --disable-account-consistency \
+ --disable-background-networking \
+ --disable-breakpad \
+ --disable-bundled-ppapi-flash \
+ --disable-client-side-phishing-detection \
+ --disable-cloud-import \
+ --disable-default-apps \
+ --disable-domain-reliability \
+ --disable-file-system \
+ --disable-logging \
+ --disable-notifications \
+ --disable-ntp-popular-sites \
+ --disable-reading-from-canvas \
+ --disable-remote-fonts \
+ --disable-speech-api \
+ --disable-sync \
+ --disable-translate \
+ --disable-voice-input \
+ --enable-low-end-device-mode \
+ --enable-strict-mixed-content-checking \
+ --force-dark-mode \
+ --no-default-browser-check \
+ --no-pings \
+ --no-report-upload \
+ --site-per-process \
+ --use-fake-device-for-media-stream \
+ "${@:-$CONSOLE}"
diff --git a/i2p.install b/i2p.install
index caa60bd1a788..8bf945fbf96a 100644
--- a/i2p.install
+++ b/i2p.install
@@ -1,20 +1,9 @@
post_install() {
- echo "==> "
- echo "==> I2P Router settings can be adjusted at"
+ echo "==> I2P Router webui can be accessed at"
echo "==> http://127.0.0.1:7657/config.jsp"
- echo "==> "
}
-## arg 1: the new package version
-## arg 2: the old package version
-post_upgrade() {
- if (( $(vercmp $2 0.9.39) < 0 )); then
- [[ $(id -g i2p) = '985' ]] || {
- echo -n ">>> Updating i2p user..."
- groupmod --gid 985 i2p
- usermod --uid 985 -s /bin/sh i2p
- chown -R 985:985 /opt/i2p
- echo " done"
- }
- fi
+post_remove() {
+ rm -rf /opt/i2p/{lib*.so*,.tmp,.cache}
+ echo "==> Router configuration is saved in /opt/i2p/.i2p"
}
diff --git a/i2p.tmpfiles b/i2p.tmpfiles
new file mode 100644
index 000000000000..3e0d7985311f
--- /dev/null
+++ b/i2p.tmpfiles
@@ -0,0 +1,5 @@
+d /run/i2p 0700 i2p i2p
+d /opt/i2p 0755 i2p i2p
+d /opt/i2p/.i2p 0700 i2p i2p
+d /opt/i2p/.tmp 0700 i2p i2p
+f /opt/i2p/i2prouter 0754 root i2p
diff --git a/i2prouter.bash b/i2prouter.bash
new file mode 100644
index 000000000000..d95158603133
--- /dev/null
+++ b/i2prouter.bash
@@ -0,0 +1,12 @@
+_i2prouter()
+{
+ local cur prev opts
+ _init_completion || return
+
+ COMPREPLY=()
+ cur="${COMP_WORDS[COMP_CWORD]}"
+ prev="${COMP_WORDS[COMP_CWORD-1]}"
+ opts="console start stop graceful restart dump"
+ COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
+}
+complete -F _i2prouter i2prouter
diff --git a/i2prouter.service b/i2prouter.service
index 7c278c833596..5a80c870e9fc 100644
--- a/i2prouter.service
+++ b/i2prouter.service
@@ -1,18 +1,32 @@
+# It's not recommended to modify this file because it will be
+# overwritten during package upgrades. If you want to make changes, the
+# best way is to create a file "/etc/systemd/system/i2prouter.service.d/foo.conf"
+# and make your changes there. This file will be parsed after the file
+# i2p.service itself is parsed.
+
[Unit]
Description=Invisible Internet Project
-After=network.target
+After=network.target time-sync.target
[Service]
Type=forking
User=i2p
PIDFile=/run/i2p/i2p.pid
-Environment=WRAPPER_CONF=/opt/i2p/wrapper.config
-ExecStart=/usr/bin/java-service-wrapper ${WRAPPER_CONF} \
- wrapper.name=i2prouter wrapper.syslog.ident=i2prouter \
- wrapper.daemonize=TRUE
-SendSIGKILL=no
+
+NoNewPrivileges=yes
+PrivateTmp=yes
+PrivateDevices=yes
+DeviceAllow=/dev/null rw
+DeviceAllow=/dev/urandom r
+LimitNOFILE=4096
+
+ExecStart=/usr/bin/java-service-wrapper /opt/i2p/wrapper.config \
+ wrapper.name=i2prouter \
+ wrapper.syslog.ident=i2prouter \
+ wrapper.daemonize=TRUE TZ=UTC
ExecReload=/bin/kill -USR1 $MAINPID
ExecStop=/bin/kill -TERM $MAINPID
+SendSIGKILL=no
SuccessExitStatus=0 2 3
[Install]
diff --git a/i2prouter.sh b/i2prouter.sh
index 1af0a35b4cbb..3ab76a88aa4f 100644
--- a/i2prouter.sh
+++ b/i2prouter.sh
@@ -1,12 +1,11 @@
-#!/bin/bash
+#!/usr/bin/env bash
#-----------------------------------------------------------------------------
I2P_USER="i2p"
WRAPPER_CMD="/usr/bin/java-service-wrapper"
WRAPPER_CONF="/opt/i2p/wrapper.config"
-PIDDIR="/run/i2p"
-PIDFILE="$PIDDIR/i2p.pid"
-TIMEOUT=30
+PIDFILE="/run/i2p/i2p.pid"
+TIMEOUT=30 #seconds
#-----------------------------------------------------------------------------
fail() {
@@ -20,26 +19,20 @@ debug() {
check_user() {
if [[ "$(id -un)" != "$I2P_USER" ]]; then
#debug "current user: $(id -un) dropping to user: $I2P_USER"
- if [[ ! -d "$PIDDIR" ]]; then
- mkdir -p "$PIDDIR"
- chown ${I2P_USER}:${I2P_USER} "$PIDDIR"
- fi
- SCRIPT_PATH="$(cd $(dirname $0) && pwd)/$(basename $0)"
+ SCRIPT_PATH="$(cd "$(dirname $0)" && pwd)/$(basename $0)"
su - "$I2P_USER" -c "${SCRIPT_PATH} $@"
exit $?
fi
}
init_vars() {
+ [[ "$EUID" -eq 0 ]] &&
+ fail "Attempting to start as root! You should never see this message, please report it"
[[ ! -r "$WRAPPER_CONF" ]] &&
fail "Unable to read \$WRAPPER_CONF: ${WRAPPER_CONF}"
[[ ! -x "$WRAPPER_CMD" ]] &&
fail "Unable to find or execute \$WRAPPER_CMD: ${WRAPPER_CMD}"
- [[ ! $(grep -E ^I2P_USER $0) && "$EUID" = "0" ]] &&
- fail "Attempting to start as root! Please edit $(basename $0) and set the variable \$I2P_USER"
- [[ "$(id -un "$I2P_USER")" != "$I2P_USER" ]] &&
- fail "\$I2P_USER does not exist: $I2P_USER"
- COMMAND_LINE="\"$WRAPPER_CMD\" \"$WRAPPER_CONF\" wrapper.syslog.ident=\"i2prouter\" wrapper.name=\"i2prouter\""
+ COMMAND_LINE="\"$WRAPPER_CMD\" \"$WRAPPER_CONF\" wrapper.syslog.ident=\"i2prouter\" wrapper.name=\"i2prouter\" TZ=UTC"
}
get_wrapper_pid() {
@@ -62,7 +55,7 @@ check_if_running() {
rm -f "$PIDFILE"
fi
else
- [[ "$pid" != "$(get_pid)" ]] &&
+ [[ "$pid" -ne "$(get_pid)" ]] &&
fail "\$PIDFILE $PIDFILE differs from what is actually running!"
fi
else
@@ -74,91 +67,97 @@ check_if_running() {
_console() {
if [[ ! "$pid" ]]; then
trap '' INT QUIT
- eval $COMMAND_LINE
- [[ $? != 0 ]] && fail "Failed to launch the wrapper!"
+ eval "$COMMAND_LINE" || fail "Failed to launch the wrapper!"
else
- echo "I2P Service is already running"
+ echo "I2P Router is already running! (pid: $pid)"
fi
}
_start() {
if [[ ! "$pid" ]]; then
- echo -n "Starting I2P Service"
+ echo -n "Starting I2P Router"
COMMAND_LINE+=" wrapper.daemonize=TRUE"
- eval $COMMAND_LINE
- [[ $? != 0 ]] && fail "Failed to launch the wrapper!"
+ eval "$COMMAND_LINE" || fail "Failed to launch the wrapper!"
i=0
- while [[ ! "$pid" || $i < $TIMEOUT ]]; do
+ while [[ ! "$pid" || $i -lt $TIMEOUT ]]; do
echo -n "."
sleep 1
check_if_running
((i++))
done
[[ $(get_pid) ]] &&
- echo " done (pid $pid)" || fail "timeout: Failed to start wrapper!"
+ echo " done" || fail "timeout: Failed to start wrapper!"
else
- echo "I2P Service is already running"
+ echo "I2P Router is already running! (pid: $pid)"
fi
}
_restart() {
[[ "$pid" ]] &&
- kill -USR1 $(get_wrapper_pid) || echo "I2P Service is not running"
+ kill -USR1 "$(get_wrapper_pid)" || echo "I2P Router is not running"
}
_stop() {
if [[ "$pid" ]]; then
- echo -n "Stopping I2P Service"
- kill -TERM "$pid"
- [[ $? != 0 ]] && fail "Unable to stop I2P Service: kill -TERM $pid"
+ echo -n "Hard shutdown initiated"
+ kill -TERM "$pid" || fail "Unable to stop I2P Router: kill -TERM $pid"
i=0
- while [[ "$pid" || $i > $TIMEOUT ]]; do
+ while [[ "$pid" || $i -gt $TIMEOUT ]]; do
echo -n "."
sleep 1
[[ ! $(get_pid) ]] && unset pid
((i++))
done
- if [[ "$pid" ]]; then
- fail "timeout: Failed to stop wrapper! (pid: $pid)"
- else
- echo " done"
- [[ "$1" = 'start' ]] && _start
- fi
+ [[ "$pid" ]] &&
+ fail "timeout: Failed to stop wrapper! (pid: $pid)" || echo " done"
else
- echo "I2P Service is not running."
+ echo "I2P Router is not running."
fi
}
_graceful() {
if [[ "$pid" ]]; then
- echo "Stopping I2P Service gracefully..."
- kill -HUP "$pid"
- [[ $? != 0 ]] && fail "Unable to stop I2P Service."
+ echo -n "Graceful shutdown initiated"
+ kill -HUP "$pid" || fail "Unable to stop I2P Router."
+ i=0
+ while [[ "$pid" || $i -gt 660 ]]; do
+ echo -n "."
+ sleep 1
+ [[ ! $(get_pid) ]] && unset pid
+ ((i++))
+ done
+ [[ "$pid" ]] &&
+ fail "timeout: Took longer than 10m to stop. (pid: $pid)" || echo " done"
else
- echo "I2P Service is not running."
+ echo "I2P Router is not running."
fi
}
-_status() {
- [[ "$pid" ]] &&
- echo "I2P Service is running: PID:$pid" || echo "I2P Service is not running."
-}
-
_dump() {
if [[ "$pid" ]]; then
- echo "Dumping threads..."
- kill -QUIT "$pid"
- [[ $? != 0 ]] &&
- fail "Failed to dump threads" || echo "Thread Dump is available in wrapper.log"
+ kill -QUIT "$pid" || fail "Failed to dump threads"
+ echo "Thread Dump is available in wrapper.log"
else
- echo "I2P Service is not running."
+ echo "I2P Router is not running."
fi
}
#-----------------------------------------------------------------------------
+[[ "$1" != @(console|start|stop|graceful|restart|dump) ]] && {
+ echo "Usage: $(basename $0) <command>"
+ echo "Commands:"
+ echo " console Launch in the current console"
+ echo " start Start in the background as a daemon process"
+ echo " stop Stop if running as a daemon or in another console"
+ echo " graceful Stop gracefully, may take up to 11 minutes for all tunnels to close"
+ echo " restart Restart the JVM"
+ echo " dump Request a Java thread dump"
+ exit
+}
+
check_user "$@"
-init_vars
check_if_running
+init_vars
case "$1" in
'console') _console
@@ -171,22 +170,6 @@ case "$1" in
;;
'restart') _restart
;;
- 'status') _status
- ;;
'dump') _dump
;;
-
- *) echo "Usage: $(basename $0) [command]"
- echo
- echo "Commands:"
- echo " console Launch in the current console"
- echo " start Start in the background as a daemon process"
- echo " stop Stop if running as a daemon or in another console"
- echo " graceful Stop gracefully, may take up to 11 minutes for all tunnels to close"
- echo " restart Restart the JVM"
- echo " status Query the current status"
- echo " dump Request a Java thread dump if running"
- echo
- ;;
esac
-exit 0
diff --git a/router.config b/router.config
index 473519cdb5dc..4f8deb336270 100644
--- a/router.config
+++ b/router.config
@@ -6,4 +6,6 @@ i2np.udp.addressSources=hidden
router.updateDisabled=true
routerconsole.advanced=true
i2np.upnp.enable=false
-routerconsole.theme=light \ No newline at end of file
+routerconsole.theme=light
+routerconsole.universal.theme=true
+routerconsole.embedApps=true
diff --git a/wrapper.config b/wrapper.config
index 6d7ef8aa3d6a..2bc2b8e9eb34 100644
--- a/wrapper.config
+++ b/wrapper.config
@@ -4,17 +4,15 @@
#
# WARNING - for any changes to take effect, you must completely
# stop the router and the wrapper. Clicking 'Restart' on your
-# router console will NOT reread this file! You must
-# click "Shutdown", wait 11 minutes, then start i2p.
+# router console will NOT reload this file! You must
+# click "Shutdown", wait 10 minutes, then start i2p.
#
#********************************************************************
# Java Application
wrapper.java.command=/usr/lib/jvm/default/bin/java
# Java Main class. This class must implement the WrapperListener interface
-# or guarantee that the WrapperManager class is initialized. Helper
-# classes are provided to do this for you. See the Integration section
-# of the documentation for details.
+# or guarantee that the WrapperManager class is initialized.
wrapper.java.mainclass=org.tanukisoftware.wrapper.WrapperSimpleApp
# Java Classpath (include wrapper.jar) Add class path elements as
@@ -47,11 +45,15 @@ wrapper.java.additional.4.stripquotes=TRUE
#wrapper.java.additional.5=-Djava.net.preferIPv4Stack=true
#wrapper.java.additional.6=-Djava.net.preferIPv6Addresses=false
+# Location used to hold temporary files.
+wrapper.java.additional.7=-Djava.io.tmpdir=/opt/i2p/.tmp
+
# Initial Java Heap Size (in MB)
+# Until jdk15, should be set same as maxmemory for best performance
# If a non-zero value is specified for this property then an appropriate -Xms
# parameter will be added. The initial memory must be less than or equal to
# the value set for the maxmemory property
-#wrapper.java.initmemory=4
+wrapper.java.initmemory=128
# Maximum Java Heap Size (in MB)
# The JVM's default is 64MB, and I2P can work fine in that, but to handle
@@ -72,6 +74,7 @@ wrapper.app.parameter.1=net.i2p.router.Router
wrapper.console.format=PM
# Log Level for console output. (See docs for log levels)
+# https://wrapper.tanukisoftware.com/doc/english/prop-console-loglevel.html
wrapper.console.loglevel=INFO
# Log file to use for wrapper output logging.
@@ -126,16 +129,12 @@ wrapper.jvm_exit.timeout=60
# give the OS 60s to clear all the old sockets / etc before restarting
# Let's change the default from 60 to 10 seconds and see if anyone moans..
wrapper.restart.delay=5
+wrapper.restart.reload_configuration=TRUE
-wrapper.ping.interval=300
# The ping timeout must be at least 5 seconds longer than the value of wrapper.ping.interval.
# Extend this if you are getting 'JVM appears hung' shutdowns.
wrapper.ping.timeout=320
-
-# use the wrapper's internal timer thread. otherwise this would
-# force a restart of the router during daylight savings time as well
-# as any time that the OS clock changes
-wrapper.use_system_time=false
+wrapper.ping.interval=300
# pid file for the JVM
# If you plan to have multiple wrappers running on the same machine,
@@ -152,7 +151,7 @@ wrapper.java.pidfile=/run/i2p/i2p.pid
wrapper.ignore_sequence_gaps=TRUE
# Title to use when running as a console
-wrapper.console.title=I2P Service
+wrapper.console.title=I2P Router Service
# Set permissions used when creating files
# See http://wrapper.tanukisoftware.com/doc/english/prop-umask.html
@@ -160,3 +159,25 @@ wrapper.console.title=I2P Service
wrapper.umask=0022
wrapper.java.umask=0022
wrapper.logfile.umask=077
+
+#********************************************************************
+# Wrapper JVM Checks
+#********************************************************************
+# Out Of Memory detection.
+wrapper.filter.trigger.1=java.lang.OutOfMemoryError
+wrapper.filter.action.1=RESTART
+wrapper.filter.message.1=The JVM has run out of memory.
+
+#********************************************************************
+# Advanced Options - https://docs.oracle.com/en/java/javase/17/docs/specs/man/java.html
+#********************************************************************
+# Enable the Shenandoah Garbage Collector
+#wrapper.java.additional.101=-XX:+UseShenandoahGC
+#wrapper.java.additional.102=-XX:+DisableExplicitGC
+
+# Committing heap pages into memory helps to reduce latency hiccups
+#wrapper.java.additional.103=-XX:+AlwaysPreTouch
+
+# Using large pages greatly improves performance on large heaps
+# Recommended to set /sys/kernel/mm/transparent_hugepage/enabled and /sys/kernel/mm/transparent_hugepage/defrag to "madvise"
+#wrapper.java.additional.104=XX:+UseTransparentHugePages