1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/nextcloud_ynh.git synced 2024-09-03 19:55:57 +02:00

Merge pull request #117 from YunoHost-Apps/testing

Testing
This commit is contained in:
JimboJoe 2018-06-16 09:46:20 +02:00 committed by GitHub
commit b4b285235a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 137 additions and 36 deletions

View file

@ -5,7 +5,7 @@ Nextcloud for YunoHost
own data. A personal cloud which run on your own server. With Nextcloud
you can synchronize your files over your devices.
**Shipped version:** 13.0.1
**Shipped version:** 13.0.2
[![Install Nextcloud with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=nextcloud)
![](https://github.com/nextcloud/screenshots/blob/master/files/filelist.png)
@ -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
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
**This is not considered as stable yet, please do it with care and only for

View file

@ -2,5 +2,4 @@
user=$1
sudo mkdir -p /home/$user
sudo setfacl -m g:#GROUP#:rwx /home/$user

View file

@ -6,7 +6,7 @@
"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"
},
"version": "13.0.1~ynh1",
"version": "13.0.2~ynh1",
"url": "https://nextcloud.com",
"license": "AGPL-3.0",
"maintainer": {

25
pull_request_template.md Normal file
View 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** :
[![Build Status](https://ci-apps-dev.yunohost.org/jenkins/job/nextcloud_ynh%20-BRANCH-%20(Official)/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
[![Build Status](https://ci-apps-dev.yunohost.org/jenkins/job/nextcloud_ynh%20PR-NUM-%20(Official_fork)/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.

View file

@ -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"
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
#=================================================
@ -19,10 +19,12 @@ exec_occ() {
php occ --no-interaction --no-ansi "$@")
}
# Create the external storage for the home folders and enable sharing
create_home_external_storage() {
# Create the external storage for the given folders and enable sharing
create_external_storage() {
local datadir="$1"
local mount_name="$2"
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]+$ ]] \
&& echo "Unable to create external storage" >&2 \
|| exec_occ files_external:option "$mount_id" enable_sharing true
@ -315,3 +317,42 @@ ynh_handle_app_migration () {
migration_process=1
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
}

View file

@ -182,7 +182,11 @@ exec_occ ldap:test-config \'\' \
# Enable External Storage and create local mount to home folder
if [ $user_home -eq 1 ]; then
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
#=================================================
@ -237,6 +241,19 @@ exec_occ background:cron
# Set system group in hooks
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
#=================================================
@ -252,13 +269,6 @@ find ${datadir}/ -type d -print0 | xargs -0 chmod 0750
chmod 640 "${final_path}/config/config.php"
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
#=================================================

View file

@ -134,6 +134,15 @@ for u in $(ynh_user_list); do
setfacl -m g:$app:rwx "/home/$u" || true
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
#=================================================

View file

@ -176,8 +176,6 @@ do
# then it's the last upgrade to do
if [ "$major_version" -eq "$current_major_version" ]; then
current_major_version=last
# Patch nexcloud files only for the last upgrade.
cp -a ../sources/patches_last_version ../sources/patches
fi
# Load the value for this version
@ -272,7 +270,11 @@ if [ $user_home -eq 1 ]; then
exec_occ app:enable files_external
exec_occ files_external:list --output=json \
| 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
#=================================================
@ -303,6 +305,19 @@ exec_occ background:cron
# Set system group in hooks
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
#=================================================
@ -318,13 +333,6 @@ find ${datadir}/ -type d -print0 | xargs -0 chmod 0750
chmod 640 "${final_path}/config/config.php"
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
#=================================================

View file

@ -1,7 +1,11 @@
#!/bin/bash
# Last available nextcloud version
next_version="13.0.1"
next_version="13.0.2"
# 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
View file

View file

@ -1,14 +1,14 @@
--- a/core/Controller/LoginController.php
+++ b/core/Controller/LoginController.php
@@ -100,7 +100,10 @@ class LoginController extends Controller {
@@ -119,7 +119,10 @@
}
$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',
+ $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;
}
/**