kchristensen / udm-le

Let's Encrypt support for Ubiquiti UniFi OS
MIT License
572 stars 79 forks source link

[BUG] : not found: /mnt/data/udm-le/udm-le.env: line 4: #42

Closed kb9gxk closed 2 years ago

kb9gxk commented 2 years ago

trying to run the initial setup and get the error: : not found: /mnt/data/udm-le/udm-le.env: line 4:

UniFi OS UDM Pro 1.11.0-14

kb9gxk commented 2 years ago

Fixed issue by editing udm-le.env to remove blank lines.

#

Required configuration

#

Email for LetsEncrypt certificate issuance

CERT_EMAIL='your@email.com'

The FQDN of your UDMP (comma separated fqdns are supported)

CERT_HOSTS='whatever.hostname.com,*.whatever.anotherhostname.com'

Enable updating Captive Portal certificate as well as device certificate

ENABLE_CAPTIVE='no' #

DNS provider configuration

See README.md file for more details

#

AWS Route53

DNS_PROVIDER='route53'

Azure

DNS_PROVIDER='azure'

AZURE_CLIENT_ID=

AZURE_CLIENT_SECRET_FILE=/root/.secrets/client-secret.txt

AZURE_ENVIRONMENT=public

AZURE_RESOURCE_GROUP=udm-le

AZURE_SUBSCRIPTION_ID=00000000-0000-0000-0000-000000000000

AZURE_TENANT_ID=

CloudFlare

Note: Quoting your CLOUDFLARE_DNS_API_TOKEN below seems to cause issues

DNS_PROVIDER='cloudflare' CLOUDFLARE_DNS_API_TOKEN=YOUR_CLOUDFLARE_API_TOKEN

Digital Ocean

Note: Quoting your DO_AUTH_TOKEN below seems to cause issues

DNS_PROVIDER='digitalocean'

DO_AUTH_TOKEN=AUTH_TOKEN

DuckDNS

DNS_PROVIDER='duckdns'

DUCKDNS_TOKEN=AUTH_TOKEN

Google Cloud DNS

Note: The default path for the service account file is /root/.secrets

DNS_PROVIDER='gcloud'

GCE_SERVICE_ACCOUNT_FILE=/root/.secrets/sa.json

GCE_PROPAGATION_TIMEOUT=3600

#

Change stuff below at your own risk

#

Container Image configuration

CONTAINER_IMAGE="docker.io/goacme/lego" CONTAINER_IMAGE_TAG="v4.4.0-arm.v8"

DNS_RESOLVERS supports a host:port if you need to override system DNS

DNS_RESOLVERS=''

Changing below requires changing line 6 of udm-le.sh

UDM_LE_PATH='/mnt/data/udm-le'

These should only change if Unifi-OS core changes require it

CERT_IMPORT_CMD='java -jar /usr/lib/unifi/lib/ace.jar import_key_cert' UBIOS_CERT_PATH='/mnt/data/unifi-os/unifi-core/config' UNIFIOS_CERT_PATH='/data/unifi-core/config'

kchristensen commented 2 years ago

That's odd, the blank lines shouldn't cause any issues. Can you show me the full output from your initial run if you have it?

kb9gxk commented 2 years ago

/mnt/data/udm-le/udm-le.sh initial

: not founddm-le/udm-le.sh: /mnt/data/udm-le/udm-le.env: line 4:

After removing the blank lines:

./udm-le.sh initial

stat: can't stat '/mnt/data/udm-le/lego': No such file or directory Attempting initial certificate generation Trying to pull docker.io/goacme/lego:v4.4.0-arm.v8... Getting image source signatures Copying blob 595b0fe564bb done Copying blob a57f83eb81af done Copying blob b9777d26d1b8 done Copying blob 7a6ed3024318 done Copying config 1135c62542 done Writing manifest to image destination Storing signatures 2021/09/13 14:10:05 No key found for account @.**@.>. Generating a 2048 key. 2021/09/13 14:10:06 Saved key to @.**@*.**@*.**@.> 2021/09/13 14:10:06 [INFO] acme: Registering account for @.**@.> !!!! HEADS UP !!!!

Your account credentials have been saved in your Let's Encrypt configuration directory at "/.lego/accounts".

