Skip to content

Commit

Permalink
Adding traefikHost parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
pieterbrandsen committed Jul 26, 2023
1 parent a351bee commit 942863a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 6 additions & 0 deletions src/setup/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit 942863a

Please sign in to comment.