• Stars
    star
    181
  • Rank 212,110 (Top 5 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created about 8 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

⚓️ Anchr provides you with a toolbox for tiny tasks on the internet, especially bookmark collections

Anchr

Anchr is a small toolbox for common tasks on the internet, including bookmarks, link shortening and image uploads.

🚀 Features

If you like this project, please consider sponsoring it!

🗒 Description

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?

Prerequisites

In order to host Anchr on your own, you need a few things.

  • Node.js >= 18.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

Configuration

  1. $ git clone https://github.com/muety/anchr
  2. Copy .env.example to .env and edit the contents to set environment variables:
    • PORT: TCP port to start the server on (default: 3000)
    • LISTEN_ADDR: IPv4 address to make the server listen on (default: 127.0.0.1)
    • ANCHR_DB_USER: MongoDB user name (default: anchr)
    • ANCHR_DB_PASSWORD: MongoDB password (required)
    • ANCHR_DB_HOST: MongoDB host name (default: localhost)
    • ANCHR_DB_PORT: MongoDB port (default: 27017)
    • ANCHR_DB_NAME: MongoDB database name (default: anchr)
    • ANCHR_UPLOAD_DIR: Absolute path to a file system directory (must exist!) to persist uploaded images to (default: /var/data/anchr)
    • ANCHR_SECRET: A (preferably long), random character sequence to be used for the JSON Web Token (default: shhh)
    • ANCHR_LOG_PATH: Absolute file path for access logs (directory must exist!) (default: /var/log/anchr/access.log)
    • ANCHR_ERROR_LOG_PATH: Absolute file path for error logs (directory must exist!) (default: /var/log/anchr/error.log)
    • 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_CLIENT_ID and ANCHR_FB_SECRET: OAuth credentials for Facebook Login (default: '', leave blank to disable Facebook login)
    • ANCHR_GOOGLE_CLIENT_ID and 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: true)
    • ANCHR_VERIFY_USERS: Whether require new users to activate their accounts with an e-mail link (requires mailing) (default: true)
    • ANCHR_BASIC_AUTH: Whether to allow authenticating using HTTP Basic Auth (default: true)
    • ANCHR_EXPOSE_METRICS: Whether to expose Prometheus metrics under the public /api/metrics endpoint (default: false)
    • ANCHR_MAIL_SENDER: Sender address in mails from Anchr.io (default: Anchr.io <[email protected]>)
    • ANCHR_SMTP_HOST: SMTP server host for sending mails (leave empty to disable mailing)
    • ANCHR_SMTP_PORT: SMTP server port (default: 587)
    • ANCHR_SMTP_TLS: Whether to establish a TLS connection with the SMTP server (not to be confused with STARTTLS) (default: false)
    • 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: https://mailwhale.dev)
    • 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.

⚙️ Run

Setup

  1. $ source env.sh
  2. $ yarn
  3. $ cd public && ../node_modules/.bin/bower install && cd ..

Option 1: Run Natively

For development
  1. Run backend $ yarn start
  2. Run frontend $ yarn start:frontend
  3. Go to http://localhost:9000 and enjoy live reload
In production
  1. $ yarn run build (to build frontend)
  2. $ yarn run production

Option 2: Run with Docker

  1. source env.sh
  2. docker-compose up

🤖 Telegram Bot Setup

  1. Create a new bot with @BotFather
  2. Configure ANCHR_TELEGRAM_BOT_TOKEN and ANCHR_TELEGRAM_URL_SECRET variables
  3. Configure the webhook:
curl https://api.telegram.org/bot<BOT_TOKEN>/setWebhook?url=https://<ANCHR_URL>/api/telegram/updates/<URL_SECRET>

🧰 Tooling

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.

  1. Generate an HTTP basic auth hash Base64 hash of [email protected]:yourpassword
  2. Insert your newly generated hash in
  3. Import both files as custom uploaders in ShareX

🧩 Project History

The project's origins lie in 2014, back when the MEAN stack was the sh*t. It was the author's first real web project and a great opportunity to learn. The project is maintained ever since, however, considered mostly feature-complete. Dependencies are updated occasionally. Because the project started quite a couple of years ago, some parts are still based on old-fashioned JavaScript ES5 syntax, alongside vintage tools like Grunt and Bower. Certainly, this is not state-of-the-art in web dev anymore. However, to keep consistency with existing code, the original code style should still be followed in new contributions. Update: Just recently, all backend-side code was refactored to modern JavaScript syntax to ease development.

