Skip to content

petabite/golinks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go/links

golinks for your personal setup

dashboard

Features

  • Create, edit, delete golinks
  • Web client to manage your golinks

Installation

Requirements

Build from Source

  1. Clone this repo
  2. Run make in the root of the repo to build and install the golinks binary

Run golinks

Usage:

$ golinks -h
Usage of golinks:
  -db string
    	path to database file (default "golinks.sqlite")
  -port int
    	port to run server on (default 7890)

To bind the server at localhost:80 and create the database file in your home directory, run:

golinks -port 80 -db ~/golinks.sqlite

You should see the web client at localhost/links.

Set up the go domain

Add this line to /etc/hosts:

127.0.0.1 go # this can be any name you want

You should be able to see the web client at go/links.

NOTE: You may need to restart the mDNS daemon process (on macOS):

sudo killall -HUP mDNSResponder

Run on Login

To start golinks on login:

On macOS:

  1. Open the "Automator" app.

  2. Create a new "Application".

  3. Select the "Run Shell Script" action.

  4. Enter this script:

    ~/go/bin/golinks -port 80 -db ~/golinks.sqlite &>/dev/null &

    NOTE: &>/dev/null & will terminate the Automator application while leaving the golinks process running in the background (so you don't get an extra icon in your menu bar).

  5. Save the app.

  6. Open System Settings, click on "General", and then click on "Login Items". Click the "+" button and choose the Automator app you created.

Alternatively, you can also create a launchd agent.

Under the Hood

Client

The (perhaps very over-engineered) client is a WebAssembly application created using yew and Rust. It is styled using Milligram with the help of Stylist and is built using trunk.

Server

The client and API are served by a backend implemented using Gin and Go. The database is handled using GORM and SQLite.