GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - freva/codesearch

BranchesTags
Open more actions menu

Latest commit

 

History

97 Commits
97 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
cmd
cmd
 
 
frontend
frontend
 
 
index
index
 
 
internal/config
internal/config
 
 
regexp
regexp
 
 
sparse
sparse
 
 
systemd
systemd
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
Makefile
Makefile
 
 
README.md
README.md
 
 
go.mod
go.mod
 
 

Repository files navigation

Code search

Extends github.com/google/codesearch with a tool to sync git repositories to be indexed and a web interface. The sync tool and web interface inspired by github.com/hakonhall/codesearch.

Configuration

Configuration is done via a config file. The format is as follows:

  • The file consists of global settings and one or more [server NAME] sections.
  • Relative paths are resolved relative to the config file location.

Global settings:

  • code: Directory for checked-out and indexed source code. Default: [workdir]/code
  • fileindex: Path to the file index file. Default: [workdir]/csearch.fileindex
  • index: Path to the code index file. Default: [workdir]/csearch.index
  • port: Port for the server. Default: 80
  • manifest: Path to the manifest file. Default: [workdir]/manifest.json
  • workdir: Working directory managed by the program. Required.

Server section ([server NAME]):

  • api: GitHub REST API URL. Default: https://api.github.com
  • exclude: Regex to exclude repositories (at most one).
  • include: Repository or owner to include. Formats:
    • OWNER (all repos for user/org)
    • OWNER/REPO (specific repo)
    • OWNER/REPO#BRANCH (specific branch)
    • OWNER/REPO#REF (specific commit)
  • token: OAuth2 token (e.g., personal access token).
  • weburl: Git web interface URL. Default: https://github.com
  • url: Base URL for cloning (e.g., [email protected], https://github.com). Required.

Example config:

[global]
code = db
index = /home/user/.csearchindex
port = 8080

[server github]
exclude = ^DEPRECATED
include = freva
include = torvalds/linux  

[server internal]
api = https://git.example.com/api
include = internalorg
token = ghp_YYYYYYYYYYYYYYYYYYYY
weburl = https://git.example.com
url = https://[email protected]

Binaries

The following binaries are produced:

  • cgrep: Command-line code search using the index. Usage:

    cgrep [flags] regexp [file...]

    Flags: -c (count), -h (no filename), -i (case-insensitive), -l (list files), -n (line numbers), -v (invert match)

  • cindex: Builds the code search index. Usage:

    cindex [flags] [path...]

    Flags: -index (index file), -list (list indexed paths), -reset (discard existing index), -zip (index zip files)

  • csearch: Behaves like cgrep, but over all indexed files with option to limit search to files matching a regex. Usage:

    csearch [flags] regexp

    Flags: -c (count), -f (file regexp), -h (no filename), -i (case-insensitive), -l (list files), -n (line numbers), -index (index file)

  • cserver: HTTP server providing the web UI. Usage:

    cserver --config path/to/config
  • csupdater: Updates repositories and indices from remote sources. Usage:

    csupdater --config path/to/config [--manifest] [--sync] [--index] [--verbose] [--exit-early] [--help-config]

    Flags: --config (config file), --exit-early (exit without updating index if no change in sync), --manifest (whether to update manifest), --sync (whether to sync repositories), --index (whether to update index) By default, runs all update steps.

Building

Requirements: Go (>=1.23), pnpm (>=10).

Run:

make

This installs Go binaries and builds the frontend UI.

Automatic Updates and Server

To run the server and keep the index up to date automatically, install the provided systemd user services:

  1. Copy the service files from systemd/ to your user systemd directory:
    cp systemd/codesearch-server.service systemd/codesearch-updater.service ~/.config/systemd/user/
    then edit them to set the correct paths for the binaries and config file.
  2. Reload systemd and enable the services:
    systemctl --user daemon-reload
    systemctl --user enable --now codesearch-server.service codesearch-updater.service
  • codesearch-server.service runs the HTTP server (cserver).
  • codesearch-updater.service keeps the repositories and index up to date (csupdater).

About

No description, website, or topics provided.

Resources

Readme
BSD-3-Clause license
Activity

Stars

1 star

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.