Skip to content

Commit

Permalink
Unify env vars
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasmalkmus committed Aug 4, 2021
1 parent 128717f commit ec1129a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ COPY axiom-loki-proxy /usr/bin/axiom-loki-proxy
WORKDIR /axiom-loki-proxy

# Expose the default application port.
EXPOSE 3101/tcp
EXPOSE 8080/tcp

# Set the binary as entrypoint.
ENTRYPOINT [ "/usr/bin/axiom-loki-proxy" ]
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,19 @@ Docker images are available on [DockerHub][docker].

1. Set the following environment variables:

* `AXIOM_DEPLOYMENT_URL`: URL of the Axiom deployment to use
* `AXIOM_ACCESS_TOKEN`: **Personal Access** or **Ingest** token. Can be
* `AXIOM_TOKEN`: **Personal Access** or **Ingest** token. Can be
created under `Profile` or `Settings > Ingest Tokens`. For security reasons it
is advised to use an Ingest Token with minimal privileges only.

2. Run it: `./axiom-loki-proxy` or using docker:
When using Axiom Selfhost:

* `AXIOM_URL`: URL of the Axiom deployment to use.

2. Run it: `./axiom-loki-proxy` or using Docker:

```shell
docker run -p3101:3101/tcp \
-e=AXIOM_DEPLOYMENT_URL=<AXIOM_DEPLOYMENT_URL> \
-e=AXIOM_ACCESS_TOKEN=<AXIOM_ACCESS_TOKEN> \
docker run -p8080:8080/tcp \
-e=AXIOM_TOKEN=<YOU_AXIOM_TOKEN> \
axiomhq/axiom-loki-proxy
```

Expand Down
10 changes: 5 additions & 5 deletions cmd/axiom-loki-proxy/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import (
)

var (
deploymentURL = os.Getenv("AXIOM_DEPLOYMENT_URL")
accessToken = os.Getenv("AXIOM_ACCESS_TOKEN")
addr = flag.String("addr", ":3101", "Listen address <ip>:<port>")
deploymentURL = os.Getenv("AXIOM_URL")
accessToken = os.Getenv("AXIOM_TOKEN")
addr = flag.String("addr", ":8080", "Listen address <ip>:<port>")
)

func main() {
Expand All @@ -24,10 +24,10 @@ func main() {
flag.Parse()

if deploymentURL == "" {
log.Fatal("missing AXIOM_DEPLOYMENT_URL")
deploymentURL = axiom.CloudURL
}
if accessToken == "" {
log.Fatal("missing AXIOM_ACCESS_TOKEN")
log.Fatal("missing AXIOM_TOKEN")
}

client, err := axiom.NewClient(deploymentURL, accessToken)
Expand Down

0 comments on commit ec1129a

Please sign in to comment.