From ef46d5ed99f58c86a68aa2cdda7ba1dc1a518ecb Mon Sep 17 00:00:00 2001 From: hhyo Date: Thu, 22 Sep 2022 09:15:25 +0800 Subject: [PATCH] =?UTF-8?q?=E7=89=88=E6=9C=AC=E6=8F=90=E5=8D=87=E8=87=B3v1?= =?UTF-8?q?.9.0=EF=BC=8C=E6=9B=B4=E6=96=B0=E9=BB=98=E8=AE=A4env=E6=96=87?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.list | 14 +++++++++++++- .github/ISSUE_TEMPLATE/bug-report.yml | 2 +- archery/settings.py | 4 ++-- src/charts/values.yaml | 2 +- src/docker-compose/.env | 20 ++++++++++++++++++++ src/docker-compose/docker-compose.yml | 8 +++----- 6 files changed, 40 insertions(+), 10 deletions(-) create mode 100644 src/docker-compose/.env diff --git a/.env.list b/.env.list index 40b93c438b..620cf190bc 100644 --- a/.env.list +++ b/.env.list @@ -1,5 +1,17 @@ +# https://docs.djangoproject.com/zh-hans/4.1/ref/settings/ +DEBUG="false" DATABASE_URL="mysql://root:@127.0.0.1:3306/archery" CACHE_URL="redis://127.0.0.1:6379/0" -ENABLE_LDAP="true" + +# https://django-auth-ldap.readthedocs.io/en/latest/ +ENABLE_LDAP="false" AUTH_LDAP_ALWAYS_UPDATE_USER="true" AUTH_LDAP_USER_ATTR_MAP="username=cn,display=displayname,email=email" + +# https://docs.djangoproject.com/en/4.0/ref/settings/#csrf-trusted-origins +CSRF_TRUSTED_ORIGINS="http://127.0.0.1:9123" + +# https://django-q.readthedocs.io/en/latest/configure.html# +Q_CLUISTER_WORKERS=4 +Q_CLUISTER_TIMEOUT=60 +Q_CLUISTER_SYNC="false" diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index 350991dc11..83955dd569 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -44,7 +44,7 @@ body: attributes: label: 版本 description: 请告诉我们你正在使用的Archery版本 - placeholder: 1.8.5 + placeholder: 1.9.0 validations: required: true - type: dropdown diff --git a/archery/settings.py b/archery/settings.py index 311db52879..6caf3a39e7 100644 --- a/archery/settings.py +++ b/archery/settings.py @@ -168,9 +168,9 @@ # Django-Q Q_CLUSTER = { "name": "archery", - "workers": 4, + "workers": env("Q_CLUISTER_WORKERS", default=4), "recycle": 500, - "timeout": 60, + "timeout": env("Q_CLUISTER_TIMEOUT", default=60), "compress": True, "cpu_affinity": 1, "save_limit": 0, diff --git a/src/charts/values.yaml b/src/charts/values.yaml index 54cdb75072..2c86e6b7cc 100644 --- a/src/charts/values.yaml +++ b/src/charts/values.yaml @@ -6,7 +6,7 @@ replicaCount: 1 image: repository: hhyo/archery - tag: v1.8.5 + tag: v1.9.0 pullPolicy: IfNotPresent nameOverride: "" diff --git a/src/docker-compose/.env b/src/docker-compose/.env new file mode 100644 index 0000000000..f208aa77e7 --- /dev/null +++ b/src/docker-compose/.env @@ -0,0 +1,20 @@ +NGINX_PORT=9123 + +# https://docs.djangoproject.com/zh-hans/4.1/ref/settings/ +DEBUG="false" +NIDATABASE_URL="mysql://root:123456@mysql:3306/archery" +CACHE_URL="redis://redis:6379/0?PASSWORD=123456" + +# https://docs.djangoproject.com/en/4.0/ref/settings/#csrf-trusted-origins +CSRF_TRUSTED_ORIGINS="http://127.0.0.1:9123" + +# https://django-auth-ldap.readthedocs.io/en/latest/ +ENABLE_LDAP="false" +AUTH_LDAP_ALWAYS_UPDATE_USER="true" +AUTH_LDAP_USER_ATTR_MAP="username=cn,display=displayname,email=email" + +# https://django-q.readthedocs.io/en/latest/configure.html# +Q_CLUISTER_WORKERS=4 +Q_CLUISTER_TIMEOUT=60 +Q_CLUISTER_SYNC="false" + diff --git a/src/docker-compose/docker-compose.yml b/src/docker-compose/docker-compose.yml index 0904ec666f..7464cf4a27 100644 --- a/src/docker-compose/docker-compose.yml +++ b/src/docker-compose/docker-compose.yml @@ -32,7 +32,7 @@ services: - "./inception/config.toml:/etc/config.toml" archery: - image: hhyo/archery:v1.8.5 + image: hhyo/archery:v1.9.0 container_name: archery restart: always ports: @@ -46,7 +46,5 @@ services: - "./archery/logs:/opt/archery/logs" - "./archery/keys:/opt/archery/keys" entrypoint: "dockerize -wait tcp://mysql:3306 -wait tcp://redis:6379 -timeout 60s /opt/archery/src/docker/startup.sh" - environment: - NGINX_PORT: 9123 - DATABASE_URL: "mysql://root:123456@mysql:3306/archery" - CACHE_URL: "redis://redis:6379/0?PASSWORD=123456" + env_file: + - .env