Docker version force use default hostname and port

This commit is contained in:
2024-01-21 22:03:14 +08:00
parent 74e9101beb
commit 34785d30ef
3 changed files with 8 additions and 1 deletions

View File

@@ -112,6 +112,9 @@ export class Config {
return this._return_bool("download_original_img") || false;
}
get port() {
if (isDocker()) {
return 8000;
}
return this._return_number("port") || 8000;
}
get export_zip_jpn_title() {
@@ -119,7 +122,7 @@ export class Config {
}
get hostname() {
if (isDocker()) {
return this._return_string("hostname") || "0.0.0.0";
return "0.0.0.0";
}
return this._return_string("hostname") || "127.0.0.1";
}

View File

@@ -4,6 +4,7 @@ import type { StatusData } from "../../server/status.ts";
import { get_host, return_data } from "../../server/utils.ts";
import { check_ffmpeg_binary } from "../../thumbnail/ffmpeg_binary.ts";
import type * as FFMPEG_API from "../../thumbnail/ffmpeg_api.ts";
import { isDocker } from "../../utils.ts";
let ffmpeg_api: typeof FFMPEG_API | undefined;
@@ -50,6 +51,7 @@ export const handler: Handlers = {
};
}
const no_user = m.db.get_user_count() === 0;
const is_docker = isDocker();
return return_data<StatusData>({
ffmpeg_api_enabled,
ffmpeg_binary_enabled,
@@ -57,6 +59,7 @@ export const handler: Handlers = {
meilisearch_enabled,
meilisearch,
no_user,
is_docker,
});
},
};

View File

@@ -8,4 +8,5 @@ export type StatusData = {
key: string;
};
no_user: boolean;
is_docker: boolean;
};