diff --git a/.gitignore b/.gitignore index 62d29b9..02cab5f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ ## Custom +dist/.goat.ignore dist/.goat.token +dist/.goat.url dist/.links.db -phpliteadmin.config.php +dist/phpliteadmin.config.php diff --git a/.links.db b/.links.db deleted file mode 100644 index e69de29..0000000 diff --git a/README.md b/README.md index 1755746..9fefce2 100644 --- a/README.md +++ b/README.md @@ -18,8 +18,16 @@ $> php -S localhost:8080 ./index.php 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. - -You may override settings from `phpliteadmin.php` in the file `phpliteadmin.config.php`. -Add your [GoatCounter](https://github.com/zgoat/goatcounter) API token with "Record pageviews" permission in the -`.goat.token` file. The database at `.links.db` is automatically created when you visit the main page. + +## Configuration +### phpLiteAdmin +You may override settings from `phpliteadmin.php` in the file `phpliteadmin.config.php`. + +### 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. diff --git a/dist/goatcounter.php b/dist/goatcounter.php index 5480f45..d97e90a 100644 --- a/dist/goatcounter.php +++ b/dist/goatcounter.php @@ -1,4 +1,25 @@