Skip to content

Commit cc03bb1

Browse files
skjnldsvbackportbot[bot]
authored andcommitted
feat: auto replace latest urls for older releases
feat: auto replace latest urls for older releases Signed-off-by: skjnldsv <skjnldsv@protonmail.com> [skip ci]
1 parent 04f2e67 commit cc03bb1

File tree

25 files changed

+23
-67
lines changed

25 files changed

+23
-67
lines changed

admin_manual/configuration_files/big_file_upload_configuration.rst

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@ through WebDAV single file PUT requests or `Chunked file uploads
4848
<https://docs.nextcloud.com/server/31/developer_manual/client_apis/WebDAV/chunking.html>`_
4949
For those, PHP and webserver timeouts are the limiting factor on the upload size.
5050

51-
.. TODO ON RELEASE: Update version number above on release
52-
5351
Adjust these values for your needs. If you see PHP timeouts in your logfiles,
5452
increase the timeout values, which are in seconds::
5553

@@ -171,14 +169,10 @@ to the actual file on the Nextcloud servers temporary directory. It is recommend
171169
the size of your temp directory accordingly and also ensure that request timeouts are high
172170
enough for PHP, webservers or any load balancers involved.
173171

174-
.. TODO ON RELEASE: Update version number above on release
175-
176172
.. tip:: In more recent versions of Nextcloud Server, when uploading to S3 in *Primary Storage* mode, we use S3 `MultipartUpload`. This allows chunked upload streaming of the chunks directly to S3 so that the final MOVE request no longer needs to assemble the final file on the Nextcloud server. This requires your ``memcache.distributed`` to be set to use Redis (or Memcached), otherwise we fall back on the prior behavior which consumes space on the Nextcloud Server for file assembly (as described above).
177173

178174
Federated Cloud Sharing
179175
-----------------------
180176

181177
If you are using `Federated Cloud Sharing <https://docs.nextcloud.com/server/31/admin_manual/configuration_files/federated_cloud_sharing_configuration.html>`_ and want to share large files, you can increase the timeout values for requests to the federated servers.
182178
Therefore, you can set ``davstorage.request_timeout`` in your ``config.php``. The default value is 30 seconds.
183-
184-
.. TODO ON RELEASE: Update version number above on release

admin_manual/configuration_files/encryption_details.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,5 +356,3 @@ Sources
356356
- `Sourcecode: Generation of the File Key <https://github.com/nextcloud/server/blob/a374d8837d6de459500e619cf608e0721ea14574/apps/encryption/lib/Crypto/Crypt.php#L645>`_
357357
- `Sourcecode: Generation of the Initialization Vector <https://github.com/nextcloud/server/blob/a374d8837d6de459500e619cf608e0721ea14574/apps/encryption/lib/Crypto/Crypt.php#L634>`_
358358
- `Sourcecode: Generation of a Key Pair <https://github.com/nextcloud/server/blob/a374d8837d6de459500e619cf608e0721ea14574/apps/encryption/lib/Crypto/Crypt.php#L153>`_
359-
360-
.. TODO ON RELEASE: Update version number above on release

admin_manual/configuration_files/file_sharing_configuration.rst

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,6 @@ forcing them.
100100
.. note:: There are more sharing options on config.php level available:
101101
`Configuration Parameters <https://docs.nextcloud.com/server/31/admin_manual/configuration_server/config_sample_php_parameters.html#sharing>`_
102102

103-
.. TODO ON RELEASE: Update version number above on release
104-
105103
.. _transfer_userfiles_label:
106104

107105
Advanced settings
@@ -178,8 +176,6 @@ reference.)
178176
Users may also transfer files or folders selectively by themselves.
179177
See `user documentation <https://docs.nextcloud.com/server/31/user_manual/en/files/transfer_ownership.html>`_ for details.
180178

181-
.. TODO ON RELEASE: Update version number above on release
182-
183179

184180
Creating persistent file Shares
185181
-------------------------------

