woodpecker-ci / woodpecker-ci/plugin-git
[Feature] Use custom SSL certificate from the direct value
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 25
- Forks
- 40
- Avg merge
- 22h 23m
- Merged PRs (30d)
- 6
Description
Summary
Add a setting custom-ssl-cert (or similar name such as -body?) to give Git the custom certificate to verify the HTTPS connection.
The setting will be empty (in that case the entry should be ignored), or will contain the whole certificate in plain text.
(It may be possible to have base64-encoded string instead of direct plain text to avoid special chars and/or newline character, but I'm not sure it is necessary.)
This will be useful to write "portable" CI workflow definitions. The workflow can be run in multiple (ideally, any) Woodpecker CI services at the different network configuration, served by different admins.
Context
I'd like my CI workflow definitions to be host-agnostic as possible.
This is because I'll move my projects around, for example I'll host it simultaneously to Forgejo in my LAN, GitLab, and GitHub, in order to accept contributions and/or to keep the project less locked in.
If things that really depend on the CI systems' configuration are needed, it should be configured on the CI system side, not the workflow definition side.
So, I'd like to avoid the things below:
- Mount host volume
- such as
/my-local-network-agent/root-ca.crt:/etc/root-ca.crt
- such as
- Depend on an internal network resources
- such as
http://my-local-server/root-ca.crt
- such as
And additionally, HTTP servers in my network are using custom CA certificates (generated by Step CA) so apps should know them to verify SSL connection (possibly from Docker container, which won't know the certificate without the volume mount).
However, currenty custom-ssl-path and custom-ssl-url requires some kind of "host- or network-dependent" setup written in the workflow.
custom-ssl-pathwill need volume mount.custom-ssl-urlwill need insecure HTTP request or the CA cert publicly exposed --- both are usually not very serious problem, but still not encouraged.
A new property to give CA cert directly, such as custom-ssl-cert, will solve the problem.
- CI server will give the CA cert string as a global variable (preferred) or repository secret.
- workflow definition will refer to them as
custom-ssl-cert: ${MY_CUSTOM_CA_CERT:-}.- In private network, this will let git verify the custom CA certificate.
- In public CI services, the string will be empty and this should have no effect.
In this way, the workflow can truly be "portable" among woodpecker hosts managed by different admins.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the existing custom-ssl-path and custom-ssl-url settings and the entry point where Git HTTPS certificate verification is configured. Add the direct certificate setting so an empty value is ignored and a provided certificate is used for verification, then verify behavior for both empty and non-empty values.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- git, go
- Domain
- ci-cd, security
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100