mirror of
https://github.com/YunoHost-Apps/nextcloud_ynh.git
synced 2024-09-03 19:55:57 +02:00
commit
b4b285235a
11 changed files with 137 additions and 36 deletions
|
@ -5,7 +5,7 @@ Nextcloud for YunoHost
|
||||||
own data. A personal cloud which run on your own server. With Nextcloud
|
own data. A personal cloud which run on your own server. With Nextcloud
|
||||||
you can synchronize your files over your devices.
|
you can synchronize your files over your devices.
|
||||||
|
|
||||||
**Shipped version:** 13.0.1
|
**Shipped version:** 13.0.2
|
||||||
|
|
||||||
[](https://install-app.yunohost.org/?app=nextcloud)
|
[](https://install-app.yunohost.org/?app=nextcloud)
|
||||||

|

|
||||||
|
@ -32,6 +32,11 @@ Also, note we made the choice to disable third-parties applications at the
|
||||||
upgrade. It allows to prevent an unstable - and sometimes broken - Nextcloud
|
upgrade. It allows to prevent an unstable - and sometimes broken - Nextcloud
|
||||||
installation. You will just have to manually activate them after the upgrade.
|
installation. You will just have to manually activate them after the upgrade.
|
||||||
|
|
||||||
|
Finally, the following error message in Nextcloud logs can be safely ignored:
|
||||||
|
```
|
||||||
|
Following symlinks is not allowed ('/home/yunohost.multimedia/user/Share' -> '/home/yunohost.multimedia/share/' not inside '/home/yunohost.multimedia/user/')
|
||||||
|
```
|
||||||
|
|
||||||
## Migrate from ownCloud
|
## Migrate from ownCloud
|
||||||
|
|
||||||
**This is not considered as stable yet, please do it with care and only for
|
**This is not considered as stable yet, please do it with care and only for
|
||||||
|
|
|
@ -2,5 +2,4 @@
|
||||||
|
|
||||||
user=$1
|
user=$1
|
||||||
|
|
||||||
sudo mkdir -p /home/$user
|
|
||||||
sudo setfacl -m g:#GROUP#:rwx /home/$user
|
sudo setfacl -m g:#GROUP#:rwx /home/$user
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
"en": "Access & share your files, calendars, contacts, mail & more from any device, on your terms",
|
"en": "Access & share your files, calendars, contacts, mail & more from any device, on your terms",
|
||||||
"fr": "Consultez et partagez vos fichiers, agendas, carnets d'adresses, emails et bien plus depuis les appareils de votre choix, sous vos conditions"
|
"fr": "Consultez et partagez vos fichiers, agendas, carnets d'adresses, emails et bien plus depuis les appareils de votre choix, sous vos conditions"
|
||||||
},
|
},
|
||||||
"version": "13.0.1~ynh1",
|
"version": "13.0.2~ynh1",
|
||||||
"url": "https://nextcloud.com",
|
"url": "https://nextcloud.com",
|
||||||
"license": "AGPL-3.0",
|
"license": "AGPL-3.0",
|
||||||
"maintainer": {
|
"maintainer": {
|
||||||
|
|
25
pull_request_template.md
Normal file
25
pull_request_template.md
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
## Problem
|
||||||
|
- *Description of why you made this PR*
|
||||||
|
|
||||||
|
## Solution
|
||||||
|
- *And how you fix that*
|
||||||
|
|
||||||
|
## PR Status
|
||||||
|
- [ ] Code finished.
|
||||||
|
- [ ] Tested with Package_check.
|
||||||
|
- [ ] Fix or enhancement tested.
|
||||||
|
- [ ] Upgrade from last version tested.
|
||||||
|
- [ ] Can be reviewed and tested.
|
||||||
|
|
||||||
|
## Validation
|
||||||
|
---
|
||||||
|
*Minor decision*
|
||||||
|
- **Upgrade previous version** :
|
||||||
|
- [ ] **Code review** :
|
||||||
|
- [ ] **Approval (LGTM)** :
|
||||||
|
- [ ] **Approval (LGTM)** :
|
||||||
|
- **CI succeeded** :
|
||||||
|
[/badge/icon)](https://ci-apps-dev.yunohost.org/jenkins/job/nextcloud_ynh%20-BRANCH-%20(Official)/) *Please replace '-BRANCH-' in this link for a PR from a local branch.*
|
||||||
|
or
|
||||||
|
[/badge/icon)](https://ci-apps-dev.yunohost.org/jenkins/job/nextcloud_ynh%20PR-NUM-%20(Official_fork)/) *Replace '-NUM-' by the PR number in this link for a PR from a forked repository.*
|
||||||
|
When the PR is marked as ready to merge, you have to wait for 3 days before really merging it.
|
|
@ -6,7 +6,7 @@
|
||||||
pkg_dependencies="php5-gd php5-json php5-intl php5-mcrypt php5-curl php5-apcu php5-redis php5-ldap php5-imagick imagemagick acl tar smbclient"
|
pkg_dependencies="php5-gd php5-json php5-intl php5-mcrypt php5-curl php5-apcu php5-redis php5-ldap php5-imagick imagemagick acl tar smbclient"
|
||||||
|
|
||||||
if [ "$(lsb_release --codename --short)" != "jessie" ]; then
|
if [ "$(lsb_release --codename --short)" != "jessie" ]; then
|
||||||
pkg_dependencies="$pkg_dependencies php-zip"
|
pkg_dependencies="$pkg_dependencies php-zip php-apcu php-mbstring php-xml"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -19,10 +19,12 @@ exec_occ() {
|
||||||
php occ --no-interaction --no-ansi "$@")
|
php occ --no-interaction --no-ansi "$@")
|
||||||
}
|
}
|
||||||
|
|
||||||
# Create the external storage for the home folders and enable sharing
|
# Create the external storage for the given folders and enable sharing
|
||||||
create_home_external_storage() {
|
create_external_storage() {
|
||||||
|
local datadir="$1"
|
||||||
|
local mount_name="$2"
|
||||||
local mount_id=`exec_occ files_external:create --output=json \
|
local mount_id=`exec_occ files_external:create --output=json \
|
||||||
'Home' 'local' 'null::null' -c 'datadir=/home/$user' || true`
|
"$2" 'local' 'null::null' -c "datadir=$datadir" || true`
|
||||||
! [[ $mount_id =~ ^[0-9]+$ ]] \
|
! [[ $mount_id =~ ^[0-9]+$ ]] \
|
||||||
&& echo "Unable to create external storage" >&2 \
|
&& echo "Unable to create external storage" >&2 \
|
||||||
|| exec_occ files_external:option "$mount_id" enable_sharing true
|
|| exec_occ files_external:option "$mount_id" enable_sharing true
|
||||||
|
@ -139,7 +141,7 @@ ynh_handle_app_migration () {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CHECK IF IT HAS TO MIGRATE
|
# CHECK IF IT HAS TO MIGRATE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
migration_process=0
|
migration_process=0
|
||||||
|
@ -209,7 +211,7 @@ ynh_handle_app_migration () {
|
||||||
new_label=$(echo $new_app_id | cut -c1 | tr [:lower:] [:upper:])$(echo $new_app_id | cut -c2-)
|
new_label=$(echo $new_app_id | cut -c1 | tr [:lower:] [:upper:])$(echo $new_app_id | cut -c2-)
|
||||||
ynh_app_setting_set $new_app label $new_label
|
ynh_app_setting_set $new_app label $new_label
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# MOVE FILES TO THE NEW DESTINATION
|
# MOVE FILES TO THE NEW DESTINATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -315,3 +317,42 @@ ynh_handle_app_migration () {
|
||||||
migration_process=1
|
migration_process=1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# EXPERIMENTAL HELPERS
|
||||||
|
#=================================================
|
||||||
|
#=================================================
|
||||||
|
# YUNOHOST MULTIMEDIA INTEGRATION
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
# Install or update the main directory yunohost.multimedia
|
||||||
|
#
|
||||||
|
# usage: ynh_multimedia_build_main_dir
|
||||||
|
ynh_multimedia_build_main_dir () {
|
||||||
|
local ynh_media_release="v1.0"
|
||||||
|
local checksum="4852c8607db820ad51f348da0dcf0c88"
|
||||||
|
|
||||||
|
# Download yunohost.multimedia scripts
|
||||||
|
wget -nv https://github.com/YunoHost-Apps/yunohost.multimedia/archive/${ynh_media_release}.tar.gz
|
||||||
|
|
||||||
|
# Verify checksum
|
||||||
|
echo "${checksum} ${ynh_media_release}.tar.gz" | md5sum -c --status \
|
||||||
|
|| ynh_die "Corrupt source"
|
||||||
|
|
||||||
|
# Extract
|
||||||
|
mkdir yunohost.multimedia-master
|
||||||
|
tar -xf ${ynh_media_release}.tar.gz -C yunohost.multimedia-master --strip-components 1
|
||||||
|
./yunohost.multimedia-master/script/ynh_media_build.sh
|
||||||
|
}
|
||||||
|
|
||||||
|
# Grant write access to multimedia directories to a specified user
|
||||||
|
#
|
||||||
|
# usage: ynh_multimedia_addaccess user_name
|
||||||
|
#
|
||||||
|
# | arg: user_name - User to be granted write access
|
||||||
|
ynh_multimedia_addaccess () {
|
||||||
|
local user_name=$1
|
||||||
|
groupadd -f multimedia
|
||||||
|
usermod -a -G multimedia $user_name
|
||||||
|
}
|
||||||
|
|
|
@ -182,7 +182,11 @@ exec_occ ldap:test-config \'\' \
|
||||||
# Enable External Storage and create local mount to home folder
|
# Enable External Storage and create local mount to home folder
|
||||||
if [ $user_home -eq 1 ]; then
|
if [ $user_home -eq 1 ]; then
|
||||||
exec_occ app:enable files_external
|
exec_occ app:enable files_external
|
||||||
create_home_external_storage
|
create_external_storage "/home/\$user" "Home"
|
||||||
|
# Iterate over users to extend their home folder permissions
|
||||||
|
for u in $(ynh_user_list); do
|
||||||
|
setfacl -m g:$app:rwx "/home/$u" || true
|
||||||
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -237,6 +241,19 @@ exec_occ background:cron
|
||||||
# Set system group in hooks
|
# Set system group in hooks
|
||||||
ynh_replace_string "#GROUP#" "$app" ../hooks/post_user_create
|
ynh_replace_string "#GROUP#" "$app" ../hooks/post_user_create
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# YUNOHOST MULTIMEDIA INTEGRATION
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
# Build YunoHost multimedia directories
|
||||||
|
ynh_multimedia_build_main_dir
|
||||||
|
# Mount the user directory in Nextcloud
|
||||||
|
exec_occ app:enable files_external
|
||||||
|
create_external_storage "/home/yunohost.multimedia/\$user" "Multimedia"
|
||||||
|
create_external_storage "/home/yunohost.multimedia/share" "Shared multimedia"
|
||||||
|
# Allow nextcloud to write into these directories
|
||||||
|
ynh_multimedia_addaccess $app
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC FINALIZATION
|
# GENERIC FINALIZATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -252,13 +269,6 @@ find ${datadir}/ -type d -print0 | xargs -0 chmod 0750
|
||||||
chmod 640 "${final_path}/config/config.php"
|
chmod 640 "${final_path}/config/config.php"
|
||||||
chmod 755 /home/yunohost.app
|
chmod 755 /home/yunohost.app
|
||||||
|
|
||||||
# Iterate over users to extend their home folder permissions - for the external
|
|
||||||
# storage plugin usage - and create relevant Nextcloud directories
|
|
||||||
for u in $(ynh_user_list); do
|
|
||||||
mkdir -p "${datadir}/${u}"
|
|
||||||
setfacl -m g:$app:rwx "/home/$u" || true
|
|
||||||
done
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP LOGROTATE
|
# SETUP LOGROTATE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -134,6 +134,15 @@ for u in $(ynh_user_list); do
|
||||||
setfacl -m g:$app:rwx "/home/$u" || true
|
setfacl -m g:$app:rwx "/home/$u" || true
|
||||||
done
|
done
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# YUNOHOST MULTIMEDIA INTEGRATION
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
# Build YunoHost multimedia directories
|
||||||
|
ynh_multimedia_build_main_dir
|
||||||
|
# Allow nextcloud to write into these directories
|
||||||
|
ynh_multimedia_addaccess $app
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC FINALIZATION
|
# GENERIC FINALIZATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -175,9 +175,7 @@ do
|
||||||
# If the current version has the same major version than the next one,
|
# If the current version has the same major version than the next one,
|
||||||
# then it's the last upgrade to do
|
# then it's the last upgrade to do
|
||||||
if [ "$major_version" -eq "$current_major_version" ]; then
|
if [ "$major_version" -eq "$current_major_version" ]; then
|
||||||
current_major_version=last
|
current_major_version=last
|
||||||
# Patch nexcloud files only for the last upgrade.
|
|
||||||
cp -a ../sources/patches_last_version ../sources/patches
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Load the value for this version
|
# Load the value for this version
|
||||||
|
@ -272,7 +270,11 @@ if [ $user_home -eq 1 ]; then
|
||||||
exec_occ app:enable files_external
|
exec_occ app:enable files_external
|
||||||
exec_occ files_external:list --output=json \
|
exec_occ files_external:list --output=json \
|
||||||
| grep -q '"storage":"\\\\OC\\\\Files\\\\Storage\\\\Local"' \
|
| grep -q '"storage":"\\\\OC\\\\Files\\\\Storage\\\\Local"' \
|
||||||
|| create_home_external_storage
|
|| create_external_storage "/home/\$user" "Home"
|
||||||
|
# Iterate over users to extend their home folder permissions
|
||||||
|
for u in $(ynh_user_list); do
|
||||||
|
setfacl -m g:$app:rwx "/home/$u" || true
|
||||||
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -303,6 +305,19 @@ exec_occ background:cron
|
||||||
# Set system group in hooks
|
# Set system group in hooks
|
||||||
ynh_replace_string "#GROUP#" "$app" ../hooks/post_user_create
|
ynh_replace_string "#GROUP#" "$app" ../hooks/post_user_create
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# YUNOHOST MULTIMEDIA INTEGRATION
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
# Build YunoHost multimedia directories
|
||||||
|
ynh_multimedia_build_main_dir
|
||||||
|
# Mount the user directory in Nextcloud
|
||||||
|
exec_occ app:enable files_external
|
||||||
|
create_external_storage "/home/yunohost.multimedia/\$user" "Multimedia"
|
||||||
|
create_external_storage "/home/yunohost.multimedia/share" "Shared multimedia"
|
||||||
|
# Allow nextcloud to write into these directories
|
||||||
|
ynh_multimedia_addaccess $app
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC FINALIZATION
|
# GENERIC FINALIZATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -318,13 +333,6 @@ find ${datadir}/ -type d -print0 | xargs -0 chmod 0750
|
||||||
chmod 640 "${final_path}/config/config.php"
|
chmod 640 "${final_path}/config/config.php"
|
||||||
chmod 755 /home/yunohost.app
|
chmod 755 /home/yunohost.app
|
||||||
|
|
||||||
# Iterate over users to extend their home folder permissions - for the external
|
|
||||||
# storage plugin usage - and create relevant Nextcloud directories
|
|
||||||
for u in $(ynh_user_list); do
|
|
||||||
mkdir -p "${datadir}/${u}"
|
|
||||||
setfacl -m g:$app:rwx "/home/$u" || true
|
|
||||||
done
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# WARNING ABOUT THIRD-PARTY APPS
|
# WARNING ABOUT THIRD-PARTY APPS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -1,7 +1,11 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Last available nextcloud version
|
# Last available nextcloud version
|
||||||
next_version="13.0.1"
|
next_version="13.0.2"
|
||||||
|
|
||||||
# Nextcloud tarball checksum sha256
|
# Nextcloud tarball checksum sha256
|
||||||
nextcloud_source_sha256="5743314a71e972ae46a14b36b37394d4545915aa5f32d9e12ba786d04c1f1d11"
|
nextcloud_source_sha256="7396f98a1a53a9f4b144f55360d87c89cb6ee899feef1cfbf29a736219f9c47d"
|
||||||
|
|
||||||
|
# Patch nextcloud files only for the last version
|
||||||
|
cp -a ../sources/patches_last_version/* ../sources/patches
|
||||||
|
|
||||||
|
|
0
sources/patches/.gitignore
vendored
Normal file
0
sources/patches/.gitignore
vendored
Normal file
|
@ -1,14 +1,14 @@
|
||||||
--- a/core/Controller/LoginController.php
|
--- a/core/Controller/LoginController.php
|
||||||
+++ b/core/Controller/LoginController.php
|
+++ b/core/Controller/LoginController.php
|
||||||
@@ -100,7 +100,10 @@ class LoginController extends Controller {
|
@@ -119,7 +119,10 @@
|
||||||
}
|
}
|
||||||
$this->userSession->logout();
|
$this->userSession->logout();
|
||||||
|
|
||||||
- return new RedirectResponse($this->urlGenerator->linkToRouteAbsolute('core.login.showLoginForm'));
|
- $response = new RedirectResponse($this->urlGenerator->linkToRouteAbsolute('core.login.showLoginForm'));
|
||||||
+ $redirectUrl = $this->config->getSystemValue('logout_url',
|
+ $redirectUrl = $this->config->getSystemValue('logout_url',
|
||||||
+ $this->urlGenerator->linkToRouteAbsolute('core.login.showLoginForm')
|
+ $this->urlGenerator->linkToRouteAbsolute('core.login.showLoginForm')
|
||||||
+ );
|
+ );
|
||||||
+ return new RedirectResponse($redirectUrl);
|
+ $response = new RedirectResponse($redirectUrl);
|
||||||
|
$response->addHeader('Clear-Site-Data', '"cache", "cookies", "storage", "executionContexts"');
|
||||||
|
return $response;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue