DietPi-Software | Pydio: Pretty URL rewrite required for sync clients

Created on 1 Dec 2018  ·  8Comments  ·  Source: MichaIng/DietPi

All 8 comments

@Fourdee
I will add this to v6.19 now:

  • Lighttpd according to solution in forum. Hope user can verify it's working there (with Windows client). I tested with another DietPi VM as client. Connection worked (without not), but last step to start dir sync somehow didn't start it. Pressing the button didn't have an effect. Not sure if something is missing for the client binary, since I just installed required libraries according to execution error messages. Didn't find a list about requirements and there is no installer available for the linux client, just the bare binary.
  • Apache works out of the box with .htaccess
  • Nginx still needs check, but should be fast forward with docs and similar to ownCloud/Nextcloud config.

Just found: https://github.com/Fourdee/DietPi/issues/297
~That actually gives a hint about the different required rewrite rules... Why there is no official doc about this, which all seems to be required... 🤔~
€: Nope, outdated according to: https://pydio.com/en/docs/kb/system/installing-debiannginx


No official hints here: https://pydio.com/en/docs/kb/system/installing-linux-distribution-nginx-1
WebDAV rewrites only: https://pydio.com/en/docs/kb/system/installing-freebsd-nginx-and-php-fpm
Another one 😠: https://pydio.com/en/docs/kb/system/installing-debiannginx

  • Jep finally rewrites are inside the last guide for Nginx. REST API is the one required for client sync:
        rewrite ^/dashboard|^/settings|^/welcome|^/ws- /index.php last;
        if ( !-e $request_filename ) {
                # WebDAV Rewrites
                rewrite ^/shares /dav.php last;
                # Sync client
                rewrite ^/api /rest.php last;
                # External users
                rewrite ^/user ./index.php?get_action=user_access_point last;
                # Public shares
                rewrite ^/data/public/([a-zA-Z0-9_-]+)\.php$ /data/public/share.php?hash=$1?;
        }
        rewrite ^/data/public/([a-zA-Z0-9_-]+)--([a-z]+)$ /data/public/share.php?hash=$1&lang=$2?;
        rewrite ^/data/public/([a-zA-Z0-9_-]+)$ /data/public/share.php?hash=$1?;

€: Nope:

PS: Pydio 6 Nginx Configuration

This is the old config.

  • Also those other php files do not exist on current install anymore.

Console error on pydio-ui, Linux sync client last step. This appears already regularly the whole time, but everything works until very last step... You can trigger error by pressing the last "next" button.
pydio-ui

Lighttpd

Gave up in Linux client. Most properly some library is missing.

🈯️ Test with Windows client succeeds with:

$HTTP["url"] =~ "^/pydio($|/)" {
        # Deny access to pydio/data dir
        $HTTP["url"] =~ "^/pydio/(data|conf|core)" {
                url.access-deny = ("")
        }

        # Pretty URL rewrite, required for sync clients
        url.rewrite-if-not-file = ( "^/pydio/(.+)/?$" => "/pydio/index.php/$1" )

        # Disable PHP output buffering, recommended by Pydio
        setenv.add-environment += ( "PHP_ADMIN_VALUE" => "output_buffering=Off" )

}
  • Added more access denials according to .htaccess files. Will add again more.

Nginx

Nginx example conf... to a while to find it 😆: https://github.com/pydio/pydio-core/blob/develop/core/src/nginx.conf.sample

Sadly even with redirection statement from this sample, sync on Nginx does not work 🤔

🈯️ try_files $uri $uri/ /pydio/index.php?$args;

  • Checks for file/folder existence, otherwise rewrites to index.php with args attached. This is the way to go with ~modern (actually since long time ago working) Nginx.

Done:

🈯️ Passed Windows client connection, sync and public shares

🈯️ Test install Lighttpd , not tested Sync client yet.

Need to verify:

  • Sync clients functional with:
    -- 🈯️ Lighttpd after reboot or service lighttpd force-reload
    -- 🈯️ Nginx
    -- 🈯️ Apache2

Update online doc:

Then we can mark this as completed.

@MichaIng

Works a charm, great work 👍

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pgferr picture pgferr  ·  3Comments

Fourdee picture Fourdee  ·  3Comments

oshank picture oshank  ·  3Comments

bhaveshgohel picture bhaveshgohel  ·  3Comments

1021683053 picture 1021683053  ·  3Comments