lasuite-docs-collaboration-server: 3.3.0 -> 3.4.1
https://github.com/suitenumerique/docs/releases/tag/v3.4.0 https://github.com/suitenumerique/docs/releases/tag/v3.4.1 https://github.com/suitenumerique/docs/compare/v3.3.0...v3.4.1
This commit is contained in:
@@ -1,43 +0,0 @@
|
||||
From ab1de49ad9c23e73cddc4dd82a9fede4f56d28d0 Mon Sep 17 00:00:00 2001
|
||||
From: soyouzpanda <soyouzpanda@soyouzpanda.fr>
|
||||
Date: Tue, 29 Apr 2025 17:09:51 +0200
|
||||
Subject: [PATCH 2/2] =?UTF-8?q?=E2=9C=A8(frontend)=20support=20`=5FFILE`?=
|
||||
=?UTF-8?q?=20envuronment=20variables=20for=20secrets?=
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Allow configuration variables that handles secrets to be read from a
|
||||
file given in an environment variable.
|
||||
---
|
||||
src/frontend/servers/y-provider/src/env.ts | 13 +++++++++----
|
||||
1 files changed, 9 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/servers/y-provider/src/env.ts b/servers/y-provider/src/env.ts
|
||||
index fe281930..e0e02cf5 100644
|
||||
--- a/servers/y-provider/src/env.ts
|
||||
+++ b/servers/y-provider/src/env.ts
|
||||
@@ -1,11 +1,16 @@
|
||||
+import { readFileSync } from 'fs';
|
||||
+
|
||||
export const COLLABORATION_LOGGING =
|
||||
process.env.COLLABORATION_LOGGING || 'false';
|
||||
export const COLLABORATION_SERVER_ORIGIN =
|
||||
process.env.COLLABORATION_SERVER_ORIGIN || 'http://localhost:3000';
|
||||
-export const COLLABORATION_SERVER_SECRET =
|
||||
- process.env.COLLABORATION_SERVER_SECRET || 'secret-api-key';
|
||||
-export const Y_PROVIDER_API_KEY =
|
||||
- process.env.Y_PROVIDER_API_KEY || 'yprovider-api-key';
|
||||
+export const COLLABORATION_SERVER_SECRET = process.env
|
||||
+ .COLLABORATION_SERVER_SECRET_FILE
|
||||
+ ? readFileSync(process.env.COLLABORATION_SERVER_SECRET_FILE, 'utf-8')
|
||||
+ : process.env.COLLABORATION_SERVER_SECRET || 'secret-api-key';
|
||||
+export const Y_PROVIDER_API_KEY = process.env.Y_PROVIDER_API_KEY_FILE
|
||||
+ ? readFileSync(process.env.Y_PROVIDER_API_KEY_FILE, 'utf-8')
|
||||
+ : process.env.Y_PROVIDER_API_KEY || 'yprovider-api-key';
|
||||
export const PORT = Number(process.env.PORT || 4444);
|
||||
export const SENTRY_DSN = process.env.SENTRY_DSN || '';
|
||||
export const COLLABORATION_BACKEND_BASE_URL =
|
||||
--
|
||||
2.47.2
|
||||
|
||||
@@ -6,74 +6,40 @@
|
||||
nodejs,
|
||||
fixup-yarn-lock,
|
||||
yarn,
|
||||
yarnConfigHook,
|
||||
yarnBuildHook,
|
||||
makeWrapper,
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "lasuite-docs-collaboration-server";
|
||||
version = "3.3.0";
|
||||
version = "3.4.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "suitenumerique";
|
||||
repo = "docs";
|
||||
tag = "v${version}";
|
||||
hash = "sha256-SLTNkK578YhsDtVBS4vH0E/rXx+rXZIyXMhqwr95QEA=";
|
||||
hash = "sha256-QAWwyFp9l+C0XfVu975zjiv61e/S2nYKkUSv4/p7gxw=";
|
||||
};
|
||||
|
||||
sourceRoot = "source/src/frontend";
|
||||
|
||||
patches = [
|
||||
# Support for $ENVIRONMENT_VARIABLE_FILE to be able to pass secret file
|
||||
# See: https://github.com/suitenumerique/docs/pull/912
|
||||
./environment_variables.patch
|
||||
];
|
||||
|
||||
offlineCache = fetchYarnDeps {
|
||||
yarnLock = "${src}/src/frontend/yarn.lock";
|
||||
hash = "sha256-ei4xj+W2j5O675cpMAG4yCB3cPLeYwMhqKTacPWFjoo=";
|
||||
hash = "sha256-07zsggGQFX/Wx/fxs1f0w01HHx7Z2BG5d3PIBlX2SVM=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
nodejs
|
||||
fixup-yarn-lock
|
||||
yarn
|
||||
yarnConfigHook
|
||||
yarnBuildHook
|
||||
makeWrapper
|
||||
];
|
||||
|
||||
configurePhase = ''
|
||||
runHook preConfigure
|
||||
|
||||
export HOME=$(mktemp -d)
|
||||
yarn config --offline set yarn-offline-mirror "$offlineCache"
|
||||
fixup-yarn-lock yarn.lock
|
||||
|
||||
# Fixup what fixup-yarn-lock does not fix. Result in error if not fixed.
|
||||
substituteInPlace yarn.lock \
|
||||
--replace-fail '"@fastify/otel@https://codeload.github.com/getsentry/fastify-otel/tar.gz/ae3088d65e286bdc94ac5d722573537d6a6671bb"' '"@fastify/otel@^0.8.0"'
|
||||
|
||||
yarn install \
|
||||
--frozen-lockfile \
|
||||
--force \
|
||||
--production=false \
|
||||
--ignore-engines \
|
||||
--ignore-platform \
|
||||
--ignore-scripts \
|
||||
--no-progress \
|
||||
--non-interactive \
|
||||
--offline
|
||||
|
||||
patchShebangs node_modules
|
||||
|
||||
runHook postConfigure
|
||||
'';
|
||||
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
|
||||
yarn --offline COLLABORATION_SERVER run build
|
||||
|
||||
runHook postBuild
|
||||
'';
|
||||
yarnBuildScript = "COLLABORATION_SERVER";
|
||||
yarnBuildFlags = "run build";
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
Reference in New Issue
Block a user