From de7d2508625dba686351375fdd956ffc690d35aa Mon Sep 17 00:00:00 2001 From: emmett1 Date: Tue, 31 Mar 2026 07:51:46 +0800 Subject: renamed files --- LICENSE | 21 ++++++ README | 252 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ license | 21 ------ makefile | 21 ------ readme.txt | 252 ------------------------------------------------------------- 5 files changed, 273 insertions(+), 294 deletions(-) create mode 100644 LICENSE create mode 100644 README delete mode 100644 license delete mode 100644 makefile delete mode 100644 readme.txt diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..c7dad4c --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2026 Emmett1 + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/README b/README new file mode 100644 index 0000000..bd9c850 --- /dev/null +++ b/README @@ -0,0 +1,252 @@ +sirc - simple irc +================= + +A simple multi-server terminal IRC client written in C. Single source file, no runtime +dependencies beyond ncurses, OpenSSL, and pthreads. + + +LAYOUT +------ + ++------------------+--------------------------------------------------+----------------+ +| CHANNELS | Don't paste spam. Use a pastebin. Be excellent. | USERS (42) | +| +--------------------------------------------------+ | +| irc.libera.chat | 12:34 -> alice joined | @ChanServ | +| *status* | 12:34 hello everyone | @alice | +| > #python | 12:34 hey! | +bob | +| + #linux | | charlie | +| | | | +| irc.oftc.net | | | +| *status* | | | +| #debian | > _ | | ++------------------+--------------------------------------------------+----------------+ + +Header bar -- topic of the active channel. Blank if no topic is set. + Starts from the left, truncated on the right if too long. + +Channel list -- grouped by server hostname. A ~ prefix on the server name + means disconnected. Channel indicators: + > active channel + + unread messages + ! unread mention of your nick + *status* appears under each server for system/server messages. + Reachable via Ctrl+N/P like any other buffer. + +Chat area -- colour scheme: + per-nick hashed colour (bold) + message body plain white + own messages yellow bold + mentions red bold + actions (/me) magenta italic + join/part gray + URLs blue underline + IRC formatting codes (^B bold, ^C colour, etc.) are stripped + before display. + +User list -- sorted by privilege then alphabetically within each group: + ~ founder/owner (red bold) + & protected op (red bold) + @ op (red bold) + % halfop (yellow bold) + + voice (yellow bold) + regular (white) + +Input -- prompt shows "> " with a blinking cursor as you type. + + +BUILD +----- + +Dependencies: + + Library Arch Debian/Ubuntu + ------- ---- ------------- + ncurses ncurses libncurses-dev + OpenSSL openssl libssl-dev + pthreads (glibc) (glibc) + +Build: + + make + +Install to ~/.local/bin/irc: + + make install + +System-wide: + + PREFIX=/usr/local make install + + +USAGE +----- + + ./irc [options] + +CLI options configure a single server. For multiple servers use a config file. + + --host HOST server hostname (default: irc.libera.chat) + --port PORT server port (default: 6697) + --nick NICK nickname (default: circ_user) + --channel CHAN channel(s) to join, comma-separated + --tls enable TLS (default: on) + --no-tls disable TLS (plain, typically port 6667) + --sasl-user USER SASL username + --sasl-pass PASS SASL password + --config FILE path to config file + +Examples: + + # TLS with SASL + ./irc --host irc.libera.chat --nick kky --sasl-user kky --sasl-pass hunter2 + + # Plain text + ./irc --host irc.libera.chat --port 6667 --no-tls --nick kky + + # Join multiple channels + ./irc --host irc.libera.chat --nick kky --channel '#python,#linux' + + +CONFIG FILE +----------- + +Loaded from ~/.sirc or ~/.config/sirc/config (first found wins). +CLI flags override the first server in the config. + +Use [server] blocks for multiple servers. Each block is an independent +connection with its own nick, channels, and credentials. All servers +connect simultaneously on startup. + + # Global defaults (before any [server] block) + nick = kky + ignore = badbot,spammer + + [server] + host = irc.libera.chat + port = 6697 + tls = true + channel = #python,#linux + sasl_user = kky + sasl_pass = hunter2 + + [server] + host = irc.oftc.net + port = 6697 + tls = true + channel = #debian,#tor + + [server] + host = irc.rizon.net + port = 6667 + tls = false + nick = kky_rizon + channel = #rice + +Per [server] keys: + + host server hostname + port port number + nick nickname for this server + channel comma-separated channels to auto-join + tls true / false + sasl_user SASL PLAIN username + sasl_pass SASL PLAIN password + +Global keys (before any [server] block): + + nick default nick inherited by all servers + ignore comma-separated nicks to ignore globally + + +COMMANDS +-------- + +All commands act on the current server (server of the active channel). + +Messaging: + /msg open a private message window + /notice send a NOTICE + /me CTCP ACTION (* nick text) + /ctcp send a raw CTCP request + +Channels: + /join [#chan] join a channel + /part [#chan] leave a channel (defaults to current) + /cycle [#chan] part and immediately rejoin + /names [#chan] list users in a channel + /topic [text] get the current topic, or set a new one + /invite [#chan] invite someone to a channel + /kick [reason] kick a user from the current channel + /mode [target] [modes] get or set channel/user modes + +Users: + /nick show your current nickname + /nick change your nickname + /whois full whois lookup + /who [target] WHO query on a channel or nick + /away [message] set an away message + /back clear away status + /ignore [nick] ignore a nick (no arg = list ignored nicks) + /unignore stop ignoring a nick + +Server: + /list [pattern] list channels on the current server + /raw send a raw IRC line (alias: /quote) + /server [port] connect to an additional server at runtime + /connect reconnect the current server + /quit [message] disconnect all servers and exit + +UI: + /clear clear the current channel's scrollback + /help show command reference in *status* + + +KEYS +---- + + Tab nick completion -- cycle through matches + colon suffix (nick: ) added at start of line + Ctrl+N next channel + Ctrl+P previous channel + PgUp scroll chat up + PgDn scroll chat down + Ctrl+W delete word left + Up / Down step through input history + Left / Right move cursor + Home / End jump to start/end of input + Delete delete character under cursor + + +FEATURES +-------- + + - Multiple simultaneous servers, each with its own thread, nick, channels + - TLS via OpenSSL with certificate verification (SSL_VERIFY_PEER) + - SASL PLAIN authentication per server, before registration + - Auto-reconnect with 5-second backoff, rejoins all open channels + - Per-nick colours: djb2 hash -> 8 colours, consistent in chat and user list + - IRC formatting stripped: bold, colour, italic, underline, reset, etc. + - Topic shown in header bar, updated live on TOPIC messages + - URLs (http://, https://, www.) rendered with blue underline + - Nick tab-completion with cycling + - Ring buffer scrollback: 500 lines per channel, O(1) insert + - Global ignore list, loadable from config + + +LIMITS +------ + + Max servers 8 + Max channels (total) 128 + Users per channel 512 + Scrollback per channel 500 lines + Input line length 480 chars + Input history 256 lines + Ignore list 64 nicks + Auto-join channels/server 16 + + +LICENSE +------- + +MIT diff --git a/license b/license deleted file mode 100644 index c7dad4c..0000000 --- a/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2026 Emmett1 - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/makefile b/makefile deleted file mode 100644 index e812067..0000000 --- a/makefile +++ /dev/null @@ -1,21 +0,0 @@ -CC = cc -CFLAGS = -std=c99 -Wall -Wextra -Wpedantic -O2 -LDFLAGS = -lncurses -lpthread -lssl -lcrypto - -TARGET = sirc -SRC = sirc.c - -.PHONY: all clean install - -all: $(TARGET) - -$(TARGET): $(SRC) - $(CC) $(CFLAGS) -std=gnu99 -o $@ $^ $(LDFLAGS) - -clean: - rm -f $(TARGET) - -install: $(TARGET) - install -Dm755 $(TARGET) $(DESTDIR)$(PREFIX)/bin/$(TARGET) - -PREFIX ?= $(HOME)/.local diff --git a/readme.txt b/readme.txt deleted file mode 100644 index bd9c850..0000000 --- a/readme.txt +++ /dev/null @@ -1,252 +0,0 @@ -sirc - simple irc -================= - -A simple multi-server terminal IRC client written in C. Single source file, no runtime -dependencies beyond ncurses, OpenSSL, and pthreads. - - -LAYOUT ------- - -+------------------+--------------------------------------------------+----------------+ -| CHANNELS | Don't paste spam. Use a pastebin. Be excellent. | USERS (42) | -| +--------------------------------------------------+ | -| irc.libera.chat | 12:34 -> alice joined | @ChanServ | -| *status* | 12:34 hello everyone | @alice | -| > #python | 12:34 hey! | +bob | -| + #linux | | charlie | -| | | | -| irc.oftc.net | | | -| *status* | | | -| #debian | > _ | | -+------------------+--------------------------------------------------+----------------+ - -Header bar -- topic of the active channel. Blank if no topic is set. - Starts from the left, truncated on the right if too long. - -Channel list -- grouped by server hostname. A ~ prefix on the server name - means disconnected. Channel indicators: - > active channel - + unread messages - ! unread mention of your nick - *status* appears under each server for system/server messages. - Reachable via Ctrl+N/P like any other buffer. - -Chat area -- colour scheme: - per-nick hashed colour (bold) - message body plain white - own messages yellow bold - mentions red bold - actions (/me) magenta italic - join/part gray - URLs blue underline - IRC formatting codes (^B bold, ^C colour, etc.) are stripped - before display. - -User list -- sorted by privilege then alphabetically within each group: - ~ founder/owner (red bold) - & protected op (red bold) - @ op (red bold) - % halfop (yellow bold) - + voice (yellow bold) - regular (white) - -Input -- prompt shows "> " with a blinking cursor as you type. - - -BUILD ------ - -Dependencies: - - Library Arch Debian/Ubuntu - ------- ---- ------------- - ncurses ncurses libncurses-dev - OpenSSL openssl libssl-dev - pthreads (glibc) (glibc) - -Build: - - make - -Install to ~/.local/bin/irc: - - make install - -System-wide: - - PREFIX=/usr/local make install - - -USAGE ------ - - ./irc [options] - -CLI options configure a single server. For multiple servers use a config file. - - --host HOST server hostname (default: irc.libera.chat) - --port PORT server port (default: 6697) - --nick NICK nickname (default: circ_user) - --channel CHAN channel(s) to join, comma-separated - --tls enable TLS (default: on) - --no-tls disable TLS (plain, typically port 6667) - --sasl-user USER SASL username - --sasl-pass PASS SASL password - --config FILE path to config file - -Examples: - - # TLS with SASL - ./irc --host irc.libera.chat --nick kky --sasl-user kky --sasl-pass hunter2 - - # Plain text - ./irc --host irc.libera.chat --port 6667 --no-tls --nick kky - - # Join multiple channels - ./irc --host irc.libera.chat --nick kky --channel '#python,#linux' - - -CONFIG FILE ------------ - -Loaded from ~/.sirc or ~/.config/sirc/config (first found wins). -CLI flags override the first server in the config. - -Use [server] blocks for multiple servers. Each block is an independent -connection with its own nick, channels, and credentials. All servers -connect simultaneously on startup. - - # Global defaults (before any [server] block) - nick = kky - ignore = badbot,spammer - - [server] - host = irc.libera.chat - port = 6697 - tls = true - channel = #python,#linux - sasl_user = kky - sasl_pass = hunter2 - - [server] - host = irc.oftc.net - port = 6697 - tls = true - channel = #debian,#tor - - [server] - host = irc.rizon.net - port = 6667 - tls = false - nick = kky_rizon - channel = #rice - -Per [server] keys: - - host server hostname - port port number - nick nickname for this server - channel comma-separated channels to auto-join - tls true / false - sasl_user SASL PLAIN username - sasl_pass SASL PLAIN password - -Global keys (before any [server] block): - - nick default nick inherited by all servers - ignore comma-separated nicks to ignore globally - - -COMMANDS --------- - -All commands act on the current server (server of the active channel). - -Messaging: - /msg open a private message window - /notice send a NOTICE - /me CTCP ACTION (* nick text) - /ctcp send a raw CTCP request - -Channels: - /join [#chan] join a channel - /part [#chan] leave a channel (defaults to current) - /cycle [#chan] part and immediately rejoin - /names [#chan] list users in a channel - /topic [text] get the current topic, or set a new one - /invite [#chan] invite someone to a channel - /kick [reason] kick a user from the current channel - /mode [target] [modes] get or set channel/user modes - -Users: - /nick show your current nickname - /nick change your nickname - /whois full whois lookup - /who [target] WHO query on a channel or nick - /away [message] set an away message - /back clear away status - /ignore [nick] ignore a nick (no arg = list ignored nicks) - /unignore stop ignoring a nick - -Server: - /list [pattern] list channels on the current server - /raw send a raw IRC line (alias: /quote) - /server [port] connect to an additional server at runtime - /connect reconnect the current server - /quit [message] disconnect all servers and exit - -UI: - /clear clear the current channel's scrollback - /help show command reference in *status* - - -KEYS ----- - - Tab nick completion -- cycle through matches - colon suffix (nick: ) added at start of line - Ctrl+N next channel - Ctrl+P previous channel - PgUp scroll chat up - PgDn scroll chat down - Ctrl+W delete word left - Up / Down step through input history - Left / Right move cursor - Home / End jump to start/end of input - Delete delete character under cursor - - -FEATURES --------- - - - Multiple simultaneous servers, each with its own thread, nick, channels - - TLS via OpenSSL with certificate verification (SSL_VERIFY_PEER) - - SASL PLAIN authentication per server, before registration - - Auto-reconnect with 5-second backoff, rejoins all open channels - - Per-nick colours: djb2 hash -> 8 colours, consistent in chat and user list - - IRC formatting stripped: bold, colour, italic, underline, reset, etc. - - Topic shown in header bar, updated live on TOPIC messages - - URLs (http://, https://, www.) rendered with blue underline - - Nick tab-completion with cycling - - Ring buffer scrollback: 500 lines per channel, O(1) insert - - Global ignore list, loadable from config - - -LIMITS ------- - - Max servers 8 - Max channels (total) 128 - Users per channel 512 - Scrollback per channel 500 lines - Input line length 480 chars - Input history 256 lines - Ignore list 64 nicks - Auto-join channels/server 16 - - -LICENSE -------- - -MIT -- cgit v1.2.3