From bde40b61e6aaa7eea99d92b3c7f37b84dc13577f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemek=20Draga=C5=84czuk?= Date: Sun, 16 Feb 2020 15:51:00 +0100 Subject: [PATCH] Added documentation about authentication --- README.md | 15 ++++++++++++--- docker-compose.yml | 2 ++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index af57128..f484896 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ git clone https://github.com/draganczukp/url ``` ## Building from source Gradle 6.x.x and JDK 11 are required. Other versions are not tested -1. Build the `.jar` file +### 1. Build the `.jar` file ``` gradle build --no-daemon ``` @@ -46,11 +46,18 @@ The `--no-daemon` option means that gradle should exit as soon as the build is finished. Without it, gradle would still be running in the background in order to speed up future builds. -2. Run it +### 2. Set environment variables +```bash +export username= +export password= +export file.location= # opitonal +``` + +### 3. Run it ``` java -jar build/libs/url.jar ``` -3. Navigate to `http://localhost:4567` in your browser, add links as you wish. +### 4. Navigate to `http://localhost:4567` in your browser, add links as you wish. ## Running with docker ### `docker run` method @@ -67,6 +74,8 @@ docker run -p 4567:4567 -d url:1.0 touch ./urls.csv docker run -p 4567:4567 \ -e file.location=/urls.csv \ + -e username="username" + -e password="password" -v ./urls.csv:/urls.csv \ -d url:1.0 ``` diff --git a/docker-compose.yml b/docker-compose.yml index 764631b..b375dde 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,5 +8,7 @@ services: - 4567:4567 environment: - file.location=/urls.csv + - username=admin + - password=admin volumes: - ./urls.csv:/urls.csv \ No newline at end of file