diff --git a/README.md b/README.md index 9d8fdee..e69a2ef 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,7 @@ Update all .example files and/or folders to match your needs. This step is not r * `--password`: overwrite the password for the Grafana admin user * `--defaultRetention`: overwrite the default retention for the default retention polic of all not regex'd retention paths. * `--enableAnonymousAccess`: enable anonymous access to Grafana +* `--traefikHost`: use only traefik forwarding #### Network diff --git a/src/setup/setup.js b/src/setup/setup.js index 6e23a55..a9ea293 100644 --- a/src/setup/setup.js +++ b/src/setup/setup.js @@ -64,6 +64,12 @@ async function UpdateDockerComposeFile() { exampleDockerComposeText = exampleDockerComposeText.replace(/#t/g, ''); exampleDockerComposeText = exampleDockerComposeText.replace(/grafana.localhost/g, argv.grafanaDomain); } + if (argv.traefikHost) { + exampleDockerComposeText = exampleDockerComposeText.replace('#t labels:', ' labels:'); + exampleDockerComposeText = exampleDockerComposeText.replace('#t - "traefik.enable=true"', ' - "traefik.enable=true"'); + exampleDockerComposeText = exampleDockerComposeText.replace('#t - "traefik.http.routers.grafana.rule=Host(`grafana.localhost`)"', ' - "traefik.http.routers.grafana.rule=Host(`grafana.localhost`)"'); + exampleDockerComposeText = exampleDockerComposeText.replace(/grafana.localhost/g, argv.grafanaDomain); + } fs.writeFileSync(dockerComposeFile, exampleDockerComposeText); console.log('Docker-compose file created');