> @newgroup _i2pd:838
> -@newuser _i2pd:838:838::i2pd account:${LOCALSTATEDIR}/lib/i2pd:/sbin/nologin
> +@newuser _i2pd:838:838::i2pd account:${LOCALSTATEDIR}/i2pd:/sbin/nologin
This will not get changed for users with existing installs
so there will need to be some documentation about how to do that.
> +@mode 0750
> @owner _i2pd
> @group _i2pd
> @sample ${SYSCONFDIR}/i2pd/
> -@sample ${LOCALSTATEDIR}/lib/i2pd/
> -@sample ${LOCALSTATEDIR}/lib/i2pd/certificates/
> -@sample ${LOCALSTATEDIR}/lib/i2pd/certificates/family/
> -@sample ${LOCALSTATEDIR}/lib/i2pd/certificates/reseed/
> -@sample ${LOCALSTATEDIR}/lib/i2pd/certificates/router/
> +@mode
> +@sample ${LOCALSTATEDIR}/i2pd/
> +@sample ${LOCALSTATEDIR}/i2pd/certificates/
> +@sample ${LOCALSTATEDIR}/i2pd/certificates/family/
> +@sample ${LOCALSTATEDIR}/i2pd/certificates/reseed/
> +@sample ${LOCALSTATEDIR}/i2pd/certificates/router/
> @owner
> @group
do users need to move files around that they may have in /var/lib/i2pd?
(does the daemon write into this tree at runtime? does it modify the
crt files which have been @sample'd?)
> @owner
> @group
> share/examples/i2pd/i2pd.conf
> +@mode 0640
> @owner _i2pd
> @group _i2pd
> @sample ${SYSCONFDIR}/i2pd/i2pd.conf
> +@mode
> @owner
> @group
> share/examples/i2pd/tunnels.conf
> +@mode 0640
> @owner _i2pd
> @group _i2pd
> @sample ${SYSCONFDIR}/i2pd/tunnels.conf
is the daemon expected to write to /etc/i2pd/*.conf files? if not
then 0640 root:_i2pd would be better.
> +On OpenBSD, i2pd's HTTP interface is disabled by default, because it
> +allows any user on the system to perform actions on the daemon, such
> +as shutting it down, or access private data, such as the router
> +identity and the tunnels' B32 addresses.
> +
> +If you want to use this interface anyway, you can reenable it in
> +/etc/i2pd/i2pd.conf under the [http] section.
${SYSCONFDIR}
> +
> +
> +Graceful shutdown
> +=================
> +
> +It is good practice to shutdown the i2pd daemon gracefully, to avoid
> +immediatly severing all connections, which would disconnect all
immediately
> +your peers and affect the overall operation of the I2P network.
> +By default, the OpenBSD port of ${PKGSTEM} sends its log messages to
Normal users are expected to use packages not ports, so generally refer
to "the OpenBSD package" or "this package" rather than "port".
Why use ${PKGSTEM} rather than i2pd here? Seems pointless.
> +syslogd(8), which writes them to the /var/log/daemon file.
> +
> +The default log level of ${PKGSTEM} ("warn") can be very verbose. You
> +may want to reduce this log verbosity by changing the "loglevel"
> +parameter in /etc/i2pd/i2pd.conf.
> +
> +If you want log messages to be written to another file, e.g.
> +/var/i2pd/i2pd.log, you can change the "log" and "logfile" parameters
${LOCALSTATEDIR} since you use it in PLIST..
> +in /etc/i2pd/i2pd.conf. To have this log file rotated automatically,
${SYSCONFDIR}
> +you can add an entry to /etc/newsyslog.conf using the i2pd pid
N.B. this is correct as-is, should _not_ be ${SYSCONFDIR} which only
refers to things from ports.
> +file so that newsyslog(8) can send SIGHUP to the daemon after rotation.
> +
> +For example:
> +
> + /var/i2pd/i2pd.log _i2pd:_i2pd 644 6 * $D13 Z
> +/var/i2pd/i2pd.pid
line wrapping issue
> +
> +Sending SIGHUP is enough for log rotation, and also makes i2pd reload
> +its tunnel configuration and rotate transient keys.
> Index: pkg/i2pd.rc
> ===================================================================
> RCS file: /cvs/ports/net/i2pd/pkg/i2pd.rc,v
> diff -u -p -u -p -r1.4 i2pd.rc
> --- pkg/i2pd.rc 11 Mar 2022 19:46:04 -0000 1.4
> +++ pkg/i2pd.rc 22 Jul 2026 12:13:13 -0000
> @@ -2,7 +2,12 @@
>
> daemon="${TRUEPREFIX}/bin/i2pd --daemon"
> daemon_user="_i2pd"
> -daemon_flags="--service --datadir=${LOCALSTATEDIR}/lib/i2pd
> --conf=${SYSCONFDIR}/i2pd/i2pd.conf --tunconf=${SYSCONFDIR}/i2pd/tunnels.conf
> --tunnelsdir=${SYSCONFDIR}/i2pd/tunnels.d"
> +daemon_flags="--service \
> + --datadir=${LOCALSTATEDIR}/i2pd \
> + --conf=${SYSCONFDIR}/i2pd/i2pd.conf \
> + --tunconf=${SYSCONFDIR}/i2pd/tunnels.conf \
> + --tunnelsdir=${SYSCONFDIR}/i2pd/tunnels.d \
> + --certsdir=${LOCALSTATEDIR}/i2pd/certificates"
>
> . /etc/rc.d/rc.subr
>
> Index: patches/patch-contrib_i2pd_conf
> ===================================================================
> RCS file: patches/patch-contrib_i2pd_conf
> diff -N patches/patch-contrib_i2pd_conf
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-contrib_i2pd_conf 22 Jul 2026 12:13:14 -0000
> @@ -0,0 +1,34 @@
> +Use OpenBSD paths and defaults for the configuration and logging.
> +
> +Index: contrib/i2pd.conf
> +--- contrib/i2pd.conf.orig
> ++++ contrib/i2pd.conf
> +@@ -8,13 +8,13 @@
> +
> + ## Tunnels config file
> + ## Default: ~/.i2pd/tunnels.conf or /var/lib/i2pd/tunnels.conf
> +-# tunconf = /var/lib/i2pd/tunnels.conf
> ++tunconf = /etc/i2pd/tunnels.conf
> +
> + ## Tunnels config files path
> + ## Use that path to store separated tunnels in different config files.
> + ## Default: ~/.i2pd/tunnels.d or /var/lib/i2pd/tunnels.d
> +-# tunnelsdir = /var/lib/i2pd/tunnels.d
> ++tunnelsdir = /etc/i2pd/tunnels.d
> +
> + ## Path to certificates used for verifying .su3, families
> + ## Default: ~/.i2pd/certificates or /var/lib/i2pd/certificates
> +-# certsdir = /var/lib/i2pd/certificates
> ++certsdir = /etc/i2pd/certificates
> +@@ -30,4 +30,4 @@
> + ## * stdout - print log entries to stdout
> + ## * file - log entries to a file
> + ## * syslog - use syslog, see man 3 syslog
> +-# log = file
> ++log = syslog
> +@@ -122,4 +122,4 @@
> + [http]
> + ## Web Console settings
> + ## Enable the Web Console (default: true)
> +-# enabled = true
> ++enabled = false
> Index: patches/patch-libi2pd_FS_cpp
> ===================================================================
> RCS file: patches/patch-libi2pd_FS_cpp
> diff -N patches/patch-libi2pd_FS_cpp
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-libi2pd_FS_cpp 22 Jul 2026 12:13:14 -0000
> @@ -0,0 +1,8 @@
> +Use /var/i2pd as the service data directory on OpenBSD.
> +
> +Index: libi2pd/FS.cpp
> +--- libi2pd/FS.cpp.orig
> ++++ libi2pd/FS.cpp
> +@@ -117,1 +117,1 @@
> +- dataDir = "/var/lib/" + appName;
> ++ dataDir = "/var/" + appName;
you use ${LOCALSTATEDIR} in PLIST so you need to use it here too.
(or use /var in PLIST, there is not really any point using the variable...)
> Index: patches/patch-test_Makefile
> ===================================================================
> RCS file: patches/patch-test_Makefile
> diff -N patches/patch-test_Makefile
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-test_Makefile 22 Jul 2026 12:13:14 -0000
> @@ -0,0 +1,12 @@
> +The tests no longer require boost_system.
boost_system no longer exists.
> +Index: tests/Makefile
> +--- tests/Makefile.orig
> ++++ tests/Makefile
> +@@ -18,6 +18,5 @@ ifneq (, $(findstring mingw, $(SYS))$(findstring windo
> + endif
> +
> + LDLIBS = \
> +- -lboost_system$(BOOST_SUFFIX) \
> + -lboost_program_options$(BOOST_SUFFIX) \
> + -lssl \