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

Improve app installation experience #8742

Closed
BernhardPosselt opened this issue May 27, 2014 · 11 comments
Closed

Improve app installation experience #8742

BernhardPosselt opened this issue May 27, 2014 · 11 comments

Comments

@BernhardPosselt
Copy link
Contributor

I think it makes sense to discuss this in a seperate thread (see #8736)

TL;DR: Get rid of app.php and routes.php and move stuff to config files to prevent apps from breaking owncloud and improve installation UX

PHP is an interpreted language. That means that we cant use a new compiler to use newer features. PHP's exception handling is also bad: You can't test if an app has syntax errors and if it does and you enable it, it will break every request where the file is included (or if you can, please let me know). So you can't compare it to an Android app since an android app cant brick your phone if you install it.

Problems

This leads to the following problems:

  • The user can install an app and "brick" his owncloud installation. As in it will be a white page. He then needs to check the logs and run commands from the CLI or on database commandline or connect via ftp/sftp to his install and remove the folder to fix it.
  • There is no way to tell the user in advance that this will not work on his install
  • There is no way to hint the user what he needs to do after install
  • If an app runs in the background (no navigation entry), theres no way to notify the user except for logging to the error log -> admin needs to read the owncloud.log continously after each app installation to see if it works fine

Solutions

Possible solutions that come to my mind:

  • Add those dependencies in the info.xml: easy for app developers to use, can be read from other applications (appstore could parse it for instance and show more information/link to docs)
  • Add a preinstall hook: appinfo/pre_install.php for instance where you can throw exceptions that are rendered on the install page. Not universally usable and error prone, but its something.

Further thoughts

Other things that can be improved by modifying the info.xml:

  • Add cronjobs: The appstore could add a hint that you need background jobs for it, after install it could check if cronjobs are set up/show the user a link to the cronjob setup documentation
  • Add hooks: Could be cached, would allow to get rid of app.php
  • Add navigation entries: can be cached, appstore could distinguish between background apps and apps that have a UI
  • Add php extension deps: It could require extensions such as php-curl pre install. That would make it possible to add documentation and hints what extensions need to be installed and what are optional and give the admin a quick overview over what additional steps need to be done
  • Add php version: This would prevent the app from bricking an installation on 5.3 if it uses features in 5.4. This will mainly hurt enterprise customers since everyone else usually runs newer PHP versions. It is not my or any app developers' job to care for enterprise customers (just sayin :P)
  • Add owncloud app dependencies: I should be able to write an app that interfaces with the calendar app, for instance Tasks can add entries to the calendar as a reminder, news could add bookmarks, etc. This could highlight what additional value you get if you have further apps installed and will also instantly show you at install that you cant use the tasks app if the calendar app is not there. I know that app dependencies are a bit more complex but it would be nice to tell the user what he needs before he installs the app.
  • Add scripts and css for every page: Would allow owncloud to cache this and become faster, also gets rid of one major usecase for having an app.php

All of the above mentioned improvements could be cached and would get rid of almost all cases where you need to include the app.php

The benefit is that it would be faster and since the app.php would not have to be included on every request it would significantly reduce the risk that a broken version (or PHP 5.4/5.5 version) of the app will completely brick the installation.

The problem of bricking the install could be further reduced by also having the routes in a seperate config file instead of appinfo/routes.php, just a thought

All these proposals are backwards compatible and would make owncloud more solid.

@karlitschek @jancborchardt @PVince81 @DeepDiver1975 @MorrisJobke

@jancborchardt
Copy link
Member

I can’t say much to the technical stuff here, but in general it sounds good if it solves the problem that people can brick their installation.

One note about the app dependencies: All of these should be fully optional enhancements. (The Tasks and Calendar dependency example because of CalDAV is a different issue though: #5939 )

cc app developers like @jbtbnl @LEDfan @georgehrke

@BernhardPosselt
Copy link
Contributor Author

@jancborchardt sure, would still be nice if we could tell users on install what the app depends on.

The dependencies should only be checked on install, no need to pull everything from the appstore. What I mean is we dont need to build a package manager. But if someone writes an app that adds TT-RSS api to owncloud news it should obviously only be installable if news is installed (or at least hint the user: hey this wont work without news)

@jbtbnl
Copy link
Contributor

jbtbnl commented Aug 31, 2014

A work in progress is going on at #10777

@MorrisJobke
Copy link
Contributor

Nice summary of the problems and implementable solutions.

@DeepDiver1975
Copy link
Member

Add owncloud app dependencies: I should be able to write an app that interfaces with the calendar app, for instance Tasks can add entries to the calendar as a reminder, news could add bookmarks, etc. This could highlight what additional value you get if you have further apps installed and will also instantly show you at install that you cant use the tasks app if the calendar app is not there. I know that app dependencies are a bit more complex but it would be nice to tell the user what he needs before he installs the app.

This violates the owncloud architecture principle - if apps need to interact APIs in core have to be provided

@DeepDiver1975
Copy link
Member

Add scripts and css for every page: Would allow owncloud to cache this and become faster, also gets rid of one major usecase for having an app.php

No necessary from my pov as we have assetic in place which will generate conactenated js and css files for every page - minification to be added ...

@BernhardPosselt
Copy link
Contributor Author

IMO each app should be responsible for minification since it's so easy to do with grunt

@BernhardPosselt
Copy link
Contributor Author

Yeah we can remove the app dependency stuff if we do it similarly to android, see the calendar and contacts libs

@DeepDiver1975 DeepDiver1975 modified the milestone: backlog Mar 21, 2015
@phsc84
Copy link

phsc84 commented Mar 26, 2015

Is this already resolved, thanks to #10777, which has been resolved? Or is still something missing here?

@PVince81
Copy link
Contributor

PVince81 commented Oct 7, 2016

A lot has improved already and app dependencies check were added as well.

There was also another PR a while ago in 9.0 that would check whether an app bricks OC directly after enabling it and then disables it again: #17451

I'm closing this now. If you think there are additional cases missing where OC bricks itself, feel free to reopen.

@PVince81 PVince81 closed this as completed Oct 7, 2016
@lock
Copy link

lock bot commented Aug 3, 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 Aug 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants