Blame | Last modification | View Log | RSS feed
Easy-RSA 3 Hacking Guide===This document is aimed at programmers looking to improve on the existingcodebase.Compatibility---The `easyrsa` code is written in POSIX shell (and any cases where it is not isconsidered a bug to be fixed.) The only exceptions are the `local` keyword andthe construct `export FOO=baz`, both well-supported.As such, modifications to the code should also be POSIX; platform-specific codeshould be placed under the `distro/` dir and listed by target platform.Coding conventions---While there aren't strict syntax standards associated with the project, pleasefollow the existing format and flow when possible; however, specific exceptionscan be made if there is a significant reason or benefit.Do try to:* Keep variables locally-scoped when possible* Comment sections of code for readability* Use the conventions for prefixes on global variables* Set editors for tab stops of 8 spaces* Use tabs for code indents; use aligned spaces for console textKeeping code, docs, and examples in sync---Changes that adjust, add, or remove features should have relevant docs, helpoutput, and examples updated at the same time.Release versioning---A point-release bump (eg: 3.0 to 3.1) is required when the frontend interfacechanges in a non-backwards compatible way. Always assume someone has anautomated process that relies on the current functionality for official(non-beta, non-rc) releases. A possible exception exists for bugfixes that dobreak backwards-compatibility; caution is to be used in such cases.The addition of a new command may or may not require a point-release dependingon the significance of the feature; the same holds true for additional optionalarguments to commands.Project layout---The project's files are structured as follows:* `easyrsa3/` is the primary project code. On Linux/Unix-alikes, all the corecode and supporting files are stored here.* `Licensing/` is for license docs.* `build/` is for build information and scripts.* `contrib/` is for externally-contributed files, such as useful externalscripts or interfaces for other systems/languages.* `distro/` is for distro-specific supporting files, such as the Windowsfrontend wrappers. Code components that are not platform-neutral should gohere.* `doc/` is for documentation. Much of this is in Markdown format which can beeasily converted to HTML for easy viewing under Windows.* `release-keys/` list current and former KeyIDs used to sign release packages(not necessarily git tags) available for download.* The top-level dir includes files for basic project info and referenceappropriate locations for more detail.As a brief note, it is actually possible to take just the easyrsa3/ dir and endup with a functional project; the remaining structure includes docs, build prep,distro-specific wrappers, and contributed files.Git conventions---As of Easy-RSA 3, the following git conventions should be used. These are mostlyuseful for people with repo access in order to keep a standard meaning to commitmessages and merge actions.### Signed-off-by: and related commit message linesCommitters with push access should ensure a `Signed-off-by:` line exists atthe end of the commit message with their name on it. This indicates that thecommitter has reviewed the changes to the commit in question and approve ofthe feature and code in question. It also helps verify the code came from anacceptable source that won't cause issues with the license.This can be automatically added by git using `git commit -s`.Additional references can be included as well. If multiple people reviewed thechange, the committer may add their names in additional `Signed-off-by:`lines; do get permission from that person before using their name, however ;)The following references may be useful as well:* `Signed-off-by:` -- discussed above, indicates review of the commit* `Author:` -- references an author of a particular feature, in full orsignificant part* `Changes-by:` -- indicates the listed party contributed changes ormodifications to a feature* `Acked-by:` -- indicates review of the feature, code, and/or functionalcorrectness### Merging from external sources (forks, patches, etc)Contributions can come in many forms: GitHub "pull requests" from clonedrepos, references to external repos, patches to the ML, or others. Those won'tnecessary have `Signed-off-by:` lines or may contain less info in the commitmessage than is desirable to explain the changes.The committing author to this project should make a merge-commit in this casewith the appropriate details provided there. If additional code changes arenecessary, this can be done on a local branch prior to merging back into themainline branch.This merge-commit should list involved contributors with `Author:` or similarlines as required. The individual commits involved in a merge also retain theoriginal committer; regardless, the merge-commit message should give a clearindication of what the entire set of commits does as a whole.### TaggingTags should follow the convention:vM.m.pwhere `M` is the major version, `m` is the minor "point-release" version, and`p` is the patch-level. Suffixes of `-rc#`, `-beta#`, etc can be added forpre-release versions as required.Currently tags are taken from the mainline development branch in question. TheChangeLog should thus be updated prior to tagging. Tags should also beannotated with an appropriate commit message and signed-off. This can be doneas shown below (don't use `-s` unless you intend to use GPG with git.)git tag -a v1.2.3Corresponding release downloads can be uploaded to release distribution pointsas required.