You should make a secure backup of this folder now. This configuration directory will also contain certificates and private keys obtained from Let's Encrypt so making regular backups of this folder is ideal. 2021/09/13 14:10:07 [INFO] [router.btwaukegan.us, camera.btwaukegan.us] acme: Obtaining bundled SAN certificate 2021/09/13 14:10:10 [INFO] [camera.btwaukegan.us] AuthURL: https://acme-v02.api.letsencrypt.org/acme/authz-v3/30574715080 2021/09/13 14:10:10 [INFO] [router.btwaukegan.us] AuthURL: https://acme-v02.api.letsencrypt.org/acme/authz-v3/30574715090 2021/09/13 14:10:10 [INFO] [camera.btwaukegan.us] acme: Could not find solver for: tls-alpn-01 2021/09/13 14:10:10 [INFO] [camera.btwaukegan.us] acme: Could not find solver for: http-01 2021/09/13 14:10:10 [INFO] [camera.btwaukegan.us] acme: use dns-01 solver 2021/09/13 14:10:10 [INFO] [router.btwaukegan.us] acme: Could not find solver for: tls-alpn-01 2021/09/13 14:10:10 [INFO] [router.btwaukegan.us] acme: Could not find solver for: http-01 2021/09/13 14:10:10 [INFO] [router.btwaukegan.us] acme: use dns-01 solver 2021/09/13 14:10:10 [INFO] [camera.btwaukegan.us] acme: Preparing to solve DNS-01 2021/09/13 14:10:11 [INFO] cloudflare: new record for camera.btwaukegan.us, ID 4c0a2149748d14ced744f2e2f3f06716 2021/09/13 14:10:11 [INFO] [router.btwaukegan.us] acme: Preparing to solve DNS-01 2021/09/13 14:10:11 [INFO] cloudflare: new record for router.btwaukegan.us, ID 53e649011734e4e725321a0c31b15586 2021/09/13 14:10:11 [INFO] [camera.btwaukegan.us] acme: Trying to solve DNS-01 2021/09/13 14:10:11 [INFO] [camera.btwaukegan.us] acme: Checking DNS record propagation using [127.0.0.1:53] 2021/09/13 14:10:13 [INFO] Wait for propagation [timeout: 2m0s, interval: 2s] 2021/09/13 14:10:15 [INFO] [camera.btwaukegan.us] The server validated our request 2021/09/13 14:10:15 [INFO] [router.btwaukegan.us] acme: Trying to solve DNS-01 2021/09/13 14:10:15 [INFO] [router.btwaukegan.us] acme: Checking DNS record propagation using [127.0.0.1:53] 2021/09/13 14:10:17 [INFO] Wait for propagation [timeout: 2m0s, interval: 2s] 2021/09/13 14:10:19 [INFO] [router.btwaukegan.us] The server validated our request 2021/09/13 14:10:19 [INFO] [camera.btwaukegan.us] acme: Cleaning DNS-01 challenge 2021/09/13 14:10:19 [INFO] [router.btwaukegan.us] acme: Cleaning DNS-01 challenge 2021/09/13 14:10:19 [INFO] [router.btwaukegan.us, camera.btwaukegan.us] acme: Validations succeeded; requesting certificates 2021/09/13 14:10:24 [INFO] [router.btwaukegan.us] Server responded with a certificate. New certificate was generated, time to deploy it

From: Kyle Christensen @.> Sent: Monday, September 13, 2021 09:24 To: kchristensen/udm-le @.> Cc: Jeff Parrish-Personal @.>; Author @.> Subject: Re: [kchristensen/udm-le] [BUG] : not found: /mnt/data/udm-le/udm-le.env: line 4: (#42)

That's odd, the blank lines shouldn't cause any issues. Can you show me the full output from your initial run if you have it?

- You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fkchristensen%2Fudm-le%2Fissues%2F42%23issuecomment-918246820&data=04%7C01%7C%7Cddcf52a01c2f47815ce808d976c2328e%7C588e7ff7c9504c619cf768e3b34dab4b%7C1%7C0%7C637671398728543017%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=DN8RXbtmnuceunyg3j7YD8MXwzF60laOiAUQ7vW9568%3D&reserved=0, or unsubscribehttps://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAOE6OX3ZSVFI3H66VCPFQWDUBYCR3ANCNFSM5D5466XQ&data=04%7C01%7C%7Cddcf52a01c2f47815ce808d976c2328e%7C588e7ff7c9504c619cf768e3b34dab4b%7C1%7C0%7C637671398728552970%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=8XOR1TBauhaRmJRsgiTx7OvNjgX1Nw8D2CvywPNZHJY%3D&reserved=0. Triage notifications on the go with GitHub Mobile for iOShttps://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fapps.apple.com%2Fapp%2Fapple-store%2Fid1477376905%3Fct%3Dnotification-email%26mt%3D8%26pt%3D524675&data=04%7C01%7C%7Cddcf52a01c2f47815ce808d976c2328e%7C588e7ff7c9504c619cf768e3b34dab4b%7C1%7C0%7C637671398728552970%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=r3V7voa4ukqY16xoAUIEL5AMHJy9hmiM8KRkPN%2Fxbe8%3D&reserved=0 or Androidhttps://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fplay.google.com%2Fstore%2Fapps%2Fdetails%3Fid%3Dcom.github.android%26referrer%3Dutm_campaign%253Dnotification-email%2526utm_medium%253Demail%2526utm_source%253Dgithub&data=04%7C01%7C%7Cddcf52a01c2f47815ce808d976c2328e%7C588e7ff7c9504c619cf768e3b34dab4b%7C1%7C0%7C637671398728562926%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=nhjveGbtJSbWw6Cdh8Xc3gMUMuXe7TLQ8hAcWPpKqzI%3D&reserved=0.

kchristensen commented 2 years ago

Yeah I think you have some kind of copy/paste issue going on, I have lots of blank lines in my env file:

# grep -Ec "^$" /mnt/data/udm-le/udm-le.env
10

# /mnt/data/udm-le/udm-le.sh initial
Attempting initial certificate generation
...
hoopsomuah commented 2 years ago

I ran into this issue, the blank lines also had CRLF line endings which I had to remove

kchristensen commented 2 years ago

Hm, that's interesting. I'll experiment when I have a second to see if there's an elegant way to catch this error or at the very least make note of it in the README.md.

Thanks!