Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
102 commits
Select commit Hold shift + click to select a range
a10422b
Implement IRCv3.2+ CAP 302 and SASL re-authentication support
MrLenin Dec 23, 2025
ca3e772
Add server-time IRCv3 capability
MrLenin Dec 23, 2025
28ecac2
Add echo-message IRCv3 capability
MrLenin Dec 23, 2025
39a824e
Add account-tag IRCv3 capability
MrLenin Dec 23, 2025
17178db
Add chghost IRCv3 capability
MrLenin Dec 23, 2025
9964049
Add invite-notify IRCv3 capability
MrLenin Dec 23, 2025
abd2a48
Add labeled-response IRCv3 capability
MrLenin Dec 23, 2025
e1077fb
Add batch IRCv3 capability
MrLenin Dec 23, 2025
42d206c
feat: Add IRCv3 setname capability with P10 SE command
MrLenin Dec 23, 2025
2f37ede
feat: Add IRCv3 message tags, standard-replies, TAGMSG, and msgid
MrLenin Dec 23, 2025
4e6184f
feat: Implement Phase 13b - client-only tag propagation for TAGMSG
MrLenin Dec 23, 2025
dc08e53
feat: Implement Phase 13c - S2S message tag propagation for PRIVMSG/N…
MrLenin Dec 23, 2025
9703606
feat: Implement Phase 13d - S2S BATCH command (BT token) for netjoin/…
MrLenin Dec 23, 2025
0e9208c
Hook netjoin/netsplit batches into network events
MrLenin Dec 23, 2025
308927f
Include @batch tag in QUIT/JOIN messages during netsplit/netjoin
MrLenin Dec 23, 2025
08f6927
feat: Add IRCv3 standard-replies (FAIL) to IRCv3 commands
MrLenin Dec 23, 2025
f40906c
feat: Don't advertise SASL capability when SASL server is unavailable
MrLenin Dec 24, 2025
45d1a16
Add dynamic SASL mechanism list support
MrLenin Dec 24, 2025
9b65aed
Fix per-capability message tag sending in broadcast functions
MrLenin Dec 24, 2025
5d65a51
Remove dead code from per-capability tag fix
MrLenin Dec 24, 2025
99ad683
feat: Implement draft/no-implicit-names capability
MrLenin Dec 24, 2025
f14d0b7
feat: Implement draft/extended-isupport capability
MrLenin Dec 24, 2025
28d482f
feat: Implement draft/pre-away capability (Phase 25)
MrLenin Dec 24, 2025
6d15b0c
feat: Implement draft/multiline capability (Phase 26)
MrLenin Dec 24, 2025
add48dd
feat: Implement native WebSocket support (draft spec)
MrLenin Dec 24, 2025
a085a8d
build: Add missing dependency rules for new source files
MrLenin Dec 24, 2025
0e8b095
feat: Implement draft/chathistory with LMDB storage
MrLenin Dec 24, 2025
ce0d9c2
feat: Implement draft/message-redaction with chathistory integration
MrLenin Dec 24, 2025
9836258
feat: Add draft/account-registration implementation
MrLenin Dec 24, 2025
347101f
feat: Implement client batch timeout for draft/multiline
MrLenin Dec 24, 2025
d57793d
feat: Implement draft/read-marker extension
MrLenin Dec 24, 2025
82bd1e7
feat: Add draft/channel-rename and draft/event-playback implementations
MrLenin Dec 24, 2025
f823288
feat: Add draft/metadata-2 implementation
MrLenin Dec 24, 2025
92ea12a
feat: Add LMDB persistence for metadata-2
MrLenin Dec 24, 2025
3fb1866
feat: Load account metadata on login
MrLenin Dec 24, 2025
ceca10d
feat: Add metadata subscriber notifications
MrLenin Dec 24, 2025
04cb970
feat: Add draft/webpush implementation to Nefarious
MrLenin Dec 24, 2025
1cf9e04
feat: Enhance metadata implementation with SYNC, rate limiting, visib…
MrLenin Dec 24, 2025
a3cea43
feat: Add metadata visibility storage support
MrLenin Dec 24, 2025
72a55db
feat: Add enhancements for chathistory, ISUPPORT, and TAGMSG
MrLenin Dec 24, 2025
7e7c95e
feat: Add presence aggregation with AWAY * support
MrLenin Dec 25, 2025
ca033ea
feat: Add cache-aware metadata with X3 detection and write queue
MrLenin Dec 25, 2025
1868ee0
feat: Add METADATAQUERY (MDQ) P10 token for on-demand metadata sync
MrLenin Dec 25, 2025
fdd0c93
feat: Complete MDQ flow with multi-hop routing support
MrLenin Dec 25, 2025
ec7af09
feat: Route MARKREAD through X3 for authoritative storage
MrLenin Dec 25, 2025
5c65e41
feat: Add zstd compression for LMDB storage (chathistory/metadata)
MrLenin Dec 25, 2025
ca7737b
fix: Regenerate autoconf files and fix LMDB/ZSTD linking
MrLenin Dec 26, 2025
b318d8d
feat(register): Implement IRCv3 account-registration for pre-reg clients
MrLenin Dec 26, 2025
304738b
feat: Add metadata LMDB persistence and fix volume permissions
MrLenin Dec 26, 2025
68c6003
feat: Enhance metadata LMDB and MDQ query system
MrLenin Dec 26, 2025
5ceb79a
fix: TAGMSG delivery now checks CAP_MSGTAGS capability
MrLenin Dec 26, 2025
6cfe580
fix: Ensure echo-message and chathistory use same msgid
MrLenin Dec 26, 2025
7586eff
fix: Add echo-message support for TAGMSG
MrLenin Dec 26, 2025
e6f94e4
fix: Increase batch ID buffer size to IRCv3 spec (64 chars)
MrLenin Dec 27, 2025
5711950
refactor: Remove gosu, use init container for volume permissions
MrLenin Dec 27, 2025
bb702e7
feat: Add S2S multiline batch propagation via ML token
MrLenin Dec 27, 2025
e4f17d2
feat: Decompress and cache metadata for online users
MrLenin Dec 27, 2025
cbfd496
feat: Add FEAT_REGISTER_SERVER for configurable registration target
MrLenin Dec 27, 2025
b0267c7
feat: Add FEAT_AWAY_THROTTLE to rate-limit AWAY changes
MrLenin Dec 27, 2025
0025fb9
feat: Add S2S chathistory federation for distributed history access
MrLenin Dec 28, 2025
da25f3b
feat: Add LMDB cache-through for X3 authoritative metadata
MrLenin Dec 28, 2025
03709f5
fix: Store full client numeric for CHATHISTORY federation lookup
MrLenin Dec 28, 2025
3bf9751
feat: Add 'make test' target to run unit tests
MrLenin Dec 28, 2025
996844b
feat: Add CMocka unit testing framework support
MrLenin Dec 28, 2025
bfa7733
feat: Add comprehensive CMocka unit test suite
MrLenin Dec 28, 2025
2c62153
fix: Correct CMocka test assertions to match nefarious implementation
MrLenin Dec 28, 2025
6a0c026
docs: Document historical ircu behavior in CMocka tests
MrLenin Dec 28, 2025
48e3193
test: Add ircd_compress CMocka unit tests
MrLenin Dec 28, 2025
655fdac
test: Add ircd_cloaking CMocka unit tests
MrLenin Dec 28, 2025
24f1eb8
test: Add dbuf CMocka unit tests
MrLenin Dec 28, 2025
516fab5
test: Add ircd_crypt CMocka unit tests
MrLenin Dec 28, 2025
fd7e31e
test: Add crule CMocka unit tests
MrLenin Dec 28, 2025
c4516f1
test: Add history serialization CMocka unit tests
MrLenin Dec 28, 2025
0ad9321
refactor: Use Unix timestamps internally, ISO 8601 only for clients
MrLenin Dec 30, 2025
1e5004b
fix: Convert client ISO timestamps to Unix for CHATHISTORY queries
MrLenin Dec 30, 2025
ea4c557
perf: Optimize CHATHISTORY S2S format for efficiency
MrLenin Dec 30, 2025
80859cb
perf: Remove T/M prefixes from CHATHISTORY S2S references
MrLenin Dec 30, 2025
bf6f7ff
feat: Add /STATS integration for CHATHISTORY and METADATA
MrLenin Dec 30, 2025
6de2af3
feat: Add TTL-based cache expiry for metadata LMDB storage
MrLenin Dec 30, 2025
dfdaf18
chore: Update .gitignore for CMocka test binaries
MrLenin Dec 30, 2025
4429999
feat: Add per-user PM chathistory opt-in consent system
MrLenin Dec 30, 2025
c1f6846
fix: Add backwards-compatible fallback for standard-replies
MrLenin Dec 30, 2025
de1bf00
fix: Handle interactive SSL prompt in Dockerfile build
MrLenin Dec 30, 2025
9e77258
feat: Add msgid and time tags to multiline batch messages
MrLenin Dec 30, 2025
81a69ab
feat: Normalize PM targets for chathistory queries
MrLenin Dec 30, 2025
3c7bd48
feat: Enable draft IRCv3 capabilities and PM chathistory in docker co…
MrLenin Dec 30, 2025
02fb7f9
feat: Add RFC 6455 WebSocket compliance improvements
MrLenin Jan 1, 2026
f3c9fd0
fix: WebSocket RFC 6455 §4.2.2 - only send subprotocol when client re…
MrLenin Jan 1, 2026
6e2b9f3
Merge upstream/master: security hardening fixes accepted
MrLenin Jan 2, 2026
e901266
feat: Add configurable TCP_NODELAY for C2S and S2S connections
MrLenin Jan 3, 2026
505d00b
fix: SASL session hardening and error logging
MrLenin Jan 3, 2026
e392299
fix: Add IsDead validation for SASL agent server references
MrLenin Jan 3, 2026
ede1c0f
fix: Proactively abort SASL sessions when services server disconnects
MrLenin Jan 3, 2026
268acbd
feat: Add multiline batch flood protection and rate limiting
MrLenin Jan 5, 2026
79bed02
fix: Prevent use-after-free in chathistory federation requests
MrLenin Jan 5, 2026
da48caf
feat: Add PBKDF2-SHA256/SHA512 password hashing support
MrLenin Jan 5, 2026
5c6fd29
feat: Add certificate expiry tracking and WebSocket origin validation
MrLenin Jan 6, 2026
8846819
feat(multiline): Add WARN notification, +M user mode, and storage fea…
MrLenin Jan 6, 2026
ffb015b
feat(multiline): Implement &ml- virtual channel storage (Phase 3A)
MrLenin Jan 6, 2026
9b40d65
fix(multiline): Always include retrieval hint when truncation occurs
MrLenin Jan 6, 2026
6da5f39
refactor(multiline): Implement 3-tier truncation with size-appropriat…
MrLenin Jan 6, 2026
ab25cc9
feat(batch): Add labeled-response correlation for multiline WARN
MrLenin Jan 6, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 15 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ ENV GID 1234
ENV UID 1234

