anacrolix / confluence

Torrent client as a HTTP service
Mozilla Public License 2.0
237 stars 32 forks source link

Set data Dir using flags. #35

Closed bubundas17 closed 2 years ago

bubundas17 commented 2 years ago

Currently, Confluence puts all the cache, Incomplete files and other files where we are executing the program.

It would be nice to be able to specify a data dir where Confluence will store all of its files.

anacrolix commented 2 years ago

Does changing the working directory work for you? There's also -fileDir, or a customized URI for -sqliteStorage.

bubundas17 commented 2 years ago

Yes, changing working directory works. In my use case I have another service beside confluence. And it is a bit annoying to change working directory and execute confluence and then switch back and run another service.

In my opinion having a flag for data directory looks bit more elegant than having to change the working directory.

On Fri, 6 May, 2022, 3:11 am Matt Joiner, @.***> wrote:

Does changing the working directory work for you? There's also -fileDir, or a customized URI for -sqliteStorage.

— Reply to this email directly, view it on GitHub https://github.com/anacrolix/confluence/issues/35#issuecomment-1119072530, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGIQBUTY5NFVRBFNB7EZUFDVIQ57ZANCNFSM5VFRAHUA . You are receiving this because you authored the thread.Message ID: @.***>

anacrolix commented 2 years ago

It is opinionated, but I do believe that working directories are not used enough, and allow for consistent and predictable behaviour. I'm happy to accept PRs or evidence to the contrary. I think what you described above is easily handled with something like

(cd /confluence/config/dir && confluence) &
some other service
wait
bubundas17 commented 2 years ago

Yes, I have changed the working directory and now it works. And I have spawned another process for the other service.

And do you have any plans to port go-libutp package to native GO? So it can be compiled without CGO.

anacrolix commented 2 years ago

I have no such plans with go-libutp. I encourage the Go authors to make C interoperability better. There have been improvements in the accessibility of cgo when cross compiling, I have been using Zig to do the cross compilation, see https://dev.to/kristoff/zig-makes-go-cross-compilation-just-work-29ho or similar. Feel free to open an issue against go-libutp to follow this up.

bubundas17 commented 2 years ago

I asked it because I was having issues building this for Android devices. I ended up building on a Android device with turmux which may sound stupid, but works. I am not familiar with Zig. Can we use it to build for Android as well?