Merge pull request #1838 from nextcloud/enh-linter-warnings

Fix some warnings
This commit is contained in:
John Molakvoæ
2020-02-24 11:09:28 +01:00
committed by GitHub
8 changed files with 52 additions and 78 deletions

View File

@@ -35,5 +35,5 @@ If you are behind a reverse proxy or load balancer it is important you make sure
setup properly. Especially the **trusted_proxies** and **forwarded_for_headers**
`config.php` variables need to be set correctly. Otherwise it can happen
that Nextcloud actually starts throttling all traffic coming from the reverse
proxy or load balancer. For more information see serverconf_reverseproxy_.
proxy or load balancer. For more information see :doc:`reverse_proxy_configuration`.

View File

@@ -399,7 +399,7 @@ Another cause of this issue could be not properly including mimetypes in the
http block, as shown `here. <https://www.nginx.com/resources/wiki/start/topics/examples/full/>`_
Upload of files greater than 10 MiB fails
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
If you configure nginx (globally) to block all requests to (hidden) dot files,
it may be not possible to upload files greater than 10 MiB using the webpage

View File

@@ -22,7 +22,7 @@ OCP event dispatcher
This mechanism is a versatile and typed approach to events in Nextcloud's php code. It uses objects rather than just passing primitives or untyped arrays. This should help provide a better developer experience while lowering the risk of unexpected changes in the API that are hard to find after the initial implementation.
Naming scheme
^^^^^^^^^^^^^
`````````````
The name should reflect the subject and the actions. Prefixing event classes with `Event` makes it easier to recognize their purpose.
@@ -35,7 +35,7 @@ Thus `BeforeUserCreatedEvent` is emitted *before* the user data is written to th
.. note:: Although you may chose to name your event classes differently, sticking to the convention will allow Nextcloud developers understand each other's apps more easily.
Writing events
^^^^^^^^^^^^^^
``````````````
As a rule events are dedicated classes extending ``\OCP\EventDispatcher\Event``.
@@ -75,7 +75,7 @@ The event above allows signalling that *something happened*. But in many cases y
}
Writing a listener
^^^^^^^^^^^^^^^^^^
``````````````````
A listener can be a simple callback function (or anything else that is `callable <https://www.php.net/manual/en/language.types.callable.php>`_, or a dedicated class.
@@ -163,7 +163,7 @@ In the ``Application.php`` the event and the listener class are connected. The c
.. note:: The listener is resolved via the DI container, therefore you can add a constructor and type-hint services required for processing the event.
Available Events
^^^^^^^^^^^^^^^^
````````````````
``\OCP\Security\CSP\AddContentSecurityPolicyEvent``
***************************************************
@@ -253,7 +253,7 @@ The hook logic should be in a separate class that is being registered in the :do
}
Available hooks
***************
```````````````
The scope is the first parameter that is passed to the **listen** method, the second parameter is the method and the third one the callback that should be executed once the hook is being called, e.g.:
@@ -281,7 +281,7 @@ Hooks can also be removed by using the **removeListener** method on the object:
The following hooks are available:
Session
*******
```````
Injectable from the ServerContainer by calling the method **getUserSession()**.
@@ -299,7 +299,7 @@ Hooks available in scope **\\OC\\User**:
* **logout** ()
UserManager
***********
```````````
Injectable from the ServerContainer by calling the method **getUserManager()**.
@@ -313,7 +313,7 @@ Hooks available in scope **\\OC\\User**:
* **postCreateUser** (\\OC\\User\\User $user, string $password)
GroupManager
^^^^^^^^^^^^
````````````
Hooks available in scope **\\OC\\Group**:
@@ -327,7 +327,7 @@ Hooks available in scope **\\OC\\Group**:
* **postCreate** (\\OC\\Group\\Group $group)
Filesystem root
^^^^^^^^^^^^^^^
```````````````
Injectable from the ServerContainer by calling the method **getRootFolder()**, **getUserFolder()** or **getAppFolder()**.
@@ -347,7 +347,7 @@ Filesystem hooks available in scope **\\OC\\Files**:
* **postRename** (\\OCP\\Files\\Node $source, \\OCP\\Files\\Node $target)
Filesystem scanner
^^^^^^^^^^^^^^^^^^
``````````````````
Filesystem scanner hooks available in scope **\\OC\\Files\\Utils\\Scanner**:

View File

@@ -31,6 +31,5 @@ App development
publicpage
testing
../api
how_to

View File

