woolfg / dokuwiki-plugin-gitbacked

Plugin for DokuWiki to store/sync files and media with a git repo
GNU General Public License v2.0
74 stars 26 forks source link

Setup Error - Gitrepo not accessible or writeable #46

Closed 11ert closed 5 years ago

11ert commented 6 years ago

I do have some questions because I am not able to get the gitbacked plug-in up and running as expected: I just followed the installation guidelines of the plug-in but I do get an error when opening my wiki pages:

"The datadir ('pages') at ./data/gitrepo/wiki/pages is not found, isn't accessible or writable. You should check your config and permission settings. Or maybe you want to run the installer?"

The corresponding configuration entry in local.php looks like:

$conf['plugin']['gitbacked']['pushAfterCommit'] = 1;
$conf['plugin']['gitbacked']['periodicPull'] = 1;
$conf['plugin']['gitbacked']['repoPath'] = './data/gitrepo';
$conf['plugin']['gitbacked']['repoWorkDir'] = './data/gitrepo/wiki';
$conf['plugin']['gitbacked']['addParams'] = '-c user.name="xyz" -c user.email="xxx@yyy.de"';
$conf['datadir'] = './data/gitrepo/wiki/pages';
$conf['mediadir'] = './data/gitrepo/wiki/media';

I executed a git pull within the folder (as my normal user). Dokuwiki could not access the files. So, I changed the ownership of the gitrepo folders to www-data but this does not help either:

pi@raspberrypi:/var/www/html/dokuwiki/data/gitrepo $ ls -lrt
insgesamt 8
drwxrwxr-x 3 www-data www-data 4096 Aug 16 22:59 wiki

Any ideas ? I would appreciate any help on this! Thanks in advance!

11ert commented 6 years ago

I managed to get rid of the issue by changing the access rights of the corresponding folders as required by the PHP user:

sudo chown -R www-data:www-data /var/www
sudo chmod -R g+rwX /var/www

However, still struggling because when saving a new page I get this error in the browser, now:


DokuWiki Setup Error
Something unforseen has happened: fatal: 'origin' does not appear to be a git repository fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.

Executing the git commands in the terminal it works fine:

pi@raspberrypi:/var/www/html/dokuwiki/data/gitrepo/wiki $ git commit .
[master f0f96e8] i
 1 file changed, 1 insertion(+), 6 deletions(-)
pi@raspberrypi:/var/www/html/dokuwiki/data/gitrepo/wiki $ git push
Counting objects: 4, done.
Writing objects: 100% (4/4), 286 bytes | 0 bytes/s, done.
Total 4 (delta 0), reused 0 (delta 0)
To bitbucket.org:xyz/wiki.git
   9577d31..f0f96e8  master -> master
Kirrito-k423 commented 11 months ago

I have the same question

mhoffrog commented 11 months ago

@Kirrito-k423 Please let us know the exact setup and config of your instance. There is a couple of confusion around repoPath and repoWorkDir config.

In most cases you just have to configure repoPath only and leave repoWorkDir empty!

Anyway - please let us know more details on your particular use case and on your actual configuration.