Certificates and signing
Developers can deploy a WebApp to their local sites using a developer license, but official Sitevision-signed certificates are needed to deploy to a production website.
Developers can log on to the developer web and create certificates for their organization. These certificates will be signed by Sitevision, thus can be used by a WebApp in production. When a production certificate is created, it can be utilized during the development of a WebApp via a npm task (or such) that invokes the signing endpoint of the Sitevision developer REST API.
A certificate always belong to a specific team. A developer must be assigned to a team to be able to create and manage certificates.
Visit the account page to apply for team membership.
Creating a certificate
Certificates are created and managed on the team page. When creating a new certificate, a friendly name and a common name must be entered. The friendly name is used when signing apps. The common name will be visible on the production website.
A team has to have a default certificate selected. The first certificate created will automatically be set as default. The default certificate will be used when signing apps, unless a specific certificate name is provided in the signing request.
Installing a certificate
To be able to deploy a signed WebApp to a production website, the certificate used when signing must be installed on the website. Installing a certificate is done by adding it to the website's trusted certificates list, found in the "Addon certificates"-tab of the site settings panel. Certificates may also be added server-wide, if a developer has access to the sv:systemUser account.
Certificate list in site settings
Certificates can be added by drag'n'dropping the certificate file into the code area or by copy/paste the certificate content.
Signing a WebApp
Signing a WebApp is handled by the Sitevision developer REST API. All of Sitevision's example WebApps have boilerplate code for invoking the signing endpoint. See the npm scripts available in the create-sitevision-app tool.
In the team page a default certificate is set up, that certificate will be used when signing, unless another certificate name is provided in the signing request. When using the Sitevision npm utility script for signing, one will be prompted for a certificate name, if left blank the default will be used.
Deploying a WebApp to production
A WebApp that will be deployed in a production environment must be signed by Sitevision, as described above.
Deploying a WebApp can be done either through the Sitevision editor or by invoking the WebAppImport endpoint in Sitevision REST API. Npm utility scripts for deploying are available in all Sitevision example WebApps found in Sitevision GitHub repository.
Deploying a WebApp to development environment
When deploying to a development environment the WebbApp must either be signed or the site must have a developer licence with the feature to deploy unsigned WebApps. Contact Sitevision support to obtain a developer licence with the feature to deploy unsigned apps.
Deploying a WebApp can be done either through the Sitevision editor or by invoking the WebAppImport endpoint in Sitevision REST API. Npm utility scripts for deploying are available in all Sitevision example WebApps found in Sitevision GitHub repository
Workflow for deploying a WebApp to production
This workflow assumes that utility scripts from Sitevision's example apps are used, and that a designated addon already exists on the production site.
- Make sure you are member of a team on developer.sitevision.se
- Download public key of team developer certificate from team page
- Install certificate on production site
- Sign WebApp using the same certificate installed in step 3
npm run sign, will create a signed version of the WebApp in the dist folder
- Deploy WebApp to production
npm run deploy-prod, uploads the signed WebApp to production