GithubHelp home page GithubHelp logo

pinpox / gopherlix Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 132 KB

A Server for the Gopher protocol written in Go

Home Page: https://pablo.tools

License: GNU General Public License v3.0

Go 100.00%
gopher-server gopher-protocol gopher golang go server

gopherlix's Introduction

Build Status GoDoc Go Report Card codecov

gopherlix

A Server for the Gopher protocol, written in the Go.

Usage

Quickstart

Installation

Just clone the repository and run go build in it.

git clone https://github.com/binaryplease/gopherlix.git
cd gopherlix
go build

Basic configuration

[paths]
content = "data/content"
templates = "data/templates"

[server]
port = "8000"
domain = "localhost"
host = "0.0.0.0"

The configuration file (config.ini) should be self explanatory. The server includes some sample pages and should run with it out of the box on port 8000. You may want to change the port to gophers default port 70

Run the server

Gopherlix will look for the configuration file in the same folder as the server per defalt.

To start it just run ./gopherlix and start browsing goopher://localhost:8000

Features

Adding content

You can add content in the content directory configured in config.ini. The templates directory includes templates that can be rendered in inside other files. The header.gph and footer.gph will be added automatically to all pages.

Directory listings

A request like gopher://localhost/something will look for data/content/something and check if it's a file or a directory. For a file, the contents of it will be returned. If the requested path is a directory, it will try to find a file called index.gph in it and display it.

If no index.gph is found in this directory, it will generate a listing with links to all the directory contents.

Templating

Gopherlix leverages the power of golangs templates to generate content dynamically. This allows to include ariables in the form of {{.Variablename}} in any page that will be replaced accordingly. At the moment the following variables are suported (more to come in future updates):

Variable Description
{{.Directory}} Path of the current request
{{.ServerName}} Shows the server's domain name

Contributing

Pull-request, issues, feature-requst and contributions of any kind are very welcome!

gopherlix's People

Contributors

pinpox avatar

Stargazers

 avatar

Watchers

 avatar  avatar

gopherlix's Issues

Selector buffer overflow crashes server

Overflowing the selector buffer crashes the server.

Reproduction

echo /w7qOCJ5yy5UWWnumh6QTxNsb7jXlCeLn5NPNMFN3LwpQcJYt2ykZl32Fp51yKWt3gT65ocP82hyxG4EToglkN7Bgn3cpeNp8xHUmQVXppiYst5wH9WlGA9AAjUZS3G2wegqVdePe5kLt0aDKFK6DM3LBw4CnRPEFwJXZd5D0fUp3pwSWeuOAhAVyASpGdKr6o7Ubmukca9T6e3JNEhDi6S1IfNh22aB33fxzfoZqployRkwuxny3xFvzzbA9ZzEO1kVHM23j5TpXFYyOYDDYhwIYhqXSQErHgGCyuvAFP4w2pRxMSXIqEduXRi5raB37al75ynnehK6TRMzyZitHNqsViMC6YwwnBSjpuTg4JEdvFm6GRKqbd2TSVGUMNhUzcZjs6VcI0CdNkacoyLKOqKv7SsMOf3pgrzOFzhhQFHJMOdierycUdO0nrVWx8sjGreeGmr7rsmcX3QQJm70C5jj47qzOxVQF9DyuExnInMTYONZ03pfTVNgjGyOYO2cavobPxN1ujzp9QClLsVaXcd34a6H2DdTxnr0gD8N6VJUDwtRuqmZc5LnO6HrvrbBjtRAzNOU7Bv3Vjc9lPNceeuo2MC2LTNjStBPdtaJrsffucdtzBduugVhbISevAcsKL0yK4L0QCcU6gxJBFlOHW3zkmSOnEKLRStopTZxqHSLHoqIwKbMwbuIBsZUAUDFpDpYfDoSrQTJNSlKzYrtD3LHqKKg8YSnUHAQMN2N5lMCpInzgt1JM8niGocEe54KWyqEKaldtTYNrnLQ5ptUMTX6XjvPyeKRinLaldBuXslQoc88h44QCKJxWCe8QzDtry9DU59sCUZPtOrRM6bMNgBQWYBkb2kDYPuw4iQEflRZwOhFmSICdOIhZFb9imZ7tpK0QfKGDTKWFSJu1WkT8kLgNfUI90hXhTUcsVi0SyCXu9tluBpjd07fJW9c2TrTufOIrwMKRhIp21CcT9PRC9RdOvsJ9XiG67TuEu5vtLMSPF7vvoW | telnet localhost 8000

The server would subsequently crash.

Unprintable selector causes SIGSEGV

nmap -A-ing the server would crash it.

panic: runtime error: invalid memory address or nil pointer dereference
goroutine 10 [running]:
main.(*GopherServerRoot).DirExists(****)
	****/gopherlix/server_root.go:79

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.