DigitalOcean and systemd problem

EDIT: I edit my token (It was read only, add write permission too) and save it. Caddy service seems working now. It is strange, I was using same token with command line!!! I leave the question because it is hard to find how to set service file with DigitalOcean token.

Hi,
I use Caddy 0.10.4, DigitalOcean, systemd
For one of my sites configuration is like:

https://example.com {
	root   /var/www/example
	log    /var/www/logs/example.log
	...
	tls {
		dns digitalocean
	}
}
https://www.example.com, http://example.com, http://www.example.com {
	redir https://example.com{uri}
}

Caddy service file (It didnt wok with EnvironmentFile):

;DigitalOcean TOKEN
;EnvironmentFile=/etc/profile.d/digitalocean.sh
Environment=DO_AUTH_TOKEN=tokentokentokentokentokentokentoken

I could run caddy on command line, it works, but when I run via service I got error:

Jul 10 14:33:45 server caddy[32613]: 2017/07/10 14:33:45 [INFO][example.com] AuthURL: https://acme-v01.api.letsencrypt.org/acme/authz/---
Jul 10 14:33:45 server caddy[32613]: 2017/07/10 14:33:45 [INFO][example.com] acme: Could not find solver for: http-01
Jul 10 14:33:45 server caddy[32613]: 2017/07/10 14:33:45 [INFO][example.com] acme: Trying to solve DNS-01
Jul 10 14:33:46 server caddy[32613]: 2017/07/10 14:33:46 [example.com] failed to get certificate: Error presenting token: HTTP 403: forbidden: You do not have access for the attempted action.

I attempt several times, even with several tokens. Once I see https is working but after that I couldnt. Via command line, it works.
Any help? thanks…

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.