Procházet zdrojové kódy

:bug: fix mint-v2 deploy

Jeremy Zheng před 2 roky
rodič
revize
1d8a30666f

+ 1 - 0
dashboard/.env.orig

@@ -7,6 +7,7 @@ PORT=20139
 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"
 REACT_APP_DOCUMENTS_SERVER=https://documents.wikipali.org
 REACT_APP_RPC_SERVER=https://rpc.wikipali.org
 REACT_APP_ASSETS_SERVER=https://assets.wikipali.org

+ 1 - 4
dashboard/public/index.html

@@ -5,10 +5,7 @@
     <link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
     <meta name="viewport" content="width=device-width, initial-scale=1" />
     <meta name="theme-color" content="#000000" />
-    <meta
-      name="description"
-      content="Web site created using create-react-app"
-    />
+    <meta name="description" content="IAPT Pali Canon Platform" />
     <link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
     <!--
       manifest.json provides metadata used when your web app is installed on a

+ 23 - 12
deploy/mint.yml

@@ -1,15 +1,26 @@
-# - name: "local compile"
-#   hosts: localhost
-#   connection: local
-#   tasks:
-#     - name: "install dashboard dependencies"
-#       ansible.builtin.shell:
-#         cmd: yarn install
-#         chdir: "{{ playbook_dir }}/../dashboard"
-#     - name: "build dashboard"
-#       ansible.builtin.shell:
-#         cmd: NODE_OPTIONS="--max_old_space_size=4096" PUBLIC_URL=/pcd yarn build
-#         chdir: "{{ playbook_dir }}/../dashboard"
+- name: "local compile"
+  hosts: localhost
+  connection: local
+  tasks:
+    - name: "install dashboard dependencies"
+      ansible.builtin.shell:
+        cmd: yarn install
+        chdir: "{{ playbook_dir }}/../dashboard"
+    - name: "build dashboard"
+      ansible.builtin.shell:
+        cmd: yarn build
+        chdir: "{{ playbook_dir }}/../dashboard"
+      environment:
+        NODE_OPTIONS: "--max_old_space_size=4096"
+        PUBLIC_URL: /pcd
+        REACT_APP_DEFAULT_LOCALE: "zh-Hans"
+        REACT_APP_LANGUAGES: "en-US,zh-Hans,zh-Hant"
+        REACT_APP_ENABLE_LOCAL_TOKEN: "true"
+        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_APP_TOKEN_KEY: "token.20230919"
 
 - hosts: www
   roles:

+ 2 - 2
deploy/roles/mint-v2/tasks/laravel.yml

@@ -23,7 +23,7 @@
     dest: "{{ app_deploy_root }}/htdocs/.env"
     owner: www-data
     group: www-data
-    mode: "0400"
+    mode: "0444"
 
 - name: upload config.php(v1)
   become: true
@@ -32,7 +32,7 @@
     dest: "{{ app_deploy_root }}/htdocs/public/app/config.php"
     owner: www-data
     group: www-data
-    mode: "0400"
+    mode: "0444"
 
 - name: upload config.js(v1)
   become: true

+ 1 - 1
deploy/roles/mint-v2/tasks/main.yml

@@ -1,3 +1,3 @@
 - import_tasks: init.yml
 - import_tasks: laravel.yml
-# - import_tasks: dashboard.yml
+- import_tasks: dashboard.yml