Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wildcard certificate support with CloudFlare DNS #916

Closed
wants to merge 1 commit into from

Conversation

ondrejri
Copy link

Edited a few lines in /app/letsencrypt_service and /app/functions.sh to create wildcard certificate for domain. As of now it only supports wildcard certificate creation over CloudFlare dns and I tested it with:

ACME_CA_URI = "https://acme.zerossl.com/v2/DV90"

In docker-compose.yml it specified it this way:

version: "3.5"
services:`
......
  nginx:
    image: ${NGINX_IMAGE}
    container_name: ${NGINX_CONTAINER_NAME}
    restart: always
    ports:
      - ${PORT1}
      - ${PORT2}
    volumes:
      - ${VOLUME1}
      - ${VOLUME2}
      - ${VOLUME3}
      - ${VOLUME4}
  acme:
    image: ${ACME_IMAGE}
    container_name: ${ACME_CONTAINER_NAME}
    restart: always
    environment:
      - DEFAULT_EMAIL=${DEFAULT_EMAIL}
      - CF_Token=${CF_TOKEN}
      - CF_Account_ID=${CF_ACCOUNT_ID}
      - CF_Zone_ID=${CF_ZONE_ID}
      - ACME_CA_URI=${ACME_CA_URI}
      - DEBUG=1
    depends_on:
      - nginx
    volumes_from:
      - nginx:rw
    volumes:
      - ${VOLUME5}
      - ${VOLUME6}
.....

.env file:

.....
ACME_CA_URI="https://acme.zerossl.com/v2/DV90"
.....
VOLUME1=certs:/etc/nginx/certs
VOLUME2=vhost:/etc/nginx/vhost.d
VOLUME3=html:/usr/share/nginx/html
VOLUME4=/var/run/docker.sock:/tmp/docker.sock:ro
VOLUME5=/var/run/docker.sock:/var/run/docker.sock:ro
VOLUME6=acme:/etc/acme.sh
.....

And finally token permissions in CloudFlare:
image

@buchdag buchdag added status/pr-needs-docs This PR needs new or additional documentation status/pr-needs-tests This PR needs new or additional test(s) type/feat PR for a new feature labels Mar 2, 2022
@ne0YT
Copy link

ne0YT commented Jun 16, 2023

would be great to have this in the main version

@buchdag
Copy link
Member

buchdag commented Jul 16, 2024

Closed in favor of #1137

@buchdag buchdag closed this Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/pr-needs-docs This PR needs new or additional documentation status/pr-needs-tests This PR needs new or additional test(s) type/feat PR for a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants