remove host settings from admin dash

This commit is contained in:
Simon Larsen 2023-09-20 09:51:32 +01:00
parent 668d00418d
commit a716d54cc6
No known key found for this signature in database
GPG Key ID: AB45983AA9C81CDE
8 changed files with 4 additions and 50 deletions

View File

@ -47,20 +47,6 @@ const Settings: FunctionComponent = (): ReactElement => {
isEditable={true}
editButtonText="Edit Host"
formFields={[
{
field: {
host: true,
},
title: 'Host',
fieldType: FormFieldSchemaType.Text,
required: true,
description:
'IP address or Hostname of this server instance.',
placeholder: 'oneuptime.yourcompany.com',
validation: {
minLength: 2,
},
},
{
field: {
useHttps: true,
@ -76,15 +62,6 @@ const Settings: FunctionComponent = (): ReactElement => {
modelType: GlobalConfig,
id: 'model-detail-global-config',
fields: [
{
field: {
host: true,
},
title: 'Host',
placeholder: 'None',
description:
'IP address or Hostname of this server instance.',
},
{
field: {
useHttps: true,

View File

@ -30,7 +30,6 @@ export default class GlobalConfigAPI extends BaseAPI<
await GlobalConfigService.findOneById({
id: ObjectID.getZeroObjectID(),
select: {
host: true,
useHttps: true,
},
props: {
@ -39,7 +38,6 @@ export default class GlobalConfigAPI extends BaseAPI<
});
return Response.sendJsonObjectResponse(req, res, {
HOST: globalConfig?.host?.toString() || 'localhost',
USE_HTTPS:
globalConfig?.useHttps?.toString() || 'false',
});

View File

@ -32,8 +32,7 @@ export default class DatabaseConfig {
public static async getHost(): Promise<Hostname> {
return (
((await DatabaseConfig.getFromGlobalConfig('host')) as Hostname) ||
new Hostname('localhost')
Promise.resolve(new Hostname(process.env['HOST'] || 'localhost'))
);
}

View File

@ -39,25 +39,6 @@ export enum EmailServerType {
update: [],
})
export default class GlobalConfig extends GlobalConfigModel {
@ColumnAccessControl({
create: [],
read: [],
update: [],
})
@TableColumn({
type: TableColumnType.ShortText,
title: 'Host',
description:
'Server Hostname or an IP address where OneUptime is hosted on.',
})
@Column({
type: ColumnType.ShortText,
length: ColumnLength.ShortText,
nullable: true,
unique: true,
transformer: Hostname.getDatabaseTransformer(),
})
public host?: Hostname = undefined;
@ColumnAccessControl({
create: [],

View File

@ -162,7 +162,7 @@ server {
listen 80;
server_name localhost ${DOMAIN}; #All domains
server_name localhost ${HOST}; #All domains
proxy_busy_buffers_size 512k;
proxy_buffers 4 512k;

View File

@ -14,7 +14,6 @@ export default class AddDefaultGlobalConfig extends DataMigrationBase {
const globalConfig: GlobalConfig = new GlobalConfig();
globalConfig.id = ObjectID.getZeroObjectID();
globalConfig.host = new Hostname('localhost');
globalConfig.useHttps = false;
globalConfig.emailServerType = EmailServerType.Internal;
globalConfig.sendgridFromName = 'OneUptime';

View File

@ -33,7 +33,6 @@ export default class UpdateGlobalConfigFromEnv extends DataMigrationBase {
twilioPhoneNumber: process.env['TWILIO_PHONE_NUMBER'] || '',
// Update host
host: process.env['DOMAIN'] || 'localhost',
useHttps: process.env['HTTP_PROTOCOL'] === 'https',
// Update SMTP

View File

@ -1,6 +1,7 @@
version: '3.7'
x-common-variables: &common-variables
HOST: ${HOST}
NODE_ENV: ${ENVIRONMENT}
BILLING_ENABLED: ${BILLING_ENABLED}
BILLING_PUBLIC_KEY: ${BILLING_PUBLIC_KEY}
@ -107,7 +108,7 @@ services:
- clickhouse:/var/lib/clickhouse/
postgres:
image: postgres:latest
image: postgres:15
restart: always
environment:
POSTGRES_USER: ${DATABASE_USERNAME}