caddy-dns / route53

Caddy module: dns.providers.route53
MIT License
38 stars 31 forks source link

Can't find AWS profile #6

Closed a1994sc closed 3 years ago

a1994sc commented 3 years ago

Hello, I am trying to set up caddy to use route53 and xcaddy is spitting out an error about not finding the ~/.aws/credentials, even though the aws cli finds them just fine.

Below is the error.

2020/12/08 16:33:12 [INFO] Writing main module: /tmp/buildenv_2020-12-08-1633.970086107/main.go
2020/12/08 16:33:12 [INFO] Initializing Go module
2020/12/08 16:33:12 [INFO] exec (timeout=10s): /usr/local/go/bin/go mod init caddy
go: creating new go.mod: module caddy
2020/12/08 16:33:12 [INFO] Replace github.com/caddy-dns/route53 => /home/<user>/.aws/route53
2020/12/08 16:33:12 [INFO] exec (timeout=10s): /usr/local/go/bin/go mod edit -replace github.com/caddy-dns/route53=/home/<user>/.aws/route53
2020/12/08 16:33:12 [INFO] Pinning versions
2020/12/08 16:33:12 [INFO] exec (timeout=0s): /usr/local/go/bin/go get -d -v github.com/caddyserver/caddy/v2
go: github.com/caddyserver/caddy/v2 upgrade => v2.2.2
2020/12/08 16:33:13 [INFO] Build environment ready
2020/12/08 16:33:13 [INFO] Building Caddy
2020/12/08 16:33:13 [INFO] exec (timeout=0s): /usr/local/go/bin/go build -o /home/<user>/.aws/route53/caddy -ldflags -w -s -trimpath
go: found github.com/caddy-dns/route53 in github.com/caddy-dns/route53 v0.0.0-00010101000000-000000000000
# github.com/caddy-dns/route53
/home/ascii17/.aws/route53/route53.go:58:16: p.Provider.AWSProfile undefined (type *"github.com/libdns/route53".Provider has no field or method AWSProfile)
2020/12/08 16:33:14 [INFO] Cleaning up temporary folder: /tmp/buildenv_2020-12-08-1633.970086107
2020/12/08 16:33:14 [ERROR] exit status 2

Here is the process that I used to install xcaddy and tried to install dns.providers.route53 go get -u github.com/caddyserver/xcaddy/cmd/xcaddy

xcaddy build v2.3.0-beta.1 --with github.com/caddy-dns/route53

At this point dns.providers.route53 does not show up in caddy list-modules

admin.api.load
admin.api.metrics
caddy.adapters.caddyfile
caddy.listeners.tls
caddy.logging.encoders.console
caddy.logging.encoders.filter
caddy.logging.encoders.filter.delete
caddy.logging.encoders.filter.ip_mask
caddy.logging.encoders.json
caddy.logging.encoders.logfmt
caddy.logging.encoders.single_field
caddy.logging.writers.discard
caddy.logging.writers.file
caddy.logging.writers.net
caddy.logging.writers.stderr
caddy.logging.writers.stdout
caddy.storage.file_system
http
http.authentication.hashes.bcrypt
http.authentication.hashes.scrypt
http.authentication.providers.http_basic
http.encoders.gzip
http.encoders.zstd
http.handlers.acme_server
http.handlers.authentication
http.handlers.encode
http.handlers.error
http.handlers.file_server
http.handlers.headers
http.handlers.map
http.handlers.metrics
http.handlers.push
http.handlers.request_body
http.handlers.reverse_proxy
http.handlers.rewrite
http.handlers.static_response
http.handlers.subroute
http.handlers.templates
http.handlers.vars
http.matchers.expression
http.matchers.file
http.matchers.header
http.matchers.header_regexp
http.matchers.host
http.matchers.method
http.matchers.not
http.matchers.path
http.matchers.path_regexp
http.matchers.protocol
http.matchers.query
http.matchers.remote_ip
http.matchers.vars
http.matchers.vars_regexp
http.reverse_proxy.selection_policies.first
http.reverse_proxy.selection_policies.header
http.reverse_proxy.selection_policies.ip_hash
http.reverse_proxy.selection_policies.least_conn
http.reverse_proxy.selection_policies.random
http.reverse_proxy.selection_policies.random_choose
http.reverse_proxy.selection_policies.round_robin
http.reverse_proxy.selection_policies.uri_hash
http.reverse_proxy.transport.fastcgi
http.reverse_proxy.transport.http
pki
tls
tls.certificates.automate
tls.certificates.load_files
tls.certificates.load_folders
tls.certificates.load_pem
tls.handshake_match.sni
tls.issuance.acme
tls.issuance.internal
tls.issuance.zerossl
tls.stek.distributed
tls.stek.standard

So I run xcaddy list-modules to get that original error message.

My OS is as follows:

Distributor ID: Ubuntu
Description:    Ubuntu 20.04.1 LTS
Release:        20.04

My Go version is:

go version go1.15.6 linux/amd64

And Caddy is:

v2.2.1 h1:Q62GWHMtztnvyRU+KPOpw6fNfeCD3SkwH7SfT1Tgt2c=
a1994sc commented 3 years ago

Sorry, I had a poor understanding of what exactly xcaddy does...

p0we7 commented 7 months ago

The credentials file is placed in this directory.

/var/lib/caddy/.aws/credentials

I don't know why but just work.