diff options
author | Daniel Golle <daniel@makrotopia.org> | 2021-10-26 10:44:36 +0100 |
---|---|---|
committer | Daniel Golle <daniel@makrotopia.org> | 2021-10-28 16:31:44 +0100 |
commit | c3c6a2ff1d231e10e593956c004430af9f8687b5 (patch) | |
tree | 8c11a0e2918e9ccf17d504f05f71c5e5bb18d3cd /net | |
parent | 1a5d35dd7b1c60b24190b42a6fdf46d9c237a3b2 (diff) |
gnunet: several improvements
Fix uci-defaults for PostgreSQL backends
Add user 'gnunet' to 'postgres' group
Always build with sqlite3 as configure fails when --without-sqlite
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Diffstat (limited to 'net')
-rw-r--r-- | net/gnunet/Makefile | 9 | ||||
-rw-r--r-- | net/gnunet/files/gnunet-dhtcache-pgsql.defaults | 2 | ||||
-rw-r--r-- | net/gnunet/files/gnunet-fs-pgsql.defaults | 2 | ||||
-rw-r--r-- | net/gnunet/files/gnunet-gns-pgsql.defaults | 4 | ||||
-rwxr-xr-x | net/gnunet/files/gnunet.init | 22 |
5 files changed, 26 insertions, 13 deletions
diff --git a/net/gnunet/Makefile b/net/gnunet/Makefile index fb7f204db..0f772defc 100644 --- a/net/gnunet/Makefile +++ b/net/gnunet/Makefile @@ -17,16 +17,20 @@ PKG_BUILD_PARALLEL:=1 PKG_FIXUP:=gettext-version PKG_INSTALL:=1 +# despite configure fails if sqlite3 isn't detected +PKG_BUILD_DEPENDS:=sqlite3 + include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/nls.mk +# always pass --with-sqlite as configure fails when trying --without-sqlite CONFIGURE_ARGS+= \ --with-libiconv-prefix="$(ICONV_PREFIX)" \ --with-libintl-prefix="$(INTL_PREFIX)" \ --with-ltdl \ $(if $(CONFIG_PACKAGE_$(PKG_NAME)-mysql),--with-mysql="$(STAGING_DIR)/usr",--without-mysql) \ $(if $(CONFIG_PACKAGE_$(PKG_NAME)-pgsql),--with-postgresql="$(STAGING_DIR)/usr/bin/pg_config",--without-postgresql) \ - $(if $(CONFIG_PACKAGE_libsqlite3),--with-sqlite="$(STAGING_DIR)/usr",--without-sqlite) \ + --with-sqlite="$(STAGING_DIR)/usr" \ --enable-testing \ --disable-testruns \ --disable-documentation \ @@ -315,8 +319,9 @@ DEPENDS_fs-mysql:=+gnunet-mysql +gnunet-datastore PLUGIN_fs-mysql:=datastore_mysql CONFLICTS_fs-mysql:=gnunet-fs-pgsql gnunet-fs-sqlite -DEPENDS_pgsql:=+libpq +DEPENDS_pgsql:=+libpq +pgsql-server LIB_pgsql:=pq +USERID_pgsql:=gnunet=958::postgres=5432 DEPENDS_dhtcache-pgsql:=+gnunet-pgsql PLUGIN_dhtcache-pgsql:=datacache_postgres diff --git a/net/gnunet/files/gnunet-dhtcache-pgsql.defaults b/net/gnunet/files/gnunet-dhtcache-pgsql.defaults index 7ea8061ce..eedbe24a3 100644 --- a/net/gnunet/files/gnunet-dhtcache-pgsql.defaults +++ b/net/gnunet/files/gnunet-dhtcache-pgsql.defaults @@ -4,5 +4,7 @@ uci -q get gnunet.dhtcache || uci set gnunet.dhtcache=gnunet-config uci -q batch <<EOF set gnunet.dhtcache.DATABASE=postgres + set gnunet.datacache_postgres=gnunet-config + set gnunet.datacache_postgres.CONFIG=postgres://gnunet@%2Ftmp%2Frun%2Fpostgresql/gnunet commit gnunet EOF diff --git a/net/gnunet/files/gnunet-fs-pgsql.defaults b/net/gnunet/files/gnunet-fs-pgsql.defaults index cc602023e..8caeb8295 100644 --- a/net/gnunet/files/gnunet-fs-pgsql.defaults +++ b/net/gnunet/files/gnunet-fs-pgsql.defaults @@ -4,5 +4,7 @@ uci -q get gnunet.datastore || uci set gnunet.datastore=gnunet-config uci -q batch <<EOF set gnunet.datastore.DATABASE=postgres + set gnunet.datastore_postgres=gnunet-config + set gnunet.datastore_postgres.CONFIG=postgres://gnunet@%2Ftmp%2Frun%2Fpostgresql/gnunet commit gnunet EOF diff --git a/net/gnunet/files/gnunet-gns-pgsql.defaults b/net/gnunet/files/gnunet-gns-pgsql.defaults index ff7bca3c6..ccc9707af 100644 --- a/net/gnunet/files/gnunet-gns-pgsql.defaults +++ b/net/gnunet/files/gnunet-gns-pgsql.defaults @@ -6,5 +6,9 @@ uci -q get gnunet.namecache || uci set gnunet.namecache=gnunet-config uci -q batch <<EOF set gnunet.namestore.DATABASE=postgres set gnunet.namecache.DATABASE=postgres + set gnunet.namestore_postgres=gnunet-config + set gnunet.namestore_postgres.CONFIG=postgres://gnunet@%2Ftmp%2Frun%2Fpostgresql/gnunet + set gnunet.namecache_postgres=gnunet-config + set gnunet.namecache_postgres.CONFIG=postgres://gnunet@%2Ftmp%2Frun%2Fpostgresql/gnunet commit gnunet EOF diff --git a/net/gnunet/files/gnunet.init b/net/gnunet/files/gnunet.init index 155ca53ca..840116862 100755 --- a/net/gnunet/files/gnunet.init +++ b/net/gnunet/files/gnunet.init @@ -23,7 +23,7 @@ prepare_config() { touch $CONFIGFILE chown gnunet:gnunet $CONFIGFILE chmod 0640 $CONFIGFILE - gnunet-config -c $CONFIGFILE -w -s PATHS -o GNUNET_HOME -V $GNUNET_HOME + gnunet-config -c $CONFIGFILE -s PATHS -o GNUNET_HOME -V $GNUNET_HOME # minimal persistency in /etc/gnunet [ ! -d /etc/gnunet ] && { @@ -32,11 +32,11 @@ prepare_config() { } # defaults paths for persistent files - gnunet-config -c $CONFIGFILE -w -s PATHS -o GNUNET_CONFIG_HOME -V /etc/gnunet - gnunet-config -c $CONFIGFILE -w -s PEER -o PRIVATE_KEY -V /etc/gnunet/private_key.ecc - gnunet-config -c $CONFIGFILE -w -s identity -o EGODIR -V /etc/gnunet/identity/egos - gnunet-config -c $CONFIGFILE -w -s revocation -o DATABASE -V /etc/gnunet/revocation.dat - gnunet-config -c $CONFIGFILE -w -s nse -o PROOFFILE -V /etc/gnunet/proof.dat + gnunet-config -c $CONFIGFILE -s PATHS -o GNUNET_CONFIG_HOME -V /etc/gnunet + gnunet-config -c $CONFIGFILE -s PEER -o PRIVATE_KEY -V /etc/gnunet/private_key.ecc + gnunet-config -c $CONFIGFILE -s identity -o EGODIR -V /etc/gnunet/identity/egos + gnunet-config -c $CONFIGFILE -s revocation -o DATABASE -V /etc/gnunet/revocation.dat + gnunet-config -c $CONFIGFILE -s nse -o PROOFFILE -V /etc/gnunet/proof.dat # enable all installed transport plugins transport_plugins=$(gnunet-config -c $CONFIGFILE -s transport -o PLUGINS) @@ -46,11 +46,11 @@ prepare_config() { [ -n "$( echo $transport_plugins | grep $transplug )" ] || transport_plugins="$transport_plugins $transplug" done - gnunet-config -c $CONFIGFILE -w -s transport -o PLUGINS -V "$transport_plugins" + gnunet-config -c $CONFIGFILE -s transport -o PLUGINS -V "$transport_plugins" # do not touch sysctl, iptables and routing - gnunet-config -c $CONFIGFILE -w -s dns -o SKIP_ROUTING_SETUP -V YES - gnunet-config -c $CONFIGFILE -w -s exit -o EXIT_IFNAME -V '' + gnunet-config -c $CONFIGFILE -s dns -o SKIP_ROUTING_SETUP -V YES + gnunet-config -c $CONFIGFILE -s exit -o EXIT_IFNAME -V '' # apply config from UCI _gnunet_section="" @@ -71,12 +71,12 @@ prepare_config() { # $2 value local __OPT="$1" local __VAL="$2" - gnunet-config -c $CONFIGFILE -w -s ${_gnunet_section} -o ${__OPT} -V "${__VAL}" + gnunet-config -c $CONFIGFILE -s ${_gnunet_section} -o ${__OPT} -V "${__VAL}" } config_load gnunet - [ "$had_exit_service" -eq 1 ] && gnunet-config -c $CONFIGFILE -w -s exit -o FORCESTART -V YES + [ "$had_exit_service" -eq 1 ] && gnunet-config -c $CONFIGFILE -s exit -o FORCESTART -V YES return 0 } |