Skip to content

Conversation

MohamedBassem
Copy link
Contributor

@MohamedBassem MohamedBassem commented May 11, 2025

Hi there, I'm the maintainer of Karakeep!

Adding a sync with Karakeep is apparently a popular FR on Floccus (#1745) and on Karakeep (karakeep-app/karakeep#712), so I took a stab at implementing it.

The way I implemented it is that I mimic-ed your implementation for Linkwarden exactly and changed the APIs to be that of Karakeep, hopefully that'll be good enough. There were some places where I saw some inconsistent casing (e.g. in i18n label names), but I kept them the same as those of linkwarden for consistency.

I tested the extension locally, and it works, you can see it in action here:

CleanShot.2025-05-11.at.2.14.43.mp4

However, what I didn't do is run the extensions' tests yet which I'll do after getting some provisional review from you.

EDIT: Just noticed that I wrote floccus incorrectly in the demo, sorry! :D

Copy link
Member

@marcelklehr marcelklehr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks really good, thank you for the effort you put into this :)

@MohamedBassem
Copy link
Contributor Author

@marcelklehr Seems like some tests are failing (which is understandable) but it's not clear to me why exactly they're failing.

@marcelklehr
Copy link
Member

It appears that the js build is failing. I'll try to build it tomorrow and see if I can find the problem

Signed-off-by: Marcel Klehr <mklehr@gmx.net>
@marcelklehr
Copy link
Member

A simple npm run lint:fix fixed the build :)

@marcelklehr
Copy link
Member

marcelklehr commented May 21, 2025

Now CI is failing to setup the karakeep container:

Service container karakeep failed.
  /usr/bin/docker logs --details b6976efb636c3fe460a94daa7cdaca5112ddb9ad58458030a00c3e5eaecdbad8
   s6-rc: info: service s6rc-oneshot-runner: starting
   Running db migration script
   s6-rc: info: service s6rc-oneshot-runner successfully started
   s6-rc: info: service fix-attrs: starting
   s6-rc: info: service init-db-migration: starting
   s6-rc: info: service fix-attrs successfully started
   s6-rc: info: service legacy-cont-init: starting
   s6-rc: info: service legacy-cont-init successfully started
   /db_migrations/index.js:811
   		throw new TypeError('Cannot open database because the directory does not exist');
   		^
   
   TypeError: Cannot open database because the directory does not exist
       at new Database (/db_migrations/index.js:811:9)
       at /db_migrations/index.js:13002:16
       at /db_migrations/index.js:13063:3
       at Object.<anonymous> (/db_migrations/index.js:13066:12)
       at Module._compile (node:internal/modules/cjs/loader:1730:14)
       at Object..js (node:internal/modules/cjs/loader:1895:10)
       at Module.load (node:internal/modules/cjs/loader:1465:32)
       at Function._load (node:internal/modules/cjs/loader:1282:12)
       at TracingChannel.traceSync (node:diagnostics_channel:322:14)
       at wrapModuleLoad (node:internal/modules/cjs/loader:235:24)
   
   Node.js v22.15.0
   s6-rc: warning: unable to start service init-db-migration: command exited 1

@MohamedBassem
Copy link
Contributor Author

Now CI is failing to setup the karakeep container:


