Skip to content

Commit

Permalink
Merge pull request #622 from YunoHost-Apps/testing
Browse files Browse the repository at this point in the history
Testing / switch to packaging V2 + proper mail config
  • Loading branch information
ericgaspar authored Jan 11, 2024
2 parents 9c6d1ee + b4f66f6 commit 3e60bac
Show file tree
Hide file tree
Showing 31 changed files with 439 additions and 930 deletions.
24 changes: 2 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ Nextcloud Hub is a fully open-source on-premises content collaboration platform.

### YunoHost-specific features

In addition to Nextcloud core features, the following are made available with
this package:
In addition to Nextcloud core features, the following are made available with this package:

* Integrate with YunoHost users and SSO - i.e. logout button
* Allow one user to be the administrator (set at the installation)
Expand All @@ -30,33 +29,14 @@ this package:
* Serve `/.well-known` paths for CalDAV and CardDAV on the domain only if it's not already served - i.e. by Baïkal


**Shipped version:** 27.1.4~ynh1
**Shipped version:** 28.0.1~ynh1

**Demo:** https://demo.nextcloud.com/

## Screenshots

![Screenshot of Nextcloud](./doc/screenshots/screenshot.png)

## Disclaimers / important information

### Configure ONLYOFFICE integration

#### With Nextcloud App (no ARM support, lower performance)

Starting from Nextcloud 18, it features a direct integration of ONLYOFFICE (an online rich text document editor) through a Nextcloud app.
To install and configure it:
- Install *Community Document Server* application in your Nextcloud. That's the part that runs ONLYOFFICE server.
- Install *ONLYOFFICE* application. That's the client part that will connect to an ONLYOFFICE server.
- Then in Settings -> ONLYOFFICE (`https://yourdomain.tld/nextcloud/settings/admin/onlyoffice`), if you want to configure which file formats should be opened by ONLYOFFICE.
- Here you go :) You should be able to create new type of documents and open them.

*NB: ONLYOFFICE Nextcloud App is only available for x86 architecture - for **ARM** architecture (Raspberry Pi, OLinuXino...), consider the YunoHost App below*

#### With YunoHost App (ARM64 support, better performance)

For better performance and ARM64 support, install ONLYOFFICE YunoHost App and connect it to Nextcloud, see the tutorial in the [doc of onlyoffice_ynh package](https://github.com/YunoHost-Apps/onlyoffice_ynh/blob/master/README_fr.md#configuration-de-onlyoffice-server)

## Documentation and resources

* Official app website: <https://nextcloud.com>
Expand Down
21 changes: 1 addition & 20 deletions README_fr.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,33 +29,14 @@ En plus des fonctionnalités principales de Nextcloud, les fonctionnalités suiv
* Utilise l'adresse `/.well-known` pour la synchronisation CalDAV et CardDAV du domaine si aucun autre service ne l'utilise déjà - par exemple, Baïkal


**Version incluse :** 27.1.4~ynh1
**Version incluse :** 28.0.1~ynh1

**Démo :** https://demo.nextcloud.com/

## Captures d’écran

![Capture d’écran de Nextcloud](./doc/screenshots/screenshot.png)

## Avertissements / informations importantes

### Configurer l'intégration d'ONLYOFFICE

#### Avec l'application Nextcloud (pas de support ARM, performances limitées)

À partir de sa version 18, Nextcloud inclut une intégration directe de ONLYOFFICE (un éditeur de texte enrichi en ligne) via une application Nextcloud.
Pour l'installer et la configurer :
- Installez l'application *Community Document Server* dans votre Nextcloud. C'est la partie qui fait tourner un serveur ONLYOFFICE.
- Installez l'application *ONLYOFFICE*. C'est la partie cliente qui va se connecter au serveur ONLYOFFICE.
- Ensuite dans les Paramètres -> ONLYOFFICE (`https://yourdomain.tld/nextcloud/settings/admin/onlyoffice`), si vous voulez configurer quels formats de fichier s'ouvrent avec ONLYOFFICE.
- Et voilà :) Vous devriez pouvoir créer de nouveaux types de documents, et les ouvrir.

*NB : l'app Nextcloud ONLYOFFICE Community Document Server n'est disponible que sous architecture x86 - Pour un support de l'architecture **ARM** (Raspberry Pi, OLinuXino...), installez plutôt l'App YunoHost, voir ci-dessous*

