vrtmrz / obsidian-livesync

MIT License
5.08k stars 164 forks source link

Is huggingface a possible platform for deployment? #442

Open IsidoreSong opened 5 months ago

IsidoreSong commented 5 months ago

Huggingface provides Space service which contains unlimited 2v CPU 16G RAM hardware.

It supports docker. I already doploy a test space follow setup couchdb with docker for live-sync but it brings me "https://any:5984/_session","USERNAME", {conn_failed,{error,nxdomain}}}" when "Verify CouchDB Installation" at "Replication". The DB Test in plugin is successful but when I check the target database it only has one obsydian_livesync_version.

I'm not sure what's wrong with it. But if deploy on huggingface is possible, it would be very promising. More details about it could be found at https://huggingface.co/docs/hub/spaces-overview.

IsidoreSong commented 5 months ago

ok, I see. The server is a catch for sync. When livesync mode is activated, there are files on it. https://github.com/vrtmrz/obsidian-livesync/blob/main/docs/tech_info.md

Huggingface is valid and could be used in China, great!

IsidoreSong commented 5 months ago

emmm, one more thing need to be mentioned, as it is a free plan, its storage is not permenant. So every time you change the config it rebuilt again and that's what I suffers. But I can endure this 30 minutes waiting with my 500 notes and 70+ plugins, as I don't need to do this everyday. Maybe less frequent than once a year after a successful deployment. Thus it is acceptable for me.

Facni commented 5 months ago

Every time you change what config?

IsidoreSong commented 5 months ago

Technically everything before running the docker, like docker file, local.ini, and COUCH_USER & COUCH_PASSWORD. But the deployment process is really simple, just copy the loca.ini, write a 2-line Dockerfile and set 2 environment varaiable. I'm still exploring this plugin. But this config already support live syncing. I like it.

Facni commented 5 months ago

Hey, instead of close this issue, we could write a tutorial alongside the fly.io and cloudant.

vrtmrz commented 2 weeks ago

Thank you so much for opening this issue! And I am so impressed to see this! Extremely easy to set it up.

The only one thing I am worried js simple, Is "Using Hugging Face Spaces for serving the Database" accepted by their terms?

I saw several documents, but none of them mentioned that. Do you know any other space like this?

I am really sorry to be late to address the PR, but I hope to decide to merge that after confirmation to avoid unnecessary friction among the communities!

IsidoreSong commented 1 week ago

I didn't find any info about space specifically, but this link explains huggingface's whole content term . For alternatives, zeabur, https://[render](https://render.com/) and vercel may be accessable. But I didn't use them a lot :-| .