caprover / caprover-cli

Command Line Interface for https://github.com/caprover/caprover
72 stars 40 forks source link

Fetching build logs when using app access token #136

Closed MihailRussu closed 1 year ago

MihailRussu commented 1 year ago

Is there any reason for this snippet:

            if (machineToDeploy.appToken) {
                StdOutUtil.printMessage(
                    `Deploying ${StdOutUtil.getColoredAppName(
                        appName
                    )} using app token is in progress. Build logs aren't retrieved when using app token.\nWait a few minutes until your app is built and deployed`
                )
            } else {
                this.startFetchingBuildLogs(machineToDeploy, appName)
            }

?

It would likely be more secure to disclose just an individual app access token in the CI/CD, rather than the global CapRover instance password, but then one would be missing out on the build logs (the primary reason to use the cli in the first place).

Assuming build logs are not available for app access tokens - is there a chance that decision could be reconsidered?

githubsaturn commented 1 year ago

The block you posted is on the CLI client code. The main problem is that the endpoint for fetching logs need to whitelisted.

Even if you change the block above, it's not going to have any impact on the output, You will just see an error.

githubsaturn commented 1 year ago

Feel free to open a feature request to whitelist the build logs using the app access token.