From f20b7953222565156b340175b6245cf025dd4f4e Mon Sep 17 00:00:00 2001 From: DarkSky Date: Thu, 11 Aug 2022 19:55:45 +0800 Subject: [PATCH 01/12] chore: arm64 images --- .github/workflows/affine.yml | 14 +++++++++++--- .vscode/settings.json | 1 + 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/affine.yml b/.github/workflows/affine.yml index a5c0eafe70..6ff463c6d2 100644 --- a/.github/workflows/affine.yml +++ b/.github/workflows/affine.yml @@ -33,23 +33,31 @@ jobs: uses: actions/checkout@v2 - name: Log in to the Container registry - uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 + uses: docker/login-action@v2 with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v1 + - name: Extract metadata (tags, labels) for Docker (AFFiNE-Local) id: meta_affine - uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 + uses: docker/metadata-action@v4 with: images: ${{ env.REGISTRY }}/${{ env.NAMESPACE }}/${{ env.AFFINE_IMAGE_NAME }} tags: ${{ env.IMAGE_TAG_LATEST }} - name: Build and push Docker image (AFFINE-Local) - uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc + uses: docker/build-push-action@v3 with: context: . + platforms: linux/amd64,linux/arm64/v8 file: ./.github/deployment/Dockerfile-affine push: ${{ github.ref == 'refs/heads/master' && true || false }} tags: ${{ steps.meta_affine.outputs.tags }} diff --git a/.vscode/settings.json b/.vscode/settings.json index c3d35c66ff..28ff9ad821 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -7,6 +7,7 @@ "Backlinks", "blockdb", "booktitle", + "Buildx", "Cascader", "clsx", "cssmodule", From 7211dd026f0f2469715b628fb23ffb9f9348c7ec Mon Sep 17 00:00:00 2001 From: DarkSky Date: Thu, 11 Aug 2022 20:17:52 +0800 Subject: [PATCH 02/12] chore: arm64 images --- .github/deployment/Dockerfile-affine-multiplatform | 11 +++++++++++ .github/workflows/affine.yml | 12 ++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 .github/deployment/Dockerfile-affine-multiplatform diff --git a/.github/deployment/Dockerfile-affine-multiplatform b/.github/deployment/Dockerfile-affine-multiplatform new file mode 100644 index 0000000000..a794d7085c --- /dev/null +++ b/.github/deployment/Dockerfile-affine-multiplatform @@ -0,0 +1,11 @@ +FROM ghcr.io/toeverything/AFFiNE:relocate as relocate + +# ============= +# AFFiNE image +# ============= +FROM caddy:2.4.6-alpine as AFFiNE +WORKDIR /app +COPY --from=relocate /app . + +EXPOSE 3000 +CMD ["caddy", "run"] diff --git a/.github/workflows/affine.yml b/.github/workflows/affine.yml index 6ff463c6d2..2de1b651ba 100644 --- a/.github/workflows/affine.yml +++ b/.github/workflows/affine.yml @@ -57,9 +57,17 @@ jobs: uses: docker/build-push-action@v3 with: context: . - platforms: linux/amd64,linux/arm64/v8 file: ./.github/deployment/Dockerfile-affine + tags: relocate + target: AFFiNE + + - name: Build and push Docker image (AFFINE-Local) + uses: docker/build-push-action@v3 + with: + context: . + platforms: linux/amd64,linux/arm64/v8 + file: ./.github/deployment/Dockerfile-affine-multiplatform push: ${{ github.ref == 'refs/heads/master' && true || false }} tags: ${{ steps.meta_affine.outputs.tags }} labels: ${{ steps.meta_affine.outputs.labels }} - target: AFFiNE + target: AFFiNE \ No newline at end of file From f7925fca5a127aaf9698160dee44c6c8a69e468d Mon Sep 17 00:00:00 2001 From: DarkSky <25152247+darkskygit@users.noreply.github.com> Date: Thu, 11 Aug 2022 20:38:03 +0800 Subject: [PATCH 03/12] fix: ci --- .github/deployment/Dockerfile-affine-multiplatform | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/deployment/Dockerfile-affine-multiplatform b/.github/deployment/Dockerfile-affine-multiplatform index a794d7085c..47200ae8d8 100644 --- a/.github/deployment/Dockerfile-affine-multiplatform +++ b/.github/deployment/Dockerfile-affine-multiplatform @@ -1,4 +1,4 @@ -FROM ghcr.io/toeverything/AFFiNE:relocate as relocate +FROM ghcr.io/toeverything/affine:relocate as relocate # ============= # AFFiNE image From 4a75946baf2037ce0f163fafcfc4e6ea36cfa79f Mon Sep 17 00:00:00 2001 From: DarkSky <25152247+darkskygit@users.noreply.github.com> Date: Thu, 11 Aug 2022 20:47:25 +0800 Subject: [PATCH 04/12] fix: ci --- .github/workflows/affine.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/affine.yml b/.github/workflows/affine.yml index 2de1b651ba..02cb47411a 100644 --- a/.github/workflows/affine.yml +++ b/.github/workflows/affine.yml @@ -58,7 +58,7 @@ jobs: with: context: . file: ./.github/deployment/Dockerfile-affine - tags: relocate + tags: ghcr.io/toeverything/affine:relocate target: AFFiNE - name: Build and push Docker image (AFFINE-Local) @@ -70,4 +70,4 @@ jobs: push: ${{ github.ref == 'refs/heads/master' && true || false }} tags: ${{ steps.meta_affine.outputs.tags }} labels: ${{ steps.meta_affine.outputs.labels }} - target: AFFiNE \ No newline at end of file + target: AFFiNE From 0682bc1b06dcba4e947c5fb143d6add6f4549a43 Mon Sep 17 00:00:00 2001 From: DarkSky <25152247+darkskygit@users.noreply.github.com> Date: Thu, 11 Aug 2022 22:39:17 +0800 Subject: [PATCH 05/12] Update affine.yml --- .github/workflows/affine.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/affine.yml b/.github/workflows/affine.yml index 02cb47411a..62febad8c2 100644 --- a/.github/workflows/affine.yml +++ b/.github/workflows/affine.yml @@ -57,6 +57,7 @@ jobs: uses: docker/build-push-action@v3 with: context: . + load: true file: ./.github/deployment/Dockerfile-affine tags: ghcr.io/toeverything/affine:relocate target: AFFiNE From 8d6ded2fcc98ca22175af845816056341b5ee2db Mon Sep 17 00:00:00 2001 From: DarkSky Date: Thu, 11 Aug 2022 23:09:35 +0800 Subject: [PATCH 06/12] chore: ci --- .github/deployment/Dockerfile-affine-multiplatform | 2 +- .github/workflows/affine.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/deployment/Dockerfile-affine-multiplatform b/.github/deployment/Dockerfile-affine-multiplatform index 47200ae8d8..de0146219c 100644 --- a/.github/deployment/Dockerfile-affine-multiplatform +++ b/.github/deployment/Dockerfile-affine-multiplatform @@ -1,4 +1,4 @@ -FROM ghcr.io/toeverything/affine:relocate as relocate +FROM relocate as relocate # ============= # AFFiNE image diff --git a/.github/workflows/affine.yml b/.github/workflows/affine.yml index 62febad8c2..968550e922 100644 --- a/.github/workflows/affine.yml +++ b/.github/workflows/affine.yml @@ -59,7 +59,7 @@ jobs: context: . load: true file: ./.github/deployment/Dockerfile-affine - tags: ghcr.io/toeverything/affine:relocate + tags: relocate target: AFFiNE - name: Build and push Docker image (AFFINE-Local) From e4533e660148b04e662a2517428f37a876a30926 Mon Sep 17 00:00:00 2001 From: DarkSky Date: Thu, 11 Aug 2022 23:25:09 +0800 Subject: [PATCH 07/12] chore: ci --- .github/deployment/Dockerfile-affine-multiplatform | 4 +++- .github/workflows/affine.yml | 13 +++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/deployment/Dockerfile-affine-multiplatform b/.github/deployment/Dockerfile-affine-multiplatform index de0146219c..e005ca3ffd 100644 --- a/.github/deployment/Dockerfile-affine-multiplatform +++ b/.github/deployment/Dockerfile-affine-multiplatform @@ -1,4 +1,6 @@ -FROM relocate as relocate +ARG BASE_IMAGE=localhost:5000/toeverything/relocate:latest + +FROM ${BASE_IMAGE} as relocate # ============= # AFFiNE image diff --git a/.github/workflows/affine.yml b/.github/workflows/affine.yml index 968550e922..2e77314af3 100644 --- a/.github/workflows/affine.yml +++ b/.github/workflows/affine.yml @@ -19,6 +19,7 @@ env: NAMESPACE: toeverything AFFINE_IMAGE_NAME: AFFiNE IMAGE_TAG_LATEST: nightly-latest + LOCAL_CACHE: localhost:5000/toeverything/relocate:latest jobs: ligo-virgo: @@ -28,6 +29,12 @@ jobs: contents: read packages: write + services: + registry: + image: registry:2 + ports: + - 5000:5000 + steps: - name: Checkout uses: actions/checkout@v2 @@ -57,9 +64,9 @@ jobs: uses: docker/build-push-action@v3 with: context: . - load: true + push: true file: ./.github/deployment/Dockerfile-affine - tags: relocate + tags: ${{ env.LOCAL_CACHE }} target: AFFiNE - name: Build and push Docker image (AFFINE-Local) @@ -72,3 +79,5 @@ jobs: tags: ${{ steps.meta_affine.outputs.tags }} labels: ${{ steps.meta_affine.outputs.labels }} target: AFFiNE + build-args: | + BASE_IMAGE=${{ env.LOCAL_CACHE }} From 66fbdf7e74456f4d69bb6664c649eeed5ed7a92d Mon Sep 17 00:00:00 2001 From: DarkSky Date: Thu, 11 Aug 2022 23:38:45 +0800 Subject: [PATCH 08/12] chore: ci --- .github/workflows/affine.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/affine.yml b/.github/workflows/affine.yml index 2e77314af3..412516f177 100644 --- a/.github/workflows/affine.yml +++ b/.github/workflows/affine.yml @@ -52,6 +52,8 @@ jobs: - name: Set up Docker Buildx id: buildx uses: docker/setup-buildx-action@v1 + with: + driver-opts: network=host - name: Extract metadata (tags, labels) for Docker (AFFiNE-Local) id: meta_affine From ee797c929ef1b30fd0650f3cdd539b2d55bc87c5 Mon Sep 17 00:00:00 2001 From: DarkSky Date: Fri, 12 Aug 2022 20:05:27 +0800 Subject: [PATCH 09/12] fix: styles --- apps/venus/src/app/index.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/venus/src/app/index.tsx b/apps/venus/src/app/index.tsx index b40f3deee8..cd95682389 100644 --- a/apps/venus/src/app/index.tsx +++ b/apps/venus/src/app/index.tsx @@ -448,6 +448,7 @@ export function App() { textAlign: 'center', marginTop: '1.5em', marginBottom: '12vh!important', + rawGap: '1em', }} > From 4178005ebc621bb1d47be83ee944ff1a697721c5 Mon Sep 17 00:00:00 2001 From: DarkSky <25152247+darkskygit@users.noreply.github.com> Date: Sat, 13 Aug 2022 00:02:59 +0800 Subject: [PATCH 10/12] Update LayoutHeader.tsx --- libs/components/layout/src/header/LayoutHeader.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/components/layout/src/header/LayoutHeader.tsx b/libs/components/layout/src/header/LayoutHeader.tsx index 5118233907..18fa4c2a94 100644 --- a/libs/components/layout/src/header/LayoutHeader.tsx +++ b/libs/components/layout/src/header/LayoutHeader.tsx @@ -23,7 +23,7 @@ export const LayoutHeader = () => { const warningTips = useMemo(() => { if (!fsApiSupported()) { - return 'Your browser does not support the local storage feature, please upgrade to the latest version of Chrome or Edge browser'; + return 'Your browser does not support the local fs storage feature, please upgrade to the latest version of Chrome or Edge browser'; } else if (!isLocalWorkspace) { return 'You are in DEMO mode. Changes will NOT be saved unless you SYNC TO DISK'; } else { From 7a43efa9da16baa04bd72c464796cfaa01b86fb6 Mon Sep 17 00:00:00 2001 From: DarkSky <25152247+darkskygit@users.noreply.github.com> Date: Sat, 13 Aug 2022 00:13:23 +0800 Subject: [PATCH 11/12] Update LayoutHeader.tsx --- libs/components/layout/src/header/LayoutHeader.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/components/layout/src/header/LayoutHeader.tsx b/libs/components/layout/src/header/LayoutHeader.tsx index 18fa4c2a94..b9f93dd3ee 100644 --- a/libs/components/layout/src/header/LayoutHeader.tsx +++ b/libs/components/layout/src/header/LayoutHeader.tsx @@ -23,7 +23,7 @@ export const LayoutHeader = () => { const warningTips = useMemo(() => { if (!fsApiSupported()) { - return 'Your browser does not support the local fs storage feature, please upgrade to the latest version of Chrome or Edge browser'; + return 'You are in DEMO mode. Changes will NOT be saved, you can SYNC DATA TO DISK with the latest version of Chromium based browser like Chrome/Edge'; } else if (!isLocalWorkspace) { return 'You are in DEMO mode. Changes will NOT be saved unless you SYNC TO DISK'; } else { From 6514efb430cfa11907b0ba08e9524343a8d042c2 Mon Sep 17 00:00:00 2001 From: DarkSky <25152247+darkskygit@users.noreply.github.com> Date: Sat, 13 Aug 2022 17:59:46 +0800 Subject: [PATCH 12/12] Update LayoutHeader.tsx --- libs/components/layout/src/header/LayoutHeader.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/components/layout/src/header/LayoutHeader.tsx b/libs/components/layout/src/header/LayoutHeader.tsx index b9f93dd3ee..2bada5a362 100644 --- a/libs/components/layout/src/header/LayoutHeader.tsx +++ b/libs/components/layout/src/header/LayoutHeader.tsx @@ -23,9 +23,9 @@ export const LayoutHeader = () => { const warningTips = useMemo(() => { if (!fsApiSupported()) { - return 'You are in DEMO mode. Changes will NOT be saved, you can SYNC DATA TO DISK with the latest version of Chromium based browser like Chrome/Edge'; + return 'Welcome to the AFFiNE demo. To begin saving changes you can SYNC DATA TO DISK with the latest version of Chromium based browser like Chrome/Edge'; } else if (!isLocalWorkspace) { - return 'You are in DEMO mode. Changes will NOT be saved unless you SYNC TO DISK'; + return 'Welcome to the AFFiNE demo. To begin saving changes you can SYNC TO DISK.'; } else { return 'AFFiNE is under active development and the current version is UNSTABLE. Please DO NOT store information or data'; }