Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 88 additions & 0 deletions admin_manual/collectives/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,91 @@ Here's an example how to import from a Dokuwiki instance:

/path/to/doku2md.py -d /path/to/dokuwiki/data/pages -T
php -d memory_limit=2G ./occ collectives:import:markdown -c 123 -u alice /path/to/dokuwiki/data/pages

Publishing collectives as websites
----------------------------------

Admins and owners of a collective can publish selected pages of the collective as a public static website. See
`Publish a collective as a website
<https://docs.nextcloud.com/server/latest/user_manual/en/collectives/publish_as_static_website.html>`_ in the user
manual for how this works for users.

Nextcloud doesn't build or host the websites itself. It hands the content of a website to the external service
`publish <https://github.com/nextcloud-publish/publish>`_. The service builds the website, serves it from its own
host and reports the result back to Nextcloud. The feature is disabled by default.

Setting up the external publish service
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Deploy the publish service as described in the `publish wiki <https://github.com/nextcloud-publish/publish/wiki>`_.
Remember the URL of the service and the value of ``PUBLISH_API_TOKEN`` from its ``.env`` file. You need both to
connect to your Nextcloud instance.

The published websites are served by the publish service, for example at
``https://publish.example.com/sites/<address>/``. The exact URL of a website is reported by the service after
publishing.

Connecting Nextcloud
^^^^^^^^^^^^^^^^^^^^

1. Go to **Administration settings** → **Additional settings**.
2. In the **Publish feature** section, enable **Enable publish feature**.
3. Enter the URL of the publish service in the **Static site generator URL** field, for example
``https://publish.example.com``.
4. Enter the value of ``PUBLISH_API_TOKEN`` in the **Static site generator token** field.
5. Click **Test connection** to check that Nextcloud can reach the service and the token is valid.

Alternatively, configure the feature with :command:`occ`:

.. code-block:: bash

sudo -E -u www-data php occ config:app:set collectives publish_enabled --value=true --type=boolean
sudo -E -u www-data php occ config:app:set collectives static_site_generator_url --value=https://publish.example.com
sudo -E -u www-data php occ config:app:set collectives static_site_generator_token --value=<token> --sensitive

Disabling the feature prevents new publications and updates. Websites that are already published stay online.

Maximum website size
^^^^^^^^^^^^^^^^^^^^

The total size of all files of a website is limited to 100 MiB by default. To change the limit, set
``static_site_max_size`` in bytes, for example to 200 MiB:

.. code-block:: bash

sudo -E -u www-data php occ config:app:set collectives static_site_max_size --value=209715200 --type=integer

Network requirements
^^^^^^^^^^^^^^^^^^^^

* Nextcloud must be able to reach the publish service.
* The publish service must be able to reach Nextcloud under its public URL. It downloads the content of a website
from Nextcloud and reports the result back to Nextcloud. Make sure ``overwrite.cli.url`` in ``config.php`` is set
to a URL the publish service can reach.
* If the publish service runs on a local or private network address, Nextcloud blocks requests to it by default.
Allow them in ``config.php``:

.. code-block:: php

$CONFIG = [
// ...
'allow_local_remote_servers' => true,
];

Deleted collectives
^^^^^^^^^^^^^^^^^^^

When a collective is moved to the trash, its websites stay online. When a collective is deleted permanently, its
websites are deleted from the publish service as well. If the service can't be reached at that moment, the background
job ``DeleteOrphanedStaticSites`` retries the deletion every six hours. Until then, the website addresses stay reserved.

Troubleshooting
^^^^^^^^^^^^^^^

* **Users don't see Publish website:** Check that **Enable publish feature** is enabled and that the user is an admin
or the owner of the collective.
* **Publishing websites is not set up:** The URL or the token of the publish service is missing.
* **The publish service is currently not available:** Nextcloud can't reach the publish service. Check the URL and the
network connection.
* **Publishing fails or never finishes:** The publish service may not be able to reach Nextcloud. Check the network
requirements above and the logs of the publish service.
2 changes: 2 additions & 0 deletions user_manual/collectives/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Why use Collectives?
* You want all your shared knowledge in one place.
* You want a quick and easy overview of your pages and subpages.
* You want to share parts of the knowledge with external people.
* You want to share all or parts of the knowledge as a public static website.
* You already use Nextcloud.

First steps
Expand Down Expand Up @@ -56,4 +57,5 @@ What's next
-----------

* To learn how to use Collectives in your team, see :doc:`onboard_your_team`.
* To publish pages of your collective as a website, see :doc:`publish_as_static_website`.
* For an overview over features, see here.
1 change: 1 addition & 0 deletions user_manual/collectives/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ to structure shared knowledge.
getting_started
onboard_your_team
markdown_files
publish_as_static_website
61 changes: 61 additions & 0 deletions user_manual/collectives/publish_as_static_website.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
=================================
Publish a collective as a website
=================================

You can publish pages of your collective as a website. Anyone with the link can read the website without logging in.
A collective can have several websites, each with its own address and its own selection of pages.

.. note::
Only admins and the owner of a collective can publish websites. The feature must also be set up by your
administrator.

Create a website
----------------

1. Click the … button next to your collective and choose **Publish website**.
2. Click **Create website**. If the collective already has a website, click **New website** instead.
3. Select the pages you want to publish and click **Continue**. When you select a page, its subpages and the pages
above it are selected as well. The **Home** page is always part of the website.
4. Enter a **Website title**. By default, this is the name of your collective.
5. Enter a **Website address**. Use lowercase letters, numbers and single hyphens.
6. Choose a **Theme**:

* **Wiki** shows the page tree in a sidebar, like in Collectives. Good for many pages.
* **Menu bar** shows the top-level pages in a menu bar. Good for a few main pages.
7. Click **Publish website**.

Publishing takes a moment. You get a notification with the link as soon as your website is online.

.. warning::
You can't change the website address after the website has been published for the first time.

Keep your website up to date
----------------------------

Changes to your pages don't show up on the website automatically. When you have changed a published page, the website
shows **Live · changes not published**.

1. Click the … button next to your collective and choose **Publish website**.
2. Click **Update** next to the website.
3. Check the list of changed pages and click **Publish**.

To change which pages are published, the title or the theme, click the … button next to the website and choose
**Edit**.

Open, share or delete a website
-------------------------------

Click the … button next to the website and choose:

* **Open website** to view the website in your browser.
* **Copy link** to copy the address of the website and share it with others.
* **Delete website** to take the website offline. This deletes the website only, the pages in your collective stay
as they are.

If publishing fails
-------------------

If a website shows **Failed**, the reason is shown below the website. Click **Retry publish** to try again.

If the website is too large, remove large files from the published pages. If the page titles are very long or the
pages are nested very deeply, shorten the titles. If the problem persists, contact your administrator.
Loading