Page 1 of 1

GNUWorld (X and UWorld)Modules Setup On FreeBSD 13.2

Posted: Mon Aug 21, 2023 12:44 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 FreeBSD 13.2 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:
  • freebsd-update fetch
  • freebsd-update install
Install needed packages with FreeBSD package manager
  • pkg update -f
  • pkg install nano
  • pkg install plocate
  • updatedb
  • pkg install readline-8.2.1 flex-2.6.4_2 git byacc bison openssl-1.1.1v,1 wget gmake-4.3_2 automake oath-toolkit-2.6.7_3 boost-all-1.82.0

2. Install Postgresql 15 package as root:
  • pkg install postgresql15-contrib postgresql15-server
Enable Postgresql in rc.conf by running the following command.
  • sysrc postgresql_enable="YES"
Once the installation is complete, initialize the PostgreSQL database with the following command:
  • /usr/local/etc/rc.d/postgresql initdb -A trust -E=SQL_ASCII
Start the postgres using this command:
  • /usr/local/etc/rc.d/postgresql start
  • /usr/local/etc/rc.d/postgresql status
pg_ctl: server is running (PID: 36458)
/usr/local/bin/postgres "-D" "/var/db/postgres/data15"

/var/db/postgres/data15 - is the data folder, hosting new db-s and current running pg_hba.conf file.
  • nano /var/db/postgres/data15/pg_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 /var/db/postgres/data15/postgresql.conf
listen_addresses='192.168.1.133'
Save and close the file
Restart pgsql server:
  • service postgresql restart
Now enable service on boot
  • service postgresql enable
  • su - postgres
  • psql
We create the user gnuworld in PgSQL:
  • create user gnuworld;
Now from pgsql console we create the databases with access on user gnuworld:
  • CREATE DATABASE cservice with OWNER='gnuworld' ENCODING='SQL_ASCII' LC_COLLATE='en_US.UTF-8' LC_CTYPE='en_US.UTF-8' TEMPLATE=template0;
  • CREATE DATABASE ccontrol with OWNER='gnuworld' ENCODING='SQL_ASCII' LC_COLLATE='en_US.UTF-8' LC_CTYPE='en_US.UTF-8' TEMPLATE=template0;
  • CREATE DATABASE local_db with OWNER='gnuworld' ENCODING='SQL_ASCII' LC_COLLATE='en_US.UTF-8' LC_CTYPE='en_US.UTF-8' TEMPLATE=template0;
We type "\l" to see database information:
postgres=# \l
List of databases
Name | Owner | Encoding | Collate | Ctype | ICU Locale | Locale Provider | Access privileges
-----------+----------+-----------+-------------+-------------+------------+-----------------+-----------------------
ccontrol | gnuworld | SQL_ASCII | en_US.UTF-8 | en_US.UTF-8 | | libc |
cservice | gnuworld | SQL_ASCII | en_US.UTF-8 | en_US.UTF-8 | | libc |
local_db | gnuworld | SQL_ASCII | en_US.UTF-8 | en_US.UTF-8 | | libc |
postgres | postgres | SQL_ASCII | C | C.UTF-8 | | libc |


We exit pgsql console:
  • \q
Type exit to return to root account
  • exit
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/local/bin/pg_config --enable-modules=ccontrol,cservice --with-liboath
  • 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/local/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)
There are two options to solve this, bellow you can find how to on both.
  • su - gnuworld
8.1 - Fix (IPR) by inserting your ip into Admin account direct on database cservice.
  • 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.0.93’);
##replace " 192.168.0.93 " with the ip address shown on whois on you on irc. !!!
  • /usr/local/pgsql/bin/psql -h 192.168.0.93 cservice < ipr.sql
##replace " 192.168.0.93 " with a real ip address of the machine hosting the cservice db.

8.2 - Fix (IPR) by disableing IPR option in mod.cservice
  • su - gnuworld
  • cd gnuworld
  • pico mod.cservice/cservice_config.h
  • change #define IPR_DEFAULT_REJECT to #undef IPR_DEFAULT_REJECT
Save the file and close
  • gmake -j 2
  • gmake install
  • and restart X
Enjoy !!!!

This "HOW TO Documentation" was last updated by ZioN on
21 August 2023