{"id":15127605,"url":"https://github.com/fescobar/allure-docker-service","last_synced_at":"2025-05-16T13:07:34.875Z","repository":{"id":32808221,"uuid":"142137642","full_name":"fescobar/allure-docker-service","owner":"fescobar","description":"This docker container allows you to see up to date reports simply mounting your \"allure-results\" directory in the container (for a Single Project) or your \"projects\" directory (for Multiple Projects). Every time appears new results (generated for your tests), Allure Docker Service will detect those changes and it will generate a new report automatically (optional: send results / generate report through API), what you will see refreshing your browser.","archived":false,"fork":false,"pushed_at":"2024-08-16T10:51:10.000Z","size":25498,"stargazers_count":700,"open_issues_count":31,"forks_count":200,"subscribers_count":22,"default_branch":"master","last_synced_at":"2025-04-09T08:06:22.323Z","etag":null,"topics":["allure","allure-api","allure-docker","allure-docker-service","allure-framework","allure-server","allure2","api","automation","docker","docker-compose","docker-container","emailable-report","kubernetes","report","report-generator","reporting","reporting-tool","testing","testing-tools"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fescobar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-07-24T09:40:35.000Z","updated_at":"2025-04-08T16:53:47.000Z","dependencies_parsed_at":"2024-11-29T17:03:23.800Z","dependency_job_id":"b0739c37-9416-4272-86e8-7f0cecbe40de","html_url":"https://github.com/fescobar/allure-docker-service","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fescobar%2Fallure-docker-service","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fescobar%2Fallure-docker-service/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fescobar%2Fallure-docker-service/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fescobar%2Fallure-docker-service/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fescobar","download_url":"https://codeload.github.com/fescobar/allure-docker-service/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254535829,"owners_count":22087399,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["allure","allure-api","allure-docker","allure-docker-service","allure-framework","allure-server","allure2","api","automation","docker","docker-compose","docker-container","emailable-report","kubernetes","report","report-generator","reporting","reporting-tool","testing","testing-tools"],"created_at":"2024-09-26T02:05:00.797Z","updated_at":"2025-05-16T13:07:34.852Z","avatar_url":"https://github.com/fescobar.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![](resources/allure.png)](http://allure.qatools.ru/)\n[![](resources/docker.png)](https://docs.docker.com/)\n\n# ALLURE DOCKER SERVICE\n[![](https://github.com/fescobar/allure-docker-service/actions/workflows/docker-publish.yml/badge.svg?branch=master)](https://github.com/fescobar/allure-docker-service/actions?query=branch%3Amaster)\n\n![](https://img.shields.io/docker/pulls/frankescobar/allure-docker-service)\n\nTable of contents\n=================\n   * [FEATURES](#FEATURES)\n      * [Docker Hub](#docker-hub)\n      * [Docker Versions](#docker-versions)\n   * [USAGE](#USAGE)\n      * [Generate Allure Results](#generate-allure-results)\n      * [ALLURE DOCKER SERVICE](#allure-docker-service-1)\n          * [SINGLE PROJECT - LOCAL REPORTS](#SINGLE-PROJECT---LOCAL-REPORTS)\n            * [Single Project - Docker on Unix/Mac](#single-project---docker-on-unixmac)\n            * [Single Project - Docker on Windows (Git Bash)](#single-project---docker-on-windows-git-bash)\n            * [Single Project - Docker Compose](#single-project---docker-compose)\n          * [MULTIPLE PROJECTS - REMOTE REPORTS](#MULTIPLE-PROJECTS---REMOTE-REPORTS)\n            * [Multiple Project - Docker on Unix/Mac](#multiple-project---docker-on-unixmac)\n            * [Multiple Project - Docker on Windows (Git Bash)](#multiple-project---docker-on-windows-git-bash)\n            * [Multiple Project - Docker Compose](#multiple-project---docker-compose)\n            * [Creating our first project](#creating-our-first-project)\n      * [PORT 4040 Deprecated](#port-4040-deprecated)\n      * [Known Issues](#known-issues)\n      * [Opening \u0026 Refreshing Report](#opening--refreshing-report)\n      * [New User Interface](#new-user-interface)\n      * [Deploy using Kubernetes](#deploy-using-kubernetes)\n      * [Extra options](#extra-options)\n          * [Allure API](#allure-api)\n            * [Info Endpoints](#info-endpoints)\n            * [Action Endpoints](#action-endpoints)\n            * [Project Endpoints](#project-endpoints)\n          * [Send results through API](#send-results-through-api)\n            * [Content-Type - application/json](#content-type---applicationjson)\n            * [Content-Type - multipart/form-data](#content-type---multipartform-data)\n            * [Force Project Creation Option](#force-project-creation-option)\n          * [Customize Executors Configuration](#customize-executors-configuration)\n          * [API Response Less Verbose](#api-response-less-verbose)\n          * [Switching version](#switching-version)\n          * [Switching port](#switching-port)\n          * [Updating seconds to check Allure Results](#updating-seconds-to-check-allure-results)\n          * [Keep History and Trends](#keep-history-and-trends)\n          * [Override User Container](#override-user-container)\n          * [Start in DEV Mode](#start-in-dev-mode)\n          * [Enable TLS](#enable-tls)\n          * [Enable Security](#enable-security)\n            * [Login](#login)\n            * [X-CSRF-TOKEN](#x-csrf-token)\n            * [Refresh Access Token](#refresh-access-token)\n            * [Logout](#logout)\n            * [Roles](#roles)\n            * [Make Viewer endpoints public](#make-viewer-endpoints-public)\n            * [Scripts](#scripts)\n          * [Multi-instance Setup](#multi-instance-setup)\n          * [Add Custom URL Prefix](#add-custom-url-prefix)\n          * [Optimize Storage](#optimize-storage)\n          * [Export Native Full Report](#export-native-full-report)\n          * [Customize Emailable Report](#customize-emailable-report)\n              * [Override CSS](#override-css)\n              * [Override title](#override-title)\n              * [Override server link](#override-server-link)\n              * [Develop a new template](#develop-a-new-template)\n          * [Allure Customized Plugins](#allure-customized-plugins)\n          * [Allure Options](#allure-options)\n   * [SUPPORT](#SUPPORT)\n      * [Gitter](#gitter)\n   * [DOCKER GENERATION (Usage for developers)](#docker-generation-usage-for-developers)\n\n## FEATURES\nAllure Framework provides you good looking reports for automation testing.\nFor using this tool is required to install a server. You could have this server running on Jenkins or if you want to see reports locally, you need to run some commands on your machine. This work results tedious, at least for me :)\n\nFor that reason, this docker container allows you to see up to date reports simply mounting your `allure-results` directory (for a Single Project) or your `projects` directory (for Multiple Projects). Every time appears new results (generated for your tests), Allure Docker Service will detect those changes and it will generate a new report automatically (optional: send results / generate report through API), what you will see refreshing your browser.\n\n- Useful for developers who wants to run tests locally and want to see what were the problems during regressions.\n- Useful for the team to check the tests status for every project.\n\n### Docker Hub\n- Repository: [frankescobar/allure-docker-service](https://hub.docker.com/r/frankescobar/allure-docker-service/)\n\n### Docker Versions\nDocker container versions are based on binary [Allure 2 releases](https://github.com/allure-framework/allure2/releases/)\n\n#### Image Variants\nAllure Docker Service supports architectures amd64, arm32v7 and arm64v8.\n\n- Tags: https://hub.docker.com/r/frankescobar/allure-docker-service/tags\n\nThe following table shows the variation of provided images.\n\n|**Tag**         |**Base Image**                              |**Arch** | **OS** |\n|----------------|--------------------------------------------|---------|--------|\n| 0.20.7-amd64   | amd64/adoptopenjdk:11-jre-openj9-bionic    | amd64   | ubuntu |\n| 0.20.7-arm32v7 | arm32v7/adoptopenjdk:11-jdk-hotspot-bionic | arm32v7 | ubuntu |\n| 0.20.7-arm64v8 | arm64v8/adoptopenjdk:11-jre-hotspot-bionic | arm64v8 | ubuntu |\n\nThe following table shows the provided Manifest Lists.\n\n| **Tag**                                | **allure-docker-service Base Image**              |\n|----------------------------------------|---------------------------------------------------|\n| latest, 2.27.0                         | frankescobar/allure-docker-service:2.27.0-amd64   |\n|                                        | frankescobar/allure-docker-service:2.27.0-arm32v7 |\n|                                        | frankescobar/allure-docker-service:2.27.0-arm64v8 |\n\n## USAGE\n### Generate Allure Results\nFirst at all it's important to be clear. This container only generates reports based on results. You have to generate allure results according to the technology what are you using.\n\nReference: https://github.com/fescobar/allure-docker-service-examples\n\nWe have some examples projects:\n- [allure-docker-java-testng-example](https://github.com/fescobar/allure-docker-service-examples/tree/master/allure-docker-java-testng-example)\n- [allure-docker-java-junit4-example](https://github.com/fescobar/allure-docker-service-examples/tree/master/allure-docker-java-junit4-example)\n- [allure-docker-java-cucumber-jvm-example](https://github.com/fescobar/allure-docker-service-examples/tree/master/allure-docker-java-cucumber-jvm-example)\n- [allure-docker-nodejs-cucumber-example](https://github.com/fescobar/allure-docker-service-examples/tree/master/allure-docker-nodejs-cucumber-example)\n- [allure-docker-nodejs-typescript-cucumber-example](https://github.com/fescobar/allure-docker-service-examples/tree/master/allure-docker-nodejs-typescript-cucumber-example)\n- [allure-docker-nodejs-typescript-mocha-example](https://github.com/fescobar/allure-docker-service-examples/tree/master/allure-docker-nodejs-typescript-mocha-example)\n- [allure-docker-python-behave-example](https://github.com/fescobar/allure-docker-service-examples/tree/master/allure-docker-python-behave-example)\n- [allure-docker-python-pytest-example](https://github.com/fescobar/allure-docker-service-examples/tree/master/allure-docker-python-pytest-example)\n- [AllureDockerCSharpExample](https://github.com/fescobar/allure-docker-service-examples/tree/master/AllureDockerCSharpExample)\n- [AllureDockerCSharpSpecFlow3Example](https://github.com/fescobar/allure-docker-service-examples/tree/master/AllureDockerCSharpSpecFlow3Example)\n\nIn this case we are going to generate results using the java project [allure-docker-java-testng-example](https://github.com/fescobar/allure-docker-service-examples/tree/master/allure-docker-java-testng-example) of this repository.\n\nGo to directory [allure-docker-java-testng-example](https://github.com/fescobar/allure-docker-service-examples/tree/master/allure-docker-java-testng-example) via command line:\n\n```sh\ncd allure-docker-java-testng-example\n```\nExecute:\n\n```sh\nmvn test -Dtest=FirstTest\n```\nIf everything is OK, you should see something like this:\n\n```sh\n[INFO] -------------------------------------------------------\n[INFO]  T E S T S\n[INFO] -------------------------------------------------------\n[INFO] Running com.allure.docker.FirstTest\n13:19:03.028 [main] INFO com.allure.docker.FirstTest - test1\n13:19:03.044 [main] DEBUG io.qameta.allure.AllureLifecycle - Adding attachment to item with uuid 4b282bd9-6a0f-4fc3-a5cc-be6e8220d3c6\n13:19:03.124 [main] INFO com.allure.docker.FirstTest - test2\n13:19:03.133 [main] DEBUG io.qameta.allure.AllureLifecycle - Adding attachment to item with uuid e2097440-e9e8-46e9-8b9d-09467b5a49b1\n[ERROR] Tests run: 2, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 1.702 s \u003c\u003c\u003c FAILURE! - in com.allure.docker.FirstTest\n[ERROR] test2(com.allure.docker.FirstTest)  Time elapsed: 0.028 s  \u003c\u003c\u003c FAILURE!\njava.lang.AssertionError: FAILURE ON PURPOSE\n        at com.allure.docker.FirstTest.test2(FirstTest.java:37)\n\n[INFO]\n[INFO] Results:\n[INFO]\n[ERROR] Failures:\n[ERROR]   FirstTest.test2:37 FAILURE ON PURPOSE\n[INFO]\n[ERROR] Tests run: 2, Failures: 1, Errors: 0, Skipped: 0\n[INFO]\n[INFO] ------------------------------------------------------------------------\n[INFO] BUILD FAILURE\n[INFO] ------------------------------------------------------------------------\n[INFO] Total time:  4.600 s\n[INFO] Finished at: 2019-09-16T13:19:03+01:00\n[INFO] ------------------------------------------------------------------------\n```\n\nThere are 2 tests, one of them failed. Now you can see the `allure-results` diretory was created inside of [allure-docker-java-testng-example](https://github.com/fescobar/allure-docker-service-examples/tree/master/allure-docker-java-testng-example) project.\n\nJust it has left 1 step more. You have to run `allure-docker-service` mounting your `allure-results` directory.\n\nStart the container for a single project -\u003e [SINGLE PROJECT - LOCAL REPORTS](#SINGLE-PROJECT---LOCAL-REPORTS)\n\n### ALLURE DOCKER SERVICE\nDocker Image: https://hub.docker.com/r/frankescobar/allure-docker-service/\n\n|  **Project Type**   |  **Port**  |       **Volume Path**     |  **Container Volume Path**   |\n|---------------------|------------|---------------------------|------------------------------|\n|  Single Project     |    5050    |   ${PWD}/allure-results   |    /app/allure-results       |\n|                     |            |   ${PWD}/allure-reports   |    /app/default-reports      |\n|  Multiple Projects  |    5050    |   ${PWD}/projects         |    /app/projects             |\n\nTo improve the navigability is recommended to install an Extension/AddOn in your browser:\n- Google Chrome \u003e  JSONView \u003e https://chrome.google.com/webstore/detail/jsonview/chklaanhfefbnpoihckbnefhakgolnmc?hl=en\n- Mozilla Firefox \u003e JSONView \u003e https://addons.mozilla.org/en-US/firefox/addon/jsonview/\n\nNOTE:\n- Check the [New User Interface](#new-user-interface)\n\n#### SINGLE PROJECT - LOCAL REPORTS\nThis option is recommended for local executions. You should attach the volume where your results are being generated locally for your automation project. \n\nAll the information related local executions will be stored in the `default` project what is created when you start the container. You can see the complete info using the `GET /projects/default` endpoint:\n\n- http://localhost:5050/allure-docker-service/projects/default\n\n##### Single Project - Docker on Unix/Mac\nFrom this directory [allure-docker-java-testng-example](https://github.com/fescobar/allure-docker-service-examples/tree/master/allure-docker-java-testng-example) execute next command:\n```sh\n      docker run -p 5050:5050 -e CHECK_RESULTS_EVERY_SECONDS=3 -e KEEP_HISTORY=1 \\\n                 -v ${PWD}/allure-results:/app/allure-results \\\n                 -v ${PWD}/allure-reports:/app/default-reports \\\n                 frankescobar/allure-docker-service\n```\n\n##### Single Project - Docker on Windows (Git Bash)\nFrom this directory [allure-docker-java-testng-example](https://github.com/fescobar/allure-docker-service-examples/tree/master/allure-docker-java-testng-example) execute next command:\n```sh\n      docker run -p 5050:5050 -e CHECK_RESULTS_EVERY_SECONDS=3 -e KEEP_HISTORY=1 \\\n                 -v \"/$(pwd)/allure-results:/app/allure-results\" \\\n                 -v \"/$(pwd)/allure-reports:/app/default-reports\" \\\n                 frankescobar/allure-docker-service\n```\n\n##### Single Project - Docker Compose\nUsing docker-compose is the best way to manage containers: [allure-docker-java-testng-example/docker-compose.yml](https://github.com/fescobar/allure-docker-service-examples/blob/master/allure-docker-java-testng-example/docker-compose.yml)\n\n```sh\nversion: '3'\nservices:\n  allure:\n    image: \"frankescobar/allure-docker-service\"\n    environment:\n      CHECK_RESULTS_EVERY_SECONDS: 1\n      KEEP_HISTORY: 1\n    ports:\n      - \"5050:5050\"\n    volumes:\n      - ${PWD}/allure-results:/app/allure-results\n      - ${PWD}/allure-reports:/app/default-reports\n```\n\nFrom this directory [allure-docker-java-testng-example](https://github.com/fescobar/allure-docker-service-examples/tree/master/allure-docker-java-testng-example) execute next command:\n\n```sh\ndocker-compose up allure\n```\n\nIf you want to run in background:\n\n```sh\ndocker-compose up -d allure\n```\n\nYou can see the logs:\n\n```sh\ndocker-compose logs -f allure\n```\n\nNOTE:\n- Check the [New User Interface](#new-user-interface)\n- Read about [PORT 4040 Deprecated](#port-4040-deprecated) in case you are using previous versions.\n- The `${PWD}/allure-results` directory could be in anywhere on your machine. Your project must generate results in that directory.\n- The `/app/allure-results` directory is inside of the container. You MUST NOT change this directory, otherwise, the container won't detect the new changes.\n- The `/app/default-reports` directory is inside of the container. You MUST NOT change this directory, otherwise, the history reports won't be stored.\n\nNOTE FOR WINDOWS USERS:\n- `${PWD}` determines the current directory. This only works for [GIT BASH](https://git-scm.com/downloads). If you want to use PowerShell or CMD you need to put your full path to `allure-results` directory or find the way to get the current directory path using those tools.\n\n#### MULTIPLE PROJECTS - REMOTE REPORTS\n`Available from Allure Docker Service version 2.13.3`\n\nWith this option you could generate multiple reports for multiple projects, you can create, delete and get projects using [Project Endpoints](#project-endpoints). You can use Swagger documentation to help you.\n\nIMPORTANT NOTE:\n- For multiple projects configuration you must use `CHECK_RESULTS_EVERY_SECONDS` with value `NONE`. Otherwise, your performance machine would be affected, it could consume high memory, processors and storage. Use the endpoint `GET /generate-report` on demand after sending the results `POST /send-results`.\n- If you use automatic reports a daemom is created and it will be listening any change in the `results` directory it will generate a new report each time find a new file. The same will happen for every project. For that reason, it's convenient disable the automatic reports using the value `NONE` in `CHECK_RESULTS_EVERY_SECONDS`.\n\n##### Multiple Project - Docker on Unix/Mac\n```sh\n      docker run -p 5050:5050 -e CHECK_RESULTS_EVERY_SECONDS=NONE -e KEEP_HISTORY=1 \\\n                 -v ${PWD}/projects:/app/projects \\\n                 frankescobar/allure-docker-service\n```\n\n##### Multiple Project - Docker on Windows (Git Bash)\n```sh\n      docker run -p 5050:5050 -e CHECK_RESULTS_EVERY_SECONDS=NONE -e KEEP_HISTORY=1 \\\n                 -v \"/$(pwd)/projects:/app/projects\" \\\n                 frankescobar/allure-docker-service\n```\n\n##### Multiple Project - Docker Compose\nUsing docker-compose is the best way to manage containers: [allure-docker-multi-project-example/docker-compose.yml](https://github.com/fescobar/allure-docker-service-examples/blob/master/allure-docker-multi-project-example/docker-compose.yml)\n\n```sh\nversion: '3'\nservices:\n  allure:\n    image: \"frankescobar/allure-docker-service\"\n    environment:\n      CHECK_RESULTS_EVERY_SECONDS: NONE\n      KEEP_HISTORY: 1\n      KEEP_HISTORY_LATEST: 25\n    ports:\n      - \"5050:5050\"\n    volumes:\n      - ${PWD}/projects:/app/projects\n```\n\n```sh\ndocker-compose up allure\n```\n\nIf you want to run in background:\n\n```sh\ndocker-compose up -d allure\n```\n\nYou can see the logs:\n\n```sh\ndocker-compose logs -f allure\n```\n\nNOTE:\n- Check the [New User Interface](#new-user-interface)\n- Check [Deploy using Kubernetes](#deploy-using-kubernetes)\n- Read about [PORT 4040 Deprecated](#port-4040-deprecated) in case you are using previous versions.\n- The `/app/projects` directory is inside of the container. You MUST NOT change this directory, otherwise, the information about projects won't be stored.\n\nNOTE FOR WINDOWS USERS:\n- `${PWD}` determines the current directory. This only works for [GIT BASH](https://git-scm.com/downloads). If you want to use PowerShell or CMD you need to put your full path to `allure-results` directory or find the way to get the current directory path using those tools.\n\n\n##### Creating our first project\n\n- Creating the project `my-project-id` using the endpoint `POST /projects`:\n\n[![](resources/allure-mp00.png)](resources/allure-mp00.png)\n\n\n- You can see all the existent projects using the endpoint `GET /projects`:\n\n[![](resources/allure-mp01.png)](resources/allure-mp01.png)\n\n- The `default` project is always created automatically, it shouldn't be removed.\n\n- And get specific information using the endpoint `GET /projects/{id}`\n\n[![](resources/allure-mp02.png)](resources/allure-mp02.png)\n\n\nIf we want to generate reports for this specific project we need to use the same [Action Endpoints](#action-endpoints) that we used for a single project, but the difference now is we need to use the query parameter `project_id` to specify our new project.\n\nFor example if we want to get the `latest` report for a `single project`, generally we execute this command:\n- http://localhost:5050/allure-docker-service/latest-report    \u003e\u003e      http://localhost:5050/allure-docker-service/projects/default/reports/latest/index.html?redirect=false\n\nThis command will return the `latest` report from the `default` project as you see in the url above\n\nIf we want to get the `latest` report from our new project we need to execute this one:\n- http://localhost:5050/allure-docker-service/latest-report?project_id=my-project-id     \u003e\u003e      http://localhost:5050/allure-docker-service/projects/my-project-id/reports/latest/index.html?redirect=false\n\nYou can appreciate the difference in the path `/projects/{PROJECT_ID}/....`\n\nYou can use any [Action Endpoints](#action-endpoints), but don't forget to pass the parameter `project_id` with the right project id that you want to interact with it.\n\n'GET'      /latest-report`?project_id=my-project-id`\n\n'POST'     /send-results`?project_id=my-project-id`\n\n'GET'      /generate-report`?project_id=my-project-id`\n\n'GET'      /clean-results`?project_id=my-project-id`\n\n'GET'      /clean-history`?project_id=my-project-id`\n\n'GET'      /emailable-report/render`?project_id=my-project-id`\n\n'GET'      /emailable-report/export`?project_id=my-project-id`\n\n'GET'      /report/export`?project_id=my-project-id`\n\nWe are going to attach our volume NOT for our `local allure-results`. For this case is necessary to store the information regarding all our projects. The project structure is this one:\n```sh\nprojects\n   |-- default\n   |   |-- results\n   |   |-- reports\n   |   |   |-- latest\n   |   |   |-- ..\n   |   |   |-- 3\n   |   |   |-- 2\n   |   |   |-- 1\n   |-- my-project-id\n   |   |-- results\n   |   |-- reports\n   |   |   |-- latest\n   |   |   |-- ..\n   |   |   |-- 3\n   |   |   |-- 2\n   |   |   |-- 1\n\n```\n\nNOTE:\n- You MUST NOT MODIFY MANUALLY the structure directory of any project, you could affect the right behaviour.\n- If you don't attach your volume with the proper path `/app/projects` you will lost the information about the projects generated for you.\n\n\n### PORT 4040 Deprecated\nThe first versions of this container used port `4040` for Allure Report and port `5050` for Allure API.\n\nThe latest version includes new features `Multiple Projects` \u0026 `Navigate detailed previous history/trends`. These improvements allow us to handle multiple projects and multiple history reports.\n\nThe only change required from your side is start using only port `5050` and instead to use http://localhost:4040/ for rendering Allure report you should use http://localhost:5050/allure-docker-service/latest-report\n\nIf you are mounting your volume `-v ${PWD}/allure-results:/app/allure-results` your allure results are being used and stored in `default` project internally in the container, you don't need to change your volume path directory or do anything else. If you want to keep the history reports start to attach another path ` -v ${PWD}/allure-reports:/app/default-reports`.\n\nIf you are already using port `4040`, NO WORRIES. The Allure Report exposed in port `4040` will still being rendered for avoiding compatibility problems.\nThe only issue you will face will be when you try to navigate the HISTORY from the TREND chart or any other widget aiming to any historic data. The error you will see is `HTTP ERROR 404 NOT FOUND`\n\n|       **Version**     |  **Port**  |       **Volume Path**     |  **Container Volume Path**   |                     **Get Latest Report**                    |\n|-----------------------|------------|---------------------------|------------------------------|--------------------------------------------------------------|\n|  Previous to 2.13.3   |    4040    |   ${PWD}/allure-results   |    /app/allure-results       |   http://localhost:4040/                                     |\n|  From 2.13.3          |    5050    |   ${PWD}/allure-results   |    /app/allure-results       |   http://localhost:5050/allure-docker-service/latest-report  |\n|                       |            |   ${PWD}/allure-reports   |    /app/default-reports      |                                                              |\n\nCheck the new commands to start the container for a single project or for multiple projects: [ALLURE DOCKER SERVICE](#allure-docker-service-1)\n\n### Known Issues\n- `Permission denied` --\u003e https://github.com/fescobar/allure-docker-service/issues/108\n\n### Opening \u0026 Refreshing Report\nIf everything was OK, you will see this:\n```sh\nallure_1  | Generating default report\nallure_1  | Overriding configuration\nallure_1  | Checking Allure Results every 1 second/s\nallure_1  | Creating executor.json for PROJECT_ID: default\nallure_1  | Generating report for PROJECT_ID: default\nallure_1  | Report successfully generated to /app/allure-docker-api/static/projects/default/reports/latest\nallure_1  | Status: 200\nallure_1  | Detecting results changes for PROJECT_ID: default\nallure_1  | Automatic Execution in Progress for PROJECT_ID: default...\nallure_1  | Creating history on results directory for PROJECT_ID: default ...\nallure_1  | Copying history from previous results...\nallure_1  | Creating executor.json for PROJECT_ID: default\nallure_1  | Generating report for PROJECT_ID: default\nallure_1  | 2020-06-18 17:02:12.364:INFO::main: Logging initialized @1620ms to org.eclipse.jetty.util.log.StdErrLog\nallure_1  | Report successfully generated to /app/allure-docker-api/static/projects/default/reports/latest\nallure_1  | Storing report history for PROJECT_ID: default\nallure_1  | BUILD_ORDER:1\nallure_1  | Status: 200\n```\n\nTo see your `latest` report simply open your browser and access to:\n\n- http://localhost:5050/allure-docker-service/latest-report\n\nThe `latest` report is generated automatically and sometimes could be not available temporary until the new `latest` report has been generated. If you access to the `latest` report url when is not available you will see the `NOT FOUND` page. It will take a few seconds until the latest report be available again.\n\nWhen you use the `latest-report` will be redirected to the resource url:\n\n- http://localhost:5050/allure-docker-service/projects/default/reports/latest/index.html?redirect=false\n\nWhen you start the container for a single report, the `default` project will be created automatically, for that reason you are redirected to this endpoint to get information about `default` project, you can see this in the path `.../projects/default/...`\n\nThe `redirect=false` parameter is used to avoid be redirected to the `GET /projects/{id}` endpoint (default behaviour)\n\n\n[![](resources/allure01.png)](resources/allure01.png)\n\n[![](resources/allure02.png)](resources/allure02.png)\n\n[![](resources/allure03.png)](resources/allure03.png)\n\nNow we can run other tests without being worried about Allure server. You don't need to restart or execute any Allure command.\n\nJust go again to this directory [allure-docker-java-testng-example](https://github.com/fescobar/allure-docker-service-examples/tree/master/allure-docker-java-testng-example) via command line:\n```sh\ncd allure-docker-java-testng-example\n```\n\nAnd execute another suite test:\n```sh\nmvn test -Dtest=SecondTest\n```\nWhen this second test finished, refresh your browser and you will see there is a new report including last results tests.\n\n[![](resources/allure04.png)](resources/allure04.png)\n\n[![](resources/allure05.png)](resources/allure05.png)\n\nWe can run the same test suite again and navigate the history:\n\n[![](resources/allure06.png)](resources/allure06.png)\n\n[![](resources/allure07.png)](resources/allure07.png)\n\n[![](resources/allure08.png)](resources/allure08.png)\n\n\nYou can repeat these steps, but now execute the third and fourth test\n ```sh\nmvn test -Dtest=ThirdTest\n ```\n\n ```sh\nmvn test -Dtest=FourthTestFactory\n ```\n\n### New User Interface\nCheck the new UI\n- [https://github.com/fescobar/allure-docker-service-ui](https://github.com/fescobar/allure-docker-service-ui)\n\n[![](https://github.com/fescobar/allure-docker-service-ui/blob/master/resources/signin-allure-docker-service-ui.png?raw=true)](https://github.com/fescobar/allure-docker-service-ui/blob/master/resources/signin-allure-docker-service-ui.png?raw=true)\n\n[![](https://github.com/fescobar/allure-docker-service-ui/blob/master/resources/allure-docker-service-ui.png?raw=true)](https://github.com/fescobar/allure-docker-service-ui/blob/master/resources/allure-docker-service-ui.png?raw=true)\n\n### Deploy using Kubernetes\n[![](https://github.com/fescobar/allure-docker-service-examples/blob/master/resources/kubernetes.png?raw=true)](https://github.com/fescobar/allure-docker-service-examples/blob/master/resources/kubernetes.png?raw=true)\n\nCheck yaml definitions here:\n- [allure-docker-kubernetes-example](https://github.com/fescobar/allure-docker-service-examples/tree/master/allure-docker-kubernetes-example)\n\n\n### Extra options\n\n#### Allure API\nAvailable endpoints:\n\n##### Info Endpoints\n\n`'GET'      /version`\n\n`'GET'      /swagger`\n\n`'GET'      /swagger.json`\n\n##### Action Endpoints\n\n`'GET'      /config`\n\n`'GET'      /latest-report`\n\n`'POST'     /send-results` (admin role)\n\n`'GET'      /generate-report` (admin role)\n\n`'GET'      /clean-results` (admin role)\n\n`'GET'      /clean-history` (admin role)\n\n`'GET'      /emailable-report/render`\n\n`'GET'      /emailable-report/export`\n\n`'GET'      /report/export`\n\n\n##### Project Endpoints\n\n`'POST'     /projects` (admin role)\n\n`'GET'      /projects`\n\n`'DELETE'   /projects/{id}` (admin role)\n\n`'GET'      /projects/{id}`\n\n`'GET'      /projects/{id}/reports/{path}`\n\n`'GET'      /projects/search`\n\n##### Security Endpoints\n\n`'POST'     /login`\n\n`'POST'     /refresh`\n\n`'DELETE'    /logout`\n\n`'DELETE'    /logout-refresh-token`\n\n\nAccess to http://localhost:5050 to see Swagger documentation with examples\n\n[![](resources/allure-api.png)](resources/allure-api.png)\n\nFrom version `2.13.4` you can request an endpoint using the base path (prefix) `/allure-docker-service/`:\n\n```sh\ncurl http://localhost:5050/allure-docker-service/version\n```\nor you can request without the prefix like in previous versions\n\n```sh\ncurl http://localhost:5050/version\n```\n\nFor accessing `Security Endpoints`, you have to enable the security. Check [Enable Security](#enable-security) section.\n\n#### Send results through API\n`Available from Allure Docker Service version 2.12.1`\n\nAfter running your tests, you can execute any script to send the generated results from any node/agent/machine to the Allure Docker server container using the [Allure API](#allure-api). Use the endpoint `POST /send-results`.\n\nYou have 2 options to send results:\n\n##### Content-Type - application/json\n\n- Python script: [allure-docker-api-usage/send_results.py](allure-docker-api-usage/send_results.py)\n\n```sh\npython send_results.py\n```\n\n- Python script with security enabled: [allure-docker-api-usage/send_results_security.py](allure-docker-api-usage/send_results_security.py)\n\n```sh\npython send_results_security.py\n```\n\n- Declarative Pipeline script for JENKINS: [allure-docker-api-usage/send_results_jenkins_pipeline.groovy](allure-docker-api-usage/send_results_jenkins_pipeline.groovy)\n\n- Declarative Pipeline script for JENKINS with security enabled: [allure-docker-api-usage/send_results_security_jenkins_pipeline.groovy](allure-docker-api-usage/send_results_security_jenkins_pipeline.groovy)\n\n\n- PowerShell script: [allure-docker-api-usage/send_results.ps1](allure-docker-api-usage/send_results.ps1)\n\n```sh\n./send_results.ps1\n```\n\n##### Content-Type - multipart/form-data\n`Available from Allure Docker Service version 2.13.3`\n\n- Bash script: [allure-docker-api-usage/send_results.sh](allure-docker-api-usage/send_results.sh)\n\n```sh\n./send_results.sh\n```\n\n- Bash script with security enabled: [allure-docker-api-usage/send_results_security.sh](allure-docker-api-usage/send_results_security.sh)\n\n```sh\n./send_results_security.sh\n```\nNOTE:\n\n- These scripts are sending these example results [allure-docker-api-usage/allure-results-example](allure-docker-api-usage/allure-results-example)\n\n- If you want to clean the results use the endpoint `GET /clean-results` ([Allure API](#allure-api)).\n\n##### Force Project Creation Option\n`Available from Allure Docker Service version 2.13.6`\nIf you use the query parameter `force_project_creation` with value `true`, the project where you want to send the results will be created automatically in case doesn't exist.\n\n`POST /send-results?project_id=any-unexistent-project\u0026force_project_creation=true`\n\n#### Customize Executors Configuration\n`Available from Allure Docker Service version 2.13.3`\n\nWhen you use the `GET /generate-report`, you will see this in your report:\n\n[![](resources/executor00.png)](resources/executor00.png)\n\nIf you want to change the `execution name`, you need to pass a parameter named `execution_name` with the value. Example:\n`GET /generate-report?execution_name=my-execution-name`\n\n[![](resources/executor01.png)](resources/executor01.png)\n\n\nIf you want to change the `execution from` (by default is empty), you need to pass a parameter named `execution_from` with the value. Example:\n`GET /generate-report?execution_from=http://my-jenkins-url/job/my-job/7/`\n\nThis option allow you to come back to your executor server.\n\n[![](resources/executor02.png)](resources/executor02.png)\n\n\nIf you want to change the `execution icon` (default is empty), you need to pass a parameter named `execution_type` with the value. Example:\n`GET /generate-report?execution_type=jenkins`\n\nIf the type is not recognized it will take the default icon. You can use different types like:\n- jenkins\n\n[![](resources/executor03.png)](resources/executor03.png)\n\n\n- teamcity\n\n[![](resources/executor04.png)](resources/executor04.png)\n\n\n- bamboo\n\n[![](resources/executor05.png)](resources/executor05.png)\n\n\n- gitlab\n\n[![](resources/executor06.png)](resources/executor06.png)\n\n\n- github\n\n[![](resources/executor07.png)](resources/executor07.png)\n\n\nThe icons are based on the native Allure2 Framework:\n- https://github.com/allure-framework/allure2/tree/master/allure-generator/src/main/javascript/blocks/executor-icon\n\n#### API Response Less Verbose\n`Available from Allure Docker Service version 2.13.1`\n\nEnable `API_RESPONSE_LESS_VERBOSE` environment variable if you are handling big quantities of files. This option is useful to avoid to transfer too much data when you request the API. Have in mind the json response structure will change.\n\n```sh\n    environment:\n      API_RESPONSE_LESS_VERBOSE: 1\n```\n\n\n#### Switching version\nYou can switch the version container using `frankescobar/allure-docker-service:${VERSION_NUMBER}`.\nDocker Compose example:\n```sh\n  allure:\n    image: \"frankescobar/allure-docker-service:2.27.0\"\n```\nor using latest version:\n\n```sh\n  allure:\n    image: \"frankescobar/allure-docker-service:latest\"\n```\n\nBy default it will take last version: https://hub.docker.com/r/frankescobar/allure-docker-service/tags\n\n#### Switching port\nInside of the container `Allure API` use port `5050`.\nYou can switch the port according to your convenience.\nDocker Compose example:\n```sh\n    ports:\n      - \"9292:5050\"\n```\n#### Updating seconds to check Allure Results\nUpdating seconds to check `results` directory to generate a new report up to date.\nDocker Compose example:\n```sh\n    environment:\n      CHECK_RESULTS_EVERY_SECONDS: 5\n```\nUse `NONE` value to disable automatic checking results.\nIf you use this option, the only way to generate a new report up to date it's using the [Allure API](#allure-api).\n```sh\n    environment:\n      CHECK_RESULTS_EVERY_SECONDS: NONE\n```\n\n- `CHECK_RESULTS_EVERY_SECONDS=3` It's only useful for executions in your`LOCAL` machine. With this option ENABLED the container detects any changes in the `allure-results` directory. Every time detects a new file, the container will generate a new report. The workflow will be the next:\n\n1. Start `allure-docker-service` via docker-compose mounting the `allure-results` volume that your project will use to storage the results files. It's recommended to use this configuration [SINGLE PROJECT - LOCAL REPORTS](#SINGLE-PROJECT---LOCAL-REPORTS)\n2. Generate your allure results with any Allure Framework according technology (Allure/Cucumber/Java, Allure/Specflow/C#, Allure/CucumberJS/NodeJS, etc). Your results will be stored in a directory named `allure-results` in any directory inside your project. Remember to use the same location that you are mounting when you start the docker container in the previous step. Also, never remove that `allure-results` directory, otherwise docker will lose the reference to that volume.\n3. Every time new results files are generated during every test execution, automatically the containers will detects those changes and it will generate a new report.\n4. You will see the report generated\n5. If you see multiple reports that it doesn't represent the real quantity of executions it's because the report is generated each time detects changes in the `allure-results` directory including existing previous results files in that directory. That's the reason is only useful locally.\n\n- `CHECK_RESULTS_EVERY_SECONDS=NONE`. This option is useful when you deploy `allure-docker-service` in a server and you are planning to feed results from any CI tool. With this option DISABLED the container won't detect any changes in the `allure-results` directory (Otherwise, it's higly cost if you handle multiple projects in terms of processor comsuption). The report won't be generated until you generate the report on demand using the API `GET /generate-report`. This will be the workflow:\n\nFrom any server machine:\n1. Deploy `allure-docker-service` using [Kubernetes](#deploy-using-kubernetes) or any other tool in any server. It's recommended to use this configuration [MULTIPLE PROJECTS - REMOTE REPORTS](#MULTIPLE-PROJECTS---REMOTE-REPORTS).\n2. Make sure the server is accessible from where your scripts are requesting the API.\n\nFrom your automation tests project:\n1. Request endpoint `GET /clean-results` (specify project if it's needed) to clean all existing results. This will be `BEFORE` starting any test execution.\n2. Execute your tests and generate your allure results with any Allure Framework according technology (Allure/Cucumber/Java, Allure/Specflow/C#, Allure/CucumberJS/NodeJS, etc).\n3. Once all your tests were executed, send all your results generated recently using the endpoint `POST /send-results` (specify project if it's needed).\n4. You won't see any report generated because at the moment you have only your results stored in the container.\n5. Now that you have all the info (allure results files) in the server, you can request the endpoint `GET /generate-report`. This action will build the report to be show.\n\n\nNOTE:\n- Scripts to interact with the API:  [Send results through API](#send-results-through-api) (Check commented code in the scripts).\n\n- If you execute `GET /generate-report` endpoint after every test execution, you will see multiple reports that doesn't represent your executions, that is because the container is building the report taking in count existing results files. For that reason, we use the `GET /clean-results` endpoint before starting any new execution to delete all results not related the current execution.\n\nResume:\n```sh\n---EXECUTION 1---\n1. Clean results files to avoid data from previous results files - GET /clean-results\n2. Execute Suite1\n3. Execute Suite2\n4. Execute Suite3\n5. Wait for all suites to finish\n6. Send results using endpoints - POST /send-results\n7. Generate report using endpoint - GET /generate-report\nReport will include all suites results from this execution.\n\n---EXECUTION 2---\nSame steps from previous execution (don't forget to clean results first)\n```\n\n#### Keep History and Trends\n`Available from Allure Docker Service version 2.12.1`\n\nEnable `KEEP_HISTORY` environment variable to work with history \u0026 trends\n\nDocker Compose example:\n```sh\n    environment:\n      KEEP_HISTORY: \"TRUE\"\n```\nFrom version `2.13.4` you can also use as value `1`\n```sh\n    environment:\n      KEEP_HISTORY: 1\n```\n \nIf you want to clean the history use the [Allure API](#allure-api).\n\nAllure framework allow you to see the latest 20 executions in the history https://github.com/allure-framework/allure2/pull/1059\n\n[![](resources/allure-history-visually-limited-01.png)](resources/allure-history-visually-limited-01.png)\n\n`Available from Allure Docker Service version 2.13.3`\n\nYou can access to previous history clicking on the Allure image in the report. If the report is not available you will be redirected to the endpoint `GET /projects/{id}`\n\n[![](resources/allure-history-visually-limited-02.png)](resources/allure-history-visually-limited-02.png)\n\n\nAlso, `Allure Docker Service` by default keeps the latest 20 executions in the history, but you can extend that limit:\n```sh\n    environment:\n      KEEP_HISTORY_LATEST: 28\n```\n\n[![](resources/allure-docker-service-history-28.png)](resources/allure-docker-service-history-28.png)\n\n\nor you can reduce it\n```sh\n    environment:\n      KEEP_HISTORY_LATEST: 10\n```\n\n[![](resources/allure-docker-service-history-10.png)](resources/allure-docker-service-history-10.png)\n\nThe `latest` directory contains the report from the last execution. On this case, the `29` directory contains the same report in the `latest` directory:\n\n[![](resources/allure-docker-service-history-latest-and-last-execution.png)](allure-docker-service-history-latest-and-last-execution.png)\n\n\n#### Override User Container\n`Available from Allure Docker Service version 2.13.1`\n\nOverride the user container in case your platform required it. The container must have permissions to create files inside directories like `allure-results` (Single Project) or `projects` (Multiple Project) or any other directory that you want to mount.\n\n`1000:1000` is the user:group for `allure` user\n\nDocker Compose example:\n```sh\n    user: 1000:1000\n    environment:\n      ...\n```\nor you can pass the current user using environment variable\n```sh\n    user: ${MY_USER}\n    environment:\n      ...\n```\n```sh\nMY_USER=$(id -u):$(id -g) docker-compose up -d allure\n```\n\nor from Docker you can use parameter `--user`\n```sh\ndocker run --user=\"$(id -u):$(id -g)\" -p 5050:5050 -e CHECK_RESULTS_EVERY_SECONDS=3 -e KEEP_HISTORY=\"TRUE\" \\\n           -v ${PWD}/allure-results:/app/allure-results \\\n           -v ${PWD}/allure-reports:/app/default-reports \\\n           frankescobar/allure-docker-service\n```\n\nNote: It's not a good practice to use `root` user to manipulate containers.\n\nReference: \n- https://snyk.io/blog/10-docker-image-security-best-practices/\n\n#### Start in DEV Mode\n`Available from Allure Docker Service version 2.13.3`\n\nEnable dev mode, if you want to see the logs about api requests using the `DEV_MODE` environment variable.\n\nDocker Compose example:\n```sh\n    environment:\n      DEV_MODE: 1\n```\nNOTE:\n- Don't use this mode for live/prod environments.\n\n#### Enable TLS\n`Available from Allure Docker Service version 2.13.4`\n\nEnable TLS, if you want to implement `https` protocol using the `TLS` environment variable.\n\nDocker Compose example:\n```sh\n    environment:\n      TLS: 1\n```\n#### Enable Security\n`Available from Allure Docker Service version 2.13.5`\n\nIf you are going to publish this API, this feature MUST BE USED TOGETHER with [Enable TLS](#enable-tls), otherwise, your tokens can be intercepted and your security could be vulnerable. When you enable TLS, the cookies credentials will be stored as `SECURE`.\n\nIt's recommended to use Allure Docker Service UI container [New User Interface](#new-user-interface) for accessing to the information without credentials problems.\n\nYou can define the `ADMIN` user credentials with env vars 'SECURITY_USER' \u0026 'SECURITY_PASS'\nAlso you need to enable the security to protect the endpoints with env var 'SECURITY_ENABLED'.\n\nDocker Compose example:\n```sh\n    environment:\n      SECURITY_USER: \"my_username\"\n      SECURITY_PASS: \"my_password\"\n      SECURITY_ENABLED: 1\n```\nWhere 'SECURITY_PASS' env var is case sensitive.\n\nNote: Check [Roles](#roles) section if you want to handle different roles.\n\nWhen the security is enabled, you will see the Swagger documentation (http://localhost:5050/allure-docker-service/swagger) updated with new security endpoints and specifying the protected endpoints.\n\nIf you try to use the endpoints `GET /projects`\n```sh\ncurl -X GET http://localhost:5050/allure-docker-service/projects -ik\n```\n\nYou will see this response\n```sh\nHTTP/1.1 401 UNAUTHORIZED\nAccess-Control-Allow-Origin: *\nContent-Length: 67\nContent-Type: application/json\nDate: Tue, 11 Aug 2020 10:31:37 GMT\nServer: waitress\n\n{\"meta_data\":{\"message\":\"Missing cookie \\\"access_token_cookie\\\"\"}}\n```\n\n##### Login\nTo access to protected endpoints you need to use the endpoint `POST /login` with the credentials configured in the initial step.\n\n```sh\ncurl -X POST http://localhost:5050/allure-docker-service/login \\\n  -H 'Content-Type: application/json' \\\n  -d '{\n    \"username\": \"my_username\",\n    \"password\": \"my_password\"\n}' -c cookiesFile -ik\n```\nWe are storing the cookies obtained in a file `cookiesFile` to use it in the next requests:\n\nNow we try to request the protected endpoints using the cookies obtained from `POST /login` endpoint.\n```sh\ncurl -X GET http://localhost:5050/allure-docker-service/projects -b cookiesFile -ik\n```\nUsing the security cookies we will have access to any endpoint protected.\n```sh\nHTTP/1.1 200 OK\nAccess-Control-Allow-Credentials: true\nAccess-Control-Allow-Origin:\nContent-Length: 606\nContent-Type: application/json\nDate: Sun, 16 Aug 2020 11:09:01 GMT\nServer: waitress\n\n{\"data\":{\"projects\":{\"default\":{\"uri\":\"http://localhost:5050/allure-docker-service/projects/default\"}}},\"meta_data\":{\"message\":\"Projects successfully obtained\"}}\n```\n\n[![](resources/allure_security_login_cookies.png)](resources/allure_security_login_cookies.png)\n\n##### X-CSRF-TOKEN\nFor example, if you try to create a new project with the security enabled with the cookies obtained in the `POST /login` endpoint\n\n```sh\ncurl -X POST \"http://localhost:5050/allure-docker-service/projects\" \\\n-H \"Content-Type: application/json\" \\\n-d '{\n  \"id\": \"my-project-id\"\n}' -b cookiesFile -ik\n```\nYou will received a 401 asking for CSRF token\n\n```sh\nHTTP/1.1 401 UNAUTHORIZED\nAccess-Control-Allow-Credentials: true\nAccess-Control-Allow-Origin:\nContent-Length: 47\nContent-Type: application/json\nDate: Mon, 17 Aug 2020 07:46:51 GMT\nServer: waitress\n\n{\"meta_data\":{\"message\":\"Missing CSRF token\"}}\n```\n\nYou need to pass the header `X-CSRF-TOKEN` (Cross-Site Request Forgery) if you request to endpoints with method type `POST`, `PUT`, `PATCH` \u0026 `DELETE`.\n\nYou can get the `X-CSRF-TOKEN` value from the cookie `csrf_access_token` which is obtained from the `POST /login` successfully response (check your cookies section).\n\nHere we are extracting the value of `csrf_access_token` cookie from the `cookiesFile` file generated with the `POST /login`\n```sh\nCRSF_ACCESS_TOKEN_VALUE=$(cat cookiesFile | grep -o 'csrf_access_token.*' | cut -f2)\necho \"csrf_access_token value: $CRSF_ACCESS_TOKEN_VALUE\"\n```\n\nOnce you get the `csrf_access_token` value you need to send it as header named `X-CSRF-TOKEN`\n\n```sh\ncurl -X POST \"http://localhost:5050/allure-docker-service/projects\" \\\n-H \"X-CSRF-TOKEN: $CRSF_ACCESS_TOKEN_VALUE\" -H \"Content-Type: application/json\" \\\n-d '{\n  \"id\": \"my-project-id\"\n}' -b cookiesFile -ik\n```\n\n```sh\nHTTP/1.1 201 CREATED\nAccess-Control-Allow-Credentials: true\nAccess-Control-Allow-Origin:\nContent-Length: 90\nContent-Type: application/json\nDate: Mon, 17 Aug 2020 07:51:37 GMT\nServer: waitress\n\n{\"data\":{\"id\":\"my-project-id\"},\"meta_data\":{\"message\":\"Project successfully created\"}}\n```\n\n[![](resources/allure_security_create_project_cookies.png)](resources/allure_security_create_project_cookies.png)\n\n\n##### Refresh Access Token\nIf you want to avoid the user login each time the access token expired, you need to refresh your token\n\nFor refreshing the access token, you have to use the `refresh_token_cookie` and `csrf_refresh_token`\n\nHere, we are extracting the value of `csrf_refresh_token` cookie from the `cookiesFile` file generated with the `POST /login` endpoint\n```sh\nCRSF_REFRESH_TOKEN_VALUE=$(cat cookiesFile | grep -o 'csrf_refresh_token.*' | cut -f2)\necho \"csrf_refresh_token value: $CRSF_REFRESH_TOKEN_VALUE\"\n```\nAfter that, we need to send `csrf_refresh_token` as header `X-CSRF-TOKEN` and the cookies file with the `-b` option.\n```sh\ncurl -X POST http://localhost:5050/allure-docker-service/refresh -H \"X-CSRF-TOKEN: $CRSF_REFRESH_TOKEN_VALUE\" -c cookiesFile -b cookiesFile -ik\n```\nWith `-c` options we are overriding the cookies file with the new tokens provided for `POST /refresh` endpoint.\n```sh\n\nHTTP/1.1 200 OK\nAccess-Control-Allow-Credentials: true\nAccess-Control-Allow-Origin:\nContent-Length: 428\nContent-Type: application/json\nDate: Mon, 17 Aug 2020 08:25:21 GMT\nServer: waitress\nSet-Cookie: access_token_cookie=eyJ0eXAiOiJKV1Qi...; HttpOnly; Path=/\nSet-Cookie: csrf_access_token=d34c2eb1-dcc5-481c-a4ad-2c499a992f65; Path=/\n\n{\"data\":{\"access_token\":\"eyJ0eXAiOiJKV1Qi...\"},\"meta_data\":{\"message\":\"Successfully token obtained\"}}\n```\n\n[![](resources/allure_security_refresh_cookies.png)](resources/allure_security_refresh_cookies.png)\n\n\nThe `Access Token` expires in 15 mins by default. You can change the default behaviour with env var `ACCESS_TOKEN_EXPIRES_IN_MINS`\n\nDocker Compose example:\n```sh\n    environment:\n      ACCESS_TOKEN_EXPIRES_IN_MINS: 30\n```\n\nAlso for development purposes, you can use the env var `ACCESS_TOKEN_EXPIRES_IN_SECONDS`\nDocker Compose example:\n```sh\n    environment:\n      ACCESS_TOKEN_EXPIRES_IN_SECONDS: 30\n```\nYou should use the `Refresh Token` to avoid the user login again.\n\nThe `Refresh` token doesn't expire by default. You can change the default behaviour with env var `REFRESH_TOKEN_EXPIRES_IN_DAYS`\nDocker Compose example:\n```sh\n    environment:\n      REFRESH_TOKEN_EXPIRES_IN_DAYS: 60\n```\n\nAlso for development purposes you can use the env var `REFRESH_TOKEN_EXPIRES_IN_SECONDS`\nDocker Compose example:\n```sh\n    environment:\n      REFRESH_TOKEN_EXPIRES_IN_SECONDS: 10\n```\n\nNOTE:\n- You can disable the expiration of any token using value 0.\n\n##### Logout\nWe have 2 endpoints:\n\nWith `DELETE /logout` your current `access_token` will be invalidated. You need to pass as header the `csrf_access_token` token.\n```sh\nCRSF_ACCESS_TOKEN_VALUE=$(cat cookiesFile | grep -o 'csrf_access_token.*' | cut -f2)\necho \"csrf_access_token value: $CRSF_ACCESS_TOKEN_VALUE\"\n\ncurl -X DELETE http://localhost:5050/allure-docker-service/logout -H \"X-CSRF-TOKEN: $CRSF_ACCESS_TOKEN_VALUE\" -b cookiesFile -ik\n```\n\n```sh\nHTTP/1.1 200 OK\nAccess-Control-Allow-Credentials: true\nContent-Length: 52\nContent-Type: application/json\nDate: Fri, 21 Aug 2020 11:17:22 GMT\nServer: waitress\n\n{\"meta_data\":{\"message\":\"Successfully logged out\"}}\n```\n\nWith `DELETE /logout-refresh-token` your current `refresh_token` will be invalidated and all cookies removed. You need to pass as header the `csrf_refresh_token` token:\n```sh\nCRSF_REFRESH_TOKEN_VALUE=$(cat cookiesFile | grep -o 'csrf_refresh_token.*' | cut -f2)\necho \"csrf_refresh_token value: $CRSF_REFRESH_TOKEN_VALUE\"\n\ncurl -X DELETE http://localhost:5050/allure-docker-service/logout-refresh-token -H \"X-CSRF-TOKEN: $CRSF_REFRESH_TOKEN_VALUE\" -b cookiesFile -ik\n```\n\n```sh\nHTTP/1.1 200 OK\nAccess-Control-Allow-Credentials: true\nContent-Length: 52\nContent-Type: application/json\nDate: Fri, 21 Aug 2020 11:47:47 GMT\nServer: waitress\nSet-Cookie: access_token_cookie=; Expires=Thu, 01-Jan-1970 00:00:00 GMT; HttpOnly; Path=/\nSet-Cookie: csrf_access_token=; Expires=Thu, 01-Jan-1970 00:00:00 GMT; Path=/\nSet-Cookie: refresh_token_cookie=; Expires=Thu, 01-Jan-1970 00:00:00 GMT; HttpOnly; Path=/\nSet-Cookie: csrf_refresh_token=; Expires=Thu, 01-Jan-1970 00:00:00 GMT; Path=/\n\n{\"meta_data\":{\"message\":\"Successfully logged out\"}}\n```\n\n##### Roles\n`Available from Allure Docker Service version 2.13.7`\n\n`SECURITY_USER` \u0026 `SECURITY_PASS` env vars are used to define the `ADMIN` user credentials who will have access to every endpoint. Also, there is another kind of user just with enough access to check the reports, this is the `VIEWER` user.\n\nYou can add this kind of user using `SECURITY_VIEWER_USER` \u0026 `SECURITY_VIEWER_PASS` env variables\nDocker Compose example:\n```sh\n    environment:\n      SECURITY_USER: \"my_username\"\n      SECURITY_PASS: \"my_password\"\n      SECURITY_VIEWER_USER: \"view_user\"\n      SECURITY_VIEWER_PASS: \"view_pass\"\n      SECURITY_ENABLED: 1\n```\nNote:\n- Always you need to define the `ADMIN` user.\n- `SECURITY_USER` \u0026 `SECURITY_VIEWER_USER` always need to be different.\n- Check [Allure API](#allure-api) to see what endpoints are exclusively for the `ADMIN` role.\n\n##### Make Viewer endpoints public\n`Available from Allure Docker Service version 2.13.8`\nIf you only want to protect the `Admin` endpoints and make public the viewer endpoints, then you can use the environment variable `MAKE_VIEWER_ENDPOINTS_PUBLIC` to make accessible the endpoints:\n\nDocker Compose example:\n```sh\n    environment:\n      SECURITY_USER: \"my_username\"\n      SECURITY_PASS: \"my_password\"\n      SECURITY_ENABLED: 1\n      MAKE_VIEWER_ENDPOINTS_PUBLIC: 1\n```\nNote:\n- With `MAKE_VIEWER_ENDPOINTS_PUBLIC` enabled, your `viewer` user (if you have someone defined) won't have effect.\n\n##### Scripts\n- Bash script with security enabled: [allure-docker-api-usage/send_results_security.sh](allure-docker-api-usage/send_results_security.sh)\n```sh\n./send_results_security.sh\n```\n\n- Python script with security enabled: [allure-docker-api-usage/send_results_security.py](allure-docker-api-usage/send_results_security.py)\n\n```sh\npython send_results_security.py\n```\n\n- Declarative Pipeline script for JENKINS with security enabled: [allure-docker-api-usage/send_results_security_jenkins_pipeline.groovy](allure-docker-api-usage/send_results_security_jenkins_pipeline.groovy)\n\n#### Multi-instance Setup\n`Available from Allure Docker Service version 2.18.0`\nIf you wish to use a setup with multiple instances, you will need to set `JWT_SECRET_KEY` env variables. Otherwise, requests may respond with `Invalid Token - Signature verification failed`.\n\n#### Add Custom URL Prefix\n`Available from Allure Docker Service version 2.13.5`\n\nConfigure an url prefix if your deployment requires it (e.g. reverse proxy with nginx)\n```sh\n    environment:\n      URL_PREFIX: \"/my-prefix\"\n```\n\nWith this configuration you can request the API in this way too:\n```sh\ncurl http://localhost:5050/my-prefix/allure-docker-service/version\n```\n\nHere's an example config for nginx where `allure` is the name of the docker container\n```\nserver {\n    listen 443 ssl;\n    ssl_certificate     /certificate.cer;\n    ssl_certificate_key /certificate.key;\n    location /my-prefix/ {\n        proxy_pass http://allure:5050;\n        proxy_set_header  Host $host;\n        proxy_set_header  X-Real-IP $remote_addr;\n        proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;\n        proxy_set_header  X-Forwarded-Host $server_name;\n    }\n}\n```\nNOTE:\n- This feature is not supported when DEV_MODE is enabled.\n\n#### Optimize Storage\n`Available from Allure Docker Service version 2.13.7`\n\n`---EXPERIMENTAL FEATURE---`\n\nWhen Allure generates reports, commonly created these files per report:\n```sh\nprojects\n   |-- default\n   |   |-- results\n   |   |-- reports\n   |   |   |-- latest\n   |   |   |   |-- data\n   |   |   |   |-- export\n   |   |   |   |-- history\n   |   |   |   |-- plugins\n   |   |   |   |-- widgets\n   |   |   |   |-- favicon.icon\n   |   |   |   |-- index.html\n   |   |   |   |-- app.js\n   |   |   |   |-- styles.css\n   |   |   |-- ..\n```\nThe heaviest files are `app.js` \u0026 `styles.css`. They never changed their content.\nWhen you enable the option `OPTIMIZE_STORAGE` those files are not stored in your `reports` directory, but they are consumed from a common location inside the container.\n\nDocker Compose example:\n```sh\n    environment:\n      OPTIMIZE_STORAGE: 1\n```\nUsing this feature, your storage consumption will be reduce drastically.\n\nNOTE:\n- This feature doesn't have a warranty to work with reports generated with different Allure native versions. For example, if any code is removed from `app.js` or `styles.css` (from a newer version of the native Allure application) that you need to render your reports generated with previous versions, your report couldn't be rendered, you will see a javascript error finding for a component that doesn't exist anymore.\n\n\n#### Export Native Full Report\n`Available from Allure Docker Service version 2.13.1`\n\nYou can export the native full report using the endpoint `GET /report/export` [Allure API](#allure-api).\n\n[![](resources/native-full-report.png)](resources/native-full-report.png)\n\n\n\n#### Customize Emailable Report\n`Available from Allure Docker Service version 2.12.1`\n\nYou can render and export the emailable report using the endpoints `GET /emailable-report/render` and `GET ​/emailable-report​/export` [Allure API](#allure-api).\n\n[![](resources/emailable-report.png)](resources/emailable-report.png)\n\n##### Override CSS\nBy default this report template is using Bootstrap css. If you want to override the css, just you need to pass the enviroment variable `EMAILABLE_REPORT_CSS_CDN`. Docker Compose example:\n\n```sh\n    environment:\n      EMAILABLE_REPORT_CSS_CDN: \"https://stackpath.bootstrapcdn.com/bootswatch/4.3.1/sketchy/bootstrap.css\"\n```\n\n[![](resources/emailable-report-custom.png)](resources/emailable-report-custom.png)\n\nYou can use all these themes: https://bootswatch.com/ or any other boostrap css like https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.css\n\n##### Override title\nIf you want override the title of the Emailable Report, just you need to pass the environment variable `EMAILABLE_REPORT_TITLE`.\n\n```sh\n    environment:\n      EMAILABLE_REPORT_TITLE: \"My Title\"\n```\n\n[![](resources/emailable-report-title.png)](resources/emailable-report-title.png)\n\n##### Override server link\n`Functionality Deprecated`\n- Currently the latest version resolves the host automatically.\n\n---\n\nIf you want the Emailable Report to redirect to your Allure server, just you need to pass the environment variable `SERVER_URL`.\n\n```sh\n    environment:\n      SERVER_URL: \"http://my-domain.com/allure-docker-service/latest-report\"\n```\n\n[![](resources/emailable-report-server-link.png)](resources/emailable-report-server-link.png)\n\n\n##### Develop a new template\nIf you want to develop a new template, create a local directory (`my-template` as example) with a file named `default.html`. In that file you can create your own html template, you can use as guide this example: [allure-docker-api/templates/default.html](allure-docker-api/templates/default.html) using [Jinja](https://jinja.palletsprojects.com/en/2.10.x/templates/) syntax. Don't rename your local template, always the file must be named `default.html`.\n\nMount that directory to the container like in the example and pass the environment variable `FLASK_DEBUG` with value `1`.\nThis variable will allow you to use `hot reloading`, you can update the content of `default.html` locally and use the endpoint `emailable-report/render` ([Allure API](#allure-api)) to see your changes applied in the browser.\n\n```sh\n    environment:\n      FLASK_DEBUG: 1\n    volumes:\n    - ${PWD}/my-template:/app/allure-docker-api/templates\n```\n\n#### Allure Customized Plugins\nIf you want to use your own Allure plugins you can mount your plugin directory\n```sh\n    environment:\n      ...\n    volumes:\n    - ${PWD}/my-plugin:/allure/plugins/my-plugin\n```\n\nReferences:\n- https://docs.qameta.io/allure/#_allure_plugins_system\n\n#### Allure Options\nSome frameworks/adaptors don't support allure properties to set up links for `Tracker Management Systems` or `Issue/Bug Trackers`. In that case you need to set up `ALLURE_OPTS` environment variable:\n- For Allure1 (XML results)\n```sh\n    environment:\n      CHECK_RESULTS_EVERY_SECONDS: 1\n      ALLURE_OPTS: \"-Dallure.tests.management.pattern=https://example.org/tms/%s -Dallure.issues.tracker.pattern=https://example.org/issue/%s\"\n```\n- For Allure2 (JSON results). Generally it's not necessary to do this because the properties are configured it in the adaptor/framework and stored in `allure-results` directory. The properties format is different:\n```sh\nallure.link.mylink.pattern=https://example.org/mylink/{}\nallure.link.issue.pattern=https://example.org/issue/{}\nallure.link.tms.pattern=https://example.org/tms/{}\n```\nReference:\n- https://docs.qameta.io/allure/#_test_management_and_bug_tracking_systems_integrations\n- https://www.swtestacademy.com/allure-testng/\n- https://docs.qameta.io/allure/#_configuration\n- https://docs.qameta.io/allure/#_config_samples\n- https://docs.qameta.io/allure/#_job_dsl_plugin\n\n## SUPPORT\n### Gitter\n[![Gitter](https://badges.gitter.im/allure-docker-service/community.svg)](https://gitter.im/allure-docker-service/community?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge)\n\n\n## DOCKER GENERATION (Usage for developers)\n### Install Docker\n```sh\nsudo apt-get update\n```\n```sh\nsudo apt install -y docker.io\n```\nIf you want to use docker without sudo, read following links:\n- https://docs.docker.com/engine/installation/linux/linux-postinstall/#manage-docker-as-a-non-root-user\n- https://stackoverflow.com/questions/21871479/docker-cant-connect-to-docker-daemon\n\n### Develop locally with Docker-Compose\n```sh\ndocker-compose -f docker-compose-dev.yml up --build\n```\n### Build image\n```sh\ndocker build -t allure-release -f docker-custom/Dockerfile.bionic-custom --build-arg ALLURE_RELEASE=2.27.0 .\n```\n### Run container\n```sh\ndocker run -d  -p 5050:5050 allure-release\n```\n### See active containers\n```sh\ndocker container ls\n```\n### Access to container\n```sh\ndocker exec -it ${CONTAINER_ID} bash\n```\n### Access to logs\n```sh\ndocker exec -it ${CONTAINER_ID} tail -f log\n```\n### Remove all containers\n```sh\ndocker container rm $(docker container ls -a -q) -f\n```\n### Remove all images\n```sh\ndocker image rm $(docker image ls -a -q)\n```\n### Remove all stopped containers\n```sh\ndocker ps -q -f status=exited | xargs docker rm\n```\n### Remove all dangling images\n```sh\ndocker images -f dangling=true | xargs docker rmi\n```\n### Register tagged image (Example)\n```sh\ndocker login\ndocker tag allure-release frankescobar/allure-docker-service:${PUBLIC_TAG}\ndocker push frankescobar/allure-docker-service\n```\n### Register latest image (Example)\n```sh\ndocker tag allure-release frankescobar/allure-docker-service:latest\ndocker push frankescobar/allure-docker-service\n```\n### Download latest image registered (Example)\n```sh\ndocker run -d  -p 5050:5050 frankescobar/allure-docker-service\n```\n### Download specific tagged image registered (Example)\n```sh\ndocker run -d -p 5050:5050 frankescobar/allure-docker-service:2.27.0\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffescobar%2Fallure-docker-service","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffescobar%2Fallure-docker-service","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffescobar%2Fallure-docker-service/lists"}