diff --git a/.gitignore b/.gitignore index 57630191..f1890d2d 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,5 @@ **/.DS_Store **/*.rpm **/*.deb -**/*-registry.yml \ No newline at end of file +**/*-registry.yml +CLAUDE.md \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index c74eddb0..f231005a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -91,7 +91,7 @@ SHELL ["/bin/bash", "-c"] RUN mkdir -p \ ${CSGHUB_HOME}/{LICENSES,bin} \ - ${CSGHUB_EMBEDDED}/{bin,lib,sv} \ + ${CSGHUB_EMBEDDED}/{bin,lib,sv,etc} \ ${CSGHUB_SRV_HOME}/{registry,nats,temporal,temporal_ui,casdoor,dnsmasq,consul,server,portal,prometheus,loki}/bin ## Install Runit Service Daemon @@ -128,33 +128,37 @@ COPY --from=gitaly /usr/local/. ${CSGHUB_SRV_HOME}/gitaly/ COPY --from=gitlab-shell /srv/gitlab-shell/. ${CSGHUB_SRV_HOME}/gitlab_shell/ ## Install Temporal & Temporal-ui -COPY --from=temporal ${CSGHUB_HOME}/etc/temporal/. ${CSGHUB_HOME}/etc/temporal/ +COPY --from=temporal ${CSGHUB_HOME}/etc/temporal/. ${CSGHUB_EMBEDDED}/etc/temporal/ COPY --from=temporal ${CSGHUB_SRV_HOME}/temporal/. ${CSGHUB_SRV_HOME}/temporal/ -COPY --from=temporal ${CSGHUB_HOME}/etc/temporal_ui/. ${CSGHUB_HOME}/etc/temporal_ui/ +COPY --from=temporal ${CSGHUB_HOME}/etc/temporal_ui/. ${CSGHUB_EMBEDDED}/etc/temporal_ui/ COPY --from=temporal ${CSGHUB_SRV_HOME}/temporal_ui/. ${CSGHUB_SRV_HOME}/temporal_ui/ # Using 8182 as temporal-ui default listen port -RUN sed -i 's/8080/8182/g' ${CSGHUB_HOME}/etc/temporal_ui/config-template.yaml +RUN sed -i 's/8080/8182/g' ${CSGHUB_EMBEDDED}/etc/temporal_ui/config-template.yaml + +# Remap temporal internal paths from component image to new embedded location +RUN find ${CSGHUB_EMBEDDED}/etc/temporal -type f -exec sed -i 's|/opt/csghub/etc/temporal|/opt/csghub/embedded/etc/temporal|g' {} \; ## Install NATS COPY --from=nats /nats-server ${CSGHUB_SRV_HOME}/nats/bin/ ## Install Casdoor COPY --from=casdoor /server ${CSGHUB_SRV_HOME}/casdoor/bin/casdoor -COPY --from=casdoor /web ${CSGHUB_HOME}/etc/casdoor/web +COPY --from=casdoor /web ${CSGHUB_EMBEDDED}/etc/casdoor/web ## Install Nginx -COPY --from=nginx /opt/csghub/. /opt/csghub/ -COPY ./opt/csghub/etc/nginx/. /opt/csghub/etc/nginx/ +COPY --from=nginx /opt/csghub/embedded/sv/nginx/. /opt/csghub/embedded/sv/nginx/ +COPY --from=nginx /opt/csghub/etc/nginx/. /opt/csghub/embedded/etc/nginx/ +COPY ./opt/csghub/embedded/etc/nginx/. /opt/csghub/embedded/etc/nginx/ ## Install csghub-server ENV GIN_MODE=release COPY --from=server /starhub-bin/starhub ${CSGHUB_SRV_HOME}/server/bin/csghub-server -COPY --from=server /starhub-bin/. ${CSGHUB_HOME}/etc/server/ +COPY --from=server /starhub-bin/. ${CSGHUB_EMBEDDED}/etc/server/ COPY --from=server /root/.duckdb ${CSGHUB_SRV_HOME}/server/.duckdb -RUN rm ${CSGHUB_HOME}/etc/server/starhub +RUN rm ${CSGHUB_EMBEDDED}/etc/server/starhub ## Install csghub-portal COPY --from=portal /myapp/csghub-portal ${CSGHUB_SRV_HOME}/portal/bin/ @@ -275,7 +279,7 @@ RUN chmod +x -R /opt/csghub/bin && \ chmod +x -R /opt/csghub/embedded/sv/**/templates && \ chmod +x -R /scripts && \ ln -s /opt/csghub/bin/* /usr/bin/ && \ - find /opt/csghub/etc/ -type f -name "*.sh" -exec chmod +x {} \; + find /opt/csghub/embedded/etc/ -type f -name "*.sh" -exec chmod +x {} \; EXPOSE 80 443 2222 5000 8000 9000 9001 ENTRYPOINT ["/scripts/entrypoint.sh"] \ No newline at end of file diff --git a/README.md b/README.md index 2986cfdf..a0d15946 100644 --- a/README.md +++ b/README.md @@ -118,7 +118,7 @@ Omnibus-CSGHub 是 OpenCSG CSGHub 的一键式 Docker Compose 部署方案,让 *Contains all configurable parameters, with minimal modifications typically required under default settings.* -- 默认参数文件 `/opt/csghub/etc/csghub/default.yaml` +- 默认参数文件 `/opt/csghub/embedded/etc/csghub/default.yaml` 定义了所有参数的默认值。 diff --git a/ee.Dockerfile b/ee.Dockerfile index 4715c35d..80284462 100644 --- a/ee.Dockerfile +++ b/ee.Dockerfile @@ -109,7 +109,7 @@ SHELL ["/bin/bash", "-c"] RUN mkdir -p \ ${CSGHUB_HOME}/{LICENSES,bin} \ - ${CSGHUB_EMBEDDED}/{bin,lib,sv} \ + ${CSGHUB_EMBEDDED}/{bin,lib,sv,etc} \ ${CSGHUB_SRV_HOME}/{registry,nats,temporal,temporal_ui,casdoor,dnsmasq,consul,server,portal,prometheus,loki,xnet}/bin ## Install Runit Service Daemon @@ -146,9 +146,9 @@ COPY --from=gitaly /usr/local/. ${CSGHUB_SRV_HOME}/gitaly/ COPY --from=gitlab-shell /srv/gitlab-shell/. ${CSGHUB_SRV_HOME}/gitlab_shell/ ## Install Temporal & Temporal-ui -COPY --from=temporal ${CSGHUB_HOME}/etc/temporal/. ${CSGHUB_HOME}/etc/temporal/ +COPY --from=temporal ${CSGHUB_HOME}/etc/temporal/. ${CSGHUB_EMBEDDED}/etc/temporal/ COPY --from=temporal ${CSGHUB_SRV_HOME}/temporal/. ${CSGHUB_SRV_HOME}/temporal/ -COPY --from=temporal ${CSGHUB_HOME}/etc/temporal_ui/. ${CSGHUB_HOME}/etc/temporal_ui/ +COPY --from=temporal ${CSGHUB_HOME}/etc/temporal_ui/. ${CSGHUB_EMBEDDED}/etc/temporal_ui/ COPY --from=temporal ${CSGHUB_SRV_HOME}/temporal_ui/. ${CSGHUB_SRV_HOME}/temporal_ui/ ## Install NATS @@ -156,20 +156,20 @@ COPY --from=nats /nats-server ${CSGHUB_SRV_HOME}/nats/bin/ ## Install Casdoor COPY --from=casdoor /server ${CSGHUB_SRV_HOME}/casdoor/bin/casdoor -COPY --from=casdoor /web ${CSGHUB_HOME}/etc/casdoor/web +COPY --from=casdoor /web ${CSGHUB_EMBEDDED}/etc/casdoor/web ## Install Nginx -COPY --from=nginx /opt/csghub/. /opt/csghub/ -#COPY ./opt/csghub/etc/nginx/. /opt/csghub/etc/nginx/ +COPY --from=nginx /opt/csghub/embedded/sv/nginx/. /opt/csghub/embedded/sv/nginx/ +COPY --from=nginx /opt/csghub/etc/nginx/. /opt/csghub/embedded/etc/nginx/ ## Install csghub-server ENV GIN_MODE=release COPY --from=server /starhub-bin/starhub ${CSGHUB_SRV_HOME}/server/bin/csghub-server -COPY --from=server /starhub-bin/. ${CSGHUB_HOME}/etc/server/ +COPY --from=server /starhub-bin/. ${CSGHUB_EMBEDDED}/etc/server/ COPY --from=server /root/.duckdb ${CSGHUB_SRV_HOME}/server/.duckdb -RUN rm ${CSGHUB_HOME}/etc/server/starhub +RUN rm ${CSGHUB_EMBEDDED}/etc/server/starhub ## Install csghub-portal COPY --from=portal /myapp/csghub-portal ${CSGHUB_SRV_HOME}/portal/bin/ @@ -187,16 +187,19 @@ COPY --from=loki /usr/bin/loki ${CSGHUB_SRV_HOME}/loki/bin/ ## Install csgship-web COPY --from=csgship /code/. ${CSGHUB_SRV_HOME}/web/ COPY --from=billing /app/. ${CSGHUB_SRV_HOME}/billing/bin/ -COPY --from=frontend /usr/share/nginx/html ${CSGHUB_HOME}/etc/nginx/html +COPY --from=frontend /usr/share/nginx/html ${CSGHUB_EMBEDDED}/etc/nginx/html COPY --from=agentic /code/. ${CSGHUB_SRV_HOME}/agentic/ # Using 8182 as temporal-ui default listen port -RUN sed -i 's/8080/8182/g' ${CSGHUB_HOME}/etc/temporal_ui/config-template.yaml && \ +RUN sed -i 's/8080/8182/g' ${CSGHUB_EMBEDDED}/etc/temporal_ui/config-template.yaml && \ sed -i -e 's/:8000/:8183/g' \ -e 's|/code/logs/gunicorn.access.log|/dev/stdout|g' \ -e 's|/code/|/opt/csghub/embedded/sv/web/|g' \ ${CSGHUB_EMBEDDED}/sv/web/project/{gunicorn_config.py,uwsgi.ini} +# Remap temporal internal paths from component image to new embedded location +RUN find ${CSGHUB_EMBEDDED}/etc/temporal -type f -exec sed -i 's|/opt/csghub/etc/temporal|/opt/csghub/embedded/etc/temporal|g' {} \; + ENV PATH=$PATH:/opt/csghub/embedded/bin RUN if grep -q -i -E 'ubuntu|debian' /etc/os-release; then \ apt update && \ @@ -303,7 +306,7 @@ RUN chmod +x -R /opt/csghub/bin && \ chmod +x -R /opt/csghub/embedded/sv/**/templates && \ chmod +x -R /scripts && \ ln -s /opt/csghub/bin/* /usr/bin/ && \ - find /opt/csghub/etc/ -type f -name "*.sh" -exec chmod +x {} \; + find /opt/csghub/embedded/etc/ -type f -name "*.sh" -exec chmod +x {} \; EXPOSE 80 443 2222 5000 8000 9000 9001 ENTRYPOINT ["/scripts/entrypoint.sh"] \ No newline at end of file diff --git a/ee/opt/csghub/etc/billing/config.yaml.sample b/ee/opt/csghub/embedded/etc/billing/config.yaml.sample similarity index 100% rename from ee/opt/csghub/etc/billing/config.yaml.sample rename to ee/opt/csghub/embedded/etc/billing/config.yaml.sample diff --git a/ee/opt/csghub/etc/csghub/default.yaml b/ee/opt/csghub/embedded/etc/csghub/default.yaml similarity index 99% rename from ee/opt/csghub/etc/csghub/default.yaml rename to ee/opt/csghub/embedded/etc/csghub/default.yaml index 80db8bad..866a149f 100644 --- a/ee/opt/csghub/etc/csghub/default.yaml +++ b/ee/opt/csghub/embedded/etc/csghub/default.yaml @@ -80,7 +80,7 @@ server: ## Casdoor (authentication) Integration casdoor: endpoint: "" ## Casdoor endpoint - certificate: "/opt/csghub/etc/casdoor/token_jwt_key.pem" ## SSL cert path + certificate: "/opt/csghub/embedded/etc/casdoor/token_jwt_key.pem" ## SSL cert path organization_name: "OpenCSG" ## Organization name in Casdoor application_name: "CSGHub" ## App name in Casdoor diff --git a/ee/opt/csghub/etc/csghub/templates/csghub/csghub.yaml.sample b/ee/opt/csghub/embedded/etc/csghub/templates/csghub.yaml.sample similarity index 99% rename from ee/opt/csghub/etc/csghub/templates/csghub/csghub.yaml.sample rename to ee/opt/csghub/embedded/etc/csghub/templates/csghub.yaml.sample index e1d316ae..e81a8431 100644 --- a/ee/opt/csghub/etc/csghub/templates/csghub/csghub.yaml.sample +++ b/ee/opt/csghub/embedded/etc/csghub/templates/csghub.yaml.sample @@ -74,7 +74,7 @@ csghub: ## Casdoor (authentication) Integration # casdoor: # endpoint: "http://csghub.example.com:8000" ## Casdoor endpoint - # certificate: "/opt/csghub/etc/casdoor/token_jwt_key.pem" ## SSL cert path + # certificate: "/opt/csghub/embedded/etc/casdoor/token_jwt_key.pem" ## SSL cert path # organization_name: "OpenCSG" ## Organization name in Casdoor # application_name: "CSGHub" ## App name in Casdoor diff --git a/ee/opt/csghub/etc/nginx/html/config.js.sample b/ee/opt/csghub/embedded/etc/nginx/html/config.js.sample similarity index 100% rename from ee/opt/csghub/etc/nginx/html/config.js.sample rename to ee/opt/csghub/embedded/etc/nginx/html/config.js.sample diff --git a/ee/opt/csghub/etc/nginx/nginx.conf.sample b/ee/opt/csghub/embedded/etc/nginx/nginx.conf.sample similarity index 100% rename from ee/opt/csghub/etc/nginx/nginx.conf.sample rename to ee/opt/csghub/embedded/etc/nginx/nginx.conf.sample diff --git a/ee/opt/csghub/etc/server/config.toml.sample b/ee/opt/csghub/embedded/etc/server/config.toml.sample similarity index 100% rename from ee/opt/csghub/etc/server/config.toml.sample rename to ee/opt/csghub/embedded/etc/server/config.toml.sample diff --git a/ee/opt/csghub/etc/xnet/config.toml.sample b/ee/opt/csghub/embedded/etc/xnet/config.toml.sample similarity index 97% rename from ee/opt/csghub/etc/xnet/config.toml.sample rename to ee/opt/csghub/embedded/etc/xnet/config.toml.sample index a49f7258..6ef19df4 100644 --- a/ee/opt/csghub/etc/xnet/config.toml.sample +++ b/ee/opt/csghub/embedded/etc/xnet/config.toml.sample @@ -56,7 +56,7 @@ lfs_bucket = {{ $s3.bucket | quote }} provider = "" [license] -public_key_file = "/opt/csghub/etc/server/enterprise/public_key_ee.pem" +public_key_file = "/opt/csghub/embedded/etc/server/enterprise/public_key_ee.pem" [jwt] signing_key = {{ tmpl.Exec "GenSeed" . | crypto.SHA256 | quote }} diff --git a/ee/opt/csghub/embedded/sv/agentic/templates/run.sample b/ee/opt/csghub/embedded/sv/agentic/templates/run.sample index dfc88c31..67f6ac57 100755 --- a/ee/opt/csghub/embedded/sv/agentic/templates/run.sample +++ b/ee/opt/csghub/embedded/sv/agentic/templates/run.sample @@ -13,7 +13,7 @@ set -e {{- $agentic := (datasource "config").agentic }} cd /opt/csghub/embedded/sv/agentic -exec chpst -e /opt/csghub/etc/web/env -P \ +exec chpst -e /opt/csghub/service/web/env -P \ -u root:root \ /opt/csghub/embedded/bin/hypercorn starship.main:starlette \ --bind {{ $agentic.listen }} \ diff --git a/ee/opt/csghub/embedded/sv/billing/templates/run.sample b/ee/opt/csghub/embedded/sv/billing/templates/run.sample index 04dc34b0..c08a3bcc 100755 --- a/ee/opt/csghub/embedded/sv/billing/templates/run.sample +++ b/ee/opt/csghub/embedded/sv/billing/templates/run.sample @@ -13,6 +13,6 @@ set -e {{- $dataDir := (datasource "config").billing.data | default "/var/opt/csghub/billing" }} cd {{ $dataDir }} -exec chpst -e /opt/csghub/etc/web/env -P \ +exec chpst -e /opt/csghub/service/web/env -P \ -u root:root \ - /opt/csghub/embedded/bin/billing -config={{ $dataDir }}/config.yaml \ No newline at end of file + /opt/csghub/embedded/bin/billing -config=/opt/csghub/service/billing/etc/config.yaml \ No newline at end of file diff --git a/ee/opt/csghub/embedded/sv/portal/templates/run.sample b/ee/opt/csghub/embedded/sv/portal/templates/run.sample index 33187109..210d39f8 100755 --- a/ee/opt/csghub/embedded/sv/portal/templates/run.sample +++ b/ee/opt/csghub/embedded/sv/portal/templates/run.sample @@ -15,7 +15,7 @@ fi set -e readonly PORTAL_BIN="/opt/csghub/embedded/bin/csghub-portal" -readonly ENV_DIR="/opt/csghub/etc/portal/env" +readonly ENV_DIR="/opt/csghub/service/portal/env" echo "Initializing database migrations..." chpst -e "$ENV_DIR" -P \ diff --git a/ee/opt/csghub/embedded/sv/producer/templates/run.sample b/ee/opt/csghub/embedded/sv/producer/templates/run.sample index d3ccd6b8..71305c3c 100755 --- a/ee/opt/csghub/embedded/sv/producer/templates/run.sample +++ b/ee/opt/csghub/embedded/sv/producer/templates/run.sample @@ -12,6 +12,6 @@ fi set -e cd /opt/csghub/embedded/sv/web/project -exec chpst -e /opt/csghub/etc/web/env -P \ +exec chpst -e /opt/csghub/service/web/env -P \ -u root:root \ /opt/csghub/embedded/bin/celery -A config beat --loglevel=INFO \ No newline at end of file diff --git a/ee/opt/csghub/embedded/sv/server/templates/pre-start.sample b/ee/opt/csghub/embedded/sv/server/templates/pre-start.sample index 2e7eeaa8..45c29d55 100755 --- a/ee/opt/csghub/embedded/sv/server/templates/pre-start.sample +++ b/ee/opt/csghub/embedded/sv/server/templates/pre-start.sample @@ -6,8 +6,8 @@ exec 2>&1 # exit when error set -e -{{- $configDir := "/opt/csghub/etc/server" }} -{{- $envDir := printf "%s/env" $configDir }} +{{- $configDir := "/opt/csghub/service/server/etc" }} +{{- $envDir := "/opt/csghub/service/server/env" }} # Clear all environment variable files # rm -rf {{ $envDir }}/* || true @@ -26,8 +26,8 @@ set -e {{- file.Write (printf "%s/STARHUB_SERVER_PUBLIC_ROOT_DOMAIN" $envDir) " " }} {{- file.Write (printf "%s/DUCKDB_HOME" $envDir) "/opt/csghub/embedded/sv/server" }} {{- file.Write (printf "%s/DUCKDB_EXTENSION_DIRECTORY" $envDir) "/opt/csghub/embedded/sv/server" }} -{{- file.Write (printf "%s/OPENCSG_LICENSE_PUBLIC_KEY_FILE" $envDir) "/opt/csghub/etc/server/enterprise/public_key_ee.pem" }} -{{- file.Write (printf "%s/OPENCSG_LICENSE_PRIVATE_KEY_FILE" $envDir) "/opt/csghub/etc/server/enterprise/private_key_ee.pem" }} +{{- file.Write (printf "%s/OPENCSG_LICENSE_PUBLIC_KEY_FILE" $envDir) "/opt/csghub/embedded/etc/server/enterprise/public_key_ee.pem" }} +{{- file.Write (printf "%s/OPENCSG_LICENSE_PRIVATE_KEY_FILE" $envDir) "/opt/csghub/embedded/etc/server/enterprise/private_key_ee.pem" }} {{- file.Write (printf "%s/STARHUB_SERVER_RUNNER_KUBE_SCHEDULER" $envDir) "volcano" }} {{- file.Write (printf "%s/STARHUB_SERVER_RUNNER_VGPU_NODE_RESOURCE_NAME" $envDir) "volcano.sh/node-vgpu-register" }} {{- file.Write (printf "%s/STARHUB_SERVER_RUNNER_VGPU_POD_RESOURCE_NAME" $envDir) "volcano.sh/vgpu-ids-new" }} @@ -46,11 +46,11 @@ set -e {{- end }} {{- $dataDir := (datasource "config").server.data | default "/var/opt/csghub/server" }} -{{- $configFile := printf "%s/config.toml" $dataDir }} +{{- $configFile := printf "%s/config.toml" $configDir }} # Define constants readonly SERVER_BIN="/opt/csghub/embedded/bin/csghub-server" -readonly ENV_DIR="/opt/csghub/etc/server/env" +readonly ENV_DIR="/opt/csghub/service/server/env" # Build command arguments ## Migration init @@ -69,7 +69,7 @@ cd {{ $dataDir }} && chpst -e "$ENV_DIR" -P -u root:root "$SERVER_BIN" "${args[@ # Load local sql scripts cd /opt/csghub/service/server -[ -x "/opt/csghub/etc/csghub/scripts/pg_executor" ] && chpst -e {{ $envDir }} /opt/csghub/etc/csghub/scripts/pg_executor +[ -x "/opt/csghub/embedded/etc/csghub/scripts/pg_executor" ] && chpst -e {{ $envDir }} /opt/csghub/embedded/etc/csghub/scripts/pg_executor {{- $minio := (datasource "config").minio }} {{- if $minio.enable }} diff --git a/ee/opt/csghub/embedded/sv/web/templates/pre-start.sample b/ee/opt/csghub/embedded/sv/web/templates/pre-start.sample index d8bff0cb..a215fbfb 100755 --- a/ee/opt/csghub/embedded/sv/web/templates/pre-start.sample +++ b/ee/opt/csghub/embedded/sv/web/templates/pre-start.sample @@ -6,7 +6,7 @@ exec 2>&1 # Exit if execute with any errors set -e -{{- $envDir := "/opt/csghub/etc/web/env" }} +{{- $envDir := "/opt/csghub/service/web/env" }} # Clear all environment variable files # rm -rf {{ $envDir }}/* || true @@ -27,114 +27,7 @@ set -e {{- $password := $db.password | default (crypto.PBKDF2 $db.user "opencsg" 2048 8) }} {{- file.Write (printf "%s/DATABASE_TYPE" $envDir) "postgresql" }} {{- file.Write (printf "%s/DATABASE_HOST" $envDir) $db.host }} -{{- file.Write (printf "%s/DATABASE_PORT" $envDir) $db.port }}#!/bin/bash - - # Redirect stderr -> stdout - exec 2>&1 - - # Exit if execute with any errors - set -e - - {{- $envDir := "/opt/csghub/etc/web/env" }} - - # Clear all environment variable files - # rm -rf {{ $envDir }}/* || true - - {{- file.Write (printf "%s/PYTHONHOME" $envDir) "/opt/csghub/embedded/python" }} - {{- file.Write (printf "%s/LD_LIBRARY_PATH" $envDir) "/opt/csghub/embedded/python/lib:$LD_LIBRARY_PATH" }} - {{- file.Write (printf "%s/PYTHONPATH" $envDir) "/opt/csghub/embedded/python/lib/python3.11/site-packages" }} - {{- file.Write (printf "%s/PATH" $envDir) "/opt/csghub/embedded/python/bin:$PATH" }} - - {{- file.Write (printf "%s/DJANGO_DEBUG" $envDir) "false" }} - {{- file.Write (printf "%s/DJANGO_SETTINGS_MODULE" $envDir) "config.settings" }} - {{- file.Write (printf "%s/C_FORCE_ROOT" $envDir) "true" }} - - {{- $csgship := (datasource "config").csgship }} - {{- $web := (datasource "config").web }} - {{- $dataDir := $web.data | default "/var/opt/csghub/web" }} - {{- $db := $web.postgresql }} - {{- $password := $db.password | default (crypto.PBKDF2 $db.user "opencsg" 2048 8) }} - {{- file.Write (printf "%s/DATABASE_TYPE" $envDir) "postgresql" }} - {{- file.Write (printf "%s/DATABASE_HOST" $envDir) $db.host }} - {{- file.Write (printf "%s/DATABASE_PORT" $envDir) $db.port }} - {{- file.Write (printf "%s/DATABASE_USERNAME" $envDir) $db.user }} - {{- file.Write (printf "%s/DATABASE_PASSWORD" $envDir) $password }} - {{- file.Write (printf "%s/DATABASE_NAME" $envDir) $db.name }} - {{- file.Write (printf "%s/DSN" $envDir) (printf "postgresql://%s:%s@%s:%d/%s" (conv.ToString $db.user) (conv.ToString $password) (conv.ToString $db.host) (conv.ToInt64 $db.port) (conv.ToString $db.name)) }} - - {{- $postgresql := (datasource "config").postgresql }} - {{- $patroni := (datasource "config").patroni }} - {{- if or $postgresql.enable $patroni.enable }} - # Rename database csgship (If database csgship exists) - /opt/csghub/bin/csghub-dbm -a rename -d "starship_codegpt" -n {{ $db.name }} - /opt/csghub/bin/csghub-dbm -a rename -d "starship" -n {{ $db.name }} - # Create csgship database (current default) - /opt/csghub/bin/csghub-dbm -a create -d {{ $db.name }} -u {{ $db.user }} -p {{ $password }} - # If csgship database exists reset all objects owner to current db user - /opt/csghub/bin/csghub-dbm -a update -d {{ $db.name }} -N {{ $db.user }} - {{- end }} - - {{- $redis := $web.redis }} - {{- $redisUser := $redis.auth.user -}} - {{- $redisPassword := $redis.auth.password | default (crypto.PBKDF2 $redisUser "opencsg" 2048 8) -}} - {{- file.Write (printf "%s/REDIS_URL" $envDir) (printf ":@%s" $redis.host) }} - {{/*{{- file.Write (printf "%s/REDIS_URL" $envDir) (printf ":%s@%s" $redisPassword $redis.host) }} */}} - {{- file.Write (printf "%s/REDIS_PORT" $envDir) $redis.port }} - - {{- $csghub := tmpl.Exec "config.csghub" . | data.YAML }} - {{- file.Write (printf "%s/csgship_WEB_URL" $envDir) (tmpl.Exec "endpoint.csgship.frontend" .) }} - {{- file.Write (printf "%s/csgship_API_URL" $envDir) (tmpl.Exec "endpoint.csgship.api" .) }} - {{- file.Write (printf "%s/USE_OPENAI_ASSISTANTS_API" $envDir) "false" }} - - {{- file.Write (printf "%s/ACCOUNTING_OP_MODE" $envDir) "has_balance|consume" }} - {{- file.Write (printf "%s/ACCOUNTING_API_BASE" $envDir) $csghub.external }} - - {{- $apiToken := tmpl.Exec "GenHubApiToken" . }} - {{- file.Write (printf "%s/ACCOUNTING_API_KEY" $envDir) $apiToken }} - {{- file.Write (printf "%s/OPENCSG_HUB_BASE_URL" $envDir) $csghub.external }} - {{- file.Write (printf "%s/OPENCSG_HUB_ACCESS_TOKEN" $envDir) $apiToken }} - - {{- $openai := $web.openai }} - {{- file.Write (printf "%s/AZURE_MODEL" $envDir) $openai.model }} - {{- file.Write (printf "%s/AZURE_API_BASE" $envDir) $openai.api.base }} - {{- file.Write (printf "%s/AZURE_API_VERSION" $envDir) $openai.api.version }} - {{- file.Write (printf "%s/AZURE_API_KEY" $envDir) $openai.api.key }} - {{- file.Write (printf "%s/LANCEDB_URI" $envDir) "/opt/csghub/embedded/sv/web/data/lancedb" }} - - {{ $billing := (datasource "config").billing }} - {{ $agentic := (datasource "config").agentic }} - {{ $web := (datasource "config").web }} - {{- file.Write (printf "%s/csgship_BILLING_API_BASE" $envDir) (printf "http://%s" $billing.listen) }} - {{- file.Write (printf "%s/BILLING_SVC_API_BASE" $envDir) (printf "http://%s" $billing.listen) }} - {{- file.Write (printf "%s/AGENTIC_SVC_API_BASE" $envDir) (printf "http://%s" $agentic.listen) }} - {{- file.Write (printf "%s/WEB_SVC_API_BASE" $envDir) (printf "http://%s" $web.listen) }} - {{- file.Write (printf "%s/MEGALINTER_SVC_API_BASE" $envDir) $web.megalinter_server.endpoint }} - {{- file.Write (printf "%s/SYNC_PERMS_GIT_SERVER" $envDir) ($csgship.oauth.issuer | strings.TrimPrefix "http://" | strings.TrimPrefix "https://") }} - - {{ $nats := (datasource "config").nats }} - {{- $natsUser := $nats.auth.user -}} - {{- $natsPassword := $nats.auth.password | default (crypto.PBKDF2 $natsUser "opencsg" 2048 8) -}} - {{- $webNats := $web.nats -}} - {{- file.Write (printf "%s/NATS_URL" $envDir) ($webNats.url | default (printf "nats://%s:%s@localhost:4222" $natsUser $natsPassword)) }} - - {{- file.Write (printf "%s/GIT_PYTHON_GIT_EXECUTABLE" $envDir) "/opt/csghub/embedded/bin/gitaly-git-v2.47" }} - chpst -e /opt/csghub/etc/web/env -P \ - -u root:root \ - /opt/csghub/embedded/bin/python3.11 /opt/csghub/embedded/sv/web/project/manage.py migrate - - chpst -e /opt/csghub/etc/web/env -P \ - -u root:root \ - /opt/csghub/embedded/bin/python3.11 /opt/csghub/embedded/sv/web/project/manage.py createcachetable - - chpst -e /opt/csghub/etc/web/env -P \ - -u root:root \ - /opt/csghub/embedded/bin/python3.11 /opt/csghub/embedded/sv/web/project/manage.py clearsessions - - # Load local sql scripts - cd /opt/csghub/service/web - [ -x "/opt/csghub/etc/csghub/scripts/pg_executor" ] && chpst -e {{ $envDir }} /opt/csghub/etc/csghub/scripts/pg_executor - - +{{- file.Write (printf "%s/DATABASE_PORT" $envDir) $db.port }} {{- file.Write (printf "%s/DATABASE_USERNAME" $envDir) $db.user }} {{- file.Write (printf "%s/DATABASE_PASSWORD" $envDir) $password }} {{- file.Write (printf "%s/DATABASE_NAME" $envDir) $db.name }} @@ -196,19 +89,19 @@ set -e {{- file.Write (printf "%s/NATS_URL" $envDir) ($webNats.url | default (printf "nats://%s:%s@localhost:4222" $natsUser $natsPassword)) }} {{- file.Write (printf "%s/GIT_PYTHON_GIT_EXECUTABLE" $envDir) "/opt/csghub/embedded/bin/gitaly-git-v2.47" }} -chpst -e /opt/csghub/etc/web/env -P \ + +chpst -e /opt/csghub/service/web/env -P \ -u root:root \ /opt/csghub/embedded/bin/python3.11 /opt/csghub/embedded/sv/web/project/manage.py migrate -chpst -e /opt/csghub/etc/web/env -P \ +chpst -e /opt/csghub/service/web/env -P \ -u root:root \ /opt/csghub/embedded/bin/python3.11 /opt/csghub/embedded/sv/web/project/manage.py createcachetable -chpst -e /opt/csghub/etc/web/env -P \ +chpst -e /opt/csghub/service/web/env -P \ -u root:root \ /opt/csghub/embedded/bin/python3.11 /opt/csghub/embedded/sv/web/project/manage.py clearsessions # Load local sql scripts cd /opt/csghub/service/web -[ -x "/opt/csghub/etc/csghub/scripts/pg_executor" ] && chpst -e {{ $envDir }} /opt/csghub/etc/csghub/scripts/pg_executor - +[ -x "/opt/csghub/embedded/etc/csghub/scripts/pg_executor" ] && chpst -e {{ $envDir }} /opt/csghub/embedded/etc/csghub/scripts/pg_executor diff --git a/ee/opt/csghub/embedded/sv/web/templates/run.sample b/ee/opt/csghub/embedded/sv/web/templates/run.sample index 27a59216..6dbf1b5b 100755 --- a/ee/opt/csghub/embedded/sv/web/templates/run.sample +++ b/ee/opt/csghub/embedded/sv/web/templates/run.sample @@ -13,6 +13,6 @@ set -e {{- $dataDir := (datasource "config").web.data | default "/var/opt/csghub/web" }} cd {{ $dataDir }} -exec chpst -e /opt/csghub/etc/web/env -P \ +exec chpst -e /opt/csghub/service/web/env -P \ -u root:root \ /opt/csghub/embedded/bin/gunicorn -c /opt/csghub/embedded/sv/web/project/gunicorn_config.py \ No newline at end of file diff --git a/ee/opt/csghub/embedded/sv/worker/templates/run.sample b/ee/opt/csghub/embedded/sv/worker/templates/run.sample index 228f1181..cb64171a 100755 --- a/ee/opt/csghub/embedded/sv/worker/templates/run.sample +++ b/ee/opt/csghub/embedded/sv/worker/templates/run.sample @@ -12,6 +12,6 @@ fi set -e cd /opt/csghub/embedded/sv/web/project -exec chpst -e /opt/csghub/etc/web/env -P \ +exec chpst -e /opt/csghub/service/web/env -P \ -u root:root \ /opt/csghub/embedded/bin/celery -A config worker --loglevel=INFO -Q high_priority_queue,default -c 2 -n worker%%h \ No newline at end of file diff --git a/ee/opt/csghub/embedded/sv/xnet/templates/pre-start.sample b/ee/opt/csghub/embedded/sv/xnet/templates/pre-start.sample index 09b79b8c..800fc034 100755 --- a/ee/opt/csghub/embedded/sv/xnet/templates/pre-start.sample +++ b/ee/opt/csghub/embedded/sv/xnet/templates/pre-start.sample @@ -6,8 +6,8 @@ exec 2>&1 # exit when error set -e -{{- $configDir := "/opt/csghub/etc/xnet" }} -{{- $envDir := printf "%s/env" $configDir }} +{{- $configDir := "/opt/csghub/embedded/etc/xnet" }} +{{- $envDir := printf "%s/env" "/opt/csghub/service/xnet" }} # Clear all environment variable files # rm -rf {{ $envDir }}/* || true diff --git a/ee/opt/csghub/embedded/sv/xnet/templates/run.sample b/ee/opt/csghub/embedded/sv/xnet/templates/run.sample index 35ec4a00..acdb14b8 100755 --- a/ee/opt/csghub/embedded/sv/xnet/templates/run.sample +++ b/ee/opt/csghub/embedded/sv/xnet/templates/run.sample @@ -13,11 +13,12 @@ fi {{- $xnet := (datasource "config").xnet }} {{- $dataDir := $xnet.data | default "/var/opt/csghub/xnet" }} -{{- $configFile := printf "%s/config.toml" $dataDir }} +{{- $configDir := "/opt/csghub/service/xnet/etc" }} +{{- $configFile := printf "%s/config.toml" $configDir }} # Define constants readonly SERVER_BIN="/opt/csghub/embedded/bin/csghub-xnet" -readonly ENV_DIR="/opt/csghub/etc/xnet/env" +readonly ENV_DIR="/opt/csghub/service/xnet/env" # Build command arguments args=("start" "server" "-l" {{ $xnet.log.level | quote }}) diff --git a/opt/csghub/etc/casdoor/app.conf.sample b/opt/csghub/embedded/etc/casdoor/app.conf.sample similarity index 88% rename from opt/csghub/etc/casdoor/app.conf.sample rename to opt/csghub/embedded/etc/casdoor/app.conf.sample index b2328adc..460815ff 100644 --- a/opt/csghub/etc/casdoor/app.conf.sample +++ b/opt/csghub/embedded/etc/casdoor/app.conf.sample @@ -27,7 +27,7 @@ radiusServerPort = 1812 radiusSecret = "secret" quota = {"organization": -1, "user": -1, "application": -1, "provider": -1} logConfig = {"filename": "logs/casdoor.log", "maxdays":99999, "perm":"0777"} -initDataFile = "{{ $casdoor.data }}/init_data.json" +initDataFile = "/opt/csghub/service/casdoor/etc/init_data.json" initDataNewOnly = true -frontendBaseDir = "/opt/csghub/etc/casdoor" +frontendBaseDir = "/opt/csghub/embedded/etc/casdoor" inactiveTimeoutMinutes = 30 diff --git a/opt/csghub/etc/casdoor/files/avatar/OpenCSG/background.png b/opt/csghub/embedded/etc/casdoor/files/avatar/OpenCSG/background.png similarity index 100% rename from opt/csghub/etc/casdoor/files/avatar/OpenCSG/background.png rename to opt/csghub/embedded/etc/casdoor/files/avatar/OpenCSG/background.png diff --git a/opt/csghub/etc/casdoor/files/avatar/OpenCSG/favicon.png b/opt/csghub/embedded/etc/casdoor/files/avatar/OpenCSG/favicon.png similarity index 100% rename from opt/csghub/etc/casdoor/files/avatar/OpenCSG/favicon.png rename to opt/csghub/embedded/etc/casdoor/files/avatar/OpenCSG/favicon.png diff --git a/opt/csghub/etc/casdoor/files/avatar/OpenCSG/gitlab_favicon.png b/opt/csghub/embedded/etc/casdoor/files/avatar/OpenCSG/gitlab_favicon.png similarity index 100% rename from opt/csghub/etc/casdoor/files/avatar/OpenCSG/gitlab_favicon.png rename to opt/csghub/embedded/etc/casdoor/files/avatar/OpenCSG/gitlab_favicon.png diff --git a/opt/csghub/etc/casdoor/files/avatar/OpenCSG/logo.png b/opt/csghub/embedded/etc/casdoor/files/avatar/OpenCSG/logo.png similarity index 100% rename from opt/csghub/etc/casdoor/files/avatar/OpenCSG/logo.png rename to opt/csghub/embedded/etc/casdoor/files/avatar/OpenCSG/logo.png diff --git a/opt/csghub/etc/casdoor/files/avatar/OpenCSG/robot.png b/opt/csghub/embedded/etc/casdoor/files/avatar/OpenCSG/robot.png similarity index 100% rename from opt/csghub/etc/casdoor/files/avatar/OpenCSG/robot.png rename to opt/csghub/embedded/etc/casdoor/files/avatar/OpenCSG/robot.png diff --git a/opt/csghub/etc/casdoor/init_data.json.sample b/opt/csghub/embedded/etc/casdoor/init_data.json.sample similarity index 99% rename from opt/csghub/etc/casdoor/init_data.json.sample rename to opt/csghub/embedded/etc/casdoor/init_data.json.sample index a4bdc444..b272c33e 100644 --- a/opt/csghub/etc/casdoor/init_data.json.sample +++ b/opt/csghub/embedded/etc/casdoor/init_data.json.sample @@ -987,7 +987,7 @@ "type": "Local File System", "method": "Normal", "domain": "{{ $casdoorEndpoint }}", - "pathPrefix": "/opt/csghub/etc/casdoor" + "pathPrefix": "/opt/csghub/embedded/etc/casdoor" } ] } \ No newline at end of file diff --git a/opt/csghub/etc/casdoor/token_jwt_key.pem b/opt/csghub/embedded/etc/casdoor/token_jwt_key.pem similarity index 100% rename from opt/csghub/etc/casdoor/token_jwt_key.pem rename to opt/csghub/embedded/etc/casdoor/token_jwt_key.pem diff --git a/opt/csghub/etc/consul/consul.hcl.sample b/opt/csghub/embedded/etc/consul/consul.hcl.sample similarity index 100% rename from opt/csghub/etc/consul/consul.hcl.sample rename to opt/csghub/embedded/etc/consul/consul.hcl.sample diff --git a/opt/csghub/etc/csghub/templates/system/csghub-runsvdir.service b/opt/csghub/embedded/etc/csghub/csghub-runsvdir.service similarity index 100% rename from opt/csghub/etc/csghub/templates/system/csghub-runsvdir.service rename to opt/csghub/embedded/etc/csghub/csghub-runsvdir.service diff --git a/opt/csghub/etc/csghub/default.yaml b/opt/csghub/embedded/etc/csghub/default.yaml similarity index 99% rename from opt/csghub/etc/csghub/default.yaml rename to opt/csghub/embedded/etc/csghub/default.yaml index b176b286..aa548d3d 100644 --- a/opt/csghub/etc/csghub/default.yaml +++ b/opt/csghub/embedded/etc/csghub/default.yaml @@ -80,7 +80,7 @@ server: ## Casdoor (authentication) Integration casdoor: endpoint: "" ## Casdoor endpoint - certificate: "/opt/csghub/etc/casdoor/token_jwt_key.pem" ## SSL cert path + certificate: "/opt/csghub/embedded/etc/casdoor/token_jwt_key.pem" ## SSL cert path organization_name: "OpenCSG" ## Organization name in Casdoor application_name: "CSGHub" ## App name in Casdoor diff --git a/opt/csghub/etc/csghub/scripts/pg_executor b/opt/csghub/embedded/etc/csghub/scripts/pg_executor similarity index 100% rename from opt/csghub/etc/csghub/scripts/pg_executor rename to opt/csghub/embedded/etc/csghub/scripts/pg_executor diff --git a/opt/csghub/etc/csghub/scripts/pg_exists b/opt/csghub/embedded/etc/csghub/scripts/pg_exists similarity index 100% rename from opt/csghub/etc/csghub/scripts/pg_exists rename to opt/csghub/embedded/etc/csghub/scripts/pg_exists diff --git a/opt/csghub/etc/csghub/templates/csghub/csghub.yaml.sample b/opt/csghub/embedded/etc/csghub/templates/csghub.yaml.sample similarity index 99% rename from opt/csghub/etc/csghub/templates/csghub/csghub.yaml.sample rename to opt/csghub/embedded/etc/csghub/templates/csghub.yaml.sample index 0fa5ad6b..3b0edc0d 100644 --- a/opt/csghub/etc/csghub/templates/csghub/csghub.yaml.sample +++ b/opt/csghub/embedded/etc/csghub/templates/csghub.yaml.sample @@ -74,7 +74,7 @@ csghub: ## Casdoor (authentication) Integration # casdoor: # endpoint: "http://csghub.example.com:8000" ## Casdoor endpoint - # certificate: "/opt/csghub/etc/casdoor/token_jwt_key.pem" ## SSL cert path + # certificate: "/opt/csghub/embedded/etc/casdoor/token_jwt_key.pem" ## SSL cert path # organization_name: "OpenCSG" ## Organization name in Casdoor # application_name: "CSGHub" ## App name in Casdoor diff --git a/opt/csghub/etc/gitaly/config.toml.sample b/opt/csghub/embedded/etc/gitaly/config.toml.sample similarity index 100% rename from opt/csghub/etc/gitaly/config.toml.sample rename to opt/csghub/embedded/etc/gitaly/config.toml.sample diff --git a/opt/csghub/etc/gitlab_shell/config.yml.sample b/opt/csghub/embedded/etc/gitlab_shell/config.yml.sample similarity index 98% rename from opt/csghub/etc/gitlab_shell/config.yml.sample rename to opt/csghub/embedded/etc/gitlab_shell/config.yml.sample index b2ce5cd0..c1fff2de 100644 --- a/opt/csghub/etc/gitlab_shell/config.yml.sample +++ b/opt/csghub/embedded/etc/gitlab_shell/config.yml.sample @@ -39,7 +39,7 @@ auth_file: "/home/git/.ssh/authorized_keys" # File that contains the secret key for verifying access to GitLab. # Default is .gitlab_shell_secret in the gitlab-shell directory. -secret_file: "/opt/csghub/etc/gitlab_shell/.gitlab_shell_secret" +secret_file: "/opt/csghub/service/gitlab_shell/.gitlab_shell_secret" # The secret field supersedes the secret_file, and if set that # file will not be read. diff --git a/opt/csghub/etc/loki/loki-config.yaml.sample b/opt/csghub/embedded/etc/loki/loki-config.yaml.sample similarity index 100% rename from opt/csghub/etc/loki/loki-config.yaml.sample rename to opt/csghub/embedded/etc/loki/loki-config.yaml.sample diff --git a/opt/csghub/etc/nats/nats.conf.sample b/opt/csghub/embedded/etc/nats/nats.conf.sample similarity index 100% rename from opt/csghub/etc/nats/nats.conf.sample rename to opt/csghub/embedded/etc/nats/nats.conf.sample diff --git a/opt/csghub/etc/nginx/html/403.html.sample b/opt/csghub/embedded/etc/nginx/html/403.html.sample similarity index 100% rename from opt/csghub/etc/nginx/html/403.html.sample rename to opt/csghub/embedded/etc/nginx/html/403.html.sample diff --git a/opt/csghub/etc/nginx/html/404.html.sample b/opt/csghub/embedded/etc/nginx/html/404.html.sample similarity index 100% rename from opt/csghub/etc/nginx/html/404.html.sample rename to opt/csghub/embedded/etc/nginx/html/404.html.sample diff --git a/opt/csghub/etc/nginx/html/500.html.sample b/opt/csghub/embedded/etc/nginx/html/500.html.sample similarity index 100% rename from opt/csghub/etc/nginx/html/500.html.sample rename to opt/csghub/embedded/etc/nginx/html/500.html.sample diff --git a/opt/csghub/etc/nginx/html/502.html.sample b/opt/csghub/embedded/etc/nginx/html/502.html.sample similarity index 100% rename from opt/csghub/etc/nginx/html/502.html.sample rename to opt/csghub/embedded/etc/nginx/html/502.html.sample diff --git a/opt/csghub/etc/nginx/html/503.html.sample b/opt/csghub/embedded/etc/nginx/html/503.html.sample similarity index 100% rename from opt/csghub/etc/nginx/html/503.html.sample rename to opt/csghub/embedded/etc/nginx/html/503.html.sample diff --git a/opt/csghub/etc/nginx/nginx.conf.sample b/opt/csghub/embedded/etc/nginx/nginx.conf.sample similarity index 100% rename from opt/csghub/etc/nginx/nginx.conf.sample rename to opt/csghub/embedded/etc/nginx/nginx.conf.sample diff --git a/opt/csghub/etc/patroni/patroni.yaml.sample b/opt/csghub/embedded/etc/patroni/patroni.yaml.sample similarity index 97% rename from opt/csghub/etc/patroni/patroni.yaml.sample rename to opt/csghub/embedded/etc/patroni/patroni.yaml.sample index 222c218a..36ad691a 100755 --- a/opt/csghub/etc/patroni/patroni.yaml.sample +++ b/opt/csghub/embedded/etc/patroni/patroni.yaml.sample @@ -123,9 +123,9 @@ postgresql: remove_data_directory_on_diverged_timelines: {{ $patroni.remove_data_directory_on_diverged_timelines }} {{- if $patroni.callback.enable }} callbacks: - on_start: /var/opt/csghub/patroni/patroni_callback.sh - on_stop: /var/opt/csghub/patroni/patroni_callback.sh - on_role_change: /var/opt/csghub/patroni/patroni_callback.sh + on_start: /opt/csghub/service/patroni/etc/patroni_callback.sh + on_stop: /opt/csghub/service/patroni/etc/patroni_callback.sh + on_role_change: /opt/csghub/service/patroni/etc/patroni_callback.sh {{- end }} {{- if has $patroni "watchdog" }} diff --git a/opt/csghub/etc/patroni/patroni_callback.sh.sample b/opt/csghub/embedded/etc/patroni/patroni_callback.sh.sample similarity index 100% rename from opt/csghub/etc/patroni/patroni_callback.sh.sample rename to opt/csghub/embedded/etc/patroni/patroni_callback.sh.sample diff --git a/opt/csghub/etc/postgresql/pg_hba.conf.sample b/opt/csghub/embedded/etc/postgresql/pg_hba.conf.sample similarity index 100% rename from opt/csghub/etc/postgresql/pg_hba.conf.sample rename to opt/csghub/embedded/etc/postgresql/pg_hba.conf.sample diff --git a/opt/csghub/etc/postgresql/postgresql.conf.sample b/opt/csghub/embedded/etc/postgresql/postgresql.conf.sample similarity index 100% rename from opt/csghub/etc/postgresql/postgresql.conf.sample rename to opt/csghub/embedded/etc/postgresql/postgresql.conf.sample diff --git a/opt/csghub/etc/praefect/config.toml.sample b/opt/csghub/embedded/etc/praefect/config.toml.sample similarity index 100% rename from opt/csghub/etc/praefect/config.toml.sample rename to opt/csghub/embedded/etc/praefect/config.toml.sample diff --git a/opt/csghub/etc/prometheus/prometheus.yml.sample b/opt/csghub/embedded/etc/prometheus/prometheus.yml.sample similarity index 100% rename from opt/csghub/etc/prometheus/prometheus.yml.sample rename to opt/csghub/embedded/etc/prometheus/prometheus.yml.sample diff --git a/opt/csghub/etc/redis/redis.conf.sample b/opt/csghub/embedded/etc/redis/redis.conf.sample similarity index 100% rename from opt/csghub/etc/redis/redis.conf.sample rename to opt/csghub/embedded/etc/redis/redis.conf.sample diff --git a/opt/csghub/etc/registry/config.yml.sample b/opt/csghub/embedded/etc/registry/config.yml.sample similarity index 100% rename from opt/csghub/etc/registry/config.yml.sample rename to opt/csghub/embedded/etc/registry/config.yml.sample diff --git a/opt/csghub/etc/server/config.toml.sample b/opt/csghub/embedded/etc/server/config.toml.sample similarity index 100% rename from opt/csghub/etc/server/config.toml.sample rename to opt/csghub/embedded/etc/server/config.toml.sample diff --git a/opt/csghub/etc/temporal/auto-setup.sh b/opt/csghub/embedded/etc/temporal/auto-setup.sh similarity index 100% rename from opt/csghub/etc/temporal/auto-setup.sh rename to opt/csghub/embedded/etc/temporal/auto-setup.sh diff --git a/opt/csghub/etc/temporal/docker.yaml.sample b/opt/csghub/embedded/etc/temporal/docker.yaml.sample similarity index 100% rename from opt/csghub/etc/temporal/docker.yaml.sample rename to opt/csghub/embedded/etc/temporal/docker.yaml.sample diff --git a/opt/csghub/etc/temporal_ui/docker.yaml.sample b/opt/csghub/embedded/etc/temporal_ui/docker.yaml.sample similarity index 100% rename from opt/csghub/etc/temporal_ui/docker.yaml.sample rename to opt/csghub/embedded/etc/temporal_ui/docker.yaml.sample diff --git a/opt/csghub/embedded/sv/accounting/templates/run.sample b/opt/csghub/embedded/sv/accounting/templates/run.sample index 3717c755..86eb79e5 100755 --- a/opt/csghub/embedded/sv/accounting/templates/run.sample +++ b/opt/csghub/embedded/sv/accounting/templates/run.sample @@ -8,11 +8,12 @@ set -e {{- $server := (datasource "config").server }} {{- $dataDir := $server.data | default "/var/opt/csghub/server" }} -{{- $configFile := printf "%s/config.toml" $dataDir }} +{{- $configDir := "/opt/csghub/service/server/etc" }} +{{- $configFile := printf "%s/config.toml" $configDir }} # Define constants readonly SERVER_BIN="/opt/csghub/embedded/bin/csghub-server" -readonly ENV_DIR="/opt/csghub/etc/server/env" +readonly ENV_DIR="/opt/csghub/service/server/env" # Build command arguments args=("accounting" "launch" "-l" {{ $server.log.level | quote }}) diff --git a/opt/csghub/embedded/sv/aigateway/templates/run.sample b/opt/csghub/embedded/sv/aigateway/templates/run.sample index d21bf3ae..e508c05e 100755 --- a/opt/csghub/embedded/sv/aigateway/templates/run.sample +++ b/opt/csghub/embedded/sv/aigateway/templates/run.sample @@ -8,11 +8,12 @@ set -e {{- $server := (datasource "config").server }} {{- $dataDir := $server.data | default "/var/opt/csghub/server" }} -{{- $configFile := printf "%s/config.toml" $dataDir }} +{{- $configDir := "/opt/csghub/service/server/etc" }} +{{- $configFile := printf "%s/config.toml" $configDir }} # Define constants readonly SERVER_BIN="/opt/csghub/embedded/bin/csghub-server" -readonly ENV_DIR="/opt/csghub/etc/server/env" +readonly ENV_DIR="/opt/csghub/service/server/env" # Build command arguments args=("aigateway" "launch" "-l" {{ $server.log.level | quote }}) diff --git a/opt/csghub/embedded/sv/casdoor/templates/pre-start.sample b/opt/csghub/embedded/sv/casdoor/templates/pre-start.sample index 03247cc8..665b7843 100755 --- a/opt/csghub/embedded/sv/casdoor/templates/pre-start.sample +++ b/opt/csghub/embedded/sv/casdoor/templates/pre-start.sample @@ -6,8 +6,8 @@ exec 2>&1 # exit on error set -e -{{- $envDir := "/opt/csghub/etc/casdoor/env" }} -{{- $configDir := "/opt/csghub/etc/casdoor" }} +{{- $envDir := "/opt/csghub/service/casdoor/env" }} +{{- $configDir := "/opt/csghub/embedded/etc/casdoor" }} {{- file.Write (printf "%s/DSN" $envDir) (tmpl.Exec "config.casdoor.db.dsn" .) }} @@ -24,11 +24,13 @@ set -e {{- end }} {{- $dataDir := (datasource "config").casdoor.data | default "/var/opt/csghub/casdoor" }} -if [ -f {{ $dataDir }}/app.conf ]; then - mkdir -p {{ $dataDir }}/conf || true - mv {{ $dataDir }}/app.conf {{ $dataDir }}/conf - cp -a {{ $configDir }}/{web,files} {{ $dataDir }}/ || true -fi + +# Ensure casdoor can find app.conf & init_data.json via conf -> etc symlink +mkdir -p {{ $dataDir }}/conf +ln -sfn /opt/csghub/service/casdoor/etc/app.conf {{ $dataDir }}/conf/app.conf +ln -sfn /opt/csghub/service/casdoor/etc/init_data.json {{ $dataDir }}/init_data.json + +cp -a {{ $configDir }}/{web,files} {{ $dataDir }}/ || true COMMAND="/opt/csghub/embedded/bin/casdoor" @@ -62,4 +64,4 @@ fi # Load local sql scripts cd /opt/csghub/service/casdoor -[ -x "/opt/csghub/etc/csghub/scripts/pg_executor" ] && chpst -e {{ $envDir }} /opt/csghub/etc/csghub/scripts/pg_executor +[ -x "/opt/csghub/embedded/etc/csghub/scripts/pg_executor" ] && chpst -e {{ $envDir }} /opt/csghub/embedded/etc/csghub/scripts/pg_executor diff --git a/opt/csghub/embedded/sv/casdoor/templates/run.sample b/opt/csghub/embedded/sv/casdoor/templates/run.sample index ab6732dd..7ed70626 100755 --- a/opt/csghub/embedded/sv/casdoor/templates/run.sample +++ b/opt/csghub/embedded/sv/casdoor/templates/run.sample @@ -14,6 +14,6 @@ fi {{- $dataDir := (datasource "config").casdoor.data | default "/var/opt/csghub/casdoor" }} cd {{ $dataDir }} -exec chpst -e /opt/csghub/etc/casdoor/env -P \ +exec chpst -e /opt/csghub/service/casdoor/env -P \ -u casdoor:casdoor \ /opt/csghub/embedded/bin/casdoor diff --git a/opt/csghub/embedded/sv/consul/templates/run.sample b/opt/csghub/embedded/sv/consul/templates/run.sample index 2c0e10cf..d99240d2 100755 --- a/opt/csghub/embedded/sv/consul/templates/run.sample +++ b/opt/csghub/embedded/sv/consul/templates/run.sample @@ -12,6 +12,6 @@ if [ -e {{ $dataDir }}/server_metadata.json ]; then fi cd {{ $dataDir }} -exec chpst -e /opt/csghub/etc/consul/env -P \ +exec chpst -e /opt/csghub/service/consul/env -P \ -u consul:consul \ - /opt/csghub/embedded/bin/consul agent -config-dir={{ $dataDir }} + /opt/csghub/embedded/bin/consul agent -config-dir=/opt/csghub/service/consul/etc diff --git a/opt/csghub/embedded/sv/dataviewer/templates/run.sample b/opt/csghub/embedded/sv/dataviewer/templates/run.sample index 811cfcd2..9f0c3318 100755 --- a/opt/csghub/embedded/sv/dataviewer/templates/run.sample +++ b/opt/csghub/embedded/sv/dataviewer/templates/run.sample @@ -8,11 +8,12 @@ set -e {{- $server := (datasource "config").server }} {{- $dataDir := $server.data | default "/var/opt/csghub/server" }} -{{- $configFile := printf "%s/config.toml" $dataDir }} +{{- $configDir := "/opt/csghub/service/server/etc" }} +{{- $configFile := printf "%s/config.toml" $configDir }} # Define constants readonly SERVER_BIN="/opt/csghub/embedded/bin/csghub-server" -readonly ENV_DIR="/opt/csghub/etc/server/env" +readonly ENV_DIR="/opt/csghub/service/server/env" # Build command arguments args=("dataviewer" "launch" "-l" {{ $server.log.level | quote }}) diff --git a/opt/csghub/embedded/sv/dnsmasq/templates/pre-start.sample b/opt/csghub/embedded/sv/dnsmasq/templates/pre-start.sample index a7a246ad..6ba6b8b3 100755 --- a/opt/csghub/embedded/sv/dnsmasq/templates/pre-start.sample +++ b/opt/csghub/embedded/sv/dnsmasq/templates/pre-start.sample @@ -6,7 +6,7 @@ exec 2>&1 # Exit if execute with any errors set -e -{{- $configDir := "/opt/csghub/etc/dnsmasq" }} +{{- $configDir := "/opt/csghub/embedded/etc/dnsmasq" }} {{- $runner := (datasource "config").runner }} {{- $ns := $runner.namespace }} {{- $services := $runner.knative.services }} diff --git a/opt/csghub/embedded/sv/dnsmasq/templates/run.sample b/opt/csghub/embedded/sv/dnsmasq/templates/run.sample index 1650c34a..d256bd46 100755 --- a/opt/csghub/embedded/sv/dnsmasq/templates/run.sample +++ b/opt/csghub/embedded/sv/dnsmasq/templates/run.sample @@ -11,6 +11,6 @@ if [ -x ./pre-start ]; then ./pre-start fi -exec chpst -e /opt/csghub/etc/dnsmasq/env -P \ +exec chpst -e /opt/csghub/service/dnsmasq/env -P \ -u dnsmasq:dnsmasq \ - /opt/csghub/embedded/bin/dnsmasq --conf-dir=/opt/csghub/etc/dnsmasq --no-daemon + /opt/csghub/embedded/bin/dnsmasq --conf-dir=/opt/csghub/embedded/etc/dnsmasq --no-daemon diff --git a/opt/csghub/embedded/sv/gitaly/templates/pre-start.sample b/opt/csghub/embedded/sv/gitaly/templates/pre-start.sample index d772f648..17444855 100755 --- a/opt/csghub/embedded/sv/gitaly/templates/pre-start.sample +++ b/opt/csghub/embedded/sv/gitaly/templates/pre-start.sample @@ -17,6 +17,6 @@ if [ ! -s {{ $pidFile }} ]; then echo -n 0 > {{ $pidFile }} fi -{{- $envDir := "/opt/csghub/etc/gitaly/env" }} +{{- $envDir := "/opt/csghub/service/gitaly/env" }} {{- $pidFileEnv := printf "%s/GITALY_PID_FILE" $envDir }} {{- file.Write $pidFileEnv $pidFile }} diff --git a/opt/csghub/embedded/sv/gitaly/templates/run.sample b/opt/csghub/embedded/sv/gitaly/templates/run.sample index ccf3c3a6..c6545bbe 100755 --- a/opt/csghub/embedded/sv/gitaly/templates/run.sample +++ b/opt/csghub/embedded/sv/gitaly/templates/run.sample @@ -15,8 +15,9 @@ if [ -x ./pre-start ]; then fi {{- $dataDir := (datasource "config").gitaly.data_dir | default "/var/opt/csghub/gitaly" }} +{{- $configDir := "/opt/csghub/service/gitaly/etc" }} cd {{ $dataDir }} -exec chpst -e /opt/csghub/etc/gitaly/env -P \ +exec chpst -e /opt/csghub/service/gitaly/env -P \ -u git:git \ - /opt/csghub/embedded/bin/gitaly-wrapper /opt/csghub/embedded/bin/gitaly serve {{ $dataDir }}/config.toml + /opt/csghub/embedded/bin/gitaly-wrapper /opt/csghub/embedded/bin/gitaly serve {{ $configDir }}/config.toml diff --git a/opt/csghub/embedded/sv/gitlab_shell/templates/run.sample b/opt/csghub/embedded/sv/gitlab_shell/templates/run.sample index f91a5714..4a1323de 100755 --- a/opt/csghub/embedded/sv/gitlab_shell/templates/run.sample +++ b/opt/csghub/embedded/sv/gitlab_shell/templates/run.sample @@ -12,8 +12,9 @@ ulimit -n 15000 # Run the pre-start script to ensure that the service meets the startup conditions {{- $gitaly := (datasource "config").gitaly }} {{- $dataDir := (datasource "config").gitlab_shell.data | default "/var/opt/csghub/gitlab_shell" }} +{{- $configDir := (datasource "config").gitlab_shell.config | default "/opt/csghub/service/gitlab_shell/etc" }} {{- $token := $gitaly.auth.token | default (crypto.PBKDF2 "gitaly" "opencsg" 2048 8) }} -{{- file.Write "/opt/csghub/etc/gitlab_shell/.gitlab_shell_secret" $token }} +{{- file.Write "/opt/csghub/service/gitlab_shell/.gitlab_shell_secret" $token }} # Exit if execute with any errors set -e @@ -41,9 +42,9 @@ fi {{- $dataDir := (datasource "config").gitlab_shell.data | default "/var/opt/csghub/gitlab_shell" }} if [ "${SSH_DAEMON}" == "gitlab-sshd" ]; then - exec chpst -e /opt/csghub/etc/gitlab_shell/env -P \ + exec chpst -e /opt/csghub/service/gitlab_shell/env -P \ -u git:git \ - /opt/csghub/embedded/bin/gitlab-sshd -config-dir {{ $dataDir }} + /opt/csghub/embedded/bin/gitlab-sshd -config-dir {{ $configDir }} else if [ "${USE_GITLAB_LOGGER-0}" -eq 1 ]; then /usr/bin/gitlab-logger /var/log/gitlab-shell & diff --git a/opt/csghub/embedded/sv/logger/templates/pre-start.sample b/opt/csghub/embedded/sv/logger/templates/pre-start.sample index 63128ac8..0702aa50 100755 --- a/opt/csghub/embedded/sv/logger/templates/pre-start.sample +++ b/opt/csghub/embedded/sv/logger/templates/pre-start.sample @@ -6,7 +6,7 @@ exec 2>&1 # Exit if execute with any errors set -e -{{- $envDir := "/opt/csghub/etc/minio/env" }} +{{- $envDir := "/opt/csghub/service/minio/env" }} # Clear all environment variable files # rm -rf {{ $envDir }}/* || true diff --git a/opt/csghub/embedded/sv/logger/templates/run.sample b/opt/csghub/embedded/sv/logger/templates/run.sample index 1d82bfa2..53b872a8 100755 --- a/opt/csghub/embedded/sv/logger/templates/run.sample +++ b/opt/csghub/embedded/sv/logger/templates/run.sample @@ -11,6 +11,6 @@ if [ -x ./pre-start ]; then ./pre-start fi -exec chpst -e /opt/csghub/etc/minio/env -P \ +exec chpst -e /opt/csghub/service/minio/env -P \ -u root:root \ /opt/csghub/embedded/bin/logger \ No newline at end of file diff --git a/opt/csghub/embedded/sv/loki/templates/run.sample b/opt/csghub/embedded/sv/loki/templates/run.sample index 9ef7e0e3..b806ef1d 100755 --- a/opt/csghub/embedded/sv/loki/templates/run.sample +++ b/opt/csghub/embedded/sv/loki/templates/run.sample @@ -12,9 +12,10 @@ fi set -e {{- $dataDir := (datasource "config").loki.data | default "/var/opt/csghub/loki" }} +{{- $configDir := "/opt/csghub/service/loki/etc" }} cd {{ $dataDir }} -exec chpst -e /opt/csghub/etc/loki/env -P \ +exec chpst -e /opt/csghub/service/loki/env -P \ -u loki:loki \ /opt/csghub/embedded/bin/loki \ - -config.file={{ $dataDir }}/loki-config.yaml \ + -config.file={{ $configDir }}/loki-config.yaml \ -server.path-prefix="/-/loki" diff --git a/opt/csghub/embedded/sv/minio/templates/pre-start.sample b/opt/csghub/embedded/sv/minio/templates/pre-start.sample index 662e6fc7..cca76cc1 100755 --- a/opt/csghub/embedded/sv/minio/templates/pre-start.sample +++ b/opt/csghub/embedded/sv/minio/templates/pre-start.sample @@ -6,7 +6,7 @@ exec 2>&1 # Exit if execute with any errors set -e -{{- $envDir := "/opt/csghub/etc/minio/env" }} +{{- $envDir := "/opt/csghub/service/minio/env" }} # Clear all environment variable files # rm -rf {{ $envDir }}/* || true diff --git a/opt/csghub/embedded/sv/minio/templates/run.sample b/opt/csghub/embedded/sv/minio/templates/run.sample index 2f8be799..1774c384 100755 --- a/opt/csghub/embedded/sv/minio/templates/run.sample +++ b/opt/csghub/embedded/sv/minio/templates/run.sample @@ -15,7 +15,7 @@ fi {{- $dataDir := $minio.data | default "/var/opt/csghub/minio/data" }} cd {{ $dataDir }} -exec chpst -e /opt/csghub/etc/minio/env -P \ +exec chpst -e /opt/csghub/service/minio/env -P \ -u minio:minio \ /opt/csghub/embedded/bin/minio server \ --address {{ $minio.listen }} \ diff --git a/opt/csghub/embedded/sv/mirror_lfs/templates/run.sample b/opt/csghub/embedded/sv/mirror_lfs/templates/run.sample index 3c26cced..a172266c 100755 --- a/opt/csghub/embedded/sv/mirror_lfs/templates/run.sample +++ b/opt/csghub/embedded/sv/mirror_lfs/templates/run.sample @@ -8,11 +8,12 @@ set -e {{- $server := (datasource "config").server }} {{- $dataDir := $server.data | default "/var/opt/csghub/server" }} -{{- $configFile := printf "%s/config.toml" $dataDir }} +{{- $configDir := "/opt/csghub/service/server/etc" }} +{{- $configFile := printf "%s/config.toml" $configDir }} # Define constants readonly SERVER_BIN="/opt/csghub/embedded/bin/csghub-server" -readonly ENV_DIR="/opt/csghub/etc/server/env" +readonly ENV_DIR="/opt/csghub/service/server/env" # Build command arguments args=("mirror" "lfs-sync" "-l" {{ $server.log.level | quote }}) diff --git a/opt/csghub/embedded/sv/mirror_repo/templates/run.sample b/opt/csghub/embedded/sv/mirror_repo/templates/run.sample index 6bc19323..4292ab20 100755 --- a/opt/csghub/embedded/sv/mirror_repo/templates/run.sample +++ b/opt/csghub/embedded/sv/mirror_repo/templates/run.sample @@ -8,11 +8,12 @@ set -e {{- $server := (datasource "config").server }} {{- $dataDir := $server.data | default "/var/opt/csghub/server" }} -{{- $configFile := printf "%s/config.toml" $dataDir }} +{{- $configDir := "/opt/csghub/service/server/etc" }} +{{- $configFile := printf "%s/config.toml" $configDir }} # Define constants readonly SERVER_BIN="/opt/csghub/embedded/bin/csghub-server" -readonly ENV_DIR="/opt/csghub/etc/server/env" +readonly ENV_DIR="/opt/csghub/service/server/env" # Build command arguments args=("mirror" "repo-sync" "-l" {{ $server.log.level | quote }}) diff --git a/opt/csghub/embedded/sv/moderation/templates/run.sample b/opt/csghub/embedded/sv/moderation/templates/run.sample index b789825f..9643c095 100755 --- a/opt/csghub/embedded/sv/moderation/templates/run.sample +++ b/opt/csghub/embedded/sv/moderation/templates/run.sample @@ -8,11 +8,12 @@ set -e {{- $server := (datasource "config").server }} {{- $dataDir := $server.data | default "/var/opt/csghub/server" }} -{{- $configFile := printf "%s/config.toml" $dataDir }} +{{- $configDir := "/opt/csghub/service/server/etc" }} +{{- $configFile := printf "%s/config.toml" $configDir }} # Define constants readonly SERVER_BIN="/opt/csghub/embedded/bin/csghub-server" -readonly ENV_DIR="/opt/csghub/etc/server/env" +readonly ENV_DIR="/opt/csghub/service/server/env" # Build command arguments args=("moderation" "launch" "-l" {{ $server.log.level | quote }}) diff --git a/opt/csghub/embedded/sv/nats/templates/run.sample b/opt/csghub/embedded/sv/nats/templates/run.sample index 9406600c..0c560f51 100755 --- a/opt/csghub/embedded/sv/nats/templates/run.sample +++ b/opt/csghub/embedded/sv/nats/templates/run.sample @@ -7,8 +7,9 @@ exec 2>&1 set -e {{- $dataDir := (datasource "config").nats.data | default "/var/opt/csghub/nats" }} +{{- $configDir := "/opt/csghub/service/nats/etc" }} cd {{ $dataDir }} -exec chpst -e /opt/csghub/etc/nats/env -P \ +exec chpst -e /opt/csghub/service/nats/env -P \ -u nats:nats \ - /opt/csghub/embedded/bin/nats-server -c {{ $dataDir }}/nats.conf + /opt/csghub/embedded/bin/nats-server -c {{ $configDir }}/nats.conf diff --git a/opt/csghub/embedded/sv/nginx/templates/control/h.sample b/opt/csghub/embedded/sv/nginx/templates/control/h.sample index f5f3612c..0b46c333 100644 --- a/opt/csghub/embedded/sv/nginx/templates/control/h.sample +++ b/opt/csghub/embedded/sv/nginx/templates/control/h.sample @@ -3,7 +3,7 @@ exec 1>&2 {{- $dataDir := (datasource "config").nginx.data | default "/var/opt/csghub/nginx" }} if pgrep nginx; then - chpst -e /opt/csghub/etc/nginx/env -P \ + chpst -e /opt/csghub/service/nginx/env -P \ -u root:root \ /opt/csghub/embedded/bin/nginx -c {{ $dataDir }}/nginx.conf -s reload fi diff --git a/opt/csghub/embedded/sv/nginx/templates/pre-start.sample b/opt/csghub/embedded/sv/nginx/templates/pre-start.sample index 8471a110..6a7b9ea3 100755 --- a/opt/csghub/embedded/sv/nginx/templates/pre-start.sample +++ b/opt/csghub/embedded/sv/nginx/templates/pre-start.sample @@ -6,7 +6,14 @@ exec 2>&1 # Exit if execute with any errors set -e -{{- $configDir := "/opt/csghub/etc/nginx" }} +{{- $configDir := "/opt/csghub/service/nginx/etc" }} {{- $dataDir := (datasource "config").nginx.data | default "/var/opt/csghub/nginx" }} -find {{ $configDir }} -type f ! -name '*.default' ! -name '*.sample' ! -name 'nginx.conf' ! -name 'env' ! -name '*.so' -exec cp -p {} {{ $dataDir }} \; +# Copy all files from embedded nginx dir to data dir +find /opt/csghub/embedded/etc/nginx -type f ! -name '*.default' ! -name '*.sample' ! -name 'nginx.conf' ! -name 'env' ! -name '*.so' -exec cp -p {} {{ $dataDir }} \; + +# Link rendered nginx.conf to data dir +ln -sf {{ $configDir }}/nginx.conf {{ $dataDir }}/nginx.conf + +# Link html error pages to data dir +ln -sfn {{ $configDir }}/html {{ $dataDir }}/html diff --git a/opt/csghub/embedded/sv/nginx/templates/run.sample b/opt/csghub/embedded/sv/nginx/templates/run.sample index 1a76944d..abf6b615 100755 --- a/opt/csghub/embedded/sv/nginx/templates/run.sample +++ b/opt/csghub/embedded/sv/nginx/templates/run.sample @@ -13,6 +13,6 @@ fi {{- $dataDir := (datasource "config").nginx.data | default "/var/opt/csghub/nginx" }} cd {{ $dataDir }} -exec chpst -e /opt/csghub/etc/nginx/env -P \ +exec chpst -e /opt/csghub/service/nginx/env -P \ -u root:root \ - /opt/csghub/embedded/bin/nginx -c {{ $dataDir }}/nginx.conf -g "daemon off;" \ No newline at end of file + /opt/csghub/embedded/bin/nginx -c {{ $dataDir }}/nginx.conf -g "pid {{ $dataDir }}/nginx.pid; lock_file {{ $dataDir }}/nginx.lock; daemon off;" \ No newline at end of file diff --git a/opt/csghub/embedded/sv/notifier/templates/run.sample b/opt/csghub/embedded/sv/notifier/templates/run.sample index 54199a7d..c25886d3 100755 --- a/opt/csghub/embedded/sv/notifier/templates/run.sample +++ b/opt/csghub/embedded/sv/notifier/templates/run.sample @@ -8,11 +8,12 @@ set -e {{- $server := (datasource "config").server }} {{- $dataDir := $server.data | default "/var/opt/csghub/server" }} -{{- $configFile := printf "%s/config.toml" $dataDir }} +{{- $configDir := "/opt/csghub/service/server/etc" }} +{{- $configFile := printf "%s/config.toml" $configDir }} # Define constants readonly SERVER_BIN="/opt/csghub/embedded/bin/csghub-server" -readonly ENV_DIR="/opt/csghub/etc/server/env" +readonly ENV_DIR="/opt/csghub/service/server/env" # Build command arguments args=("notification" "launch" "-l" {{ $server.log.level | quote }}) diff --git a/opt/csghub/embedded/sv/patroni/templates/pre-start.sample b/opt/csghub/embedded/sv/patroni/templates/pre-start.sample index ead72a9b..17bb182f 100755 --- a/opt/csghub/embedded/sv/patroni/templates/pre-start.sample +++ b/opt/csghub/embedded/sv/patroni/templates/pre-start.sample @@ -6,7 +6,7 @@ exec 2>&1 # Exit if execute with any errors set -e -{{- $envDir := "/opt/csghub/etc/patroni/env" }} +{{- $envDir := "/opt/csghub/service/patroni/env" }} # Clear all environment variable files # rm -rf {{ $envDir }}/* || true diff --git a/opt/csghub/embedded/sv/patroni/templates/run.sample b/opt/csghub/embedded/sv/patroni/templates/run.sample index e0b3bee5..58cca323 100755 --- a/opt/csghub/embedded/sv/patroni/templates/run.sample +++ b/opt/csghub/embedded/sv/patroni/templates/run.sample @@ -12,9 +12,9 @@ if [ -x ./pre-start ]; then fi {{- $dataDir := (datasource "config").patroni.data_dir | default "/var/opt/csghub/patroni" }} -{{- $configDir := (datasource "config").patroni.config_dir | default "/var/opt/csghub/patroni" }} +{{- $configDir := (datasource "config").patroni.config_dir | default "/opt/csghub/service/patroni/etc" }} cd {{ $configDir }} -exec chpst -e /opt/csghub/etc/patroni/env -P \ +exec chpst -e /opt/csghub/service/patroni/env -P \ -u postgres:postgres \ /opt/csghub/embedded/bin/python3.11 /opt/csghub/embedded/bin/patroni {{ $configDir }}/patroni.yaml \ No newline at end of file diff --git a/opt/csghub/embedded/sv/portal/templates/pre-start.sample b/opt/csghub/embedded/sv/portal/templates/pre-start.sample index db0d6599..0281bf4f 100755 --- a/opt/csghub/embedded/sv/portal/templates/pre-start.sample +++ b/opt/csghub/embedded/sv/portal/templates/pre-start.sample @@ -6,7 +6,7 @@ exec 2>&1 # Exit if execute with any errors set -e -{{- $envDir := "/opt/csghub/etc/portal/env" }} +{{- $envDir := "/opt/csghub/service/portal/env" }} # Clear all environment variable files # rm -rf {{ $envDir }}/* || true diff --git a/opt/csghub/embedded/sv/portal/templates/run.sample b/opt/csghub/embedded/sv/portal/templates/run.sample index f1189aca..10cbecbd 100755 --- a/opt/csghub/embedded/sv/portal/templates/run.sample +++ b/opt/csghub/embedded/sv/portal/templates/run.sample @@ -15,7 +15,7 @@ if [ -x ./pre-start ]; then fi readonly PORTAL_BIN="/opt/csghub/embedded/bin/csghub-portal" -readonly ENV_DIR="/opt/csghub/etc/portal/env" +readonly ENV_DIR="/opt/csghub/service/portal/env" echo "Initializing database migrations..." chpst -e "$ENV_DIR" -P \ diff --git a/opt/csghub/embedded/sv/postgresql/templates/control/h.sample b/opt/csghub/embedded/sv/postgresql/templates/control/h.sample index 553c8c83..8edc052d 100644 --- a/opt/csghub/embedded/sv/postgresql/templates/control/h.sample +++ b/opt/csghub/embedded/sv/postgresql/templates/control/h.sample @@ -3,7 +3,7 @@ exec 1>&2 {{- $dataDir := (datasource "config").postgresql.data_dir | default "/var/opt/csghub/postgresql/data" }} if [ -f "{{ $dataDir }}/postmaster.pid" ]; then - chpst -e /opt/csghub/etc/postgresql/env -P \ + chpst -e /opt/csghub/service/postgresql/env -P \ -u postgres:postgres \ /opt/csghub/embedded/bin/pg_ctl reload -D "{{ $dataDir }}" fi diff --git a/opt/csghub/embedded/sv/postgresql/templates/control/t.sample b/opt/csghub/embedded/sv/postgresql/templates/control/t.sample index 753dc2cd..498a40d6 100644 --- a/opt/csghub/embedded/sv/postgresql/templates/control/t.sample +++ b/opt/csghub/embedded/sv/postgresql/templates/control/t.sample @@ -3,7 +3,7 @@ exec 1>&2 {{- $dataDir := (datasource "config").postgresql.data_dir | default "/var/opt/csghub/postgresql/data" }} if [ -f "{{ $dataDir }}/postmaster.pid" ]; then - chpst -e /opt/csghub/etc/postgresql/env -P \ + chpst -e /opt/csghub/service/postgresql/env -P \ -u postgres:postgres \ /opt/csghub/embedded/bin/pg_ctl stop -D "{{ $dataDir }}" -m fast fi diff --git a/opt/csghub/embedded/sv/postgresql/templates/pre-start.sample b/opt/csghub/embedded/sv/postgresql/templates/pre-start.sample index 5032c009..351efecb 100755 --- a/opt/csghub/embedded/sv/postgresql/templates/pre-start.sample +++ b/opt/csghub/embedded/sv/postgresql/templates/pre-start.sample @@ -6,7 +6,7 @@ exec 2>&1 # Exit if execute with any errors set -e -{{- $envDir := "/opt/csghub/etc/postgresql/env" }} +{{- $envDir := "/opt/csghub/service/postgresql/env" }} # Clear all environment variable files # rm -rf {{ $envDir }}/* || true diff --git a/opt/csghub/embedded/sv/postgresql/templates/run.sample b/opt/csghub/embedded/sv/postgresql/templates/run.sample index 255e6135..91b2618b 100755 --- a/opt/csghub/embedded/sv/postgresql/templates/run.sample +++ b/opt/csghub/embedded/sv/postgresql/templates/run.sample @@ -14,6 +14,8 @@ fi {{- $dataDir := (datasource "config").postgresql.data_dir | default "/var/opt/csghub/postgresql" }} cd {{ $dataDir }} -exec chpst -e /opt/csghub/etc/postgresql/env -P \ +exec chpst -e /opt/csghub/service/postgresql/env -P \ -u postgres:postgres \ - /opt/csghub/embedded/bin/postgres -D {{ $dataDir }} \ No newline at end of file + /opt/csghub/embedded/bin/postgres -D {{ $dataDir }} \ + -c config_file=/opt/csghub/service/postgresql/etc/postgresql.conf \ + -c hba_file=/opt/csghub/service/postgresql/etc/pg_hba.conf \ No newline at end of file diff --git a/opt/csghub/embedded/sv/praefect/templates/pre-start.sample b/opt/csghub/embedded/sv/praefect/templates/pre-start.sample index da196eb4..a4cc519d 100755 --- a/opt/csghub/embedded/sv/praefect/templates/pre-start.sample +++ b/opt/csghub/embedded/sv/praefect/templates/pre-start.sample @@ -6,7 +6,7 @@ exec 2>&1 # Exit if execute with any errors set -e -{{- $envDir := "/opt/csghub/etc/praefect/env" }} +{{- $envDir := "/opt/csghub/service/praefect/env" }} {{- $dataDir := (datasource "config").praefect.data_dir | default "/var/opt/csghub/praefect" }} {{- $pidFile := printf "%s/praefect.pid" $dataDir }} diff --git a/opt/csghub/embedded/sv/praefect/templates/run.sample b/opt/csghub/embedded/sv/praefect/templates/run.sample index 572364b1..80576cca 100755 --- a/opt/csghub/embedded/sv/praefect/templates/run.sample +++ b/opt/csghub/embedded/sv/praefect/templates/run.sample @@ -12,12 +12,13 @@ if [ -x ./pre-start ]; then fi {{- $dataDir := (datasource "config").praefect.data_dir | default "/var/opt/csghub/praefect" }} +{{- $configDir := "/opt/csghub/service/praefect/etc" }} cd {{ $dataDir }} -chpst -e /opt/csghub/etc/praefect/env -P \ +chpst -e /opt/csghub/service/praefect/env -P \ -u git:git \ - /opt/csghub/embedded/bin/praefect --config {{ $dataDir }}/config.toml sql-migrate + /opt/csghub/embedded/bin/praefect --config {{ $configDir }}/config.toml sql-migrate -exec chpst -e /opt/csghub/etc/praefect/env -P \ +exec chpst -e /opt/csghub/service/praefect/env -P \ -u git:git \ - /opt/csghub/embedded/bin/gitaly-wrapper /opt/csghub/embedded/bin/praefect -config {{ $dataDir }}/config.toml + /opt/csghub/embedded/bin/gitaly-wrapper /opt/csghub/embedded/bin/praefect -config {{ $configDir }}/config.toml diff --git a/opt/csghub/embedded/sv/prometheus/templates/run.sample b/opt/csghub/embedded/sv/prometheus/templates/run.sample index 84a16a21..9200cc5f 100755 --- a/opt/csghub/embedded/sv/prometheus/templates/run.sample +++ b/opt/csghub/embedded/sv/prometheus/templates/run.sample @@ -14,6 +14,7 @@ set -e {{- $csghub := tmpl.Exec "config.csghub" . | data.YAML }} {{- $prometheus := (datasource "config").prometheus }} {{- $dataDir := $prometheus.data | default "/var/opt/csghub/prometheus" }} +{{- $configDir := "/opt/csghub/service/prometheus/etc" }} {{- $tsdb := $prometheus.tsdb }} {{- $tsdbPath := ($tsdb.path | default (printf "%s/data" $dataDir)) }} {{- $tsdbRetention := ($tsdb.retention | default "15d") }} @@ -21,10 +22,10 @@ set -e {{- $externalUrl := ($prometheus.external_url | default (printf "%s/-/prometheus" $csghub.external)) }} cd {{ $dataDir }} -exec chpst -e /opt/csghub/etc/prometheus/env -P \ +exec chpst -e /opt/csghub/service/prometheus/env -P \ -u prometheus:prometheus \ /opt/csghub/embedded/bin/prometheus \ - --config.file={{ $dataDir }}/prometheus.yml \ + --config.file={{ $configDir }}/prometheus.yml \ --storage.tsdb.path={{ $tsdbPath }} \ --storage.tsdb.retention.time={{ $tsdbRetention }} \ --web.listen-address={{ $listenAddr }} \ diff --git a/opt/csghub/embedded/sv/redis/templates/run.sample b/opt/csghub/embedded/sv/redis/templates/run.sample index 6db151e0..65dc0294 100755 --- a/opt/csghub/embedded/sv/redis/templates/run.sample +++ b/opt/csghub/embedded/sv/redis/templates/run.sample @@ -12,8 +12,9 @@ if [ -x ./pre-start ]; then fi {{- $dataDir := (datasource "config").redis.data | default "/var/opt/csghub/redis" }} +{{- $configDir := "/opt/csghub/service/redis/etc" }} cd {{ $dataDir }} -exec chpst -e /opt/csghub/etc/redis/env -P \ +exec chpst -e /opt/csghub/service/redis/env -P \ -u redis:redis \ - /opt/csghub/embedded/bin/redis-server {{ $dataDir }}/redis.conf + /opt/csghub/embedded/bin/redis-server {{ $configDir }}/redis.conf diff --git a/opt/csghub/embedded/sv/registry/templates/run.sample b/opt/csghub/embedded/sv/registry/templates/run.sample index b7172f24..62107fd0 100755 --- a/opt/csghub/embedded/sv/registry/templates/run.sample +++ b/opt/csghub/embedded/sv/registry/templates/run.sample @@ -12,9 +12,10 @@ if [ -x ./pre-start ]; then fi {{- $dataDir := (datasource "config").registry.data | default "/var/opt/csghub/registry" }} +{{- $configDir := "/opt/csghub/service/registry/etc" }} cd {{ $dataDir }} -exec chpst -e /opt/csghub/etc/registry/env -P \ +exec chpst -e /opt/csghub/service/registry/env -P \ -u registry:registry \ - /opt/csghub/embedded/bin/registry serve {{ $dataDir }}/config.yml + /opt/csghub/embedded/bin/registry serve {{ $configDir }}/config.yml diff --git a/opt/csghub/embedded/sv/rproxy/templates/run.sample b/opt/csghub/embedded/sv/rproxy/templates/run.sample index d8d9b901..3a0b6a8c 100755 --- a/opt/csghub/embedded/sv/rproxy/templates/run.sample +++ b/opt/csghub/embedded/sv/rproxy/templates/run.sample @@ -8,11 +8,12 @@ set -e {{- $server := (datasource "config").server }} {{- $dataDir := $server.data | default "/var/opt/csghub/server" }} -{{- $configFile := printf "%s/config.toml" $dataDir }} +{{- $configDir := "/opt/csghub/service/server/etc" }} +{{- $configFile := printf "%s/config.toml" $configDir }} # Define constants readonly SERVER_BIN="/opt/csghub/embedded/bin/csghub-server" -readonly ENV_DIR="/opt/csghub/etc/server/env" +readonly ENV_DIR="/opt/csghub/service/server/env" # Build command arguments args=("start" "rproxy" "-l" {{ $server.log.level | quote }}) diff --git a/opt/csghub/embedded/sv/server/templates/pre-start.sample b/opt/csghub/embedded/sv/server/templates/pre-start.sample index 335a328e..a9460b87 100755 --- a/opt/csghub/embedded/sv/server/templates/pre-start.sample +++ b/opt/csghub/embedded/sv/server/templates/pre-start.sample @@ -6,8 +6,8 @@ exec 2>&1 # exit when error set -e -{{- $configDir := "/opt/csghub/etc/server" }} -{{- $envDir := printf "%s/env" $configDir }} +{{- $configDir := "/opt/csghub/service/server/etc" }} +{{- $envDir := "/opt/csghub/service/server/env" }} # Clear all environment variable files # rm -rf {{ $envDir }}/* || true @@ -44,11 +44,11 @@ set -e {{- end }} {{- $dataDir := (datasource "config").server.data | default "/var/opt/csghub/server" }} -{{- $configFile := printf "%s/config.toml" $dataDir }} +{{- $configFile := printf "%s/config.toml" $configDir }} # Define constants readonly SERVER_BIN="/opt/csghub/embedded/bin/csghub-server" -readonly ENV_DIR="/opt/csghub/etc/server/env" +readonly ENV_DIR="/opt/csghub/service/server/env" # Build command arguments ## Migration init @@ -67,7 +67,7 @@ cd {{ $dataDir }} && chpst -e "$ENV_DIR" -P -u root:root "$SERVER_BIN" "${args[@ # Load local sql scripts cd /opt/csghub/service/server -[ -x "/opt/csghub/etc/csghub/scripts/pg_executor" ] && chpst -e {{ $envDir }} /opt/csghub/etc/csghub/scripts/pg_executor +[ -x "/opt/csghub/embedded/etc/csghub/scripts/pg_executor" ] && chpst -e {{ $envDir }} /opt/csghub/embedded/etc/csghub/scripts/pg_executor {{- $minio := (datasource "config").minio }} {{- if $minio.enable }} @@ -77,7 +77,7 @@ cd /opt/csghub/service/server /opt/csghub/service/minio/create_bucket "csghub-runner" {{- end }} -find {{ $configDir }} -mindepth 1 -maxdepth 1 ! -name '*.sample' ! -name 'seed' ! -name 'env' ! -name 'scripts' -exec cp -r {} {{ $dataDir }} \; +find /opt/csghub/embedded/etc/server -mindepth 1 -maxdepth 1 ! -name '*.sample' ! -name 'seed' ! -name 'env' ! -name 'scripts' -exec cp -r {} {{ $dataDir }} \; echo "copy configuration files done." {{- $multi_sync := $server.multi_sync -}} diff --git a/opt/csghub/embedded/sv/server/templates/run.sample b/opt/csghub/embedded/sv/server/templates/run.sample index fecb35e3..270ef701 100755 --- a/opt/csghub/embedded/sv/server/templates/run.sample +++ b/opt/csghub/embedded/sv/server/templates/run.sample @@ -13,11 +13,12 @@ fi {{- $server := (datasource "config").server }} {{- $dataDir := $server.data | default "/var/opt/csghub/server" }} -{{- $configFile := printf "%s/config.toml" $dataDir }} +{{- $configDir := "/opt/csghub/service/server/etc" }} +{{- $configFile := printf "%s/config.toml" $configDir }} # Define constants readonly SERVER_BIN="/opt/csghub/embedded/bin/csghub-server" -readonly ENV_DIR="/opt/csghub/etc/server/env" +readonly ENV_DIR="/opt/csghub/service/server/env" # Build command arguments args=("start" "server" "-l" {{ $server.log.level | quote }}) diff --git a/opt/csghub/embedded/sv/temporal/templates/pre-start.sample b/opt/csghub/embedded/sv/temporal/templates/pre-start.sample index 4a37df54..0f8d31da 100755 --- a/opt/csghub/embedded/sv/temporal/templates/pre-start.sample +++ b/opt/csghub/embedded/sv/temporal/templates/pre-start.sample @@ -7,7 +7,7 @@ exec 2>&1 set -e {{- $dataDir := (datasource "config").temporal.data | default "/var/opt/csghub/temporal" }} -{{- $envDir := printf "%s/env" $dataDir }} +{{- $envDir := "/opt/csghub/service/temporal/env" }} # Clear all environment variable files # rm -rf {{ $envDir }}/* || true @@ -41,4 +41,4 @@ set -e # Load local sql scripts cd /opt/csghub/service/temporal -[ -x "/opt/csghub/etc/csghub/scripts/pg_executor" ] && chpst -e {{ $envDir }} /opt/csghub/etc/csghub/scripts/pg_executor +[ -x "/opt/csghub/embedded/etc/csghub/scripts/pg_executor" ] && chpst -e {{ $envDir }} /opt/csghub/embedded/etc/csghub/scripts/pg_executor diff --git a/opt/csghub/embedded/sv/temporal/templates/run.sample b/opt/csghub/embedded/sv/temporal/templates/run.sample index a1a7924a..383b159d 100755 --- a/opt/csghub/embedded/sv/temporal/templates/run.sample +++ b/opt/csghub/embedded/sv/temporal/templates/run.sample @@ -8,22 +8,22 @@ if [ -x ./pre-start ]; then ./pre-start fi -: "${TEMPORAL_HOME:=/opt/csghub/etc/temporal}" +: "${TEMPORAL_HOME:=/opt/csghub/embedded/etc/temporal}" export TEMPORAL_HOME {{- $dataDir := (datasource "config").temporal.data | default "/var/opt/csghub/temporal" }} cd {{ $dataDir }} # Setup temporal database -chpst -e {{ $dataDir }}/env -P \ +chpst -e /opt/csghub/service/temporal/env -P \ -u temporal:temporal \ "${TEMPORAL_HOME}"/auto-setup.sh -exec chpst -e {{ $dataDir }}/env -P \ +exec chpst -e /opt/csghub/service/temporal/env -P \ -u temporal:temporal \ /opt/csghub/embedded/bin/temporal-server \ --allow-no-auth \ --env docker \ - --root {{ $dataDir }}/env \ - --config ../ \ + --root /opt/csghub/service/temporal \ + --config etc \ start \ No newline at end of file diff --git a/opt/csghub/embedded/sv/temporal_ui/templates/run.sample b/opt/csghub/embedded/sv/temporal_ui/templates/run.sample index e266c3da..3dfa6240 100755 --- a/opt/csghub/embedded/sv/temporal_ui/templates/run.sample +++ b/opt/csghub/embedded/sv/temporal_ui/templates/run.sample @@ -15,6 +15,6 @@ fi {{- $temporalDataDir := (datasource "config").temporal.data | default "/var/opt/csghub/temporal" }} cd {{ $dataDir }} exec chpst -P \ - -e /opt/csghub/etc/temporal_ui/env \ + -e /opt/csghub/service/temporal_ui/env \ -u temporal:temporal \ - /opt/csghub/embedded/bin/ui-server --env docker --root {{ $dataDir }}/env --config .. start + /opt/csghub/embedded/bin/ui-server --env docker --root /opt/csghub/service/temporal_ui --config etc/ start diff --git a/opt/csghub/embedded/sv/temporal_worker/templates/run.sample b/opt/csghub/embedded/sv/temporal_worker/templates/run.sample index 55a6fc5d..31ee0e1d 100755 --- a/opt/csghub/embedded/sv/temporal_worker/templates/run.sample +++ b/opt/csghub/embedded/sv/temporal_worker/templates/run.sample @@ -8,11 +8,12 @@ set -e {{- $server := (datasource "config").server }} {{- $dataDir := $server.data | default "/var/opt/csghub/server" }} -{{- $configFile := printf "%s/config.toml" $dataDir }} +{{- $configDir := "/opt/csghub/service/server/etc" }} +{{- $configFile := printf "%s/config.toml" $configDir }} # Define constants readonly SERVER_BIN="/opt/csghub/embedded/bin/csghub-server" -readonly ENV_DIR="/opt/csghub/etc/server/env" +readonly ENV_DIR="/opt/csghub/service/server/env" # Build command arguments args=("temporal-worker" "launch" "-l" {{ $server.log.level | quote }}) diff --git a/opt/csghub/embedded/sv/user/templates/run.sample b/opt/csghub/embedded/sv/user/templates/run.sample index 9f4cc44c..26228965 100755 --- a/opt/csghub/embedded/sv/user/templates/run.sample +++ b/opt/csghub/embedded/sv/user/templates/run.sample @@ -8,11 +8,12 @@ set -e {{- $server := (datasource "config").server }} {{- $dataDir := $server.data | default "/var/opt/csghub/server" }} -{{- $configFile := printf "%s/config.toml" $dataDir }} +{{- $configDir := "/opt/csghub/service/server/etc" }} +{{- $configFile := printf "%s/config.toml" $configDir }} # Define constants readonly SERVER_BIN="/opt/csghub/embedded/bin/csghub-server" -readonly ENV_DIR="/opt/csghub/etc/server/env" +readonly ENV_DIR="/opt/csghub/service/server/env" # Build command arguments args=("user" "launch" "-l" {{ $server.log.level | quote }}) diff --git a/packages/debian-based/DEBIAN/postinst b/packages/debian-based/DEBIAN/postinst index 1e2c002f..5043a868 100755 --- a/packages/debian-based/DEBIAN/postinst +++ b/packages/debian-based/DEBIAN/postinst @@ -81,7 +81,7 @@ case "$1" in if [ -n "$2" ]; then if [ ! -e /etc/csghub/csghub.yaml ]; then mkdir -p /etc/csghub || true - cp /opt/csghub/etc/csghub/templates/csghub/csghub.yaml.sample /etc/csghub/csghub.yaml + cp /opt/csghub/embedded/etc/csghub/templates/csghub.yaml.sample /etc/csghub/csghub.yaml fi fi @@ -90,11 +90,11 @@ case "$1" in create_symlinks "/opt/csghub/embedded/python/bin" "/opt/csghub/embedded/bin" echo "Copy systemd unit files." - cp -f /opt/csghub/etc/csghub/templates/system/csghub-runsvdir.service /etc/systemd/system/ + cp -f /opt/csghub/embedded/etc/csghub/csghub-runsvdir.service /etc/systemd/system/ echo "Copy configuration files." if [ ! -f "/etc/csghub/csghub.yaml" ]; then - cp -rf /opt/csghub/etc/csghub/templates/csghub /etc/csghub + cp -rf /opt/csghub/embedded/etc/csghub/templates /etc/csghub mv /etc/csghub/csghub.yaml.sample /etc/csghub/csghub.yaml fi diff --git a/packages/rhel-based/omnibus-csghub.spec b/packages/rhel-based/omnibus-csghub.spec index 68f64506..d1d5b390 100644 --- a/packages/rhel-based/omnibus-csghub.spec +++ b/packages/rhel-based/omnibus-csghub.spec @@ -33,7 +33,7 @@ mkdir -p %{buildroot}/etc/csghub mkdir -p %{buildroot}/opt/csghub cp -a %{_builddir}/opt/csghub/* %{buildroot}/opt/csghub/ -cp -a %{_builddir}/opt/csghub/etc/csghub/templates/system/csghub-runsvdir.service %{buildroot}/etc/systemd/system/ +cp -a %{_builddir}/opt/csghub/embedded/etc/csghub/csghub-runsvdir.service %{buildroot}/etc/systemd/system/ %pre #!/bin/sh @@ -52,7 +52,7 @@ done # Create central configuration file if [ ! -e /etc/csghub/csghub.yaml ]; then mkdir -p /etc/csghub || true - cp /opt/csghub/etc/csghub/templates/csghub/csghub.yaml.sample /etc/csghub/csghub.yaml + cp /opt/csghub/embedded/etc/csghub/templates/csghub.yaml.sample /etc/csghub/csghub.yaml fi # Enable and start service diff --git a/toolbox/csghub-ctl b/toolbox/csghub-ctl index 0196c2a7..21a8e149 160000 --- a/toolbox/csghub-ctl +++ b/toolbox/csghub-ctl @@ -1 +1 @@ -Subproject commit 0196c2a7570b7fe042c8c116cd16f5a59834674a +Subproject commit 21a8e14987bdd785c4ca94ec6343abb7cf33ce15