chore: rename project from gosearch to kafka

A search engine named after a man who proved answers don't exist.

Renamed everywhere user-facing:
- Brand name, UI titles, OpenSearch description, CSS filename
- Docker service name, NixOS module (services.kafka)
- Cache key prefix (kafka:), User-Agent strings (kafka/0.1)
- README, config.example.toml, flake.nix descriptions

Kept unchanged (internal):
- Go module path: github.com/ashie/gosearch
- Git repository URL: git.ashisgreat.xyz/penal-colony/gosearch
- Binary entrypoint: cmd/searxng-go
This commit is contained in:
Franz Kafka 2026-03-21 19:20:47 +00:00
parent be7ba66a09
commit e5295fa69d
16 changed files with 55 additions and 55 deletions

View file

@ -11,17 +11,17 @@ RUN go mod download
# Copy source and build # Copy source and build
COPY . . COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o /gosearch ./cmd/searxng-go RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o /kafka ./cmd/searxng-go
# Runtime stage # Runtime stage
FROM alpine:3.21 FROM alpine:3.21
RUN apk add --no-cache ca-certificates tzdata RUN apk add --no-cache ca-certificates tzdata
COPY --from=builder /gosearch /usr/local/bin/gosearch COPY --from=builder /kafka /usr/local/bin/kafka
COPY config.example.toml /etc/gosearch/config.example.toml COPY config.example.toml /etc/kafka/config.example.toml
EXPOSE 8080 EXPOSE 8080
ENTRYPOINT ["gosearch"] ENTRYPOINT ["kafka"]
CMD ["-config", "/etc/gosearch/config.toml"] CMD ["-config", "/etc/kafka/config.toml"]

View file

@ -1,4 +1,4 @@
# gosearch # kafka
A privacy-respecting, open metasearch engine written in Go. SearXNG-compatible API with an HTML frontend, designed to be fast, lightweight, and deployable anywhere. A privacy-respecting, open metasearch engine written in Go. SearXNG-compatible API with an HTML frontend, designed to be fast, lightweight, and deployable anywhere.
@ -12,7 +12,7 @@ A privacy-respecting, open metasearch engine written in Go. SearXNG-compatible A
- **Valkey cache** — optional Redis-compatible caching with configurable TTL - **Valkey cache** — optional Redis-compatible caching with configurable TTL
- **Rate limiting** — three layers: per-IP, burst, and global (all disabled by default) - **Rate limiting** — three layers: per-IP, burst, and global (all disabled by default)
- **CORS** — configurable origins for browser-based clients - **CORS** — configurable origins for browser-based clients
- **OpenSearch** — browsers can add gosearch as a search engine from the address bar - **OpenSearch** — browsers can add kafka as a search engine from the address bar
- **Graceful degradation** — individual engine failures don't kill the whole search - **Graceful degradation** — individual engine failures don't kill the whole search
- **Docker** — multi-stage build, ~20MB runtime image - **Docker** — multi-stage build, ~20MB runtime image
- **NixOS** — native NixOS module with systemd service - **NixOS** — native NixOS module with systemd service
@ -23,7 +23,7 @@ A privacy-respecting, open metasearch engine written in Go. SearXNG-compatible A
```bash ```bash
git clone https://git.ashisgreat.xyz/penal-colony/gosearch.git git clone https://git.ashisgreat.xyz/penal-colony/gosearch.git
cd gosearch cd kafka
go build ./cmd/searxng-go go build ./cmd/searxng-go
./searxng-go -config config.toml ./searxng-go -config config.toml
``` ```
@ -41,28 +41,28 @@ docker compose up -d
Add to your flake inputs: Add to your flake inputs:
```nix ```nix
inputs.gosearch.url = "git+https://git.ashisgreat.xyz/penal-colony/gosearch.git"; inputs.kafka.url = "git+https://git.ashisgreat.xyz/penal-colony/gosearch.git";
``` ```
Enable in your configuration: Enable in your configuration:
```nix ```nix
imports = [ inputs.gosearch.nixosModules.default ]; imports = [ inputs.kafka.nixosModules.default ];
services.gosearch = { services.kafka = {
enable = true; enable = true;
openFirewall = true; openFirewall = true;
baseUrl = "https://search.example.com"; baseUrl = "https://search.example.com";
# config = "/etc/gosearch/config.toml"; # default # config = "/etc/kafka/config.toml"; # default
}; };
``` ```
Write your config: Write your config:
```bash ```bash
sudo mkdir -p /etc/gosearch sudo mkdir -p /etc/kafka
sudo cp config.example.toml /etc/gosearch/config.toml sudo cp config.example.toml /etc/kafka/config.toml
sudo $EDITOR /etc/gosearch/config.toml sudo $EDITOR /etc/kafka/config.toml
``` ```
Deploy: Deploy:

