Set data Dir using flags.

#35 · closed · 6 comments

View on GitHub ↗

bubundas17

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.

Comments

anacrolix

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

bubundas17

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

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

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

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

> 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?