#### Avec l'application YunoHost (support ARM64, meilleures performances)

Pour de meilleures performances et le support de ARM64, installez l'app YunoHost ONLYOFFICE, voir le tutoriel dans la [doc du paquet onlyoffice_ynh](https://github.com/YunoHost-Apps/onlyoffice_ynh/blob/master/README_fr.md#configuration-de-onlyoffice-server)

## Documentations et ressources

* Site officiel de l’app : <https://nextcloud.com>
Expand Down
27 changes: 0 additions & 27 deletions check_process

This file was deleted.

18 changes: 17 additions & 1 deletion conf/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,23 @@
},
"hashing_default_password": true,
"localstorage.allowsymlinks": true,
"simpleSignUpLink.shown": false
"simpleSignUpLink.shown": false,
"mail_smtpmode": "smtp",
"mail_smtpport": "25",
"mail_smtpauth": 1,
"mail_smtpname": "__APP__",
"mail_smtppassword": "__MAIL_PWD__",
"mail_sendmailmode": "smtp",
"mail_from_address": "__APP__",
"mail_domain": "__DOMAIN__",
"mail_smtphost": "localhost",
"mail_smtpstreamoptions": {
"ssl": {
"allow_self_signed": true,
"verify_peer": false,
"verify_peer_name": false
}
}
},
"apps": {
"user_ldap": {
Expand Down
18 changes: 9 additions & 9 deletions conf/config_install.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"system": {
"datadirectory": "__DATADIR__",
"trusted_domains": [
"localhost",
"__DOMAIN__"
]
}
}
{
"system": {
"datadirectory": "__DATA_DIR__/data/",
"trusted_domains": [
"localhost",
"__DOMAIN__"
]
}
}
2 changes: 1 addition & 1 deletion conf/extra_php-fpm.conf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ php_value[opcache.interned_strings_buffer]=32
php_value[opcache.max_accelerated_files]=10000
php_value[opcache.memory_consumption]=128
php_value[opcache.save_comments]=1
php_value[opcache.revalidate_freq]=1
php_value[opcache.revalidate_freq]=60
; https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/caching_configuration.html#id1
php_value[apc.enabled]=1
php_value[apc.enable_cli]=1
2 changes: 1 addition & 1 deletion conf/nextcloud.cron
Original file line number Diff line number Diff line change
@@ -1 +1 @@
*/5 * * * * __APP__ /usr/bin/php__PHPVERSION__ --define apc.enable_cli=1 -f __FINAL_PATH__/cron.php
*/5 * * * * __APP__ /usr/bin/php__PHPVERSION__ --define apc.enable_cli=1 -f __INSTALL_DIR__/cron.php
62 changes: 43 additions & 19 deletions conf/nginx.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# Add .mjs as a file extension for javascript
# Either include it in the default mime.types list
# or include you can include that list explicitly and add the file extension
# only for Nextcloud like below:
include mime.types;
types {
text/javascript js mjs;
}

location ^~ /.well-known {
# The following 6 rules are borrowed from `.htaccess`

Expand All @@ -9,29 +18,21 @@ location ^~ /.well-known {
location = /.well-known/carddav { return 301 __PATH__/remote.php/dav/; }
location = /.well-known/caldav { return 301 __PATH__/remote.php/dav/; }

location = /.well-known/webfinger { return 301 __PATH__/index.php$uri; }
location = /.well-known/webfinger { return 301 __PATH__/index.php$request_uri; }
location = /.well-known/nodeinfo { return 301 __PATH__/index.php$uri; }

try_files $uri $uri/ =404;
# Let Nextcloud's API for `/.well-known` URIs handle all other
# requests by passing them to the front-end controller.
return 301 __PATH__/index.php$request_uri;
}

#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent;
location ^~ __PATH__/ {

# Path to source
alias __FINALPATH__/;
alias __INSTALL_DIR__/;

# Add headers to serve security related headers
more_set_headers "Strict-Transport-Security: max-age=15768000; includeSubDomains; preload;";
more_set_headers "Referrer-Policy: no-referrer";
more_set_headers "X-Content-Type-Options: nosniff";
more_set_headers "X-Download-Options: noopen";
more_set_headers "X-Frame-Options: SAMEORIGIN";
more_set_headers "X-Permitted-Cross-Domain-Policies: none";
more_set_headers "X-Robots-Tag: noindex, nofollow";
more_set_headers "X-XSS-Protection: 1; mode=block";

# Set max upload size
# set max upload size and increase upload timeout:
client_max_body_size 10G;
client_body_timeout 300s;
fastcgi_buffers 64 4K;
Expand All @@ -53,6 +54,16 @@ location ^~ __PATH__/ {
# for tunning hints
client_body_buffer_size 512k;

# HTTP response headers borrowed from Nextcloud `.htaccess`
more_set_headers "Strict-Transport-Security: max-age=15768000; includeSubDomains; preload;";
more_set_headers "Referrer-Policy: no-referrer";
more_set_headers "X-Content-Type-Options: nosniff";
more_set_headers "X-Download-Options: noopen";
more_set_headers "X-Frame-Options: SAMEORIGIN";
more_set_headers "X-Permitted-Cross-Domain-Policies: none";
more_set_headers "X-Robots-Tag: noindex, nofollow";
more_set_headers "X-XSS-Protection: 1; mode=block";

# Remove X-Powered-By, which is an information leak
fastcgi_hide_header X-Powered-By;

Expand Down Expand Up @@ -80,7 +91,7 @@ location ^~ __PATH__/ {
log_not_found off;
access_log off;
}

# Rules borrowed from `.htaccess` to hide certain paths from clients
location ~ ^__PATH__/(?:build|tests|config|lib|3rdparty|templates|data)(?:$|/) { return 404; }
location ~ ^__PATH__/(?:\.|autotest|occ|issue|indie|db_|console) { return 404; }
Expand All @@ -91,8 +102,6 @@ location ^~ __PATH__/ {
# `/nextcloud/index.php` to the URI, resulting in a HTTP 500 error response.
location ~ \.php(?:$|/) {
# Required for legacy support
# https://github.com/nextcloud/documentation/pull/2197#issuecomment-721432337
# This line fix the ldap admin page
rewrite ^__PATH__/(?!index|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|ocs-provider\/.+|.+\/richdocumentscode\/proxy) __PATH__/index.php$request_uri;

fastcgi_split_path_info ^(.+?\.php)(/.*)$;
Expand All @@ -107,17 +116,27 @@ location ^~ __PATH__/ {

fastcgi_param modHeadersAvailable true; # Avoid sending the security headers twice
fastcgi_param front_controller_active true; # Enable pretty urls
fastcgi_param HTTP_ACCEPT_ENCODING ""; # Disable encoding of nextcloud response to inject ynh scripts
fastcgi_param HTTP_ACCEPT_ENCODING ""; # Disable encoding of Nextcloud response to inject ynh scripts
fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock;

fastcgi_intercept_errors on;
fastcgi_request_buffering off;

fastcgi_read_timeout 600;
fastcgi_send_timeout 600;
fastcgi_connect_timeout 600;
proxy_connect_timeout 600;
proxy_send_timeout 600;
proxy_read_timeout 600;
send_timeout 600;
}

location ~ ^__PATH__/(?:updater|ocs-provider)(?:$|/) {
try_files $uri/ =404;
index index.php;
}

# Serve static files
location ~ \.(?:css|js|mjs|svg|gif|png|jpg|ico|wasm|tflite|map)$ {
try_files $uri / __PATH__/index.php$request_uri;
expires 6M; # Cache-Control policy borrowed from `.htaccess`
Expand All @@ -134,8 +153,13 @@ location ^~ __PATH__/ {
access_log off; # Optional: Don't log access to assets
}

# Rule borrowed from `.htaccess`
location __PATH__/remote {
return 301 __PATH__/remote.php$request_uri;
}

location ~ / {
if ($request_method ~ ^(PUT|DELETE|PATCH)$) {
if ($request_method ~ ^(PUT|DELETE|PATCH|PROPFIND|PROPPATCH)$) {
rewrite ^ __PATH__/index.php$request_uri last;
}
try_files $uri / __PATH__/index.php$request_uri;
Expand Down
24 changes: 24 additions & 0 deletions doc/ADMIN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
### Manually running Nextcloud commands

You can run Nextcloud commands from the command line using:

```
sudo -u __APP__ php__YNH_PHP_VERSION__ --define apc.enable_cli=1 __INSTALL_DIR__/occ ...
```

Alternatively, you may open a 'Nextcloud shell' with `sudo yunohost app shell __APP__`, then run `php occ ...`

### ONLYOFFICE integration

ONLYOFFICE is an online rich text document editor which can be integrated in Nextcloud

#### With YunoHost App (ARM64 support, better performance)

For better performance and ARM64 support (Raspberry Pi, OLinuXino...), install the [OnlyOffice YunoHost app](https://apps.yunohost.org/app/onlyoffice) and connect it to Nextcloud, see the tutorial in the [doc of onlyoffice_ynh package](https://github.com/YunoHost-Apps/onlyoffice_ynh/blob/master/README_fr.md#configuration-de-onlyoffice-server)

#### Alternative: With Nextcloud App (no ARM support, lower performance)

Nextcloud features a direct integration of ONLYOFFICE through a Nextcloud app.
- Install *Community Document Server* application in your Nextcloud. That's the part that runs ONLYOFFICE server.
- Install *ONLYOFFICE* application. That's the client part that will connect to an ONLYOFFICE server.
- Then in Settings -> ONLYOFFICE (`https://__DOMAIN____PATH__/settings/admin/onlyoffice`), if you want to configure which file formats should be opened by ONLYOFFICE.
24 changes: 24 additions & 0 deletions doc/ADMIN_fr.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
### Exécuter manuellement des commandes Nextcloud

Vous pouvez lancer des commandes Nextcloud depuis la ligne de commande avec:

```
sudo -u __APP__ php__YNH_PHP_VERSION__ --define apc.enable_cli=1 __INSTALL_DIR__/occ ...
```

Ou bien, vous pouvez ouvrir un "shell Nextcloud" avec `sudo yunohost app shell __APP__`, puis lancer `php occ ...`

### Intégration d'ONLYOFFICE

ONLYOFFICE est un éditeur de texte enrichi en ligne qui peut s'intégrer dans Nextcloud

#### Avec l'application YunoHost (support ARM64, meilleures performances)

Pour de meilleures performances et le support de ARM64 (Raspberry Pi, OLinuXino...), installez l'[app YunoHost OnlyOffice](https://apps.yunohost.org/app/onlyoffice), puis connectez-la à Nextcloud : voir le tutoriel dans la [doc du paquet onlyoffice_ynh](https://github.com/YunoHost-Apps/onlyoffice_ynh/blob/master/README_fr.md#configuration-de-onlyoffice-server)

#### Alternative: avec l'application Nextcloud (pas de support ARM, performances limitées)

Nextcloud inclut une intégration directe via une application Nextcloud.
- Installez l'application *Community Document Server* dans votre Nextcloud. C'est la partie qui fait tourner un serveur ONLYOFFICE.
- Installez l'application *ONLYOFFICE*. C'est la partie cliente qui va se connecter au serveur ONLYOFFICE.
- Ensuite dans les Paramètres -> ONLYOFFICE (`https://__DOMAIN____PATH__/settings/admin/onlyoffice`), si vous voulez configurer quels formats de fichier s'ouvrent avec ONLYOFFICE.
3 changes: 1 addition & 2 deletions doc/DESCRIPTION.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ Nextcloud Hub is a fully open-source on-premises content collaboration platform.

### YunoHost-specific features

In addition to Nextcloud core features, the following are made available with
this package:
In addition to Nextcloud core features, the following are made available with this package:

* Integrate with YunoHost users and SSO - i.e. logout button
* Allow one user to be the administrator (set at the installation)
Expand Down
16 changes: 0 additions & 16 deletions doc/DISCLAIMER.md

This file was deleted.

16 changes: 0 additions & 16 deletions doc/DISCLAIMER_fr.md

This file was deleted.

1 change: 1 addition & 0 deletions doc/POST_UPGRADE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Note that if you've installed any third-party Nextcloud applications, they have probably been disabled. If so, you'll need to manually enable them again.
1 change: 1 addition & 0 deletions doc/POST_UPGRADE_fr.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Notez que si vous avez installé des applications Nextcloud tierces, elles sont probablement désactivées et vous devrez les réactiver manuellement.
Loading

0 comments on commit 3e60bac

Please sign in to comment.