瀏覽代碼

Merge branch 'master' into imprv/create-api-v3-get-revisions

itizawa 5 年之前
父節點
當前提交
41352f1e79
共有 5 個文件被更改,包括 56 次插入8 次删除
  1. 35 0
      .github/workflows/prerelease.yml
  2. 12 3
      .github/workflows/release.yml
  3. 5 1
      CHANGES.md
  4. 1 1
      package.json
  5. 3 3
      src/server/middlewares/certify-shared-file.js

+ 35 - 0
.github/workflows/prerelease.yml

@@ -0,0 +1,35 @@
+name: Pre Release
+
+on:
+  push:
+    branches:
+      - master
+
+jobs:
+  build-image-for-cache:
+
+    runs-on: ubuntu-latest
+
+    steps:
+    - uses: actions/checkout@v2
+
+    - name: Set up Docker Buildx
+      uses: crazy-max/ghaction-docker-buildx@v3
+
+    - name: Cache Docker layers
+      uses: actions/cache@v2
+      id: cache
+      with:
+        path: /tmp/.buildx-cache
+        key: ${{ runner.OS }}-buildx-${{ hashFiles('**/yarn.lock') }}-default
+        restore-keys: |
+          ${{ runner.os }}-buildx-
+
+    - name: Build Docker Image
+      run: |
+        docker buildx build \
+          --cache-from "type=local,src=/tmp/.buildx-cache" \
+          --cache-to "type=local,dest=/tmp/.buildx-cache" \
+          --platform linux/amd64 \
+          --load \
+          --file ./docker/Dockerfile .

+ 12 - 3
.github/workflows/release.yml

@@ -78,16 +78,25 @@ jobs:
       run: |
       run: |
         echo ${{ secrets. DOCKER_REGISTRY_PASSWORD }} | docker login --username wsmoogle --password-stdin
         echo ${{ secrets. DOCKER_REGISTRY_PASSWORD }} | docker login --username wsmoogle --password-stdin
 
 
+    - name: Cache Docker layers
+      uses: actions/cache@v2
+      id: cache
+      with:
+        path: /tmp/.buildx-cache
+        key: ${{ runner.OS }}-buildx-${{ hashFiles('**/yarn.lock') }}-${{ matrix.flavor }}
+        restore-keys: |
+          ${{ runner.OS }}-buildx-${{ hashFiles('**/yarn.lock') }}-
+          ${{ runner.OS }}-buildx-
+
     - name: Build Docker Image
     - name: Build Docker Image
       run: |
       run: |
-        CACHE_REF=weseek/growi-cache:4${{ env.SUFFIX }}
         docker buildx build \
         docker buildx build \
+          --cache-from "type=local,src=/tmp/.buildx-cache" \
+          --cache-to "type=local,dest=/tmp/.buildx-cache" \
           --tag growi${{ env.SUFFIX }} \
           --tag growi${{ env.SUFFIX }} \
           --build-arg flavor=${{ matrix.flavor }} \
           --build-arg flavor=${{ matrix.flavor }} \
           --platform linux/amd64 \
           --platform linux/amd64 \
           --load \
           --load \
-          --cache-from=type=registry,ref=$CACHE_REF \
-          --cache-to=type=registry,ref=$CACHE_REF,mode=max \
           --file ./docker/Dockerfile .
           --file ./docker/Dockerfile .
 
 
     - name: Docker Tags by SemVer
     - name: Docker Tags by SemVer

+ 5 - 1
CHANGES.md

@@ -1,9 +1,13 @@
 # CHANGES
 # CHANGES
 
 
-## v4.1.2-RC
+## v4.1.3-RC
 
 
 * Feature: Create/edit linker with GUI
 * Feature: Create/edit linker with GUI
 
 
+## v4.1.2
+
+* Fix: Uploaded images do not displayed
+    * Introduced by v4.1.1
 
 
 ## v4.1.1
 ## v4.1.1
 
 

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
 {
   "name": "growi",
   "name": "growi",
-  "version": "4.1.2-RC",
+  "version": "4.1.3-RC",
   "description": "Team collaboration software using markdown",
   "description": "Team collaboration software using markdown",
   "tags": [
   "tags": [
     "wiki",
     "wiki",

+ 3 - 3
src/server/middlewares/certify-shared-file.js

@@ -10,7 +10,7 @@ module.exports = (crowi) => {
     const { path } = url.parse(referer);
     const { path } = url.parse(referer);
 
 
     if (!path.startsWith('/share/')) {
     if (!path.startsWith('/share/')) {
-      next();
+      return next();
     }
     }
 
 
     const fileId = req.params.id || null;
     const fileId = req.params.id || null;
@@ -21,14 +21,14 @@ module.exports = (crowi) => {
     const attachment = await Attachment.findOne({ _id: fileId });
     const attachment = await Attachment.findOne({ _id: fileId });
 
 
     if (attachment == null) {
     if (attachment == null) {
-      next();
+      return next();
     }
     }
 
 
     const shareLinks = await ShareLink.find({ relatedPage: attachment.page });
     const shareLinks = await ShareLink.find({ relatedPage: attachment.page });
 
 
     // If sharelinks don't exist, skip it
     // If sharelinks don't exist, skip it
     if (shareLinks.length === 0) {
     if (shareLinks.length === 0) {
-      next();
+      return next();
     }
     }
 
 
     // Is there a valid share link
     // Is there a valid share link