remove HTTPS handling (#8380)

This commit is contained in:
Johann150 2022-03-08 15:23:18 +01:00 committed by GitHub
parent 39676ad683
commit 26d90cd030
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 11 additions and 48 deletions

View file

@ -6,7 +6,6 @@ export type Source = {
feedback_url?: string;
url: string;
port: number;
https?: { [x: string]: string };
disableHsts?: boolean;
db: {
host: string;

View file

@ -64,11 +64,6 @@ export const meta = {
optional: false, nullable: false,
default: 'https://github.com/misskey-dev/misskey/issues/new',
},
secure: {
type: 'boolean',
optional: false, nullable: false,
default: false,
},
defaultDarkTheme: {
type: 'string',
optional: false, nullable: true,
@ -489,9 +484,6 @@ export default define(meta, paramDef, async (ps, me) => {
tosUrl: instance.ToSUrl,
repositoryUrl: instance.repositoryUrl,
feedbackUrl: instance.feedbackUrl,
secure: config.https != null,
disableRegistration: instance.disableRegistration,
disableLocalTimeline: instance.disableLocalTimeline,
disableGlobalTimeline: instance.disableGlobalTimeline,

View file

@ -4,8 +4,6 @@
import * as fs from 'node:fs';
import * as http from 'http';
import * as http2 from 'http2';
import * as https from 'https';
import Koa from 'koa';
import Router from '@koa/router';
import mount from 'koa-mount';
@ -123,16 +121,7 @@ app.use(router.routes());
app.use(mount(webServer));
function createServer() {
if (config.https) {
const certs: any = {};
for (const k of Object.keys(config.https)) {
certs[k] = fs.readFileSync(config.https[k]);
}
certs['allowHTTP1'] = true;
return http2.createSecureServer(certs, app.callback()) as https.Server;
} else {
return http.createServer(app.callback());
}
return http.createServer(app.callback());
}
// For testing