diff --git a/app-config.yaml b/app-config.yaml index be0f405de5..f963296bb8 100644 --- a/app-config.yaml +++ b/app-config.yaml @@ -94,7 +94,7 @@ techdocs: generators: techdocs: 'docker' # Alternatives - 'local' publisher: - type: 'local' # Alternatives - 'googleGcs' or 'awsS3' or 'azureBlobStorage' or 'openStackSwift' Read documentation for using alternatives. + type: 'local' # Alternatives - 'googleGcs' or 'awsS3' or 'azureBlobStorage' or 'openStackSwift'. Read documentation for using alternatives. sentry: organization: my-company diff --git a/docs/features/techdocs/using-cloud-storage.md b/docs/features/techdocs/using-cloud-storage.md index 6fefca70c0..8b8ff04573 100644 --- a/docs/features/techdocs/using-cloud-storage.md +++ b/docs/features/techdocs/using-cloud-storage.md @@ -281,12 +281,11 @@ techdocs: **3b. Authentication using app-config.yaml** -If you do not prefer (3a) and optionally like to use a service account, you can Set the config `techdocs.publisher.azureBlobStorage.credentials.accountName` in -follow these steps. your `app-config.yaml` to the your account name. +If you do not prefer (3a) and optionally like to use a service account, you can +follow these steps. To get credentials, access the Azure Portal and go to "Settings > Access Keys", and get your Storage account name and Primary Key. - https://docs.microsoft.com/en-us/rest/api/storageservices/authorize-with-shared-key for more details. @@ -373,14 +372,14 @@ techdocs: $env: OPENSTACK_SWIFT_STORAGE_DOMAIN_ID domainName: $env: OPENSTACK_SWIFT_STORAGE_DOMAIN_NAME - region: + region: $env: OPENSTACK_SWIFT_STORAGE_REGION ``` **4. That's it!** -Your Backstage app is now ready to use OpenStack Swift Storage for TechDocs, to store -and read the static generated documentation files. When you start the backend of -the app, you should be able to see -`techdocs info Successfully connected to the OpenStack Swift Storage container` in -the logs. +Your Backstage app is now ready to use OpenStack Swift Storage for TechDocs, to +store and read the static generated documentation files. When you start the +backend of the app, you should be able to see +`techdocs info Successfully connected to the OpenStack Swift Storage container` +in the logs. diff --git a/packages/techdocs-common/__mocks__/pkgcloud.ts b/packages/techdocs-common/__mocks__/pkgcloud.ts index 4316630928..6b250092b8 100644 --- a/packages/techdocs-common/__mocks__/pkgcloud.ts +++ b/packages/techdocs-common/__mocks__/pkgcloud.ts @@ -21,7 +21,7 @@ import { EventEmitter } from 'events'; const rootDir = os.platform() === 'win32' ? 'C:\\rootDir' : '/rootDir'; const checkFileExists = async (Key: string): Promise => { - // Key will always have / as file separator irrespective of OS since S3 expects /. + // Key will always have / as file separator irrespective of OS since cloud providers expects /. // Normalize Key to OS specific path before checking if file exists. const filePath = path.join(rootDir, Key); diff --git a/packages/techdocs-common/src/stages/publish/openStackSwift.ts b/packages/techdocs-common/src/stages/publish/openStackSwift.ts index 4c4c15d9c4..3987a36e17 100644 --- a/packages/techdocs-common/src/stages/publish/openStackSwift.ts +++ b/packages/techdocs-common/src/stages/publish/openStackSwift.ts @@ -49,7 +49,7 @@ export class OpenStackSwiftPublish implements PublisherBase { } catch (error) { throw new Error( "Since techdocs.publisher.type is set to 'openStackSwift' in your app config, " + - 'techdocs.publisher.openStackSwift.containerName is required.', + 'techdocs.publisher.openStackSwift.containerName is required.', ); } @@ -80,9 +80,9 @@ export class OpenStackSwiftPublish implements PublisherBase { } else { logger.error( `Could not retrieve metadata about the OpenStack Swift container ${containerName}. ` + - 'Make sure the container exists. Also make sure that authentication is setup either by ' + - 'explicitly defining credentials and region in techdocs.publisher.openStackSwift in app config or ' + - 'by using environment variables. Refer to https://backstage.io/docs/features/techdocs/using-cloud-storage', + 'Make sure the container exists. Also make sure that authentication is setup either by ' + + 'explicitly defining credentials and region in techdocs.publisher.openStackSwift in app config or ' + + 'by using environment variables. Refer to https://backstage.io/docs/features/techdocs/using-cloud-storage', ); logger.error(`from OpenStack client library: ${err.message}`); @@ -138,16 +138,17 @@ export class OpenStackSwiftPublish implements PublisherBase { }; // Rate limit the concurrent execution of file uploads to batches of 10 (per publish) - const uploadFile = limiter(() => - new Promise((res, rej) => { - const writeStream = this.storageClient.upload(params); + const uploadFile = limiter( + () => + new Promise((res, rej) => { + const writeStream = this.storageClient.upload(params); - writeStream.on('error', rej); + writeStream.on('error', rej); - writeStream.on('success', res); + writeStream.on('success', res); - readStream.pipe(writeStream); - }), + readStream.pipe(writeStream); + }), ); uploadPromises.push(uploadFile); }