# 42links

42links is an open-source, web-based bookmarking server. It supports multiple accounts.

## Screenshot

![42links 1.0.0](https://cdn.tuxproject.de/projects/42links/42links-1.0.0.png)

## Inspirations

42links was not-so-loosely inspired by [Espial](https://github.com/jonschoning/espial), another open-source, web-based bookmarking server, written in Haskell so it [won't work well](https://github.com/jonschoning/espial/issues/60) on OpenBSD which I use in some of my server infrastructure.

## Installation

### Database

You'll need **PostgreSQL** with an empty database set up that will hold 42links's data later. You will be asked for the connection data when starting 42links for the first time.

### Application

You'll need **SBCL** with [Quicklisp](https://www.quicklisp.org/beta/#installation) set up.

1. Download this repository, either via [Fossil](https://fossil-scm.org) (`fossil clone https://code.rosaelefanten.org/42links`) or by downloading the tarball or the ZIP archive [from here.](https://code.rosaelefanten.org/42links/info/tip)
2. Run `build.sh` from inside your clone's directory. On non-UNIX platforms, please see the `build.sh` source code for a rough estimate on how to build 42links.
3. Run `./42links` and fill the blanks during the setup process. **It will ask you to set a few environment variables.** If you don't do that, the setup process will start again during the next application start and it **will** fail. Please do it. Seriously.
4. 42links will run on the port you told it during the setup. Enjoy.

### Packages

Nobody seems to have packaged 42links yet. You can be the first! (Please tell me so I can add a link here.)

## Bugs and Patches

**Bug reports** are gladly accepted, please [create a ticket.](https://code.rosaelefanten.org/42links/ticket) (Anonymous contributions are allowed.) For **patches** or other contributions, please [create a patch file](https://fossil-scm.org/home/doc/trunk/www/patchcmd.md) and share it in [the forum](https://code.rosaelefanten.org/42links/forum) (requires an account) or [by other means](https://keyoxide.org/tux0r@rosaelefanten.org).

## Design Decisions

### Programming Language

Given that 42links mostly exists because Espial does not run on OpenBSD, I built it with portability and simplicity in mind. Common Lisp works just well on OpenBSD and both the language and the code are as easy as I want them to be. (Also, I had [promised to use Lisp](https://feddit.org/post/6267753/3888298) and I try to keep as many promises as I can.)

### Database

This software requires a PostgreSQL database, as that's what I happen to use anyway. PostgreSQL is really good. If you don't want to use PostgreSQL, please don't use 42links.

### Security

42links uses *bcrypt* for password storage, with an additional (optional) `canvas`-based captcha on the login page to make brute-force attacks less attractive. While this makes both the initial onboarding process and the login slightly slower and it is *somewhat* less secure than Argon2, Scrypt and whatnot, I think it is a good compromise between safety and performance.

#### JavaScript

Almost everything in 42links works just well in browsers that don't support (or run) JavaScript. The two features that **require** JavaScript are 1) the (optional) captcha mentioned above and 2) tags auto-completion. This is by design. There is no technical advantage hidden inside the option to add more AJAX interaction, so I did not do that.

## Donations

Yes, please! Both [Paypal](https://paypal.me/GebtmireuerGeld) and [Liberapay](https://liberapay.com/Cthulhux/) are accepted.

## FAQ

### How does the search work?

Enter a [regular expression](https://www.regexone.com), press Enter.

### How can I manage tags?

Once you add a new tag to a link, you can edit the tag in the tag list (available from the menu bar). Add a new regular expression there to apply the tag to all matching URLs. You can also delete (= unassign) the new tag from all links there.

### Can you add <feature>?

I probably could, and I might consider it if there is an obvious advantage in doing so. However, you are invited to contribute your own features (see "Bugs and Patches" above).

### Wouldn't <random AI stuff> make this software much better?

No.
