Add opt-in PORTAINER_INSECURE flag to skip TLS verification#19
Merged
Conversation
Portainer behind a self-signed or private certificate fails every API call with curl exit 60. Add an opt-in PORTAINER_INSECURE flag (true/1/yes) that routes --insecure into all curl calls; verification stays on by default. The test preflight detects curl exit 60 and reports a TLS-specific error naming the flag, rather than a generic unreachable-host message.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Portainer behind a self-signed or private certificate fails every API call with curl exit 60 and no recovery path, since
validate_urlacceptshttps://but no curl call could skip verification. This adds an opt-inPORTAINER_INSECUREflag (true/1/yes) that skips TLS verification; verification stays on by default.Mirrors the same treatment applied to hosaka in nopoz/hosaka#95.
Changes
load_config: builds anINSECURE_CURLarray, set to(--insecure)only on a truthy value. A boolean self-validates to the secure default, so there is no reject/warn branch (unlikePORTAINER_BACKUP_UMASK, whose validation guards a real YAML octal footgun).make_api_requestand bothcmd_testcurls splat"${INSECURE_CURL[@]}", covering every Portainer call.cmd_testpreflight captures the curl exit code;60(cert verification failed) yields a TLS-specific error namingPORTAINER_INSECUREinstead of a generic unreachable-host message.docker-compose.ymlcommented line,.portainer_config.samplecommented line.Testing
shellcheck portrieve.sh docker-entrypoint.shclean;bash -nok.true/1/yes->--insecure;false/junk/unset -> empty.set -euo pipefail.