RUN DEBIAN_FRONTEND=noninteractive RUNLEVEL=1 apt-get update
RUN DEBIAN_FRONTEND=noninteractive RUNLEVEL=1 apt-get -y install build-essential libssl-dev autoconf automake flex libpcre3-dev byacc gawk git vim procps net-tools iputils-ping bind9-host
RUN DEBIAN_FRONTEND=noninteractive RUNLEVEL=1 apt-get -y install build-essential libssl-dev autoconf automake flex libpcre3-dev byacc gawk git vim procps net-tools iputils-ping bind9-host liblmdb-dev libzstd-dev libcmocka-dev valgrind
#libgeoip-dev libmaxminddb-dev

# Perl dependencies for iauthd.pl (commented out - using TypeScript version)
#RUN DEBIAN_FRONTEND=noninteractive apt-get -y install libpoe-perl libpoe-component-client-dns-perl libterm-readkey-perl libfile-slurp-perl libtime-duration-perl

# Node.js for iauthd-ts
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install nodejs npm
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install nodejs npm

RUN mkdir -p /home/nefarious/nefarious2
RUN mkdir -p /home/nefarious/ircd
Expand All @@ -20,6 +20,9 @@ COPY . /home/nefarious/nefarious2

RUN groupadd -g ${GID} nefarious
RUN useradd -u ${UID} -g ${GID} nefarious
# Create LMDB directories for chathistory and metadata storage
# Create cores directory for valgrind logs
RUN mkdir -p /home/nefarious/ircd/history /home/nefarious/ircd/metadata /home/nefarious/ircd/cores
RUN chown -R nefarious:nefarious /home/nefarious
USER nefarious

Expand All @@ -31,8 +34,12 @@ WORKDIR /home/nefarious/nefarious2

# I cant get the maxminddb library to compile in at all in debian 12, give up on geoip for now
# --with-geoip=/usr --with-mmdb=/usr \
RUN ./configure --libdir=/home/nefarious/ircd --enable-debug --with-maxcon=4096
# Enable LMDB for chathistory and zstd for compression
RUN ./configure --libdir=/home/nefarious/ircd --enable-debug --with-maxcon=4096 --with-lmdb=/usr --with-zstd=/usr
RUN make
# Run unit tests during build (they require the built object files)
RUN make test
# make install runs an interactive SSL generator - pre-create pem to skip, then remove so entrypoint generates fresh one
RUN touch /home/nefarious/ircd/ircd.pem && make install && rm /home/nefarious/ircd/ircd.pem

# Build iauthd-ts
Expand All @@ -53,8 +60,7 @@ RUN ln -sf /dev/stdout /home/nefarious/ircd/ircd.log
USER root
#Clean up build
RUN rm -rf /home/nefarious/nefarious2
RUN apt-get remove -y build-essential && apt-get autoremove -y
RUN apt-get clean
RUN apt-get remove -y build-essential && apt-get autoremove -y && apt-get clean

USER nefarious

