- Notifications
You must be signed in to change notification settings - Fork0
Landing page for when you open browsers / live bookmarks in go.
License
arran4/gobookmarks
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
The purpose of the site is to display a list of links for you to see every time you open your browser. I have tried tomove as much of the work into the app as possible with minimal effort but you will need to use GitHub occasionally.
This project is a conversion of a project:goa4web-bookmarks to removethe SQL and replace it with GitHub. Which itself is extracted fromgoa4web, which isa Go port of a C++ site I made in 2003. Ported using ChatGPT:a4web. It's all beenminimally modified and as close to the original as I could get but with the changes I required. I made modifications tothis becauseStartHere my SPA version using modern tech failed because of GitHubOAuth2 restrictions on SPA sites. You can read more about this here:https://arranubels.substack.com/p/quicklinks
Sign up or log in using a database, local Git, GitHub or GitLab. On first use the servicecreates a repository called
MyBookmarks
in your account containing abookmarks.txt
file like:Category: Searchhttp://www.google.com.au GoogleCategory: Wikishttp://en.wikipedia.org/wiki/Main_Page Wikipediahttp://mathworld.wolfram.com/ Math Worldhttp://gentoo-wiki.com/Main_Page Gentoo-wiki
Go to the URL this app is deployed at.
Enjoy your new landing page / start page / bookmarks page.
It's a basic file format. Every command must be on its own line; empty lines are ignored.
Code | Meaning |
---|---|
Category[: <category>] | Will create a category title. If unnamed it displays asCategory . |
<Link> | Will create a link to<Link> with the display name<Link> |
<Link> <Name> | Will create a link to<Link> with the display name<Name> |
Column | Will create a column |
Page[: <name>] | Creates a new page and optionally names it |
Tab[: <name>] | Starts a new tab. Without a name it reverts to the main tab (switch using?tab=<index> ) |
-- | Inserts a horizontal rule and resets columns |
Tabs contain one or more pages. The first tab is implicit and does not need aTab
directive unless you want to name it. EachPage
line begins a new page within the current tab.
Example with two named columns:
Category: Lefthttp://left.comColumnCategory: Righthttp://right.com
Tab: Home Dashboard Page: Quick Links Column Category: Search Engines https://www.google.com Google Search https://duckduckgo.com DuckDuckGo https://bing.com Bing https://startpage.com Startpage Category: Version Control https://github.com GitHub https://gitlab.com GitLab https://github.com/arran4/blog arran4 Blog https://github.com/arran4/dotfiles arran4 Dotfiles https://bitbucket.org Bitbucket https://sr.ht SourceHut https://gitea.com Gitea https://aws.amazon.com/codecommit AWS CodeCommit Column Category: freeCodeCamp https://freecodecamp.org freeCodeCamp https://forum.freecodecamp.org freeCodeCamp Forum Category: Coursera https://coursera.org Coursera https://blog.coursera.org Coursera Blog Page: Tools Column Category: Code Editors https://code.visualstudio.com Visual Studio Code https://sublimetext.com Sublime Text https://atom.io Atom https://www.jetbrains.com/idea IntelliJ IDEA Community Edition Column Category: Terminal Emulators https://wezfurlong.org/wezterm WezTerm https://kitty.black Kitty https://github.com/alacritty/alacritty Alacritty https://hyper.is Hyper Tab: UI Frameworks Page: Components Column Category: Libraries https://mui.com Material‑UI https://storybook.js.org Storybook https://ant.design Ant Design https://chakra-ui.com Chakra UI Column Category: Grid Guides https://css-tricks.com/snippets/css/complete-guide-grid CSS‑Tricks Grid Guide https://getbootstrap.com/docs/5.0/layout/grid/ Bootstrap Grid Guide https://tailwindcss.com/docs/grid-template-columns Tailwind CSS Grid Guide Page: Reference Column Category: MDN Web Docs https://developer.mozilla.org MDN Web Docs https://caniuse.com Can I Use https://www.w3.org/standards W3C Standards https://devdocs.io DevDocs Tab: Entertainment Page: Video Column Category: Videos https://youtube.com YouTube https://netflix.com Netflix https://primevideo.com Prime Video Column Category: Tech News https://news.ycombinator.com Hacker News https://arstechnica.com Ars Technica https://techcrunch.com TechCrunch Page: Podcasts Column Category: Podcasts https://talkpython.fm Talk Python To Me https://developerhabits.com Developer Habits https://syntax.fm Syntax.fm
There is a visual editor which you can do some things such as rearrange links, categories,pages, etc. It's designed to be for things which would be quicker to preform them that wayyou can also just use the text version below.
Here is a visual demonstration of the edit capabilities:
There is a distinct edit mode. With some visual indication of what can be moved:
The/edit
page allows updating the entire bookmark file.Each category heading on the index page now includes a small pencil iconlink that opens/editCategory
. This page shows only the selectedcategory text and saves changes back to your bookmarks without touchingother sections. Edits check the file's SHA so you'll get an error if itchanged while you were editing.
All modes have a git (or git like) means of storing history, you can see your bookmarksat any stage using this system:
You can quickly search for any link on the same Tab you're on. (Tabs contain pages.)
There is keyboard navigation, see keyboard shortcuts for details.
Selecting the entry from quick search focuses its input field. PressEnter inside the widget to open the search in a new tab,Shift+Enter for a background tab and holdAlt to keep the entered text.
Use a link starting with thesearch:
scheme followed by a URL containing$query
, for example:
search:https://www.google.com/search?q=$query
The interface supports a number of keyboard shortcuts to make navigationquicker:
- Alt+K orCtrl+K/Cmd+K focuses the search box and selects any existing text.
- Alt+{ andAlt+} switch between bookmark tabs.
- Alt+[ andAlt+] switch between pages within a tab.
- While the search box is focused,Up/Down orLeft/Right arrows movebetween filtered results. PressEnter to open the selected link orCtrl+Enter/Meta+Enter to open it in a background tab.
- PressingEsc inside the search field removes focus. PressingEscagain clears the search and restores the previous view. Search widgets use thesame pattern, with a thirdEsc press clearing all widget text.
- Press? anywhere (outside of a text field) to see these shortcuts in asmall help dialog.
You can run this yourself. Docker images are published to theGitHub Container Registry asghcr.io/arran4/gobookmarks
.There are also precompiled versions under the releases section of this git repo:https://github.com/arran4/gobookmarks/releases
Configuration values can be supplied as environment variables, via a JSON configuration file or using command line arguments. Environment variables are the lowest priority, followed by the configuration file and finally command line arguments. If/etc/gobookmarks/gobookmarks.env
exists it will be loaded before reading the environment.
Name | Description |
---|---|
GITHUB_CLIENT_ID | GitHub OAuth2 client ID |
GITHUB_SECRET | GitHub OAuth2 client secret |
GITLAB_CLIENT_ID | GitLab OAuth2 client ID |
GITLAB_SECRET | GitLab OAuth2 client secret |
EXTERNAL_URL | Fully qualified URL the service is reachable on, e.g.http://localhost:8080 |
GBM_CSS_COLUMNS | If set (to any value) theColumn keyword in your bookmarks is rendered using a flex-based layout that emulates table positioning. |
GBM_NAMESPACE | Optional suffix added to the bookmarks repository name. |
GBM_TITLE | Overrides the page title shown in the browser. |
GBM_NO_FOOTER | Hide footer on pages. |
GBM_DEV_MODE | Enable developer helpers like/_css and/_table . Defaults to on when built asdev . |
FAVICON_CACHE_DIR | Directory where fetched favicons are stored. If unset icons are kept only in memory. Defaults to/var/cache/gobookmarks/favcache when installed system‑wide (including the Docker image). |
FAVICON_CACHE_SIZE | Maximum size in bytes of the favicon cache before old icons are removed. Defaults to20971520 . |
GITHUB_SERVER | Base URL for GitHub (set for GitHub Enterprise). |
GITLAB_SERVER | Base URL for GitLab (self-hosted). |
LOCAL_GIT_PATH | Directory used for the local git provider. Defaults to/var/lib/gobookmarks/localgit when installed system‑wide (including the Docker image). |
DB_CONNECTION_PROVIDER | SQL driver name for the SQL provider.mysql orsqlite3 |
DB_CONNECTION_STRING | Connection string for the SQL provider. File path forsqlite3 oruser:pass@/database?multiStatements=true Seehttps://github.com/go-sql-driver/mysql |
GBM_NO_FOOTER | Hide the footer on pages. |
SESSION_KEY | Secret used to sign session cookies. If unset the program reads or createssession.key under$XDG_STATE_HOME/gobookmarks ,$HOME/.local/state/gobookmarks or/var/lib/gobookmarks . |
PROVIDER_ORDER | Comma-separated list controlling the order login options are shown. Unrecognized names are ignored. Defaults to alphabetical order. |
GOBM_ENV_FILE | Path to a file ofKEY=VALUE pairs loaded before the environment. Defaults to/etc/gobookmarks/gobookmarks.env . |
GOBM_CONFIG_FILE | Path to the JSON config file. If unset the program uses$XDG_CONFIG_HOME/gobookmarks/config.json or$HOME/.config/gobookmarks/config.json for normal users and/etc/gobookmarks/config.json when installed system‑wide or run as root. |
Favicons fetched for your bookmarks are cached on disk whenFAVICON_CACHE_DIR
is set. The/proxy/favicon
endpoint also accepts asize
parameter to scale icons on the fly.
You can place these settings in/etc/gobookmarks/gobookmarks.env
asKEY=VALUE
pairs and the service will load them automatically if the file exists.The release packages do not install this file; create it manually if you want to use environment-based settings.
Use--config <path>
or setGOBM_CONFIG_FILE
to control which configuration file is loaded.
The--title
flag orGBM_TITLE
environment variable sets the browser page title.The--no-footer
flag orGBM_NO_FOOTER
environment variable hides the footer on pages.The--dev-mode
flag orGBM_DEV_MODE
environment variable toggles the developer helpers.Use--github-server
orGITHUB_SERVER
to override the GitHub base URL and--gitlab-server
orGITLAB_SERVER
for GitLab.Use--no-footer
orGBM_NO_FOOTER
to hide the footer on pages.Use--provider-order
orPROVIDER_ORDER
to customize the login button order.
Runninggobookmarks --version
will print the version information along with the list of compiled-in providers.When no OAuth2 credentials are configured the login buttons are hidden. Visit/status
to see which providers are available.Use--dump-config
to print the final configuration after merging the environment,config file and command line arguments.
For GitHub visithttps://github.com/settings/developers. For GitLab visithttps://gitlab.com/-/profile/applications.
Create an application, call it whatever you like. Set the Callback URL to whatever you put inEXTERNAL_URL
and add:/oauth2Callback
to the end, ie if you entered:http://localhost:8080
it should be:http://localhost:8080/oauth2Callback
Uploadlogo.png
for the logo.
Generate a secret key and use it for the environment variables with the Client Id.
The release packages include service files for bothsystemd
and FreeBSDrc.d
. During installation these files can be copied to your system so theserver starts automatically on boot.
When installed from the release packages the service files pass--config /etc/gobookmarks/config.json
. An example config file is included inthe packages and is installed with permissions0600
owned by thegobookmarks
user. The installation process creates this user automaticallyand both service files run the daemon asgobookmarks
.
The Docker image continues to work as before and now uses an Alpine base image. Mount/var/cache/gobookmarks
if you needpersistent storage for favicons and/var/lib/gobookmarks
for the git provider. These directories are also the defaults when gobookmarks is installed system-wide under/usr
. Pass the same environment variables as listed above. The git provider stores data under$LOCAL_GIT_PATH/<sha256(username)>/
as a git repository with a.password
file containing the bcrypt hash.Create an account via/signup/git
. This stores the password hash under$LOCAL_GIT_PATH/<sha256(username)>/.password
and creates the repository. Log inlater via/login/git
using the same credentials. Passwords can be updated withthe provider's SetPassword method.
To locate the file, compute the SHA-256 of your username and look for thecorresponding directory. For example:
echo -n alice| sha256sum
The output hash forms the path$LOCAL_GIT_PATH/<hash>/.password
.Favicons are cached on disk under/var/cache/gobookmarks/favcache
by default when the program is installed system‑wide or run in Docker. SetFAVICON_CACHE_DIR
to an empty string to disable disk caching.The optional SQL provider stores bookmarks and passwords in a database whenDB_CONNECTION_PROVIDER
andDB_CONNECTION_STRING
are set. Accounts are created through/signup/sql
and log in via/login/sql
. Only the latest bookmarks are returned; commit history is maintained in thehistory
table.
Thesql/legacy_migrate.sql
file contains SQL statements that convert theoriginalgoa4web-bookmarks
tables into the schema used here. Execute thescript manually on your database before enabling the SQL provider.You can run the container entirely via environment variables:
docker run -p 8080:8080 \ -v /my/cache:/var/cache/gobookmarks \ -v /my/db:/var/lib/gobookmarks \ -e EXTERNAL_URL=http://localhost:8080 \ -e GITHUB_CLIENT_ID=abc \ -e GITHUB_SECRET=def \ -e FAVICON_CACHE_DIR=/var/cache/gobookmarks/favcache \ -e LOCAL_GIT_PATH=/var/lib/gobookmarks/localgit \ -e DB_CONNECTION_PROVIDER=sqlite3 \ -e DB_CONNECTION_STRING=/var/lib/gobookmarks/bookmarks.db \ ghcr.io/arran4/gobookmarks
Alternatively you can mount a config file and environment file:
docker run -v /my/config.json:/etc/gobookmarks/config.json \ -v /my/gobookmarks.env:/etc/gobookmarks/gobookmarks.env \ -v /my/cache:/var/cache/gobookmarks \ -v /my/db:/var/lib/gobookmarks \ -p 8080:8080 ghcr.io/arran4/gobookmarks
An exampleconfig.json
looks like:
{"github_client_id":"","github_secret":"","gitlab_client_id":"","gitlab_secret":"","external_url":"http://localhost:8080","css_columns":false,"namespace":"","title":"","no_footer":false,"github_server":"https://github.com","gitlab_server":"https://gitlab.com","favicon_cache_dir":"/var/cache/gobookmarks/favcache","favicon_cache_size":20971520,"local_git_path":"/var/lib/gobookmarks/localgit","db_connection_provider":"sqlite3","db_connection_string":"/var/lib/gobookmarks/bookmarks.db","no_footer":false}
Using environment variables:
version:'3'services:gobookmarks:image:ghcr.io/arran4/gobookmarksports: -"8080:8080"volumes: -cache:/var/cache/gobookmarks -db:/var/lib/gobookmarksenvironment:EXTERNAL_URL:"http://localhost:8080"GITHUB_CLIENT_ID:abcGITHUB_SECRET:defFAVICON_CACHE_DIR:/var/cache/gobookmarks/favcacheLOCAL_GIT_PATH:/var/lib/gobookmarks/localgitDB_CONNECTION_PROVIDER:sqlite3DB_CONNECTION_STRING:/var/lib/gobookmarks/bookmarks.dbvolumes:cache:db:
Using a config and env file:
version:'3'services:gobookmarks:image:ghcr.io/arran4/gobookmarksports: -"8080:8080"volumes: -./config.json:/etc/gobookmarks/config.json:ro -./gobookmarks.env:/etc/gobookmarks/gobookmarks.env:ro -cache:/var/cache/gobookmarks -db:/var/lib/gobookmarksvolumes:cache:db:
About
Landing page for when you open browsers / live bookmarks in go.
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.