NCDC(1)

πŸ’– NCDC(1) β€” the ncdc manual, bestie edition πŸ’–

ncdc manual ✨ okay so welcome to the Ncurses Direct Connect Client page, we're doing this together, grab a snack πŸ“


🌸 NAME 🌸

ncdc β€” Ncurses Direct Connect Client πŸ’… that's the whole name, she's short, she's iconic, she's the moment


✨ SYNOPSIS ✨

ncdc [options]

that's it. that's the whole summoning ritual 🧚


πŸ¦‹ DESCRIPTION πŸ¦‹

Ncdc is a modern and lightweight direct connect client, and she comes with a friendly ncurses interface. like. she's pretty AND she works. we love a multi-hyphenate πŸ‘‘


πŸŽ€ GETTING STARTED πŸŽ€

okay bestie, this part is the baby's first ncdc section, for anyone who's never touched this thing before. the chapters further down go way deeper into everything she can do, no worries.

πŸ‘€ what you're looking at when you open her

What you see when starting up ncdc is basically two things:

  • an input line where you type commands
  • a log window where the results show up

ngl it's giving regular terminal energy, and that's on purpose. 🫢

Commands within ncdc start with a slash β€” like /help β€” and there's tab completion to help you out, because typing full words is for people with time ✨

🌱 first-time setup

so the very first thing you're gonna wanna do after launching ncdc for the first time is set up some basic info and settings, fr fr:

/set nick MyNick
/set description ncdc is awesome!
/set connection 10
/share "My Awesome Files" /path/to/files

and if you have a direct connection to the internet, or if your router is cool with port forwarding, you might also wanna turn on active mode:

/set active_port 34194
/set active true

πŸ“– go read the help text for each of those commands and settings if you want more, it's all there.

πŸ’– and yes β€” all of the above settings are saved to the database and will be used again on the next run. she remembers. she's not gonna make you redo it. queen behavior.

πŸ”Œ connecting to a hub

to connect to a hub, you use /open:

/open ncdc adc://dc.blicky.net:2780/

so in that line, ncdc is the personal name you're giving to that hub, and the second argument is the URL. 🌈

This URL will be saved in the database, so next time you wanna connect to this hub you can literally just do /open ncdc and you're in. πŸ’«

go read the help text for /open and /connect for the full tea. and if you want ncdc to auto-connect to a hub when she starts up, that's the autoconnect setting πŸŽ€

πŸ—‚οΈ the tab situation

Ncdc uses a tabbed interface: every hub opens in a new tab, and there are several other kinds of tabs available too. the type of tab is indicated in the tab list on the bottom of the screen with a character prefix. hubs, for example, are prefixed with a #. πŸ’…

and if a tab needs your attention, there's a colored exclamation mark displayed before the tab name β€” different colors are used for different types of activity, so you can tell at a glance what kind of chaos is happening πŸ”₯

🧭 everything else

Everything else should be fairly self-explanatory</purl>, but let's speedrun it anyway because I got you:

  • to search for files β†’ /search
  • to browse through the user list of a hub β†’ /userlist or hit Alt+u
  • to browse someone's file list β†’ /browse or hit the 'b' key in the user list
  • to monitor your upload and download connections β†’ /connections or hit Alt+n

slay. that's the whole starter pack. 🎁


✨ OPTIONS ✨

here's every flag she takes, no skips, no cuts πŸ’–

  • -c, --session-dir= dir β€” use a different session directory. defaults to whatever's in the environment variable $NCDC_DIR, or if that's not set, it falls back to $HOME/.ncdc 🏠
  • -h, --help β€” display a summary of options. the "help me please" button πŸ™ˆ
  • -n, --no-autoconnect β€” don't automatically connect to hubs that have the "autoconnect" option set. like, she'll hold back, respectfully 🫢
  • --no-bracketed-paste β€” disable bracketed pasting. that's it, that's the flag βœ‚οΈ
  • -v, --version β€” display the ncdc version. flex check πŸ’…

🌈 GETTING CONNECTED 🌈

okay so as with most file sharing clients, ncdc supports two modes of being connected: active and passive. let's talk about it because this is lowkey the most important part πŸ‘€

😴 passive mode (the default)

In passive mode, you can connect out to the outside world, but nobody can connect (directly) to you.

when you're passive, you'll only be able to transfer files with people who are in active mode. so you're kinda limited, ngl 😭

⚑ active mode

In active mode, however, you'll have some port open to the rest of the network that other clients can connect to. and when you're active:

  • you'll be able to transfer files with everyone 🌍
  • you may get more and faster search results πŸ”₯
Configuring active mode is therefore recommended. like genuinely, do it bestie, it's worth it πŸ’–

πŸ› οΈ how to switch to active mode

In many setups, all you need to do is set a TCP/UDP port and enable the "active" setting:

/set active_port 34194
/set active true

that's it. two lines. iconic ✨

πŸ“Š checking your status

When you connect to a hub</purl>, the status bar will tell you whether you're active or passive on that particular hub, and what IP address is being used to let others connect to you. πŸ‘‘

For most hubs, your IP address will be detected automatically, but in the event that this fails, you can set it yourself:

/set active_ip 13.33.33.7

manual override, we love a backup plan 🫢

πŸšͺ NAT and firewalls

