GithubHelp home page GithubHelp logo

dbremner / ccso-nameserver Goto Github PK

View Code? Open in Web Editor NEW

This project forked from michael-lazar/ccso-nameserver

0.0 2.0 0.0 2.8 MB

Resurrecting the Qi/Ph nameserver from '93

Home Page: cso://mozz.us:105

License: GNU General Public License v3.0

Dockerfile 0.04% Shell 7.43% Perl 2.99% Makefile 3.08% C 45.57% Roff 31.82% C++ 0.42% Rich Text Format 5.07% PostScript 1.76% Objective-C 0.33% Lex 0.44% Perl 6 0.12% Brainfuck 0.13% Python 0.80%

ccso-nameserver's Introduction

CCSO Nameserver

Ph Demo

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. It was used mainly in the early-to-middle 1990s. [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 from some long forgotten FTP server. Then I stuck it in a CentOS Docker Container, and proceeded to smash it with a hammer until gcc cried uncle and submitted to compiling without errors.

The fruits of this labor can be seen here:

cso://mozz.us:105

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:

gopher://mozz.us:70/1/ccso (http proxy)

Table of Contents

Quickstart

git clone https://github.com/michael-lazar/ccso-nameserver.git && 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 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:

# /etc/systemd/system/ccso.socket
[Unit]
Description=CCSO Nameserver

[Socket]
ListenStream=105
Accept=yes

[Install]
WantedBy=sockets.target
# /etc/systemd/system/[email protected]
[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]
WantedBy=multi-user.target

Customizing the Database

You can customize the fields in your CCSO database by editing the following files:

File Description
util/db/prod-new.cnf Defines all of the fields and indices that will be available to the nameserver
util/db/qi.input Defines seed data that will be added when the database is created
util/db/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.

./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.

Ph Demo

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://mozz.us

Lynx Demo Lynx Demo 2

Lynx also recognizes gopher URLs with item type 2, and will parse everything after the ? as a CCSO query.

Example: $ lynx "gopher://mozz.us:105/2?name=adams clay"

Lynx Demo 3

Telnet

Good ol' Telnet. Is there anything it can't do?

Telnet Demo

Python

This repo also includes a python script for automating connections to CCSO servers. The script was borrowed from https://github.com/jcollie/ccso and has been ported to work with python 3.

Python Demo

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:

An RFC memo was later published in 1998 that formally describes the CCSO protocol:

Man pages:

Other miscellaneous documentation:

ccso-nameserver's People

Contributors

michael-lazar avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.