Sign inSign up

prologic/golinks

By prologic

•Updated almost 6 years ago

Self-hosted smart bookmark search engine.

Image
2

100K+

prologic/golinks repository overview

CodeCov Go Report Card codebeat badge GoDoc GitHub license

golinks is a web app that allows you to create smart bookmarks, commands and aliases by pointing your web browser's default search engine at a running instance. Similar to bunny1 or yubnub.

⁠Installation

⁠Source
$ go get github.com/prologic/golinks
⁠OS X Homebrew

There is a formula provided that you can tap and install from prologic/homebrew-golinks⁠:

$ brew tap prologic/golinks
$ brew install golinks

NB: This installs the latest released binary; so if you want a more recent unreleased version from master you'll have to clone the repository and build yourself.

⁠Docker

To startup a container with an image from docker hub, run the following:

docker run -it -d -p 8000:8000 prologic/golinks

Or use the following docker-compose configuration:

golinks:
    image: 'prologic/golinks:latest'
    container_name: golinks
    ports:
        - "8000:8000"

You can also specify command line arguments as described in configuration⁠ and make docker container persistent with volumes:

golinks:
  image: 'prologic/golinks:latest'
  container_name: golinks
  command:
      - "-dbpath=/path/to/container/search.db"
      - "-title=Dave's Search"
      - "-fqdn=localhost:8000"
      - "-url=https://www.google.com/search?q=%s&btnK"
      - "-suggest=https://suggestqueries.google.com/complete/search?client=firefox&q=%s"
  volumes:
      - "./path/to/local/search.db:/path/to/container/search.db"

⁠Usage

Run golinks:

$ golinks -bind 127.0.0.1:8000 -fqdn localhost:8000

Set your browser's default golinks engine to http://localhost:8000/?q=%s⁠

Then type help to view the main help page, g foo bar to perform a Google⁠ search for "foo bar" or list to list all available commands.

⁠Custom bookmarks

To add a bookmark (or overwrite an existing one), enter add [name] [url] as your search query, where name is the shortcut for the bookmark and url the URL:

add imdb https://www.imdb.com

Now you can just enter imdb in your search bar to go straight to imdb.com.

You can also add %s to your URL, which will be replaced with your search query:

add ddg https://duckduckgo.com/?q=%s

Now you can use ddg [query] to search via DuckDuckGo, e.g. ddg free stuff to find yourself some free stuff.

To remove a search, use remove [name], so remove ddg will remove the above search.

⁠Other commands

Use list to see all your bookmarks and commands (golinks comes with several useful built-ins) and help to view the online help page.

⁠Configuration

golinks comes with sensible defaults, so it will run out-of-the box without any configuration (just run golinks and it will be available at http://localhost:8000, and save your custom bookmarks to search.db in the working directory), but there are several knobs you can tweak.

All configuration options can be specified via command-line flag, environment variable or a configuration file.

The available CLI flags are (as shown via golinks -h):

FlagDefaultDescription
-bind0:0:0:0:8000IP and port to bind server to.
-fqdnlocalhost:8000Web address that corresponds to bind address.
-dbpathsearch.dbDatabase to save your custom bookmarks to.
-suggesthttps://suggestqueries.google.com/complete/search?client=firefox&q=%sURL of autosuggest service to retrieve search suggestions from.
-titleSearchThe OpenSearch service title (i.e. what your browser will call golinks' search).
-urlhttps://www.google.com/search?q=%s&btnKThe URL golinks will redirect searches to by default (if no custom bookmark matches).
-configPath to the optional configuration file (see below).
-hShow CLI help and exit.
-vShow golinks version number and exit.
⁠Environment variables

All the above flags can also be specified via environment variable with the same name as the flag, but in uppercase. So BIND=127.0.0.1:8081 FQDN=localhost:8081 golinks is equivalent to golinks -bind 127.0.0.1:8081 -fqdn localhost:8081.

⁠Configuration file

golinks can also use a configuration file (specified via -config /path/to/file or CONFIG=/path/to/file) with a very simple format. Each line of the file should contain one option, specified in the same way as the corresponding CLI flag but without the leading -. Empty lines and lines beginning with # are ignored:

# with a space
bind 127.0.0.1:8081

# with equals
fqdn=localhost:8081
⁠Example

So, assuming your name is "Dave", a Linux user and fan of DuckDuckGo, you might run golinks like this:

golinks -config ~/.config/golinks/config.cfg

where /home/dave/.config/golinks/config.cfg looks like this:

bind 127.0.0.1:3456
fqdn localhost:3456
dbpath /home/dave/.config/golinks/search.db
title Dave's Search
url https://duckduckgo.com/?q=%s
suggest https://duckduckgo.com/ac/?type=list&q=%s

⁠Stargazers over time

Stargazers over time

⁠Support

Support the ongoing development of Bitcask!

Sponsor

⁠Contributing

golinks is considered "production" software and is used daily. If you find this interresting or useful please fork and contribute back via pull-requests! If you find bugs or have ideas for new features, please file an issue!

⁠License

MIT

Tag summary

Content type

Image

Digest

Size

5.8 MB

Last updated

almost 6 years ago

docker pull prologic/golinks