🌐 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.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
brokenscripts 4cb133f76f Merge branch 'master' of https://git.mills.io/brokenscripts/golinks 6 days ago
.dockerfiles Fixed incorrect newline 6 days ago
golinks.gif Example usage 6 days ago
templates Minor cosmetic updates and fix list template due to Command update from commit @0f8b1cbd3b (#52) 1 week ago
tools Use goreleaser for releases and my release.sh script from other projects 3 years ago
.drone.yml Fix and update deps (#46) 10 months ago
.gitignore Use goreleaser for releases and my release.sh script from other projects 3 years ago
.goreleaser.yml Fix GoReleaser config 10 months ago
AUTHORS Added Github Actions workflows from another project (Bitcask) 2 years ago
CODE_OF_CONDUCT.md Added Github Actions workflows from another project (Bitcask) 2 years ago
CONTRIBUTING.md Added Github Actions workflows from another project (Bitcask) 2 years ago
Dockerfile Minor cosmetic updates and fix list template due to Command update from commit @0f8b1cbd3b (#52) 1 week ago
LICENSE Fixed LICENSE 5 years ago
Makefile Fix installation of deps 9 months ago
README.md Added binary usage 6 days ago
_config.yml Set theme jekyll-theme-hacker 3 years ago
bookmarks.go Fix import paths 12 months ago
bookmarks_test.go Add support for plain 'ol bookmarks with no query. e.g: gmail -> https://www.gmail.com/ 6 years ago
commands.go Add support for BaseURL in all templates (#49) 10 months ago
commands_test.go Fix import paths 12 months ago
config.go Add support for BaseURL in all templates (#49) 10 months ago
config_test.go Add support for BaseURL in all templates (#49) 10 months ago
coverage.txt Fixed CI build 3 years ago
defaults.go Add support for BaseURL in all templates (#49) 10 months ago
defaults_test.go Add tests for EnsureDefaultBookmarks for the error case 6 years ago
go.mod Fix and update deps (#46) 10 months ago
go.sum Fix and update deps (#46) 10 months ago
main.go Add support for BaseURL in all templates (#49) 10 months ago
server.go Add support for BaseURL in all templates (#49) 10 months ago
server_test.go Add support for BaseURL in all templates (#49) 10 months ago
templates.go Add support for BaseURL in all templates (#49) 10 months ago
utils.go Add OpenSearch suggestions support (#18) 3 years ago
version.go Bump version to align with the latest release tag (#38) 2 years ago

README.md

golinks

Build Status

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 git.mills.io/prologic/golinks

OS X Homebrew

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

brew tap prologic/golinks https://git.mills.io/prologic/homebrew-golinks.git
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.

Initial Setup (required)

Set your browser's default custom search engine to your golinks hosted location, such as http://localhost:8000/?q=%s. Replacing localhost with wherever you host golinks from.

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.

Usage (Standalone)

If using the binary golinks, then run it as follows, specifying the parameters individually or by specifying a configuration file

golinks -bind 0.0.0.0:8000 -baseURL http://localhost:8000

Or using a configuration file:

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

When using the binary, it supports any of the parameters specified in the Example Config File section.
NOTE: They are case sensitive and must be used, exactly as shown in the config file section such as baseURL.

Docker

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

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

This will start up the server on port 8000.

Docker Compose

Or use the following docker-compose configuration that creates a bind mount from a golinks folder in the current user's home directory to where the environment variable DBPATH is pointed at in the container.

Note: The latest version of golinks, used in this docker image, uses environment variables instead of the old command variables.

version: "3.9"

services:
  golinks:
    image: brokenscripts/golinks
    container_name: golinks
    restart: unless-stopped
    volumes:
      - "${HOME}/golinks:/search.db"
    environment:
      BIND: "0.0.0.0:8000"
      BASEURL: "https://golinks.domain.net"   # Using an internal proxy that will make this resolve correctly
      DBPATH: "/search.db"
      TITLE: "GoLinks"
      SEARCHURL: "https://www.google.com/search?q=%s&btnK"
      SUGGESTURL: "https://suggestqueries.google.com/complete/search?client=firefox&q=%s"
FLAG DEFAULT Description
BIND 0.0.0.0:8000 Must be in IP:PORT format. Where the container listens at.
BASEURL http://localhost:8000 Must start with http:// or https:// and can optionally have a port following the domain name. If using a proxy, ensure that this matches what your clients will visit.
DBPATH /search.db Where in the container you want the bookmarks stored
TITLE Search The OpenSearch service title (i.e. what your browser will call golinks' search)
SEARCHURL https://www.google.com/search?q=%s&btnK The URL golinks will redirect searches to by default (if no custom bookmark matches)
SUGGESTURL https://suggestqueries.google.com/complete/search?client=firefox&q=%s URL of autosuggest service to retrieve search suggestions from

FLAG DEFAULT Description
CONFIG Path to an optional config file containing the below golinks variables

See Configuration File below for more information.

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.

Commands

help to view the online help page
list to see all your bookmarks and commands
add to create a new bookmark
remove to remove a bookmark
date to get the current container date (UTC default)
time to get the current container time (UTC default)
ping to get the current UNIX timestamp (epoch)

Configuration File

golinks can also use a configuration file (specified via 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.

Note: If using a config file, do not specify the environment variables shown above

Example Config File

Save the variables shown below as config.cfg (example filename) and bind mount into the container and specify the environment CONFIG variable pointing to where this is mounted at.

bind 0.0.0.0:8000
baseURL http://localhost:8000
dbpath /search.db
title GoLinks
searchURL https://www.google.com/search?q=%s&btnK
suggestURL https://suggestqueries.google.com/complete/search?client=firefox&q=%s

In Action!

Here is a quick example of having Chrome's search engine change the keyword go to point to my golinks.

After using go you can see the bar change to Search GoLinks.
Typing help (so.. go help) does a redirect to the defined help URL contained in golinks.

GoLinks Example

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