Using ikiwiki via command line: Workflow and permission problem

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite












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?

Note that I asked this question already on the ikiwiki forum a long time ago, I repost it here and hope to get help.










share|improve this question



























    up vote
    1
    down vote

    favorite












    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?

    Note that I asked this question already on the ikiwiki forum a long time ago, I repost it here and hope to get help.










    share|improve this question

























      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      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?

      Note that I asked this question already on the ikiwiki forum a long time ago, I repost it here and hope to get help.










      share|improve this question















      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?

      Note that I asked this question already on the ikiwiki forum a long time ago, I repost it here and hope to get help.







      permissions git ikiwiki






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Aug 29 '17 at 12:18

























      asked Aug 28 '17 at 15:47









      Anna19

      133




      133




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          1
          down vote



          accepted










          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: 127.0.0.1/~myuser/newiki


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






          share|improve this answer




















            Your Answer







            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "106"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            convertImagesToLinks: false,
            noModals: false,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













             

            draft saved


            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f388870%2fusing-ikiwiki-via-command-line-workflow-and-permission-problem%23new-answer', 'question_page');

            );

            Post as a guest






























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            1
            down vote



            accepted










            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: 127.0.0.1/~myuser/newiki


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






            share|improve this answer
























              up vote
              1
              down vote



              accepted










              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: 127.0.0.1/~myuser/newiki


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






              share|improve this answer






















                up vote
                1
                down vote



                accepted







                up vote
                1
                down vote



                accepted






                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: 127.0.0.1/~myuser/newiki


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






                share|improve this answer












                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: 127.0.0.1/~myuser/newiki


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







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Aug 13 at 13:23









                student

                6,6381663113




                6,6381663113



























                     

                    draft saved


                    draft discarded















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f388870%2fusing-ikiwiki-via-command-line-workflow-and-permission-problem%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    Popular posts from this blog

                    How to check contact read email or not when send email to Individual?

                    Bahrain

                    Postfix configuration issue with fips on centos 7; mailgun relay