fwdkr.co/README.md

34 lines
1.2 KiB
Markdown
Raw Permalink Normal View History

2021-03-18 20:42:11 +01:00
# fwdkr.co
2021-03-25 11:35:40 +01:00
A custom URL shortener.
2021-03-22 20:17:58 +01:00
## Requirements
2021-03-25 11:35:40 +01:00
* PHP 7.3+
* [PHP cURL](https://www.php.net/manual/en/book.curl.php)
2021-03-25 11:35:40 +01:00
* [PHP Multibyte String](https://www.php.net/manual/en/book.mbstring.php)
2021-04-13 09:11:24 +02:00
* [PHP SQLite 3](https://www.php.net/manual/en/book.sqlite3.php)
2021-03-22 20:17:58 +01:00
2021-03-22 22:25:07 +01:00
## Development
```shell script
# Run local PHP web server
2021-04-28 13:27:15 +02:00
$> cd ./dist
2021-03-25 11:35:40 +01:00
$> php -S localhost:8080 ./index.php
2021-03-22 22:25:07 +01:00
```
2021-03-22 20:17:58 +01:00
## Installation
Copy these files into the desired directory.
There's a few hardcoded URLs in there that you'll have to fix yourself.
One day I'll create a config file for that.
The database at `.links.db` is automatically created when you visit the main page.
2023-03-28 14:06:27 +02:00
You can access the database from the command line using something like
[VisiData](https://www.visidata.org/install/).
2023-03-28 14:06:27 +02:00
## Configuration
### GoatCounter
GoatCounter is disabled unless the `.goat.token` and `.goat.url` files exist.
* Add your [GoatCounter](https://github.com/zgoat/goatcounter) API token with "Record pageviews" permission in the
`.goat.token` file.
* Add the URL of the `/count` API endpoint in `.goat.url`, e.g. `https://example.com/api/v0/count`.
* Add IP addresses that should not be counted to `.goat.ignore`, separated by newlines.