Skip to content

Commit

Permalink
Merge pull request #14 from sygmaprotocol/mmuftic/flag-name-fix
Browse files Browse the repository at this point in the history
fix: rename flag
  • Loading branch information
MakMuftic authored May 22, 2024
2 parents 3e7faf6 + 68483cc commit ab60068
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,11 @@ Each JSON configuration file for the gateways can specify detailed settings for
```

## Authentication
Basic authentication can be enabled using the `--basic-auth` flag. The username and password should be set through environment variables `GATEWAY_USERNAME` and `GATEWAY_PASSWORD`, respectively.
Basic authentication can be enabled using the `--auth` flag. The username and password should be set through environment variables `GATEWAY_USERNAME` and `GATEWAY_PASSWORD`, respectively.

### Running the Application
To run the application with authentication:

```
DEBUG=true GATEWAY_USERNAME=myuser GATEWAY_PASSWORD=mypass go run . --config config.json --basic-auth
DEBUG=true GATEWAY_USERNAME=myuser GATEWAY_PASSWORD=mypass go run . --config config.json --auth
```
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func main() {
Value: false,
},
&cli.BoolFlag{
Name: "basic-auth",
Name: "auth",
Usage: "Enable basic authentication.",
Value: false,
},
Expand All @@ -79,7 +79,7 @@ func main() {
r.Use(middleware.Recoverer)
r.Use(middleware.Heartbeat("/health"))
// Add basic auth middleware
if cc.Bool("basic-auth") {
if cc.Bool("auth") {
username := os.Getenv("GATEWAY_USERNAME")
password := os.Getenv("GATEWAY_PASSWORD")
if username == "" || password == "" {
Expand Down

0 comments on commit ab60068

Please sign in to comment.