Anchr is a small toolbox for common tasks on the internet, including bookmarks, link shortening and image uploads.
- Link shortener
- Searchable bookmarks collections
- Encrypted images uploads, using CryptoJS
- Malicious link checking, using Safe Browsing API
- Self-hosted and open-source
- Hosted, GDPR-compliant service at Anchr.io
- Official Android app
- Chrome and Firefox browser extension
- Prometheus metrics
- Integration with ShareX
- OAuth 2 authentication (Google, Facebook, ...)
- Telegram Bot (@AnchrBot)
If you like this project, please consider sponsoring it!
The idea arose when someday I considered it useful to have a collection of web links or bookmarks – like those you have in Chrome or Firefox – accessible from anywhere without needing to synchronize your browser profile. Just like if you’re somewhere on another PC, find a useful article on the internet and want to save it quickly for later at home. This is what Anchr’s collections feature does. It saves links – with an optional description for easier search and separated into categories / collections.
The second feature is to upload images. You can easily upload one or more photos from your computer or mobile device and send them to friends or include them into forum posts or the like. Special with Anchr’s image hosting is that users are given the opportunity to client-sided encrypt images with a password. As a result no one without the password will ever see their photos’ content.
The last feature are shortlinks – actually not any different from those you know from goo.gl or bit.ly. They’re useful if you have a very long web link including many query parameters, access tokens, session ids, special characters and the like and want to share them. Often special characters break the linking or your chat application has a maximum length for hyperlinks. Or you just want to keep clarity in your document or emails. In this case it can be very helpful to make the links as short as any possible. Additionally, shortlinks are checked against Google's Safe Browsing API to prevent your site to reference phishing sites or the like.
Anchr’s focus is on ease and quickness of use – short loading times, flat menu hierarchies, etc. There's also a Chrome extension out there, which you can use to save or shorten links directly from the website.
📡 How to run?
In order to host Anchr on your own, you need a few things.
- Node.js 16.x
- A MongoDB 3.4 database (you can use mlab.com to get a free, hosted MongoDB)
- Optionally, but recommended: A webserver as a reverse proxy (e.g. nginx) to enable compression and SSL encryption
$ git clone https://github.com/muety/anchr
.envand edit the contents to set environment variables:
PORT: TCP port to start the server on (default:
LISTEN_ADDR: IPv4 address to make the server listen on (default:
ANCHR_DB_USER: MongoDB user name (default:
ANCHR_DB_PASSWORD: MongoDB password (required)
ANCHR_DB_HOST: MongoDB host name (default:
ANCHR_DB_PORT: MongoDB port (default:
ANCHR_DB_NAME: MongoDB database name (default:
ANCHR_UPLOAD_DIR: Absolute path to a file system directory (must exist!) to persist uploaded images to (default:
ANCHR_SECRET: A (preferably long), random character sequence to be used for the JSON Web Token (default:
ANCHR_LOG_PATH: Absolute file path for access logs (directory must exist!) (default:
ANCHR_ERROR_LOG_PATH: Absolute file path for error logs (directory must exist!) (default:
ANCHR_GOOGLE_API_KEY: Your API key for Google APIs (required for safe browse checking incoming shortlinks), which you get from the Developers Console (default:
'', leave blank to disable safe browse checking)
ANCHR_FB_SECRET: OAuth credentials for Facebook Login (default:
'', leave blank to disable Facebook login)
ANCHR_GOOGLE_SECRET: OAuth credentials for Google Login (default:
'', leave blank to disable Google login)
ANCHR_ALLOW_SIGNUP: Whether to allow sign up of new users (default:
ANCHR_VERIFY_USERS: Whether require new users to activate their accounts with an e-mail link (requires mailing) (default:
ANCHR_BASIC_AUTH: Whether to allow authenticating using HTTP Basic Auth (default:
ANCHR_EXPOSE_METRICS: Whether to expose Prometheus metrics under the public
ANCHR_MAIL_SENDER: Sender address in mails from Anchr.io (default:
ANCHR_SMTP_HOST: SMTP server host for sending mails (leave empty to disable mailing)
ANCHR_SMTP_PORT: SMTP server port (default:
ANCHR_SMTP_TLS: Whether to establish a TLS connection with the SMTP server (not to be confused with STARTTLS) (default:
ANCHR_SMTP_USER: SMTP server login username
ANCHR_SMTP_PASS: SMTP server login password
ANCHR_MAILWHALE_URL: Public URL of your MailWhale instance when using it for mails instead of SMTP (default:
ANCHR_MAILWHALE_CLIENT_ID: MailWhale client ID for authentication
ANCHR_MAILWHALE_CLIENT_SECRET: MailWhale client secret for authentication
ANCHR_TELEGRAM_BOT_TOKEN: Telegram bot token (from @BotFather). Leave empty for disabling Telegram integration.
ANCHR_TELEGRAM_URL_SECRET: Secret to append to Telegram webhook path for security purposes. Can be any random string.
$ source env.sh
$ cd public && ../node_modules/.bin/bower install && cd ..
Option 1: Run Natively
- Run backend
$ yarn start
- Run frontend
$ yarn start:frontend
- Go to http://localhost:9000 and enjoy live reload
$ yarn run build(to build frontend)
$ yarn run production
Option 2: Run with Docker
🤖 Telegram Bot Setup
- Create a new bot with @BotFather
- Configure the webhook:
ShareX (Windows only)
You can integrate Anchr with ShareX on Windows and make it be used as a custom target for image uploads and shortlinks.
- Generate an HTTP basic auth hash Base64 hash of
- Option 1 (Linux):
echo "email@example.com:yourpassword" | base64
- Option 2: Use an online tool
- Option 1 (Linux):
- Insert your newly generated hash in
- Import both files as custom uploaders in ShareX
🧩 Project History
GNU General Public License v3 (GPL-3) @ Ferdinand Mütsch