admin_manual/configuration_user/two_factor-auth.rst

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,11 @@ types of factors. Three providers are automatically installed (but may need to b
4343

4444
Other 2FA providers may be found in the App Store.
4545

46-
.. TODO ON RELEASE: Update version number above on release
47-
4846
.. figure:: ../images/2fa-app-install.png
4947

5048
Developers can also `implement new two-factor provider
5149
apps <https://docs.nextcloud.com/server/latest/developer_manual/digging_deeper/two-factor-provider.html>`_.
5250

53-
.. TODO ON RELEASE: Update version number above on release
54-
5551
Enforcing two-factor authentication
5652
-----------------------------------
5753

admin_manual/installation/example_ubuntu.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ following commands in a terminal::
1616
If you are planning on running additional apps, keep in mind that they might
1717
require additional packages. See `Prerequisites for manual installation <https://docs.nextcloud.com/server/31/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation>`_ for details.
1818

19-
.. TODO ON RELEASE: Update version number above on release
20-
2119
Now you need to create a database user and the database itself by using the
2220
MySQL command line interface. The database tables will be created by Nextcloud
2321
when you login for the first time.

admin_manual/installation/harden_server.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,8 +306,6 @@ Depending on your server setup, these are the possible connections:
306306
.. _optional (config): https://docs.nextcloud.com/server/31/admin_manual/configuration_server/config_sample_php_parameters.html#has-internet-connection
307307
.. _detailed field list: https://github.com/nextcloud/survey_client
308308

309-
.. TODO ON RELEASE: Update version number above on release
310-
311309

312310
Setup fail2ban
313311
--------------

admin_manual/issues/general_troubleshooting.rst

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ configuration report with the :ref:`occ config command
3333
.. _FAQ page: https://help.nextcloud.com/t/how-to-faq-wiki
3434
.. _bugtracker: https://docs.nextcloud.com/server/31/developer_manual/prologue/bugtracker/index.html
3535

36-
.. TODO ON RELEASE: Update version number above on release
37-
3836
General troubleshooting
3937
-----------------------
4038

@@ -434,8 +432,6 @@ does not match the actual data stored in the user's ``data/$userId/files`` direc
434432
Metadata, versions, trashbin and encryption keys are not counted in the used space above.
435433
Please refer to the `quota documentation <https://docs.nextcloud.com/server/31/user_manual/en/files/quota.html>`_ for details.
436434

437-
.. TODO ON RELEASE: Update version number above on release
438-
439435
Running the following command can help fix the sizes and quota for a given user::
440436

441437
sudo -u www-data php occ files:scan -vvv <user-id>

admin_manual/occ_command.rst

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -369,8 +369,6 @@ While setting a configuration value, multiple options are available:
369369

370370
.. _Appconfig Concepts: https://docs.nextcloud.com/server/31/developer_manual/digging_deeper/config/appconfig.html#concept-overview
371371

372-
.. TODO ON RELEASE: Update version number above on release
373-
374372
You can list all configuration values with one command::
375373

376374
sudo -u www-data php occ config:list
@@ -1040,8 +1038,6 @@ Verify your app::
10401038
When it returns nothing, your app is signed correctly. When it returns a message then there is an error. See `Code Signing
10411039
<https://docs.nextcloud.com/server/31/developer_manual/app_publishing_maintenance/code_signing.html#how-to-get-your-app-signed>`_ in the Developer manual for more detailed information.
10421040

1043-
.. TODO ON RELEASE: Update version number above on release
1044-
10451041
``integrity:sign-core`` is for Nextcloud core developers only.
10461042

10471043
See :doc:`../issues/code_signing` to learn more.

conf.py

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,17 @@
2525
# Can be overridden via DOCS_RELEASE env var (used for PDF builds to show the actual version number)
2626
release = os.environ.get('DOCS_RELEASE', version)
2727

28+
# Ensure release is either "latest", or a digit (for stable versions)
29+
if not (release == 'latest' or release.isdigit()):
30+
raise ValueError("Invalid release version: %s. Must be 'latest' or a digit." % release)
31+
32+
# Print the version being built in a clear way in the logs
33+
width = 60
34+
msg = " Building documentation for version: %s " % release
35+
print("\n\n" + "#" * width)
36+
print("#" + msg.center(width - 2, "#") + "#")
37+
print("#" * width + "\n\n")
38+
2839
# RTD theme options
2940
html_theme_options = {
3041
'logo_only': True,
@@ -37,7 +48,18 @@
3748
html_logo = "../_shared_assets/static/logo-white.png"
3849

3950
# substitutions go here
40-
rst_epilog = '.. |version| replace:: %s' % version
51+
rst_epilog = """
52+
.. |version| replace:: %s
53+
""" % (release)
54+
55+
# Replace hardcoded /latest/ URLs in all .rst source files with the actual release
56+
def replace_latest(app, docname, source):
57+
if release != 'latest':
58+
source[0] = source[0].replace('/server/latest/', '/server/%s/' % release)
59+
60+
def setup(app):
61+
app.connect('source-read', replace_latest)
62+
4163

4264
# building the versions list
4365
version_start = 28 # THIS IS THE OLDEST SUPPORTED VERSION NUMBER

developer_manual/basics/logging.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@ who changed the password of an item or made it public, the
5050
`admin audit log <https://docs.nextcloud.com/server/31/admin_manual/configuration_server/logging_configuration.html#admin-audit-log>`_
5151
is the correct place.
5252

53-
.. TODO ON RELEASE: Update version number above on release
54-
5553
You can easily add a log by simply emitting an ``OCP\Log\Audit\CriticalActionPerformedEvent`` event:
5654

5755
.. code-block:: php

0 commit comments

Comments
 (0)