View file

@ -1,4 +1,4 @@
# gosearch configuration # kafka configuration
# Copy to config.toml and adjust as needed. # Copy to config.toml and adjust as needed.
# Environment variables are used as fallbacks when a config field is empty/unset. # Environment variables are used as fallbacks when a config field is empty/unset.
@ -10,7 +10,7 @@ port = 8080
http_timeout = "10s" http_timeout = "10s"
# Public base URL for OpenSearch XML (env: BASE_URL) # Public base URL for OpenSearch XML (env: BASE_URL)
# Set this so browsers can add gosearch as a search engine. # Set this so browsers can add kafka as a search engine.
# Example: "https://search.example.com" # Example: "https://search.example.com"
base_url = "" base_url = ""

View file

@ -1,16 +1,16 @@
# Docker Compose for gosearch + Valkey # Docker Compose for kafka + Valkey
# #
# Usage: # Usage:
# cp config.example.toml config.toml # edit as needed # cp config.example.toml config.toml # edit as needed
# docker compose up -d # docker compose up -d
services: services:
gosearch: kafka:
build: . build: .
ports: ports:
- "8080:8080" - "8080:8080"
volumes: volumes:
- ./config.toml:/etc/gosearch/config.toml:ro - ./config.toml:/etc/kafka/config.toml:ro
depends_on: depends_on:
valkey: valkey:
condition: service_healthy condition: service_healthy

View file

