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

Polls app takes for granted that it lives under /apps #249

Closed
tYYGH opened this issue Nov 19, 2017 · 12 comments
Closed

Polls app takes for granted that it lives under /apps #249

tYYGH opened this issue Nov 19, 2017 · 12 comments

Comments

@tYYGH
Copy link

tYYGH commented Nov 19, 2017

Steps to reproduce

  1. Install Nextcloud in read-only /usr, with writeable data in /var/lib/nextcloud:
    • official apps are bundled with NC under /usr,
    • extra apps get installed in /var/lib/nextcloud/apps.
  2. Install Polls: it gets installed in /var/lib/nextcloud/apps/polls, associated with URL prefix /xapps/polls.
  3. Polls mostly works.

Expected behaviour

URLs to /…/polls/img/*.svg (yes-vote, no-vote…) should depend on the path of the app itself, in my case /xapps/polls.

Actual behaviour

URLs to /…/polls/img/*.svg (yes-vote, no-vote…) are hard-coded to be /apps/polls/img/*.svg.

Server configuration

See here:
nextcloud/server#7037

Browser console: 502 bad gateway for the SVG files.
Nginx console: [error] 9068#9068: *38300 upstream prematurely closed connection while reading response header from upstream, client: 192.168.1.99, server: , request: "GET /apps/polls/img/no-vote.svg HTTP/1.1", upstream: "uwsgi://unix:/run/nextcloud:", host: "yalis.fr"
uwsgi console: GET /apps/polls/img/no-vote.svg => generated 0 bytes in 0 msecs (HTTP/1.1 500)

@dartcafe
Copy link
Collaborator

I assume the same problem as other installations have with the NC core generated css files. We should switch back from SCSS to CSS.

@splitt3r
Copy link
Contributor

Same problem with Deck and Contacts app?

@tYYGH
Copy link
Author

tYYGH commented Nov 21, 2017

Indeed, Deck and Contacts (see nextcloud/contacts#439) also have presentation issues, although I had not thought about the similarity until you pointed it out! I will try to apply the same “solution” (see #230) to those two apps…

@pixelipo
Copy link

@juliushaertl didn't you recently make a PR related to this?

@juliushaertl
Copy link
Member

Nope, but it looks like nextcloud/server#5289. @kyrofa mentioned on IRC that he is working on a fix for that.

@kyrofa
Copy link
Member

kyrofa commented Nov 23, 2017

Indeed this looks the same-- the bug only bites with scss. I have a failing unit test, just driving toward a solution. Note that the test already passes on master, so it seems this issue has been fixed there. It's just broken in v12. Can you verify?

@kyrofa
Copy link
Member

kyrofa commented Nov 23, 2017

Just tested my fix, it works. I'll clean it up and propose it either later tonight or in the morning.

@kyrofa
Copy link
Member

kyrofa commented Nov 23, 2017

Please take a look at nextcloud/server#7257 .

@tYYGH
Copy link
Author

tYYGH commented Nov 23, 2017

Thank you, @kyrofa. Unfortunately, this does not seem to fix things for me.

I downloaded https://github.com/nextcloud/server/pull/7257.patch and applied the patch on my Nextcloud installation:

[/usr/share/webapps/nextcloud]# patch -p 1 </var/tmp/nextcloud-pr-7257.patch
patching file lib/private/Template/CSSResourceLocator.php
Hunk #2 succeeded at 118 (offset -5 lines).
patching file lib/private/Template/ResourceLocator.php
can't find file to patch at input line 223
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/tests/lib/Template/CSSResourceLocatorTest.php b/tests/lib/Template/CSSResourceLocatorTest.php
|index a16cc18cb0a..ee209a599d6 100644
|--- a/tests/lib/Template/CSSResourceLocatorTest.php
|+++ b/tests/lib/Template/CSSResourceLocatorTest.php
--------------------------
File to patch:
Skip this patch? [y]
Skipping patch.
5 out of 5 hunks ignored

I also re-enabled the SCSS files:

# find /var/lib/nextcloud/apps -name '*scss.yalis-disabled' -exec bash -c 'mv "$0" "${0%.yalis-disabled}"' {} \;

Finally, I made sure to restart the server:

# systemctl restart uwsgi@nextcloud.service

Neither Contacts nor Polls sees any improvement over the result from the original code.

@pixelipo
Copy link

pixelipo commented Nov 23, 2017

@tYYGH I noticed this in your config file:

"apps_paths": [
            {
                "path": "\/usr\/share\/webapps\/nextcloud\/apps",
                "url": "\/nc\/apps",
                "writable": false
            },
            {
                "path": "\/var\/lib\/nextcloud\/apps",
                "url": "\/nc\/xapps",
                "writable": true
            }
        ],

Could it be the fact that your apps location is not writeable?

@tYYGH
Copy link
Author

tYYGH commented Nov 23, 2017

It depends on which “apps” you talk about ;-)

  • /usr is of course read-only: this is the upstream package, ie. Nextcloud + bundled apps.
  • /var is writeable; this is where Nextcloud is allowed to “grow”…

@splitt3r
Copy link
Contributor

See #250 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants