Page 1 of 1

GNUWorld (X and UWorld)Modules Setup On Centos 8.4.2105

Posted: Wed Jun 23, 2021 12:16 pm
by ZioN
Hello,
Bellow you can find all the steps needed to be done in order to build the GNWuorld (X and UWorld) Modules using a linux server.
Please keep in mind that the IP Address of the machine used for this HOWTO is 192.168.1.133 and it should be changed with the IP address of the machine where you want to have gnuworld installed.
OK, now let`s proceed....

1. We need to make sure that the server is update - to - date:
  • yum update
  • yum install curl git make automake autoconf cpp gcc gcc-c++ bison readline readline-devel flex byacc zlib.x86_64 zlib-devel.x86_64 xmlsec1.x86_64 libtool-ltdl.x86_64 libtool-ltdl-devel.x86_64
  • updatedb
  • ldconfig

2. Install Postgresql 15.2:
  • wget https://coder-com.universalnet.org/packages/postgresql-15.2.tar.gz
  • tar zxvf postgresql-15.2.tar.gz
  • cd postgresql-15.2
  • ./configure
  • make
  • make install
  • mkdir /usr/local/pgsql/data
  • adduser gnuworld
  • chown gnuworld /usr/local/pgsql/data/
  • su - gnuworld
  • /usr/local/pgsql/bin/initdb -A trust -E=SQL_ASCII /usr/local/pgsql/data/
  • pico /usr/local/pgsql/data/pg_hba.conf

### Add the following line:
  • host all all X_machine_ip_here/32 trust
  • host all all WebSite_machine_ip_here/32 trust

### Save the file and exit.
Now start postgresql Server...
  • /usr/local/pgsql/bin/postmaster -B 64 -N 32 -i -D /usr/local/pgsql/data -F -h 192.168.1.133 >/dev/null 2>&1 &
  • cd /etc/ld.so.conf.d/
  • nano pgsql.conf

## add the following line:
  • /usr/local/pgsql/lib

## save and exit
  • ldconfig


3. Build as root OATH Library needed if your are using TOTP authenticating mode. Skip this step if you dont use TOTP.
  • wget https://coder-com.universalnet.org/packages/liboath-2.6.2-3.el8.x86_64.rpm
  • wget https://coder-com.universalnet.org/packages/liboath-devel-2.6.2-3.el8.x86_64.rpm
  • rpm -Uvh liboath-2.6.2-3.el8.x86_64.rpm
  • rpm -Uvh liboath-devel-2.6.2-3.el8.x86_64.rpm


4 . Download and build GNUWorld (X and UWorld) modules
  • su - gnuworld
  • git clone https://github.com/UndernetIRC/gnuworld
  • cd gnuworld



4.1 #run the following command ONLY if you build gnuworld to use TOTP
  • ./configure --with-pgconfig=/usr/local/pgsql/bin/pg_config --enable-modules=ccontrol,cservice --with-liboath --with-liboath-include=/usr/include/
  • nano mod.cservice/cservice_config.h
  • change #undef TOTP_AUTH_ENABLED to #define TOTP_AUTH_ENABLED

## save the file and exit
  • make

### if you receive the following error:
  • [gnuworld@centos8 gnuworld]$ make
    Making all in libltdl
    make[1]: Entering directory '/home/gnuworld/gnuworld/libltdl'
    CDPATH="${ZSH_VERSION+.}:" && cd . && /bin/sh '/home/gnuworld/gnuworld/missing' aclocal-1.16 -I ../m4
    cd . && /bin/sh /home/gnuworld/gnuworld/missing automake-1.16 --foreign
    configure.ac:68: error: required file '../compile' not found
    configure.ac:68: 'automake --add-missing' can install 'compile'
    make[1]: *** [Makefile:529: Makefile.in] Error 1
    make[1]: Leaving directory '/home/gnuworld/gnuworld/libltdl'
    make: *** [Makefile:6089: all-recursive] Error 1

### is because source code acolocal.m4 file was created using aclocal-1.16.3 and your system has an older version. To fix this type:
  • aclocal --version

open aclocal.m4 and change everything that is with 1.16.3 with the version your system replied, in my case the version was 1.16.1, save the file.
  • automake --add-missing
  • make
  • make install

#if you selected step 4.1 skip step 4.2


4.2 # Run the following command if you build gnuworld WITHOUT TOTP Support and skip step 4.1
  • ./configure --with-pgconfig=/usr/local/pgsql/bin/pg_config --enable-modules=ccontrol,cservice
  • make

### if you receive the following error:
  • [gnuworld@centos8 gnuworld]$ make
    Making all in libltdl
    make[1]: Entering directory '/home/gnuworld/gnuworld/libltdl'
    CDPATH="${ZSH_VERSION+.}:" && cd . && /bin/sh '/home/gnuworld/gnuworld/missing' aclocal-1.16 -I ../m4
    cd . && /bin/sh /home/gnuworld/gnuworld/missing automake-1.16 --foreign
    configure.ac:68: error: required file '../compile' not found
    configure.ac:68: 'automake --add-missing' can install 'compile'
    make[1]: *** [Makefile:529: Makefile.in] Error 1
    make[1]: Leaving directory '/home/gnuworld/gnuworld/libltdl'
    make: *** [Makefile:6089: all-recursive] Error 1

### is because source code acolocal.m4 file was created using aclocal-1.16.3 and your system has an older version. To fix this type:
  • aclocal --version

open aclocal.m4 and change everything that is with 1.16.3 with the version your system replied, in my case the version was 1.16.1, save the file.
  • automake --add-missing
  • make
  • make install


5. Now Let`s build the databases !!!
## run the following commands under user gnuworld !!!
  • cd gnuworld/doc

5.1 ## Building cservice database !!!
  • /usr/local/pgsql/bin/createdb cservice
  • /usr/local/pgsql/bin/psql cservice < cservice.sql
  • /usr/local/pgsql/bin/psql cservice < languages.sql
  • /usr/local/pgsql/bin/psql cservice < language_table.sql
  • /usr/local/pgsql/bin/psql cservice < cservice.help.sql
  • /usr/local/pgsql/bin/psql cservice < cservice.web.sql
  • /usr/local/pgsql/bin/psql cservice < cservice.config.sql
  • /usr/local/pgsql/bin/psql cservice < greeting.sql
  • /usr/local/pgsql/bin/psql cservice < cservice.addme.sql


5.2 ## Building ccontrol (UWorld) database !!!
  • /usr/local/pgsql/bin/createdb ccontrol
  • /usr/local/pgsql/bin/psql ccontrol < ccontrol.sql
  • /usr/local/pgsql/bin/psql ccontrol < ccontrol.help.sql
  • /usr/local/pgsql/bin/psql ccontrol < ccontrol.shells.sql
  • nano ccontrol.addme_sql
  • replace "Admin" with your desired username (ex. ZioN)

##save the file and exit.
  • /usr/local/pgsql/bin/psql ccontrol < ccontrol.addme.sql
  • /usr/local/pgsql/bin/psql ccontrol < ccontrol.commands.sql



Skip this step ONLY if you already done it when you set the webpage !!!
5.3 ## Building local_db (Website) database !!!
  • /usr/local/pgsql/bin/createdb local_db
  • /usr/local/pgsql/bin/psql local_db < local_db.sql



6. GNUWorld config files needed to be edited before running gnuworld.
  • cd gnuworld/bin

6.1 ## edit cservice.conf with your needed settings for your network.
  • cp cservice.example.conf cservice.conf
  • nano cservice.conf



6.2 ## edit ccontrol.conf with your needed settings for your network.
  • cp ccontrol.example.conf ccontrol.conf
  • nano ccontrol.conf



6.3 ## edit GNUWorld.conf with your needed settings for your network. Enable modules ccservice and ccontrol:
  • cp GNUWorld.example.conf GNUWorld.conf
  • nano GNUWorld.conf



7. Starting GNUWorld
## If GNUWorld.conf , cservice.conf and ccontrol.conf files are set please proceed with starting GNUWorld, if NOT, please go back to step 6.
## to start gnuworld type te following command:
  • ./gnuworld


Now X should be up on your Network.


8. X- AUTHENTICATION FAILED as admin (IPR)
  • su - gnuworld
  • pico ipr.sql
  • insert into ip_restrict (id, user_id, added_by, added, type, expiry, value) values (1, 1, 1, now()::abstime::int4, 1, 0, '0.0.0.0');
  • /usr/local/pgsql/bin/psql -h 192.168.1.133 cservice < ipr.sql
##replace " 192.168.1.133 " with a real ip address of the machine hosting the cservice db.
Enjoy.

9. Fix for register channel via IRC
open gnuworld/mode.cservice/sqlChannel.cc
Find:
  • static const char* queryHeader = "INSERT INTO channels (name, flags, registered_ts, channel_ts, channel_mode, last_updated, no_take) VALUES (";

    stringstream queryString;
    queryString << queryHeader
    << "'" << escapeSQLChars(name) << "', "
    << flags << ", "
    << registered_ts << ", "
    << channel_ts << ", '"
    << escapeSQLChars(channel_mode) << "', "
    << "now()::abstime::int4),"
    << no_take
    << ")"
    << ends;


Replace with:

  • static const char* queryHeader = "INSERT INTO channels (name,flags,registered_ts,channel_ts,channel_mode,no_take,last_updated) VALUES (";

    stringstream queryString;
    queryString << queryHeader
    << "'" << escapeSQLChars(name) << "', "
    << flags << ", "
    << registered_ts << ", "
    << channel_ts << ", '"
    << escapeSQLChars(channel_mode) << "', "
    << no_take << ", "
    << "now()::abstime::int4)"
    << ends;


This HOWTO was last updated by ZioN
23 Jun 2021