From 1ec4c8e417f6770a01af1620b2f0c803d9f575e0 Mon Sep 17 00:00:00 2001 From: Anton McClure Date: Fri, 14 Jun 2019 11:43:03 -0400 Subject: [PATCH 1/6] fix url in INSTALL.md the git clone url was still for the repo's old location --- INSTALL.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/INSTALL.md b/INSTALL.md index 6c27949..5c5f158 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -8,7 +8,7 @@ any \*nix system. To compile and install run: ``` -$ git clone https://github.com/kimholviala/gophernicus.git +$ git clone https://github.com/gophernicus/gophernicus.git $ cd gophernicus $ make $ sudo make install From 89b37a11f6fc5bd9d4b1a258290035a6bb88831c Mon Sep 17 00:00:00 2001 From: fosslinux Date: Sat, 15 Jun 2019 11:01:19 +1000 Subject: [PATCH 2/6] Travis CI -> Drone CI --- .drone.yml | 17 +++++++++++++++++ .drone/deps | 4 ++++ Makefile | 8 +++++--- 3 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 .drone.yml create mode 100755 .drone/deps diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..748e77d --- /dev/null +++ b/.drone.yml @@ -0,0 +1,17 @@ +kind: pipeline +name: default + +steps: +- name: build + image: ubuntu:18.04 + commands: + - .drone/deps + - make + - make install +- name: debian + image: ubuntu:18.04 + commands: + - .drone/deps + - apt-get -qq install debhelper git libwrap0-dev openbsd-inetd > /dev/null + - make deb + - dpkg -i ../*.deb diff --git a/.drone/deps b/.drone/deps new file mode 100755 index 0000000..8a4238b --- /dev/null +++ b/.drone/deps @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +apt-get -qq update > /dev/null +apt-get -qq dist-upgrade > /dev/null +apt-get -qq install build-essential > /dev/null diff --git a/Makefile b/Makefile index c485193..de2d7c5 100644 --- a/Makefile +++ b/Makefile @@ -255,9 +255,11 @@ install-systemd: install-files install-docs install-root break; \ fi; \ done; \ - systemctl daemon-reload; \ - systemctl enable $(NAME).socket; \ - systemctl start $(NAME).socket; \ + if pidof systemd ; then \ + systemctl daemon-reload; \ + systemctl enable $(NAME).socket; \ + systemctl start $(NAME).socket; \ + fi; \ fi @echo From bf56cff914a42da569e93726b52e621cf62d6cab Mon Sep 17 00:00:00 2001 From: fosslinux Date: Sat, 15 Jun 2019 10:09:50 +1000 Subject: [PATCH 3/6] update documentation about vhosts --- README.md | 33 +++++++++++++-------------------- 1 file changed, 13 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 8ce968f..99b167b 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,6 @@ on the root menu don't work make sure you are using the `-h HOSTNAME` parameter in your configuration (with a valid resolveable hostname instead of `HOSTNAME` - see INSTALL). - ## Security Gophernicus has been written with high security in mind. There should @@ -89,7 +88,6 @@ The `-nx` option prevents execution of any script or external file, and the `-nu` option suppresses scanning for and serving of `~user` directories (which are normally at `~/public_html/` for each user). - ## Gophermaps By default all gopher menus are automatically generated from the @@ -98,7 +96,6 @@ informational text along with the files, or if you want to completely replace the generated menu with your own you need to take a look at gophermaps. See the [README.gophermap](./README.gophermap) for more information. - ## Gophertags A gophertag file can be used to virtually rename a directory. Let's @@ -109,7 +106,6 @@ will show "bar" but the links will still point to "foo". This is useful for creating descriptive names for directories without littering the file system with spaces and weird characters. - ## Personal gopherspaces Gophernicus supports users personal gopherspaces. If a user has @@ -121,30 +117,31 @@ This is suppressed if the `-nu` option is given. In this case, any `~` entry which otherwise initiates listing of user directories will be displayed literally. - ## Virtual hosting Gophernicus supports virtual hosting, or serving more than one logical domain using the same IP address. Since gopher (RFC1436) doesn't -support virtual hosting this requires some clever (but mostly invisble) -hacks. +support virtual hosting this requires some hacks. To enable virtual hosting create one or more directories under your gopher root which are named after your domain names. The primary vhost directory (set with the `-h HOSTNAME` option) must exist or virtual hosting will be disabled. Then simply add content to the hostname -directories and you're up and running. +directories and you're (kind of) up and running. -Almost. +There is a serious issue with virtual hosting. -To make gopher clients work properly with virtual hosting, create a -root gophermap for each of your domains and include the "%" type -character to create a list of all available virtual hosts (see -README.gophermap). The generated virtual host links will be created so -that standard gopher clients will find the correct domain even when -they don't specifically tell the server which host they're trying to -reach. +As stated previously, RFC1436 dosen't support virtual hosting. Clients won't +like it. +How the virtual hosting works, is that it loops through the vhosts looking for +the selector. As you might think, the root gophermap exists on all of the +vhosts, meaning it might not use the correct vhost. There is currently no easy +way to fix this. + +It is recommended to add '%' on a line by itself to the bottom of your root +gophermaps. This will add "special" links of the format example.com/;example.com +which forces the correct vhost. ## CGI support @@ -189,7 +186,6 @@ the PHP command line interpreter. In other words, PHP starts working. And don't use the CGI version of PHP as it outputs HTTP headers the gopher protocol doesn't have. - ## Charset support and conversions Gophernicus supports three charsets: US-ASCII, ISO-8859-1 and UTF-8. @@ -208,7 +204,6 @@ than pure US-ASCII. If you want to disable the conversion use the something else than US-ASCII just use for example the `-o ISO-8859-1` option. - ## Selector rewriting Selector rewriting lets you rewrite parts of the selector on the fly. @@ -243,7 +238,6 @@ monitoring systems. To ease up such integrations, Gophernicus supports HTTP requests of the server-status page using an URL like `http://HOSTNAME:70/server-status?auto` . - ## TLS/SSL and proxy support As of version 2.3 Gophernicus supports the HAproxy proxy protocol @@ -292,4 +286,3 @@ Example: accept = :::7070 connect = 127.0.0.1:70 protocol = proxy - From 7802eca58636702f31e53a75f7ee988b3553005f Mon Sep 17 00:00:00 2001 From: fosslinux Date: Sat, 15 Jun 2019 10:31:02 +1000 Subject: [PATCH 4/6] version 3.0 release * release version 3.0 * change appropriate documentation * change debian packaging for 3.0 --- .gitignore | 4 +- INSTALL.md | 6 +-- Makefile | 21 +++------ README.md | 15 ++++++- VERSIONING.md | 55 +++++++++++++++++++++++ changelog | 38 ++++++++++++++++ changelog.old | 3 ++ debian/changelog | 33 ++++++++++++++ debian/control | 4 +- debian/copyright | 1 + debian/docs | 4 +- debian/gophernicus.default | 2 +- debian/gophernicus.logcheck.ignore.server | 6 +-- debian/postinst | 2 +- debian/rules | 3 +- git2changelog | 29 ------------ gophernicus.env | 2 +- gophernicus.xinetd | 2 +- gophernicus@.service | 2 +- org.gophernicus.server.plist | 2 +- version | 14 ------ 21 files changed, 168 insertions(+), 80 deletions(-) create mode 100644 VERSIONING.md create mode 100644 changelog create mode 100644 debian/changelog delete mode 100755 git2changelog delete mode 100755 version diff --git a/.gitignore b/.gitignore index 1fa4a58..b04a3e8 100644 --- a/.gitignore +++ b/.gitignore @@ -6,20 +6,18 @@ files.h functions.h README.options bin2c -in.gophernicus +gophernicus # # Release files # *.gz -ChangeLog # # Debian packaging leftovers # build-stamp debian/files -debian/changelog debian/gophernicus.debhelper.log debian/gophernicus.postrm.debhelper debian/gophernicus.substvars diff --git a/INSTALL.md b/INSTALL.md index 5c5f158..a4c4fff 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -90,7 +90,7 @@ just run 'make withwrap'. For configuring IP access lists with TCP wrappers, take a look at the files `/etc/hosts.allow` and `/etc/hosts.deny` (because the -manual pages suck). Use the daemon name 'in.gophernicus' to +manual pages suck). Use the daemon name 'gophernicus' to make your access lists. @@ -101,7 +101,7 @@ below line should be added to your `/etc/inetd.conf` and the inetd process restarted. ``` -gopher stream tcp nowait nobody /usr/sbin/in.gophernicus in.gophernicus -h +gopher stream tcp nowait nobody /usr/sbin/gophernicus gophernicus -h ``` The Makefile will automatically do this for you and remove it when @@ -142,7 +142,7 @@ Gophernicus uses SYSV shared memory for session tracking and statistics. It creates the shared memory block using mode 600 and a predefined key which means that a shared memory block created with one user cannot be used by another user. Simply -said, running in.gophernicus under various different user +said, running gophernicus under various different user accounts may create a situation where the memory block is locked to the wrong user. diff --git a/Makefile b/Makefile index de2d7c5..c7c32cb 100644 --- a/Makefile +++ b/Makefile @@ -7,10 +7,10 @@ # NAME = gophernicus PACKAGE = $(NAME) -BINARY = in.$(NAME) -VERSION = `./version` +BINARY = $(NAME) +VERSION = 3.0 CODENAME = Dungeon Edition -AUTHOR = Kim Holviala and others +AUTHOR = h9bnks and fosslinux EMAIL = gophernicus@gophernicus.org STARTED = 2009 @@ -18,7 +18,7 @@ SOURCES = $(NAME).c file.c menu.c string.c platform.c session.c options.c HEADERS = functions.h files.h OBJECTS = $(SOURCES:.c=.o) README = README.md -DOCS = LICENSE README.md INSTALL.md TODO ChangeLog README.Gophermap gophertag +DOCS = LICENSE README.md INSTALL.md TODO changelog README.Gophermap gophertag INSTALL = PATH=$$PATH:/usr/sbin ./install-sh -o 0 -g 0 DESTDIR = /usr @@ -71,19 +71,8 @@ withwrap: # Special targets # deb: - printf "$(PACKAGE) ($(VERSION)) unstable; urgency=low\n\n * Automatically generated changelog\n\n" > debian/changelog - printf " -- $(AUTHOR) <$(EMAIL)> %s\n" "`LC_ALL=POSIX date "+%a, %d %b %Y %H:%M:%S %z"`" >> debian/changelog dpkg-buildpackage -rfakeroot -uc -us -ChangeLog: - if [ -d .git ]; then \ - (./git2changelog > ChangeLog; \ - cat changelog.old >> ChangeLog); \ - else true; fi - -.PHONY: ChangeLog - - # # Building # @@ -142,7 +131,7 @@ clean-shm: # # Install targets # -install: ChangeLog clean-shm +install: clean-shm @case `uname` in \ Darwin) $(MAKE) ROOT="$(OSXROOT)" DESTDIR="$(OSXDEST)" install-files install-docs install-root install-osx install-done; ;; \ Haiku) $(MAKE) SBINDIR=/boot/common/bin DOCDIR=/boot/common/share/doc/$(PACKAGE) \ diff --git a/README.md b/README.md index 99b167b..9caa1d7 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,23 @@ # Gophernicus +Version 3.0 + *Copyright (c) 2009-2019 Kim Holviala and others* Gophernicus is a modern full-featured (and hopefully) secure gopher daemon. It is licensed under the BSD license. +## Support/Contact + +Developers can be reached at . + +Our IRC channel is on irc.freenode.net #gophernicus. + +You most likely want to subscribe to the gophernicus mailing list at +https://lists.tildeverse.org/postorius/lists/gophernicus.lists.tildeverse.org/, +especially if you maintain a server. This is where all important announcements +are made. + ## Command line options -h hostname Change server hostname (FQDN) [$HOSTNAME] @@ -279,7 +292,7 @@ Example: ; Enable TCP wrappers libwrap = yes - service = in.gophernicus-tls + service = gophernicus-tls ; Gopher over TLS service [gophernicus] diff --git a/VERSIONING.md b/VERSIONING.md new file mode 100644 index 0000000..027a647 --- /dev/null +++ b/VERSIONING.md @@ -0,0 +1,55 @@ +# Versioning + +## Latest version + +3.0 + +## Changelog + + +### 3.0 (from 101): +**N.B. this version has two important changes that may make it backwards-incompatible:** + * binary changed from in.gophernicus to gophernicus + * virtual hosting NEVER WORKED and does not work in the way previously + described + +Other changes: + * prevent leak of executable gophermap contents + * make sure {x,}inetd works when systemd is on the system + * allow -j flag to work + * add h9bnks (yargo) and fosslinux into developer roles + * add -nx flag, blocks executable gophermaps + * add -nu flag, disable ~/public_gopher + * modify various documentation to markdown + * fix various formattings and typos + * allow inetd targets to work without update-inetd + * correct handling of inetd.conf + * remove list of supported platforms + * remove example gophermaps + * add dependencies for various distros to INSTALL.md + * fix query urls + * add travis ci + * add documentation about CI + +Upgrade guide: + +If you are running gophernicus on a **production** system, **do not** upgrade +to 3.0. Wait for 3.1. + +As a general guide: + +If you are running 101 and haven't upgraded to newer versions **because** of +instability worries, **wait for 3.1**. + +If you were running other rolling-release versions, **upgrade now**. + +## History + +Gophernicus has had a rough versioning history. + +Versions progressed through to 2.6. Then it changed to a rolling-release scheme. +This dosen't work very well, hence the decision was made to revert to a numbered +versioning scheme. In some places, it was referred to 101 (the git commit +number) or 2.99.101 (2.99.gitcommitnumber). + +These days (June 2019), the vast majority of gophernicus servers are on 101. diff --git a/changelog b/changelog new file mode 100644 index 0000000..2a75397 --- /dev/null +++ b/changelog @@ -0,0 +1,38 @@ +3.0 (from 101) +============== + +N.B. this version has two important changes that may make it +backwards-incompatible: + * binary changed from in.gophernicus to gophernicus + * virtual hosting NEVER WORKED and does not work in the way previously + described + +Other changes: + * prevent leak of executable gophermap contents + * make sure {x,}inetd works when systemd is on the system + * allow -j flag to work + * add h9bnks (yargo) and fosslinux into developer roles + * add -nx flag, blocks executable gophermaps + * add -nu flag, disable ~/public_gopher + * modify various documentation to markdown + * fix various formattings and typos + * allow inetd targets to work without update-inetd + * correct handling of inetd.conf + * remove list of supported platforms + * remove example gophermaps + * add dependencies for various distros to INSTALL.md + * fix query urls + * add travis ci + * add documentation about CI + +Upgrade guide: + +If you are running gophernicus on a **production** system, **do not** upgrade +to 3.0. Wait for 3.1. + +As a general guide, + +If you are running 101 and haven't upgraded to newer versions **because** of +instability worries, **wait for 3.1**. + +If you were running other rolling-release versions, **upgrade now**. diff --git a/changelog.old b/changelog.old index a867a05..a9be324 100644 --- a/changelog.old +++ b/changelog.old @@ -1,3 +1,6 @@ +This contains changelog up to 1.4. There are no changelogs from 1.4 +until 3.0. + 2012-12-02 Kim Holviala * Released version 1.4 diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..50a25c0 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,33 @@ +gophernicus (3.0-1.1) unstable; urgency=medium + + * N.B. this version has two important changes that may make it + backwards-incompatible: + * binary changed from in.gophernicus to gophernicus + * virtual hosting NEVER WORKED and does not work in the way previously + described + * Other changes: + * prevent leak of executable gophermap contents + * make sure {x,}inetd works when systemd is on the system + * allow -j flag to work + * add h9bnks (yargo) and fosslinux into developer roles + * add -nx flag, blocks executable gophermaps + * add -nu flag, disable ~/public_gopher + * modify various documentation to markdown + * fix various formattings and typos + * allow inetd targets to work without update-inetd + * correct handling of inetd.conf + * remove list of supported platforms + * remove example gophermaps + * add dependencies for various distros to INSTALL.md + * fix query urls + * add travis ci + * add documentation about CI + * Upgrade guide: + * If you are running gophernicus on a **production** system, **do not** upgrade + to 3.0. Wait for 3.1. + * As a general guide, + * If you are running 101 and haven't upgraded to newer versions **because** of + instability worries, **wait for 3.1**. + * If you were running other rolling-release versions, **upgrade now**. + + -- gophernicus developers Sun, 16 Jun 2019 17:49:46 +0000 diff --git a/debian/control b/debian/control index 4eca63d..cf593b0 100644 --- a/debian/control +++ b/debian/control @@ -1,10 +1,10 @@ Source: gophernicus Section: net Priority: extra -Maintainer: Kim Holviala +Maintainer: gophernicus developers Build-Depends: debhelper (>= 5), libwrap0-dev Standards-Version: 3.7.3 -Homepage: gopher://gophernicus.org/1/software/gophernicus/server/ +Homepage: https://github.com/gophernicus/gophernicus Package: gophernicus Architecture: any diff --git a/debian/copyright b/debian/copyright index ae18689..096df79 100644 --- a/debian/copyright +++ b/debian/copyright @@ -1,4 +1,5 @@ Gophernicus - Copyright (c) 2009-2018 Kim Holviala + 2019 gophernicus developers All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/debian/docs b/debian/docs index 994fb1d..f9ae1f7 100644 --- a/debian/docs +++ b/debian/docs @@ -1,5 +1,7 @@ -README +README.md README.Gophermap TODO INSTALL.md +VERSONING.md +changelog gophertag diff --git a/debian/gophernicus.default b/debian/gophernicus.default index af26579..c06f426 100644 --- a/debian/gophernicus.default +++ b/debian/gophernicus.default @@ -3,7 +3,7 @@ # If you are using Gophernicus with inetd this configuration file # is ignored and the real configuration is in /etc/inetd.conf # -# See README or run "in.gophernicus -?" to see a full list of +# See README or run "gophernicus -?" to see a full list of # configuration options. # # Example: diff --git a/debian/gophernicus.logcheck.ignore.server b/debian/gophernicus.logcheck.ignore.server index 5279b6f..5675585 100644 --- a/debian/gophernicus.logcheck.ignore.server +++ b/debian/gophernicus.logcheck.ignore.server @@ -1,4 +1,4 @@ -^\w{3} [ :0-9]{11} [._[:alnum:]-]+ in.gophernicus\[[0-9]+\]: request for "[^"]*" from [._[:alnum:]:-]+$ -^\w{3} [ :0-9]{11} [._[:alnum:]-]+ in.gophernicus\[[0-9]+\]: error "No such file or directory" for request "[^"]*" from [._[:alnum:]:-]+$ -^\w{3} [ :0-9]{11} [._[:alnum:]-]+ in.gophernicus\[[0-9]+\]: error "User not found" for request "/~[^"]*" from [._[:alnum:]:-]+$ +^\w{3} [ :0-9]{11} [._[:alnum:]-]+ gophernicus\[[0-9]+\]: request for "[^"]*" from [._[:alnum:]:-]+$ +^\w{3} [ :0-9]{11} [._[:alnum:]-]+ gophernicus\[[0-9]+\]: error "No such file or directory" for request "[^"]*" from [._[:alnum:]:-]+$ +^\w{3} [ :0-9]{11} [._[:alnum:]-]+ gophernicus\[[0-9]+\]: error "User not found" for request "/~[^"]*" from [._[:alnum:]:-]+$ ^\w{3} [ :0-9]{11} [._[:alnum:]-]+ systemd\[1\]: Start(ing|ed) Gophernicus gopher server \([^[:space:]]+\)\.+$ diff --git a/debian/postinst b/debian/postinst index 383e49d..f7e05db 100644 --- a/debian/postinst +++ b/debian/postinst @@ -11,7 +11,7 @@ ROOT=/var/gopher PACKAGE=gophernicus LOGDIR=/var/log/$PACKAGE LIBDIR=/usr/lib/$PACKAGE -BINARY=in.gophernicus +BINARY=gophernicus DEFAULT=/etc/default/$PACKAGE USER=nobody diff --git a/debian/rules b/debian/rules index cd85559..4db56c0 100755 --- a/debian/rules +++ b/debian/rules @@ -20,7 +20,6 @@ build-stamp: dh_testdir $(MAKE) - $(MAKE) ChangeLog touch $@ @@ -55,7 +54,7 @@ binary-indep: build install binary-arch: build install dh_testdir dh_testroot - dh_installchangelogs ChangeLog + dh_installchangelogs changelog dh_installdocs # dh_install # dh_installmenu diff --git a/git2changelog b/git2changelog deleted file mode 100755 index a7f8817..0000000 --- a/git2changelog +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh - -## -## Generate ChangeLog from git log -## - -VERSION=`git log | grep -c "^commit"` -FIRSTVER=93 -PREVIOUS= -IFS=\; - -echo "[ Automatically generated from git log ]" - -git log --pretty=tformat:"%ad %an <%ae>;%s" --date=short | \ -while read -r AUTHOR COMMENT; do - [ "$AUTHOR" != "$PREVIOUS" ] && printf "\n$AUTHOR\n\n" - - if [ $VERSION -ge $FIRSTVER ]; then - printf "\t* (v%d) %s\n" $VERSION "$COMMENT" - else - printf "\t* %s\n" "$COMMENT" - fi - - PREVIOUS="$AUTHOR" - VERSION=$(( VERSION - 1 )) -done - -echo -echo diff --git a/gophernicus.env b/gophernicus.env index fdc9d2f..13556df 100644 --- a/gophernicus.env +++ b/gophernicus.env @@ -1,6 +1,6 @@ # Options for Gophernicus # -# See README or run "in.gophernicus -?" to see a full list of +# See README or run "gophernicus -?" to see a full list of # configuration options. # # Example: diff --git a/gophernicus.xinetd b/gophernicus.xinetd index f6c429c..2ae9dc2 100644 --- a/gophernicus.xinetd +++ b/gophernicus.xinetd @@ -5,7 +5,7 @@ service gopher socket_type = stream wait = no user = nobody - server = /usr/sbin/in.gophernicus + server = /usr/sbin/gophernicus server_args = -r/var/gopher -h@HOSTNAME@ disable = no } diff --git a/gophernicus@.service b/gophernicus@.service index 47bd46c..dacb19b 100644 --- a/gophernicus@.service +++ b/gophernicus@.service @@ -4,7 +4,7 @@ Description=Gophernicus gopher server [Service] EnvironmentFile=-/etc/default/gophernicus EnvironmentFile=-/etc/sysconfig/gophernicus -ExecStart=/usr/sbin/in.gophernicus -h %H $OPTIONS +ExecStart=/usr/sbin/gophernicus -h %H $OPTIONS SuccessExitStatus=1 StandardInput=socket User=nobody diff --git a/org.gophernicus.server.plist b/org.gophernicus.server.plist index f2ed949..e6bb571 100644 --- a/org.gophernicus.server.plist +++ b/org.gophernicus.server.plist @@ -6,7 +6,7 @@ org.gophernicus.server ProgramArguments - /usr/local/sbin/in.gophernicus + /usr/local/sbin/gophernicus -h@HOSTNAME@ -r/Library/GopherServer diff --git a/version b/version deleted file mode 100755 index de6a73e..0000000 --- a/version +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh - -## -## Generate Gophernicus version/build number -## - -DEFAULT="120+" - -if which git >/dev/null && test -d .git; then - git log | grep -c "^commit" -else - echo $DEFAULT -fi - From 962a62024e0cb3ee07d12eaec9e0b7a71518ea2c Mon Sep 17 00:00:00 2001 From: Yargo Date: Mon, 24 Jun 2019 15:33:16 +0000 Subject: [PATCH 5/6] replace executable name, remove trailing spaces --- .gitignore | 1 + INSTALL.md | 66 +++++++++++++++++------------------- Makefile | 2 +- README.Gophermap | 4 +-- README.md | 2 +- VERSIONING.md | 21 +++++++----- changelog | 14 ++++---- debian/control | 2 +- debian/gophernicus.templates | 2 +- debian/prerm | 2 +- debian/rules | 6 ++-- gophernicus.c | 2 +- gophernicus.h | 4 +-- gophernicus.xinetd | 2 +- menu.c | 6 ++-- options.c | 2 +- platform.c | 2 +- 17 files changed, 70 insertions(+), 70 deletions(-) diff --git a/.gitignore b/.gitignore index b04a3e8..2734999 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ *.o files.h functions.h +README README.options bin2c gophernicus diff --git a/INSTALL.md b/INSTALL.md index a4c4fff..5041057 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -14,11 +14,19 @@ $ make $ sudo make install ``` +after having set the correct public hostname in the `gophernicus.env` +file. If this is wrong, selectors ("gopher links") won't work! + +On \*nix systems, `hostname` might give you an idea, but please +note this might be completely wrong, especially on your personal +machine at home or on some cheap virtual server. If you know you +have a fixed numerical IP, you can also directly use that. +For testing, just keep the default value of `localhost` which will +result in selectors working only when you're connecting locally. + That's it - Gophernicus should now be installed, preconfigured and running under gopher:///. And more often than not, -It Just Works(tm). If gopher links don't seem to work you may -need to configure your public hostname explicitly in whatever -config file Gophernicus is using. +It Just Works(tm). By default Gophernicus serves gopher documents from `/var/gopher` although that can be changed by using the `-r ` parameter. @@ -28,49 +36,43 @@ hostname (the one set with `-h `) directory available (`mkdir /var/gopher/$HOSTNAME`). -<<<<<<< HEAD:INSTALL -Dependencies -============ +## Dependencies These were obtained from a base docker installation, what we (will) be using on Travis. -# Ubuntu 18.04, 16.04, Debian Sid, Buster, Stretch, Jessie # +### Ubuntu 18.04, 16.04, Debian Sid, Buster, Stretch, Jessie - build-essential - git - libwrap0-dev for tcp -# Centos 6, 7 # +### Centos 6, 7 - the group 'Development Tools'. less is probably required, but I know this works and couldn't be bothered to find out what was actually required. -# Fedora 29, 30, rawhide # +### Fedora 29, 30, rawhide - the group 'Development Tools'. less is probably required, but I know this works and couldn't be bothered to find out what was actually required. - net-tools -# OpenSuse Leap, Tumbleweed # +### OpenSuse Leap, Tumbleweed - the pattern devel_C_C++ - the pattern devel_basis - git -# archlinux # +### archlinux - base-devel - git -# Gentoo # +### Gentoo - git -# Alpine Linux # +### Alpine Linux - alpine-sdk. once again, less is probably required.. blah blah. -Other installation targets -========================== -======= -## Other installation targets ->>>>>>> 82a1abebc4bfabc43ef6b27f0627f526984eaf30:INSTALL.md +### Other installation targets Suppose your server runs systemd, but you'd rather have Gophernicus started with inetd or xinetd. To do that, do `make install-inetd` @@ -90,14 +92,14 @@ just run 'make withwrap'. For configuring IP access lists with TCP wrappers, take a look at the files `/etc/hosts.allow` and `/etc/hosts.deny` (because the -manual pages suck). Use the daemon name 'gophernicus' to +manual pages suck). Use the daemon name "gophernicus" to make your access lists. ## Running with traditional inetd superserver -If you want to run Gophernicus under the traditional Unix inetd, the -below line should be added to your `/etc/inetd.conf` and the inetd +If you want to run Gophernicus under the traditional Unix inetd, the +below line should be added to your `/etc/inetd.conf` and the inetd process restarted. ``` @@ -134,9 +136,7 @@ arch one. $ make HOSTCC=gcc CC=target-arch-gcc ``` - ## Shared memory issues -==================== Gophernicus uses SYSV shared memory for session tracking and statistics. It creates the shared memory block using mode 600 @@ -156,17 +156,14 @@ $ sudo make clean-shm ## Porting to different platforms -If you need to port Gophernicus to a new platform, please take -a look at gophernicus.h which has a bunch of `HAVE_*` `#defines`. -Fiddling with those usually makes it possible to compile a working -server. If you succeed in compiling Gophernicus to a new -platform please send the patches to - so we can include them into -the next release. +If you need to port Gophernicus to a new platform, please take a look at +gophernicus.h which has a bunch of `#define HAVE_...` Fiddling with those +usually makes it possible to compile a working server. +If you succeed in compiling Gophernicus to a new platform please send +the patches to so we can include +them into the next release. -<<<<<<< HEAD:INSTALL -Supported Platforms -=================== +## Supported Platforms | Platform | Versions | | ------------ | ---------------------------- | @@ -178,5 +175,4 @@ Supported Platforms | Arch Linux | up to date | | Gentoo | up to date | | Alpine Linux | Edge, 3.9 | -======= ->>>>>>> 82a1abebc4bfabc43ef6b27f0627f526984eaf30:INSTALL.md +| FreeBSD | 12.0 | diff --git a/Makefile b/Makefile index c7c32cb..c6686a1 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ NAME = gophernicus PACKAGE = $(NAME) BINARY = $(NAME) -VERSION = 3.0 +VERSION = 3.0 CODENAME = Dungeon Edition AUTHOR = h9bnks and fosslinux EMAIL = gophernicus@gophernicus.org diff --git a/README.Gophermap b/README.Gophermap index 5cb88d5..e06ca87 100644 --- a/README.Gophermap +++ b/README.Gophermap @@ -10,7 +10,7 @@ file. You can also have inline gophermaps - files with a ".gophermap" extension are parsed as gophermaps and displayed in between normal resources in alphabetical order. -In a gophermap any line that doesn't contain a character is +In a gophermap any line that doesn't contain a character is automatically converted to an type "i" gopher resource which are displayed as plain text in the client. Lines which contain tabs are intepreted as gopher resource lines which the client will render as @@ -63,7 +63,7 @@ Additional type characters supported by Gophernicus: :ext=type change filetype (for this directory only) ~ include a list of users with valid ~/public_gopher % include a list of available virtual hosts - =mapfile include or execute other gophermap + =mapfile include or execute other gophermap * stop processing gophermap, include file listing . stop processing gophermap (default) diff --git a/README.md b/README.md index 9caa1d7..38373f7 100644 --- a/README.md +++ b/README.md @@ -154,7 +154,7 @@ way to fix this. It is recommended to add '%' on a line by itself to the bottom of your root gophermaps. This will add "special" links of the format example.com/;example.com -which forces the correct vhost. +which forces the correct vhost. ## CGI support diff --git a/VERSIONING.md b/VERSIONING.md index 027a647..5a6df10 100644 --- a/VERSIONING.md +++ b/VERSIONING.md @@ -5,15 +5,18 @@ 3.0 ## Changelog + ### 3.0 (from 101): -**N.B. this version has two important changes that may make it backwards-incompatible:** - * binary changed from in.gophernicus to gophernicus - * virtual hosting NEVER WORKED and does not work in the way previously - described -Other changes: +**N.B. this version has two important changes that may make it backwards-incompatible:** + + * binary changed from in.gophernicus to gophernicus + * virtual hosting NEVER WORKED and does not work in the way previously described + +#### Other changes: + * prevent leak of executable gophermap contents * make sure {x,}inetd works when systemd is on the system * allow -j flag to work @@ -31,10 +34,10 @@ Other changes: * add travis ci * add documentation about CI -Upgrade guide: +#### Upgrade guide: -If you are running gophernicus on a **production** system, **do not** upgrade -to 3.0. Wait for 3.1. +If you are running gophernicus on a **production** system, **do not** upgrade to 3.0. +Wait for 3.1. As a general guide: @@ -50,6 +53,6 @@ Gophernicus has had a rough versioning history. Versions progressed through to 2.6. Then it changed to a rolling-release scheme. This dosen't work very well, hence the decision was made to revert to a numbered versioning scheme. In some places, it was referred to 101 (the git commit -number) or 2.99.101 (2.99.gitcommitnumber). +number) or 2.99.101 (2.99.gitcommitnumber). These days (June 2019), the vast majority of gophernicus servers are on 101. diff --git a/changelog b/changelog index 2a75397..81a3659 100644 --- a/changelog +++ b/changelog @@ -1,13 +1,13 @@ 3.0 (from 101) ============== -N.B. this version has two important changes that may make it -backwards-incompatible: +N.B. this version has two important changes that may make it backwards-incompatible: + * binary changed from in.gophernicus to gophernicus - * virtual hosting NEVER WORKED and does not work in the way previously - described + * virtual hosting NEVER WORKED and does not work in the way previously described Other changes: + * prevent leak of executable gophermap contents * make sure {x,}inetd works when systemd is on the system * allow -j flag to work @@ -27,10 +27,10 @@ Other changes: Upgrade guide: -If you are running gophernicus on a **production** system, **do not** upgrade -to 3.0. Wait for 3.1. +If you are running gophernicus on a **production** system, **do not** upgrade to 3.0. +Wait for 3.1. -As a general guide, +As a general guide: If you are running 101 and haven't upgraded to newer versions **because** of instability worries, **wait for 3.1**. diff --git a/debian/control b/debian/control index cf593b0..84fce6c 100644 --- a/debian/control +++ b/debian/control @@ -1,7 +1,7 @@ Source: gophernicus Section: net Priority: extra -Maintainer: gophernicus developers +Maintainer: gophernicus developers Build-Depends: debhelper (>= 5), libwrap0-dev Standards-Version: 3.7.3 Homepage: https://github.com/gophernicus/gophernicus diff --git a/debian/gophernicus.templates b/debian/gophernicus.templates index a68f93a..3a550ca 100644 --- a/debian/gophernicus.templates +++ b/debian/gophernicus.templates @@ -1,4 +1,4 @@ Template: gophernicus/fqdn Type: string -Default: +Default: Description: Fully-qualified hostname for the gopher server: diff --git a/debian/prerm b/debian/prerm index f2b5d3f..1035cd9 100644 --- a/debian/prerm +++ b/debian/prerm @@ -1,7 +1,7 @@ #!/bin/sh if [ -f /etc/inetd.conf -a -x /usr/sbin/update-inetd ]; then - /usr/sbin/update-inetd --disable gopher + /usr/sbin/update-inetd --disable gopher fi if [ -x /usr/bin/deb-systemd-helper ]; then diff --git a/debian/rules b/debian/rules index 4db56c0..2957064 100755 --- a/debian/rules +++ b/debian/rules @@ -23,19 +23,19 @@ build-stamp: touch $@ -clean: +clean: dh_testdir dh_testroot rm -f build-stamp $(MAKE) clean-build - dh_clean + dh_clean install: build dh_testdir dh_testroot - dh_clean -k + dh_clean -k dh_installdirs # Add here commands to install the package into debian/gophernicus diff --git a/gophernicus.c b/gophernicus.c index eb6e020..5eb2038 100644 --- a/gophernicus.c +++ b/gophernicus.c @@ -177,7 +177,7 @@ void log_combined(state *st, int status) /* Generate log entry */ fprintf(fp, "%s %s:%i - [%s] \"GET %c%s HTTP/1.0\" %i %li \"%s\" \"" HTTP_USERAGENT "\"\n", - st->req_remote_addr, + st->req_remote_addr, st->server_host, st->server_port, timestr, diff --git a/gophernicus.h b/gophernicus.h index 649b918..d5317da 100644 --- a/gophernicus.h +++ b/gophernicus.h @@ -1,7 +1,7 @@ /* * Gophernicus - Copyright (c) 2009-2018 Kim Holviala * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright @@ -9,7 +9,7 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE diff --git a/gophernicus.xinetd b/gophernicus.xinetd index 2ae9dc2..0c5553c 100644 --- a/gophernicus.xinetd +++ b/gophernicus.xinetd @@ -2,7 +2,7 @@ # description: Gophernicus - Modern full-featured gopher server service gopher { - socket_type = stream + socket_type = stream wait = no user = nobody server = /usr/sbin/gophernicus diff --git a/menu.c b/menu.c index fa0d34f..4f70a57 100644 --- a/menu.c +++ b/menu.c @@ -179,7 +179,7 @@ void vhostlist(state *st) strftime(timestr, sizeof(timestr), DATE_FORMAT, ltime); printf("1%-*.*s %s - \t/;%s\t%s\t%i" CRLF, - width, width, buf, timestr, dir[i].name, + width, width, buf, timestr, dir[i].name, dir[i].name, st->server_port); } @@ -226,7 +226,7 @@ char gopher_filetype(state *st, char *file, char magic) fclose(fp); /* GIF images */ - if (sstrncmp(buf, "GIF89a") == MATCH || + if (sstrncmp(buf, "GIF89a") == MATCH || sstrncmp(buf, "GIF87a") == MATCH) return TYPE_GIF; /* JPEG images */ @@ -405,7 +405,7 @@ int gophermap(state *st, char *mapfile, int depth) /* Parse port */ port = st->server_port; if ((c = strchr(host, '\t'))) { - *c = '\0'; + *c = '\0'; port = atoi(c + 1); } diff --git a/options.c b/options.c index 734141e..186fbc0 100644 --- a/options.c +++ b/options.c @@ -151,7 +151,7 @@ void parse_args(state *st, int argc, char *argv[]) case 'd': st->debug = TRUE; break; case 'b': puts(license); exit(EXIT_SUCCESS); - case 'v': + case 'v': printf("%s/%s \"%s\" (built %s)\n", SERVER_SOFTWARE, VERSION, CODENAME, __DATE__); exit(EXIT_SUCCESS); diff --git a/platform.c b/platform.c index 89c9537..e283fc6 100644 --- a/platform.c +++ b/platform.c @@ -274,7 +274,7 @@ void platform(state *st) #else release, machine); -#endif +#endif /* Debug */ if (st->debug) { From 75990fc93ec7a5a40bafe2303fde8167182b3b40 Mon Sep 17 00:00:00 2001 From: Yargo Date: Mon, 1 Jul 2019 06:31:13 +0000 Subject: [PATCH 6/6] add suggestion of pull request for new platforms --- INSTALL.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/INSTALL.md b/INSTALL.md index 5041057..2da8e48 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -161,7 +161,8 @@ gophernicus.h which has a bunch of `#define HAVE_...` Fiddling with those usually makes it possible to compile a working server. If you succeed in compiling Gophernicus to a new platform please send the patches to so we can include -them into the next release. +them into the next release -- or even better, commit them to your fork +on Github and make a pull request! ## Supported Platforms