enhance(backend): add unix socket support (#11275)
* unix socket support * add changelog * lint --------- Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
This commit is contained in:
parent
4f22176b8f
commit
5dab918999
5 changed files with 21 additions and 3 deletions
|
@ -30,6 +30,10 @@ url: https://example.tld/
|
|||
# The port that your Misskey server should listen on.
|
||||
port: 3000
|
||||
|
||||
# You can also use UNIX domain socket.
|
||||
# socket: /path/to/misskey.sock
|
||||
# chmodSocket: '777'
|
||||
|
||||
# ┌──────────────────────────┐
|
||||
#───┘ PostgreSQL configuration └────────────────────────────────
|
||||
|
||||
|
|
|
@ -61,6 +61,7 @@
|
|||
- Fix: Remove Meilisearch index when notes are deleted
|
||||
- Fix: 非英語環境でのPostgreSQLのエラーハンドリングを修正
|
||||
- Fix: インスタンスのアイコンがbase64の場合の挙動を修正
|
||||
- Add unix socket support
|
||||
|
||||
## 13.13.2
|
||||
|
||||
|
|
|
@ -78,7 +78,7 @@ export async function masterMain() {
|
|||
await spawnWorkers(config.clusterLimit);
|
||||
}
|
||||
|
||||
bootLogger.succ(`Now listening on port ${config.port} on ${config.url}`, null, true);
|
||||
bootLogger.succ(config.socket ? `Now listening on socket ${config.socket} on ${config.url}` : `Now listening on port ${config.port} on ${config.url}`, null, true);
|
||||
}
|
||||
|
||||
function showEnvironment(): void {
|
||||
|
|
|
@ -14,7 +14,9 @@ export type Source = {
|
|||
repository_url?: string;
|
||||
feedback_url?: string;
|
||||
url: string;
|
||||
port: number;
|
||||
port?: number;
|
||||
socket?: string;
|
||||
chmodSocket?: string;
|
||||
disableHsts?: boolean;
|
||||
db: {
|
||||
host: string;
|
||||
|
|
|
@ -224,7 +224,18 @@ export class ServerService implements OnApplicationShutdown {
|
|||
}
|
||||
});
|
||||
|
||||
fastify.listen({ port: this.config.port, host: '0.0.0.0' });
|
||||
if (this.config.socket) {
|
||||
if (fs.existsSync(this.config.socket)) {
|
||||
fs.unlinkSync(this.config.socket);
|
||||
}
|
||||
fastify.listen({ path: this.config.socket }, (err, address) => {
|
||||
if (this.config.chmodSocket) {
|
||||
fs.chmodSync(this.config.socket!, this.config.chmodSocket);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
fastify.listen({ port: this.config.port, host: '0.0.0.0' });
|
||||
}
|
||||
|
||||
await fastify.ready();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue