All Projects → unknwon → go-import-server

unknwon / go-import-server

Licence: MIT license
HTTP server for canonical "go get" import path

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to go-import-server

Jarvis
APL-based web service framework supporting JSON or REST
Stars: ✭ 17 (-41.38%)
Mutual labels:  http-server
http4ts
Server as a Function http toolkit for TypeScript & JavaScript
Stars: ✭ 30 (+3.45%)
Mutual labels:  http-server
sheret
A tiny, simple static file web server.
Stars: ✭ 45 (+55.17%)
Mutual labels:  http-server
mirror-http-server
A dummy HTTP server that responds whatever you told it to
Stars: ✭ 35 (+20.69%)
Mutual labels:  http-server
libmicrohttpd-http2
HTTP/2 support for libmicrohttpd
Stars: ✭ 21 (-27.59%)
Mutual labels:  http-server
http-server-pwa
👾 http-server alike but for serving and rendering PWA: pwa-server
Stars: ✭ 14 (-51.72%)
Mutual labels:  http-server
heart
A high performance Lua web server with a simple, powerful API
Stars: ✭ 78 (+168.97%)
Mutual labels:  http-server
yams
YAMS: Awesome MIPS Server
Stars: ✭ 17 (-41.38%)
Mutual labels:  http-server
squilu
A scripting language that accepts a subset of javascript and C/C++
Stars: ✭ 69 (+137.93%)
Mutual labels:  http-server
session
Package session is a middleware that provides the session management of Macaron.
Stars: ✭ 26 (-10.34%)
Mutual labels:  lsif-enabled
Houki
🧹 Customizable MitM proxy / 可定制化的中间人代理
Stars: ✭ 28 (-3.45%)
Mutual labels:  lsif-enabled
quiki
a file-based web engine and server featuring a productive source language, markdown, image generation, categories, templates, and revision tracking
Stars: ✭ 20 (-31.03%)
Mutual labels:  http-server
lighttpd-Link
A lighttpd powered lightweight web server for the Steam Link
Stars: ✭ 21 (-27.59%)
Mutual labels:  http-server
backend-server
📠 The backend of the Fairfield Programming Association website.
Stars: ✭ 26 (-10.34%)
Mutual labels:  http-server
b23.wtf
Remove tracing parameters from b23.tv/*.
Stars: ✭ 85 (+193.1%)
Mutual labels:  http-server
WebServer
High-performance multi-threaded tcp network server in c++11
Stars: ✭ 58 (+100%)
Mutual labels:  http-server
fancy
High performance web server
Stars: ✭ 20 (-31.03%)
Mutual labels:  http-server
aqua
A minimal and fast 🏃 web framework for Deno
Stars: ✭ 219 (+655.17%)
Mutual labels:  http-server
smartacus-mqtt-broker
smartacus-mqtt-broker is a Java-based open source MQTT broker that fully supports MQTT 3.x .Using Netty 4.1.37
Stars: ✭ 25 (-13.79%)
Mutual labels:  http-server
tinyweb
Simple and lightweight HTTP async server for micropython
Stars: ✭ 182 (+527.59%)
Mutual labels:  http-server

go-import-server

HTTP server for canonical "go get" import path. It supports all versions of go get regardless of if it's Go Modules aware.

Installation

Install from source or download binaries on GitHub Releases.

The minimum requirement of Go is 1.16, and 64-bit system is required because of a bug in BadgerDB.

$ go get unknwon.dev/go-import-server

Configuration

Example for this tool itself (save as app.toml):

addr = "127.0.0.1:4333"
db_path = "app.db"

[[packages]]
import_path = "unknwon.dev/go-import-server"
subpath = "/go-import-server"
repo = "https://github.com/unknwon/go-import-server"
branch = "main"

Assuming $GOPATH/bin has been added to your $PATH environment variable.

$ go-import-server -config=./app.toml
YYYY/MM/DD 12:34:56 [ INFO] Listening on http://127.0.0.1:4333...

Reverse proxy and HTTPS

I recommend use Caddy for automatic HTTPS in front of this tool:

# Caddy 1
unknwon.dev {
    proxy / localhost:4333 {
        transparent
    }
}

# Caddy 2
unknwon.dev {
    reverse_proxy * localhost:4333 {
        header_up Host {http.request.host}
        header_up X-Real-IP {http.request.remote}
        header_up X-Forwarded-For {http.request.remote}
        header_up X-Forwarded-Port {http.request.port}
        header_up X-Forwarded-Proto {http.request.scheme}
    }
}

Metrics

This tool exposes Prometheus metrics via endpoint /-/metrics.

You can set HTTP Basic Authentication for this endpoint via your app.toml:

[prometheus]
auth_username = "superuser"
auth_password = "supersecure"

The BadgerDB is used to store total page views and number of go gets.

Here is an example dump:

go_import_server_stats_view_total 20
go_import_server_stats_view_unknwon_dev_go_import_server 20
go_import_server_stats_get_total 16
go_import_server_stats_get_unknwon_dev_go_import_server 16

Development

This project uses the Task as the build tool, it is not required as all the commands are listed in the Taskfile.yml in plaintext.

The source files of templates are located in the templates directory but uses Go embed to embed into the binary. Due to the nature limitation of the Go embed, templates cannot be hot-reloaded after modifications, so the following command needs to be used for re-packing templates and re-compiling the binary:

$ task web --force

Open-source, not open-contribution

Quote from benbjohnson/litestream:

I am grateful for community involvement, bug reports, & feature requests. I do not wish to come off as anything but welcoming, however, I've made the decision to keep this project closed to contributions for my own mental health and long term viability of the project.

License

This project is under MIT License. See the LICENSE file for the full license text.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].