Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ ENV VITE_IS_DEV=${IS_DEV}
ENV BUILD_DATE=${BUILD_DATE}
ENV VITE_BUILD_DATE=${BUILD_DATE}

# utf-8 locale so child processes (mediainfo etc) can open non-ascii filenames
ENV LANG=C.UTF-8
ENV LC_ALL=C.UTF-8

# system packages
#RUN apk --no-cache add \
# gcc g++ libc-dev git curl \
Expand Down
9 changes: 7 additions & 2 deletions server/src/Helpers/Execute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -372,12 +372,15 @@ export function exec(
ticker?: (source: "stdout" | "stderr", data: string) => void,
progressFunction?: (log: string) => number | undefined
): Promise<ExecReturn> {
// inherit the parent environment (PATH, locale, etc) instead of replacing it;
// an empty env made mediainfo unable to open non-ascii filenames
const spawnEnv = { ...process.env, ...env };
return new Promise((resolve, reject) => {
const stdout: string[] = [];
const stderr: string[] = [];

const process = spawn(bin, args || [], {
env: env,
env: spawnEnv,
});

process.on("error", (err) => {
Expand Down Expand Up @@ -547,7 +550,9 @@ export function startJob(
args: string[],
env: Record<string, string> = {}
): Job | false {
const envs = Object.keys(env).length > 0 ? env : process.env;
// inherit the parent environment (PATH, locale, etc) and overlay the custom values,
// so child processes can still open non-ascii filenames
const envs = { ...process.env, ...env };

const stdout: string[] = [];
const stderr: string[] = [];
Expand Down