Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 14 Oct 2018 15:27:58 +0000 (UTC)
From:      Bernard Spil <brnrd@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r482045 - in head/www/nextcloud: . files
Message-ID:  <201810141527.w9EFRwxP074681@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: brnrd
Date: Sun Oct 14 15:27:57 2018
New Revision: 482045
URL: https://svnweb.freebsd.org/changeset/ports/482045

Log:
  www/nextcloud: Fix fresh installs
  
   - Add minimal configuration sample for bundled installer
   - Fix default logging configuration
   - Old sample configuration is actually documentation
  
  Reported by:    miwi
  Approved by:    miwi

Added:
  head/www/nextcloud/files/config.sample.php.in   (contents, props changed)
  head/www/nextcloud/files/patch-config_config.documented.php
     - copied, changed from r482044, head/www/nextcloud/files/patch-config_config.sample.php
Deleted:
  head/www/nextcloud/files/patch-config_config.sample.php
Modified:
  head/www/nextcloud/Makefile
  head/www/nextcloud/files/pkg-message.in
  head/www/nextcloud/pkg-plist

Modified: head/www/nextcloud/Makefile
==============================================================================
--- head/www/nextcloud/Makefile	Sun Oct 14 14:54:59 2018	(r482044)
+++ head/www/nextcloud/Makefile	Sun Oct 14 15:27:57 2018	(r482045)
@@ -2,6 +2,7 @@
 
 PORTNAME=	nextcloud
 DISTVERSION=	14.0.1
+PORTREVISION=	1
 CATEGORIES=	www
 MASTER_SITES=	https://download.nextcloud.com/server/releases/
 PKGNAMESUFFIX=	${PHP_PKGNAMESUFFIX}
@@ -22,7 +23,7 @@ NEXTCLOUD_GROUPNAME?=	${WWWGRP}
 WRKSRC=		${WRKDIR}/${PORTNAME}
 NO_BUILD=	yes
 NO_ARCH=	yes
-SUB_FILES=	pkg-message
+SUB_FILES=	config.sample.php pkg-message
 PLIST_SUB=	NEXTCLOUD_USERNAME=${NEXTCLOUD_USERNAME} \
 		NEXTCLOUD_GROUPNAME=${NEXTCLOUD_GROUPNAME}
 
@@ -67,15 +68,21 @@ RUN_DEPENDS+=   ${PHPBASE}/lib/php/${PHP_EXT_DIR}/apcu
 .	endif
 .endif
 
+post-extract:
+	@${MV} ${WRKSRC}/config/config.sample.php ${WRKSRC}/config/config.documented.php
+
 post-patch:
-	@${REINPLACE_CMD} -e 's|/var/www/${PORTNAME}|${WWWDIR}|' ${WRKSRC}/config/config.sample.php
+	@${REINPLACE_CMD} -e 's|/var/www/${PORTNAME}|${WWWDIR}|;s|/var/log/|/var/log/${PORTNAME}/|' \
+		${WRKSRC}/config/config.documented.php
 	@${MV} ${WRKSRC}/apps ${WRKSRC}/apps-pkg
 
 do-install:
 	@${MKDIR} -m 0755 ${STAGEDIR}${WWWDIR}
 	@cd ${WRKSRC} && ${COPYTREE_SHARE} . ${STAGEDIR}${WWWDIR}
+	@${INSTALL_SCRIPT} ${WRKDIR}/config.sample.php ${STAGEDIR}${WWWDIR}/config/config.sample.php
 	@${RM} ${STAGEDIR}${WWWDIR}/updater/updater.phar
 	@${MKDIR} ${STAGEDIR}${WWWDIR}/data
 	@${MKDIR} ${STAGEDIR}${WWWDIR}/apps
+	@${MKDIR} ${STAGEDIR}/var/log/${PORTNAME}
 
 .include <bsd.port.post.mk>

Added: head/www/nextcloud/files/config.sample.php.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/www/nextcloud/files/config.sample.php.in	Sun Oct 14 15:27:57 2018	(r482045)
@@ -0,0 +1,32 @@
+<?php
+
+/** This is the bare minimum configuration for the bundled installer
+  * to function properly.  
+  */
+
+$CONFIG = array (
+
+/** The FreeBSD package separates apps into bundled apps and user-
+  * installed apps. If this 'apps_paths' array is missing from
+  * your config, your Nextcloud installation is broken 
+  */
+  'apps_paths' =>
+  array (
+    0 =>
+    array (
+      'path' => '%%WWWDIR%%/apps',
+      'url' => '/apps',
+      'writable' => true,
+    ),
+    1 =>
+    array (
+      'path' => '%%WWWDIR%%/apps-pkg',
+      'url' => '/apps-pkg',
+      'writable' => false,
+    ),
+  ),
+
+/** Log-files belong in the appropriate location
+  */
+  'logfile' => '/var/log/nextcloud/nextcloud.log',
+);

