Skip to content

Commit

Permalink
docs(configuration): update configuration (#137)
Browse files Browse the repository at this point in the history
* docs(configuration): update configuration
  • Loading branch information
nico-mcalley authored Apr 15, 2024
1 parent 4905edd commit 0f83f01
Showing 1 changed file with 18 additions and 39 deletions.
57 changes: 18 additions & 39 deletions docs/pages/Configuration.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,65 +4,44 @@

The .env file allows you to provide required variables for the local build process. We recommend that you do not check them into your source code management. Ideally, you inject them later via your CI/CD process. The environment variables follow a strict naming convention enforced by Nuxt. More information can be found in `nuxt.config.ts`

=== NUXT_PRIVATE_API_KEY `string`

This API key is required by the PWA to obtain authorized access to the CaaS and navigation service. Our Customer Success Management team (team-csm@e-spirit.com) will be happy to provide you with this key after the successful provisioning of your cloud environment. The API key will only be used on the server and is not exposed on the client side.

=== NUXT_PRIVATE_CAAS `string`

The URL under which the CaaS can be reached. This URL is only used on the server and is not visible to the user in the client.

=== NUXT_PRIVATE_NAVIGATION_SERVICE `string`
=== NUXT_PUBLIC_MODE `"preview"` | `"release"`

The URL under which the navigation service is available. This URL is only used on the server and is not visible to the user in the client.
We distinguish between preview (editorial) and released data. This is the traditional FirstSpirit way. Specify here which data should be loaded by the PWA. Use "preview" for a PWA instance for editorial purposes, and "release" for a PWA showing released content, e.g. for your production PWA.

=== NUXT_PRIVATE_PROJECT_ID `string`

Several projects can be configured on your FirstSpirit server. In order for the PWA to know which data it needs to access, it needs the UUID of the relevant project.

For the project(s) provided by Crownpeak Technology you will be given this data too.

For other projects you can look at _Project Properties_ in _ServerManager_, then _Project Components_, then _CaaS Connect Project App_.
Several projects can be configured on your FirstSpirit server. In order for the PWA to know which data it needs to access, it needs the UUID of the relevant project. You can copy the UUID from FirstSpirit project settings, menu "Project", field "Global UUID".

Another way to access the project_id is by https://docs.e-spirit.com/odfs/template-develo/scripting/making-scripts/[adding the following script]:

....
import de.espirit.firstspirit.agency.OperationAgent;
import de.espirit.firstspirit.ui.operations.RequestOperation;
=== NUXT_PRIVATE_TENANT_ID `string`

message = context.requireSpecialist(OperationAgent.TYPE).getOperation(RequestOperation.TYPE);
message.setTitle("Project UUID");
message.setKind(RequestOperation.Kind.INFO);
message.perform("Project UUID: " + context.project.uuid);
....
The tenantId is used by the PWA to distinguish between the different environments provided to you. This is the subdomain part of your cloud URL. Usually cloud customers have three environments, one for development, one for quality assurance, and one production environment. Each environment has a different subdomain.

Use the following _display logic_ to only make the script menu entry visible to project admins:
=== NUXT_PRIVATE_CAAS `string`

....
connection = context.userService.connection;
return connection.user.isProjectAdmin(connection.project);
....
The URL under which the CaaS can be reached. This URL is only used on the server and is not visible to the user in the client. Fill in only the host name of your CaaS instance. You will find the URL in the FirstSpirit project settings, menu "Project components", configuration Dialog of "CaaS Connect Project App", field "Preview Collection API" or "Release Collection API", depending on the mode (see NUXT_PUBLIC_MODE above). Only the domain part is needed here.

=== NUXT_PRIVATE_TENANT_ID `string`
=== NUXT_PRIVATE_API_KEY `string`

The tenantId is used by the PWA to distinguish between the different environments provided to you.
This API key is required by the PWA to obtain authorized access to the CaaS and navigation service. You will find a list of API keys in the FirstSpirit project settings, in the same dialog as mentioned above. Use one of the keys labeled "Preview (read only)" or "Release (read only)", depending on the mode (see NUXT_PUBLIC_MODE above).

=== NUXT_PUBLIC_MODE `"preview"` | `"release"`
=== NUXT_PRIVATE_NAVIGATION_SERVICE `string`

We distinguish between preview and release data. This is the traditional FirstSpirit way. Specify here which data should be loaded by the PWA.
The URL under which the navigation service is available. This URL is only used on the server and is not visible to the user in the client. Copy the URL in the FirstSpirit project settings, menu "Project components", the configuration dialog of the "Navigation Project Configuration". Use either the "release" or "preview" URL, depending on the mode (see NUXT_PUBLIC_MODE above). Only the host part including the following endpoint "/navigation" is needed here.

=== CI
We use husky to enforce branch protection rules to prevent direct commits and pushes to the main branch. On your local machine this variable is not needed, but in your CI it can be set to 1 to allow the semantic release plugin to do releases. This is done automatically by Github.

=== NUXT_PUBLIC_SNAP_URL `string` (_optional_ but recommended)

(Only needed when NUXT_PUBLIC_MODE is set to "preview" and the PWA should be used inside the editorial environment.)

Snap Library is an external dependency which offers a lot of LiveEdit features in the authoring environment to edit sections, images, datasets, etc. in place.

The current implementation is https://docs.e-spirit.com/tpp/snap/[TPP Snap] and the URL to this script has to look like:

`https://[your-firstspirit-server]/fs5webedit/snap.js` or `https://[your-firstspirit-server]/fs5webedit[_project-id]/snap.js`
`https://[your-firstspirit-server]/fs5webedit/snap.js`

where [your-firstspirit-server] is the hostname of your FirstSpirit server (e.g. https://company.e-spirit.hosting) and fs5webedit[_project-id] the path of the ContentCreator WebApp (log in to your project in ContentCreator to see the path in your browser).
where [your-firstspirit-server] is the hostname of your FirstSpirit server (e.g. https://company.e-spirit.hosting) and fs5webedit the path of the ContentCreator WebApp (log in to your project in ContentCreator to see the path in your browsers address bar).

This path should be set as `NUXT_PUBLIC_SNAP_URL`` in your .env file. A fallback is the latest https://cdn.jsdelivr.net/npm/fs-tpp-api/snap.js[CDN version] of this dependency which may cause a version mismatch and is not recommended.

Expand All @@ -72,15 +51,15 @@ Possible log levels: `0` = Info, `1` = Log, `2` = Warning, `3` = Error, `4` = No

You can also set the `logLevel` via _app.config.ts_

ENV variable will take the priority if set, e.x.
ENV variable will take the priority if set.

=== NUXT_PRIVATE_MAX_REFERENCE_DEPTH `number` _optional_

Due to performance reasons content references in your project get resolved up to a maximum reference depth of 10. Meaning a dataset refering to a dataset refering to a dataset ... and so on. You can increase that number by specifying the `NUXT_PRIVATE_MAX_REFERENCE_DEPTH` variable.

=== NUXT_PUBLIC_ENABLE_EVENT_STREAM `boolean` _optional_

When enabled, events for `insert`, `replace` and `delete` CaaS documents can be observed and handled. It's currently used in preview mode, to sync updated data in FirstSpirit with the CaaS and the App State.
When enabled, events for `insert`, `replace` and `delete` CaaS documents can be observed and handled. It is only used in preview mode, to sync updated data in FirstSpirit with the CaaS and the App State.

=== NUXT_PUBLIC_DEFAULT_LOCALE `string` _optional_

Expand Down Expand Up @@ -126,4 +105,4 @@ const appConfig: AppFileConfig = {

export default defineAppConfig(appConfig)

##
##

0 comments on commit 0f83f01

Please sign in to comment.