2024-02-25 22:18:34 -06:00
2024-02-25 22:18:34 -06:00
2024-02-25 02:15:31 -06:00
2024-02-25 02:15:31 -06:00
2023-08-10 05:19:31 -05:00
2024-02-25 02:15:31 -06:00
2024-02-25 02:15:31 -06:00
2023-08-10 05:19:31 -05:00
2024-02-25 17:28:41 -06:00

LinkLogger API

A simple API for you to create redirect links on my domain (link.pkrm.dev) and log all IPs that click on the link. Essentially a CLI-only version of Grabify.

Feel free to submit an issue for any problems you experience or if you have an idea for a new feature. If you have a fix for anything, please submit a pull request for review.

Want to self-host?

Bare metal

Feel free to fork this code and run it yourself, simply install the dependencies, create your .env file and run the linklogger.py file.

Docker

Use the docker-compose below as an example of running LinkLogger in docker.

version: '3.3'
services:
    linklogger:
        container_name: linklogger
        image: packetparker/linklogger
        network_mode: host
        environment:
            - BASE_URL=https://your.domain
            - IP_TO_LOCATION=True
            - API_KEY=Your Key
        volumes:
            - /local/file/path:/data
        restart: unless-stopped
Variable Description Requirement
BASE_URL Redirect link for when people visit old/dead/non-existant link Required
IP_TO_LOCATION "True"/"False" Whether or not you want to IP to Location feature (requires IP2Location.io account) Required
API_KEY IP2Location.io API Key Required unless IP_TO_LOCATION is "False"

API Reference

Create account/api key

Your account name functions as your API key and will only be provided to you once.
GET /signup
curl https://link.pkrm.dev/signup
POST /newlink
curl -X POST \
    -H "Content-type: application/json" \
    -H "Authorization: Bearer YOUR_ACCOUNT_NAME" \
    -d '{"redirect_link": "YOUR_LINK_OF_CHOICE"}' \
    https://link.pkrm.dev/newlink
curl -X POST \
    -H "Authorization: Bearer YOUR_ACCOUNT_NAME" \
    https://link.pkrm.dev/links

Get all logs

POST /records
curl -X POST \
    -H "Authorization: Bearer YOUR_ACCOUNT_NAME" \
    https://link.pkrm.dev/records
POST /<link>/records
curl -X POST \
    -H "Authorization: Bearer YOUR_ACCOUNT_NAME" \
    https://link.pkrm.dev/<link>/delete
POST /<link>/Renew
curl -X POST \
    -H "Authorization: Bearer YOUR_ACCOUNT_NAME" \
    https://link.pkrm.dev/<link>/renew
POST /<link>/records
curl -X POST \
    -H "Authorization: Bearer YOUR_ACCOUNT_NAME" \
    https://link.pkrm.dev/<link>/records
Description
Link shortener & IP Logger
https://link.pkrm.dev
Readme Unlicense 548 KiB
Languages
Python 47.6%
TypeScript 33%
CSS 8.1%
Shell 4.6%
Batchfile 3.7%
Other 3%