2018-11-15 04:09:57 +01:00
|
|
|
import os
|
2019-03-12 12:09:01 +01:00
|
|
|
from pathlib import Path
|
2018-11-15 04:09:57 +01:00
|
|
|
|
|
|
|
## Const
|
|
|
|
DEFAULT_UID = 10000
|
|
|
|
DEFAULT_GID = 10000
|
|
|
|
|
2019-07-30 07:04:28 +02:00
|
|
|
PG_UID = 999
|
|
|
|
PG_GID = 999
|
|
|
|
|
|
|
|
REDIS_UID = 999
|
|
|
|
REDIS_GID = 999
|
|
|
|
|
2018-11-15 04:09:57 +01:00
|
|
|
## Global variable
|
2020-04-28 07:17:24 +02:00
|
|
|
templates_dir = Path("/usr/src/app/templates")
|
2020-02-11 06:47:55 +01:00
|
|
|
|
|
|
|
host_root_dir = Path('/hostfs')
|
2019-08-09 09:17:10 +02:00
|
|
|
|
2018-11-15 04:09:57 +01:00
|
|
|
base_dir = '/harbor_make'
|
2020-02-11 06:47:55 +01:00
|
|
|
config_dir = Path('/config')
|
|
|
|
data_dir = Path('/data')
|
|
|
|
|
|
|
|
secret_dir = data_dir.joinpath('secret')
|
|
|
|
secret_key_dir = secret_dir.joinpath('keys')
|
|
|
|
trust_ca_dir = secret_dir.joinpath('keys', 'trust_ca')
|
|
|
|
internal_tls_dir = secret_dir.joinpath('tls')
|
|
|
|
|
|
|
|
storage_ca_bundle_filename = 'storage_ca_bundle.crt'
|
2020-04-26 09:00:51 +02:00
|
|
|
internal_ca_filename = 'harbor_internal_ca.crt'
|
2019-03-12 12:09:01 +01:00
|
|
|
|
2019-03-18 03:14:00 +01:00
|
|
|
old_private_key_pem_path = Path('/config/core/private_key.pem')
|
|
|
|
old_crt_path = Path('/config/registry/root.crt')
|
|
|
|
|
2020-02-11 06:47:55 +01:00
|
|
|
private_key_pem_path = secret_dir.joinpath('core', 'private_key.pem')
|
|
|
|
root_crt_path = secret_dir.joinpath('registry', 'root.crt')
|
2019-03-12 12:09:01 +01:00
|
|
|
|
|
|
|
config_file_path = '/compose_location/harbor.yml'
|
2019-04-02 14:08:26 +02:00
|
|
|
input_config_path = '/input/harbor.yml'
|
2019-03-18 08:07:19 +01:00
|
|
|
versions_file_path = Path('/usr/src/app/versions')
|
2018-11-15 04:09:57 +01:00
|
|
|
|
2020-02-11 06:47:55 +01:00
|
|
|
cert_dir = config_dir.joinpath("nginx", "cert")
|
|
|
|
core_cert_dir = config_dir.joinpath("core", "certificates")
|
2020-04-26 09:00:51 +02:00
|
|
|
shared_cert_dir = config_dir.joinpath("shared", "trust-certificates")
|
2019-11-25 10:28:11 +01:00
|
|
|
|
|
|
|
INTERNAL_NO_PROXY_DN = {
|
|
|
|
'127.0.0.1',
|
|
|
|
'localhost',
|
|
|
|
'.local',
|
|
|
|
'.internal',
|
|
|
|
'log',
|
|
|
|
'db',
|
|
|
|
'redis',
|
|
|
|
'nginx',
|
|
|
|
'core',
|
|
|
|
'portal',
|
|
|
|
'postgresql',
|
|
|
|
'jobservice',
|
|
|
|
'registry',
|
|
|
|
'registryctl',
|
2020-03-14 22:41:43 +01:00
|
|
|
'trivy-adapter',
|
2020-11-17 13:14:11 +01:00
|
|
|
'exporter',
|
2020-03-14 22:41:43 +01:00
|
|
|
}
|