mirror of
https://github.com/caprover/caprover
synced 2025-12-12 06:15:40 +00:00
simplify more
This commit is contained in:
@@ -15,6 +15,9 @@ chmod -R 777 /captain
|
||||
docker run \
|
||||
-e "CAPTAIN_IS_DEBUG=1" \
|
||||
-e "MAIN_NODE_IP_ADDRESS=127.0.0.1" \
|
||||
-e "CAPTAIN_HOST_HTTP_PORT=10080" \
|
||||
-e "CAPTAIN_HOST_HTTPS_PORT=10443" \
|
||||
-e "CAPTAIN_HOST_ADMIN_PORT=13000" \
|
||||
-v /var/run/docker.sock:/var/run/docker.sock \
|
||||
-v /captain:/captain \
|
||||
-v $(pwd):/usr/src/app captain-debug
|
||||
|
||||
@@ -16,6 +16,7 @@ import Logger from '../../utils/Logger'
|
||||
import CertbotManager from './CertbotManager'
|
||||
import fs = require('fs-extra')
|
||||
import request = require('request')
|
||||
import { IAppPort } from '../../models/AppDefinition'
|
||||
const exec = util.promisify(chileProcess.exec)
|
||||
|
||||
const defaultPageTemplate = fs
|
||||
@@ -98,8 +99,7 @@ class LoadBalancerManager {
|
||||
self.reloadInProcess = true
|
||||
|
||||
// This will resolve to something like: /captain/nginx/conf.d/captain
|
||||
const configFilePathBase = `${
|
||||
CaptainConstants.perAppNginxConfigPathBase
|
||||
const configFilePathBase = `${CaptainConstants.perAppNginxConfigPathBase
|
||||
}/${self.dataStore.getNameSpace()}`
|
||||
|
||||
const FUTURE = configFilePathBase + '.fut'
|
||||
@@ -126,8 +126,7 @@ class LoadBalancerManager {
|
||||
s.keyPath = self.getSslKeyPath(s.publicDomain)
|
||||
}
|
||||
|
||||
s.staticWebRoot = `${
|
||||
CaptainConstants.nginxStaticRootDir +
|
||||
s.staticWebRoot = `${CaptainConstants.nginxStaticRootDir +
|
||||
CaptainConstants.nginxDomainSpecificHtmlDir
|
||||
}/${s.publicDomain}`
|
||||
|
||||
@@ -479,11 +478,9 @@ class LoadBalancerManager {
|
||||
const self = this
|
||||
const dataStore = self.dataStore
|
||||
|
||||
const captainDomain = `${
|
||||
CaptainConstants.configs.captainSubDomain
|
||||
const captainDomain = `${CaptainConstants.configs.captainSubDomain
|
||||
}.${dataStore.getRootDomain()}`
|
||||
const registryDomain = `${
|
||||
CaptainConstants.registrySubDomain
|
||||
const registryDomain = `${CaptainConstants.registrySubDomain
|
||||
}.${dataStore.getRootDomain()}`
|
||||
let logAccess = false
|
||||
|
||||
@@ -532,8 +529,10 @@ class LoadBalancerManager {
|
||||
hasRootSsl: hasRootSsl,
|
||||
serviceName: CaptainConstants.captainServiceName,
|
||||
domain: captainDomain,
|
||||
containerAdminPort:
|
||||
serviceExposedPort:
|
||||
EnvVars.CAPTAIN_CONTAINER_ADMIN_PORT,
|
||||
//proposed name for serviceExposedPort: containerAdminPort:
|
||||
// EnvVars.CAPTAIN_CONTAINER_ADMIN_PORT,
|
||||
containerHttpsPort:
|
||||
EnvVars.CAPTAIN_CONTAINER_HTTPS_PORT,
|
||||
containerHttpPort:
|
||||
|
||||
@@ -15,8 +15,7 @@ const CONSTANT_FILE_OVERRIDE_USER =
|
||||
CAPTAIN_DATA_DIRECTORY + '/config-override.json'
|
||||
|
||||
const configs = {
|
||||
publishedNameOnDockerHub:
|
||||
EnvVars.CAPROVER_IMAGE ?? (EnvVars.CAPTAIN_IS_DEBUG ? 'captain-debug' : 'caprover/caprover'),
|
||||
publishedNameOnDockerHub: 'caprover/caprover',
|
||||
|
||||
version: '1.13.3',
|
||||
|
||||
@@ -52,7 +51,7 @@ const configs = {
|
||||
|
||||
overlayNetworkOverride: {},
|
||||
|
||||
useExistingSwarm: EnvVars.USE_EXISTING_SWARM,
|
||||
useExistingSwarm: false,
|
||||
|
||||
proApiDomains: ['https://pro.caprover.com'],
|
||||
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
server {
|
||||
|
||||
# Catch all HTTP
|
||||
listen 80;
|
||||
listen <%-captain.containerHttpPort%>;
|
||||
|
||||
# Catch all HTTPS
|
||||
listen 443 ssl;
|
||||
listen <%-captain.containerHttpsPort%> ssl;
|
||||
ssl_certificate <%-fake.crtPath%>;
|
||||
ssl_certificate_key <%-fake.keyPath%>;
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
# Captain dashboard at captain.captainroot.domain.com
|
||||
server {
|
||||
|
||||
listen 80;
|
||||
listen <%-captain.containerHttpPort%>;
|
||||
client_max_body_size 300m;
|
||||
|
||||
gzip on;
|
||||
@@ -72,7 +72,7 @@
|
||||
<%
|
||||
if (captain.hasRootSsl) {
|
||||
%>
|
||||
listen 443 ssl;
|
||||
listen <%-captain.containerHttpsPort%> ssl;
|
||||
ssl_certificate <%-captain.crtPath%>;
|
||||
ssl_certificate_key <%-captain.keyPath%>;
|
||||
|
||||
@@ -127,13 +127,13 @@
|
||||
# But the Registry engine runs on port 996
|
||||
server {
|
||||
|
||||
listen 80;
|
||||
listen <%-captain.containerHttpPort%>;
|
||||
client_max_body_size 500m;
|
||||
|
||||
<%
|
||||
if (registry.hasRootSsl) {
|
||||
%>
|
||||
listen 443 ssl;
|
||||
listen <%-captain.containerHttpsPort%> ssl;
|
||||
ssl_certificate <%-registry.crtPath%>;
|
||||
ssl_certificate_key <%-registry.keyPath%>;
|
||||
<%
|
||||
|
||||
Reference in New Issue
Block a user