بدون توضیح

Frederic G. MARAND fc25c47d9b Web UI: package registers routes. Interruptible command 'serve' for both API and UI. 6 سال پیش
.idea fc25c47d9b Web UI: package registers routes. Interruptible command 'serve' for both API and UI. 6 سال پیش
api fc25c47d9b Web UI: package registers routes. Interruptible command 'serve' for both API and UI. 6 سال پیش
cmd fc25c47d9b Web UI: package registers routes. Interruptible command 'serve' for both API and UI. 6 سال پیش
doc bf466912c5 export config command. README made useful. More admin use cases. 6 سال پیش
domain 49103a3fce Web API test refactor: simpler, more readable and more complete tests. 6 سال پیش
infrastructure 545a8d9798 Working Web API using config, as 'kurzd serve api'. 6 سال پیش
migrations 2495579d44 Infrastructure tests now use config correctly to set up test DB. 6 سال پیش
web fc25c47d9b Web UI: package registers routes. Interruptible command 'serve' for both API and UI. 6 سال پیش
.gitignore 2d10f502f4 Test redirects to be absolute. Committed .idea. 6 سال پیش
LICENSE.txt 5ba5ac0c61 First commit: README, GPLv3 license, .gitignore. 9 سال پیش
Makefile d9e3a92565 First stab at domain. 6 سال پیش
README.md cacbb5da50 Goose CLI implemented as 'kurzd migrate [command]' 6 سال پیش
go.mod 5ce586d710 Web API: GET /{short} OK, 65% coverage, POST as 501 100% coverage. 6 سال پیش
go.sum 5ce586d710 Web API: GET /{short} OK, 65% coverage, POST as 501 100% coverage. 6 سال پیش

README.md

Kurz is yet another URL shortener.

  • built as a Go API
  • web front end provided
  • multiple shortening strategies. provided:
    • 32-bits hexa string, leading 0s omitted
    • base36
    • manual selection
  • vanity domain support
  • usage statistics

Installing

  1. Download the Kurz server to $GOPATH/bin

    go get code.osinet.fr/fgm/kurz/cmd/kurzd
    
  2. Download the Kurz client to $GOPATH/bin

    go get code.osinet.fr/fgm/kurz/cmd/kurz
    
  3. Configure a MySQL database for Kurz, say osinet_kurz

  4. Create the Kurz configuration

    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

    1. Load the Kurz schema to the database:
    

    bash kurzd migrate up

    
    
    # 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.

Uninstalling

  1. Drop the Kurz database

    mysql -u<user> -p<password> -e "drop database osinet_kurz;"
    
  2. If the database used a specific user/password, remove them from the database server

  3. Remove the Kurz configuration

    rm ~/.kurz/config.yml
    
  4. Remove Kurz binaries (assuming an single-component $GOPATH)

    rm $GOPATH/bin/kurz*