oxyno-zeta / s3-proxy

S3 Reverse Proxy with GET, PUT and DELETE methods and authentication (OpenID Connect and Basic Auth)
https://oxyno-zeta.github.io/s3-proxy/
Apache License 2.0
297 stars 33 forks source link

feat: add version command and allow config path #435

Closed redat00 closed 6 months ago

redat00 commented 6 months ago

Issue/Feature

Additional Information

Nothing is suppose to break, as the usage stay the same : Not specifying any command will start the server, just like it's currently done, and the default value for the configuration folder is also still the same. If I missed anything, please let me know.

The only downside of this PR is that it adds a new dependencies to the project in the form of Cobra.

Checklist:

oxyno-zeta commented 6 months ago

Hello, Thanks for your PR. I will start to review it !

redat00 commented 6 months ago

Just finished editing all the thing you mentionned. Tests are passing fine on my local setup now. Let me know if I'm still missing something. Thanks!

oxyno-zeta commented 6 months ago

Just finished editing all the thing you mentionned. Tests are passing fine on my local setup now. Let me know if I'm still missing something. Thanks!

Thanks ! I won't have a lot of time today sorry but I will start the CI as a first step.

redat00 commented 6 months ago

Thanks for the CI !

I can see that I did not properly check for the error value of the rootCmd.Execute method. The solution I can propose for this is the following :

    if err := rootCmd.Execute(); err != nil {
        fmt.Println(err)
        os.Exit(1)
    }

Do this looks fine to you ?

oxyno-zeta commented 6 months ago

Thanks for the CI !

I can see that I did not properly check for the error value of the rootCmd.Execute method. The solution I can propose for this is the following :

  if err := rootCmd.Execute(); err != nil {
      fmt.Println(err)
      os.Exit(1)
  }

Do this looks fine to you ?

Oh yes ! Linter is cool to check those :) . Yes I'm fine with it. That will through an error only when a not found command is used so it is great to not use the logger.

redat00 commented 6 months ago

No more linting error, should have ran the lint command on my local setup before committing, would have saved us some times!

oxyno-zeta commented 6 months ago

:tada: This PR is included in version 4.14.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: