Skip to content

Conversation

@coreyramirezgomez
Copy link
Contributor

@coreyramirezgomez coreyramirezgomez commented Aug 10, 2022

linuxserver.io


  • I have read the contributing guideline and understand that I have made the correct modifications

Description:

Benefits of this PR and context:

Allow other users with Dynu Dynamic DNS service to utilize this container for their own environments and use cases.

How Has This Been Tested?

sudo docker build --no-cache --pull -t linuxserver/swag:latest .

compose file:

version: "2.1"
networks:
  default:
    name: proxynet
services:
  nginx:
    image: [IMAGE ID of build]
    container_name: swag
    hostname: swag
    cap_add:
      - NET_ADMIN
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=America/Los_Angeles
      - URL=DOMAIN
      - VALIDATION=dns
      - SUBDOMAINS=test
      - DNSPLUGIN=dynu
      - PROPAGATION=120
      - EMAIL=[REDACTED]
      - ONLY_SUBDOMAINS=true
      - STAGING=true
    volumes:
      - /usr/docker/data/swag/config:/config:rw
    ports:
      - 80:80
      - 443:443
    restart: unless-stopped
docker-compose up -d

Certificates generated as expected.
stdout of docker-compose up -d:
stdout (from swag container):

Aug 11 21:01:50 blackmesa docker-compose[79840]: Attaching to swag
Aug 11 21:01:52 blackmesa docker-compose[79840]: swag  | s6-rc: info: service s6rc-oneshot-runner: starting
Aug 11 21:01:52 blackmesa docker-compose[79840]: swag  | s6-rc: info: service s6rc-oneshot-runner successfully started
Aug 11 21:01:52 blackmesa docker-compose[79840]: swag  | s6-rc: info: service fix-attrs: starting
Aug 11 21:01:52 blackmesa docker-compose[79840]: swag  | s6-rc: info: service 00-legacy: starting
Aug 11 21:01:52 blackmesa docker-compose[79840]: swag  | s6-rc: info: service 00-legacy successfully started
Aug 11 21:01:52 blackmesa docker-compose[79840]: swag  | s6-rc: info: service fix-attrs successfully started
Aug 11 21:01:52 blackmesa docker-compose[79840]: swag  | s6-rc: info: service legacy-cont-init: starting
Aug 11 21:01:52 blackmesa docker-compose[79840]: swag  | cont-init: info: running /etc/cont-init.d/01-envfile
Aug 11 21:01:52 blackmesa docker-compose[79840]: swag  | cont-init: info: /etc/cont-init.d/01-envfile exited 0
Aug 11 21:01:52 blackmesa docker-compose[79840]: swag  | cont-init: info: running /etc/cont-init.d/02-tamper-check
Aug 11 21:01:52 blackmesa docker-compose[79840]: swag  | cont-init: info: /etc/cont-init.d/02-tamper-check exited 0
Aug 11 21:01:52 blackmesa docker-compose[79840]: swag  | cont-init: info: running /etc/cont-init.d/10-adduser
Aug 11 21:01:53 blackmesa docker-compose[79840]: swag  |
Aug 11 21:01:53 blackmesa docker-compose[79840]: swag  | -------------------------------------
Aug 11 21:01:53 blackmesa docker-compose[79840]: swag  |           _         ()
Aug 11 21:01:53 blackmesa docker-compose[79840]: swag  |          | |  ___   _    __
Aug 11 21:01:53 blackmesa docker-compose[79840]: swag  |          | | / __| | |  /  \
Aug 11 21:01:53 blackmesa docker-compose[79840]: swag  |          | | \__ \ | | | () |
Aug 11 21:01:53 blackmesa docker-compose[79840]: swag  |          |_| |___/ |_|  \__/
Aug 11 21:01:53 blackmesa docker-compose[79840]: swag  |
Aug 11 21:01:53 blackmesa docker-compose[79840]: swag  |
Aug 11 21:01:53 blackmesa docker-compose[79840]: swag  | Brought to you by linuxserver.io
Aug 11 21:01:53 blackmesa docker-compose[79840]: swag  | -------------------------------------
Aug 11 21:01:53 blackmesa docker-compose[79840]: swag  |
Aug 11 21:01:53 blackmesa docker-compose[79840]: swag  | To support the app dev(s) visit:
Aug 11 21:01:53 blackmesa docker-compose[79840]: swag  | Certbot: https://supporters.eff.org/donate/support-work-on-certbot
Aug 11 21:01:53 blackmesa docker-compose[79840]: swag  |
Aug 11 21:01:53 blackmesa docker-compose[79840]: swag  | To support LSIO projects visit:
Aug 11 21:01:53 blackmesa docker-compose[79840]: swag  | https://www.linuxserver.io/donate/
Aug 11 21:01:53 blackmesa docker-compose[79840]: swag  | -------------------------------------
Aug 11 21:01:53 blackmesa docker-compose[79840]: swag  | GID/UID
Aug 11 21:01:53 blackmesa docker-compose[79840]: swag  | -------------------------------------
Aug 11 21:01:53 blackmesa docker-compose[79840]: swag  |
Aug 11 21:01:53 blackmesa docker-compose[79840]: swag  | User uid:    1000
Aug 11 21:01:53 blackmesa docker-compose[79840]: swag  | User gid:    1000
Aug 11 21:01:53 blackmesa docker-compose[79840]: swag  | -------------------------------------
Aug 11 21:01:53 blackmesa docker-compose[79840]: swag  |
Aug 11 21:01:53 blackmesa docker-compose[79840]: swag  | cont-init: info: /etc/cont-init.d/10-adduser exited 0
Aug 11 21:01:53 blackmesa docker-compose[79840]: swag  | cont-init: info: running /etc/cont-init.d/20-config
Aug 11 21:01:53 blackmesa docker-compose[79840]: swag  | cont-init: info: /etc/cont-init.d/20-config exited 0
Aug 11 21:01:53 blackmesa docker-compose[79840]: swag  | cont-init: info: running /etc/cont-init.d/30-keygen
Aug 11 21:01:53 blackmesa docker-compose[79840]: swag  | using keys found in /config/keys
Aug 11 21:01:53 blackmesa docker-compose[79840]: swag  | cont-init: info: /etc/cont-init.d/30-keygen exited 0
Aug 11 21:01:53 blackmesa docker-compose[79840]: swag  | cont-init: info: running /etc/cont-init.d/50-config
Aug 11 21:01:53 blackmesa docker-compose[79840]: swag  | Variables set:
Aug 11 21:01:53 blackmesa docker-compose[79840]: swag  | PUID=1000
Aug 11 21:01:53 blackmesa docker-compose[79840]: swag  | PGID=1000
Aug 11 21:01:53 blackmesa docker-compose[79840]: swag  | TZ=America/Los_Angeles
Aug 11 21:01:53 blackmesa docker-compose[79840]: swag  | URL=DOMAIN
Aug 11 21:01:53 blackmesa docker-compose[79840]: swag  | SUBDOMAINS=test
Aug 11 21:01:53 blackmesa docker-compose[79840]: swag  | EXTRA_DOMAINS=
Aug 11 21:01:53 blackmesa docker-compose[79840]: swag  | ONLY_SUBDOMAINS=true
Aug 11 21:01:53 blackmesa docker-compose[79840]: swag  | VALIDATION=dns
Aug 11 21:01:53 blackmesa docker-compose[79840]: swag  | CERTPROVIDER=
Aug 11 21:01:53 blackmesa docker-compose[79840]: swag  | DNSPLUGIN=dynu
Aug 11 21:01:53 blackmesa docker-compose[79840]: swag  | EMAIL=[REDACTED]
Aug 11 21:01:53 blackmesa docker-compose[79840]: swag  | STAGING=true
Aug 11 21:01:53 blackmesa docker-compose[79840]: swag  |
Aug 11 21:01:53 blackmesa docker-compose[79840]: swag  | NOTICE: Staging is active
Aug 11 21:01:53 blackmesa docker-compose[79840]: swag  | Using Let's Encrypt as the cert provider
Aug 11 21:01:53 blackmesa docker-compose[79840]: swag  | SUBDOMAINS entered, processing
Aug 11 21:01:53 blackmesa docker-compose[79840]: swag  | SUBDOMAINS entered, processing
Aug 11 21:01:53 blackmesa docker-compose[79840]: swag  | Only subdomains, no URL in cert
Aug 11 21:01:53 blackmesa docker-compose[79840]: swag  | Sub-domains processed are:  -d test.DOMAIN
Aug 11 21:01:53 blackmesa docker-compose[79840]: swag  | E-mail address entered: [REDACTED]
Aug 11 21:01:53 blackmesa docker-compose[79840]: swag  | dns validation via dynu plugin is selected
Aug 11 21:01:53 blackmesa docker-compose[79840]: swag  | Generating new certificate
Aug 11 21:01:57 blackmesa docker-compose[79840]: swag  | Saving debug log to /var/log/letsencrypt/letsencrypt.log
Aug 11 21:01:57 blackmesa docker-compose[79840]: swag  | Requesting a certificate for test.DOMAIN
Aug 11 21:02:00 blackmesa docker-compose[79840]: swag  | Waiting 120 seconds for DNS changes to propagate
Aug 11 21:04:12 blackmesa docker-compose[79840]: swag  |
Aug 11 21:04:12 blackmesa docker-compose[79840]: swag  | Successfully received certificate.
Aug 11 21:04:12 blackmesa docker-compose[79840]: swag  | Certificate is saved at: /etc/letsencrypt/live/test.DOMAIN/fullchain.pem
Aug 11 21:04:12 blackmesa docker-compose[79840]: swag  | Key is saved at:         /etc/letsencrypt/live/test.DOMAIN/privkey.pem
Aug 11 21:04:12 blackmesa docker-compose[79840]: swag  | This certificate expires on 2022-11-09.
Aug 11 21:04:12 blackmesa docker-compose[79840]: swag  | These files will be updated when the certificate renews.
Aug 11 21:04:12 blackmesa docker-compose[79840]: swag  | NEXT STEPS:
Aug 11 21:04:12 blackmesa docker-compose[79840]: swag  | - The certificate will need to be renewed before it expires. Certbot can automatically renew the certificate in the background, but you may need to take steps to enable that functionality. See https://certbot.org/renewal-setup for instructions.
Aug 11 21:04:12 blackmesa docker-compose[79840]: swag  |
Aug 11 21:04:12 blackmesa docker-compose[79840]: swag  | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Aug 11 21:04:12 blackmesa docker-compose[79840]: swag  | If you like Certbot, please consider supporting our work by:
Aug 11 21:04:12 blackmesa docker-compose[79840]: swag  |  * Donating to ISRG / Let's Encrypt:   https://letsencrypt.org/donate
Aug 11 21:04:12 blackmesa docker-compose[79840]: swag  |  * Donating to EFF:                    https://eff.org/donate-le
Aug 11 21:04:12 blackmesa docker-compose[79840]: swag  | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Aug 11 21:04:13 blackmesa docker-compose[79840]: swag  | New certificate generated; starting nginx
Aug 11 21:04:14 blackmesa docker-compose[79840]: swag  | cont-init: info: /etc/cont-init.d/50-config exited 0
Aug 11 21:04:14 blackmesa docker-compose[79840]: swag  | cont-init: info: running /etc/cont-init.d/60-renew
Aug 11 21:04:14 blackmesa docker-compose[79840]: swag  | The cert does not expire within the next day. Letting the cron script handle the renewal attempts overnight (2:08am).
Aug 11 21:04:14 blackmesa docker-compose[79840]: swag  | cont-init: info: /etc/cont-init.d/60-renew exited 0
Aug 11 21:04:14 blackmesa docker-compose[79840]: swag  | cont-init: info: running /etc/cont-init.d/70-templates
Aug 11 21:04:14 blackmesa docker-compose[79840]: swag  | cont-init: info: /etc/cont-init.d/70-templates exited 0
Aug 11 21:04:14 blackmesa docker-compose[79840]: swag  | cont-init: info: running /etc/cont-init.d/90-custom-folders
Aug 11 21:04:14 blackmesa docker-compose[79840]: swag  | cont-init: info: /etc/cont-init.d/90-custom-folders exited 0
Aug 11 21:04:14 blackmesa docker-compose[79840]: swag  | cont-init: info: running /etc/cont-init.d/99-custom-files
Aug 11 21:04:14 blackmesa docker-compose[79840]: swag  | [custom-init] no custom files found exiting...
Aug 11 21:04:14 blackmesa docker-compose[79840]: swag  | cont-init: info: /etc/cont-init.d/99-custom-files exited 0
Aug 11 21:04:14 blackmesa docker-compose[79840]: swag  | s6-rc: info: service legacy-cont-init successfully started
Aug 11 21:04:14 blackmesa docker-compose[79840]: swag  | s6-rc: info: service init-mods: starting
Aug 11 21:04:14 blackmesa docker-compose[79840]: swag  | s6-rc: info: service init-mods successfully started
Aug 11 21:04:14 blackmesa docker-compose[79840]: swag  | s6-rc: info: service init-mods-package-install: starting
Aug 11 21:04:14 blackmesa docker-compose[79840]: swag  | s6-rc: info: service init-mods-package-install successfully started
Aug 11 21:04:14 blackmesa docker-compose[79840]: swag  | s6-rc: info: service init-mods-end: starting
Aug 11 21:04:14 blackmesa docker-compose[79840]: swag  | s6-rc: info: service init-mods-end successfully started
Aug 11 21:04:14 blackmesa docker-compose[79840]: swag  | s6-rc: info: service init-services: starting
Aug 11 21:04:14 blackmesa docker-compose[79840]: swag  | s6-rc: info: service init-services successfully started
Aug 11 21:04:14 blackmesa docker-compose[79840]: swag  | s6-rc: info: service legacy-services: starting
Aug 11 21:04:14 blackmesa docker-compose[79840]: swag  | services-up: info: copying legacy longrun cron (no readiness notification)
Aug 11 21:04:14 blackmesa docker-compose[79840]: swag  | services-up: info: copying legacy longrun fail2ban (no readiness notification)
Aug 11 21:04:14 blackmesa docker-compose[79840]: swag  | services-up: info: copying legacy longrun nginx (no readiness notification)
Aug 11 21:04:14 blackmesa docker-compose[79840]: swag  | services-up: info: copying legacy longrun php-fpm (no readiness notification)
Aug 11 21:04:14 blackmesa docker-compose[79840]: swag  | s6-rc: info: service legacy-services successfully started
Aug 11 21:04:14 blackmesa docker-compose[79840]: swag  | s6-rc: info: service 99-ci-service-check: starting
Aug 11 21:04:14 blackmesa docker-compose[79840]: swag  | [ls.io-init] done.
Aug 11 21:04:14 blackmesa docker-compose[79840]: swag  | s6-rc: info: service 99-ci-service-check successfully started
Aug 11 21:04:14 blackmesa docker-compose[79840]: swag  | Server ready

Source / References:

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for opening this pull request! Be sure to follow the pull request template!

@LinuxServer-CI
Copy link
Contributor

@LinuxServer-CI
Copy link
Contributor

@coreyramirezgomez coreyramirezgomez marked this pull request as ready for review August 11, 2022 21:47
@thespad thespad merged commit f8ee44c into linuxserver:master Aug 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants