Compare commits
133
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3be12a45c6 | ||
|
|
fba139fdec | ||
|
|
e0dd0e4348 | ||
|
|
710bdf380a | ||
|
|
7b83f36060 | ||
|
|
2a23956a8b | ||
|
|
9269643c0e | ||
|
|
6c8fe4ebf7 | ||
|
|
037ac76d26 | ||
|
|
9faaefa83a | ||
|
|
85700efcd1 | ||
|
|
91a8c76bdb | ||
|
|
88e2780a54 | ||
|
|
60fcb2e214 | ||
|
|
c8224fd434 | ||
|
|
69433426be | ||
|
|
9015eec558 | ||
|
|
5129853267 | ||
|
|
a669541b13 | ||
|
|
c0c15f8cab | ||
|
|
2e377bde67 | ||
|
|
703bbe1113 | ||
|
|
1347e3607d | ||
|
|
9e2a79d0f2 | ||
|
|
841dd9b948 | ||
|
|
887796c36d | ||
|
|
02c52130bb | ||
|
|
76a9cb8042 | ||
|
|
b5f843e99b | ||
|
|
be21f76688 | ||
|
|
d90dfa7085 | ||
|
|
f7453530f6 | ||
|
|
29c01920f8 | ||
|
|
0ffb415e89 | ||
|
|
cc8c1c883f | ||
|
|
90d58ae47d | ||
|
|
05fe0cf8fd | ||
|
|
b9077d96d8 | ||
|
|
de0ffcc1e5 | ||
|
|
db46163971 | ||
|
|
9143307b70 | ||
|
|
fc02922968 | ||
|
|
4b35a609ea | ||
|
|
08914a21a6 | ||
|
|
c4a6948a67 | ||
|
|
17d052ee50 | ||
|
|
07a1dbf9c3 | ||
|
|
281a1f1b46 | ||
|
|
a3f23620cc | ||
|
|
ae7464d62e | ||
|
|
784c5ecc16 | ||
|
|
9056e6fd21 | ||
|
|
4402ca161b | ||
|
|
30ff89b1de | ||
|
|
6069640d49 | ||
|
|
e92060de7e | ||
|
|
a66ae6783d | ||
|
|
3fe6545ffd | ||
|
|
9f147b8329 | ||
|
|
3d2dc1a7de | ||
|
|
52891efd4e | ||
|
|
dbf40a3dcd | ||
|
|
aa047423f9 | ||
|
|
ed40259ebf | ||
|
|
2f1946e117 | ||
|
|
60b5b9eca0 | ||
|
|
4daf1331f8 | ||
|
|
87acc90e4d | ||
|
|
738b15268d | ||
|
|
dc33f20fee | ||
|
|
6c278bf2ee | ||
|
|
9e984d5ef3 | ||
|
|
018df1c0f5 | ||
|
|
6292da31c9 | ||
|
|
69b4423300 | ||
|
|
015c67e9e6 | ||
|
|
a0fd651d67 | ||
|
|
dd7c7fce58 | ||
|
|
d8983b8163 | ||
|
|
83cc6fc95e | ||
|
|
146f08513c | ||
|
|
21dd288ac4 | ||
|
|
cdad61175d | ||
|
|
951f45f54e | ||
|
|
44a46faae0 | ||
|
|
5701e03c52 | ||
|
|
12ff0e1fcf | ||
|
|
09717f094f | ||
|
|
cb7fc967a9 | ||
|
|
deaf4b6389 | ||
|
|
51eb6039b1 | ||
|
|
02c3df5503 | ||
|
|
3148d79bfa | ||
|
|
56cf1baaa2 | ||
|
|
db41580800 | ||
|
|
f6505f57c3 | ||
|
|
2e3eb33c20 | ||
|
|
80faeabaad | ||
|
|
533b0d011b | ||
|
|
5d9d80b45b | ||
|
|
a700f0cccc | ||
|
|
0642bb1514 | ||
|
|
c6a91cdbfc | ||
|
|
4712c7c619 | ||
|
|
13abed9072 | ||
|
|
26f0bef804 | ||
|
|
7349dda508 | ||
|
|
b99e8ff0a7 | ||
|
|
d54974677e | ||
|
|
e1a0f3a1b2 | ||
|
|
1ba86e6437 | ||
|
|
13583aba0f | ||
|
|
3e3bb41132 | ||
|
|
d58071bbd9 | ||
|
|
709b9ac0e4 | ||
|
|
a19f8dac48 | ||
|
|
180282bb5d | ||
|
|
ea160dc90f | ||
|
|
862d7e1e44 | ||
|
|
73b26532fe | ||
|
|
4bf1e3ea5e | ||
|
|
6d8bd29cef | ||
|
|
d857d272d3 | ||
|
|
e76a9668e9 | ||
|
|
9b3bec759d | ||
|
|
0a97a84c23 | ||
|
|
560384b05d | ||
|
|
e27876e155 | ||
|
|
237f593ee0 | ||
|
|
d15fa7486e | ||
|
|
44b4830d55 | ||
|
|
f2a4430937 | ||
|
|
29392cea9c |
No files matched your search
@@ -12,7 +12,7 @@ jobs:
|
||||
outputs:
|
||||
docs-only: ${{ steps.check.outputs.docs-only }}
|
||||
steps:
|
||||
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
@@ -56,13 +56,13 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 60
|
||||
steps:
|
||||
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
- uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
|
||||
with:
|
||||
go-version-file: go.mod
|
||||
cache: true
|
||||
|
||||
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
||||
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
||||
with:
|
||||
node-version: "24"
|
||||
|
||||
@@ -122,7 +122,7 @@ jobs:
|
||||
exit $FAILED
|
||||
|
||||
- name: Trivy scan
|
||||
uses: aquasecurity/trivy-action@57a97c7e7821a5776cebc9bb87c984fa69cba8f1 # v0.35.0
|
||||
uses: aquasecurity/trivy-action@ed142fd0673e97e23eac54620cfb913e5ce36c25 # v0.36.0
|
||||
with:
|
||||
scan-type: fs
|
||||
format: table
|
||||
@@ -141,7 +141,9 @@ jobs:
|
||||
make ci-golangci-lint > /tmp/golangci-lint.log 2>&1 & PIDS=($!)
|
||||
( ENABLE_VIPS=true make -C ocis build-debug \
|
||||
&& mv ocis/bin/ocis-debug ocis/bin/ocis ) > /tmp/ocis-build.log 2>&1 & PIDS+=($!)
|
||||
make test > /tmp/unit-tests.log 2>&1 & PIDS+=($!)
|
||||
make test > /tmp/unit-tests.log 2>&1 & PIDS+=($!)
|
||||
# vips-tagged files live only under thumbnails; scoped run, no coverprofile.
|
||||
go test -v -tags 'enable_vips' ./services/thumbnails/... > /tmp/unit-tests-vips.log 2>&1 & PIDS+=($!)
|
||||
GOWORK=off make -C tests/ociswrapper build > /tmp/ociswrapper-build.log 2>&1 & PIDS+=($!)
|
||||
|
||||
FAILED=0
|
||||
@@ -158,11 +160,12 @@ jobs:
|
||||
echo "=== ocis build ===" && cat /tmp/ocis-build.log
|
||||
echo "=== ociswrapper build ===" && cat /tmp/ociswrapper-build.log
|
||||
echo "=== unit tests ===" && cat /tmp/unit-tests.log
|
||||
echo "=== vips unit tests ===" && cat /tmp/unit-tests-vips.log
|
||||
|
||||
exit $FAILED
|
||||
|
||||
- name: Upload build artifacts
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
||||
with:
|
||||
name: ocis-build-artifacts
|
||||
path: |
|
||||
@@ -226,7 +229,7 @@ jobs:
|
||||
- apiCollaboration
|
||||
- apiVault
|
||||
steps:
|
||||
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
|
||||
- uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2.37.2
|
||||
with:
|
||||
@@ -277,7 +280,7 @@ jobs:
|
||||
'
|
||||
|
||||
- name: Download build artifacts
|
||||
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
|
||||
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
||||
with:
|
||||
name: ocis-build-artifacts
|
||||
|
||||
@@ -291,7 +294,7 @@ jobs:
|
||||
|
||||
- name: Upload raw coverage data
|
||||
if: always()
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
||||
with:
|
||||
name: api-coverage-${{ matrix.suite }}
|
||||
path: ${{ env.GOCOVERDIR }}
|
||||
@@ -310,7 +313,7 @@ jobs:
|
||||
suite:
|
||||
- cliCommands,apiServiceAvailability # grouped: both need ClamAV + email services
|
||||
steps:
|
||||
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
|
||||
- uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2.37.2
|
||||
with:
|
||||
@@ -325,7 +328,7 @@ jobs:
|
||||
sudo NEEDRESTART_MODE=a apt-get install -y libvips42t64
|
||||
|
||||
- name: Download build artifacts
|
||||
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
|
||||
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
||||
with:
|
||||
name: ocis-build-artifacts
|
||||
|
||||
@@ -339,7 +342,7 @@ jobs:
|
||||
|
||||
- name: Upload raw coverage data
|
||||
if: always()
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
||||
with:
|
||||
name: api-coverage-cli-${{ matrix.suite }}
|
||||
path: ${{ env.GOCOVERDIR }}
|
||||
@@ -358,7 +361,7 @@ jobs:
|
||||
suite:
|
||||
- apiGraphUser,apiGraph,apiGraphGroup
|
||||
steps:
|
||||
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
|
||||
- uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2.37.2
|
||||
with:
|
||||
@@ -373,7 +376,7 @@ jobs:
|
||||
sudo NEEDRESTART_MODE=a apt-get install -y libvips42t64
|
||||
|
||||
- name: Download build artifacts
|
||||
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
|
||||
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
||||
with:
|
||||
name: ocis-build-artifacts
|
||||
|
||||
@@ -387,7 +390,7 @@ jobs:
|
||||
|
||||
- name: Upload raw coverage data
|
||||
if: always()
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
||||
with:
|
||||
name: api-coverage-ldap-pool-${{ matrix.suite }}
|
||||
path: ${{ env.GOCOVERDIR }}
|
||||
@@ -414,7 +417,7 @@ jobs:
|
||||
- "coreApiWebdavProperties"
|
||||
- "coreApiWebdavMove1,coreApiWebdavPreviews,coreApiWebdavUpload,coreApiWebdavUploadTUS"
|
||||
steps:
|
||||
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
|
||||
- uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2.37.2
|
||||
with:
|
||||
@@ -465,7 +468,7 @@ jobs:
|
||||
'
|
||||
|
||||
- name: Download build artifacts
|
||||
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
|
||||
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
||||
with:
|
||||
name: ocis-build-artifacts
|
||||
|
||||
@@ -482,7 +485,7 @@ jobs:
|
||||
|
||||
- name: Upload raw coverage data
|
||||
if: always()
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
||||
with:
|
||||
name: api-coverage-core-${{ matrix.suite }}
|
||||
path: ${{ env.GOCOVERDIR }}
|
||||
@@ -530,8 +533,8 @@ jobs:
|
||||
args: "--type playwright --suites vault-storage"
|
||||
vault_storage: true
|
||||
steps:
|
||||
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
||||
with:
|
||||
# 24.16.0 breaks playwright install (yauzl zip extraction hangs); pin to last known good.
|
||||
# https://github.com/microsoft/playwright/issues/40724
|
||||
@@ -548,7 +551,7 @@ jobs:
|
||||
sudo NEEDRESTART_MODE=a apt-get install -y libvips42t64
|
||||
|
||||
- name: Download build artifacts
|
||||
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
|
||||
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
||||
with:
|
||||
name: ocis-build-artifacts
|
||||
|
||||
@@ -680,7 +683,7 @@ jobs:
|
||||
|
||||
- name: Upload tracing result
|
||||
if: failure()
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
||||
with:
|
||||
name: playwright-traces-${{ matrix.suite }}-${{ github.run_attempt }}
|
||||
path: web/reports/e2e
|
||||
@@ -688,7 +691,7 @@ jobs:
|
||||
|
||||
- name: Upload a11y result
|
||||
if: ${{ !cancelled() }}
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
||||
with:
|
||||
name: playwright-a11y-result-${{ matrix.suite }}-${{ github.run_attempt }}
|
||||
path: web/reports/e2e/a11y-report.json
|
||||
@@ -700,7 +703,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 120
|
||||
steps:
|
||||
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
|
||||
- name: Install libvips runtime
|
||||
run: |
|
||||
@@ -709,7 +712,7 @@ jobs:
|
||||
sudo NEEDRESTART_MODE=a apt-get install -y libvips42t64
|
||||
|
||||
- name: Download build artifacts
|
||||
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
|
||||
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
||||
with:
|
||||
name: ocis-build-artifacts
|
||||
|
||||
@@ -725,7 +728,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 120
|
||||
steps:
|
||||
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
|
||||
- name: Install libvips runtime
|
||||
run: |
|
||||
@@ -734,7 +737,7 @@ jobs:
|
||||
sudo NEEDRESTART_MODE=a apt-get install -y libvips42t64
|
||||
|
||||
- name: Download build artifacts
|
||||
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
|
||||
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
||||
with:
|
||||
name: ocis-build-artifacts
|
||||
|
||||
@@ -750,7 +753,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 120
|
||||
steps:
|
||||
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
|
||||
- name: Install libvips runtime
|
||||
run: |
|
||||
@@ -759,7 +762,7 @@ jobs:
|
||||
sudo NEEDRESTART_MODE=a apt-get install -y libvips42t64
|
||||
|
||||
- name: Download build artifacts
|
||||
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
|
||||
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
||||
with:
|
||||
name: ocis-build-artifacts
|
||||
|
||||
@@ -775,7 +778,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 120
|
||||
steps:
|
||||
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
|
||||
- name: Install libvips runtime
|
||||
run: |
|
||||
@@ -784,7 +787,7 @@ jobs:
|
||||
sudo NEEDRESTART_MODE=a apt-get install -y libvips42t64
|
||||
|
||||
- name: Download build artifacts
|
||||
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
|
||||
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
||||
with:
|
||||
name: ocis-build-artifacts
|
||||
|
||||
@@ -800,13 +803,13 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 120
|
||||
steps:
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
|
||||
with:
|
||||
go-version-file: go.mod
|
||||
cache: true
|
||||
|
||||
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
|
||||
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
||||
with:
|
||||
node-version: "24"
|
||||
|
||||
@@ -833,13 +836,13 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 120
|
||||
steps:
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
|
||||
with:
|
||||
go-version-file: go.mod
|
||||
cache: true
|
||||
|
||||
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
|
||||
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
||||
with:
|
||||
node-version: "24"
|
||||
|
||||
@@ -860,20 +863,20 @@ jobs:
|
||||
|
||||
acceptance-coverage:
|
||||
name: acceptance-coverage
|
||||
needs: [local-api-tests, cli-tests, ldap-pool-tests, core-api-tests]
|
||||
if: always() && github.event_name == 'pull_request'
|
||||
needs: [detect-changes, local-api-tests, cli-tests, ldap-pool-tests, core-api-tests]
|
||||
if: always() && github.event_name == 'pull_request' && needs.detect-changes.outputs.docs-only != 'true'
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
GOCOVERDIR: ${{ github.workspace }}/coverage-reports
|
||||
steps:
|
||||
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
- uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
|
||||
with:
|
||||
go-version-file: go.mod
|
||||
cache: true
|
||||
|
||||
- name: Download raw coverage data
|
||||
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
|
||||
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
||||
with:
|
||||
pattern: api-coverage-*
|
||||
path: ${{ env.GOCOVERDIR }}
|
||||
|
||||
@@ -10,7 +10,7 @@ jobs:
|
||||
timeout-minutes: 15
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
|
||||
- name: Install REUSE tool
|
||||
run: pip install reuse
|
||||
|
||||
@@ -3,7 +3,7 @@ name: Test Deployment Examples
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: "0 0 * * *" # every day at 00:00 UTC
|
||||
- cron: "0 1 * * *"
|
||||
|
||||
jobs:
|
||||
test:
|
||||
@@ -34,7 +34,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout ocis repo
|
||||
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
repository: owncloud/ocis
|
||||
|
||||
|
||||
+362
-34
@@ -10,7 +10,10 @@ env:
|
||||
PHP_VERSION: "8.4"
|
||||
K3D_VERSION: "v5.8.3"
|
||||
HELM_VERSION: "v3.18.4"
|
||||
TEST_SERVER_DOMAIN: ocis-server
|
||||
FED_SERVER_DOMAIN: federation-ocis-server
|
||||
TEST_SERVER_URL: https://ocis-server
|
||||
FED_SERVER_URL: https://federation-ocis-server
|
||||
STORAGE_DRIVER: ocis
|
||||
OCIS_WRAPPER_URL: http://localhost:5200
|
||||
K8S: true
|
||||
@@ -34,12 +37,12 @@ jobs:
|
||||
- suite: apiContract
|
||||
- suite: apiLocks
|
||||
- suite: apiSettings
|
||||
# - suite: apiNotification
|
||||
- suite: apiNotification
|
||||
- suite: apiCors
|
||||
- suite: apiGraphUser
|
||||
- suite: apiGraph
|
||||
- suite: apiGraphGroup
|
||||
# - suite: apiSpaces
|
||||
- suite: apiSpaces
|
||||
- suite: apiSpacesShares
|
||||
- suite: apiSpacesDavOperation
|
||||
- suite: apiDownloads
|
||||
@@ -49,22 +52,22 @@ jobs:
|
||||
- suite: apiActivities
|
||||
- suite: apiSearch1
|
||||
- suite: apiSearch2
|
||||
# - suite: apiSearchContent
|
||||
- suite: apiSearchContent
|
||||
- suite: apiSharingNgShares
|
||||
- suite: apiReshare
|
||||
- suite: apiSharingNgPermissions
|
||||
- suite: apiSharingNgAdditionalShareRole
|
||||
- suite: apiSharingNgDriveInvitation
|
||||
# - suite: apiSharingNgItemInvitation
|
||||
- suite: apiSharingNgItemInvitation
|
||||
- suite: apiSharingNgDriveLinkShare
|
||||
- suite: apiSharingNgItemLinkShare
|
||||
- suite: apiSharingNgLinkShareManagement
|
||||
- suite: apiAuthApp
|
||||
# - suite: apiAntivirus
|
||||
- suite: apiAntivirus
|
||||
- suite: apiOcm
|
||||
# - suite: apiCollaboration
|
||||
- suite: apiCollaboration
|
||||
- suite: apiVault
|
||||
# - suite: "coreApiAuth,coreApiCapabilities,coreApiFavorites,coreApiMain,coreApiVersions"
|
||||
- suite: "coreApiAuth,coreApiCapabilities,coreApiFavorites,coreApiMain,coreApiVersions"
|
||||
- suite: "coreApiShareManagementBasicToShares,coreApiShareManagementToShares"
|
||||
- suite: "coreApiSharees"
|
||||
- suite: "coreApiSharePublicLink2"
|
||||
@@ -72,14 +75,14 @@ jobs:
|
||||
- suite: "coreApiTrashbin,coreApiTrashbinRestore,coreApiWebdavEtagPropagation1,coreApiWebdavEtagPropagation2"
|
||||
- suite: "coreApiWebdavDelete,coreApiWebdavOperations,coreApiWebdavMove2"
|
||||
- suite: "coreApiWebdavProperties"
|
||||
# - suite: "coreApiWebdavMove1,coreApiWebdavPreviews,coreApiWebdavUpload,coreApiWebdavUploadTUS"
|
||||
- suite: "coreApiWebdavMove1,coreApiWebdavUpload,coreApiWebdavUploadTUS,coreApiWebdavPreviews"
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
|
||||
- name: Setup PHP ${{ env.PHP_VERSION }}
|
||||
uses: shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f # v2.37.0
|
||||
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2.37.2
|
||||
with:
|
||||
php-version: ${{ env.PHP_VERSION }}
|
||||
extensions: curl, xml, mbstring, zip, ldap, gd
|
||||
@@ -94,7 +97,7 @@ jobs:
|
||||
chmod +x k3d
|
||||
sudo mv k3d /usr/local/bin/
|
||||
k3d version
|
||||
|
||||
|
||||
- name: Install Helm
|
||||
run: |
|
||||
curl -fsSL -o helm-${{ env.HELM_VERSION }}-linux-amd64.tar.gz https://get.helm.sh/helm-${{ env.HELM_VERSION }}-linux-amd64.tar.gz
|
||||
@@ -104,7 +107,7 @@ jobs:
|
||||
|
||||
- name: Prepare hosts
|
||||
run: |
|
||||
echo "127.0.0.1 ocis-server clamav email collabora onlyoffice fakeoffice tika federation-ocis-server keycloak" \
|
||||
echo "127.0.0.1 $TEST_SERVER_DOMAIN clamav email collabora onlyoffice fakeoffice tika $FED_SERVER_DOMAIN keycloak" \
|
||||
| sudo tee -a /etc/hosts
|
||||
|
||||
- name: Spin up K3d Cluster
|
||||
@@ -180,11 +183,11 @@ jobs:
|
||||
|
||||
# patch the realm so the "web" client's redirect/origin URLs match
|
||||
# the k8s ingress domain instead of the non-k8s "localhost:9200" one
|
||||
sed 's|https://localhost:9200|https://ocis-server|g' \
|
||||
sed "s|https://localhost:9200|${TEST_SERVER_URL}|g" \
|
||||
tests/config/ci/ocis-mfa-ci-realm.dist.json > /tmp/ocis-realm.json
|
||||
|
||||
docker run -d --name keycloak --network host \
|
||||
-e OCIS_DOMAIN=https://ocis-server \
|
||||
-e OCIS_DOMAIN="$TEST_SERVER_URL" \
|
||||
-e KC_HOSTNAME=keycloak \
|
||||
-e KC_PORT=8443 \
|
||||
-e KC_DB=postgres \
|
||||
@@ -212,34 +215,99 @@ jobs:
|
||||
bash tests/config/k8s/expose-external-svc.sh keycloak:8443
|
||||
fi
|
||||
|
||||
if [[ "${{ matrix.suite }}" == "apiCollaboration" ]]; then
|
||||
# Start Collabora
|
||||
docker run -d \
|
||||
--name collabora \
|
||||
--network host \
|
||||
--entrypoint bash \
|
||||
-e DONT_GEN_SSL_CERT=set \
|
||||
-e "extra_params=--o:ssl.enable=true --o:ssl.termination=true --o:welcome.enable=false --o:net.frame_ancestors=https://127.0.0.1:9200" \
|
||||
collabora/code:25.04.7.3.1 \
|
||||
-c "coolconfig generate-proof-key && bash /start-collabora-online.sh"
|
||||
timeout 150 bash -c 'until curl -kfsSL https://localhost:9980/hosting/discovery > /dev/null; do sleep 5; done'
|
||||
echo "collabora ready."
|
||||
|
||||
# Start OnlyOffice
|
||||
docker run -d \
|
||||
--name onlyoffice \
|
||||
-p 7443:443 \
|
||||
-e WOPI_ENABLED=true \
|
||||
-e USE_UNAUTHORIZED_STORAGE=true \
|
||||
-v "$(pwd)/tests/config/ci/only-office.json:/tmp/local.json:ro" \
|
||||
--entrypoint /bin/sh \
|
||||
onlyoffice/documentserver:9.2.1 \
|
||||
-c "set -e
|
||||
cp /tmp/local.json /etc/onlyoffice/documentserver/local.json
|
||||
openssl req -x509 -newkey rsa:4096 -keyout onlyoffice.key -out onlyoffice.crt -sha256 -days 365 -batch -nodes
|
||||
mkdir -p /var/www/onlyoffice/Data/certs
|
||||
cp onlyoffice.key /var/www/onlyoffice/Data/certs/
|
||||
cp onlyoffice.crt /var/www/onlyoffice/Data/certs/
|
||||
chmod 400 /var/www/onlyoffice/Data/certs/onlyoffice.key
|
||||
/app/ds/run-document-server.sh"
|
||||
timeout 150 bash -c 'until curl -kfsSL https://localhost:7443/hosting/discovery > /dev/null; do sleep 5; done'
|
||||
echo "onlyoffice ready."
|
||||
|
||||
#Start FakeOffice
|
||||
docker run -d --name fakeoffice --network host \
|
||||
-v "$(pwd):/ocis:ro" \
|
||||
python:3-alpine \
|
||||
python3 -c "
|
||||
import http.server, pathlib
|
||||
body = pathlib.Path('/ocis/tests/config/ci/hosting-discovery.xml').read_bytes()
|
||||
class H(http.server.BaseHTTPRequestHandler):
|
||||
def do_GET(self):
|
||||
self.send_response(200)
|
||||
self.send_header('Content-Type', 'text/xml')
|
||||
self.end_headers()
|
||||
self.wfile.write(body)
|
||||
def log_message(self, *a): pass
|
||||
http.server.HTTPServer(('', 8080), H).serve_forever()
|
||||
"
|
||||
timeout 60 bash -c 'until curl -fsSL http://localhost:8080/hosting/discovery > /dev/null; do sleep 5; done'
|
||||
echo "fakeoffice ready."
|
||||
|
||||
bash tests/config/k8s/expose-external-svc.sh collabora:9980
|
||||
bash tests/config/k8s/expose-external-svc.sh onlyoffice:7443
|
||||
bash tests/config/k8s/expose-external-svc.sh fakeoffice:8080
|
||||
fi
|
||||
|
||||
- name: Deploy oCIS
|
||||
run: |
|
||||
cd tests/config/k8s
|
||||
kubectl get pods -n ocis-server -Aw &
|
||||
kubectl get pods -n "$TEST_SERVER_DOMAIN" -Aw &
|
||||
make deploy-ocis
|
||||
if [[ "${{ matrix.suite }}" == "apiOcm" ]]; then
|
||||
OCM=true make deploy-ocis
|
||||
fi
|
||||
|
||||
|
||||
- name: Expose node ports
|
||||
if: ${{ matrix.suite == 'apiCollaboration' }}
|
||||
run: |
|
||||
bash tests/config/k8s/expose-nodeports.sh collaboration-collabora 9300 30300
|
||||
bash tests/config/k8s/expose-nodeports.sh collaboration-fakeoffice 9300 30301
|
||||
bash tests/config/k8s/expose-nodeports.sh collaboration-onlyoffice 9300 30302
|
||||
bash tests/config/k8s/expose-nodeports.sh collaboration-fakeoffice 9304 30304
|
||||
|
||||
- name: Wait for oCIS to be ready
|
||||
env:
|
||||
FILE_URL: ${{ env.TEST_SERVER_URL }}/remote.php/dav/files/admin/hello1.txt
|
||||
run: |
|
||||
kubectl wait \
|
||||
--namespace ocis-server \
|
||||
--namespace "$TEST_SERVER_DOMAIN" \
|
||||
--for=condition=Available \
|
||||
deployment \
|
||||
--all \
|
||||
--timeout=10m
|
||||
|
||||
kubectl wait \
|
||||
--namespace ocis-server \
|
||||
--namespace "$TEST_SERVER_DOMAIN" \
|
||||
--for=condition=Ready \
|
||||
pod \
|
||||
--all \
|
||||
--timeout=10m
|
||||
|
||||
kubectl get pods -n ocis-server
|
||||
kubectl get pods -n "$TEST_SERVER_DOMAIN"
|
||||
|
||||
retry() {
|
||||
local label=$1
|
||||
@@ -263,7 +331,7 @@ jobs:
|
||||
# reached via port-forward since it isn't exposed by any Service.
|
||||
# local port 19205 (not 9205): 9100-9399 is already bound on the
|
||||
# host by the k3d loadbalancer's NodePort range, see create-cluster.
|
||||
kubectl -n ocis-server port-forward deployment/proxy 19205:9205 &
|
||||
kubectl -n "$TEST_SERVER_DOMAIN" port-forward deployment/proxy 19205:9205 &
|
||||
PORT_FORWARD_PID=$!
|
||||
trap 'kill $PORT_FORWARD_PID 2>/dev/null' EXIT
|
||||
|
||||
@@ -315,7 +383,7 @@ jobs:
|
||||
run: |
|
||||
(
|
||||
while true; do
|
||||
kubectl -n ocis-server port-forward deployment/proxy 19205:9205 >> /tmp/proxy-readyz-portforward.log 2>&1
|
||||
kubectl -n "$TEST_SERVER_DOMAIN" port-forward deployment/proxy 19205:9205 >> /tmp/proxy-readyz-portforward.log 2>&1
|
||||
sleep 1
|
||||
done
|
||||
) &
|
||||
@@ -330,18 +398,7 @@ jobs:
|
||||
--admin-username admin \
|
||||
--admin-password admin \
|
||||
--skip-ocis-run \
|
||||
-n ocis-server &
|
||||
|
||||
- name: Install Playwright for vault tests
|
||||
if: matrix.suite == 'apiVault'
|
||||
run: |
|
||||
composer install --no-progress
|
||||
composer bin behat install --no-progress
|
||||
vendor-php/bin/playwright-install
|
||||
vendor-php/bin/playwright-install --browsers
|
||||
env:
|
||||
COMPOSER_NO_INTERACTION: "1"
|
||||
COMPOSER_NO_AUDIT: "1"
|
||||
-n "$TEST_SERVER_DOMAIN" &
|
||||
|
||||
- name: Prepare expected failures
|
||||
if: startsWith( matrix.suite, 'core' )
|
||||
@@ -358,7 +415,7 @@ jobs:
|
||||
if: startsWith( matrix.suite, 'api' )
|
||||
env:
|
||||
TEST_SERVER_URL: ${{ env.TEST_SERVER_URL }}
|
||||
TEST_SERVER_FED_URL: https://federation-ocis-server
|
||||
TEST_SERVER_FED_URL: ${{ env.FED_SERVER_URL }}
|
||||
STORAGE_DRIVER: ${{ env.STORAGE_DRIVER }}
|
||||
BEHAT_SUITES: ${{ matrix.suite }}
|
||||
BEHAT_FILTER_TAGS: "~@skip&&~@skipOnGraph&&~@skipOnOcis-OCIS-Storage"
|
||||
@@ -386,3 +443,274 @@ jobs:
|
||||
WITH_REMOTE_PHP: "false"
|
||||
K8S: ${{ env.K8S }}
|
||||
run: make test-acceptance-api
|
||||
|
||||
e2e-tests:
|
||||
name: e2e-${{ matrix.suite }}-k8s
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 120
|
||||
|
||||
if: >-
|
||||
github.event_name == 'schedule' ||
|
||||
github.event_name == 'workflow_dispatch' ||
|
||||
(github.event_name == 'pull_request' &&
|
||||
contains(github.event.pull_request.title || '', 'k8s'))
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
# - suite: part-1
|
||||
# args: "--type playwright --total-parts 4 --xsuites search,app-provider,ocm,keycloak,mfa,oidc,vault-storage --run-part 1"
|
||||
- suite: part-2
|
||||
args: "--type playwright --total-parts 4 --xsuites search,app-provider,ocm,keycloak,mfa,oidc,vault-storage --run-part 2"
|
||||
# - suite: part-3
|
||||
# args: "--type playwright --total-parts 4 --xsuites search,app-provider,ocm,keycloak,mfa,oidc,vault-storage --run-part 3"
|
||||
# - suite: part-4
|
||||
# args: "--type playwright --total-parts 4 --xsuites search,app-provider,ocm,keycloak,mfa,oidc,vault-storage --run-part 4"
|
||||
# - suite: search
|
||||
# args: "--type playwright --suites search"
|
||||
# tika: true
|
||||
# - suite: keycloak
|
||||
# args: "--type playwright --suites journeys,keycloak"
|
||||
# keycloak: true
|
||||
# - suite: mfa
|
||||
# args: "--type playwright --suites mfa"
|
||||
# mfa: true
|
||||
# - suite: oidc
|
||||
# args: "--type playwright specs/oidc/refreshToken.spec.ts"
|
||||
# oidc: true
|
||||
# - suite: oidc-iframe
|
||||
# args: "--type playwright specs/oidc/iframeTokenRenewal.spec.ts"
|
||||
# oidc_iframe: true
|
||||
- suite: app-provider
|
||||
args: "--type playwright --suites app-provider"
|
||||
collaboration: true
|
||||
# - suite: ocm
|
||||
# args: "--type playwright --suites ocm"
|
||||
# federated: true
|
||||
# - suite: vault-storage
|
||||
# args: "--type playwright --suites vault-storage"
|
||||
# vault_storage: true
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
||||
with:
|
||||
# 24.16.0 breaks playwright install (yauzl zip extraction hangs); pin to last known good.
|
||||
# https://github.com/microsoft/playwright/issues/40724
|
||||
node-version: "24.15.0"
|
||||
|
||||
- name: Enable pnpm
|
||||
run: |
|
||||
corepack enable && corepack prepare pnpm@10.33.3 --activate
|
||||
pnpm config set store-dir ./.pnpm-store
|
||||
|
||||
- name: Cache Playwright Chromium
|
||||
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
||||
with:
|
||||
path: ~/.cache/ms-playwright
|
||||
key: playwright-chromium-${{ hashFiles('web/pnpm-lock.yaml') }}
|
||||
|
||||
- name: Download k3d
|
||||
run: |
|
||||
curl -L \
|
||||
-o k3d \
|
||||
https://github.com/k3d-io/k3d/releases/download/${{ env.K3D_VERSION }}/k3d-linux-amd64
|
||||
echo "dbaa79a76ace7f4ca230a1ff41dc7d8a5036a8ad0309e9c54f9bf3836dbe853e k3d" | sha256sum --check
|
||||
chmod +x k3d
|
||||
sudo mv k3d /usr/local/bin/
|
||||
k3d version
|
||||
|
||||
- name: Install Helm
|
||||
run: |
|
||||
curl -fsSL -o helm-${{ env.HELM_VERSION }}-linux-amd64.tar.gz https://get.helm.sh/helm-${{ env.HELM_VERSION }}-linux-amd64.tar.gz
|
||||
tar -zxvf helm-${{ env.HELM_VERSION }}-linux-amd64.tar.gz
|
||||
sudo mv linux-amd64/helm /usr/local/bin/helm
|
||||
helm version --short
|
||||
|
||||
- name: Prepare hosts
|
||||
run: |
|
||||
echo "127.0.0.1 $TEST_SERVER_DOMAIN clamav email collabora onlyoffice fakeoffice tika $FED_SERVER_DOMAIN keycloak" \
|
||||
| sudo tee -a /etc/hosts
|
||||
|
||||
- name: Spin up K3d Cluster
|
||||
run: make -C tests/config/k8s create-cluster
|
||||
|
||||
- name: Prepare Helm Charts
|
||||
env:
|
||||
ENABLE_WOPI: ${{ matrix.suite == 'app-provider' }}
|
||||
run: make -C tests/config/k8s prepare-charts
|
||||
|
||||
- name: Deploy Suite-Specific External Backends
|
||||
run: |
|
||||
if [[ "${{ matrix.suite }}" == "app-provider" ]]; then
|
||||
# Start Collabora
|
||||
docker run -d \
|
||||
--name collabora \
|
||||
--network host \
|
||||
--entrypoint bash \
|
||||
-e DONT_GEN_SSL_CERT=set \
|
||||
-e "extra_params=--o:ssl.enable=true --o:ssl.termination=true --o:welcome.enable=false --o:net.frame_ancestors=https://127.0.0.1:9200" \
|
||||
collabora/code:25.04.7.3.1 \
|
||||
-c "coolconfig generate-proof-key && bash /start-collabora-online.sh"
|
||||
timeout 150 bash -c 'until curl -kfsSL https://localhost:9980/hosting/discovery > /dev/null; do sleep 5; done'
|
||||
echo "collabora ready."
|
||||
|
||||
# Start OnlyOffice
|
||||
docker run -d \
|
||||
--name onlyoffice \
|
||||
-p 7443:443 \
|
||||
--add-host "$TEST_SERVER_DOMAIN:host-gateway" \
|
||||
-e WOPI_ENABLED=true \
|
||||
-e USE_UNAUTHORIZED_STORAGE=true \
|
||||
-v "$(pwd)/tests/config/ci/only-office.json:/tmp/local.json:ro" \
|
||||
--entrypoint /bin/sh \
|
||||
onlyoffice/documentserver:9.2.1 \
|
||||
-c "set -e
|
||||
cp /tmp/local.json /etc/onlyoffice/documentserver/local.json
|
||||
openssl req -x509 -newkey rsa:4096 -keyout onlyoffice.key -out onlyoffice.crt -sha256 -days 365 -batch -nodes
|
||||
mkdir -p /var/www/onlyoffice/Data/certs
|
||||
cp onlyoffice.key /var/www/onlyoffice/Data/certs/
|
||||
cp onlyoffice.crt /var/www/onlyoffice/Data/certs/
|
||||
chmod 400 /var/www/onlyoffice/Data/certs/onlyoffice.key
|
||||
/app/ds/run-document-server.sh"
|
||||
timeout 150 bash -c 'until curl -kfsSL https://localhost:7443/hosting/discovery > /dev/null; do sleep 5; done'
|
||||
echo "onlyoffice ready."
|
||||
|
||||
#Start FakeOffice
|
||||
docker run -d --name fakeoffice --network host \
|
||||
-v "$(pwd):/ocis:ro" \
|
||||
python:3-alpine \
|
||||
python3 -c "
|
||||
import http.server, pathlib
|
||||
body = pathlib.Path('/ocis/tests/config/ci/hosting-discovery.xml').read_bytes()
|
||||
class H(http.server.BaseHTTPRequestHandler):
|
||||
def do_GET(self):
|
||||
self.send_response(200)
|
||||
self.send_header('Content-Type', 'text/xml')
|
||||
self.end_headers()
|
||||
self.wfile.write(body)
|
||||
def log_message(self, *a): pass
|
||||
http.server.HTTPServer(('', 8080), H).serve_forever()
|
||||
"
|
||||
timeout 60 bash -c 'until curl -fsSL http://localhost:8080/hosting/discovery > /dev/null; do sleep 5; done'
|
||||
echo "fakeoffice ready."
|
||||
|
||||
bash tests/config/k8s/expose-external-svc.sh collabora:9980
|
||||
bash tests/config/k8s/expose-external-svc.sh onlyoffice:7443
|
||||
bash tests/config/k8s/expose-external-svc.sh fakeoffice:8080
|
||||
fi
|
||||
|
||||
- name: Deploy oCIS
|
||||
run: |
|
||||
cd tests/config/k8s
|
||||
kubectl get pods -n "$TEST_SERVER_DOMAIN" -Aw &
|
||||
make deploy-ocis
|
||||
|
||||
- name: Expose node ports
|
||||
if: ${{ matrix.suite == 'app-provider' }}
|
||||
run: |
|
||||
bash tests/config/k8s/expose-nodeports.sh collaboration-collabora 9300 30300
|
||||
bash tests/config/k8s/expose-nodeports.sh collaboration-fakeoffice 9300 30301
|
||||
bash tests/config/k8s/expose-nodeports.sh collaboration-onlyoffice 9300 30302
|
||||
bash tests/config/k8s/expose-nodeports.sh collaboration-fakeoffice 9304 30304
|
||||
|
||||
- name: Wait for oCIS to be ready
|
||||
env:
|
||||
FILE_URL: ${{ env.TEST_SERVER_URL }}/remote.php/dav/files/admin/hello1.txt
|
||||
run: |
|
||||
kubectl wait \
|
||||
--namespace "$TEST_SERVER_DOMAIN" \
|
||||
--for=condition=Available \
|
||||
deployment \
|
||||
--all \
|
||||
--timeout=10m
|
||||
|
||||
kubectl wait \
|
||||
--namespace "$TEST_SERVER_DOMAIN" \
|
||||
--for=condition=Ready \
|
||||
pod \
|
||||
--all \
|
||||
--timeout=10m
|
||||
|
||||
kubectl get pods -n "$TEST_SERVER_DOMAIN"
|
||||
|
||||
retry() {
|
||||
local label=$1
|
||||
shift
|
||||
for i in {1..30}; do
|
||||
if "$@"; then
|
||||
echo "$label succeeded"
|
||||
return 0
|
||||
fi
|
||||
echo "$label attempt $i failed, retrying in 10s..."
|
||||
sleep 10
|
||||
done
|
||||
echo "$label failed after 30 attempts"
|
||||
return 1
|
||||
}
|
||||
|
||||
echo "Creating test file in oCIS..."
|
||||
|
||||
request() {
|
||||
local method=$1
|
||||
shift
|
||||
curl -ks -o /dev/null -w "%{http_code}" \
|
||||
-X "$method" \
|
||||
-u admin:admin \
|
||||
"$@" \
|
||||
"$FILE_URL"
|
||||
}
|
||||
put_file() {
|
||||
request PUT \
|
||||
-H "Content-Type: text/plain" \
|
||||
--data "Hello from GitHub Actions!"
|
||||
}
|
||||
delete_file() {
|
||||
request DELETE
|
||||
}
|
||||
check_status() {
|
||||
local expected=$1
|
||||
shift
|
||||
status=$("$@")
|
||||
[ "$status" = "$expected" ]
|
||||
}
|
||||
echo "Creating test file..."
|
||||
retry "create file (HTTP 201)" check_status 201 put_file || exit 1
|
||||
echo "Deleting test file..."
|
||||
retry "delete file (HTTP 204)" check_status 204 delete_file || exit 1
|
||||
|
||||
- name: Run e2e ${{ matrix.suite }} tests
|
||||
env:
|
||||
E2E_ARGS: "${{ matrix.args }}"
|
||||
K8S: ${{ env.K8S }}
|
||||
TEST_SERVER_URL: ${{ env.TEST_SERVER_URL }}
|
||||
COLLABORATION_NEEDED: ${{ matrix.collaboration == true && 'true' || 'false' }}
|
||||
run: python3 tests/acceptance/run-e2e.py
|
||||
|
||||
- name: Upload Playwright traces
|
||||
if: failure()
|
||||
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
||||
with:
|
||||
name: playwright-traces-${{ matrix.suite }}-k8s-${{ github.run_attempt }}
|
||||
path: web/reports/e2e
|
||||
retention-days: 7
|
||||
|
||||
- name: Upload a11y result
|
||||
if: ${{ !cancelled() }}
|
||||
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
||||
with:
|
||||
name: playwright-a11y-result-${{ matrix.suite }}-k8s-${{ github.run_attempt }}
|
||||
path: web/reports/e2e/a11y-report.json
|
||||
retention-days: 7
|
||||
|
||||
- name: Upload oCIS logs
|
||||
if: always()
|
||||
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
||||
with:
|
||||
name: ocis-logs-${{ matrix.suite }}-k8s-${{ github.run_attempt }}
|
||||
path: tests/config/k8s/logs
|
||||
retention-days: 7
|
||||
@@ -26,10 +26,10 @@ jobs:
|
||||
working-directory: web
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
||||
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
||||
with:
|
||||
node-version: 24.15.0
|
||||
registry-url: "https://registry.npmjs.org"
|
||||
|
||||
+30
-200
@@ -14,11 +14,9 @@ on:
|
||||
default: ''
|
||||
|
||||
env:
|
||||
PRODUCTION_RELEASE_TAGS: '5.0,7,8'
|
||||
DOCKER_REPO_ROLLING: owncloud/ocis-rolling
|
||||
DOCKER_REPO_PRODUCTION: owncloud/ocis
|
||||
NODE_VERSION: '24'
|
||||
PNPM_VERSION: '10.28.1'
|
||||
GOLANG_BUILD_IMAGE: 'golang:1.26.8-alpine3.23@sha256:a8fa79c5bd40d880b52bd3b6d7669ecdcfd00e85facdd427d279efb5ddd79cb1'
|
||||
|
||||
jobs:
|
||||
determine-release-type:
|
||||
@@ -26,11 +24,9 @@ jobs:
|
||||
timeout-minutes: 10
|
||||
outputs:
|
||||
version: ${{ steps.info.outputs.version }}
|
||||
is_production: ${{ steps.info.outputs.is_production }}
|
||||
is_prerelease: ${{ steps.info.outputs.is_prerelease }}
|
||||
docker_repos: ${{ steps.info.outputs.docker_repos }}
|
||||
steps:
|
||||
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
if: ${{ github.ref_type == 'branch' || (github.event_name == 'workflow_dispatch' && inputs.version_override == '') }}
|
||||
with:
|
||||
fetch-depth: 0
|
||||
@@ -74,38 +70,25 @@ jobs:
|
||||
exit 1
|
||||
fi
|
||||
|
||||
IS_PRODUCTION=false
|
||||
for TAG in ${PRODUCTION_RELEASE_TAGS//,/ }; do
|
||||
[[ "$VERSION" == "$TAG"* ]] && IS_PRODUCTION=true && break
|
||||
done
|
||||
|
||||
[[ "$VERSION" == *"-"* ]] && IS_PRERELEASE=true || IS_PRERELEASE=false
|
||||
|
||||
if [[ "$IS_PRODUCTION" == "true" && "$IS_PRERELEASE" == "false" ]]; then
|
||||
REPOS=[\"$DOCKER_REPO_ROLLING\",\"$DOCKER_REPO_PRODUCTION\"]
|
||||
else
|
||||
REPOS=[\"$DOCKER_REPO_ROLLING\"]
|
||||
fi
|
||||
|
||||
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
||||
echo "is_production=$IS_PRODUCTION" >> $GITHUB_OUTPUT
|
||||
echo "is_prerelease=$IS_PRERELEASE" >> $GITHUB_OUTPUT
|
||||
echo "docker_repos=$REPOS" >> $GITHUB_OUTPUT
|
||||
|
||||
generate-code:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 60
|
||||
needs: [determine-release-type]
|
||||
steps:
|
||||
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
- uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
|
||||
with:
|
||||
go-version-file: go.mod
|
||||
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
||||
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
||||
with:
|
||||
node-version: ${{ env.NODE_VERSION }}
|
||||
- run: npm install --silent -g yarn npx --force
|
||||
- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v4
|
||||
- uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v4
|
||||
with:
|
||||
version: ${{ env.PNPM_VERSION }}
|
||||
- run: pnpm config set store-dir ./.pnpm-store && make ci-node-generate
|
||||
@@ -118,7 +101,7 @@ jobs:
|
||||
run: |
|
||||
VERSION="${{ needs.determine-release-type.outputs.version }}"
|
||||
sed -i "s/LatestTag = \".*\"/LatestTag = \"$VERSION\"/" ocis-pkg/version/version.go
|
||||
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
||||
with:
|
||||
name: generated-code
|
||||
path: |
|
||||
@@ -127,159 +110,6 @@ jobs:
|
||||
!web
|
||||
retention-days: 1
|
||||
|
||||
docker-build:
|
||||
if: false
|
||||
name: docker-build (${{ matrix.arch }}, ${{ matrix.repo }})
|
||||
runs-on: ${{ matrix.arch == 'amd64' && 'ubuntu-24.04' || 'ubuntu-24.04-arm' }}
|
||||
timeout-minutes: 120
|
||||
needs: [determine-release-type, generate-code, security-scan-trivy]
|
||||
strategy:
|
||||
matrix:
|
||||
arch: [amd64, arm64]
|
||||
repo: ${{ fromJSON(needs.determine-release-type.outputs.docker_repos) }}
|
||||
steps:
|
||||
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
||||
with:
|
||||
name: generated-code
|
||||
path: .
|
||||
- uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
|
||||
- uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0
|
||||
with:
|
||||
username: ${{ vars.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
- id: goversion
|
||||
uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
|
||||
with:
|
||||
go-version-file: go.mod
|
||||
- run: |
|
||||
ALPINE_VERSION=$(grep '^FROM.*alpine:' ocis/docker/Dockerfile.linux.${{ matrix.arch }} | grep -o 'alpine:[0-9.]*' | cut -d: -f2 | cut -d. -f1,2)
|
||||
docker run --rm \
|
||||
-v "${{ github.workspace }}:/workspace" \
|
||||
-w /workspace \
|
||||
"golang:${{ steps.goversion.outputs.go-version }}-alpine${ALPINE_VERSION}" \
|
||||
sh -c "apk add --no-cache bash gcc musl-dev vips-dev make git && \
|
||||
git config --global --add safe.directory /workspace && \
|
||||
CGO_ENABLED=1 ENABLE_VIPS=true VERSION=${{ needs.determine-release-type.outputs.version }} \
|
||||
make -C ocis release-linux-docker-${{ matrix.arch }}"
|
||||
- id: tags
|
||||
run: |
|
||||
VERSION="${{ needs.determine-release-type.outputs.version }}"
|
||||
REPO="${{ matrix.repo }}"
|
||||
ARCH="${{ matrix.arch }}"
|
||||
printf "tags<<EOF\n%s\nEOF\n" \
|
||||
"${REPO}:${VERSION}-linux-${ARCH}" >> $GITHUB_OUTPUT
|
||||
- id: build
|
||||
uses: docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294 # v7.0.0
|
||||
with:
|
||||
context: ocis
|
||||
file: ocis/docker/Dockerfile.linux.${{ matrix.arch }}
|
||||
platforms: linux/${{ matrix.arch }}
|
||||
load: true
|
||||
push: false
|
||||
provenance: false
|
||||
build-args: |
|
||||
REVISION=${{ github.sha }}
|
||||
VERSION=${{ needs.determine-release-type.outputs.version }}
|
||||
tags: ${{ steps.tags.outputs.tags }}
|
||||
- id: trivy
|
||||
uses: aquasecurity/trivy-action@57a97c7e7821a5776cebc9bb87c984fa69cba8f1 # v0.35.0
|
||||
continue-on-error: true
|
||||
with:
|
||||
image-ref: ${{ steps.tags.outputs.tags }}
|
||||
format: table
|
||||
exit-code: 1
|
||||
severity: HIGH,CRITICAL
|
||||
ignore-unfixed: true
|
||||
skip-files: /usr/bin/gomplate,/usr/bin/wait-for
|
||||
hide-progress: true
|
||||
env:
|
||||
TRIVY_IGNOREFILE: .trivyignore
|
||||
- name: Block on vulnerabilities
|
||||
if: steps.trivy.outcome == 'failure'
|
||||
run: |
|
||||
echo "::error title=Security scan blocked release::Image ${{ steps.tags.outputs.tags }} has HIGH or CRITICAL vulnerabilities (see Trivy report above). Fix all findings before releasing."
|
||||
exit 1
|
||||
- name: push
|
||||
if: steps.trivy.outcome == 'success'
|
||||
run: docker push ${{ steps.tags.outputs.tags }}
|
||||
|
||||
docker-scan:
|
||||
name: docker-scan (${{ matrix.arch }}, ${{ matrix.repo }})
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
needs: [determine-release-type, docker-build]
|
||||
strategy:
|
||||
matrix:
|
||||
arch: [amd64]
|
||||
repo: ${{ fromJSON(needs.determine-release-type.outputs.docker_repos) }}
|
||||
steps:
|
||||
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
- uses: aquasecurity/trivy-action@57a97c7e7821a5776cebc9bb87c984fa69cba8f1 # v0.35.0
|
||||
id: trivy
|
||||
continue-on-error: true
|
||||
with:
|
||||
image-ref: ${{ matrix.repo }}:${{ needs.determine-release-type.outputs.version }}-linux-${{ matrix.arch }}
|
||||
format: table
|
||||
exit-code: 1
|
||||
severity: HIGH,CRITICAL
|
||||
ignore-unfixed: true
|
||||
skip-files: /usr/bin/gomplate,/usr/bin/wait-for
|
||||
hide-progress: true
|
||||
env:
|
||||
TRIVY_IGNOREFILE: .trivyignore
|
||||
|
||||
- name: Block on vulnerabilities
|
||||
if: steps.trivy.outcome == 'failure'
|
||||
run: |
|
||||
echo "::error title=Security scan blocked release::Image ${{ matrix.repo }}:${{ needs.determine-release-type.outputs.version }}-linux-${{ matrix.arch }} has HIGH or CRITICAL vulnerabilities (see Trivy report above). Fix all findings before releasing."
|
||||
exit 1
|
||||
|
||||
docker-manifest:
|
||||
if: false
|
||||
name: docker-manifest (${{ matrix.repo }})
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
needs: [determine-release-type, docker-build, docker-scan]
|
||||
strategy:
|
||||
matrix:
|
||||
repo: ${{ fromJSON(needs.determine-release-type.outputs.docker_repos) }}
|
||||
steps:
|
||||
- uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0
|
||||
with:
|
||||
username: ${{ vars.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
- if: ${{ contains(matrix.repo, 'rolling') }}
|
||||
run: |
|
||||
docker buildx imagetools create \
|
||||
-t "${{ matrix.repo }}:${{ needs.determine-release-type.outputs.version }}" \
|
||||
"${{ matrix.repo }}:${{ needs.determine-release-type.outputs.version }}-linux-amd64" \
|
||||
"${{ matrix.repo }}:${{ needs.determine-release-type.outputs.version }}-linux-arm64"
|
||||
- if: ${{ !contains(matrix.repo, 'rolling') }}
|
||||
run: |
|
||||
docker buildx imagetools create \
|
||||
-t "${{ matrix.repo }}:${{ needs.determine-release-type.outputs.version }}" \
|
||||
"${{ matrix.repo }}:${{ needs.determine-release-type.outputs.version }}-linux-amd64" \
|
||||
"${{ matrix.repo }}:${{ needs.determine-release-type.outputs.version }}-linux-arm64"
|
||||
|
||||
docker-readme:
|
||||
if: false
|
||||
name: docker-readme (${{ matrix.repo }})
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
needs: [determine-release-type, docker-manifest]
|
||||
strategy:
|
||||
matrix:
|
||||
repo: ${{ fromJSON(needs.determine-release-type.outputs.docker_repos) }}
|
||||
steps:
|
||||
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
- uses: peter-evans/dockerhub-description@1b9a80c056b620d92cedb9d9b5a223409c68ddfa # v5.0.0
|
||||
with:
|
||||
username: ${{ vars.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
repository: ${{ matrix.repo }}
|
||||
readme-filepath: ocis/README.md
|
||||
|
||||
build-binaries:
|
||||
name: build-binaries (${{ matrix.os }})
|
||||
runs-on: ubuntu-latest
|
||||
@@ -289,12 +119,12 @@ jobs:
|
||||
matrix:
|
||||
os: [linux, darwin]
|
||||
steps:
|
||||
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
||||
with:
|
||||
name: generated-code
|
||||
path: .
|
||||
- uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
|
||||
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
|
||||
with:
|
||||
go-version-file: go.mod
|
||||
- run: |
|
||||
@@ -303,7 +133,7 @@ jobs:
|
||||
if [[ "${{ matrix.os }}" == "linux" ]]; then
|
||||
cp assets/End-User-License-Agreement-for-ownCloud-Infinite-Scale.pdf ocis/dist/release/
|
||||
fi
|
||||
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
||||
with:
|
||||
name: binaries-${{ matrix.os }}
|
||||
path: ocis/dist/release/*
|
||||
@@ -313,8 +143,8 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
steps:
|
||||
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
- uses: aquasecurity/trivy-action@57a97c7e7821a5776cebc9bb87c984fa69cba8f1 # v0.35.0
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- uses: aquasecurity/trivy-action@ed142fd0673e97e23eac54620cfb913e5ce36c25 # v0.36.0
|
||||
with:
|
||||
scan-type: fs
|
||||
format: table
|
||||
@@ -327,15 +157,15 @@ jobs:
|
||||
timeout-minutes: 60
|
||||
needs: [determine-release-type, generate-code]
|
||||
steps:
|
||||
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
||||
with:
|
||||
name: generated-code
|
||||
path: .
|
||||
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
||||
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
||||
with:
|
||||
node-version: ${{ env.NODE_VERSION }}
|
||||
- uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
|
||||
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
|
||||
with:
|
||||
go-version-file: go.mod
|
||||
- run: npm install --silent -g yarn npx "pnpm@$PNPM_VERSION" --force
|
||||
@@ -346,7 +176,7 @@ jobs:
|
||||
- run: make ci-node-check-licenses && make ci-node-save-licenses
|
||||
- run: make ci-go-check-licenses && make ci-go-save-licenses
|
||||
- run: tar -czf third-party-licenses.tar.gz -C third-party-licenses .
|
||||
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
||||
with:
|
||||
name: third-party-licenses
|
||||
path: third-party-licenses.tar.gz
|
||||
@@ -357,10 +187,10 @@ jobs:
|
||||
timeout-minutes: 15
|
||||
needs: [determine-release-type]
|
||||
steps:
|
||||
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
|
||||
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
|
||||
with:
|
||||
go-version-file: go.mod
|
||||
- run: |
|
||||
@@ -370,7 +200,7 @@ jobs:
|
||||
if [[ $(wc -l < ocis/dist/CHANGELOG.md) -lt 5 ]]; then
|
||||
echo "Development release — no release notes yet. See [unreleased changes](https://github.com/owncloud/ocis/tree/master/changelog/unreleased/)." > ocis/dist/CHANGELOG.md
|
||||
fi
|
||||
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
||||
with:
|
||||
name: changelog
|
||||
path: ocis/dist/CHANGELOG.md
|
||||
@@ -381,23 +211,23 @@ jobs:
|
||||
timeout-minutes: 30
|
||||
needs: [determine-release-type, build-binaries, license-check, generate-changelog, security-scan-trivy]
|
||||
steps:
|
||||
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
||||
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
||||
with:
|
||||
name: binaries-linux
|
||||
path: release-assets
|
||||
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
||||
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
||||
with:
|
||||
name: binaries-darwin
|
||||
path: release-assets
|
||||
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
||||
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
||||
with:
|
||||
name: third-party-licenses
|
||||
path: release-assets
|
||||
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
||||
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
||||
with:
|
||||
name: changelog
|
||||
path: .
|
||||
- uses: softprops/action-gh-release@718ea10b132b3b2eba29c1007bb80653f286566b # v3.0.1
|
||||
- uses: softprops/action-gh-release@efb35369e0ad2afab669f228072c1b0d510eae64 # v3.0.3
|
||||
with:
|
||||
tag_name: v${{ needs.determine-release-type.outputs.version }}
|
||||
name: v${{ needs.determine-release-type.outputs.version }}
|
||||
@@ -417,16 +247,16 @@ jobs:
|
||||
- generate-changelog
|
||||
- create-github-release
|
||||
steps:
|
||||
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
||||
with:
|
||||
name: binaries-linux
|
||||
path: release-assets
|
||||
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
||||
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
||||
with:
|
||||
name: binaries-darwin
|
||||
path: release-assets
|
||||
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
||||
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
||||
with:
|
||||
name: third-party-licenses
|
||||
path: release-assets
|
||||
|
||||
@@ -12,9 +12,10 @@ jobs:
|
||||
timeout-minutes: 5
|
||||
outputs:
|
||||
web-changed: ${{ steps.check.outputs.web-changed }}
|
||||
full-run: ${{ steps.check.outputs.full-run }}
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
@@ -23,16 +24,24 @@ jobs:
|
||||
env:
|
||||
PR_TITLE: ${{ github.event.pull_request.title }}
|
||||
run: |
|
||||
# full-run: push to master/stable-* or an explicit [full-ci] request always run
|
||||
# everything, unscoped - same as before Nx. A normal PR gets the affected-scoped
|
||||
# path instead (see web-build-test), since only those two cases actually need every
|
||||
# project checked.
|
||||
if [[ "${{ github.event_name }}" == "push" ]]; then
|
||||
echo "web-changed=true" >> "$GITHUB_OUTPUT"
|
||||
echo "full-run=true" >> "$GITHUB_OUTPUT"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if echo "$PR_TITLE" | grep -qi "\[full-ci\]"; then
|
||||
echo "web-changed=true" >> "$GITHUB_OUTPUT"
|
||||
echo "full-run=true" >> "$GITHUB_OUTPUT"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "full-run=false" >> "$GITHUB_OUTPUT"
|
||||
|
||||
CHANGED_FILES=$(git diff --name-only "${{ github.event.pull_request.base.sha }}" "${{ github.sha }}" 2>/dev/null || git diff --name-only HEAD~1)
|
||||
|
||||
WEB_CHANGED=false
|
||||
@@ -57,15 +66,18 @@ jobs:
|
||||
working-directory: web
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
# nx affected --base=<pr-base-sha> (used below) needs that commit present locally
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup pnpm
|
||||
uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
|
||||
uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0
|
||||
with:
|
||||
version: 10.33.3
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
||||
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
||||
with:
|
||||
node-version: 24.15.0
|
||||
cache: pnpm
|
||||
@@ -81,16 +93,34 @@ jobs:
|
||||
run: pnpm licenses:csv && pnpm licenses:save
|
||||
|
||||
- name: Check types
|
||||
# Whole-repo, unconditional: only 5/27 projects have a per-project typecheck target
|
||||
# (nx/vite's typecheck inference needs a project's own vite.config.ts, which most
|
||||
# web-app-* packages don't have), so `nx affected -t typecheck` can't safely stand
|
||||
# in for this yet.
|
||||
run: pnpm check:types
|
||||
|
||||
- name: Check format
|
||||
run: pnpm check:format
|
||||
|
||||
- name: Lint
|
||||
run: pnpm lint
|
||||
env:
|
||||
FULL_RUN: ${{ needs.detect-web-changes.outputs.full-run }}
|
||||
run: |
|
||||
if [[ "$FULL_RUN" == "true" ]]; then
|
||||
pnpm lint
|
||||
else
|
||||
pnpm exec nx affected -t lint --base="${{ github.event.pull_request.base.sha }}"
|
||||
fi
|
||||
|
||||
- name: Run unit tests
|
||||
run: pnpm test:unit --coverage
|
||||
env:
|
||||
FULL_RUN: ${{ needs.detect-web-changes.outputs.full-run }}
|
||||
run: |
|
||||
if [[ "$FULL_RUN" == "true" ]]; then
|
||||
pnpm test:unit --coverage
|
||||
else
|
||||
pnpm exec nx affected -t test --base="${{ github.event.pull_request.base.sha }}"
|
||||
fi
|
||||
|
||||
- name: Build
|
||||
run: pnpm build
|
||||
|
||||
@@ -19,7 +19,7 @@ jobs:
|
||||
container: golang:1.25-alpine
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v6
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
|
||||
|
||||
- name: Run CI Reporter
|
||||
working-directory: tools/ci-reporter
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ COPY --from=generate /ocis /ocis
|
||||
WORKDIR /ocis/ocis
|
||||
RUN make ci-go-generate build ENABLE_VIPS=true
|
||||
|
||||
FROM alpine:3.24.1
|
||||
FROM alpine:3.24.2
|
||||
|
||||
RUN apk add --no-cache attr ca-certificates curl mailcap tree \
|
||||
&& apk add --no-cache --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community "vips=8.18.2-r0" \
|
||||
|
||||
@@ -96,15 +96,6 @@ help:
|
||||
@echo
|
||||
@echo -e "${RED}You also should have a look at other available Makefiles:${RESET}"
|
||||
@echo
|
||||
@echo -e "${GREEN}oCIS:${RESET}\n"
|
||||
@echo -e "${PURPLE}\tdocs: https://owncloud.dev/ocis/ocis/build-docs/${RESET}\n"
|
||||
@echo -e "\tsee ./ocis/Makefile"
|
||||
@echo -e "\tor run ${YELLOW}make -C ocis help${RESET}"
|
||||
@echo
|
||||
@echo -e "${GREEN}Documentation:${RESET}\n"
|
||||
@echo -e "${PURPLE}\tdocs: https://owncloud.dev/ocis/build-docs/${RESET}\n"
|
||||
@echo -e "\trun ${YELLOW}make list | grep docs-\t\t${BLUE}note: run all docs command via this makefile${RESET}"
|
||||
@echo
|
||||
@echo -e "${GREEN}Testing with test suite in docker:${RESET}\n"
|
||||
@echo -e "${PURPLE}\tdocs: https://owncloud.dev/ocis/development/testing/#testing-with-test-suite-in-docker${RESET}\n"
|
||||
@echo -e "\tsee ./tests/acceptance/docker/Makefile"
|
||||
@@ -167,61 +158,6 @@ clean:
|
||||
$(MAKE) --no-print-directory -C $$mod clean || exit 1; \
|
||||
done
|
||||
|
||||
# generate the docs
|
||||
# intents and comments are intentional...
|
||||
.PHONY: docs-generate # 1. prepare docs
|
||||
docs-generate:
|
||||
@echo 'Empty folders first to only have those files that are generated without remnants.'
|
||||
find docs/services/_includes/ -type f \( -name "*" ! -name ".git*" \) -delete || exit 1
|
||||
|
||||
@echo 'Generate content from services.'
|
||||
@for mod in $(OCIS_MODULES); do \
|
||||
$(MAKE) --no-print-directory -C $$mod docs-generate || exit 1; \
|
||||
done
|
||||
|
||||
@$(MAKE) --no-print-directory -C docs docs-run-helpers || exit 1
|
||||
|
||||
# initialize the docs build environment
|
||||
@$(MAKE) --no-print-directory -C docs docs-init
|
||||
|
||||
# copy required resources into hugo/content
|
||||
.PHONY: docs-copy # 2. copy required doc resources
|
||||
docs-copy:
|
||||
@$(MAKE) --no-print-directory -C docs docs-copy
|
||||
|
||||
# the docs-build|serve commands requires that docs-init was run first for the required data to exists
|
||||
# create a docs build
|
||||
.PHONY: docs-build # 3. build prepared docs
|
||||
docs-build:
|
||||
@$(MAKE) --no-print-directory -C docs docs-build
|
||||
|
||||
# serve built docs with hugo
|
||||
.PHONY: docs-serve # serve the docs build
|
||||
docs-serve:
|
||||
@$(MAKE) --no-print-directory -C docs docs-serve
|
||||
|
||||
# clean up doc build artifacts
|
||||
.PHONY: docs-clean # clean all docs artifacts, must be run as sudo
|
||||
docs-clean:
|
||||
@$(MAKE) --no-print-directory -C docs docs-clean
|
||||
|
||||
# docs-local imitates the 3-step docs build pipeline (generate → copy → build)
|
||||
# locally without pushing. docs-hugo-drone-prep creates the ../hugo symlink required by
|
||||
# the Hugo Docker image (hugomods/hugo:base-0.129.0).
|
||||
# imitate a full docs build run locally without pushing to the web.
|
||||
# this can help identify uncaught issues when running `make docs-serve` only.
|
||||
.PHONY: docs-local # run all steps as drone would do it (1, 2, 3)
|
||||
docs-local:
|
||||
@$(MAKE) --no-print-directory docs-generate
|
||||
@$(MAKE) --no-print-directory docs-copy
|
||||
@$(MAKE) --no-print-directory docs-build
|
||||
|
||||
# prepare a link from the root to the hugo folder because the image requires it
|
||||
# note that on local building, the referenced container of inside the hugo/makefile is used
|
||||
.PHONY: docs-hugo-drone-prep # only used for drone !
|
||||
docs-hugo-drone-prep:
|
||||
@$(MAKE) --no-print-directory -C docs docs-hugo-drone-prep
|
||||
|
||||
.PHONY: check-env-var-annotations
|
||||
check-env-var-annotations:
|
||||
.make/check-env-var-annotations.sh
|
||||
@@ -245,6 +181,17 @@ go-mod-tidy:
|
||||
$(MAKE) --no-print-directory -C $$mod go-mod-tidy || exit 1; \
|
||||
done
|
||||
|
||||
# Opt in to vips-tagged sources: `ENABLE_VIPS=true
|
||||
# make test` compiles files behind `//go:build enable_vips` (e.g. thumbnails).
|
||||
TAGS ?=
|
||||
ifdef ENABLE_VIPS
|
||||
ifeq ($(strip $(TAGS)),)
|
||||
TAGS := enable_vips
|
||||
else
|
||||
TAGS := $(TAGS),enable_vips
|
||||
endif
|
||||
endif
|
||||
|
||||
.PHONY: test
|
||||
test:
|
||||
@go test -v -tags '$(TAGS)' -coverprofile coverage.out ./...
|
||||
|
||||
@@ -69,13 +69,15 @@ Use as URL `localhost:9200` and the user/password printed.
|
||||
|
||||
Infinite Scale allows the following ownCloud clients:
|
||||
|
||||
* [web](https://github.com/owncloud/web),
|
||||
* Web (bundled in this repository under [`web/`](web/)),
|
||||
* [Android](https://github.com/owncloud/android),
|
||||
* [iOS](https://github.com/owncloud/ios-app) and
|
||||
* [Desktop](https://github.com/owncloud/client/)
|
||||
|
||||
to synchronize and share file spaces with a scalable server backend based on [reva](https://reva.link/) using open and well-defined APIs like [WebDAV](http://www.webdav.org/) and [CS3](https://github.com/cs3org/cs3apis/).
|
||||
|
||||
The Web client used to live in the separate [owncloud/web](https://github.com/owncloud/web) repository; it is now developed in-tree here under [`web/`](web/) as part of a single-repo product (backend + web frontend). `owncloud/web` is archived and kept only as the historical record up to its final release; file web-related issues and contributions in this repository instead.
|
||||
|
||||
### Web Office Applications
|
||||
|
||||
Infinite Scale can integrate web office applications such as:
|
||||
@@ -166,5 +168,5 @@ Some builds of stable ownCloud Infinite Scale releases provided by ownCloud GmbH
|
||||
## Copyright
|
||||
|
||||
```console
|
||||
Copyright (c) 2020-2023 ownCloud GmbH <https://owncloud.com>
|
||||
Copyright (c) 2020-2026 ownCloud GmbH <https://owncloud.com>
|
||||
```
|
||||
@@ -0,0 +1,13 @@
|
||||
Bugfix: Stop endless redirect loop when admin settings MFA step-up fails
|
||||
|
||||
The admin settings route guards required MFA via `requireAcr()`, which
|
||||
redirected to the IdP whenever the token's `acr` did not match. IdPs like
|
||||
Keycloak answer an `acr_values` request they can't satisfy with a lower `acr`
|
||||
instead of an error, so a user without a second factor at hand was trapped in a
|
||||
redirect loop. `requireAcr()` now uses the same protection as the vault: the
|
||||
step-up carries its target as OIDC state, and if the IdP answers it without the
|
||||
required `acr`, `requireAcr()` returns false. The admin settings then redirect
|
||||
to the default view and show an error message.
|
||||
|
||||
https://github.com/owncloud/ocis/issues/13069
|
||||
https://github.com/owncloud/ocis/pull/13070
|
||||
@@ -0,0 +1,12 @@
|
||||
Bugfix: Announce status messages to screen readers
|
||||
|
||||
Status messages such as "copied to clipboard" or "file restored successfully"
|
||||
were not reliably read out by screen readers. The underlying announcement
|
||||
area was never cleared between messages, so a repeated or rapid message
|
||||
could be silently dropped, especially when combined with a focus change
|
||||
elsewhere on the page.
|
||||
|
||||
The announcement area is now cleared before each new message and refilled
|
||||
after a short delay, so status messages are announced consistently.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/13024
|
||||
@@ -0,0 +1,13 @@
|
||||
Bugfix: Fix AuthApp and basic auth requests with custom PROXY_USER_OIDC_CLAIM
|
||||
|
||||
We fixed AuthApp (app password) and HTTP basic auth requests returning an
|
||||
internal server error whenever PROXY_USER_OIDC_CLAIM was set to anything
|
||||
other than its default value. Both authenticators put the already
|
||||
authenticated user directly into the request context instead of faking
|
||||
incomplete claims for the account resolver to re-resolve. We also made sure
|
||||
a user who only ever authenticates this way still gets a default role
|
||||
assigned, and that these requests keep getting rejected on deployments with
|
||||
multiple instances enabled, since neither carries tenant-membership
|
||||
information.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/13107
|
||||
@@ -0,0 +1,20 @@
|
||||
Bugfix: Record the acting user in the audit log's User field
|
||||
|
||||
The audit log's `User` field is documented as the UID of the user performing
|
||||
the action, but the file and folder converters filled it from the event's
|
||||
`Owner`, which reva does not set, so the field was empty on every upload,
|
||||
download, move, delete, restore and version restore. Where an event did carry
|
||||
an owner, `User` named the owner rather than the person acting, for example a
|
||||
share recipient uploading into a shared folder. Space, user and group events
|
||||
hard-coded the field to an empty string although every one of those events
|
||||
carries the actor.
|
||||
|
||||
`User` is now taken from the event's `Executant` for all of these events. The
|
||||
`Owner` field of file events is unchanged. The failed public-link access event
|
||||
still has no actor and keeps an empty `User`.
|
||||
|
||||
While adding tests for the user and group events, the group member added and
|
||||
removed messages turned out to pass the user and group ids in the wrong order,
|
||||
naming the group as the user and the user as the group; that is fixed too.
|
||||
|
||||
https://github.com/owncloud/ocis/issues/4789
|
||||
@@ -0,0 +1,13 @@
|
||||
Bugfix: fixed missing accessible name on button loading spinner
|
||||
|
||||
`OcButton`'s loading spinner is a `role="img"` element, but it had no
|
||||
accessible name. This tripped an axe `role-img-alt` violation on any
|
||||
page whose e2e a11y check ran while a button was in its loading state,
|
||||
such as the public link password page's "Continue" button.
|
||||
|
||||
The spinner now gets a real accessible name ("Loading") via
|
||||
`OcSpinner`'s `ariaLabel` prop, marked `aria-live="polite"` so it is
|
||||
actively announced to screen reader users instead of only being
|
||||
described if focus happens to already be on the button.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/13018
|
||||
@@ -0,0 +1,13 @@
|
||||
Bugfix: Announce autocomplete comboboxes correctly to screen readers
|
||||
|
||||
Autocomplete fields such as the language and design selectors on the account
|
||||
page did not announce themselves as comboboxes to assistive technology. The
|
||||
combobox role and its related ARIA attributes were set on a wrapper element
|
||||
that could not receive keyboard focus, while the actual focusable input
|
||||
exposed a generic, hardcoded label instead of the field's own label.
|
||||
|
||||
The combobox role, its state attributes and the accessible name are now set
|
||||
directly on the focusable input, so screen readers announce the field as a
|
||||
combobox with the correct label.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/13041
|
||||
@@ -0,0 +1,11 @@
|
||||
Bugfix: Do not allow credentials for wildcard CORS origins
|
||||
|
||||
CORS responses no longer send `Access-Control-Allow-Credentials: true` when the
|
||||
configured origins permit any origin: an empty list, `*`, or a wildcard pattern
|
||||
such as `https://*`. In those cases credentials are dropped and a warning is
|
||||
logged. This applies across all CORS paths (the shared HTTP middleware, the reva
|
||||
interceptor used by the frontend and ocm services, ocdav, and the tus upload
|
||||
handler). Explicitly configured origins are unaffected and keep credentials, so
|
||||
intended cross-origin setups continue to work.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/12983
|
||||
@@ -0,0 +1,9 @@
|
||||
Bugfix: Show image preview for files with spaces in the name on public links
|
||||
|
||||
The preview in the details panel was not shown for files opened via a public
|
||||
link when the file name contained spaces. The preview URL was used unquoted in a
|
||||
CSS `url()`, so the browser dropped it and never requested the thumbnail. The
|
||||
URL is now quoted.
|
||||
|
||||
https://github.com/owncloud/ocis/issues/13137
|
||||
https://github.com/owncloud/ocis/pull/13150
|
||||
@@ -0,0 +1,12 @@
|
||||
Bugfix: fixed low color contrast on disabled danger buttons
|
||||
|
||||
Disabled buttons using the "danger" styling, such as the "Empty trash bin"
|
||||
button when there is nothing to delete, showed their label text with very
|
||||
low contrast against the button background, making the text hard to read.
|
||||
|
||||
The muted background color used for these buttons in a disabled state has
|
||||
been darkened, and the fading effect applied to disabled buttons no longer
|
||||
washes out the danger button background, restoring readable contrast
|
||||
between the label and the background.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/12992
|
||||
@@ -0,0 +1,11 @@
|
||||
Bugfix: Keep keyboard focus on the trigger when a dropdown closes
|
||||
|
||||
Dropdown and context menus that close on item click (e.g. the per-file "..."
|
||||
menu) removed the clicked item from the page as they closed, so keyboard
|
||||
focus fell back to the page body. Screen readers then re-announced the
|
||||
whole page, drowning out any status message the action had just triggered.
|
||||
|
||||
The dropdown now returns focus to the button that opened it when it closes,
|
||||
unless the clicked action already moved focus somewhere else on its own.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/13025
|
||||
@@ -0,0 +1,12 @@
|
||||
Bugfix: fixed low color contrast on dropdown menu item hover text
|
||||
|
||||
Items in dropdown menus, such as the "New" file/folder menu, changed
|
||||
their text to a color meant for use as a background rather than as
|
||||
text when hovered. On top of the generic hover background used
|
||||
across the app, this produced poor contrast in some themes.
|
||||
|
||||
Hovered menu items now keep the same text color already used before
|
||||
hovering, which reads correctly against the hover background in
|
||||
every theme.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/12994
|
||||
@@ -0,0 +1,11 @@
|
||||
Bugfix: fixed low color contrast on file name in editor topbar
|
||||
|
||||
The file name and extension shown in the topbar when a file is open,
|
||||
for example in an editor, were displayed in white on top of a light
|
||||
brand-colored background in some theme variants, making the text
|
||||
hard to read.
|
||||
|
||||
The text now uses a dark color instead, restoring readable contrast
|
||||
against that background.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/12997
|
||||
@@ -0,0 +1,12 @@
|
||||
Bugfix: fixed low color contrast on disabled danger button text
|
||||
|
||||
Disabled filled danger buttons, such as the "Empty trash bin" button
|
||||
in the deleted files view, displayed their text and icon in a color
|
||||
too close to the background fill, making them hard to read.
|
||||
|
||||
The disabled text and icon color is now forced to white, restoring
|
||||
readable contrast against the button's background. The vault light
|
||||
theme's muted danger color was also darkened, since it was too light
|
||||
to meet contrast requirements against white text.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/12998
|
||||
@@ -0,0 +1,10 @@
|
||||
Bugfix: Disable rubber-band overscroll of the page in file apps
|
||||
|
||||
Scrolling to the top or bottom of the content in a file app such as
|
||||
OnlyOffice, Collabora or the text editor could make the whole page bounce
|
||||
along with it, including the top bar and the app frame, briefly revealing the
|
||||
blank page background behind them. The vertical elastic overscroll of the page
|
||||
is now disabled while a file is open in one of these apps, so the surrounding
|
||||
layout stays in place.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/13140
|
||||
@@ -0,0 +1,11 @@
|
||||
Bugfix: Files no longer stay in processing after upload or copy
|
||||
|
||||
After uploading or copying files, some of them sometimes stayed greyed out as
|
||||
"processing" until the page was reloaded. This happened when processing
|
||||
finished while the file list was still being loaded: the update from the
|
||||
server was ignored and the list then showed the file as still processing.
|
||||
|
||||
Files whose processing has finished are now refreshed automatically when they
|
||||
show up in the file list as processing.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/13134
|
||||
@@ -0,0 +1,25 @@
|
||||
Bugfix: Fix the LDAP master-ID filter when the base filter is empty
|
||||
|
||||
The function `EnhanceFilterWithMasterID` in `ocis-pkg/ldap/filter.go` adds a
|
||||
master-ID clause to an LDAP filter with OR. An empty filter means "no
|
||||
restriction". Before this fix, the function replaced an empty filter with a
|
||||
master-ID-only filter. This action restricted an unrestricted search to
|
||||
master-ID users only.
|
||||
|
||||
The bug broke the search for a user on another instance in multi-instance
|
||||
deployments. This search uses the Graph API endpoint `/graph/v1.0/users`.
|
||||
Multi-instance deployments use this search to find a user to share a resource
|
||||
with.
|
||||
|
||||
Now the function keeps an empty filter unchanged. The function still adds a
|
||||
master-ID clause to a filter that is not empty.
|
||||
|
||||
The `graph`, `auth-basic`, `users`, and `groups` services also use this
|
||||
function to compute their default LDAP user filter when
|
||||
`OCIS_MULTI_INSTANCE_MASTER_ID` is set. An empty user filter now means these
|
||||
services resolve or authenticate every user in the shared LDAP directory,
|
||||
not only master-ID users. Each of these services now rejects startup when
|
||||
`OCIS_MULTI_INSTANCE_MASTER_ID` is set and its own user filter is empty.
|
||||
Set an explicit `OCIS_LDAP_USER_FILTER` for every multi-instance deployment.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/13100
|
||||
@@ -0,0 +1,15 @@
|
||||
Bugfix: Unify when the maintenance banner clears
|
||||
|
||||
The Web frontend showed the maintenance banner inconsistently depending on which
|
||||
HTTP client happened to make the last request: the webdav client cleared the banner
|
||||
on any error that was not a maintenance response, including a plain 404 or 500,
|
||||
while the other client only cleared it on a genuine successful response. Whether the
|
||||
banner disappeared during real maintenance could therefore depend on which request
|
||||
happened to run last.
|
||||
|
||||
Both clients now agree: the maintenance banner is only raised by the explicit
|
||||
maintenance response, and any other real response from the server clears it, since
|
||||
that is not the same as general unhealthiness. Only a transport-level failure, where
|
||||
no response is received at all, leaves the banner state untouched.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/12966
|
||||
@@ -0,0 +1,12 @@
|
||||
Bugfix: fixed low color contrast on nav and primary button hover states
|
||||
|
||||
Non-active sidebar navigation items, as well as buttons using the
|
||||
"primary" styling, showed their text and icons in black on top of a
|
||||
dark hover background in some themes, making them hard to read while
|
||||
hovering.
|
||||
|
||||
The hover state for these elements now switches to a light color
|
||||
instead of always using black, restoring readable contrast between
|
||||
the text and the background while hovering.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/12993
|
||||
@@ -0,0 +1,11 @@
|
||||
Bugfix: fixed low color contrast on notification bell badge
|
||||
|
||||
The unread notification count badge on the notification bell used a
|
||||
hardcoded red background with white text, which fell below the
|
||||
WCAG AA contrast requirement for text that size.
|
||||
|
||||
The badge now uses the design system's danger color tokens instead,
|
||||
which are already tuned to keep sufficient contrast with their
|
||||
paired text color across all theme variants.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/13000
|
||||
@@ -0,0 +1,12 @@
|
||||
Bugfix: notification bell now announces the unread count
|
||||
|
||||
The notification bell's accessible name was a static "Notifications"
|
||||
string regardless of how many unread notifications there were. Since
|
||||
that label overrides all other content for assistive technology, screen
|
||||
reader users never heard the unread count that sighted users see on the
|
||||
bell's badge.
|
||||
|
||||
The bell's accessible name and tooltip now include the exact unread
|
||||
count, with correct singular/plural wording.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/13003
|
||||
@@ -0,0 +1,12 @@
|
||||
Bugfix: fixed arrow-key navigation in the notification dropdown
|
||||
|
||||
Opening the notification bell's dropdown did not move keyboard focus into
|
||||
it. Arrow-key navigation only started working after an extra, unrelated
|
||||
Tab press, and pressing an arrow key too early scrolled the page instead,
|
||||
which looked like the dropdown had closed.
|
||||
|
||||
The dropdown now moves focus to its first item as soon as it opens, so
|
||||
arrow keys work immediately, matching the behavior of other click-triggered
|
||||
dropdowns in the application.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/13002
|
||||
@@ -0,0 +1,8 @@
|
||||
Bugfix: Stop logging "no user in context" for data gateway requests
|
||||
|
||||
The proxy's create-home middleware logged an error for every request that
|
||||
carried a reva token but no user. reva's internal downloads through the data
|
||||
gateway (`/data`) are such requests, so every file download added an
|
||||
error-level line. These requests are now passed on with a debug-level log.
|
||||
|
||||
https://github.com/owncloud/ocis/issues/13101
|
||||
@@ -0,0 +1,13 @@
|
||||
Bugfix: Purge revisions stored with whole-second timestamps
|
||||
|
||||
The revisions purge command reported a clean storage when revisions were still
|
||||
present. Revision filenames are the previous mtime formatted with
|
||||
time.RFC3339Nano, which omits fractional seconds on a whole second. Names such
|
||||
as `.REV.1601-01-01T00:00:00Z` never matched the purge pattern, so those
|
||||
revisions stayed on disk.
|
||||
|
||||
The matcher now treats the decimal point and fractional digits as optional.
|
||||
Whole-second revisions and their `.mpk` and `.mlock` companions are discovered
|
||||
and purged along with revisions that still carry a fractional timestamp.
|
||||
|
||||
https://github.com/owncloud/ocis/issues/11167
|
||||
@@ -0,0 +1,13 @@
|
||||
Bugfix: Recover uploads stuck in processing when the blob commit fails
|
||||
|
||||
When the final blob commit failed after postprocessing, the node kept its
|
||||
`processing` marker with no retry and no timeout. Every download then returned
|
||||
`425 Too Early`, the file could not be deleted, and its reserved size kept
|
||||
counting against the quota.
|
||||
|
||||
The commit is now retried with backoff. If it still fails, the node is reverted
|
||||
to a recoverable failed state, which clears the processing marker and releases
|
||||
the reserved quota.
|
||||
|
||||
https://github.com/owncloud/reva/pull/733
|
||||
https://github.com/owncloud/ocis/pull/12970
|
||||
@@ -0,0 +1,10 @@
|
||||
Bugfix: Restoring an already-restored trash item now returns 404
|
||||
|
||||
Issuing a second restore request for a trash item that had already been
|
||||
restored or purged returned a 500 (internal server error) instead of a 404
|
||||
(not found). This made benign duplicate restores, such as those caused by a
|
||||
sync client retrying a request, look like server errors. The restore
|
||||
operation now reports 404 for this case, matching the existing behavior of
|
||||
purging an already-purged item.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/TODO
|
||||
@@ -0,0 +1,14 @@
|
||||
Bugfix: Restore focus after changing the account language
|
||||
|
||||
Selecting a new language in the account page's Language dropdown dropped
|
||||
keyboard focus to the page body instead of keeping it on the dropdown, and
|
||||
the confirmation message was not announced to screen readers afterward.
|
||||
|
||||
The language change triggers a fair amount of background work (reloading
|
||||
translations, switching the active language, saving the preference) before
|
||||
it finishes, which raced against the dropdown's own best-effort focus
|
||||
handling. Focus is now explicitly restored only once that work has fully
|
||||
settled, and before the confirmation message is shown, so the announcement
|
||||
is no longer cancelled by a focus change happening right after it.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/13045
|
||||
@@ -0,0 +1,12 @@
|
||||
Bugfix: fixed low color contrast on share permission dropdown hover text
|
||||
|
||||
The share permission dropdown's role options, such as "Can view" or
|
||||
"Can edit", showed their hovered text in a color too close in
|
||||
lightness to the hover background in the dark theme, making it hard
|
||||
to read.
|
||||
|
||||
The hover text color has been lightened slightly, restoring
|
||||
readable contrast between the text and the background while
|
||||
hovering.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/12995
|
||||
@@ -0,0 +1,14 @@
|
||||
Bugfix: added a keyboard shortcut to move focus out of the text editor
|
||||
|
||||
Opening the text/markdown editor moved keyboard focus straight into the
|
||||
edit area, but Tab is bound to indenting rather than moving focus, so
|
||||
there was no reliable way to reach the toolbar without leaving the file
|
||||
entirely. The editor's own built-in escape hatch for this doesn't work
|
||||
on a standard Mac keyboard, since the key combo it relies on is consumed
|
||||
by macOS as a diacritic shortcut before it reaches the page.
|
||||
|
||||
Pressing Ctrl+M now moves focus from the edit area to the toolbar, the
|
||||
same way on every platform. The editor's accessible description also
|
||||
announces this shortcut for assistive technology users.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/13004
|
||||
@@ -0,0 +1,10 @@
|
||||
Bugfix: Show an error instead of "no deleted files" for inaccessible trash
|
||||
|
||||
Members of a space who are not allowed to list its trash, for example members
|
||||
with the "Can edit" role, were told that the space has no deleted files, even
|
||||
though files had been deleted. The trash view now tells the user that the
|
||||
deleted files could not be loaded and that they might lack the permission to
|
||||
view them. A trash that is really empty still shows the "no deleted files"
|
||||
message.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/13105
|
||||
@@ -0,0 +1,10 @@
|
||||
Bugfix: Clean up the trash view in the Safe
|
||||
|
||||
The trash offered a "Copy permanent link" action for deleted items, which
|
||||
cannot be linked to. The action is no longer shown for deleted items.
|
||||
|
||||
The personal space in the trash was labelled "Personal" in the Safe, while the
|
||||
rest of the interface calls it "Safe-Personal". The trash now uses the same
|
||||
name.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/13136
|
||||
@@ -0,0 +1,7 @@
|
||||
Bugfix: Text and BMP file previews failed where libvips has no ImageMagick
|
||||
|
||||
Downloading the preview of a text or BMP file failed with a `500 could not get thumbnail` error on systems where libvips comes without ImageMagick support, such as minimal container images. The rendered text image was passed through a BMP encoding round-trip first, and uploaded BMP files were handed to libvips as bytes; libvips can only load BMP images via ImageMagick.
|
||||
|
||||
The rendered text image is now handed over to libvips directly from memory, and BMP files are decoded in Go before the handover, so both no longer depend on ImageMagick being installed alongside libvips.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/12961
|
||||
@@ -0,0 +1,12 @@
|
||||
Bugfix: Explain why an upload or a duplicate does not fit the space quota
|
||||
|
||||
An upload rejected for lack of room named only the shortfall ("You need
|
||||
additional 1 MB"), and a failed duplicate was reported as a failed move with
|
||||
"Insufficient quota" underneath. Both messages now name the space and what to do
|
||||
about it, and a failed duplicate is reported as one.
|
||||
|
||||
The upload check also measured only the last file of a batch, and skipped the
|
||||
check altogether for a space with nothing left, because a remaining quota of 0
|
||||
was read as "unknown".
|
||||
|
||||
https://github.com/owncloud/ocis/pull/12943
|
||||
@@ -0,0 +1,12 @@
|
||||
Bugfix: Return a retryable 503 when the OIDC userinfo call fails transiently
|
||||
|
||||
A transient failure of the OIDC userinfo call (a timeout, a network error or a
|
||||
5xx/429 from the IdP) was mapped to HTTP 401. Clients read the 401 as an invalid
|
||||
session and logged the user out on a brief IdP slowdown.
|
||||
|
||||
The proxy now distinguishes a transient IdP failure from an authentication
|
||||
failure and returns a retryable 503 (with Retry-After) for the former, so clients
|
||||
retry and keep their session. A genuinely invalid or expired token still returns
|
||||
401.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/12999
|
||||
@@ -0,0 +1,8 @@
|
||||
Bugfix: Show correct message when Safe access is denied for lacking permission
|
||||
|
||||
A user without permission to use the Safe who opened the Safe URL directly was
|
||||
shown "Not logged in" with a "Log in again" button, even though they were
|
||||
still logged in. The page now shows "Access denied" with a "Continue" button
|
||||
that returns to the app for this case.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/13111
|
||||
@@ -0,0 +1,14 @@
|
||||
Bugfix: Stop endless redirect loop when vault MFA step-up fails
|
||||
|
||||
Web requested the vault MFA level via `acr_values`, which is a voluntary claim.
|
||||
IdPs like Keycloak return a token with a lower `acr` instead of an error when
|
||||
the user can't complete the second factor (none enrolled, device not at hand).
|
||||
Web then started the step-up again on every return, trapping the user in a
|
||||
redirect loop. The step-up request now carries the vault page as OIDC state. If
|
||||
the IdP answers it without the required `acr`, web stops retrying, reloads the
|
||||
page outside the vault and shows an error message there. Leaving the vault needs
|
||||
a full page load, because vault mode is fixed for the lifetime of the page.
|
||||
Returning without the IdP answering, e.g. via the browser's back button, still
|
||||
starts a new step-up.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/12985
|
||||
@@ -0,0 +1,15 @@
|
||||
Bugfix: Open Safe permanent links from outside the Safe
|
||||
|
||||
A permanent link to a file in the Safe, opened in a regular Drive tab, showed
|
||||
"An error occurred while resolving the private link" instead of the file. The
|
||||
Web frontend recognized Safe files by a storage provider id that the server
|
||||
only sends to sessions already inside the Safe, so a Drive tab never redirected
|
||||
the link into the Safe.
|
||||
|
||||
The Safe storage provider id is fixed, so the frontend now uses it as a
|
||||
constant, like the share jail and OCM ids. This also keeps Safe notifications
|
||||
out of the Drive view and lets the invite form recognize Safe resources in
|
||||
Drive mode. The `vaultStorageProvider` getter of the web-pkg capability store
|
||||
is removed; use `VAULT_STORAGE_PROVIDER_ID` from web-client instead.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/13001
|
||||
@@ -4,3 +4,5 @@ Users whose role did not grant Safe access could still reach it by editing the U
|
||||
Such users are now denied and shown the access-denied page.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/12884
|
||||
https://github.com/owncloud/ocis/pull/12925
|
||||
https://github.com/owncloud/ocis/pull/12928
|
||||
@@ -0,0 +1,13 @@
|
||||
Bugfix: Fix file and folder downloads in vault mode
|
||||
|
||||
Downloading a file in the vault failed with a 403 error. A download uses a
|
||||
signed link without a login token. Thus the proxy uses the stored MFA status of
|
||||
the user. The proxy did not store this status. Now the proxy stores it after it
|
||||
knows the user. A download is accepted if the user had a request with MFA within
|
||||
the MFA session duration.
|
||||
|
||||
Downloading a folder or several files in the vault failed with a 404 error. In
|
||||
vault mode, the web UI requested the signing key from a wrong address. Now the
|
||||
web UI uses the correct address.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/13097
|
||||
@@ -9,3 +9,5 @@ https://github.com/owncloud/ocis/pull/12302
|
||||
https://github.com/owncloud/ocis/pull/12439
|
||||
https://github.com/owncloud/ocis/pull/12266
|
||||
https://github.com/owncloud/ocis/pull/12730
|
||||
https://github.com/owncloud/ocis/pull/13066
|
||||
https://github.com/owncloud/ocis/pull/13081
|
||||
@@ -0,0 +1,15 @@
|
||||
Change: Replace GRPC_MAX_CONNECTION_AGE with client keepalive
|
||||
|
||||
The grpc clients now send a keepalive ping while a request is in flight and fail
|
||||
the requests on a connection whose peer stops answering, instead of waiting for
|
||||
as long as the caller allows. This covers both the reva CS3 clients (gateway,
|
||||
storage-users, storage-shares, ...) and the go-micro based clients used for
|
||||
inter-service calls between the other oCIS services. Set GRPC_CLIENT_KEEPALIVE_TIME
|
||||
and GRPC_CLIENT_KEEPALIVE_TIMEOUT to enable and tune this; leave them unset to keep
|
||||
grpc's own default (no pings).
|
||||
|
||||
GRPC_MAX_CONNECTION_AGE has been removed. It only closed healthy connections on
|
||||
a timer, never ended a request that was already in flight, and silently did
|
||||
nothing when its value had no unit suffix.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/13020
|
||||
@@ -0,0 +1,13 @@
|
||||
Change: Remove the MFA session extension popup in vault mode
|
||||
|
||||
In vault mode, the web UI showed a popup shortly before the multi-factor
|
||||
authentication session was about to expire, offering to extend or dismiss it.
|
||||
Extending only reset a timer in the browser and did not renew anything on the
|
||||
server, so the popup has been removed.
|
||||
|
||||
The frontend service no longer exposes the MFA session duration in its
|
||||
capabilities, and its `session_duration` setting has been removed. The
|
||||
`OCIS_MFA_SESSION_DURATION` environment variable is still used by the proxy
|
||||
service.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/13085
|
||||
@@ -0,0 +1,58 @@
|
||||
Change: Replace axios with the native fetch API in Web
|
||||
|
||||
The Web frontend no longer depends on axios. All HTTP traffic goes through a
|
||||
single fetch-based client, and the libre-graph client is generated from the
|
||||
`typescript-fetch` template instead of `typescript-axios`.
|
||||
|
||||
Sending requests is a drop-in change. `HttpClient` keeps its per-request config
|
||||
including `data`, keeps `cancel()`, still resolves a non-JSON body as text, and
|
||||
still exposes response headers as `headers['etag']` as well as
|
||||
`headers.get('etag')`. Errors still carry the body and status as `error.data` /
|
||||
`error.statusCode` and as `error.response.data` / `error.response.status`.
|
||||
`mockAxiosResolve` and `mockAxiosReject` still work, deprecated in favour of
|
||||
`mockHttpResponse` and `mockHttpError`.
|
||||
|
||||
Per-request `headers` are merged over the client-wide ones case-insensitively, so
|
||||
an override replaces the header it names whatever case either side used.
|
||||
|
||||
Maintenance mode is now also detected on `clientService.httpAuthenticated`. Before,
|
||||
only the unauthenticated, graph and ocs clients watched responses for it, as the
|
||||
authenticated client had no response interceptor. Requests through it now raise and
|
||||
clear the maintenance flag like any other, and they update
|
||||
`lastSuccessfulRequestTime`, which seeds the MFA expiry timer.
|
||||
|
||||
Code that touches axios directly has to be adapted:
|
||||
|
||||
- `new HttpClient()` takes `{ baseUrl, staticHeaders, headers, onResponse }`
|
||||
instead of `{ config, requestInterceptor, responseInterceptor }`. Clients from
|
||||
`ClientService` are unaffected.
|
||||
- The per-request config drops `timeout`, `withCredentials`, `onUploadProgress`,
|
||||
`cancelToken`, `paramsSerializer`, `transformRequest` / `transformResponse`,
|
||||
`validateStatus` and `baseURL`; `responseType` drops `document` and `stream`.
|
||||
- The per-request `headers` are typed as `HeadersInit`, so a `Headers` is accepted
|
||||
as well as a plain object. Assigning into them after the fact
|
||||
(`config.headers.Authorization = …`) no longer type-checks; build the object
|
||||
first, or use `new Headers()` and `set()`.
|
||||
- `error.response` carries the body on `error.response.data`, as it did with
|
||||
axios. Its underlying stream is consumed, so `error.response.json()` is not
|
||||
available.
|
||||
- `graph()`, `ocs()`, `UrlSign` and `WebDavOptions` take a `FetchClient`, and
|
||||
the latter two rename `axiosClient` to `httpClient`. `webdav()` is unchanged.
|
||||
- Graph fields with an OData annotation use their generated camelCase names,
|
||||
e.g. `atLibreGraphPermissionsActions`. The wire format is unchanged.
|
||||
- Graph responses are rebuilt from the fields the spec declares, which is what makes
|
||||
the renaming above possible. A field the spec does not declare is dropped, so the
|
||||
oCIS-only `attributes` on users is added to the spec before generating. A declared
|
||||
field the server omits is present and holds `undefined`, so
|
||||
`'accountEnabled' in user` no longer tells whether the server sent it. Compare
|
||||
against `undefined` instead.
|
||||
- `CollaboratorAutoCompleteItem.attributes` is optional, matching the `attributes` on
|
||||
the generated `User`. The field is only there when
|
||||
`OCIS_USER_SEARCH_DISPLAYED_ATTRIBUTES` is configured, so read it as
|
||||
`item.attributes?.join(…)`.
|
||||
- The generated client loses its `*ApiFactory`, `*ApiFp` and
|
||||
`*AxiosParamCreator` exports. The `*Api` classes now take one options object
|
||||
per operation and resolve with the payload.
|
||||
- `@ownclouders/web-test-helpers` no longer has a `mocks/axios` module path.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/12910
|
||||
@@ -0,0 +1,8 @@
|
||||
Enhancement: Add Mermaid diagram editor
|
||||
|
||||
Added a dedicated split-pane editor and live preview for standalone Mermaid
|
||||
diagram files (`.mmd`/`.mermaid`). Previously Mermaid rendering only worked
|
||||
inside a fenced code block of a Markdown document; there was no way to edit
|
||||
a diagram on its own without wrapping it in Markdown first.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/12676
|
||||
@@ -0,0 +1,12 @@
|
||||
Enhancement: Record tag changes in the audit log
|
||||
|
||||
Adding or removing tags on a file or folder left no trace in the audit log.
|
||||
The graph service already publishes `TagsAdded` and `TagsRemoved` events for
|
||||
every change, but only the search service listened to them.
|
||||
|
||||
The audit service now records both: `file_tags_add` and `file_tags_remove`
|
||||
entries carry the acting user, the file id and path, the space owner and the
|
||||
tags concerned. The graph service also sets the timestamp on the two events,
|
||||
which it left empty before.
|
||||
|
||||
https://github.com/owncloud/ocis/issues/13054
|
||||
@@ -9,8 +9,10 @@ colour being stored anywhere. Themes supply the palette through a new
|
||||
`designTokens.tagColorsList`, and the label colour is chosen per fill so it
|
||||
stays legible in both the light and dark themes.
|
||||
|
||||
The tag overflow indicator on the files list also became a real, keyboard
|
||||
reachable button, and it now shows the hidden tags in a popover instead of
|
||||
opening the sidebar.
|
||||
The tag overflow indicator on the files list also became a disclosure button
|
||||
that shows the hidden tags in a popover instead of opening the sidebar. It
|
||||
opens on click or on Enter/Space, closes on Escape, and reports its state to
|
||||
assistive technology.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/12892
|
||||
https://github.com/owncloud/ocis/pull/12923
|
||||
@@ -0,0 +1,14 @@
|
||||
Enhancement: Make the public share expiry janitor configurable
|
||||
|
||||
The sharing service runs a background janitor that permanently deletes
|
||||
expired public shares. Whether that cleanup runs at all could previously only
|
||||
be set in the sharing service's yaml config, and how often it ran was fixed
|
||||
internally with no way to tune it.
|
||||
|
||||
Both settings are now exposed as environment variables:
|
||||
OCIS_SHARING_ENABLE_EXPIRED_SHARES_CLEANUP toggles the cleanup (default:
|
||||
enabled, expired shares stay hidden from listings even when disabled), and
|
||||
the new OCIS_SHARING_JANITOR_RUN_INTERVAL sets the interval in seconds
|
||||
between janitor runs (default: 3600).
|
||||
|
||||
https://github.com/owncloud/ocis/pull/13020
|
||||
@@ -0,0 +1,11 @@
|
||||
Enhancement: Default 30-day expiration for vault shares
|
||||
|
||||
When a user or group share of a vault file or folder is created without an
|
||||
expiration date, the server now preconfigures a default expiration (30 days
|
||||
by default, configurable via `GRAPH_DEFAULT_VAULT_SHARE_EXPIRATION_DAYS`) to
|
||||
encourage data minimization. The sharer can override or shorten this value.
|
||||
|
||||
Non-vault shares and space memberships are exempt and stay unbounded, as
|
||||
space memberships represent a permanent organizational role.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/12988
|
||||
@@ -0,0 +1,27 @@
|
||||
Enhancement: Inline images in the markdown editor
|
||||
|
||||
Uploading an image in the markdown editor did nothing at all - neither
|
||||
drag-and-drop nor the "Upload Images" toolbar button produced a result, a
|
||||
progress indicator, or an error. The feature had been deliberately suppressed
|
||||
because there was no answer to where an uploaded image should be stored, and
|
||||
because a recipient of a public link to a single markdown file has no
|
||||
permission to read an image stored next to it.
|
||||
|
||||
Images dropped or picked in the markdown editor are now encoded into the
|
||||
document itself as base64 data URIs, so a shared document carries its own
|
||||
images and needs no further permissions. Because the image bytes are now part
|
||||
of the document, two limits keep documents small enough to stay fully
|
||||
searchable: a maximum size per image, and a budget for the total size of all
|
||||
images in one document. An image that exceeds either limit is rejected with a
|
||||
notification naming the image and the limit, instead of failing silently.
|
||||
|
||||
Both limits are configurable through the text editor's app configuration as
|
||||
`maxImageSize` and `maxDocumentImageSize`, given in bytes and defaulting to
|
||||
2 MB and 10 MB respectively.
|
||||
|
||||
The editor's "Crop And Upload" entry is no longer offered. Cropping was not part
|
||||
of the reported problem, so it stays out until users ask for it, and images are
|
||||
inlined exactly as they were picked.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/12967
|
||||
https://github.com/owncloud/web/issues/12407
|
||||
@@ -0,0 +1,10 @@
|
||||
Enhancement: Add TLS support for the frontend stat cache store connection
|
||||
|
||||
The frontend service was the only remaining place where a `nats-js-kv` store
|
||||
connection could not be secured. Its OCS stat cache forwarded the store type,
|
||||
nodes, database, table, TTL and credentials to reva, but not the TLS settings,
|
||||
so the connection stayed plaintext with no operator toggle to change it. The
|
||||
stat cache now honours `OCIS_CACHE_ENABLE_TLS`, `OCIS_CACHE_TLS_INSECURE` and
|
||||
`OCIS_CACHE_TLS_ROOT_CA_CERTIFICATE` like every other cache and store.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/12931
|
||||
@@ -0,0 +1,7 @@
|
||||
Enhancement: Clarify the NATS store TLS insecure options
|
||||
|
||||
The descriptions of the `*_TLS_INSECURE` options for the `nats-js-kv` store, cache
|
||||
and service registry now state that they disable authentication of the NATS server
|
||||
and are for testing only.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/12941
|
||||
@@ -0,0 +1,13 @@
|
||||
Enhancement: Add a --timeout flag to the search index command
|
||||
|
||||
`ocis search index` called the search service with a fixed 10 minute request
|
||||
timeout. The service walks the whole space inside that request, so once the
|
||||
timeout expired the walk was cancelled with "error walking the tree: context
|
||||
canceled" and everything after that point stayed unindexed. A space whose
|
||||
walk takes longer than ten minutes, for example because the content extractor
|
||||
is slow on a few files, could never be fully indexed from the command line.
|
||||
|
||||
The timeout is now a flag. `--timeout` takes a duration (default `10m`, so the
|
||||
behaviour is unchanged out of the box); `0` waits indefinitely.
|
||||
|
||||
https://github.com/owncloud/ocis/issues/13052
|
||||
@@ -0,0 +1,17 @@
|
||||
Bugfix: Hide "Shared via link" when public sharing is disabled
|
||||
|
||||
The Shares navigation (the desktop tab list and the mobile drop-down) always
|
||||
offered a "Shared via link" entry, even when public link sharing was disabled
|
||||
for the account — for example in the Vault, where the backend rejects public
|
||||
link creation and the capability `files_sharing.public.enabled` reported
|
||||
`false`. The entry led to a page that could never contain anything.
|
||||
|
||||
The Shares navigation was changed to hide the "Shared via link" entry
|
||||
whenever `files_sharing.public.enabled` is `false`. Anyone who still reached
|
||||
the via-link route directly, including through the legacy
|
||||
`/list/shared-via-link` redirect, was redirected to "Shared with me" at
|
||||
navigation time, keeping the current route scope (e.g. `vault`) intact. When
|
||||
public sharing was enabled, all three Shares navigation entries continued to
|
||||
behave exactly as before.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/13005
|
||||
@@ -0,0 +1,6 @@
|
||||
Bugfix: Correct introduction version for OCIS_LDAP_INSTANCE_MAPPER_CACHE_TTL
|
||||
|
||||
We changed the documented introduction version of the
|
||||
OCIS_LDAP_INSTANCE_MAPPER_CACHE_TTL from 8.0.0 to 8.3.0.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/12948
|
||||
@@ -0,0 +1,12 @@
|
||||
Enhancement: The public link resolution flag added to PROPFIND
|
||||
|
||||
The public link resolution flag and the context timeout added to PROPFIND request
|
||||
The ocdav PROPFIND handler resolves public link shares to populate the oc:share-type property.
|
||||
A new toggle for skipping that lookup. The toggle is now exposed as
|
||||
OCDAV_DISABLE_PROPFIND_PUBLIC_LINK_RESOLUTION, which can be set to reduce load
|
||||
on services for large collections.
|
||||
Also, the bounded context was added for least public share request. Since this property is needed only
|
||||
to display an icon next to files in the list, indicating that a public link exists,
|
||||
it can be omitted if the ListPublicShares request is slow.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/13020
|
||||
@@ -0,0 +1,6 @@
|
||||
Security: Bump grpc dependency
|
||||
|
||||
We've bumped the grpc dependency to fix a vulnerability that could cause a
|
||||
server panic when handling requests missing authority or Host headers.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/13066
|
||||
@@ -0,0 +1,7 @@
|
||||
Security: Harden public link brute force protection
|
||||
|
||||
We've hardened the brute force protection for password protected public links so
|
||||
that failed password attempts are reliably counted and the rate limit is
|
||||
consistently enforced.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/12944
|
||||
+1
-3
@@ -11,8 +11,7 @@
|
||||
},
|
||||
"require-dev": {
|
||||
"ext-simplexml": "*",
|
||||
"bamarni/composer-bin-plugin": "^1.8",
|
||||
"playwright-php/playwright": "^1.2"
|
||||
"bamarni/composer-bin-plugin": "^1.8"
|
||||
},
|
||||
"extra": {
|
||||
"bamarni-bin": {
|
||||
@@ -20,7 +19,6 @@
|
||||
}
|
||||
},
|
||||
"require": {
|
||||
"khanamiryan/qrcode-detector-decoder": "^2.0",
|
||||
"spomky-labs/otphp": "^11.5"
|
||||
}
|
||||
}
|
||||
@@ -54,6 +54,11 @@ ADMIN_PASSWORD=
|
||||
# because their passwords are public. Defaults to "false".
|
||||
# Also see: https://doc.owncloud.com/ocis/latest/deployment/general/general-info.html#demo-users-and-groups
|
||||
DEMO_USERS=
|
||||
# Enables oCIS app-passwords (via the "auth-app" service), which let clients
|
||||
# authenticate without the user's live session. Required by some optional
|
||||
# services, e.g. Workflows automations (see the "oCIS Workflows Settings"
|
||||
# section below). Defaults to "false".
|
||||
PROXY_ENABLE_APP_AUTH=
|
||||
# Define the oCIS loglevel used.
|
||||
# For more details see:
|
||||
# https://doc.owncloud.com/ocis/latest/deployment/services/env-vars-special-scope.html
|
||||
@@ -290,6 +295,38 @@ MAIL_SERVER_DOMAIN=
|
||||
MAIL_SERVER_DOCKER_TAG=v1.29.3
|
||||
|
||||
|
||||
### oCIS Workflows Settings ###
|
||||
# AI-powered file workflow automation extension. Adds a frontend extension plus
|
||||
# a backend sidecar routed at https://${OCIS_DOMAIN}/workflows/api.
|
||||
# IMPORTANT: Workflows also requires the web extensions volume, so EXTENSIONS
|
||||
# must be enabled too, see the "oCIS Web Extensions" section above. Also, if
|
||||
# you disable Workflows again later, delete the ocis-apps volume to remove
|
||||
# its stale frontend assets (same caveat as the other web extensions above).
|
||||
# IMPORTANT: If you want to use Workflows automations (scheduled/event-triggered
|
||||
# runs, as opposed to only manual "Run now"), you also MUST:
|
||||
# 1. Set PROXY_ENABLE_APP_AUTH=true in the Infinite Scale Settings above.
|
||||
# 2. Add 'auth-app' to the START_ADDITIONAL_SERVICES envvar in the Infinite
|
||||
# Scale Settings above, e.g. START_ADDITIONAL_SERVICES="notifications,auth-app".
|
||||
# Both are left disabled by default, since they widen the oCIS instance's
|
||||
# authentication surface (app-passwords) for the whole deployment, not just
|
||||
# for Workflows.
|
||||
# Note: the leading colon is required to enable the service.
|
||||
#WORKFLOWS=:workflows.yml
|
||||
# Set the desired docker image tag or digest.
|
||||
# Defaults to "latest", which tracks an unreleased, weekly-rebuilt rolling
|
||||
# build of ocis-workflows' main branch (no versioned releases exist yet).
|
||||
# Consider pinning a dated tag (e.g. "20260602") for reproducible deployments.
|
||||
WORKFLOWS_DOCKER_TAG=latest
|
||||
# LLM backend used for the AI workflow nodes. Point at any OpenAI-compatible
|
||||
# endpoint (e.g. Ollama, OpenAI, ...). Required, no default in this deployment.
|
||||
WORKFLOWS_LLM_ENDPOINT=
|
||||
WORKFLOWS_LLM_MODEL=
|
||||
WORKFLOWS_LLM_API_KEY=
|
||||
# Key used to encrypt secrets (e.g. app passwords) stored by the Workflows
|
||||
# backend. Required, generate your own with: openssl rand -base64 32
|
||||
WORKFLOWS_ENCRYPTION_KEY=
|
||||
|
||||
|
||||
### Debugging - Monitoring ###
|
||||
# Please see documentation at: https://owncloud.dev/ocis/deployment/monitoring-tracing/
|
||||
# Note: the leading colon is required to enable the service.
|
||||
@@ -304,4 +341,4 @@ MAIL_SERVER_DOCKER_TAG=v1.29.3
|
||||
# This MUST be the last line as it assembles the supplemental compose files to be used.
|
||||
# ALL supplemental configs must be added here, whether commented or not.
|
||||
# Each var must either be empty or contain :path/file.yml
|
||||
COMPOSE_FILE=docker-compose.yml${OCIS:-}${TIKA:-}${S3NG:-}${S3NG_MINIO:-}${COLLABORA:-}${IMPORTER:-}${CLAMAV:-}${ONLYOFFICE:-}${EXTENSIONS:-}${UNZIP:-}${DRAWIO:-}${JSONVIEWER:-}${PROGRESSBARS:-}${EXTERNALSITES:-}${PHOTOADDON:-}${ADVANCEDSEARCH:-}${MAIL_SERVER:-}${MONITORING:-}${KEYCLOAK:-}${VAULT_STORAGE:-}
|
||||
COMPOSE_FILE=docker-compose.yml${OCIS:-}${TIKA:-}${S3NG:-}${S3NG_MINIO:-}${COLLABORA:-}${IMPORTER:-}${CLAMAV:-}${ONLYOFFICE:-}${EXTENSIONS:-}${UNZIP:-}${DRAWIO:-}${JSONVIEWER:-}${PROGRESSBARS:-}${EXTERNALSITES:-}${PHOTOADDON:-}${ADVANCEDSEARCH:-}${MAIL_SERVER:-}${MONITORING:-}${KEYCLOAK:-}${VAULT_STORAGE:-}${WORKFLOWS:-}
|
||||
@@ -23,3 +23,14 @@ Keycloak can be optionally enabled by uncommenting the corresponding variables i
|
||||
- `KEYCLOAK=:keycloak.yml`
|
||||
|
||||
Note that Keycloak requires the default `ocis` Identity Provider to be disabled, which is automatically handled when the `keycloak.yml` configuration is used.
|
||||
|
||||
### oCIS Workflows
|
||||
|
||||
[oCIS Workflows](https://github.com/owncloud/ocis-workflows) is an AI-powered file workflow automation extension. It can be optionally enabled by uncommenting the corresponding variables in the `.env` file:
|
||||
- `WORKFLOWS=:workflows.yml`
|
||||
|
||||
Note that Workflows requires the `ocis-apps` volume provided by the web extensions configuration, so `EXTENSIONS=:web_extensions/extensions.yml` must also be enabled. You also need to set `WORKFLOWS_ENCRYPTION_KEY` (e.g. via `openssl rand -base64 32`) and point `WORKFLOWS_LLM_ENDPOINT` / `WORKFLOWS_LLM_MODEL` / `WORKFLOWS_LLM_API_KEY` at an OpenAI-compatible LLM backend.
|
||||
|
||||
To use Workflows *automations* (scheduled or event-triggered runs, rather than only manual "Run now"), the backend mints oCIS app-passwords on the user's behalf, which requires oCIS's `auth-app` service. App-password support (`PROXY_ENABLE_APP_AUTH`) and the `auth-app` service are both off by default, since they widen the oCIS instance's authentication surface, so you must explicitly:
|
||||
- Set `PROXY_ENABLE_APP_AUTH=true` in the `.env` file.
|
||||
- Add `auth-app` to `START_ADDITIONAL_SERVICES` in the `.env` file, e.g. `START_ADDITIONAL_SERVICES="notifications,auth-app"`.
|
||||
@@ -1,3 +1,6 @@
|
||||
workflows:
|
||||
config:
|
||||
backendUrl: https://${OCIS_DOMAIN|ocis.owncloud.test}/workflows/api/v1beta1
|
||||
importer:
|
||||
config:
|
||||
companionUrl: https://${COMPANION_DOMAIN|companion.owncloud.test}
|
||||
|
||||
@@ -32,6 +32,8 @@ services:
|
||||
OCIS_INSECURE: "${INSECURE:-false}"
|
||||
# basic auth (not recommended, but needed for eg. WebDav clients that do not support OpenID Connect)
|
||||
PROXY_ENABLE_BASIC_AUTH: "${PROXY_ENABLE_BASIC_AUTH:-false}"
|
||||
# app-passwords (needed e.g. for Workflows automations, see workflows.yml)
|
||||
PROXY_ENABLE_APP_AUTH: "${PROXY_ENABLE_APP_AUTH:-false}"
|
||||
# admin user password
|
||||
IDM_ADMIN_PASSWORD: "${ADMIN_PASSWORD:-admin}" # this overrides the admin password from the configuration file
|
||||
# demo users
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
---
|
||||
services:
|
||||
ocis:
|
||||
volumes:
|
||||
- ./config/ocis/apps.yaml:/etc/ocis/apps.yaml
|
||||
depends_on:
|
||||
workflows-init:
|
||||
condition: service_completed_successfully
|
||||
|
||||
workflows-init:
|
||||
image: owncloud/ocis-workflows:${WORKFLOWS_DOCKER_TAG:-latest}
|
||||
user: root
|
||||
entrypoint:
|
||||
- /bin/sh
|
||||
command: ["-c", "cp -R /web/apps/workflows /apps"]
|
||||
volumes:
|
||||
- ocis-apps:/apps
|
||||
logging:
|
||||
driver: ${LOG_DRIVER:-local}
|
||||
|
||||
workflows:
|
||||
image: owncloud/ocis-workflows:${WORKFLOWS_DOCKER_TAG:-latest}
|
||||
networks:
|
||||
ocis-net:
|
||||
depends_on:
|
||||
ocis:
|
||||
condition: service_started
|
||||
environment:
|
||||
WORKFLOWS_OCIS_URL: https://${OCIS_DOMAIN:-ocis.owncloud.test}
|
||||
WORKFLOWS_OCIS_INSECURE: "${INSECURE:-false}"
|
||||
WORKFLOWS_ALLOWED_ORIGIN: https://${OCIS_DOMAIN:-ocis.owncloud.test}
|
||||
WORKFLOWS_LOG_LEVEL: ${LOG_LEVEL:-info}
|
||||
WORKFLOWS_HTTP_ADDR: 0.0.0.0:9105
|
||||
WORKFLOWS_DEBUG_ADDR: 0.0.0.0:9109
|
||||
WORKFLOWS_DB_PATH: /data/workflows.db
|
||||
WORKFLOWS_LLM_ENDPOINT: ${WORKFLOWS_LLM_ENDPOINT}
|
||||
WORKFLOWS_LLM_MODEL: ${WORKFLOWS_LLM_MODEL}
|
||||
WORKFLOWS_LLM_API_KEY: ${WORKFLOWS_LLM_API_KEY}
|
||||
WORKFLOWS_ENCRYPTION_KEY: ${WORKFLOWS_ENCRYPTION_KEY}
|
||||
volumes:
|
||||
- workflows-data:/data
|
||||
healthcheck:
|
||||
test: ["CMD", "wget", "-qO-", "http://localhost:9109/healthz"]
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.workflows.entrypoints=https"
|
||||
- "traefik.http.routers.workflows.rule=Host(`${OCIS_DOMAIN:-ocis.owncloud.test}`) && PathPrefix(`/workflows/api`)"
|
||||
- "traefik.http.routers.workflows.tls.certresolver=http"
|
||||
- "traefik.http.routers.workflows.service=workflows"
|
||||
- "traefik.http.routers.workflows.middlewares=workflows-stripprefix"
|
||||
- "traefik.http.middlewares.workflows-stripprefix.stripprefix.prefixes=/workflows"
|
||||
- "traefik.http.services.workflows.loadbalancer.server.port=9105"
|
||||
logging:
|
||||
driver: ${LOG_DRIVER:-local}
|
||||
restart: always
|
||||
|
||||
volumes:
|
||||
workflows-data:
|
||||
+3
-2
@@ -1,5 +1,6 @@
|
||||
# Documentation
|
||||
|
||||
To contribute to documentation please see also: [Documentation](http://owncloud.dev/ocis/development/build-docs/)
|
||||
**IMPORTANT**\
|
||||
All docs helpers and their output has been migrated to the docs.owncloud.com repo.\
|
||||
Any remaining documentations will finally be migrated to the docs repo too. When done, this folder will be deleted.
|
||||
|
||||
Note that when running a helper like `make -C docs docs-generate` locally, you will see the generated output in e.g. docs/services/<service-name>. When merging a PR, the pipeline will generate the output in the master branch but finally moves it into the `docs` branch. You will therefore _not_ see changes in the docs folder of the master branch!
|
||||
@@ -1,195 +0,0 @@
|
||||
# Docs Helpers
|
||||
|
||||
* [Introduction](#introduction)
|
||||
* [Output Generated](#output-generated)
|
||||
* [Process for Admin Docs](#process-for-admin-docs)
|
||||
* [Working With Branches](#working-with-branches)
|
||||
* [Service-Dependent Envvars](#service-dependent-envvars)
|
||||
* [Generate Envvar Docs From Config Structs](#generate-envvar-docs-from-config-structs)
|
||||
* [Deprecation Process](#deprecation-process)
|
||||
* [Global Envvars](#global-envvars)
|
||||
* [Special Envvars](#special-envvars)
|
||||
* [Special Scope Envvars](#special-scope-envvars)
|
||||
* [Extended Envvars](#extended-envvars)
|
||||
* [Extract Extended Envvars](#extract-extended-envvars)
|
||||
* [Generate Extended Envvar Docs](#generate-extended-envvar-docs)
|
||||
* [Doc Tasks for New Releases](#doc-tasks-for-new-releases)
|
||||
* [Backporting](#backporting)
|
||||
* [Old Processes](#old-processes)
|
||||
|
||||
## Introduction
|
||||
|
||||
This readme file describes how envvars are managed internally for the documentation process.
|
||||
|
||||
`docs/helpers` contains a go program named `main.go` which creates docs by extracting information from the code using additional go programs.
|
||||
|
||||
In `./docs/helpers` run: `go run . --help`\
|
||||
This will give you an overview of available commands.
|
||||
|
||||
Individual steps (programs) can be called manually if needed. Note that not all programs are called automatically on purpose, see the [Doc Tasks for New Releases](#doc-tasks-for-new-releases) below. `main.go` is used by `make docs-generate` (or `make -C docs docs-generate` when running manually from the repos root) which is triggered by the CI or can be called manually. It calls the other required programs and has these main responsibilities for automatic runs:
|
||||
|
||||
- Generate docs for envvars in config structs including deprecations if there are any.
|
||||
- Extract and generate docs for `extended` envvars that are not mentioned in config structs (aka "rogue" envvars).
|
||||
- Extract and generate docs for `global` envvars which occur in multiple services.
|
||||
- Create `docs/service/<service-name>/_index.md` from `service/<service-name>/README.md` files while keeping the existing `_index.md` if the service README.md has not been created so far. Also see the important note at [docs README](../README.md).
|
||||
|
||||
Note that whenever you run `make docs-generate`, a file named `env_vars.yaml` will appear to have changed content. Usually, this change can safely be dropped and no merge is required. BUT, before a new production release ocis is generated, this file neds close attention, manual intervention and changes need to be merged. See the [developer documentation](https://owncloud.dev/general-info/envvars/new-release-process/) for more details.
|
||||
|
||||
|
||||
## Output Generated
|
||||
|
||||
- The generated yaml files can be found at: `docs/services/_includes` when running locally respectively in the `docs branch` after the CI has finished.
|
||||
- The generated adoc files can be found at: `docs/services/_includes/adoc` when running locally respectively in the `docs branch` after the CI has finished.
|
||||
- The file name for global envvars is named: `global_configvars.adoc`.
|
||||
- The file name for extended envvars is named: `extended_configvars.adoc`.
|
||||
- A file named `docs/helpers/env_vars.yaml` containing envvar changes gets updated if changes have been identified.
|
||||
- A file named `docs/helpers/extended_vars.yaml` containing changes for extended envvars gets updated if changes have been identified.\
|
||||
Note, if changes appear, **this file needs manual treatment** before committing, see [Extended Envvars](#extended-envvars) below.
|
||||
|
||||
## Process for Admin Docs
|
||||
|
||||
Whenever a build is triggered from the [ocis Admin](https://github.com/owncloud/docs-ocis) docs or any other admin-related documentation, the files generated in this ocis repository are included in the build process and added in the manner defined by the admin documentation. The updated documentation will then appear on the public [admin documentation](https://doc.owncloud.com/ocis/next) page. The same is true for ocis production releases.
|
||||
|
||||
**Notes**
|
||||
* When docs relevant data will be generated in ocis, they will be written into the `docs/servcies/...` folder structure, but they are in the master branch. When merging, an automated process will **move** them into the `docs` branch.\
|
||||
**When running make commands locally, the relocation is not done and files reside on the generated location!**
|
||||
|
||||
* The above is the reason you should have an up-to-date docs branch before deriving a `docs-stable-x.y` branch from docs - though backports can be done.
|
||||
|
||||
* .adoc file generation
|
||||
* Service related adoc files are autogenerated and saved in `/docs/services/<service-name>` but will be _relocated_ by each merge into the docs branch into a subfolder named `services/_include/adoc/<service-name.adoc>`.
|
||||
* Release based envvar changes are saved during manual generation in `/docs/services/general-info/env-var-deltas/<filename>` but will be _copied_ on each merge into the doc branch into a subfolder named `services/_include/adoc/env-var-deltas/<filename>`.
|
||||
|
||||
* Exclude paths for Hugo
|
||||
* The paths defined above for .adoc files are excluded from parsing by Hugo. The source of what to exclude is defined in the `config.yaml` file located in [owncloud.github.io](https://github.com/owncloud/owncloud.github.io/). Any folder containg .adoc files must be added there else `make -C docs docs-serve` or CI will fail reporting an adoc related parsing error. (We could also add an asciidoc parser to Hugo as alternative...)
|
||||
|
||||
**Backgroud Information**\
|
||||
The admin docs rely on the existence of the following branches in the ocis repository. Note that the admin docs define which ocis branch is accessed via the attributes in the `antora.yml` file in the respective admin docs branch.
|
||||
|
||||
* `docs`\
|
||||
This reflects ocis master and is referenced from the admin docs from the master branch showing as `next` in the documentation.
|
||||
* `docs-stable-x.y`\
|
||||
This reflects a published ocis release and is referenced from the admin docs via the corresponding admin docs branch such as `7.2`.
|
||||
|
||||
Because of this, branching and parametrizing admin docs occurs **after** branching an ocis release with its necessary branches! If you branch admin docs before the required ocis branches are available, you must set the ocis source branch to import data from to `docs` and reconfigure afterwards.
|
||||
|
||||
## Working With Branches
|
||||
|
||||
The following is valid for envvars and yaml files related to the doc process:
|
||||
|
||||
* When filing a pull request in the ocis master branch relating to docs, CI runs `make docs-generate` and copies the result into the `docs` branch of ocis. The `docs` branch is taken as base for the [developer documnetation](owncloud.dev) and as reference for the [admin docs](https://doc.owncloud.com/ocis/next/).
|
||||
* When running `make docs-generate` _locally_, the same output is created as above but it stays in the same branch where the make command was issued.
|
||||
|
||||
In both cases, `make docs-generate` removes files in the target folder `_includes` to avoid remnants. All content is recreated.
|
||||
|
||||
On a side note (unrelated to the `docs` branch), [deployment examples](https://github.com/owncloud/ocis/tree/master/deployments/examples) have their own branch related to an ocis stable version to keep the state consistent, which is necessary for the admin documentation.
|
||||
|
||||
## Service-Dependent Envvars
|
||||
|
||||
For each service available, a file named like `<service name>_configvars.adoc` is created containing a:
|
||||
|
||||
* table on top defining deprecated envvars - if applicable
|
||||
* table containing all envvars with their name, type, default value and description
|
||||
|
||||
The table with deprecations is always printed in the final adoc file even if there are none, but is rendered in the docs build process only if the `HasDeprecations` value is set. This value is automatically handed over via the .adoc file. The template file can be found at `docs/templates/ADOC.tmpl`.
|
||||
|
||||
### Generate Envvar Docs From Config Structs
|
||||
|
||||
Generates docs from a template file, mainly extracting `"env"` and `"desc"` tags from the config structs.
|
||||
|
||||
Templates can be found in `docs/helpers` folder. (Same as this `README`). Check the `.tmpl` files.
|
||||
|
||||
### Deprecation Process
|
||||
|
||||
For details on deprecation see the [deprecating-variables](https://owncloud.dev/services/general-info/envvars/deprecating-variables/) documentation in the dev docs.
|
||||
|
||||
## Global Envvars
|
||||
|
||||
True global envvars are identified by checking if they are available in more than one service. The table created is similar to the service-dependent envvar table but additionally contains a column with all service names where this envvar occurs. The output is rendered in list form where each item is clickable and automatically points to the corresponding service page. The template file can be found at `docs/templates/ADOC_global.tmpl`.
|
||||
|
||||
If global envvars does not appear in the list of globals, before checking if the code works, do a manual search in the `ocis/services` folder with `grep -rn OCIS_xxx` if the envvar in question appears at least twice. If the envvar only appears once, the helpers code works correct.
|
||||
|
||||
**IMPORTANT**\
|
||||
A global envvar may not appear in the globals list though it is named `OCIS_xxx`. This can be the case if a developer decides for a global name but it is currently not used in more than one service!
|
||||
|
||||
## Special Envvars
|
||||
|
||||
### Special Scope Envvars
|
||||
|
||||
These envvars cant be managed automatically and need a full manualy process. See the [Special Scope Envvars](https://owncloud.dev/general-info/envvars/special-envvars/) documentation in the dev docs.
|
||||
|
||||
### Extended Envvars
|
||||
|
||||
For a description and their handling see the [Extended Envvars](https://owncloud.dev/general-info/envvars/special-envvars/) documentation in the dev docs.
|
||||
|
||||
#### Extract Extended Envvars
|
||||
|
||||
The `grep` command parses the code, looking for `os.Getenv` and passes these contents to a yaml file along with the following information:
|
||||
```golang
|
||||
// Variable contains all information about one rogue envvar
|
||||
type Variable struct {
|
||||
// These field structs are automatically filled:
|
||||
// RawName can be the name of the envvar or the name of its var
|
||||
RawName string `yaml:"rawname"`
|
||||
// Path to the envvar with linenumber
|
||||
Path string `yaml:"path"`
|
||||
// FoundInCode indicates if the variable is still found in the codebase.
|
||||
FoundInCode bool `yaml:"foundincode"`
|
||||
// Name is equal to RawName but will not be overwritten in consecutive runs
|
||||
Name string `yaml:"name"`
|
||||
|
||||
// These field structs need manual filling:
|
||||
// Type of the envvar
|
||||
Type string `yaml:"type"`
|
||||
// DefaultValue of the envvar
|
||||
DefaultValue string `yaml:"default_value"`
|
||||
// Description of what this envvar does
|
||||
Description string `yaml:"description"`
|
||||
// Do not export this envvar into the generated adoc table
|
||||
Ignore bool `yaml:"do_ignore"`
|
||||
|
||||
// For simplicity ignored for now:
|
||||
// DependendServices []Service `yaml:"dependend_services"`
|
||||
}
|
||||
```
|
||||
|
||||
This yaml file **can and must be edited manually** to add descriptions, default values, etc.
|
||||
|
||||
**IMPORTANT**: Some value are automatically filled by the program and mujst not be changed. See the developer documentation for more details.
|
||||
|
||||
### Generate Extended Envvar Docs
|
||||
|
||||
The process further picks up the `yaml` file generated in the `Extract Rogue Envvars` step and renders it to an adoc file (a table is created) using a go template. The template file for this step can be found at `docs/templates/ADOC_extended.tmpl`.
|
||||
|
||||
## Doc Tasks for New Releases
|
||||
|
||||
For details see the [Release Process for Envvars](https://owncloud.dev/general-info/envvars/new-release-process/) documentation in the dev docs.
|
||||
|
||||
## Backporting
|
||||
|
||||
The ocis repo contains branches which are necessary for the documentation. The `docs` branch is related to changes in master, necessary for owncloud.dev and the admin docs referencing master content when it comes to envvars and yaml files.
|
||||
|
||||
Cases for a backport can be a typo in an envvar description you want to have fixed in a stable branch too or a file was created after the stable branch was set up but needs to be available in that branch.
|
||||
|
||||
When a new stable ocis release (branch) is published, like `stable-7.2`, an additional branch (including CI) is set up manually by the dev team for referencing docs content like `docs-stable-7.2` - related to envvars and yaml files only - and added to the CI.
|
||||
|
||||
In case it is necessary to transport a change from master to a stable branch like `docs-stable-7.2`, you must backport the original changes that will create that file to the `stable-7.2` branch. The CI will then take care of creating the results in the target `docs-stable-7.2`.
|
||||
|
||||
If the change is expected to have a bigger impact on documenation, you can locally run `make -C docs docs-generate` in the respective branch containing the changes or independently in the `stable-x.y` branch after merging to see if there are additional actions necessary and changed files may need to get checked in.
|
||||
|
||||
## Old Processes
|
||||
|
||||
The generation of delta files for markdown could also be done using a go helper. This should not be done anymore because:
|
||||
|
||||
1. It needs that the production tag is already created for the new release and contains all data.
|
||||
2. The outcome has a different look and feel compared the new process.
|
||||
|
||||
For the sake of documentation because the code still extists, here is the description:
|
||||
|
||||
* Because `env_vars.yaml` has been cleaned up as part of the update tasks, we can rely on its actuality for the branches to be compared.
|
||||
* Create delta files for added, removed and deprecated envvars. To do so type:\
|
||||
`go run . env-var-delta-table` and use as parameter the versions you want to compare. Example: `v7.1.0 v7.2.0`.
|
||||
* List and check the files created in `./docs/helpers/output/env-deltas/`. The markdown files created contain a table with dev relevant data. Any other files created are not relevant and can safely be deleted.
|
||||
* Create a branch and move the markdown files from `./docs/helpers/output/env-deltas/` to `./docs/services/general-info/env-var-deltas/`. The markdown files will be consumed by dev docs from this location.
|
||||
|
||||
* Commit all changes, create a PR and merge. Dev docs is now up-to-date.
|
||||
@@ -1,238 +0,0 @@
|
||||
import yaml
|
||||
import sys
|
||||
import os
|
||||
from datetime import date
|
||||
from urllib.request import urlopen
|
||||
|
||||
## this python script generates based on defined variables adoc files for added, removed and deprecated
|
||||
## envvars based on the env_vars.yaml that must exist in each referenced version.
|
||||
## it is CRUCIAL that the version compared TO is actual - do required updates first!
|
||||
## note that env_vars.yaml has been introduced with v6.0.0, comparing earlier is not possible
|
||||
## note that we are always comparing from github sources and NOT local files
|
||||
|
||||
## when the files got created, you MUST do some post work manually like referencing services with xref:
|
||||
## when running, files get recreated, existing content gets overwritten!!
|
||||
|
||||
## !! you MUST run this script from the local ocis repo root !!
|
||||
## like: python3 docs/helpers/changed_envvars.py
|
||||
## create a branch to prepare the changes
|
||||
|
||||
## WHAT TO CHANGE FOR A NEW RELEASE
|
||||
##
|
||||
## versionOld: To do a proper change comparision from the old to new version, update this var to the FORMER release
|
||||
## versionNew: Change only if master already contains new ennvars that are NOT part of the new release. Set to heads/stable-<new-release>
|
||||
## For the latter case, the relevant env_vars.yaml file mustr be part of the branch referenced !!
|
||||
## from_version and to_version are print strings only used in the generated adoc files
|
||||
## excludePattern: add the FORMER release to the list. The code then searches for anything that does not match the exclude pattern.
|
||||
|
||||
# CHANGE according your needs
|
||||
# old is the base version to compare from which is always a tagged release
|
||||
# new is the target version to compare to and can be a branch or tagged
|
||||
# tagged versions must be of format: 'tags/v7.1.0'
|
||||
# branches are different, master or stable-x.y: 'heads/master'
|
||||
# stick with master because the follow up process is much easier and you avoid confusion
|
||||
versionOld: str = 'tags/v8.1.0'
|
||||
versionNew: str = 'heads/master'
|
||||
|
||||
# CHANGE according your needs
|
||||
from_version: str = '8.1.0'
|
||||
to_version: str = '8.2.0'
|
||||
|
||||
# CHANGE according your needs
|
||||
# this will create files like 5.0.0-7.0.0-added and 5.0.0-7.0.0-removed
|
||||
# this should match which versions you compare. master is ok if that is the base for a named release
|
||||
nameComponent: str = '8.1.0-8.2.0'
|
||||
|
||||
# ADD new elements when a new version has been published so that it gets excluded
|
||||
# array of version patterns to be excluded for added items. we dont need patch versions
|
||||
excludePattern: list[str] = ['pre5.0', '5.0', '6.0', '6.0.0', '6.0.1', '6.1.0', '6.7', '7.0', '7.0.0', '7.1.0', '7.2.0', '7.3.0', '8.0.0', '8.1.0']
|
||||
|
||||
# DO NOT CHANGE
|
||||
# this is the path the added/removed result is written to
|
||||
adocWritePath: str = 'docs/services/general-info/envvars/env-var-deltas'
|
||||
|
||||
# define root sources from github
|
||||
git_left_dir: str = 'https://raw.githubusercontent.com/owncloud/ocis/refs/'
|
||||
git_right_dir: str ='/docs/helpers/env_vars.yaml'
|
||||
|
||||
def check_path() -> None:
|
||||
# check which path the script started. we can do this because the target path must be present
|
||||
# exit if not present
|
||||
if not os.path.exists(adocWritePath):
|
||||
print('Path not found: ' + adocWritePath)
|
||||
sys.exit()
|
||||
|
||||
def get_sources(versionOld: str, versionNew: str) -> (str, str):
|
||||
urlOld = git_left_dir + versionOld + git_right_dir
|
||||
urlNew = git_left_dir + versionNew + git_right_dir
|
||||
|
||||
try:
|
||||
fileOld = urlopen(urlOld).read().decode('utf-8')
|
||||
fileNew = urlopen(urlNew).read().decode('utf-8')
|
||||
return yaml.safe_load(fileOld), yaml.safe_load(fileNew)
|
||||
|
||||
except Exception as e:
|
||||
print(e)
|
||||
sys.exit()
|
||||
|
||||
def get_added(fileNew: str, excludePattern: list[str]) -> set[str]:
|
||||
# create dict with added items
|
||||
addedWith: set[str] = {}
|
||||
for key, value in fileNew.items():
|
||||
if not fileNew[key]['introductionVersion'] in str(excludePattern):
|
||||
addedWith[key] = value
|
||||
return addedWith
|
||||
|
||||
def get_removed(fileOld: str, fileNew: str) -> set[str]:
|
||||
# create dict with removed items
|
||||
removedWith: set[str] = {}
|
||||
for key, value in fileOld.items():
|
||||
if not key in fileNew:
|
||||
removedWith[key] = value
|
||||
return removedWith
|
||||
|
||||
def get_deprecated(fileNew: str) -> set[str]:
|
||||
# create dict with deprecated items
|
||||
deprecatedWith: set[str] = {}
|
||||
for key, value in fileNew.items():
|
||||
if value['removalVersion']:
|
||||
deprecatedWith[key] = value
|
||||
return deprecatedWith
|
||||
|
||||
def create_adoc_start(type_text: str, from_version: str, to_version: str, creation_date: str, columns: str, closing: str) -> str:
|
||||
# create the page/table header
|
||||
# 'closing' contains variable column names dependen if added/removed ir deprecated
|
||||
a: str = '''// # {ftype} Variables between oCIS {ffrom} and oCIS {fto}
|
||||
// commenting the headline to make it better includable
|
||||
|
||||
// table created per {fdate}
|
||||
// the table should be recreated/updated on source () changes
|
||||
|
||||
[width="100%",cols="{fcolumns}",options="header"]
|
||||
|===
|
||||
| Service | Variable | Description | {fclosing}
|
||||
|
||||
'''.format(ftype = type_text, ffrom = from_version, fto = to_version, fdate = creation_date, fcolumns = columns, fclosing = closing)
|
||||
return a
|
||||
|
||||
def create_adoc_end() -> str:
|
||||
# close the table
|
||||
a: str = '''|===
|
||||
|
||||
'''
|
||||
return a
|
||||
|
||||
def add_adoc_line_1(service: str, variable: str, description: str, value: str) -> str:
|
||||
# add a table line for added/removed
|
||||
# the dummy values are only here to have the same number of parameters as add_adoc_line_2
|
||||
a: str = '''| {fservice}
|
||||
| {fvariable}
|
||||
| {fdescription}
|
||||
| {fvalue}
|
||||
|
||||
'''.format(fservice = service, fvariable = variable, fdescription = description, fvalue = value)
|
||||
return a
|
||||
|
||||
def add_adoc_line_2(service, variable, description, removalVersion, deprecationInfo):
|
||||
# add a table line for deprecated, this has different columns
|
||||
a: str = '''| {fservice}
|
||||
| {fvariable}
|
||||
| {fdescription}
|
||||
| {fremovalVersion}
|
||||
| {fdeprecationInfo}
|
||||
|
||||
'''.format(fservice = service, fvariable = variable, fdescription = description, fremovalVersion = removalVersion, fdeprecationInfo = deprecationInfo)
|
||||
return a
|
||||
|
||||
def create_table(type_text: str, source_dict: set[str], from_version: str, to_version: str, date_today: str, type: bool = False) -> str:
|
||||
# get the table header
|
||||
columns: str = '~,~,~,~' if type == False else '~,~,~,~,~'
|
||||
closing: str = 'Default' if type == False else 'Removal Version | Deprecation Info'
|
||||
a: str = create_adoc_start(type_text, from_version, to_version, date_today, columns, closing)
|
||||
|
||||
if not type:
|
||||
# added and removed envvars
|
||||
# first add all ocis_
|
||||
for key, value in source_dict.items():
|
||||
if key.startswith('OCIS_'):
|
||||
a += add_adoc_line_1(
|
||||
# note that any envvar starting with ocis cant be assigned to a service automatically
|
||||
# the xref must be corrected in the output file manually
|
||||
'xref:deployment/services/env-vars-special-scope.adoc[Special Scope Envvars]',
|
||||
key,
|
||||
value['description'],
|
||||
value['defaultValue']
|
||||
)
|
||||
# then add all others
|
||||
for key, value in source_dict.items():
|
||||
if not key.startswith('OCIS_'):
|
||||
a += add_adoc_line_1(
|
||||
'xref:{s-path}/xxx.adoc[xxx]',
|
||||
key,
|
||||
value['description'],
|
||||
value['defaultValue']
|
||||
)
|
||||
else:
|
||||
# deprecated envvars
|
||||
# first add all ocis_
|
||||
for key, value in source_dict.items():
|
||||
if key.startswith('OCIS_'):
|
||||
a += add_adoc_line_2(
|
||||
'xref:deployment/services/env-vars-special-scope.adoc[Special Scope Envvars]',
|
||||
key,
|
||||
value['description'],
|
||||
value['removalVersion'],
|
||||
value['deprecationInfo']
|
||||
)
|
||||
# then add all others
|
||||
for key, value in source_dict.items():
|
||||
if not key.startswith('OCIS_'):
|
||||
a += add_adoc_line_2(
|
||||
'xref:{s-path}/xxx.adoc[xxx]',
|
||||
key,
|
||||
value['description'],
|
||||
value['removalVersion'],
|
||||
value['deprecationInfo']
|
||||
)
|
||||
|
||||
# finally close the table
|
||||
a += create_adoc_end()
|
||||
return a
|
||||
|
||||
def write_output(a: str, type_text: str) -> None:
|
||||
# write the content to a file
|
||||
try:
|
||||
with open(adocWritePath + '/' + nameComponent + '-' + type_text + '.adoc', 'w') as file:
|
||||
file.write(a)
|
||||
except Exception as e:
|
||||
print('Failed creating ' + type_text + ' file')
|
||||
print(e)
|
||||
sys.exit()
|
||||
|
||||
def main() -> None:
|
||||
## here are the tasks in sequence
|
||||
|
||||
fileOld: str = ''
|
||||
fileNew: str = ''
|
||||
addedWith: set[str] = {}
|
||||
removedWith: set[str] = {}
|
||||
deprecatedWith: set[str] = {}
|
||||
|
||||
check_path()
|
||||
fileOld, fileNew = get_sources(versionOld, versionNew)
|
||||
addedWith = get_added(fileNew, excludePattern)
|
||||
removedWith = get_removed(fileOld, fileNew)
|
||||
deprecatedWith = get_deprecated(fileNew)
|
||||
|
||||
a: str = create_table('Added', addedWith, from_version, to_version, date.today().strftime('%Y.%m.%d'))
|
||||
r: str = create_table('Removed', removedWith, from_version, to_version, date.today().strftime('%Y.%m.%d'))
|
||||
d: str = create_table('Deprecated', deprecatedWith, from_version, to_version, date.today().strftime('%Y.%m.%d'), True)
|
||||
|
||||
write_output(a, 'added')
|
||||
write_output(r, 'removed')
|
||||
write_output(d, 'deprecated')
|
||||
|
||||
print('Success, see files created in: ' + adocWritePath)
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,86 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"strings"
|
||||
"text/template"
|
||||
)
|
||||
|
||||
var targets = map[string]string{
|
||||
"templates/adoc-generator.go.tmpl": "output/adoc/adoc-generator.go",
|
||||
"templates/example-config-generator.go.tmpl": "output/exampleconfig/example-config-generator.go",
|
||||
"templates/environment-variable-docs-generator.go.tmpl": "output/env/environment-variable-docs-generator.go",
|
||||
"templates/envar-delta-table.go.tmpl": "output/env/envvar-delta-table.go",
|
||||
}
|
||||
|
||||
// RenderTemplates does something with templates
|
||||
func RenderTemplates() {
|
||||
fmt.Println("Getting relevant packages")
|
||||
paths, err := filepath.Glob("../../services/*/pkg/config/defaults/defaultconfig.go")
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
replacer := strings.NewReplacer(
|
||||
"../../", "github.com/owncloud/ocis/v2/",
|
||||
"/defaultconfig.go", "",
|
||||
)
|
||||
for i := range paths {
|
||||
paths[i] = replacer.Replace(paths[i])
|
||||
}
|
||||
|
||||
for template, output := range targets {
|
||||
generateIntermediateCode(template, output, paths)
|
||||
runIntermediateCode(output)
|
||||
}
|
||||
fmt.Println("Cleaning up")
|
||||
err = os.RemoveAll("output")
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
}
|
||||
}
|
||||
|
||||
func generateIntermediateCode(templatePath string, intermediateCodePath string, paths []string) {
|
||||
content, err := os.ReadFile(templatePath)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
fmt.Println("Generating intermediate go code for " + intermediateCodePath + " using template " + templatePath)
|
||||
tpl := template.Must(template.New("").Parse(string(content)))
|
||||
err = os.MkdirAll(path.Dir(intermediateCodePath), 0700)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
runner, err := os.Create(intermediateCodePath)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
err = tpl.Execute(runner, paths)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
func runIntermediateCode(intermediateCodePath string) {
|
||||
fmt.Println("Running intermediate go code for " + intermediateCodePath)
|
||||
defaultConfigPath := "/etc/ocis"
|
||||
defaultDataPath := "/var/lib/ocis"
|
||||
os.Setenv("OCIS_BASE_DATA_PATH", defaultDataPath)
|
||||
os.Setenv("OCIS_CONFIG_DIR", defaultConfigPath)
|
||||
|
||||
// Set AUTOMEMLIMIT_EXPERIMENT=system on non-Linux systems to avoid cgroups errors
|
||||
if runtime.GOOS != "linux" {
|
||||
os.Setenv("AUTOMEMLIMIT_EXPERIMENT", "system")
|
||||
}
|
||||
|
||||
out, err := exec.Command("go", "run", intermediateCodePath).CombinedOutput()
|
||||
if err != nil {
|
||||
log.Fatal(string(out), err)
|
||||
}
|
||||
fmt.Println(string(out))
|
||||
}
|
||||
@@ -1,122 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/rogpeppe/go-internal/semver"
|
||||
"gopkg.in/yaml.v2"
|
||||
"log"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"text/template"
|
||||
)
|
||||
|
||||
const envVarYamlSource = "env_vars.yaml"
|
||||
|
||||
var envVarOutPutTemplates = map[string]string{
|
||||
"added": "templates/env-vars-added.md.tmpl",
|
||||
"removed": "templates/env-vars-removed.md.tmpl",
|
||||
"deprecated": "templates/env-vars-deprecated.md.tmpl",
|
||||
}
|
||||
|
||||
// ConfigField represents the env-var annotation in the code
|
||||
type ConfigField struct {
|
||||
Name string `yaml:"name"`
|
||||
DefaultValue string `yaml:"defaultValue"`
|
||||
Type string `yaml:"type"`
|
||||
Description string `yaml:"description"`
|
||||
IntroductionVersion string `yaml:"introductionVersion"`
|
||||
DeprecationVersion string `yaml:"deprecationVersion"`
|
||||
RemovalVersion string `yaml:"removalVersion"`
|
||||
DeprecationInfo string `yaml:"deprecationInfo"`
|
||||
}
|
||||
|
||||
type TemplateData struct {
|
||||
StartVersion string
|
||||
EndVersion string
|
||||
DeltaFields []*ConfigField
|
||||
}
|
||||
|
||||
// RenderEnvVarDeltaTable generates tables for env-var deltas
|
||||
func RenderEnvVarDeltaTable(osArgs []string) {
|
||||
if !semver.IsValid(osArgs[2]) {
|
||||
log.Fatalf("Start version invalid semver: %s", osArgs[2])
|
||||
}
|
||||
if !semver.IsValid(osArgs[3]) {
|
||||
log.Fatalf("Target version invalid semver: %s", osArgs[3])
|
||||
}
|
||||
if semver.Compare(osArgs[2], osArgs[3]) >= 0 {
|
||||
log.Fatalf("Start version %s is not smaller than target version %s", osArgs[2], osArgs[3])
|
||||
}
|
||||
if semver.Compare(osArgs[2], "v5.0.0") < 0 {
|
||||
log.Fatalf("This tool does not support versions prior v5.0.0, (given %s)", osArgs[2])
|
||||
}
|
||||
startVersion := osArgs[2]
|
||||
endVersion := osArgs[3]
|
||||
fmt.Printf("Generating tables for env-var deltas between version %s and %s...\n", startVersion, endVersion)
|
||||
curdir, err := os.Getwd()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
fullYamlPath := filepath.Join(curdir, envVarYamlSource)
|
||||
configFields := make(map[string]*ConfigField)
|
||||
variableList := map[string][]*ConfigField{
|
||||
"added": {},
|
||||
"removed": {},
|
||||
"deprecated": {},
|
||||
}
|
||||
fmt.Printf("Reading existing variable definitions from %s\n", fullYamlPath)
|
||||
yfile, err := os.ReadFile(fullYamlPath)
|
||||
if err == nil {
|
||||
err := yaml.Unmarshal(yfile, configFields)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
fmt.Printf("Success, found %d entries\n", len(configFields))
|
||||
for _, field := range configFields {
|
||||
if field.IntroductionVersion != "" &&
|
||||
field.IntroductionVersion != "pre5.0" &&
|
||||
!semver.IsValid(field.IntroductionVersion) &&
|
||||
field.IntroductionVersion[0] != 'v' {
|
||||
field.IntroductionVersion = "v" + field.IntroductionVersion
|
||||
}
|
||||
if field.IntroductionVersion != "pre5.0" && !semver.IsValid(field.IntroductionVersion) {
|
||||
fmt.Printf("Invalid semver for field %s: %s\n", field.Name, field.IntroductionVersion)
|
||||
os.Exit(1)
|
||||
}
|
||||
//fmt.Printf("Processing field %s dv: %s, iv: %s\n", field.Name, field.DeprecationVersion, field.IntroductionVersion)
|
||||
if semver.IsValid(field.RemovalVersion) && semver.Compare(startVersion, field.RemovalVersion) < 0 && semver.Compare(endVersion, field.RemovalVersion) >= 0 {
|
||||
variableList["removed"] = append(variableList["removed"], field)
|
||||
}
|
||||
if semver.IsValid(field.DeprecationVersion) && semver.Compare(startVersion, field.DeprecationVersion) <= 0 && semver.Compare(endVersion, field.DeprecationVersion) > 0 {
|
||||
variableList["deprecated"] = append(variableList["deprecated"], field)
|
||||
}
|
||||
if semver.IsValid(field.IntroductionVersion) && semver.Compare(startVersion, field.IntroductionVersion) <= 0 && semver.Compare(endVersion, field.IntroductionVersion) >= 0 {
|
||||
fmt.Printf("Adding field %s iv: %s\n", field.Name, field.IntroductionVersion)
|
||||
variableList["added"] = append(variableList["added"], field)
|
||||
}
|
||||
}
|
||||
for templateName, templatePath := range envVarOutPutTemplates {
|
||||
content, err := os.ReadFile(templatePath)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
tpl := template.Must(template.New(templateName).Parse(string(content)))
|
||||
err = os.MkdirAll("output/env-deltas", 0700)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
targetFile, err := os.Create(filepath.Join("output/env-deltas", fmt.Sprintf("%s-%s-%s.md", startVersion, endVersion, templateName)))
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
err = tpl.Execute(targetFile, TemplateData{
|
||||
StartVersion: startVersion,
|
||||
EndVersion: endVersion,
|
||||
DeltaFields: variableList[templateName],
|
||||
})
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,207 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"regexp"
|
||||
"sort"
|
||||
"strings"
|
||||
"text/template"
|
||||
|
||||
"gopkg.in/yaml.v2"
|
||||
)
|
||||
|
||||
const yamlSource = "extended_vars.yaml"
|
||||
|
||||
// ConfigVars is the main yaml source
|
||||
type ConfigVars struct {
|
||||
Variables []Variable `yaml:"variables"`
|
||||
}
|
||||
|
||||
// Variable contains all information about one rogue envvar
|
||||
type Variable struct {
|
||||
// These field structs are automatically filled:
|
||||
// RawName can be the name of the envvar or the name of its var
|
||||
RawName string `yaml:"rawname"`
|
||||
// Path to the envvar with linenumber
|
||||
Path string `yaml:"path"`
|
||||
// FoundInCode indicates if the variable is still found in the codebase. TODO: delete immediately?
|
||||
FoundInCode bool `yaml:"foundincode"`
|
||||
// Name is equal to RawName but will not be overwritten in consecutive runs
|
||||
Name string `yaml:"name"`
|
||||
|
||||
// These field structs need manual filling:
|
||||
// Type of the envvar
|
||||
Type string `yaml:"type"`
|
||||
// DefaultValue of the envvar
|
||||
DefaultValue string `yaml:"default_value"`
|
||||
// Description of what this envvar does
|
||||
Description string `yaml:"description"`
|
||||
// Ignore this envvar when creating docs?
|
||||
Ignore bool `yaml:"do_ignore"`
|
||||
|
||||
// For simplicity ignored for now:
|
||||
// DependendServices []Service `yaml:"dependend_services"`
|
||||
}
|
||||
|
||||
// GetRogueEnvs extracts the rogue envs from the code
|
||||
func GetRogueEnvs() {
|
||||
curdir, err := os.Getwd()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
fullYamlPath := filepath.Join(curdir, yamlSource)
|
||||
re := regexp.MustCompile(`os.Getenv\(([^\)]+)\)`)
|
||||
vars := &ConfigVars{}
|
||||
fmt.Printf("Reading existing variable definitions from %s\n", fullYamlPath)
|
||||
yfile, err := os.ReadFile(fullYamlPath)
|
||||
if err == nil {
|
||||
err := yaml.Unmarshal(yfile, &vars)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
if err := os.Chdir("../../"); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
// Option to process a specific directory, for faster development iteration
|
||||
processDir := os.Getenv("DIR")
|
||||
if processDir == "" {
|
||||
processDir = "."
|
||||
}
|
||||
|
||||
fmt.Printf("Processing directory: %s\n", processDir)
|
||||
|
||||
// Old command `grep -RHn os.Getenv $DIR --exclude-dir=vendor | grep -v extendedEnv.go | grep \\.go`
|
||||
// New command, 10x faster than direct grep:
|
||||
// C_ALL=C - Sets locale to C for consistent output
|
||||
// find %s -type f -name '*.go' - Finds all .go files in the specified directory
|
||||
// xargs -0 -P $(getconf _NPROCESSORS_ONLN) - Processes files in parallel using all available CPU cores
|
||||
// grep -F -Hn 'os.Getenv' - Searches for literal "os.Getenv" with filename and line number output
|
||||
grepCmd := fmt.Sprintf("C_ALL=C find %s -type f -name '*.go' -not -path '*/vendor/*' -print0 | xargs -0 -P $(getconf _NPROCESSORS_ONLN) grep -F -Hn 'os.Getenv' | grep -v extendedEnv.go", processDir)
|
||||
out, err := exec.Command("sh", "-c", grepCmd).Output()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
lines := strings.Split(string(out), "\n")
|
||||
|
||||
// find current vars
|
||||
currentVars := make(map[string]Variable)
|
||||
totalLines := len(lines)
|
||||
fmt.Printf("Processing %d lines...\n", totalLines)
|
||||
|
||||
for _, l := range lines {
|
||||
|
||||
if l == "" {
|
||||
continue
|
||||
}
|
||||
|
||||
fmt.Printf("Parsing %s\n", l)
|
||||
r := strings.SplitN(l, ":", 3)
|
||||
if len(r) != 3 || r[0] == "" || r[2] == "" {
|
||||
continue
|
||||
}
|
||||
|
||||
// Remove ./ prefix from path if it exists
|
||||
path := strings.TrimPrefix(r[0], "./")
|
||||
path = path + ":" + r[1] // Reconstruct path:line
|
||||
content := r[2]
|
||||
|
||||
res := re.FindAllSubmatch([]byte(content), -1)
|
||||
if len(res) < 1 {
|
||||
fmt.Printf(" No envvar found in content: %s\n", content)
|
||||
continue
|
||||
}
|
||||
|
||||
for _, m := range res {
|
||||
name := strings.Trim(string(m[1]), "\"")
|
||||
fmt.Printf(" Found envvar: %s at %s\n", name, path)
|
||||
currentVars[path+name] = Variable{
|
||||
RawName: name,
|
||||
Path: path,
|
||||
FoundInCode: true,
|
||||
Name: name,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fmt.Printf("Found %d current variables\n", len(currentVars))
|
||||
// adjust existing vars
|
||||
for i, v := range vars.Variables {
|
||||
_, ok := currentVars[v.Path+v.RawName]
|
||||
if !ok {
|
||||
vars.Variables[i].FoundInCode = false
|
||||
continue
|
||||
}
|
||||
|
||||
vars.Variables[i].FoundInCode = true
|
||||
delete(currentVars, v.Path+v.RawName)
|
||||
}
|
||||
|
||||
// add new envvars
|
||||
for _, v := range currentVars {
|
||||
vars.Variables = append(vars.Variables, v)
|
||||
}
|
||||
|
||||
less := func(i, j int) bool {
|
||||
return vars.Variables[i].Name < vars.Variables[j].Name
|
||||
}
|
||||
|
||||
sort.Slice(vars.Variables, less)
|
||||
|
||||
output, err := yaml.Marshal(vars)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
fmt.Printf("Writing new variable definitions to %s\n", fullYamlPath)
|
||||
err = os.WriteFile(fullYamlPath, output, 0666)
|
||||
if err != nil {
|
||||
log.Fatalf("could not write %s", fullYamlPath)
|
||||
}
|
||||
if err := os.Chdir(curdir); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
// RenderGlobalVarsTemplate renders the global vars template
|
||||
func RenderGlobalVarsTemplate() {
|
||||
curdir, err := os.Getwd()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
fullYamlPath := filepath.Join(curdir, yamlSource)
|
||||
|
||||
content, err := os.ReadFile("../../docs/templates/ADOC_extended.tmpl")
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
targetFolder := "../../docs/services/_includes/adoc/"
|
||||
|
||||
vars := &ConfigVars{}
|
||||
fmt.Printf("Reading existing variable definitions from %s\n", fullYamlPath)
|
||||
yfile, err := os.ReadFile(fullYamlPath)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
err = yaml.Unmarshal(yfile, &vars)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
targetFile, err := os.Create(filepath.Join(targetFolder, "extended_configvars.adoc"))
|
||||
if err != nil {
|
||||
log.Fatalf("Failed to create target file: %s", err)
|
||||
}
|
||||
defer targetFile.Close()
|
||||
|
||||
tpl := template.Must(template.New("").Parse(string(content)))
|
||||
if err = tpl.Execute(targetFile, *vars); err != nil {
|
||||
log.Fatalf("Failed to execute template: %s", err)
|
||||
}
|
||||
}
|
||||
@@ -1,203 +0,0 @@
|
||||
variables:
|
||||
- rawname: CS3_GATEWAY
|
||||
path: services/idp/pkg/backends/cs3/bootstrap/cs3.go:77
|
||||
foundincode: true
|
||||
name: CS3_GATEWAY
|
||||
type: ""
|
||||
default_value: ""
|
||||
description: ""
|
||||
do_ignore: true
|
||||
- rawname: CS3_MACHINE_AUTH_API_KEY
|
||||
path: services/idp/pkg/backends/cs3/bootstrap/cs3.go:78
|
||||
foundincode: true
|
||||
name: CS3_MACHINE_AUTH_API_KEY
|
||||
type: ""
|
||||
default_value: ""
|
||||
description: ""
|
||||
do_ignore: true
|
||||
- rawname: DAYS
|
||||
path: tests/qa-activity-report/generate-qa-activity-report.go:94
|
||||
foundincode: true
|
||||
name: DAYS
|
||||
type: ""
|
||||
default_value: ""
|
||||
description: ""
|
||||
do_ignore: true
|
||||
- rawname: _registryRegisterIntervalEnv
|
||||
path: ocis-pkg/registry/expiry.go:19
|
||||
foundincode: true
|
||||
name: EXPERIMENTAL_REGISTER_INTERVAL
|
||||
type: ""
|
||||
default_value: ""
|
||||
description: ""
|
||||
do_ignore: true
|
||||
- rawname: _registryRegisterTTLEnv
|
||||
path: ocis-pkg/registry/expiry.go:28
|
||||
foundincode: true
|
||||
name: EXPERIMENTAL_REGISTER_TTL
|
||||
type: ""
|
||||
default_value: ""
|
||||
description: ""
|
||||
do_ignore: true
|
||||
- rawname: GITHUB_TOKEN
|
||||
path: tools/ci-reporter/cmd/list-flaky-tests/main.go:66
|
||||
foundincode: true
|
||||
name: GITHUB_TOKEN
|
||||
type: ""
|
||||
default_value: ""
|
||||
description: ""
|
||||
do_ignore: true
|
||||
- rawname: _serverMaxConnectionAgeEnv
|
||||
path: ocis-pkg/service/grpc/keepalive.go:19
|
||||
foundincode: true
|
||||
name: GRPC_MAX_CONNECTION_AGE
|
||||
type: Duration
|
||||
default_value: "9223372036854775807"
|
||||
description: Timeout for GRPC connections. After timeout, a new connection will
|
||||
be established automatically. The default value is in ns and is about 2.5 mio
|
||||
h.
|
||||
do_ignore: false
|
||||
- rawname: MICRO_LOG_LEVEL
|
||||
path: ocis-pkg/log/log.go:34
|
||||
foundincode: true
|
||||
name: MICRO_LOG_LEVEL
|
||||
type: ""
|
||||
default_value: ""
|
||||
description: ""
|
||||
do_ignore: true
|
||||
- rawname: MICRO_LOG_LEVEL
|
||||
path: ocis-pkg/log/log.go:31
|
||||
foundincode: false
|
||||
name: MICRO_LOG_LEVEL
|
||||
type: string
|
||||
default_value: Error
|
||||
description: Set the log level for the internal go micro framework. Only change
|
||||
on supervision of ownCloud Support.
|
||||
do_ignore: false
|
||||
- rawname: MICRO_LOG_LEVEL
|
||||
path: ocis-pkg/log/log.go:30
|
||||
foundincode: true
|
||||
name: MICRO_LOG_LEVEL
|
||||
type: ""
|
||||
default_value: ""
|
||||
description: ""
|
||||
do_ignore: true
|
||||
- rawname: _registryEnv
|
||||
path: ocis-pkg/registry/registry.go:88
|
||||
foundincode: true
|
||||
name: MICRO_REGISTRY
|
||||
type: string
|
||||
default_value: nats-js-kv
|
||||
description: 'The Go micro registry type to use. Supported types are: ''memory''
|
||||
and ''nats-js-kv'' (default). Only change on supervision of ownCloud Support.'
|
||||
do_ignore: false
|
||||
- rawname: _registryAddressEnv
|
||||
path: ocis-pkg/registry/registry.go:92
|
||||
foundincode: true
|
||||
name: MICRO_REGISTRY_ADDRESS
|
||||
type: ""
|
||||
default_value: ""
|
||||
description: ""
|
||||
do_ignore: true
|
||||
- rawname: _registryAddressEnv
|
||||
path: ocis-pkg/natsjsregistry/registry.go:206
|
||||
foundincode: true
|
||||
name: MICRO_REGISTRY_ADDRESS
|
||||
type: string
|
||||
default_value: 127.0.0.1:9233
|
||||
description: The bind address of the internal go micro framework. Only change on
|
||||
supervision of ownCloud Support.
|
||||
do_ignore: false
|
||||
- rawname: _registryPasswordEnv
|
||||
path: ocis-pkg/natsjsregistry/registry.go:234
|
||||
foundincode: true
|
||||
name: MICRO_REGISTRY_AUTH_PASSWORD
|
||||
type: string
|
||||
default_value: ""
|
||||
description: Optional when using nats to authenticate with the nats cluster.
|
||||
do_ignore: false
|
||||
- rawname: _registryUsernameEnv
|
||||
path: ocis-pkg/natsjsregistry/registry.go:234
|
||||
foundincode: true
|
||||
name: MICRO_REGISTRY_AUTH_USERNAME
|
||||
type: string
|
||||
default_value: ""
|
||||
description: Optional when using nats to authenticate with the nats cluster.
|
||||
do_ignore: false
|
||||
- rawname: MONTH
|
||||
path: tests/qa-activity-report/generate-qa-activity-report.go:92
|
||||
foundincode: true
|
||||
name: MONTH
|
||||
type: ""
|
||||
default_value: ""
|
||||
description: ""
|
||||
do_ignore: true
|
||||
- rawname: OCIS_BASE_DATA_PATH
|
||||
path: ocis-pkg/config/defaults/paths.go:23
|
||||
foundincode: true
|
||||
name: OCIS_BASE_DATA_PATH
|
||||
type: string
|
||||
default_value: ""
|
||||
description: The base directory location used by several services and for user data.
|
||||
See the General Info section in the documentation for more details on defaults.
|
||||
Services can have, if available, an individual setting with an own environment
|
||||
variable.
|
||||
do_ignore: false
|
||||
- rawname: OCIS_BASE_DATA_PATH
|
||||
path: ocis/pkg/command/shares.go:50
|
||||
foundincode: true
|
||||
name: OCIS_BASE_DATA_PATH
|
||||
type: ""
|
||||
default_value: ""
|
||||
description: ""
|
||||
do_ignore: true
|
||||
- rawname: OCIS_CONFIG_DIR
|
||||
path: ocis-pkg/config/defaults/paths.go:56
|
||||
foundincode: true
|
||||
name: OCIS_CONFIG_DIR
|
||||
type: string
|
||||
default_value: ""
|
||||
description: The default directory location for config files. See the General Info
|
||||
section in the documentation for more details on defaults.
|
||||
do_ignore: false
|
||||
- rawname: OCIS_INSECURE
|
||||
path: ocis-pkg/service/grpc/client.go:79
|
||||
foundincode: true
|
||||
name: OCIS_INSECURE
|
||||
type: bool
|
||||
default_value: "false"
|
||||
description: Insecure TLS mode is only allowed in development environments with
|
||||
OCIS_INSECURE=true
|
||||
do_ignore: false
|
||||
- rawname: OCIS_INSECURE
|
||||
path: services/idp/pkg/service/v0/service.go:366
|
||||
foundincode: true
|
||||
name: OCIS_INSECURE
|
||||
type: ""
|
||||
default_value: ""
|
||||
description: ""
|
||||
do_ignore: true
|
||||
- rawname: RUN_CMD_TEST
|
||||
path: internal/testenv/test.go:32
|
||||
foundincode: true
|
||||
name: RUN_CMD_TEST
|
||||
type: ""
|
||||
default_value: ""
|
||||
description: ""
|
||||
do_ignore: true
|
||||
- rawname: YEAR
|
||||
path: tests/qa-activity-report/generate-qa-activity-report.go:93
|
||||
foundincode: true
|
||||
name: YEAR
|
||||
type: ""
|
||||
default_value: ""
|
||||
description: ""
|
||||
do_ignore: true
|
||||
- rawname: parts[0]
|
||||
path: ocis-pkg/config/envdecode/envdecode.go:396
|
||||
foundincode: true
|
||||
name: parts[0]
|
||||
type: ""
|
||||
default_value: ""
|
||||
description: false positive - code that extract envvars for config structs
|
||||
do_ignore: true
|
||||
@@ -1,93 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# This script must be run from the root folder of the ocis repo such as:
|
||||
# docs/helpers/identify_envvar_placeholder_names.sh
|
||||
|
||||
# The following grep will filter out every line containing an `env` annotation AND
|
||||
# containing a non semver `introductionVersion` annotation that is used as placeholder.
|
||||
# note that invalid `introductionVersion` annotations are already covered via:
|
||||
# /.make/check-env-var-annotations.sh as part of the CI
|
||||
|
||||
RED=$(echo -e "\033[0;31m")
|
||||
GREEN=$(echo -e "\033[0;32m")
|
||||
NORM=$(echo -e "\033[0m")
|
||||
|
||||
|
||||
# build the correct regex
|
||||
IV_REGEX='(?:introductionVersion:\")(?!pre5\.0)(?:[^\d].*?\")'
|
||||
IV_NAME=introductionVersion
|
||||
|
||||
RV_REGEX='(?:removalVersion:\")(?!pre5\.0)(?:[^\d].*?\")'
|
||||
RV_NAME=removalVersion
|
||||
|
||||
EXCLUDE_PATHS='_test.go|vendor/'
|
||||
|
||||
# create a here doc function to be printed when the option is selected
|
||||
# note that tabs are used intentionally. they are removed by cat but are required to make the code readable.
|
||||
print_version_examples() {
|
||||
cat <<-EOL
|
||||
${GREEN}Valid $1 examples:${NORM}
|
||||
|
||||
$1:"releaseX" # acceptable alphabetical version
|
||||
$1:"Addams" # another alphabetical example such as a release name
|
||||
$1:"Addams.8" # another alphabetical example such as a release name plus a version
|
||||
$1:"%%NEXT%%" # a dummy placeholder as release name
|
||||
|
||||
See the dev docs for more details: https://owncloud.dev/services/general-info/envvars/envvar-naming-scopes/
|
||||
EOL
|
||||
}
|
||||
|
||||
# ask what the script should search for
|
||||
echo "Select one of the following keys to search for:"
|
||||
echo
|
||||
echo " 1) introductionVersion"
|
||||
echo " 2) removalVersion"
|
||||
echo " 3) Print valid matching search pattern examples"
|
||||
echo
|
||||
read -s -n 1 n
|
||||
case $n in
|
||||
1) USEREGEX="${IV_REGEX}"
|
||||
NAME="${IV_NAME}"
|
||||
echo "Running..."
|
||||
;;
|
||||
2) USEREGEX="${RV_REGEX}"
|
||||
NAME="${RV_NAME}"
|
||||
echo "Running..."
|
||||
;;
|
||||
3) echo
|
||||
print_version_examples "${IV_NAME}"
|
||||
echo
|
||||
print_version_examples "${RV_NAME}"
|
||||
echo
|
||||
exit
|
||||
;;
|
||||
*) echo "Invalid option"
|
||||
exit
|
||||
;;
|
||||
esac
|
||||
|
||||
# query the code
|
||||
QS=$(grep -rn --include=\*.go "env:" | grep -v -E "${EXCLUDE_PATHS}" | grep --color=always -P "${USEREGEX}")
|
||||
|
||||
# count the results found
|
||||
RESULTS_COUNT=$(echo "${QS}"|wc -l)
|
||||
|
||||
# add a new line after each hit, eol identified via "´ which only appears at the end of each envvar string definition
|
||||
QUERY_RESULT=$(echo "${QS}" | sed "s#\"\`#\"\`\n#g")
|
||||
|
||||
echo "Checking ${NAME} annotations"
|
||||
|
||||
if [ "${QUERY_RESULT}" != "" ] && [ "${RESULTS_COUNT}" -gt 0 ]; then
|
||||
echo
|
||||
echo "==============================================================================================="
|
||||
echo ${GREEN}"The following items contain placeholder ${NAME} annotation(s):"${NORM}
|
||||
echo "==============================================================================================="
|
||||
echo
|
||||
echo "$QUERY_RESULT"
|
||||
echo
|
||||
echo ${GREEN}"${RESULTS_COUNT} items found"${NORM}
|
||||
echo
|
||||
else
|
||||
echo ${GREEN}"No matching placeholders for ${NAME} annotations found."${NORM}
|
||||
echo
|
||||
fi
|
||||
@@ -1,45 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
)
|
||||
|
||||
func main() {
|
||||
if len(os.Args) > 1 {
|
||||
switch os.Args[1] {
|
||||
case "templates":
|
||||
RenderTemplates()
|
||||
case "rogue":
|
||||
GetRogueEnvs()
|
||||
case "globals":
|
||||
RenderGlobalVarsTemplate()
|
||||
case "service-index":
|
||||
GenerateServiceIndexMarkdowns()
|
||||
case "env-var-delta-table":
|
||||
// This step is not covered by the all or default case, because it needs explicit arguments
|
||||
if len(os.Args) != 4 {
|
||||
fmt.Println("Needs two arguments: env-var-delta-table <first-version> <second-version>")
|
||||
fmt.Println("Example: env-var-delta-table v5.0.0 v6.0.0")
|
||||
fmt.Println("Will not generate usable results for versions Prior to v5.0.0")
|
||||
} else {
|
||||
RenderEnvVarDeltaTable(os.Args)
|
||||
}
|
||||
case "all":
|
||||
RenderTemplates()
|
||||
GetRogueEnvs()
|
||||
RenderGlobalVarsTemplate()
|
||||
GenerateServiceIndexMarkdowns()
|
||||
case "help":
|
||||
fallthrough
|
||||
default:
|
||||
fmt.Printf("Usage: %s [templates|rogue|globals|service-index|env-var-delta-table|all|help]\n", os.Args[0])
|
||||
}
|
||||
} else {
|
||||
// Left here, even though present in the switch case, for backwards compatibility
|
||||
RenderTemplates()
|
||||
GetRogueEnvs()
|
||||
RenderGlobalVarsTemplate()
|
||||
GenerateServiceIndexMarkdowns()
|
||||
}
|
||||
}
|
||||
@@ -1,76 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"text/template"
|
||||
"time"
|
||||
|
||||
"github.com/owncloud/ocis/v2/ocis-pkg/markdown"
|
||||
)
|
||||
|
||||
var _configMarkdown = `{{< include file="services/_includes/%s-config-example.yaml" language="yaml" >}}
|
||||
|
||||
{{< include file="services/_includes/%s_configvars.md" >}}
|
||||
`
|
||||
|
||||
// GenerateServiceIndexMarkdowns generates the _index.md files for the dev docu
|
||||
func GenerateServiceIndexMarkdowns() {
|
||||
paths, err := filepath.Glob("../../services/*/README.md")
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
for _, p := range paths {
|
||||
service := filepath.Base(filepath.Dir(p))
|
||||
if err := generateMarkdown(p, service); err != nil {
|
||||
fmt.Printf("error generating markdown for %s: %s\n", service, err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func generateMarkdown(filepath string, servicename string) error {
|
||||
f, err := os.ReadFile(filepath)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
md := markdown.NewMD(f)
|
||||
if len(md.Headings) == 0 || md.Headings[0].Level != 1 {
|
||||
return errors.New("readme has invalid format")
|
||||
}
|
||||
|
||||
// we don't need the main title, we add in our template
|
||||
head := md.Headings[0]
|
||||
md.Headings = md.Headings[1:]
|
||||
md.Headings = append(md.Headings, markdown.Heading{
|
||||
Level: 2,
|
||||
Header: "Example Yaml Config",
|
||||
Content: fmt.Sprintf(_configMarkdown, servicename, servicename),
|
||||
})
|
||||
|
||||
tpl := template.Must(template.ParseFiles("templates/index.tmpl"))
|
||||
b := bytes.NewBuffer(nil)
|
||||
if err := tpl.Execute(b, map[string]interface{}{
|
||||
"ServiceName": head.Header,
|
||||
"CreationTime": time.Now().Format(time.RFC3339Nano),
|
||||
"service": servicename,
|
||||
"Abstract": head.Content,
|
||||
"TocTree": md.TocString(),
|
||||
"Content": md.String(),
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
path := fmt.Sprintf("../../docs/services/%s", servicename)
|
||||
|
||||
if err := os.Mkdir(path, os.ModePerm); err != nil && !os.IsExist(err) {
|
||||
return err
|
||||
}
|
||||
|
||||
return os.WriteFile(path+"/_index.md", b.Bytes(), os.ModePerm)
|
||||
}
|
||||
@@ -1,272 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"reflect"
|
||||
"regexp"
|
||||
"strings"
|
||||
"text/template"
|
||||
"time"
|
||||
"sort"
|
||||
|
||||
{{- range $key, $value := .}}
|
||||
pkg{{$key}} "{{$value}}"
|
||||
{{- end}}
|
||||
)
|
||||
|
||||
// ConfigField is the representation of one configuration field
|
||||
type ConfigField struct {
|
||||
EnvVars []string
|
||||
DefaultValue string
|
||||
IntroductionVersion string
|
||||
Type string
|
||||
Description string
|
||||
VersionInfo string
|
||||
DeprecationLink string
|
||||
}
|
||||
|
||||
// DeprecationField holds information about deprecation
|
||||
type DeprecationField struct {
|
||||
DeprecationVersion string
|
||||
DeprecationInfo string
|
||||
DeprecationReplacement string
|
||||
RemovalVersion string
|
||||
}
|
||||
|
||||
// EnvVar holds information about one envvar
|
||||
type EnvVar struct {
|
||||
Name string
|
||||
IntroductionVersion string
|
||||
DefaultValue string
|
||||
Type string
|
||||
Description string
|
||||
Services []string
|
||||
}
|
||||
|
||||
type templateData struct {
|
||||
ExtensionName string
|
||||
Fields []ConfigField
|
||||
Deprecations []DeprecationField
|
||||
HasDeprecations bool
|
||||
Timestamp string
|
||||
}
|
||||
|
||||
func main() {
|
||||
fmt.Println("Generating adoc documentation for environment variables:")
|
||||
adoc, err := os.ReadFile("../../docs/templates/ADOC.tmpl")
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
dpr, err := os.ReadFile("../../docs/templates/ADOC_deprecation.tmpl")
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
replacer := strings.NewReplacer(
|
||||
"github.com/owncloud/ocis/v2/services/", "",
|
||||
"/pkg/config/defaults", "",
|
||||
)
|
||||
var (
|
||||
fields []ConfigField
|
||||
deprecations []DeprecationField
|
||||
adocFile *os.File
|
||||
dprFile *os.File
|
||||
)
|
||||
adoctpl := template.Must(template.New("").Parse(string(adoc)))
|
||||
dprtpl := template.Must(template.New("").Parse(string(dpr)))
|
||||
|
||||
m := map[string]interface{}{
|
||||
{{- range $key, $value := .}}
|
||||
"{{$value}}": *pkg{{$key}}.FullDefaultConfig(),
|
||||
{{- end }}
|
||||
}
|
||||
|
||||
targetFolder := "../../docs/services/_includes/adoc/"
|
||||
all := make(map[string]EnvVar)
|
||||
for pkg, conf := range m {
|
||||
service := replacer.Replace(pkg)
|
||||
timestamp := time.Now().Format("2006-01-02-15-04-05")
|
||||
fields, deprecations = GetAnnotatedVariables(conf, timestamp)
|
||||
var hasDeprecations bool
|
||||
if len(deprecations) > 0 {
|
||||
hasDeprecations = true
|
||||
}
|
||||
|
||||
for _, f := range fields {
|
||||
for _, e := range f.EnvVars {
|
||||
if env, ok := all[e]; ok {
|
||||
env.Services = append(env.Services, service)
|
||||
sort.Slice(env.Services, func(i, j int) bool {
|
||||
return env.Services[i] < env.Services[j]
|
||||
})
|
||||
all[e] = env
|
||||
} else {
|
||||
all[e] = EnvVar{
|
||||
Name: e,
|
||||
IntroductionVersion: replaceEnvVarPlaceHolder(f.IntroductionVersion),
|
||||
Description: f.Description,
|
||||
Type: f.Type,
|
||||
DefaultValue: f.DefaultValue,
|
||||
Services: []string{service},
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if len(fields) > 0 || len(deprecations) > 0 {
|
||||
fmt.Printf("... %s\n", pkg)
|
||||
td := templateData{
|
||||
ExtensionName: service,
|
||||
Fields: fields,
|
||||
Deprecations: deprecations,
|
||||
HasDeprecations: hasDeprecations,
|
||||
Timestamp: timestamp,
|
||||
}
|
||||
adocFile, err = os.Create(filepath.Join(targetFolder, service + "_configvars.adoc"))
|
||||
if err != nil {
|
||||
log.Fatalf("Failed to create target file: %s", err)
|
||||
}
|
||||
defer adocFile.Close()
|
||||
|
||||
if err := adoctpl.Execute(adocFile, td); err != nil {
|
||||
log.Fatalf("Failed to execute template: %s", err)
|
||||
}
|
||||
|
||||
dprFile, err = os.Create(filepath.Join(targetFolder, service + "_deprecation.adoc"))
|
||||
if err != nil {
|
||||
log.Fatalf("Failed to create target file: %s", err)
|
||||
}
|
||||
defer dprFile.Close()
|
||||
|
||||
if err := dprtpl.Execute(dprFile, td); err != nil {
|
||||
log.Fatalf("Failed to execute template: %s", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// render global env vars
|
||||
tmplValues := make([]map[string]interface{}, 0)
|
||||
for _, env := range all {
|
||||
if len(env.Services) > 1 {
|
||||
tmplValues = append(tmplValues, map[string]interface{}{
|
||||
"Name": env.Name,
|
||||
"IntroductionVersion": replaceEnvVarPlaceHolder(env.IntroductionVersion),
|
||||
"Services": env.Services,
|
||||
"Description": env.Description,
|
||||
"DefaultValue": env.DefaultValue,
|
||||
"Type": env.Type,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// sort
|
||||
sort.Slice(tmplValues, func(i, j int) bool {
|
||||
return tmplValues[i]["Name"].(string) < tmplValues[j]["Name"].(string)
|
||||
})
|
||||
|
||||
glc, err := os.ReadFile("../../docs/templates/ADOC_global.tmpl")
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
gltpl := template.Must(template.New("").Parse(string(glc)))
|
||||
glfile, err := os.Create(filepath.Join(targetFolder, "global_configvars.adoc"))
|
||||
if err != nil {
|
||||
log.Fatalf("Failed to create target file: %s", err)
|
||||
}
|
||||
|
||||
if err := gltpl.Execute(glfile, tmplValues); err != nil {
|
||||
log.Printf("Failed to execute template: %s", err)
|
||||
}
|
||||
|
||||
fmt.Println("done")
|
||||
}
|
||||
|
||||
func replaceEnvVarPlaceHolder(s string) string {
|
||||
return strings.Replace(
|
||||
s,
|
||||
"%%NEXT_PRODUCTION_VERSION%%",
|
||||
"next-prod",
|
||||
-1,
|
||||
)
|
||||
}
|
||||
|
||||
func GetAnnotatedVariables(s interface{}, timestamp string) ([]ConfigField, []DeprecationField) {
|
||||
t := reflect.TypeOf(s)
|
||||
v := reflect.ValueOf(s)
|
||||
|
||||
var fields []ConfigField
|
||||
var deprecations []DeprecationField
|
||||
for i := 0; i < t.NumField(); i++ {
|
||||
field := t.Field(i)
|
||||
value := v.Field(i)
|
||||
|
||||
switch value.Kind() {
|
||||
default:
|
||||
desc := field.Tag.Get("desc")
|
||||
env, ok := field.Tag.Lookup("env")
|
||||
deprecationLink := ""
|
||||
if !ok {
|
||||
continue
|
||||
}
|
||||
introductionVersion, _ := field.Tag.Lookup("introductionVersion")
|
||||
deprecationVersion, _ := field.Tag.Lookup("deprecationVersion")
|
||||
removalVersion, _ := field.Tag.Lookup("removalVersion")
|
||||
deprecationInfo, _ := field.Tag.Lookup("deprecationInfo")
|
||||
deprecationReplacement, _ := field.Tag.Lookup("deprecationReplacement")
|
||||
if deprecationVersion != "" ||
|
||||
removalVersion != "" ||
|
||||
deprecationInfo != "" ||
|
||||
deprecationReplacement != "" {
|
||||
deprecationLink = fmt.Sprintf("xref:deprecation-note-%s[Deprecation Note]", timestamp)
|
||||
}
|
||||
v := fmt.Sprintf("%v", value.Interface())
|
||||
td := strings.Split(env, ";")
|
||||
// re := regexp.MustCompile(`^(https?:\/\/)`)
|
||||
// v = re.ReplaceAllString(v,"\\$1")
|
||||
re := regexp.MustCompile(`(https?:\/\/)`)
|
||||
desc = re.ReplaceAllString(desc, "\\$1")
|
||||
re = regexp.MustCompile(`(\|)`)
|
||||
v = re.ReplaceAllString(v, "\\$1")
|
||||
typeName := value.Type().Name()
|
||||
if typeName == "" {
|
||||
typeName = value.Type().String()
|
||||
}
|
||||
fields = append(fields,
|
||||
ConfigField{
|
||||
EnvVars: td,
|
||||
IntroductionVersion: replaceEnvVarPlaceHolder(introductionVersion),
|
||||
DefaultValue: v,
|
||||
Description: desc,
|
||||
Type: typeName,
|
||||
DeprecationLink: deprecationLink,
|
||||
})
|
||||
if deprecationLink != "" {
|
||||
deprecations = append(deprecations,
|
||||
DeprecationField{
|
||||
DeprecationVersion: replaceEnvVarPlaceHolder(deprecationVersion),
|
||||
DeprecationInfo: deprecationInfo,
|
||||
DeprecationReplacement: deprecationReplacement,
|
||||
RemovalVersion: replaceEnvVarPlaceHolder(removalVersion),
|
||||
})
|
||||
}
|
||||
case reflect.Ptr:
|
||||
// PolicySelectors in the Proxy are being skipped atm
|
||||
// they are not configurable via env vars, if that changes
|
||||
// they are probably added to the Sanitize() function
|
||||
// and this should not be an issue then
|
||||
if !value.IsZero() && value.Elem().CanInterface() {
|
||||
f, d := GetAnnotatedVariables(value.Elem().Interface(), timestamp)
|
||||
fields = append(fields, f...)
|
||||
deprecations = append(deprecations, d...)
|
||||
}
|
||||
case reflect.Struct:
|
||||
f, d := GetAnnotatedVariables(value.Interface(), timestamp)
|
||||
fields = append(fields, f...)
|
||||
deprecations = append(deprecations, d...)
|
||||
}
|
||||
}
|
||||
return fields, deprecations
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
Added between Version {{ .StartVersion }} and {{ .EndVersion }}.
|
||||
|
||||
| Variable | Description |
|
||||
| --- | --- |
|
||||
{{- range $key, $value := .DeltaFields}}
|
||||
| {{$value.Name}} | {{$value.Description}} |
|
||||
{{- end}}
|
||||
@@ -1,7 +0,0 @@
|
||||
Deprecated between Version {{ .StartVersion }} and {{ .EndVersion }}.
|
||||
|
||||
| Variable | Description | Deprecation Info |
|
||||
| --- | --- |
|
||||
{{- range $key, $value := .DeltaFields}}
|
||||
| {{$value.Name}} | {{$value.Description}} | {{$value.DeprecationInfo}} |
|
||||
{{- end}}
|
||||
@@ -1,7 +0,0 @@
|
||||
Removed between Version {{ .StartVersion }} and {{ .EndVersion }}.
|
||||
|
||||
| Variable | Description | Deprecation Info |
|
||||
| --- | --- |
|
||||
{{- range $key, $value := .DeltaFields}}
|
||||
| {{$value.Name}} | {{$value.Description}} | {{$value.DeprecationInfo}} |
|
||||
{{- end}}
|
||||
@@ -1,154 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"gopkg.in/yaml.v2"
|
||||
"html"
|
||||
"reflect"
|
||||
"strings"
|
||||
"log"
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
{{- range $key, $value :=.}}
|
||||
pkg{{$key}} "{{$value}}"
|
||||
{{- end}}
|
||||
)
|
||||
|
||||
const yamlSource = "env_vars.yaml"
|
||||
|
||||
type ConfigField struct {
|
||||
Name string `yaml:"name"`
|
||||
DefaultValue string `yaml:"defaultValue"`
|
||||
Type string `yaml:"type"`
|
||||
Description string `yaml:"description"`
|
||||
IntroductionVersion string `yaml:"introductionVersion"`
|
||||
DeprecationVersion string `yaml:"deprecationVersion"`
|
||||
RemovalVersion string `yaml:"removalVersion"`
|
||||
DeprecationInfo string `yaml:"deprecationInfo"`
|
||||
}
|
||||
|
||||
func main() {
|
||||
fmt.Println("Generating tables for env-var deltas...")
|
||||
curdir, err := os.Getwd()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
fullYamlPath := filepath.Join(curdir, yamlSource)
|
||||
var fields []ConfigField
|
||||
configFields := make(map[string]*ConfigField)
|
||||
fmt.Printf("Reading existing variable definitions from %s\n", fullYamlPath)
|
||||
yfile, err := os.ReadFile(fullYamlPath)
|
||||
if err == nil {
|
||||
err := yaml.Unmarshal(yfile, configFields)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
m := map[string]interface{}{
|
||||
{{- range $key, $value := .}}
|
||||
"{{$value}}": *pkg{{$key}}.FullDefaultConfig(),
|
||||
{{- end }}
|
||||
}
|
||||
for _, conf := range m {
|
||||
fields = GetAnnotatedVariables(conf)
|
||||
for _, field := range fields {
|
||||
variants := strings.Split(field.Name, ";")
|
||||
for _, variant := range variants {
|
||||
if (configFields[variant] != nil && configFields[variant].Name == "") || configFields[variant] == nil {
|
||||
configFields[variant] = &field
|
||||
} else {
|
||||
fmt.Printf("%v, duplicate key, merging\n", variant)
|
||||
if strings.TrimSpace(configFields[variant].DefaultValue) != "" && configFields[variant].DefaultValue != field.DefaultValue {
|
||||
configFields[variant].DefaultValue = field.DefaultValue
|
||||
}
|
||||
if strings.TrimSpace(configFields[variant].Description) != "" && configFields[variant].Description != field.Description {
|
||||
configFields[variant].Description = field.Description
|
||||
}
|
||||
if strings.TrimSpace(configFields[variant].Type) != "" && configFields[variant].Type != field.Type {
|
||||
configFields[variant].Type = field.Type
|
||||
}
|
||||
if strings.TrimSpace(configFields[variant].IntroductionVersion) != "" && configFields[variant].IntroductionVersion != field.IntroductionVersion {
|
||||
configFields[variant].IntroductionVersion = field.IntroductionVersion
|
||||
}
|
||||
if strings.TrimSpace(configFields[variant].DeprecationVersion) != "" && configFields[variant].DeprecationVersion != field.DeprecationVersion {
|
||||
configFields[variant].DeprecationVersion = field.DeprecationVersion
|
||||
}
|
||||
if strings.TrimSpace(configFields[variant].RemovalVersion) != "" && configFields[variant].RemovalVersion != field.RemovalVersion {
|
||||
configFields[variant].RemovalVersion = field.RemovalVersion
|
||||
}
|
||||
if strings.TrimSpace(configFields[variant].Name) != "" && configFields[variant].Name != field.Name {
|
||||
configFields[variant].Name = field.Name
|
||||
}
|
||||
if strings.TrimSpace(configFields[variant].DeprecationInfo) != "" && configFields[variant].DeprecationInfo != field.DeprecationInfo {
|
||||
// there might be multiple superseeding DeprecationInformations, we might want to keep track of those, that's why we are not overwriting the field
|
||||
configFields[variant].DeprecationInfo = configFields[variant].DeprecationInfo + " | " + field.DeprecationInfo
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
output, err := yaml.Marshal(configFields)
|
||||
if err != nil {
|
||||
log.Fatalf("Could not marshall variables: %v", err)
|
||||
}
|
||||
err = os.WriteFile(fullYamlPath, output, 0666)
|
||||
if err != nil {
|
||||
log.Fatalf("could not write %s", fullYamlPath)
|
||||
}
|
||||
if err := os.Chdir(curdir); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
func GetAnnotatedVariables(s interface{}) []ConfigField {
|
||||
t := reflect.TypeOf(s)
|
||||
v := reflect.ValueOf(s)
|
||||
|
||||
var fields []ConfigField
|
||||
for i := 0; i < t.NumField(); i++ {
|
||||
field := t.Field(i)
|
||||
value := v.Field(i)
|
||||
|
||||
switch value.Kind() {
|
||||
default:
|
||||
desc := field.Tag.Get("desc")
|
||||
env, ok := field.Tag.Lookup("env")
|
||||
if !ok {
|
||||
continue
|
||||
}
|
||||
introductionVersion := field.Tag.Get("introductionVersion")
|
||||
deprecationVersion := field.Tag.Get("deprecationVersion")
|
||||
removalVersion := field.Tag.Get("removalVersion")
|
||||
deprecationInfo := field.Tag.Get("deprecationInfo")
|
||||
v := fmt.Sprintf("%v", value.Interface())
|
||||
typeName := value.Type().Name()
|
||||
if typeName == "" {
|
||||
typeName = value.Type().String()
|
||||
}
|
||||
//fields = append(fields, ConfigField{Name: strings.ReplaceAll(env, ";", "<br/>"), DefaultValue: html.EscapeString(strings.Replace(v, "|", "\\|", -1)), Description: desc, Type: typeName})
|
||||
fields = append(fields, ConfigField{
|
||||
Name: env,
|
||||
DefaultValue: html.EscapeString(strings.Replace(v, "|", "\\|", -1)),
|
||||
Description: desc,
|
||||
Type: typeName,
|
||||
IntroductionVersion: introductionVersion,
|
||||
DeprecationVersion: deprecationVersion,
|
||||
RemovalVersion: removalVersion,
|
||||
DeprecationInfo: deprecationInfo,
|
||||
})
|
||||
case reflect.Ptr:
|
||||
// PolicySelectors in the Proxy are being skipped atm
|
||||
// they are not configurable via env vars, if that changes
|
||||
// they are probably added to the Sanitize() function
|
||||
// and this should not be an issue then
|
||||
if !value.IsZero() && value.Elem().CanInterface() {
|
||||
fields = append(fields, GetAnnotatedVariables(value.Elem().Interface())...)
|
||||
}
|
||||
case reflect.Struct:
|
||||
fields = append(fields, GetAnnotatedVariables(value.Interface())...)
|
||||
}
|
||||
}
|
||||
return fields
|
||||
}
|
||||
@@ -1,97 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"html"
|
||||
"log"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"reflect"
|
||||
"strings"
|
||||
"text/template"
|
||||
|
||||
{{- range $key, $value := .}}
|
||||
pkg{{$key}} "{{$value}}"
|
||||
{{- end}})
|
||||
|
||||
type ConfigField struct {
|
||||
Name string
|
||||
DefaultValue string
|
||||
Type string
|
||||
Description string
|
||||
}
|
||||
|
||||
func main() {
|
||||
fmt.Println("Generating documentation for environment variables:")
|
||||
content, err := os.ReadFile("../../docs/templates/CONFIGURATION.tmpl")
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
replacer := strings.NewReplacer(
|
||||
"github.com/owncloud/ocis/v2/services/", "",
|
||||
"/pkg/config/defaults", "",
|
||||
)
|
||||
var fields []ConfigField
|
||||
var targetFile *os.File
|
||||
tpl := template.Must(template.New("").Parse(string(content)))
|
||||
|
||||
m := map[string]interface{}{
|
||||
{{- range $key, $value := .}}
|
||||
"{{$value}}": *pkg{{$key}}.FullDefaultConfig(),
|
||||
{{- end }}
|
||||
}
|
||||
|
||||
targetFolder := "../../docs/services/_includes/"
|
||||
for pkg, conf := range m {
|
||||
fields = GetAnnotatedVariables(conf)
|
||||
if len(fields) > 0 {
|
||||
fmt.Printf("... %s\n", pkg)
|
||||
targetFile, err = os.Create(filepath.Join(targetFolder, replacer.Replace(pkg) + "_configvars.md"))
|
||||
if err != nil {
|
||||
log.Fatalf("Failed to create target file: %s", err)
|
||||
}
|
||||
defer targetFile.Close()
|
||||
if err := tpl.Execute(targetFile, fields); err != nil {
|
||||
log.Fatalf("Failed to execute template: %s", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
fmt.Println("done")
|
||||
}
|
||||
|
||||
func GetAnnotatedVariables(s interface{}) []ConfigField {
|
||||
t := reflect.TypeOf(s)
|
||||
v := reflect.ValueOf(s)
|
||||
|
||||
var fields []ConfigField
|
||||
for i := 0; i < t.NumField(); i++ {
|
||||
field := t.Field(i)
|
||||
value := v.Field(i)
|
||||
|
||||
switch value.Kind() {
|
||||
default:
|
||||
desc := field.Tag.Get("desc")
|
||||
env, ok := field.Tag.Lookup("env")
|
||||
if !ok {
|
||||
continue
|
||||
}
|
||||
v := fmt.Sprintf("%v", value.Interface())
|
||||
typeName := value.Type().Name()
|
||||
if typeName == "" {
|
||||
typeName = value.Type().String()
|
||||
}
|
||||
fields = append(fields, ConfigField{Name: strings.ReplaceAll(env, ";", "<br/>"), DefaultValue: html.EscapeString(strings.Replace(v, "|", "\\|", -1)), Description: desc, Type: typeName})
|
||||
case reflect.Ptr:
|
||||
// PolicySelectors in the Proxy are being skipped atm
|
||||
// they are not configurable via env vars, if that changes
|
||||
// they are probably added to the Sanitize() function
|
||||
// and this should not be an issue then
|
||||
if !value.IsZero() && value.Elem().CanInterface() {
|
||||
fields = append(fields, GetAnnotatedVariables(value.Elem().Interface())...)
|
||||
}
|
||||
case reflect.Struct:
|
||||
fields = append(fields, GetAnnotatedVariables(value.Interface())...)
|
||||
}
|
||||
}
|
||||
return fields
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"gopkg.in/yaml.v2"
|
||||
{{- range $key, $value := .}}
|
||||
pkg{{$key}} "{{$value}}"
|
||||
{{- end}}
|
||||
)
|
||||
|
||||
func main() {
|
||||
replacer := strings.NewReplacer(
|
||||
"github.com/owncloud/ocis/v2/services/", "",
|
||||
"/pkg/config/defaults", "",
|
||||
)
|
||||
cfg := map[string]string{
|
||||
{{- range $key, $value := .}}
|
||||
replacer.Replace("{{$value}}"): func() string {
|
||||
fmt.Println("Generating example YAML config for {{ $value -}}")
|
||||
c := pkg{{$key}}.FullDefaultConfig()
|
||||
yml, err := yaml.Marshal(c)
|
||||
if err != nil {
|
||||
log.Fatalf("Marshalling yaml for pkg0 failed: %s\n", err)
|
||||
}
|
||||
return fmt.Sprintf("# Autogenerated\n# Filename: %s-config-example.yaml\n\n%s", replacer.Replace("{{ $value }}"),string(yml))
|
||||
}(),
|
||||
{{- end}}
|
||||
}
|
||||
for pkg, yml := range cfg {
|
||||
targetFolders := []string{
|
||||
// TODO: comment in when it is clear how to commit this to the structure of the master|main branch
|
||||
// filepath.Join("../../", pkg, "/config"),
|
||||
"../../docs/services/_includes/",
|
||||
}
|
||||
for _, targetFolder := range targetFolders {
|
||||
os.MkdirAll(targetFolder, 0700)
|
||||
targetYamlFile, err := os.Create(filepath.Join(targetFolder, replacer.Replace(pkg) + "-config-example.yaml"))
|
||||
if err != nil {
|
||||
log.Fatalf("Failed to create target file for : %s", err)
|
||||
}
|
||||
defer targetYamlFile.Close()
|
||||
targetYamlFile.WriteString(yml)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
---
|
||||
title: {{ .ServiceName }}
|
||||
date: {{ .CreationTime }}
|
||||
weight: 20
|
||||
geekdocRepo: https://github.com/owncloud/ocis
|
||||
geekdocEditPath: edit/master/services/{{ .service }}
|
||||
geekdocFilePath: README.md
|
||||
geekdocCollapseSection: true
|
||||
---
|
||||
|
||||
<!-- Do not edit this file, it is autogenerated. Edit the service README.md instead -->
|
||||
|
||||
## Abstract
|
||||
|
||||
{{ .Abstract }}
|
||||
## Table of Contents
|
||||
|
||||
{{ .TocTree }}
|
||||
{{ .Content }}
|
||||
@@ -1,13 +0,0 @@
|
||||
---
|
||||
title: Service Independent Settings
|
||||
date: 2025-11-13T00:00:00+00:00
|
||||
geekdocRepo: https://github.com/owncloud/ocis
|
||||
geekdocEditPath: edit/master/docs/service-independent/
|
||||
geekdocFilePath: _index.md
|
||||
geekdocCollapseSection: true
|
||||
weight: 15
|
||||
---
|
||||
|
||||
{{< toc-tree >}}
|
||||
|
||||
Some components programmed are not bound to a service but are valid for all of ocis. These are for example environment variables that are used before any service gets started. For ocis CLI commands that are service independent, see the [Service Independent CLI]({{< ref "../cli-commands/service_independent_cli.md" >}}) documentation.
|
||||
@@ -1,38 +0,0 @@
|
||||
---
|
||||
title: Service Independent Envvars
|
||||
date: 2025-11-13T00:00:00+00:00
|
||||
geekdocRepo: https://github.com/owncloud/ocis
|
||||
geekdocEditPath: edit/master/docs/service-independent/
|
||||
geekdocFilePath: service_independent_envvars.md
|
||||
---
|
||||
|
||||
The following environment variables are service independent. You will find the respective code in the `ocis-pkg/` directory. See the [Admin Documentation - Environment Variables with Special Scopes](https://doc.owncloud.com/ocis/7.3/deployment/services/env-vars-special-scope.html) for a comprehensive list and explanation.
|
||||
|
||||
{{< toc >}}
|
||||
|
||||
{{< hint info >}}
|
||||
See the [Environment Variables]({{< ref "../services/general-info/envvars/" >}}) documentation for common and important details on envvars.
|
||||
{{< /hint >}}
|
||||
|
||||
## Service Registry
|
||||
|
||||
This package configures the service registry which will be used to look up for example the service addresses.
|
||||
|
||||
Available registries are:
|
||||
|
||||
- nats-js-kv (default)
|
||||
- memory
|
||||
|
||||
To configure which registry to use, you have to set the environment variable `MICRO_REGISTRY`, and for all except `memory` you also have to set the registry address via `MICRO_REGISTRY_ADDRESS` and other envvars.
|
||||
|
||||
## Startup Related Envvars
|
||||
|
||||
These envvars define the startup of ocis and can for example add or remove services from the startup process such as `OCIS_ADD_RUN_SERVICES`.
|
||||
|
||||
## Memory Limits
|
||||
|
||||
{{< hint info >}}
|
||||
Note that this envvar is for development purposes only and not described in the admin docs.
|
||||
{{< /hint >}}
|
||||
|
||||
oCIS will automatically set the go native `GOMEMLIMIT` to `0.9`. To disable the limit set `AUTOMEMLIMIT=off`. For more information take a look at the official [Guide to the Go Garbage Collector](https://go.dev/doc/gc-guide).
|
||||
@@ -1,5 +0,0 @@
|
||||
*_configvars.md
|
||||
*-example.yaml
|
||||
adoc/*.adoc
|
||||
adoc/env-var-deltas/*.adoc
|
||||
adoc/env-var-deltas/*.md
|
||||
Whitespace-only changes.
Whitespace-only changes.
@@ -1,15 +0,0 @@
|
||||
---
|
||||
title: Services
|
||||
date: 2023-12-06T13:00:00+01:00
|
||||
geekdocRepo: https://github.com/owncloud/ocis
|
||||
geekdocEditPath: edit/master/docs/services/
|
||||
geekdocFilePath: _index.md
|
||||
geekdocCollapseSection: true
|
||||
weight: 10
|
||||
---
|
||||
|
||||
The documentation of services is intended for developers and only reflects the state of the master branch of the ocis repo.
|
||||
|
||||
{{< hint warning >}}
|
||||
See the [admin documentation](https://doc.owncloud.com/ocis/next/deployment/services/services.html) which provides versioned content suitable for administrators. This documentation also offers other useful information including deployment guides.
|
||||
{{< /hint >}}
|
||||
@@ -1,15 +0,0 @@
|
||||
---
|
||||
title: Service Configuration
|
||||
date: 2023-03-16T00:00:00+00:00
|
||||
weight: 20
|
||||
geekdocRepo: https://github.com/owncloud/ocis
|
||||
geekdocEditPath: edit/master/docs/services/antivirus
|
||||
geekdocFilePath: configuration.md
|
||||
geekdocCollapseSection: true
|
||||
---
|
||||
|
||||
## Example YAML Config
|
||||
|
||||
{{< include file="services/_includes/antivirus-config-example.yaml" language="yaml" >}}
|
||||
|
||||
{{< include file="services/_includes/antivirus_configvars.md" >}}
|
||||
@@ -1,16 +0,0 @@
|
||||
---
|
||||
title: App-Provider
|
||||
date: 2022-03-02T00:00:00+00:00
|
||||
weight: 20
|
||||
geekdocRepo: https://github.com/owncloud/ocis
|
||||
geekdocEditPath: edit/master/docs/services/app-provider
|
||||
geekdocFilePath: _index.md
|
||||
geekdocCollapseSection: true
|
||||
---
|
||||
|
||||
## Abstract
|
||||
|
||||
|
||||
## Table of Contents
|
||||
|
||||
{{< toc-tree >}}
|
||||
Loaded 100 of 2143 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user