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

Connection refused for docker container #20

Open
avral opened this issue Jan 12, 2023 · 3 comments
Open

Connection refused for docker container #20

avral opened this issue Jan 12, 2023 · 3 comments

Comments

@avral
Copy link

avral commented Jan 12, 2023

Hello! Trying to use your service, builded docker image from latest code. (as pulling mpwsh/imgopt:0.2.1 is not available)

docker run --rm -p 3030:3030 imgopt

but getting Connection refused for any url, ie: server_ip:3030/ipfs/bafybeih26pot7dyvqkjabsx75fuypf6cy6derd6tojnfpctja75a2j7uk4?width=600

[2023-01-12T11:30:09Z DEBUG actix_web::middleware::logger] Error in response: Connect(Io(Os { code: 111, kind: ConnectionRefused, message: "Connection refused" }))

@mpwsh
Copy link
Member

mpwsh commented Jan 12, 2023

Hi @avral, readme is a bit outdated.
You'll need to run smol-kv which is just a key value store, to keep track of download retries to avoid trying to download broken links again and again.

Please start smol-kv on a new terminal and then try again

docker run -p 5050:5050 -e DATABASE_PATH=/rocksdb \
  -v $(pwd)/rocksdb:/rocksdb \
  ghcr.io/mpwsh/smol-kv:amd64-latest

The port 5050 should match the kvstore_uri value on the config:
https://github.com/holaplex/imgopt/blob/main/config-sample.toml#L27

@avral
Copy link
Author

avral commented Jan 13, 2023

Hi @mpwsh Thank you! It works!

Also i noticed that ipfs service does not support path with slashes
ie: QmPWJhQdbw6s1RXpXHrEs56mgJcFXKSCuCEWwhZY7Mi9jt/1-2.png

im getting 404 for any url with slash.

But it works perfect with hashes, thank you for great service!

@mpwsh
Copy link
Member

mpwsh commented Jan 13, 2023

You're welcome @avral !
Yep, you got another good catch lol.

For urls with path, you'll need to use the path query parameter.
For example:

http://localhost:3030/ipfs/QmPWJhQdbw6s1RXpXHrEs56mgJcFXKSCuCEWwhZY7Mi9jt?width=400&path=1-2.png

Heres a working example for you to test as well.
https://assets.holaplex.tools/ipfs/bafybeia73wj35e4qr54ynknxnlp7kkyft2c75szsylihiyunuasxsvj3la?width=400&path=5479.gif

Contributions are highly appreciated. Please feel free to update it with blocks you found and outdated stuff and i'll merge it.

Happy you find the tool useful

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

2 participants