Skip to content
This repository has been archived by the owner on Jan 23, 2022. It is now read-only.

Latest commit

 

History

History
105 lines (72 loc) · 3.62 KB

CONTRIBUTING.md

File metadata and controls

105 lines (72 loc) · 3.62 KB

Contributing Guidelines

Contributor License Agreements

I'd love to accept your pull request! Before I can take them, we have to jump a couple of legal hurdles.

NOTE: Only original source code from you and other people that have signed the CLA can be accepted into the main repository.

Please fill out either the individual or corporate Contributor License Agreement (CLA).

  • If you are an individual writing original source code and you're sure you own the intellectual property, then you'll need to sign an individual CLA.
  • If you work for a company that wants to allow you to contribute your work, then you'll need to sign a corporate CLA.

Follow either of the two links above to access the appropriate CLA. Next, if you are ready to accept, add the following text in the body your first commit message.

  • For Individual CLA:

    I hereby consent to the Individual CLA provided in assets/cla/individual_cla.md
    
  • For Corporate CLA:

    I hereby consent to the Corporate CLA provided in assets/cla/corporate_cla.md
    

Pull Request Checklist

Before sending your pull requests, make sure you followed this list.

  1. Open an issue to discuss your PR
  2. Ensure you read appropriate Contributor License Agreement (CLA)
  3. Run unit tests

Development Environment

The contribution to portal and authorize plugins requires setting up a development environment. The following steps allow developers to test Caddy server with the plugins using local source code.

First, designate directory for building caddy with plugins, e.g. tmpcaddydev.

mkdir -p ~/tmpcaddydev
cd ~/tmpcaddydev

Second, fork the following repositories in Github into to your own Github handle, e.g. anonymous:

  • https://github.com/greenpau/caddy-auth-portal => https://github.com/anonymous/caddy-auth-portal
  • https://github.com/greenpau/caddy-authorize => https://github.com/anonymous/caddy-authorize
  • https://github.com/greenpau/caddy-trace => https://github.com/anonymous/caddy-trace
  • https://github.com/greenpau/go-identity => https://github.com/anonymous/go-identity

Provided you are in tmpcaddydev directory, clone the forked repositories:

git clone git@github.com:anonymous/caddy-auth-portal.git
git clone git@github.com:anonymous/caddy-authorize.git
git clone git@github.com:anonymous/caddy-trace.git
git clone git@github.com:anonymous/go-identity.git

Next, browse to caddy-auth-portal and run the following make command to install various dependencies:

cd caddy-auth-portal
make dep

Next, modify go.mod in github.com/greenpau/caddy-auth-portal. Include replace directives to instruct go using local directories, as opposed to follow Github versions.

module github.com/greenpau/caddy-auth-portal

# intentionally omitted

replace github.com/greenpau/caddy-authorize v1.2.7 => /home/greenpau/dev/go/src/github.com/greenpau/caddy-authorize

replace github.com/greenpau/caddy-trace v1.1.6 => /home/greenpau/dev/go/src/github.com/greenpau/caddy-trace

replace github.com/greenpau/go-identity v1.0.23 => /home/greenpau/dev/go/src/github.com/greenpau/go-identity

Once all the necessary packages are installed, you should be ready to compile caddy using the local source code. Run:

make

The above make command creates xcaddy-caddy-auth-portal directory in tmpcaddydev. Then, it starts building caddy and referencing locally sources plugins.

After the build, the resultant binary will be in bin/ directory. You can then test it with your own configuration files.

bin/caddy run -config /etc/gatekeeper/Caddyfile | jq