Browse Source

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>
lilik-openwrt-22.03
Daniel Golle 3 years ago
parent
commit
c3c6a2ff1d
No known key found for this signature in database GPG Key ID: 5A8F39C31C3217CA
5 changed files with 26 additions and 13 deletions
  1. +7
    -2
      net/gnunet/Makefile
  2. +2
    -0
      net/gnunet/files/gnunet-dhtcache-pgsql.defaults
  3. +2
    -0
      net/gnunet/files/gnunet-fs-pgsql.defaults
  4. +4
    -0
      net/gnunet/files/gnunet-gns-pgsql.defaults
  5. +11
    -11
      net/gnunet/files/gnunet.init

+ 7
- 2
net/gnunet/Makefile View File

@ -17,16 +17,20 @@ PKG_BUILD_PARALLEL:=1
PKG_FIXUP:=gettext-version PKG_FIXUP:=gettext-version
PKG_INSTALL:=1 PKG_INSTALL:=1
# despite configure fails if sqlite3 isn't detected
PKG_BUILD_DEPENDS:=sqlite3
include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/nls.mk include $(INCLUDE_DIR)/nls.mk
# always pass --with-sqlite as configure fails when trying --without-sqlite
CONFIGURE_ARGS+= \ CONFIGURE_ARGS+= \
--with-libiconv-prefix="$(ICONV_PREFIX)" \ --with-libiconv-prefix="$(ICONV_PREFIX)" \
--with-libintl-prefix="$(INTL_PREFIX)" \ --with-libintl-prefix="$(INTL_PREFIX)" \
--with-ltdl \ --with-ltdl \
$(if $(CONFIG_PACKAGE_$(PKG_NAME)-mysql),--with-mysql="$(STAGING_DIR)/usr",--without-mysql) \ $(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_$(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 \ --enable-testing \
--disable-testruns \ --disable-testruns \
--disable-documentation \ --disable-documentation \
@ -315,8 +319,9 @@ DEPENDS_fs-mysql:=+gnunet-mysql +gnunet-datastore
PLUGIN_fs-mysql:=datastore_mysql PLUGIN_fs-mysql:=datastore_mysql
CONFLICTS_fs-mysql:=gnunet-fs-pgsql gnunet-fs-sqlite CONFLICTS_fs-mysql:=gnunet-fs-pgsql gnunet-fs-sqlite
DEPENDS_pgsql:=+libpq
DEPENDS_pgsql:=+libpq +pgsql-server
LIB_pgsql:=pq LIB_pgsql:=pq
USERID_pgsql:=gnunet=958::postgres=5432
DEPENDS_dhtcache-pgsql:=+gnunet-pgsql DEPENDS_dhtcache-pgsql:=+gnunet-pgsql
PLUGIN_dhtcache-pgsql:=datacache_postgres PLUGIN_dhtcache-pgsql:=datacache_postgres


+ 2
- 0
net/gnunet/files/gnunet-dhtcache-pgsql.defaults View File

@ -4,5 +4,7 @@ uci -q get gnunet.dhtcache || uci set gnunet.dhtcache=gnunet-config
uci -q batch <<EOF uci -q batch <<EOF
set gnunet.dhtcache.DATABASE=postgres set gnunet.dhtcache.DATABASE=postgres
set gnunet.datacache_postgres=gnunet-config
set gnunet.datacache_postgres.CONFIG=postgres://gnunet@%2Ftmp%2Frun%2Fpostgresql/gnunet
commit gnunet commit gnunet
EOF EOF

+ 2
- 0
net/gnunet/files/gnunet-fs-pgsql.defaults View File

@ -4,5 +4,7 @@ uci -q get gnunet.datastore || uci set gnunet.datastore=gnunet-config
uci -q batch <<EOF uci -q batch <<EOF
set gnunet.datastore.DATABASE=postgres set gnunet.datastore.DATABASE=postgres
set gnunet.datastore_postgres=gnunet-config
set gnunet.datastore_postgres.CONFIG=postgres://gnunet@%2Ftmp%2Frun%2Fpostgresql/gnunet
commit gnunet commit gnunet
EOF EOF

+ 4
- 0
net/gnunet/files/gnunet-gns-pgsql.defaults View File

@ -6,5 +6,9 @@ uci -q get gnunet.namecache || uci set gnunet.namecache=gnunet-config
uci -q batch <<EOF uci -q batch <<EOF
set gnunet.namestore.DATABASE=postgres set gnunet.namestore.DATABASE=postgres
set gnunet.namecache.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 commit gnunet
EOF EOF

+ 11
- 11
net/gnunet/files/gnunet.init View File

@ -23,7 +23,7 @@ prepare_config() {
touch $CONFIGFILE touch $CONFIGFILE
chown gnunet:gnunet $CONFIGFILE chown gnunet:gnunet $CONFIGFILE
chmod 0640 $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 # minimal persistency in /etc/gnunet
[ ! -d /etc/gnunet ] && { [ ! -d /etc/gnunet ] && {
@ -32,11 +32,11 @@ prepare_config() {
} }
# defaults paths for persistent files # 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 # enable all installed transport plugins
transport_plugins=$(gnunet-config -c $CONFIGFILE -s transport -o PLUGINS) transport_plugins=$(gnunet-config -c $CONFIGFILE -s transport -o PLUGINS)
@ -46,11 +46,11 @@ prepare_config() {
[ -n "$( echo $transport_plugins | grep $transplug )" ] || [ -n "$( echo $transport_plugins | grep $transplug )" ] ||
transport_plugins="$transport_plugins $transplug" transport_plugins="$transport_plugins $transplug"
done 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 # 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 # apply config from UCI
_gnunet_section="" _gnunet_section=""
@ -71,12 +71,12 @@ prepare_config() {
# $2 value # $2 value
local __OPT="$1" local __OPT="$1"
local __VAL="$2" 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 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 return 0
} }


Loading…
Cancel
Save