I use my ikiwiki for personal notes only on my laptop locally (the html pages are under ~/public_html/mywiki) and now I am trying to edit it with emacs and push from command line.

I have some questions about this:

  1. Is the following workflow correct:

cd ~/mywiki

edit and save ~/mypage.mdwm with emacs

git add ~/mypage.mdwm
git commit -m "mypage edit"
git push

Since I also sometimes want to edit it from the web interface, I tested it and noticed that it doesn't seem that I have to pull before editing. If I save an edit from the web interface the directory ~/mywiki is updated magically without using git pull.

Is this correct so far or is there a better workflow?

  1. After editing and saving the page from the web interface it is saved with root permissions in ~/mywiki how can I make ikiwiki to save everything with my username as group and owner?

ad question 1:

This seems to be correct. If you set git_wrapper to git_wrapper: /home/user/mywiki/.git/hooks/post-commit (instead of git_wrapper: /home/user/mywiki.git/hooks/post-update you don't need the push step.

You may also think about another working clone of your wiki. But as long as you have a single user setup and you don't edit via web interface and editor at the same time, it should be fine to work inside scrdir as you described. See also this question: Why do I need 3 git repositories for ikiwiki if I want to commit locally)

ad question 2:

I am not quite sure where the problem comes from, maybe that you did run ikiwiki with sudo during setup. I suggest the following to fix it:

  1. Make sure, that public_html is owned by you (sudo chmod myuser:myuser ~/public_html)

  2. Resetup the wiki via cloning:

    • Clone the bare repository: git clone --bare ~/mywiki.git ~/newiki.git (even if the files in mywiki.git are owned by root the files in ~/newiki.git will owened by myuser)
    • cp ~/mywiki.git/config ~/newiki.git/config
    • Make new srcdir: git clone ~/newiki.git ~/newiki (~/newiki will be your new srcdir)
  3. Make new config file: cp ~/mywiki.setup ~/newiki.setup and rename all occurences of mywiki with newiki.

  4. Then run (without sudo): ikiwiki --setup newiki.setup --getctime

  5. Test in your browser:

If everything works you may (after an backup) delete mywiki and rename newiki to mywiki if you want.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.