It seems to be working decently well (outside of the fact that I can’t keep my PC on all the time, so on phone it’s offline mode until I sync every so often, but that’s fine.)
I’ve been looking at Backup your space to Github to keep a backup, but I’ve noticed a small issue (similar-ish to what others are experiencing there). Repo is set up, and running git commands via the CLI works like a treat - but trying to use the new git plug from the library doesn’t seem to be working.
I did a bit of investigation and I’ve gotten closer to the issue - space lua running shell commands doesn’t seem to have the same git config that the shell inside the docker container via CLI has.
Running git config user.name (with or without --global) within the container shell correctly gives the username I set, but the same thing in lua (shell.run(“git”, {“config”, “user.name”})) returns nothing at all. Trying different git commands also returns ‘dubious ownership’ errors, but I can’t run anything that actually involves configs from lua as it says ‘can’t lock .gitconfig’.
Would love to be able to get the git sync working if possible, and thanks in advance as I’m completely new to self hosting-type stuff. Only figured out how docker worked at all yesterday
Ok, I just reviewed and tested the linked guide. There’s some things there that are outdated and I’ve updated them now.
What was missing:
When you shell into your container you have to make sure you su as the same user as which silverbullet is running, this may be root or silverbullet so you need to run su silverbullet before running all the git commands to avoid permission errors. This is likely where your issues come from. To fix it, you can probably simply chown -R silverbullet /space
The guide was still linking to the Git plug, which is deprecated. I’ve now updated to recommend installing the Git library with the library manager instead.
There was a step missing updating the origin upstream, which turned out to be necessary for my setup as I tested it. Added this too.
Btw, I’m assuming/hoping you misplaced this topic and you’re actually running v2, is that right?
You know, I saw there was troubleshooting v1/v2 categories and somehow completely missed the fact that it was for v1/v2 silverbullet no idea what I thought it was but that makes a whole lot of sense now.
I am running v2, yes. Am I able to move this post over to that category?
Knowing that the guide was a bit outdated makes me feel a lot better, I thought I was going crazy. I’ll try out the fixes you mentioned and get back to you, I really appreciate the help.
I have an issue with Git sync as well. I am running the binary in Apple Silicon mac and starting the server using the command ./silverbullet notes. The notes folder is already a git repo and the only authentication method available for me is ssh keys. I am able to pull, push and commit in that folder from terminal. I have a bunch of changed files and running the git commit/sync command does nothing. I would atleast expect the changed to be committed locally but even that does not seem to be happening. Is there anything else I need to be doing?