From nobody Fri Feb 18 14:15:10 2022 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id B5CCE19CF3D4; Fri, 18 Feb 2022 14:15:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4K0YcZ4jskz4rRf; Fri, 18 Feb 2022 14:15:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645193710; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6BCl+fKo6SLVrJ7EUM2YutwIZWrafboU6P7fBVHlFyE=; b=uh/6mgD9x/sESvOEG5crvNy5wT3Mfz3wT1U9XEKJrfJZTwouROQcD2ihdgvYs1IQgY3Gbp h/6g3On8ocAoEP6O45J5IwW7iHPxAD1mbfcaFWrzceV5dkgwA/5jKnNkLBI9SU5lwfow4L Rz35T3F3dsnBD22j4tYosnLD/o3sw6QwpJhRp6BHWDd6kOUVdHGZwi5U0eZ1gCcJmbiX36 DSAmGEHO/jHgaodr/MIUhQ8eOnCb+NQSUcPpAFxoa6As6mPVAav+AzXu+1Dg2LAeT+O1EA gQN5RjDwF+p7mUBNMYqqecEhbrGrdA1ZLdG3qURLWNzxst7k/X/Wquz8u7/nww== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 72D701EF11; Fri, 18 Feb 2022 14:15:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 21IEFAjj023881; Fri, 18 Feb 2022 14:15:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 21IEFAju023880; Fri, 18 Feb 2022 14:15:10 GMT (envelope-from git) Date: Fri, 18 Feb 2022 14:15:10 GMT Message-Id: <202202181415.21IEFAju023880@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Mikael Urankar Subject: git: d8171126acd5 - main - www/onlyoffice-documentserver: Improve port. List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mikael X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d8171126acd5a857c056959218c8401743971444 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645193710; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6BCl+fKo6SLVrJ7EUM2YutwIZWrafboU6P7fBVHlFyE=; b=UZ8C15+XHJMWQ17bfbUbuciJMpVlU64xvfiDZrPShnLn6Z2WYz+qSoRQKacRqucLcGN2fu qOLEf9awsDu+GO5INYEw7Q1WfUR2ZCzVNcZRDdCHC6JXrV6HcxcLgBx1TP2J3KU874bLhJ z7CsAkC4ijB3S5F3G2YGgLGmeFIab/EF7F+lWol4WcsTOnR7mX0N8ZqNoilY0w7BI4E9vY aF5efizcsIVG0rSBiuzoa/d7QMqh1iJrXJ7hMUmLVNh36HaAMNkxWKg+OsRIeMk6jEqH9w EaS4pD/248mwAg8OtTnNnYDLvEjO6qJAdtFR+Oxtr17/rYJJcRrMNdVaK4lISw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1645193710; a=rsa-sha256; cv=none; b=JNAMwFJ7IyhPfsPJkAywETd5rBSd7bHLl+ro0HyQpqg8QMVDDXhYsyW8sLReovMhzrBih8 qWqCSnrpDJHc1HtJgaYO5PJfmBUpOWvYIi+mHy/yvf/MiJLa/diAZIsqv3+Gb9g38s6t7P j0MjizAetomFNrkX++aq9zAqZlsWg+HPQIU8VlvHbGCEfgrRERrF8v/00ZikHxgMxXwwlx xlRDD20jnTQ6xNSXca6z6rm3dnpkgGJvl9UPuoG9mwTbzBXUv571u1hLTqibCyqyhczask cp7ihSvpM+bcSaFPgxzm5e6xN0QsNVY5CKG9trBj5YjZnUI5c2CaYydjErT1eA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mikael: URL: https://cgit.FreeBSD.org/ports/commit/?id=d8171126acd5a857c056959218c8401743971444 commit d8171126acd5a857c056959218c8401743971444 Author: Mikael Urankar AuthorDate: 2022-02-18 14:13:57 +0000 Commit: Mikael Urankar CommitDate: 2022-02-18 14:13:57 +0000 www/onlyoffice-documentserver: Improve port. - Option'ify the database backend and add MySQL - Add a newsyslog sample file (pr 261514, submitted by Martin Waschbüsch) - Add a missing nginx sample file (ds-ssl.conf) - Fix an hardcoded /usr/local in files/patch-document-server-package_Makefile - Improve pkg-message: - Add an 'upgrade' note (suggested by bapt@) - Add instructions to use MySQL as a database server - Pass the erlang-cookie option when invoking rabbitmqctl PR: 261514 --- www/onlyoffice-documentserver/Makefile | 22 +++++++++--- .../files/onlyoffice.newsyslog.sample.in | 3 ++ .../files/patch-document-server-package_Makefile | 6 ++-- www/onlyoffice-documentserver/files/pkg-message.in | 42 ++++++++++++++-------- www/onlyoffice-documentserver/pkg-plist | 2 ++ 5 files changed, 54 insertions(+), 21 deletions(-) diff --git a/www/onlyoffice-documentserver/Makefile b/www/onlyoffice-documentserver/Makefile index d8b498b36c48..54b084dc3d05 100644 --- a/www/onlyoffice-documentserver/Makefile +++ b/www/onlyoffice-documentserver/Makefile @@ -1,6 +1,7 @@ PORTNAME= onlyoffice-documentserver DISTVERSIONPREFIX= v DISTVERSION= 7.0.0.133 +PORTREVISION= 1 CATEGORIES= www MASTER_SITES+= LOCAL/mikael/v8/:source1 \ LOCAL/mikael/onlyoffice/:source2 \ @@ -37,11 +38,10 @@ LIB_DEPENDS= libboost_regex.so:devel/boost-libs \ RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}supervisor>0:sysutils/py-supervisor@${PY_FLAVOR} \ gsed:textproc/gsed \ nginx:www/nginx \ - pg_dump:databases/postgresql${PGSQL_VER_NODOT}-server \ rabbitmq>0:net/rabbitmq \ webfonts>=0:x11-fonts/webfonts -USES= autoreconf:build dos2unix fakeroot gmake gnome iconv nodejs:16,build pgsql pkgconfig \ +USES= autoreconf:build dos2unix fakeroot gmake gnome iconv nodejs:16,build pkgconfig \ python:3.7+,build qt:5 USE_QT= qmake_build USE_GITHUB= yes @@ -73,6 +73,14 @@ GH_TUPLE= ONLYOFFICE:core:v${DISTVERSION}:core/core \ hackers-painters:katana-parser:499118d3:hackers_painters_katana/core/Common/3dParty/html/katana-parser \ google:gumbo-parser:aa91b27:google_gumbo/core/Common/3dParty/html/gumbo-parser +OPTIONS_SINGLE= DB +OPTIONS_SINGLE_DB= MYSQL PGSQL +OPTIONS_DEFAULT= PGSQL + +MYSQL_USES+= mysql:server +PGSQL_USES+= pgsql +PGSQL_VARS= WANT_PGSQL=server + BINARY_ALIAS= python=${PYTHON_CMD} USE_LDCONFIG= yes @@ -87,7 +95,8 @@ GROUPS= ${DS_GROUPNAME} PLIST_SUB= DS_GROUPNAME=${DS_GROUPNAME} \ DS_USERNAME=${DS_USERNAME} -SUB_FILES= pkg-message +SUB_FILES= pkg-message \ + onlyoffice.newsyslog.sample SUB_LIST= ETCDIR=${ETCDIR} \ PREFIX=${PREFIX} \ WWWDIR=${WWWDIR} @@ -150,6 +159,8 @@ post-patch: ${WRKSRC}/document-server-package/common/documentserver/bin/documentserver-update-securelink.sh.m4 @${REINPLACE_CMD} 's|%%DISTDIR%%|${DISTDIR}|' \ ${WRKSRC}/web-apps/build/patches/optipng-bin+5.1.0.patch + @${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|' -e 's|%%ETCDIR%%|${ETCDIR}|' \ + ${WRKSRC}/document-server-package/Makefile @${RM} ${WRKSRC}/web-apps/build/patches/optipng-bin+5.1.0.patch.orig @${FIND} ${WRKSRC}/server -type f -name npm-shrinkwrap.json -delete @@ -194,12 +205,15 @@ do-install: ${RM} ${WRKSRC}/document-server-package/common/documentserver/config/*-mac.json ${WRKSRC}/document-server-package/common/documentserver/config/*-windows.json cd ${WRKSRC}/document-server-package/common/documentserver/supervisor && ${COPYTREE_SHARE} . ${STAGEDIR}${ETCDIR}/documentserver/supervisor "-name *\.conf" cd ${WRKSRC}/document-server-package/common/documentserver/logrotate && ${COPYTREE_SHARE} . ${STAGEDIR}${ETCDIR}/documentserver/logrotate "-name *\.conf" -.for f in ds.conf includes/http-common.conf includes/ds-common.conf includes/ds-docservice.conf includes/ds-letsencrypt.conf + @${CP} ${WRKSRC}/document-server-package/common/documentserver/nginx/ds-ssl.conf.tmpl ${WRKSRC}/document-server-package/common/documentserver/nginx/ds-ssl.conf +.for f in ds.conf ds-ssl.conf includes/http-common.conf includes/ds-common.conf includes/ds-docservice.conf includes/ds-letsencrypt.conf ${INSTALL_DATA} ${WRKSRC}/document-server-package/common/documentserver/nginx/${f} ${STAGEDIR}${ETCDIR}/documentserver/nginx/${f}.sample .endfor cd ${WRKSRC}/document-server-package/common/documentserver/nginx/includes && ${COPYTREE_SHARE} . ${STAGEDIR}${ETCDIR}/documentserver/nginx/includes "-name *\.conf" cd ${WRKSRC}/document-server-package/common/documentserver/config && ${COPYTREE_SHARE} . ${STAGEDIR}${ETCDIR}/documentserver ${INSTALL_DATA} ${FILESDIR}/local.json.sample ${STAGEDIR}${ETCDIR}/documentserver + ${MKDIR} ${STAGEDIR}/${ETCDIR}/documentserver/newsyslog.conf.d + ${INSTALL_DATA} ${WRKDIR}/onlyoffice.newsyslog.sample ${STAGEDIR}/${ETCDIR}/documentserver/newsyslog.conf.d # create missing dir ${MKDIR} ${STAGEDIR}/var/log/onlyoffice/documentserver/docservice \ diff --git a/www/onlyoffice-documentserver/files/onlyoffice.newsyslog.sample.in b/www/onlyoffice-documentserver/files/onlyoffice.newsyslog.sample.in new file mode 100644 index 000000000000..f532e5cec13b --- /dev/null +++ b/www/onlyoffice-documentserver/files/onlyoffice.newsyslog.sample.in @@ -0,0 +1,3 @@ +# logfilename [owner:group] mode count size when flags [/pid_file] [sig_num] +/var/log/onlyoffice/documentserver/{converter,docservice,metrics}/*.log %%DS_USERNAME%%:%%DS_GROUPNAME%% 644 7 * @T00 BGJ /var/run/supervisor/supervisord.pid +/var/log/onlyoffice/documentserver/nginx.error.log root:wheel 644 7 * @T00 BGJ /var/run/nginx.pid diff --git a/www/onlyoffice-documentserver/files/patch-document-server-package_Makefile b/www/onlyoffice-documentserver/files/patch-document-server-package_Makefile index ce2721b5599d..a358d4276f1b 100644 --- a/www/onlyoffice-documentserver/files/patch-document-server-package_Makefile +++ b/www/onlyoffice-documentserver/files/patch-document-server-package_Makefile @@ -12,11 +12,11 @@ + AR := 7z a -y + PACKAGES = tar + DS_PREFIX := $(COMPANY_NAME_LOW)/$(PRODUCT_SHORT_NAME_LOW) -+ NGINX_CONF := /usr/local/etc/nginx/includes ++ NGINX_CONF := %%ETCDIR%%/documentserver/nginx/includes + NGINX_LOG := /var/log/$(DS_PREFIX) -+ DS_ROOT := /usr/local/www/$(DS_PREFIX) ++ DS_ROOT := %%LOCALBASE%%/www/$(DS_PREFIX) + DS_FILES := /var/db/$(DS_PREFIX) -+ DS_EXAMLE := /usr/local/www/$(DS_PREFIX)-example ++ DS_EXAMLE := %%LOCALBASE%%/www/$(DS_PREFIX)-example + DEV_NULL := /dev/null + endif ifeq ($(UNAME_S),Darwin) diff --git a/www/onlyoffice-documentserver/files/pkg-message.in b/www/onlyoffice-documentserver/files/pkg-message.in index 5e639fc9e1f1..80fa664caa16 100644 --- a/www/onlyoffice-documentserver/files/pkg-message.in +++ b/www/onlyoffice-documentserver/files/pkg-message.in @@ -19,25 +19,33 @@ upgrade Document Server to a new version and all your changes will be lost. Optionally in case of a jail with local IP and no internet access: update /etc/hosts in order to resolve your nextcloud server to its local IP -2. Configure PostgreSQL server (don't forget to change the password): - # service postgresql initdb - # service postgresql start - # psql -U postgres -c "CREATE DATABASE onlyoffice;" - # psql -U postgres -c "CREATE USER onlyoffice WITH password 'onlyoffice';" - # psql -U postgres -c "GRANT ALL privileges ON DATABASE onlyoffice TO onlyoffice;" - # psql -hlocalhost -Uonlyoffice -d onlyoffice -f %%WWWDIR%%/documentserver/server/schema/postgresql/createdb.sql +2. Set up the database (either PostgreSQL or MySQL): + For PostgreSQL (don't forget to change the password): + # service postgresql initdb + # service postgresql start + # psql -U postgres -c "CREATE DATABASE onlyoffice;" + # psql -U postgres -c "CREATE USER onlyoffice WITH password 'onlyoffice';" + # psql -U postgres -c "GRANT ALL privileges ON DATABASE onlyoffice TO onlyoffice;" + # psql -hlocalhost -Uonlyoffice -d onlyoffice -f %%WWWDIR%%/documentserver/server/schema/postgresql/createdb.sql - Optionally in case of a jail with local IP: - update /var/db/postgres/data13/pg_hba.conf accordingly + Optionally in case of a jail with local IP: + update /var/db/postgres/data13/pg_hba.conf accordingly + + For MySQL don't forget to change the password): + # service mysql-server start + # mysql -u root -p -e "CREATE DATABASE onlyoffice DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;" + # mysql -u root -p -e "CREATE USER 'onlyoffice'@'localhost' IDENTIFIED BY 'onlyoffice';" + # mysql -u root -p -e mysql -u root -p -e "GRANT ALL privileges ON onlyoffice.* TO 'onlyoffice'@'localhost';" + # mysql -u onlyoffice -p < %%WWWDIR%%/documentserver/server/schema/mysql/createdb.sql 3. Create a new rabbitmq user for the ONLYOFFICE Document Server configuration (don't forget to change the password): # service rabbitmq start - # rabbitmqctl add_user onlyoffice password - # rabbitmqctl set_user_tags onlyoffice administrator - # rabbitmqctl set_permissions -p / onlyoffice ".*" ".*" ".*" + # rabbitmqctl --erlang-cookie `cat /var/db/rabbitmq/.erlang.cookie` add_user onlyoffice password + # rabbitmqctl --erlang-cookie `cat /var/db/rabbitmq/.erlang.cookie` set_user_tags onlyoffice administrator + # rabbitmqctl --erlang-cookie `cat /var/db/rabbitmq/.erlang.cookie` set_permissions -p / onlyoffice ".*" ".*" ".*" and change it in %%ETCDIR%%/documentserver/local.json accordingly. -4. Setup supervisord in order to execute documentserver services: +4. Set up supervisord in order to execute documentserver services: - let supervisord.conf load files contained in this directory by adding to %%PREFIX%%/etc/supervisord.conf: [include] @@ -46,7 +54,7 @@ files = %%ETCDIR%%/documentserver/supervisor/*.conf - start supervisord: # service supervisord start -5. Setup nginx: +5. Set up nginx: - nginx sample configuration files are located in: %%ETCDIR%%/documentserver/nginx Do not edit them as they will be restored everytime the port is updated. @@ -61,6 +69,12 @@ files = %%ETCDIR%%/documentserver/supervisor/*.conf 8. Enjoy. +EOM +} +{ type: upgrade + message: <