name mode size
qi 040000
resources 040000
systemd 040000
util 040000
.gitignore 100644 17B
Dockerfile 100644 681B
LICENSE 100644 35.15kB 100644 8.07kB
ccso 100755 2.08kB
# CCSO Nameserver <p align="center"> <img alt="Ph Demo" src="resources/demo_ph.png"/> </p> The CCSO nameserver was an early form of database search on the Internet. In its most common form, it was used as an electronic "Phone Book" to lookup information such as telephone numbers and email addresses. Today, this service has largely been replaced by LDAP. [[1]]( This repository contains a working version of the original CCSO nameserver (aka *"Qi"*) developed by Steven Domer at University of Illinois in '93. I salvaged the source code off a long forgotten FTP server, stuck it into a *CentOS* Docker Container, and smashed it with a hammer until *gcc* cried uncle and compiled without errors. The fruits of this labor can be seen here: **cso://** There are less than a handful of CCSO servers still running on the open web. This is probably the first new nameserver to go live in over a decade! More information about CCSO, including a list of active domains, can be found at: <a href=gopher://><b>gopher://</b></a> ([http proxy]( ## Table of Contents - [Quickstart](#quickstart) - [Using this Repository](#using-this-repository) - [CCSO Clients](#ccso-clients) - [Interesting Documents](#interesting-documents) ## Quickstart ```bash git clone && cd ccso-nameserver ./ccso build ./ccso initdb ./ccso qi ``` *This will build the docker container, initialize a new CCSO database using the built-in seed data, and launch an interactive Qi command line prompt. The only dependency is [Docker](* ## Using this Repository ### Commands I have included a [bash script](ccso) that contains aliases for my commonly used docker commands: Command | Description --- | --- ``./ccso build`` | Build the CCSO docker image ``./ccso initdb`` | Setup the CCSO database files inside of a persistant docker volume ``./ccso shell`` | Launch a shell into the docker container ``./ccso ph`` | Launch the ph client ``./ccso qi`` | Run the qi server in local "hero" mode ``./ccso daemon`` | Run the qi server in silent daemon mode ``./ccso install-service`` | Install a systemd service that exposes the qi server ### Running Qi as a Daemon Qi was originally designed to run behind an [inetd]( service. The ``qi`` binary itself has very straightforward behavior: Read one or more commands from *stdin*, write its response to *stdout*, and exit. Inetd handles running the actual TCP server and managing the incoming socket connections. Inetd is not very popular anymore and has been largely supplanted by other services. For my implementation, I decided to use [systemd sockets]( instead. Systemd binds to port 105 on the host machine, and everytime there's an incoming connection it launches an ephemeral docker container that executes the ``qi`` binary. The container runs for the duration of the connection and shuts down once the connection closes. Here's what the systemd service looks like: ```ini # /etc/systemd/system/ccso.socket [Unit] Description=CCSO Nameserver [Socket] ListenStream=105 Accept=yes [Install] ``` ```ini # /etc/systemd/system/ccso@.service [Unit] Description=CCSO Service Requires=ccso.socket [Service] Type=simple # Assumes the repository was cloned into /var/ccso/ ExecStart=/var/ccso/ccso daemon StandardInput=socket StandardError=journal [Install] ``` ### Customizing the Database You can customize the fields in your CCSO database by editing the following files: File | Description --- | --- [util/db/prod-new.cnf](util/db/prod-new.cnf) | Defines all of the fields and indices that will be available to the nameserver [util/db/qi.input](util/db/qi.input) | Defines seed data that will be added when the database is created [util/db/initdb](initdb) | Shell script used to construct the database files See the [CSO Nameserver FAQ]( for more information on how these files are structured. You can re-initialize the database at any time with the following commands, but beware that it will overwrite any existing data saved in the CCSO server. Migrating data from an old format appears to be a painful process, and I have not yet attempted it. ```bash ./ccso build ./ccso initdb ``` ### Explore! There are a ton of tools for *qi* and *ph* that are bundled with the source code but that I haven't documented here. A great place to start is by launching a shell into the docker container and poking around the **/opt/nameserv/** directory. ## CCSO Clients CCSO's simple, plaintext ASCII protocol lends itself to work with a wide range of terminal clients. Some are more sophisticated than others. ### Ph Ph (stands for *"Phonebook"*) was the original CCSO client that was developed alongside the Qi server by University of Illinois. The source code is bundled with Qi, and it gets built and installed inside of the docker image. I've included a shortcut command to launch Ph from the docker container. Use the ``-s`` flag to specify a server host. <p align="center"> <img alt="Ph Demo" src="resources/demo_ph.png"/> </p> ### Lynx Lynx (the curses web browser) supports CCSO links using the ``cso://`` protocol. When you open a cso link, lynx will present you with a form that contains all of the fields that are indexed and searchable by the CCSO server. Pretty neat! **Example:** ``$ lynx cso://`` <p align="center"> <img alt="Lynx Demo" src="resources/demo_lynx.png"/> <img alt="Lynx Demo 2" src="resources/demo_lynx2.png"/> </p> Lynx also recognizes gopher URLs with item type 2, and will parse everything after the ``?`` as a CCSO query. **Example:** ``$ lynx "gopher:// clay"`` <p align="center"> <img alt="Lynx Demo 3" src="resources/demo_lynx3.png"/> </p> ### Telnet Good ol' Telnet. Is there anything it can't do? <p align="center"> <img alt="Telnet Demo" src="resources/demo_telnet.png"/> </p> ### Python This repo also includes a [python script](util/ for automating connections to CCSO servers. The script was borrowed from []( and has been ported to work with python 3. <p align="center"> <img alt="Python Demo" src="resources/demo_python.png"/> </p> ## Interesting Documents A series of reference documents were published by the University of Illinois between 1988 and 1992. These cover everything from the motivations for creating the CCSO Nameserver, to a retrospective of what worked and what didn't. These are a great place to start if you're looking for some historical context: - [The CCSO Nameserver - A Description]( - [The CCSO Nameserver - Guide to Installation]( - [The CCSO Nameserver - Programmer's Guide]( - [The CCSO Nameserver - Why?]( - [The CCSO Nameserver - An Introduction]( - [The CCSO Nameserver - Server Client Protocol]( An RFC memo was later published in 1998 that formally describes the CCSO protocol: - [RFC 2378]( Man pages: - [Ph User Manual]( - [Qi User Manual]( Other miscellaneous documentation: - [A CCSO User Guide for the University of Illinois]( *(This one is very comprehensive!)* - [CSO Nameserver FAQ]( - [Qi Installation Quick-Start]( - [Rebuilding a Nameserver Database in 24 Easy Steps](