Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enabled theme app outside of OC folder doesn't work #31170

Closed
PVince81 opened this issue Apr 17, 2018 · 14 comments · Fixed by #31175
Closed

Enabled theme app outside of OC folder doesn't work #31170

PVince81 opened this issue Apr 17, 2018 · 14 comments · Fixed by #31175
Assignees
Milestone

Comments

@PVince81
Copy link
Contributor

Steps

  1. Install OC 10.0.8 RC2 from tarball inside "/srv/www/htdocs/owncloudtest"
  2. Create a folder "/srv/www/htdocs/temp" and give web server permissions
  3. Move the example theme from "/srv/www/htdocs/owncloudtest/apps/theme-example" to "/srv/www/htdocs/temp/theme-example"
  4. Adjust config.php:
 'apps_paths' => 
    array (
      0 => 
      array (
        'path' => '/srv/www/htdocs/owncloudtest/apps',
        'url' => '/apps',
        'writable' => 'false',
      ),
      1 => 
      array (
        'path' => '/srv/www/htdocs/temp',
        'url' => '/apps-temp',
        'writable' => 'true',
      ),
    ),
  1. Open the web UI as admin
  2. Go to settings and enable the theme-example app
  3. Refresh the page / log out then log in again

Expected result

Example theme applied

Actual result

Default theme still visible

Logs

Nothing

Version

ownCloud 10.0.8 RC2

@VicDeo please have a look, this is supposed to work after #30477

@VicDeo
Copy link
Member

VicDeo commented Apr 17, 2018

@PVince81 'url' should be relative to OC webroot:

 'url' => '../apps-temp',

@VicDeo
Copy link
Member

VicDeo commented Apr 17, 2018

... and for

 'path' => '/srv/www/htdocs/temp',

it should be

1 => 
      array (
        'path' => '/srv/www/htdocs/temp',
        'url' => '../temp',
        'writable' => 'true',
      ),

@ownclouders
Copy link
Contributor

GitMate.io thinks possibly related issues are #3209 (Theming), #9154 (Enable app for group only does not work.), #391 (Sharing doesn't work when picture App is enabled), #550 (folders in Pictures don't work), and #3758 (Drag & Drop folder does not work).

@PVince81
Copy link
Contributor Author

Doesn't work with either of these:

  • "../apps-temp"
  • ".../apps-temp"
  • "../temp"
  • ".../temp"

I checked that the app is enabled and force refresh the browser, no luck.

Also I settled on "../temp" and reenabled the app, also doesn't work.

A relative URL sounds like it's looking for trouble...

@PVince81
Copy link
Contributor Author

More info, something wrong with URL building:
image

Full config.php in case it's useful:

<?php
$CONFIG = array (
  'instanceid' => 'ocz6lm568ewo',
  'passwordsalt' => 'HT5rttNF6DqMLyd6c2sBzH7jr8iXqW',
  'secret' => 'QFvxBlphP3aV4WgZxMw33USPw56m+o8JbCNlhgZtDk41pLRI',
  'trusted_domains' => 
  array (
    0 => 'localhost',
  ),
  'datadirectory' => '/srv/www/htdocs/owncloudtest/data',
  'overwrite.cli.url' => 'http://localhost/owncloudtest',
  'dbtype' => 'mysql',
  'version' => '10.0.8.2',
  'dbname' => 'owncloudtest',
  'dbhost' => 'localhost',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'owncloud',
  'dbpassword' => 'owncloud42',
  'logtimezone' => 'UTC',
  'installed' => true,
 'apps_paths' => [[
        'path' => '/srv/www/htdocs/owncloudtest/apps',
        'url' => '/apps',
        'writable' => 'false',
        ], [
        'path' => '/srv/www/htdocs/temp',
        'url' => '../temp',
        'writable' => 'true',
]],
);

@VicDeo
Copy link
Member

VicDeo commented Apr 17, 2018

@PVince81 sorry, there should be two dots, not three. We don't process assets in core so they are handled by a web-server.

ok, I'm testing with http://localhost/owncloudtest base url.

@PVince81
Copy link
Contributor Author

My guess is that since the PR was merged maybe some other PR added some URL sanitization of some sorts and might discard dots.

In any case I'd have hoped for a solution that doesn't involve such hacky-looking URL prefix. Do we have this in the documentation ?

@tboerger
Copy link
Contributor

That's why the docker container adds a symlink to the custom apps folder within the document root.

@VicDeo
Copy link
Member

VicDeo commented Apr 17, 2018

In any case I'd have hoped for a solution that doesn't involve such hacky-looking URL prefix. Do we have this in the documentation ?

@PVince81 AFAIK this exact case in not documented. While url in apps_paths has the following description https://github.com/owncloud/core/blob/master/config/config.sample.php#L728

@VicDeo
Copy link
Member

VicDeo commented Apr 17, 2018

aargh. it works for http://localhost/something/owncloudtest and not for http://localhost/owncloudtest...

@VicDeo
Copy link
Member

VicDeo commented Apr 17, 2018

yep, there is a bug in OC\App\AppManager::getAppWebPath exactly for this case. It builds the URLs with double leading slash and due to this hostname is not added http://temp//theme-example/apps/files/js/files.js?v=3db57c92729c1551555f489fbdab281d

@PVince81
Copy link
Contributor Author

@VicDeo what about if the theme is in a completely different folder like "/tmp/apps" ? what would the matching URL be in that case ?

@VicDeo
Copy link
Member

VicDeo commented Apr 18, 2018

@PVince81 this case is not supported as owncloud is not capable to replace a web server currently.

@lock
Copy link

lock bot commented Jul 30, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jul 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
4 participants