diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 4e1ef42..245df18 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -1,13 +1,36 @@ # This workflows will upload a Python Package using Twine when a release is created # For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries -name: Upload Python Package +name: Create release and upload python package on: - release: - types: [created] + push: + # Sequence of patterns matched against refs/tags + tags: + - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 + jobs: + build: + name: Create Release + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + body: | + Changes in this Release + - First Change + - Second Change + draft: false + prerelease: false deploy: runs-on: ubuntu-latest diff --git a/README.md b/README.md index a298edd..df42739 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,9 @@ # Azure plugin for [Certbot](https://certbot.eff.org/) client -Use the certbot client to generate and install a certificate to be used with -an Azure App Gateway. +Use the certbot client to generate and install certificates in Azure. + +Currently it supports authentication with Azure DNS and installation to Azure App Gateway. ### Before you start @@ -11,7 +12,6 @@ Before starting you need: - An Azure account and the Azure CLI installed. - Certbot installed locally. -- An Azure App Gateway deployed in your subscription. ### Setup @@ -32,7 +32,32 @@ The easiest way to install both the certbot client and the certbot-azure plugin And then run `pip install certbot-azure`. -### How to use it + +### Obtaining a certificate with Azure DNS authentication + +To generate a certificate and install it in an Azure App Gateway first generate your credentials: + +```bash +az ad sp create-for-rbac \ +--name Certbot --sdk-auth \ +--role "DNS Zone Contributor" \ +--scope /subscriptions//resourceGroups/ mycredentials.json +``` + +Then generate the certificate: + +```bash +certbot certonly -d REPLACE_WITH_YOUR_DOMAIN \ +-a dns-azure --dns-azure-credentials mycredentials.json \ +--dns-azure-resource-group +``` + +Follow the screen prompts and you should end up with the certificate in your +distribution. It may take a couple minutes to update. + + +### Installing a certificate to an Azure App Gateway To generate a certificate and install it in an Azure App Gateway first generate your credentials: @@ -47,11 +72,11 @@ Then generate and install the certificate (this example uses Azure DNS for authe ```bash certbot -d REPLACE_WITH_YOUR_DOMAIN \ ---dns-azure --dns-azure-credentials mycredentials.json \ ---dns-azure-resource-group REPLACE_WITH_RESOURCE_GROUP \ --i certbot-azure-ag:installer --certbot-azure-ag:installer-credentials mycredentials.json \ ---certbot-azure-ag:installer-resource-group REPLACE_WITH_RESOURCE_GROUP \ ---certbot-azure-ag:installer-app-gateway-name REPLACE_WITH_APP_GATEWAY_NAME +-a dns-azure --dns-azure-credentials mycredentials.json \ +--dns-azure-resource-group \ +-i azure_agw --certbot-azure-ag:installer-credentials mycredentials.json \ +--azure-agw-resource-group \ +--azure-agw-app-gateway-name ``` Follow the screen prompts and you should end up with the certificate in your diff --git a/setup.py b/setup.py index 7d067ba..1ca2011 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ from distutils.core import setup from setuptools import find_packages -version = '0.0.3.dev0' +version = '0.1.0' install_requires = [ 'acme>=0.29.0', @@ -29,8 +29,8 @@ setup( name='certbot-azure', version=version, - description="Azure Installer plugin for Certbot client", - url='https://github.com/dlapiduz/certbot-azure-ag', + description="Azure plugin for Certbot client", + url='https://github.com/dlapiduz/certbot-azure', author="Diego Lapiduz", author_email='diego@lapiduz.com', license='MIT', @@ -53,7 +53,7 @@ packages=find_packages(), include_package_data=True, install_requires=install_requires, - keywords = ['certbot', 'azure', 'app_gateway'], + keywords = ['certbot', 'azure', 'app_gateway', 'azure_dns'], entry_points={ 'certbot.plugins': [ 'azure-agw = certbot_azure.azure_agw:Installer',