If you are behind a NAT or firewall, you have to make sure that the port you configured is somehow allowed and/or forwarded. no port forwarding, no active mode, that's just how it is 😀

here's the deets:

  • the "active_port" setting is used for incoming TCP connections and UDP messages
  • you can configure a different UDP port with the "active_udp_port" setting
  • Contrary to many other Direct Connect clients, ncdc only uses a single port for incoming TCP and TLS connections β€” there is no separate port for TLS πŸŽ€

πŸ” the /listen command

The /listen command can tell you which ports it expects to be forwarded, and for which hubs these ports will be used. πŸ‘€

⚠️ it only lists hubs on which you are currently active, so the output will change when you open or close a hub connection. don't be confused bestie, it's just doing its job πŸ’€

πŸ–§ multiple network interfaces

If you have multiple network interfaces, you can force ncdc to use only a single interface by setting the "local_address" setting to the address of that interface. ✨

this affects both:

  • outgoing connections β€” they'll be forced to go through the configured interface
  • incoming connections β€” the ports will be bound to the configured interface

🌍 per-hub settings, the plot twist

All of the previously mentioned settings can be set:

  • globally β€” with /set
  • on a per-hub basis β€” with /hset

and this is genuinely so good, because it means you can:

  • be active on an internet hub and a LAN-only hub at the same time 🌈
  • be active in one hub while passive in another πŸ’…
  • use different ports for each hub πŸŽ€

main character energy, honestly. she contains multitudes πŸ‘‘


more chapters coming, bestie β€” don't go anywhere πŸ¦‹

πŸ’¬ INTERACTIVE COMMANDS πŸ’¬

okay bestie, here's the full tea on every single command you can type inside ncdc. You can also just run /help to pull up the command list and get to this very documentation. iykyk 🫢


/accept

Use this one to accept the TLS certificate of a hub. It's only for that one situation where the keyprint of the hub's TLS certificate does not match the keyprint sitting in the database. πŸ”

/browse [[-f] <user>]

With no arguments, this pops open a new tab where you can browse your own file list. ⚠️ Heads up though: changes you make to your list are not immediately visible in the browser. You've gotta re-open the tab to get the latest version of your list. no shortcuts, sorry πŸ₯²