@@ -45,94 +45,67 @@ The rest of this section will cover a rough overview of which packages are provi
``@nextcloud/auth``
^^^^^^^^^^^^^^^^^^^
This package provides information about the current user and session.
`Read the full documentation <https://nextcloud.github.io/nextcloud-auth/>`_
This package provides information about the current user and session. Documentation: https://nextcloud.github.io/nextcloud-auth/
``@nextcloud/axios``
^^^^^^^^^^^^^^^^^^^
This package provides an `Axios <https://www.npmjs.com/package/axios>`_ HTTP client instance, ready to send request to the Nextcloud server. If you use this instance you do not have to care about authentication and special headers.
`Read the full documentation <https://nextcloud.github.io/nextcloud-axios/>`_
^^^^^^^^^^^^^^^^^^^^
This package provides an `Axios <https://www.npmjs.com/package/axios>`_ HTTP client instance, ready to send request to the Nextcloud server. If you use this instance you do not have to care about authentication and special headers. Documentation: https://nextcloud.github.io/nextcloud-axios/
``@nextcloud/event-bus``
^^^^^^^^^^^^^^^^^^^^^^^^
This package provides a simple event bus implementation that integrates with server and other apps. Thus it is one of the recommended ways of inter-app communication.
`Read the full documentation <https://nextcloud.github.io/nextcloud-event-bus/>`_
This package provides a simple event bus implementation that integrates with server and other apps. Thus it is one of the recommended ways of inter-app communication. Documentation: https://nextcloud.github.io/nextcloud-event-bus/
``@nextcloud/dialogs``
^^^^^^^^^^^^^^^^^^^^^^
This package provides access to UI dialogs in Nextcloud.
`Read the full documentation <https://nextcloud.github.io/nextcloud-dialogs/>`_
This package provides access to UI dialogs in Nextcloud. Documentation: https://nextcloud.github.io/nextcloud-dialogs/
``@nextcloud/files``
^^^^^^^^^^^^^^^^^^^^
This package provides helper functions around the Files app.
`Read the full documentation <https://nextcloud.github.io/nextcloud-files/>`_
This package provides helper functions around the Files app. Documentation: https://nextcloud.github.io/nextcloud-files/
``@nextcloud/initial-state``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This package provides the counterpart for the `\OCP\IInitialStateService` on the back-end. Use it to retreive your stored data on page load.
`Read the full documentation <https://nextcloud.github.io/nextcloud-initial-state/>`_
This package provides the counterpart for the `\OCP\IInitialStateService` on the back-end. Use it to retreive your stored data on page load. Documentation: https://nextcloud.github.io/nextcloud-initial-state/
``@nextcloud/l10n``
^^^^^^^^^^^^^^^^^^^
This package provides everything around localization, like access to the current user's locale and translation helpers.
`Read the full documentation <https://nextcloud.github.io/nextcloud-l10n/>`_
This package provides everything around localization, like access to the current user's locale and translation helpers. Documentation: https://nextcloud.github.io/nextcloud-l10n/
``@nextcloud/logger``
^^^^^^^^^^^^^^^^^^^^^
This package provides a unified logging helper that adds app names, severity and other context to log messages. Use it to enhance the output of your app's logs, useful for development and triaging bug reports.
`Read the full documentation <https://nextcloud.github.io/nextcloud-logger/>`_
This package provides a unified logging helper that adds app names, severity and other context to log messages. Use it to enhance the output of your app's logs, useful for development and triaging bug reports. Documentation: https://nextcloud.github.io/nextcloud-logger/
``@nextcloud/moment``
^^^^^^^^^^^^^^^^^^^^^
This package provides a modified version of `moment.js <https://momentjs.com/>`_ with the current user's locale set.
`Read the full documentation <https://nextcloud.github.io/nextcloud-moment/>`_
This package provides a modified version of `moment.js <https://momentjs.com/>`_ with the current user's locale set. Documentation: https://nextcloud.github.io/nextcloud-moment/
``@nextcloud/password-confirmation``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This package makes it possible to ask a user for confirmation on actions that have a `@PasswordConfirmationRequired` set on the controller method. Use it for critical actions.
`Read the full documentation <https://nextcloud.github.io/nextcloud-password-confirmation/>`_
This package makes it possible to ask a user for confirmation on actions that have a `@PasswordConfirmationRequired` set on the controller method. Use it for critical actions. Documentation: https://nextcloud.github.io/nextcloud-password-confirmation/
``@nextcloud/paths``
^^^^^^^^^^^^^^^^^^^^
This package provides various helpers for file and folder paths.
`Read the full documentation <https://nextcloud.github.io/nextcloud-paths/>`_
This package provides various helpers for file and folder paths. Documentation: https://nextcloud.github.io/nextcloud-paths/
``@nextcloud/router``
^^^^^^^^^^^^^^^^^^^^^
This package provides helpers to generate URLs, e.g. to access assets and REST APIs of your app or the Nextcloud server.
`Read the full documentation <https://nextcloud.github.io/nextcloud-router/>`_
This package provides helpers to generate URLs, e.g. to access assets and REST APIs of your app or the Nextcloud server. Documentation: https://nextcloud.github.io/nextcloud-router/
``@nextcloud/vue``
^^^^^^^^^^^^^^^^^^
This package provides lots of nextcloud components allowing you to quickly build UIs..
`Read the full documentation <https://nextcloud-vue-components.netlify.com/>`_
This package provides lots of nextcloud components allowing you to quickly build UIs. Documentation: https://nextcloud-vue-components.netlify.com/
Global variables
----------------

