From ab9fb65e1f8ca93274c3244577164880cb3fe769 Mon Sep 17 00:00:00 2001 From: Raman Maksimchuk Date: Wed, 17 Apr 2024 12:49:08 +0300 Subject: [PATCH] Notes about Merging Configuration Files feature in `configuration.rst` (#2048) * Update configuration.rst * Static CSS overrides * Notes are now smaller --- .gitignore | 1 - docs/_static/overrides.css | 6 ++++++ docs/conf.py | 1 + docs/features/configuration.rst | 15 ++++++++++++--- 4 files changed, 19 insertions(+), 4 deletions(-) create mode 100644 docs/_static/overrides.css diff --git a/.gitignore b/.gitignore index 1c30928ce..f01a1095e 100644 --- a/.gitignore +++ b/.gitignore @@ -417,5 +417,4 @@ test/Ocelot.AcceptanceTests/ocelot.json # Read the Docs # https://ocelot.readthedocs.io _build/ -_static/ _templates/ diff --git a/docs/_static/overrides.css b/docs/_static/overrides.css new file mode 100644 index 000000000..a5f45454c --- /dev/null +++ b/docs/_static/overrides.css @@ -0,0 +1,6 @@ +blockquote { + font-size: 0.9em; +} +aside.footnote-list { + font-size: 0.9em; +} diff --git a/docs/conf.py b/docs/conf.py index 41b0fd36d..6d08568ce 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -27,3 +27,4 @@ # https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-html_static_path html_static_path = ['_static'] +html_css_files = ['overrides.css'] diff --git a/docs/features/configuration.rst b/docs/features/configuration.rst index 552767f49..931e4f58d 100644 --- a/docs/features/configuration.rst +++ b/docs/features/configuration.rst @@ -123,9 +123,16 @@ If you want to set the **GlobalConfiguration** property, you must have a file ca The way Ocelot merges the files is basically load them, loop over them, add any **Routes**, add any **AggregateRoutes** and if the file is called ``ocelot.global.json`` add the **GlobalConfiguration** aswell as any **Routes** or **AggregateRoutes**. Ocelot will then save the merged configuration to a file called `ocelot.json`_ and this will be used as the source of truth while Ocelot is running. -At the moment there is no validation at this stage it only happens when Ocelot validates the final merged configuration. -This is something to be aware of when you are investigating problems. -We would advise always checking what is in `ocelot.json`_ file if you have any problems. + **Note 1**: Currently, validation occurs only during the final merging of configurations in Ocelot. + It's essential to be aware of this when troubleshooting issues. + We recommend thoroughly inspecting the contents of the ``ocelot.json`` file if you encounter any problems. + + **Note 2**: The Merging feature is operational only during the application's startup. + Consequently, the merged configuration in ``ocelot.json`` remains static post-merging and startup. + It's important to be aware that the ``ConfigureAppConfiguration`` method is invoked solely during the startup of an ASP.NET web application. + Once the Ocelot application has started, you cannot call the ``AddOcelot`` method, nor can you employ the merging feature within ``AddOcelot``. + If you still require on-the-fly updating of the primary configuration file, ``ocelot.json``, please refer to the :ref:`config-react-to-changes` section. + Additionally, note that merging partial configuration files (such as ``ocelot.*.json``) on the fly using :doc:`../features/administration` API is not currently implemented. Keep files in a folder ^^^^^^^^^^^^^^^^^^^^^^ @@ -336,6 +343,8 @@ As a team, we highly recommend following these instructions when developing your System administrators or DevOps engineers must create real valid certificates being signed by hosting or cloud providers. **Switch off the feature for all routes!** Remove the **DangerousAcceptAnyServerCertificateValidator** property for all routes in production version of `ocelot.json`_ file! +.. _config-react-to-changes: + React to Configuration Changes ------------------------------