Skip to content

New script oidentd.py: mini RFC 1413 ident server integrated into WeeChat - #612

Open
TehPeGaSuS wants to merge 1 commit into
weechat:mainfrom
TehPeGaSuS:add-script-oidentd
Open

New script oidentd.py: mini RFC 1413 ident server integrated into WeeChat#612
TehPeGaSuS wants to merge 1 commit into
weechat:mainfrom
TehPeGaSuS:add-script-oidentd

Conversation

@TehPeGaSuS

Copy link
Copy Markdown
Contributor

Script info

  • Script name: oidentd.py
  • Version: 1.0
  • Requirements: oidentd configured with force forward <listen_ip> <listen_port> to hand queries off to this script
  • Min WeeChat version: (none specific, uses hook_fd/hook_timer/hook_signal, available since early WeeChat 1.x)
  • Script tags: irc, identd, network

Description

Spins up a small RFC 1413 ident server integrated directly into WeeChat's event loop via hook_fd(), instead of running a separate identd daemon that has no idea which local port belongs to which IRC server buffer.

oidentd is configured to forward ident queries for a given listen address/port to this script (force forward 127.0.0.1 1113 in /etc/oidentd.conf). The script answers each query with the irc.server.<name>.username of whichever server connection owns the queried local port.

It resolves the local port -> server mapping two ways:

  • a proactively-built cache, populated by polling hdata right after irc_server_connecting fires (before the query normally arrives), avoiding the race where the ident query lands before WeeChat has updated hdata with the new socket
  • a live hdata walk as a fallback/cache-populator

Includes /oidentd status|debug <server>|restart for inspecting the listener state and the lport cache.

Checklist (new script)

  • Single commit, single file added
  • Commit message: New script name.py: short description…
  • No similar script already exists
  • Name: max 32 chars, only lower case letters, digits and underscores
  • Unique name, does not already exist in repository
  • No shebang on the first line
  • Comment in script with name/pseudo, e-mail and license using SPDX tags
  • Only English in code/comments
  • Pure WeeChat API used, no extra API
  • Function hook_url, hook_process or hook_process_hashtable is used for any blocking call (N/A — all sockets are non-blocking and driven via hook_fd)
  • For Python script: works with Python 3 (Python 2 support is optional)
  • Score 100 / 100 displayed by weechat-script-lint

@flashcode flashcode added the new script New script label Sep 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new script New script

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants