]> jfr.im git - irc/UndernetIRC/undernet-development-env.git/commitdiff
Initial import of undernet development env
authorStefan Wold <redacted>
Sun, 11 Dec 2022 13:11:24 +0000 (14:11 +0100)
committerStefan Wold <redacted>
Sun, 11 Dec 2022 13:11:24 +0000 (14:11 +0100)
14 files changed:
Dockerfile.gnuworld [new file with mode: 0644]
Dockerfile.ircu2 [new file with mode: 0644]
cservice-web
dbinit/dbinit.sh [new file with mode: 0755]
docker-compose.yml [new file with mode: 0644]
etc/gnuworld/ccontrol.conf [new file with mode: 0644]
etc/gnuworld/cservice.conf [new file with mode: 0644]
etc/gnuworld/dronescan.conf [new file with mode: 0644]
etc/gnuworld/gnuworld.conf [new file with mode: 0644]
etc/gnuworld/logging.properties [new file with mode: 0644]
etc/gnuworld/openchanfix.conf [new file with mode: 0644]
etc/hub.conf [new file with mode: 0644]
etc/leaf.conf [new file with mode: 0644]
patches/log4c-alpine-compat+log-paths.patch [new file with mode: 0644]

diff --git a/Dockerfile.gnuworld b/Dockerfile.gnuworld
new file mode 100644 (file)
index 0000000..41df612
--- /dev/null
@@ -0,0 +1,58 @@
+FROM alpine:3.17 AS build
+
+RUN apk --no-cache update &&  \
+    apk --no-cache upgrade && \
+    apk --no-cache add \
+    build-base \
+    autoconf \
+    automake \
+    libtool \
+    pkgconfig \
+    check-dev \
+    file \
+    bison \
+    patch \
+    postgresql12-dev \
+    log4cplus-dev
+
+COPY ./gnuworld /src
+COPY ./patches /patches
+
+#RUN ls /src
+RUN cd /src && patch -p0 < /patches/log4c-alpine-compat+log-paths.patch
+RUN cd /src && \
+    ./configure \
+    --prefix=/gnuworld \
+    --enable-modules=cservice,ccontrol,openchanfix,dronescan \
+    --enable-ltdl-convenience \
+    --with-log4cplus \
+    --with-log4cplus-lib=/usr/lib \
+    --with-log4cplus-include=/usr/include && \
+    make && \
+    make install
+
+FROM alpine:3.17
+MAINTAINER ratler@undernet.org
+
+EXPOSE 4400/tcp 6667/tcp 6669/tcp
+
+RUN apk --no-cache update && \
+    apk --no-cache upgrade && \
+    apk --no-cache add \
+    libtool \
+    postgresql12 \
+    strace \
+    bind-tools \
+    log4cplus
+
+RUN addgroup -S gnuworld && \
+    adduser -D -S -s /sbin/nologin -G gnuworld gnuworld
+
+COPY --from=build /gnuworld /gnuworld
+
+RUN install -o gnuworld -g gnuworld -dm755 /gnuworld/log
+#RUN chown -R ircd:ircd /ircd/lib
+
+USER gnuworld
+WORKDIR /gnuworld/bin
+ENTRYPOINT ["./gnuworld", "-c", "-f", "/gnuworld/etc/gnuworld.conf"]
diff --git a/Dockerfile.ircu2 b/Dockerfile.ircu2
new file mode 100644 (file)
index 0000000..c9beb1e
--- /dev/null
@@ -0,0 +1,45 @@
+FROM alpine:3.17 AS build
+
+RUN apk --no-cache update &&  \
+    apk --no-cache upgrade && \
+    apk --no-cache add \
+    build-base \
+    autoconf \
+    automake \
+    libtool \
+    pkgconfig \
+    check-dev \
+    file \
+    bison
+
+COPY . /src
+
+RUN cd /src && \
+    ./configure --build="$(arch)-unknown-linux-gnu" \
+    --prefix=/ircd \
+    --with-cpath=/ircd/etc/ircd.conf \
+    --with-maxcon=1024 && \
+    make && \
+    make install && \
+    chmod 711 /ircd/bin/umkpasswd
+
+CMD /bin/sh
+
+FROM alpine:3.17
+MAINTAINER ratler@undernet.org
+
+EXPOSE 4400/tcp 6667/tcp 6669/tcp
+
+RUN apk --no-cache update && \
+    apk --no-cache upgrade
+
+RUN addgroup -S ircd && \
+    adduser -D -S -s /sbin/nologin -G ircd ircd
+
+COPY --from=build /ircd /ircd
+
+RUN chown -R ircd:ircd /ircd/lib
+
+USER ircd
+WORKDIR /ircd
+ENTRYPOINT ["/ircd/bin/ircd", "-n"]
index a203acd07799404cb1a8c65a6a04e46f5d594d43..dc621e3211ee92c1d9f4163149e05c7ece9f68be 160000 (submodule)
@@ -1 +1 @@
-Subproject commit a203acd07799404cb1a8c65a6a04e46f5d594d43
+Subproject commit dc621e3211ee92c1d9f4163149e05c7ece9f68be
diff --git a/dbinit/dbinit.sh b/dbinit/dbinit.sh
new file mode 100755 (executable)
index 0000000..96c8530
--- /dev/null
@@ -0,0 +1,37 @@
+#!/bin/bash
+
+export PGPASSWORD="${PGPASSWORD:-$POSTGRES_PASSWORD}"
+psql=( psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --no-password )
+
+for db in local_db ccontrol chanfix dronescan; do
+  "${psql[@]}" --dbname postgres --set db="$db" <<-'EOSQL'
+                               CREATE DATABASE :"db";
+                       EOSQL
+  echo
+done
+
+echo "$0: Setting up cservice db"
+for sql_file in cservice.sql languages.sql language_table.sql cservice.help.sql cservice.web.sql cservice.config.sql cservice.addme.sql greeting.sql; do
+  ${psql[@]} --dbname cservice < /gnuworld/doc/${sql_file}
+done
+
+echo "$0: Setting up ccontrol db"
+for sql_file in ccontrol.sql ccontrol.help.sql ccontrol.addme.sql ccontrol.commands.sql; do
+  ${psql[@]} --dbname ccontrol < /gnuworld/doc/${sql_file}
+done
+
+echo "$0: Setting up chanfix db"
+for sql_file in chanfix.sql chanfix.languages.sql chanfix.language.english.sql chanfix.help.sql chanfix.addme.sql; do
+  ${psql[@]} --dbname chanfix < /gnuworld/mod.openchanfix/doc/${sql_file}
+done
+
+echo "$0: Setting up dronescan db"
+${psql[@]} --dbname dronescan < /gnuworld/doc/dronescan.sql
+
+echo "$0: Setting up local db"
+${psql[@]} --dbname local_db < /gnuworld/doc/local_db.sql
+
+echo "$0: Loading themes into local_db..."
+for theme in $(find /cservice-web/docs/gnuworld/themes/data -name "*.sql"); do
+  cat $theme | ${psql[@]} --dbname local_db
+done
diff --git a/docker-compose.yml b/docker-compose.yml
new file mode 100644 (file)
index 0000000..7032efd
--- /dev/null
@@ -0,0 +1,115 @@
+version: "3"
+services:
+  hub:
+    image: ircu2:latest
+    hostname: hub.undernet.org
+    build:
+      context: ircu2
+      dockerfile: ../Dockerfile.ircu2
+    ports:
+      - "4400:4400"
+      - "6669:6669"
+    volumes:
+      - ./etc/hub.conf:/ircd/etc/ircd.conf
+    networks:
+      undernet:
+        ipv4_address: 10.5.0.10
+
+  leaf:
+    image: ircu2:latest
+    hostname: leaf.undernet.org
+    ports:
+      - "4401:4400"
+      - "6667:6667"
+    volumes:
+      - ./etc/leaf.conf:/ircd/etc/ircd.conf
+    depends_on:
+      - hub
+    networks:
+      undernet:
+        ipv4_address: 10.5.0.20
+
+  db:
+    image: postgres:11-alpine
+    hostname: db.undernet.org
+    restart: always
+    ports:
+      - "5432:5432"
+    volumes:
+      - pgdata:/var/lib/postgresql/data
+      - ./dbinit:/docker-entrypoint-initdb.d
+      - ./cservice-web:/cservice-web
+      - ./gnuworld:/gnuworld
+    environment:
+      - POSTGRES_USER=cservice
+      - POSTGRES_PASSWORD=cservice
+      - POSTGRES_INITDB_ARGS="-E SQL_ASCII"
+      - LANG=C
+    networks:
+      undernet:
+        ipv4_address: 10.5.0.30
+
+  mail:
+    image: ajoergensen/mailhog
+    hostname: mail.undernet.org
+    ports:
+      - "1025:1025"
+      - "8025:8025"
+    networks:
+      undernet:
+        ipv4_address: 10.5.0.40
+
+  web:
+    build:
+      context: ./cservice-web
+    ports:
+      - "8080:80"
+    environment:
+      - PHP_SHORT_OPEN_TAG=On
+      - APACHE_ERRORLOG=/dev/stderr
+      - LOCALDB_USER=cservice
+      - LOCALDB_PASS=cservice
+      - LOCALDB_HOST=db.undernet.org
+      - REMOTEDB_NAME=cservice
+      - REMOTEDB_USER=cservice
+      - REMOTEDB_PASS=cservice
+      - REMOTEDB_HOST=db.undernet.org
+      - ENABLE_REGISTER_GLOBALS=1
+      - LOG_LEVEL=Logger::DEBUG
+      - LOG_STREAM_HANDLER=php://stdout
+      - SMTPHOST=mail.undernet.org:1025
+    volumes:
+      - ./cservice-web:/app
+    networks:
+      undernet:
+        ipv4_address: 10.5.0.50
+    depends_on:
+      - db
+      - mail
+
+  gnuworld:
+    image: gnuworld:latest
+    hostname: channels.undernet.org
+    #entrypoint: /bin/sh -c "while true; do sleep 1; done"
+    build:
+      context: .
+      dockerfile: Dockerfile.gnuworld
+    volumes:
+      - ./etc/gnuworld:/gnuworld/etc
+    networks:
+      undernet:
+        ipv4_address: 10.5.0.60
+    depends_on:
+      - db
+      - hub
+
+volumes:
+  pgdata:
+
+networks:
+  undernet:
+    driver: bridge
+    ipam:
+      config:
+        - subnet: 10.5.0.0/16
+          gateway: 10.5.0.1
diff --git a/etc/gnuworld/ccontrol.conf b/etc/gnuworld/ccontrol.conf
new file mode 100644 (file)
index 0000000..f2e672c
--- /dev/null
@@ -0,0 +1,108 @@
+# $Id: ccontrol.example.conf.in,v 1.4 2009/06/09 05:55:55 hidden1 Exp $
+# conf file for testClient
+
+# database specifications
+sql_host = db
+sql_port = 5432
+
+# sql_db = Name of the database. 
+
+sql_db = ccontrol
+
+#if you dont need user/pass just leave it with ''
+sql_user = cservice
+sql_pass = cservice
+
+# The following fields are required
+username = UWorld
+nickname = UWorld
+hostname = UWorld.Undernet.org
+userdescription = UWorld
+
+operchanmodes = +isn
+mode = +iodkw
+
+# make sure channel names are preceeded
+# by the '#' character
+operchan = #valhalla
+
+# msgchan is also an operchan
+msgchan = #gnuworld.message
+
+# limitsChan is also an operchan, but used for debugging rejected connections.
+# Leave it to '' for None (which should be the default) 
+#limitschan = #gnuworld.limitsdebug
+limitschan = ''
+
+# Default gline length (in seconds)
+glength = 3600
+
+# Default reason for adding an oper chan
+operchanreason = This is now an IRC Operator only channel
+
+# report specification
+
+# abuse_mail - the email that the report should be emailed to
+abuse_mail = abuse@yournet.org 
+
+# ccemail - the email that ccontrol will put in the from field
+# of the report
+ccemail = uworld-report@yourdomain.com
+
+# sendmail - full path to the sendmail program
+sendmail = /usr/sbin/sendmail
+
+# mail_report - set 1 for the bot to mail the report
+# set to 0 if you dont want a report to be mailed
+mail_report = 0
+
+# gline_interval - the interval in which ccontrol should check
+# for expired glines
+gline_interval = 3600
+
+# max_connection - the maximum connections a host can have before glined
+max_connection = 5
+
+# max_GLen - the length of the gline the for excessive
+# connection (in seconds)
+max_GLen = 86400
+
+# max_threads - maximum number of gate checking threads to start
+max_threads = 100
+
+# check_gates - set 1 for the bot to check for open gates, or 0 for not 
+check_gates = 0
+
+# check_clones - set 1 for the bot to check for clones, or 0 for not
+check_clones = 0
+
+# Expired_Interval
+Expired_interval = 60
+
+# dbinterval
+dbinterval = 60
+
+# showCGIpsInLogs - If set to 1, it shows channel glines IPs in lastcom logs and in daily logs sent by email
+showCGIpsInLogs = 1
+
+# AnnounceNick - Nick used by the fake client to make announcements using the ANNOUNCE command
+AnnounceNick = A
+
+# StdCloneChecksDisabled - Disables the clone checks made on /32 and /24 for ipv4 and on /64 and /48 for ipv6. 
+# Useful if you intend to use the LIMITS command
+StdCloneChecksDisabled = 1
+
+# Timeout for considering that a connect attempt via iauth was unsuccessful
+# (used for clones)
+iauthTimeout = 30
+
+
+#### Append URL to G-line messages (optional settings)
+
+# Excessive connections
+#url_excessive_conn = ''
+url_excessive_conn = . Visit https://www.undernet.org/gline#ex-conn for more information.
+
+# Please install identd
+#url_install_identd = ''
+url_install_identd = . Visit https://www.undernet.org/gline#identd for more information.
diff --git a/etc/gnuworld/cservice.conf b/etc/gnuworld/cservice.conf
new file mode 100644 (file)
index 0000000..96ac0fc
--- /dev/null
@@ -0,0 +1,344 @@
+# Channel Services configuration file.
+#
+# sql_host = Hostname/IP of the PostgreSQL server.
+
+sql_host = db
+sql_port = 5432
+
+# sql_db = Name of the database. 
+# (To create from the template, run cservice.sql through Postgres)
+
+sql_db = cservice
+
+# sql_user is the username to pass to Postgres on connection.
+# Usefull if your account name is not the same as your Database
+# username.
+
+sql_user = cservice
+sql_pass = cservice
+
+# General 'Bot' options.
+
+nickname = X
+username = cservice
+hostname = undernet.org
+userdescription = For help type: /msg X help
+# Important: remove 'd' deaf mode if you intend to enable cservice FLOODPRO
+mode = +idk
+
+#
+# Channel to relay flood/warnings/exceptions, etc.
+#
+
+pending_page_url = http://www.yoursite.com/live/view_app.php
+
+relay_channel = #coder-com
+
+#
+# Channel to relay useful information, but not quite as annoying
+# as the debug_channel ! (a.k.a privileged user relay channel)
+# 
+
+priv_relay_channel = #coder-com
+
+#
+# Channel to relay useful debug information that otherwise
+# annoy CS admins. :)
+#
+
+debug_channel = #coder-com
+
+#
+# Coder channel.
+#
+# Channel used to extract levels to display coder access status.
+
+coder_channel = #coder-com
+
+#
+# Frequency in seconds to check the database for updates.
+#
+
+update_interval = 180
+
+#
+# Number of seconds to sample for flooding.
+#
+
+flood_duration = 30
+
+#
+# Input flood rate.
+#
+# Eg: 30, for 30 points amassed within "flood_duration" seconds.
+#
+
+input_flood = 30
+
+#
+# Output flood rate.
+#
+# Eg: 20480 (20k within "flood_duration" seconds).
+#
+
+output_flood = 20480
+
+#
+# Frequency in seconds to sample after clients channel flood
+#
+
+channels_flood_period = 30
+
+#
+# After how many seconds of absence of flood activity should reduce the FLOODNET value
+# Eg. 300 = 5 minutes. 
+
+floodpro_relaxtime = 300
+
+#
+# How many not(ic)es will be stored for an offline user 
+# 0 is disallowed, 7 will be used
+
+max_notes = 7;
+
+#
+# Minimum duration at which to set a topic in a non idle channel.
+# (Seconds).
+#
+
+topic_duration = 1800
+
+#
+# Duration at which we check for idle user accounts in memory.
+# (Seconds).
+
+expire_interval = 3600
+
+#
+# How long those accounts should have been idle before they are
+# uncached. (Seconds).
+#
+
+cache_interval = 3600
+
+#
+# How often to commit changes to Pending channels.
+# (Seconds).
+
+pending_duration = 180
+
+#
+# How often to notify changes of Pending channels.
+# (Seconds).
+
+pending_notif_duration = 1800
+
+#
+# How often to check if the connection to the backend has
+# fallen over? (Seconds).
+#
+
+connection_check_frequency = 10
+
+#
+# How many times do we try every 'connection_check_frequency' seconds
+# to reconnect before finally giving up and exiting?
+#
+
+connection_retry_total = 5
+
+#
+# How often (in seconds) should we check all channels that have
+# floating-limit set to see if they need a new limit setting?
+#
+# Note: 30 is a good value, try 1min if you have lots of chans
+# and not so much CPU.
+
+limit_check = 30
+
+#
+# How long (In seconds) should we wait before allowing
+# logins after startup. (Incase you're on a busy network
+# with a really large burst and need things to settle down
+# first to ease up load on the Db).
+#
+
+login_delay = 360
+
+
+#
+# What is the period (in seconds) in which we will check to
+# see if someone has sent too many notes, and what do we
+# define "Too Many" as?
+# Ie: You can send 'note_limit' notes in 'note_duration' seconds.
+#
+
+note_duration = 3600
+note_limit = 5
+
+#
+# Pre-cache 'x' days worth of user accounts.
+# This lets you preload all the users who have logged in during the last
+# 'x' number of days to avoid a large number of queries when processing
+# +r accounts during the initial net.burst.
+#
+preload_user_days = 1
+
+#
+# Specify the filename for the 'Admin Log'.
+# Basically a log of all commands admins type.
+#
+admin_logfile = admin.log
+
+#
+# Specify the filename for the 'Command Log'
+# A log of ALL commands issued by ALL users.
+# requires USE_COMMAND_LOG in cservice_config.h
+command_logfile = cs.log
+
+#
+# This option is used only if ALLOW_HELLO is defined in
+# cservice_config.h, thus enabling the HELLO command in cservice.
+# This is the time to block users attempting to flood the bot with
+# hello commands, in seconds.
+#
+hello_block_period = 3600
+
+# Message when login-on-connect (LoC) parameters are incorrect
+# Used with iauthd-c: https://github.com/UndernetIRC/iauthd-c
+#
+loc_message = Insufficient login-on-connect (LoC) parameters - see www.undernet.org/loc/ for help
+
+#
+# What is the period (in seconds) in which we will check for
+# new webrelay messages
+#
+
+webrelay_interval = 10;
+
+#
+# How long the bot should stay in an idle channel before leaving it.
+# This only takes into account join/parts, not privmsg.
+# Default is 2 days (172800 seconds)
+#
+
+part_idle_chan = 172800
+
+#
+# Enable/Disable totp authentication (must be enabled in mod.cservice/cservice_config.h on compliation)
+# 1 = totp enabled, 0 = totp disabled
+
+enable_totp = 0
+
+# A welcome message for a newly accepted channel
+# For empty use '' and it means disabled
+
+welcome_newchan_message = Congratulations! Channel %s has been registered!
+
+# A welcome topic for a newly accepted channel
+# For empty use '' and it means disabled. Applies only on empty channel topic.
+# TOPIC_TRACK must be #define in \include\gnuworld_config.h
+
+welcome_newchan_topic = *** Congratulations! Your channel application has been accepted! ***
+
+# After how much seconds should expire any newly created never logged in user
+
+neverloggedin_users_expiretime = 21600
+
+# Days to expire users
+# 0 = never expire
+
+users_expire_days = 60
+
+# Day length in seconds - refers to users expiration
+
+day_seconds = 86400
+
+#              #               #
+#  *** The Judge settings ***  #
+#              #               #
+
+# Required supporters
+
+required_supporters = 5
+
+# Length of a day in seconds
+
+judge_day_seconds = 3600
+
+# If somebody supports with a 'NO' answer, the channel will be set as noreg
+# for the specified number of days
+
+noreg_days_on_nosupport = 1
+
+# If one of the supporters gets marked as Fraud during channel registration, 
+# the channel will be rejected automatically if the value is '1' enabled
+
+reject_app_on_userfraud = 1
+
+# If the value is 1 enabled then all channels at a minimum require an admin to Mark As Reviewed
+# before application can be fully processed by TheJudge
+
+require_review = 1
+
+# If the value is 1 enabled, any channel application with admin comments of objectsions will
+# require manual decision accept/reject by an admin
+
+decide_on_object = 1
+
+# If the value is 1 enabled, after all successful registration stages there will be no automatic accepts.
+# Channel will be left at to 'Ready to review' stage, waiting for an admin's final decision to accept/reject
+
+decide_on_complete = 0
+
+# After how many days will be a channel automatically rejected
+# when it was no decision made by an admin for a 'Ready to review' channel
+
+reviews_expire_time = 100
+
+# After some days, we cleanup the database from old application datas: pending channels, supporters, etc
+# But this applies *only* for Accepted OR Rejected channels!
+
+pendings_expire_time = 30
+
+# The length of the traffic checking period.
+
+max_days = 2
+
+# The number of unique IP addresses that must visit the channel during traffic checking
+
+unique_joins = 3
+
+# The total number of joins needed in traffick checking. This is a full sum.
+
+joins = 5
+
+# The number of supporters required to have at least 1 joincount during traffic checking.
+# This value is less or equal than required_supporters
+
+min_supporters = 3
+
+# The minimum joincount required for each supporter during traffic checking.
+# If any supporter has a lower joincount than this value, will result in a reject.
+
+min_supporters_joins = 1
+
+# Number of days for notification
+
+notify_days = 1
+
+# Number of days waiting for supporters confirmation
+
+support_days = 1
+
+# Reviewer's user_id
+
+reviewer_id = 1
+
+# Where to log application channel's stages, and other The Judge announces.
+# if set to 0 will log to debug channel, otherwise to admin channel
+
+log_to_admin_console = 1;
+
+# chanfix servername to send and receive Oplist/Score requests/answers
+chanfix_servername = gnuworld6.undernet.org
diff --git a/etc/gnuworld/dronescan.conf b/etc/gnuworld/dronescan.conf
new file mode 100644 (file)
index 0000000..cde31f3
--- /dev/null
@@ -0,0 +1,157 @@
+# $Id: dronescan.example.conf.in,v 1.19 2008/11/17 02:54:42 hidden1 Exp $
+# What nickname should the bot use?
+nickname = E
+
+# What username should the bot use?
+username = dronescan
+
+# What hostname should the bot use?
+hostname = undernet.org
+
+# What should the bots real name be?
+userdescription = Drone Scanner
+
+# What user modes should the bot use?
+mode = +idk
+
+# Console channel name and initial modes
+consoleChannel = #ds.console
+consoleChannelModes = +ntsim
+
+# SQL Setup
+sqlHost = db
+sqlPort = 5432
+sqlDB   = dronescan
+sqlUser = cservice
+sqlPass = cservice
+
+# Margins
+# Be careful with these. I wouldn't touch chanMargin too much but I suspect
+# nickMargin will need tweaking from network to network. These defaults were
+# taken from a fairly old burst from a small (2k5 user) network so beware!
+
+# The fraction of users who must be `abnormal' in a channel for the channel
+# to be reported.
+channelMargin = 0.8
+
+# The margin around the average entropy within which a nickname is considered
+# `normal'. Outside this margin is `abnormal'. Note this is the margin *either
+# side* of the center, ie 0.25 would give a 50% spread - from 25% to 75%.
+nickMargin = 0.1
+
+# The channel cutoff is the minimum amount of members a channel must have before
+# it can be considered a drone channel.
+channelCutoff = 10
+
+# The minimum level of information shown in the console channels. Available
+# levels are as follows:
+# 0 - DEBUG    Random debug things that you very probably are not interested in
+# 1 - INFO     Informational things - this is usually worth seeing
+# 2 - WARN     Warnings about drone channels and serious events.
+# 3 - ERROR    DroneScan core errors.
+consoleLevel = 1
+
+# The minimum amount of votes needed for a channel to be considered abnormal
+voteCutoff = 30
+
+# The interval (in seconds) during which a channel won't be reported again
+# This is to stop repeated spamming of the same channel
+dcInterval = 600
+
+# The interval in seconds for how often we should attempt to refresh any
+# caches from the database. The refreshes typically only trigger if any
+# data has actually changed.
+rcInterval = 300
+
+# The level that an opered client without an account should be assumed
+# to have.
+# If you wish this functionality to be disabled, set the level to 0.
+fakeOperLevel = 300
+
+################
+# JOIN COUNTER #
+################
+
+# The interval over which join counter checks for joins. This is in seconds.
+jcInterval = 10
+
+# The trigger level for which join counter warns. Note that the total join
+# count must be OVER this level to trigger.
+jcCutoff = 10
+
+# The minimum time a client needs to join and part within a flood to be reported/glined
+jcMinJoinToGline = 1
+
+# Whether or not to gline join flood clients 
+jcGlineEnable = 0
+
+# The minimum joins during join-floods required for an IP to be glined without a part (Can be on multiple channels)
+jcMinJoinsPerIPToGline = 4
+
+# The time within the joins.
+jcJoinsPerIPTime = 14400
+
+# The number of clients per IP required during *ONE* joinflood to set a gline if there are no parts
+jcMinJoinToGlineJOnly = 2
+
+# The join-flood size required to set a gline with no parts
+jcMinJFJOnlySizeToGline = 25
+
+# The minimum number of flooding clients required to gline
+jcMinJFSizeToGline = 20
+
+# The gline reason to set when glining join flood offenders
+jcGlineReason = Flooding is not tollerated on this network!
+
+# The length in seconds for glines which are issued on join flood offenders
+jcGlineLength = 3600
+
+
+################
+# NICK COUNTER #
+################
+
+# The interval over which nick counter checks for nicks changes. This is in 
+# seconds.
+ncInterval = 10
+
+# The trigger level for which nick counter warns. Note that the total nick
+# change count must be OVER this level to trigger.
+ncCutoff = 10
+
+
+#################
+# CHANNEL RANGE #
+#################
+
+# The total range of entropy in a channel before it is considered abnormal
+channelRange = 0.2
+
+
+############
+# MAXCHANS #
+############
+
+# The minimum channel membership before a client in a channel is considered
+# normal:
+maxChans = 2
+
+
+##############
+# COMMONREAL #
+##############
+
+# The amount of users who must have the same realname before being considered
+# abnormal.
+realCutoff = 4
+
+###############
+# GLINE QUEUE #
+###############
+
+# The number of clients to gline when processing the gline queue
+gbCount = 2
+
+# The interval (in seconds) processing the gline queue
+gbInterval = 1
+
diff --git a/etc/gnuworld/gnuworld.conf b/etc/gnuworld/gnuworld.conf
new file mode 100644 (file)
index 0000000..59c3114
--- /dev/null
@@ -0,0 +1,70 @@
+uplink = hub.undernet.org
+port = 4400
+password = 123456789
+name = channels.undernet.org
+description = UnderNet Services
+numeric = 51
+
+# Set this variable to yes if you want the server to attempt
+# to auto_reconnect when a connection is terminated, set
+# to no otherwise.
+# Be careful using this.
+auto_reconnect = yes
+
+# There is currently a bug in ircu which causes the first client
+# of a multiclient server to be lost, but only if maxclients is set
+# to an even number.
+# Therefore, only use odd numbers for maxclients here.
+maxclients = 1023
+
+# This is the variable which defines the host suffix to be concatenated
+# onto the user's account name for host hiding.
+hidden_host_suffix = .users.undernet.org
+
+# command_map is the name of the file which contains the mappings
+# from module filenames (of server command handlers) to the
+# message name to which it is associated.
+# You probably will not need to ever change this.
+command_map = /gnuworld/share/gnuworld/server_command_map
+
+# libdir is the path to the directory containing
+# the gnuworld modules
+libdir = /gnuworld/lib
+
+# To use a certain module, uncomment it below.
+module = libcservice.la /gnuworld/etc/cservice.conf
+module = libccontrol.la /gnuworld/etc/ccontrol.conf
+#module = libchanfix.la /gnuworld/etc/openchanfix.conf
+#module = libcloner.la cloner.example.conf
+#module = libnickserv.la nickserv.example.conf
+#module = libstats.la stats.example.conf
+#module = libscanner.la scanner.example.conf
+#module = libgnutest.la gnutest.example.conf
+#module = libclientExample.la clientExample.example.conf
+module = libdronescan.la /gnuworld/etc/dronescan.conf
+#module = libsnoop.la snoop.example.conf
+
+# Control nicknames
+# List here the nicknames to which you want the server to respond
+# for control commands.
+# You need not list any, it could be construed as a security
+# risk, but adds very nice functionality.
+# No clients are burst for control, instead control commands
+# must be sent via MSG controlnick@server.name <command>
+controlnick = control
+
+# List the AC account usernames for those users you want to
+# have access to the control commands.
+# Be careful who you choose for this.
+# AC account usernames are case sensitive.
+allowcontrol = reppir
+
+#################################################
+# It is safe to leave the rest of this file alone
+# These variables are for fine tuning
+
+# The time between checks for expired glines (seconds)
+glineUpdateInterval = 15
+
+# The time between pings to the uplink (seconds)
+pingUpdateInterval = 60
diff --git a/etc/gnuworld/logging.properties b/etc/gnuworld/logging.properties
new file mode 100644 (file)
index 0000000..6d7ccc6
--- /dev/null
@@ -0,0 +1,15 @@
+log4cplus.logger.gnuworld.ds.jf.glined=INFO, DS-JFGLINED
+
+log4cplus.appender.DS-JFGLINED=log4cplus::DailyRollingFileAppender
+log4cplus.appender.DS-JFGLINED.File=/gnuworld/log/jf-glined.log
+log4cplus.appender.DS-JFGLINED.Schedule=Daily
+log4cplus.appender.DS-JFGLINED.layout=log4cplus::PatternLayout
+log4cplus.appender.DS-JFGLINED.layout.ConversionPattern=%d - %m%n
+
+log4cplus.logger.gnuworld.ds.jf.cservice=INFO, DS-CSERVICE
+
+log4cplus.appender.DS-CSERVICE=log4cplus::DailyRollingFileAppender
+log4cplus.appender.DS-CSERVICE.File=/gnuworld/log/jf-cservice.log
+log4cplus.appender.DS-CSERVICE.Schedule=Daily
+log4cplus.appender.DS-CSERVICE.layout=log4cplus::PatternLayout
+log4cplus.appender.DS-CSERVICE.layout.ConversionPattern=%d - %m%n
diff --git a/etc/gnuworld/openchanfix.conf b/etc/gnuworld/openchanfix.conf
new file mode 100644 (file)
index 0000000..8d2c2ec
--- /dev/null
@@ -0,0 +1,166 @@
+# $Id: openchanfix.example.conf.in,v 1.1 2006/12/22 06:41:41 kewlio Exp $
+# chanfix configuration file
+
+# ---------------------------------------------------------------------
+
+# Nickname of bot
+nickname = C
+
+# Username of bot
+username = chanfix
+
+# Hostname of bot
+hostname = evilnet.development
+
+# Real name (info) of bot
+userdescription = Oooh! Oooh! I can fix it!
+
+# User modes bot should set
+mode = +idk
+
+# ---------------------------------------------------------------------
+# Database specifications
+
+# Host and port of database
+sqlHost = db
+sqlPort = 5432
+# Name of database
+sqlDB   = chanfix
+# If you don't need user/pass just put "" for option(s) below
+sqlcfUser = cservice
+sqlPass = cservice
+
+# ---------------------------------------------------------------------
+# Channels the bot should join
+
+# Console channel name and initial modes
+consoleChan = #coder-com
+consoleChanModes = +nst
+
+# Should the bot relay admin messages to the console channel?
+# NOTE: This only disables relaying information sent to the
+# adminLog. debugLog information is *always* relayed.
+sendConsoleNotices = true
+
+# Channel(s) that chanfix should join besides consoleChan (can be multiple)
+joinChan = #chanfix
+joinChan = #staff
+
+# Initial modes all joinChans should have
+joinChanModes = +nt
+
+# ---------------------------------------------------------------------
+# Fixing settings
+
+# Should chanfix automatically fix opless channels?
+enableAutoFix = true
+
+# Should chanfix be able to manually fix channels?
+enableChanFix = true
+
+# Can channels be blocked by admins?
+enableChannelBlocking = true
+
+# Should chanfix join the channel its fixing? this avoids the hopping issue
+joinChannels = true
+
+# Should chanfix send notices saying the channel is being fixed for auto
+# fixes. Also a notice after its finished saying its done?
+autoFixNotice = true
+
+# Should chanfix send notices saying the channel is being fixed for manual
+# fixes Also a notice after its finished saying its done?
+manualFixNotice = true
+
+# Should auto fixes stop if an already reopped user ops another user?
+stopAutoFixOnOp = true
+
+# Should manual fixes stop if an already reopped user ops another user?
+stopChanFixOnOp = true
+
+# Should the top ops be allowed to perform fixes on their own channels?
+allowTopOpFix = false
+
+# Should the top op fixes be able to alert the top 10 ops who are not in
+# the channel at the time of the fix automatically? If no/false then the
+# database help entry for REQUESTOP will need to be updated.
+# 2022-05-15: Setting no longer active. Even if this setting is set to false,
+#   top ops will be notified by default.
+#allowTopOpAlert = true
+
+# How much percentage within the top score should the top ops score be
+# before they are allowed to perform fixes. Dont include a %.
+topOpPercent = 10
+
+# Minimum score an op has be before they can issue fixes in their own
+# channel without requiring an oper to do them.
+minFixScore = 1000
+
+# Minimum score an op has to be before they can use the CANFIX command for
+# a channel they are ops in.
+minCanFixScore = 500
+
+# Minimum time required between REQUESTOP fixes. (In seconds). The last
+# fix time is updated at the start of a fix so allow time for the first
+# fix aswell as time for a gap.
+minRequestOpTime = 720
+
+# ---------------------------------------------------------------------
+# Network settings
+
+# Version of IRCu used on the network (11 or 12)
+# Use 11 for u2.10.11 and 12 for u2.10.12
+# NOTE: You MUST restart GNUWorld for this change to take place.
+version = 12
+
+# Should burst be used to fix takeovers (through a manual fix)?
+# Burst guarantees that the abusers will not be reopped due to
+# a netsplit, but it can cause problems due to lowering timestamp.
+# NOTE: You MUST restart GNUWorld for this change to take place.
+# NOTE: (2022-05-08): useBurstToFix set to true appears to cause issues with +l and +k modes remaining set. (Issue #13 on Github)
+useBurstToFix = false
+
+# Total number of servers on the network
+numServers = 10
+
+# The minimum percentage of servers that need to be linked;
+# if there are fewer servers linked, chanfix will not fix
+# any channels, be it automatic or manual.
+minServersPresent = 75
+
+# The full server name of the channel service. This is used in
+# checking whether the channel service is currently linked or
+# not to the network.
+chanServName = channels.undernet.org
+
+# ---------------------------------------------------------------------
+# Interface settings
+
+# The amount of scores to report when issuing the SCORE #channel
+# command. Do not set this to a higher value than 10.
+numTopScores = 10
+
+# ---------------------------------------------------------------------
+# Database settings
+
+# Minimum clients needed in a channel for it to be scored
+minClients = 4
+
+# Which clients score a point if they are opped?
+# Client needs to be idented (no ~ before username)
+clientNeedsIdent = false
+
+# ---------------------------------------------------------------------
+# Miscellaneous settings
+
+# Frequency (in seconds) between database connection status checks
+connectCheckFreq = 10
+
+# File where all admin commands sent to backchan are logged and saved
+adminLogFile = /gnuworld/log/chanfix-admin.log
+
+# File where all debug information sent to backchan is logged and saved
+debugLogFile = /gnuworld/log/chanfix-debug.log
+
+# End of config file.
+# ---------------------------------------------------------------------
diff --git a/etc/hub.conf b/etc/hub.conf
new file mode 100644 (file)
index 0000000..fc2023c
--- /dev/null
@@ -0,0 +1,132 @@
+# -- the main show
+
+General {
+        name = "hub.undernet.org";
+        description = "hub";
+        numeric = 1;
+};
+
+Admin {
+       Location = "hub";
+};
+
+Class {
+        name = "Server";
+        pingfreq = 1200;
+        connectfreq = 300;
+        maxlinks = 40;
+        sendq = 250000000;
+};
+
+# -- Class [Users]
+Class {
+        name = "Users";
+        pingfreq = 2 minutes;
+        sendq = 6000000;
+        maxlinks = 10;
+};
+
+# -- Client catchall
+Client {
+        class = "Users";
+        ip = "*@*";
+};
+
+Class {
+        name = "Admin";
+        pingfreq = 1 minutes 30 seconds;
+        sendq = 250000000000;
+        maxlinks = 10;
+        local = no;
+        walk_lchan = yes;
+        unlimit_query = yes;
+        wide_gline = yes;
+        rehash = yes;
+        restart = yes;
+};
+
+Class {
+        name = "operators";
+        pingfreq = 1 minutes 30 seconds;
+        sendq = 250000000;
+        maxlinks = 10;
+        local = no;
+        walk_lchan = yes;
+        rehash = no;
+        restart = no;
+};
+
+Connect {
+        name = "leaf.undernet.org";
+        host = "10.5.0.20";
+        password = "$PLAIN$123456789";
+        port = 4400;
+        class = "Server";
+        autoconnect = yes;
+};
+
+Connect {
+        name = "channels.undernet.org";
+        host = "10.5.0.60";
+        password = "123456789";
+        port = 4400;
+        class = "Server";
+        autoconnect = yes;
+};
+
+Operator {
+        local = no;
+        host = "*";
+        name = "admin";
+        password = "$PLAIN$admin";
+        unlimit_query = yes;
+        class = "Admin";
+};
+
+motd { host = "*"; file = "motd"; };
+
+UWorld {
+        name = "uworld.eu.undernet.org";
+        name = "uworld2.undernet.org";
+        name = "uworld.undernet.org";
+        name = "channels.undernet.org";
+        name = "channels2.undernet.org";
+        name = "channels3.undernet.org";
+        name = "channels4.undernet.org";
+        name = "channels5.undernet.org";
+        name = "channels6.undernet.org";
+        name = "channels7.undernet.org";
+        name = "channels8.undernet.org";
+        name = "chanfix.undernet.org";
+};
+
+Jupe {
+        nick = "A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,{,|,},~,-,_,`";
+        nick = "EuWorld,UWorld,UWorld2";
+        nick = "login,undernet,protocol,pass,newpass,org";
+        nick = "StatServ,NoteServ";
+        nick = "ChanSvr,ChanSaver,ChanServ";
+        nick = "NickSvr,NickSaver,NickServ";
+        nick = "LPT1,LPT2,COM1,COM2,COM3,COM4,AUX";
+};
+
+Port {
+       server = yes;
+       port = 4400;
+};
+
+Port {
+       port = 6669;
+       hidden = yes;
+};
+
+features {
+        "LOG" = "SYSTEM" "FILE" "/tmp/ircd.log";
+        "LOG" = "SYSTEM" "LEVEL" "DEBUG";
+        "RELIABLE_CLOCK"="TRUE";
+        "BUFFERPOOL"="134217728";
+        "HUB"="TRUE";
+        "OPLEVELS" = "FALSE";
+        "ZANNELS" = "FALSE";
+        "MAXCHANNELSPERUSER"="40";
+};
diff --git a/etc/leaf.conf b/etc/leaf.conf
new file mode 100644 (file)
index 0000000..3ab3564
--- /dev/null
@@ -0,0 +1,127 @@
+# -- the main show
+
+General {
+        name = "leaf.undernet.org";
+        description = "leaf";
+        numeric = 2;
+};
+
+Admin {
+       Location = "leaf";
+};
+
+Class {
+        name = "Server";
+        pingfreq = 1200;
+        connectfreq = 300;
+        maxlinks = 40;
+        sendq = 250000000;
+};
+
+# -- Class [Users]
+Class {
+        name = "Users";
+        pingfreq = 2 minutes;
+        sendq = 6000000;
+        maxlinks = 10;
+};
+
+# -- Client catchall
+Client {
+        class = "Users";
+        ip = "*@*";
+};
+
+
+Class {
+        name = "Admin";
+        pingfreq = 1 minutes 30 seconds;
+        sendq = 250000000000;
+        maxlinks = 10;
+        local = no;
+        walk_lchan = yes;
+        unlimit_query = yes;
+        wide_gline = yes;
+        rehash = yes;
+        restart = yes;
+};
+
+
+Class {
+        name = "operators";
+        pingfreq = 1 minutes 30 seconds;
+        sendq = 250000000;
+        maxlinks = 10;
+        local = no;
+        walk_lchan = yes;
+        rehash = no;
+        restart = no;
+};
+
+Connect {
+        name = "hub.undernet.org";
+        host = "10.5.0.10";
+        password = "$PLAIN$123456789";
+        port = 4400;
+        class = "Server";
+        autoconnect = yes;
+        hub = "*";
+};
+
+Operator {
+        local = no;
+        host = "*";
+        password = "$PLAIN$admin";
+        #password = "$SMD5$9n$jhrat4I6WipKISjPWFOzq/";
+        unlimit_query = yes;
+        name = "admin";
+        class = "Admin";
+};
+
+motd { host = "*"; file = "motd"; };
+
+UWorld {
+        name = "uworld.eu.undernet.org";
+        name = "uworld2.undernet.org";
+        name = "uworld.undernet.org";
+        name = "channels.undernet.org";
+        name = "channels2.undernet.org";
+        name = "channels3.undernet.org";
+        name = "channels4.undernet.org";
+        name = "channels5.undernet.org";
+        name = "channels6.undernet.org";
+        name = "channels7.undernet.org";
+        name = "channels8.undernet.org";
+        name = "chanfix.undernet.org";
+};
+
+Jupe {
+        nick = "A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,{,|,},~,-,_,`";
+        nick = "EuWorld,UWorld,UWorld2";
+        nick = "login,undernet,protocol,pass,newpass,org";
+        nick = "StatServ,NoteServ";
+        nick = "ChanSvr,ChanSaver,ChanServ";
+        nick = "NickSvr,NickSaver,NickServ";
+        nick = "LPT1,LPT2,COM1,COM2,COM3,COM4,AUX";
+};
+
+Port {
+       server = yes;
+       hidden = yes;
+       port = 4400;
+};
+
+Port {
+       port = 6667;
+};
+
+features {
+        "LOG" = "SYSTEM" "FILE" "/tmp/ircd.log";
+        "LOG" = "SYSTEM" "LEVEL" "CRIT";
+        "RELIABLE_CLOCK"="TRUE";
+        "BUFFERPOOL"="134217728";
+        "HUB"="FALSE";
+        "OPLEVELS" = "FALSE";
+        "ZANNELS" = "FALSE";
+        "MAXCHANNELSPERUSER"="40";
+};
diff --git a/patches/log4c-alpine-compat+log-paths.patch b/patches/log4c-alpine-compat+log-paths.patch
new file mode 100644 (file)
index 0000000..b314873
--- /dev/null
@@ -0,0 +1,42 @@
+diff --git src/main.cc src/main.cc
+index 00fd8474..81d05797 100644
+--- src/main.cc
++++ src/main.cc
+@@ -50,6 +50,7 @@
+ #ifdef ENABLE_LOG4CPLUS
+ #include <log4cplus/configurator.h>
+ #include <log4cplus/logger.h>
++#include <log4cplus/initializer.h>
+ #endif
+ // main() must be in the global namespace
+@@ -188,7 +189,7 @@ while( autoConnect )
+       // TODO: This will have to be updated when running
+       // in background.
+       {
+-      std::ofstream pidFile( "gnuworld.pid", std::ios::trunc | 
++      std::ofstream pidFile( "/gnuworld/log/gnuworld.pid", std::ios::trunc |
+                               std::ios::out ) ;
+       if( !pidFile )
+               {
+@@ -224,8 +225,8 @@ return 0 ;
+ xServer::xServer( int argc, char** argv )
+  : eventList( EVT_NOOP ),
+-   elogFileName( "debug.log" ),
+-   socketFileName( "socket.log" ),
++   elogFileName( "/gnuworld/log/debug.log" ),
++   socketFileName( "/gnuworld/log/socket.log" ),
+    configFileName( CONFFILE )
+ {
+ logSocket = true ;
+@@ -234,7 +235,8 @@ doDebug = true ;
+ std::cout << "Before configuration" << endl; 
+ #ifdef ENABLE_LOG4CPLUS
+-log4cplus::PropertyConfigurator::doConfigure("logging.properties");
++log4cplus::Initializer initializer;
++log4cplus::PropertyConfigurator::doConfigure("/gnuworld/etc/logging.properties");
+ #endif
+ optind = 0 ;