Live data from Hacker News

Rga: Ripgrep, but also search in PDFs, E-Books, Office documents, zip, etc.

github.com

21–30 of 59 posts

Re: Rga: Ripgrep, but also search in PDFs, E-Books, Office documents, zip, etc.

#21
post #13

Lazy question but anyone integrated this with Emacs Dired, to transparently search all the files?

According to Reddit [1], you can use the existing rg.el package, and just point it to the rga binary instead of the rg binary, and it is supposed to just work.

[1]: https://www.reddit.com/r/emacs/comments/1eghspj/comment/lg6q...

Re: Rga: Ripgrep, but also search in PDFs, E-Books, Office documents, zip, etc.

#23
Awesome tool and I use it often. One under utilized feature of rga is its integration with fuzzy search (fzf) that provides interactive outputs compared to running the commands and collecting outputs in sequence. So in short use rga-fzf instead of rga in CLI.

Re: Rga: Ripgrep, but also search in PDFs, E-Books, Office documents, zip, etc.

#24
post #9

To what extent does reading these formats accurately require the execution of code within the documents ? In other words, not just stuff like zip expansion by a library dependency of rga, but for example macros inside office documents or JavaScript inside PDFs. Note: I have no reason to believe such code execution is actually happening — so please don't take this as FUD. My assumption is that a secure design would in…

On average, the macros in an Office document add features to the software and aren't run to render any content. So like toggling a group of settings or inserting some content or whatever. They may change the content, but it's done at a point in time by the user, not each time the document is opened.

And then, on average, most users don't use macros in their documents.

So yes, negligible.

Re: Rga: Ripgrep, but also search in PDFs, E-Books, Office documents, zip, etc.

#25
post #9

To what extent does reading these formats accurately require the execution of code within the documents ? In other words, not just stuff like zip expansion by a library dependency of rga, but for example macros inside office documents or JavaScript inside PDFs. Note: I have no reason to believe such code execution is actually happening — so please don't take this as FUD. My assumption is that a secure design would in…

None of them really execute "code". Pandoc has a pretty good write up of the security implications or running it, which I think applies just as much to the other ones, with the added caveat of zip bombs. https://pandoc.org/MANUAL.html#a-note-on-security It's just text, this isn't ripgrepping through your excel macros, just the data that's actually in the excel file.

I don't think there's a default excel adapter in rga.

(I wanted one somewhat recently, and then doing a find for xls on the linked page returns 0 results)

Re: Rga: Ripgrep, but also search in PDFs, E-Books, Office documents, zip, etc.

#26
post #12

Use Recoll for that; check the recommended dependencies from your package manager. Synaptic it's good for this with a click from the right mouse button on the package. EDIT: For instance, under Trisquel/Ubuntu/Debian and derivatives, click on 'recollcmd', and with the right click button mark all the dependencies. Install RecollGUI for a nice UI. Now you will have something like Google Search but libre in your own des…

To take it further install recoll-webui [1] and SearxNG [2], enable the recoll engine in the latter at point it at the former for a web-accessible search engine for local as well as remote content. Make sure to put local content behind a password or other type of authentication unless you intend for it to be searchable by outside visitors.

Source: I made the recoll engine for Searx/SearxNG and have been using this system for many years now with a full-text index over close to a terabyte worth of data.

[1] https://github.com/koniu/recoll-webui

[2] https://github.com/searxng/searxng

Re: Rga: Ripgrep, but also search in PDFs, E-Books, Office documents, zip, etc.

#27
post #10
post #9

To what extent does reading these formats accurately require the execution of code within the documents ? In other words, not just stuff like zip expansion by a library dependency of rga, but for example macros inside office documents or JavaScript inside PDFs. Note: I have no reason to believe such code execution is actually happening — so please don't take this as FUD. My assumption is that a secure design would in…

Also note that it's not necessarily safe to read these documents even if you don't intend on executing embedded code. For example, reading from pdfs uses poppler, which has had a few CVEs that could result in arbitrary code execution, mostly around image decoding. https://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=poppler (No shade to poppler intended, just the first tool on the list I looked at.)

Couldn't or shouldn't each parser be run in a container with systemd-nspawn or LXC or another container runtime? (Even if all it's doing is reading a file format into process space as NX data not code as the current user)
Post reply on HN