From 8c1905a28755bd11d236fb9b250378068bb7332c Mon Sep 17 00:00:00 2001 From: "kim (grufwub)" Date: Mon, 13 Jul 2020 13:25:45 +0100 Subject: [PATCH] rename the project to gophi! Signed-off-by: kim (grufwub) --- README.md | 9 ++++----- build-all-gopher.sh | 2 +- build-gopher.sh | 2 +- core/cgi.go | 2 +- go.mod | 2 +- gopher/error.go | 2 +- gopher/filecontents.go | 2 +- gopher/format.go | 2 +- gopher/gophermap.go | 2 +- gopher/main.go | 4 ++-- gopher/policy.go | 4 ++-- gopher/regex.go | 2 +- gopher/server.go | 3 +-- main_gopher.go | 2 +- 14 files changed, 19 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index a2f6145..dd78cde 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,9 @@ -# Gophor +# Gophi -A server written in GoLang, with 2 separately supported protocols: +A server with Gopher & Gemini protocol support in GoLang! -- A gopher server, compiled with `build-all-gopher.sh` - -- A gemini server, (not yet implemented) +The two protocols are supported separately, and as such you compile +the server with support for one or the other, not both. Unix (like) OSes only. Cross-compiled to way too many architectures. Build-script now much improved, but still not pretty... diff --git a/build-all-gopher.sh b/build-all-gopher.sh index 1a6a96a..74bfbef 100755 --- a/build-all-gopher.sh +++ b/build-all-gopher.sh @@ -2,7 +2,7 @@ set -e -PROJECT='gophor.gopher' +PROJECT='gophi.gopher' VERSION="$(cat 'core/server.go' | grep -E '^\s*Version' | sed -e 's|\s*Version = \"||' -e 's|\"\s*$||')" LOGFILE='build.log' OUTDIR="build-gopher-${VERSION}" diff --git a/build-gopher.sh b/build-gopher.sh index ca857f4..6aa3896 100755 --- a/build-gopher.sh +++ b/build-gopher.sh @@ -1,3 +1,3 @@ #!/bin/sh -CC='x86_64-linux-musl-gcc' CGO_ENABLED=1 go build -trimpath -buildmode 'pie' -a -tags 'netgo' -ldflags '-s -w -extldflags "-static"' -o gophor.gopher main_gopher.go \ No newline at end of file +CC='x86_64-linux-musl-gcc' CGO_ENABLED=1 go build -trimpath -buildmode 'pie' -a -tags 'netgo' -ldflags '-s -w -extldflags "-static"' -o 'gophi.gopher' main_gopher.go \ No newline at end of file diff --git a/core/cgi.go b/core/cgi.go index 2dd5211..bb8bcb5 100644 --- a/core/cgi.go +++ b/core/cgi.go @@ -31,7 +31,7 @@ func setupInitialCGIEnv(safePath string) []string { SystemLog.Info("CGI safe path: %s", safePath) env = append(env, "GATEWAY_INTERFACE=CGI/1.1") - env = append(env, "SERVER_SOFTWARE=gophor "+Version) + env = append(env, "SERVER_SOFTWARE=Gophi "+Version) env = append(env, "SERVER_PROTOCOL="+protocol) env = append(env, "REQUEST_METHOD=GET") // always GET (in HTTP terms anywho) env = append(env, "CONTENT_LENGTH=0") // always 0 diff --git a/go.mod b/go.mod index 12f7faf..8d985eb 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,3 @@ -module gophor +module gophi go 1.14 diff --git a/gopher/error.go b/gopher/error.go index e7299f8..98160ec 100644 --- a/gopher/error.go +++ b/gopher/error.go @@ -1,6 +1,6 @@ package gopher -import "gophor/core" +import "gophi/core" // Gopher specific error codes const ( diff --git a/gopher/filecontents.go b/gopher/filecontents.go index 5e0ad2b..74cbb62 100644 --- a/gopher/filecontents.go +++ b/gopher/filecontents.go @@ -1,7 +1,7 @@ package gopher import ( - "gophor/core" + "gophi/core" "os" ) diff --git a/gopher/format.go b/gopher/format.go index e18b5ca..d3c3bb3 100644 --- a/gopher/format.go +++ b/gopher/format.go @@ -1,7 +1,7 @@ package gopher import ( - "gophor/core" + "gophi/core" "os" "strings" ) diff --git a/gopher/gophermap.go b/gopher/gophermap.go index e7fb506..82189c4 100644 --- a/gopher/gophermap.go +++ b/gopher/gophermap.go @@ -1,7 +1,7 @@ package gopher import ( - "gophor/core" + "gophi/core" "os" ) diff --git a/gopher/main.go b/gopher/main.go index 231978b..5522aea 100644 --- a/gopher/main.go +++ b/gopher/main.go @@ -2,13 +2,13 @@ package gopher import ( "flag" - "gophor/core" + "gophi/core" ) // setup parses gopher specific flags, and all core flags, preparing server for .Run() func setup() { pWidth := flag.Uint(pageWidthFlagStr, 80, pageWidthDescStr) - footerText := flag.String(footerTextFlagStr, "Gophor, a gopher server in Go!", footerTextDescStr) + footerText := flag.String(footerTextFlagStr, "Gophi, a Gopher server in Go!", footerTextDescStr) subgopherSizeMax := flag.Float64(subgopherSizeMaxFlagStr, 1.0, subgopherSizeMaxDescStr) admin := flag.String(adminFlagStr, "", adminDescStr) desc := flag.String(descFlagStr, "", descDescStr) diff --git a/gopher/policy.go b/gopher/policy.go index 6bac041..e298450 100644 --- a/gopher/policy.go +++ b/gopher/policy.go @@ -1,6 +1,6 @@ package gopher -import "gophor/core" +import "gophi/core" // We make heavy-use of string concat here instead of StringBuilder // as this is performed during the setup phase of the server and therefore @@ -31,7 +31,7 @@ func generateCapsTxt(desc, admin, geo string) []byte { text += "PathEscapeCharacter=\\" + "\r\n" text += "PathKeepPreDelimeter=FALSE" + "\r\n" text += "\r\n" - text += "ServerSoftware=Gophor" + "\r\n" + text += "ServerSoftware=Gophi" + "\r\n" text += "ServerSoftwareVersion=" + core.Version + "\r\n" text += "ServerDescription=" + desc + "\r\n" text += "ServerGeolocationString=" + geo + "\r\n" diff --git a/gopher/regex.go b/gopher/regex.go index 2aa49fd..c1339e9 100644 --- a/gopher/regex.go +++ b/gopher/regex.go @@ -1,7 +1,7 @@ package gopher import ( - "gophor/core" + "gophi/core" "regexp" ) diff --git a/gopher/server.go b/gopher/server.go index 0ebed85..96b7538 100644 --- a/gopher/server.go +++ b/gopher/server.go @@ -1,7 +1,7 @@ package gopher import ( - "gophor/core" + "gophi/core" "os" "strings" ) @@ -50,7 +50,6 @@ func serve(client *core.Client) { if err == nil { stat, osErr := fd2.Stat() if osErr == nil { - core.SystemLog.Info("Returning fetched gophermap") return fs.FetchFile(client, fd2, stat, gophermap, newFileContents) } diff --git a/main_gopher.go b/main_gopher.go index b7713f7..8e00fc4 100644 --- a/main_gopher.go +++ b/main_gopher.go @@ -1,7 +1,7 @@ package main import ( - "gophor/gopher" + "gophi/gopher" ) func main() {