YunoHost-Apps / dokuwiki_ynh

Dokuwiki package for YunoHost
https://www.dokuwiki.org/dokuwiki
GNU General Public License v3.0
11 stars 16 forks source link

Latest update breaks installations in subfolder #57

Closed gabrielcossette closed 2 years ago

gabrielcossette commented 4 years ago

The latest update breaks Dokuwiki installations that are in a subfolder. Error 404 when we navigate to a page other than the homepage.

I guess nginx.conf must be adjusted appropriately.

Thanks!

Gofannon commented 4 years ago

Following https://forum.yunohost.org/t/official-app-dokuwiki/5366/24, could you share:

  1. Nginx config https://github.com/YunoHost/doc/blob/master/troubleshooting_guide.md#application-configuration
  2. Nginx logs https://github.com/YunoHost/doc/blob/master/troubleshooting_guide.md#logs-1
  3. Could you try to access the wiki in a private browser windows ?
  4. Does it works if you install of new DokuWiki instance?
    1. on a dedicated domain ?
    2. in a subpath ?
gabrielcossette commented 4 years ago

Very weird, I didn't experience the issue on a brand new install in a subpath and the 2 Nginx configs look the same! Also private browser window doesn't change anything.

Nginx config:

# config built from these sources:
# https://www.dokuwiki.org/install:nginx
# https://www.nginx.com/resources/wiki/start/topics/recipes/dokuwiki/
# https://forum.dokuwiki.org/thread/17126

 rewrite ^/bf$ /bf/ permanent;
location /bf/ {

  # Path to source
  alias /var/www/dokuwiki__4/ ;

  # Force usage of https
  if ($scheme = http) {
    rewrite ^ https://$server_name$request_uri? permanent;
  }

  index index.php;

  # Common parameter to increase upload size limit in conjuction with dedicated php-fpm file
  client_max_body_size 25M;

  try_files $uri $uri/ @dokuwiki;

  location ~ [^/]\.php(/|$) {
    fastcgi_split_path_info ^(.+?\.php)(/.*)$;
    fastcgi_pass unix:/var/run/php/php7.0-fpm-dokuwiki__4.sock;

    fastcgi_index index.php;
    include fastcgi_params;
    fastcgi_param HTTPS on if_not_empty;
    fastcgi_param REMOTE_USER     $remote_user;
    fastcgi_param PATH_INFO       $fastcgi_path_info;
    fastcgi_param SCRIPT_FILENAME $request_filename;
  }

  # Secure DokuWiki
  location ~ ^/bf/(data|conf|bin|inc)/ {
    deny all;
  }

  # Deny Access to htaccess-Files for Apache
  location ~ /\.ht {
    deny all;
  }

  # Serve static files
  location ~ ^/lib.*\.(gif|png|ico|jpg)$ {
    expires 30d;
  }

  # Include SSOWAT user panel.
  include conf.d/yunohost_panel.conf.inc;
}

# rewrites "doku.php/" out of the URLs if you set the userwrite setting to .htaccess in dokuwiki confi$
location @dokuwiki {
  rewrite ^/bf/_media/(.*)          /bf/lib/exe/fetch.php?media=$1 last;
  rewrite ^/bf/_detail/(.*)         /bf/lib/exe/detail.php?media=$1 last;
  rewrite ^/bf/_export/([^/]+)/(.*) /bf/doku.php?do=export_$1&id=$2 last;
  # Specifig to "tag plugin". Added here to allow plugin to work if installed
  rewrite ^/bf/tag/(.*)             /bf/doku.php?id=tag:$1&do=showtag&tag=tag:$1 last;
  rewrite ^/bf/(.*)                 /bf/doku.php?id=$1&$args last;
}

Nginx log example: "GET /bf/documents HTTP/2.0" 404 618 "https://xxxxx.xxx/bf/doku.php?id=documents"

I'm stumped...

Gofannon commented 4 years ago

Well, only nginx config has been changed so I don't know what happened :/

Gofannon commented 4 years ago

Bug identified and fix is on the way. I will push a testing version in the following days.

Gofannon commented 4 years ago

Fix to be reviewed https://github.com/YunoHost-Apps/dokuwiki_ynh/pull/61

Gofannon commented 4 years ago

Hello, it should be fixed in the testing version. Could you try it and give a feedback?

sudo yunohost app install https://github.com/YunoHost-Apps/dokuwiki_ynh/tree/testing --debug
or
sudo yunohost app upgrade dokuwiki -u https://github.com/YunoHost-Apps/dokuwiki_ynh/tree/testing --debug
Gofannon commented 4 years ago

It should be fixed with lastest version!