diff --git a/misc/MoreUsage.md b/misc/MoreUsage.md index b61e3da..fc20fbc 100644 --- a/misc/MoreUsage.md +++ b/misc/MoreUsage.md @@ -1,31 +1,60 @@ +## bash alias +You can configure an bash alias in your `~/.bashrc` like this: -# Baue die Go-Anwendung +``` +## genpasswd alias +alias genpasswd='echo $(curl -s https://passwd.scu.si/api/password)' +``` + +After making above changes you have to reload your ~/bashrc, in order to activate your changes. +``` +. ~/.bashrc +``` + +Now you can enter `genpasswd` and get a fresh password from the API Endpoint. + +# building the app + +you can build the app yourself like this: ``` go build -o password-generator ./ ``` -# Baue das Docker-Image + + +# build a docker container ``` docker build -t password-generator . ``` -# Starte den Docker Container +# start the docker container ``` docker run -p 8080:8080 password-generator ``` -## mit docker-compose +## docker-compose -Ein `docker-compose.yml` wird mitgeliefert. +There are two example docker-compose files in the [misc](./) directory. + +### docker-compose.yml + +A basic variant that just brings up the container and export port 8080. +The basic variant can be used without modifications. + +### docker-compose.traefik.yml + +The other one is meant to be used behind a traefik reverse proxy. +This variant has lables to configure traefik accordingly. +The traefik variant needs to be adjusted to your environment before +you can use it successfully. ### initial pull ``` -docker compose login gitea.scu.si docker compose pull ``` @@ -41,5 +70,13 @@ docker compose up -d docker compose down ``` +### update container + +In order to update your container to the current version, do this: +``` +docker compose pull +docker compose down +docker compose up -d +```