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