📓 License

GNU General Public License v3 (GPL-3) @ Ferdinand Mütsch

More Repositories

1

wakapi

📊 A minimalist, self-hosted WakaTime-compatible backend for coding statistics
Go
2,534
star
2

telepush

🤖 A simple bot to translate JSON HTTP requests into Telegram push messages
Go
449
star
3

mailwhale

🐳 A bring-your-own-SMTP-server mail relay with REST API and web UI
Go
245
star
4

mininote

📔 A simple, self-hosted, encrypted Markdown note-taking editor
Vue
225
star
5

website-watcher

🕵️‍♀️ Naively watch websites for changes on regular intervals.
Python
54
star
6

telegram-expense-bot

A bot that helps you manage and track your daily expenses.
JavaScript
48
star
7

anchr-android

📱 Android client for Anchr.io link collections, built with Flutter
Dart
43
star
8

telegram-payment-bot

How to create a basic Telegram bot with Payments
JavaScript
42
star
9

telegram-bot-tutorial

How to create a basic Telegram bot
JavaScript
38
star
10

http-server-benchmarks

Some simple benchmarks of different HTTP servers in different languages
Java
27
star
11

http2-serverpush-proxy

A simple standalone reverse proxy that automatically enables server-push for assets related to a HTTP response.
JavaScript
26
star
12

gitcount

A command-line tool to estimate the time spent on a git project, based on a very simple heuristic
Go
25
star
13

safe-browse-url-lookup

A simplified NodeJS wrapper for Google's Safe Browsing API v4 to check whether a URL is malicious or not. See https://developers.google.com/safe-browsing/v4/ for more information.
JavaScript
19
star
14

kitsquid

🐙 Alternative course catalog for Karlsruhe Institute of Technology
Go
15
star
15

linkeddata-trivia

Auto-generated trivia questions based on DBPedia data.
JavaScript
15
star
16

hashcode-2018

Solution for Google Hash Code 2018 Qualification Round
Python
14
star
17

tello

Keyboard interface to control a DJI Tello drone with your PC
Go
13
star
18

talkycars-thesis

A Distributed Platform Approach to Cooperative Perception based on Celluar-V2X Communication
Python
10
star
19

telegram-paypalme-bot

A bot that help you easily request money from friends.
JavaScript
9
star
20

go-graphql-sse-example

Basic example application using Go + GraphQL Subscriptions + Server-Sent Events + MongoDB + VueJS
Go
8
star
21

caddy-remote-host

Caddy v2 plugin to match a request's client IP against a host name (similar to remote_ip)
Go
7
star
22

tg-chat-classification

Naive-Bayes based classification of Telegram chat messages.
Python
6
star
23

caddy-pirsch-plugin

A Caddy v2 plugin to track requests in Pirsch analytics
Go
5
star
24

popular-movies-android

Project 1 from Udacity Android Developer Nanodegree
Java
5
star
25

halite-bot-java

My rule-based solution for the Halite AI competition
Java
4
star
26

quiznerd-android

🤓 A multiplayer coding quiz game for developers. Challenge your friends, compete in matches and test your skills in various programming languages.
Java
4
star
27

winscp2filezilla

A tool that migrates your saved servers from WinSCP to FileZilla.
Go
4
star
28

kit-lod16-knowledge-panel

Linked Open Data-based knowledge panel built during a seminar at Karlsruhe Institute of Technology
Java
4
star
29

broilerplate

A template project for new Go web backend applications
Go
3
star
30

readme-guestbook

A GitHub action to create a guestbook in your README from repository issues
JavaScript
3
star
31

express-request-limit

Express middleware to limit the request rate to specific routes, based on client IP address.
JavaScript
2
star
32

xyz-reader-android

Project 5 from Udacity Android Developer Nanodegree
Java
2
star
33

muetsch.io

My personal website and blog
Stylus
2
star
34

muety.github.io

HTML
1
star
35

baking-time-android

Project 3 from Udacity Android Developer Nanodegree
Java
1
star
36

hashcode-2021

Google HashCode 2021 Solutions
Java
1
star
37

telegram-bot-sdk

A JavaScript SDK to interact with the Telegram Bot API (https://core.telegram.org/bots/api) from your Node.js application.
JavaScript
1
star
38

operation-go

My solutions to the Operation Go hacking game by gocode.io
Go
1
star
39

srvctl

A mini tool to quickly perform certain actions on a server
PHP
1
star