turboflakes / crunch

Crunch is a command-line interface (CLI) and Matrix Bot to claim staking rewards every Era for Substrate-based chains
https://turboflakes.io
Apache License 2.0
64 stars 22 forks source link

Not working with my own matrix server. #8

Open sniffski opened 2 years ago

sniffski commented 2 years ago

It seem the bot doesn't work with self hosted matrix server... :(

paulormart commented 2 years ago

Hi, I haven’t tried this myself. Do you have any logs of the errors?

sniffski commented 2 years ago

Yup:

[2022-04-15T09:51:03Z DEBUG crunch::matrix] response Response { url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("matrix.org")), port: None, path: "/_matrix/client/r0/login", query: None, fragment: None }, status: 403, headers: {"date": "Fri, 15 Apr 2022 09:51:03 GMT", "content-type": "application/json", "transfer-encoding": "chunked", "connection": "keep-alive", "synapse-trace-id": "a583afd31132411b", "cache-control": "no-cache,
no-store, must-revalidate", "access-control-allow-origin": "*", "access-control-a
llow-methods": "GET, HEAD, POST, PUT, DELETE, OPTIONS", "access-control-allow-headers": "X-Requested-With, Content-Type, Authorization, Date", "permissions-policy
": "interest-cohort=()", "cf-cache-status": "DYNAMIC", "expect-ct": "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"", "server": "cloudflare", "cf-ray": "6fc3c7cc5c7c9bfe-FRA"} }
[2022-04-15T09:51:03Z ERROR crunch::crunch] Invalid password

Also there is no variable to set custom matrix server instead of matrix.org... Bear in mind the username and password are set in .env file, but the debug log displays empty values, not sure if that's for security reasons or it fails to properly get the variables from file... If I put CRUNCH_MATRIX_BOT_USER=@valid-matrix-user:matrix.org all works fine...