platform/server/front
Andrey Sobolev 8aa6989e26
Some checks are pending
CI / build (push) Waiting to run
CI / svelte-check (push) Blocked by required conditions
CI / formatting (push) Blocked by required conditions
CI / test (push) Blocked by required conditions
CI / uitest (push) Waiting to run
CI / uitest-pg (push) Waiting to run
CI / uitest-qms (push) Waiting to run
CI / docker-build (push) Blocked by required conditions
CI / dist-build (push) Blocked by required conditions
Fix front service (#7070)
Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
2024-10-31 02:20:10 +07:00
..
config :Apply templates (#3799) 2023-10-07 16:38:21 +06:00
src Fix front service (#7070) 2024-10-31 02:20:10 +07:00
.eslintrc.js :Apply templates (#3799) 2023-10-07 16:38:21 +06:00
.npmignore initial front implementation 2021-08-28 22:31:45 +02:00
build.sh Change shebangs to /usr/bin/env calls for better portability (#5961) 2024-07-01 23:21:52 +07:00
jest.config.js :Apply templates (#3799) 2023-10-07 16:38:21 +06:00
package.json UBERF-7603: Support multiple transactors (#6086) 2024-07-19 01:04:48 +07:00
readme.md feat: datalake worker initial version (#6952) 2024-10-18 19:17:40 +07:00
run.sh Change shebangs to /usr/bin/env calls for better portability (#5961) 2024-07-01 23:21:52 +07:00
tsconfig.json Fix validate build (#4780) 2024-02-27 15:29:41 +07:00

Overview

Front service is suited to deliver application bundles and resource assets, it also work as resize/recode service for previews, perform blob storage front operations.

Configuration

  • SERVER_PORT: Specifies the port number on which the server will listen.
  • MONGO_URL: Specifies the URL of the MongoDB database.
  • ELASTIC_URL: Specifies the URL of the Elasticsearch service.
  • ACCOUNTS_URL: Specifies the URL of the accounts service.
  • UPLOAD_URL: Specifies the URL for uploading files.
  • GMAIL_URL: Specifies the URL of the Gmail service.
  • CALENDAR_URL: Specifies the URL of the calendar service.
  • TELEGRAM_URL: Specifies the URL of the Telegram service.
  • REKONI_URL: Specifies the URL of the Rekoni service.
  • COLLABORATOR_URL: Specifies the URL of the collaborator service.
  • MODEL_VERSION: Specifies the required model version.
  • SERVER_SECRET: Specifies the server secret.
  • PREVIEW_CONFIG: Specifies the preview configuration.
  • UPLOAD_CONFIG: Specifies the upload configuration.
  • BRANDING_URL: Specifies the URL of the branding service.

Preview service configuration

PREVIEW_CONFIG env variable format.

A ; separated list of pairs, mediaType|previewUrl.

  • mediaType - a type of media, image or video.
  • previewUrl - an Url with :workspace, :blobId, :downloadFile, :size placeholders, they will be replaced in UI with an appropriate blob values.

PREVIEW_CONFIG=image|https://front.hc.engineering/files/:workspace/api/preview/?width=:size&image=:downloadFile

Variables

  • :workspace - a current workspacw public url name segment.
  • :blobId - an uniq blob _id identifier.
  • :size - a numeric value to determine required size of the image, image will not be upscaled, only downscaled. If -1 is passed, original image size value will be used.
  • :downloadFile - an URI encoded component value of full download URI, could be presigned uri to S3 storage.

Passing default variant.

providerName could be set to * in this case it will be default preview provider.

Default variant.

If no preview config are specified, a default one targating a front service preview/resize functionality will be used.

/files/${getCurrentWorkspaceUrl()}?file=:blobId&size=:size

Testing with dev-production/etc.

Only a downloadFile variant of URIs will work, since app is hosted on localhost and token should be valid to use preview on production environment.