Skip to content

Commit 66293b5

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 5bb23ae commit 66293b5

File tree

26 files changed

+23
-69
lines changed

26 files changed

+23
-69
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/33/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

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

172-
.. TODO ON RELEASE: Update version number above on release
173-
174170
.. 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).
175171

176172
Federated Cloud Sharing
177173
-----------------------
178174

179175
If you are using `Federated Cloud Sharing <https://docs.nextcloud.com/server/33/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.
180176
Therefore, you can set ``davstorage.request_timeout`` in your ``config.php``. The default value is 30 seconds.
181-
182-
.. 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/33/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/33/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 & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@ Other 2FA providers may be found in the App Store.
4848
Developers can also `implement new two-factor provider
4949
apps <https://docs.nextcloud.com/server/33/developer_manual/digging_deeper/two-factor-provider.html>`_.
5050

51-
.. TODO ON RELEASE: Update version number above on release
52-
5351
Enforcing two-factor authentication
5452
-----------------------------------
5553

admin_manual/index.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ For documentation on development topics, see:
3333
- The individual repositories on GitHub within `the @nextcloud organization <https://github.com/nextcloud/>`_
3434
- `Nextcloud Development Manual <https://docs.nextcloud.com/server/33/developer_manual/>`_
3535

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

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/33/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
@@ -305,8 +305,6 @@ Depending on your server setup, these are the possible connections:
305305
.. _optional (config): https://docs.nextcloud.com/server/33/admin_manual/configuration_server/config_sample_php_parameters.html#has-internet-connection
306306
.. _detailed field list: https://github.com/nextcloud/survey_client
307307

308-
.. TODO ON RELEASE: Update version number above on release
309-
310308

311309
Setup fail2ban
312310
--------------

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/33/developer_manual/prologue/bugtracker/index.html
3535

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

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

418-
.. TODO ON RELEASE: Update version number above on release
419-
420416
Running the following command can help fix the sizes and quota for a given user::
421417

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

admin_manual/occ_command.rst

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

381381
.. _Appconfig Concepts: https://docs.nextcloud.com/server/33/developer_manual/digging_deeper/config/appconfig.html#concept-overview
382382

383-
.. TODO ON RELEASE: Update version number above on release
384-
385383
You can list all configuration values with one command::
386384

387385
sudo -E -u www-data php occ config:list
@@ -1153,8 +1151,6 @@ The command line option ``--transfer-incoming-shares`` overwrites the config.php
11531151
Users may also transfer files or folders selectively by themselves.
11541152
See `user documentation <https://docs.nextcloud.com/server/33/user_manual/en/files/transfer_ownership.html>`_ for details.
11551153

1156-
.. TODO ON RELEASE: Update version number above on release
1157-
11581154
.. _occ_files_windows_filenames:
11591155

11601156
Toggle Windows compatibility
@@ -1246,8 +1242,6 @@ Verify your app::
12461242
When it returns nothing, your app is signed correctly. When it returns a message then there is an error. See `Code Signing
12471243
<https://docs.nextcloud.com/server/33/developer_manual/app_publishing_maintenance/code_signing.html#how-to-get-your-app-signed>`_ in the Developer manual for more detailed information.
12481244

1249-
.. TODO ON RELEASE: Update version number above on release
1250-
12511245
``integrity:sign-core`` is for Nextcloud core developers only.
12521246

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

conf.py

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

34+
# Ensure release is either "latest", or a digit (for stable versions)
35+
if not (release == 'latest' or release.isdigit()):
36+
raise ValueError("Invalid release version: %s. Must be 'latest' or a digit." % release)
37+
38+
# Print the version being built in a clear way in the logs
39+
width = 60
40+
msg = " Building documentation for version: %s " % release
41+
print("\n\n" + "#" * width)
42+
print("#" + msg.center(width - 2, "#") + "#")
43+
print("#" * width + "\n\n")
44+
3445
# RTD theme options
3546
html_theme_options = {
3647
'logo_only': True,
@@ -46,7 +57,18 @@
4657
html_copy_source = False
4758

4859
# substitutions go here
49-
rst_epilog = '.. |version| replace:: %s' % version
60+
rst_epilog = """
61+
.. |version| replace:: %s
62+
""" % (release)
63+
64+
# Replace hardcoded /latest/ URLs in all .rst source files with the actual release
65+
def replace_latest(app, docname, source):
66+
if release != 'latest':
67+
source[0] = source[0].replace('/server/latest/', '/server/%s/' % release)
68+
69+
def setup(app):
70+
app.connect('source-read', replace_latest)
71+
5072

5173
# building the versions list
5274
version_start = 31 # THIS IS THE OLDEST SUPPORTED VERSION NUMBER

0 commit comments

Comments
 (0)