Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue related to home-assistant-addons lego #42

Open
wes1993 opened this issue Aug 3, 2022 · 0 comments
Open

Issue related to home-assistant-addons lego #42

wes1993 opened this issue Aug 3, 2022 · 0 comments

Comments

@wes1993
Copy link

wes1993 commented Aug 3, 2022

Hello,
i can't find in the repository https://github.com/jherby2k/via-justa-home-assistant-addons where to write :-(
I want to ask you if is possible to add an optiot that, after the first line of SAN certificate has generated, copy and rename the certificate here:
/ssl/fullchain.pem
/ssl/privkey.pem

So we can use this addon instead of duckdns addon, this is some line of code that i have created but i don't know how to test this:

int h = 0
for domain in $(bashio::config 'domains'); do
    sans=(${domain//,/ })
    bashio::log.debug "Checking for certificate ${CERT_PATH}/certificates/${sans[0]//[*]/_}.crt existence"
    if [[ ! -f "${CERT_PATH}/certificates/${sans[0]//[*]/_}.crt" ]]; then
        bashio::log.info "Certificate for domain ${sans[0]} not found, issuing"
        domainargs=$args
        for san in ${sans[@]}; do
            domainargs="${domainargs} -d ${san}"
        done
        bashio::log.debug "running command: lego ${domainargs} run"
        lego ${domainargs} run
        
        for (i=1 ; i<100 ; i++) ;
        
        if [ h == 0 ]; 
		then
            cp -rp ${CERT_PATH}/certificates/${sans[0]//[*]/_}.crt /ssl/fullchain.pem
			cp -rp ${CERT_PATH}/certificates/${sans[0]//[*]/_}.key /ssl/privkey.pem
        fi
    else
        bashio::log.info "Certificate for domain ${sans[0]} found"
    fi
    h++
done

I hope in this implementation
Best regards
Stefano

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

No branches or pull requests

1 participant