View File

@@ -71,7 +71,7 @@ Respect the users
Apps which break the guidelines will lose their 'approved' or 'official' state; and might be blocked from the app store altogether. This also has repercussions for the author, especially in case of security concerns, he/she might find themselves blocked from submitting applications.
Moving your repo to the Nextcloud organization
------------------------------------------
----------------------------------------------
We're always delighted to hear app developers are interested in moving their app to the Nextcloud organization at `github.com/nextcloud <https://github.com/nextcloud>`_! There are benefits for users and developers in being there. However, it comes with some requirements as well.
Benefits

View File

@@ -112,12 +112,10 @@ Providing the initial state with PHP
Providing state in PHP is done via the ``\OCP\IInitialStateService``. This service
has two methods you can use to provide the initial state.
* ``provideInitialState(string $appName, string $key, $data)``: Use this method
if you know for sure your state will be used. For example on the settings page
of your app.
* ``provideInitialState(string $appName, string $key, $data)``:
If you know for sure your state will be used. For example on the settings page of your app.
* ``provideLazyInitialState(string $appName, string $key, Closure $closure)``:
Use this method if you want to inject your state on a general page. For example
the initial state of the notifications app. The callback will be invoked if and only if a template is rendered.
If you want to inject your state on a general page. For example the initial state of the notifications app. The callback will be invoked if and only if a template is rendered.
You call both methods with the name of your app and a key. This is to scope
the states properly. You will need both when retrieving the initial state in

View File

@@ -83,7 +83,7 @@ SAML setup with onelogin
Collabora without SSL
-----
---------------------
**1) Start Collabora in a docker container**
@@ -115,7 +115,7 @@ Collabora without SSL
OnlyOffice
----------
1) Create self signed cert, should be on a permanent path::
1. Create self signed cert, should be on a permanent path::
mkdir -p /tmp/oo/certs
cd /tmp/oo/certs
@@ -128,20 +128,24 @@ OnlyOffice
chmod 400 onlyoffice.csr
chmod 400 dhparam.pem
2) Start docker, important: do not use certs folder, but parent folder:
docker run --name=ONLYOFFICEDOCKER -i -t -d -p 4433:443 -e JWT_ENABLED='true' -e JWT_SECRET='secret' --restart=always -v /tmp/oo/:/var/www/onlyoffice/Data onlyoffice/documentserver
2. Start docker, important: do not use certs folder, but parent folder::
docker run --name=ONLYOFFICEDOCKER -i -t -d -p 4433:443 \
-e JWT_ENABLED='true' -e JWT_SECRET='secret' --restart=always \
-v /tmp/oo/:/var/www/onlyoffice/Data onlyoffice/documentserver
3. Go into docker container:
- docker exec -it ONLYOFFICEDOCKER /bin/bash
- apt-get update
- apt-get install vim -y
- vim /etc/onlyoffice/documentserver/default.json
- change rejectUnauthorized to false
- vim /etc/onlyoffice/documentserver/local.json
- change token -> inbox -> header to "AuthorizationJWT"
- change token -> outbox -> header to "AuthorizationJWT"
- Add the following to your config.php
3) go into docker:
- docker exec -it ONLYOFFICEDOCKER /bin/bash
- apt-get update
- apt-get install vim -y
- vim ./etc/onlyoffice/documentserver/default.json
- change rejectUnauthorized to false
- vim /etc/onlyoffice/documentserver/local.json
- change token -> inbox -> header to "AuthorizationJWT"
- change token -> outbox -> header to "AuthorizationJWT"
- Add the following to your config.php:
::
'onlyoffice' => array (
@@ -150,13 +154,13 @@ docker run --name=ONLYOFFICEDOCKER -i -t -d -p 4433:443 -e JWT_ENABLED='true' -e
'jwt_header' => 'AuthorizationJWT'
),
- test with local ip: https://localhost:4433
Test with local ip: https://localhost:4433
- accept cert warning
- verify that "Document Server is running" is shown
- on Nextcloud
Test with Nextcloud
- download & enable OnlyOffice app
- configure:
- configure:
- Document Editing Service address: https://localhost:4433/
- Secret key : secret (as above)
- Document Editing Service address for internal requests from the server: https://localhost:4433/