Thread: pgarchive's search frontend
I deployed pgarchives and pglister using a custom application for the auth system. Now we just noticed that the search function did not work because the frontend is deported to pgweb, and pgarchives onlyprovides a json API. What is the rationale behind this? Would it make sense to move the frontend to pgarchives and send a patch here? Thanks, -- Célestin Matte
On Mon, Jul 31, 2023, 11:55 Célestin Matte <celestin.matte@cmatte.me> wrote:
I deployed pgarchives and pglister using a custom application for the auth system.
Now we just noticed that the search function did not work because the frontend is deported to pgweb, and pgarchives only provides a json API.
What is the rationale behind this? Would it make sense to move the frontend to pgarchives and send a patch here?
The rationale behind it is simply that it makes it possible to make a better experience for the user of the pgweb site. (and it used to be even worse from this perspective - pgweb used to open a postgres connection directly into the archives db and query it). So I don't think we want to move that.
That's not a reason to not also have an interface for it in the archives code itself. It just needs to be made configurable in a way that would allow both use cases.
/Magnus
Here's the patch for moving pgweb's search front-end to pgarchives. I worked on factorizing code between the search API and pgweb's search to avoid code duplication. I removed the possibility to search for lists using the 'ln=somelist,someotherlist' syntax because it only existed in thesearch API and did not seem to be used by the code calling this API. I kept the cache for the front-end search only because it was easier that way. I may be interesting to cache the API as well.What do you think? Once this is integrated, there is only a few work left to allow searching in private archives, taking access rights intoaccount. On 02/08/2023 08:46, Magnus Hagander wrote: > > > On Mon, Jul 31, 2023, 11:55 Célestin Matte <celestin.matte@cmatte.me <mailto:celestin.matte@cmatte.me>> wrote: > > I deployed pgarchives and pglister using a custom application for the auth system. > Now we just noticed that the search function did not work because the frontend is deported to pgweb, and pgarchivesonly provides a json API. > What is the rationale behind this? Would it make sense to move the frontend to pgarchives and send a patch here? > > > > > > The rationale behind it is simply that it makes it possible to make a better experience for the user of the pgweb site.(and it used to be even worse from this perspective - pgweb used to open a postgres connection directly into the archivesdb and query it). So I don't think we want to move that. > > That's not a reason to not also have an interface for it in the archives code itself. It just needs to be made configurablein a way that would allow both use cases. > > > /Magnus > -- Célestin Matte