@@ -112,6 +112,9 @@ outputs:
112112 ocis-url :
113113 description : oCIS instance URL
114114 value : ${{ inputs.ocis-url }}
115+ wopi-url :
116+ description : WOPI source base URL (http://localhost:PORT); only set when collaboration-apps is non-empty
117+ value : ${{ steps.wopi-url.outputs.wopi-url }}
115118
116119runs :
117120 using : composite
@@ -330,9 +333,13 @@ runs:
330333 echo "WEB_UI_CONFIG_FILE=${CONFIG_DIR}/web-ui-config.json" >> "$GITHUB_ENV"
331334
332335 # -------------------------------------------------------------------------
333- # 8b. cs3-wopi: start FakeOffice before oCIS (app-provider probes discovery at startup)
336+ # 8b. Pre-start WOPI apps that require discovery before oCIS boots
337+ # cs3-wopi: app-provider probes FakeOffice discovery at startup, so
338+ # FakeOffice must be healthy before oCIS launches.
339+ # Collabora/OnlyOffice don't depend on oCIS, so start them early too
340+ # to overlap their container pull+boot with oCIS startup time.
334341 # -------------------------------------------------------------------------
335- - name : Start FakeOffice (cs3-wopi early start )
342+ - name : Start FakeOffice (cs3-wopi — must be ready before oCIS )
336343 if : contains(inputs.collaboration-apps, 'cs3-wopi')
337344 shell : bash
338345 working-directory : ${{ github.workspace }}
@@ -345,6 +352,32 @@ runs:
345352 timeout 120 bash -c 'until curl -sf http://localhost:8080/hosting/discovery; do sleep 2; done'
346353 echo "FakeOffice ready."
347354
355+ - name : Start Collabora (early — overlaps with oCIS boot)
356+ if : contains(inputs.collaboration-apps, 'collabora')
357+ shell : bash
358+ run : |
359+ docker run -d --name collabora --network host \
360+ -e DONT_GEN_SSL_CERT=set \
361+ -e "extra_params=--o:ssl.enable=true --o:ssl.termination=true --o:welcome.enable=false --o:net.frame_ancestors=${{ inputs.ocis-url }}" \
362+ --entrypoint /bin/sh \
363+ ${{ inputs.collabora-image }} \
364+ -c "set -e; coolconfig generate-proof-key; bash /start-collabora-online.sh"
365+
366+ - name : Start OnlyOffice (early — overlaps with oCIS boot)
367+ if : contains(inputs.collaboration-apps, 'onlyoffice')
368+ shell : bash
369+ working-directory : ${{ github.workspace }}
370+ run : |
371+ sudo systemctl stop postgresql || true
372+ docker run -d --name onlyoffice --network host \
373+ -e WOPI_ENABLED=true \
374+ -e USE_UNAUTHORIZED_STORAGE=true \
375+ -v "$(pwd)/tests/config/ci/only-office.json:/tmp/only-office.json:ro" \
376+ -v "$(pwd)/tests/config/ci/onlyoffice-entrypoint.sh:/entrypoint.sh:ro" \
377+ --entrypoint /bin/sh \
378+ ${{ inputs.onlyoffice-image }} \
379+ /entrypoint.sh
380+
348381 # -------------------------------------------------------------------------
349382 # 9. Start oCIS via ociswrapper (or directly when wrapper: false)
350383 # -------------------------------------------------------------------------
@@ -415,7 +448,7 @@ runs:
415448 echo "OCIS_CERT=$CERT" >> "$GITHUB_ENV"
416449
417450 # -------------------------------------------------------------------------
418- # 12. Optional WOPI collaboration apps
451+ # 12. Start fakeoffice (non-cs3-wopi path) + wait for all discovery endpoints
419452 # -------------------------------------------------------------------------
420453 - name : Start FakeOffice
421454 if : contains(inputs.collaboration-apps, 'fakeoffice')
@@ -427,40 +460,15 @@ runs:
427460 python:3-alpine \
428461 python3 /ocis/tests/config/ci/fakeoffice-server.py
429462
430- - name : Start Collabora
431- if : contains(inputs.collaboration-apps, 'collabora')
432- shell : bash
433- run : |
434- docker run -d --name collabora --network host \
435- -e DONT_GEN_SSL_CERT=set \
436- -e "extra_params=--o:ssl.enable=true --o:ssl.termination=true --o:welcome.enable=false --o:net.frame_ancestors=${{ inputs.ocis-url }}" \
437- --entrypoint /bin/sh \
438- ${{ inputs.collabora-image }} \
439- -c "set -e; coolconfig generate-proof-key; bash /start-collabora-online.sh"
440-
441- - name : Start OnlyOffice
442- if : contains(inputs.collaboration-apps, 'onlyoffice')
443- shell : bash
444- working-directory : ${{ github.workspace }}
445- run : |
446- sudo systemctl stop postgresql || true
447- docker run -d --name onlyoffice --network host \
448- -e WOPI_ENABLED=true \
449- -e USE_UNAUTHORIZED_STORAGE=true \
450- -v "$(pwd)/tests/config/ci/only-office.json:/tmp/only-office.json:ro" \
451- -v "$(pwd)/tests/config/ci/onlyoffice-entrypoint.sh:/entrypoint.sh:ro" \
452- --entrypoint /bin/sh \
453- ${{ inputs.onlyoffice-image }} \
454- /entrypoint.sh
455-
456463 - name : Wait for WOPI app discovery endpoints
457464 if : inputs.collaboration-apps != ''
458465 shell : bash
459466 env :
460467 COLLAB_APPS : ${{ inputs.collaboration-apps }}
461468 run : |
462469 PIDS=()
463- [[ "$COLLAB_APPS" == *fakeoffice* || "$COLLAB_APPS" == *cs3-wopi* ]] && {
470+ # cs3-wopi FakeOffice was already confirmed healthy in step 8b; skip re-check
471+ [[ "$COLLAB_APPS" == *fakeoffice* ]] && {
464472 ( timeout 300 bash -c 'until curl -sf http://localhost:8080/hosting/discovery; do sleep 2; done'
465473 echo "fakeoffice ready." ) &
466474 PIDS+=($!)
@@ -549,3 +557,16 @@ runs:
549557 timeout 120 bash -c 'until curl -sf http://localhost:9300/wopi/cbox/endpoints 2>/dev/null || nc -z localhost 9300 2>/dev/null; do sleep 2; done'
550558 echo "cs3 wopi server ready."
551559 echo "WOPI_PORT=9300" >> "$GITHUB_ENV"
560+
561+ # -------------------------------------------------------------------------
562+ # 14. Declare wopi-url output so callers can wire it explicitly
563+ # -------------------------------------------------------------------------
564+ - name : Set wopi-url output
565+ id : wopi-url
566+ if : inputs.collaboration-apps != ''
567+ shell : bash
568+ env :
569+ WOPI_PORT : ${{ env.WOPI_PORT }}
570+ run : |
571+ PORT="${WOPI_PORT:-9320}"
572+ echo "wopi-url=http://localhost:${PORT}" >> "$GITHUB_OUTPUT"
0 commit comments