From bfba720779a2141bb7358ca458e049c291d5691b Mon Sep 17 00:00:00 2001 From: provokateurin Date: Tue, 30 Jan 2024 21:19:33 +0100 Subject: [PATCH] feat(tool): Add hack to run Neon on web Signed-off-by: provokateurin --- packages/app/README.md | 10 ++++++++++ tool/dev.sh | 7 ++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/packages/app/README.md b/packages/app/README.md index 9435498af32..236fd5c1acb 100644 --- a/packages/app/README.md +++ b/packages/app/README.md @@ -6,6 +6,16 @@ A beautiful convergent cross-platform client for Nextcloud written in Flutter. You can build it yourself from source or download it from the automatic build pipelines. The app will be published on F-Droid, the Google Playstore and Flathub later on. +## Run on web + +Due to CORS issues it is not possible to run the app in debug mode. + +```bash +fvm flutter build web --base-href /neon/ # Use --profile to build faster and get better error messages. +``` + +Use `./tool/dev.sh` from the root of the repository and go to http://localhost/neon. + ## Screenshots For more screenshots see `./screenshots/`. diff --git a/tool/dev.sh b/tool/dev.sh index b05252181e4..863fb34bb8c 100755 --- a/tool/dev.sh +++ b/tool/dev.sh @@ -15,7 +15,12 @@ echo "Running development instance on http://localhost. To access it in an Andro tag="$(preset_image_tag "$preset")" volume="nextcloud-neon-dev-$(echo "$tag" | cut -d ":" -f 2)" -container="$(docker run -d --rm -v "$volume":/usr/src/nextcloud -v "$volume":/var/www/html -p "80:80" --add-host=host.docker.internal:host-gateway "$tag")" +args=() +if [ -d packages/app/build/web ]; then + args=(-v ./packages/app/build/web:/var/www/html/neon -v ./packages/app/build/web:/usr/src/nextcloud/neon) +fi +# shellcheck disable=SC2086 +container="$(docker run -d --rm -v "$volume":/usr/src/nextcloud -v "$volume":/var/www/html ${args[*]} -p "80:80" --add-host=host.docker.internal:host-gateway "$tag")" function cleanup() { docker kill "$container" }