diff --git a/README.md b/README.md index 18345a9..b17c9ce 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Deployer Backend This server allows to automatically deploy applications on the server. - +The API works in combination with the [ndb-setup](https://github.com/Aam-Digital/ndb-setup) scripts, for instructions to integrate this API deployment service, see https://github.com/Aam-Digital/ndb-setup/tree/master/deployer diff --git a/integrations/elementor-plugin/form-actions/aam-deploy.php b/integrations/elementor-plugin/form-actions/aam-deploy.php index ff9018a..dbc2a85 100644 --- a/integrations/elementor-plugin/form-actions/aam-deploy.php +++ b/integrations/elementor-plugin/form-actions/aam-deploy.php @@ -140,7 +140,7 @@ public function register_settings_section( $widget ) { [ 'label' => esc_html__( 'Client name', 'elementor-forms-aam-deploy' ), 'type' => \Elementor\Controls_Manager::TEXT, - 'description' => esc_html__( 'Enter you client name.', 'elementor-forms-aam-deploy' ), + 'description' => esc_html__( 'Enter your client name.', 'elementor-forms-aam-deploy' ), ] ); @@ -149,7 +149,7 @@ public function register_settings_section( $widget ) { [ 'label' => esc_html__( 'Client key', 'elementor-forms-aam-deploy' ), 'type' => \Elementor\Controls_Manager::TEXT, - 'description' => esc_html__( 'Enter you secret client key.', 'elementor-forms-aam-deploy' ), + 'description' => esc_html__( 'Enter your secret client key (API token).', 'elementor-forms-aam-deploy' ), ] ); @@ -158,7 +158,7 @@ public function register_settings_section( $widget ) { [ 'label' => esc_html__( 'Language', 'elementor-forms-aam-deploy' ), 'type' => \Elementor\Controls_Manager::TEXT, - 'description' => esc_html__( 'Enter the default language for the deployed app ("en", "de",...).', 'elementor-forms-aam-deploy' ), + 'description' => esc_html__( 'Enter the default language for the deployed app ("en", "de", ...).', 'elementor-forms-aam-deploy' ), 'default' => 'en' ] ); @@ -209,4 +209,4 @@ public function on_export( $element ) { return $element; } -} \ No newline at end of file +} diff --git a/src/app.controller.spec.ts b/src/app.controller.spec.ts index b720a11..1ace8f0 100644 --- a/src/app.controller.spec.ts +++ b/src/app.controller.spec.ts @@ -53,6 +53,7 @@ describe('AppController', () => { it('should throw bad request exception if data has wrong format', (done) => { const invalidData = { ...deploymentData, name: 'with space' }; + // TODO: add an extensive list of invalid formats including attempts someone could pass to try and inject code? controller.deployApp(invalidData).subscribe({ error: (err) => { diff --git a/src/app.module.ts b/src/app.module.ts index 548d632..20e7061 100644 --- a/src/app.module.ts +++ b/src/app.module.ts @@ -44,7 +44,7 @@ const lowSeverityLevels: SeverityLevel[] = ['log', 'info']; dsn: configService.get('SENTRY_DSN'), debug: true, environment: 'prod', - release: 'backend@' + process.env.npm_package_version, + release: 'deployer-backend@' + process.env.npm_package_version, whitelistUrls: [/https?:\/\/(.*)\.?aam-digital\.com/], initialScope: { tags: { diff --git a/src/deployment-info.dto.ts b/src/deployment-info.dto.ts index 9d9fdee..01d6177 100644 --- a/src/deployment-info.dto.ts +++ b/src/deployment-info.dto.ts @@ -1,11 +1,51 @@ +import { ApiProperty } from '@nestjs/swagger'; + export class DeploymentInfo { + @ApiProperty({ + description: + 'Name of the system to be created. Must not contain whitespaces.', + }) name: string; + + @ApiProperty({ + description: 'Language for the system (and keycloak).', + }) locale?: string; + + @ApiProperty({ + description: 'Username of the initial user account created as site admin.', + }) username: string; + + @ApiProperty({ + description: 'Email for the initial user account.', + }) email: string; + + @ApiProperty({ + description: + 'Whether the permission backend (replication-backend) should be set up.', + }) backend: boolean; + + @ApiProperty({ + description: 'Whether the new system should be added to uptime monitoring.', + }) monitor: boolean; + + @ApiProperty({ + description: 'Name of the Keycloak confidential client.', + }) client: string; + + @ApiProperty({ + description: 'Credentials for the Keycloak confidential client.', + }) clientKey: string; + + @ApiProperty({ + description: + 'The prebuilt configuration which should be used as a basis for this app.', + }) base: string; }