Giter Club home page Giter Club logo

docker-letsencrypt's Introduction

IMPORTANT NOTICE: THIS IMAGE HAS BEEN DEPRECATED AND THE PROJECT IS MOVED TO A NEW REPO

Due to a trademark related request, this image is moved to a new repo on Docker Hub and GitHub. This is a breaking change and you need to manually update. Apologies for the the disruption.

Switching existing implementations over to the new image is very easy, just follow these simple steps: https://github.com/linuxserver/docker-swag#migrating-from-the-old-linuxserverletsencrypt-image

This repository will be archived and builds for the image will no longer be created at the end of 2020

linuxserver.io

Blog Discord Discourse Fleet GitHub Open Collective

The LinuxServer.io team brings you another container release featuring:

  • regular and timely application updates
  • easy user mappings (PGID, PUID)
  • custom base image with s6 overlay
  • weekly base OS updates with common layers across the entire LinuxServer.io ecosystem to minimise space usage, down time and bandwidth
  • regular security updates

Find us at:

  • Blog - all the things you can do with our containers including How-To guides, opinions and much more!
  • Discord - realtime support / chat with the community and the team.
  • Discourse - post on our community forum.
  • Fleet - an online web interface which displays all of our maintained images.
  • GitHub - view the source for all of our repositories.
  • Open Collective - please consider helping us by either donating or contributing to our budget

GitHub Stars GitHub Release GitHub Package Repository GitLab Container Registry MicroBadger Layers Docker Pulls Docker Stars Jenkins Build LSIO CI

