Difference between revisions of "Shlink"

From CSCWiki
Jump to navigation Jump to search
(Create page)
 
(Add setup instructions)
 
Line 8: Line 8:
 
== Usage ==
 
== Usage ==
 
Links can be managed at [https://links.csclub.uwaterloo.ca links.csclub.uwaterloo.ca], or through the CLI (currently restricted to the <code>staff</code> group).
 
Links can be managed at [https://links.csclub.uwaterloo.ca links.csclub.uwaterloo.ca], or through the CLI (currently restricted to the <code>staff</code> group).
 +
[[File:Shlink1.png|none|thumb|When you open it for the first time, you will see an interface that looks like this. Click '''Add a server'''.]]
 +
[[File:Shlink2.png|none|thumb|Enter the details as follows. Name: <code>csclub.ca</code> URL: <code><nowiki>https://csclub.ca</nowiki></code> API key: The exec API key (in the usual exec passwords location, or ask an exec for it if you aren't one)]]
 +
On the next interface, '''custom slug''' is the part of the URL that can be customized. If it is left blank, a random 4-character slug will be generated.
  
 
Use the <code>csctest</code> parameter to disable tracking on test requests.
 
Use the <code>csctest</code> parameter to disable tracking on test requests.

Latest revision as of 13:58, 10 September 2022

Shlink is a self-hosted URL shortener. We run an instance on caffeine, currently for exec-use only.

Installation Details

Shlink was installed manually (as of F2022 there is currently no Debian package for it). Its files are in /usr/local/lib/shlink on caffeine, with a symlink of bin/cli (the Shlink CLI) to /usr/local/bin/shlink as recommended by Shlink's docs. Due to Shlink only supporting PHP 8.2, which is in debian-unstable at the moment, the installation and CLI scripts were modified to use the php8.2 binary installed from packages.sury.org.

The web client (used to manage shortlinks graphically, the other option being the CLI) sources are located in /usr/local/bin/shlink/web-client/. Apache is configured (through sites-available/csc-links.conf and sites-real/csc-links) to serve actual shortlinks through csclub.ca (which itself redirects to the CSC homepage) and the web client through links.csclub.uwaterloo.ca.

Usage

Links can be managed at links.csclub.uwaterloo.ca, or through the CLI (currently restricted to the staff group).

When you open it for the first time, you will see an interface that looks like this. Click Add a server.
Enter the details as follows. Name: csclub.ca URL: https://csclub.ca API key: The exec API key (in the usual exec passwords location, or ask an exec for it if you aren't one)

On the next interface, custom slug is the part of the URL that can be customized. If it is left blank, a random 4-character slug will be generated.

Use the csctest parameter to disable tracking on test requests.