Skip to content

Commit

Permalink
Docker version force use default hostname and port
Browse files Browse the repository at this point in the history
  • Loading branch information
lifegpc committed Jan 21, 2024
1 parent 74e9101 commit 34785d3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
5 changes: 4 additions & 1 deletion config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,17 @@ 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() {
return this._return_bool("export_zip_jpn_title") || false;
}
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";
}
Expand Down
3 changes: 3 additions & 0 deletions routes/api/status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -50,13 +51,15 @@ 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,
ffprobe_binary_enabled,
meilisearch_enabled,
meilisearch,
no_user,
is_docker,
});
},
};
1 change: 1 addition & 0 deletions server/status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ export type StatusData = {
key: string;
};
no_user: boolean;
is_docker: boolean;
};

0 comments on commit 34785d3

Please sign in to comment.