Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/tidy-snails-smile.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rocket.chat/apps": patch
---

Fixes app startup failing with EACCESS errors in docker deployments running with specified UIDs
Comment thread
d-gubert marked this conversation as resolved.
Outdated
10 changes: 6 additions & 4 deletions packages/apps/src/server/runtime/deno/AppsEngineDenoRuntime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function getDenoConfigPath(): string {
*
* Returns the path to the generated config file.
*/
function generateEphemeralDenoConfig(targetPath: string, denoConfigPath: string, appsEnginePath: string): void {
function generateEphemeralDenoConfig(targetPath: string, denoConfigPath: string, appsEnginePath: string, packagePath: string): void {
let staticConfig: DenoConfigurationFileSchema;

try {
Expand All @@ -39,6 +39,8 @@ function generateEphemeralDenoConfig(targetPath: string, denoConfigPath: string,
imports: {
...staticConfig.imports,
Comment thread
d-gubert marked this conversation as resolved.
'@rocket.chat/apps-engine/': `${appsEnginePath}/`,
'@rocket.chat/apps/base-runtime/': `${path.join(packagePath, 'base-runtime', 'src')}/`,
Comment thread
d-gubert marked this conversation as resolved.
'@rocket.chat/apps/': `${packagePath}/`,
Comment thread
coderabbitai[bot] marked this conversation as resolved.
},
};

Expand Down Expand Up @@ -67,7 +69,7 @@ export class DenoRuntimeSubprocessController extends BaseRuntimeSubprocessContro
this.denoDir = process.env.DENO_DIR ?? path.join(this.packagePath, '.deno-cache');

this.denoRuntimePath = path.join(this.tempFilePath, 'deno-runtime', 'main.ts');
Comment thread
d-gubert marked this conversation as resolved.
this.denoEphemeralConfigPath = this.denoConfigPath.replace('.jsonc', '.runtime.jsonc');
this.denoEphemeralConfigPath = path.join(this.tempFilePath, 'deno.runtime.jsonc');

Comment thread
coderabbitai[bot] marked this conversation as resolved.
/**
* Deno 2.x refuses to run scripts inside the node_modules, so we create a symlink to the deno runtime files in the temp directory
Expand All @@ -81,8 +83,8 @@ export class DenoRuntimeSubprocessController extends BaseRuntimeSubprocessContro
}
}

// Generate a runtime config with the resolved absolute path for @rocket.chat/apps-engine/
generateEphemeralDenoConfig(this.denoEphemeralConfigPath, this.denoConfigPath, this.appsEnginePath);
// Generate a runtime config with the resolved absolute path for @rocket.chat/apps-engine/ and @rocket.chat/apps/ paths
generateEphemeralDenoConfig(this.denoEphemeralConfigPath, this.denoConfigPath, this.appsEnginePath, this.packagePath);
}

protected buildProcessConfiguration(): ProcessConfiguration {
Expand Down
Loading