With arguments, the file list of the specified user gets downloaded (if it hasn't been downloaded already) and the browse tab opens up once it's done. The -f flag forces the file list to be (re-)downloaded. πŸ’…

/clear

Clears the log showing on your screen. Does not touch the log files in any way. Ctrl+l is a shortcut for this one. ✨

/close

Closes the current tab. When you close a hub tab, you get disconnected from the hub, and all related userlist and PM tabs also get closed. Alt+c is the shortcut. πŸšͺ

/connect [<address>]

Kicks off a connection with a hub. If you don't give an address, it connects to the hub you last used on the current tab. The address should look like protocol://host:port/ or host:port. The :port part is optional in both cases and defaults to :411. These protocols are recognized: dchub, nmdc, nmdcs, adc, adcs. When you're connecting to an nmdcs or adcs hub and the SHA256 keyprint is known, you can attach it to the url as ?kp=SHA256/<base32-encoded-keyprint>. πŸ”—

Note: this command only works on hub tabs. Want a brand new connection to a hub? You need /open first.

For example:

/open testhub
/connect dchub://dc.some-test-hub.com/

See the /open command for more info. πŸ‘€

/connections

Opens the connections tab. 🌐

/delhub <name>

Removes a hub from the configuration. bye bye πŸ‘‹

/disconnect

Disconnects from a hub. that's it, that's the command πŸ’€

/gc

Cleans up unused data and reorganizes existing data so storage and usage are more efficient. Currently this command removes unused hash data, does a VACUUM on db.sqlite3, removes unused files in inc/ and old files in fl/. 🧹

This command may take some time to complete, and it will fully block ncdc while it's running. It's recommended you run this every once in a while β€” every month is a good interval. And note: when ncdc says it's completed this command, it's lying to you. 😭 Ncdc will still run a few large queries in the background, which may take up to a minute to complete.

/grant [-list|<user>]

Grants someone a slot. This lets the user download from you even if you have no free slots. The slot stays granted until you use the /ungrant command β€” even if ncdc has been restarted in the meantime. πŸ‘‘

Want a list of everyone you've granted a slot to? Use /grant with no arguments, or with -list.

Be warned: using /grant with no arguments on a PM tab will grant the slot to the user you're talking with. Make sure you use -list in that case. πŸ™ˆ

Note that a granted slot is specific to a single hub. If the same user is also on other hubs, they will not be granted a slot on those hubs. fr fr

/help [<command>|set <key>|keys [<section>]]

Want a list of available commands? /help with no arguments. Want info on a particular command? /help <command>. Want info on a configuration setting? /help set <setting>. Want help on key bindings? /help keys. πŸŽ€

/hset [<key> [<value>]]

Get or set per-hub configuration variables. Works just like /set, but it can only be used on hub tabs. Use /hunset to reset a variable back to its global value. πŸ”§

/hunset [<key>]

Resets a per-hub configuration variable back to its global value. ✨

/kick <user>

Kicks a user from the hub. This only works on NMDC hubs, and you need to be an OP to use it. πŸ’€

/listen

Lists currently opened ports. πŸšͺ

/me <message>

Lets you talk in third person. Most clients will show your message as something like:

** Nick is doing something
Note: this only works correctly on ADC hubs. The NMDC protocol doesn't have this feature, so your message gets sent as-is, including the /me. 😭

/msg <user> [<message>]

Sends a private message to a user on the currently opened hub. If no message is given, the tab opens but nothing gets sent. πŸ“¬

/nick [<nick>]

Alias for /hset nick on hub tabs, and /set nick otherwise. πŸ’…

/open [-n] [<name>] [<address>]

With no arguments, this lists all hubs known by the current configuration. Otherwise, it opens a new tab to use for a hub. The name is a (short) personal name you use to identify the hub, and it gets used for storing hub-specific configuration. 🏷️

If you've specified an address, or you've previously connected to a hub from a tab with the same name, /open will automatically connect to the hub. Use the -n flag to disable this behaviour.

See /connect for more info on connecting to a hub. πŸ”—

/password <password>

Sends a password to the hub without saving it to the database. If you want to log in automatically without typing /password every time, use /hset password <password>.

Be warned: in that case your password will be saved unencrypted. πŸ˜³πŸ”“

/pm <user> [<message>]

Alias for /msg. 🫢

/queue

Opens the download queue. πŸ“₯

/quit

Quits ncdc. ✌️

/reconnect

Reconnects to the hub. When your nick or the hub encoding have been changed, the new settings get used after the reconnect. πŸ”„

This command can also be used on the main tab, in which case all connected hubs get reconnected.

/refresh [<path>]

Initiates share refresh. No argument means the complete list gets refreshed. Otherwise only the specified directory gets refreshed. The path argument can be either an absolute filesystem path or a virtual path within your share. 🌸

/say <message>

Sends a chat message to the current hub or user. You normally don't have to use /say explicitly β€” any command not starting with / automatically implies /say <command>. For example, typing hello. in the command line is equivalent to /say hello.. Using /say explicitly is handy for sending a message that starts with / to the chat, like /say /help is what you are looking for. πŸ’¬

/search [options] <query>

Performs a file search, opening a new tab with the results. πŸ”Ž

Available options:

  • -hub β€” Search the current hub only. (default)
  • -all β€” Search all connected hubs, except those with chat_only set.
  • -le <s> β€” Size of the file must be less than <s>.
  • -ge <s> β€” Size of the file must be larger than <s>.
  • -t <t> β€” File must be of type <t>. (see below)
  • -tth <h> β€” TTH root of this file must match <h>.

File sizes (<s> above) accept these suffixes: G (GiB), M (MiB) and K (KiB). πŸ“

These file types can be used with the -t option:

  1. any β€” Any file or directory. (default)
  2. audio β€” Audio files.
  3. archive β€” (Compressed) archives.
  4. doc β€” Text documents.
  5. exe β€” Windows executables.
  6. img β€” Image files.
  7. video β€” Video files.
  8. dir β€” Directories.
Note: file type matching is done using file extensions, and it's not very reliable. πŸ™ˆ

/set [<key> [<value>]]

Get or set global configuration variables. Use it with no arguments to get a list of all global settings and their current values. Glob-style pattern matching on the settings is also possible β€” use, for example, /set color* to list all color-related settings. 🌈

See /unset to change a setting back to its default, and /hset to manage configuration on a per-hub basis. Changes to the settings are automatically saved to the database, and won't be lost after restarting ncdc. πŸ’Ύ

To get information on a particular setting, use /help set <key>. πŸ‘‘

/share [<name> <path>]

Use /share with no arguments to get a list of shared directories. Called with a name and a path, the path gets added to your share. Note that shell escaping may be used in the name. For example, to add a directory with the name Fun Stuff, you could do:

/share "Fun Stuff" /path/to/fun/stuff

Or:

/share Fun\ Stuff /path/to/fun/stuff

The full path to the directory will not be visible to others β€” only the name you give it is public. An initial /refresh is done automatically on the added directory. πŸŽ€

/ungrant [<user>]

Revokes a granted slot. 🚫

/unset [<key>]

Resets a global configuration variable back to its default value. ✨

/unshare [<name>]

To remove a single directory from your share, use /unshare <name>. To remove all directories from your share, use /unshare /. πŸ—‘οΈ

Note: the hash data associated with the removed files will remain in the database. This lets you re-add the files to your share without needing to re-hash them. The downside? The database file may grow fairly large with unneeded information. See the /gc command to clean that up. 🧹

/userlist

Opens the user list of the currently selected hub. Can also be accessed with Alt+u. πŸ‘₯

/version

Displays version information. ⭐

/whois <user>

Opens the user list and selects the given user. πŸ”


βš™οΈ SETTINGS βš™οΈ

Here's the list of configuration settings, bestie. These can be changed and queried using the /set command for global settings and /hset for hub-local settings. All configuration data is stored in the db.sqlite3 file in the session directory. πŸ’Ύ

active <boolean>

Enables or disables active mode. You may have to configure your router and/or firewall for this to work β€” see the active_ip and active_port settings for more info. πŸ”₯

active_ip <string>

Your public IP address for active mode, bestie. If this isn't set, or it's set to 0.0.0.0 for IPv4 or :: for IPv6, then ncdc will try to automatically get your IP address from the hub. If you do set it manually, it is super important that other clients can reach you using this IP address. If you connect to a hub on the internet, this should be your internet (WAN) IP. Likewise, if you connect to a hub on your LAN, this should be your LAN IP. πŸ’…

Both an IPv4 and an IPv6 address are set by providing two IP addresses separated with a comma. When unset, 0.0.0.0,:: is assumed. Only the IP version used to connect to the hub is used. That is, if you connect to an IPv6 hub, then the configured IPv6 address is used and the IPv4 address is ignored. No cap.

When set to the special value local, ncdc will automatically get your IP address from the local network interface that is used to connect to the hub. This option should only be used if there is no NAT between you and the hub, because this will give the wrong IP if you are behind a NAT. Periodt.


active_port <integer>

The listen port for incoming connections in active mode. Set to 0 to automatically assign a random port. This setting is by default also used for the UDP port, see the active_tls_port settings to change that. If you are behind a router or firewall, make sure that you have configured it to forward and allow these ports. πŸ”₯

active_udp_port <integer>

The listen port for incoming UDP connections in active mode. Defaults to the active_port setting, or to a random number if active_port is not set.

adc_blom <boolean>

Whether to support the BLOM extension on ADC hubs. This may decrease the bandwidth usage on the hub connection, in exchange for a bit of computational overhead. Some hubs require this setting to be enabled. This setting requires a reconnect with the hub to be active. πŸ”„

autoconnect <boolean>

Set to true to automatically connect to the current hub when ncdc starts up. It's giving "I'm already there" energy. ✨

autorefresh <interval>

The time between automatic file refreshes. Recognized suffices are s for seconds, m for minutes, h for hours and d for days. Set to 0 to disable automatically refreshing the file list. This setting also determines whether ncdc will perform a refresh on startup. See the /refresh command to manually refresh your file list. πŸ¦‹

backlog <integer>

When opening a hub or PM tab, ncdc can load a certain amount of lines from the log file into the log window. Setting this to a positive value enables this feature and configures the number of lines to load. Note that, while this setting can be set on a per-hub basis, PM windows will use the global value (global.backlog). πŸ‘‘

chat_only <boolean>

Set to true to indicate that this hub is only used for chatting. That is, you won't or can't download from it. This setting affects the /search command when it is given the -all option.

color_* <color>

The settings starting with the color_ prefix allow you to change the interface colors. The following is a list of available color settings:

  • list_default β€” default item in a list
  • list_header β€” header of a list
  • list_select β€” selected item in a list
  • log_default β€” default log color
  • log_time β€” the time prefix in log messages
  • log_nick β€” default nick color
  • log_highlight β€” nick color of a highlighted line
  • log_ownnick β€” color of your own nick
  • log_join β€” color of join messages
  • log_quit β€” color of quit messages
  • separator β€” the list separator/footer bar
  • tab_active β€” the active tab in the tab list
  • tabprio_low β€” low priority tab notification color
  • tabprio_med β€” medium priority tab notification color
  • tabprio_high β€” high priority tab notification color
  • title β€” the title bar

The actual color value can be set with a comma-separated list of color names and/or attributes. The first color in the list is the foreground color, the second color is used for the background. When the fore- or background color is not specified, the default colors of your terminal will be used. The following color names can be used: black, blue, cyan, default, green, magenta, red, white and yellow. The following attributes can be used: bold, blink, reverse and underline. The actual color values displayed by your terminal may vary. Adding the bold attribute usually makes the foreground color appear brighter as well. 🌈

connection <string>

Set your upload speed. This is just an indication for other users in the hub so that they know what speed they can expect when downloading from you. The actual format you can use here may vary, but it is recommended to set it to either a plain number for Mbit/s (e.g. 50 for 50 mbit) or a number with a KiB/s indicator (e.g. 2300 KiB/s). On ADC hubs you must use one of the previously mentioned formats, otherwise no upload speed will be broadcasted. This setting is broadcasted as-is on NMDC hubs, to allow for using old-style connection values (e.g. DSL or Cable) on hubs that require this. πŸ“‘

This setting is ignored if upload_rate has been set. If it is, that value is broadcasted instead.

description <string>

A short public description that will be displayed in the user list of a hub. Make it cute, make it you. πŸŽ€

disconnect_offline <boolean>

Automatically disconnect any upload or download transfers when a user leaves the hub, or when you leave the hub. Setting this to true ensures that you are only connected with people who are online on the same hubs as you are. No ghost transfers, bestie. πŸ’€

download_dir <path>

The directory where finished downloads are moved to. Finished downloads are by default stored in <session directory>/dl/. It is possible to set this to a location that is on a different filesystem than the incoming directory, but doing so is not recommended: ncdc will block when moving the completed files to their final destination. 😭

download_exclude <regex>

When recursively adding a directory to the download queue β€” by pressing d on a directory in the file list browser β€” any item in the selected directory with a name that matches this regular expression will not be added to the download queue. 🚫

This regex is not checked when adding individual files from either the file list browser or the search results.

download_rate <speed>

Maximum combined transfer rate of all downloads. The total download speed will be limited to this value. The suffixes G, M, and K can be used for GiB/s, MiB/s and KiB/s, respectively. Note that, similar to upload_rate, TCP overhead are not counted towards this limit, so the actual bandwidth usage might be a little higher. 🐒

download_segment <size>

Minimum segment size to use when requesting file data from another user. Set to 0 to disable segmented downloading.

download_shared <boolean>

Whether to download files which are already present in your share. When this is set to false, adding already shared files results in a UI message instead of adding the file to the download queue. πŸ™ˆ

download_slots <integer>

Maximum number of simultaneous downloads. Multitasking queen. πŸ‘‘

email <string>

Your email address. This will be displayed in the user list of the hub, so only set this if you want it to be public. Privacy check, bestie. πŸ”’

encoding <string>

The character set/encoding to use for hub and PM messages. This setting is only used on NMDC hubs, ADC always uses UTF-8. Some common values are:

  • CP1250 β€” Central Europe
  • CP1251 β€” Cyrillic
  • CP1252 β€” Western Europe
  • ISO-8859-7 β€” Greek
  • KOI8-R β€” Cyrillic
  • UTF-8 β€” International

filelist_maxage <interval>

The maximum age of a downloaded file list. If a file list was downloaded longer ago than the configured interval, it will be removed from the cache (the fl/ directory) and subsequent requests to open the file list will result in the list being downloaded from the user again. Recognized suffices are s for seconds, m for minutes, h for hours and d for days. Set to 0 to disable the cache altogether. πŸ—‘οΈ

flush_file_cache <none|upload|download|hash>[,...]

Tell the OS to flush the file (disk) cache for file contents read while hashing and/or uploading or written to while downloading. On one hand, this will avoid trashing your disk cache with large files and thus improve the overall responsiveness of your system. On the other hand, ncdc may purge any shared files from the cache, even if they are still used by other applications. In general, it is a good idea to enable this if you also use your system for other things besides ncdc, you share large files (>100MB) and people are not constantly downloading the same file from you. 🧚

geoip_cc <path>|disabled

Path to the GeoIP2 Country database file (GeoLite2-Country.mmdb), or disabled to disable GeoIP lookups. The database can be downloaded from https://dev.maxmind.com/geoip/geoip2/geolite2/. 🌍

hash_rate <speed>

Maximum file hashing speed. See the download_rate setting for allowed formats for this setting.

hubname <string>

The name of the currently opened hub tab. This is a user-assigned name, and is only used within ncdc itself. This is the same name as given to the /open command. ✨

incoming_dir <path>

The directory where incomplete downloads are stored. This setting can only be changed when the download queue is empty. Also see the download_dir setting.

local_address <string>

Specifies the address of the local network interface to use for connecting to the outside and for accepting incoming connections in active mode. Both an IPv4 and an IPv6 address are set by providing two IP addresses separated with a comma. When unset, 0.0.0.0,:: is assumed. 🫢

Okay so real quick β€” if you don't hand over an IPv4 address, 0.0.0.0 just gets added for you automatically. Same energy with IPv6: no address specified? Boom, :: appears on its own. Which one actually gets used depends on the IP version that's actually in play. So like, if you're on an IPv6 hub, ncdc listens on the IPv6 address you gave it. But heads up bestie β€” even if your hub is on IPv6, ncdc may still try to connect to another client over IPv4, and at that point the socket gets bound to the IPv4 address you configured. Multitasking queen πŸ’…

  • log_debug <boolean> β€” Logs debug messages to stderr.log inside the session directory. Highly recommended if you wanna debug or hack on ncdc, fr fr. But be warned ⚠️ β€” if you're connected to a large hub, this can generate a lot of data.
  • log_downloads <boolean> β€” Logs downloaded files to transfers.log.
  • log_hubchat <boolean> β€” Logs the main hub chat. Note: changing this requires any affected hub tabs to be closed and reopened before the change actually kicks in.
  • log_uploads <boolean> β€” Logs file uploads to transfers.log.
  • max_ul_per_user <integer> β€” The max number of simultaneous upload connections to one single user.
  • minislots <integer> β€” Sets how many minislots you've got available. A minislot is a special little slot that gets used when all your regular upload slots are busy and someone's asking for your filelist or a small file. In that case the other client automatically applies for a minislot, and can still download from you as long as not all minislots are taken. What counts as a small file is configurable with the minislot_size setting. Also peep the slots configuration setting and the /grant command. πŸ‘‘
  • minislot_size <integer> β€” The maximum size of a file that can be downloaded using a minislot, in KiB. See the minislots setting for the full tea.
  • nick <string> β€” Your nick, obviously. Nick changes only show up on newly connected hubs, so use the /reconnect command if you want your new nick to take effect immediately. Heads up though: it's highly discouraged to change your nick on NMDC hubs. Why? Because clients downloading from you have literally no way of knowing you changed it, so they can't immediately keep downloading from you. Rude to them, honestly. πŸ™ˆ
  • notify_bell <disable|low|medium|high> β€” When enabled, ncdc rings a bell at your terminal when a tab shows a notification. The notification types are:
    • high β€” Messages directed to you (PM or highlight in hub chat),
    • medium β€” Regular hub chat,
    • low β€” User joins/quits, new search results, etc.

How a "bell" (or "beep", or "alert", call it whatever you want bestie) actually manifests depends entirely on your terminal. Some setups give you an audible system bell. Some make your terminal window flash or do other annoying little things to grab your attention. And some setups just ignore it completely. πŸ’€

  • password <string> β€” Sets your password for the current hub and enables auto-login on connect. If you just wanna log in to a hub without saving your password, use the /password command instead. Passwords are saved unencrypted in the config file β€” no cap, keep that in mind.
  • reconnect_timeout <interval> β€” How long to wait before automatically reconnecting to a hub. Set it to 0 to disable automatic reconnect.
  • sendfile <boolean> β€” Whether or not to use the sendfile() system call to upload files, if it's supported. Using sendfile() means less resource usage while uploading, but it may not work well on all systems. YMMV ✨
  • share_emptydirs <boolean> β€” Share empty directories. When disabled (which is the default), empty directories in your share won't be visible to others. This also affects empty directories that contain only empty directories, and so on and so forth. A file list refresh is required for this setting to actually take effect.
  • share_exclude <regex> β€” Any file or directory whose name matches this regular expression won't be shared. A file list refresh is required for this setting to take effect.
  • share_hidden <boolean> β€” Whether to share hidden files and directories. A hidden file or directory is one whose file name starts with a dot (like .bashrc). A file list refresh is required for this setting to take effect.
  • share_symlinks <boolean> β€” Whether to follow symlinks in shared directories. When disabled (the default), ncdc will never share any files outside the directory you specified. When enabled, any symlinks in your shared directories get followed β€” even when they point to a directory outside your share. πŸ‘€
  • show_free_slots <boolean> β€” When set to true, [n sl] gets prepended to your description, where n is the number of currently available upload slots.
  • show_joinquit <boolean> β€” Whether to display join/quit messages in the hub chat.
  • slots <integer> β€” The number of upload slots. This is basically what decides how many people can download from you at the same time. It is possible for this limit to get exceeded in certain circumstances β€” see the minislots setting and the /grant command.
  • sudp_policy <disabled|allow|prefer> β€” Sets the policy for sending or receiving encrypted UDP search results. Set it to disabled and all UDP search results get sent and received in plain text. Set it to allow to let ncdc reply with encrypted search results if the other client asked for it. prefer will also make ncdc itself request encryption.

Note: no matter what this is set to, encrypted UDP search results are only used on ADCS hubs. They'll never be sent on NMDC or non-TLS ADC hubs. And also β€” even if you set this to prefer, encryption is still only used when the client on the other side of the connection supports it too. It takes two to tango, bestie. 🫢

  • tls_policy <disabled|allow|prefer|force> β€” Sets the policy for secure client-to-client connections. Setting it to disabled disables TLS support for client connections, but you can still connect to TLS-enabled hubs. allow will allow the use of TLS if the other client requests it, but ncdc itself won't request TLS when connecting to others. prefer tells ncdc to request TLS when connecting to others. And setting it to force will disallow non-TLS connections entirely, plus it requires that the hub connection itself is TLS.

Using TLS for client connections usually results in less optimal performance when uploading and downloading, but it's quite effective at avoiding the protocol-specific traffic shaping some ISPs like to do. πŸ›‘οΈ

  • tls_priority <string> β€” Sets the GnuTLS priority string used for all TLS-enabled connections. See the "Priority strings" section in the GnuTLS manual for details on what this does and how it works. Currently it is not possible to set a different priority string for different types of connections (like hub vs. incoming/outgoing client connections). One string to rule them all, I guess. πŸ’…
  • ui_time_format <string> β€” The format of the time displayed in the lower-left of the screen. Set it to - to not display a time at all. The string gets passed to the Glib g_date_time_format() function, which accepts roughly the same formats as strftime(). Check out the strftime(3) man page or the Glib documentation for more info. Note: this setting does not influence the date/time format used in other places, like the chat window or log files.
  • upload_rate <speed> β€” Maximum combined transfer rate of all uploads. See the download_rate setting for more info on rate limiting. Note: this setting also overrides any connection setting.

✨ KEY BINDINGS ✨

Okay so bestie, if you're on any tab that doesn't have a text input line, you can just smash ? and it'll spill all the key bindings for that exact tab. Iconic. You can also get the whole list with the /help keys command, and I'm literally reproducing it below so you don't even have to ask. πŸ’…


🌍 Global key bindings

  • Alt+j β€” Open previous tab.
  • Alt+k β€” Open next tab.
  • Alt+h β€” Move current tab left.
  • Alt+l β€” Move current tab right.
  • Alt+a β€” Move tab with recent activity.
  • Alt+<num> β€” Open tab with number <num>.
  • Alt+c β€” Close current tab.
  • Alt+n β€” Open the connections tab.
  • Alt+q β€” Open the download queue tab.
  • Alt+o β€” Open own file list.
  • Alt+r β€” Refresh file list.

πŸ“œ Keys for tabs with a log window:

  • Ctrl+l β€” Clear current log window.
  • PgUp β€” Scroll the log backward.
  • PgDown β€” Scroll the log forward.

⌨️ Keys for tabs with a text input line:

  • Left/Right β€” Move cursor one character left or right.
  • End/Home β€” Move cursor to the end / start of the line.
  • Up/Down β€” Scroll through the command history.
  • Tab β€” Auto-complete current command, nick or argument.
  • Alt+b β€” Move cursor one word backward.
  • Alt+f β€” Move cursor one word forward.
  • Backspace β€” Delete character before cursor.
  • Delete β€” Delete character under cursor.
  • Ctrl+w β€” Delete to previous space.
  • Alt+d β€” Delete to next space.
  • Ctrl+k β€” Delete everything after cursor.
  • Ctrl+u β€” Delete entire line.

πŸ“ File browser

  • Up/Down β€” Select one item up/down.
  • k/j β€” Select one item up/down.
  • PgUp/PgDown β€” Select one page of items up/down.
  • End/Home β€” Select last/first item in the list.
  • / β€” Start incremental regex search (press Return to stop editing).
  • ,/. β€” Search next / previous.
  • Right/l β€” Open selected directory.
  • Left/h β€” Open parent directory.
  • t β€” Toggle sorting directories before files.
  • u β€” Toggle sorting unknown files before files existing locally.
  • s β€” Order by file size.
  • n β€” Order by file name.
  • d β€” Add selected file/directory to the download queue.
  • m β€” Match selected item with the download queue.
  • M β€” Match entire file list with the download queue.
  • a β€” Search for alternative download sources.

πŸ”Œ Connection list

  • Up/Down β€” Select one item up/down.
  • k/j β€” Select one item up/down.
  • PgUp/PgDown β€” Select one page of items up/down.
  • End/Home β€” Select last/first item in the list.
  • d β€” Disconnect selected connection.
  • i/Return β€” Toggle information box.
  • f β€” Find user in user list.
  • m β€” Send a PM to the selected user.
  • q β€” Find file in download queue.
  • b/B β€” Browse the selected user's list, B to force a redownload.

πŸ“₯ Download queue

  • Up/Down β€” Select one item up/down.
  • k/j β€” Select one item up/down.
  • PgUp/PgDown β€” Select one page of items up/down.
  • End/Home β€” Select last/first item in the list.
  • K/J β€” Select one user up/down.
  • f β€” Find user in user list.
  • c β€” Find connection in the connection list.
  • a β€” Search for alternative download sources.
  • d β€” Remove selected file from the queue.
  • +/- β€” Increase/decrease priority.
  • i/Return β€” Toggle user list.
  • r β€” Remove selected user for this file.
  • R β€” Remove selected user from all files in the download queue.
  • x β€” Clear error state for the selected user for this file.
  • X β€” Clear error state for the selected user for all files.
πŸ’€ Note: when an item in the queue has ERR indicated in the priority column, you have two choices: You can remove the item from the queue using d, or attempt to continue the download by increasing its priority using +.

πŸ”Ž Search results tab

  • Up/Down β€” Select one item up/down.
  • k/j β€” Select one item up/down.
  • PgUp/PgDown β€” Select one page of items up/down.
  • End/Home β€” Select last/first item in the list.
  • f β€” Find user in user list.
  • b/B β€” Browse the selected user's list, B to force a redownload.
  • d β€” Add selected file to the download queue.
  • h β€” Toggle hub column visibility.
  • u β€” Order by username.
  • s β€” Order by file size.
  • l β€” Order by free slots.
  • n β€” Order by file name.
  • m β€” Match selected item with the download queue.
  • M β€” Match all search results with the download queue.
  • q β€” Match selected users' list with the download queue.
  • Q β€” Match all matched users' lists with the download queue.
  • a β€” Search for alternative download sources.

πŸ‘€ User list tab

  • Up/Down β€” Select one item up/down.
  • k/j β€” Select one item up/down.
  • PgUp/PgDown β€” Select one page of items up/down.
  • End/Home β€” Select last/first item in the list.
  • / β€” Start incremental regex search (press Return to stop editing).
  • ,/. β€” Search next / previous.
  • o β€” Toggle sorting OPs before others.
  • s/S β€” Order by share size.
  • u/U β€” Order by username.
  • t/T β€” Toggle visibility / order by tag column.
  • e/E β€” Toggle visibility / order by email column.
  • c/C β€” Toggle visibility / order by connection column.
  • p/P β€” Toggle visibility / order by IP column.
  • i/Return β€” Toggle information box.
  • m β€” Send a PM to the selected user.
  • g β€” Grant a slot to the selected user.
  • b/B β€” Browse the selected users' list, B to force a redownload.
  • q β€” Match selected users' list with the download queue.

πŸ€” WEIRD UI FLAGS

Some listings have a little flags display, and honestly their meaning might not be giving what you think it's giving. Let's decode. πŸ•΅οΈβ€β™€οΈ

πŸ“„ File status

You might see one-letter flags to the left of file names in search results and file list tabs. Here's the tea:

  • H β€” The file had been added to the file list, but has not been hashed yet and thus is not visible to others. This flag can appear only when browsing your own list. πŸ™ˆ
  • S β€” The file is already in your share. If "download_shared" is set to "false", trying to download it will result only in an informational message. This flag never appears when browsing your own file list. 🫢
  • Q β€” The file is currently in your download queue. Trying to download it will result only in an informational message. πŸ“₯

πŸ”— Connection flags

On the connection list window, there are two flags:

  • S β€” Connection state, can be either Connecting, Handshake, Idle, Downloading, Uploading or - for disconnected. πŸ”„
  • t β€” This means that the connection is encrypted with TLS. πŸ”’

πŸ‘₯ User flags

The user list has some flags too:

  • o β€” Set if the user is an operator in the hub. πŸ‘‘
  • p β€” When the user is passive. If this flag is not set, the user is active. πŸ’€
  • t β€” Set if connections with this user will be encrypted with TLS. πŸ”

🌱 ENVIRONMENT

$NCDC_DIR is used to determine the session dir, it is only honoured if -c is not set on the command line. So like, if you're passing -c, this env var is lowkey ignored, periodt. πŸ’…

πŸ“ FILES πŸ’Ύ

okay bestie, so here's where ncdc keeps all its stuff. $NCDC_DIR is literally just the session dir β€” the one you set with -c, or the env var $NCDC_DIR, or it defaults to $HOME/.ncdc. pick your fighter ✨

  • $NCDC_DIR/cert/ β€” where your client certificates live. It has to contain a private key file (client.key) and a public certificate (client.crt). Good news: these get generated automatically the very first time ncdc starts up, so don't stress. πŸŽ€
  • $NCDC_DIR/db.sqlite3 β€” the database, bestie. It stores all the configuration variables, hash data of shared files, download queue information and other state info. Technically you can hand-edit it with the sqlite3 commandline tool… but it's discouraged, fr fr. Any changes you make while ncdc is running won't be read, and ncdc might literally just overwrite them. πŸ™ˆ
  • $NCDC_DIR/dl/ β€” where completed downloads get moved to by default. You can change this with the "download_dir" configuration option.
  • $NCDC_DIR/files.xml.bz2 β€” the filelist, containing a listing of all your shared files. iconic.
  • $NCDC_DIR/fl/ β€” where downloaded file lists from other users are stored. The file names are hex-encoded user IDs that ncdc uses internally. Old file lists get deleted automatically after a configurable interval β€” check the "filelist_maxage" configuration option for that. πŸ¦‹
  • $NCDC_DIR/history β€” your command history. all your greatest hits πŸ’…
  • $NCDC_DIR/inc/ β€” default location for incomplete downloads. Changeable with the "incoming_dir" setting. The file names in here are the base32-encoded TTH root of the completed file.
  • $NCDC_DIR/logs/ β€” where all the log files go. File names starting with # are hub logs and ~ are user (PM) logs. The special ones are transfers.log and main.log.
heads up, bestie: ncdc does not have built-in functionality to rotate or compress log files automatically. So when you rotate log files manually (like via a cron job, iykyk), make sure you send the SIGUSR1 signal afterwards to force ncdc to flush the old logs and create or open the new log files. no cap.
  • $NCDC_DIR/stderr.log β€” the error/debug log. This file gets cleared every single time ncdc starts up. fresh start energy ✨
  • $NCDC_DIR/version β€” the version of the data directory. This file is locked while an ncdc instance is running, which makes sure no two ncdc instances ever work with the same session directory at the same time. mutual exclusivity slay πŸ‘‘

πŸ“ Format of transfers.log 🌈

Uploads and downloads get logged in the transfers.log file. Transfers are separated by a newline (0x0a). Each log line has the following fields, separated by a space:

  1. Date/time when the transfer ended, formatted as "[YYYY-MM-DD HH:MM:SS ZONE]",
  2. Hub name, including the "#" prefix,
  3. Base32-encoded CID of the other user for ADC transfers, or a - for NMDC,
  4. User name (escaped),
  5. IPv4 or IPv6 address,
  6. Direction, "u" for upload or "d" for download,
  7. Whether the transfer completed successfully ("c") or has been interrupted/disconnected before all requested file data has been transferred ("i"),
  8. Base32-encoded TTH of the transferred file, or - for "files.xml.bz2",
  9. Total transfer time, in seconds,
  10. File size, in bytes,
  11. File offset, in bytes,
  12. Transfer size, in bytes,
  13. File path (escaped). Absolute virtual path for uploads, destination path for downloads.

All fields are encoded in UTF-8. Fields that may contain a space or newline are escaped as follows: a space is escaped as "\s", a newline as "\n" and a backslash as "\\". The timestamp is not escaped. πŸ’–

Many clients download files in separate (smallish) chunks. Ncdc makes no attempt to combine multiple chunk requests in a single log entry, so you may see the same uploaded file several times with a different file offset. don't be confused bestie, that's just how it is 🫢


πŸ“œ LICENSE πŸ’œ

Copyright (C) Yoran Heling <projects@yorhel.nl>

ncdc is distributed under the MIT license, please read the COPYING file for more information. ✨


πŸ› BUGS 😭

Please report bugs or feature requests to the bug tracker or the mailing list. Both can be found on the ncdc homepage at <https://dev.yorhel.nl/ncdc>. There's also an ADC hub available at "adc://dc.blicky.net:2780/" for general support and discussions. come hang out 🫢


πŸ‘‘ AUTHOR 🌟

ncdc is written by Yoran Heling <projects@yorhel.nl>

Web: <https://dev.yorhel.nl/ncdc>


and that's the whole page, bestie!! you made it to the end, main character energy fr fr πŸ’… this is ncdc version ncdc-1.24.1, dated 2024-07-18, and it lives in section NCDC(1) of the manual β€” go slay some downloads πŸ¦‹βœ¨πŸŽ€

πŸ“¦ where this page comes from