feat: Add bind address option

This commit is contained in:
Mizunashi Mana 2023-07-16 20:13:24 +09:00
parent cae6ba0edb
commit e5360536f3
5 changed files with 12 additions and 2 deletions

View file

@ -29,6 +29,10 @@ url: https://example.com/
# The port that your Calckey server should listen on.
port: 3000
# The bind host your Calckey server should listen on.
# If unspecified, the wildcard address will be using.
#bind: 127.0.0.1
# ┌──────────────────────────┐
#───┘ PostgreSQL configuration └────────────────────────────────

View file

@ -113,6 +113,10 @@ url: "https://{{ .Values.calckey.domain }}/"
# The port that your Misskey server should listen on.
port: 3000
# The bind host your Calckey server should listen on.
# If unspecified, the wildcard address will be using.
#bind: 127.0.0.1
# ┌──────────────────────────┐
#───┘ PostgreSQL configuration └────────────────────────────────

View file

@ -41,6 +41,7 @@ export default function load() {
config.url = url.origin;
config.port = config.port || parseInt(process.env.PORT || "", 10);
config.bind = config.bind || process.env.BIND;
mixin.version = meta.version;
mixin.host = url.host;

View file

@ -6,6 +6,7 @@ export type Source = {
feedback_url?: string;
url: string;
port: number;
bind?: string;
disableHsts?: boolean;
db: {
host: string;

View file

@ -221,7 +221,7 @@ export const startServer = () => {
initializeStreamingServer(server);
server.listen(config.port);
server.listen(config.port, config.bind);
return server;
};
@ -258,5 +258,5 @@ export default () =>
});
// @ts-ignore
server.listen(config.port, resolve);
server.listen(config.port, config.bind, resolve);
});