Browse Source

:bug: fix laravel timer

Jeremy Zheng 2 years ago
parent
commit
de5e054991

+ 1 - 0
dashboard/.env.orig

@@ -13,3 +13,4 @@ REACT_APP_RPC_SERVER=https://rpc.wikipali.org
 REACT_APP_ASSETS_SERVER=https://assets.wikipali.org
 REACT_APP_API_SERVER=https://www.wikipali.org
 REACT_APP_ICP_CODE=
+REACT_APP_QUESTIONNAIRE_LINK=

+ 2 - 1
deploy/mint.yml

@@ -16,12 +16,13 @@
         REACT_APP_DEFAULT_LOCALE: "zh-Hans"
         REACT_APP_LANGUAGES: "en-US,zh-Hans,zh-Hant"
         REACT_APP_ENABLE_LOCAL_TOKEN: "true"
+        REACT_APP_TOKEN_KEY: "token.20230919"
         REACT_APP_DOCUMENTS_SERVER: "{{ app_documents_server }}"
         REACT_APP_RPC_SERVER: "{{ app_rpc_server }}"
         REACT_APP_ASSETS_SERVER: "{{ app_assets_server }}"
         REACT_APP_API_SERVER: "{{ app_api_server }}"
         REACT_ICP_CODE: "{{ app_icp_code }}"
-        REACT_APP_TOKEN_KEY: "token.20230919"
+        REACT_APP_QUESTIONNAIRE_LINK: "{{ app_questionnaire_link }}"
 
 - hosts:
     - php_fpm

+ 5 - 0
deploy/roles/mint-v2/tasks/main.yml

@@ -1,3 +1,8 @@
 - import_tasks: init.yml
 - import_tasks: laravel.yml
 - import_tasks: dashboard.yml
+
+- name: Force systemd to reread configs
+  become: true
+  systemd:
+    daemon_reload: yes

+ 1 - 0
deploy/roles/mint-v2/templates/v1/config.js.j2

@@ -1,6 +1,7 @@
 var ICP_CODE = "{{ app_icp_code }}"
 var RPC_SERVER = "{{ app_rpc_server }}";
 var DOCUMENTS_SERVER = "{{ app_documents_server }}"
+var REACT_APP_QUESTIONNAIRE_LINK = "{{ app_questionnaire_link }}"
 
 /*
   |---------------

+ 0 - 1
deploy/roles/mint-v2/templates/v2/env.j2

@@ -7,7 +7,6 @@ APP_ENV={{ app_deploy_env }}
 APP_KEY={{ app_secret_key }}
 APP_DEBUG=false
 APP_URL="https://{{ app_domain }}"
-DASHBOARD_URL="https://{{ app_domain }}/pcd"
 
 LOG_CHANNEL=stack
 LOG_DEPRECATIONS_CHANNEL=null

+ 2 - 1
deploy/roles/mint-v2/templates/v2/scheduler.service.j2

@@ -3,6 +3,7 @@ Description=Mint scheduler for {{ app_deploy_env }}
 
 [Service]
 Type=simple
+ExecStart=/usr/bin/php artisan schedule:run
+WorkingDirectory={{ app_deploy_root }}/htdocs
 User=www-data
 Group=www-data
-ExecStart=cd {{ app_deploy_root }}/htdocs && /usr/bin/php artisan schedule:run >> {{ app_deploy_root }}/logs/scheduler.log 2>&1

+ 2 - 1
deploy/roles/mint-v2/templates/v2/scheduler.timer.j2

@@ -2,8 +2,9 @@
 Description=Runs Mint mint-{{ app_deploy_env }} scheduler every minute
 
 [Timer]
+OnBootSec=15minutes
 OnUnitActiveSec=1minute
 Unit=mint-{{ app_deploy_env }}-scheduler.service
 
 [Install]
-WantedBy=multi-user.target
+WantedBy=timers.target