{"id":19892146,"url":"https://github.com/maxpert/crankshaft","last_synced_at":"2026-07-17T07:37:04.864Z","repository":{"id":66864051,"uuid":"236426449","full_name":"maxpert/crankshaft","owner":"maxpert","description":"An pluggable go web server","archived":false,"fork":false,"pushed_at":"2020-01-27T05:43:57.000Z","size":12,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-24T11:58:20.074Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/maxpert.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-01-27T05:37:32.000Z","updated_at":"2022-09-12T00:53:03.000Z","dependencies_parsed_at":"2023-07-24T18:00:18.978Z","dependency_job_id":null,"html_url":"https://github.com/maxpert/crankshaft","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/maxpert/crankshaft","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxpert%2Fcrankshaft","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxpert%2Fcrankshaft/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxpert%2Fcrankshaft/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxpert%2Fcrankshaft/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maxpert","download_url":"https://codeload.github.com/maxpert/crankshaft/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxpert%2Fcrankshaft/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280791362,"owners_count":26391692,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-24T02:00:06.418Z","response_time":73,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-12T18:21:44.602Z","updated_at":"2025-10-24T11:58:20.757Z","avatar_url":"https://github.com/maxpert.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"**NOTE**: The project is in a proof of concept stage yet. Please do not use it in your production.\n\n# What is Crankshaft?\n\nCrankshaft is a barebone go web-server inspired by [unix philosophy](https://en.wikipedia.org/wiki/Unix_philosophy). \nIt allows handling requests by chaining interceptors (sometimes referred ad middleware). \nThese interceptors are golang [plugins](https://golang.org/pkg/plugin/) with one unified interface, \nthat can be loaded and plugged into different routes. \nThese plugged in interceptors along the request pipeline can then decide to handle the request, and \nbreak the chain or hand it over to next interceptor (may be modifying/adding stuff request/response).\n\n## Philosophy\n\nDynamic modules is not a new concept and has been practiced for years in traditional web servers. In modern times Go \ndue to it's efficiency and stability has been used by various projects to develop gateways/sidecars/web servers. Due\nto single binary philosophy initially these projects provided no mechanism (except some scripting language) to extend\nor provide interceptions, until recently. While these gateways are loaded with many pre-built interceptors/middleware \nto mold and modify request along the pipeline, crankshaft does the exact opposite. Crankshaft come with nothing builtin.\nEverything has to be an interceptor, and interceptor in turn can be actually responding to request or chaining the \nrequest forward. \n\n## Why?\n\n**In essence crankshaft is created to conceive unix philosophy interceptor plugins that can be chained**. This allows\ncomposing complex request handling pipelines with simple, and clean chains.  \n\nCrankshaft wants to take first principle approach on building a customizable gateway, writing minimal core will make \nit extremely testable, and stable. Due to intuitive nature and low friction writing interceptor plugin should be \nextremely easy. As an example; serving static file is not built-in to the server, a plugin `static_content`. Similarly\nfor path prefix stripping there is plugin `strip_path`. This should make it extremely simple to write plugins for\ninstrumentation, tracing, logging, authentication etc. \n\n# Show me some interceptor code\n\nInterceptor in a plugin is a dead simple function that takes configuration `map[string]interface{}` and returns back\na function and error. Here is a very simple hello world interceptor:\n\n```go\npackage main\n\nimport (\n\"fmt\"\n\"log\"\n\"net/http\"\n)\n\nfunc Create(config map[string]interface{}) (func(http.ResponseWriter, *http.Request, http.HandlerFunc), error) {\n    log.Println(\"Loading Hello World with\", config, \"...\")\n   \n    return func(w http.ResponseWriter, r *http.Request, _ http.HandlerFunc) {\n        fmt.Fprintf(w, \"Greetings %s!\", r.URL.Path[1:])\n    }, nil\n}\n\n``` \n\nCompiling the plugin should be as simple as:\n\n```\ngo build -buildmode=plugin\n```\n\nFor loading `plugins.yml` will look something like this:\n```yaml\nhello_world: bin/modules/hello_world.so\n```\n\nThen define a chain invoking the plugin `chains.yaml`:\n```yaml\n- chain: hello_chain\n  of:\n    - plugin: hello_world\n      config: {}\n```\n\nFinally plug this chain into router `routes.yaml`:\n```yaml\n- path: /\n  invoke: hello_chain\n```\n\nNow running crankshaft `bin/crankshaft -chains chains.yaml -plugins plugins.yaml -routes routes.yaml` should\nbring up a server, and hitting `http://localhost:6060/crankshaft` will return `Greetings crankshaft!`. \n\n# Yet to implement\n\n- [X] Proof-of-concept base server\n- [ ] Test case coverage\n- [ ] Zero downtime, hot reload\n- [X] `static_content` plugin\n- [X] `strip_path` plugin\n- [X] `reverse_proxy` plugin\n- [ ] Github hooks\n- [ ] `markdown_server` plugin\n- [ ] `fast_cgi` plugin\n- [ ] Logging story\n- [ ] Documentation \n- [ ] TLS + HTTP2 support (partially present)\n- [ ] Control pane\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxpert%2Fcrankshaft","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaxpert%2Fcrankshaft","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxpert%2Fcrankshaft/lists"}