From f4e3fbb0b08395398c63c62a142833162af46636 Mon Sep 17 00:00:00 2001 From: Sergey Kirichenko Date: Fri, 1 Nov 2024 09:45:03 +0000 Subject: [PATCH] Modify approach choosing type of docspace (#50) Co-authored-by: Sergey Kirichenko Co-committed-by: Sergey Kirichenko --- config/appsettings.developer.json | 1 + config/appsettings.enterprise.json | 10 ++++++++++ install/docker/.env | 2 +- install/docker/docker-entrypoint.py | 6 +----- 4 files changed, 13 insertions(+), 6 deletions(-) create mode 100644 config/appsettings.developer.json create mode 100644 config/appsettings.enterprise.json diff --git a/config/appsettings.developer.json b/config/appsettings.developer.json new file mode 100644 index 00000000000..0967ef424bc --- /dev/null +++ b/config/appsettings.developer.json @@ -0,0 +1 @@ +{} diff --git a/config/appsettings.enterprise.json b/config/appsettings.enterprise.json new file mode 100644 index 00000000000..c6cbe0694a1 --- /dev/null +++ b/config/appsettings.enterprise.json @@ -0,0 +1,10 @@ +{ + "web": { + "license-url": "https://help.onlyoffice.co/Products/Files/DocEditor.aspx?fileid=8516433&doc=U0U1QUs2VEtIVmtYclFTNzVXSWkxUEN6aVlWTzdOWFFsWGdibG80Mnhacz0_IntcImVudHJ5XCI6XCI4NTE2NDMzXCIsXCJsaW5rXCI6XCI5Y2ZiMWNkMS0wMmMxLTRlNmEtYThhOC1iNjFlYTk2ZTYzNDZcIn0i0" + }, + "license": { + "file": { + "path": "/app/onlyoffice/data/license.lic" + } + } +} diff --git a/install/docker/.env b/install/docker/.env index effc33e54c0..d10c51b901e 100644 --- a/install/docker/.env +++ b/install/docker/.env @@ -2,7 +2,7 @@ HUB="" PRODUCT=onlyoffice REPO=${PRODUCT} - INSTALLATION_TYPE=COMMUNITY + INSTALLATION_TYPE="" STATUS="" DOCKER_IMAGE_PREFIX=${STATUS}docspace CONTAINER_PREFIX=${PRODUCT}- diff --git a/install/docker/docker-entrypoint.py b/install/docker/docker-entrypoint.py index 732c2e402de..238a708f5a4 100644 --- a/install/docker/docker-entrypoint.py +++ b/install/docker/docker-entrypoint.py @@ -10,7 +10,7 @@ PRODUCT = os.environ["PRODUCT"] if environ.get("PRODUCT") else "onlyoffice" BASE_DIR = os.environ["BASE_DIR"] if environ.get("BASE_DIR") else "/app/" + PRODUCT -ENV_EXTENSION = os.environ["ENV_EXTENSION"] if environ.get("ENV_EXTENSION") else "none" +ENV_EXTENSION = os.environ.get("ENV_EXTENSION", os.environ.get("INSTALLATION_TYPE", "none")).lower() PROXY_HOST = os.environ["PROXY_HOST"] if environ.get("PROXY_HOST") else "onlyoffice-proxy" SERVICE_PORT = os.environ["SERVICE_PORT"] if environ.get("SERVICE_PORT") else "5050" URLS = os.environ["URLS"] if environ.get("URLS") else "http://0.0.0.0:" @@ -29,7 +29,6 @@ APP_CORE_BASE_DOMAIN = os.environ["APP_CORE_BASE_DOMAIN"] if environ.get("APP_CORE_BASE_DOMAIN") is not None else "localhost" APP_CORE_MACHINEKEY = os.environ["APP_CORE_MACHINEKEY"] if environ.get("APP_CORE_MACHINEKEY") else "your_core_machinekey" -INSTALLATION_TYPE = os.environ["INSTALLATION_TYPE"].upper() if environ.get("INSTALLATION_TYPE") else "COMMUNITY" APP_URL_PORTAL = os.environ["APP_URL_PORTAL"] if environ.get("APP_URL_PORTAL") else "http://" + ROUTER_HOST + ":8092" OAUTH_REDIRECT_URL = os.environ["OAUTH_REDIRECT_URL"] if environ.get("OAUTH_REDIRECT_URL") else None APP_STORAGE_ROOT = os.environ["APP_STORAGE_ROOT"] if environ.get("APP_STORAGE_ROOT") else BASE_DIR + "/data/" @@ -175,9 +174,6 @@ def writeJsonFile(jsonFile, jsonData, indent=4): updateJsonData(jsonData,"$.files.docservice.secret.header", DOCUMENT_SERVER_JWT_HEADER) updateJsonData(jsonData,"$.debug-info.enabled", DEBUG_INFO) updateJsonData(jsonData,"$.web.samesite", SAMESITE) -if INSTALLATION_TYPE in ["ENTERPRISE", "DEVELOPER"]: - updateJsonData(jsonData, "$.license.file.path", "/app/onlyoffice/data/license.lic") - updateJsonData(jsonData, "$.web.license-url", "https://help.onlyoffice.co/Products/Files/DocEditor.aspx?fileid=8516433&doc=U0U1QUs2VEtIVmtYclFTNzVXSWkxUEN6aVlWTzdOWFFsWGdibG80Mnhacz0_IntcImVudHJ5XCI6XCI4NTE2NDMzXCIsXCJsaW5rXCI6XCI5Y2ZiMWNkMS0wMmMxLTRlNmEtYThhOC1iNjFlYTk2ZTYzNDZcIn0i0") ip_address = netifaces.ifaddresses('eth0').get(netifaces.AF_INET)[0].get('addr') netmask = netifaces.ifaddresses('eth0').get(netifaces.AF_INET)[0].get('netmask')