wikmd icon indicating copy to clipboard operation
wikmd copied to clipboard

How to add git authentication?

Open ebbeknudsen opened this issue 1 year ago • 3 comments

Hello. How would I got about adding authentication (like an SSH key) to be able to sync the wiki with my git remote?

What is the recommended approach?

  1. Create a ssh key in my host and map the file into container
    • How do I add the ssh key to the agent inside the container?
  2. Manually perform something like docker exec into the container, and create the ssh configuration?
    • I feel like manually performing something inside a docker container is contradictory to the purpose of docker containers. I would have to do this again if i ever recreate the container or something similar

What is the recommended approach? I think the documentation is very lackluser on this topic, it just links to githubs documentation of how to add an ssh key

Thanks for the help!

ebbeknudsen avatar Jan 02 '24 02:01 ebbeknudsen

Hi @ebbeknudsen

My excuses for the not so clear documentation. I did not test this feature inside docker yet... I'll try to find out we can implement that. I did a quick test and it did indeed not work as it should.

Using it without docker does seem to work fine.

Linbreux avatar Jan 03 '24 19:01 Linbreux

Spent some time trying to get this work.

First, I updated my volumes to the below: volumes: - /docker/wikmd/wiki:/wiki - /docker/wikmd/ssh:/root/.ssh put my key in /docker/wikmd/ssh and chmod 600 the key file

From within the container when I run ssh -T [email protected] per the github recommendation to test if the key is working, I get the expected message.

However, when I edit pages, I don't see anything pushed to my github repo. I have both environment variables and & the yaml file setup. I was hoping at least one of them would get picked up.

Also, wanted to point out, the yaml variable is sync_with_remote, whereas the environment variable documentation refers to both is SYNCH_WITH_REMOTE and SYNC_WITH_REMOTE Minor difference, but probably nice to keep the similar in the long term.

IXEguy avatar Feb 22 '24 01:02 IXEguy

I'm also not able to get this working in a docker container. For me this seems like an absolute perfect markdown wiki with a git backend, but only if it can be deployed in a container environment.

arcoast avatar Jul 28 '24 14:07 arcoast