Copied and modified: head/www/nextcloud/files/patch-config_config.documented.php (from r482044, head/www/nextcloud/files/patch-config_config.sample.php)
==============================================================================
--- head/www/nextcloud/files/patch-config_config.sample.php	Sun Oct 14 14:54:59 2018	(r482044, copy source)
+++ head/www/nextcloud/files/patch-config_config.documented.php	Sun Oct 14 15:27:57 2018	(r482045)
@@ -1,5 +1,5 @@
---- config/config.sample.php.orig	2018-03-13 18:47:31 UTC
-+++ config/config.sample.php
+--- config/config.documented.php.orig	2018-03-13 18:47:31 UTC
++++ config/config.documented.php
 @@ -818,6 +818,11 @@ $CONFIG = array(
  		'url' => '/apps',
  		'writable' => true,

Modified: head/www/nextcloud/files/pkg-message.in
==============================================================================
--- head/www/nextcloud/files/pkg-message.in	Sun Oct 14 14:54:59 2018	(r482044)
+++ head/www/nextcloud/files/pkg-message.in	Sun Oct 14 15:27:57 2018	(r482045)
@@ -4,8 +4,8 @@
 
 Please note that everything has been installed in %%WWWDIR%%.
 
-You will probably want to add an alias to your httpd.conf file, something
-like this:
+You will probably want to add an alias to your httpd.conf file,
+something like this:
 
     	Alias /nextcloud %%WWWDIR%%
 	AcceptPathInfo On
@@ -18,6 +18,9 @@ And restart Apache.
 
 The caching options require additional Nextcloud configuration, see
 https://docs.nextcloud.com/server/12/admin_manual/configuration_server/caching_configuration.html
+
+/!\ The FreeBSD package REQUIRES the apps_paths configuration as    /!\
+/!\ seen in config/config.sample.php to function                    /!\
 
 ***********************************************************************
 *                       NEXTCLOUD VERSION UPGRADE                     *

Modified: head/www/nextcloud/pkg-plist
==============================================================================
--- head/www/nextcloud/pkg-plist	Sun Oct 14 14:54:59 2018	(r482044)
+++ head/www/nextcloud/pkg-plist	Sun Oct 14 15:27:57 2018	(r482045)
@@ -1,4 +1,4 @@
-@(root,%%NEXTCLOUD_GROUPNAME%%,644) %%WWWDIR%%/.htaccess
+@(,%%NEXTCLOUD_GROUPNAME%%,644) %%WWWDIR%%/.htaccess
 @(%%NEXTCLOUD_USERNAME%%,%%NEXTCLOUD_GROUPNAME%%,664) %%WWWDIR%%/.user.ini
 %%WWWDIR%%/3rdparty/.drone.yml
 %%WWWDIR%%/3rdparty/.gitignore
@@ -10630,12 +10630,9 @@
 %%WWWDIR%%/apps-pkg/workflowengine/lib/Manager.php
 %%WWWDIR%%/apps-pkg/workflowengine/lib/Settings/Section.php
 %%WWWDIR%%/apps-pkg/workflowengine/templates/admin.php
-@group %%NEXTCLOUD_GROUPNAME%%
-%%WWWDIR%%/config/.htaccess
-@owner %%NEXTCLOUD_USERNAME%%
-%%WWWDIR%%/config/config.sample.php
-@owner
-@group
+@(,%%NEXTCLOUD_GROUPNAME%%,644) %%WWWDIR%%/config/.htaccess
+@sample(%%NEXTCLOUD_USERNAME%%,%%NEXTCLOUD_GROUPNAME%%,640) %%WWWDIR%%/config/config.sample.php %%WWWDIR%%/config/config.php
+%%WWWDIR%%/config/config.documented.php
 %%WWWDIR%%/console.php
 %%WWWDIR%%/core/Application.php
 %%WWWDIR%%/core/BackgroundJobs/BackgroundCleanupUpdaterBackupsJob.php
@@ -13299,6 +13296,9 @@
 %%WWWDIR%%/version.php
 @dir %%WWWDIR%%/apps-pkg
 @dir %%WWWDIR%%/apps-pkg/gallery/documentation/wiki
-@dir(%%NEXTCLOUD_USERNAME%%,%%NEXTCLOUD_GROUPNAME%%,) %%WWWDIR%%/apps
-@dir(%%NEXTCLOUD_USERNAME%%,%%NEXTCLOUD_GROUPNAME%%,) %%WWWDIR%%/config
-@dir(%%NEXTCLOUD_USERNAME%%,%%NEXTCLOUD_GROUPNAME%%,) %%WWWDIR%%/data
+@owner %%NEXTCLOUD_USERNAME%%
+@group %%NEXTCLOUD_GROUPNAME%%
+@dir %%WWWDIR%%/apps
+@dir %%WWWDIR%%/config
+@dir %%WWWDIR%%/data
+@dir /var/log/nextcloud



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201810141527.w9EFRwxP074681>