{"id":13619783,"url":"https://github.com/mbionchi/telnet-site","last_synced_at":"2025-04-14T18:32:20.768Z","repository":{"id":90457954,"uuid":"160307113","full_name":"mbionchi/telnet-site","owner":"mbionchi","description":null,"archived":false,"fork":false,"pushed_at":"2019-05-03T06:33:45.000Z","size":157,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-08T06:38:15.208Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mbionchi.png","metadata":{"files":{"readme":"README","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-12-04T06:03:47.000Z","updated_at":"2023-09-06T23:38:23.000Z","dependencies_parsed_at":"2024-01-14T04:57:26.505Z","dependency_job_id":null,"html_url":"https://github.com/mbionchi/telnet-site","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbionchi%2Ftelnet-site","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbionchi%2Ftelnet-site/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbionchi%2Ftelnet-site/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbionchi%2Ftelnet-site/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mbionchi","download_url":"https://codeload.github.com/mbionchi/telnet-site/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248936903,"owners_count":21186121,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T21:00:48.662Z","updated_at":"2025-04-14T18:32:20.487Z","avatar_url":"https://github.com/mbionchi.png","language":"C","funding_links":[],"categories":["C"],"sub_categories":[],"readme":"TELNET-SITE\n===========\n\n\nDESCRIPTION\n-----------\n\n  telnet-site - a glorified file reader intended to be used as a telnet site.\n\n  The telnet-site executable takes the following parameters:\n\n  --site \u003cpath-to-dir\u003e       specify the path to the directory with site files\n\n  --splash \u003cpath-to-file\u003e    specify the path to the splash screen file (optional)\n\n  The files in the --site directory can either be plaintext with some formatting\n(see the FORMATTING and ANIMATIONS sections) or shared objects specifying special\nfunctions to work with the site(see the DYNAMIC LIBRARIES section).\n\n\nBUILDING\n--------\n\n  If you have autotools, you can just run\n    ./autogen.sh\nand then do the normal `./configure \u0026\u0026 make \u0026\u0026 make install` with your favourite\nflags.  See BUILD-TIME OPTIONS to find out about features you can compile in or out.\n\n  Otherwise, you can run\n    gcc -o telnetsite -lncurses -ldl -Isrc ./src/*.c\n\n\nBUILD-TIME OPTIONS\n------------------\n\n  You can pass the following options to the configure script:\n\n    --disable-follow-link       Disable following symbolic links when reading content files.\n\n    --enable-unicode            Enable unicode support for content files (note: not filenames).\n\n\nSERVING OVER TELNET\n-------------------\n\n  Right now, in order to serve this over telnet, you need to use telnetd with\neither inetd or xinetd.  Assuming you are running inetutils-telnetd and inetd,\nyour config should look like this:\n\n  /etc/services, replacing \u003cport\u003e with the port you'd like to put the site on:\n\nmytelnetsite \u003cport\u003e/tcp\n\n  /etc/inetd.conf, replacing \u003cuser\u003e with the user you'd like to run the site as\nand \u003cpath-to-wrapper-script\u003e with the path to the wrapper script (see below):\n\nmytelnetsite stream tcp nowait \u003cuser\u003e /usr/sbin/tcpd /usr/sbin/telnetd -h -E \u003cpath-to-wrapper-script\u003e\n\n  And finally, you should create a small script at \u003cpath-to-wrapper-script\u003e,\nwith the following:\n\n#!/bin/sh\nexec \u003cpath-to-binary\u003e --site \u003cpath-to-site.d\u003e [--splash \u003cpath-to-splash-file\u003e]\n\n  where \u003cpath-to-binary\u003e is the path to the telnet-site executable, and\n\u003cpath-to-site.d\u003e is the path to the root directory of the site.\n\n\nFORMATTING\n----------\n\n  - If a line in the file ends in a space character (ascii 0x20 that is), then the\nnewline at the end is \"escaped\" and the next line from the file is treated as a part\nof the same paragraph and will be reflowed based on the screen width, for example:\n\n  Hello \nworld!\n\n  Will be treated as a single line due to Hello having a trailing space.  (I guess\nyou might need a hex editor to see this one :^))\n\n  - If the first non-whitespace character at the beginning of a line is not a\nletter, then this line is treated as a list item and, if it needs re-flowing,\nwill be aligned to the first letter character on this line, for example:\n\n  [] this is list item number one\n\n  Given limited columns, can be re-flowed by the algorithm as:\n\n  [] this is\n     list\n     item\n     number\n     one\n\n  - You can change text or animation alignment by using the `;align \u003chow\u003e`\n    directive, on a line by itself, where \u003chow\u003e is one-of {left,right,center}.\n    The chosen alignment will apply until explicitly changed.  Example:\n\n;align center\n* * *\n\n;align right\n  This paragraph will be right-aligned.\n\n  And same for this one.\n\n;align left\n  However, this paragraph will be left-aligned!  How wonderful.\n\n\nANIMATIONS\n----------\n\n  Animation specification must start with a ;anim on the line by\nitself and end with either ;loop or ;noloop on the line by itself.\nIn between those two lines, it is expected that the user will specify\nframes by using the keyword ;frame followed by the number of ticks this\nframe should last (where one tick is 1/10th a second), all on one line\nwith nothing else on it.  On the next line, and until the next ;frame,\nthe lines will be treated as frame data.  The number of lines must be\nthe same among all frames.\n\n  For example, here's a specification of a loading spinner:\n\n;anim\n;frame 1\nloading... |\n;frame 1\nloading... /\n;frame 1\nloading... -\n;frame 1\nloading... \\\n;loop\n\n\nDYNAMIC LIBRARIES\n-----------------\n\n  In order to allow for more interactive functionality (such as user input or\nprogrammable animations), telnet-site can dynamically load shared objects it\nfinds in the --site path.  The shared object files must end in .so in order for\nthe program to recognize it as such.  The \"src/module.h\" file contains the\npreprocessor macro definitions for function names that the shared object must\ndefine in order to interoperate with the telnet-site:\n\nvoid INIT_FUNC_NAME(WINDOW *)  -  mandatory, called on the initial load of the\n                                  shared object.  The WINDOW pointer points to\n                                  the section of the screen the module is supposed\n                                  to print on.\n\nvoid SCROLL_FUNC_NAME(int)  -  optional, called when the main input loop gets a\n                               command to scroll up (-1) or down (1).\n\nvoid SETMODE_FUNC_NAME(enum mode)  -  optional, called when the main input loop\n                                      detects mode change (COMMAND to INSERT or\n                                      the other way around).  Used for custom user\n                                      input.\n\nvoid GETCH_FUNC_NAME(int)  -  optional, called when getch() in the main input loop\n                              returns during INSERT mode.\n\nvoid KILL_FUNC_NAME()  -  optional, called when the content is about to go out of\n                          focus.  Is expected to clean up whatever memory was allocated\n                          during the module's life.\n\n  You can find an example that uses all of the features above to implement a\nsimple guestbook in the examples/guestbook.c file.\n\n  To compile the example module as a shared library, you will need to:\n      gcc -g -o guestbook.so -Isrc -fpic -shared examples/guestbook.c src/*.c\n\n\nBUGS\n----\n\n  You know it.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmbionchi%2Ftelnet-site","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmbionchi%2Ftelnet-site","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmbionchi%2Ftelnet-site/lists"}