FlyersWeb/dhtbay

Include with BitCannon

Closed this issue · 11 comments

I'm not sure of the progress you've had on merging the two but I was able to whip a quick implementation up overnight. I'm sure it could be refined : https://github.com/bglopez/dhtbay/tree/aiodht

I'm not sure if it is an issue with my environment but I've noticed that it will not continually run loadTorrent.js -- after the initial start it will just continue to fill the torrent directory but never scans.

loadTorrent use a watcher that is executed when a file is added, it should only run when there is a new file.
this dockerified version is still under development, so you'll not have too much logs. do you see the files in the mongo database based on torrent id ?

Thanks by the way for the combined version, it will save me some work :)

So it will insert files on the initial run, but any subsequent files added while running are not picked up. If I kill all the containers and rebuild the dhtbay one it seems to pick them up again on first run. It could be that the instance is running on a CentOS 7 server. I can try it on OSX to see if it shows there.

Another issue I run in to is an Angular dependency mismatch. I can override it by changed the required version from 1.4.8 to ~1.4.0 but I feel like this could cause some issues itself.
screen shot 2017-01-02 at 22 11 32

Edit: Changing Angular to ^1.3.0 will get past that step as well but fail at:

Running "karma:unit" (karma) task
WARN `start` method is deprecated since 0.13. It will be removed in 0.14. Please use
  server = new Server(config, [done])
  server.start()
instead.
03 01 2017 06:41:43.227:ERROR [config]: File /var/www/test/karma.conf.js does not exist!

Edit 2:
If I put the two projects separately in a folder and build them that way it works. eg:
./
./bitcannon
./dhtbay
./docker-compose.yml

and then reference them via their ./dhtbay or ./bitcannon paths for building and mounts. Make sure bitcannon-api depends on mongo and I've found assigning aria2c a static external port then forwarding it works best for my setup as everything needs to be punched through the firewall/router.

About your last issue, I ran into the same issue and made a bugfix on bitcannon side 12 hours ago, so it is corrected.
About the loadTorrent issue, I ran into the same issue and this was caused by incomplete downloaded torrent metadata that was present on torrent folder. You should not change aria2 container path otherwise you'll receive incomplete files on host sides. The dataComplete folder should be used as volume mount point.

I've pinned the loadTorrent.js issue down to Docker not updating mounted volumes while the instance is running. I manually copied the torrent files in the aria2c instance and checked the torrent dir in dhtbay to see it wasn't updated. I've added a volume to dhtbay and moved torrent out of it's directory to facilitate this and it picks up on file updates now.

oncompleted.sh in has a bunch of this in the logs, so I plan on modifying the script after figuring out exactly what arguments are being passed:

Tue Jan 3 09:35:15 UTC 2017 INFO  no file to move for 192b95b51d11cbc2.
Tue Jan 3 09:35:21 UTC 2017 INFO  no file to move for 663df785c29b13a5.
Tue Jan 3 09:35:29 UTC 2017 INFO  no file to move for 4627aa36cf9e9568.
Tue Jan 3 09:35:32 UTC 2017 INFO  no file to move for e8e970ee834636f1.
Tue Jan 3 09:35:45 UTC 2017 INFO  no file to move for 1d1051975c5ab3a2.
Tue Jan 3 09:36:02 UTC 2017 INFO  no file to move for 01ed2dc6655b9b2b.
Tue Jan 3 09:36:16 UTC 2017 INFO  no file to move for f8e28c6bc00b79e8.
Tue Jan 3 09:36:24 UTC 2017 INFO  no file to move for 1c7ba484de8b2886.
Tue Jan 3 09:37:09 UTC 2017 INFO  no file to move for 8634f62c0610725c.
Tue Jan 3 09:39:17 UTC 2017 INFO  no file to move for cb1c5f1d559a1d52.
Tue Jan 3 09:40:40 UTC 2017 INFO  no file to move for fd1c4d2d0effa552.

re: My previous update on the volumes, I just meant my docker-compose looks like:

services:
  dhtbay:
...
    volumes:
      - ./torrent:/var/www/torrent
...
    volumes:
      - ./torrent:/dataComplete
      - ./dhtbay/config/aria2:/etc/aria2

and the directory structure is now:

./
./docker-compose.yml
./torrent
./dhtbay
./bitcannon

Edit : I've updated my fork's bitcannonized branch for you to take a look at. Probably makes a bit more sense.

Hi, I've just updated the aria2 docker image in order to ignore the number of files check, I think it's because we're setting metadata download only so it is not passed as a full download to the oncomplete script. You should try to rebuild the aria2 dependency : docker-compose up --build aria2. Then check the oncomplete script update.

I'm working on an another problem on bitcannon side, looks like the client does not support API calls through docker network mapping.

I'll check the changes to Aria after work, as for Docker networking I ended up using the local address of the machine it ran on since I was accessing across my internal network. Something I noticed that I'm going to work around is the requirement for the API URL in Bitcannon must end with a slash or the connection fails.

Problem should be solved, it was on aria2 docker image side