mirror of
https://github.com/filecoin-project/slate.git
synced 2024-12-23 09:01:56 +03:00
postgres: disables SSL in production web to see if that fixes issues
This commit is contained in:
parent
346eb21b85
commit
ea2d2d2eff
21
knexfile.js
21
knexfile.js
@ -12,4 +12,25 @@ module.exports = {
|
|||||||
password: Environment.POSTGRES_ADMIN_PASSWORD,
|
password: Environment.POSTGRES_ADMIN_PASSWORD,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
www: {
|
||||||
|
client: "pg",
|
||||||
|
connection: {
|
||||||
|
port: 5432,
|
||||||
|
host: Environment.POSTGRES_HOSTNAME,
|
||||||
|
database: Environment.POSTGRES_DATABASE,
|
||||||
|
user: Environment.POSTGRES_ADMIN_USERNAME,
|
||||||
|
password: Environment.POSTGRES_ADMIN_PASSWORD,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
production: {
|
||||||
|
client: "pg",
|
||||||
|
connection: {
|
||||||
|
ssl: true,
|
||||||
|
port: 5432,
|
||||||
|
host: Environment.POSTGRES_HOSTNAME,
|
||||||
|
database: Environment.POSTGRES_DATABASE,
|
||||||
|
user: Environment.POSTGRES_ADMIN_USERNAME,
|
||||||
|
password: Environment.POSTGRES_ADMIN_PASSWORD,
|
||||||
|
},
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
|
import * as Environment from "~/node_common/environment";
|
||||||
|
|
||||||
import configs from "~/knexfile";
|
import configs from "~/knexfile";
|
||||||
import knex from "knex";
|
import knex from "knex";
|
||||||
|
|
||||||
const envConfig = configs["development"];
|
const envConfig = configs[Environment.NODE];
|
||||||
const Database = knex(envConfig);
|
const Database = knex(envConfig);
|
||||||
|
|
||||||
export default Database;
|
export default Database;
|
||||||
|
@ -1,10 +1,12 @@
|
|||||||
require("dotenv").config();
|
export const NODE = process.env.NODE_ENV || "development";
|
||||||
|
|
||||||
export const NODE = process.env.NODE_ENV;
|
|
||||||
export const IS_PRODUCTION = NODE === "production" || NODE === "www";
|
export const IS_PRODUCTION = NODE === "production" || NODE === "www";
|
||||||
export const IS_PRODUCTION_WEB = NODE === "www";
|
export const IS_PRODUCTION_WEB = NODE === "www";
|
||||||
export const PORT = process.env.PORT || 1337;
|
export const PORT = process.env.PORT || 1337;
|
||||||
|
|
||||||
|
if (!IS_PRODUCTION_WEB) {
|
||||||
|
require("dotenv").config();
|
||||||
|
}
|
||||||
|
|
||||||
export const IS_LOCAL_WEB = !IS_PRODUCTION;
|
export const IS_LOCAL_WEB = !IS_PRODUCTION;
|
||||||
export const POSTGRES_ADMIN_PASSWORD = process.env.POSTGRES_ADMIN_PASSWORD;
|
export const POSTGRES_ADMIN_PASSWORD = process.env.POSTGRES_ADMIN_PASSWORD;
|
||||||
export const POSTGRES_ADMIN_USERNAME = process.env.POSTGRES_ADMIN_USERNAME;
|
export const POSTGRES_ADMIN_USERNAME = process.env.POSTGRES_ADMIN_USERNAME;
|
||||||
|
@ -19,6 +19,7 @@ const handler = app.getRequestHandler();
|
|||||||
|
|
||||||
app.prepare().then(async () => {
|
app.prepare().then(async () => {
|
||||||
const server = express();
|
const server = express();
|
||||||
|
|
||||||
if (Environment.IS_PRODUCTION_WEB) {
|
if (Environment.IS_PRODUCTION_WEB) {
|
||||||
server.use(compression());
|
server.use(compression());
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user