alxwolf / ubios-cert

Manage SSL / TLS certificates with acme.sh (Let's Encrypt, ZeroSSL) for Ubiquiti UbiOS firmwares
MIT License
170 stars 20 forks source link

ubios-cert.sh setdefaultca requires initial first #4

Closed tackynugget closed 2 years ago

tackynugget commented 2 years ago

Hello world,

In the course of troubleshooting #2 I discovered that if you want to specify a non-default CA, you have to run sh /mnt/data/ubios-cert/ubios-cert.sh initial before you can run sh /mnt/data/ubios-cert/ubios-cert.sh setdefaultca

Otherwise, it will error out thusly: Error: error checking path "/mnt/data/ubios-cert/acme.sh": stat /mnt/data/ubios-cert/acme.sh: no such file or directory

I think it errors out like this because the setdefaultca switch doesn't install acme.sh, but requires acme.sh to be present so it can set a different value for DEFAULT_CA.

In the course of un/re-installing this script several times, I found that I had to

to get it to utilize the DEFAULT_CA value from my /mnt/data/ubios-cert/ubios-cert.env file.

Not a big deal, but I thought I'd report it here. I'm not very good at scripting, but I wonder if the ubios-cert.sh script could check to see if acme.sh is installed first before proceeding. Seems like it would be good for the initial, setdefaultca, and cleanup switches to know about ahead of time.

alxwolf commented 2 years ago

Thanks for the report! Will have a look at it if I can include your solution in the script directly.

tackynugget commented 2 years ago

I just uninstalled and reinstalled everything.

I can confirm that these changes worked.

I was able to run sh /mnt/data/ubios-cert/ubios-cert.sh setdefaultca before running it with the initial switch without any issues.

Thanks for being so quick to fix this.

alxwolf commented 2 years ago

Thanks for your excellent debugging!

I stick with Let's Encrypt for the moment, all other providers might require additional configuration.