diff --git a/.github/workflows/deploy_test_web.yaml b/.github/workflows/deploy_test_web.yaml index bd5bd353ca..f4cc82fa80 100644 --- a/.github/workflows/deploy_test_web.yaml +++ b/.github/workflows/deploy_test_web.yaml @@ -65,8 +65,10 @@ jobs: SOURCE: "frontend/appflowy_web_app/dist frontend/appflowy_web_app/server.cjs frontend/appflowy_web_app/start.sh frontend/appflowy_web_app/Dockerfile frontend/appflowy_web_app/nginx.conf frontend/appflowy_web_app/.env nginx-signed.crt nginx-signed.key" REMOTE_HOST: ${{ env.REMOTE_HOST }} REMOTE_USER: ${{ env.REMOTE_USER }} + TARGET: /home/${{ env.REMOTE_USER }}/appflowy-web-app EXCLUDE: "frontend/appflowy_web_app/dist/, frontend/appflowy_web_app/node_modules/" SCRIPT_AFTER: | + cd appflowy-web-app docker build -t appflowy-web-app . docker rm -f appflowy-web-app || true - docker run -d -p 80:80 -p 443:443 --env-file .env --name appflowy-web-app appflowy-web-app + docker run -d -p 3000:3000 --env-file .env --name appflowy-web-app appflowy-web-app diff --git a/frontend/appflowy_web_app/Dockerfile b/frontend/appflowy_web_app/Dockerfile index b6e4be2e23..402a89e267 100644 --- a/frontend/appflowy_web_app/Dockerfile +++ b/frontend/appflowy_web_app/Dockerfile @@ -9,26 +9,17 @@ RUN bun install cheerio pino pino-pretty COPY . . -RUN addgroup --system nginx && \ - adduser --system --no-create-home --disabled-login --ingroup nginx nginx RUN apt-get clean && rm -rf /var/lib/apt/lists/* COPY dist/ /usr/share/nginx/html/ -COPY nginx.conf /etc/nginx/nginx.conf - -COPY nginx-signed.crt /etc/ssl/certs/nginx-signed.crt -COPY nginx-signed.key /etc/ssl/private/nginx-signed.key - -RUN chown -R nginx:nginx /etc/ssl/certs/nginx-signed.crt /etc/ssl/private/nginx-signed.key - COPY start.sh /app/start.sh RUN chmod +x /app/start.sh -EXPOSE 80 443 +EXPOSE 3000 CMD ["/app/start.sh"] diff --git a/frontend/appflowy_web_app/nginx.conf b/frontend/appflowy_web_app/nginx.conf index 729255a778..cad2257e61 100644 --- a/frontend/appflowy_web_app/nginx.conf +++ b/frontend/appflowy_web_app/nginx.conf @@ -38,7 +38,7 @@ http { # Existing server block for HTTP server { - listen 80; + listen 3000; server_name localhost; #server_name appflowy.com *.appflowy.com; diff --git a/frontend/appflowy_web_app/src/application/slate-yjs/plugins/withYjs.ts b/frontend/appflowy_web_app/src/application/slate-yjs/plugins/withYjs.ts index 837063fd1d..3b9f527087 100644 --- a/frontend/appflowy_web_app/src/application/slate-yjs/plugins/withYjs.ts +++ b/frontend/appflowy_web_app/src/application/slate-yjs/plugins/withYjs.ts @@ -75,7 +75,6 @@ export function withYjs( e.children = content.children; - console.log('initializeDocumentContent', doc.getMap(YjsEditorKey.data_section).toJSON(), e.children); Editor.normalize(editor, { force: true }); }; diff --git a/frontend/appflowy_web_app/src/application/slate-yjs/utils/convert.ts b/frontend/appflowy_web_app/src/application/slate-yjs/utils/convert.ts index 67defd6acc..954ad3518e 100644 --- a/frontend/appflowy_web_app/src/application/slate-yjs/utils/convert.ts +++ b/frontend/appflowy_web_app/src/application/slate-yjs/utils/convert.ts @@ -97,9 +97,11 @@ export function yDataToSlateContent({ export function yDocToSlateContent(doc: YDoc): Element | undefined { const sharedRoot = doc.getMap(YjsEditorKey.data_section) as YSharedRoot; + if (!sharedRoot || sharedRoot.size === 0) return; const document = sharedRoot.get(YjsEditorKey.document); const pageId = document.get(YjsEditorKey.page_id) as string; const blocks = document.get(YjsEditorKey.blocks) as YBlocks; + const meta = document.get(YjsEditorKey.meta) as YMeta; const childrenMap = meta.get(YjsEditorKey.children_map) as YChildrenMap; const textMap = meta.get(YjsEditorKey.text_map) as YTextMap;