1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/xwiki_ynh.git synced 2024-09-03 20:36:11 +02:00

Merge pull request #4 from YunoHost-Apps/testing

Testing
This commit is contained in:
Josue-T 2024-01-14 18:43:02 +01:00 committed by GitHub
commit 05b381fcd2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 3032 additions and 78 deletions

View file

@ -18,7 +18,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in
XWiki is an Open Source wiki engine (LGPLv2) suitable for use by workgroups (associations, companies, etc.). The software allows the rapid creation of small applications to meet different information management needs.
**Shipped version:** 14.10.8~ynh1
**Shipped version:** 15.10.1~ynh1
**Demo:** https://playground.xwiki.org/xwiki/bin/view/Main/WebHome
@ -32,7 +32,7 @@ XWiki is an Open Source wiki engine (LGPLv2) suitable for use by workgroups (ass
* Official user documentation: <https://www.xwiki.org/xwiki/bin/view/Documentation/UserGuide/>
* Official admin documentation: <https://www.xwiki.org/xwiki/bin/view/Documentation/AdminGuide/>
* Upstream app code repository: <https://github.com/xwiki/xwiki-platform>
* YunoHost documentation for this app: <https://yunohost.org/app_xwiki>
* YunoHost Store: <https://apps.yunohost.org/app/xwiki>
* Report a bug: <https://github.com/YunoHost-Apps/xwiki_ynh/issues>
## Developer info

View file

@ -18,7 +18,7 @@ Si vous navez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po
XWiki est un moteur de wiki Open Source (LGPLv2) adapté à un usage pour des groupes de travail (associations, entreprises…). Le logiciel permet la création rapide de petites applications pour répondre à différents besoins de gestion de l'information.
**Version incluse :** 14.10.8~ynh1
**Version incluse :** 15.10.1~ynh1
**Démo :** https://playground.xwiki.org/xwiki/bin/view/Main/WebHome
@ -32,7 +32,7 @@ XWiki est un moteur de wiki Open Source (LGPLv2) adapté à un usage pour des gr
* Documentation officielle utilisateur : <https://www.xwiki.org/xwiki/bin/view/Documentation/UserGuide/>
* Documentation officielle de ladmin : <https://www.xwiki.org/xwiki/bin/view/Documentation/AdminGuide/>
* Dépôt de code officiel de lapp : <https://github.com/xwiki/xwiki-platform>
* Documentation YunoHost pour cette app : <https://yunohost.org/app_xwiki>
* YunoHost Store: <https://apps.yunohost.org/app/xwiki>
* Signaler un bug : <https://github.com/YunoHost-Apps/xwiki_ynh/issues>
## Informations pour les développeurs

266
conf/hibernate.cfg.xml Normal file
View file

@ -0,0 +1,266 @@
<!--
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->
<hibernate-configuration>
<session-factory>
<!-- Please refer to the installation guide on
https://www.xwiki.org/xwiki/bin/view/Documentation/AdminGuide/Installation/ for configuring your database.
You'll need to do 2 things:
1) Copy your database driver JAR in WEB-INF/lib or in some shared lib directory
2) Uncomment the properties below for your specific DB (and comment the default
database configuration if it doesn't match your DB)
-->
<!-- Generic parameters common to all Databases -->
<property name="hibernate.show_sql">false</property>
<property name="hibernate.use_outer_join">true</property>
<!-- Without it, some queries fail in MS SQL. XWiki doesn't need scrollable result sets, anyway. -->
<property name="hibernate.jdbc.use_scrollable_resultset">false</property>
<!-- DBCP Connection Pooling configuration. Only some properties are shown. All available properties can be found
at https://commons.apache.org/proper/commons-dbcp/configuration.html
-->
<property name="hibernate.dbcp.defaultAutoCommit">false</property>
<property name="hibernate.dbcp.maxTotal">50</property>
<property name="hibernate.dbcp.maxIdle">5</property>
<property name="hibernate.dbcp.maxWaitMillis">30000</property>
<!-- Enable JMX monitoring for DBCP -->
<property name="hibernate.dbcp.jmxName">org.apache.dbcp:DataSource=dbcp</property>
<!-- Tell Hibernate to use XWiki's custom DBCP Connection Provider so that the DBCP pool is used -->
<property name="hibernate.connection.provider_class">com.xpn.xwiki.store.DBCPConnectionProvider</property>
<!--
Keep the old behavior. The new version of hibernate tries to delete and recreate unique
constraints when updating the database schema. The problem is that an exception is thrown
when the constraint to be deleted does not exists, which is the case with a new XWiki
instance.
See https://hibernate.atlassian.net/browse/HHH-8162
-->
<property name="hibernate.schema_update.unique_constraint_strategy">skip</property>
<!-- Setting "hibernate.dbcp.poolPreparedStatements" to true and "hibernate.dbcp.maxOpenPreparedStatements" will
tell DBCP to cache Prepared Statements (it's off by default). Note that for backward compatibility the
"hibernate.dbcp.ps.maxActive" is also supported and when set it'll set "hibernate.dbcp.poolPreparedStatements"
to true and "hibernate.dbcp.maxOpenPreparedStatements" to value of "hibernate.dbcp.ps.maxActive".
Note 1: When using HSQLDB for example, it's important to NOT cache prepared statements because HSQLDB
Prepared Statements (PS) contain the schema on which they were initially created and thus when switching
schema if the same PS is reused it'll execute on the wrong schema! Since HSQLDB does internally cache
prepared statement there's no performance loss by not caching Prepared Statements at the DBCP level.
See https://jira.xwiki.org/browse/XWIKI-1740.
Thus we recommend not turning on this configuration for HSQLDB unless you know what you're doing :)
Note 2: The same applies to PostGreSQL.
-->
<!-- BoneCP Connection Pooling configuration.
<property name="hibernate.bonecp.idleMaxAgeInMinutes">240</property>
<property name="hibernate.bonecp.idleConnectionTestPeriodInMinutes">60</property>
<property name="hibernate.bonecp.partitionCount">3</property>
<property name="hibernate.bonecp.acquireIncrement">10</property>
<property name="hibernate.bonecp.maxConnectionsPerPartition">60</property>
<property name="hibernate.bonecp.minConnectionsPerPartition">20</property>
<property name="hibernate.bonecp.statementsCacheSize">50</property>
<property name="hibernate.bonecp.releaseHelperThreads">3</property>
<property name="hibernate.connection.provider_class">com.xpn.xwiki.store.DBCPConnectionProvider</property>
-->
<!-- Configuration for the default database.
Comment out this section and uncomment other sections below if you want to use another database.
Note that the database tables will be created automatically if they don't already exist.
If you want the main wiki database to be different than "xwiki" (or the default schema for schema based
engines) you will also have to set the property xwiki.db in xwiki.cfg file
<property name="hibernate.connection.url">jdbc:hsqldb:file:${environment.permanentDirectory}/database/xwiki_db;shutdown=true</property>
<property name="hibernate.connection.username">sa</property>
<property name="hibernate.connection.password"/>
<property name="hibernate.connection.driver_class">org.hsqldb.jdbcDriver</property>
<property name="hibernate.connection.charSet">UTF-8</property>
<property name="hibernate.connection.useUnicode">true</property>
<property name="hibernate.connection.characterEncoding">utf8</property>
<mapping resource="xwiki.hbm.xml"/>
<mapping resource="feeds.hbm.xml"/>
<mapping resource="instance.hbm.xml"/>
<mapping resource="notification-filter-preferences.hbm.xml"/>
<mapping resource="mailsender.hbm.xml"/>-->
<!-- MySQL configuration.
Uncomment if you want to use MySQL and comment out other database configurations.
Notes:
- if you want the main wiki database to be different than "xwiki"
you will also have to set the property xwiki.db in xwiki.cfg file
- if you're using a MySQL 8+ JDBC driver, you don't need the "hibernate.connection.driver_class" which will
generate a warning since it's not needed as the driver is registered automatically
<property name="hibernate.connection.url">jdbc:mysql://localhost/xwiki?useSSL=false</property>
<property name="hibernate.connection.username">xwiki</property>
<property name="hibernate.connection.password">xwiki</property>
<property name="hibernate.connection.driver_class">com.mysql.cj.jdbc.Driver</property>
<property name="hibernate.dbcp.poolPreparedStatements">true</property>
<property name="hibernate.dbcp.maxOpenPreparedStatements">20</property>
<property name="hibernate.connection.charSet">UTF-8</property>
<property name="hibernate.connection.useUnicode">true</property>
<property name="hibernate.connection.characterEncoding">utf8</property>
<mapping resource="xwiki.hbm.xml"/>
<mapping resource="feeds.hbm.xml"/>
<mapping resource="instance.hbm.xml"/>
<mapping resource="notification-filter-preferences.hbm.xml"/>
<mapping resource="mailsender.hbm.xml"/>
-->
<!-- MariaDB configuration.
Uncomment if you want to use MariaDB and comment out other database configurations.
Notes:
- if you want the main wiki database to be different than "xwiki"
you will also have to set the property xwiki.db in xwiki.cfg file
<property name="hibernate.connection.url">jdbc:mariadb://localhost/xwiki?useSSL=false</property>
<property name="hibernate.connection.username">xwiki</property>
<property name="hibernate.connection.password">xwiki</property>
<property name="hibernate.connection.driver_class">org.mariadb.jdbc.Driver</property>
<property name="hibernate.dbcp.poolPreparedStatements">true</property>
<property name="hibernate.dbcp.maxOpenPreparedStatements">20</property>
<property name="hibernate.connection.charSet">UTF-8</property>
<property name="hibernate.connection.useUnicode">true</property>
<property name="hibernate.connection.characterEncoding">utf8</property>
<mapping resource="xwiki.hbm.xml"/>
<mapping resource="feeds.hbm.xml"/>
<mapping resource="instance.hbm.xml"/>
<mapping resource="notification-filter-preferences.hbm.xml"/>
<mapping resource="mailsender.hbm.xml"/>
-->
<!-- HSQLDB configuration.
Uncomment if you want to use HSQLDB and comment out other database configurations.
Notes:
- if you want the main wiki schema to be different than "PUBLIC" (the default HSQLDB schema)
you will also have to set the property xwiki.db in xwiki.cfg file
<property name="hibernate.connection.url">jdbc:hsqldb:file:${environment.permanentDirectory}/database/xwiki_db;shutdown=true</property>
<property name="hibernate.connection.username">sa</property>
<property name="hibernate.connection.password"></property>
<property name="hibernate.connection.driver_class">org.hsqldb.jdbcDriver</property>
<property name="hibernate.connection.charSet">UTF-8</property>
<property name="hibernate.connection.useUnicode">true</property>
<property name="hibernate.connection.characterEncoding">utf8</property>
<mapping resource="xwiki.hbm.xml"/>
<mapping resource="feeds.hbm.xml"/>
<mapping resource="instance.hbm.xml"/>
<mapping resource="notification-filter-preferences.hbm.xml"/>
<mapping resource="mailsender.hbm.xml"/>
-->
<!-- PostgreSQL configuration. -->
<!--
Uncomment if you want to use PostgreSQL and comment out other database configurations.
Notes:
- "hibernate.jdbc.use_streams_for_binary" needs to be set to "false",
see https://community.jboss.org/wiki/HibernateCoreMigrationGuide36
- "xwiki.virtual_mode" can be set to either "schema" or "database". Note that currently the database mode
doesn't support database creation (see https://jira.xwiki.org/browse/XWIKI-8753)
- if you want the main wiki database to be different than "xwiki" (or "public" in schema mode)
you will also have to set the property xwiki.db in xwiki.cfg file-->
<property name="hibernate.connection.url">jdbc:postgresql://localhost:5432/__DB_NAME__</property>
<property name="hibernate.connection.username">__DB_USER__</property>
<property name="hibernate.connection.password">__DB_PWD__</property>
<property name="hibernate.connection.driver_class">org.postgresql.Driver</property>
<property name="hibernate.jdbc.use_streams_for_binary">false</property>
<property name="xwiki.virtual_mode">schema</property>
<property name="hibernate.connection.charSet">UTF-8</property>
<property name="hibernate.connection.useUnicode">true</property>
<property name="hibernate.connection.characterEncoding">utf8</property>
<mapping resource="xwiki.postgresql.hbm.xml"/>
<mapping resource="feeds.hbm.xml"/>
<mapping resource="instance.hbm.xml"/>
<mapping resource="notification-filter-preferences.hbm.xml"/>
<mapping resource="mailsender.hbm.xml"/>
<!-- Oracle configuration.
Uncomment if you want to use Oracle and comment out other database configurations.
Notes:
- the 2 properties named "hibernate.connection.SetBigStringTryClob" and
"hibernate.jdbc.batch_size" are required to tell Oracle to allow CLOBs larger than 32K.
- "hibernate.jdbc.use_streams_for_binary" needs to be set to "false",
see https://community.jboss.org/wiki/HibernateCoreMigrationGuide36
- if you want the main wiki schema to be different than "xwiki"
you will also have to set the property xwiki.db in xwiki.cfg file
<property name="hibernate.connection.url">jdbc:oracle:thin:@localhost:1521:XE</property>
<property name="hibernate.connection.username">xwiki</property>
<property name="hibernate.connection.password">xwiki</property>
<property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="hibernate.connection.SetBigStringTryClob">true</property>
<property name="hibernate.jdbc.batch_size">0</property>
<property name="hibernate.jdbc.use_streams_for_binary">false</property>
<property name="hibernate.dbcp.poolPreparedStatements">true</property>
<property name="hibernate.dbcp.maxOpenPreparedStatements">20</property>
<property name="hibernate.connection.charSet">UTF-8</property>
<property name="hibernate.connection.useUnicode">true</property>
<property name="hibernate.connection.characterEncoding">utf8</property>
<mapping resource="xwiki.oracle.hbm.xml"/>
<mapping resource="feeds.oracle.hbm.xml"/>
<mapping resource="instance.hbm.xml"/>
<mapping resource="notification-filter-preferences.hbm.xml"/>
<mapping resource="mailsender.oracle.hbm.xml"/>
-->
<!-- Derby configuration.
Uncomment if you want to use Derby and comment out other database configurations.
Notes:
- if you want the main wiki schema to be different than "APP" (the default Derby schema)
you will also have to set the property xwiki.db in xwiki.cfg file
<property name="hibernate.connection.url">jdbc:derby:/some/path/xwikidb;create=true</property>
<property name="hibernate.connection.driver_class">org.apache.derby.jdbc.EmbeddedDriver</property>
<property name="hibernate.dialect">org.hibernate.dialect.DerbyDialect</property>
<property name="hibernate.dbcp.poolPreparedStatements">true</property>
<property name="hibernate.dbcp.maxOpenPreparedStatements">20</property>
<property name="hibernate.connection.charSet">UTF-8</property>
<property name="hibernate.connection.useUnicode">true</property>
<property name="hibernate.connection.characterEncoding">utf8</property>
<mapping resource="xwiki.derby.hbm.xml"/>
<mapping resource="feeds.hbm.xml"/>
<mapping resource="instance.hbm.xml"/>
<mapping resource="notification-filter-preferences.hbm.xml"/>
-->
<!-- H2 configuration.
Uncomment if you want to use H2 and comment out other database configurations.
Notes:
- if you want the main wiki schema to be different than "PUBLIC" (the default H2 schema)
you will also have to set the property xwiki.db in xwiki.cfg file
<property name="hibernate.connection.url">jdbc:h2:${environment.permanentDirectory}/database/xwiki</property>
<property name="hibernate.connection.username">sa</property>
<property name="hibernate.connection.password"></property>
<property name="hibernate.connection.driver_class">org.h2.Driver</property>
<property name="hibernate.dialect">org.hibernate.dialect.H2Dialect</property>
<property name="hibernate.connection.charSet">UTF-8</property>
<property name="hibernate.connection.useUnicode">true</property>
<property name="hibernate.connection.characterEncoding">utf8</property>
<mapping resource="xwiki.hbm.xml"/>
<mapping resource="feeds.hbm.xml"/>
<mapping resource="instance.hbm.xml"/>
<mapping resource="notification-filter-preferences.hbm.xml"/>
-->
</session-factory>
</hibernate-configuration>

View file

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<jobRequest xmlns="http://www.xwiki.org">
<id>
<element>extension</element>
<element>provision</element>
<element>__JOB_ID__</element>
<!-- <string>wiki:xwiki</string> -->
</id>
<interactive>false</interactive>
<remote>false</remote>
<verbose>true</verbose>
<property>
<key>extensions</key>
<value>
<list xmlns="" xmlns:ns2="http://www.xwiki.org">
<org.xwiki.extension.ExtensionId>
<id>__EXTENSION_ID__</id>
<version class="org.xwiki.extension.version.internal.DefaultVersion" serialization="custom">
<org.xwiki.extension.version.internal.DefaultVersion>
<string>__EXTENSION_VERSION__</string>
</org.xwiki.extension.version.internal.DefaultVersion>
</version>
</org.xwiki.extension.ExtensionId>
</list>
</value>
</property>
<!-- Note that namespaces param don't work correctly for now and is just ingored by the extension installer -->
<property>
<key>namespaces</key>
<value>
<list xmlns="" xmlns:ns2="http://www.xwiki.org">
<string>xwiki:xwiki</string>
</list>
</value>
</property>
</jobRequest>

View file

@ -1,11 +1,13 @@
#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent;
location __PATH__/ {
proxy_pass http://127.0.0.1:__PORT__/;
proxy_pass http://127.0.0.1:__PORT__/__PATH2__;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
expires 0m;
include conf.d/yunohost_panel.conf.inc;
}

View file

@ -6,10 +6,9 @@ After=network.target
Type=simple
User=__APP__
Group=__APP__
EnvironmentFile=__INSTALL_DIR__/xwiki_env
Environment=JETTY_HOME=__INSTALL_DIR__/jetty
WorkingDirectory=__INSTALL_DIR__/
ExecStart=/bin/bash start_xwiki.sh -p __PORT__ -sp __PORT_STOP__ -ni
ExecStop=/bin/bash stop_xwiki.sh
ExecStart=/usr/bin/java -jar __INSTALL_DIR__/jetty/start.jar jetty.http.port=__PORT__ jetty.http.host=127.0.0.1
Restart=always
RestartSec=10
@ -33,7 +32,7 @@ ProtectKernelModules=yes
ProtectKernelTunables=yes
LockPersonality=yes
SystemCallArchitectures=native
SystemCallFilter=~@clock @debug @module @mount @obsolete @reboot @setuid @swap @cpu-emulation @privileged
SystemCallFilter=~@clock @debug @module @mount @obsolete @reboot @setuid @swap @cpu-emulation
# Denying access to capabilities that should not be relevant for webapps
# Doc: https://man7.org/linux/man-pages/man7/capabilities.7.html

770
conf/xwiki.cfg Normal file
View file

@ -0,0 +1,770 @@
# ---------------------------------------------------------------------------
# See the NOTICE file distributed with this work for additional
# information regarding copyright ownership.
#
# This is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation; either version 2.1 of
# the License, or (at your option) any later version.
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this software; if not, write to the Free
# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301 USA, or see the FSF site: http://www.fsf.org.
# ---------------------------------------------------------------------------
#---------------------------------------
# Preamble
#
# This is the main old XWiki configuration file. Commented parameters show the default value, although some features
# might be disabled. To customize, uncomment and put your own value instead.
#
# This file come from one of those locations (in this order):
# * [since 9.3] /etc/xwiki/xwiki.cfg
# * /WEB-INF/xwiki.cfg in the web application resources
#---------------------------------------
# General wiki settings
#
#-# When the wiki is readonly, any updates are forbidden. To mark readonly, use one of: yes, 1, true
# xwiki.readonly=no
#-# [Since 1.6RC1] The list of supported syntaxes is defined as an xobject in the Rendering.RenderingConfig page
#-# and you can change it using the Admin UI of XWiki. When the Rendering.RenderingConfig page doesn't exist, the list
#-# of supported syntaxes is taken from this property. And if there's no syntax listed, then the default syntax is
#-# supported by defaut (this default syntax is defined in xwiki.properties using the core.defaultDocumentSyntax
#-# property).
#-# Example of syntaxes:
#-# xwiki/2.0, xwiki/2.1, confluence/1.0, jspwiki/1.0, creole/1.0, mediawiki/1.0, twiki/1.0, xhtml/1.0,
#-# html/4.01, plain/1.0, docbook/4.4, markdown/1.0, markdown/1.1, apt/1.0
#-# xwiki.rendering.syntaxes = xwiki/2.1
#-# List of groups that a new user should be added to by default after registering. Comma-separated list of group
#-# document names.
#-# The default list depends on the value of xwiki.authentication.group.allgroupimplicit:
#-# 0: created users are added to XWiki.XWikiAllGroup group page
#-# 1: created users are not added to any group page (but they will virtually be part of XWiki.XWikiAllGroup group)
# xwiki.users.initialGroups=XWiki.XWikiAllGroup
#-# Should all users be considered members of XWiki.XWikiAllGroup, even if they don't have an associated object in the
#-# group's document?
# xwiki.authentication.group.allgroupimplicit=0
#-# Uncomment if you want to ignore requests for unmapped actions, and simply display the document
# xwiki.unknownActionResponse=view
#-# The encoding to use when transformin strings to and from byte arrays. This causes the jvm encoding to be ignored,
#-# since we want to be independend of the underlying system.
xwiki.encoding=UTF-8
#-# This parameter will activate the sectional editing.
xwiki.section.edit=1
#-# This parameter controls the depth of sections that have section editing.
#-# By default level 1 and level 2 sections have section editing.
xwiki.section.depth=2
#-# Enable backlinks storage, which increases the update time, but allows to keep track of inter document links.
xwiki.backlinks=1
#-# Enable document tags.
xwiki.tags=1
#-# [Since 6.1M1] HTTP cache settings: by default, HTTP responses generated by XWiki actions are not supposed to be cached,
#-# since they often contain dynamic content. This can be controlled globally using the following setting, with accepted values:
#-# - 0: no Cache-Control header sent, use the browser's defaults. RFC 2616 only specifies optional behavior in this case
#-# - 1: no-cache; caches must not serve this response in a subsequent response, but the page is stored for the bf-cache
#-# - 2: no-store, no-cache and max-age=0; the response will never be reused, not even for bf-cache; note that unsaved changes may be lost
#-# - 3: private; the response will be cached by personal caches, such as a browser cache
#-# - 4: public; the response may be cached by both personal and shared caches
#-# This can be overridden in each wiki using a headers_nocache XWikiPreferences property of type Long.
# xwiki.httpheaders.cache=1
#---------------------------------------
# Storage
#
#-# Role hints that differentiate implementations of the various storage components. To add a new implementation for
#-# one of the storages, implement the appropriate interface and declare it in a components.xml file (using a role-hint
#-# other than 'default') and put its hint here.
#-# Stores with both "hibernate" and "file" support in XWiki Standard.
#-# [Since 10.5RC1] The default is "file" for all of them.
#-#
#-# [Since 9.0RC1] The default document content recycle bin storage.
#-# This property is only taken into account when deleting a document and has no effect on already deleted documents.
# xwiki.store.recyclebin.content.hint=file
#-# The attachment content storage.
# xwiki.store.attachment.hint=file
#-# The attachment versioning storage. Use 'void' to disable attachment versioning.
# xwiki.store.attachment.versioning.hint=file
#-# [Since 9.9RC1] The default attachment content recycle bin storage.
#-# This property is only taken into account when deleting an attachment and has no effect on already deleted documents.
# xwiki.store.attachment.recyclebin.content.hint=file
#-# Stores with only "hibernate" support in XWiki Standard
#-#
#-# The main (documents) storage.
# xwiki.store.main.hint=hibernate
#-# The document versioning storage.
# xwiki.store.versioning.hint=hibernate
#-# The document recycle bin metadata storage.
# xwiki.store.recyclebin.hint=hibernate
#-# The attachment recycle bin metadata storage.
# xwiki.store.attachment.recyclebin.hint=hibernate
#-# The Migration manager.
# xwiki.store.migration.manager.hint=hibernate
#-# Whether the document recycle bin feature is activated or not
# xwiki.recyclebin=1
#-# Whether the attachment recycle bin feature is activated or not
# storage.attachment.recyclebin=1
#-# Whether the document versioning feature is activated or not
# xwiki.store.versioning=1
#-# Whether the attachment versioning feature is activated or not
# xwiki.store.attachment.versioning=1
#-# Whether the attachments should also be rolled back when a document is reverted.
# xwiki.store.rollbackattachmentwithdocuments=1
#-# The path to the hibernate configuration file.
xwiki.store.hibernate.path=/etc/__APP__/hibernate.cfg.xml
#-# Allow or disable custom mapping for particular XClasses. Custom mapping may increase the performance of certain
#-# queries when large number of objects from particular classes are used in the wiki.
# xwiki.store.hibernate.custommapping=1
#-# Dynamic custom mapping.
# xwiki.store.hibernate.custommapping.dynamic=0
#-# Put a cache in front of the document store. This greatly improves performance at the cost of memory consumption.
#-# Disable only when memory is critical.
# xwiki.store.cache=1
#-# Maximum number of documents to keep in the cache.
#-# The default is 500.
# xwiki.store.cache.capacity=500
#-# Maximum number of documents to keep in the cache indicating if a document exist.
#-# Since this cache contain only boolean it can be very big without taking much memory.
#-# The default is 10000.
# xwiki.store.cache.pageexistcapacity=10000
#-# [Since 1.6M1]
#-# Force the database name for the main wiki.
# xwiki.db=xwiki
#-# [Since 1.6M1]
#-# Add a prefix to all databases names of each wiki.
# xwiki.db.prefix=
#---------------------------------------
# Data migrations and schema updates
#
# [Since 3.3M1] Migration and schema updates are now done together. Data migration manipulates the actual data,
# and schema updates change the layout of the database. Schema updates are require for proper database access
# and migration are useful for migrating data to new formats, correct errors introduced in older versions, or
# even for schema updates which are not backward compatible.
#-# Whether schema updates and migrations are enabled or not. Should be enabled when upgrading, but for a better
#-# startup time it is better to disable them in production.
xwiki.store.migration=1
#-# Whether to exit after migration. Useful when a server should handle migrations for a large database, without going
#-# live afterwards.
# xwiki.store.migration.exitAfterEnd=0
#-# Indicate the list of databases to migrate.
#-# to upgrade all wikis database set xwiki.store.migration.databases=all
#-# to upgrade just some wikis databases set xwiki.store.migration.databases=xwiki,wiki1,wiki2
#-# Note: the main wiki is always migrated whatever the configuration.
#-# [Since 3.3M1] default to migrate all databases
# xwiki.store.migration.databases=all
#---------------------------------------
# Internationalization
#
#-# By default, XWiki chooses the language specified by the client (browser) in the Accept-Language HTTP header. This
#-# allows to use the default language of the wiki when the user didn't manually choose a language.
# xwiki.language.preferDefault=0
#-# Force only one of the supported languages to be accepted. Default to true.
# xwiki.language.forceSupported=1
#---------------------------------------
# Virtual wikis (farm)
#
#-# Starting with XWiki 5.0M2, virtual mode is enabled by default.
#-# [Since 5.0M2]
#-# What to do when the requested wiki does not exist:
#-# - 0: (default) serve the main wiki
#-# - 1: display an error (customizable through wikidoesnotexist.vm or xwiki:XWiki.WikiDoesNotExist)
# xwiki.virtual.failOnWikiDoesNotExist=0
#-# Forbidden names that should not be allowed when creating a new wiki.
# xwiki.virtual.reserved_wikis=
#-# How virtual wikis are mapped to different URLs.
#-# If set to 0, then virtual wikis have different domain names, in the format http://wikiname.myfarm.net/.
#-# If set to 1 (the default), then the domain is common for the entire farm, but the path contains the wiki name,
#-# in the format http://myfarm.net/xwiki/wiki/wikiname/.
#-# Note that you can configure the "/wiki/" part with xwiki.virtual.usepath.servletpath property.
# xwiki.virtual.usepath=1
#-# Configure the servlet action identifier for url path based multiwiki. It has also to be modified in web.xml.
# xwiki.virtual.usepath.servletpath=wiki
#---------------------------------------
# URLs
#
#-# The domain name to use when creating URLs to the default wiki. If set, the generated URLs will point to this server
#-# instead of the requested one. It should contain schema, domain and (optional) port, and the trailing /. For example:
#-# xwiki.home=http://www.xwiki.org/
#-# xwiki.home=http://wiki.mycompany.net:8080/
# xwiki.home=
#-# The name of the default URL factory that should be used.
# xwiki.urlfactory.serviceclass=com.xpn.xwiki.web.XWikiURLFactoryServiceImpl
#-# The default protocol to use when generating an external URL. Can be overwritten in the wiki descriptor ("secure" property).
#-# If not set, the following is used:
#-# * during client request for the current wiki: the protocol from the URL used by the client
#-# * for a different wiki or during background tasks (mails, etc.): information come from the wiki descriptor (also fallback on main wiki)
#-# For example:
#-# xwiki.url.protocol=https
# xwiki.url.protocol=
#-# The name of the webapp to use in the generated URLs. If not specified, the value is extracted from the request URL
#-# and thus it's generally not required to set it. However if you're deploying XWiki as ROOT in your Servlet Container
#-# and you're using XWiki 6.2.8+/6.4.3+/7.0+ you must set it to an empty value as otherwise the code cannot guess it.
#-# Note that not setting this property seemed to work on previous versions when deploying as ROOT but it was actually
#-# leading to errors from time to time, depending on what URL was used when doing the first request on the XWiki
#-# instance.
#-# For example:
#-# xwiki.webapppath=xwiki
xwiki.webapppath=__PATH3__
#-# The default servlet mapping name to use in the generated URLs. The right value is taken from the request URL,
#-# preserving the requested servlet mapping, so setting this is not recommended in most cases. If set, the value should
#-# contain a trailing /, but not a leading one. For example:
#-# xwiki.servletpath=bin/
# xwiki.servletpath=
#-# The fallback servlet mapping name to use in the generated URLs. Unlike xwiki.servletpath, this is the value used
#-# when the correct setting could not be determined from the request URL. A good way to use this setting is to achieve
#-# short URLs, see https://www.xwiki.org/xwiki/bin/view/Documentation/AdminGuide/ShortURLs/
# xwiki.defaultservletpath=bin/
#-# Whether the /view/ part of the URL should be included if the target action is 'view'.
# xwiki.showviewaction=1
#-# The name of the default space. This is displayed when the URL specifies a document, but not a space, or neither.
# xwiki.defaultweb=Main
#-# The name of the default page of a space. This is displayed when the URL specifies a space, but not a document, or
#-# neither.
# xwiki.defaultpage=WebHome
#-# Hide the /WebHome part of the URL when the document is the default one. Use 0 to hide, 1 to show.
# xwiki.usedefaultaction=0
#-# [Since 4.0RC1]
#-# Indicate if the URL used in HTTPSevlet#sendRedirect should be made absolute by XWiki or left to application server.
#-# Sending absolute URLs is a bad practice and generally not needed. This option is mostly here as retro-compatibility
#-# switch and you should always make sure to properly configure your application server or any proxy behind it before
#-# using this.
#-# 0: send relative URLs (the default)
#-# 1: send absolute URLs
# xwiki.redirect.absoluteurl=0
#---------------------------------------
# Users
#
xwiki.inactiveuser.allowedpages=
#---------------------------------------
# Authentication and authorization
#
#-# Enable to allow superadmin. It is disabled by default as this could be a
#-# security breach if it were set and you forgot about it. Should only be enabled
#-# for recovering the Wiki when the rights are completely messed.
# xwiki.superadminpassword=system
__SUPER_ADMIN_CONFIG__
#-# Authentication type. You can use 'basic' to always use basic authentication.
# xwiki.authentication=form
#-# Indicate if the authentication has do be done for each request
#-# 0: the default value, authentication is done only once by session.
#-# 1: the authentication is done for each request.
# xwiki.authentication.always=0
#-# Cookie encryption keys. They are randomly generated and stored when not specified.
# xwiki.authentication.validationKey=totototototototototototototototo
# xwiki.authentication.encryptionKey=titititititititititititititititi
#-# Comma separated list of domains for which authentication cookies are set. This
#-# concerns mostly wiki farms. The exact meaning is that when a user logs in, if
#-# the current domain name corresponding to the wiki ends with one of the entries
#-# in this parameter, then the cookie is set for the larger domain. Otherwise, it
#-# is set for the exact domain name of the wiki.
#-#
#-# For example, suppose the cookiedomains is set to "mydomain.net". If I log in
#-# on wiki1.xwiki.com, then the cookie will be set for the entire mydomain.net
#-# domain, and if I visit wiki2.xwiki.com I will still be authenticated. If I log
#-# in on wiki1.otherdomain.net, then I will only be authenticated on
#-# wiki1.otherdomain.net, and not on wiki2.otherdomain.net.
#-#
#-# So you need this parameter set only for global authentication in a
#-# farm, there's no need to specify your domain name otherwise.
#-#
#-# Example: xwiki.authentication.cookiedomains=xwiki.org,myxwiki.org
xwiki.authentication.cookiedomains=
#-# This allows logout to happen for any page going through the /logout/ action, regardless of the document or the
#-# servlet.
#-# Comment-out if you want to enable logout only for /bin/logout/XWiki/XWikiLogout
#-# Currently accepted patterns:
#-# - /StrutsServletName/logout/ (this is usually /bin/logout/ and is the default setup)
#-# - /logout/ (this works with the short URLs configuration)
#-# - /wiki/SomeWikiName/logout/ (this works with path-based virtual wikis)
xwiki.authentication.logoutpage=(/|/[^/]+/|/wiki/[^/]+/)logout/*
#-# The group management class.
# xwiki.authentication.groupclass=com.xpn.xwiki.user.impl.xwiki.XWikiGroupServiceImpl
#-# The authentication management class.
# xwiki.authentication.authclass=com.xpn.xwiki.user.impl.xwiki.XWikiAuthServiceImpl
#-# (Deprecated) The authorization management class.
#-# [Since 5.0M2] The default right service is now org.xwiki.security.authorization.internal.XWikiCachingRightService
#-# which is a bridge to the new security authorization component. It provides increased security and performance, but
#-# its right policies differ sightly from the old Right Service implementation. In rare situation, you may want to
#-# switch back to the old unmaintained implementation by uncommenting the following line. However, only old
#-# implementation, still using a bridged RightService will be impacted by this parameter. Customization of the new
#-# security authorization component should be done in the new xwiki.properties configuration (security.*).
# xwiki.authentication.rightsclass=com.xpn.xwiki.user.impl.xwiki.XWikiRightServiceImpl
#-# If an unauthenticated user (guest) tries to perform a restricted action, by default the wiki redirects to the login
#-# page. Enable this to simply display an "unauthorized" message instead, to hide the login form.
# xwiki.hidelogin=false
#-# Used by some authenticators (like com.xpn.xwiki.user.impl.xwiki.AppServerTrustedAuthServiceImpl)
#-# to indicate that the users should be created. In this kind of authenticator the user are not created by default.
#-# Must be set to "empty".
# xwiki.authentication.createuser=empty
#-# If set to true(the default value), cookies of users are blocked from being used except by the same IP address
#-# which got them.
# xwiki.authentication.useip=true
#---------------------------------------
# Editing
#
#-# Minor edits don't participate in notifications.
# xwiki.minoredit=1
#-# Use edit comments
xwiki.editcomment=1
#-# Hide editcomment field and only use Javascript
# xwiki.editcomment.hidden=0
#-# Make edit comment mandatory
xwiki.editcomment.mandatory=0
#-# Make edit comment suggested (asks 1 time if the comment is empty.
#-# 1 shows one popup if comment is empty.
#-# 0 means there is no popup.
#-# This setting is ignored if mandatory is set
# xwiki.editcomment.suggested=0
#---------------------------------------
# Skins & Templates configuration
#
#-# The default skin to use when there's no value specified in the wiki preferences document. Note that the default
#-# wiki already specifies a skin, so this setting is only valid for empty wikis.
xwiki.defaultskin=flamingo
#-# The default base for skins that don't specify a base skin. This is also the last place where a skin file is searched
#-# if not found in the more specific skins.
xwiki.defaultbaseskin=flamingo
#-# Defines whether title handling should be using the compatibility mode or not. When the compatibility
#-# mode is active, XWiki will try to extract a title from the document content.
#-# If the document's content first header (level 1 or level 2) matches the document's title
#-# the first header is stripped.
#-# The default value is 0.
# xwiki.title.compatibility=1
#-# Defines the maximum header depth to look for when computing a document's title from its content. If no header
#-# equal or lower to the specified depth is found then the computed title falls back to the document name.
#-# The default value is 2.
# xwiki.title.headerdepth=2
#-# Defines if setting the title field must be mandatory in the WYSIWYG and Wiki editors. It is mandatory when this
#-# property is set to 1. The default value is 0 (not mandatory).
# xwiki.title.mandatory=0
#---------------------------------------
# Plugin Mechanism
#
#-# List of active plugins.
xwiki.plugins=\
com.xpn.xwiki.monitor.api.MonitorPlugin,\
com.xpn.xwiki.plugin.skinx.JsSkinExtensionPlugin,\
com.xpn.xwiki.plugin.skinx.JsSkinFileExtensionPlugin,\
com.xpn.xwiki.plugin.skinx.JsResourceSkinExtensionPlugin,\
com.xpn.xwiki.plugin.skinx.CssSkinExtensionPlugin,\
com.xpn.xwiki.plugin.skinx.CssSkinFileExtensionPlugin,\
com.xpn.xwiki.plugin.skinx.CssResourceSkinExtensionPlugin,\
com.xpn.xwiki.plugin.skinx.LinkExtensionPlugin,\
com.xpn.xwiki.plugin.feed.FeedPlugin,\
com.xpn.xwiki.plugin.mail.MailPlugin,\
com.xpn.xwiki.plugin.packaging.PackagePlugin,\
com.xpn.xwiki.plugin.fileupload.FileUploadPlugin,\
com.xpn.xwiki.plugin.image.ImagePlugin,\
com.xpn.xwiki.plugin.rightsmanager.RightsManagerPlugin,\
com.xpn.xwiki.plugin.jodatime.JodaTimePlugin,\
com.xpn.xwiki.plugin.scheduler.SchedulerPlugin,\
com.xpn.xwiki.plugin.mailsender.MailSenderPlugin,\
com.xpn.xwiki.plugin.tag.TagPlugin,\
com.xpn.xwiki.plugin.zipexplorer.ZipExplorerPlugin
#---------------------------------------
# Monitor Plugin
#
#-# Enable light monitoring of the wiki performance. Records various statistics, like number of requests processed,
#-# time spent in rendering or in the database, medium time for a request, etc. Disable for a minor increase of
#-# performance and a bit of memory.
# xwiki.monitor=1
#-# Maximum number of last requests to remember.
# xwiki.monitor.lastlistsize=20
#---------------------------------------
# Image Plugin
#
xwiki.plugin.image.cache.capacity=30
#---------------------------------------
# Watchlist Plugin
#
#-# [Since 3.1M1]
#-# Indicate which mode to use for automatic document watching.
#-# The possibles modes are the following:
#-# * none: never automatically add document in watchlist
#-# * all: add to watchlist any modified document
#-# * major: add to watchlist only document which are not edited as minor edit. That's the default mode.
#-# * new: add to watchlist only newly created documents
# xwiki.plugin.watchlist.automaticwatch=major
#---------------------------------------
# Statistics Plugin
#
#-# Note that this plugin is in charge of storing stats in the database, and offering some API to query them.
#-# It doesn't provide any UI. If you wish to install a UI, please check the Statistics Application at
#-# https://extensions.xwiki.org/xwiki/bin/view/Extension/Statistics+Application
#-# (this application is no longer bundled in XWiki starting with 8.0)
#-# Stats configuration allows to globally activate/deactivate stats module (launch storage thread, register events...).
#-# Enabled by default.
# xwiki.stats=1
#-# When statistics are globally enabled, storage can be enabled/disabled by wiki using the XWikiPreference property
#-# "statistics".
#-# Note: Statistics are disabled by default for improved performances/space.
xwiki.stats.default=0
#-# Deprecated since 2.5M1. Use "xwiki.stats.request.excludedUsersAndGroups" instead.
# xwiki.stats.excludedUsersAndGroups=XWiki.Admin,XWiki.XWikiGuest
#-# [Since 2.5M1]
#-# List of users and groups to filter from the visit search request result. Entities are comma separated and can be
#-# relative.
#-# "XWiki.Admin" means "XWiki.Admin" user on the wiki where the search is done and "xwiki:XWiki.Admin" only filter
#-# admin user from main wiki.
#-# For example, the following filter default admin user and unregistered user from the most active contributor graph
#-# on Stats.WebHome page:
# xwiki.stats.request.excludedUsersAndGroups
#-# [Since 2.5M1]
#-# List of users and groups to skip when storing statistics to the database. Entities are comma separated and can be
#-# relative.
#-# "XWiki.Admin" means "XWiki.Admin" user on the wiki where the search is done and "xwiki:XWiki.Admin" only filter
#-# admin user from main wiki.
#-# For example, the following filter avoid storing statistics for the user "HiddenUser":
# xwiki.stats.excludedUsersAndGroups=XWiki.HiddenUser
#-# It is also possible to choose a different stats service to record statistics separately from XWiki.
# xwiki.stats.class=com.xpn.xwiki.stats.impl.XWikiStatsServiceImpl
#---------------------------------------
# Import/Export
#
#-# [Since 6.2]
#-# Indicate if Filter module should be used when exporting a XAR in the export action.
#-# By default Filter module is used, uncomment to use the old system.
# xwiki.action.export.xar.usefilter=0
#-# [Since 12.0]
#-# Indicate if the XAR packages should be optimized (from size point of view) by default.
#-# Can be overwritten with URL parameter "?optimized=false".
#-# The default is:
# xwiki.action.export.xar.optimized=1
#-# [Since 12.0]
#-# Indicate if the JRCS format should be used for attachment history in XAR packages by default.
#-# Enabled by default for retro compatibility reasons.
#-# Can be overwritten with URL parameter "?attachment_jrcs=false"
#-# The default is:
# xwiki.action.export.xar.attachment.jrcs=1
#---------------------------------------
# LDAP
#
#-# LDAP authentication service
xwiki.authentication.authclass=org.xwiki.contrib.ldap.XWikiLDAPAuthServiceImpl
#-# Turn LDAP authentication on - otherwise only XWiki authentication
#-# - 0: disable
#-# - 1: enable
#-# The default is 0
xwiki.authentication.ldap=1
#-# Enable local accounts in addition to LDAP.
#-# Without this setting you will be unable to log into XWiki with local accounts.
#-# - 0: disable
#-# - 1: enable
#-# The default is 0
xwiki.authentication.ldap.trylocal=1
#-# LDAP Server (Active Directory, eDirectory, OpenLDAP, etc.)
#-# The default host is localhost
xwiki.authentication.ldap.server=localhost
#-# The default port is 389 (636 if xwiki.authentication.ldap.ssl is enabled)
# xwiki.authentication.ldap.port=389
#-# LDAP credentials, empty = anonymous access, otherwise specify full dn
#-# {0} is replaced with the user name, {1} with the password
xwiki.authentication.ldap.bind_DN=
xwiki.authentication.ldap.bind_pass=
#-# The Base DN used in LDAP searches
xwiki.authentication.ldap.base_DN=ou=users,dc=yunohost,dc=org
#-# LDAP query to search the user in the LDAP database (in case a static admin user is provided in
#-# xwiki.authentication.ldap.bind_DN)
#-# {0} is replaced with the user uid field name and {1} with the user name
#-# The default is:
# xwiki.authentication.ldap.user_search_fmt=({0}={1})
#-# Only members of the following group can authenticate.
#-# The following kind of groups are supported:
#-# * LDAP static groups (users/subgroups are listed statically in the group object)
#-# * [Since 3.3M1] LDAP organization units (users/subgroups are sub object of the provided organization unit)
#-# * [Since 3.3M1] LDAP filter (users/groups are object found in a search with the provided filter)
xwiki.authentication.ldap.user_group=cn=__APP__.main,ou=permission,dc=yunohost,dc=org
#-# Only users not member of the following group can authenticate.
#-# The following kind of groups are supported:
#-# * LDAP static groups (users/subgroups are listed statically in the group object)
#-# * [Since 3.3M1] LDAP organization units (users/subgroups are sub object of the provided organization unit)
#-# * [Since 3.3M1] LDAP filter (users/groups are object found in a search with the provided filter)
# xwiki.authentication.ldap.exclude_group=cn=admin,ou=groups,o=MegaNova,c=US
#-# Specifies the LDAP attribute containing the unique user identifier. It's also used by default as identifier on XWiki side for the user profile page name.
#-# The default is:
xwiki.authentication.ldap.UID_attr=uid
#-# The potential LDAP groups classes. Separated by commas.
#-# The default is group,groupOfNames,groupOfUniqueNames,dynamicGroup,dynamicGroupAux,groupWiseDistributionList,posixGroup,apple-group
xwiki.authentication.ldap.group_classes=permissionYnh,groupOfNamesYnh
#-# The potential names of the LDAP groups fields containings the members. Separated by commas.
#-# The default is member,uniqueMember,memberUid
xwiki.authentication.ldap.group_memberfields=member,uniqueMember,memberUid
#-# Retrieve the following fields from LDAP and store them in the XWiki user object (xwiki-attribute=ldap-attribute).
#-# You can add any custom field you want in the XWiki user profile in the user profile section of the wiki administration.
#-# You can find all the field defined in the user profile in the page XWiki.XWikiUsers and here are some of the important ones:
#-# * first_name
#-# * last_name
#-# * email
#-# * company
#-# * address
#-# * phone
#-# * comment (a free form text about the user)
#-# By default the list is empty
xwiki.authentication.ldap.fields_mapping=last_name=sn,first_name=givenName,email=mail
#-# On every authentication update the mapped attributes from LDAP to XWiki otherwise this happens only once when the XWiki
#-# account is created.
#-# - 0: only when creating user
#-# - 1: at each authentication
#-# The default is 0
xwiki.authentication.ldap.update_user=1
#-# On every authentication update photo from LDAP to XWiki avatar otherwise photo will not be updated.
#-# - 0: never
#-# - 1: at each authentication
#-# The default is 0
# xwiki.authentication.ldap.update_photo=0
#-# Profile attachment name which will be used to save LDAP photo.
#-# The default is ldapPhoto
# xwiki.authentication.ldap.photo_attachment_name=ldapPhoto
#-# Specifies the LDAP attribute containing the binary photo
#-# The default is thumbnailPhoto
# xwiki.authentication.ldap.photo_attribute=thumbnailPhoto
#-# Maps XWiki groups to LDAP groups, separator is "|".
#-# The following kind of groups are supported:
#-# * LDAP static groups (users/subgroups are listed statically in the group object)
#-# * [Since 3.3M1] LDAP organization units (users/subgroups are sub object of the provided organization unit)
#-# * [Since 3.3M1] LDAP filter (users/groups are object found in a search with the provided filter),
#-# | character in the filter need to be escaped with backslash (\).
#-#
#-# Here is an example:
xwiki.authentication.ldap.group_mapping=XWiki.XWikiAdminGroup=cn=__APP__.admin,ou=permission,dc=yunohost,dc=org|\
XWiki.LDAPUsers=cn=__APP__.main,ou=permission,dc=yunohost,dc=org|\
XWiki.Organisation=cn=__APP__.main,ou=permission,dc=yunohost,dc=org
#-# Time in s after which the list of members in a group is refreshed from LDAP
#-# The default is 21600 (6 hours)
# xwiki.authentication.ldap.groupcache_expiration=21600
#-# - create : synchronize group membership only when the user is first created
#-# - always: synchronize on every authentication
#-# The default is always
xwiki.authentication.ldap.mode_group_sync=always
#-# Indicate groups members should be resolved in case they are subgroups.
#-# Doing so can be very expensive so it should be disabled if you know there is no subgroups
#-# (or if you don't care about them).
#-# If the group is actually a filter it will always be resolved since it does not make sense left alone.
#-# - 0: disable
#-# - 1: enable
#-# The default is 1
# xwiki.authentication.ldap.group_sync_resolve_subgroups=0
#-# SSL connection to LDAP server
#-# - 0: normal
#-# - 1: SSL
#-# The default is 0
# xwiki.authentication.ldap.ssl=0
#-# The keystore file to use in SSL connection
# xwiki.authentication.ldap.ssl.keystore=
#-# Set a specific java secure provider to be used in SSL connection, besides the already preregistered ones.
# xwiki.authentication.ldap.ssl.secure_provider=
#-# Bypass standard LDAP bind validation by doing a direct password comparison.
#-# If you don't know what you do, don't use that. It's covering very rare and bad use cases.
#-# - 0: disable
#-# - 1: enable
#-# The default is 0
# xwiki.authentication.ldap.validate_password=0
#-# Specifies the LDAP attribute containing the password to be used "when xwiki.authentication.ldap.validate_password"
#-# is set to 1
# xwiki.authentication.ldap.password_field=userPassword
#-# The maximum number of milliseconds the client waits for any operation under these constraints to complete.
#-# The default (0) is no timeout
# xwiki.authentication.ldap.timeout=0
#-# The maximum number of search results to be returned from a search operation.
#-# The default is 1000
# xwiki.authentication.ldap.maxresults=1000
#-# An HTTP Header to be use as the authenticated remote user input (in place of using the default authenticated user reported by the servlet container)
#-# WARNING: Enabling this feature without ensuring the validity of transmitted headers is very insecure.
#-#
#-# In this example, the authenticated user will be taken from the HTTP header REMOTE_USER:
xwiki.authentication.ldap.httpHeader=REMOTE_USER
#-# A Java regexp used to parse the remote user provided by JAAS.
#-#
#-# The following matches the users like UID@DOMAIN:
# xwiki.authentication.ldap.remoteUserParser=(.+)@(.+)
#-# Indicate which of the regexp group correspond to which LDAP properties.
#-# The following LDAP properties are reserved (any other property can be defined as variable for xwiki.authentication.ldap.userPageName):
#-# * uid: the uid of the user
#-# * password: the password of the user
#-# * all the non multidomain related properties with "ldap_" prefix (ldap_server, ldap_port, ldap_base_DN, etc.)
#-#
#-# The following indicate that the first regexp group is associated to the uid:
xwiki.authentication.ldap.remoteUserMapping.1=uid
#-# The following indicate that the second regexp group is associated everything else we want to make different based on the domain (the mapping is then used to indicate which is the value for each property):
# xwiki.authentication.ldap.remoteUserMapping.2=domain,ldap_server,ldap_port,ldap_base_DN,ldap_bind_DN,ldap_bind_pass,ldap_group_mapping
#-# Indicate how to convert each found property. If a property is not set, the standard LDAP authenticator setup is used.
#-#
#-# Here is an example mapping each of the domains MYDOMAIN and MYDOMAIN2 to specific properties:
# xwiki.authentication.ldap.remoteUserMapping.ldap_server=MYDOMAIN=my.domain.com|MYDOMAIN2=my.domain2.com
# xwiki.authentication.ldap.remoteUserMapping.ldap_port=MYDOMAIN=388|MYDOMAIN2=387
# xwiki.authentication.ldap.remoteUserMapping.ldap_base_DN=MYDOMAIN=dc=my,dc=domain,dc=com|MYDOMAIN2=dc=my,dc=domain2,dc=com
# xwiki.authentication.ldap.remoteUserMapping.ldap_bind_DN=MYDOMAIN=cn=bind,dc=my,dc=domain,dc=com|MYDOMAIN2=cn=bind,dc=my,dc=domain2,dc=com
# xwiki.authentication.ldap.remoteUserMapping.ldap_bind_pass=MYDOMAIN=password|MYDOMAIN2=password2
# xwiki.authentication.ldap.remoteUserMapping.ldap_group_mapping=MYDOMAIN=XWiki.Admin=cn=admin,dc=my,dc=domain,dc=com\\|XWiki.LDAPUsers=ou=groups,o=domain,c=com|MYDOMAIN2=XWiki.Admin=cn=admin,dc=my,dc=domain2,dc=com\\|XWiki.LDAPUsers=ou=groups,o=domain2,c=com
#-# The XWiki page name pattern.
#-# The supported syntax is org.apache.commons.lang3.text.StrSubstitutor one,
#-# see http://commons.apache.org/proper/commons-lang/javadocs/api-3.0/org/apache/commons/lang3/text/StrSubstitutor.html for more details.
#-# Can use:
#-# * the LDAP fields listed in xwiki.authentication.ldap.fields_mapping by prefixing it with "ldap." as in ${ldap.givenName}
#-# * xwiki.authentication.ldap.remoteUserParser regex groups
#-# * a properties defined in xwiki.authentication.ldap.remoteUserMapping
#-#
#-# The following suffixes can be added:
#-# * "._lowerCase": the lower case version of the string
#-# * "._upperCase": the upper case version of the string
#-# * "._clean": a version of the string stripped from ".", ":", ",", "@", "^", "/" characters and "\s" (all forms of white spaces).
#-# It can itself be suffixed with "._lowerCase" and "._upperCase".
#-#
#-# In this example the XWiki user profile page name will be of the form MYDOMAIN-myuid
# xwiki.authentication.ldap.userPageName=${domain}-${uid}
#-#
#-# The default is; "${uid}".
# xwiki.authentication.ldap.userPageName=${uid}
#-# The list of authentication inputs for which user profile should also be searched based on uid.
#-# You can use this property as retro-compatibility when upgrading a setup that used to be targeting a single LDAP server.
#-# An alternative is to change the uid in all the existing users to make sure it contains complete input instead.
#-#
#-# In this example the authenticator will try to find existing users from domain MYDOMAIN with only the uid when it can't find one with the complete input:
# xwiki.authentication.ldap.testLoginFor=${uid}@MYDOMAIN,${uid}@ANOTHERDOMAIN
#-# The maximum number of results to receive at the same time in a pages search (for example when searching group members).
#-# The default is 500.
#-#
# xwiki.authentication.ldap.searchPageSize=500
#-# Discover SRV records at _ldap._tcp.<xwiki.authentication.ldap.server> (or _ldaps._tcp.<xwiki.authentication.ldap.server> if ssl is enabled) and use the one with the highest priority/weight. If no record is found, proceed to connect to <xwiki.authentication.ldap.server>.
#-# The default is 1.
#-#
# xwiki.authentication.ldap.service_discovery=1
#-# In some cases the referral setup of an LDAP server is not is a great shape but cannot be easily changed and you which you could just tell the authenticator to ignore those.
#-# By default referral following is enabled (1) but it can be disabled with 0 and the authenticator will simply ignore any referral related error (but log them in debug mode) and continue.
#-#

1565
conf/xwiki.properties Normal file

File diff suppressed because it is too large Load diff

View file

@ -1,2 +0,0 @@
JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64/jre
PATH=$JAVA_HOME/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/opt/puppetlabs/bin:/snap/bin

View file

@ -5,9 +5,9 @@ name = "xWiki"
description.en = "Collaboration tool based on the wiki principle"
description.fr = "Outil de collaboration basé sur le principe du wiki"
version = "14.10.8~ynh1"
version = "15.10.1~ynh1"
maintainers = [""]
maintainers = ["Josué Tille"]
[upstream]
license = "LGPL-2.1"
@ -18,44 +18,98 @@ userdoc = "https://www.xwiki.org/xwiki/bin/view/Documentation/UserGuide/"
code = "https://github.com/xwiki/xwiki-platform"
[integration]
yunohost = ">= 11.1.17"
yunohost = ">= 11.2"
architectures = "all"
multi_instance = true
ldap = false
ldap = true
sso = false
disk = "50M"
ram.build = "50M"
ram.runtime = "50M"
disk = "500M"
ram.build = "0M"
ram.runtime = "1G"
[install]
[install.domain]
type = "domain"
[install.path]
type = "path"
default = "/xwiki"
[install.install_standard_flavor]
ask.en = "Would you like to install the Standard Flavor?"
help.en = "See https://extensions.xwiki.org/xwiki/bin/view/Extension/XWiki%20Standard%20Flavor/ for more informations."
type = "boolean"
default = true
[install.init_main_permission]
type = "group"
default = "visitors"
[install.init_admin_permission]
ask.en = "Which group will have access to xWiki admin page"
ask.fr = "Quel groupe aura accès à l'administration de xWiki"
help.en = "Users of this group should have access to xWiki admin page"
help.fr = "Les utilisateurs de ce groupe devrait avoir accès à la page d'administration de xWiki"
type = "group"
default = "admins"
[resources]
[resources.sources]
[resources.sources.main]
url = "https://nexus.xwiki.org/nexus/content/groups/public/org/xwiki/platform/xwiki-platform-distribution-jetty-hsqldb/14.10.8/xwiki-platform-distribution-jetty-hsqldb-14.10.8.zip"
sha256 = "42bb11563587860d2268f3226b90c6ae5cf5930e027fe0e3386fb2de29445a2b"
url = "https://nexus.xwiki.org/nexus/content/groups/public/org/xwiki/platform/xwiki-platform-distribution-jetty-hsqldb/15.10.1/xwiki-platform-distribution-jetty-hsqldb-15.10.1.zip"
sha256 = "76efd6e1c58b8557034a3e25271963392b8b5e125af97d932210823510586e9f"
format = "zip"
[resources.sources.jdbc]
url = "https://jdbc.postgresql.org/download/postgresql-42.7.0.jar"
rename = "postgresql-42.7.0.jar"
sha256 = "90c39c97ac309b5767882f9beef913244da029204af2d2982c2b45bcfcb42624"
# Note that xq is available on debian package since debian 12
# So on bookworm should just remove this and use official package
[resources.sources.xq_tool]
in_subdir= false
i386.url = "https://github.com/sibprogrammer/xq/releases/download/v1.2.3/xq_1.2.3_linux_386.tar.gz"
i386.sha256 = "fc500e887d825f6cbedecdbfb3a272e1a88473b1f1a1b92075cab429d3d6fc64"
amd64.url = "https://github.com/sibprogrammer/xq/releases/download/v1.2.3/xq_1.2.3_linux_amd64.tar.gz"
amd64.sha256 = "d510d97a247ad9b5a4e92759ea9b1b6be07d9f18187209b359525744e1bb8947"
armhf.url = "https://github.com/sibprogrammer/xq/releases/download/v1.2.3/xq_1.2.3_linux_armv7.tar.gz"
armhf.sha256 = "f9b01ba7d77965f292f3c1b8c164267367507e16a8951b67733a539d7f73eecb"
arm64.url = "https://github.com/sibprogrammer/xq/releases/download/v1.2.3/xq_1.2.3_linux_arm64.tar.gz"
arm64.sha256 = "a8989b2b1a5254033aebacb72ffea77964d6903d809361001dbf1ed09a0c6550"
#
# INFO need also to update extensions version on _common.sh
#
[resources.ports]
main.default = 31386
stop.default = 31387
main.default = 8080
[resources.system_user]
allow_email = true
[resources.install_dir]
dir = "/opt/yunohost/__APP__"
[resources.data_dir]
dir = "/home/yunohost.app/__APP__"
[resources.permissions]
main.url = "/"
[resources.apt]
packages = "openjdk-17-jdk" #mariadb-server
admin.label = "Admins"
#[resources.database]
#type = "mysql"
[resources.apt]
packages = ["openjdk-17-jre", "postgresql"]
[resources.database]
type = "postgresql"

View file

@ -4,10 +4,187 @@
# COMMON VARIABLES
#=================================================
super_admin_config='#'
systemd_match_start_line='oxtjl.NotifyListener:main: ----------------------------------'
flavor_version='15.10.1'
ldap_version='9.12.0'
if [ $install_standard_flavor -eq 1 ]; then
distribution_default_ui="distribution.defaultUI=org.xwiki.platform:xwiki-platform-distribution-flavor-mainwiki/$flavor_version"
else
distribution_default_ui='#'
fi
if [ $path == '/' ]; then
install_on_root=true
path2=''
path3=''
web_inf_path="$install_dir"/webapps/root/WEB-INF
else
install_on_root=false
path2=${path/#\//}/ # path=/xwiki -> xwiki/
path3=${path/#\//} # path=/xwiki -> xwiki
web_inf_path="$install_dir"/webapps$path/WEB-INF
fi
#=================================================
# PERSONAL HELPERS
#=================================================
enable_super_admin() {
super_admin_pwd=$(ynh_string_random)
super_admin_config="xwiki.superadminpassword=$super_admin_pwd"
ynh_add_config --template=xwiki.cfg --destination=/etc/$app/xwiki_conf.cfg
ln -f /etc/$app/xwiki_conf.cfg "$web_inf_path"/xwiki.cfg
chmod 400 /etc/$app/xwiki_conf.cfg
chown "$app:$app" /etc/$app/xwiki_conf.cfg
}
disable_super_admin() {
super_admin_config='#'
ynh_add_config --template=xwiki.cfg --destination=/etc/$app/xwiki_conf.cfg
ln -f /etc/$app/xwiki_conf.cfg "$web_inf_path"/xwiki.cfg
chmod 400 /etc/$app/xwiki_conf.cfg
chown "$app:$app" /etc/$app/xwiki_conf.cfg
}
install_exension() {
local extension_id=$1
local extension_version=$2
local temp_dir=$(mktemp -d)
local job_id=$(ynh_string_random)
local xq=$install_dir/xq_tool/xq
local curl='curl --silent --show-error'
local extension_name_path=$(echo ${extension_id//./%2E} | sed 's|:|%3A|g')
local extension_version_path=${extension_version//./%2E}
if [ -e "$data_dir/extension/repository/$extension_name_path/$extension_version_path" ]; then
# Return if extension is already installed
return 0
fi
local status_raw
local state_request
chmod 700 $temp_dir
chown root:root $temp_dir
ynh_add_config --template=install_extensions.xml --destination=$temp_dir/install_extensions.xml
status_raw=$($curl -i --user "superadmin:$super_admin_pwd" -X PUT -H 'Content-Type: text/xml' "http://127.0.0.1:$port/${path2}rest/jobs?jobType=install&async=true" --upload-file $temp_dir/install_extensions.xml)
state_request=$(echo $status_raw | $xq -x '//jobStatus/ns2:state')
while true; do
sleep 5
status_raw=$($curl --user "superadmin:$super_admin_pwd" -X GET -H 'Content-Type: text/xml' "http://127.0.0.1:$port/${path2}rest/jobstatus/extension/provision/$job_id")
state_request=$(echo "$status_raw" | $xq -x '//jobStatus/state')
if [ -z "$state_request" ]; then
ynh_die --message="Invalid answer: '$status_raw'"
elif [ "$state_request" == FINISHED ]; then
# Check if error happen
error_msg=$(echo "$status_raw" | $xq -x '//jobStatus/errorMessage')
if [ -z "$error_msg" ]; then
break
else
ynh_die --message="Error while installing extension '$extension_id'. Error: $error_msg"
fi
elif [ "$state_request" != RUNNING ]; then
ynh_die --message="Invalid status '$state_request'"
fi
done
}
wait_xwiki_started() {
local res='meta http-equiv="refresh" content="1"'$
local curl='curl --silent --show-error'
while echo "$res" | grep -q 'meta http-equiv="refresh" content="1"'; do
res=$($curl "http://127.0.0.1:$port/${path2}bin/view/Main/")
sleep 10
done
}
wait_for_flavor_install() {
local flavor_job_id='org.xwiki.platform%3Axwiki-platform-distribution-flavor-mainwiki/wiki%3Axwiki'
local status_raw
local state_request
local xq=$install_dir/xq_tool/xq
local curl='curl --silent --show-error'
# Need to call main page to start xwiki service
wait_xwiki_started
while true; do
status_raw=$($curl --user "superadmin:$super_admin_pwd" -X GET -H 'Content-Type: text/xml' "http://127.0.0.1:$port/${path2}rest/jobstatus/extension/action/$flavor_job_id")
state_request=$(echo "$status_raw" | $xq -x '//jobStatus/state')
if [ -z "$state_request" ]; then
ynh_die --message="Invalid answer: '$status_raw'"
elif [ "$state_request" == FINISHED ]; then
# Check if error happen
error_msg=$(echo "$status_raw" | $xq -x '//jobStatus/errorMessage')
if [ -z "$error_msg" ]; then
break
else
ynh_die --message="Error while installing extension 'org.xwiki.platform%3Axwiki-platform-distribution-flavor-mainwiki'. Error: $error_msg"
fi
elif [ "$state_request" != RUNNING ]; then
ynh_die --message="Invalid status '$state_request'"
fi
sleep 10
done
}
install_source() {
ynh_setup_source --dest_dir="$install_dir" --full_replace=1
ynh_setup_source --dest_dir="$install_dir"/webapps/xwiki/WEB-INF/lib/ --source_id=jdbc
ynh_setup_source --dest_dir="$install_dir"/xq_tool --source_id=xq_tool
ynh_secure_remove --file="$install_dir"/webapps/xwiki/WEB-INF/xwiki.cfg
ynh_secure_remove --file="$install_dir"/webapps/xwiki/WEB-INF/xwiki.properties
ynh_secure_remove --file="$install_dir"/webapps/root
ln -s /var/log/"$app" "$install_dir"/logs
if $install_on_root; then
mv "$install_dir"/webapps/xwiki "$install_dir"/webapps/root
elif [ "$path" == /root ]; then
ynh_die --message='Path "/root" not supported'
elif [ "$path" != /xwiki ]; then
mv "$install_dir"/webapps/xwiki "$install_dir"/webapps$path
fi
}
add_config() {
ynh_add_config --template=hibernate.cfg.xml --destination=/etc/$app/hibernate.cfg.xml
ynh_add_config --template=xwiki.cfg --destination=/etc/$app/xwiki_conf.cfg
ynh_add_config --template=xwiki.properties --destination=/etc/$app/xwiki_conf.properties
# Note that using /etc/xwiki/xwiki.cfg or /etc/xwiki/xwiki.properties is hard coded on the application
# And using this break multi instance feature so we must use an other path
# Note that symlink don't work. So use hard link instead.
ln -f /etc/$app/xwiki_conf.cfg "$web_inf_path"/xwiki.cfg
ln -f /etc/$app/xwiki_conf.properties "$web_inf_path"/xwiki.properties
}
set_permissions() {
chmod -R u+rwX,o-rwx "$install_dir"
chown -R "$app:$app" "$install_dir"
chmod -R u=rwX,g=rX,o= /etc/$app
chown -R "$app:$app" /etc/$app
chown "$app:$app" -R /var/log/$app
chmod u=rwX,g=rX,o= -R /var/log/$app
find $data_dir \( \! -perm u=rwX,g=rX,-o= \
-o \! -user $app \
-o \! -group $app \) \
-exec chown $app:$app {} \; \
-exec chmod u=rwX,g=rX,o= {} \;
}
#=================================================
# EXPERIMENTAL HELPERS
#=================================================

View file

@ -15,11 +15,16 @@ source /usr/share/yunohost/helpers
#=================================================
ynh_print_info --message="Declaring files to be backed up..."
if [[ ! "$(systemctl status $app)" =~ "Active: inactive (dead)" ]]; then
ynh_print_warn --message="It's hightly recommended to make your backup when the service is stopped. Please stop $app service with this command before to run the backup 'systemctl stop $app.service'"
fi
#=================================================
# BACKUP THE APP MAIN DIR
#=================================================
ynh_backup --src_path="$install_dir"
ynh_backup --src_path="/etc/$app"
#=================================================
# BACKUP THE NGINX CONFIGURATION
@ -33,12 +38,18 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
ynh_backup --src_path="/etc/systemd/system/$app.service"
#=================================================
# BACKUP DATA
#=================================================
ynh_backup --src_path="$data_dir" --is_big=1
#=================================================
# BACKUP THE MYSQL DATABASE
#=================================================
#ynh_print_info --message="Backing up the MySQL database..."
ynh_print_info --message="Backing up the MySQL database..."
#ynh_mysql_dump_db --database="$db_name" > db.sql
ynh_psql_dump_db --database="$db_name" > db.sql
#=================================================
# END OF SCRIPT

View file

@ -16,7 +16,7 @@ source /usr/share/yunohost/helpers
#=================================================
ynh_script_progression --message="Stopping a systemd service..." --weight=1
ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log"
ynh_systemd_action --service_name=$app --action=stop
#=================================================
# MODIFY URL IN NGINX CONF
@ -25,6 +25,22 @@ ynh_script_progression --message="Updating NGINX web server configuration..." --
ynh_change_url_nginx_config
ynh_script_progression --message="Updating xwiki configuration..." --weight=1
if [ $new_path != $old_path ]; then
if $install_on_root; then
mv "$install_dir"/webapps$old_path "$install_dir"/webapps/root
elif [ "$path" == /root ]; then
ynh_die --message='Path "/root" not supported'
elif [ $old_path == / ]; then
mv "$install_dir"/webapps/root "$install_dir"/webapps$new_path
else
mv "$install_dir"/webapps$old_path "$install_dir"/webapps$new_path
fi
fi
add_config
set_permissions
#=================================================
# GENERIC FINALISATION
#=================================================
@ -32,7 +48,8 @@ ynh_change_url_nginx_config
#=================================================
ynh_script_progression --message="Starting a systemd service..." --weight=1
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log"
ynh_systemd_action --service_name=$app --action=start --log_path=systemd --line_match="$systemd_match_start_line"
wait_xwiki_started
#=================================================
# END OF SCRIPT

View file

@ -11,17 +11,33 @@ source /usr/share/yunohost/helpers
#=================================================
# APP "BUILD" (DEPLOYING SOURCES, VENV, COMPILING ETC)
#=================================================
if [ -n "$(ls -A $data_dir)" ]; then
old_data_dir_path="${data_dir}_$(date '+%Y%m%d.%H%M%S')"
ynh_print_warn "Data directory was not empty. Data was moved to $old_data_dir_path"
mkdir -p $old_data_dir_path
mv -t "$old_data_dir_path" "$data_dir"/*
fi
mkdir -p /var/log/"$app"
mkdir -p /etc/$app
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
ynh_script_progression --message="Setting up source files..." --weight=1
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$install_dir"
ynh_script_progression --message='Setting up source files...' --weight=1
chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir"
chmod +x "$install_dir/start_xwiki.sh"
install_source
#=================================================
# ADD A CONFIGURATION
#=================================================
ynh_script_progression --message='Adding configuration files...' --weight=1
add_config
set_permissions
#=================================================
# SYSTEM CONFIGURATION
@ -34,29 +50,40 @@ ynh_add_nginx_config
# Create a dedicated systemd config
ynh_add_systemd_config
yunohost service add $app --description="Collaboration tool" --log="/var/log/$app/$app.log"
yunohost service add "$app" --description=XWiki --log="/var/log/$app/$app.log"
ynh_use_logrotate --logfile "/var/log/$app"
#=================================================
# APP INITIAL CONFIGURATION
# INSTALL EXTENSIONS
#=================================================
# ADD A CONFIGURATION
#=================================================
ynh_script_progression --message="Adding a configuration file..." --weight=1
ynh_add_config --template="../conf/xwiki_env" --destination="$install_dir/xwiki_env"
enable_super_admin
chmod 400 "$install_dir/xwiki_env"
chown $app:$app "$install_dir/xwiki_env"
# Start a systemd service
ynh_systemd_action --service_name=$app --action=start --log_path=systemd --line_match="$systemd_match_start_line"
if [ $install_standard_flavor -eq 1 ]; then
ynh_script_progression --message='Installing flavor...'
wait_for_flavor_install
fi
ynh_script_progression --message='Installing LDAP extension...' --weight=1
install_exension 'org.xwiki.contrib.ldap:ldap-authenticator' "$ldap_version"
# Disable super admin
ynh_systemd_action --service_name=$app --action=stop
disable_super_admin
#=================================================
# GENERIC FINALIZATION
#=================================================
# START SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Starting a systemd service..." --weight=1
# Start a systemd service
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log"
ynh_script_progression --message='Starting a systemd service...' --weight=1
ynh_systemd_action --service_name=$app --action=start --log_path=systemd --line_match="$systemd_match_start_line"
wait_xwiki_started
#=================================================
# END OF SCRIPT

View file

@ -12,7 +12,7 @@ source /usr/share/yunohost/helpers
#=================================================
# REMOVE SYSTEM CONFIGURATIONS
#=================================================
# REMOVE SYSTEMD SERVICE
# REMOVE SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Removing system configurations related to $app..." --weight=1
@ -23,6 +23,8 @@ then
yunohost service remove $app
fi
ynh_secure_remove --file="/etc/$app"
ynh_remove_systemd_config
ynh_remove_nginx_config

View file

@ -13,42 +13,39 @@ source /usr/share/yunohost/helpers
#=================================================
# RESTORE THE APP MAIN DIR
#=================================================
ynh_script_progression --message="Restoring the app main directory..." --weight=1
ynh_script_progression --message="Restoring files..." --weight=10
ynh_restore_file --origin_path="$install_dir"
chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir"
ynh_restore
#=================================================
# RESTORE THE MYSQL DATABASE
#=================================================
#ynh_script_progression --message="Restoring the MySQL database..." --weight=1
ynh_script_progression --message="Restoring the database..." --weight=1
#ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql
ynh_psql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql
#=================================================
# RESTORE SYSTEM CONFIGURATIONS
#=================================================
# RESTORE THE PHP-FPM CONFIGURATION
#=================================================
ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
mkdir -p /var/log/"$app"
set_permissions
ynh_restore_file --origin_path="/etc/systemd/system/$app.service"
systemctl enable $app.service --quiet
yunohost service add $app --description=XWiki --log="/var/log/$app/$app.log"
yunohost service add $app --description="Collaboration tool" --log="/var/log/$app/$app.log"
ynh_use_logrotate --logfile "/var/log/$app"
#=================================================
# GENERIC FINALIZATION
#=================================================
# RELOAD NGINX AND PHP-FPM OR THE APP SERVICE
# RELOAD NGINX AND THE APP SERVICE
#=================================================
ynh_script_progression --message="Reloading NGINX web server and $app's service..." --weight=1
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log"
ynh_systemd_action --service_name=$app --action=start --log_path=systemd --line_match="$systemd_match_start_line"
wait_xwiki_started
ynh_systemd_action --service_name=nginx --action=reload

View file

@ -11,12 +11,16 @@ source /usr/share/yunohost/helpers
upgrade_type=$(ynh_check_app_version_changed)
if ynh_compare_current_package_version --comparison le --version '14.10.8~ynh1'; then
ynh_die --mesage='Upgrade from this version is not supported. Please backup and restore manually the data after a clean new install'
fi
#=================================================
# STOP SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Stopping a systemd service..." --weight=1
ynh_script_progression --message='Stopping a systemd service..' --weight=1
ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log"
ynh_systemd_action --service_name=$app --action=stop --log_path="/var/log/$app/$app.log"
#=================================================
# "REBUILD" THE APP (DEPLOY NEW SOURCES, RERUN NPM BUILD...)
@ -24,35 +28,64 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
if [ "$upgrade_type" == "UPGRADE_APP" ]
if [ "$upgrade_type" == UPGRADE_APP ]
then
ynh_script_progression --message="Upgrading source files..." --weight=1
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$install_dir" --keep ="xwiki_env"
ynh_script_progression --message='Setting up source files...'
install_source
fi
chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir"
chmod +x "$install_dir/start_xwiki.sh"
#=================================================
# REAPPLY SYSTEM CONFIGURATIONS
#=================================================
ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=1
ynh_script_progression --message="Adding system configurations related to $app..." --weight=1
# Create a dedicated NGINX config using the conf/nginx.conf template
ynh_add_nginx_config
# Create a dedicated systemd config
ynh_add_systemd_config
yunohost service add $app --description="Collaboration tool" --log="/var/log/$app/$app.log"
yunohost service add "$app" --description=XWiki --log="/var/log/$app/$app.log"
ynh_use_logrotate --logfile "/var/log/$app"
#=================================================
# ADD A CONFIGURATION
#=================================================
ynh_script_progression --message='Adding configuration files...' --weight=1
add_config
set_permissions
#=================================================
# UPGRADE EXTENSIONS
#=================================================
enable_super_admin
# Start a systemd service
ynh_systemd_action --service_name=$app --action=start --log_path=systemd --line_match="$systemd_match_start_line"
if [ $install_standard_flavor -eq 1 ]; then
ynh_script_progression --message='Upgrading flavor...'
wait_for_flavor_install
fi
ynh_script_progression --message='Upgrading LDAP extension...' --weight=1
install_exension 'org.xwiki.contrib.ldap:ldap-authenticator' "$ldap_version"
# Disable super admin
ynh_systemd_action --service_name=$app --action=stop
disable_super_admin
#=================================================
# GENERIC FINALIZATION
#=================================================
# START SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Starting a systemd service..." --weight=1
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log"
ynh_script_progression --message='Starting a systemd service...' --weight=1
ynh_systemd_action --service_name=$app --action=start --log_path=systemd --line_match="$systemd_match_start_line"
wait_xwiki_started
#=================================================
# END OF SCRIPT