From d1341ec984b7f65567033c823eb0d1db493e9990 Mon Sep 17 00:00:00 2001 From: Wei He Date: Sat, 21 Aug 2021 13:20:56 -0400 Subject: [PATCH] Update nyancat-server --- .github/FUNDING.yml | 1 - Dockerfile | 34 +++++++++++++++++++++++ README.md | 67 +++++++++++++++++---------------------------- 3 files changed, 59 insertions(+), 43 deletions(-) delete mode 100644 .github/FUNDING.yml create mode 100644 Dockerfile diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index 2228251..0000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1 +0,0 @@ -github: [klange] diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..2ac540d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,34 @@ +FROM alpine AS builder + +RUN \ + apk upgrade --update && \ + apk add g++ make git autoconf automake + +WORKDIR /tmp + +RUN \ + git clone https://github.com/boppy/onenetd.git && \ + cd /tmp/onenetd && autoreconf -vfi && ./configure && make && \ + cp ./onenetd /usr/local/bin + +WORKDIR /tmp/nyancat + +COPY . . + +RUN \ + make && \ + cp ./src/nyancat /usr/local/bin/ + + +FROM alpine + +LABEL \ + maintainer="Wei He " \ + verion="1.0" \ + description="Nyancat Telnet Server" + +COPY --from=builder /usr/local/bin/onenetd /usr/local/bin/nyancat /usr/local/bin/ + +EXPOSE 23 + +ENTRYPOINT ["onenetd", "-v1", "0", "23", "nyancat", "-I", "--telnet"] diff --git a/README.md b/README.md index aca402a..1989fd3 100644 --- a/README.md +++ b/README.md @@ -1,57 +1,40 @@ -# Nyancat CLI +# Nyancat Telnet Server -Nyancat rendered in your terminal. +[![Docker Stars](https://img.shields.io/docker/stars/ddhhz/nyancat-server.svg)](https://hub.docker.com/r/ddhhz/nyancat-server/) [![Docker Pulls](https://img.shields.io/docker/pulls/ddhhz/nyancat-server.svg)](https://hub.docker.com/r/ddhhz/nyancat-server/) [![Docker Build](https://img.shields.io/docker/build/ddhhz/nyancat-server.svg)](https://hub.docker.com/r/ddhhz/nyancat-server/builds/) [![Docker Image Size and Layers](https://images.microbadger.com/badges/image/ddhhz/nyancat-server.svg)](https://microbadger.com/images/ddhhz/nyancat-server) -[![Nyancats](http://nyancat.dakko.us/nyancat.png)](http://nyancat.dakko.us/nyancat.png) +Docker Image for a nyancat telnet server. -## Distributions -Nyancat is available in the following distributions: +## Usage -- [Arch](https://www.archlinux.org/packages/?q=nyancat) -- [Debian](http://packages.qa.debian.org/n/nyancat.html) -- [Fedora](https://src.fedoraproject.org/rpms/nyancat) -- [Gentoo](http://packages.gentoo.org/package/games-misc/nyancat) -- [Mandriva](http://sophie.zarb.org/rpms/928724d4aea0efdbdeda1c80cb59a7d3) -- [Ubuntu](https://launchpad.net/ubuntu/+source/nyancat) +### Telnet Server +```bash +$ docker run -d --name nyancat-server --restart=always -p 23:23 ddhhz/nyancat-server +``` -And also on some BSD systems: +##### To view: +```bash +$ telnet +``` -- [FreeBSD](http://www.freshports.org/net/nyancat/) -- [OpenBSD](http://openports.se/misc/nyancat) -- [NetBSD](http://pkgsrc.se/misc/nyancat) +### View Locally, aka show me the cat +```bash +$ docker run -d --name nyancat-local ddhhz/nyancat-server -## Setup +$ docker exec -it nyancat-local nyancat +``` -First build the C application: - make && cd src +## Using -You can run the C application standalone. +### [klange/nyancat](https://github.com/klange/nyancat) +Checkout 「[Nyan Cat Telnet Server](http://nyancat.dakko.us/)」 project homepage for demos. - ./nyancat +### [atsampson/onenetd](https://github.com/atsampson/onenetd) +> By default, 40 connections are allowed at once. -To use the telnet server, you need to add a configuration that runs: +View `onenetd` help document by running `$ docker exec nyancat-server sh -c "onenetd -h"` - nyancat -t -We recommend `openbsd-inetd`, but both `xinetd` and `systemd` work as well. You -should be able to use any other compatible `inetd` flavor too. - -## Distribution Specific Information - -#### Debian/Ubuntu - -Debian and Ubuntu provide the nyancat binary through the `nyancat` package. A -`nyancat-server` package is provided to automatically setup and enable a nyancat -telnet server upon installation. I am not the maintainer of these packages; -please direct any questions or bugs to the relevant distribution's bug tracking -system. - -## Licenses, References, etc. - -The original source of the Nyancat animation is -[prguitarman](http://www.prguitarman.com/index.php?id=348). - -The code provided here is provided under the terms of the -[NCSA license](http://en.wikipedia.org/wiki/University_of_Illinois/NCSA_Open_Source_License). +## Author +[**Wei He**](https://whe.me) [_github@weispot.com_](mailto:github@weispot.com)