Expand All @@ -71,9 +77,12 @@ COPY tools/docker/base.conf-dist /home/nefarious/ircd/base.conf-dist
COPY tools/docker/ircd.conf /home/nefarious/ircd/ircd.conf
COPY tools/docker/linesync.conf /home/nefarious/ircd/linesync.conf

# Run entrypoint (volume permissions fixed by init container in docker-compose)
ENTRYPOINT ["/home/nefarious/dockerentrypoint.sh"]

CMD ["/home/nefarious/bin/ircd", "-n", "-x", "5", "-f", "ircd-docker.conf"]
# Run with Valgrind for memory testing (logs to cores mount for easy access)
# %n = sequence number for unique filenames per run (starts at 0)
CMD ["valgrind", "--leak-check=full", "--show-leak-kinds=all", "--track-origins=yes", "--log-file=/home/nefarious/ircd/cores/valgrind.%n.log", "/home/nefarious/bin/ircd", "-n", "-x", "5", "-f", "ircd-docker.conf"]



6 changes: 5 additions & 1 deletion Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ IRCD_MAKEFILES = Makefile ircd/Makefile ircd/test/Makefile

all: build

.PHONY: server build depend install config update diff patch export update
.PHONY: server build depend install config update diff patch export update test
# Some versions of make give a warning when this is empty:
.SUFFIXES: .dummy

Expand Down Expand Up @@ -101,6 +101,10 @@ depend: ${IRCD_MAKEFILES}
cd $$i; ${MAKE} depend; cd ..; \
done

test: ${IRCD_MAKEFILES}
@echo "Running unit tests..."
cd ircd/test && ${MAKE} test

install: ${IRCD_MAKEFILES}
test -d ${prefix} || mkdir ${prefix}
@for i in ${SUBDIRS}; do \
Expand Down
72 changes: 42 additions & 30 deletions config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -33,40 +33,40 @@
/* Define to 1 if you have the <crypt.h> header file. */
#undef HAVE_CRYPT_H

/* Define to 1 if you have the `getrusage' function. */
/* Define to 1 if you have the 'getrusage' function. */
#undef HAVE_GETRUSAGE

/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H

/* Define to 1 if you have the `kqueue' function. */
/* Define to 1 if you have the 'kqueue' function. */
#undef HAVE_KQUEUE

/* Define to 1 if you have the `nsl' library (-lnsl). */
/* Define to 1 if you have the 'nsl' library (-lnsl). */
#undef HAVE_LIBNSL

/* Define to 1 if you have the `resolv' library (-lresolv). */
/* Define to 1 if you have the 'resolv' library (-lresolv). */
#undef HAVE_LIBRESOLV

/* Define to 1 if you have the `socket' library (-lsocket). */
/* Define to 1 if you have the 'socket' library (-lsocket). */
#undef HAVE_LIBSOCKET

/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H

/* Define to 1 if you have the <poll.h> header file. */
#undef HAVE_POLL_H

/* Define to 1 if system calls automatically restart after interruption by a
signal. */
#undef HAVE_RESTARTABLE_SYSCALLS

/* Define to 1 if you have the `setrlimit' function. */
/* Define to 1 if you have the 'setrlimit' function. */
#undef HAVE_SETRLIMIT

/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H

/* Define to 1 if you have the <stdio.h> header file. */
#undef HAVE_STDIO_H

/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H

Expand Down Expand Up @@ -97,13 +97,16 @@
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H

/* Define to 1 if you have the <sys/time.h> header file. */
#undef HAVE_SYS_TIME_H

