Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Share database between machine? #114

Closed
nguyenhaiac opened this issue Jun 11, 2020 · 4 comments
Closed

Share database between machine? #114

nguyenhaiac opened this issue Jun 11, 2020 · 4 comments

Comments

@nguyenhaiac
Copy link

nguyenhaiac commented Jun 11, 2020

Hi, I really love this and I want to fully incorporated it into my workflow. My situation is that I have a machine at work and one at home, can both of these machines share a single sqlite database? Obviously while I'm at work, no one uses the machine at home (though I still keep the machine running) so I guess there would be no conflict or blocking of database. However, I'm not that familiar with sqlite so there maybe problems that I'm not aware of.

Have anybody trying this? if this is not possible, is there anyway to run this in a server securely so I can connect my devices to?

@karlicoss
Copy link
Owner

Hi! Yep, absolutely, I've got similar setup between my computers.
Indeed, when using sqlite there is a potential for blocking the database and conflicts. But at the moment Promnesia indexer replaces it atomically (exactly to avoid possible conflicts), so there shouldn't be any database blocking involved.
The server reloads the database automatically, so you can share it with any file sharing solution you prefer! I'm using Syncthing, you can also use Dropbox or something similar.

As for running the server securely -- some work on putting it in Docker has started: #55, but might need a bit of polishing first. Although I'm not sure if you're gonna be able to expose the server from a home computer (usually ISPs don't allow opening ports these days), so sharing the database is easier and safer at the moment.

P.S. I'm sure you have thought about it, but when running at work make sure your security team allows it. When you're browsing, the extension sends current URL to Promnesia backend, and it might potentially expose tokens or something else. There is a blacklist feature in the extension if you want to exclude your work-specific domains (intranet). But if you're running locally you should be fine, of course.

@nthainguyen
Copy link

Hi, thanks for the response. By secure I mean some sort of authentication and https or smt like that. However if the db sharing works just fine then I don't think server is needed anymore, less thing for me to care for anw. I will also put promnesia to run on my phone via termux as well. I've done some test and it runs fine on my phone.
Thanks for an awesome software.

@karlicoss
Copy link
Owner

By secure I mean some sort of authentication and https or smt like that.

Ah, for HTTPS it's better to rely on the reverse proxy (apache/nginx/caddy, etc) -- they would handle this much better and more secure. For authentication as well: you can set up basic auth and promnesia allows to set username/password in the extension settings. Guess I need to add this to docs!

However if the db sharing works just fine then I don't think server is needed anymore, less thing for me to care for anw

Just to clarify -- the promnesia serve is still needed to expose the database to the extension (because browsers can't access the filesystem directly), but I guess you meant server in the sense that it's exposed to the outside.

I'm running promnesia on Windows machine via wsl now and it runs very well, I can help update the readme regarding setting up on Windows

oh wow, didn't know about wsl, that's great to know if it just works! :)

I will also put promnesia to run on my phone via termux as well

Yes, that was also on my todo list! Let me know how it goes. At the moment I'm just using it over the local network, considering I don't leave home much...

Thanks for an awesome software.

You're welcome! Glad you found it useful!

@nguyenhaiac
Copy link
Author

It works well both on Termux and Windows. However there's a bit of a problem with the path. For example in my home Linux machine, the path is /home/username/Syncthing/filename.org, then the same file when indexed on WSL it would be /mnt/c/Users/username/Syncthing/filename.org (I sync the Syncthing folder between machines). The same file would be indexed twice with 2 different paths. I do think I have a solution for this though, I'll have to test it and report back.

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

No branches or pull requests

3 participants