GNUWorld (X and UWorld)Modules Setup On Mint 21.1

Post Reply
User avatar
ZioN
Site Admin
Posts: 27
Joined: Sat Feb 29, 2020 9:31 pm

GNUWorld (X and UWorld)Modules Setup On Mint 21.1

Post 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:
  • apt update
  • apt upgrade
  • apt install build-essential
  • apt install wget git libssl-dev openssl bison libreadline-dev zlib1g-dev automake make flex mlocate byacc libxmlsec1 libxmlsec1-dev liboath-dev liboath0

2. Install Postgresql 14 :
  • apt install postgresql-client postgresql-client-common postgresql-common postgresql postgresql-server-dev-all libboost-all-dev
  • cd /etc/postgresql/14/main/
  • nano pga_hba.conf
Add the following line:
  • Host all all 192.168.1.133/32 trust
Save and close file
Open postgresql conf file and set the host/ip that pgsql runs under:
  • nano postgresql.conf
listen_addresses='192.168.1.133'
Save and close the file
Now we restart postgresql service:
  • service postgresql restart
We check the running status of postgresql server:
  • service postgresql status
Now we create user gnuworld and cservice, ccontrol, local_db databases in PostgreSQL:
  • su - postgres
  • psql
  • create user gnuworld;
  • CREATE DATABASE cservice with OWNER='gnuworld' ENCODING='SQL_ASCII' TEMPLATE=template0;
  • CREATE DATABASE ccontrol with OWNER='gnuworld' ENCODING='SQL_ASCII' TEMPLATE=template0;
  • CREATE DATABASE local_db with OWNER='gnuworld' ENCODING='SQL_ASCII' TEMPLATE=template0;
We exit pgsql console:
  • \q
Type exit to return to root account

3 . 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/lib/postgresql/14/bin/pg_config --enable-modules=ccontrol,cservice --with-liboath --with-liboath-lib=/usr/lib/ --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
  • gmake
  • gmake 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/lib/postgresql/14/bin/pg_config --enable-modules=ccontrol,cservice
  • gmake
  • gmake install

5. Now Let`s build the databases !!!
## run the following commands under user gnuworld !!!
  • cd gnuworld/doc
5.1 ## Building cservice database !!!
  • psql -h 192.168.1.133 -U gnuworld cservice < cservice.sql
  • psql -h 192.168.1.133 -U gnuworld cservice < languages.sql
  • psql -h 192.168.1.133 -U gnuworld cservice < language_table.sql
  • psql -h 192.168.1.133 -U gnuworld cservice < cservice.help.sql
  • psql -h 192.168.1.133 -U gnuworld cservice < cservice.web.sql
  • psql -h 192.168.1.133 -U gnuworld cservice < cservice.config.sql
  • psql -h 192.168.1.133 -U gnuworld cservice < greeting.sql
  • psql -h 192.168.1.133 -U gnuworld cservice < cservice.addme.sql


5.2 ## Building ccontrol (UWorld) database !!!
  • psql -h 192.168.1.133 -U gnuworld ccontrol < ccontrol.sql
  • psql -h 192.168.1.133 -U gnuworld ccontrol < ccontrol.help.sql
  • psql -h 192.168.1.133 -U gnuworld ccontrol < ccontrol.shells.sql
  • nano ccontrol.addme_sql
  • replace "Admin" with your desired username (ex. ZioN)
##save the file and exit.
  • psql -h 192.168.1.133 -U gnuworld ccontrol < ccontrol.addme.sql
  • psql -h 192.168.1.133 -U gnuworld 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 !!!
  • psql -h 192.168.1.133 -U gnuworld 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, ‘192.168.1.133’);
##replace " 192.168.1.133 " with the ip address from where you are trying to login on irc. !!!
  • /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
15 Jan 2023
Post Reply