/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H

/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
#undef HAVE_SYS_WAIT_H

/* Define to 1 if you have the `times' function. */
/* Define to 1 if you have the 'times' function. */
#undef HAVE_TIMES

/* Define to 1 if you have the <unistd.h> header file. */
Expand Down Expand Up @@ -169,22 +172,22 @@
/* Define if you have POSIX signals. */
#undef POSIX_SIGNALS

/* The size of `int', as computed by sizeof. */
/* The size of 'int', as computed by sizeof. */
#undef SIZEOF_INT

/* The size of `int64_t', as computed by sizeof. */
/* The size of 'int64_t', as computed by sizeof. */
#undef SIZEOF_INT64_T

/* The size of `long', as computed by sizeof. */
/* The size of 'long', as computed by sizeof. */
#undef SIZEOF_LONG

/* The size of `long long', as computed by sizeof. */
/* The size of 'long long', as computed by sizeof. */
#undef SIZEOF_LONG_LONG

/* The size of `short', as computed by sizeof. */
/* The size of 'short', as computed by sizeof. */
#undef SIZEOF_SHORT

/* The size of `void *', as computed by sizeof. */
/* The size of 'void *', as computed by sizeof. */
#undef SIZEOF_VOID_P

/* Path to executable for restarts */
Expand All @@ -196,16 +199,19 @@
/* Path name used as a base for the ssl lib files. */
#undef SSL_LIBS_PATH

/* Define to 1 if you have the ANSI C header files. */
/* Define to 1 if all of the C89 standard headers exist (not just the ones
required in a freestanding environment). This macro is provided for
backward compatibility; new code need not use it. */
#undef STDC_HEADERS

/* Define if you have (unreliable) SysV signals. */
#undef SYSV_UNRELIABLE_SIGNALS

/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. This
macro is obsolete. */
#undef TIME_WITH_SYS_TIME

/* Define to 1 if your <sys/time.h> declares `struct tm'. */
/* Define to 1 if your <sys/time.h> declares 'struct tm'. */
#undef TM_IN_SYS_TIME

/* Define to enable the /dev/poll engine */
Expand All @@ -223,6 +229,9 @@
/* Define to enable the kqueue engine */
#undef USE_KQUEUE

/* Define if you are using LMDB for chathistory */
#undef USE_LMDB

/* Define if you are using MaxMindDB */
#undef USE_MMDB

Expand All @@ -232,6 +241,9 @@
/* Define if you are using OpenSSL */
#undef USE_SSL

/* Define if you are using zstd compression */
#undef USE_ZSTD

/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
significant byte first (like Motorola and SPARC, unlike Intel). */
#if defined AC_APPLE_UNIVERSAL_BUILD
Expand All @@ -244,36 +256,36 @@
# endif
#endif

/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a
`char[]'. */
/* Define to 1 if 'lex' declares 'yytext' as a 'char *' by default, not a
'char[]'. */
#undef YYTEXT_POINTER

/* Define to `int' if <sys/types.h> doesn't define. */
/* Define as 'int' if <sys/types.h> doesn't define. */
#undef gid_t

/* Define to `short' if <sys/types.h> does not define. */
/* Define to 'short' if <sys/types.h> does not define. */
#undef int16_t

/* Define to `long' if <sys/types.h> does not define. */
/* Define to 'long' if <sys/types.h> does not define. */
#undef int32_t

/* Define to `long long' if <sys/types.h> does not define. */
/* Define to 'long long' if <sys/types.h> does not define. */
#undef int64_t

/* Define to `unsigned int' if <sys/types.h> does not define. */
/* Define as 'unsigned int' if <stddef.h> doesn't define. */
#undef size_t

/* type to use in place of socklen_t if not defined */
#undef socklen_t

/* Define to `int' if <sys/types.h> doesn't define. */
/* Define as 'int' if <sys/types.h> doesn't define. */
#undef uid_t

/* Define to `unsigned short' if <sys/types.h> does not define. */
/* Define to 'unsigned short' if <sys/types.h> does not define. */
#undef uint16_t

/* Define to `unsigned long' if <sys/types.h> does not define. */
/* Define to 'unsigned long' if <sys/types.h> does not define. */
#undef uint32_t

/* Define to `unsigned long long' if <sys/types.h> does not define. */
/* Define to 'unsigned long long' if <sys/types.h> does not define. */
#undef uint64_t
Loading