|
@@ -9,3 +9,74 @@ _Kurz_ is yet another URL shortener.
|
|
|
* vanity domain support
|
|
|
* usage statistics
|
|
|
|
|
|
+
|
|
|
+# Installing
|
|
|
+
|
|
|
+1. Download the Kurz server to `$GOPATH/bin`
|
|
|
+ ```bash
|
|
|
+ go get code.osinet.fr/fgm/kurz/cmd/kurzd
|
|
|
+ ```
|
|
|
+1. Download the Kurz client to `$GOPATH/bin`
|
|
|
+ ```bash
|
|
|
+ go get code.osinet.fr/fgm/kurz/cmd/kurz
|
|
|
+ ```
|
|
|
+1. Configure a MySQL database for Kurz, say `osinet_kurz`
|
|
|
+1. Load the Kurz schema to the database:
|
|
|
+ ```bash
|
|
|
+ mysql -u<user> -p<password> osinet_kurz -e "source data/schema.sql;"
|
|
|
+ ```
|
|
|
+1. Create the Kurz configuration
|
|
|
+ ```bash
|
|
|
+ mkdir ~/.kurz
|
|
|
+ cp <kurz dir>/cmd/kurzd/dist.config.yml ~/.kurz/config.yml
|
|
|
+ vi ~/.kurz/config.yml
|
|
|
+1. Edit the configuration and save it.
|
|
|
+1. Discover the server syntax:
|
|
|
+ ```bash
|
|
|
+ kurzd help
|
|
|
+ ```
|
|
|
+
|
|
|
+
|
|
|
+# Runnning the Kurz server
|
|
|
+
|
|
|
+```bash
|
|
|
+kurzd
|
|
|
+```
|
|
|
+
|
|
|
+
|
|
|
+# Operating the Kurz server
|
|
|
+## Backing up
|
|
|
+
|
|
|
+```bash
|
|
|
+kurzd export config > some_config_backup_file.yml
|
|
|
+kurzd export content > some_content_backup_file.yml
|
|
|
+```
|
|
|
+
|
|
|
+This will need some automation, like cron, to trigger backups and ensure backups
|
|
|
+rotation, as well as removal on uninstall.
|
|
|
+
|
|
|
+
|
|
|
+## Logging
|
|
|
+
|
|
|
+Kurzd [logs to stdout], so any production deployment will need to set up logs
|
|
|
+acquisition and storage, with rotation, and remove them on uninstall. This is
|
|
|
+normally part of a SystemD - or equivalent - service configuration.
|
|
|
+
|
|
|
+[logs to stdout]: https://12factor.net/logs
|
|
|
+
|
|
|
+
|
|
|
+# Uninstalling
|
|
|
+
|
|
|
+1. Drop the Kurz database
|
|
|
+ ```bash
|
|
|
+ mysql -u<user> -p<password> -e "drop database osinet_kurz;"
|
|
|
+ ```
|
|
|
+1. If the database used a specific user/password, remove them from the database server
|
|
|
+1. Remove the Kurz configuration
|
|
|
+ ```bash
|
|
|
+ rm ~/.kurz/config.yml
|
|
|
+ ```
|
|
|
+1. Remove Kurz binaries (assuming an single-component `$GOPATH`)
|
|
|
+ ```bash
|
|
|
+ rm $GOPATH/bin/kurz*
|
|
|
+ ```
|