steffenfritz / FileTrove

FileTrove indexes files and creates metadata from them.
https://filetrove.fritz.wtf
GNU Affero General Public License v3.0
37 stars 5 forks source link

[BUG] Streamline the "--install" option #25

Closed hkramski closed 9 months ago

hkramski commented 10 months ago

The "--install" option is documented as "Install FileTrove into the given directory." However, this is somewhat misleading because, for example, "~/bin/ftrove --install /home/myusername/filetrove" does not lead to a functioning installation in the specified directory, but to the error message 'level=ERROR msg="Could not create db directory." error="mkdir /home/myusername/filetrove/db: no such file or directory"'.

"~/bin/ftrove --install ." in an existing directory on the other hand works.

I see two possibilities here:

  1. Make it work
  2. Change the help text to ""Install FileTrove helper files into the current directory.", remove the string parameter and default to the current directory.
steffenfritz commented 10 months ago

The installation in a directory other than in the same where ftrove is located did not work due to a bug, this is fixed now.

On the other hand it makes no sense to install in another directory without the possibility to pass db and logs directory for the runs.

One use case is that someone wants to have different result databases and logs for every source but use the same NSRL database and from my point of view this is a valid idea.

Therefore I propose to close this bug as it is fixed but create an enhancement to add two flags for logs and db directories. This enables us to use one binary, one NSRL and several databases and logs.

dla-kramski commented 9 months ago

The installation in a directory other than in the same where ftrove is located did not work due to a bug, this is fixed now.

Even with the latest version I still get this (on Arch Linux, btw), if /home/kramski/FileTrove does not exist:

kramski@r0838 ~ $ ~/bin/ftrove --install /home/kramski/FileTrove

o--o   o     o-O-o                   
|    o |       |                     
O-o    | o-o   |   o-o o-o o   o o-o 
|    | | |-'   |   |   | |  \ /  |-' 
o    | o o-o   o   o   o-o   o   o-o 

time=2024-02-13T10:46:52.904+01:00 level=INFO msg="FileTrove installation started. Version: 1.0.0-DEV-10"
time=2024-02-13T10:46:52.904+01:00 level=ERROR msg="Could not create db directory." error="mkdir /home/kramski/FileTrove/db: no such file or directory"

(Please note that this is 1.0.0-DEV-11, while Taskfile.yml still declares VERSION: 1.0.0-DEV-10.)

I like the idea of simply changing the help text to "Install FileTrove into the given existing directory." which should cover all use cases discussed here.

steffenfritz commented 9 months ago

Fixed with 1.0.0-DEV-12