@ -1,5 +1,5 @@
{ {
description = "gosearch privacy-respecting, open metasearch engine"; description = "kafka privacy-respecting, open metasearch engine";
inputs = { inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
@ -17,7 +17,7 @@
in in
{ {
default = pkgs.buildGoModule { default = pkgs.buildGoModule {
pname = "gosearch"; pname = "kafka";
version = "0.1.0"; version = "0.1.0";
src = ./.; src = ./.;
@ -32,7 +32,7 @@
meta = with pkgs.lib; { meta = with pkgs.lib; {
description = "Privacy-respecting, open metasearch engine"; description = "Privacy-respecting, open metasearch engine";
homepage = "https://git.ashisgreat.xyz/penal-colony/gosearch"; homepage = "https://git.ashisgreat.xyz/penal-colony/kafka";
license = licenses.mit; license = licenses.mit;
platforms = platforms.linux ++ platforms.darwin; platforms = platforms.linux ++ platforms.darwin;
}; };
@ -41,16 +41,16 @@
nixosModules.default = { config, lib, pkgs, ... }: nixosModules.default = { config, lib, pkgs, ... }:
let let
cfg = config.services.gosearch; cfg = config.services.kafka;
in in
{ {
options.services.gosearch = { options.services.kafka = {
enable = lib.mkEnableOption "gosearch metasearch engine"; enable = lib.mkEnableOption "kafka metasearch engine";
package = lib.mkOption { package = lib.mkOption {
type = lib.types.package; type = lib.types.package;
default = self.packages.${pkgs.system}.default; default = self.packages.${pkgs.system}.default;
description = "gosearch package to use."; description = "kafka package to use.";
}; };
port = lib.mkOption { port = lib.mkOption {
@ -73,41 +73,41 @@
config = lib.mkOption { config = lib.mkOption {
type = lib.types.path; type = lib.types.path;
default = "/etc/gosearch/config.toml"; default = "/etc/kafka/config.toml";
description = "Path to config.toml file."; description = "Path to config.toml file.";
}; };
user = lib.mkOption { user = lib.mkOption {
type = lib.types.str; type = lib.types.str;
default = "gosearch"; default = "kafka";
description = "System user to run as."; description = "System user to run as.";
}; };
group = lib.mkOption { group = lib.mkOption {
type = lib.types.str; type = lib.types.str;
default = "gosearch"; default = "kafka";
description = "System group to run as."; description = "System group to run as.";
}; };
stateDir = lib.mkOption { stateDir = lib.mkOption {
type = lib.types.path; type = lib.types.path;
default = "/var/lib/gosearch"; default = "/var/lib/kafka";
description = "State directory."; description = "State directory.";
}; };
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
users.users.${cfg.user} = lib.mkIf (cfg.user == "gosearch") { users.users.${cfg.user} = lib.mkIf (cfg.user == "kafka") {
isSystemUser = true; isSystemUser = true;
group = cfg.group; group = cfg.group;
home = cfg.stateDir; home = cfg.stateDir;
createHome = true; createHome = true;
}; };
users.groups.${cfg.group} = lib.mkIf (cfg.group == "gosearch") { }; users.groups.${cfg.group} = lib.mkIf (cfg.group == "kafka") { };
systemd.services.gosearch = { systemd.services.kafka = {
description = "gosearch metasearch engine"; description = "kafka metasearch engine";
after = [ "network.target" ]; after = [ "network.target" ];
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];

View file

@ -81,7 +81,7 @@ func (c *Cache) Get(ctx context.Context, key string) (contracts.SearchResponse,
return contracts.SearchResponse{}, false return contracts.SearchResponse{}, false
} }
fullKey := "gosearch:" + key fullKey := "kafka:" + key
data, err := c.client.Get(ctx, fullKey).Bytes() data, err := c.client.Get(ctx, fullKey).Bytes()
if err != nil { if err != nil {
@ -113,7 +113,7 @@ func (c *Cache) Set(ctx context.Context, key string, resp contracts.SearchRespon
return return
} }
fullKey := "gosearch:" + key fullKey := "kafka:" + key
if err := c.client.Set(ctx, fullKey, data, c.ttl).Err(); err != nil { if err := c.client.Set(ctx, fullKey, data, c.ttl).Err(); err != nil {
c.logger.Warn("cache set failed", "key", fullKey, "error", err) c.logger.Warn("cache set failed", "key", fullKey, "error", err)
} }
@ -124,7 +124,7 @@ func (c *Cache) Invalidate(ctx context.Context, key string) {
if !c.Enabled() { if !c.Enabled() {
return return
} }
fullKey := "gosearch:" + key fullKey := "kafka:" + key
c.client.Del(ctx, fullKey) c.client.Del(ctx, fullKey)
} }

View file

@ -9,7 +9,7 @@ import (
"github.com/BurntSushi/toml" "github.com/BurntSushi/toml"
) )
// Config is the top-level configuration for the gosearch service. // Config is the top-level configuration for the kafka service.
type Config struct { type Config struct {
Server ServerConfig `toml:"server"` Server ServerConfig `toml:"server"`
Upstream UpstreamConfig `toml:"upstream"` Upstream UpstreamConfig `toml:"upstream"`

View file

@ -43,7 +43,7 @@ func (e *BingEngine) Search(ctx context.Context, req contracts.SearchRequest) (c
if err != nil { if err != nil {
return contracts.SearchResponse{}, err return contracts.SearchResponse{}, err
} }
httpReq.Header.Set("User-Agent", "gosearch/0.1 (compatible; +https://git.ashisgreat.xyz/penal-colony/gosearch)") httpReq.Header.Set("User-Agent", "kafka/0.1 (compatible; +https://git.ashisgreat.xyz/penal-colony/gosearch)")
resp, err := e.client.Do(httpReq) resp, err := e.client.Do(httpReq)
if err != nil { if err != nil {

View file

@ -38,7 +38,7 @@ func (e *DuckDuckGoEngine) Search(ctx context.Context, req contracts.SearchReque
if err != nil { if err != nil {
return contracts.SearchResponse{}, err return contracts.SearchResponse{}, err
} }
httpReq.Header.Set("User-Agent", "gosearch/0.1 (compatible; +https://git.ashisgreat.xyz/penal-colony/gosearch)") httpReq.Header.Set("User-Agent", "kafka/0.1 (compatible; +https://git.ashisgreat.xyz/penal-colony/gosearch)")
resp, err := e.client.Do(httpReq) resp, err := e.client.Do(httpReq)
if err != nil { if err != nil {

View file

@ -40,7 +40,7 @@ func (e *GitHubEngine) Search(ctx context.Context, req contracts.SearchRequest)
if err != nil { if err != nil {
return contracts.SearchResponse{}, err return contracts.SearchResponse{}, err
} }
httpReq.Header.Set("User-Agent", "gosearch/0.1") httpReq.Header.Set("User-Agent", "kafka/0.1")
httpReq.Header.Set("Accept", "application/vnd.github.v3+json") httpReq.Header.Set("Accept", "application/vnd.github.v3+json")
resp, err := e.client.Do(httpReq) resp, err := e.client.Do(httpReq)

View file

@ -90,7 +90,7 @@ func (e *QwantEngine) searchWebAPI(ctx context.Context, req contracts.SearchRequ
if err != nil { if err != nil {
return contracts.SearchResponse{}, err return contracts.SearchResponse{}, err
} }
httpReq.Header.Set("User-Agent", "gosearch-go/0.1 (+https://github.com/ashie/gosearch)") httpReq.Header.Set("User-Agent", "kafka/0.1 (compatible; +https://git.ashisgreat.xyz/penal-colony/gosearch)")
resp, err := e.client.Do(httpReq) resp, err := e.client.Do(httpReq)
if err != nil { if err != nil {
@ -234,7 +234,7 @@ func (e *QwantEngine) searchWebLite(ctx context.Context, req contracts.SearchReq
if err != nil { if err != nil {
return contracts.SearchResponse{}, err return contracts.SearchResponse{}, err
} }
httpReq.Header.Set("User-Agent", "gosearch-go/0.1 (+https://github.com/ashie/gosearch)") httpReq.Header.Set("User-Agent", "kafka/0.1 (compatible; +https://git.ashisgreat.xyz/penal-colony/gosearch)")
resp, err := e.client.Do(httpReq) resp, err := e.client.Do(httpReq)
if err != nil { if err != nil {

View file

@ -37,7 +37,7 @@ func (e *RedditEngine) Search(ctx context.Context, req contracts.SearchRequest)
if err != nil { if err != nil {
return contracts.SearchResponse{}, err return contracts.SearchResponse{}, err
} }
httpReq.Header.Set("User-Agent", "gosearch/0.1 (compatible; +https://git.ashisgreat.xyz/penal-colony/gosearch)") httpReq.Header.Set("User-Agent", "kafka/0.1 (compatible; +https://git.ashisgreat.xyz/penal-colony/gosearch)")
resp, err := e.client.Do(httpReq) resp, err := e.client.Do(httpReq)
if err != nil { if err != nil {

View file

@ -1,4 +1,4 @@
/* gosearch — clean, minimal search engine CSS */ /* kafka — clean, minimal search engine CSS */
/* Inspired by SearXNG's simple theme class conventions */ /* Inspired by SearXNG's simple theme class conventions */
:root { :root {

View file

@ -6,19 +6,19 @@
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="referrer" content="no-referrer"> <meta name="referrer" content="no-referrer">
<meta name="robots" content="noarchive"> <meta name="robots" content="noarchive">
<meta name="description" content="gosearch — a privacy-respecting, open metasearch engine"> <meta name="description" content="kafka — a privacy-respecting, open metasearch engine">
<title>{{template "title" .}}gosearch</title> <title>{{template "title" .}}kafka</title>
<link rel="stylesheet" href="/static/css/gosearch.css"> <link rel="stylesheet" href="/static/css/kafka.css">
<script src="https://unpkg.com/htmx.org@2.0.4"></script> <script src="https://unpkg.com/htmx.org@2.0.4"></script>
<link rel="icon" href="/static/img/favicon.svg" type="image/svg+xml"> <link rel="icon" href="/static/img/favicon.svg" type="image/svg+xml">
<link title="gosearch" type="application/opensearchdescription+xml" rel="search" href="/opensearch.xml"> <link title="kafka" type="application/opensearchdescription+xml" rel="search" href="/opensearch.xml">
</head> </head>
<body class="{{if .Query}}search_on_results{{end}}"> <body class="{{if .Query}}search_on_results{{end}}">
<main> <main>
{{template "content" .}} {{template "content" .}}
</main> </main>
<footer> <footer>
<p>Powered by <a href="https://git.ashisgreat.xyz/penal-colony/gosearch">gosearch</a> — a privacy-respecting, open metasearch engine</p> <p>Powered by <a href="https://git.ashisgreat.xyz/penal-colony/kafka">kafka</a> — a privacy-respecting, open metasearch engine</p>
</footer> </footer>
</body> </body>
</html> </html>

View file

@ -1,7 +1,7 @@
{{define "title"}}{{end}} {{define "title"}}{{end}}
{{define "content"}} {{define "content"}}
<div class="index"> <div class="index">
<div class="title"><h1>gosearch</h1></div> <div class="title"><h1>kafka</h1></div>
<div id="search"> <div id="search">
<form method="GET" action="/search" role="search"> <form method="GET" action="/search" role="search">
<input type="text" name="q" id="q" placeholder="Search…" autocomplete="off" autofocus <input type="text" name="q" id="q" placeholder="Search…" autocomplete="off" autofocus

View file

@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"> <OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
<ShortName>gosearch</ShortName> <ShortName>kafka</ShortName>
<Description>A privacy-respecting, open metasearch engine</Description> <Description>A privacy-respecting, open metasearch engine</Description>
<InputEncoding>UTF-8</InputEncoding> <InputEncoding>UTF-8</InputEncoding>
<OutputEncoding>UTF-8</OutputEncoding> <OutputEncoding>UTF-8</OutputEncoding>
<LongName>gosearch — Privacy-respecting metasearch</LongName> <LongName>kafka — Privacy-respecting metasearch</LongName>
<Image width="16" height="16" type="image/svg+xml">/static/img/favicon.svg</Image> <Image width="16" height="16" type="image/svg+xml">/static/img/favicon.svg</Image>
<Contact>https://git.ashisgreat.xyz/penal-colony/gosearch</Contact> <Contact>https://git.ashisgreat.xyz/penal-colony/kafka</Contact>
<Url type="text/html" method="GET" template="{baseUrl}/search?q={searchTerms}&amp;format=html"> <Url type="text/html" method="GET" template="{baseUrl}/search?q={searchTerms}&amp;format=html">
<Param name="pageno" value="{startPage?}" /> <Param name="pageno" value="{startPage?}" />
<Param name="language" value="{language?}" /> <Param name="language" value="{language?}" />