Skip to content

Commit

Permalink
fix(cli): Cache generated assets in user writable directory instead
Browse files Browse the repository at this point in the history
  • Loading branch information
netroy committed Oct 6, 2022
1 parent 9089dbe commit 0c1ca5a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
4 changes: 0 additions & 4 deletions docker/images/n8n/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ if [ -d /root/.n8n ] ; then
ln -s /root/.n8n /home/node/
fi

# node user needs to be able to write in this folder to be able to customize static assets
mkdir -p /usr/local/lib/node_modules/n8n/dist/public
chown -R node /home/node /usr/local/lib/node_modules/n8n/dist/public

if [ "$#" -gt 0 ]; then
# Got started with arguments
exec su-exec node "$@"
Expand Down
4 changes: 1 addition & 3 deletions packages/cli/src/Server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,10 @@ import { createHmac } from 'crypto';
import { promisify } from 'util';
import cookieParser from 'cookie-parser';
import express from 'express';
import send from 'send';
import { FindManyOptions, getConnectionManager, In } from 'typeorm';
// eslint-disable-next-line import/no-extraneous-dependencies
import axios, { AxiosRequestConfig } from 'axios';
import clientOAuth1, { RequestOptions } from 'oauth-1.0a';
import curlconverter from 'curlconverter';
// IMPORTANT! Do not switch to anther bcrypt library unless really necessary and
// tested with all possible systems like Windows, Alpine on ARM, FreeBSD, ...
import { compare } from 'bcryptjs';
Expand Down Expand Up @@ -1787,7 +1785,7 @@ class App {
}

const editorUiDistDir = pathJoin(pathDirname(require.resolve('n8n-editor-ui')), 'dist');
const generatedStaticDir = pathJoin(__dirname, '../public');
const generatedStaticDir = pathJoin(UserSettings.getUserHome(), '.cache/n8n/public');

const closingTitleTag = '</title>';
const compileFile = async (fileName: string) => {
Expand Down

0 comments on commit 0c1ca5a

Please sign in to comment.