From 44e50e2dabbcffe37aef95a7be68e8c86e98ef97 Mon Sep 17 00:00:00 2001 From: fosslinux Date: Wed, 23 Dec 2020 11:48:42 +1100 Subject: [PATCH] Further improvements, delete debian packaging --- INSTALL.md | 157 ++++++----------- Makefile.in | 18 +- configure | 201 ++++++++++++---------- debian/changelog | 89 ---------- debian/compat | 1 - debian/control | 16 -- debian/copyright | 23 --- debian/dirs | 5 - debian/docs | 4 - debian/gophernicus.config | 14 -- debian/gophernicus.default | 13 -- debian/gophernicus.logcheck.ignore.server | 4 - debian/gophernicus.logrotate | 7 - debian/gophernicus.templates | 4 - debian/postinst | 46 ----- debian/postrm | 11 -- debian/prerm | 12 -- debian/rules | 85 --------- debian/source/format | 1 - init/.gitignore | 1 + init/gophernicus.env | 2 +- init/gophernicus.env.in | 10 ++ 22 files changed, 179 insertions(+), 545 deletions(-) delete mode 100644 debian/changelog delete mode 100644 debian/compat delete mode 100644 debian/control delete mode 100644 debian/copyright delete mode 100644 debian/dirs delete mode 100644 debian/docs delete mode 100755 debian/gophernicus.config delete mode 100644 debian/gophernicus.default delete mode 100644 debian/gophernicus.logcheck.ignore.server delete mode 100644 debian/gophernicus.logrotate delete mode 100644 debian/gophernicus.templates delete mode 100644 debian/postinst delete mode 100644 debian/postrm delete mode 100644 debian/prerm delete mode 100755 debian/rules delete mode 100644 debian/source/format create mode 100644 init/gophernicus.env.in diff --git a/INSTALL.md b/INSTALL.md index f586343..6f11f09 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -13,121 +13,65 @@ To compile and install run: ``` $ git clone -b 3.0.1 https://github.com/gophernicus/gophernicus.git $ cd gophernicus +$ ./configure --listener=somelistener $ 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! +Important configure arguments include: -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. +- `--listener`. This is the only required argument. You must + choose a listener that passes network requests to + gophernicus, as gophernicus dosen't do this by itself. The + options are: + - systemd, a common init system on many Linux distributions + that can do this without an external program. + - inetd, an older, well-known implementation that is very + simple. + - xinetd, a modern reimplementation of inetd using specific + config files. + - mac, to be used on Mac OSX machines. + - haiku, to be used on Haiku machines. + - autodetect, which looks at what you have avaliable + (unrecommended, please manually specify where possible). +- `--hostname`. This is by default attempted to be autodetected + by the configure script, using the command `hostname`. It is + expected to be the publicly-accessible address of the server. + However, this might be completely wrong, especially on your + personal machine at home or on some cheap VPS. 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. +- `--gopherroot`. The location in which your gopher server will + serve from. By default is `/var/gopher`. Also can be changed + later using the `-r ` parameter in configuration files. That's it - Gophernicus should now be installed, preconfigured and running under gopher:///. And more often than not, It Just Works(tm). -By default Gophernicus serves gopher documents from `/var/gopher` -although that can be changed by using the `-r ` parameter. -To enable virtual hosting create hostname directories under -the gopher root and make sure you have at least the primary -hostname (the one set with `-h `) directory available -(`mkdir /var/gopher/$HOSTNAME`). - - -## Dependencies - -These were obtained from a base docker installation. - -### Ubuntu 18.04, 16.04, Debian Sid, Buster, Stretch, Jessie -- build-essential -- git -- libwrap0-dev for tcp -- fakeroot - -### 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 -- 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 -- the pattern devel_C_C++ -- the pattern devel_basis -- git - -### archlinux -- base-devel -- git - -### Gentoo -- git - -### Alpine Linux -- alpine-sdk. once again, less is probably required.. blah blah. - - -### 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` -or `make install-xinetd`. Likewise use `make uninstall-inetd` or -`make uninstall-xinetd` to uninstall Gophernicus. - - ## Compiling with TCP wrappers Gophernicus uses no extra libraries... well... except libwrap (TCP wrappers) if it is installed with headers in default Unix directories at the time of compiling. If you have the headers -installed and don't want wrapper support, run 'make generic' -instead of just 'make', and if you have wrappers installed in -non-standard place and want to force compile with wrappers -just run 'make withwrap'. +installed and don't want wrapper support, too bad (for now, see +issue #89). 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 make your access lists. +## Distributions -## 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 -process restarted. - -``` -gopher stream tcp nowait nobody /usr/sbin/gophernicus gophernicus -h -``` - -The Makefile will automatically do this for you and remove it when -uninstalling. - - -## Compiling on Debian Linux (and Ubuntu) - -The above commands work on Debian just fine, but if you prefer -having everything installed as packages run `make deb` instead -of plain `make`. If all the dependencies were in place you'll -end up with an offical-looking deb package in the parent -directory (don't ask - that's just how it works). And instead -of `sudo make install` you should just install the deb with -`dpkg -i ../gophernicus_*.deb` after which It Should Just -Work(tm). - -If you need TCP wrappers support on Debian/Ubuntu, please -install libwrap0-dev before compiling. +### Debian (and -based) (including Ubuntu) distributions +We used to distribute a `debian/` directory for people to `make +deb` and then install a deb. However, thanks to the work of +Ryan Kavanagh, gophernicus will be distributed in the official +debian repositories in the next stable release! In the interim, +either keep using the old version or install without deb. ## Cross-compiling @@ -137,7 +81,9 @@ must point to a local arch compiler, and CC to the target arch one. ``` -$ make HOSTCC=gcc CC=target-arch-gcc +$ export HOSTCC=gcc CC=target-arch-gcc +$ ./configure .... +$ make ``` ## Shared memory issues @@ -157,7 +103,6 @@ let Gophernicus recreate it - no harm done: $ sudo make clean-shm ``` - ## Porting to different platforms If you need to port Gophernicus to a new platform, please take a look at @@ -168,17 +113,15 @@ the patches to so we can include them into the next release -- or even better, commit them to your fork on Github and make a pull request! -## Supported Platforms +## For packagers -| Platform | Versions | -| ------------ | ---------------------------- | -| Ubuntu | 18.04, 16.04 | -| Debian | Sid, Buster, Stretch, Jessie | -| Centos | 7, 6 | -| Fedora | 29, 30, Rawhide | -| Opensuse | Leap, Tumbleweed | -| Arch Linux | up to date | -| Gentoo | up to date | -| Alpine Linux | Edge, 3.9 | -| FreeBSD | 12.0 | -| Darwin (Mac) | OSX 10.7 | +Are you looking to package gophernicus for a Linux +distribution? Thanks! Please see issue #50 to help. Some tips: + +- Hostnames will need to be configured by users at runtime, the + installed gophernicus.env will need to be a config file. +- You probably want to support as many listeners as possible. + We allow this through the use of a comma seperated list to + `--listener`. +- The default gopher root is `/var/gopher`; many disributions + prefer `/srv`. diff --git a/Makefile.in b/Makefile.in index 00b807b..134f58e 100644 --- a/Makefile.in +++ b/Makefile.in @@ -26,15 +26,15 @@ OSXROOT = /Library/GopherServer INETD = @INETD_CONF@ XINETD = @XINETD_CONF@ # get OPTIONS line from gophernicus.env and use that also for inetd -INETOPT = $$(grep '^OPTIONS=' $(NAME).env | tail -n 1 | sed -e 's/OPTIONS="*//;s/"*$$//') +INETOPT = $$(grep '^OPTIONS=' init/$(NAME).env | tail -n 1 | sed -e 's/OPTIONS="*//;s/"*$$//') LAUNCHD = @LAUNCHD@ PLIST = org.$(NAME).server.plist HAIKU_SRV = @HAIKUSRV@ DEFAULT = @DEFAULT@ SYSCONF = @SYSCONF@ -HOSTNAME = @HOSTNAME@ CC ?= @CC@ +HOSTCC ?= @HOSTCC@ CFLAGS := -O2 -Wall @LIBWRAP@ $(CFLAGS) LDFLAGS := $(LDFLAGS) @@ -59,7 +59,7 @@ src/filetypes.h: src/filetypes.conf sh src/filetypes.sh < src/filetypes.conf > $@ src/bin2c: src/bin2c.c - $(CC) src/bin2c.c -o $@ + $(HOSTCC) src/bin2c.c -o $@ src/files.h: src/bin2c sed -e '/^(end of option list)/,$$d' README.md > README.options @@ -101,18 +101,18 @@ install-inetd-update: install-root update-inetd --add $$(sed -e "s/@BINARY_PATH@/$(DESTDIR)$(SBINDIR)$(BINARY)/g" -e "s/@BINARY_NAME@/$(BINARY)/g" -e "s/@OPTIONS@/$(INETOPT)/g" init/inetlin.in) install-inetd-manual: install-root - sed -e "s/@BINARY_PATH@/$(DESTDIR)$(SBINDIR)$(BINARY)/g" -e "s/@BINARY_NAME@/$(BINARY)/g" -e "s/@OPTIONS@/$(INETOPT)/g" init/inetlin.in > $(DESTDIR)$(INETD) + sed -e "s:@BINARY_PATH@:$(DESTDIR)$(SBINDIR)/$(BINARY):g" -e "s/@BINARY_NAME@/$(BINARY)/g" -e "s/@OPTIONS@/$(INETOPT)/g" init/inetlin.in >> $(DESTDIR)$(INETD) install-xinetd: install-root - sed -e "s/@HOSTNAME@/$(HOSTNAME)/g" init/$(NAME).xinetd.in > $(DESTDIR)$(XINETD)/$(NAME) + $(INSTALL) -T -m 644 init/$(NAME).xinetd $(DESTDIR)$(XINETD) install-osx: install-root - sed -e "s/@HOSTNAME@/$(HOSTNAME)/g" init/$(PLIST).in > $(DESTDIR)$(LAUNCHD)/$(PLIST) + $(INSTALL) -m 644 init/$(PLIST) $(DESTDIR)$(LAUNCHD) chown -h root:admin $(DESTDIR)$(ROOT) $(DESTDIR)$(ROOT)/* chmod -h 0775 $(DESTDIR)$(ROOT) $(DESTDIR)$(ROOT)/docs install-haiku: install-root - sed -e "s/@HOSTNAME@/$(HOSTNAME)/g" -e "s/@BINARY@/$(BINARY)/g" init/haiku_snippet.in >> $(DESTDIR)$(HAIKU_SRV) + sed -e "s/@BINARY@/$(BINARY)/g" init/haiku_snippet.in >> $(DESTDIR)$(HAIKU_SRV) chown user:root $(DESTDIR)$(DOCDIR)/* $(DESTDIR)$(SBINDIR)/$(BINARY) $(DESTDIR)$(ROOT)/$(MAP) install-systemd: install-root @@ -121,7 +121,7 @@ install-systemd: install-root uninstall: @UNINSTALL_INETD_UPDATE@ @UNINSTALL_INETD_MANUAL@ @UNINSTALL_XINETD@ @UNINSTALL_OSX@ @UNINSTALL_SYSTEMD@ rm -f $(DESTDIR)$(SBINDIR)/$(BINARY) - rm -f $(DESTDIR)$(MANDEST)/$(MANPAGE) + rm -f $(DESTDIR)$(MAN8DIR)/$(MANPAGE) uninstall-inetd-update: update-inetd --remove "^gopher.*gophernicus" @@ -130,7 +130,7 @@ uninstall-inetd-manual: sed -i '/^gopher/d' $(DESTDIR)$(INETD) uninstall-xinetd: - rm -f $(DESTDIR)$(XINETD)/gopher + rm -f $(DESTDIR)$(XINETD) uninstall-osx: rm -f $(DESTDIR)$(LAUNCHD)/$(PLIST) diff --git a/configure b/configure index 03a55ba..21f29fb 100755 --- a/configure +++ b/configure @@ -15,7 +15,7 @@ usage() { printf " --launchd=/Library/LaunchDaemons Path to launchd for MacOS\\n" printf " --haikusrv=/boot/common/settings/network/services Path to services directory in Haiku\\n\\n" printf " --os=autodetected Your target OS, one of linux, mac, haiku, netbsd, openbsd or freebsd\\n" - printf " --listener=autodetected Program to recieve and pass network requests; one or more of systemd, inetd, xinetd, comma-seperated, or autodetect, mac or haiku (parameter required, mac/haiku required on respective OSes)\\n" + printf " --listener=somelistener Program to recieve and pass network requests; one or more of systemd, inetd, xinetd, comma-seperated, or autodetect, mac or haiku (parameter required, mac/haiku required on respective OSes)\\n" printf " --hostname=autodetected Desired hostname for gophernicus to identify as\\n" } @@ -57,6 +57,7 @@ done : ${LAUNCHD:=/Library/LaunchDaemons} : ${HAIKUSRV:=/boot/common/settings/network/services} : ${CC:=cc} +: ${HOSTCC:=${CC}} : ${CFLAGS:=-O2} : ${HOSTNAME:=autodetect} @@ -74,7 +75,7 @@ else fi # Autodetect the OS -if ! [ "${OS:=1}" ]; then +if [ -z "${OS}" ]; then # If it can't find uname, it needs to be manually specified printf "checking for uname... " if ! UNAME="$(command -v uname)"; then @@ -110,102 +111,105 @@ else fi printf "\\n" -# Check for listener validity and autodetect if required -# Checks that take place: -# mac OS = mac listener (both ways) -# haiku OS = haiku listener (both ways) -# systemd listener = linux OS -printf "checking for listener... " -if [ -z "${LISTENER}" ]; then - printf "not given\\n" - exit 1 -elif [ "${LISTENER}" = "mac" ] && [ "${OS}" != "mac" ]; then - printf "mac listener only valid with macos\\n" - exit 1 -elif [ "${LISTENER}" = "haiku" ] && [ "${OS}" != "haiku" ]; then - printf "haiku listener only valid with haiku\\n" - exit 1 -elif [ "${LISTENER}" = "systemd" ] && [ "${OS}" != "linux" ]; then - printf "systemd listener only valid with linux\\n" - exit 1 -elif [ "${LISTENER}" = "autodetect" ]; then - # OS-specific listeners - case "${OS}" in - mac) - LISTENER=mac - printf "mac\\n" - break ;; - haiku) - LISTENER=haiku - printf "haiku\\n" - break ;; - esac - - if [ -d "/lib/systemd/system" ] ; then - LISTENER=systemd - printf "systemd\\n" - break - fi - - printf "checking for inetd... " - if command -v update-inetd; then - LISTENER=inetd - printf "inetd\\n" - break - fi - - printf "checking for xinetd... " - if XINETD="$(command -v xinetd)"; then - LISTENER=xinetd - printf "xinetd\\n" - break - fi - - # Ensure we detected something - if [ "${LISTENER}" = "autodetect" ]; then - printf "unable to autodetect, please manually specify\\n" +listeners="$(echo ${LISTENER} | tr ',' ' ')" +for listener in ${listeners}; do + # Check for listener validity and autodetect if required + # Checks that take place: + # mac OS = mac listener (both ways) + # haiku OS = haiku listener (both ways) + # systemd listener = linux OS + printf "checking for listener... " + if [ -z "${listener}" ]; then + printf "not given\\n" exit 1 - fi -elif [ "${OS}" = "haiku" ] && [ "${LISTENER}" != "haiku" ]; then - printf "only haiku listener supported on haiku\\n" - exit 1 -elif [ "${OS}" = "mac" ] && [ "${LISTENER}" != "mac" ]; then - printf "only mac listener supported on mac\\n" - exit 1 -else - printf "%s\\n" "${LISTENER}" -fi + elif [ "${listener}" = "mac" ] && [ "${OS}" != "mac" ]; then + printf "mac listener only valid with macos\\n" + exit 1 + elif [ "${listener}" = "haiku" ] && [ "${OS}" != "haiku" ]; then + printf "haiku listener only valid with haiku\\n" + exit 1 + elif [ "${listener}" = "systemd" ] && [ "${OS}" != "linux" ]; then + printf "systemd listener only valid with linux\\n" + exit 1 + elif [ "${listener}" = "autodetect" ]; then + # OS-specific listeners + case "${OS}" in + mac) + LISTENER=mac + printf "mac\\n" + break ;; + haiku) + LISTENER=haiku + printf "haiku\\n" + break ;; + esac -# Act accordingly based on whichever listener we are given -case "${LISTENER}" in - systemd) - INSTALL_SYSTEMD="install-systemd" - UNINSTALL_SYSTEMD="uninstall-systemd" ;; - xinetd) - INSTALL_XINETD="install-xinetd" - UNINSTALL_XINETD="uninstall-xinetd" - XINETD_CONF="/etc/xinetd.d/gophernicus" ;; - inetd) - INSTALL_INETD="install-inetd" - INETD_CONF="/etc/inetd.conf" - printf "checking for update-inetd... " - if ! UPDATE_INETD="$(command -v update-inetd)"; then - printf "not found\\n" - INSTALL_INETD_MANUAL="install-inetd-manual" - UNINSTALL_INETD_UPDATE="uninstall-inetd-update" - else - printf "%s\\n" "${UPDATE_INETD}" - INSTALL_INETD_UPDATE="install-inetd-update" - UNINSTALL_INETD_UPDATE="uninstall-inetd-update" + if [ -d "/lib/systemd/system" ] ; then + LISTENER=systemd + printf "systemd\\n" + break fi - ;; - mac) INSTALL_OSX="install-osx" UNINSTALL_OSX="uninstall-osx" ;; - haiku) INSTALL_HAIKU="install-haiku" UNINSTALL_HAIKU="uninstall-haiku" ;; - *) printf "The listener %s is not offically supported; continuing anyway.\\n" "${LISTENER}" ;; -esac + + printf "checking for inetd... " + if command -v update-inetd; then + LISTENER=inetd + printf "inetd\\n" + break + fi + + printf "checking for xinetd... " + if XINETD="$(command -v xinetd)"; then + LISTENER=xinetd + printf "xinetd\\n" + break + fi + + # Ensure we detected something + if [ "${listener}" = "autodetect" ]; then + printf "unable to autodetect, please manually specify\\n" + exit 1 + fi + elif [ "${OS}" = "haiku" ] && [ "${listener}" != "haiku" ]; then + printf "only haiku listener supported on haiku\\n" + exit 1 + elif [ "${OS}" = "mac" ] && [ "${listener}" != "mac" ]; then + printf "only mac listener supported on mac\\n" + exit 1 + else + printf "%s\\n" "${listener}" + fi + + # Act accordingly based on whichever listener we are given + case "${listener}" in + systemd) + INSTALL_SYSTEMD="install-systemd" + UNINSTALL_SYSTEMD="uninstall-systemd" ;; + xinetd) + INSTALL_XINETD="install-xinetd" + UNINSTALL_XINETD="uninstall-xinetd" + XINETD_CONF="/etc/xinetd.d/gophernicus" ;; + inetd) + INSTALL_INETD="install-inetd" + INETD_CONF="/etc/inetd.conf" + printf "checking for update-inetd... " + if ! UPDATE_INETD="$(command -v update-inetd)"; then + printf "not found\\n" + INSTALL_INETD_MANUAL="install-inetd-manual" + UNINSTALL_INETD_UPDATE="uninstall-inetd-manual" + else + printf "%s\\n" "${UPDATE_INETD}" + INSTALL_INETD_UPDATE="install-inetd-update" + UNINSTALL_INETD_UPDATE="uninstall-inetd-update" + fi + ;; + mac) INSTALL_OSX="install-osx" UNINSTALL_OSX="uninstall-osx" ;; + haiku) INSTALL_HAIKU="install-haiku" UNINSTALL_HAIKU="uninstall-haiku" ;; + *) printf "The listener %s is not offically supported; continuing anyway.\\n" "${listener}" ;; + esac +done # Try to detect hostname -printf "getting hostname... " +printf "checking current hostname... " if [ "${HOSTNAME}" = "autodetect" ]; then HOSTNAME="$(hostname)" # If no hostname then we couldn't autodetect @@ -266,6 +270,7 @@ cp Makefile.in Makefile printf "creating Makefile... " sed -i "s:@CC@:${CC}:" Makefile +sed -i "s:@HOSTCC@:${HOSTCC}:" Makefile sed -i "s:@LIBWRAP@:${LIBWRAP}:" Makefile sed -i "s:@INSTALL@:${INSTALL}:" Makefile sed -i "s:@MAKE@:${MAKE}:" Makefile @@ -304,7 +309,17 @@ sed -i "s:@UNINSTALL_HAIKU@:${UNINSTALL_HAIKU}:" Makefile sed -i "s:@INETD_CONF@:${INETD_CONF}:" Makefile sed -i "s:@XINETD_CONF@:${XINETD_CONF}:" Makefile + printf "done\\n" +# Also sub in $HOSTNAME to the various init systems (whether or not we really +# use them, its just easier) +for f in gophernicus.env haiku_snippet org.gophernicus.server.plist \ + gophernicus.xinetd; do + printf "creating init/${f}... " + sed -e "s:@HOSTNAME@:${HOSTNAME}:" "init/${f}.in" > "init/${f}" + printf "done\\n" +done + # Cleanup rm -f conftest conftest.c diff --git a/debian/changelog b/debian/changelog deleted file mode 100644 index d46606c..0000000 --- a/debian/changelog +++ /dev/null @@ -1,89 +0,0 @@ -gophernicus (3.1-1) experimental; urgency=medium - - * .gitignore for restructure - * src/bin2c.c should not be executable - * corrected some typos in author's names (#55) - * Merge pull request #54 from emilengler/2020-01-make-force-symlink - * build: macOS travis fix - * build: Force create symlink - * Merge pull request #52 from emilengler/2020-01-new-travis - * ci: New Travis system for linux and macOS builds and installs - * Merge pull request #51 from emilengler/2020-01-refactor-hierarchy - * refactor: New hierarchy and refactored Makefile - * re-add travis - * use user-defined CC by default - * update development version to 3.1; next release will be 3.1 - * gophermap -> gophermap.sample debian - * Merge pull request #47 from tallship/patch-1 - * Update gophernicus.1.man - * gophermap -> gophermap.sample, be more descriptive with the name - * add manpage - * clean up Makefile - * add -b option to git clone instead of git checkout - * add fakeroot as dependency for dpkg - * changelog update, todo makefile fix - * Merge pull request #44 from tallship/patch-1 - * Update README.md - * remove TODO - * Merge pull request #17 from vext01/pledge-unveil - * Add OpenBSD pledge(2) and unveil(2) support. - * utf-8 default charset in readme.md - * update changelog - * Merge pull request #40 from fosslinux/utf8-charset - * change default charset to utf-8 - * change max-width to 67 (#39) - * change indentation from tabs to spaces - * fix copyright - * update copyright in README.md - * Update INSTALL.md - * No longer relevant - * remove <>, was screwing up email - * remove obselete .travis.yml - * Update LICENSE - * forgot to change makefile - * Merge pull request #36 from gophernicus/3.0.1 - - -- gophernicus developers Mon, 31 Dec 9999 11:59:59 +0000 - -gophernicus (3.0.1-1) unstable; urgency=medium - - * add installation notes to git checkout before installing - * fix typo in debian packaging (fixes `make deb`) - * update docs to reflect new changes - * fix indenting and typos in docs - - -- gophernicus developers Sun, 21 Jul 2019 18:36:08 +1000 - -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/compat b/debian/compat deleted file mode 100644 index f599e28..0000000 --- a/debian/compat +++ /dev/null @@ -1 +0,0 @@ -10 diff --git a/debian/control b/debian/control deleted file mode 100644 index 84fce6c..0000000 --- a/debian/control +++ /dev/null @@ -1,16 +0,0 @@ -Source: gophernicus -Section: net -Priority: extra -Maintainer: gophernicus developers -Build-Depends: debhelper (>= 5), libwrap0-dev -Standards-Version: 3.7.3 -Homepage: https://github.com/gophernicus/gophernicus - -Package: gophernicus -Architecture: any -Depends: ${shlibs:Depends}, debconf, netbase, libwrap0, openbsd-inetd | inet-superserver | systemd -Recommends: lsb-release -Suggests: php5-cli -Description: Modern full-featured gopher server - Gophernicus is a modern full-featured (and hopefully) secure - gopher daemon. diff --git a/debian/copyright b/debian/copyright deleted file mode 100644 index 096df79..0000000 --- a/debian/copyright +++ /dev/null @@ -1,23 +0,0 @@ -Gophernicus - Copyright (c) 2009-2018 Kim Holviala - 2019 gophernicus developers -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 - notice, this list of conditions and the following disclaimer. - * 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 -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - diff --git a/debian/dirs b/debian/dirs deleted file mode 100644 index 6dc0f4e..0000000 --- a/debian/dirs +++ /dev/null @@ -1,5 +0,0 @@ -usr/sbin -var/gopher -var/log/gophernicus -usr/lib/gophernicus/filters -lib/systemd/system diff --git a/debian/docs b/debian/docs deleted file mode 100644 index a470771..0000000 --- a/debian/docs +++ /dev/null @@ -1,4 +0,0 @@ -gophernicus.1 -README.gophermap -changelog -gophertag diff --git a/debian/gophernicus.config b/debian/gophernicus.config deleted file mode 100755 index 1332353..0000000 --- a/debian/gophernicus.config +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh - -# Source debconf library -. /usr/share/debconf/confmodule - -# Ask for a hostname -db_input high gophernicus/fqdn || true -db_go - -# Clear old config on reconfigure -if [ "$1" = "reconfigure" -a -x /usr/sbin/update-inetd ]; then - /usr/sbin/update-inetd --remove "## gopher" -fi - diff --git a/debian/gophernicus.default b/debian/gophernicus.default deleted file mode 100644 index c06f426..0000000 --- a/debian/gophernicus.default +++ /dev/null @@ -1,13 +0,0 @@ -# Options for Gophernicus for use with systemd -# -# 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 "gophernicus -?" to see a full list of -# configuration options. -# -# Example: -# OPTIONS="-h full.hostname -D \"I find your lack of gopher disturbing.\"" -# -# Add your options here: -OPTIONS="-h __HOSTNAME__ -l __LOGDIR__/server.log -f /usr/lib/__PACKAGE__/filters" diff --git a/debian/gophernicus.logcheck.ignore.server b/debian/gophernicus.logcheck.ignore.server deleted file mode 100644 index 5675585..0000000 --- a/debian/gophernicus.logcheck.ignore.server +++ /dev/null @@ -1,4 +0,0 @@ -^\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/gophernicus.logrotate b/debian/gophernicus.logrotate deleted file mode 100644 index d8bde2a..0000000 --- a/debian/gophernicus.logrotate +++ /dev/null @@ -1,7 +0,0 @@ -/var/log/gophernicus/server.log { - rotate 6 - weekly - compress - missingok - notifempty -} diff --git a/debian/gophernicus.templates b/debian/gophernicus.templates deleted file mode 100644 index 3a550ca..0000000 --- a/debian/gophernicus.templates +++ /dev/null @@ -1,4 +0,0 @@ -Template: gophernicus/fqdn -Type: string -Default: -Description: Fully-qualified hostname for the gopher server: diff --git a/debian/postinst b/debian/postinst deleted file mode 100644 index 3d83d23..0000000 --- a/debian/postinst +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/sh - -#DEBHELPER# - -# Source debconf library. -. /usr/share/debconf/confmodule - -# Configuration -HOSTNAME="$(hostname)" -ROOT=/var/gopher -PACKAGE=gophernicus -LOGDIR=/var/log/$PACKAGE -LIBDIR=/usr/lib/$PACKAGE -BINARY=gophernicus -DEFAULT=/etc/default/$PACKAGE -USER=nobody - -# Get hostname from debconf -db_get gophernicus/fqdn -if [ "$RET" ]; then - HOSTNAME="$(echo $RET | tr -cd 'A-Za-z0-9.-')" -fi - -# Configure gophernicus -if [ "$1" = "configure" ]; then - if [ ! -f "$ROOT/gophermap" ]; then - cp $LIBDIR/gophermap.sample $ROOT/gophermap - fi - - chown $USER.adm $LOGDIR - chmod 0750 $LOGDIR - - sed -i -e "s|-h [^ ]* |-h $HOSTNAME |" $DEFAULT - sed -i -e "s|__PACKAGE__|$PACKAGE|g" $DEFAULT - sed -i -e "s|__LOGDIR__|$LOGDIR|g" $DEFAULT - - if [ -x /usr/bin/deb-systemd-helper -a -d /run/systemd/system ]; then - /usr/bin/deb-systemd-helper enable gophernicus.socket - /usr/bin/deb-systemd-invoke start gophernicus.socket - else - if [ -f /etc/inetd.conf -a -x /usr/sbin/update-inetd ]; then - /usr/sbin/update-inetd --add "gopher\t\tstream\ttcp\tnowait\t$USER\t/usr/sbin/$BINARY\t$BINARY -h $HOSTNAME -l $LOGDIR/server.log -f /usr/lib/$PACKAGE/filters" - fi - fi -fi - diff --git a/debian/postrm b/debian/postrm deleted file mode 100644 index f6bfaa0..0000000 --- a/debian/postrm +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh - -if [ "$1" = "purge" -a -f /etc/inetd.conf -a -x /usr/sbin/update-inetd ]; then - /usr/sbin/update-inetd --remove "## gopher" -fi - -if [ -d /run/systemd/system ]; then - systemctl --system daemon-reload >/dev/null || true -fi - -#DEBHELPER# diff --git a/debian/prerm b/debian/prerm deleted file mode 100644 index 1035cd9..0000000 --- a/debian/prerm +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -if [ -f /etc/inetd.conf -a -x /usr/sbin/update-inetd ]; then - /usr/sbin/update-inetd --disable gopher -fi - -if [ -x /usr/bin/deb-systemd-helper ]; then - /usr/bin/deb-systemd-helper disable gophernicus.socket >/dev/null -fi - -#DEBHELPER# - diff --git a/debian/rules b/debian/rules deleted file mode 100755 index c71b1d9..0000000 --- a/debian/rules +++ /dev/null @@ -1,85 +0,0 @@ -#!/usr/bin/make -f -# -*- makefile -*- -# Gophernicus debian/rules that uses debhelper. -# This file was originally written by Joey Hess and Craig Small. -# As a special exception, when this file is copied by dh-make into a -# dh-make output file, you may use that output file without restriction. -# This special exception was added by Craig Small in version 0.37 of dh-make. - -# Uncomment this to turn on verbose mode. -#export DH_VERBOSE=1 - -# Installation directory -DEST=$(CURDIR)/debian/gophernicus - -configure: - -build: build-stamp - -build-stamp: - dh_testdir - - $(MAKE) - - touch $@ - -clean: - dh_testdir - dh_testroot - rm -f build-stamp - - $(MAKE) clean-build - - dh_clean - -install: build - dh_testdir - dh_testroot - dh_clean -k - dh_installdirs - - # Add here commands to install the package into debian/gophernicus - $(MAKE) DESTDIR=$(DEST)/usr install-files - rm -rf $(DEST)/tmp - ln -s /usr/share/doc/gophernicus/ $(DEST)/var/gopher/docs - ln -s /usr/bin/php5 $(DEST)/usr/lib/gophernicus/filters/php - cp $(CURDIR)/gophermap.sample $(DEST)/usr/lib/gophernicus/gophermap - cp $(CURDIR)/init/gophernicus.socket $(CURDIR)/init/gophernicus@.service $(DEST)/lib/systemd/system/ - -# Build architecture-independent files here. -binary-indep: build install -# We have nothing to do by default. - -# Build architecture-dependent files here. -binary-arch: build install - dh_testdir - dh_testroot - dh_installchangelogs changelog - dh_installdocs -# dh_install -# dh_installmenu - dh_installdebconf - dh_installlogrotate - dh_installlogcheck -# dh_installemacsen -# dh_installpam -# dh_installmime -# dh_python - dh_installinit -# dh_installcron -# dh_installinfo -# dh_installman - dh_link - dh_strip - dh_compress - dh_fixperms -# dh_perl -# dh_makeshlibs - dh_installdeb - dh_shlibdeps - dh_gencontrol - dh_md5sums - dh_builddeb - -binary: binary-indep binary-arch -.PHONY: build clean binary-indep binary-arch binary install configure diff --git a/debian/source/format b/debian/source/format deleted file mode 100644 index d3827e7..0000000 --- a/debian/source/format +++ /dev/null @@ -1 +0,0 @@ -1.0 diff --git a/init/.gitignore b/init/.gitignore index 882a402..4fc3d36 100644 --- a/init/.gitignore +++ b/init/.gitignore @@ -2,3 +2,4 @@ haiku_snippet org.gophernicus.server.plist gophernicus.xinetd inetlin +gophernicus.env diff --git a/init/gophernicus.env b/init/gophernicus.env index 89aefd0..33c6b7d 100644 --- a/init/gophernicus.env +++ b/init/gophernicus.env @@ -7,4 +7,4 @@ # OPTIONS="-h full.hostname -D \"I find your lack of gopher disturbing.\"" # # modify and set your options here: -OPTIONS="-h localhost -nv" +OPTIONS="-h beast -nv" diff --git a/init/gophernicus.env.in b/init/gophernicus.env.in new file mode 100644 index 0000000..7fd4361 --- /dev/null +++ b/init/gophernicus.env.in @@ -0,0 +1,10 @@ +# Options for Gophernicus +# +# See README or run "gophernicus -?" to see a full list of +# configuration options. +# +# Example: +# OPTIONS="-h full.hostname -D \"I find your lack of gopher disturbing.\"" +# +# modify and set your options here: +OPTIONS="-h @HOSTNAME@ -nv"