Giter VIP home page Giter VIP logo

Comments (8)

bakito avatar bakito commented on July 19, 2024 1

Hi @alexfornuto

You can define all params via env variable by following the pattern REPLICA_ where the promertyname must be all UPPERCASE and must not have any spaces.

Env replacement in the config file should be supported by the used config library.

But in your case you use ${USER} in the config file and define env ORIGIN_USERNAME in the docker compose file.

from adguardhome-sync.

alexfornuto avatar alexfornuto commented on July 19, 2024 1

It was a PEBCAK error, typo in the domain name. My shame is now complete.

from adguardhome-sync.

alexfornuto avatar alexfornuto commented on July 19, 2024

You can define all params via env variable by following the pattern REPLICA_ where the promertyname must be all UPPERCASE and must not have any spaces.

Does that mean to pass insecureSkipVerify in docker-compose.yaml, it would look like ORIGIN_INSECURESKIPVERIFY?

I think I defined my config files as you suggested:

from docker_compose.yaml:

    environment:
      LOG_LEVEL: "debug"
      ORIGIN_URL: "https://<ORIGIN-IP>:443"
      ORIGIN_USERNAME: ${USER}
      ORIGIN_INSECURESKIPVERIFY: true
      ORIGIN_PASSWORD: ${PASSWORD}

From adguardhome-sync.yaml:

origin:
  insecureSkipVerify: true # disable tls check
  username: ${USER}
  password: ${PASSWORD}

From the logs:

2023-12-07T22:00:28.221Z	INFO	root	cmd/root.go:125	Using config file:/config/adguardhome-sync.yaml
2023-12-07T22:00:28.226Z	INFO	sync	sync/sync.go:38	AdGuardHome sync	{"version": "v0.5.2", "build": "2023-11-23T07:13:51Z", "os": "linux", "arch": "amd64"}
2023-12-07T22:00:28.226Z	DEBUG	sync	types/types.go:70	Using config	{"config": {"origin":{"url":"https://<ORIGIN-IP>:443","apiPath":"/control","username":"a***x","password":"a***b","insecureSkipVerify":true,"autoSetup":false,"interfaceName":""},"replica":{"url":"http://192.168.1.100","apiPath":"/control","username":"a***x","password":"a***b","insecureSkipVerify":false,"autoSetup":false,"interfaceName":""},"cron":"*/10 * * * *","runOnStart":true,"api":{"port":8080},"features":{"dns":{"accessLists":true,"serverConfig":true,"rewrites":true},"dhcp":{"serverConfig":true,"staticLeases":true},"generalSettings":true,"queryLogConfig":true,"statsConfig":true,"clientSettings":true,"services":true,"filters":true}}}
2023-12-07T22:00:28.226Z	INFO	sync	sync/sync.go:65	Setup cronjob	{"cron": "*/10 * * * *", "next-execution": "2023-12-07T22:10:00.000Z"}
2023-12-07T22:00:28.226Z	INFO	sync	sync/http.go:57	Starting API server	{"port": 8080}
2023-12-07T22:00:28.226Z	INFO	sync	sync/sync.go:75	Running sync on startup
2023-12-07T22:00:28.226Z	DEBUG	client	client/client-methods.go:16	do get	{"host": "<ORIGIN-IP>:443", "method": "GET", "path": "status", "username": "alex"}
2023-12-07T22:00:28.317Z	DEBUG	client	client/client-methods.go:32	got response	{"host": "<ORIGIN-IP>:443", "method": "GET", "path": "status", "username": "alex", "status": 403, "body": "Forbidden", "content-type": ["text/plain; charset=utf-8"]}
2023-12-07T22:00:28.317Z	ERROR	sync	sync/sync.go:153	Error getting origin status	{"from": "<ORIGIN-IP>:443", "error": "403 Forbidden(Forbidden)"}

from adguardhome-sync.

alexfornuto avatar alexfornuto commented on July 19, 2024

A brief update. I figured out how to insert hosts entries into containers, so I can use the .local domain included in the certificate. That didn't change anything. What's interesting is that the paths sync is trying to get to don't seem to be accessible though curl either:

❯ curl -k -u alex https://adguard.local/control
Enter host password for user 'alex':
404 page not found
❯ curl -k -u alex https://adguard.local/status
Enter host password for user 'alex':
404 page not found
❯ curl -k -u alex https://adguard.local/
Enter host password for user 'alex':
<!doctype html><html lang="en"><head>...

from adguardhome-sync.

bakito avatar bakito commented on July 19, 2024
  1. You do not need the config file if you define everything as env variables.
  2. The config file is still wrong. In the container is no env var with name PASSWORD nor USERNAME this is only known outside the docker container.

from adguardhome-sync.

bakito avatar bakito commented on July 19, 2024

A brief update. I figured out how to insert hosts entries into containers, so I can use the .local domain included in the certificate. That didn't change anything. What's interesting is that the paths sync is trying to get to don't seem to be accessible though curl either:

❯ curl -k -u alex https://adguard.local/control
Enter host password for user 'alex':
404 page not found
❯ curl -k -u alex https://adguard.local/status
Enter host password for user 'alex':
404 page not found
❯ curl -k -u alex https://adguard.local/
Enter host password for user 'alex':
<!doctype html><html lang="en"><head>...

In the sync log, you have a 403 meaning there's an issue with atuthentication, with curl there's 404 meaning not found.

So the url with curl might not point to the correct container.

from adguardhome-sync.

alexfornuto avatar alexfornuto commented on July 19, 2024

Welp. This turned out to be a PEBCAK error too shameful to detail here. Thanks for your patience and assistance. At least I learned more about how to configure this project along the way.

from adguardhome-sync.

bakito avatar bakito commented on July 19, 2024

@alexfornuto for other users it still might be helpful if you could describe your solution hete.

from adguardhome-sync.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.