├── .dockerignore ├── .gitattributes ├── .github ├── CONTRIBUTING.md ├── FUNDING.yml ├── ISSUE_TEMPLATE │ ├── config.yml │ ├── issue.bug.md │ └── issue.feature.md ├── PULL_REQUEST_TEMPLATE.md └── workflows │ ├── deprecated.yml │ ├── external_trigger.yml │ ├── external_trigger_scheduler.yml │ ├── greetings.yml │ ├── package_trigger.yml │ ├── package_trigger_scheduler.yml │ └── stale.yml ├── Dockerfile ├── Dockerfile.aarch64 ├── Dockerfile.armhf ├── Jenkinsfile ├── LICENSE ├── README.md ├── jenkins-vars.yml ├── package_versions.txt ├── readme-vars.yml └── root ├── app ├── duckdns-txt └── le-renew.sh ├── defaults ├── authelia-location.conf ├── authelia-server.conf ├── default ├── dns-conf │ ├── aliyun.ini │ ├── cloudflare.ini │ ├── cloudxns.ini │ ├── cpanel.ini │ ├── digitalocean.ini │ ├── dnsimple.ini │ ├── dnsmadeeasy.ini │ ├── domeneshop.ini │ ├── gandi.ini │ ├── google.json │ ├── inwx.ini │ ├── linode.ini │ ├── luadns.ini │ ├── nsone.ini │ ├── ovh.ini │ ├── rfc2136.ini │ ├── route53.ini │ └── transip.ini ├── fail2ban │ ├── fail2ban.local │ └── filter.d │ │ ├── nginx-badbots.conf │ │ └── nginx-deny.conf ├── jail.local ├── ldap.conf ├── nginx.conf ├── proxy.conf └── ssl.conf ├── donate.txt └── etc ├── cont-init.d ├── 50-config ├── 60-renew └── 90-config ├── crontabs └── root ├── logrotate.d ├── fail2ban └── lerotate └── services.d └── fail2ban └── run /.dockerignore: -------------------------------------------------------------------------------- 1 | .git 2 | .gitignore 3 | .github 4 | .gitattributes 5 | READMETEMPLATE.md 6 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | 7 | # Standard to msysgit 8 | *.doc diff=astextplain 9 | *.DOC diff=astextplain 10 | *.docx diff=astextplain 11 | *.DOCX diff=astextplain 12 | *.dot diff=astextplain 13 | *.DOT diff=astextplain 14 | *.pdf diff=astextplain 15 | *.PDF diff=astextplain 16 | *.rtf diff=astextplain 17 | *.RTF diff=astextplain 18 | -------------------------------------------------------------------------------- /.github/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to letsencrypt 2 | 3 | ## Gotchas 4 | 5 | * While contributing make sure to make all your changes before creating a Pull Request, as our pipeline builds each commit after the PR is open. 6 | * Read, and fill the Pull Request template 7 | * If this is a fix for a typo in code or documentation in the README please file an issue 8 | * If the PR is addressing an existing issue include, closes #\, in the body of the PR commit message 9 | * If you want to discuss changes, you can also bring it up in [#dev-talk](https://discordapp.com/channels/354974912613449730/757585807061155840) in our [Discord server](https://discord.gg/YWrKVTn) 10 | 11 | ## Common files 12 | 13 | | File | Use case | 14 | | :----: | --- | 15 | | `Dockerfile` | Dockerfile used to build amd64 images | 16 | | `Dockerfile.aarch64` | Dockerfile used to build 64bit ARM architectures | 17 | | `Dockerfile.armhf` | Dockerfile used to build 32bit ARM architectures | 18 | | `Jenkinsfile` | This file is a product of our builder and should not be edited directly. This is used to build the image | 19 | | `jenkins-vars.yml` | This file is used to generate the `Jenkinsfile` mentioned above, it only affects the build-process | 20 | | `package_versions.txt` | This file is generated as a part of the build-process and should not be edited directly. It lists all the installed packages and their versions | 21 | | `README.md` | This file is a product of our builder and should not be edited directly. This displays the readme for the repository and image registries | 22 | | `readme-vars.yml` | This file is used to generate the `README.md` | 23 | 24 | ## Readme 25 | 26 | If you would like to change our readme, please __**do not**__ directly edit the readme, as it is auto-generated on each commit. 27 | Instead edit the [readme-vars.yml](https://github.com/linuxserver/docker-letsencrypt/edit/master/readme-vars.yml). 28 | 29 | These variables are used in a template for our [Jenkins Builder](https://github.com/linuxserver/docker-jenkins-builder) as part of an ansible play. 30 | Most of these variables are also carried over to [docs.linuxserver.io](https://docs.linuxserver.io) 31 | 32 | ### Fixing typos or clarify the text in the readme 33 | 34 | There are variables for multiple parts of the readme, the most common ones are: 35 | 36 | | Variable | Description | 37 | | :----: | --- | 38 | | `project_blurb` | This is the short excerpt shown above the project logo. | 39 | | `app_setup_block` | This is the text that shows up under "Application Setup" if enabled | 40 | 41 | ### Parameters 42 | 43 | The compose and run examples are also generated from these variables. 44 | 45 | We have a [reference file](https://github.com/linuxserver/docker-jenkins-builder/blob/master/vars/_container-vars-blank) in our Jenkins Builder. 46 | 47 | These are prefixed with `param_` for required parameters, or `opt_param` for optional parameters, except for `cap_add`. 48 | Remember to enable param, if currently disabled. This differs between parameters, and can be seen in the reference file. 49 | 50 | Devices, environment variables, ports and volumes expects its variables in a certain way. 51 | 52 | ### Devices 53 | 54 | ```yml 55 | param_devices: 56 | - { device_path: "/dev/dri", device_host_path: "/dev/dri", desc: "For hardware transcoding" } 57 | opt_param_devices: 58 | - { device_path: "/dev/dri", device_host_path: "/dev/dri", desc: "For hardware transcoding" } 59 | ``` 60 | 61 | ### Environment variables 62 | 63 | ```yml 64 | param_env_vars: 65 | - { env_var: "TZ", env_value: "Europe/London", desc: "Specify a timezone to use EG Europe/London." } 66 | opt_param_env_vars: 67 | - { env_var: "VERSION", env_value: "latest", desc: "Supported values are LATEST, PLEXPASS or a specific version number." } 68 | ``` 69 | 70 | ### Ports 71 | 72 | ```yml 73 | param_ports: 74 | - { external_port: "80", internal_port: "80", port_desc: "Application WebUI" } 75 | opt_param_ports: 76 | - { external_port: "80", internal_port: "80", port_desc: "Application WebUI" } 77 | ``` 78 | 79 | ### Volumes 80 | 81 | ```yml 82 | param_volumes: 83 | - { vol_path: "/config", vol_host_path: "", desc: "Configuration files." } 84 | opt_param_volumes: 85 | - { vol_path: "/config", vol_host_path: "", desc: "Configuration files." } 86 | ``` 87 | 88 | ### Testing template changes 89 | 90 | After you make any changes to the templates, you can use our [Jenkins Builder](https://github.com/linuxserver/docker-jenkins-builder) to have the files updated from the modified templates. Please use the command found under `Running Locally` [on this page](https://github.com/linuxserver/docker-jenkins-builder/blob/master/README.md) to generate them prior to submitting a PR. 91 | 92 | ## Dockerfiles 93 | 94 | We use multiple Dockerfiles in our repos, this is because sometimes some CPU architectures needs different packages to work. 95 | If you are proposing additional packages to be added, ensure that you added the packages to all the Dockerfiles in alphabetical order. 96 | 97 | ### Testing your changes 98 | 99 | ``` 100 | git clone https://github.com/linuxserver/docker-letsencrypt.git 101 | cd docker-letsencrypt 102 | docker build \ 103 | --no-cache \ 104 | --pull \ 105 | -t linuxserver/letsencrypt:latest . 106 | ``` 107 | 108 | The ARM variants can be built on x86_64 hardware using `multiarch/qemu-user-static` 109 | ``` 110 | docker run --rm --privileged multiarch/qemu-user-static:register --reset 111 | ``` 112 | 113 | Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64`. 114 | 115 | ## Update the chagelog 116 | 117 | If you are modifying the Dockerfiles or any of the startup scripts in [root](https://github.com/linuxserver/docker-letsencrypt/tree/master/root), add an entry to the changelog 118 | 119 | ```yml 120 | changelogs: 121 | - { date: "DD.MM.YY:", desc: "Added some love to templates" } 122 | ``` 123 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: linuxserver 2 | open_collective: linuxserver 3 | custom: ["https://supporters.eff.org/donate/support-work-on-certbot",] 4 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: Discord chat support 4 | url: https://discord.gg/YWrKVTn 5 | about: Realtime support / chat with the community and the team. 6 | 7 | - name: Discourse discussion forum 8 | url: https://discourse.linuxserver.io 9 | about: Post on our community forum. 10 | 11 | - name: Documentation 12 | url: https://docs.linuxserver.io 13 | about: Documentation - information about all of our containers. 14 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/issue.bug.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | 5 | --- 6 | [linuxserverurl]: https://linuxserver.io 7 | [![linuxserver.io](https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/linuxserver_medium.png)][linuxserverurl] 8 | 9 | 10 | 11 | 12 | 13 | ------------------------------ 14 | 15 | ## Expected Behavior 16 | 17 | 18 | ## Current Behavior 19 | 20 | 21 | ## Steps to Reproduce 22 | 23 | 24 | 1. 25 | 2. 26 | 3. 27 | 4. 28 | 29 | ## Environment 30 | **OS:** 31 | **CPU architecture:** x86_64/arm32/arm64 32 | **How docker service was installed:** 33 | 34 | 35 | 36 | ## Command used to create docker container (run/create/compose/screenshot) 37 | 38 | 39 | ## Docker logs 40 | 41 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/issue.feature.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | 5 | --- 6 | [linuxserverurl]: https://linuxserver.io 7 | [![linuxserver.io](https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/linuxserver_medium.png)][linuxserverurl] 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | ------------------------------ 17 | 18 | ## Desired Behavior 19 | 20 | 21 | ## Current Behavior 22 | 23 | 24 | ## Alternatives Considered 25 | 26 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [linuxserverurl]: https://linuxserver.io 4 | [![linuxserver.io](https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/linuxserver_medium.png)][linuxserverurl] 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | ------------------------------ 23 | 24 | - [ ] I have read the [contributing](https://github.com/linuxserver/docker-letsencrypt/blob/master/.github/CONTRIBUTING.md) guideline and understand that I have made the correct modifications 25 | 26 | ------------------------------ 27 | 28 | 29 | 30 | ## Description: 31 | 32 | 33 | ## Benefits of this PR and context: 34 | 35 | 36 | ## How Has This Been Tested? 37 | 38 | 39 | 40 | 41 | 42 | ## Source / References: 43 | 44 | -------------------------------------------------------------------------------- /.github/workflows/deprecated.yml: -------------------------------------------------------------------------------- 1 | name: Deprecated 2 | 3 | on: 4 | issues: 5 | types: [opened, reopened] 6 | pull_request_target: 7 | types: [opened, reopened] 8 | 9 | jobs: 10 | comment: 11 | runs-on: ubuntu-latest 12 | steps: 13 | - run: | 14 | curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -X POST "${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY}/issues/${{ github.event.issue.number || github.event.pull_request.number }}/comments" \ 15 | -d '{"body": "# IMPORTANT NOTICE: THIS IMAGE HAS BEEN DEPRECATED AND THE PROJECT IS MOVED TO A NEW REPO\nDue to a trademark related request, this image is moved to a new repo on [Docker Hub](https://hub.docker.com/r/linuxserver/swag) and [GitHub](https://github.com/linuxserver/docker-swag). This is a breaking change and you need to manually update. Apologies for the the disruption."}' 16 | -------------------------------------------------------------------------------- /.github/workflows/external_trigger.yml: -------------------------------------------------------------------------------- 1 | name: External Trigger Main 2 | 3 | on: 4 | workflow_dispatch: 5 | 6 | jobs: 7 | external-trigger-master: 8 | runs-on: ubuntu-latest 9 | steps: 10 | - uses: actions/checkout@v2.3.3 11 | 12 | - name: External Trigger 13 | if: github.ref == 'refs/heads/master' 14 | run: | 15 | if [ -n "${{ secrets.PAUSE_EXTERNAL_TRIGGER_LETSENCRYPT_MASTER }}" ]; then 16 | echo "**** Github secret PAUSE_EXTERNAL_TRIGGER_LETSENCRYPT_MASTER is set; skipping trigger. ****" 17 | exit 0 18 | fi 19 | echo "**** External trigger running off of master branch. To disable this trigger, set a Github secret named \"PAUSE_EXTERNAL_TRIGGER_LETSENCRYPT_MASTER\". ****" 20 | echo "**** Retrieving external version ****" 21 | EXT_RELEASE=$(curl -sL "https://pypi.python.org/pypi/certbot/json" |jq -r '. | .info.version') 22 | if [ -z "${EXT_RELEASE}" ] || [ "${EXT_RELEASE}" == "null" ]; then 23 | echo "**** Can't retrieve external version, exiting ****" 24 | FAILURE_REASON="Can't retrieve external version for letsencrypt branch master" 25 | curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 16711680, 26 | "description": "**Trigger Failed** \n**Reason:** '"${FAILURE_REASON}"' \n"}], 27 | "username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }} 28 | exit 1 29 | fi 30 | EXT_RELEASE=$(echo ${EXT_RELEASE} | sed 's/[~,%@+;:/]//g') 31 | echo "**** External version: ${EXT_RELEASE} ****" 32 | echo "**** Retrieving last pushed version ****" 33 | image="linuxserver/letsencrypt" 34 | tag="latest" 35 | token=$(curl -sX GET \ 36 | "https://ghcr.io/token?scope=repository%3Alinuxserver%2Fletsencrypt%3Apull" \ 37 | | jq -r '.token') 38 | multidigest=$(curl -s \ 39 | --header "Accept: application/vnd.docker.distribution.manifest.v2+json" \ 40 | --header "Authorization: Bearer ${token}" \ 41 | "https://ghcr.io/v2/${image}/manifests/${tag}" \ 42 | | jq -r 'first(.manifests[].digest)') 43 | digest=$(curl -s \ 44 | --header "Accept: application/vnd.docker.distribution.manifest.v2+json" \ 45 | --header "Authorization: Bearer ${token}" \ 46 | "https://ghcr.io/v2/${image}/manifests/${multidigest}" \ 47 | | jq -r '.config.digest') 48 | image_info=$(curl -sL \ 49 | --header "Authorization: Bearer ${token}" \ 50 | "https://ghcr.io/v2/${image}/blobs/${digest}" \ 51 | | jq -r '.container_config') 52 | IMAGE_RELEASE=$(echo ${image_info} | jq -r '.Labels.build_version' | awk '{print $3}') 53 | IMAGE_VERSION=$(echo ${IMAGE_RELEASE} | awk -F'-ls' '{print $1}') 54 | if [ -z "${IMAGE_VERSION}" ]; then 55 | echo "**** Can't retrieve last pushed version, exiting ****" 56 | FAILURE_REASON="Can't retrieve last pushed version for letsencrypt tag latest" 57 | curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 16711680, 58 | "description": "**Trigger Failed** \n**Reason:** '"${FAILURE_REASON}"' \n"}], 59 | "username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }} 60 | exit 1 61 | fi 62 | echo "**** Last pushed version: ${IMAGE_VERSION} ****" 63 | if [ "${EXT_RELEASE}" == "${IMAGE_VERSION}" ]; then 64 | echo "**** Version ${EXT_RELEASE} already pushed, exiting ****" 65 | exit 0 66 | elif [ $(curl -s https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-letsencrypt/job/master/lastBuild/api/json | jq -r '.building') == "true" ]; then 67 | echo "**** New version ${EXT_RELEASE} found; but there already seems to be an active build on Jenkins; exiting ****" 68 | exit 0 69 | else 70 | echo "**** New version ${EXT_RELEASE} found; old version was ${IMAGE_VERSION}. Triggering new build ****" 71 | response=$(curl -iX POST \ 72 | https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-letsencrypt/job/master/buildWithParameters?PACKAGE_CHECK=false \ 73 | --user ${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }} | grep -i location | sed "s|^[L|l]ocation: \(.*\)|\1|") 74 | echo "**** Jenkins job queue url: ${response%$'\r'} ****" 75 | echo "**** Sleeping 10 seconds until job starts ****" 76 | sleep 10 77 | buildurl=$(curl -s "${response%$'\r'}api/json" | jq -r '.executable.url') 78 | buildurl="${buildurl%$'\r'}" 79 | echo "**** Jenkins job build url: ${buildurl} ****" 80 | echo "**** Attempting to change the Jenkins job description ****" 81 | curl -iX POST \ 82 | "${buildurl}submitDescription" \ 83 | --user ${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }} \ 84 | --data-urlencode "description=GHA external trigger https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" \ 85 | --data-urlencode "Submit=Submit" 86 | echo "**** Notifying Discord ****" 87 | TRIGGER_REASON="A version change was detected for letsencrypt tag latest. Old version:${IMAGE_VERSION} New version:${EXT_RELEASE}" 88 | curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 9802903, 89 | "description": "**Build Triggered** \n**Reason:** '"${TRIGGER_REASON}"' \n**Build URL:** '"${buildurl}display/redirect"' \n"}], 90 | "username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }} 91 | fi 92 | -------------------------------------------------------------------------------- /.github/workflows/external_trigger_scheduler.yml: -------------------------------------------------------------------------------- 1 | name: External Trigger Scheduler 2 | 3 | on: 4 | schedule: 5 | - cron: '55 * * * *' 6 | workflow_dispatch: 7 | 8 | jobs: 9 | external-trigger-scheduler: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - uses: actions/checkout@v2.3.3 13 | with: 14 | fetch-depth: '0' 15 | 16 | - name: External Trigger Scheduler 17 | run: | 18 | echo "**** Branches found: ****" 19 | git for-each-ref --format='%(refname:short)' refs/remotes 20 | echo "**** Pulling the yq docker image ****" 21 | docker pull ghcr.io/linuxserver/yq 22 | for br in $(git for-each-ref --format='%(refname:short)' refs/remotes) 23 | do 24 | br=$(echo "$br" | sed 's|origin/||g') 25 | echo "**** Evaluating branch ${br} ****" 26 | ls_branch=$(curl -sX GET https://raw.githubusercontent.com/linuxserver/docker-letsencrypt/${br}/jenkins-vars.yml \ 27 | | docker run --rm -i --entrypoint yq ghcr.io/linuxserver/yq -r .ls_branch) 28 | if [ "$br" == "$ls_branch" ]; then 29 | echo "**** Branch ${br} appears to be live; checking workflow. ****" 30 | if curl -sfX GET https://raw.githubusercontent.com/linuxserver/docker-letsencrypt/${br}/.github/workflows/external_trigger.yml > /dev/null 2>&1; then 31 | echo "**** Workflow exists. Triggering external trigger workflow for branch ${br} ****." 32 | curl -iX POST \ 33 | -H "Authorization: token ${{ secrets.CR_PAT }}" \ 34 | -H "Accept: application/vnd.github.v3+json" \ 35 | -d "{\"ref\":\"refs/heads/${br}\"}" \ 36 | https://api.github.com/repos/linuxserver/docker-letsencrypt/actions/workflows/external_trigger.yml/dispatches 37 | else 38 | echo "**** Workflow doesn't exist; skipping trigger. ****" 39 | fi 40 | else 41 | echo "**** ${br} appears to be a dev branch; skipping trigger. ****" 42 | fi 43 | done 44 | -------------------------------------------------------------------------------- /.github/workflows/greetings.yml: -------------------------------------------------------------------------------- 1 | name: Greetings 2 | 3 | on: [pull_request_target, issues] 4 | 5 | jobs: 6 | greeting: 7 | runs-on: ubuntu-latest 8 | steps: 9 | - uses: actions/first-interaction@v1 10 | with: 11 | issue-message: 'Thanks for opening your first issue here! Be sure to follow the [issue template](https://github.com/linuxserver/docker-letsencrypt/blob/master/.github/ISSUE_TEMPLATE.md)!' 12 | pr-message: 'Thanks for opening this pull request! Be sure to follow the [pull request template](https://github.com/linuxserver/docker-letsencrypt/blob/master/.github/PULL_REQUEST_TEMPLATE.md)!' 13 | repo-token: ${{ secrets.GITHUB_TOKEN }} 14 | -------------------------------------------------------------------------------- /.github/workflows/package_trigger.yml: -------------------------------------------------------------------------------- 1 | name: Package Trigger Main 2 | 3 | on: 4 | workflow_dispatch: 5 | 6 | jobs: 7 | package-trigger-master: 8 | runs-on: ubuntu-latest 9 | steps: 10 | - uses: actions/checkout@v2.3.3 11 | 12 | - name: Package Trigger 13 | if: github.ref == 'refs/heads/master' 14 | run: | 15 | if [ -n "${{ secrets.PAUSE_PACKAGE_TRIGGER_LETSENCRYPT_MASTER }}" ]; then 16 | echo "**** Github secret PAUSE_PACKAGE_TRIGGER_LETSENCRYPT_MASTER is set; skipping trigger. ****" 17 | exit 0 18 | fi 19 | if [ $(curl -s https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-letsencrypt/job/master/lastBuild/api/json | jq -r '.building') == "true" ]; then 20 | echo "**** There already seems to be an active build on Jenkins; skipping package trigger ****" 21 | exit 0 22 | fi 23 | echo "**** Package trigger running off of master branch. To disable, set a Github secret named \"PAUSE_PACKAGE_TRIGGER_LETSENCRYPT_MASTER\". ****" 24 | response=$(curl -iX POST \ 25 | https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-letsencrypt/job/master/buildWithParameters?PACKAGE_CHECK=true \ 26 | --user ${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }} | grep -i location | sed "s|^[L|l]ocation: \(.*\)|\1|") 27 | echo "**** Jenkins job queue url: ${response%$'\r'} ****" 28 | echo "**** Sleeping 10 seconds until job starts ****" 29 | sleep 10 30 | buildurl=$(curl -s "${response%$'\r'}api/json" | jq -r '.executable.url') 31 | buildurl="${buildurl%$'\r'}" 32 | echo "**** Jenkins job build url: ${buildurl} ****" 33 | echo "**** Attempting to change the Jenkins job description ****" 34 | curl -iX POST \ 35 | "${buildurl}submitDescription" \ 36 | --user ${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }} \ 37 | --data-urlencode "description=GHA package trigger https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" \ 38 | --data-urlencode "Submit=Submit" 39 | -------------------------------------------------------------------------------- /.github/workflows/package_trigger_scheduler.yml: -------------------------------------------------------------------------------- 1 | name: Package Trigger Scheduler 2 | 3 | on: 4 | schedule: 5 | - cron: '24 2 * * 2' 6 | workflow_dispatch: 7 | 8 | jobs: 9 | package-trigger-scheduler: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - uses: actions/checkout@v2.3.3 13 | with: 14 | fetch-depth: '0' 15 | 16 | - name: Package Trigger Scheduler 17 | run: | 18 | echo "**** Branches found: ****" 19 | git for-each-ref --format='%(refname:short)' refs/remotes 20 | echo "**** Pulling the yq docker image ****" 21 | docker pull ghcr.io/linuxserver/yq 22 | for br in $(git for-each-ref --format='%(refname:short)' refs/remotes) 23 | do 24 | br=$(echo "$br" | sed 's|origin/||g') 25 | echo "**** Evaluating branch ${br} ****" 26 | ls_branch=$(curl -sX GET https://raw.githubusercontent.com/linuxserver/docker-letsencrypt/${br}/jenkins-vars.yml \ 27 | | docker run --rm -i --entrypoint yq ghcr.io/linuxserver/yq -r .ls_branch) 28 | if [ "${br}" == "${ls_branch}" ]; then 29 | echo "**** Branch ${br} appears to be live; checking workflow. ****" 30 | if curl -sfX GET https://raw.githubusercontent.com/linuxserver/docker-letsencrypt/${br}/.github/workflows/package_trigger.yml > /dev/null 2>&1; then 31 | echo "**** Workflow exists. Triggering package trigger workflow for branch ${br}. ****" 32 | triggered_branches="${triggered_branches}${br} " 33 | curl -iX POST \ 34 | -H "Authorization: token ${{ secrets.CR_PAT }}" \ 35 | -H "Accept: application/vnd.github.v3+json" \ 36 | -d "{\"ref\":\"refs/heads/${br}\"}" \ 37 | https://api.github.com/repos/linuxserver/docker-letsencrypt/actions/workflows/package_trigger.yml/dispatches 38 | sleep 30 39 | else 40 | echo "**** Workflow doesn't exist; skipping trigger. ****" 41 | fi 42 | else 43 | echo "**** ${br} appears to be a dev branch; skipping trigger. ****" 44 | fi 45 | done 46 | echo "**** Package check build(s) triggered for branch(es): ${triggered_branches} ****" 47 | echo "**** Notifying Discord ****" 48 | curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 9802903, 49 | "description": "**Package Check Build(s) Triggered for letsencrypt** \n**Branch(es):** '"${triggered_branches}"' \n**Build URL:** '"https://ci.linuxserver.io/blue/organizations/jenkins/Docker-Pipeline-Builders%2Fdocker-letsencrypt/activity/"' \n"}], 50 | "username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }} 51 | -------------------------------------------------------------------------------- /.github/workflows/stale.yml: -------------------------------------------------------------------------------- 1 | name: Mark stale issues and pull requests 2 | 3 | on: 4 | schedule: 5 | - cron: "30 1 * * *" 6 | 7 | jobs: 8 | stale: 9 | 10 | runs-on: ubuntu-latest 11 | 12 | steps: 13 | - uses: actions/stale@v1 14 | with: 15 | stale-issue-message: "This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions." 16 | stale-pr-message: "This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions." 17 | stale-issue-label: 'no-issue-activity' 18 | stale-pr-label: 'no-pr-activity' 19 | days-before-stale: 30 20 | days-before-close: 365 21 | exempt-issue-labels: 'awaiting-approval,work-in-progress' 22 | exempt-pr-labels: 'awaiting-approval,work-in-progress' 23 | repo-token: ${{ secrets.GITHUB_TOKEN }} 24 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM lsiobase/nginx:3.12 2 | 3 | # set version label 4 | ARG BUILD_DATE 5 | ARG VERSION 6 | ARG CERTBOT_VERSION 7 | LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}" 8 | LABEL maintainer="aptalca" 9 | 10 | # environment settings 11 | ENV DHLEVEL=2048 ONLY_SUBDOMAINS=false AWS_CONFIG_FILE=/config/dns-conf/route53.ini 12 | ENV S6_BEHAVIOUR_IF_STAGE2_FAILS=2 13 | 14 | RUN \ 15 | echo "**** install build packages ****" && \ 16 | apk add --no-cache --virtual=build-dependencies \ 17 | g++ \ 18 | gcc \ 19 | libffi-dev \ 20 | openssl-dev \ 21 | python3-dev && \ 22 | echo "**** install runtime packages ****" && \ 23 | apk add --no-cache --upgrade \ 24 | curl \ 25 | fail2ban \ 26 | gnupg \ 27 | memcached \ 28 | nginx \ 29 | nginx-mod-http-echo \ 30 | nginx-mod-http-fancyindex \ 31 | nginx-mod-http-geoip2 \ 32 | nginx-mod-http-headers-more \ 33 | nginx-mod-http-image-filter \ 34 | nginx-mod-http-lua \ 35 | nginx-mod-http-lua-upstream \ 36 | nginx-mod-http-nchan \ 37 | nginx-mod-http-perl \ 38 | nginx-mod-http-redis2 \ 39 | nginx-mod-http-set-misc \ 40 | nginx-mod-http-upload-progress \ 41 | nginx-mod-http-xslt-filter \ 42 | nginx-mod-mail \ 43 | nginx-mod-rtmp \ 44 | nginx-mod-stream \ 45 | nginx-mod-stream-geoip2 \ 46 | nginx-vim \ 47 | php7-bcmath \ 48 | php7-bz2 \ 49 | php7-ctype \ 50 | php7-curl \ 51 | php7-dom \ 52 | php7-exif \ 53 | php7-ftp \ 54 | php7-gd \ 55 | php7-iconv \ 56 | php7-imap \ 57 | php7-intl \ 58 | php7-ldap \ 59 | php7-mcrypt \ 60 | php7-memcached \ 61 | php7-mysqli \ 62 | php7-mysqlnd \ 63 | php7-opcache \ 64 | php7-pdo_mysql \ 65 | php7-pdo_odbc \ 66 | php7-pdo_pgsql \ 67 | php7-pdo_sqlite \ 68 | php7-pear \ 69 | php7-pecl-apcu \ 70 | php7-pecl-redis \ 71 | php7-pgsql \ 72 | php7-phar \ 73 | php7-posix \ 74 | php7-soap \ 75 | php7-sockets \ 76 | php7-sodium \ 77 | php7-sqlite3 \ 78 | php7-tokenizer \ 79 | php7-xml \ 80 | php7-xmlreader \ 81 | php7-xmlrpc \ 82 | php7-zip \ 83 | py3-cryptography \ 84 | py3-future \ 85 | py3-pip \ 86 | whois && \ 87 | echo "**** install certbot plugins ****" && \ 88 | if [ -z ${CERTBOT_VERSION+x} ]; then \ 89 | CERTBOT="certbot"; \ 90 | else \ 91 | CERTBOT="certbot==${CERTBOT_VERSION}"; \ 92 | fi && \ 93 | pip3 install -U \ 94 | pip && \ 95 | pip3 install -U \ 96 | ${CERTBOT} \ 97 | certbot-dns-aliyun \ 98 | certbot-dns-cloudflare \ 99 | certbot-dns-cloudxns \ 100 | certbot-dns-cpanel \ 101 | certbot-dns-digitalocean \ 102 | certbot-dns-dnsimple \ 103 | certbot-dns-dnsmadeeasy \ 104 | certbot-dns-domeneshop \ 105 | certbot-dns-google \ 106 | certbot-dns-inwx \ 107 | certbot-dns-linode \ 108 | certbot-dns-luadns \ 109 | certbot-dns-nsone \ 110 | certbot-dns-ovh \ 111 | certbot-dns-rfc2136 \ 112 | certbot-dns-route53 \ 113 | certbot-dns-transip \ 114 | certbot-plugin-gandi \ 115 | cryptography \ 116 | requests && \ 117 | echo "**** remove unnecessary fail2ban filters ****" && \ 118 | rm \ 119 | /etc/fail2ban/jail.d/alpine-ssh.conf && \ 120 | echo "**** copy fail2ban default action and filter to /default ****" && \ 121 | mkdir -p /defaults/fail2ban && \ 122 | mv /etc/fail2ban/action.d /defaults/fail2ban/ && \ 123 | mv /etc/fail2ban/filter.d /defaults/fail2ban/ && \ 124 | echo "**** copy proxy confs to /default ****" && \ 125 | mkdir -p /defaults/proxy-confs && \ 126 | curl -o \ 127 | /tmp/proxy.tar.gz -L \ 128 | "https://github.com/linuxserver/reverse-proxy-confs/tarball/master" && \ 129 | tar xf \ 130 | /tmp/proxy.tar.gz -C \ 131 | /defaults/proxy-confs --strip-components=1 --exclude=linux*/.gitattributes --exclude=linux*/.github --exclude=linux*/.gitignore --exclude=linux*/LICENSE && \ 132 | echo "**** configure nginx ****" && \ 133 | rm -f /etc/nginx/conf.d/default.conf && \ 134 | curl -o \ 135 | /defaults/dhparams.pem -L \ 136 | "https://lsio.ams3.digitaloceanspaces.com/dhparams.pem" && \ 137 | echo "**** cleanup ****" && \ 138 | apk del --purge \ 139 | build-dependencies && \ 140 | for cleanfiles in *.pyc *.pyo; \ 141 | do \ 142 | find /usr/lib/python3.* -iname "${cleanfiles}" -exec rm -f '{}' + \ 143 | ; done && \ 144 | rm -rf \ 145 | /tmp/* \ 146 | /root/.cache 147 | 148 | # add local files 149 | COPY root/ / 150 | -------------------------------------------------------------------------------- /Dockerfile.aarch64: -------------------------------------------------------------------------------- 1 | FROM lsiobase/nginx:arm64v8-3.12 2 | 3 | # set version label 4 | ARG BUILD_DATE 5 | ARG VERSION 6 | ARG CERTBOT_VERSION 7 | LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}" 8 | LABEL maintainer="aptalca" 9 | 10 | # environment settings 11 | ENV DHLEVEL=2048 ONLY_SUBDOMAINS=false AWS_CONFIG_FILE=/config/dns-conf/route53.ini 12 | ENV S6_BEHAVIOUR_IF_STAGE2_FAILS=2 13 | 14 | RUN \ 15 | echo "**** install build packages ****" && \ 16 | apk add --no-cache --virtual=build-dependencies \ 17 | g++ \ 18 | gcc \ 19 | libffi-dev \ 20 | openssl-dev \ 21 | python3-dev && \ 22 | echo "**** install runtime packages ****" && \ 23 | apk add --no-cache --upgrade \ 24 | curl \ 25 | fail2ban \ 26 | gnupg \ 27 | memcached \ 28 | nginx \ 29 | nginx-mod-http-echo \ 30 | nginx-mod-http-fancyindex \ 31 | nginx-mod-http-geoip2 \ 32 | nginx-mod-http-headers-more \ 33 | nginx-mod-http-image-filter \ 34 | nginx-mod-http-lua \ 35 | nginx-mod-http-lua-upstream \ 36 | nginx-mod-http-nchan \ 37 | nginx-mod-http-perl \ 38 | nginx-mod-http-redis2 \ 39 | nginx-mod-http-set-misc \ 40 | nginx-mod-http-upload-progress \ 41 | nginx-mod-http-xslt-filter \ 42 | nginx-mod-mail \ 43 | nginx-mod-rtmp \ 44 | nginx-mod-stream \ 45 | nginx-mod-stream-geoip2 \ 46 | nginx-vim \ 47 | php7-bcmath \ 48 | php7-bz2 \ 49 | php7-ctype \ 50 | php7-curl \ 51 | php7-dom \ 52 | php7-exif \ 53 | php7-ftp \ 54 | php7-gd \ 55 | php7-iconv \ 56 | php7-imap \ 57 | php7-intl \ 58 | php7-ldap \ 59 | php7-mcrypt \ 60 | php7-memcached \ 61 | php7-mysqli \ 62 | php7-mysqlnd \ 63 | php7-opcache \ 64 | php7-pdo_mysql \ 65 | php7-pdo_odbc \ 66 | php7-pdo_pgsql \ 67 | php7-pdo_sqlite \ 68 | php7-pear \ 69 | php7-pecl-apcu \ 70 | php7-pecl-redis \ 71 | php7-pgsql \ 72 | php7-phar \ 73 | php7-posix \ 74 | php7-soap \ 75 | php7-sockets \ 76 | php7-sodium \ 77 | php7-sqlite3 \ 78 | php7-tokenizer \ 79 | php7-xml \ 80 | php7-xmlreader \ 81 | php7-xmlrpc \ 82 | php7-zip \ 83 | py3-cryptography \ 84 | py3-future \ 85 | py3-pip \ 86 | whois && \ 87 | echo "**** install certbot plugins ****" && \ 88 | if [ -z ${CERTBOT_VERSION+x} ]; then \ 89 | CERTBOT="certbot"; \ 90 | else \ 91 | CERTBOT="certbot==${CERTBOT_VERSION}"; \ 92 | fi && \ 93 | pip3 install -U \ 94 | pip && \ 95 | pip3 install -U \ 96 | ${CERTBOT} \ 97 | certbot-dns-aliyun \ 98 | certbot-dns-cloudflare \ 99 | certbot-dns-cloudxns \ 100 | certbot-dns-cpanel \ 101 | certbot-dns-digitalocean \ 102 | certbot-dns-dnsimple \ 103 | certbot-dns-dnsmadeeasy \ 104 | certbot-dns-domeneshop \ 105 | certbot-dns-google \ 106 | certbot-dns-inwx \ 107 | certbot-dns-linode \ 108 | certbot-dns-luadns \ 109 | certbot-dns-nsone \ 110 | certbot-dns-ovh \ 111 | certbot-dns-rfc2136 \ 112 | certbot-dns-route53 \ 113 | certbot-dns-transip \ 114 | certbot-plugin-gandi \ 115 | cryptography \ 116 | requests && \ 117 | echo "**** remove unnecessary fail2ban filters ****" && \ 118 | rm \ 119 | /etc/fail2ban/jail.d/alpine-ssh.conf && \ 120 | echo "**** copy fail2ban default action and filter to /default ****" && \ 121 | mkdir -p /defaults/fail2ban && \ 122 | mv /etc/fail2ban/action.d /defaults/fail2ban/ && \ 123 | mv /etc/fail2ban/filter.d /defaults/fail2ban/ && \ 124 | echo "**** copy proxy confs to /default ****" && \ 125 | mkdir -p /defaults/proxy-confs && \ 126 | curl -o \ 127 | /tmp/proxy.tar.gz -L \ 128 | "https://github.com/linuxserver/reverse-proxy-confs/tarball/master" && \ 129 | tar xf \ 130 | /tmp/proxy.tar.gz -C \ 131 | /defaults/proxy-confs --strip-components=1 --exclude=linux*/.gitattributes --exclude=linux*/.github --exclude=linux*/.gitignore --exclude=linux*/LICENSE && \ 132 | echo "**** configure nginx ****" && \ 133 | rm -f /etc/nginx/conf.d/default.conf && \ 134 | curl -o \ 135 | /defaults/dhparams.pem -L \ 136 | "https://lsio.ams3.digitaloceanspaces.com/dhparams.pem" && \ 137 | echo "**** cleanup ****" && \ 138 | apk del --purge \ 139 | build-dependencies && \ 140 | for cleanfiles in *.pyc *.pyo; \ 141 | do \ 142 | find /usr/lib/python3.* -iname "${cleanfiles}" -exec rm -f '{}' + \ 143 | ; done && \ 144 | rm -rf \ 145 | /tmp/* \ 146 | /root/.cache 147 | 148 | # add local files 149 | COPY root/ / 150 | -------------------------------------------------------------------------------- /Dockerfile.armhf: -------------------------------------------------------------------------------- 1 | FROM lsiobase/nginx:arm32v7-3.12 2 | 3 | # set version label 4 | ARG BUILD_DATE 5 | ARG VERSION 6 | ARG CERTBOT_VERSION 7 | LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}" 8 | LABEL maintainer="aptalca" 9 | 10 | # environment settings 11 | ENV DHLEVEL=2048 ONLY_SUBDOMAINS=false AWS_CONFIG_FILE=/config/dns-conf/route53.ini 12 | ENV S6_BEHAVIOUR_IF_STAGE2_FAILS=2 13 | 14 | RUN \ 15 | echo "**** install build packages ****" && \ 16 | apk add --no-cache --virtual=build-dependencies \ 17 | g++ \ 18 | gcc \ 19 | libffi-dev \ 20 | openssl-dev \ 21 | python3-dev && \ 22 | echo "**** install runtime packages ****" && \ 23 | apk add --no-cache --upgrade \ 24 | curl \ 25 | fail2ban \ 26 | gnupg \ 27 | memcached \ 28 | nginx \ 29 | nginx-mod-http-echo \ 30 | nginx-mod-http-fancyindex \ 31 | nginx-mod-http-geoip2 \ 32 | nginx-mod-http-headers-more \ 33 | nginx-mod-http-image-filter \ 34 | nginx-mod-http-lua \ 35 | nginx-mod-http-lua-upstream \ 36 | nginx-mod-http-nchan \ 37 | nginx-mod-http-perl \ 38 | nginx-mod-http-redis2 \ 39 | nginx-mod-http-set-misc \ 40 | nginx-mod-http-upload-progress \ 41 | nginx-mod-http-xslt-filter \ 42 | nginx-mod-mail \ 43 | nginx-mod-rtmp \ 44 | nginx-mod-stream \ 45 | nginx-mod-stream-geoip2 \ 46 | nginx-vim \ 47 | php7-bcmath \ 48 | php7-bz2 \ 49 | php7-ctype \ 50 | php7-curl \ 51 | php7-dom \ 52 | php7-exif \ 53 | php7-ftp \ 54 | php7-gd \ 55 | php7-iconv \ 56 | php7-imap \ 57 | php7-intl \ 58 | php7-ldap \ 59 | php7-mcrypt \ 60 | php7-memcached \ 61 | php7-mysqli \ 62 | php7-mysqlnd \ 63 | php7-opcache \ 64 | php7-pdo_mysql \ 65 | php7-pdo_odbc \ 66 | php7-pdo_pgsql \ 67 | php7-pdo_sqlite \ 68 | php7-pear \ 69 | php7-pecl-apcu \ 70 | php7-pecl-redis \ 71 | php7-pgsql \ 72 | php7-phar \ 73 | php7-posix \ 74 | php7-soap \ 75 | php7-sockets \ 76 | php7-sodium \ 77 | php7-sqlite3 \ 78 | php7-tokenizer \ 79 | php7-xml \ 80 | php7-xmlreader \ 81 | php7-xmlrpc \ 82 | php7-zip \ 83 | py3-cryptography \ 84 | py3-future \ 85 | py3-pip \ 86 | whois && \ 87 | echo "**** install certbot plugins ****" && \ 88 | if [ -z ${CERTBOT_VERSION+x} ]; then \ 89 | CERTBOT="certbot"; \ 90 | else \ 91 | CERTBOT="certbot==${CERTBOT_VERSION}"; \ 92 | fi && \ 93 | pip3 install -U \ 94 | pip && \ 95 | pip3 install -U \ 96 | ${CERTBOT} \ 97 | certbot-dns-aliyun \ 98 | certbot-dns-cloudflare \ 99 | certbot-dns-cloudxns \ 100 | certbot-dns-cpanel \ 101 | certbot-dns-digitalocean \ 102 | certbot-dns-dnsimple \ 103 | certbot-dns-dnsmadeeasy \ 104 | certbot-dns-domeneshop \ 105 | certbot-dns-google \ 106 | certbot-dns-inwx \ 107 | certbot-dns-linode \ 108 | certbot-dns-luadns \ 109 | certbot-dns-nsone \ 110 | certbot-dns-ovh \ 111 | certbot-dns-rfc2136 \ 112 | certbot-dns-route53 \ 113 | certbot-dns-transip \ 114 | certbot-plugin-gandi \ 115 | cryptography \ 116 | requests && \ 117 | echo "**** remove unnecessary fail2ban filters ****" && \ 118 | rm \ 119 | /etc/fail2ban/jail.d/alpine-ssh.conf && \ 120 | echo "**** copy fail2ban default action and filter to /default ****" && \ 121 | mkdir -p /defaults/fail2ban && \ 122 | mv /etc/fail2ban/action.d /defaults/fail2ban/ && \ 123 | mv /etc/fail2ban/filter.d /defaults/fail2ban/ && \ 124 | echo "**** copy proxy confs to /default ****" && \ 125 | mkdir -p /defaults/proxy-confs && \ 126 | curl -o \ 127 | /tmp/proxy.tar.gz -L \ 128 | "https://github.com/linuxserver/reverse-proxy-confs/tarball/master" && \ 129 | tar xf \ 130 | /tmp/proxy.tar.gz -C \ 131 | /defaults/proxy-confs --strip-components=1 --exclude=linux*/.gitattributes --exclude=linux*/.github --exclude=linux*/.gitignore --exclude=linux*/LICENSE && \ 132 | echo "**** configure nginx ****" && \ 133 | rm -f /etc/nginx/conf.d/default.conf && \ 134 | curl -o \ 135 | /defaults/dhparams.pem -L \ 136 | "https://lsio.ams3.digitaloceanspaces.com/dhparams.pem" && \ 137 | echo "**** cleanup ****" && \ 138 | apk del --purge \ 139 | build-dependencies && \ 140 | for cleanfiles in *.pyc *.pyo; \ 141 | do \ 142 | find /usr/lib/python3.* -iname "${cleanfiles}" -exec rm -f '{}' + \ 143 | ; done && \ 144 | rm -rf \ 145 | /tmp/* \ 146 | /root/.cache 147 | 148 | # add local files 149 | COPY root/ / 150 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | # IMPORTANT NOTICE: THIS IMAGE HAS BEEN DEPRECATED AND THE PROJECT IS MOVED TO A NEW REPO 5 | Due to a trademark related request, this image is moved to a new repo on [Docker Hub](https://hub.docker.com/r/linuxserver/swag) and [GitHub](https://github.com/linuxserver/docker-swag). This is a breaking change and you need to manually update. Apologies for the the disruption. 6 | 7 | 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 8 | 9 | ## This repository will be archived and builds for the image will no longer be created at the end of 2020 10 | 11 | [![linuxserver.io](https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/linuxserver_medium.png)](https://linuxserver.io) 12 | 13 | [![Blog](https://img.shields.io/static/v1.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=linuxserver.io&message=Blog)](https://blog.linuxserver.io "all the things you can do with our containers including How-To guides, opinions and much more!") 14 | [![Discord](https://img.shields.io/discord/354974912613449730.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=Discord&logo=discord)](https://discord.gg/YWrKVTn "realtime support / chat with the community and the team.") 15 | [![Discourse](https://img.shields.io/discourse/https/discourse.linuxserver.io/topics.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&logo=discourse)](https://discourse.linuxserver.io "post on our community forum.") 16 | [![Fleet](https://img.shields.io/static/v1.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=linuxserver.io&message=Fleet)](https://fleet.linuxserver.io "an online web interface which displays all of our maintained images.") 17 | [![GitHub](https://img.shields.io/static/v1.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=linuxserver.io&message=GitHub&logo=github)](https://github.com/linuxserver "view the source for all of our repositories.") 18 | [![Open Collective](https://img.shields.io/opencollective/all/linuxserver.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=Supporters&logo=open%20collective)](https://opencollective.com/linuxserver "please consider helping us by either donating or contributing to our budget") 19 | 20 | The [LinuxServer.io](https://linuxserver.io) team brings you another container release featuring: 21 | 22 | * regular and timely application updates 23 | * easy user mappings (PGID, PUID) 24 | * custom base image with s6 overlay 25 | * weekly base OS updates with common layers across the entire LinuxServer.io ecosystem to minimise space usage, down time and bandwidth 26 | * regular security updates 27 | 28 | Find us at: 29 | * [Blog](https://blog.linuxserver.io) - all the things you can do with our containers including How-To guides, opinions and much more! 30 | * [Discord](https://discord.gg/YWrKVTn) - realtime support / chat with the community and the team. 31 | * [Discourse](https://discourse.linuxserver.io) - post on our community forum. 32 | * [Fleet](https://fleet.linuxserver.io) - an online web interface which displays all of our maintained images. 33 | * [GitHub](https://github.com/linuxserver) - view the source for all of our repositories. 34 | * [Open Collective](https://opencollective.com/linuxserver) - please consider helping us by either donating or contributing to our budget 35 | 36 | # [linuxserver/swag](https://github.com/linuxserver/docker-letsencrypt) 37 | 38 | [![GitHub Stars](https://img.shields.io/github/stars/linuxserver/docker-letsencrypt.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&logo=github)](https://github.com/linuxserver/docker-letsencrypt) 39 | [![GitHub Release](https://img.shields.io/github/release/linuxserver/docker-letsencrypt.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&logo=github)](https://github.com/linuxserver/docker-letsencrypt/releases) 40 | [![GitHub Package Repository](https://img.shields.io/static/v1.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=linuxserver.io&message=GitHub%20Package&logo=github)](https://github.com/linuxserver/docker-letsencrypt/packages) 41 | [![GitLab Container Registry](https://img.shields.io/static/v1.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=linuxserver.io&message=GitLab%20Registry&logo=gitlab)](https://gitlab.com/Linuxserver.io/docker-letsencrypt/container_registry) 42 | [![MicroBadger Layers](https://img.shields.io/microbadger/layers/linuxserver/letsencrypt.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge)](https://microbadger.com/images/linuxserver/letsencrypt "Get your own version badge on microbadger.com") 43 | [![Docker Pulls](https://img.shields.io/docker/pulls/linuxserver/letsencrypt.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=pulls&logo=docker)](https://hub.docker.com/r/linuxserver/letsencrypt) 44 | [![Docker Stars](https://img.shields.io/docker/stars/linuxserver/letsencrypt.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=stars&logo=docker)](https://hub.docker.com/r/linuxserver/letsencrypt) 45 | [![Jenkins Build](https://img.shields.io/jenkins/build?labelColor=555555&logoColor=ffffff&style=for-the-badge&jobUrl=https%3A%2F%2Fci.linuxserver.io%2Fjob%2FDocker-Pipeline-Builders%2Fjob%2Fdocker-letsencrypt%2Fjob%2Fmaster%2F&logo=jenkins)](https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-letsencrypt/job/master/) 46 | [![LSIO CI](https://img.shields.io/badge/dynamic/yaml?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=CI&query=CI&url=https%3A%2F%2Flsio-ci.ams3.digitaloceanspaces.com%2Flinuxserver%2Fletsencrypt%2Flatest%2Fci-status.yml)](https://lsio-ci.ams3.digitaloceanspaces.com/linuxserver/letsencrypt/latest/index.html) 47 | 48 | **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. 49 | 50 | [![letsencrypt](https://raw.githubusercontent.com/aptalca/testing/testing/swag.gif)](https://linuxserver.io) 51 | 52 | ## Supported Architectures 53 | 54 | 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](https://github.com/docker/distribution/blob/master/docs/spec/manifest-v2-2.md#manifest-list) and our announcement [here](https://blog.linuxserver.io/2019/02/21/the-lsio-pipeline-project/). 55 | 56 | Simply pulling `linuxserver/letsencrypt` should retrieve the correct image for your arch, but you can also pull specific arch images via tags. 57 | 58 | The architectures supported by this image are: 59 | 60 | | Architecture | Tag | 61 | | :----: | --- | 62 | | x86-64 | amd64-latest | 63 | | arm64 | arm64v8-latest | 64 | | armhf | arm32v7-latest | 65 | 66 | 67 | ## Usage 68 | 69 | Here are some example snippets to help you get started creating a container. 70 | 71 | ### docker 72 | 73 | ``` 74 | docker create \ 75 | --name=swag \ 76 | --cap-add=NET_ADMIN \ 77 | -e PUID=1000 \ 78 | -e PGID=1000 \ 79 | -e TZ=Europe/London \ 80 | -e URL=yourdomain.url \ 81 | -e SUBDOMAINS=www, \ 82 | -e VALIDATION=http \ 83 | -e DNSPLUGIN=cloudflare `#optional` \ 84 | -e PROPAGATION= `#optional` \ 85 | -e DUCKDNSTOKEN= `#optional` \ 86 | -e EMAIL= `#optional` \ 87 | -e ONLY_SUBDOMAINS=false `#optional` \ 88 | -e EXTRA_DOMAINS= `#optional` \ 89 | -e STAGING=false `#optional` \ 90 | -p 443:443 \ 91 | -p 80:80 `#optional` \ 92 | -v /path/to/appdata/config:/config \ 93 | --restart unless-stopped \ 94 | linuxserver/letsencrypt 95 | ``` 96 | 97 | 98 | ### docker-compose 99 | 100 | Compatible with docker-compose v2 schemas. 101 | 102 | ``` 103 | --- 104 | version: "2.1" 105 | services: 106 | swag: 107 | image: linuxserver/letsencrypt 108 | container_name: swag 109 | cap_add: 110 | - NET_ADMIN 111 | environment: 112 | - PUID=1000 113 | - PGID=1000 114 | - TZ=Europe/London 115 | - URL=yourdomain.url 116 | - SUBDOMAINS=www, 117 | - VALIDATION=http 118 | - DNSPLUGIN=cloudflare #optional 119 | - PROPAGATION= #optional 120 | - DUCKDNSTOKEN= #optional 121 | - EMAIL= #optional 122 | - ONLY_SUBDOMAINS=false #optional 123 | - EXTRA_DOMAINS= #optional 124 | - STAGING=false #optional 125 | volumes: 126 | - /path/to/appdata/config:/config 127 | ports: 128 | - 443:443 129 | - 80:80 #optional 130 | restart: unless-stopped 131 | ``` 132 | 133 | ## Parameters 134 | 135 | Container images are configured using parameters passed at runtime (such as those above). These parameters are separated by a colon and indicate `:` 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. 136 | 137 | | Parameter | Function | 138 | | :----: | --- | 139 | | `-p 443` | Https port | 140 | | `-p 80` | Http port (required for http validation and http -> https redirect) | 141 | | `-e PUID=1000` | for UserID - see below for explanation | 142 | | `-e PGID=1000` | for GroupID - see below for explanation | 143 | | `-e TZ=Europe/London` | Specify a timezone to use EG Europe/London. | 144 | | `-e URL=yourdomain.url` | Top url you have control over (`customdomain.com` if you own it, or `customsubdomain.ddnsprovider.com` if dynamic dns). | 145 | | `-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) | 146 | | `-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`). | 147 | | `-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`. | 148 | | `-e PROPAGATION=` | Optionally override (in seconds) the default propagation time for the dns plugins. | 149 | | `-e DUCKDNSTOKEN=` | Required if `VALIDATION` is set to `duckdns`. Retrieve your token from https://www.duckdns.org | 150 | | `-e EMAIL=` | Optional e-mail address used for cert expiration notifications. | 151 | | `-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` | 152 | | `-e EXTRA_DOMAINS=` | Additional fully qualified domain names (comma separated, no spaces) ie. `extradomain.com,subdomain.anotherdomain.org,*.anotherdomain.org` | 153 | | `-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. | 154 | | `-v /config` | All the config files including the webroot reside here. | 155 | 156 | ## Environment variables from files (Docker secrets) 157 | 158 | You can set any environment variable from a file by using a special prepend `FILE__`. 159 | 160 | As an example: 161 | 162 | ``` 163 | -e FILE__PASSWORD=/run/secrets/mysecretpassword 164 | ``` 165 | 166 | Will set the environment variable `PASSWORD` based on the contents of the `/run/secrets/mysecretpassword` file. 167 | 168 | ## Umask for running applications 169 | 170 | 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. 171 | Keep in mind umask is not chmod it subtracts from permissions based on it's value it does not add. Please read up [here](https://en.wikipedia.org/wiki/Umask) before asking for support. 172 | 173 | ## User / Group Identifiers 174 | 175 | 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`. 176 | 177 | Ensure any volume directories on the host are owned by the same user you specify and any permissions issues will vanish like magic. 178 | 179 | In this instance `PUID=1000` and `PGID=1000`, to find yours use `id user` as below: 180 | 181 | ``` 182 | $ id username 183 | uid=1000(dockeruser) gid=1000(dockergroup) groups=1000(dockergroup) 184 | ``` 185 | 186 | 187 |   188 | ## Application Setup 189 | 190 | ### Validation and initial setup 191 | * 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.). 192 | * For `http` validation, port 80 on the internet side of the router should be forwarded to this container's port 80 193 | * For `dns` validation, make sure to enter your credentials into the corresponding ini (or json for some plugins) file under `/config/dns-conf` 194 | * 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" 195 | * Google dns plugin is meant to be used with "Google Cloud DNS", a paid enterprise product, and not for "Google Domains DNS" 196 | * 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](https://hub.docker.com/r/linuxserver/duckdns/) to update your IP on duckdns.org. 197 | * `--cap-add=NET_ADMIN` is required for fail2ban to modify iptables 198 | * 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. 199 | * 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`). 200 | * 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. 201 | ### Security and password protection 202 | * The container detects changes to url and subdomains, revokes existing certs and generates new ones during start. 203 | * The container provides a pre-generated 4096-bit dhparams.pem (rotated weekly via [Jenkins job](https://ci.linuxserver.io/blue/organizations/jenkins/Xtras-Builders-Etc%2Fdhparams-uploader/activity)) 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 204 | * 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 ` 205 | * 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 206 | * 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](https://hub.docker.com/r/linuxserver/ldap-auth/) to communicate with an ldap server. 207 | ### Site config and reverse proxy 208 | * 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. 209 | * 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](https://github.com/linuxserver/reverse-proxy-confs). 210 | * 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 211 | `add_header X-Robots-Tag "noindex, nofollow, nosnippet, noarchive";` 212 | 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 213 | * If you wish to redirect http to https, you must expose port 80 214 | ### Using certs in other containers 215 | * This container includes auto-generated pfx and private-fullchain-bundle pem certs that are needed by other apps like Emby and Znc. 216 | * To use these certs in other containers, do either of the following: 217 | 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/` 218 | 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//` (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) 219 | * These certs include: 220 | 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 221 | 2. `privkey.pfx`, a format supported by Microsoft and commonly used by dotnet apps such as Emby Server (no password) 222 | 3. `priv-fullchain-bundle.pem`, a pem cert that bundles the private key and the fullchain, used by apps like ZNC 223 | ### Using fail2ban 224 | * This container includes fail2ban set up with 3 jails by default: 225 | 1. nginx-http-auth 226 | 2. nginx-badbots 227 | 3. nginx-botsearch 228 | * To enable or disable other jails, modify the file `/config/fail2ban/jail.local` 229 | * 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`) 230 | * You can check which jails are active via `docker exec -it swag fail2ban-client status` 231 | * You can check the status of a specific jail via `docker exec -it swag fail2ban-client status ` 232 | * You can unban an IP via `docker exec -it swag fail2ban-client set unbanip ` 233 | * A list of commands can be found here: https://www.fail2ban.org/wiki/index.php/Commands 234 | 235 | 236 | ## Docker Mods 237 | [![Docker Mods](https://img.shields.io/badge/dynamic/yaml?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=mods&query=%24.mods%5B%27letsencrypt%27%5D.mod_count&url=https%3A%2F%2Fraw.githubusercontent.com%2Flinuxserver%2Fdocker-mods%2Fmaster%2Fmod-list.yml)](https://mods.linuxserver.io/?mod=letsencrypt "view available mods for this container.") 238 | 239 | We publish various [Docker Mods](https://github.com/linuxserver/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. 240 | 241 | 242 | ## Support Info 243 | 244 | * Shell access whilst the container is running: `docker exec -it swag /bin/bash` 245 | * To monitor the logs of the container in realtime: `docker logs -f swag` 246 | * container version number 247 | * `docker inspect -f '{{ index .Config.Labels "build_version" }}' swag` 248 | * image version number 249 | * `docker inspect -f '{{ index .Config.Labels "build_version" }}' linuxserver/letsencrypt` 250 | 251 | ## Updating Info 252 | 253 | 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](#application-setup) section above to see if it is recommended for the image. 254 | 255 | Below are the instructions for updating containers: 256 | 257 | ### Via Docker Run/Create 258 | * Update the image: `docker pull linuxserver/letsencrypt` 259 | * Stop the running container: `docker stop swag` 260 | * Delete the container: `docker rm swag` 261 | * 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) 262 | * Start the new container: `docker start swag` 263 | * You can also remove the old dangling images: `docker image prune` 264 | 265 | ### Via Docker Compose 266 | * Update all images: `docker-compose pull` 267 | * or update a single image: `docker-compose pull swag` 268 | * Let compose update all containers as necessary: `docker-compose up -d` 269 | * or update a single container: `docker-compose up -d swag` 270 | * You can also remove the old dangling images: `docker image prune` 271 | 272 | ### Via Watchtower auto-updater (especially useful if you don't remember the original parameters) 273 | * Pull the latest image at its tag and replace it with the same env variables in one run: 274 | ``` 275 | docker run --rm \ 276 | -v /var/run/docker.sock:/var/run/docker.sock \ 277 | containrrr/watchtower \ 278 | --run-once swag 279 | ``` 280 | 281 | **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. 282 | 283 | * You can also remove the old dangling images: `docker image prune` 284 | 285 | ## Building locally 286 | 287 | If you want to make local modifications to these images for development purposes or just to customize the logic: 288 | ``` 289 | git clone https://github.com/linuxserver/docker-letsencrypt.git 290 | cd docker-letsencrypt 291 | docker build \ 292 | --no-cache \ 293 | --pull \ 294 | -t linuxserver/letsencrypt:latest . 295 | ``` 296 | 297 | The ARM variants can be built on x86_64 hardware using `multiarch/qemu-user-static` 298 | ``` 299 | docker run --rm --privileged multiarch/qemu-user-static:register --reset 300 | ``` 301 | 302 | Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64`. 303 | 304 | ## Versions 305 | 306 | * **28.07.20:** - Start transition to new name, SWAG. 307 | * **17.06.20:** - Reformat ssl.conf. Pull in pre-generated dhparams.pem from DO Spaces. Deprecate `DHLEVEL` param. 308 | * **01.06.20:** - Rebasing to alpine 3.12, change ldap login address to `/ldaplogin` to avoid clashes (existing users need to manually update). 309 | * **31.05.20:** - Tweak Authelia confs (existing users can delete `authelia-server.conf` and `authelia-location.conf`, and restart to update). 310 | * **23.05.20:** - Add support for Authelia. 311 | * **15.05.20:** - Remove `php7-pecl-imagick` due to upstream issues. Add support for `Geoip2` auto db retrieval. 312 | * **10.05.20:** - Added support for fail2ban deny statements. 313 | * **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`. 314 | * **13.04.20:** - Update cloudflare.ini with token info. 315 | * **11.03.20:** - Add php7-sodium. 316 | * **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). 317 | * **05.03.20:** - Use port and proto upstream variables for ldap and default sample confs. 318 | * **24.02.20:** - Remove world/group read permissions in dns-conf. 319 | * **23.02.20:** - Add aliyun dns validation plugin. 320 | * **28.01.20:** - Deprecate tls-sni validation method, remove from docs. 321 | * **27.01.20:** - Add support for cpanel dns validation. 322 | * **10.01.20:** - Add support for domeneshop dns validation. 323 | * **07.01.20:** - Update ciphers from Mozilla ssl-config recommendations. 324 | * **01.01.20:** - Add support for gandi dns validation. 325 | * **31.12.19:** - GeoIP2 databases now require personal license keys to download. Auto download is disabled and log message is added. 326 | * **19.12.19:** - Rebasing to alpine 3.11. 327 | * **19.12.19:** - Increase large_client_header_buffers in nginx.conf to prevent 414 errors. 328 | * **18.12.19:** - Add php7-imap and php7-pecl-apcu. 329 | * **11.12.19:** - Fix Google Cloud DNS to use .json file for authentication. 330 | * **20.11.19:** - Fix cryptography version mismatch due to pip issue. 331 | * **17.11.19:** - Add php7-pdo_odbc. 332 | * **17.11.19:** - Add transip dns validation plugin. 333 | * **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). 334 | * **26.10.19:** - Add new package for stream-geoip2, remove geoip2 module patch. 335 | * **24.10.19:** - Add php7-pecl-imagick. 336 | * **23.10.19:** - Update Host header in `proxy.conf` to fix CSRF issues. 337 | * **12.10.19:** - Add linode dns validation plugin. 338 | * **23.09.19:** - Move GeoIP2 db to /config to make it persistent. 339 | * **14.08.19:** - Add inwx dns validation plugin. 340 | * **06.08.19:** - Add php7-ftp. 341 | * **04.08.19:** - Add php7-bcmath, php7-pear, php7-xmlrpc. 342 | * **02.08.19:** - Add php7-ldap, remove geoip v1(deprecated). 343 | * **01.08.19:** - Mark https redirect block as default_server (effective only for new installs). 344 | * **31.07.19:** - Create GeoIP2 databse (libmaxminddb) during container start if it doesn't exist. 345 | * **30.07.19:** - Support main domain via duckdns validation. 346 | * **29.07.19:** - Enable http to https redirect by default (effective only for new installs). 347 | * **01.07.19:** - Patch geoip2 module until upstream is fixed. 348 | * **30.06.19:** - Add geoip2 module. 349 | * **28.06.19:** - Rebasing to alpine 3.10. 350 | * **19.06.19:** - Set resolver to docker dns in ssl.conf. 351 | * **29.05.19:** - Compensate for changes to the reverse-proxy-confs repo. 352 | * **26.05.19:** - Remove botocore/urllib patch. 353 | * **08.05.19:** - Remove default.conf when nginx is upgraded in downstream image. 354 | * **30.04.19:** - Add php-redis. 355 | * **12.04.19:** - Rebase aarch64 image to 3.9. 356 | * **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. 357 | * **23.03.19:** - Switching to new Base images, shift to arm32v7 tag. 358 | * **10.03.19:** - Add TLSv1.3 to ssl.conf. 359 | * **02.03.19:** - Add php intl and posix modules. 360 | * **27.02.19:** - Add gnupg package. 361 | * **22.02.19:** - Rebase to alpine 3.9. 362 | * **03.02.19:** - Removed memcached due to seccomp errors. Let us know if you need to re-enable memcached. 363 | * **28.01.19:** - Add pipeline logic and multi arch. 364 | * **21.01.19:** - Remove client_body_max from proxy.conf (existing users need to manually update). 365 | * **09.01.19:** - Remove tls v1 and v1.1 from default ssl.conf, update ciphers (existing users need to manually update). 366 | * **30.12.18:** - Fix bundle key generation. 367 | * **19.12.18:** - Add ipv6 and http/2 support to default site config. 368 | * **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. 369 | * **03.12.18:** - Fix silly bug resetting the duckdns token. 370 | * **02.12.18:** - Add dns validation support for ovh. 371 | * **20.11.18:** - Externalize reverse proxy confs to separate github repo `linuxserver/reverse-proxy-confs`, update baseimage packages during build 372 | * **19.11.18:** - Add php opcache package. 373 | * **12.11.18:** - Add support for duckdns wildcard certs via dns validation 374 | * **31.10.18:** - Add various preset proxy confs and fix others (thanks @nemchik and @hijxf) 375 | * **02.10.18:** - Fix fail2ban instructions and logrotate conf 376 | * **11.09.18:** - Add various preset proxy confs and fix others (thanks @nemchik and @LeoVerto) 377 | * **04.09.18:** - Linting fixes. 378 | * **30.08.18:** - Add support for ldap auth, add proxy confs for bazarr, couchpotato, headphones, lidarr and plex subfolder (thanks @nemchik and @jedahan) 379 | * **21.08.18:** - Rebase to alpine 3.8, add info on search engine de-listing 380 | * **08.08.18:** - Add subdomain proxy conf for plex, update emby proxy confs 381 | * **25.07.18:** - Add subdomain proxy conf for syncthing 382 | * **23.07.18:** - Remove backwards compatibility and set default validation method to http. Update portainer proxy config to fix websockets. Add unifi proxy conf. 383 | * **31.05.18:** - Update ssl.conf and proxy.conf for tighter security (thanks @nemchik) 384 | * **30.05.18:** - Add reverse proxy configs for jackett, monitorr, nzbget, nzbhydra, organizr, portainer and transmission (thanks @nemchik) 385 | * **18.05.18:** - Add more info on certs and unraid reverse proxy config 386 | * **11.05.18:** - Add php pgsql support 387 | * **24.04.18:** - Auto generate a private key + fullchain bundle pem that is needed by certain apps 388 | * **20.04.18:** - Add standardized optional reverse proxy conf files 389 | * **19.04.18:** - Bind memcached to localhost only, add php7-sqlite3 390 | * **08.04.18:** - Fix renewal hooks 391 | * **29.03.18:** - Create pfx cert after renewal for dns validation (previous version only created it for http and tls, an oversight) 392 | * **29.03.18:** - Fix staging for v2 api 393 | * **13.03.18:** - Support for wildcard cert with dns validation added. Switched to v2 api for ACME. 394 | * **21.02.18:** - Reduce shellcheck directives by renaming secondary variables 395 | * **20.02.18:** - Sanitize variables, increase log verbosity 396 | * **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 397 | * **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 398 | * **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) 399 | * **10.01.18:** - Add option for http validation on port 80 400 | * **05.01.18:** - Rebase to alpine 3.7 401 | * **04.11.17:** - Add php7 soap module 402 | * **31.10.17:** - Add php7 exif and xmlreader modules 403 | * **25.09.17:** - Manage fail2ban via s6 404 | * **24.09.17:** - Add memcached service 405 | * **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 406 | * **31.08.17:** - Add php7-phar 407 | * **14.07.17:** - Enable modules dynamically in nginx.conf 408 | * **06.07.17:** - Add support for multiple domains (thanks @oznu) 409 | * **22.06.17:** - Add various nginx modules and enable all modules in the default nginx.conf 410 | * **16.06.17:** - Update deprecated certbot option for https validation, make e-mail entry optional, update readme 411 | * **05.06.17:** - Add php7-bz2 412 | * **27.05.17:** - Rebase to alpine 3.6. 413 | * **03.05.17:** - Fix log permissions. 414 | * **18.04.17:** - Add php7-sockets, update fail2ban filter and action defaults 415 | * **27.02.17:** - Add php7-dom, php7-iconv and php7-pdo_sqlite 416 | * **21.02.17:** - Add php7-xml 417 | * **10.02.17:** - Switch to alpine 3.5 base and php7, add php zlib module and all nginx modules 418 | * **13.01.17:** - Add php5-ctype and php5-openssl 419 | * **04.01.17:** - Add php5-mysqli and php5-pdo_mysql 420 | * **22.11.16:** - Add gd and mcrypt packages 421 | * **21.11.16:** - Add curl package 422 | * **07.11.16:** - Initial Release 423 | -------------------------------------------------------------------------------- /jenkins-vars.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | # jenkins variables 4 | project_name: docker-letsencrypt 5 | external_type: pip_version 6 | release_type: stable 7 | release_tag: latest 8 | ls_branch: master 9 | repo_vars: 10 | - EXT_PIP = 'certbot' 11 | - BUILD_VERSION_ARG = 'CERTBOT_VERSION' 12 | - LS_USER = 'linuxserver' 13 | - LS_REPO = 'docker-letsencrypt' 14 | - CONTAINER_NAME = 'letsencrypt' 15 | - DOCKERHUB_IMAGE = 'linuxserver/letsencrypt' 16 | - DEV_DOCKERHUB_IMAGE = 'lsiodev/letsencrypt' 17 | - PR_DOCKERHUB_IMAGE = 'lspipepr/letsencrypt' 18 | - DIST_IMAGE = 'alpine' 19 | - MULTIARCH='true' 20 | - CI='true' 21 | - CI_WEB='false' 22 | - CI_PORT='80' 23 | - CI_SSL='false' 24 | - CI_DELAY='30' 25 | - CI_DOCKERENV='TEST_RUN=1' 26 | - CI_AUTH='' 27 | - CI_WEBPATH='' 28 | sponsor_links: 29 | - { name: "Certbot", url: "https://supporters.eff.org/donate/support-work-on-certbot" } 30 | -------------------------------------------------------------------------------- /package_versions.txt: -------------------------------------------------------------------------------- 1 | alpine-baselayout-3.2.0-r7 2 | alpine-keys-2.2-r0 3 | apache2-utils-2.4.46-r1 4 | apk-tools-2.10.5-r1 5 | apr-1.7.0-r0 6 | apr-util-1.6.1-r6 7 | argon2-libs-20190702-r1 8 | bash-5.0.17-r0 9 | brotli-libs-1.0.9-r1 10 | busybox-1.31.1-r19 11 | c-client-2007f-r11 12 | ca-certificates-20191127-r4 13 | ca-certificates-bundle-20191127-r4 14 | coreutils-8.32-r0 15 | curl-7.69.1-r3 16 | db-5.3.28-r1 17 | expat-2.2.9-r1 18 | fail2ban-0.11.1-r3 19 | freetype-2.10.4-r0 20 | gdbm-1.13-r1 21 | git-2.26.2-r0 22 | git-perl-2.26.2-r0 23 | glib-2.64.6-r0 24 | gmp-6.2.0-r0 25 | gnupg-2.2.23-r0 26 | gnutls-3.6.15-r0 27 | icu-libs-67.1-r0 28 | ip6tables-1.8.4-r2 29 | iptables-1.8.4-r2 30 | libacl-2.2.53-r0 31 | libassuan-2.5.3-r0 32 | libattr-2.4.48-r0 33 | libblkid-2.35.2-r0 34 | libbsd-0.10.0-r0 35 | libbz2-1.0.8-r1 36 | libc-utils-0.7.2-r3 37 | libcap-2.27-r0 38 | libcrypto1.1-1.1.1i-r0 39 | libcurl-7.69.1-r3 40 | libedit-20191231.3.1-r0 41 | libevent-2.1.11-r1 42 | libffi-3.3-r2 43 | libgcc-9.3.0-r2 44 | libgcrypt-1.8.5-r0 45 | libgd-2.3.0-r1 46 | libgpg-error-1.37-r0 47 | libice-1.0.10-r0 48 | libidn-1.35-r0 49 | libintl-0.20.2-r0 50 | libjpeg-turbo-2.0.5-r0 51 | libksba-1.4.0-r0 52 | libldap-2.4.50-r1 53 | libmagic-5.38-r0 54 | libmaxminddb-1.4.3-r0 55 | libmcrypt-2.5.8-r8 56 | libmemcached-libs-1.0.18-r4 57 | libmnl-1.0.4-r0 58 | libmount-2.35.2-r0 59 | libnftnl-libs-1.1.6-r0 60 | libpng-1.6.37-r1 61 | libpq-12.5-r0 62 | libproc-3.3.16-r0 63 | libressl3.1-libcrypto-3.1.2-r0 64 | libressl3.1-libssl-3.1.2-r0 65 | libsasl-2.1.27-r6 66 | libseccomp-2.4.3-r0 67 | libsecret-0.20.3-r0 68 | libsm-1.2.3-r0 69 | libsodium-1.0.18-r0 70 | libssl1.1-1.1.1i-r0 71 | libstdc++-9.3.0-r2 72 | libtasn1-4.16.0-r1 73 | libtls-standalone-2.9.1-r1 74 | libunistring-0.9.10-r0 75 | libuuid-2.35.2-r0 76 | libwebp-1.1.0-r0 77 | libx11-1.6.12-r0 78 | libxau-1.0.9-r0 79 | libxcb-1.14-r1 80 | libxdmcp-1.1.3-r0 81 | libxext-1.3.4-r0 82 | libxml2-2.9.10-r5 83 | libxpm-3.5.13-r0 84 | libxslt-1.1.34-r0 85 | libxt-1.2.0-r0 86 | libzip-1.6.1-r1 87 | linux-pam-1.3.1-r4 88 | logrotate-3.16.0-r0 89 | luajit-5.1.20190925-r0 90 | memcached-1.6.6-r0 91 | musl-1.1.24-r10 92 | musl-utils-1.1.24-r10 93 | nano-4.9.3-r0 94 | ncurses-libs-6.2_p20200523-r0 95 | ncurses-terminfo-base-6.2_p20200523-r0 96 | nettle-3.5.1-r1 97 | nghttp2-libs-1.41.0-r0 98 | nginx-1.18.0-r1 99 | nginx-mod-devel-kit-1.18.0-r1 100 | nginx-mod-http-echo-1.18.0-r1 101 | nginx-mod-http-fancyindex-1.18.0-r1 102 | nginx-mod-http-geoip2-1.18.0-r1 103 | nginx-mod-http-headers-more-1.18.0-r1 104 | nginx-mod-http-image-filter-1.18.0-r1 105 | nginx-mod-http-lua-1.18.0-r1 106 | nginx-mod-http-lua-upstream-1.18.0-r1 107 | nginx-mod-http-nchan-1.18.0-r1 108 | nginx-mod-http-perl-1.18.0-r1 109 | nginx-mod-http-redis2-1.18.0-r1 110 | nginx-mod-http-set-misc-1.18.0-r1 111 | nginx-mod-http-upload-progress-1.18.0-r1 112 | nginx-mod-http-xslt-filter-1.18.0-r1 113 | nginx-mod-mail-1.18.0-r1 114 | nginx-mod-rtmp-1.18.0-r1 115 | nginx-mod-stream-1.18.0-r1 116 | nginx-mod-stream-geoip2-1.18.0-r1 117 | nginx-vim-1.18.0-r1 118 | npth-1.6-r0 119 | openssl-1.1.1i-r0 120 | p11-kit-0.23.22-r0 121 | pcre-8.44-r0 122 | pcre2-10.35-r0 123 | perl-5.30.3-r0 124 | perl-error-0.17029-r0 125 | perl-git-2.26.2-r0 126 | php7-7.3.25-r0 127 | php7-bcmath-7.3.25-r0 128 | php7-bz2-7.3.25-r0 129 | php7-common-7.3.25-r0 130 | php7-ctype-7.3.25-r0 131 | php7-curl-7.3.25-r0 132 | php7-dom-7.3.25-r0 133 | php7-exif-7.3.25-r0 134 | php7-fileinfo-7.3.25-r0 135 | php7-fpm-7.3.25-r0 136 | php7-ftp-7.3.25-r0 137 | php7-gd-7.3.25-r0 138 | php7-iconv-7.3.25-r0 139 | php7-imap-7.3.25-r0 140 | php7-intl-7.3.25-r0 141 | php7-json-7.3.25-r0 142 | php7-ldap-7.3.25-r0 143 | php7-mbstring-7.3.25-r0 144 | php7-mysqli-7.3.25-r0 145 | php7-mysqlnd-7.3.25-r0 146 | php7-opcache-7.3.25-r0 147 | php7-openssl-7.3.25-r0 148 | php7-pdo-7.3.25-r0 149 | php7-pdo_mysql-7.3.25-r0 150 | php7-pdo_odbc-7.3.25-r0 151 | php7-pdo_pgsql-7.3.25-r0 152 | php7-pdo_sqlite-7.3.25-r0 153 | php7-pear-7.3.25-r0 154 | php7-pecl-apcu-5.1.19-r0 155 | php7-pecl-igbinary-3.1.6-r0 156 | php7-pecl-mcrypt-1.0.3-r0 157 | php7-pecl-memcached-3.1.5-r0 158 | php7-pecl-redis-5.2.2-r1 159 | php7-pgsql-7.3.25-r0 160 | php7-phar-7.3.25-r0 161 | php7-posix-7.3.25-r0 162 | php7-session-7.3.25-r0 163 | php7-simplexml-7.3.25-r0 164 | php7-soap-7.3.25-r0 165 | php7-sockets-7.3.25-r0 166 | php7-sodium-7.3.25-r0 167 | php7-sqlite3-7.3.25-r0 168 | php7-tokenizer-7.3.25-r0 169 | php7-xml-7.3.25-r0 170 | php7-xmlreader-7.3.25-r0 171 | php7-xmlrpc-7.3.25-r0 172 | php7-xmlwriter-7.3.25-r0 173 | php7-zip-7.3.25-r0 174 | pinentry-1.1.0-r2 175 | popt-1.16-r7 176 | procps-3.3.16-r0 177 | py3-appdirs-1.4.4-r1 178 | py3-asn1crypto-1.3.0-r0 179 | py3-cachecontrol-0.12.6-r0 180 | py3-certifi-2020.4.5.1-r0 181 | py3-cffi-1.14.0-r2 182 | py3-chardet-3.0.4-r4 183 | py3-colorama-0.4.3-r0 184 | py3-contextlib2-0.6.0-r0 185 | py3-cparser-2.20-r0 186 | py3-cryptography-2.9.2-r0 187 | py3-distlib-0.3.0-r0 188 | py3-distro-1.5.0-r1 189 | py3-future-0.18.2-r1 190 | py3-html5lib-1.0.1-r4 191 | py3-idna-2.9-r0 192 | py3-lockfile-0.12.2-r3 193 | py3-msgpack-1.0.0-r0 194 | py3-ordered-set-4.0.1-r0 195 | py3-packaging-20.4-r0 196 | py3-parsing-2.4.7-r0 197 | py3-pep517-0.8.2-r0 198 | py3-pip-20.1.1-r0 199 | py3-progress-1.5-r0 200 | py3-pytoml-0.1.21-r0 201 | py3-requests-2.23.0-r0 202 | py3-retrying-1.3.3-r0 203 | py3-setuptools-47.0.0-r0 204 | py3-six-1.15.0-r0 205 | py3-toml-0.10.1-r0 206 | py3-urllib3-1.25.9-r0 207 | py3-webencodings-0.5.1-r3 208 | python3-3.8.5-r0 209 | readline-8.0.4-r0 210 | scanelf-1.2.6-r0 211 | shadow-4.8.1-r0 212 | sqlite-libs-3.32.1-r0 213 | ssl_client-1.31.1-r19 214 | tzdata-2020c-r1 215 | unixodbc-2.3.7-r2 216 | whois-5.5.6-r0 217 | xz-5.2.5-r0 218 | xz-libs-5.2.5-r0 219 | zlib-1.2.11-r3 220 | -------------------------------------------------------------------------------- /readme-vars.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | # project information 4 | project_name: letsencrypt 5 | full_custom_readme: | 6 | {% raw -%} 7 | # IMPORTANT NOTICE: THIS IMAGE HAS BEEN DEPRECATED AND THE PROJECT IS MOVED TO A NEW REPO 8 | Due to a trademark related request, this image is moved to a new repo on [Docker Hub](https://hub.docker.com/r/linuxserver/swag) and [GitHub](https://github.com/linuxserver/docker-swag). This is a breaking change and you need to manually update. Apologies for the the disruption. 9 | 10 | 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 11 | 12 | ## This repository will be archived and builds for the image will no longer be created at the end of 2020 13 | 14 | [![linuxserver.io](https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/linuxserver_medium.png)](https://linuxserver.io) 15 | 16 | [![Blog](https://img.shields.io/static/v1.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=linuxserver.io&message=Blog)](https://blog.linuxserver.io "all the things you can do with our containers including How-To guides, opinions and much more!") 17 | [![Discord](https://img.shields.io/discord/354974912613449730.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=Discord&logo=discord)](https://discord.gg/YWrKVTn "realtime support / chat with the community and the team.") 18 | [![Discourse](https://img.shields.io/discourse/https/discourse.linuxserver.io/topics.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&logo=discourse)](https://discourse.linuxserver.io "post on our community forum.") 19 | [![Fleet](https://img.shields.io/static/v1.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=linuxserver.io&message=Fleet)](https://fleet.linuxserver.io "an online web interface which displays all of our maintained images.") 20 | [![GitHub](https://img.shields.io/static/v1.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=linuxserver.io&message=GitHub&logo=github)](https://github.com/linuxserver "view the source for all of our repositories.") 21 | [![Open Collective](https://img.shields.io/opencollective/all/linuxserver.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=Supporters&logo=open%20collective)](https://opencollective.com/linuxserver "please consider helping us by either donating or contributing to our budget") 22 | 23 | The [LinuxServer.io](https://linuxserver.io) team brings you another container release featuring: 24 | 25 | * regular and timely application updates 26 | * easy user mappings (PGID, PUID) 27 | * custom base image with s6 overlay 28 | * weekly base OS updates with common layers across the entire LinuxServer.io ecosystem to minimise space usage, down time and bandwidth 29 | * regular security updates 30 | 31 | Find us at: 32 | * [Blog](https://blog.linuxserver.io) - all the things you can do with our containers including How-To guides, opinions and much more! 33 | * [Discord](https://discord.gg/YWrKVTn) - realtime support / chat with the community and the team. 34 | * [Discourse](https://discourse.linuxserver.io) - post on our community forum. 35 | * [Fleet](https://fleet.linuxserver.io) - an online web interface which displays all of our maintained images. 36 | * [GitHub](https://github.com/linuxserver) - view the source for all of our repositories. 37 | * [Open Collective](https://opencollective.com/linuxserver) - please consider helping us by either donating or contributing to our budget 38 | 39 | # [linuxserver/swag](https://github.com/linuxserver/docker-letsencrypt) 40 | 41 | [![GitHub Stars](https://img.shields.io/github/stars/linuxserver/docker-letsencrypt.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&logo=github)](https://github.com/linuxserver/docker-letsencrypt) 42 | [![GitHub Release](https://img.shields.io/github/release/linuxserver/docker-letsencrypt.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&logo=github)](https://github.com/linuxserver/docker-letsencrypt/releases) 43 | [![GitHub Package Repository](https://img.shields.io/static/v1.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=linuxserver.io&message=GitHub%20Package&logo=github)](https://github.com/linuxserver/docker-letsencrypt/packages) 44 | [![GitLab Container Registry](https://img.shields.io/static/v1.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=linuxserver.io&message=GitLab%20Registry&logo=gitlab)](https://gitlab.com/Linuxserver.io/docker-letsencrypt/container_registry) 45 | [![MicroBadger Layers](https://img.shields.io/microbadger/layers/linuxserver/letsencrypt.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge)](https://microbadger.com/images/linuxserver/letsencrypt "Get your own version badge on microbadger.com") 46 | [![Docker Pulls](https://img.shields.io/docker/pulls/linuxserver/letsencrypt.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=pulls&logo=docker)](https://hub.docker.com/r/linuxserver/letsencrypt) 47 | [![Docker Stars](https://img.shields.io/docker/stars/linuxserver/letsencrypt.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=stars&logo=docker)](https://hub.docker.com/r/linuxserver/letsencrypt) 48 | [![Jenkins Build](https://img.shields.io/jenkins/build?labelColor=555555&logoColor=ffffff&style=for-the-badge&jobUrl=https%3A%2F%2Fci.linuxserver.io%2Fjob%2FDocker-Pipeline-Builders%2Fjob%2Fdocker-letsencrypt%2Fjob%2Fmaster%2F&logo=jenkins)](https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-letsencrypt/job/master/) 49 | [![LSIO CI](https://img.shields.io/badge/dynamic/yaml?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=CI&query=CI&url=https%3A%2F%2Flsio-ci.ams3.digitaloceanspaces.com%2Flinuxserver%2Fletsencrypt%2Flatest%2Fci-status.yml)](https://lsio-ci.ams3.digitaloceanspaces.com/linuxserver/letsencrypt/latest/index.html) 50 | 51 | **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. 52 | 53 | [![letsencrypt](https://raw.githubusercontent.com/aptalca/testing/testing/swag.gif)](https://linuxserver.io) 54 | 55 | ## Supported Architectures 56 | 57 | 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](https://github.com/docker/distribution/blob/master/docs/spec/manifest-v2-2.md#manifest-list) and our announcement [here](https://blog.linuxserver.io/2019/02/21/the-lsio-pipeline-project/). 58 | 59 | Simply pulling `linuxserver/letsencrypt` should retrieve the correct image for your arch, but you can also pull specific arch images via tags. 60 | 61 | The architectures supported by this image are: 62 | 63 | | Architecture | Tag | 64 | | :----: | --- | 65 | | x86-64 | amd64-latest | 66 | | arm64 | arm64v8-latest | 67 | | armhf | arm32v7-latest | 68 | 69 | 70 | ## Usage 71 | 72 | Here are some example snippets to help you get started creating a container. 73 | 74 | ### docker 75 | 76 | ``` 77 | docker create \ 78 | --name=swag \ 79 | --cap-add=NET_ADMIN \ 80 | -e PUID=1000 \ 81 | -e PGID=1000 \ 82 | -e TZ=Europe/London \ 83 | -e URL=yourdomain.url \ 84 | -e SUBDOMAINS=www, \ 85 | -e VALIDATION=http \ 86 | -e DNSPLUGIN=cloudflare `#optional` \ 87 | -e PROPAGATION= `#optional` \ 88 | -e DUCKDNSTOKEN= `#optional` \ 89 | -e EMAIL= `#optional` \ 90 | -e ONLY_SUBDOMAINS=false `#optional` \ 91 | -e EXTRA_DOMAINS= `#optional` \ 92 | -e STAGING=false `#optional` \ 93 | -p 443:443 \ 94 | -p 80:80 `#optional` \ 95 | -v /path/to/appdata/config:/config \ 96 | --restart unless-stopped \ 97 | linuxserver/letsencrypt 98 | ``` 99 | 100 | 101 | ### docker-compose 102 | 103 | Compatible with docker-compose v2 schemas. 104 | 105 | ``` 106 | --- 107 | version: "2.1" 108 | services: 109 | swag: 110 | image: linuxserver/letsencrypt 111 | container_name: swag 112 | cap_add: 113 | - NET_ADMIN 114 | environment: 115 | - PUID=1000 116 | - PGID=1000 117 | - TZ=Europe/London 118 | - URL=yourdomain.url 119 | - SUBDOMAINS=www, 120 | - VALIDATION=http 121 | - DNSPLUGIN=cloudflare #optional 122 | - PROPAGATION= #optional 123 | - DUCKDNSTOKEN= #optional 124 | - EMAIL= #optional 125 | - ONLY_SUBDOMAINS=false #optional 126 | - EXTRA_DOMAINS= #optional 127 | - STAGING=false #optional 128 | volumes: 129 | - /path/to/appdata/config:/config 130 | ports: 131 | - 443:443 132 | - 80:80 #optional 133 | restart: unless-stopped 134 | ``` 135 | 136 | ## Parameters 137 | 138 | Container images are configured using parameters passed at runtime (such as those above). These parameters are separated by a colon and indicate `:` 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. 139 | 140 | | Parameter | Function | 141 | | :----: | --- | 142 | | `-p 443` | Https port | 143 | | `-p 80` | Http port (required for http validation and http -> https redirect) | 144 | | `-e PUID=1000` | for UserID - see below for explanation | 145 | | `-e PGID=1000` | for GroupID - see below for explanation | 146 | | `-e TZ=Europe/London` | Specify a timezone to use EG Europe/London. | 147 | | `-e URL=yourdomain.url` | Top url you have control over (`customdomain.com` if you own it, or `customsubdomain.ddnsprovider.com` if dynamic dns). | 148 | | `-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) | 149 | | `-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`). | 150 | | `-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`. | 151 | | `-e PROPAGATION=` | Optionally override (in seconds) the default propagation time for the dns plugins. | 152 | | `-e DUCKDNSTOKEN=` | Required if `VALIDATION` is set to `duckdns`. Retrieve your token from https://www.duckdns.org | 153 | | `-e EMAIL=` | Optional e-mail address used for cert expiration notifications. | 154 | | `-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` | 155 | | `-e EXTRA_DOMAINS=` | Additional fully qualified domain names (comma separated, no spaces) ie. `extradomain.com,subdomain.anotherdomain.org,*.anotherdomain.org` | 156 | | `-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. | 157 | | `-v /config` | All the config files including the webroot reside here. | 158 | 159 | ## Environment variables from files (Docker secrets) 160 | 161 | You can set any environment variable from a file by using a special prepend `FILE__`. 162 | 163 | As an example: 164 | 165 | ``` 166 | -e FILE__PASSWORD=/run/secrets/mysecretpassword 167 | ``` 168 | 169 | Will set the environment variable `PASSWORD` based on the contents of the `/run/secrets/mysecretpassword` file. 170 | 171 | ## Umask for running applications 172 | 173 | 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. 174 | Keep in mind umask is not chmod it subtracts from permissions based on it's value it does not add. Please read up [here](https://en.wikipedia.org/wiki/Umask) before asking for support. 175 | 176 | ## User / Group Identifiers 177 | 178 | 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`. 179 | 180 | Ensure any volume directories on the host are owned by the same user you specify and any permissions issues will vanish like magic. 181 | 182 | In this instance `PUID=1000` and `PGID=1000`, to find yours use `id user` as below: 183 | 184 | ``` 185 | $ id username 186 | uid=1000(dockeruser) gid=1000(dockergroup) groups=1000(dockergroup) 187 | ``` 188 | 189 | 190 |   191 | ## Application Setup 192 | 193 | ### Validation and initial setup 194 | * 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.). 195 | * For `http` validation, port 80 on the internet side of the router should be forwarded to this container's port 80 196 | * For `dns` validation, make sure to enter your credentials into the corresponding ini (or json for some plugins) file under `/config/dns-conf` 197 | * 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" 198 | * Google dns plugin is meant to be used with "Google Cloud DNS", a paid enterprise product, and not for "Google Domains DNS" 199 | * 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](https://hub.docker.com/r/linuxserver/duckdns/) to update your IP on duckdns.org. 200 | * `--cap-add=NET_ADMIN` is required for fail2ban to modify iptables 201 | * 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. 202 | * 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`). 203 | * 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. 204 | ### Security and password protection 205 | * The container detects changes to url and subdomains, revokes existing certs and generates new ones during start. 206 | * The container provides a pre-generated 4096-bit dhparams.pem (rotated weekly via [Jenkins job](https://ci.linuxserver.io/blue/organizations/jenkins/Xtras-Builders-Etc%2Fdhparams-uploader/activity)) 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 207 | * 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 ` 208 | * 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 209 | * 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](https://hub.docker.com/r/linuxserver/ldap-auth/) to communicate with an ldap server. 210 | ### Site config and reverse proxy 211 | * 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. 212 | * 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](https://github.com/linuxserver/reverse-proxy-confs). 213 | * 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 214 | `add_header X-Robots-Tag "noindex, nofollow, nosnippet, noarchive";` 215 | 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 216 | * If you wish to redirect http to https, you must expose port 80 217 | ### Using certs in other containers 218 | * This container includes auto-generated pfx and private-fullchain-bundle pem certs that are needed by other apps like Emby and Znc. 219 | * To use these certs in other containers, do either of the following: 220 | 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/` 221 | 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//` (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) 222 | * These certs include: 223 | 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 224 | 2. `privkey.pfx`, a format supported by Microsoft and commonly used by dotnet apps such as Emby Server (no password) 225 | 3. `priv-fullchain-bundle.pem`, a pem cert that bundles the private key and the fullchain, used by apps like ZNC 226 | ### Using fail2ban 227 | * This container includes fail2ban set up with 3 jails by default: 228 | 1. nginx-http-auth 229 | 2. nginx-badbots 230 | 3. nginx-botsearch 231 | * To enable or disable other jails, modify the file `/config/fail2ban/jail.local` 232 | * 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`) 233 | * You can check which jails are active via `docker exec -it swag fail2ban-client status` 234 | * You can check the status of a specific jail via `docker exec -it swag fail2ban-client status ` 235 | * You can unban an IP via `docker exec -it swag fail2ban-client set unbanip ` 236 | * A list of commands can be found here: https://www.fail2ban.org/wiki/index.php/Commands 237 | 238 | 239 | ## Docker Mods 240 | [![Docker Mods](https://img.shields.io/badge/dynamic/yaml?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=mods&query=%24.mods%5B%27letsencrypt%27%5D.mod_count&url=https%3A%2F%2Fraw.githubusercontent.com%2Flinuxserver%2Fdocker-mods%2Fmaster%2Fmod-list.yml)](https://mods.linuxserver.io/?mod=letsencrypt "view available mods for this container.") 241 | 242 | We publish various [Docker Mods](https://github.com/linuxserver/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. 243 | 244 | 245 | ## Support Info 246 | 247 | * Shell access whilst the container is running: `docker exec -it swag /bin/bash` 248 | * To monitor the logs of the container in realtime: `docker logs -f swag` 249 | * container version number 250 | * `docker inspect -f '{{ index .Config.Labels "build_version" }}' swag` 251 | * image version number 252 | * `docker inspect -f '{{ index .Config.Labels "build_version" }}' linuxserver/letsencrypt` 253 | 254 | ## Updating Info 255 | 256 | 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](#application-setup) section above to see if it is recommended for the image. 257 | 258 | Below are the instructions for updating containers: 259 | 260 | ### Via Docker Run/Create 261 | * Update the image: `docker pull linuxserver/letsencrypt` 262 | * Stop the running container: `docker stop swag` 263 | * Delete the container: `docker rm swag` 264 | * 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) 265 | * Start the new container: `docker start swag` 266 | * You can also remove the old dangling images: `docker image prune` 267 | 268 | ### Via Docker Compose 269 | * Update all images: `docker-compose pull` 270 | * or update a single image: `docker-compose pull swag` 271 | * Let compose update all containers as necessary: `docker-compose up -d` 272 | * or update a single container: `docker-compose up -d swag` 273 | * You can also remove the old dangling images: `docker image prune` 274 | 275 | ### Via Watchtower auto-updater (especially useful if you don't remember the original parameters) 276 | * Pull the latest image at its tag and replace it with the same env variables in one run: 277 | ``` 278 | docker run --rm \ 279 | -v /var/run/docker.sock:/var/run/docker.sock \ 280 | containrrr/watchtower \ 281 | --run-once swag 282 | ``` 283 | 284 | **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. 285 | 286 | * You can also remove the old dangling images: `docker image prune` 287 | 288 | ## Building locally 289 | 290 | If you want to make local modifications to these images for development purposes or just to customize the logic: 291 | ``` 292 | git clone https://github.com/linuxserver/docker-letsencrypt.git 293 | cd docker-letsencrypt 294 | docker build \ 295 | --no-cache \ 296 | --pull \ 297 | -t linuxserver/letsencrypt:latest . 298 | ``` 299 | 300 | The ARM variants can be built on x86_64 hardware using `multiarch/qemu-user-static` 301 | ``` 302 | docker run --rm --privileged multiarch/qemu-user-static:register --reset 303 | ``` 304 | 305 | Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64`. 306 | 307 | ## Versions 308 | 309 | * **28.07.20:** - Start transition to new name, SWAG. 310 | * **17.06.20:** - Reformat ssl.conf. Pull in pre-generated dhparams.pem from DO Spaces. Deprecate `DHLEVEL` param. 311 | * **01.06.20:** - Rebasing to alpine 3.12, change ldap login address to `/ldaplogin` to avoid clashes (existing users need to manually update). 312 | * **31.05.20:** - Tweak Authelia confs (existing users can delete `authelia-server.conf` and `authelia-location.conf`, and restart to update). 313 | * **23.05.20:** - Add support for Authelia. 314 | * **15.05.20:** - Remove `php7-pecl-imagick` due to upstream issues. Add support for `Geoip2` auto db retrieval. 315 | * **10.05.20:** - Added support for fail2ban deny statements. 316 | * **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`. 317 | * **13.04.20:** - Update cloudflare.ini with token info. 318 | * **11.03.20:** - Add php7-sodium. 319 | * **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). 320 | * **05.03.20:** - Use port and proto upstream variables for ldap and default sample confs. 321 | * **24.02.20:** - Remove world/group read permissions in dns-conf. 322 | * **23.02.20:** - Add aliyun dns validation plugin. 323 | * **28.01.20:** - Deprecate tls-sni validation method, remove from docs. 324 | * **27.01.20:** - Add support for cpanel dns validation. 325 | * **10.01.20:** - Add support for domeneshop dns validation. 326 | * **07.01.20:** - Update ciphers from Mozilla ssl-config recommendations. 327 | * **01.01.20:** - Add support for gandi dns validation. 328 | * **31.12.19:** - GeoIP2 databases now require personal license keys to download. Auto download is disabled and log message is added. 329 | * **19.12.19:** - Rebasing to alpine 3.11. 330 | * **19.12.19:** - Increase large_client_header_buffers in nginx.conf to prevent 414 errors. 331 | * **18.12.19:** - Add php7-imap and php7-pecl-apcu. 332 | * **11.12.19:** - Fix Google Cloud DNS to use .json file for authentication. 333 | * **20.11.19:** - Fix cryptography version mismatch due to pip issue. 334 | * **17.11.19:** - Add php7-pdo_odbc. 335 | * **17.11.19:** - Add transip dns validation plugin. 336 | * **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). 337 | * **26.10.19:** - Add new package for stream-geoip2, remove geoip2 module patch. 338 | * **24.10.19:** - Add php7-pecl-imagick. 339 | * **23.10.19:** - Update Host header in `proxy.conf` to fix CSRF issues. 340 | * **12.10.19:** - Add linode dns validation plugin. 341 | * **23.09.19:** - Move GeoIP2 db to /config to make it persistent. 342 | * **14.08.19:** - Add inwx dns validation plugin. 343 | * **06.08.19:** - Add php7-ftp. 344 | * **04.08.19:** - Add php7-bcmath, php7-pear, php7-xmlrpc. 345 | * **02.08.19:** - Add php7-ldap, remove geoip v1(deprecated). 346 | * **01.08.19:** - Mark https redirect block as default_server (effective only for new installs). 347 | * **31.07.19:** - Create GeoIP2 databse (libmaxminddb) during container start if it doesn't exist. 348 | * **30.07.19:** - Support main domain via duckdns validation. 349 | * **29.07.19:** - Enable http to https redirect by default (effective only for new installs). 350 | * **01.07.19:** - Patch geoip2 module until upstream is fixed. 351 | * **30.06.19:** - Add geoip2 module. 352 | * **28.06.19:** - Rebasing to alpine 3.10. 353 | * **19.06.19:** - Set resolver to docker dns in ssl.conf. 354 | * **29.05.19:** - Compensate for changes to the reverse-proxy-confs repo. 355 | * **26.05.19:** - Remove botocore/urllib patch. 356 | * **08.05.19:** - Remove default.conf when nginx is upgraded in downstream image. 357 | * **30.04.19:** - Add php-redis. 358 | * **12.04.19:** - Rebase aarch64 image to 3.9. 359 | * **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. 360 | * **23.03.19:** - Switching to new Base images, shift to arm32v7 tag. 361 | * **10.03.19:** - Add TLSv1.3 to ssl.conf. 362 | * **02.03.19:** - Add php intl and posix modules. 363 | * **27.02.19:** - Add gnupg package. 364 | * **22.02.19:** - Rebase to alpine 3.9. 365 | * **03.02.19:** - Removed memcached due to seccomp errors. Let us know if you need to re-enable memcached. 366 | * **28.01.19:** - Add pipeline logic and multi arch. 367 | * **21.01.19:** - Remove client_body_max from proxy.conf (existing users need to manually update). 368 | * **09.01.19:** - Remove tls v1 and v1.1 from default ssl.conf, update ciphers (existing users need to manually update). 369 | * **30.12.18:** - Fix bundle key generation. 370 | * **19.12.18:** - Add ipv6 and http/2 support to default site config. 371 | * **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. 372 | * **03.12.18:** - Fix silly bug resetting the duckdns token. 373 | * **02.12.18:** - Add dns validation support for ovh. 374 | * **20.11.18:** - Externalize reverse proxy confs to separate github repo `linuxserver/reverse-proxy-confs`, update baseimage packages during build 375 | * **19.11.18:** - Add php opcache package. 376 | * **12.11.18:** - Add support for duckdns wildcard certs via dns validation 377 | * **31.10.18:** - Add various preset proxy confs and fix others (thanks @nemchik and @hijxf) 378 | * **02.10.18:** - Fix fail2ban instructions and logrotate conf 379 | * **11.09.18:** - Add various preset proxy confs and fix others (thanks @nemchik and @LeoVerto) 380 | * **04.09.18:** - Linting fixes. 381 | * **30.08.18:** - Add support for ldap auth, add proxy confs for bazarr, couchpotato, headphones, lidarr and plex subfolder (thanks @nemchik and @jedahan) 382 | * **21.08.18:** - Rebase to alpine 3.8, add info on search engine de-listing 383 | * **08.08.18:** - Add subdomain proxy conf for plex, update emby proxy confs 384 | * **25.07.18:** - Add subdomain proxy conf for syncthing 385 | * **23.07.18:** - Remove backwards compatibility and set default validation method to http. Update portainer proxy config to fix websockets. Add unifi proxy conf. 386 | * **31.05.18:** - Update ssl.conf and proxy.conf for tighter security (thanks @nemchik) 387 | * **30.05.18:** - Add reverse proxy configs for jackett, monitorr, nzbget, nzbhydra, organizr, portainer and transmission (thanks @nemchik) 388 | * **18.05.18:** - Add more info on certs and unraid reverse proxy config 389 | * **11.05.18:** - Add php pgsql support 390 | * **24.04.18:** - Auto generate a private key + fullchain bundle pem that is needed by certain apps 391 | * **20.04.18:** - Add standardized optional reverse proxy conf files 392 | * **19.04.18:** - Bind memcached to localhost only, add php7-sqlite3 393 | * **08.04.18:** - Fix renewal hooks 394 | * **29.03.18:** - Create pfx cert after renewal for dns validation (previous version only created it for http and tls, an oversight) 395 | * **29.03.18:** - Fix staging for v2 api 396 | * **13.03.18:** - Support for wildcard cert with dns validation added. Switched to v2 api for ACME. 397 | * **21.02.18:** - Reduce shellcheck directives by renaming secondary variables 398 | * **20.02.18:** - Sanitize variables, increase log verbosity 399 | * **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 400 | * **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 401 | * **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) 402 | * **10.01.18:** - Add option for http validation on port 80 403 | * **05.01.18:** - Rebase to alpine 3.7 404 | * **04.11.17:** - Add php7 soap module 405 | * **31.10.17:** - Add php7 exif and xmlreader modules 406 | * **25.09.17:** - Manage fail2ban via s6 407 | * **24.09.17:** - Add memcached service 408 | * **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 409 | * **31.08.17:** - Add php7-phar 410 | * **14.07.17:** - Enable modules dynamically in nginx.conf 411 | * **06.07.17:** - Add support for multiple domains (thanks @oznu) 412 | * **22.06.17:** - Add various nginx modules and enable all modules in the default nginx.conf 413 | * **16.06.17:** - Update deprecated certbot option for https validation, make e-mail entry optional, update readme 414 | * **05.06.17:** - Add php7-bz2 415 | * **27.05.17:** - Rebase to alpine 3.6. 416 | * **03.05.17:** - Fix log permissions. 417 | * **18.04.17:** - Add php7-sockets, update fail2ban filter and action defaults 418 | * **27.02.17:** - Add php7-dom, php7-iconv and php7-pdo_sqlite 419 | * **21.02.17:** - Add php7-xml 420 | * **10.02.17:** - Switch to alpine 3.5 base and php7, add php zlib module and all nginx modules 421 | * **13.01.17:** - Add php5-ctype and php5-openssl 422 | * **04.01.17:** - Add php5-mysqli and php5-pdo_mysql 423 | * **22.11.16:** - Add gd and mcrypt packages 424 | * **21.11.16:** - Add curl package 425 | * **07.11.16:** - Initial Release 426 | 427 | {%- endraw %} 428 | -------------------------------------------------------------------------------- /root/app/duckdns-txt: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | . /config/donoteditthisfile.conf 4 | 5 | curl https://www.duckdns.org/update?domains=${CERTBOT_DOMAIN}\&token=${ORIGDUCKDNSTOKEN}\&txt=${CERTBOT_VALIDATION} 6 | 7 | echo "sleeping 60" 8 | sleep 60 9 | -------------------------------------------------------------------------------- /root/app/le-renew.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/with-contenv bash 2 | 3 | . /config/donoteditthisfile.conf 4 | 5 | echo "<------------------------------------------------->" 6 | echo 7 | echo "<------------------------------------------------->" 8 | echo "cronjob running on "$(date) 9 | echo "Running certbot renew" 10 | if [ "$ORIGVALIDATION" = "dns" ] || [ "$ORIGVALIDATION" = "duckdns" ]; then 11 | certbot -n renew \ 12 | --post-hook "if ps aux | grep [n]ginx: > /dev/null; then s6-svc -h /var/run/s6/services/nginx; fi; \ 13 | cd /config/keys/letsencrypt && \ 14 | openssl pkcs12 -export -out privkey.pfx -inkey privkey.pem -in cert.pem -certfile chain.pem -passout pass: && \ 15 | sleep 1 && \ 16 | cat privkey.pem fullchain.pem > priv-fullchain-bundle.pem" 17 | else 18 | certbot -n renew \ 19 | --pre-hook "if ps aux | grep [n]ginx: > /dev/null; then s6-svc -d /var/run/s6/services/nginx; fi" \ 20 | --post-hook "if ps aux | grep 's6-supervise nginx' | grep -v grep > /dev/null; then s6-svc -u /var/run/s6/services/nginx; fi; \ 21 | cd /config/keys/letsencrypt && \ 22 | openssl pkcs12 -export -out privkey.pfx -inkey privkey.pem -in cert.pem -certfile chain.pem -passout pass: && \ 23 | sleep 1 && \ 24 | cat privkey.pem fullchain.pem > priv-fullchain-bundle.pem" 25 | fi 26 | -------------------------------------------------------------------------------- /root/defaults/authelia-location.conf: -------------------------------------------------------------------------------- 1 | ## Version 2020/05/31 - Changelog: https://github.com/linuxserver/docker-letsencrypt/commits/master/root/defaults/authelia-location.conf 2 | # Make sure that your authelia container is in the same user defined bridge network and is named authelia 3 | # Make sure that the authelia configuration.yml has 'path: "authelia"' defined 4 | 5 | auth_request /authelia/api/verify; 6 | auth_request_set $target_url $scheme://$http_host$request_uri; 7 | auth_request_set $user $upstream_http_remote_user; 8 | auth_request_set $groups $upstream_http_remote_groups; 9 | proxy_set_header Remote-User $user; 10 | proxy_set_header Remote-Groups $groups; 11 | error_page 401 =302 https://$http_host/authelia/?rd=$target_url; 12 | -------------------------------------------------------------------------------- /root/defaults/authelia-server.conf: -------------------------------------------------------------------------------- 1 | ## Version 2020/05/31 - Changelog: https://github.com/linuxserver/docker-letsencrypt/commits/master/root/defaults/authelia-server.conf 2 | # Make sure that your authelia container is in the same user defined bridge network and is named authelia 3 | 4 | location ^~ /authelia { 5 | include /config/nginx/proxy.conf; 6 | resolver 127.0.0.11 valid=30s; 7 | set $upstream_authelia authelia; 8 | proxy_pass http://$upstream_authelia:9091; 9 | } 10 | 11 | location = /authelia/api/verify { 12 | internal; 13 | resolver 127.0.0.11 valid=30s; 14 | set $upstream_authelia authelia; 15 | proxy_pass_request_body off; 16 | proxy_pass http://$upstream_authelia:9091; 17 | proxy_set_header Content-Length ""; 18 | 19 | # Timeout if the real server is dead 20 | proxy_next_upstream error timeout invalid_header http_500 http_502 http_503; 21 | 22 | # [REQUIRED] Needed by Authelia to check authorizations of the resource. 23 | # Provide either X-Original-URL and X-Forwarded-Proto or 24 | # X-Forwarded-Proto, X-Forwarded-Host and X-Forwarded-Uri or both. 25 | # Those headers will be used by Authelia to deduce the target url of the user. 26 | # Basic Proxy Config 27 | client_body_buffer_size 128k; 28 | proxy_set_header Host $host; 29 | proxy_set_header X-Original-URL $scheme://$http_host$request_uri; 30 | proxy_set_header X-Real-IP $remote_addr; 31 | proxy_set_header X-Forwarded-For $remote_addr; 32 | proxy_set_header X-Forwarded-Proto $scheme; 33 | proxy_set_header X-Forwarded-Host $http_host; 34 | proxy_set_header X-Forwarded-Uri $request_uri; 35 | proxy_set_header X-Forwarded-Ssl on; 36 | proxy_redirect http:// $scheme://; 37 | proxy_http_version 1.1; 38 | proxy_set_header Connection ""; 39 | proxy_cache_bypass $cookie_session; 40 | proxy_no_cache $cookie_session; 41 | proxy_buffers 4 32k; 42 | 43 | # Advanced Proxy Config 44 | send_timeout 5m; 45 | proxy_read_timeout 240; 46 | proxy_send_timeout 240; 47 | proxy_connect_timeout 240; 48 | } 49 | -------------------------------------------------------------------------------- /root/defaults/default: -------------------------------------------------------------------------------- 1 | ## Version 2020/05/23 - Changelog: https://github.com/linuxserver/docker-letsencrypt/commits/master/root/defaults/default 2 | 3 | # redirect all traffic to https 4 | server { 5 | listen 80 default_server; 6 | listen [::]:80 default_server; 7 | server_name _; 8 | return 301 https://$host$request_uri; 9 | } 10 | 11 | # main server block 12 | server { 13 | listen 443 ssl http2 default_server; 14 | listen [::]:443 ssl http2 default_server; 15 | 16 | root /config/www; 17 | index index.html index.htm index.php; 18 | 19 | server_name _; 20 | 21 | # enable subfolder method reverse proxy confs 22 | include /config/nginx/proxy-confs/*.subfolder.conf; 23 | 24 | # all ssl related config moved to ssl.conf 25 | include /config/nginx/ssl.conf; 26 | 27 | # enable for ldap auth 28 | #include /config/nginx/ldap.conf; 29 | 30 | # enable for Authelia 31 | #include /config/nginx/authelia-server.conf; 32 | 33 | client_max_body_size 0; 34 | 35 | location / { 36 | try_files $uri $uri/ /index.html /index.php?$args =404; 37 | } 38 | 39 | location ~ \.php$ { 40 | fastcgi_split_path_info ^(.+\.php)(/.+)$; 41 | fastcgi_pass 127.0.0.1:9000; 42 | fastcgi_index index.php; 43 | include /etc/nginx/fastcgi_params; 44 | } 45 | 46 | # sample reverse proxy config for password protected couchpotato running at IP 192.168.1.50 port 5050 with base url "cp" 47 | # notice this is within the same server block as the base 48 | # don't forget to generate the .htpasswd file as described on docker hub 49 | # location ^~ /cp { 50 | # auth_basic "Restricted"; 51 | # auth_basic_user_file /config/nginx/.htpasswd; 52 | # include /config/nginx/proxy.conf; 53 | # proxy_pass http://192.168.1.50:5050/cp; 54 | # } 55 | 56 | } 57 | 58 | # sample reverse proxy config without url base, but as a subdomain "cp", ip and port same as above 59 | # notice this is a new server block, you need a new server block for each subdomain 60 | #server { 61 | # listen 443 ssl http2; 62 | # listen [::]:443 ssl http2; 63 | # 64 | # root /config/www; 65 | # index index.html index.htm index.php; 66 | # 67 | # server_name cp.*; 68 | # 69 | # include /config/nginx/ssl.conf; 70 | # 71 | # client_max_body_size 0; 72 | # 73 | # location / { 74 | # auth_basic "Restricted"; 75 | # auth_basic_user_file /config/nginx/.htpasswd; 76 | # include /config/nginx/proxy.conf; 77 | # proxy_pass http://192.168.1.50:5050; 78 | # } 79 | #} 80 | 81 | # sample reverse proxy config for "heimdall" via subdomain, with ldap authentication 82 | # ldap-auth container has to be running and the /config/nginx/ldap.conf file should be filled with ldap info 83 | # notice this is a new server block, you need a new server block for each subdomain 84 | #server { 85 | # listen 443 ssl http2; 86 | # listen [::]:443 ssl http2; 87 | # 88 | # root /config/www; 89 | # index index.html index.htm index.php; 90 | # 91 | # server_name heimdall.*; 92 | # 93 | # include /config/nginx/ssl.conf; 94 | # 95 | # include /config/nginx/ldap.conf; 96 | # 97 | # client_max_body_size 0; 98 | # 99 | # location / { 100 | # # the next two lines will enable ldap auth along with the included ldap.conf in the server block 101 | # auth_request /auth; 102 | # error_page 401 =200 /ldaplogin; 103 | # 104 | # include /config/nginx/proxy.conf; 105 | # resolver 127.0.0.11 valid=30s; 106 | # set $upstream_app heimdall; 107 | # set $upstream_port 443; 108 | # set $upstream_proto https; 109 | # proxy_pass $upstream_proto://$upstream_app:$upstream_port; 110 | # } 111 | #} 112 | 113 | # sample reverse proxy config for "heimdall" via subdomain, with Authelia 114 | # Authelia container has to be running in the same user defined bridge network, with container name "authelia", and with 'path: "authelia"' set in its configuration.yml 115 | # notice this is a new server block, you need a new server block for each subdomain 116 | #server { 117 | # listen 443 ssl http2; 118 | # listen [::]:443 ssl http2; 119 | # 120 | # root /config/www; 121 | # index index.html index.htm index.php; 122 | # 123 | # server_name heimdall.*; 124 | # 125 | # include /config/nginx/ssl.conf; 126 | # 127 | # include /config/nginx/authelia-server.conf; 128 | # 129 | # client_max_body_size 0; 130 | # 131 | # location / { 132 | # # the next line will enable Authelia along with the included authelia-server.conf in the server block 133 | # include /config/nginx/authelia-location.conf; 134 | # 135 | # include /config/nginx/proxy.conf; 136 | # resolver 127.0.0.11 valid=30s; 137 | # set $upstream_app heimdall; 138 | # set $upstream_port 443; 139 | # set $upstream_proto https; 140 | # proxy_pass $upstream_proto://$upstream_app:$upstream_port; 141 | # } 142 | #} 143 | 144 | # enable subdomain method reverse proxy confs 145 | include /config/nginx/proxy-confs/*.subdomain.conf; 146 | # enable proxy cache for auth 147 | proxy_cache_path cache/ keys_zone=auth_cache:10m; 148 | -------------------------------------------------------------------------------- /root/defaults/dns-conf/aliyun.ini: -------------------------------------------------------------------------------- 1 | # Obtain Aliyun RAM AccessKey 2 | # https://ram.console.aliyun.com/ 3 | # And ensure your RAM account has AliyunDNSFullAccess permission. 4 | 5 | certbot_dns_aliyun:dns_aliyun_access_key = 12345678 6 | certbot_dns_aliyun:dns_aliyun_access_key_secret = 1234567890abcdef1234567890abcdef 7 | -------------------------------------------------------------------------------- /root/defaults/dns-conf/cloudflare.ini: -------------------------------------------------------------------------------- 1 | # Instructions: https://github.com/certbot/certbot/blob/master/certbot-dns-cloudflare/certbot_dns_cloudflare/__init__.py#L20 2 | # Replace with your values 3 | 4 | # With global api key: 5 | dns_cloudflare_email = cloudflare@example.com 6 | dns_cloudflare_api_key = 0123456789abcdef0123456789abcdef01234567 7 | 8 | # With token (comment out both lines above and uncomment below): 9 | #dns_cloudflare_api_token = 0123456789abcdef0123456789abcdef01234567 -------------------------------------------------------------------------------- /root/defaults/dns-conf/cloudxns.ini: -------------------------------------------------------------------------------- 1 | # Instructions: https://github.com/certbot/certbot/blob/master/certbot-dns-cloudxns/certbot_dns_cloudxns/__init__.py#L20 2 | # Replace with your values 3 | dns_cloudxns_api_key = 1234567890abcdef1234567890abcdef 4 | dns_cloudxns_secret_key = 1122334455667788 5 | -------------------------------------------------------------------------------- /root/defaults/dns-conf/cpanel.ini: -------------------------------------------------------------------------------- 1 | # Instructions: https://github.com/badjware/certbot-dns-cpanel#credentials 2 | # Replace with your values 3 | # include the scheme and the port number (usually 2083 for https) 4 | certbot_dns_cpanel:cpanel_url = https://cpanel.example.com:2083 5 | certbot_dns_cpanel:cpanel_username = username 6 | certbot_dns_cpanel:cpanel_password = 1234567890abcdef -------------------------------------------------------------------------------- /root/defaults/dns-conf/digitalocean.ini: -------------------------------------------------------------------------------- 1 | # Instructions: https://github.com/certbot/certbot/blob/master/certbot-dns-digitalocean/certbot_dns_digitalocean/__init__.py#L21 2 | # Replace with your value 3 | dns_digitalocean_token = 0000111122223333444455556666777788889999aaaabbbbccccddddeeeeffff 4 | -------------------------------------------------------------------------------- /root/defaults/dns-conf/dnsimple.ini: -------------------------------------------------------------------------------- 1 | # Instructions: https://github.com/certbot/certbot/blob/master/certbot-dns-dnsimple/certbot_dns_dnsimple/__init__.py#L20 2 | # Replace with your value 3 | dns_dnsimple_token = MDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAw 4 | -------------------------------------------------------------------------------- /root/defaults/dns-conf/dnsmadeeasy.ini: -------------------------------------------------------------------------------- 1 | # Instructions: https://github.com/certbot/certbot/blob/master/certbot-dns-dnsmadeeasy/certbot_dns_dnsmadeeasy/__init__.py#L20 2 | # Replace with your values 3 | dns_dnsmadeeasy_api_key = 1c1a3c91-4770-4ce7-96f4-54c0eb0e457a 4 | dns_dnsmadeeasy_secret_key = c9b5625f-9834-4ff8-baba-4ed5f32cae55 5 | -------------------------------------------------------------------------------- /root/defaults/dns-conf/domeneshop.ini: -------------------------------------------------------------------------------- 1 | # Instructions: https://github.com/domeneshop/certbot-dns-domeneshop#credentials 2 | # Replace with your values 3 | certbot_dns_domeneshop:dns_domeneshop_client_token=1234567890abcdef 4 | certbot_dns_domeneshop:dns_domeneshop_client_secret=1234567890abcdefghijklmnopqrstuvxyz1234567890abcdefghijklmnopqrs -------------------------------------------------------------------------------- /root/defaults/dns-conf/gandi.ini: -------------------------------------------------------------------------------- 1 | # Instructions: https://github.com/obynio/certbot-plugin-gandi#usage 2 | # Replace with your value 3 | certbot_plugin_gandi:dns_api_key=APIKEY 4 | -------------------------------------------------------------------------------- /root/defaults/dns-conf/google.json: -------------------------------------------------------------------------------- 1 | { 2 | "instructions": "https://github.com/certbot/certbot/blob/master/certbot-dns-google/certbot_dns_google/__init__.py", 3 | "_comment": "Replace with your values", 4 | "type": "service_account", 5 | "rest": "..." 6 | } -------------------------------------------------------------------------------- /root/defaults/dns-conf/inwx.ini: -------------------------------------------------------------------------------- 1 | # Instructions: https://github.com/oGGy990/certbot-dns-inwx 2 | # Replace with your values 3 | certbot_dns_inwx:dns_inwx_url = https://api.domrobot.com/xmlrpc/ 4 | certbot_dns_inwx:dns_inwx_username = your_username 5 | certbot_dns_inwx:dns_inwx_password = your_password 6 | certbot_dns_inwx:dns_inwx_shared_secret = your_shared_secret optional 7 | -------------------------------------------------------------------------------- /root/defaults/dns-conf/linode.ini: -------------------------------------------------------------------------------- 1 | # Instructions: https://github.com/certbot/certbot/blob/master/certbot-dns-linode/certbot_dns_linode/__init__.py#L25 2 | # Replace with your values 3 | dns_linode_key = 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ64 4 | -------------------------------------------------------------------------------- /root/defaults/dns-conf/luadns.ini: -------------------------------------------------------------------------------- 1 | # Instructions: https://github.com/certbot/certbot/blob/master/certbot-dns-luadns/certbot_dns_luadns/__init__.py#L20 2 | # Replace with your values 3 | dns_luadns_email = user@example.com 4 | dns_luadns_token = 0123456789abcdef0123456789abcdef 5 | -------------------------------------------------------------------------------- /root/defaults/dns-conf/nsone.ini: -------------------------------------------------------------------------------- 1 | # Instructions: https://github.com/certbot/certbot/blob/master/certbot-dns-nsone/certbot_dns_nsone/__init__.py#L20 2 | # Replace with your value 3 | dns_nsone_api_key = MDAwMDAwMDAwMDAwMDAw 4 | -------------------------------------------------------------------------------- /root/defaults/dns-conf/ovh.ini: -------------------------------------------------------------------------------- 1 | # Instructions: https://github.com/certbot/certbot/blob/master/certbot-dns-ovh/certbot_dns_ovh/__init__.py#L20 2 | # Replace with your values 3 | dns_ovh_endpoint = ovh-eu 4 | dns_ovh_application_key = MDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAw 5 | dns_ovh_application_secret = MDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAw 6 | dns_ovh_consumer_key = MDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAw 7 | -------------------------------------------------------------------------------- /root/defaults/dns-conf/rfc2136.ini: -------------------------------------------------------------------------------- 1 | # Instructions: https://github.com/certbot/certbot/blob/master/certbot-dns-rfc2136/certbot_dns_rfc2136/__init__.py#L20 2 | # Replace with your values 3 | # Target DNS server 4 | dns_rfc2136_server = 192.0.2.1 5 | # TSIG key name 6 | dns_rfc2136_name = keyname. 7 | # TSIG key secret 8 | dns_rfc2136_secret = 4q4wM/2I180UXoMyN4INVhJNi8V9BCV+jMw2mXgZw/CSuxUT8C7NKKFs \ 9 | AmKd7ak51vWKgSl12ib86oQRPkpDjg== 10 | # TSIG key algorithm 11 | dns_rfc2136_algorithm = HMAC-SHA512 12 | -------------------------------------------------------------------------------- /root/defaults/dns-conf/route53.ini: -------------------------------------------------------------------------------- 1 | # Instructions: https://github.com/certbot/certbot/blob/master/certbot-dns-route53/certbot_dns_route53/__init__.py#L18 2 | # Replace with your values 3 | [default] 4 | aws_access_key_id=AKIAIOSFODNN7EXAMPLE 5 | aws_secret_access_key=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY 6 | -------------------------------------------------------------------------------- /root/defaults/dns-conf/transip.ini: -------------------------------------------------------------------------------- 1 | # Instructions: https://readthedocs.org/projects/certbot-dns-transip/ 2 | # Convert the key to an RSA key (openssl rsa -in transip.key -out transip-rsa.key) 3 | # Place .key-file in the same directory as this file. Location "/config/dns-conf" is from within the container 4 | 5 | certbot_dns_transip:dns_transip_username = 6 | certbot_dns_transip:dns_transip_key_file = /config/dns-conf/transip-rsa.key -------------------------------------------------------------------------------- /root/defaults/fail2ban/fail2ban.local: -------------------------------------------------------------------------------- 1 | [Definition] 2 | 3 | logtarget = /config/log/fail2ban/fail2ban.log 4 | dbfile = /config/fail2ban/fail2ban.sqlite3 5 | -------------------------------------------------------------------------------- /root/defaults/fail2ban/filter.d/nginx-badbots.conf: -------------------------------------------------------------------------------- 1 | # Fail2Ban configuration file 2 | # 3 | # Regexp to catch known spambots and software alike. Please verify 4 | # that it is your intent to block IPs which were driven by 5 | # above mentioned bots. 6 | 7 | 8 | [Definition] 9 | 10 | badbotscustom = EmailCollector|WebEMailExtrac|TrackBack/1\.02|sogou music spider 11 | badbots = Atomic_Email_Hunter/4\.0|atSpider/1\.0|autoemailspider|bwh3_user_agent|China Local Browse 2\.6|ContactBot/0\.2|ContentSmartz|DataCha0s/2\.0|DBrowse 1\.4b|DBrowse 1\.4d|Demo Bot DOT 16b|Demo Bot Z 16b|DSurf15a 01|DSurf15a 71|DSurf15a 81|DSurf15a VA|EBrowse 1\.4b|Educate Search VxB|EmailSiphon|EmailSpider|EmailWolf 1\.00|ESurf15a 15|ExtractorPro|Franklin Locator 1\.8|FSurf15a 01|Full Web Bot 0416B|Full Web Bot 0516B|Full Web Bot 2816B|Guestbook Auto Submitter|Industry Program 1\.0\.x|ISC Systems iRc Search 2\.1|IUPUI Research Bot v 1\.9a|LARBIN-EXPERIMENTAL \(efp@gmx\.net\)|LetsCrawl\.com/1\.0 \+http\://letscrawl\.com/|Lincoln State Web Browser|LMQueueBot/0\.2|LWP\:\:Simple/5\.803|Mac Finder 1\.0\.xx|MFC Foundation Class Library 4\.0|Microsoft URL Control - 6\.00\.8xxx|Missauga Locate 1\.0\.0|Missigua Locator 1\.9|Missouri College Browse|Mizzu Labs 2\.2|Mo College 1\.9|MVAClient|Mozilla/2\.0 \(compatible; NEWT ActiveX; Win32\)|Mozilla/3\.0 \(compatible; Indy Library\)|Mozilla/3\.0 \(compatible; scan4mail \(advanced version\) http\://www\.peterspages\.net/?scan4mail\)|Mozilla/4\.0 \(compatible; Advanced Email Extractor v2\.xx\)|Mozilla/4\.0 \(compatible; Iplexx Spider/1\.0 http\://www\.iplexx\.at\)|Mozilla/4\.0 \(compatible; MSIE 5\.0; Windows NT; DigExt; DTS Agent|Mozilla/4\.0 efp@gmx\.net|Mozilla/5\.0 \(Version\: xxxx Type\:xx\)|NameOfAgent \(CMS Spider\)|NASA Search 1\.0|Nsauditor/1\.x|PBrowse 1\.4b|PEval 1\.4b|Poirot|Port Huron Labs|Production Bot 0116B|Production Bot 2016B|Production Bot DOT 3016B|Program Shareware 1\.0\.2|PSurf15a 11|PSurf15a 51|PSurf15a VA|psycheclone|RSurf15a 41|RSurf15a 51|RSurf15a 81|searchbot admin@google\.com|ShablastBot 1\.0|snap\.com beta crawler v0|Snapbot/1\.0|Snapbot/1\.0 \(Snap Shots, \+http\://www\.snap\.com\)|sogou develop spider|Sogou Orion spider/3\.0\(\+http\://www\.sogou\.com/docs/help/webmasters\.htm#07\)|sogou spider|Sogou web spider/3\.0\(\+http\://www\.sogou\.com/docs/help/webmasters\.htm#07\)|sohu agent|SSurf15a 11 |TSurf15a 11|Under the Rainbow 2\.2|User-Agent\: Mozilla/4\.0 \(compatible; MSIE 6\.0; Windows NT 5\.1\)|VadixBot|WebVulnCrawl\.unknown/1\.0 libwww-perl/5\.803|Wells Search II|WEP Search 00 12 | 13 | failregex = ^ -.*"(GET|POST|HEAD).*HTTP.*"(?:%(badbots)s|%(badbotscustom)s)"$ 14 | 15 | ignoreregex = 16 | 17 | # DEV Notes: 18 | # List of bad bots fetched from http://www.user-agents.org 19 | # Generated on Thu Nov 7 14:23:35 PST 2013 by files/gen_badbots. 20 | # 21 | # Author: Yaroslav Halchenko 22 | -------------------------------------------------------------------------------- /root/defaults/fail2ban/filter.d/nginx-deny.conf: -------------------------------------------------------------------------------- 1 | # fail2ban filter configuration for nginx 2 | 3 | 4 | [Definition] 5 | 6 | 7 | failregex = ^ \[error\] \d+#\d+: \*\d+ (access forbidden by rule), client: , server: \S*, request: "\S+ \S+ HTTP\/\d+\.\d+", host: "\S+"(?:, referrer: "\S+")?\s*$ 8 | 9 | ignoreregex = 10 | 11 | datepattern = {^LN-BEG} 12 | 13 | # DEV NOTES: 14 | # 15 | # Author: Will L (driz@linuxserver.io) 16 | -------------------------------------------------------------------------------- /root/defaults/jail.local: -------------------------------------------------------------------------------- 1 | ## Version 2020/05/10 - Changelog: https://github.com/linuxserver/docker-letsencrypt/commits/master/root/defaults/jail.local 2 | # This is the custom version of the jail.conf for fail2ban 3 | # Feel free to modify this and add additional filters 4 | # Then you can drop the new filter conf files into the fail2ban-filters 5 | # folder and restart the container 6 | 7 | [DEFAULT] 8 | 9 | # Changes the default ban action from "iptables-multiport", which causes issues on some platforms, to "iptables-allports". 10 | banaction = iptables-allports 11 | 12 | # "bantime" is the number of seconds that a host is banned. 13 | bantime = 600 14 | 15 | # A host is banned if it has generated "maxretry" during the last "findtime" 16 | # seconds. 17 | findtime = 600 18 | 19 | # "maxretry" is the number of failures before a host get banned. 20 | maxretry = 5 21 | 22 | 23 | [ssh] 24 | 25 | enabled = false 26 | 27 | 28 | [nginx-http-auth] 29 | 30 | enabled = true 31 | filter = nginx-http-auth 32 | port = http,https 33 | logpath = /config/log/nginx/error.log 34 | 35 | 36 | [nginx-badbots] 37 | 38 | enabled = true 39 | port = http,https 40 | filter = nginx-badbots 41 | logpath = /config/log/nginx/access.log 42 | maxretry = 2 43 | 44 | 45 | [nginx-botsearch] 46 | 47 | enabled = true 48 | port = http,https 49 | filter = nginx-botsearch 50 | logpath = /config/log/nginx/access.log 51 | 52 | [nginx-deny] 53 | 54 | enabled = true 55 | port = http,https 56 | filter = nginx-deny 57 | logpath = /config/log/nginx/error.log 58 | -------------------------------------------------------------------------------- /root/defaults/ldap.conf: -------------------------------------------------------------------------------- 1 | ## Version 2020/06/02 - Changelog: https://github.com/linuxserver/docker-letsencrypt/commits/master/root/defaults/ldap.conf 2 | ## this conf is meant to be used in conjunction with our ldap-auth image: https://github.com/linuxserver/docker-ldap-auth 3 | ## see the heimdall example in the default site config for info on enabling ldap auth 4 | ## for further instructions on this conf, see https://github.com/nginxinc/nginx-ldap-auth 5 | 6 | location /ldaplogin { 7 | resolver 127.0.0.11 valid=30s; 8 | set $upstream_auth_app ldap-auth; 9 | set $upstream_auth_port 9000; 10 | set $upstream_auth_proto http; 11 | proxy_pass $upstream_auth_proto://$upstream_auth_app:$upstream_auth_port; 12 | proxy_set_header X-Target $request_uri; 13 | } 14 | 15 | location = /auth { 16 | resolver 127.0.0.11 valid=30s; 17 | set $upstream_auth_app ldap-auth; 18 | set $upstream_auth_port 8888; 19 | set $upstream_auth_proto http; 20 | proxy_pass $upstream_auth_proto://$upstream_auth_app:$upstream_auth_port; 21 | 22 | proxy_pass_request_body off; 23 | proxy_set_header Content-Length ""; 24 | 25 | #Before enabling the below caching options, make sure you have the line "proxy_cache_path cache/ keys_zone=auth_cache:10m;" at the bottom your default site config 26 | #proxy_cache auth_cache; 27 | #proxy_cache_valid 200 10m; 28 | #proxy_cache_key "$http_authorization$cookie_nginxauth"; 29 | 30 | # As implemented in nginx-ldap-auth-daemon.py, the ldap-auth daemon 31 | # communicates with a LDAP server, passing in the following 32 | # parameters to specify which user account to authenticate. To 33 | # eliminate the need to modify the Python code, this file contains 34 | # 'proxy_set_header' directives that set the values of the 35 | # parameters. Set or change them as instructed in the comments. 36 | # 37 | # Parameter Proxy header 38 | # ----------- ---------------- 39 | # url X-Ldap-URL 40 | # starttls X-Ldap-Starttls 41 | # basedn X-Ldap-BaseDN 42 | # binddn X-Ldap-BindDN 43 | # bindpasswd X-Ldap-BindPass 44 | # cookiename X-CookieName 45 | # realm X-Ldap-Realm 46 | # template X-Ldap-Template 47 | 48 | # (Required) Set the URL and port for connecting to the LDAP server, 49 | # by replacing 'example.com'. 50 | # Do not mix ldaps-style URL and X-Ldap-Starttls as it will not work. 51 | proxy_set_header X-Ldap-URL "ldap://example.com"; 52 | 53 | # (Optional) Establish a TLS-enabled LDAP session after binding to the 54 | # LDAP server. 55 | # This is the 'proper' way to establish encrypted TLS connections, see 56 | # http://www.openldap.org/faq/data/cache/185.html 57 | #proxy_set_header X-Ldap-Starttls "true"; 58 | 59 | # (Required) Set the Base DN, by replacing the value enclosed in 60 | # double quotes. 61 | proxy_set_header X-Ldap-BaseDN "cn=Users,dc=test,dc=local"; 62 | 63 | # (Required) Set the Bind DN, by replacing the value enclosed in 64 | # double quotes. 65 | # If AD, use "root@test.local" 66 | proxy_set_header X-Ldap-BindDN "cn=root,dc=test,dc=local"; 67 | 68 | # (Required) Set the Bind password, by replacing 'secret'. 69 | proxy_set_header X-Ldap-BindPass "secret"; 70 | 71 | # (Required) The following directives set the cookie name and pass 72 | # it, respectively. They are required for cookie-based 73 | # authentication. Comment them out if using HTTP basic 74 | # authentication. 75 | proxy_set_header X-CookieName "nginxauth"; 76 | proxy_set_header Cookie nginxauth=$cookie_nginxauth; 77 | 78 | # (Required if using Microsoft Active Directory as the LDAP server) 79 | # Set the LDAP template by uncommenting the following directive. 80 | #proxy_set_header X-Ldap-Template "(sAMAccountName=%(username)s)"; 81 | 82 | # (Optional if using OpenLDAP as the LDAP server) Set the LDAP 83 | # template by uncommenting the following directive and replacing 84 | # '(cn=%(username)s)' which is the default set in 85 | # nginx-ldap-auth-daemon.py. 86 | #proxy_set_header X-Ldap-Template "(cn=%(username)s)"; 87 | 88 | # (Optional) Set the realm name, by uncommenting the following 89 | # directive and replacing 'Restricted' which is the default set 90 | # in nginx-ldap-auth-daemon.py. 91 | #proxy_set_header X-Ldap-Realm "Restricted"; 92 | } 93 | -------------------------------------------------------------------------------- /root/defaults/nginx.conf: -------------------------------------------------------------------------------- 1 | ## Version 2019/12/19 - Changelog: https://github.com/linuxserver/docker-letsencrypt/commits/master/root/defaults/nginx.conf 2 | 3 | user abc; 4 | worker_processes 4; 5 | pid /run/nginx.pid; 6 | include /etc/nginx/modules/*.conf; 7 | 8 | events { 9 | worker_connections 768; 10 | # multi_accept on; 11 | } 12 | 13 | http { 14 | 15 | ## 16 | # Basic Settings 17 | ## 18 | 19 | sendfile on; 20 | tcp_nopush on; 21 | tcp_nodelay on; 22 | keepalive_timeout 65; 23 | types_hash_max_size 2048; 24 | variables_hash_max_size 2048; 25 | large_client_header_buffers 4 16k; 26 | 27 | # server_tokens off; 28 | 29 | # server_names_hash_bucket_size 64; 30 | # server_name_in_redirect off; 31 | 32 | client_max_body_size 0; 33 | 34 | include /etc/nginx/mime.types; 35 | default_type application/octet-stream; 36 | 37 | ## 38 | # Logging Settings 39 | ## 40 | 41 | access_log /config/log/nginx/access.log; 42 | error_log /config/log/nginx/error.log; 43 | 44 | ## 45 | # Gzip Settings 46 | ## 47 | 48 | gzip on; 49 | gzip_disable "msie6"; 50 | 51 | # gzip_vary on; 52 | # gzip_proxied any; 53 | # gzip_comp_level 6; 54 | # gzip_buffers 16 8k; 55 | # gzip_http_version 1.1; 56 | # gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript; 57 | 58 | ## 59 | # nginx-naxsi config 60 | ## 61 | # Uncomment it if you installed nginx-naxsi 62 | ## 63 | 64 | #include /etc/nginx/naxsi_core.rules; 65 | 66 | ## 67 | # nginx-passenger config 68 | ## 69 | # Uncomment it if you installed nginx-passenger 70 | ## 71 | 72 | #passenger_root /usr; 73 | #passenger_ruby /usr/bin/ruby; 74 | 75 | ## 76 | # Virtual Host Configs 77 | ## 78 | include /etc/nginx/conf.d/*.conf; 79 | include /config/nginx/site-confs/*; 80 | lua_load_resty_core off; 81 | 82 | } 83 | 84 | 85 | #mail { 86 | # # See sample authentication script at: 87 | # # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript 88 | # 89 | # # auth_http localhost/auth.php; 90 | # # pop3_capabilities "TOP" "USER"; 91 | # # imap_capabilities "IMAP4rev1" "UIDPLUS"; 92 | # 93 | # server { 94 | # listen localhost:110; 95 | # protocol pop3; 96 | # proxy on; 97 | # } 98 | # 99 | # server { 100 | # listen localhost:143; 101 | # protocol imap; 102 | # proxy on; 103 | # } 104 | #} 105 | daemon off; 106 | -------------------------------------------------------------------------------- /root/defaults/proxy.conf: -------------------------------------------------------------------------------- 1 | ## Version 2019/10/23 - Changelog: https://github.com/linuxserver/docker-letsencrypt/commits/master/root/defaults/proxy.conf 2 | 3 | client_body_buffer_size 128k; 4 | 5 | #Timeout if the real server is dead 6 | proxy_next_upstream error timeout invalid_header http_500 http_502 http_503; 7 | 8 | # Advanced Proxy Config 9 | send_timeout 5m; 10 | proxy_read_timeout 240; 11 | proxy_send_timeout 240; 12 | proxy_connect_timeout 240; 13 | 14 | # TLS 1.3 early data 15 | proxy_set_header Early-Data $ssl_early_data; 16 | 17 | # Basic Proxy Config 18 | proxy_set_header Host $host; 19 | proxy_set_header X-Real-IP $remote_addr; 20 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 21 | proxy_set_header X-Forwarded-Proto https; 22 | proxy_set_header X-Forwarded-Host $host; 23 | proxy_set_header X-Forwarded-Ssl on; 24 | proxy_redirect http:// $scheme://; 25 | proxy_http_version 1.1; 26 | proxy_set_header Connection ""; 27 | #proxy_cookie_path / "/; HTTPOnly; Secure"; # enable at your own risk, may break certain apps 28 | proxy_cache_bypass $cookie_session; 29 | proxy_no_cache $cookie_session; 30 | proxy_buffers 32 4k; 31 | proxy_headers_hash_bucket_size 128; 32 | proxy_headers_hash_max_size 1024; 33 | -------------------------------------------------------------------------------- /root/defaults/ssl.conf: -------------------------------------------------------------------------------- 1 | ## Version 2020/06/17 - Changelog: https://github.com/linuxserver/docker-letsencrypt/commits/master/root/defaults/ssl.conf 2 | 3 | ### Mozilla Recommendations 4 | # generated 2020-06-17, Mozilla Guideline v5.4, nginx 1.18.0-r0, OpenSSL 1.1.1g-r0, intermediate configuration 5 | # https://ssl-config.mozilla.org/#server=nginx&version=1.18.0-r0&config=intermediate&openssl=1.1.1g-r0&guideline=5.4 6 | 7 | ssl_session_timeout 1d; 8 | ssl_session_cache shared:MozSSL:10m; # about 40000 sessions 9 | ssl_session_tickets off; 10 | 11 | # intermediate configuration 12 | ssl_protocols TLSv1.2 TLSv1.3; 13 | ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384; 14 | ssl_prefer_server_ciphers off; 15 | 16 | # OCSP stapling 17 | ssl_stapling on; 18 | ssl_stapling_verify on; 19 | 20 | 21 | ### Linuxserver.io Defaults 22 | 23 | # Certificates 24 | ssl_certificate /config/keys/letsencrypt/fullchain.pem; 25 | ssl_certificate_key /config/keys/letsencrypt/privkey.pem; 26 | # verify chain of trust of OCSP response using Root CA and Intermediate certs 27 | ssl_trusted_certificate /config/keys/letsencrypt/fullchain.pem; 28 | 29 | # Diffie-Hellman Parameters 30 | ssl_dhparam /config/nginx/dhparams.pem; 31 | 32 | # Resolver 33 | resolver 127.0.0.11 valid=30s; # Docker DNS Server 34 | 35 | # Enable TLS 1.3 early data 36 | ssl_early_data on; 37 | 38 | # HSTS, remove # from the line below to enable HSTS 39 | #add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload" always; 40 | 41 | # Optional additional headers 42 | #add_header Content-Security-Policy "upgrade-insecure-requests"; 43 | #add_header X-Frame-Options "SAMEORIGIN" always; 44 | #add_header X-XSS-Protection "1; mode=block" always; 45 | #add_header X-Content-Type-Options "nosniff" always; 46 | #add_header X-UA-Compatible "IE=Edge" always; 47 | #add_header Cache-Control "no-transform" always; 48 | #add_header Referrer-Policy "same-origin" always; 49 | -------------------------------------------------------------------------------- /root/donate.txt: -------------------------------------------------------------------------------- 1 | Certbot: https://supporters.eff.org/donate/support-work-on-certbot 2 | -------------------------------------------------------------------------------- /root/etc/cont-init.d/50-config: -------------------------------------------------------------------------------- 1 | #!/usr/bin/with-contenv bash 2 | 3 | # Display variables for troubleshooting 4 | echo -e "Variables set:\\n\ 5 | PUID=${PUID}\\n\ 6 | PGID=${PGID}\\n\ 7 | TZ=${TZ}\\n\ 8 | URL=${URL}\\n\ 9 | SUBDOMAINS=${SUBDOMAINS}\\n\ 10 | EXTRA_DOMAINS=${EXTRA_DOMAINS}\\n\ 11 | ONLY_SUBDOMAINS=${ONLY_SUBDOMAINS}\\n\ 12 | VALIDATION=${VALIDATION}\\n\ 13 | DNSPLUGIN=${DNSPLUGIN}\\n\ 14 | EMAIL=${EMAIL}\\n\ 15 | STAGING=${STAGING}\\n" 16 | 17 | # Echo init finish for test runs 18 | if [ -n "${TEST_RUN}" ]; then 19 | echo '[services.d] done.' 20 | fi 21 | 22 | # Sanitize variables 23 | SANED_VARS=( DNSPLUGIN EMAIL EXTRA_DOMAINS ONLY_SUBDOMAINS STAGING SUBDOMAINS URL VALIDATION ) 24 | for i in "${SANED_VARS[@]}" 25 | do 26 | export echo "$i"="${!i//\"/}" 27 | export echo "$i"="$(echo "${!i}" | tr '[:upper:]' '[:lower:]')" 28 | done 29 | 30 | # check to make sure that the required variables are set 31 | [[ -z "$URL" ]] && \ 32 | echo "Please pass your URL as an environment variable in your docker run command. See docker info for more details." && \ 33 | sleep infinity 34 | 35 | # make our folders and links 36 | mkdir -p \ 37 | /config/{log/letsencrypt,log/fail2ban,etc/letsencrypt,fail2ban,crontabs,dns-conf,geoip2db} \ 38 | /var/run/fail2ban 39 | rm -rf /etc/letsencrypt 40 | ln -s /config/etc/letsencrypt /etc/letsencrypt 41 | 42 | # copy dns default configs 43 | cp -n /defaults/dns-conf/* /config/dns-conf/ 44 | chown -R abc:abc /config/dns-conf 45 | 46 | # copy reverse proxy configs 47 | cp -R /defaults/proxy-confs /config/nginx/ 48 | # remove outdated files (remove this action after 2020/10/17) 49 | rm -f /config/nginx/proxy-confs/seafile.subdomain.config.sample /config/nginx/proxy-confs/librespeed.subdomain.com.sample 50 | 51 | # copy/update the fail2ban config defaults to/in /config 52 | cp -R /defaults/fail2ban/filter.d /config/fail2ban/ 53 | cp -R /defaults/fail2ban/action.d /config/fail2ban/ 54 | # if jail.local is missing in /config, copy default 55 | [[ ! -f /config/fail2ban/jail.local ]] && \ 56 | cp /defaults/jail.local /config/fail2ban/jail.local 57 | # Replace fail2ban config with user config 58 | [[ -d /etc/fail2ban/filter.d ]] && \ 59 | rm -rf /etc/fail2ban/filter.d 60 | [[ -d /etc/fail2ban/action.d ]] && \ 61 | rm -rf /etc/fail2ban/action.d 62 | cp -R /config/fail2ban/filter.d /etc/fail2ban/ 63 | cp -R /config/fail2ban/action.d /etc/fail2ban/ 64 | cp /defaults/fail2ban/fail2ban.local /etc/fail2ban/ 65 | cp /config/fail2ban/jail.local /etc/fail2ban/jail.local 66 | 67 | # copy crontab and proxy defaults if needed 68 | [[ ! -f /config/crontabs/root ]] && \ 69 | cp /etc/crontabs/root /config/crontabs/ 70 | [[ ! -f /config/nginx/proxy.conf ]] && \ 71 | cp /defaults/proxy.conf /config/nginx/proxy.conf 72 | [[ ! -f /config/nginx/ssl.conf ]] && \ 73 | cp /defaults/ssl.conf /config/nginx/ssl.conf 74 | [[ ! -f /config/nginx/ldap.conf ]] && \ 75 | cp /defaults/ldap.conf /config/nginx/ldap.conf 76 | [[ ! -f /config/nginx/authelia-server.conf ]] && \ 77 | cp /defaults/authelia-server.conf /config/nginx/authelia-server.conf 78 | [[ ! -f /config/nginx/authelia-location.conf ]] && \ 79 | cp /defaults/authelia-location.conf /config/nginx/authelia-location.conf 80 | 81 | # copy pre-generated dhparams or generate if needed 82 | [[ ! -f /config/nginx/dhparams.pem ]] && \ 83 | cp /defaults/dhparams.pem /config/nginx/dhparams.pem 84 | if ! grep -q 'PARAMETERS' "/config/nginx/dhparams.pem"; then 85 | curl -o /config/nginx/dhparams.pem -L "https://lsio.ams3.digitaloceanspaces.com/dhparams.pem" 86 | fi 87 | if ! grep -q 'PARAMETERS' "/config/nginx/dhparams.pem"; then 88 | echo "Generating dhparams.pem. This will take a long time. Do not stop the container until this process is completed." 89 | openssl dhparam -out /config/nginx/dhparams.pem 4096 90 | fi 91 | 92 | # check to make sure DNSPLUGIN is selected if dns validation is used 93 | [[ "$VALIDATION" = "dns" ]] && [[ ! "$DNSPLUGIN" =~ ^(aliyun|cloudflare|cloudxns|cpanel|digitalocean|dnsimple|dnsmadeeasy|domeneshop|gandi|google|inwx|linode|luadns|nsone|ovh|rfc2136|route53|transip)$ ]] && \ 94 | echo "Please set the DNSPLUGIN variable to a valid plugin name. See docker info for more details." && \ 95 | sleep infinity 96 | 97 | # import user crontabs 98 | rm /etc/crontabs/* 99 | cp /config/crontabs/* /etc/crontabs/ 100 | 101 | # create original config file if it doesn't exist 102 | if [ ! -f "/config/donoteditthisfile.conf" ]; then 103 | echo -e "ORIGURL=\"$URL\" ORIGSUBDOMAINS=\"$SUBDOMAINS\" ORIGONLY_SUBDOMAINS=\"$ONLY_SUBDOMAINS\" ORIGEXTRA_DOMAINS=\"$EXTRA_DOMAINS\" ORIGVALIDATION=\"$VALIDATION\" ORIGDNSPLUGIN=\"$DNSPLUGIN\" ORIGPROPAGATION=\"$PROPAGATION\" ORIGSTAGING=\"$STAGING\" ORIGDUCKDNSTOKEN=\"$DUCKDNSTOKEN\"" > /config/donoteditthisfile.conf 104 | echo "Created donoteditthisfile.conf" 105 | fi 106 | 107 | # load original config settings 108 | # shellcheck disable=SC1091 109 | . /config/donoteditthisfile.conf 110 | 111 | # set default validation to http 112 | if [ -z "$VALIDATION" ]; then 113 | VALIDATION="http" 114 | echo "VALIDATION parameter not set; setting it to http" 115 | fi 116 | 117 | # if staging is set to true, use the staging server 118 | if [ "$STAGING" = "true" ]; then 119 | echo "NOTICE: Staging is active" 120 | ACMESERVER="https://acme-staging-v02.api.letsencrypt.org/directory" 121 | else 122 | ACMESERVER="https://acme-v02.api.letsencrypt.org/directory" 123 | fi 124 | 125 | # figuring out url only vs url & subdomains vs subdomains only 126 | if [ -n "$SUBDOMAINS" ]; then 127 | echo "SUBDOMAINS entered, processing" 128 | if [ "$SUBDOMAINS" = "wildcard" ]; then 129 | if [ "$ONLY_SUBDOMAINS" = true ]; then 130 | export URL_REAL="-d *.${URL}" 131 | echo "Wildcard cert for only the subdomains of $URL will be requested" 132 | else 133 | export URL_REAL="-d *.${URL} -d ${URL}" 134 | echo "Wildcard cert for $URL will be requested" 135 | fi 136 | else 137 | echo "SUBDOMAINS entered, processing" 138 | for job in $(echo "$SUBDOMAINS" | tr "," " "); do 139 | export SUBDOMAINS_REAL="$SUBDOMAINS_REAL -d ${job}.${URL}" 140 | done 141 | if [ "$ONLY_SUBDOMAINS" = true ]; then 142 | URL_REAL="$SUBDOMAINS_REAL" 143 | echo "Only subdomains, no URL in cert" 144 | else 145 | URL_REAL="-d ${URL}${SUBDOMAINS_REAL}" 146 | fi 147 | echo "Sub-domains processed are: $SUBDOMAINS_REAL" 148 | fi 149 | else 150 | echo "No subdomains defined" 151 | URL_REAL="-d $URL" 152 | fi 153 | 154 | # add extra domains 155 | if [ -n "$EXTRA_DOMAINS" ]; then 156 | echo "EXTRA_DOMAINS entered, processing" 157 | for job in $(echo "$EXTRA_DOMAINS" | tr "," " "); do 158 | export EXTRA_DOMAINS_REAL="$EXTRA_DOMAINS_REAL -d ${job}" 159 | done 160 | echo "Extra domains processed are: $EXTRA_DOMAINS_REAL" 161 | URL_REAL="$URL_REAL $EXTRA_DOMAINS_REAL" 162 | fi 163 | 164 | # figuring out whether to use e-mail and which 165 | if [[ $EMAIL == *@* ]]; then 166 | echo "E-mail address entered: ${EMAIL}" 167 | EMAILPARAM="-m ${EMAIL} --no-eff-email" 168 | else 169 | echo "No e-mail address entered or address invalid" 170 | EMAILPARAM="--register-unsafely-without-email" 171 | fi 172 | 173 | # setting the validation method to use 174 | if [ "$VALIDATION" = "dns" ]; then 175 | if [ "$DNSPLUGIN" = "route53" ]; then 176 | if [ -n "$PROPAGATION" ];then PROPAGATIONPARAM="--dns-${DNSPLUGIN}-propagation-seconds ${PROPAGATION}"; fi 177 | PREFCHAL="--dns-${DNSPLUGIN} ${PROPAGATIONPARAM} --manual-public-ip-logging-ok" 178 | elif [[ "$DNSPLUGIN" =~ ^(cpanel)$ ]]; then 179 | if [ -n "$PROPAGATION" ];then PROPAGATIONPARAM="--certbot-dns-${DNSPLUGIN}:${DNSPLUGIN}-propagation-seconds ${PROPAGATION}"; fi 180 | PREFCHAL="-a certbot-dns-${DNSPLUGIN}:${DNSPLUGIN} --certbot-dns-${DNSPLUGIN}:${DNSPLUGIN}-credentials /config/dns-conf/${DNSPLUGIN}.ini ${PROPAGATIONPARAM} --manual-public-ip-logging-ok" 181 | elif [[ "$DNSPLUGIN" =~ ^(gandi)$ ]]; then 182 | if [ -n "$PROPAGATION" ];then echo "Gandi dns plugin does not support setting propagation time"; fi 183 | PREFCHAL="-a certbot-plugin-${DNSPLUGIN}:dns --certbot-plugin-${DNSPLUGIN}:dns-credentials /config/dns-conf/${DNSPLUGIN}.ini --manual-public-ip-logging-ok" 184 | elif [[ "$DNSPLUGIN" =~ ^(google)$ ]]; then 185 | if [ -n "$PROPAGATION" ];then PROPAGATIONPARAM="--dns-${DNSPLUGIN}-propagation-seconds ${PROPAGATION}"; fi 186 | PREFCHAL="--dns-${DNSPLUGIN} --dns-${DNSPLUGIN}-credentials /config/dns-conf/${DNSPLUGIN}.json ${PROPAGATIONPARAM} --manual-public-ip-logging-ok" 187 | elif [[ "$DNSPLUGIN" =~ ^(aliyun|domeneshop|inwx|transip)$ ]]; then 188 | if [ -n "$PROPAGATION" ];then PROPAGATIONPARAM="--certbot-dns-${DNSPLUGIN}:dns-${DNSPLUGIN}-propagation-seconds ${PROPAGATION}"; fi 189 | PREFCHAL="-a certbot-dns-${DNSPLUGIN}:dns-${DNSPLUGIN} --certbot-dns-${DNSPLUGIN}:dns-${DNSPLUGIN}-credentials /config/dns-conf/${DNSPLUGIN}.ini ${PROPAGATIONPARAM} --manual-public-ip-logging-ok" 190 | else 191 | if [ -n "$PROPAGATION" ];then PROPAGATIONPARAM="--dns-${DNSPLUGIN}-propagation-seconds ${PROPAGATION}"; fi 192 | PREFCHAL="--dns-${DNSPLUGIN} --dns-${DNSPLUGIN}-credentials /config/dns-conf/${DNSPLUGIN}.ini ${PROPAGATIONPARAM} --manual-public-ip-logging-ok" 193 | fi 194 | echo "${VALIDATION} validation via ${DNSPLUGIN} plugin is selected" 195 | elif [ "$VALIDATION" = "tls-sni" ]; then 196 | PREFCHAL="--non-interactive --standalone --preferred-challenges http" 197 | echo "*****tls-sni validation has been deprecated, attempting http validation instead" 198 | elif [ "$VALIDATION" = "duckdns" ]; then 199 | PREFCHAL="--non-interactive --manual --preferred-challenges dns --manual-public-ip-logging-ok --manual-auth-hook /app/duckdns-txt" 200 | chmod +x /app/duckdns-txt 201 | echo "duckdns validation is selected" 202 | if [ "$SUBDOMAINS" = "wildcard" ]; then 203 | echo "the resulting certificate will only cover the subdomains due to a limitation of duckdns, so it is advised to set the root location to use www.subdomain.duckdns.org" 204 | export URL_REAL="-d *.${URL}" 205 | else 206 | echo "the resulting certificate will only cover the main domain due to a limitation of duckdns, ie. subdomain.duckdns.org" 207 | export URL_REAL="-d ${URL}" 208 | fi 209 | else 210 | PREFCHAL="--non-interactive --standalone --preferred-challenges http" 211 | echo "http validation is selected" 212 | fi 213 | 214 | # setting the symlink for key location 215 | rm -rf /config/keys/letsencrypt 216 | if [ "$ONLY_SUBDOMAINS" = "true" ] && [ ! "$SUBDOMAINS" = "wildcard" ] ; then 217 | DOMAIN="$(echo "$SUBDOMAINS" | tr ',' ' ' | awk '{print $1}').${URL}" 218 | ln -s ../etc/letsencrypt/live/"$DOMAIN" /config/keys/letsencrypt 219 | else 220 | ln -s ../etc/letsencrypt/live/"$URL" /config/keys/letsencrypt 221 | fi 222 | 223 | # checking for changes in cert variables, revoking certs if necessary 224 | if [ ! "$URL" = "$ORIGURL" ] || [ ! "$SUBDOMAINS" = "$ORIGSUBDOMAINS" ] || [ ! "$ONLY_SUBDOMAINS" = "$ORIGONLY_SUBDOMAINS" ] || [ ! "$EXTRA_DOMAINS" = "$ORIGEXTRA_DOMAINS" ] || [ ! "$VALIDATION" = "$ORIGVALIDATION" ] || [ ! "$DNSPLUGIN" = "$ORIGDNSPLUGIN" ] || [ ! "$PROPAGATION" = "$ORIGPROPAGATION" ] || [ ! "$STAGING" = "$ORIGSTAGING" ] || [ ! "$DUCKDNSTOKEN" = "$ORIGDUCKDNSTOKEN" ]; then 225 | echo "Different validation parameters entered than what was used before. Revoking and deleting existing certificate, and an updated one will be created" 226 | if [ "$ORIGONLY_SUBDOMAINS" = "true" ] && [ ! "$ORIGSUBDOMAINS" = "wildcard" ]; then 227 | ORIGDOMAIN="$(echo "$ORIGSUBDOMAINS" | tr ',' ' ' | awk '{print $1}').${ORIGURL}" 228 | [[ -f /config/etc/letsencrypt/live/"$ORIGDOMAIN"/fullchain.pem ]] && certbot revoke --non-interactive --cert-path /config/etc/letsencrypt/live/"$ORIGDOMAIN"/fullchain.pem 229 | else 230 | [[ -f /config/etc/letsencrypt/live/"$ORIGURL"/fullchain.pem ]] && certbot revoke --non-interactive --cert-path /config/etc/letsencrypt/live/"$ORIGURL"/fullchain.pem 231 | fi 232 | rm -rf /config/etc 233 | mkdir -p /config/etc/letsencrypt 234 | fi 235 | 236 | # saving new variables 237 | echo -e "ORIGURL=\"$URL\" ORIGSUBDOMAINS=\"$SUBDOMAINS\" ORIGONLY_SUBDOMAINS=\"$ONLY_SUBDOMAINS\" ORIGEXTRA_DOMAINS=\"$EXTRA_DOMAINS\" ORIGVALIDATION=\"$VALIDATION\" ORIGDNSPLUGIN=\"$DNSPLUGIN\" ORIGPROPAGATION=\"$PROPAGATION\" ORIGSTAGING=\"$STAGING\" ORIGDUCKDNSTOKEN=\"$DUCKDNSTOKEN\"" > /config/donoteditthisfile.conf 238 | 239 | # alter extension for error message 240 | if [ "$DNSPLUGIN" = "google" ]; then 241 | FILENAME="$DNSPLUGIN.json" 242 | else 243 | FILENAME="$DNSPLUGIN.ini" 244 | fi 245 | 246 | # generating certs if necessary 247 | if [ ! -f "/config/keys/letsencrypt/fullchain.pem" ]; then 248 | echo "Generating new certificate" 249 | # shellcheck disable=SC2086 250 | certbot certonly --renew-by-default --server $ACMESERVER $PREFCHAL --rsa-key-size 4096 $EMAILPARAM --agree-tos $URL_REAL 251 | if [ -d /config/keys/letsencrypt ]; then 252 | cd /config/keys/letsencrypt || exit 253 | else 254 | if [ "$VALIDATION" = "dns" ]; then 255 | echo "ERROR: Cert does not exist! Please see the validation error above. Make sure you entered correct credentials into the /config/dns-conf/${FILENAME} file." 256 | elif [ "$VALIDATION" = "duckdns" ]; then 257 | echo "ERROR: Cert does not exist! Please see the validation error above. Make sure your DUCKDNSTOKEN is correct." 258 | else 259 | echo "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" 260 | fi 261 | sleep infinity 262 | fi 263 | openssl pkcs12 -export -out privkey.pfx -inkey privkey.pem -in cert.pem -certfile chain.pem -passout pass: 264 | sleep 1 265 | cat {privkey,fullchain}.pem > priv-fullchain-bundle.pem 266 | echo "New certificate generated; starting nginx" 267 | else 268 | echo "Certificate exists; parameters unchanged; starting nginx" 269 | fi 270 | 271 | # create GeoIP2 folder symlink 272 | [[ -d /var/lib/libmaxminddb ]] && [[ ! -L /var/lib/libmaxminddb ]] && \ 273 | rm -rf /var/lib/libmaxminddb 274 | [[ ! -d /var/lib/libmaxminddb ]] && \ 275 | ln -s /config/geoip2db /var/lib/libmaxminddb 276 | # check GeoIP2 database 277 | if [ -n "$MAXMINDDB_LICENSE_KEY" ]; then 278 | sed -i "s|.*MAXMINDDB_LICENSE_KEY.*|MAXMINDDB_LICENSE_KEY=\"${MAXMINDDB_LICENSE_KEY}\"|g" /etc/conf.d/libmaxminddb 279 | if [ ! -f /var/lib/libmaxminddb/GeoLite2-City.mmdb ]; then 280 | echo "Downloading GeoIP2 City database." 281 | /etc/periodic/weekly/libmaxminddb 282 | fi 283 | elif [ -f /var/lib/libmaxminddb/GeoLite2-City.mmdb ]; then 284 | echo -e "Currently using the user provided GeoLite2-City.mmdb.\nIf you want to enable weekly auto-updates of the database, retrieve a free license key from MaxMind,\nand add a new env variable \"MAXMINDDB_LICENSE_KEY\", set to your license key." 285 | else 286 | echo -e "Starting 2019/12/30, GeoIP2 databases require personal license key to download. Please retrieve a free license key from MaxMind,\nand add a new env variable \"MAXMINDDB_LICENSE_KEY\", set to your license key." 287 | fi 288 | 289 | # logfiles needed by fail2ban 290 | [[ ! -f /config/log/nginx/error.log ]] && \ 291 | touch /config/log/nginx/error.log 292 | [[ ! -f /config/log/nginx/access.log ]] && \ 293 | touch /config/log/nginx/access.log 294 | 295 | # permissions 296 | chown -R abc:abc \ 297 | /config 298 | chmod -R 0644 /etc/logrotate.d 299 | chmod -R +r /config/log 300 | chmod +x /app/le-renew.sh 301 | chmod 700 /defaults/dns-conf 302 | chmod 600 /defaults/dns-conf/* 303 | -------------------------------------------------------------------------------- /root/etc/cont-init.d/60-renew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/with-contenv bash 2 | 3 | # Check if the cert is expired or expires within a day, if so, renew 4 | if openssl x509 -in /config/keys/letsencrypt/fullchain.pem -noout -checkend 86400 >/dev/null; then 5 | echo "The cert does not expire within the next day. Letting the cron script handle the renewal attempts overnight (2:08am)." 6 | else 7 | echo "The cert is either expired or it expires within the next day. Attempting to renew. This could take up to 10 minutes." 8 | /app/le-renew.sh 9 | sleep 1 10 | fi -------------------------------------------------------------------------------- /root/etc/cont-init.d/90-config: -------------------------------------------------------------------------------- 1 | #!/usr/bin/with-contenv bash 2 | 3 | echo ' 4 | ****************************************************** 5 | ****************************************************** 6 | * * 7 | * * 8 | * This image has been deprecated * 9 | * * 10 | * Use the new image at * 11 | * * 12 | * linuxserver/swag * 13 | * * 14 | * https://hub.docker.com/r/linuxserver/swag * 15 | * * 16 | * https://github.com/linuxserver/docker-swag * 17 | * * 18 | * * 19 | * * 20 | ****************************************************** 21 | ******************************************************' -------------------------------------------------------------------------------- /root/etc/crontabs/root: -------------------------------------------------------------------------------- 1 | # do daily/weekly/monthly maintenance 2 | # min hour day month weekday command 3 | */15 * * * * run-parts /etc/periodic/15min 4 | 0 * * * * run-parts /etc/periodic/hourly 5 | 0 2 * * * run-parts /etc/periodic/daily 6 | 0 3 * * 6 run-parts /etc/periodic/weekly 7 | 0 5 1 * * run-parts /etc/periodic/monthly 8 | # renew letsencrypt certs 9 | 8 2 * * * /app/le-renew.sh >> /config/log/letsencrypt/letsencrypt.log 2>&1 10 | -------------------------------------------------------------------------------- /root/etc/logrotate.d/fail2ban: -------------------------------------------------------------------------------- 1 | /config/log/fail2ban/fail2ban.log { 2 | weekly 3 | rotate 7 4 | missingok 5 | compress 6 | delaycompress 7 | nodateext 8 | postrotate 9 | /usr/bin/fail2ban-client flushlogs 1>/dev/null || true 10 | endscript 11 | su abc abc 12 | } 13 | -------------------------------------------------------------------------------- /root/etc/logrotate.d/lerotate: -------------------------------------------------------------------------------- 1 | /config/log/letsencrypt/*.log { 2 | weekly 3 | rotate 52 4 | compress 5 | delaycompress 6 | nodateext 7 | missingok 8 | notifempty 9 | sharedscripts 10 | su abc abc 11 | } 12 | -------------------------------------------------------------------------------- /root/etc/services.d/fail2ban/run: -------------------------------------------------------------------------------- 1 | #!/usr/bin/with-contenv bash 2 | 3 | exec \ 4 | fail2ban-client -x -f start 5 | --------------------------------------------------------------------------------