SWAG - Secure Web-server And Gateway (formerly known as letsencrypt, no relation to Let's Encrypt™) sets up an Nginx webserver and reverse proxy with php support and a built-in certbot client that automates free SSL server certificate generation and renewal processes. It also contains fail2ban for intrusion prevention.

letsencrypt

Supported Architectures

Our images support multiple architectures such as x86-64, arm64 and armhf. We utilise the docker manifest for multi-platform awareness. More information is available from docker here and our announcement here.

Simply pulling linuxserver/letsencrypt should retrieve the correct image for your arch, but you can also pull specific arch images via tags.

The architectures supported by this image are:

Architecture Tag
x86-64 amd64-latest
arm64 arm64v8-latest
armhf arm32v7-latest

Usage

Here are some example snippets to help you get started creating a container.

docker

docker create \
  --name=swag \
  --cap-add=NET_ADMIN \
  -e PUID=1000 \
  -e PGID=1000 \
  -e TZ=Europe/London \
  -e URL=yourdomain.url \
  -e SUBDOMAINS=www, \
  -e VALIDATION=http \
  -e DNSPLUGIN=cloudflare `#optional` \
  -e PROPAGATION= `#optional` \
  -e DUCKDNSTOKEN= `#optional` \
  -e EMAIL= `#optional` \
  -e ONLY_SUBDOMAINS=false `#optional` \
  -e EXTRA_DOMAINS= `#optional` \
  -e STAGING=false `#optional` \
  -p 443:443 \
  -p 80:80 `#optional` \
  -v /path/to/appdata/config:/config \
  --restart unless-stopped \
  linuxserver/letsencrypt

docker-compose

Compatible with docker-compose v2 schemas.

---
version: "2.1"
services:
  swag:
    image: linuxserver/letsencrypt
    container_name: swag
    cap_add:
      - NET_ADMIN
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/London
      - URL=yourdomain.url
      - SUBDOMAINS=www,
      - VALIDATION=http
      - DNSPLUGIN=cloudflare #optional
      - PROPAGATION= #optional
      - DUCKDNSTOKEN= #optional
      - EMAIL= #optional
      - ONLY_SUBDOMAINS=false #optional
      - EXTRA_DOMAINS= #optional
      - STAGING=false #optional
    volumes:
      - /path/to/appdata/config:/config
    ports:
      - 443:443
      - 80:80 #optional
    restart: unless-stopped

Parameters

Container images are configured using parameters passed at runtime (such as those above). These parameters are separated by a colon and indicate <external>:<internal> respectively. For example, -p 8080:80 would expose port 80 from inside the container to be accessible from the host's IP on port 8080 outside the container.

Parameter Function
-p 443 Https port
-p 80 Http port (required for http validation and http -> https redirect)
-e PUID=1000 for UserID - see below for explanation
-e PGID=1000 for GroupID - see below for explanation
-e TZ=Europe/London Specify a timezone to use EG Europe/London.
-e URL=yourdomain.url Top url you have control over (customdomain.com if you own it, or customsubdomain.ddnsprovider.com if dynamic dns).
-e SUBDOMAINS=www, Subdomains you'd like the cert to cover (comma separated, no spaces) ie. www,ftp,cloud. For a wildcard cert, set this exactly to wildcard (wildcard cert is available via dns and duckdns validation only)
-e VALIDATION=http Certbot validation method to use, options are http, dns or duckdns (dns method also requires DNSPLUGIN variable set) (duckdns method requires DUCKDNSTOKEN variable set, and the SUBDOMAINS variable must be either empty or set to wildcard).
-e DNSPLUGIN=cloudflare Required if VALIDATION is set to dns. Options are aliyun, cloudflare, cloudxns, cpanel, digitalocean, dnsimple, dnsmadeeasy, domeneshop, gandi, google, inwx, linode, luadns, nsone, ovh, rfc2136, route53 and transip. Also need to enter the credentials into the corresponding ini (or json for some plugins) file under /config/dns-conf.
-e PROPAGATION= Optionally override (in seconds) the default propagation time for the dns plugins.
-e DUCKDNSTOKEN= Required if VALIDATION is set to duckdns. Retrieve your token from https://www.duckdns.org
-e EMAIL= Optional e-mail address used for cert expiration notifications.
-e ONLY_SUBDOMAINS=false If you wish to get certs only for certain subdomains, but not the main domain (main domain may be hosted on another machine and cannot be validated), set this to true
-e EXTRA_DOMAINS= Additional fully qualified domain names (comma separated, no spaces) ie. extradomain.com,subdomain.anotherdomain.org,*.anotherdomain.org
-e STAGING=false Set to true to retrieve certs in staging mode. Rate limits will be much higher, but the resulting cert will not pass the browser's security test. Only to be used for testing purposes.
-v /config All the config files including the webroot reside here.

Environment variables from files (Docker secrets)

You can set any environment variable from a file by using a special prepend FILE__.

As an example:

-e FILE__PASSWORD=/run/secrets/mysecretpassword

Will set the environment variable PASSWORD based on the contents of the /run/secrets/mysecretpassword file.

Umask for running applications

For all of our images we provide the ability to override the default umask settings for services started within the containers using the optional -e UMASK=022 setting. Keep in mind umask is not chmod it subtracts from permissions based on it's value it does not add. Please read up here before asking for support.

User / Group Identifiers

When using volumes (-v flags) permissions issues can arise between the host OS and the container, we avoid this issue by allowing you to specify the user PUID and group PGID.

Ensure any volume directories on the host are owned by the same user you specify and any permissions issues will vanish like magic.

In this instance PUID=1000 and PGID=1000, to find yours use id user as below:

  $ id username
    uid=1000(dockeruser) gid=1000(dockergroup) groups=1000(dockergroup)

 

Application Setup

Validation and initial setup

  • Before running this container, make sure that the url and subdomains are properly forwarded to this container's host, and that port 443 (and/or 80) is not being used by another service on the host (NAS gui, another webserver, etc.).
  • For http validation, port 80 on the internet side of the router should be forwarded to this container's port 80
  • For dns validation, make sure to enter your credentials into the corresponding ini (or json for some plugins) file under /config/dns-conf
    • Cloudflare provides free accounts for managing dns and is very easy to use with this image. Make sure that it is set up for "dns only" instead of "dns + proxy"
    • Google dns plugin is meant to be used with "Google Cloud DNS", a paid enterprise product, and not for "Google Domains DNS"
  • For duckdns validation, either leave the SUBDOMAINS variable empty or set it to wildcard, and set the DUCKDNSTOKEN variable with your duckdns token. Due to a limitation of duckdns, the resulting cert will only cover either main subdomain (ie. yoursubdomain.duckdns.org), or sub-subdomains (ie. *.yoursubdomain.duckdns.org), but will not both at the same time. You can use our duckdns image to update your IP on duckdns.org.
  • --cap-add=NET_ADMIN is required for fail2ban to modify iptables
  • If you need a dynamic dns provider, you can use the free provider duckdns.org where the URL will be yoursubdomain.duckdns.org and the SUBDOMAINS can be www,ftp,cloud with http validation, or wildcard with dns validation.
  • After setup, navigate to https://yourdomain.url to access the default homepage (http access through port 80 is disabled by default, you can enable it by editing the default site config at /config/nginx/site-confs/default).
  • Certs are checked nightly and if expiration is within 30 days, renewal is attempted. If your cert is about to expire in less than 30 days, check the logs under /config/log/letsencrypt to see why the renewals have been failing. It is recommended to input your e-mail in docker parameters so you receive expiration notices from Let's Encrypt in those circumstances.

Security and password protection

  • The container detects changes to url and subdomains, revokes existing certs and generates new ones during start.
  • The container provides a pre-generated 4096-bit dhparams.pem (rotated weekly via Jenkins job) for new instances, however you may generate your own by running docker exec letsencrypt openssl dhparam -out /config/nginx/dhparams.pem 4096 WARNING: This takes a very long time
  • If you'd like to password protect your sites, you can use htpasswd. Run the following command on your host to generate the htpasswd file docker exec -it letsencrypt htpasswd -c /config/nginx/.htpasswd <username>
  • You can add multiple user:pass to .htpasswd. For the first user, use the above command, for others, use the above command without the -c flag, as it will force deletion of the existing .htpasswd and creation of a new one
  • You can also use ldap auth for security and access control. A sample, user configurable ldap.conf is provided, and it requires the separate image linuxserver/ldap-auth to communicate with an ldap server.

Site config and reverse proxy

  • The default site config resides at /config/nginx/site-confs/default. Feel free to modify this file, and you can add other conf files to this directory. However, if you delete the default file, a new default will be created on container start.
  • Preset reverse proxy config files are added for popular apps. See the README.md file under /config/nginx/proxy_confs for instructions on how to enable them. The preset confs reside in and get imported from this repo.
  • If you wish to hide your site from search engine crawlers, you may find it useful to add this configuration line to your site config, within the server block, above the line where ssl.conf is included add_header X-Robots-Tag "noindex, nofollow, nosnippet, noarchive"; This will ask Google et al not to index and list your site. Be careful with this, as you will eventually be de-listed if you leave this line in on a site you wish to be present on search engines
  • If you wish to redirect http to https, you must expose port 80

Using certs in other containers

  • This container includes auto-generated pfx and private-fullchain-bundle pem certs that are needed by other apps like Emby and Znc.
    • To use these certs in other containers, do either of the following:
    1. (Easier) Mount the container's config folder in other containers (ie. -v /path-to-le-config:/le-ssl) and in the other containers, use the cert location /le-ssl/keys/letsencrypt/
    2. (More secure) Mount the letsencrypt folder etc/letsencrypt that resides under /config in other containers (ie. -v /path-to-le-config/etc/letsencrypt:/le-ssl) and in the other containers, use the cert location /le-ssl/live/<your.domain.url>/ (This is more secure because the first method shares the entire letsencrypt config folder with other containers, including the www files, whereas the second method only shares the ssl certs)
    • These certs include:
    1. cert.pem, chain.pem, fullchain.pem and privkey.pem, which are generated by Let's Encrypt and used by nginx and various other apps
    2. privkey.pfx, a format supported by Microsoft and commonly used by dotnet apps such as Emby Server (no password)
    3. priv-fullchain-bundle.pem, a pem cert that bundles the private key and the fullchain, used by apps like ZNC

Using fail2ban

  • This container includes fail2ban set up with 3 jails by default:
    1. nginx-http-auth
    2. nginx-badbots
    3. nginx-botsearch
  • To enable or disable other jails, modify the file /config/fail2ban/jail.local
  • To modify filters and actions, instead of editing the .conf files, create .local files with the same name and edit those because .conf files get overwritten when the actions and filters are updated. .local files will append whatever's in the .conf files (ie. nginx-http-auth.conf --> nginx-http-auth.local)
  • You can check which jails are active via docker exec -it swag fail2ban-client status
  • You can check the status of a specific jail via docker exec -it swag fail2ban-client status <jail name>
  • You can unban an IP via docker exec -it swag fail2ban-client set <jail name> unbanip <IP>
  • A list of commands can be found here: https://www.fail2ban.org/wiki/index.php/Commands

Docker Mods

Docker Mods

We publish various Docker Mods to enable additional functionality within the containers. The list of Mods available for this image (if any) can be accessed via the dynamic badge above.

Support Info

  • Shell access whilst the container is running: docker exec -it swag /bin/bash
  • To monitor the logs of the container in realtime: docker logs -f swag
  • container version number
    • docker inspect -f '{{ index .Config.Labels "build_version" }}' swag
  • image version number
    • docker inspect -f '{{ index .Config.Labels "build_version" }}' linuxserver/letsencrypt

Updating Info

Most of our images are static, versioned, and require an image update and container recreation to update the app inside. With some exceptions (ie. nextcloud, plex), we do not recommend or support updating apps inside the container. Please consult the Application Setup section above to see if it is recommended for the image.

Below are the instructions for updating containers:

Via Docker Run/Create

  • Update the image: docker pull linuxserver/letsencrypt
  • Stop the running container: docker stop swag
  • Delete the container: docker rm swag
  • Recreate a new container with the same docker create parameters as instructed above (if mapped correctly to a host folder, your /config folder and settings will be preserved)
  • Start the new container: docker start swag
  • You can also remove the old dangling images: docker image prune

Via Docker Compose

  • Update all images: docker-compose pull
    • or update a single image: docker-compose pull swag
  • Let compose update all containers as necessary: docker-compose up -d
    • or update a single container: docker-compose up -d swag
  • You can also remove the old dangling images: docker image prune

Via Watchtower auto-updater (especially useful if you don't remember the original parameters)

  • Pull the latest image at its tag and replace it with the same env variables in one run:
    docker run --rm \
    -v /var/run/docker.sock:/var/run/docker.sock \
    containrrr/watchtower \
    --run-once swag
    

Note: We do not endorse the use of Watchtower as a solution to automated updates of existing Docker containers. In fact we generally discourage automated updates. However, this is a useful tool for one-time manual updates of containers where you have forgotten the original parameters. In the long term, we highly recommend using Docker Compose.

  • You can also remove the old dangling images: docker image prune

Building locally

If you want to make local modifications to these images for development purposes or just to customize the logic:

git clone https://github.com/linuxserver/docker-letsencrypt.git
cd docker-letsencrypt
docker build \
  --no-cache \
  --pull \
  -t linuxserver/letsencrypt:latest .

The ARM variants can be built on x86_64 hardware using multiarch/qemu-user-static

docker run --rm --privileged multiarch/qemu-user-static:register --reset

Once registered you can define the dockerfile to use with -f Dockerfile.aarch64.

Versions

  • 28.07.20: - Start transition to new name, SWAG.
  • 17.06.20: - Reformat ssl.conf. Pull in pre-generated dhparams.pem from DO Spaces. Deprecate DHLEVEL param.
  • 01.06.20: - Rebasing to alpine 3.12, change ldap login address to /ldaplogin to avoid clashes (existing users need to manually update).
  • 31.05.20: - Tweak Authelia confs (existing users can delete authelia-server.conf and authelia-location.conf, and restart to update).
  • 23.05.20: - Add support for Authelia.
  • 15.05.20: - Remove php7-pecl-imagick due to upstream issues. Add support for Geoip2 auto db retrieval.
  • 10.05.20: - Added support for fail2ban deny statements.
  • 04.05.20: - Allow for optionally setting propagation time for dns plugins. Add repo version of whois to replace the built-in busybox version. Update jail.local to change default fail2ban ban action to more widely supported iptables-allports.
  • 13.04.20: - Update cloudflare.ini with token info.
  • 11.03.20: - Add php7-sodium.
  • 06.03.20: - Implement cert renewal attempt during container start (only if the cert is already expired or will expire within the next 24 hours, otherwise it will be attempted at 2:08am).
  • 05.03.20: - Use port and proto upstream variables for ldap and default sample confs.
  • 24.02.20: - Remove world/group read permissions in dns-conf.
  • 23.02.20: - Add aliyun dns validation plugin.
  • 28.01.20: - Deprecate tls-sni validation method, remove from docs.
  • 27.01.20: - Add support for cpanel dns validation.
  • 10.01.20: - Add support for domeneshop dns validation.
  • 07.01.20: - Update ciphers from Mozilla ssl-config recommendations.
  • 01.01.20: - Add support for gandi dns validation.
  • 31.12.19: - GeoIP2 databases now require personal license keys to download. Auto download is disabled and log message is added.
  • 19.12.19: - Rebasing to alpine 3.11.
  • 19.12.19: - Increase large_client_header_buffers in nginx.conf to prevent 414 errors.
  • 18.12.19: - Add php7-imap and php7-pecl-apcu.
  • 11.12.19: - Fix Google Cloud DNS to use .json file for authentication.
  • 20.11.19: - Fix cryptography version mismatch due to pip issue.
  • 17.11.19: - Add php7-pdo_odbc.
  • 17.11.19: - Add transip dns validation plugin.
  • 27.10.19: - Turn off lua resty core to get rid of error message in the log (existing users will have to delete /config/nginx/nginx.conf and restart the container).
  • 26.10.19: - Add new package for stream-geoip2, remove geoip2 module patch.
  • 24.10.19: - Add php7-pecl-imagick.
  • 23.10.19: - Update Host header in proxy.conf to fix CSRF issues.
  • 12.10.19: - Add linode dns validation plugin.
  • 23.09.19: - Move GeoIP2 db to /config to make it persistent.
  • 14.08.19: - Add inwx dns validation plugin.
  • 06.08.19: - Add php7-ftp.
  • 04.08.19: - Add php7-bcmath, php7-pear, php7-xmlrpc.
  • 02.08.19: - Add php7-ldap, remove geoip v1(deprecated).
  • 01.08.19: - Mark https redirect block as default_server (effective only for new installs).
  • 31.07.19: - Create GeoIP2 databse (libmaxminddb) during container start if it doesn't exist.
  • 30.07.19: - Support main domain via duckdns validation.
  • 29.07.19: - Enable http to https redirect by default (effective only for new installs).
  • 01.07.19: - Patch geoip2 module until upstream is fixed.
  • 30.06.19: - Add geoip2 module.
  • 28.06.19: - Rebasing to alpine 3.10.
  • 19.06.19: - Set resolver to docker dns in ssl.conf.
  • 29.05.19: - Compensate for changes to the reverse-proxy-confs repo.
  • 26.05.19: - Remove botocore/urllib patch.
  • 08.05.19: - Remove default.conf when nginx is upgraded in downstream image.
  • 30.04.19: - Add php-redis.
  • 12.04.19: - Rebase aarch64 image to 3.9.
  • 25.03.19: - Rebase aarch64 image back to 3.8 due to python issues (specifically with fail2ban), switch packages to python 3 on amd64 and armhf, clean up pip/python cache to shrink image size.
  • 23.03.19: - Switching to new Base images, shift to arm32v7 tag.
  • 10.03.19: - Add TLSv1.3 to ssl.conf.
  • 02.03.19: - Add php intl and posix modules.
  • 27.02.19: - Add gnupg package.
  • 22.02.19: - Rebase to alpine 3.9.
  • 03.02.19: - Removed memcached due to seccomp errors. Let us know if you need to re-enable memcached.
  • 28.01.19: - Add pipeline logic and multi arch.
  • 21.01.19: - Remove client_body_max from proxy.conf (existing users need to manually update).
  • 09.01.19: - Remove tls v1 and v1.1 from default ssl.conf, update ciphers (existing users need to manually update).
  • 30.12.18: - Fix bundle key generation.
  • 19.12.18: - Add ipv6 and http/2 support to default site config.
  • 08.12.18: - Had to remove cert renewal during container start due to certbot's new undocumented feature of up to 8 minute random delay.
  • 03.12.18: - Fix silly bug resetting the duckdns token.
  • 02.12.18: - Add dns validation support for ovh.
  • 20.11.18: - Externalize reverse proxy confs to separate github repo linuxserver/reverse-proxy-confs, update baseimage packages during build
  • 19.11.18: - Add php opcache package.
  • 12.11.18: - Add support for duckdns wildcard certs via dns validation
  • 31.10.18: - Add various preset proxy confs and fix others (thanks @nemchik and @hijxf)
  • 02.10.18: - Fix fail2ban instructions and logrotate conf
  • 11.09.18: - Add various preset proxy confs and fix others (thanks @nemchik and @LeoVerto)
  • 04.09.18: - Linting fixes.
  • 30.08.18: - Add support for ldap auth, add proxy confs for bazarr, couchpotato, headphones, lidarr and plex subfolder (thanks @nemchik and @jedahan)
  • 21.08.18: - Rebase to alpine 3.8, add info on search engine de-listing
  • 08.08.18: - Add subdomain proxy conf for plex, update emby proxy confs
  • 25.07.18: - Add subdomain proxy conf for syncthing
  • 23.07.18: - Remove backwards compatibility and set default validation method to http. Update portainer proxy config to fix websockets. Add unifi proxy conf.
  • 31.05.18: - Update ssl.conf and proxy.conf for tighter security (thanks @nemchik)
  • 30.05.18: - Add reverse proxy configs for jackett, monitorr, nzbget, nzbhydra, organizr, portainer and transmission (thanks @nemchik)
  • 18.05.18: - Add more info on certs and unraid reverse proxy config
  • 11.05.18: - Add php pgsql support
  • 24.04.18: - Auto generate a private key + fullchain bundle pem that is needed by certain apps
  • 20.04.18: - Add standardized optional reverse proxy conf files
  • 19.04.18: - Bind memcached to localhost only, add php7-sqlite3
  • 08.04.18: - Fix renewal hooks
  • 29.03.18: - Create pfx cert after renewal for dns validation (previous version only created it for http and tls, an oversight)
  • 29.03.18: - Fix staging for v2 api
  • 13.03.18: - Support for wildcard cert with dns validation added. Switched to v2 api for ACME.
  • 21.02.18: - Reduce shellcheck directives by renaming secondary variables
  • 20.02.18: - Sanitize variables, increase log verbosity
  • 01.02.18: - Big changes. VALIDATION parameter added for choosing certbot validation methods, including dns through official plugins. HTTPVAL is deprecated. STAGING parameter added for testing. Backwards compatibility for the short term. Since tls-sni is disabled by letsencrypt, most users will have to change their settings and adopt the new parameters within the next 90 days. Reorganized the nginx default config, split ssl settings into new ssl.conf
  • 13.01.18: - Re-enable ipv6 due to update to fail2ban 0.10.1. Existing users can enable ipv6 by deleting /config/fail2ban/action.d/iptables-common.local and restarting the container after updating the image
  • 11.01.18: - Halt the container if validation fails instead of a stop (so restart=always doesn't get users throttled with Let's Encrypt)
  • 10.01.18: - Add option for http validation on port 80
  • 05.01.18: - Rebase to alpine 3.7
  • 04.11.17: - Add php7 soap module
  • 31.10.17: - Add php7 exif and xmlreader modules
  • 25.09.17: - Manage fail2ban via s6
  • 24.09.17: - Add memcached service
  • 01.09.17: - --privileged is no longer required as long as --cap-add=NET_ADMIN is added, instructions modified accordingly, disabled fail2ban ipv6 actions due to requiring access to host kernel modules
  • 31.08.17: - Add php7-phar
  • 14.07.17: - Enable modules dynamically in nginx.conf
  • 06.07.17: - Add support for multiple domains (thanks @oznu)
  • 22.06.17: - Add various nginx modules and enable all modules in the default nginx.conf
  • 16.06.17: - Update deprecated certbot option for https validation, make e-mail entry optional, update readme
  • 05.06.17: - Add php7-bz2
  • 27.05.17: - Rebase to alpine 3.6.
  • 03.05.17: - Fix log permissions.
  • 18.04.17: - Add php7-sockets, update fail2ban filter and action defaults
  • 27.02.17: - Add php7-dom, php7-iconv and php7-pdo_sqlite
  • 21.02.17: - Add php7-xml
  • 10.02.17: - Switch to alpine 3.5 base and php7, add php zlib module and all nginx modules
  • 13.01.17: - Add php5-ctype and php5-openssl
  • 04.01.17: - Add php5-mysqli and php5-pdo_mysql
  • 22.11.16: - Add gd and mcrypt packages
  • 21.11.16: - Add curl package
  • 07.11.16: - Initial Release

docker-letsencrypt's People

Contributors

adamradocz avatar alex-phillips avatar aptalca avatar chbmb avatar drizuid avatar dulanic avatar dylanparker avatar gilbn avatar henrikbacher avatar homerr avatar ironicbadger avatar j0nnymoe avatar jmuchovej avatar jodumont avatar klardotsh avatar leoverto avatar linuxserver-ci avatar ljani avatar mattti avatar nemchik avatar oznu avatar realies avatar rodrigoayala avatar samuel-0-0 avatar sparklyballs avatar that1matt avatar thelamer avatar tobbenb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docker-letsencrypt's Issues

digital ocean dns cert problem

not sure what is wrong with the digitalocean dns script, going to switch to another but i thought i would put this here for you.

2018-02-05T16:54:14.217662999Z Generating new certificate
2018-02-05T16:54:15.751941268Z Saving debug log to /var/log/letsencrypt/letsencrypt.log
2018-02-05T16:54:15.760014451Z Plugins selected: Authenticator dns-digitalocean, Installer None
2018-02-05T16:54:16.087488366Z Obtaining a new certificate
2018-02-05T16:54:18.027681186Z Performing the following challenges:
2018-02-05T16:54:18.027880537Z dns-01 challenge for mydom.stream
2018-02-05T16:54:18.028257255Z dns-01 challenge for www.mydom.stream
2018-02-05T16:54:18.028421826Z dns-01 challenge for ftp.mydom.stream
2018-02-05T16:54:18.028642982Z dns-01 challenge for cloud.mydom.stream
2018-02-05T16:54:18.028938013Z Unsafe permissions on credentials configuration file: /config/dns-conf/digitalocean.ini
2018-02-05T16:54:18.463314298Z Cleaning up challenges
2018-02-05T16:54:18.715121116Z Encountered exception during recovery
2018-02-05T16:54:18.715370816Z Unable to determine base domain for mydom.stream using names: [u'mydom.stream', u'stream'].
2018-02-05T16:54:18.715379875Z Traceback (most recent call last):
2018-02-05T16:54:18.715383334Z   File "/usr/lib/python2.7/site-packages/certbot/error_handler.py", line 100, in _call_registered
2018-02-05T16:54:18.715386699Z     self.funcs[-1]()
2018-02-05T16:54:18.715389586Z   File "/usr/lib/python2.7/site-packages/certbot/auth_handler.py", line 284, in _cleanup_challenges
2018-02-05T16:54:18.715392759Z     self.auth.cleanup(achalls)
2018-02-05T16:54:18.715395531Z   File "/usr/lib/python2.7/site-packages/certbot/plugins/dns_common.py", line 76, in cleanup
2018-02-05T16:54:18.715398893Z     self._cleanup(domain, validation_domain_name, validation)
2018-02-05T16:54:18.715401855Z   File "/usr/lib/python2.7/site-packages/certbot_dns_digitalocean/dns_digitalocean.py", line 50, in _cleanup
2018-02-05T16:54:18.715405130Z     self._get_digitalocean_client().del_txt_record(domain, validation_name, validation)
2018-02-05T16:54:18.715408256Z   File "/usr/lib/python2.7/site-packages/certbot_dns_digitalocean/dns_digitalocean.py", line 116, in del_txt_record
2018-02-05T16:54:18.715415656Z     domain = self._find_domain(domain_name)
2018-02-05T16:54:18.715418615Z   File "/usr/lib/python2.7/site-packages/certbot_dns_digitalocean/dns_digitalocean.py", line 163, in _find_domain
2018-02-05T16:54:18.715421717Z     .format(domain_name, domain_name_guesses))
2018-02-05T16:54:18.715424497Z PluginError: Unable to determine base domain for mydom.stream using names: [u'mydom.stream', u'stream'].
2018-02-05T16:54:18.716174821Z Unable to determine base domain for mydom.stream using names: [u'mydom.stream', u'stream'].
2018-02-05T16:54:18.761892428Z ERROR: Cert does not exist! Please see the validation error above. Make sure you entered correct credentials into the /config/dns 

Request: Add sqlite3 to the container

linuxserver.io

Thanks, team linuxserver.io

Hi!

Would love if you guys could add sqlite3 to the container!
Right now I run docker exec letsencrypt /bin/sh -c 'apk update;apk add php7-sqlite3;apk add php7-apcu;apk add --update yaml yaml-dev;apk add php7-xdebug;' Which works just fine, but it would be nice if it was already installed.

Add sleep timer for failed validation

I have rolled my own slight modification of this project because I kept running into issues where things wouldn't be set up just right and the container would stop after failing to validate. I prefer to use "unless-stopped" restart action in general, and in this instance it would cause the container to continue restarting until all validation attempts are used up.

My suggestion is to add an option for the failure sleep timer. I can make a PR for what I'm suggesting if that would be preferred.

Suggestion: Option to temporarily use self-signed certificate

First of all, thank you for the great container release, keep up the good work! 👍

I think it would be great idea to add option to bypass letsencrypt certificate obtaining process temporarily and use self-signed certificate instead while setting up other containers and experimenting with subdomains and stuff.

It would also be great for the times when you are hit with rate limit error from letsencrypt because you were setting up your server just the way you like it, like I just was 😁

error while first run

Hello
I ran container with this command.
docker run -it -d
--privileged
--restart=always
--name=letsencrypt
-v /docker/config/letsencrypt:/config
-e PGID=33 -e PUID=33
-e DHLEVEL=4096
-e EMAIL=[email protected]
-e URL=my.wan.de
-e SUBDOMAINS=one,two
-p 80:80
-p 443:443
-e TZ=Europe/Berlin
linuxserver/letsencrypt

after DH creation I can read this error:
/var/run/s6/etc/cont-init.d/50-config: line 108: cd: /config/keys/letsencrypt: No such file or directory
after that container is stopped

[cont-init.d] 50-config: exited 1.
[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.
[s6-finish] syncing disks.
[s6-finish] sending all processes the TERM signal.
[s6-finish] sending all processes the KILL signal and exiting.

Error getting php file through reverse proxy

I'm using this instance for some reverse proxies. One of them is a PHP page (The Linuxserver's COPS docker container.) However the location was redirected to the PHP support on the local server.

My location:

        location /books {
                rewrite ^/books(/.*)$ $1 break;
                proxy_set_header Host $host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_pass http://192.168.86.100:9000;
        }

Included fpm support

        location ~ \.php$ {
               fastcgi_split_path_info ^(.+\.php)(/.+)$;
               # With php7-cgi alone:
               fastcgi_pass 127.0.0.1:9000;
               # With php7-fpm:
               #fastcgi_pass unix:/var/run/php7-fpm.sock;
               fastcgi_index index.php;
               include /etc/nginx/fastcgi_params;
        }

Commenting out that location allows COPS to work.

linuxserver.io

Ubuntu 14.04.5

docker run --restart=always -d --privileged --name=nginx -v nginx_config:/config -v htpasswd:/htpasswd -e EMAIL=emailt -e URL=domain -e SUBDOMAINS=hostlist -p 443:443 -e TZ=PST8PDT7 linuxserver/letsencrypt

nginx's error.log:
2017/03/18 22:04:57 [error] 323#323: *1037 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 192.168.86.1, server: , request: "GET /books/getJSON.php?complete=1&=1489899896685 HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "hostname", referrer: "https://hostname/books/"

Thanks, team linuxserver.io

Suggestion: Configuration to hit staging

I've been mucking around with trying to get a letsencrypt reverse proxy going for a number of domains, and I've hit the "too many registrations for this IP" error.

Can I suggest an option to allow hitting the staging environment? Something like -e STAGING=true that would make all calls to certbot include --staging.

php7-mbstring Missing

The new version using php7 doesn't have the mbstring module loaded. Need it for Codiad IDE that I run from this container. It seems to have been present previously.

apk update
apk add php7-mbstring

Was able to get it working for now but it would be nice to be already loaded.

linuxserver.io

Thanks, team linuxserver.io

Add an environment variable for DNS propagation time

The default propagation times in certbot are rather short, for example 10 seconds for dns-cloudflare.
This is not enough, because the Cloudflare TTL seems to be 5 minutes [1] - so the validation almost certainly fails after 10 seconds, because LE won't find the TXT record.

This can be fixed by using the commandline options --dns-<plugin>-propagation-seconds <seconds> and specifying a longer time (should be the TTL or a bit longer just to be sure)
The propagation time depends on the DNS provider of course, I just happen to use Cloudflare which seems to work after 5 minutes.

Currently, my workaround is to add something like this in /config/etc/letsencrypt/cli.ini before the container is created:

dns-<plugin>-propagation-seconds 300

... but of course it would be much nicer to have a simple environment variable to configure this :)