Service container karakeep failed.

  /usr/bin/docker logs --details b6976efb636c3fe460a94daa7cdaca5112ddb9ad58458030a00c3e5eaecdbad8

   s6-rc: info: service s6rc-oneshot-runner: starting

   Running db migration script

   s6-rc: info: service s6rc-oneshot-runner successfully started

   s6-rc: info: service fix-attrs: starting

   s6-rc: info: service init-db-migration: starting

   s6-rc: info: service fix-attrs successfully started

   s6-rc: info: service legacy-cont-init: starting

   s6-rc: info: service legacy-cont-init successfully started

   /db_migrations/index.js:811

   		throw new TypeError('Cannot open database because the directory does not exist');

   		^

   

   TypeError: Cannot open database because the directory does not exist

       at new Database (/db_migrations/index.js:811:9)

       at /db_migrations/index.js:13002:16

       at /db_migrations/index.js:13063:3

       at Object.<anonymous> (/db_migrations/index.js:13066:12)

       at Module._compile (node:internal/modules/cjs/loader:1730:14)

       at Object..js (node:internal/modules/cjs/loader:1895:10)

       at Module.load (node:internal/modules/cjs/loader:1465:32)

       at Function._load (node:internal/modules/cjs/loader:1282:12)

       at TracingChannel.traceSync (node:diagnostics_channel:322:14)

       at wrapModuleLoad (node:internal/modules/cjs/loader:235:24)

   

   Node.js v22.15.0

   s6-rc: warning: unable to start service init-db-migration: command exited 1

Ah that might be an easy fix, changing the DATA_DIR to be '/' or maybe '/tmp'

@MohamedBassem
Copy link
Contributor Author

I managed to run the tests locally, and I'm still fixing the test failures. Still trying to understand the expected semantics.

@marcelklehr
Copy link
Member

I'm happy to help. If you like, we can chat on https://matrix.to/#/#marcelklehr_floccus:gitter.im

MohamedBassem and others added 7 commits May 26, 2025 10:56
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
@marcelklehr
Copy link
Member

Fixed the last test, but the server setup still fails in CI

@marcelklehr
Copy link
Member

Another thing I noticed: When calling removeFolder() on the adapter, floccus assumes that everything under that folder is removed, too, including sub-folders. Is that currently the case?

@MohamedBassem
Copy link
Contributor Author

but the server setup still fails in CI

@marcelklehr It seems that the latest failure is because of the address. Given that we're exporting port 3000, we can try setting KARAKEEP_URL to localhost:3000 instead.

floccus assumes that everything under that folder is removed, too, including sub-folders. Is that currently the case?

Oh, no that's not the case. Currently, removing a folder, removes the the bookmark <-> list link, but the bookmark lives. And subfolders end up getting promoted to be top level folders. We'll have to manually mimic it, I can give that a shot after fixing the server issue.

@marcelklehr
Copy link
Member

marcelklehr commented May 31, 2025

I think we cannot use localhost because floccus runs in a separate selenium container :D Let me try setting the container name manually, hopefully that works

@MohamedBassem
Copy link
Contributor Author

@marcelklehr Oh totally, forgot that selenium is running in its own container. So we need to put the two containers in the same network (or move them both to net: host or something. How is nextcloud currently set up?

@marcelklehr
Copy link
Member

Let me try setting the container name manually, hopefully that works

Damnit, didn't work

@marcelklehr marcelklehr merged commit f3599c2 into floccusaddon:develop May 31, 2025
46 of 67 checks passed
@marcelklehr
Copy link
Member

Woop woop, thanks @MohamedBassem

I expect to ship this in a few weeks :)

@MohamedBassem
Copy link
Contributor Author

Thanks a lot for the help @marcelklehr!

@bwcgn
Copy link

bwcgn commented Jul 7, 2025

@marcelklehr is there anticipated release date of the feature on Floccus? I would love to enable that sync :)

@simono41
Copy link

simono41 commented Jul 9, 2025

@marcelklehr I would also like to have this feature in the next version. :)

@marcelklehr
Copy link
Member

Yep, I haven't forgotten about this, it's in the pipeline. I'm currently still in the process of rolling out v5.5.x which had a major flaw which I had to fix, so I'm more careful with the rollout this time than usual. Karakeep will make it into v5.6.x. I'd say ETA is in the coming weeks.

@bwcgn
Copy link

bwcgn commented Jul 9, 2025

Feel free to send me some issues @marcelklehr :)

@ThomasWilczek
Copy link

I would love to have the option to sync all my bookmarks regardless of the list structure or the option to sync all lists :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants