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

How to add git authentication? #129

Open
ebbeknudsen opened this issue Jan 2, 2024 · 2 comments
Open

How to add git authentication? #129

ebbeknudsen opened this issue Jan 2, 2024 · 2 comments

Comments

@ebbeknudsen
Copy link

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!

@Linbreux
Copy link
Owner

Linbreux commented Jan 3, 2024

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.

@IXEguy
Copy link

IXEguy commented Feb 22, 2024

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 git@github.com 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.

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