[1] https://support.cloudflare.com/hc/en-us/articles/200169036-How-long-does-it-take-for-a-DNS-change-I-made-to-push-out-

ERROR: Cert does not exist!

linuxserver.io

Ubuntu 16.04.
stdout:

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 10-adduser: executing... 

-------------------------------------
          _         ()
         | |  ___   _    __
         | | / __| | |  /  \ 
         | | \__ \ | | | () |
         |_| |___/ |_|  \__/


Brought to you by linuxserver.io
We gratefully accept donations at:
https://www.linuxserver.io/donations/
-------------------------------------
GID/UID
-------------------------------------

User uid:    1000
User gid:    1000
-------------------------------------

[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 20-config: executing... 
[cont-init.d] 20-config: exited 0.
[cont-init.d] 30-keygen: executing... 
using keys found in /config/keys
[cont-init.d] 30-keygen: exited 0.
[cont-init.d] 50-config: executing... 
2048 bit DH parameters present
SUBDOMAINS entered, processing
Sub-domains processed are:  -d www.spanglish.no -d nextcloud.spanglish.no
E-mail address entered: [email protected]
Different sub/domains entered than what was used before. Revoking and deleting existing certificate, and an updated one will be created
Generating new certificate
IMPORTANT NOTES:
 - Your account credentials have been saved in your Certbot
   configuration directory at /etc/letsencrypt. You should make a
   secure backup of this folder now. This configuration directory will
   also contain certificates and private keys obtained by Certbot so
   making regular backups of this folder is ideal.
ERROR: Cert does not exist! Please see the validation error above. The issue may be due to incorrect dns or port forwarding settings. Please fix your settings and recreate the container

stderr:

usage: 
  certbot [SUBCOMMAND] [options] [-d DOMAIN] [-d DOMAIN] ...

Certbot can obtain and install HTTPS/TLS/SSL certificates.  By default,
it will attempt to use a webserver both for obtaining and installing the
certificate. 
certbot: error: argument --cert-path: No such file or directory
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator standalone, Installer None
Obtaining a new certificate
Performing the following challenges:
Client with the currently selected authenticator does not support any combination of challenges that will satisfy the CA.
Client with the currently selected authenticator does not support any combination of challenges that will satisfy the CA.

Init:


**[Unit]
Description=A Letsencrypt nginx container, brought to you by LinuxServer.io.
Documentation=https://hub.docker.com/r/linuxserver/letsencrypt/
After=network.target docker.socket
Requires=docker.socket

[Service]
RestartSec=10
Restart=on-failure

Environment="NAME=letsencrypt"
Environment="IMG=linuxserver/letsencrypt"

# Pull new image for updates
ExecStartPre=-/usr/bin/docker pull $IMG

# Clean-up bad state if still hanging around
ExecStartPre=-/usr/bin/docker rm -f $NAME

# Main process
ExecStart=/usr/bin/docker run \
  --name $NAME \
  --cap-add=NET_ADMIN \
  --name=letsencrypt \
  -v /opt/docker/letsencrypt:/config \
  -e PGID=1000 -e PUID=1000  \
  -e [email protected] \
  -e URL=mydomain.com \
  -e SUBDOMAINS=www,nextcloud \
  -p 80:80 -p 443:443 \
  -e TZ=Europe/Oslo \
  $IMG

# Stop Service
ExecStop=/usr/bin/docker stop $NAME

# Large image causes a timeout because of the time it takes
# to download and extract / run.

# TimeoutStartSec=infinity

#Prevent systemd from killing the service
KillMode=none

[Install]
WantedBy=multi-user.target**

I can not for the life of me figure this out. I have double checked the dns records with nginx servers and they are all fine. There should be no issues.

Support for multiple domains

This container currently offers no (easy) support for multi-domain setups. When configuring, only one single domain can be specified. Please support the option of setting up Lets Encrypt for multiple domains.

Running the container as root

Hi,

running the container as root runs in to the following error:

[15-Mar-2018 18:51:15] ERROR: [pool www] please specify user and group other than root
[15-Mar-2018 18:51:15] ERROR: FPM initialization failed

The following parameter would fix it:

# php-fpm --help
...
 -R, --allow-to-run-as-root
               Allow pool to run as root (disabled by default)

Could you implement this?

Cheers

Crawlers Disallowed by Default

This is more of a 'note' than it is an issue. The default nginx configuration adds X-Robots-Tag none; header. While this is great when you're testing, people might overlook to remove it once they've gone live. It took some research to realise that X-Robots-Tag none; is equivalent to X-Robots-Tag noindex;.ref

It might be worthwhile adding a note/reminder in the defaults to edit/remove X-Robots-Tag as required.

Error when generating the certs (50-config: line 149)

Hi LinuxServer and cie;
I read these three issues and try to dig a little bit about my mistake but I can't figure it, so I come here to ask you some light ;)

my .env file

DATA=/docker/letsencrypt/data
[email protected]
HTTPVAL=true
ONLY_SUBDOMAINS=true
SUBDOMAINS=home
TZ=Europe/Zurich
URL=chez.moi

If I understood well, --cap-add is just used by fail2ban
so I omit it because docker run with --userns-remap=tape:duck
just to mention, I have around 12 of your images running with this config
so I confident it's a local misunderstood with this one.

IMAGE=linuxserver/letsencrypt
PROJECT=${PWD##*/}
source .env

docker run -d \
--env-file .env \
--name $PROJECT \
--restart always \
-p 80:80/tcp \
-p 443:443/tcp \
-v $DATA/config:/config \
$IMAGE

So the error is : /var/run/s6/etc/cont-init.d/50-config: line 149
which is try to make the fullchain
but when I look inside my /docker/letsencrypt/data/etc/letsencrypt/live/home.chez.moi don't exist.

Now my port 80 and 443 are truly redirected from my router to my server/docker and if I just turn on a nginx the web page respond at home.chez.moi

this is my : /var/log/letsencrypt/letsencrypt.log

2018-01-27 17:11:28,340:DEBUG:certbot.main:certbot version: 0.19.0
2018-01-27 17:11:28,340:DEBUG:certbot.main:Arguments: ['--non-interactive', '--renew-by-default', '--standalone', '--preferred-challenges', 'http', '--rsa-key-size', '4096', '-m', '[email protected]', '--agree-tos', '-d', 'home.chez.moi']
2018-01-27 17:11:28,340:DEBUG:certbot.main:Discovered plugins: PluginsRegistry(PluginEntryPoint#manual,PluginEntryPoint#null,PluginEntryPoint#standalone,PluginEntryPoint#webroot)
2018-01-27 17:11:28,353:DEBUG:certbot.log:Root logging level set at 20
2018-01-27 17:11:28,353:INFO:certbot.log:Saving debug log to /var/log/letsencrypt/letsencrypt.log
2018-01-27 17:11:28,354:DEBUG:certbot.plugins.selection:Requested authenticator standalone and installer None
2018-01-27 17:11:28,387:DEBUG:certbot.plugins.selection:Single candidate plugin: * standalone
Description: Spin up a temporary webserver
Interfaces: IAuthenticator, IPlugin
Entry point: standalone = certbot.plugins.standalone:Authenticator
Initialized: <certbot.plugins.standalone.Authenticator object at 0x6a1d088e2550>
Prep: True
2018-01-27 17:11:28,387:DEBUG:certbot.plugins.selection:Selected authenticator <certbot.plugins.standalone.Authenticator object at 0x6a1d088e2550> and installer None
2018-01-27 17:11:28,387:INFO:certbot.plugins.selection:Plugins selected: Authenticator standalone, Installer None
2018-01-27 17:11:29,048:DEBUG:acme.client:Sending GET request to https://acme-v01.api.letsencrypt.org/directory.
2018-01-27 17:11:29,049:DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): acme-v01.api.letsencrypt.org

So I don't know why it can't make it and I need you help on it :)

Thanks, team linuxserver.io

PHP-Zip

Hello,

would it be possible to add the PHP-Zip extension to this container? I'm trying to run Grav, which requires this extension.

Thank you!

Nginx breaks serving of cached assets (permission denied)

Running Debian 8.8 with Docker version 17.03.1-ce, build c6d412e and the following run command:

docker run -d --privileged --name=letsencrypt -v /opt/letsencrypt:/config -e PGID=1001 -e PUID=1001 -e DHLEVEL=4096 -e EMAIL=xxx -e URL=xxx -e SUBDOMAINS= -p 443:443 -e TZ=Europe/Paris linuxserver/letsencrypt

/opt/letsencrypt has 1001:1001 as owner and is on the root filesystem.

Everything works fine after the container is created, but after a while (hours to days) nginx stops delivering random asset files (js, css) on both served content and reverse-proxied sites, breaking them.

The nginx error log then contains the following (example):

2017/05/12 09:24:57 [crit] 348#348: *4540 open() "/var/lib/nginx/tmp/proxy/7/02/0000000027" failed (13: Permission denied) while reading upstream, client: 192.168.1.1, server: xxx, request: "GET /gitea/css/semantic-2.2.1.min.css HTTP/1.1", upstream: "http://172.24.0.2:3000/css/semantic-2.2.1.min.css", host: "xxx"

The tmp file its looking for doesn't exist. Running chmod -R 777 tmp/ or recreating the container fixes it for a short while, until it happens again on another random asset.

The tmp directory is not mapped and has 1001 as owner.

Is this a cache setting issue in the image? If so, can caching of assets be disabled?

Use a port other than 443

It seems that it is not possible to use a port other than the 443 to validate the domain. It would come in handy in situations where we already have port 443 bind to the Web container.

php-zip

any chance we can get php-zip added to the containter, im using this with organizr and auto update itsnt working, thanks

Impossible to generate cert

Impossible to generate cert I think it's related to this update:
https://community.letsencrypt.org/t/solution-client-with-the-currently-selected-authenticator-does-not-support-any-combination-of-challenges-that-will-satisfy-the-ca/49983

Linux Mint 18.2
Log:


      _         ()
     | |  ___   _    __
     | | / __| | |  /  \ 
     | | \__ \ | | | () |
     |_| |___/ |_|  \__/

Brought to you by linuxserver.io
We gratefully accept donations at:
https://www.linuxserver.io/donations/

GID/UID

User uid: 1001
User gid: 1001

[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 20-config: executing...
[cont-init.d] 20-config: exited 0.
[cont-init.d] 30-keygen: executing...
using keys found in /config/keys
[cont-init.d] 30-keygen: exited 0.
[cont-init.d] 50-config: executing...
4096 bit DH parameters present
No subdomains defined
E-mail address entered:xxxx
Generating new certificate
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator standalone, Installer None
Obtaining a new certificate
Performing the following challenges:
Client with the currently selected authenticator does not support any combination of challenges that will satisfy the CA.
Client with the currently selected authenticator does not support any combination of challenges that will satisfy the CA.
y combination of challenges that will satisfy the CA.
ERROR: Cert does not exist! Please see the validation error above. The issue may be due to incorrect dns or port forwarding settings. Please fix your settings and recreate the container

Please update certbot to certbot-auto latest version

Large reverse proxy files truncated

If you have a large response such as a huge JSON file coming over a reverse proxy, it will be truncated unless you modify the proxy_max_temp_file_size such as disabling it completely:

proxy_max_temp_file_size 0;

The error indicated in the logs would be along the lines of:
2017/03/19 18:42:56 [crit] 322#322: *919 open() "/var/lib/nginx/tmp/proxy/2/00/0000000002" failed (13: Permission denied) while reading upstream, client: 192.168.86.1, server: _, request: "GET /gui/js/lib/jquery-ui.js HTTP/1.1", upstream: "http://192.168.86.100:8888/gui/js/lib/jquery-ui.js", host: "edge.thebigwave.net", referrer: "https://hostname/gui/"

PHP Support for wordpress

I see that certain PHP files have been added to this docker to support certain things however I dont appear to be able to run Wordpress from this docker, is more PHP required?

I have the reverse proxy working great, would just like to run wordpress from the same docker

thanks

permanent CPU load 1-2% from fail2ban-server

on my docker i have a permanent CPU load of 1-2%, even without any connections. the fail2ban-server is the issuse

PID USER PR NI VIRT RES SHR S %CPU %MEM ZEIT+ BEFEHL
5920 root 20 0 73692 10896 2388 S 2,0 0,1 18:23.69 fail2ban-server

a log file is attached.
fail2ban.txt

Creating ECDSA certificaties

There is currently no official, automatic way to receive ECDSA certificates from letsencrypt.

ECDSA certs can drastically increase HTTPS performance and are up for an official "release" by September 1, 2017: https://letsencrypt.org/upcoming-features/

This is just a suggestion to prepare for deploying these new certificates through this container.

Just an example how to manually get an ECDSA cert right now:
https://boops.me/how-to-get-a-signed-ecdsa-ecc-cert-from-letsencrypt/

SUBDOMAINS

linuxserver.io

Thanks, team linuxserver.io

if you set the 'SUBDOMAINS' like that
-e SUBDOMAINS=a,b,c,d
and then run the container,it will cause erros.
does linuxserver/docker-letsencrypt only support 3 subdomains?

An unexpected error occurred:
There were too many requests of a given type :: Error creating new cert :: too many certificates already issued for exact set of domains:

NGINX-Extras

Hi there,

are the so called "nginx-extras" included in this setup?
Thanks for info on this.

best regards

ERROR: Cert does not exist!

When I run the image at the first time, I got the following error message. The 80 and the 443 ports are forwarded.

DH parameters successfully created - 2048 bits
SUBDOMAINS entered, processing
Only subdomains, no URL in cert
Sub-domains processed are:  -d xxx.duckdns.org
E-mail address entered: [email protected]
Generating new certificate
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator standalone, Installer None
Obtaining a new certificate
Performing the following challenges:
Client with the currently selected authenticator does not support any combination of challenges that will satisfy the CA.
Client with the currently selected authenticator does not support any combination of challenges that will satisfy the CA.
IMPORTANT NOTES:
 - Your account credentials have been saved in your Certbot
   configuration directory at /etc/letsencrypt. You should make a
   secure backup of this folder now. This configuration directory will
   also contain certificates and private keys obtained by Certbot so
   making regular backups of this folder is ideal.
ERROR: Cert does not exist! Please see the validation error above. The issue may be due to incorrect dns or port forwarding settings. Please fix your settings and recreate the container

Host OS: Ubuntu Server 17.10.1
Docker version:

Client:
 Version:       17.12.0-ce
 API version:   1.35
 Go version:    go1.9.2
 Git commit:    c97c6d6
 Built: Wed Dec 27 20:11:14 2017
 OS/Arch:       linux/amd64

Server:
 Engine:
  Version:      17.12.0-ce
  API version:  1.35 (minimum version 1.12)
  Go version:   go1.9.2
  Git commit:   c97c6d6
  Built:        Wed Dec 27 20:09:47 2017
  OS/Arch:      linux/amd64
  Experimental: false

Docker compose version:

docker-compose version 1.8.0, build unknown
docker-py version: 1.9.0
CPython version: 2.7.14
OpenSSL version: OpenSSL 1.0.2g  1 Mar 2016

The command I run: sudo docker-compose up -d
The docker-compose.yml file's content:

version: '2'
services:

  letsencrypt:
    image: linuxserver/letsencrypt
    container_name: letsencrypt
    restart: always
    cap_add:
      - NET_ADMIN
    ports:
      - 80:80
      - 443:443
    volumes:
      - /opt/appdata/letsencrypt:/config
    environment:
      - [email protected]
      - URL=duckdns.org
      - SUBDOMAINS=xxx
      - ONLY_SUBDOMAINS=true
      - DHLEVEL=2048
      - TZ=Europe/Budapest
      - PUID=1000
      - PGID=1000

Wildcards and DuckDNS support

DuckDNS now supports TXT records which means you can get a wildcard cert issued for any subdomain of your subdomain.

The process is below:

  1. Request the wildcard cert:
./certbot-auto certonly --manual -d *.yourdomain.duckdns.org --preferred-challenges dns-01 --server https://acme-v02.api.letsencrypt.org/directory
  1. Enter the TXT record via the duckdns api
curl https://www.duckdns.org/update?domains=yourdomain.duckdns.org\&token=<yourtoken>\&txt=<yourtxt>

nginx: [emerg] mkdir() "/var/tmp/nginx/client_body" failed (1: Operation not permitted)

First time setting up the container for two separate domains (keepitsimple.tv and keepitsimple.today)

docker run
-d
--privileged
--name=nginx
--net isolated_nw
-v /share/Container/application-data/nginx/config:/config
-e PGID=1001
-e PUID=1002
-e EMAIL=[email protected]
-e URL=keepitsimple.tv
-e SUBDOMAINS=nzbget,plexpy,radarr,request,requests,sonarr,www
-e EXTRA_DOMAINS=keepitsimple.today,nas.keepitsimple.today,www.keepitsimple.today
-e ONLY_SUBDOMAINS=false
-e DHLEVEL=2048
-p 443:443
-e TZ="US/Central"
-h atlas.nginx
linuxserver/letsencrypt

Receive the following error continuously on launch of the container (never gets past this):
nginx: [emerg] mkdir() "/var/tmp/nginx/client_body" failed (1: Operation not permitted)

Receive the same error on container release 76 and release 75.

TLS-SNI has been disabled in Cetbot. Update config to default to HTTP-01

linuxserver.io

Ubuntu 16.04

standard docker run command.

When using default value to HTTPVAL environmental variable.
2018-01-21 16:17:56,603:CRITICAL:certbot.auth_handler:Client with the currently selected authenticator does not support any combination of challenges that will satisfy the CA.

no symlinks.

Fix:
Set HTTPVAL defaut to true while TLS-SNI is disabled. - https://community.letsencrypt.org/t/important-what-you-need-to-know-about-tls-sni-validation-issues/50811

Yes, probably could be fixed wit a pull request.

Thanks, team linuxserver.io

Is --privileged really needed?

I tried starting the container without --privileged and it seems to work fine, to my understanding running privileged containers should be avoided if possible, I think there should either be a clarification on why it's needed or it should be removed from the example

Thanks for an awesome image!

Question: Is there a hook to pickup custom cron jobs?

Would like to be able to automate sending the periodically renewed certificate to the host systems running the applications that need them. How do I get this docker to pickup my custom script to run after a renewal?

php7-sockets package

Could you add the php7-sockets package to this docker or your alpine base? I have a php app I am trying to run from my www folder that is requiring it to be added and don't want to lose it next update.

Add package

Hello,

Can you add the package portsentry please.

Upgrade Insecure Requests

I suggest we add another header into the default nginx.conf file

add_header Content-Security-Policy "upgrade-insecure-requests";

This would solve issues with certain webservers not respecting proxy headers and embedding improper links/references.

PHP config files

Is there any way to change the php configuration? I like to put

disable_functions = "show_source, system, shell_exec, passthru, exec, phpinfo, popen, proc_open, allow_url_fopen"

in my php.ini, but there is no php config in my etc folder.

Cert does not exist!

Hi,

I use -e VALIDATION=http but it seems to be ignored. Kindly advice.

Host OS: Ubuntu 16.04.3 LTS

Command

docker run -d \
--restart=always \
--cap-add=NET_ADMIN \
--name=letsencrypt \
-v /media/docker/letsencrypt:/config \
-e PUID=10023 -e PGID=10065 \
-e [email protected] \
-e URL=xxx.org \
-e SUBDOMAINS=xxx \
-e VALIDATION=http \
-p 80:80 \
-p 443:443 \
-e TZ=Europe/Berlin \
linuxserver/letsencrypt

Docker log output:

...
Generating new certificate
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator standalone, Installer None
Obtaining a new certificate
Performing the following challenges:
Client with the currently selected authenticator does not support any combination of challenges that will satisfy the CA.
Client with the currently selected authenticator does not support any combination of challenges that will satisfy the CA.
ERROR: Cert does not exist! Please see the validation error above. The issue may be due to incorrect dns or port forwarding settings. Please fix your settings and recreate the container

Varible For PHP upload size

Feature request

Have a variable to specify php uploads size. Currently, I just mount php.ini as a volume
-v /path/to/your/custom/php.ini:/etc/php7/php.ini
but it is less than ideal if php makes a big config change.

..

linuxserver.io

Thanks, team linuxserver.io

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.