From 63ab739b3d5f067da7939f3d8f538f76b76b5f67 Mon Sep 17 00:00:00 2001 From: Aiden McClelland Date: Thu, 19 Oct 2023 09:08:15 -0600 Subject: [PATCH 01/35] update Cargo.lock --- system-images/compat/Cargo.lock | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/system-images/compat/Cargo.lock b/system-images/compat/Cargo.lock index 92eb8ed50..d53a78378 100644 --- a/system-images/compat/Cargo.lock +++ b/system-images/compat/Cargo.lock @@ -4527,6 +4527,7 @@ dependencies = [ "tracing", "tracing-error", "tracing-futures", + "tracing-journald", "tracing-subscriber", "trust-dns-server", "typed-builder", @@ -5065,6 +5066,17 @@ dependencies = [ "tracing", ] +[[package]] +name = "tracing-journald" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba316a74e8fc3c3896a850dba2375928a9fa171b085ecddfc7c054d39970f3fd" +dependencies = [ + "libc", + "tracing-core", + "tracing-subscriber", +] + [[package]] name = "tracing-log" version = "0.1.3" From 8ea3c3c29e6d6331fac6a5f4398c121602a2d3e8 Mon Sep 17 00:00:00 2001 From: Aiden McClelland <3732071+dr-bonez@users.noreply.github.com> Date: Mon, 23 Oct 2023 14:40:00 -0600 Subject: [PATCH 02/35] consolidate and streamline build (#2469) * consolidate and streamline build * fix workflow syntax * fix workflow syntax * fix workflow syntax * fix workflow syntax * fix build scripts * only build platform-specific system images * fix build script * more build fixes * fix * fix compat build for x86 * wat * checkout * Prevent rebuild of compiled artifacts * Update startos-iso.yaml * Update startos-iso.yaml * fix raspi build * handle missing platform better * reduce arm vcpus * remove arch and platform from fe config, add to patch db --------- Co-authored-by: Matt Hill --- .github/workflows/startos-iso.yaml | 196 +++++------ .gitignore | 8 +- Makefile | 156 +++++---- backend/Cargo.lock | 23 -- backend/Cargo.toml | 4 +- backend/build-prod.sh | 25 +- backend/install-sdk.sh | 4 +- backend/src/bins/start_deno.rs | 21 +- backend/src/bins/start_init.rs | 10 +- backend/src/config/spec.rs | 4 +- backend/src/db/model.rs | 16 + backend/src/firmware.rs | 2 +- backend/src/init.rs | 8 +- backend/src/lib.rs | 8 +- backend/src/logs.rs | 17 +- backend/src/procedure/docker.rs | 2 +- backend/src/registry/marketplace.rs | 2 +- backend/src/shutdown.rs | 6 +- backend/src/update/mod.rs | 6 +- backend/src/util/docker.rs | 8 +- backend/src/version/mod.rs | 3 +- .../scripts/test-package/0.3.0.3/embassy.js | 4 +- backend/update-sqlx-data.sh | 2 +- basename.sh | 19 + build-cargo-dep.sh | 2 +- build/.gitignore | 2 + build/{lib => dpkg-deps}/conflicts | 4 +- build/{lib => dpkg-deps}/depends | 6 - build/dpkg-deps/docker.depends | 5 + build/dpkg-deps/generate.sh | 43 +++ build/dpkg-deps/unstable.depends | 2 + build/lib/motd | 4 +- build/lib/scripts/enable-kiosk | 6 +- build/lib/scripts/fake-apt | 2 +- build/lib/scripts/persist-apt-install | 2 +- build/raspberrypi/make-image.sh | 10 +- check-git-hash.sh | 6 +- check-platform.sh | 8 + {build/lib/scripts => debian}/postinst | 27 +- dpkg-build.sh | 48 +++ frontend/config-sample.json | 2 - .../shared/src/types/workspace-config.ts | 2 - .../server-logs/server-logs.page.html | 2 +- .../ui/src/app/services/api/mock-patch.ts | 1 + .../ui/src/app/services/config.service.ts | 4 - .../src/app/services/patch-db/data-model.ts | 1 + image-recipe/.gitignore | 2 + image-recipe/README.md | 23 ++ image-recipe/build.sh | 324 ++++++++++++++++++ image-recipe/prepare.sh | 24 ++ .../raspberrypi/img/etc}/fstab | 0 .../usr/lib/startos/scripts}/init_resize.sh | 2 +- .../raspberrypi/squashfs/boot/cmdline.txt | 1 + .../raspberrypi/squashfs/boot/config.txt | 86 +++++ .../squashfs/etc/embassy/config.yaml | 6 + .../squashfs/etc/modprobe.d/cfg80211.conf | 1 + .../squashfs/usr/bin/extract-ikconfig | 69 ++++ image-recipe/run-local-build.sh | 88 +++++ image-recipe/splash.png | Bin 0 -> 9834 bytes system-images/compat/Cargo.lock | 29 -- system-images/compat/Makefile | 11 +- system-images/compat/build.sh | 11 +- 62 files changed, 1052 insertions(+), 368 deletions(-) create mode 100755 basename.sh create mode 100644 build/.gitignore rename build/{lib => dpkg-deps}/conflicts (51%) rename build/{lib => dpkg-deps}/depends (88%) create mode 100644 build/dpkg-deps/docker.depends create mode 100755 build/dpkg-deps/generate.sh create mode 100644 build/dpkg-deps/unstable.depends create mode 100755 check-platform.sh rename {build/lib/scripts => debian}/postinst (81%) create mode 100755 dpkg-build.sh create mode 100644 image-recipe/.gitignore create mode 100644 image-recipe/README.md create mode 100755 image-recipe/build.sh create mode 100755 image-recipe/prepare.sh rename {build/raspberrypi => image-recipe/raspberrypi/img/etc}/fstab (100%) rename {build/raspberrypi => image-recipe/raspberrypi/img/usr/lib/startos/scripts}/init_resize.sh (98%) create mode 100644 image-recipe/raspberrypi/squashfs/boot/cmdline.txt create mode 100644 image-recipe/raspberrypi/squashfs/boot/config.txt create mode 100644 image-recipe/raspberrypi/squashfs/etc/embassy/config.yaml create mode 100644 image-recipe/raspberrypi/squashfs/etc/modprobe.d/cfg80211.conf create mode 100755 image-recipe/raspberrypi/squashfs/usr/bin/extract-ikconfig create mode 100755 image-recipe/run-local-build.sh create mode 100644 image-recipe/splash.png diff --git a/.github/workflows/startos-iso.yaml b/.github/workflows/startos-iso.yaml index c2e568d47..b33d57984 100644 --- a/.github/workflows/startos-iso.yaml +++ b/.github/workflows/startos-iso.yaml @@ -12,9 +12,9 @@ on: - dev - unstable - dev-unstable - - podman - - dev-podman - - dev-unstable-podman + - docker + - dev-docker + - dev-unstable-docker runner: type: choice description: Runner @@ -42,11 +42,55 @@ on: env: NODEJS_VERSION: "18.15.0" - ENVIRONMENT: '${{ fromJson(format(''["{0}", ""]'', github.event.inputs.environment || ''dev-podman''))[github.event.inputs.environment == ''NONE''] }}' + ENVIRONMENT: '${{ fromJson(format(''["{0}", ""]'', github.event.inputs.environment || ''dev''))[github.event.inputs.environment == ''NONE''] }}' jobs: - all: - name: Build + compile: + name: Compile Base Binaries + strategy: + fail-fast: true + matrix: + arch: >- + ${{ + fromJson('{ + "x86_64": ["x86_64"], + "x86_64-nonfree": ["x86_64"], + "aarch64": ["aarch64"], + "aarch64-nonfree": ["aarch64"], + "raspberrypi": ["aarch64"], + "ALL": ["x86_64", "aarch64"] + }')[github.event.inputs.platform || 'ALL'] + }} + runs-on: ${{ fromJson('["ubuntu-22.04", "buildjet-32vcpu-ubuntu-2204"]')[github.event.inputs.runner == 'fast'] }} + steps: + - run: | + sudo mount -t tmpfs tmpfs . + if: ${{ github.event.inputs.runner == 'fast' }} + + - uses: actions/checkout@v3 + with: + submodules: recursive + + - uses: actions/setup-node@v3 + with: + node-version: ${{ env.NODEJS_VERSION }} + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Make + run: make ARCH=${{ matrix.arch }} compiled-${{ matrix.arch }}.tar + + - uses: actions/upload-artifact@v3 + with: + name: compiled-${{ matrix.arch }}.tar + path: compiled-${{ matrix.arch }}.tar + image: + name: Build Image + needs: [compile] strategy: fail-fast: false matrix: @@ -68,86 +112,30 @@ jobs: format( '["ubuntu-22.04", "{0}"]', fromJson('{ - "x86_64": ["buildjet-32vcpu-ubuntu-2204", "buildjet-32vcpu-ubuntu-2204"], - "x86_64-nonfree": ["buildjet-32vcpu-ubuntu-2204", "buildjet-32vcpu-ubuntu-2204"], - "aarch64": ["buildjet-16vcpu-ubuntu-2204-arm", "buildjet-32vcpu-ubuntu-2204-arm"], - "aarch64-nonfree": ["buildjet-16vcpu-ubuntu-2204-arm", "buildjet-32vcpu-ubuntu-2204-arm"], - "raspberrypi": ["buildjet-16vcpu-ubuntu-2204-arm", "buildjet-32vcpu-ubuntu-2204-arm"], - }')[matrix.platform][github.event.inputs.platform == matrix.platform] + "x86_64": "buildjet-32vcpu-ubuntu-2204", + "x86_64-nonfree": "buildjet-32vcpu-ubuntu-2204", + "aarch64": "buildjet-8vcpu-ubuntu-2204-arm", + "aarch64-nonfree": "buildjet-8vcpu-ubuntu-2204-arm", + "raspberrypi": "buildjet-8vcpu-ubuntu-2204-arm", + }')[matrix.platform] ) )[github.event.inputs.runner == 'fast'] }} + env: + ARCH: >- + ${{ + fromJson('{ + "x86_64": "x86_64", + "x86_64-nonfree": "x86_64", + "aarch64": "aarch64", + "aarch64-nonfree": "aarch64", + "raspberrypi": "aarch64", + }')[matrix.platform] + }} steps: - - name: Free space - run: df -h && rm -rf /opt/hostedtoolcache* && df -h - if: ${{ github.event.inputs.runner != 'fast' }} - - - run: | - sudo mount -t tmpfs tmpfs . - if: ${{ github.event.inputs.runner == 'fast' && (matrix.platform == 'x86_64' || matrix.platform == 'x86_64-nonfree' || github.event.inputs.platform == matrix.platform) }} - - - uses: actions/checkout@v3 - with: - repository: Start9Labs/embassy-os-deb - path: embassy-os-deb - - uses: actions/checkout@v3 with: submodules: recursive - path: embassy-os-deb/embassyos-0.3.x - - - run: | - cp -r debian embassyos-0.3.x/ - VERSION=0.3.x ./control.sh - cp embassyos-0.3.x/backend/startd.service embassyos-0.3.x/debian/embassyos.startd.service - working-directory: embassy-os-deb - - - uses: actions/setup-node@v3 - with: - node-version: ${{ env.NODEJS_VERSION }} - - - uses: actions/cache@v3 - with: - path: /var/lib/docker - key: ${{ runner.os }}-${{ matrix.platform }}-docker-cache - - - name: Get npm cache directory - id: npm-cache-dir - run: | - echo "dir=$(npm config get cache)" >> $GITHUB_OUTPUT - - uses: actions/cache@v3 - id: npm-cache - with: - path: ${{ steps.npm-cache-dir.outputs.dir }} - key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-node- - - - name: Install dependencies - run: | - sudo apt-get update - sudo apt-get install \ - debmake \ - debhelper-compat \ - crossbuild-essential-arm64 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Run dpkg build - working-directory: embassy-os-deb - run: "make VERSION=0.3.x TAG=${{ github.ref_name }}" - env: - OS_ARCH: ${{ matrix.platform }} - - - uses: actions/checkout@v3 - with: - repository: Start9Labs/startos-image-recipes - path: startos-image-recipes - ref: feature/podman - name: Install dependencies run: | @@ -166,52 +154,40 @@ jobs: - run: sudo mount -t tmpfs tmpfs /var/tmp/debspawn if: ${{ github.event.inputs.runner == 'fast' && (matrix.platform == 'x86_64' || matrix.platform == 'x86_64-nonfree') }} - - uses: actions/cache@v3 + - name: Download compiled artifacts + uses: actions/download-artifact@v3 with: - path: /var/lib/debspawn - key: ${{ runner.os }}-${{ matrix.platform }}-debspawn-init + name: compiled-${{ env.ARCH }}.tar - - run: "mkdir -p startos-image-recipes/overlays/deb" + - name: Extract compiled artifacts + run: tar -xvf compiled-${{ env.ARCH }}.tar - - run: "mv embassy-os-deb/embassyos_0.3.x-1_*.deb startos-image-recipes/overlays/deb/" - - - run: "sudo rm -rf embassy-os-deb ${{ steps.npm-cache-dir.outputs.dir }} $HOME/.cargo" + - name: Prevent rebuild of compiled artifacts + run: | + mkdir -p frontend/dist/raw + PLATFORM=${{ matrix.platform }} make -t compiled-${{ env.ARCH }}.tar - name: Run iso build - working-directory: startos-image-recipes - run: | - ./run-local-build.sh ${{ matrix.platform }} + run: PLATFORM=${{ matrix.platform }} make iso + if: ${{ matrix.platform != 'raspberrypi' }} + + - name: Run img build + run: PLATFORM=${{ matrix.platform }} make img + if: ${{ matrix.platform == 'raspberrypi' }} - uses: actions/upload-artifact@v3 with: name: ${{ matrix.platform }}.squashfs - path: startos-image-recipes/results/*.squashfs + path: results/*.squashfs - uses: actions/upload-artifact@v3 with: name: ${{ matrix.platform }}.iso - path: startos-image-recipes/results/*.iso + path: results/*.iso if: ${{ matrix.platform != 'raspberrypi' }} - - uses: actions/checkout@v3 - with: - submodules: recursive - path: start-os - if: ${{ matrix.platform == 'raspberrypi' }} - - - run: "mv startos-image-recipes/results/startos-*_raspberrypi.squashfs start-os/startos.raspberrypi.squashfs" - if: ${{ matrix.platform == 'raspberrypi' }} - - - run: rm -rf startos-image-recipes - if: ${{ matrix.platform == 'raspberrypi' }} - - - name: Build image - working-directory: start-os - run: make startos_raspberrypi.img - if: ${{ matrix.platform == 'raspberrypi' }} - - uses: actions/upload-artifact@v3 with: - name: raspberrypi.img - path: start-os/startos-*_raspberrypi.img + name: ${{ matrix.platform }}.img + path: results/*.img if: ${{ matrix.platform == 'raspberrypi' }} diff --git a/.gitignore b/.gitignore index c91de92fd..b97eb7334 100644 --- a/.gitignore +++ b/.gitignore @@ -16,13 +16,15 @@ deploy_web.sh secrets.db .vscode/ /cargo-deps/**/* +/PLATFORM.txt /ENVIRONMENT.txt /GIT_HASH.txt /VERSION.txt -/embassyos-*.tar.gz /eos-*.tar.gz /*.deb /target /*.squashfs -/debian -/DEBIAN \ No newline at end of file +/results +/dpkg-workdir +/compiled.tar +/compiled-*.tar \ No newline at end of file diff --git a/Makefile b/Makefile index 38f09468f..07a18aadb 100644 --- a/Makefile +++ b/Makefile @@ -1,25 +1,31 @@ -OS_ARCH := $(shell echo "${OS_ARCH}") -ARCH := $(shell if [ "$(OS_ARCH)" = "raspberrypi" ]; then echo aarch64; else echo $(OS_ARCH) | sed 's/-nonfree$$//g'; fi) -ENVIRONMENT_FILE = $(shell ./check-environment.sh) -GIT_HASH_FILE = $(shell ./check-git-hash.sh) -VERSION_FILE = $(shell ./check-version.sh) +PLATFORM_FILE := $(shell ./check-platform.sh) +ENVIRONMENT_FILE := $(shell ./check-environment.sh) +GIT_HASH_FILE := $(shell ./check-git-hash.sh) +VERSION_FILE := $(shell ./check-version.sh) +BASENAME := $(shell ./basename.sh) +PLATFORM := $(shell if [ -f ./PLATFORM.txt ]; then cat ./PLATFORM.txt; else echo unknown; fi) +ARCH := $(shell if [ "$(PLATFORM)" = "raspberrypi" ]; then echo aarch64; else echo $(PLATFORM) | sed 's/-nonfree$$//g'; fi) +IMAGE_TYPE=$(shell if [ "$(PLATFORM)" = raspberrypi ]; then echo img; else echo iso; fi) EMBASSY_BINS := backend/target/$(ARCH)-unknown-linux-gnu/release/startbox libs/target/aarch64-unknown-linux-musl/release/embassy_container_init libs/target/x86_64-unknown-linux-musl/release/embassy_container_init EMBASSY_UIS := frontend/dist/raw/ui frontend/dist/raw/setup-wizard frontend/dist/raw/diagnostic-ui frontend/dist/raw/install-wizard -BUILD_SRC := $(shell find build) +BUILD_SRC := $(shell git ls-files build) build/lib/depends build/lib/conflicts +DEBIAN_SRC := $(shell git ls-files debian/) +IMAGE_RECIPE_SRC := $(shell git ls-files image-recipe/) EMBASSY_SRC := backend/startd.service $(BUILD_SRC) -COMPAT_SRC := $(shell find system-images/compat/ -not -path 'system-images/compat/target/*' -and -not -name *.tar -and -not -name target) -UTILS_SRC := $(shell find system-images/utils/ -not -name *.tar) -BINFMT_SRC := $(shell find system-images/binfmt/ -not -name *.tar) -BACKEND_SRC := $(shell find backend/src) $(shell find backend/migrations) $(shell find patch-db/*/src) $(shell find libs/*/src) libs/*/Cargo.toml backend/Cargo.toml backend/Cargo.lock frontend/dist/static -FRONTEND_SHARED_SRC := $(shell find frontend/projects/shared) $(shell ls -p frontend/ | grep -v / | sed 's/^/frontend\//g') frontend/package.json frontend/node_modules frontend/config.json patch-db/client/dist frontend/patchdb-ui-seed.json -FRONTEND_UI_SRC := $(shell find frontend/projects/ui) -FRONTEND_SETUP_WIZARD_SRC := $(shell find frontend/projects/setup-wizard) -FRONTEND_DIAGNOSTIC_UI_SRC := $(shell find frontend/projects/diagnostic-ui) -FRONTEND_INSTALL_WIZARD_SRC := $(shell find frontend/projects/install-wizard) -PATCH_DB_CLIENT_SRC := $(shell find patch-db/client -not -path patch-db/client/dist -and -not -path patch-db/client/node_modules) +COMPAT_SRC := $(shell git ls-files system-images/compat/) +UTILS_SRC := $(shell git ls-files system-images/utils/) +BINFMT_SRC := $(shell git ls-files system-images/binfmt/) +BACKEND_SRC := $(shell git ls-files backend) $(shell git ls-files --recurse-submodules patch-db) $(shell git ls-files libs) frontend/dist/static +FRONTEND_SHARED_SRC := $(shell git ls-files frontend/projects/shared) $(shell ls -p frontend/ | grep -v / | sed 's/^/frontend\//g') frontend/node_modules frontend/config.json patch-db/client/dist frontend/patchdb-ui-seed.json +FRONTEND_UI_SRC := $(shell git ls-files frontend/projects/ui) +FRONTEND_SETUP_WIZARD_SRC := $(shell git ls-files frontend/projects/setup-wizard) +FRONTEND_DIAGNOSTIC_UI_SRC := $(shell git ls-files frontend/projects/diagnostic-ui) +FRONTEND_INSTALL_WIZARD_SRC := $(shell git ls-files frontend/projects/install-wizard) +PATCH_DB_CLIENT_SRC := $(shell git ls-files --recurse-submodules patch-db/client) GZIP_BIN := $(shell which pigz || which gzip) TAR_BIN := $(shell which gtar || which tar) -ALL_TARGETS := $(EMBASSY_BINS) system-images/compat/docker-images/$(ARCH).tar system-images/utils/docker-images/$(ARCH).tar system-images/binfmt/docker-images/$(ARCH).tar $(EMBASSY_SRC) $(shell if [ "$(OS_ARCH)" = "raspberrypi" ]; then echo cargo-deps/aarch64-unknown-linux-gnu/release/pi-beep; fi) $(shell /bin/bash -c 'if [[ "${ENVIRONMENT}" =~ (^|-)unstable($$|-) ]]; then echo cargo-deps/$(ARCH)-unknown-linux-gnu/release/tokio-console; fi') $(ENVIRONMENT_FILE) $(GIT_HASH_FILE) $(VERSION_FILE) +COMPILED_TARGETS := $(EMBASSY_BINS) system-images/compat/docker-images/$(ARCH).tar system-images/utils/docker-images/$(ARCH).tar system-images/binfmt/docker-images/$(ARCH).tar +ALL_TARGETS := $(EMBASSY_SRC) $(ENVIRONMENT_FILE) $(GIT_HASH_FILE) $(VERSION_FILE) $(COMPILED_TARGETS) $(shell if [ "$(PLATFORM)" = "raspberrypi" ]; then echo cargo-deps/aarch64-unknown-linux-gnu/release/pi-beep; fi) $(shell /bin/bash -c 'if [[ "${ENVIRONMENT}" =~ (^|-)unstable($$|-) ]]; then echo cargo-deps/$(ARCH)-unknown-linux-gnu/release/tokio-console; fi') $(PLATFORM_FILE) ifeq ($(REMOTE),) mkdir = mkdir -p $1 @@ -40,14 +46,14 @@ define cp endef endif - - .DELETE_ON_ERROR: -.PHONY: all gzip install clean format sdk snapshots frontends ui backend reflash startos_raspberrypi.img sudo wormhole +.PHONY: all metadata install clean format sdk snapshots frontends ui backend reflash deb $(IMAGE_TYPE) squashfs sudo wormhole docker-buildx all: $(ALL_TARGETS) +metadata: $(VERSION_FILE) $(PLATFORM_FILE) $(ENVIRONMENT_FILE) $(GIT_HASH_FILE) + sudo: sudo true @@ -64,9 +70,13 @@ clean: rm -rf patch-db/client/dist rm -rf patch-db/target rm -rf cargo-deps - rm ENVIRONMENT.txt - rm GIT_HASH.txt - rm VERSION.txt + rm -rf dpkg-workdir + rm -rf image-recipe/deb + rm -rf results + rm -f ENVIRONMENT.txt + rm -f PLATFORM.txt + rm -f GIT_HASH.txt + rm -f VERSION.txt format: cd backend && cargo +nightly fmt @@ -75,8 +85,20 @@ format: sdk: cd backend/ && ./install-sdk.sh -startos_raspberrypi.img: $(BUILD_SRC) startos.raspberrypi.squashfs $(VERSION_FILE) $(ENVIRONMENT_FILE) $(GIT_HASH_FILE) | sudo - ./build/raspberrypi/make-image.sh +deb: results/$(BASENAME).deb + +debian/control: build/lib/depends build/lib/conflicts + ./debuild/control.sh + +results/$(BASENAME).deb: dpkg-build.sh $(DEBIAN_SRC) $(VERSION_FILE) $(PLATFORM_FILE) $(ENVIRONMENT_FILE) $(GIT_HASH_FILE) + PLATFORM=$(PLATFORM) ./dpkg-build.sh + +$(IMAGE_TYPE): results/$(BASENAME).$(IMAGE_TYPE) + +squashfs: results/$(BASENAME).squashfs + +results/$(BASENAME).$(IMAGE_TYPE) results/$(BASENAME).squashfs: $(IMAGE_RECIPE_SRC) results/$(BASENAME).deb + ./image-recipe/run-local-build.sh "results/$(BASENAME).deb" # For creating os images. DO NOT USE install: $(ALL_TARGETS) @@ -88,58 +110,65 @@ install: $(ALL_TARGETS) $(call ln,/usr/bin/startbox,$(DESTDIR)/usr/bin/start-deno) $(call ln,/usr/bin/startbox,$(DESTDIR)/usr/bin/avahi-alias) $(call ln,/usr/bin/startbox,$(DESTDIR)/usr/bin/embassy-cli) - if [ "$(OS_ARCH)" = "raspberrypi" ]; then $(call cp,cargo-deps/aarch64-unknown-linux-gnu/release/pi-beep,$(DESTDIR)/usr/bin/pi-beep); fi + if [ "$(PLATFORM)" = "raspberrypi" ]; then $(call cp,cargo-deps/aarch64-unknown-linux-gnu/release/pi-beep,$(DESTDIR)/usr/bin/pi-beep); fi if /bin/bash -c '[[ "${ENVIRONMENT}" =~ (^|-)unstable($$|-) ]]'; then $(call cp,cargo-deps/$(ARCH)-unknown-linux-gnu/release/tokio-console,$(DESTDIR)/usr/bin/tokio-console); fi + $(call mkdir,$(DESTDIR)/lib/systemd/system) + $(call cp,backend/startd.service,$(DESTDIR)/lib/systemd/system/startd.service) + $(call mkdir,$(DESTDIR)/usr/lib) - $(call rm,$(DESTDIR)/usr/lib/embassy) - $(call cp,build/lib,$(DESTDIR)/usr/lib/embassy) + $(call rm,$(DESTDIR)/usr/lib/startos) + $(call cp,build/lib,$(DESTDIR)/usr/lib/startos) - $(call cp,ENVIRONMENT.txt,$(DESTDIR)/usr/lib/embassy/ENVIRONMENT.txt) - $(call cp,GIT_HASH.txt,$(DESTDIR)/usr/lib/embassy/GIT_HASH.txt) - $(call cp,VERSION.txt,$(DESTDIR)/usr/lib/embassy/VERSION.txt) + $(call cp,PLATFORM.txt,$(DESTDIR)/usr/lib/startos/PLATFORM.txt) + $(call cp,ENVIRONMENT.txt,$(DESTDIR)/usr/lib/startos/ENVIRONMENT.txt) + $(call cp,GIT_HASH.txt,$(DESTDIR)/usr/lib/startos/GIT_HASH.txt) + $(call cp,VERSION.txt,$(DESTDIR)/usr/lib/startos/VERSION.txt) - $(call mkdir,$(DESTDIR)/usr/lib/embassy/container) - $(call cp,libs/target/aarch64-unknown-linux-musl/release/embassy_container_init,$(DESTDIR)/usr/lib/embassy/container/embassy_container_init.arm64) - $(call cp,libs/target/x86_64-unknown-linux-musl/release/embassy_container_init,$(DESTDIR)/usr/lib/embassy/container/embassy_container_init.amd64) + $(call mkdir,$(DESTDIR)/usr/lib/startos/container) + $(call cp,libs/target/aarch64-unknown-linux-musl/release/embassy_container_init,$(DESTDIR)/usr/lib/startos/container/embassy_container_init.arm64) + $(call cp,libs/target/x86_64-unknown-linux-musl/release/embassy_container_init,$(DESTDIR)/usr/lib/startos/container/embassy_container_init.amd64) - $(call mkdir,$(DESTDIR)/usr/lib/embassy/system-images) - $(call cp,system-images/compat/docker-images/$(ARCH).tar,$(DESTDIR)/usr/lib/embassy/system-images/compat.tar) - $(call cp,system-images/utils/docker-images/$(ARCH).tar,$(DESTDIR)/usr/lib/embassy/system-images/utils.tar) - $(call cp,system-images/binfmt/docker-images/$(ARCH).tar,$(DESTDIR)/usr/lib/embassy/system-images/binfmt.tar) + $(call mkdir,$(DESTDIR)/usr/lib/startos/system-images) + $(call cp,system-images/compat/docker-images/$(ARCH).tar,$(DESTDIR)/usr/lib/startos/system-images/compat.tar) + $(call cp,system-images/utils/docker-images/$(ARCH).tar,$(DESTDIR)/usr/lib/startos/system-images/utils.tar) + $(call cp,system-images/binfmt/docker-images/$(ARCH).tar,$(DESTDIR)/usr/lib/startos/system-images/binfmt.tar) -update-overlay: +update-overlay: $(ALL_TARGETS) @echo "\033[33m!!! THIS WILL ONLY REFLASH YOUR DEVICE IN MEMORY !!!\033[0m" @echo "\033[33mALL CHANGES WILL BE REVERTED IF YOU RESTART THE DEVICE\033[0m" @if [ -z "$(REMOTE)" ]; then >&2 echo "Must specify REMOTE" && false; fi - @if [ "`ssh $(REMOTE) 'cat /usr/lib/embassy/VERSION.txt'`" != "`cat ./VERSION.txt`" ]; then >&2 echo "StartOS requires migrations: update-overlay is unavailable." && false; fi + @if [ "`ssh $(REMOTE) 'cat /usr/lib/startos/VERSION.txt'`" != "`cat ./VERSION.txt`" ]; then >&2 echo "StartOS requires migrations: update-overlay is unavailable." && false; fi $(call ssh,"sudo systemctl stop startd") - $(MAKE) install REMOTE=$(REMOTE) SSHPASS=$(SSHPASS) OS_ARCH=$(OS_ARCH) + $(MAKE) install REMOTE=$(REMOTE) SSHPASS=$(SSHPASS) PLATFORM=$(PLATFORM) $(call ssh,"sudo systemctl start startd") wormhole: backend/target/$(ARCH)-unknown-linux-gnu/release/startbox - @wormhole send backend/target/$(ARCH)-unknown-linux-gnu/release/startbox 2>&1 | awk -Winteractive '/wormhole receive/ { printf "sudo /usr/lib/embassy/scripts/chroot-and-upgrade \"cd /usr/bin && rm startbox && wormhole receive --accept-file %s && chmod +x startbox\"\n", $$3 }' + @wormhole send backend/target/$(ARCH)-unknown-linux-gnu/release/startbox 2>&1 | awk -Winteractive '/wormhole receive/ { printf "sudo /usr/lib/startos/scripts/chroot-and-upgrade \"cd /usr/bin && rm startbox && wormhole receive --accept-file %s && chmod +x startbox\"\n", $$3 }' -update: +update: $(ALL_TARGETS) @if [ -z "$(REMOTE)" ]; then >&2 echo "Must specify REMOTE" && false; fi $(call ssh,"sudo rsync -a --delete --force --info=progress2 /media/embassy/embassyfs/current/ /media/embassy/next/") - $(MAKE) install REMOTE=$(REMOTE) SSHPASS=$(SSHPASS) DESTDIR=/media/embassy/next OS_ARCH=$(OS_ARCH) - $(call ssh,'sudo NO_SYNC=1 /media/embassy/next/usr/lib/embassy/scripts/chroot-and-upgrade "apt-get install -y $(shell cat ./build/lib/depends)"') + $(MAKE) install REMOTE=$(REMOTE) SSHPASS=$(SSHPASS) DESTDIR=/media/embassy/next PLATFORM=$(PLATFORM) + $(call ssh,'sudo NO_SYNC=1 /media/embassy/next/usr/lib/startos/scripts/chroot-and-upgrade "apt-get install -y $(shell cat ./build/lib/depends)"') -emulate-reflash: +emulate-reflash: $(ALL_TARGETS) @if [ -z "$(REMOTE)" ]; then >&2 echo "Must specify REMOTE" && false; fi $(call ssh,"sudo rsync -a --delete --force --info=progress2 /media/embassy/embassyfs/current/ /media/embassy/next/") - $(MAKE) install REMOTE=$(REMOTE) SSHPASS=$(SSHPASS) DESTDIR=/media/embassy/next OS_ARCH=$(OS_ARCH) + $(MAKE) install REMOTE=$(REMOTE) SSHPASS=$(SSHPASS) DESTDIR=/media/embassy/next PLATFORM=$(PLATFORM) $(call ssh,"sudo touch /media/embassy/config/upgrade && sudo rm -f /media/embassy/config/disk.guid && sudo sync && sudo reboot") -system-images/compat/docker-images/aarch64.tar system-images/compat/docker-images/x86_64.tar: $(COMPAT_SRC) backend/Cargo.lock - cd system-images/compat && make && touch docker-images/*.tar +build/lib/depends build/lib/conflicts: build/dpkg-deps/* + build/dpkg-deps/generate.sh -system-images/utils/docker-images/aarch64.tar system-images/utils/docker-images/x86_64.tar: $(UTILS_SRC) - cd system-images/utils && make && touch docker-images/*.tar +system-images/compat/docker-images/$(ARCH).tar: $(COMPAT_SRC) backend/Cargo.lock | docker-buildx + cd system-images/compat && make docker-images/$(ARCH).tar && touch docker-images/$(ARCH).tar -system-images/binfmt/docker-images/aarch64.tar system-images/binfmt/docker-images/x86_64.tar: $(BINFMT_SRC) - cd system-images/binfmt && make && touch docker-images/*.tar +system-images/utils/docker-images/$(ARCH).tar: $(UTILS_SRC) | docker-buildx + cd system-images/utils && make docker-images/$(ARCH).tar && touch docker-images/$(ARCH).tar + +system-images/binfmt/docker-images/$(ARCH).tar: $(BINFMT_SRC) | docker-buildx + cd system-images/binfmt && make docker-images/$(ARCH).tar && touch docker-images/$(ARCH).tar snapshots: libs/snapshot_creator/Cargo.toml cd libs/ && ./build-v8-snapshot.sh @@ -152,27 +181,23 @@ $(EMBASSY_BINS): $(BACKEND_SRC) $(ENVIRONMENT_FILE) $(GIT_HASH_FILE) frontend/pa frontend/node_modules: frontend/package.json npm --prefix frontend ci -frontend/dist/raw/ui: $(FRONTEND_UI_SRC) $(FRONTEND_SHARED_SRC) $(ENVIRONMENT_FILE) +frontend/dist/raw/ui: $(FRONTEND_UI_SRC) $(FRONTEND_SHARED_SRC) npm --prefix frontend run build:ui -frontend/dist/raw/setup-wizard: $(FRONTEND_SETUP_WIZARD_SRC) $(FRONTEND_SHARED_SRC) $(ENVIRONMENT_FILE) +frontend/dist/raw/setup-wizard: $(FRONTEND_SETUP_WIZARD_SRC) $(FRONTEND_SHARED_SRC) npm --prefix frontend run build:setup -frontend/dist/raw/diagnostic-ui: $(FRONTEND_DIAGNOSTIC_UI_SRC) $(FRONTEND_SHARED_SRC) $(ENVIRONMENT_FILE) +frontend/dist/raw/diagnostic-ui: $(FRONTEND_DIAGNOSTIC_UI_SRC) $(FRONTEND_SHARED_SRC) npm --prefix frontend run build:dui -frontend/dist/raw/install-wizard: $(FRONTEND_INSTALL_WIZARD_SRC) $(FRONTEND_SHARED_SRC) $(ENVIRONMENT_FILE) +frontend/dist/raw/install-wizard: $(FRONTEND_INSTALL_WIZARD_SRC) $(FRONTEND_SHARED_SRC) npm --prefix frontend run build:install-wiz -frontend/dist/static: $(EMBASSY_UIS) +frontend/dist/static: $(EMBASSY_UIS) $(ENVIRONMENT_FILE) ./compress-uis.sh frontend/config.json: $(GIT_HASH_FILE) frontend/config-sample.json - jq '.useMocks = false' frontend/config-sample.json > frontend/config.json - jq '.packageArch = "$(ARCH)"' frontend/config.json > frontend/config.json.tmp - jq '.osArch = "$(OS_ARCH)"' frontend/config.json.tmp > frontend/config.json - rm frontend/config.json.tmp - npm --prefix frontend run-script build-config + jq '.useMocks = false' frontend/config-sample.json | jq '.gitHash = "$(shell cat GIT_HASH.txt)"' > frontend/config.json frontend/patchdb-ui-seed.json: frontend/package.json jq '."ack-welcome" = $(shell yq '.version' frontend/package.json)' frontend/patchdb-ui-seed.json > ui-seed.tmp @@ -186,7 +211,7 @@ patch-db/client/dist: $(PATCH_DB_CLIENT_SRC) patch-db/client/node_modules npm --prefix frontend run build:deps # used by github actions -backend-$(ARCH).tar: $(EMBASSY_BINS) +compiled-$(ARCH).tar: $(COMPILED_TARGETS) $(ENVIRONMENT_FILE) $(GIT_HASH_FILE) $(VERSION_FILE) tar -cvf $@ $^ # this is a convenience step to build all frontends - it is not referenced elsewhere in this file @@ -195,9 +220,6 @@ frontends: $(EMBASSY_UIS) # this is a convenience step to build the UI ui: frontend/dist/raw/ui -# used by github actions -backend: $(EMBASSY_BINS) - cargo-deps/aarch64-unknown-linux-gnu/release/pi-beep: ARCH=aarch64 ./build-cargo-dep.sh pi-beep diff --git a/backend/Cargo.lock b/backend/Cargo.lock index ae5690b8d..c2b316f24 100644 --- a/backend/Cargo.lock +++ b/backend/Cargo.lock @@ -1896,28 +1896,6 @@ version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" -[[package]] -name = "git-version" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6b0decc02f4636b9ccad390dcbe77b722a77efedfa393caf8379a51d5c61899" -dependencies = [ - "git-version-macro", - "proc-macro-hack", -] - -[[package]] -name = "git-version-macro" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe69f1cbdb6e28af2bac214e943b99ce8a0a06b447d15d3e61161b0423139f3f" -dependencies = [ - "proc-macro-hack", - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "glob" version = "0.3.1" @@ -4938,7 +4916,6 @@ dependencies = [ "emver", "fd-lock-rs", "futures", - "git-version", "gpt", "helpers", "hex", diff --git a/backend/Cargo.toml b/backend/Cargo.toml index 84998b323..bd9b4e608 100644 --- a/backend/Cargo.toml +++ b/backend/Cargo.toml @@ -15,6 +15,7 @@ name = "start-os" readme = "README.md" repository = "https://github.com/Start9Labs/start-os" version = "0.3.5" +license = "MIT" [lib] name = "startos" @@ -31,7 +32,7 @@ cli = [] daemon = [] default = ["cli", "sdk", "daemon", "js_engine"] dev = [] -podman = [] +docker = [] sdk = [] unstable = ["console-subscriber", "tokio/tracing"] @@ -76,7 +77,6 @@ emver = { version = "0.1.7", git = "https://github.com/Start9Labs/emver-rs.git", ] } fd-lock-rs = "0.1.4" futures = "0.3.28" -git-version = "0.3.5" gpt = "3.1.0" helpers = { path = "../libs/helpers" } hex = "0.4.3" diff --git a/backend/build-prod.sh b/backend/build-prod.sh index c679fdf98..d6c64eec2 100755 --- a/backend/build-prod.sh +++ b/backend/build-prod.sh @@ -3,11 +3,6 @@ set -e shopt -s expand_aliases -if [ -z "$OS_ARCH" ]; then - >&2 echo '$OS_ARCH is required' - exit 1 -fi - if [ -z "$ARCH" ]; then ARCH=$(uname -m) fi @@ -23,27 +18,17 @@ if tty -s; then fi cd .. -FLAGS="" +FEATURES="$(echo $ENVIRONMENT | sed 's/-/,/g')" RUSTFLAGS="" -if [[ "$ENVIRONMENT" =~ (^|-)podman($|-) ]]; then - FLAGS="podman,$FLAGS" -fi -if [[ "$ENVIRONMENT" =~ (^|-)unstable($|-) ]]; then - FLAGS="unstable,$FLAGS" - RUSTFLAGS="$RUSTFLAGS --cfg tokio_unstable" -fi -if [[ "$ENVIRONMENT" =~ (^|-)dev($|-) ]]; then - FLAGS="dev,$FLAGS" -fi -alias 'rust-gnu-builder'='docker run $USE_TTY --rm -e "OS_ARCH=$OS_ARCH" -e "RUSTFLAGS=$RUSTFLAGS" -v "$HOME/.cargo/registry":/usr/local/cargo/registry -v "$(pwd)":/home/rust/src -w /home/rust/src -P start9/rust-arm-cross:aarch64' -alias 'rust-musl-builder'='docker run $USE_TTY --rm -e "OS_ARCH=$OS_ARCH" -v "$HOME/.cargo/registry":/root/.cargo/registry -v "$(pwd)":/home/rust/src -P messense/rust-musl-cross:$ARCH-musl' +alias 'rust-gnu-builder'='docker run $USE_TTY --rm -e "RUSTFLAGS=$RUSTFLAGS" -v "$HOME/.cargo/registry":/usr/local/cargo/registry -v "$(pwd)":/home/rust/src -w /home/rust/src -P start9/rust-arm-cross:aarch64' +alias 'rust-musl-builder'='docker run $USE_TTY --rm -v "$HOME/.cargo/registry":/root/.cargo/registry -v "$(pwd)":/home/rust/src -P messense/rust-musl-cross:$ARCH-musl' set +e fail= -echo "FLAGS=\"$FLAGS\"" +echo "FEATURES=\"$FEATURES\"" echo "RUSTFLAGS=\"$RUSTFLAGS\"" -rust-gnu-builder sh -c "(cd backend && cargo build --release --features avahi-alias,$FLAGS --locked --target=$ARCH-unknown-linux-gnu)" +rust-gnu-builder sh -c "(cd backend && cargo build --release --features avahi-alias,$FEATURES --locked --target=$ARCH-unknown-linux-gnu)" if test $? -ne 0; then fail=true fi diff --git a/backend/install-sdk.sh b/backend/install-sdk.sh index 56edaa3dd..a5d9b31b6 100755 --- a/backend/install-sdk.sh +++ b/backend/install-sdk.sh @@ -11,8 +11,8 @@ fi frontend="../frontend/dist/static" [ -d "$frontend" ] || mkdir -p "$frontend" -if [ -z "$OS_ARCH" ]; then - export OS_ARCH=$(uname -m) +if [ -z "$PLATFORM" ]; then + export PLATFORM=$(uname -m) fi cargo install --path=. --no-default-features --features=js_engine,sdk,cli --locked diff --git a/backend/src/bins/start_deno.rs b/backend/src/bins/start_deno.rs index 1a68decfc..43c97485a 100644 --- a/backend/src/bins/start_deno.rs +++ b/backend/src/bins/start_deno.rs @@ -1,13 +1,9 @@ -use clap::Arg; -use rpc_toolkit::command; -use rpc_toolkit::run_cli; use rpc_toolkit::yajrc::RpcError; +use rpc_toolkit::{command, run_cli, Context}; use serde_json::Value; -use crate::context::CliContext; use crate::procedure::js_scripts::ExecuteArgs; use crate::s9pk::manifest::PackageId; -use crate::util::logger::EmbassyLogger; use crate::util::serde::{display_serializable, parse_stdin_deserializable}; use crate::version::{Current, VersionT}; use crate::Error; @@ -16,6 +12,9 @@ lazy_static::lazy_static! { static ref VERSION_STRING: String = Current::new().semver().to_string(); } +struct DenoContext; +impl Context for DenoContext {} + #[command(subcommands(execute, sandbox))] fn deno_api() -> Result<(), Error> { Ok(()) @@ -103,16 +102,8 @@ fn inner_main() -> Result<(), Error> { command: deno_api, app: app => app .name("StartOS Deno Executor") - .version(&**VERSION_STRING) - .arg( - clap::Arg::with_name("config") - .short('c') - .long("config") - .takes_value(true), - ), - context: matches => { - CliContext::init(matches)? - }, + .version(&**VERSION_STRING), + context: _m => DenoContext, exit: |e: RpcError| { match e.data { Some(Value::String(s)) => eprintln!("{}: {}", e.message, s), diff --git a/backend/src/bins/start_init.rs b/backend/src/bins/start_init.rs index a2b16cf78..0440e0ad6 100644 --- a/backend/src/bins/start_init.rs +++ b/backend/src/bins/start_init.rs @@ -17,7 +17,7 @@ use crate::net::web_server::WebServer; use crate::shutdown::Shutdown; use crate::sound::CHIME; use crate::util::Invoke; -use crate::{Error, ErrorKind, ResultExt, OS_ARCH}; +use crate::{Error, ErrorKind, ResultExt, PLATFORM}; #[instrument(skip_all)] async fn setup_or_init(cfg_path: Option) -> Result, Error> { @@ -30,19 +30,19 @@ async fn setup_or_init(cfg_path: Option) -> Result, Er Command::new("ln") .arg("-sf") - .arg("/usr/lib/embassy/scripts/fake-apt") + .arg("/usr/lib/startos/scripts/fake-apt") .arg("/usr/local/bin/apt") .invoke(crate::ErrorKind::OpenSsh) .await?; Command::new("ln") .arg("-sf") - .arg("/usr/lib/embassy/scripts/fake-apt") + .arg("/usr/lib/startos/scripts/fake-apt") .arg("/usr/local/bin/apt-get") .invoke(crate::ErrorKind::OpenSsh) .await?; Command::new("ln") .arg("-sf") - .arg("/usr/lib/embassy/scripts/fake-apt") + .arg("/usr/lib/startos/scripts/fake-apt") .arg("/usr/local/bin/aptitude") .invoke(crate::ErrorKind::OpenSsh) .await?; @@ -177,7 +177,7 @@ async fn run_script_if_exists>(path: P) { #[instrument(skip_all)] async fn inner_main(cfg_path: Option) -> Result, Error> { - if OS_ARCH == "raspberrypi" && tokio::fs::metadata(STANDBY_MODE_PATH).await.is_ok() { + if &*PLATFORM == "raspberrypi" && tokio::fs::metadata(STANDBY_MODE_PATH).await.is_ok() { tokio::fs::remove_file(STANDBY_MODE_PATH).await?; Command::new("sync").invoke(ErrorKind::Filesystem).await?; crate::sound::SHUTDOWN.play().await?; diff --git a/backend/src/config/spec.rs b/backend/src/config/spec.rs index 35512d47a..09f7ec91e 100644 --- a/backend/src/config/spec.rs +++ b/backend/src/config/spec.rs @@ -1,4 +1,4 @@ -use std::borrow::{Borrow, Cow}; +use std::borrow::{Cow}; use std::collections::{BTreeMap, BTreeSet}; use std::fmt; use std::fmt::Debug; @@ -105,7 +105,7 @@ where rng: &mut R, timeout: &Option, ) -> Result { - self.gen_with(self.default_spec().borrow(), rng, timeout) + self.gen_with(self.default_spec(), rng, timeout) } } diff --git a/backend/src/db/model.rs b/backend/src/db/model.rs index 86c9bbb42..2e8cf1ede 100644 --- a/backend/src/db/model.rs +++ b/backend/src/db/model.rs @@ -4,6 +4,7 @@ use std::sync::Arc; use chrono::{DateTime, Utc}; use emver::VersionRange; +use imbl_value::InternedString; use ipnet::{Ipv4Net, Ipv6Net}; use isocountry::CountryCode; use itertools::Itertools; @@ -23,6 +24,7 @@ use crate::s9pk::manifest::{Manifest, PackageId}; use crate::status::Status; use crate::util::Version; use crate::version::{Current, VersionT}; +use crate::{ARCH, PLATFORM}; #[derive(Debug, Deserialize, Serialize, HasModel)] #[serde(rename_all = "kebab-case")] @@ -38,6 +40,8 @@ impl Database { let lan_address = account.hostname.lan_address().parse().unwrap(); Database { server_info: ServerInfo { + arch: get_arch(), + platform: get_platform(), id: account.server_id.clone(), version: Current::new().semver().into(), hostname: account.hostname.no_dot_host_name(), @@ -87,10 +91,22 @@ impl Database { pub type DatabaseModel = Model; +fn get_arch() -> InternedString { + (*ARCH).into() +} + +fn get_platform() -> InternedString { + (&*PLATFORM).into() +} + #[derive(Debug, Deserialize, Serialize, HasModel)] #[serde(rename_all = "kebab-case")] #[model = "Model"] pub struct ServerInfo { + #[serde(default = "get_arch")] + pub arch: InternedString, + #[serde(default = "get_platform")] + pub platform: InternedString, pub id: String, pub hostname: String, pub version: Version, diff --git a/backend/src/firmware.rs b/backend/src/firmware.rs index 3ffb603fe..708ae2169 100644 --- a/backend/src/firmware.rs +++ b/backend/src/firmware.rs @@ -23,7 +23,7 @@ pub async fn update_firmware() -> Result { if product_name.is_empty() { return Ok(RequiresReboot(false)); } - let firmware_dir = Path::new("/usr/lib/embassy/firmware").join(&product_name); + let firmware_dir = Path::new("/usr/lib/startos/firmware").join(&product_name); if tokio::fs::metadata(&firmware_dir).await.is_ok() { let current_firmware = String::from_utf8( Command::new("dmidecode") diff --git a/backend/src/init.rs b/backend/src/init.rs index b98a23921..fdbc41212 100644 --- a/backend/src/init.rs +++ b/backend/src/init.rs @@ -263,6 +263,9 @@ pub async fn init(cfg: &RpcContextConfig) -> Result { tracing::info!("Mounted Logs"); let tmp_dir = cfg.datadir().join("package-data/tmp"); + if should_rebuild && tokio::fs::metadata(&tmp_dir).await.is_ok() { + tokio::fs::remove_dir_all(&tmp_dir).await?; + } if tokio::fs::metadata(&tmp_dir).await.is_err() { tokio::fs::create_dir_all(&tmp_dir).await?; } @@ -275,9 +278,6 @@ pub async fn init(cfg: &RpcContextConfig) -> Result { .datadir() .join(format!("package-data/tmp/{CONTAINER_TOOL}")); let tmp_docker_exists = tokio::fs::metadata(&tmp_docker).await.is_ok(); - if should_rebuild && tmp_docker_exists { - tokio::fs::remove_dir_all(&tmp_docker).await?; - } if CONTAINER_TOOL == "docker" { Command::new("systemctl") .arg("stop") @@ -309,7 +309,7 @@ pub async fn init(cfg: &RpcContextConfig) -> Result { } tracing::info!("Loading System Docker Images"); - crate::install::load_images("/usr/lib/embassy/system-images").await?; + crate::install::load_images("/usr/lib/startos/system-images").await?; tracing::info!("Loaded System Docker Images"); tracing::info!("Loading Package Docker Images"); diff --git a/backend/src/lib.rs b/backend/src/lib.rs index 986682252..67f34d785 100644 --- a/backend/src/lib.rs +++ b/backend/src/lib.rs @@ -5,12 +5,18 @@ pub const DEFAULT_MARKETPLACE: &str = "https://registry.start9.com"; pub const BUFFER_SIZE: usize = 1024; pub const HOST_IP: [u8; 4] = [172, 18, 0, 1]; pub const TARGET: &str = current_platform::CURRENT_PLATFORM; -pub const OS_ARCH: &str = env!("OS_ARCH"); lazy_static::lazy_static! { pub static ref ARCH: &'static str = { let (arch, _) = TARGET.split_once("-").unwrap(); arch }; + pub static ref PLATFORM: String = { + if let Ok(platform) = std::fs::read_to_string("/usr/lib/startos/PLATFORM.txt") { + platform + } else { + ARCH.to_string() + } + }; } pub mod account; diff --git a/backend/src/logs.rs b/backend/src/logs.rs index baacb2845..26463be35 100644 --- a/backend/src/logs.rs +++ b/backend/src/logs.rs @@ -145,7 +145,7 @@ pub struct JournalctlEntry { #[serde(rename = "__REALTIME_TIMESTAMP")] pub timestamp: String, #[serde(rename = "MESSAGE")] - #[serde(deserialize_with = "deserialize_string_or_utf8_array")] + #[serde(deserialize_with = "deserialize_log_message")] pub message: String, #[serde(rename = "__CURSOR")] pub cursor: String, @@ -164,7 +164,7 @@ impl JournalctlEntry { } } -fn deserialize_string_or_utf8_array<'de, D: serde::de::Deserializer<'de>>( +fn deserialize_log_message<'de, D: serde::de::Deserializer<'de>>( deserializer: D, ) -> std::result::Result { struct Visitor; @@ -177,13 +177,7 @@ fn deserialize_string_or_utf8_array<'de, D: serde::de::Deserializer<'de>>( where E: serde::de::Error, { - Ok(v.to_owned()) - } - fn visit_string(self, v: String) -> Result - where - E: serde::de::Error, - { - Ok(v) + Ok(v.trim().to_owned()) } fn visit_unit(self) -> Result where @@ -201,6 +195,7 @@ fn deserialize_string_or_utf8_array<'de, D: serde::de::Deserializer<'de>>( .flatten() .collect::, _>>()?, ) + .map(|s| s.trim().to_owned()) .map_err(serde::de::Error::custom) } } @@ -374,12 +369,12 @@ pub async fn journalctl( cmd.arg(format!("_COMM={}", SYSTEM_UNIT)); } LogSource::Container(id) => { - #[cfg(feature = "podman")] + #[cfg(not(feature = "docker"))] cmd.arg(format!( "SYSLOG_IDENTIFIER={}", DockerProcedure::container_name(&id, None) )); - #[cfg(not(feature = "podman"))] + #[cfg(feature = "docker")] cmd.arg(format!( "CONTAINER_NAME={}", DockerProcedure::container_name(&id, None) diff --git a/backend/src/procedure/docker.rs b/backend/src/procedure/docker.rs index 79f62039d..92d19d6c2 100644 --- a/backend/src/procedure/docker.rs +++ b/backend/src/procedure/docker.rs @@ -813,7 +813,7 @@ impl LongRunning { socket_path: &Path, ) -> Result { const INIT_EXEC: &str = "/start9/bin/embassy_container_init"; - const BIND_LOCATION: &str = "/usr/lib/embassy/container/"; + const BIND_LOCATION: &str = "/usr/lib/startos/container/"; tracing::trace!("setup_long_running_docker_cmd"); remove_container(container_name, true).await?; diff --git a/backend/src/registry/marketplace.rs b/backend/src/registry/marketplace.rs index 435350240..979733198 100644 --- a/backend/src/registry/marketplace.rs +++ b/backend/src/registry/marketplace.rs @@ -23,7 +23,7 @@ pub fn with_query_params(ctx: RpcContext, mut url: Url) -> Url { "os.compat", &crate::version::Current::new().compat().to_string(), ) - .append_pair("os.arch", crate::OS_ARCH) + .append_pair("os.arch", &*crate::PLATFORM) .append_pair("hardware.arch", &*crate::ARCH) .append_pair("hardware.ram", &ctx.hardware.ram.to_string()); diff --git a/backend/src/shutdown.rs b/backend/src/shutdown.rs index 98465f454..93e5cc3d2 100644 --- a/backend/src/shutdown.rs +++ b/backend/src/shutdown.rs @@ -9,7 +9,7 @@ use crate::init::{STANDBY_MODE_PATH, SYSTEM_REBUILD_PATH}; use crate::sound::SHUTDOWN; use crate::util::docker::CONTAINER_TOOL; use crate::util::{display_none, Invoke}; -use crate::{Error, OS_ARCH}; +use crate::{Error, PLATFORM}; #[derive(Debug, Clone)] pub struct Shutdown { @@ -60,7 +60,7 @@ impl Shutdown { tracing::debug!("{:?}", e); } } - if OS_ARCH != "raspberrypi" || self.restart { + if &*PLATFORM != "raspberrypi" || self.restart { if let Err(e) = SHUTDOWN.play().await { tracing::error!("Error Playing Shutdown Song: {}", e); tracing::debug!("{:?}", e); @@ -68,7 +68,7 @@ impl Shutdown { } }); drop(rt); - if OS_ARCH == "raspberrypi" { + if &*PLATFORM == "raspberrypi" { if !self.restart { std::fs::write(STANDBY_MODE_PATH, "").unwrap(); Command::new("sync").spawn().unwrap().wait().unwrap(); diff --git a/backend/src/update/mod.rs b/backend/src/update/mod.rs index 814a27b1d..4ce57a8d1 100644 --- a/backend/src/update/mod.rs +++ b/backend/src/update/mod.rs @@ -25,7 +25,7 @@ use crate::sound::{ }; use crate::update::latest_information::LatestInformation; use crate::util::Invoke; -use crate::{Error, ErrorKind, ResultExt, OS_ARCH}; +use crate::{Error, ErrorKind, ResultExt, PLATFORM}; mod latest_information; @@ -231,7 +231,7 @@ impl EosUrl { .host_str() .ok_or_else(|| Error::new(eyre!("Could not get host of base"), ErrorKind::ParseUrl))?; let version: &Version = &self.version; - Ok(format!("{host}::{version}/{OS_ARCH}/") + Ok(format!("{host}::{version}/{}/", &*PLATFORM) .parse() .map_err(|_| Error::new(eyre!("Could not parse path"), ErrorKind::ParseUrl))?) } @@ -297,7 +297,7 @@ async fn sync_boot() -> Result<(), Error> { .await? .wait() .await?; - if OS_ARCH != "raspberrypi" { + if &*PLATFORM != "raspberrypi" { let dev_mnt = MountGuard::mount(&Bind::new("/dev"), "/media/embassy/next/dev", ReadWrite).await?; let sys_mnt = diff --git a/backend/src/util/docker.rs b/backend/src/util/docker.rs index e6c4d3db6..fb6bc15f4 100644 --- a/backend/src/util/docker.rs +++ b/backend/src/util/docker.rs @@ -7,14 +7,14 @@ use tokio::process::Command; use crate::util::Invoke; -#[cfg(not(feature = "podman"))] +#[cfg(feature = "docker")] pub const CONTAINER_TOOL: &str = "docker"; -#[cfg(feature = "podman")] +#[cfg(not(feature = "docker"))] pub const CONTAINER_TOOL: &str = "podman"; -#[cfg(not(feature = "podman"))] +#[cfg(feature = "docker")] pub const CONTAINER_DATADIR: &str = "/var/lib/docker"; -#[cfg(feature = "podman")] +#[cfg(not(feature = "docker"))] pub const CONTAINER_DATADIR: &str = "/var/lib/containers"; pub struct DockerImageSha(String); diff --git a/backend/src/version/mod.rs b/backend/src/version/mod.rs index e0651642d..ebc895f8e 100644 --- a/backend/src/version/mod.rs +++ b/backend/src/version/mod.rs @@ -182,8 +182,7 @@ pub async fn init(db: &PatchDb, secrets: &PgPool) -> Result<(), Error> { Ok(()) } -pub const COMMIT_HASH: &str = - git_version::git_version!(args = ["--always", "--abbrev=40", "--dirty=-modified"]); +pub const COMMIT_HASH: &str = include_str!("../../../GIT_HASH.txt"); #[command(rename = "git-info", local, metadata(authenticated = false))] pub fn git_info() -> Result<&'static str, Error> { diff --git a/backend/test/js_action_execute/package-data/scripts/test-package/0.3.0.3/embassy.js b/backend/test/js_action_execute/package-data/scripts/test-package/0.3.0.3/embassy.js index 31734a92d..86565053e 100644 --- a/backend/test/js_action_execute/package-data/scripts/test-package/0.3.0.3/embassy.js +++ b/backend/test/js_action_execute/package-data/scripts/test-package/0.3.0.3/embassy.js @@ -857,7 +857,7 @@ export const action = { }, /** * Created this test because of issue - * https://github.com/Start9Labs/embassy-os/issues/1737 + * https://github.com/Start9Labs/start-os/issues/1737 * which that we couldn't create a dir that was deeply nested, and the parents where * not created yet. Found this out during the migrations, where the parent would die. * @param {*} effects @@ -933,7 +933,7 @@ export const action = { }, /** * Created this test because of issue - * https://github.com/Start9Labs/embassy-os/issues/2121 + * https://github.com/Start9Labs/start-os/issues/2121 * That the empty in the create dies * @param {*} effects * @param {*} _input diff --git a/backend/update-sqlx-data.sh b/backend/update-sqlx-data.sh index 1b00498a2..83ec111f0 100755 --- a/backend/update-sqlx-data.sh +++ b/backend/update-sqlx-data.sh @@ -15,7 +15,7 @@ docker run -d --rm --name=tmp_postgres -e POSTGRES_PASSWORD=password -v $TMP_DIR PG_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' tmp_postgres) DATABASE_URL=postgres://postgres:password@$PG_IP/postgres cargo sqlx migrate run - DATABASE_URL=postgres://postgres:password@$PG_IP/postgres OS_ARCH=$(uname -m) cargo sqlx prepare -- --lib --profile=test + DATABASE_URL=postgres://postgres:password@$PG_IP/postgres PLATFORM=$(uname -m) cargo sqlx prepare -- --lib --profile=test ) docker stop tmp_postgres diff --git a/basename.sh b/basename.sh new file mode 100755 index 000000000..17eb62623 --- /dev/null +++ b/basename.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +cd "$(dirname "${BASH_SOURCE[0]}")" + +PLATFORM=$(if [ -f ./PLATFORM.txt ]; then cat ./PLATFORM.txt; else echo unknown; fi) +VERSION="$(cat ./VERSION.txt)" +GIT_HASH="$(cat ./GIT_HASH.txt)" +if [[ "$GIT_HASH" =~ ^@ ]]; then + GIT_HASH=unknown +else + GIT_HASH="$(echo -n "$GIT_HASH" | head -c 7)" +fi +STARTOS_ENV="$(cat ./ENVIRONMENT.txt)" +VERSION_FULL="${VERSION}-${GIT_HASH}" +if [ -n "$STARTOS_ENV" ]; then + VERSION_FULL="$VERSION_FULL~${STARTOS_ENV}" +fi + +echo -n "startos-${VERSION_FULL}_${PLATFORM}" \ No newline at end of file diff --git a/build-cargo-dep.sh b/build-cargo-dep.sh index f4ad4c951..f3cb8e969 100755 --- a/build-cargo-dep.sh +++ b/build-cargo-dep.sh @@ -4,7 +4,7 @@ set -e shopt -s expand_aliases if [ "$0" != "./build-cargo-dep.sh" ]; then - >&2 echo "Must be run from embassy-os directory" + >&2 echo "Must be run from start-os directory" exit 1 fi diff --git a/build/.gitignore b/build/.gitignore new file mode 100644 index 000000000..357c0e49f --- /dev/null +++ b/build/.gitignore @@ -0,0 +1,2 @@ +lib/depends +lib/conflicts \ No newline at end of file diff --git a/build/lib/conflicts b/build/dpkg-deps/conflicts similarity index 51% rename from build/lib/conflicts rename to build/dpkg-deps/conflicts index 536950a42..12a2f73b2 100644 --- a/build/lib/conflicts +++ b/build/dpkg-deps/conflicts @@ -1,5 +1,5 @@ -openresolv dhcpcd5 firewalld nginx -nginx-common \ No newline at end of file +nginx-common +openresolv \ No newline at end of file diff --git a/build/lib/depends b/build/dpkg-deps/depends similarity index 88% rename from build/lib/depends rename to build/dpkg-deps/depends index 263a7d65d..a712d4a52 100644 --- a/build/lib/depends +++ b/build/dpkg-deps/depends @@ -6,21 +6,15 @@ bmon btrfs-progs ca-certificates cifs-utils -containerd.io cryptsetup curl dmidecode -docker-ce -docker-ce-cli -docker-compose-plugin dosfstools e2fsprogs ecryptfs-utils exfatprogs flashrom -gdb grub-common -heaptrack htop httpdirfs iotop diff --git a/build/dpkg-deps/docker.depends b/build/dpkg-deps/docker.depends new file mode 100644 index 000000000..dd78be8a1 --- /dev/null +++ b/build/dpkg-deps/docker.depends @@ -0,0 +1,5 @@ ++ containerd.io ++ docker-ce ++ docker-ce-cli ++ docker-compose-plugin +- podman \ No newline at end of file diff --git a/build/dpkg-deps/generate.sh b/build/dpkg-deps/generate.sh new file mode 100755 index 000000000..53a7b87e5 --- /dev/null +++ b/build/dpkg-deps/generate.sh @@ -0,0 +1,43 @@ +#!/bin/bash + +set -e + +cd "$(dirname "${BASH_SOURCE[0]}")" + +IFS="-" read -ra FEATURES <<< "$ENVIRONMENT" + +feature_file_checker=' +/^#/ { next } +/^\+ [a-z0-9]+$/ { next } +/^- [a-z0-9]+$/ { next } +{ exit 1 } +' + +for type in conflicts depends; do + pkgs=() + for feature in ${FEATURES[@]}; do + file="$feature.$type" + if [ -f $file ]; then + # TODO check for syntax errrors + cat $file | awk "$feature_file_checker" + for pkg in $(cat $file | awk '/^\+/ {print $2}'); do + pkgs+=($pkg) + done + fi + done + for pkg in $(cat $type); do + SKIP= + for feature in ${FEATURES[@]}; do + file="$feature.$type" + if [ -f $file ]; then + if grep "^- $pkg$" $file; then + SKIP=1 + fi + fi + done + if [ -z $SKIP ]; then + pkgs+=($pkg) + fi + done + (IFS=$'\n'; echo "${pkgs[*]}") | sort -u > ../lib/$type +done diff --git a/build/dpkg-deps/unstable.depends b/build/dpkg-deps/unstable.depends new file mode 100644 index 000000000..fe5dee256 --- /dev/null +++ b/build/dpkg-deps/unstable.depends @@ -0,0 +1,2 @@ ++ gdb ++ heaptrack \ No newline at end of file diff --git a/build/lib/motd b/build/lib/motd index 25c83a8a4..5de21ec53 100755 --- a/build/lib/motd +++ b/build/lib/motd @@ -11,8 +11,8 @@ cat << "ASCII" ASCII printf " %s (%s %s)\n" "$(uname -o)" "$(uname -r)" "$(uname -m)" printf " $(start-cli --version | sed 's/StartOS CLI /StartOS v/g') - $(start-cli git-info)" -if [ -n "$(cat /usr/lib/embassy/ENVIRONMENT.txt)" ]; then - printf " ~ $(cat /usr/lib/embassy/ENVIRONMENT.txt)\n" +if [ -n "$(cat /usr/lib/startos/ENVIRONMENT.txt)" ]; then + printf " ~ $(cat /usr/lib/startos/ENVIRONMENT.txt)\n" else printf "\n" fi diff --git a/build/lib/scripts/enable-kiosk b/build/lib/scripts/enable-kiosk index d07fc29b3..ad7cd4bf3 100755 --- a/build/lib/scripts/enable-kiosk +++ b/build/lib/scripts/enable-kiosk @@ -72,7 +72,7 @@ user_pref("messaging-system.rsexperimentloader.enabled", false); user_pref("network.allow-experiments", false); user_pref("network.captive-portal-service.enabled", false); user_pref("network.connectivity-service.enabled", false); -user_pref("network.proxy.autoconfig_url", "file:///usr/lib/embassy/proxy.pac"); +user_pref("network.proxy.autoconfig_url", "file:///usr/lib/startos/proxy.pac"); user_pref("network.proxy.socks_remote_dns", true); user_pref("network.proxy.type", 2); user_pref("signon.rememberSignons", false); @@ -91,11 +91,11 @@ EOT while ! curl "http://localhost" > /dev/null; do sleep 1 done -while ! /usr/lib/embassy/scripts/check-monitor; do +while ! /usr/lib/startos/scripts/check-monitor; do sleep 15 done ( - while /usr/lib/embassy/scripts/check-monitor; do + while /usr/lib/startos/scripts/check-monitor; do sleep 15 done killall firefox-esr diff --git a/build/lib/scripts/fake-apt b/build/lib/scripts/fake-apt index 378320c53..8f23c213a 100755 --- a/build/lib/scripts/fake-apt +++ b/build/lib/scripts/fake-apt @@ -13,7 +13,7 @@ fi >&2 echo ' sudo rm /usr/local/bin/apt' >&2 echo >&2 echo 'Otherwise, what you probably want to do is run:' ->&2 echo ' sudo /usr/lib/embassy/scripts/chroot-and-upgrade' +>&2 echo ' sudo /usr/lib/startos/scripts/chroot-and-upgrade' >&2 echo 'You can run apt in this context to add packages to your system.' >&2 echo 'When you are done with your changes, type "exit" and the device will reboot into a system with the changes applied.' >&2 echo 'This is still NOT RECOMMENDED if you don'"'"'t know what you are doing, but at least isn'"'"'t guaranteed to break things.' diff --git a/build/lib/scripts/persist-apt-install b/build/lib/scripts/persist-apt-install index 3ed5c24b1..974833ca3 100755 --- a/build/lib/scripts/persist-apt-install +++ b/build/lib/scripts/persist-apt-install @@ -14,7 +14,7 @@ while [ -n "$1" ]; do done if [ ${#TO_INSTALL[@]} -ne 0 ]; then -/usr/lib/embassy/scripts/chroot-and-upgrade << EOF +/usr/lib/startos/scripts/chroot-and-upgrade << EOF apt-get update && apt-get install -y ${TO_INSTALL[@]} EOF fi \ No newline at end of file diff --git a/build/raspberrypi/make-image.sh b/build/raspberrypi/make-image.sh index 2c58fc079..3b07cb3a8 100755 --- a/build/raspberrypi/make-image.sh +++ b/build/raspberrypi/make-image.sh @@ -60,12 +60,12 @@ sudo mount `partition_for ${OUTPUT_DEVICE} 2` $TMPDIR sudo mkdir $TMPDIR/boot sudo mount `partition_for ${OUTPUT_DEVICE} 1` $TMPDIR/boot sudo unsquashfs -f -d $TMPDIR startos.raspberrypi.squashfs -REAL_GIT_HASH=$(cat $TMPDIR/usr/lib/embassy/GIT_HASH.txt) -REAL_VERSION=$(cat $TMPDIR/usr/lib/embassy/VERSION.txt) -REAL_ENVIRONMENT=$(cat $TMPDIR/usr/lib/embassy/ENVIRONMENT.txt) -sudo sed -i 's| boot=embassy| init=/usr/lib/embassy/scripts/init_resize\.sh|' $TMPDIR/boot/cmdline.txt +REAL_GIT_HASH=$(cat $TMPDIR/usr/lib/startos/GIT_HASH.txt) +REAL_VERSION=$(cat $TMPDIR/usr/lib/startos/VERSION.txt) +REAL_ENVIRONMENT=$(cat $TMPDIR/usr/lib/startos/ENVIRONMENT.txt) +sudo sed -i 's| boot=embassy| init=/usr/lib/startos/scripts/init_resize\.sh|' $TMPDIR/boot/cmdline.txt sudo cp ./build/raspberrypi/fstab $TMPDIR/etc/ -sudo cp ./build/raspberrypi/init_resize.sh $TMPDIR/usr/lib/embassy/scripts/init_resize.sh +sudo cp ./build/raspberrypi/init_resize.sh $TMPDIR/usr/lib/startos/scripts/init_resize.sh sudo umount $TMPDIR/boot sudo umount $TMPDIR sudo losetup -d $OUTPUT_DEVICE diff --git a/check-git-hash.sh b/check-git-hash.sh index 8c286840d..874dcc8bf 100755 --- a/check-git-hash.sh +++ b/check-git-hash.sh @@ -1,6 +1,10 @@ #!/bin/bash -GIT_HASH="$(git describe --always --abbrev=40 --dirty=-modified)" +if [ "$GIT_BRANCH_AS_HASH" != 1 ]; then + GIT_HASH="$(git describe --always --abbrev=40 --dirty=-modified)" +else + GIT_HASH="@$(git rev-parse --abbrev-ref HEAD)" +fi if ! [ -f ./GIT_HASH.txt ] || [ "$(cat ./GIT_HASH.txt)" != "$GIT_HASH" ]; then echo -n "$GIT_HASH" > ./GIT_HASH.txt diff --git a/check-platform.sh b/check-platform.sh new file mode 100755 index 000000000..aebb0fc5f --- /dev/null +++ b/check-platform.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +if ! [ -f ./PLATFORM.txt ] || [ "$(cat ./PLATFORM.txt)" != "$PLATFORM" ] && [ -n "$PLATFORM" ]; then + >&2 echo "Updating PLATFORM.txt to \"$PLATFORM\"" + echo -n "$PLATFORM" > ./PLATFORM.txt +fi + +echo -n ./PLATFORM.txt diff --git a/build/lib/scripts/postinst b/debian/postinst similarity index 81% rename from build/lib/scripts/postinst rename to debian/postinst index 171924a9c..2254e02e1 100755 --- a/build/lib/scripts/postinst +++ b/debian/postinst @@ -8,10 +8,10 @@ fi if [ -f /usr/sbin/grub-probe ]; then mv /usr/sbin/grub-probe /usr/sbin/grub-probe-default - ln -s /usr/lib/embassy/scripts/grub-probe-eos /usr/sbin/grub-probe + ln -s /usr/lib/startos/scripts/grub-probe-eos /usr/sbin/grub-probe fi -cp /usr/lib/embassy/scripts/embassy-initramfs-module /etc/initramfs-tools/scripts/embassy +cp /usr/lib/startos/scripts/embassy-initramfs-module /etc/initramfs-tools/scripts/embassy if ! grep overlay /etc/initramfs-tools/modules > /dev/null; then echo overlay >> /etc/initramfs-tools/modules @@ -46,6 +46,7 @@ dns=systemd-resolved [ifupdown] managed=true EOF +$SYSTEMCTL enable startd.service $SYSTEMCTL enable systemd-resolved.service $SYSTEMCTL enable systemd-networkd-wait-online.service $SYSTEMCTL enable ssh.service @@ -70,20 +71,20 @@ fi sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/g' /etc/ssh/sshd_config sed -i 's/Restart=on-failure/Restart=always/g' /lib/systemd/system/tor@default.service -sed -i 's/ExecStart=\/usr\/bin\/dockerd/ExecStart=\/usr\/bin\/dockerd --exec-opt native.cgroupdriver=systemd/g' /lib/systemd/system/docker.service sed -i '/\(^\|#\)entries-per-entry-group-max=/c\entries-per-entry-group-max=128' /etc/avahi/avahi-daemon.conf sed -i '/\(^\|#\)Storage=/c\Storage=persistent' /etc/systemd/journald.conf sed -i '/\(^\|#\)Compress=/c\Compress=yes' /etc/systemd/journald.conf sed -i '/\(^\|#\)SystemMaxUse=/c\SystemMaxUse=1G' /etc/systemd/journald.conf sed -i '/\(^\|#\)ForwardToSyslog=/c\ForwardToSyslog=no' /etc/systemd/journald.conf sed -i '/^\s*#\?\s*issue_discards\s*=\s*/c\issue_discards = 1' /etc/lvm/lvm.conf -mkdir -p /etc/docker -cat > /etc/docker/daemon.json << EOF -{ - "storage-driver": "overlay2" -} -EOF -podman network create -d bridge --subnet 172.18.0.1/24 --opt com.docker.network.bridge.name=br-start9 start9 + +if cat /usr/lib/startos/ENVIRONMENT.txt | grep '(^|-)docker(-|$)'; then + sed -i 's/ExecStart=\/usr\/bin\/dockerd/ExecStart=\/usr\/bin\/dockerd --exec-opt native.cgroupdriver=systemd/g' /lib/systemd/system/docker.service + mkdir -p /etc/docker + echo '{ "storage-driver": "overlay2" }' > /etc/docker/daemon.json +else + podman network create -d bridge --subnet 172.18.0.1/24 --opt com.docker.network.bridge.name=br-start9 start9 +fi mkdir -p /etc/nginx/ssl # fix to suppress docker warning, fixed in 21.xx release of docker cli: https://github.com/docker/cli/pull/2934 @@ -100,7 +101,7 @@ CookieAuthentication 1 EOF rm -rf /var/lib/tor/* -ln -sf /usr/lib/embassy/scripts/tor-check.sh /usr/bin/tor-check +ln -sf /usr/lib/startos/scripts/tor-check.sh /usr/bin/tor-check echo "fs.inotify.max_user_watches=1048576" > /etc/sysctl.d/97-embassy.conf @@ -113,9 +114,9 @@ dpkg-reconfigure --frontend noninteractive locales groupadd embassy -ln -s /usr/lib/embassy/scripts/dhclient-exit-hook /etc/dhcp/dhclient-exit-hooks.d/embassy +ln -s /usr/lib/startos/scripts/dhclient-exit-hook /etc/dhcp/dhclient-exit-hooks.d/embassy rm -f /etc/motd -ln -sf /usr/lib/embassy/motd /etc/update-motd.d/00-embassy +ln -sf /usr/lib/startos/motd /etc/update-motd.d/00-embassy chmod -x /etc/update-motd.d/* chmod +x /etc/update-motd.d/00-embassy diff --git a/dpkg-build.sh b/dpkg-build.sh new file mode 100755 index 000000000..e8ffdb0ac --- /dev/null +++ b/dpkg-build.sh @@ -0,0 +1,48 @@ +#!/bin/bash + +set -e + +cd "$(dirname "${BASH_SOURCE[0]}")" + +BASENAME=$(./basename.sh) +VERSION=$(cat ./VERSION.txt) +if [ "$PLATFORM" = "x86_64" ] || [ "$PLATFORM" = "x86_64-nonfree" ]; then + DEB_ARCH=amd64 +elif [ "$PLATFORM" = "aarch64" ] || [ "$PLATFORM" = "aarch64-nonfree" ] || [ "$PLATFORM" = "raspberrypi" ]; then + DEB_ARCH=arm64 +else + DEB_ARCH="$PLATFORM" +fi + +rm -rf dpkg-workdir/$BASENAME +mkdir -p dpkg-workdir/$BASENAME + +make install DESTDIR=dpkg-workdir/$BASENAME + +DEPENDS=$(cat dpkg-workdir/$BASENAME/usr/lib/startos/depends | tr $'\n' ',' | sed 's/,,\+/,/g' | sed 's/,$//') +CONFLICTS=$(cat dpkg-workdir/$BASENAME/usr/lib/startos/conflicts | tr $'\n' ',' | sed 's/,,\+/,/g' | sed 's/,$//') + +cp -r debian dpkg-workdir/$BASENAME/DEBIAN +cat > dpkg-workdir/$BASENAME/DEBIAN/control << EOF +Package: startos +Version: ${VERSION} +Section: unknown +Priority: required +Maintainer: Aiden McClelland +Homepage: https://start9.com +Architecture: ${DEB_ARCH} +Multi-Arch: foreign +Depends: ${DEPENDS} +Conflicts: ${CONFLICTS} +Description: StartOS Debian Package +EOF + +cd dpkg-workdir/$BASENAME +find . -type f -not -path "./DEBIAN/*" -exec md5sum {} \; | sort -k 2 | sed 's/\.\/\(.*\)/\1/' > DEBIAN/md5sums +cd ../.. + +cd dpkg-workdir +dpkg-deb --root-owner-group -b $BASENAME +mkdir -p ../results +mv $BASENAME.deb ../results/$BASENAME.deb +rm -rf $BASENAME \ No newline at end of file diff --git a/frontend/config-sample.json b/frontend/config-sample.json index 4d2bd94dd..37d5ea038 100644 --- a/frontend/config-sample.json +++ b/frontend/config-sample.json @@ -1,8 +1,6 @@ { "useMocks": true, "enableWidgets": false, - "packageArch": "aarch64", - "osArch": "raspberrypi", "ui": { "api": { "url": "rpc", diff --git a/frontend/projects/shared/src/types/workspace-config.ts b/frontend/projects/shared/src/types/workspace-config.ts index 8394ac95f..101af40fd 100644 --- a/frontend/projects/shared/src/types/workspace-config.ts +++ b/frontend/projects/shared/src/types/workspace-config.ts @@ -1,6 +1,4 @@ export type WorkspaceConfig = { - packageArch: 'aarch64' | 'x86_64' - osArch: 'aarch64' | 'x86_64' | 'raspberrypi' gitHash: string useMocks: boolean enableWidgets: boolean diff --git a/frontend/projects/ui/src/app/pages/server-routes/server-logs/server-logs.page.html b/frontend/projects/ui/src/app/pages/server-routes/server-logs/server-logs.page.html index e9501c2b9..c41ab6461 100644 --- a/frontend/projects/ui/src/app/pages/server-routes/server-logs/server-logs.page.html +++ b/frontend/projects/ui/src/app/pages/server-routes/server-logs/server-logs.page.html @@ -1,7 +1,7 @@ + +# Build image +./run-local-build.sh +``` + +In order for the build to work properly, you will need debspawn >= 0.5.1, the +build may fail with prior versions. diff --git a/image-recipe/build.sh b/image-recipe/build.sh new file mode 100755 index 000000000..88374ff2b --- /dev/null +++ b/image-recipe/build.sh @@ -0,0 +1,324 @@ +#!/bin/bash +set -e + +MAX_IMG_SECTORS=8388608 # 4GB + +echo "==== StartOS Image Build ====" + +echo "Building for architecture: $IB_TARGET_ARCH" + +base_dir="$(dirname "$(readlink -f "$0")")" +prep_results_dir="$base_dir/images-prep" +if systemd-detect-virt -qc; then + RESULTS_DIR="/srv/artifacts" +else + RESULTS_DIR="$base_dir/results" +fi +echo "Saving results in: $RESULTS_DIR" + +IMAGE_BASENAME=startos-${VERSION_FULL}_${IB_TARGET_PLATFORM} + +mkdir -p $prep_results_dir + +cd $prep_results_dir + +QEMU_ARCH=${IB_TARGET_ARCH} +BOOTLOADERS=grub-efi,syslinux +if [ "$QEMU_ARCH" = 'amd64' ]; then + QEMU_ARCH=x86_64 +elif [ "$QEMU_ARCH" = 'arm64' ]; then + QEMU_ARCH=aarch64 + BOOTLOADERS=grub-efi +fi +NON_FREE= +if [[ "${IB_TARGET_PLATFORM}" =~ -nonfree$ ]] || [ "${IB_TARGET_PLATFORM}" = "raspberrypi" ]; then + NON_FREE=1 +fi +IMAGE_TYPE=iso +if [ "${IB_TARGET_PLATFORM}" = "raspberrypi" ] || [ "${IB_TARGET_PLATFORM}" = "rockchip64" ]; then + IMAGE_TYPE=img +fi + +ARCHIVE_AREAS="main contrib" +if [ "$NON_FREE" = 1 ]; then + if [ "$IB_SUITE" = "bullseye" ]; then + ARCHIVE_AREAS="$ARCHIVE_AREAS non-free" + elif [ "$IB_SUITE" = "bookworm" ]; then + ARCHIVE_AREAS="$ARCHIVE_AREAS non-free-firmware" + fi +fi + +PLATFORM_CONFIG_EXTRAS= +if [ "${IB_TARGET_PLATFORM}" = "raspberrypi" ]; then + PLATFORM_CONFIG_EXTRAS="$PLATFORM_CONFIG_EXTRAS --firmware-binary false" + PLATFORM_CONFIG_EXTRAS="$PLATFORM_CONFIG_EXTRAS --firmware-chroot false" + # BEGIN stupid ugly hack + # The actual name of the package is `raspberrypi-kernel` + # live-build determines thte name of the package for the kernel by combining the `linux-packages` flag, with the `linux-flavours` flag + # the `linux-flavours` flag defaults to the architecture, so there's no way to remove the suffix. + # So we're doing this, cause thank the gods our package name contains a hypen. Cause if it didn't we'd be SOL + PLATFORM_CONFIG_EXTRAS="$PLATFORM_CONFIG_EXTRAS --linux-packages raspberrypi" + PLATFORM_CONFIG_EXTRAS="$PLATFORM_CONFIG_EXTRAS --linux-flavours kernel" + # END stupid ugly hack +elif [ "${IB_TARGET_PLATFORM}" = "rockchip64" ]; then + PLATFORM_CONFIG_EXTRAS="$PLATFORM_CONFIG_EXTRAS --linux-flavours rockchip64" +fi + +cat > /etc/wgetrc << EOF +retry_connrefused = on +tries = 100 +EOF +lb config \ + --iso-application "StartOS v${VERSION_FULL} ${IB_TARGET_ARCH}" \ + --iso-volume "StartOS v${VERSION} ${IB_TARGET_ARCH}" \ + --iso-preparer "START9 LABS; HTTPS://START9.COM" \ + --iso-publisher "START9 LABS; HTTPS://START9.COM" \ + --backports true \ + --bootappend-live "boot=live noautologin" \ + --bootloaders $BOOTLOADERS \ + --mirror-bootstrap "https://deb.debian.org/debian/" \ + --mirror-chroot "https://deb.debian.org/debian/" \ + --mirror-chroot-security "https://security.debian.org/debian-security" \ + -d ${IB_SUITE} \ + -a ${IB_TARGET_ARCH} \ + --bootstrap-qemu-arch ${IB_TARGET_ARCH} \ + --bootstrap-qemu-static /usr/bin/qemu-${QEMU_ARCH}-static \ + --archive-areas "${ARCHIVE_AREAS}" \ + $PLATFORM_CONFIG_EXTRAS + +# Overlays + +mkdir -p config/includes.chroot/deb +cp $base_dir/deb/${IMAGE_BASENAME}.deb config/includes.chroot/deb/ + +if [ "${IB_TARGET_PLATFORM}" = "raspberrypi" ]; then + cp -r $base_dir/raspberrypi/squashfs/* config/includes.chroot/ +fi + +mkdir -p config/includes.chroot/etc +echo start > config/includes.chroot/etc/hostname +cat > config/includes.chroot/etc/hosts << EOT +127.0.0.1 localhost start +::1 localhost start ip6-localhost ip6-loopback +ff02::1 ip6-allnodes +ff02::2 ip6-allrouters +EOT + +# Bootloaders + +rm -rf config/bootloaders +cp -r /usr/share/live/build/bootloaders config/bootloaders + +cat > config/bootloaders/syslinux/syslinux.cfg << EOF +include menu.cfg +default vesamenu.c32 +prompt 0 +timeout 50 +EOF + +cat > config/bootloaders/isolinux/isolinux.cfg << EOF +include menu.cfg +default vesamenu.c32 +prompt 0 +timeout 50 +EOF + +rm config/bootloaders/syslinux_common/splash.svg +cp $base_dir/splash.png config/bootloaders/syslinux_common/splash.png +cp $base_dir/splash.png config/bootloaders/isolinux/splash.png +cp $base_dir/splash.png config/bootloaders/grub-pc/splash.png + +sed -i -e '2i set timeout=5' config/bootloaders/grub-pc/config.cfg + +# Archives + +mkdir -p config/archives + +if [ "${IB_TARGET_PLATFORM}" = "raspberrypi" ]; then + curl -fsSL https://archive.raspberrypi.org/debian/raspberrypi.gpg.key | gpg --dearmor -o config/archives/raspi.key + echo "deb https://archive.raspberrypi.org/debian/ bullseye main" > config/archives/raspi.list +fi + +if [ "${IB_SUITE}" = "bullseye" ]; then + cat > config/archives/backports.pref <<- EOF + Package: * + Pin: release a=bullseye-backports + Pin-Priority: 500 + EOF +fi + +if [ "${IB_TARGET_PLATFORM}" = "rockchip64" ]; then + curl -fsSL https://apt.armbian.com/armbian.key | gpg --dearmor -o config/archives/armbian.key + echo "deb https://apt.armbian.com/ ${IB_SUITE} main" > config/archives/armbian.list +fi + +curl -fsSL https://deb.torproject.org/torproject.org/A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc > config/archives/tor.key +echo "deb [arch=${IB_TARGET_ARCH} signed-by=/etc/apt/trusted.gpg.d/tor.key.gpg] https://deb.torproject.org/torproject.org ${IB_SUITE} main" > config/archives/tor.list + +curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o config/archives/docker.key +echo "deb [arch=${IB_TARGET_ARCH} signed-by=/etc/apt/trusted.gpg.d/docker.key.gpg] https://download.docker.com/linux/debian ${IB_SUITE} stable" > config/archives/docker.list + +curl -fsSL https://download.opensuse.org/repositories/devel:kubic:libcontainers:unstable/Debian_Testing/Release.key | gpg --dearmor -o config/archives/podman.key +echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/trusted.gpg.d/podman.key.gpg] https://download.opensuse.org/repositories/devel:kubic:libcontainers:unstable/Debian_Testing/ /" > config/archives/podman.list + +# Dependencies + +## Base dependencies +dpkg-deb --fsys-tarfile $base_dir/deb/${IMAGE_BASENAME}.deb | tar --to-stdout -xvf - ./usr/lib/startos/depends > config/package-lists/embassy-depends.list.chroot + +## Firmware +if [ "$NON_FREE" = 1 ]; then + echo 'firmware-iwlwifi firmware-misc-nonfree firmware-brcm80211 firmware-realtek firmware-atheros firmware-libertas firmware-amd-graphics' > config/package-lists/nonfree.list.chroot +fi + +if [ "${IB_TARGET_PLATFORM}" = "raspberrypi" ]; then + echo 'raspberrypi-bootloader rpi-update parted' > config/package-lists/bootloader.list.chroot +else + echo 'grub-efi grub2-common' > config/package-lists/bootloader.list.chroot +fi +if [ "${IB_TARGET_ARCH}" = "amd64" ] || [ "${IB_TARGET_ARCH}" = "i386" ]; then + echo 'grub-pc-bin' >> config/package-lists/bootloader.list.chroot +fi + +cat > config/hooks/normal/9000-install-startos.hook.chroot << EOF +#!/bin/bash + +set -e + +apt-get install -y /deb/${IMAGE_BASENAME}.deb +rm -rf /deb + +if [ "${IB_SUITE}" = bookworm ]; then + echo 'deb https://deb.debian.org/debian/ bullseye main' > /etc/apt/sources.list.d/bullseye.list + apt-get update + apt-get install -y postgresql-13 + rm /etc/apt/sources.list.d/bullseye.list + apt-get update +fi + +if [ "${IB_TARGET_PLATFORM}" = "raspberrypi" ]; then + for f in /usr/lib/modules/*; do + v=\${f#/usr/lib/modules/} + echo "Configuring raspi kernel '\$v'" + extract-ikconfig "/usr/lib/modules/\$v/kernel/kernel/configs.ko.xz" > /boot/config-\$v + update-initramfs -c -k \$v + done + ln -sf /usr/bin/pi-beep /usr/local/bin/beep +fi + +useradd --shell /bin/bash -G embassy -m start9 +echo start9:embassy | chpasswd +usermod -aG sudo start9 + +echo "start9 ALL=(ALL:ALL) NOPASSWD: ALL" | sudo tee "/etc/sudoers.d/010_start9-nopasswd" + +if [ "${IB_TARGET_PLATFORM}" != "raspberrypi" ]; then + /usr/lib/startos/scripts/enable-kiosk +fi + +if ! [[ "${IB_OS_ENV}" =~ (^|-)dev($|-) ]]; then + passwd -l start9 +fi + +EOF + +SOURCE_DATE_EPOCH="${SOURCE_DATE_EPOCH:-$(date '+%s')}" + +lb bootstrap +lb chroot +lb installer +lb binary_chroot +lb chroot_prep install all mode-apt-install-binary mode-archives-chroot +ln -sf /run/systemd/resolve/stub-resolv.conf chroot/chroot/etc/resolv.conf +lb binary_rootfs + +cp $prep_results_dir/binary/live/filesystem.squashfs $RESULTS_DIR/$IMAGE_BASENAME.squashfs + +if [ "${IMAGE_TYPE}" = iso ]; then + + lb binary_manifest + lb binary_package-lists + lb binary_linux-image + lb binary_memtest + lb binary_grub-legacy + lb binary_grub-pc + lb binary_grub_cfg + lb binary_syslinux + lb binary_disk + lb binary_loadlin + lb binary_win32-loader + lb binary_includes + lb binary_grub-efi + lb binary_hooks + lb binary_checksums + find binary -newermt "$(date -d@${SOURCE_DATE_EPOCH} '+%Y-%m-%d %H:%M:%S')" -printf "%y %p\n" -exec touch '{}' -d@${SOURCE_DATE_EPOCH} --no-dereference ';' > binary.modified_timestamps + lb binary_iso + lb binary_onie + lb binary_netboot + lb binary_tar + lb binary_hdd + lb binary_zsync + lb chroot_prep remove all mode-archives-chroot + lb source + + mv $prep_results_dir/live-image-${IB_TARGET_ARCH}.hybrid.iso $RESULTS_DIR/$IMAGE_BASENAME.iso + +elif [ "${IMAGE_TYPE}" = img ]; then + + function partition_for () { + if [[ "$1" =~ [0-9]+$ ]]; then + echo "$1p$2" + else + echo "$1$2" + fi + } + + ROOT_PART_END=7217792 + TARGET_NAME=$prep_results_dir/${IMAGE_BASENAME}.img + TARGET_SIZE=$[($ROOT_PART_END+1)*512] + truncate -s $TARGET_SIZE $TARGET_NAME + ( + echo o + echo x + echo i + echo "0xcb15ae4d" + echo r + echo n + echo p + echo 1 + echo 2048 + echo 526335 + echo t + echo c + echo n + echo p + echo 2 + echo 526336 + echo $ROOT_PART_END + echo a + echo 1 + echo w + ) | fdisk $TARGET_NAME + OUTPUT_DEVICE=$(losetup --show -fP $TARGET_NAME) + mkfs.ext4 `partition_for ${OUTPUT_DEVICE} 2` + mkfs.vfat `partition_for ${OUTPUT_DEVICE} 1` + + TMPDIR=$(mktemp -d) + + mount `partition_for ${OUTPUT_DEVICE} 2` $TMPDIR + mkdir $TMPDIR/boot + mount `partition_for ${OUTPUT_DEVICE} 1` $TMPDIR/boot + unsquashfs -f -d $TMPDIR $prep_results_dir/binary/live/filesystem.squashfs + + if [ "${IB_TARGET_PLATFORM}" = "raspberrypi" ]; then + sed -i 's| boot=embassy| init=/usr/lib/startos/scripts/init_resize\.sh|' $TMPDIR/boot/cmdline.txt + rsync -a $base_dir/raspberrypi/img/ $TMPDIR/ + fi + + umount $TMPDIR/boot + umount $TMPDIR + losetup -d $OUTPUT_DEVICE + + mv $prep_results_dir/${IMAGE_BASENAME}.img $RESULTS_DIR/$IMAGE_BASENAME.iso + +fi \ No newline at end of file diff --git a/image-recipe/prepare.sh b/image-recipe/prepare.sh new file mode 100755 index 000000000..1c6779608 --- /dev/null +++ b/image-recipe/prepare.sh @@ -0,0 +1,24 @@ +#!/bin/sh +set -e +set -x + +export DEBIAN_FRONTEND=noninteractive +apt-get install -yq \ + live-build \ + procps \ + systemd \ + binfmt-support \ + qemu-utils \ + qemu-user-static \ + qemu-system-x86 \ + qemu-system-aarch64 \ + xorriso \ + isolinux \ + ca-certificates \ + curl \ + gpg \ + fdisk \ + dosfstools \ + e2fsprogs \ + squashfs-tools \ + rsync diff --git a/build/raspberrypi/fstab b/image-recipe/raspberrypi/img/etc/fstab similarity index 100% rename from build/raspberrypi/fstab rename to image-recipe/raspberrypi/img/etc/fstab diff --git a/build/raspberrypi/init_resize.sh b/image-recipe/raspberrypi/img/usr/lib/startos/scripts/init_resize.sh similarity index 98% rename from build/raspberrypi/init_resize.sh rename to image-recipe/raspberrypi/img/usr/lib/startos/scripts/init_resize.sh index 401d83978..931649897 100755 --- a/build/raspberrypi/init_resize.sh +++ b/image-recipe/raspberrypi/img/usr/lib/startos/scripts/init_resize.sh @@ -114,7 +114,7 @@ mount / -o remount,ro beep if main; then - sed -i 's| init=/usr/lib/embassy/scripts/init_resize\.sh| boot=embassy|' /boot/cmdline.txt + sed -i 's| init=/usr/lib/startos/scripts/init_resize\.sh| boot=embassy|' /boot/cmdline.txt echo "Resized root filesystem. Rebooting in 5 seconds..." sleep 5 else diff --git a/image-recipe/raspberrypi/squashfs/boot/cmdline.txt b/image-recipe/raspberrypi/squashfs/boot/cmdline.txt new file mode 100644 index 000000000..02de34729 --- /dev/null +++ b/image-recipe/raspberrypi/squashfs/boot/cmdline.txt @@ -0,0 +1 @@ +usb-storage.quirks=152d:0562:u,14cd:121c:u,0781:cfcb:u console=serial0,115200 console=tty1 root=PARTUUID=cb15ae4d-02 rootfstype=ext4 fsck.repair=yes rootwait cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory quiet boot=embassy \ No newline at end of file diff --git a/image-recipe/raspberrypi/squashfs/boot/config.txt b/image-recipe/raspberrypi/squashfs/boot/config.txt new file mode 100644 index 000000000..17bd5dc4e --- /dev/null +++ b/image-recipe/raspberrypi/squashfs/boot/config.txt @@ -0,0 +1,86 @@ +# For more options and information see +# http://rpf.io/configtxt +# Some settings may impact device functionality. See link above for details + +# uncomment if you get no picture on HDMI for a default "safe" mode +#hdmi_safe=1 + +# uncomment the following to adjust overscan. Use positive numbers if console +# goes off screen, and negative if there is too much border +#overscan_left=16 +#overscan_right=16 +#overscan_top=16 +#overscan_bottom=16 + +# uncomment to force a console size. By default it will be display's size minus +# overscan. +#framebuffer_width=1280 +#framebuffer_height=720 + +# uncomment if hdmi display is not detected and composite is being output +#hdmi_force_hotplug=1 + +# uncomment to force a specific HDMI mode (this will force VGA) +#hdmi_group=1 +#hdmi_mode=1 + +# uncomment to force a HDMI mode rather than DVI. This can make audio work in +# DMT (computer monitor) modes +#hdmi_drive=2 + +# uncomment to increase signal to HDMI, if you have interference, blanking, or +# no display +#config_hdmi_boost=4 + +# uncomment for composite PAL +#sdtv_mode=2 + +#uncomment to overclock the arm. 700 MHz is the default. +#arm_freq=800 + +# Uncomment some or all of these to enable the optional hardware interfaces +#dtparam=i2c_arm=on +#dtparam=i2s=on +#dtparam=spi=on + +# Uncomment this to enable infrared communication. +#dtoverlay=gpio-ir,gpio_pin=17 +#dtoverlay=gpio-ir-tx,gpio_pin=18 + +# Additional overlays and parameters are documented /boot/overlays/README + +# Enable audio (loads snd_bcm2835) +dtparam=audio=on + +# Automatically load overlays for detected cameras +camera_auto_detect=1 + +# Automatically load overlays for detected DSI displays +display_auto_detect=1 + +# Enable DRM VC4 V3D driver +dtoverlay=vc4-kms-v3d +max_framebuffers=2 + +# Run in 64-bit mode +arm_64bit=1 + +# Disable compensation for displays with overscan +disable_overscan=1 + +[cm4] +# Enable host mode on the 2711 built-in XHCI USB controller. +# This line should be removed if the legacy DWC2 controller is required +# (e.g. for USB device mode) or if USB support is not required. +otg_mode=1 + +[all] + +[pi4] +# Run as fast as firmware / board allows +arm_boost=1 + +[all] +gpu_mem=16 +dtoverlay=pwm-2chan,disable-bt +initramfs initrd.img-6.1.21-v8+ diff --git a/image-recipe/raspberrypi/squashfs/etc/embassy/config.yaml b/image-recipe/raspberrypi/squashfs/etc/embassy/config.yaml new file mode 100644 index 000000000..7c81ad513 --- /dev/null +++ b/image-recipe/raspberrypi/squashfs/etc/embassy/config.yaml @@ -0,0 +1,6 @@ +os-partitions: + boot: /dev/mmcblk0p1 + root: /dev/mmcblk0p2 +ethernet-interface: end0 +wifi-interface: wlan0 +disable-encryption: true diff --git a/image-recipe/raspberrypi/squashfs/etc/modprobe.d/cfg80211.conf b/image-recipe/raspberrypi/squashfs/etc/modprobe.d/cfg80211.conf new file mode 100644 index 000000000..d2abd4efb --- /dev/null +++ b/image-recipe/raspberrypi/squashfs/etc/modprobe.d/cfg80211.conf @@ -0,0 +1 @@ +options cfg80211 ieee80211_regdom=US diff --git a/image-recipe/raspberrypi/squashfs/usr/bin/extract-ikconfig b/image-recipe/raspberrypi/squashfs/usr/bin/extract-ikconfig new file mode 100755 index 000000000..8df33e7d6 --- /dev/null +++ b/image-recipe/raspberrypi/squashfs/usr/bin/extract-ikconfig @@ -0,0 +1,69 @@ +#!/bin/sh +# ---------------------------------------------------------------------- +# extract-ikconfig - Extract the .config file from a kernel image +# +# This will only work when the kernel was compiled with CONFIG_IKCONFIG. +# +# The obscure use of the "tr" filter is to work around older versions of +# "grep" that report the byte offset of the line instead of the pattern. +# +# (c) 2009,2010 Dick Streefland +# Licensed under the terms of the GNU General Public License. +# ---------------------------------------------------------------------- + +cf1='IKCFG_ST\037\213\010' +cf2='0123456789' + +dump_config() +{ + if pos=`tr "$cf1\n$cf2" "\n$cf2=" < "$1" | grep -abo "^$cf2"` + then + pos=${pos%%:*} + tail -c+$(($pos+8)) "$1" | zcat > $tmp1 2> /dev/null + if [ $? != 1 ] + then # exit status must be 0 or 2 (trailing garbage warning) + cat $tmp1 + exit 0 + fi + fi +} + +try_decompress() +{ + for pos in `tr "$1\n$2" "\n$2=" < "$img" | grep -abo "^$2"` + do + pos=${pos%%:*} + tail -c+$pos "$img" | $3 > $tmp2 2> /dev/null + dump_config $tmp2 + done +} + +# Check invocation: +me=${0##*/} +img=$1 +if [ $# -ne 1 -o ! -s "$img" ] +then + echo "Usage: $me " >&2 + exit 2 +fi + +# Prepare temp files: +tmp1=/tmp/ikconfig$$.1 +tmp2=/tmp/ikconfig$$.2 +trap "rm -f $tmp1 $tmp2" 0 + +# Initial attempt for uncompressed images or objects: +dump_config "$img" + +# That didn't work, so retry after decompression. +try_decompress '\037\213\010' xy gunzip +try_decompress '\3757zXZ\000' abcde unxz +try_decompress 'BZh' xy bunzip2 +try_decompress '\135\0\0\0' xxx unlzma +try_decompress '\211\114\132' xy 'lzop -d' +try_decompress '\002\041\114\030' xyy 'lz4 -d -l' +try_decompress '\050\265\057\375' xxx unzstd + +# Bail out: +echo "$me: Cannot find kernel config." >&2 +exit 1 diff --git a/image-recipe/run-local-build.sh b/image-recipe/run-local-build.sh new file mode 100755 index 000000000..7f7ecd3d4 --- /dev/null +++ b/image-recipe/run-local-build.sh @@ -0,0 +1,88 @@ +#!/bin/bash +set -e + +DEB_PATH="$(realpath $1)" + +cd "$(dirname "${BASH_SOURCE[0]}")"/.. + +BASEDIR="$(pwd -P)" + +VERSION="$(dpkg-deb --fsys-tarfile $DEB_PATH | tar --to-stdout -xvf - ./usr/lib/startos/VERSION.txt)" +GIT_HASH="$(dpkg-deb --fsys-tarfile $DEB_PATH | tar --to-stdout -xvf - ./usr/lib/startos/GIT_HASH.txt)" +if [[ "$GIT_HASH" =~ ^@ ]]; then + GIT_HASH="unknown" +else + GIT_HASH="$(echo -n "$GIT_HASH" | head -c 7)" +fi +STARTOS_ENV="$(dpkg-deb --fsys-tarfile $DEB_PATH | tar --to-stdout -xvf - ./usr/lib/startos/ENVIRONMENT.txt)" +PLATFORM="$(dpkg-deb --fsys-tarfile $DEB_PATH | tar --to-stdout -xvf - ./usr/lib/startos/PLATFORM.txt)" + +if [ -z "$1" ]; then + PLATFORM="$(uname -m)" +fi +if [ "$PLATFORM" = "x86_64" ] || [ "$PLATFORM" = "x86_64-nonfree" ]; then + ARCH=amd64 + QEMU_ARCH=x86_64 +elif [ "$PLATFORM" = "aarch64" ] || [ "$PLATFORM" = "aarch64-nonfree" ] || [ "$PLATFORM" = "raspberrypi" ] || [ "$PLATFORM" = "rockchip64" ]; then + ARCH=arm64 + QEMU_ARCH=aarch64 +else + ARCH="$PLATFORM" + QEMU_ARCH="$PLATFORM" +fi + +SUITE=bookworm + +debspawn list | grep $SUITE || debspawn create $SUITE + +VERSION_FULL="${VERSION}-${GIT_HASH}" +if [ -n "$STARTOS_ENV" ]; then + VERSION_FULL="$VERSION_FULL~${STARTOS_ENV}" +fi + +if [ -z "$DSNAME" ]; then + DSNAME="$SUITE" +fi + +if [ "$QEMU_ARCH" != "$(uname -m)" ]; then + sudo update-binfmts --import qemu-$QEMU_ARCH +fi + +imgbuild_fname="$(mktemp /tmp/exec-mkimage.XXXXXX)" +cat > $imgbuild_fname <4f92?wjaMTu^b5;2@mv~({2msTRvUm*`FJH3IIxf=N<;4 zO1Yx|Ams!A0Tj*wP{8^Y00WBS0dC-q7(@VgqXv}%4A3wGAd2+=Jn%G?$nQ5-Qe+X% zc`o8~ABb8!0oaMl=LFsj_$=mmI%HwIDOiwgq4WFS=55QfY0lW(5JrZvs7~O|ftlYk z$(C0DVqn+8SPe7hFj6Le`A3`zwoiYbZ9GX;Sm?#`J>O+5`|?ZZjOy&O*Z6>yi;%>x zL56fqX7*sbv~YWLd#prgF(it@6BRGlzD!cA^r>i^D{W8=7aP`nytOjpRvPNK*i2ls z=3mnaria%{aT^T53=YG6S4@dv?B87pJyTgHcRaq#%W-=wO^$iy>6R#AaZ1+&qB41+ zconWKq@u7H4KLu3WzOz$UeDls*wn3;Ir$7&$DoBaW^P1=JA$cAueuLAz?SzcqAkm} zwV`41>9ImiICMmpMZ0Xj(m3svR<8I_TH-Zf>s%59vT`QGa4ff?cxE~AqPwJ)`o zJ~D*zw*EcSpOMB5G$jGIRn%s}J_+0SJi3Tz^L;!m-ph4dXQ27_XYt-@LDl8vwLasG zi&K~h;f|V_-8C(-o!+^rXfl$TcZVD10#}3ed=umdk{YXzb&a%fHYPUbdgqx}%bS-x z_0}>9RWd3cEw`{FG-R@;CUpQ8_#Y7W3niqKl(zL@a^f=hhsr_~{jK)nSJpSkc~&{| ziY|m9Vr~33@ra(^Oh}3WfP2SM|L~@VMSh!55#6>vgu*={C`$WKUi?t{@zbj5=+z-| zh1UoVpq&A9U;jq0bXfTs)7Dy$v8K)w6TU2)J*lM(EBvO3kCg%z)S*(;)DV9(J`GkV z-QoNa(WkPIDa@btHHKI%>2mT-pvVh=Xdw$!W4zwe&b%_eLwcGZogK;97T4={Y9F7P zwLTlmjmB^jmrY9bYlG!u z1fJ{~LOoYh&UL^YEA~>E%g+8iuP{e#om#H$A(C_&Pb)abRR2EU^U_X2rIQ}>6f*h+ zX23{A)XxqqC+e<}w!^^$$a~!L!6(?X!5Tu&|DiW~s%Z@pa6G0|3rZ9P2diN&-HM5b z)o}_g)`TeG<54VHKz~f7ZUto+BL%bn!|1Hh+y~A^=$(G_i_NM_7 z35j)h3qe^ityVNy92NW~l5-?^m;Vxwt+Ia!2*l z1}{&%i-|lgsYl~2aPYZ{q1taL@J zN!DyE^_H+eRL%{+y-*Fn5=7nXW?S2+7>vOS3iVzpKXxSXj2AFRMjSZ{vM8jf#J znQd-ay!g+*k@CSoor*vinAaJNh;p@+^$RJDOI6idZb={P4il|~V>7eT=G^Olq=!WP z6T=LFtZj5H@ zx+o3aAV{Q(h6sTCTrNSMvvpVd@Aw91-w?~jT@fy#mJpEfpzHy%VcA!5mp4t>HRi$B zyN3}i0A%#S0a5j+fG! zcR77{-Y88Zz1+TMo6Dt05DfmOG`*twY`rhNwa{`9Da2|Kea{UQ!@>T*E?mH))dEEXQKx2UITgHk6x-aECLa$D)kV{RgTR_ z!|*!tLyl|4^8w)?)FlfAX$@iI+GiK=*zkp2?MnY*O=k7a?9cuZ?^ccwEzSYeCDkTr zPN8wqp-t0m120bAL5)I)wlIS$h`u~j?cb#Ia%Yc>VL^{31knrsCjxw4 zUjKE{6re0YUwD-}$Bb^fDS{8mCphe5blas&TP|WE%z$8x>?1Tqz2&tttdGb*+nc5@ zBGpIoU-1BBL164|Y0x-n3`Z$`zhSEB>z86!IGc!5NM3U?)l7K!Q*QXb($yTF-HSS; zBw}9{+8vmYs*2w5MWmPkwy8k3gCIawnAGVkntl4$B~)9F8kh@61Tng;dIx?>$QuxS zdN77VT1mb0T6)5cBt2+7G3?s@@7h$=***!!hFe4W08R)bRl!l)3hvfzMwVy9o)(L& z*e~lEgfvYLTW$&NWR|c?IFJv?JW)R6Gr_c~sWm&p_A!NW?XpI!VIeqWGj9;}Jqvs^ z^dCr-WBJc$DZnQDI{Azc{Up^okc=KVJr8)SoQ%Yazvcf5S z--5E+g-31s4lVQv_l%_Fp8#-gS-Fo_zwD0?ub>kqFZW%2r^!fnlS5QtrObxPwAopc zwJ-UStq$qzF4Vx4+>N;xa_66L9m({}3&;7l=gvw6@UA!3(G z$EL%Bdo@PNFr727A^)T|L~w`p4!bS>ydU zAFzNt`D6fZ4O~91iuVYnTz`=rjD)0_zlFHep8&+nDV^{8ofMvz@Z<2$-MVS5N-MXi zY0)~`p}-w5-XAi7x~tvi#B)u#$ysWS4f!%#vg_vFyHG#_ zl#YKzw?z}{e>h)DI;kFVt7= zaNt7{&`mK8`jA6T^Gok<(vGhcT%c?}33>l5EdeSC_*ncSbIT`z|2^6J-|6F?D!x0< zS#A4!ybV34K*1wtdMsn8j7DZ_zioE8j47_^bdUTgWzm6Bi0fI{6VU;{N{?@wgmNa+Wu2{fNuj+hxJ~_4gke z>guf~C8+1IXXNE2(|#{U?l*<}_)9)he}B8bchrB0nHz>(qetd3j#i+Ii}$wsBPW2B ziaOq?fAsn0m?vC5_tB3SW&+55Mo#d=*m{5Yvm?i`+FK6bBA)!>OKI~;$FW|+ z#_F@D7{{EqI=%&ErzTCJ zkRMkaI)a=LwTSLzl;78INIaA{Dc^u6mDZ z_$G!VN366Tk?;H%7up{-G1$y%SD0ih3>YJ^`XG&9utfv99^E`Ex;<+0SN~}4Jg6xQ`PDzWH&#Q6`W&$Ku-|pe8O7e*Oy0V&?y+l!X z%T1>u-Q}CH-k!a_Y7k zH@@36R)=A3G}3E|c?VOcR9t^e#Y#%dFtZZV@@K4nH4YJ@I|!7I#m!D|Haa4I<%nu? z$|B5vJZR*MU9kY@>TCjb7wh4b&8sE>3sqef6UAgB);2q2n7REi2N-S*33e{p9bM2V zL@ZEDCUod1J-Tk*qRDJ!bI~k40h8;kvfmm;cYgf)69ezOH#ehyq#Wl;J}X^X-rBp< zGPXb?O=ED%S&nqI{VHP@Qg&O#6?HzbC92!&V+I!+f4(h1F5o(y-Rr9Uxic8C`AKl+ z?HE(5?fJu{*n;<{OBe9+gL=zU59X!v%$lK*-bMl%eZD+JnnWAK2FbA=FKo(>=b_D- zHdmLa%kwdXyluEj*`eZ_6$MnS`;_HgBy&V#IcQ`1vc+sA>ba?{iK@6;1+7dVJ;1)! z#yR+_l~b^=?h(j?+E>6MaMknOYUYciiV@K7{C^uUWEf7234&m{VD{(Q`x-Ucr|E~= zSMAke1AFLccG7-I87vzlRpQa)lXgnA*q6Wt4XbdX28eEuDu53i zKk!Ow1he<*xnP%>ovh=M>Z?Ql3ZDxonD-zR4rrXOKjIKO=ZyE!wIT$KnFMdF;@U)_ zKK*?P5E57|93TJWy0Cq}$#}`Le#6w=0u7I^)6Q((qs0aRLH?Y3}uJ&<{lU~gy>PYQYbtN)7P`NF;T{cE7(t0iQwrBYADy=pu5xIjn#%e)QP_RZoY1C|L0I=>WD@^pd_Wm@9c7Y;2 zjQDx@Ev>&7XlJ>hxUAtlSOE|7_Ag zV~Re=FeAQmOnP)}E5t>#>xyC`P69q2IOyJ8eTK6)!D@wPOh&TCgW*2PaaSAT^uNua z@lt8KoB_k*=9|Nq<*?1~i%9p8USs(j^)YxOs=Vj)H}%Ge#i6$Iimvk?EwP$1E!__$ zVkILU8P2Lm)_iiH&~*;#O-;X^_F9;8=&yn=T|s3pp=J0Ka5Z@7SwShUpU@hct{Xyz z2to%*@0)Dh9m^G>1M#j6mON2o7cr>>K^EA3GqdlIf!(4C%CW-69ysQ)-j1s@($?T{ zf3~g{sF+7YR^N2MP(IXP1)*tT1WbK;6MK~mhjrur_|mKxEdfPa2gMvl0hYoyJ5Rv+OTHSltuDbJAvBHwC-2xlK z{EhYrT3~1Uf^MUM!jV}qM~S}9+Xf4tuGo(GRu(gKOj8gV2?`O*lTT$)-2odTheW&j&1t)WY&{xxiVfMcgQl$br`QT<9GY8c^RKVdTa6!bd zwq>88nfBPRG%DlrD1p|k+dTbJJ9P;UU);hVRHXwl7=xO0ao^^L-{2No)bZ-`GKgka z1FU^<>C$PQ1ZVaS5&6nGlJXibJVb)J)KbF=L~JST4j}x=r0-{Y^DjG$@=GRYCin>( z648pU31_cV($-+hR{(;ttKb_EJ_IV<8A>~gZ>ceutY})&x;yLB>8woBjI?v9!eU(B zqRQvpa_?1CH4S!q3=wI`WfFan+?M)#>wMI&b-O~xo&e(IHvu1;Vh;(_$ru@6X}qca zKv2LRhr`|79~!hWz)sTmiUy`zR1x;l?)d|8{j@lJ#u?6Ht3{Jw6WT z(fG}nxqr(zPLs#71n~IXg?n~i{3Ga_c@KG>5C0lKT{uk{$Z&1wx#nZ&f?DiV-K<^q zii8uy{bN78aAQ?<;O?WTX$V5;mpw{b$ryoH}r7vejBR}GaUdNp2CP0592 zmP>3m>InYpK$u%1{}n6?ds)@LVk=y7T7G2k49EOFNf$L!w;IkfI{t!Q-6C2v9=GX9 z?c470i@ff_`Y5)!PZ?>wvgS$S_pJ==qbrmqpwkuVpQDbU~MlYLR^Q2~xq#E=a5PlA-a=R8Za84+0)cD83XFPa1ilSEv8zjGgof z8C0t?N%OxrG-k;7cv;S|5t5&G@Jp)JdBb0g>iCHDuSRg1Hbh`Da`+1HS;v=+ak)<= z1u~Om2janbh(Zb$<3>m;m>81C(BU#H5P!3NHmhE1*l}wObO{lirHiMvrGp*0=pOj& z*w9U4RjGa}>H@c)2d*agZ+*-*9p*DP9906=#rR1i zho?(wm2|9Ynt}`1vACk{%c`rdk#!Ou6>_Ojeb4&@BiWtf692*eqLXbAV2d3g_~?IW zP2tNQdB`tIR9M&oY)y(E?ffcAc$`ZRFr+ALfl(V%8VC@aB;@k7vN9;H-Vrri7U07b z#_%g_2!O-nYCXM)K{chq-5FLRIX3kd*TxDL2dc1&uWNq3JAM6#OWGkK&b9`1$rzuW zpU}`v#~79Rj}NP0rkQ#(L4tBkLJaca2&1msWG0#zy{QKCxMrg8q^>SJL-y~ars|HM zp#TVZ|NPA9kt!o;z=)ax_NZh&r*mC3brvR8Zz2i!rHT~PO>R3<95H*chFY!$3Iku&`iBItx{z&pE25Z|f(7ARkNR#_zS z{oN7It+-~VO{=8}k}kOOkyTY20QG!M1Un`+-0aE)3^ip_5ifeQ@A?aDLQD7ZY~#`$ ze;U|*-gbB{IO*7g<#!1T7O=xbQqk*|9^3KPppVr{$J|`Y1gi!;ssHjqc9*E(2aI2y zFjOconi$L+35uPYej9gD>w)y=M77wZRk8|w#o_u;BXXaFXq*4`_OQzk&Ji&CR7O*T z#~fA5LWt}Z>v#meL{6}4?%yj0($8o$J_%V!Rk}VoELclYK*l`nDu&6iXZ2;q8)7xn zf+ij^LF1*p%FLc`RK5$bO>qm^q`W(s%U(@ubD+8o`RCqiNId+; zqe%hq_~cvfXo9*V{w*=(6R06iIUX0gwMxl2Hag^KnjVr80BypABZZ+O#;730XEsnv z!q9w7E_$}E+M5jSVm*+6ui-Qai)!ON0}OW8C#0&9&og0#c7bphVD%u3ZU${JcsSn^Kcs04u4ELNP69#4&l!dGn~m zHvx#$lXtXN%I!Y!`3un%(Y-heyCtufx2#1fd`C4@9C}$jM2{cNz(suKPx>a015@Cm3D3Qf&jp|#3ms3DPm&smX|P@rgs%PG7;)BL)sSRQ z9+98&#RI7%zYc49%ew!9*V?hKneVG@9^tp?H+I#nWm#})eWaM#l#c4gFg>s;>L zM+-5eMIv8QN>NL0F@oo=X?K3bQSDBtci* z&e&ZXt0`iwq`72kzCi9l&FZUxM+d!+a8lO(-|&g6JQo(vKCOBUnOvFb>{V-IF)}=J zGkk`wAU9Mfsj56EjPOcXO<$%WfU9h&Jalz&4`VoqPIDZlf&RAlz@vufNvpDadVo;^ z*{*14mPhws&nCJZ)(*qpWI_r_X$Bb>;aL7ZR9e>W4#pBXGEC6H+P8t11aO|4N*VR_ zJvTUD+h{pCa=}WP+(o$i{bH)UQ@?=yl4 ziz*E-DN>?~0)7%1@^JjO;g}*F!CXrIk4rKxj9_J^4Zmyuxy~`3qy{Xi1=7Pz-$(Kw z?{+)_{b^SHM5wo6UQCcC%ic^is;hT4u6Kq7mx3!>!%WDw4PNGa9bXttY@YGLkaQ zJASrkPpnHJ@*?n|EQRpI_|Ai{);h^|d}jtboV&2 echo '$OS_ARCH is required' - exit 1 +if [ -z "$ARCH" ]; then + ARCH=$(uname -m) fi if [ "$0" != "./build.sh" ]; then @@ -18,12 +17,10 @@ if tty -s; then USE_TTY="-it" fi -alias 'rust-arm64-musl-builder'='docker run $USE_TTY --rm -e "OS_ARCH=$OS_ARCH" -v "$HOME"/.cargo/registry:/root/.cargo/registry -v "$(pwd)":/home/rust/src messense/rust-musl-cross:aarch64-musl' -alias 'rust-x86_64-musl-builder'='docker run $USE_TTY --rm -e "OS_ARCH=$OS_ARCH" -v "$HOME"/.cargo/registry:/root/.cargo/registry -v "$(pwd)":/home/rust/src messense/rust-musl-cross:x86_64-musl' +alias 'rust-musl-builder'='docker run $USE_TTY --rm -v "$HOME"/.cargo/registry:/root/.cargo/registry -v "$(pwd)":/home/rust/src messense/rust-musl-cross:${ARCH}-musl' cd ../.. -rust-arm64-musl-builder sh -c "(git config --global --add safe.directory '*'; cd system-images/compat && cargo build --release --target=aarch64-unknown-linux-musl --no-default-features)" -rust-x86_64-musl-builder sh -c "(git config --global --add safe.directory '*'; cd system-images/compat && cargo build --release --target=x86_64-unknown-linux-musl --no-default-features)" +rust-musl-builder sh -c "(git config --global --add safe.directory '*'; cd system-images/compat && cargo build --release --target=${ARCH}-unknown-linux-musl --no-default-features)" cd system-images/compat sudo chown -R $USER target From a69cae22dd91580080ffbba17b1f15e37943c2e2 Mon Sep 17 00:00:00 2001 From: J H <2364004+Blu-J@users.noreply.github.com> Date: Mon, 23 Oct 2023 14:41:54 -0600 Subject: [PATCH 03/35] chore: Cleaning up the stream to a regular stream (#2468) --- backend/src/procedure/docker.rs | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/backend/src/procedure/docker.rs b/backend/src/procedure/docker.rs index 92d19d6c2..463b2f2e4 100644 --- a/backend/src/procedure/docker.rs +++ b/backend/src/procedure/docker.rs @@ -892,22 +892,13 @@ async fn buf_reader_to_lines( reader: impl AsyncBufRead + Unpin, limit: impl Into>, ) -> Result, Error> { - let lines = stream! { - let mut lines = reader.lines(); - while let Some(line) = lines.next_line().await? { - yield Ok::<_, Report>(line); + let mut lines = reader.lines(); + let mut output = RingVec::new(limit.into().unwrap_or(1000)); + while let Ok(line) = lines.next_line().await { + if let Some(line) = line { + output.push(line); } - }; - let output: RingVec = lines - .try_fold( - RingVec::new(limit.into().unwrap_or(1000)), - |mut acc, line| async move { - acc.push(line); - Ok(acc) - }, - ) - .await - .with_kind(crate::ErrorKind::Unknown)?; + } let output: Vec = output.value.into_iter().collect(); Ok(output) } From 740e63da2b3454e86be84775dc5d1c4570c6e4db Mon Sep 17 00:00:00 2001 From: Aiden McClelland <3732071+dr-bonez@users.noreply.github.com> Date: Mon, 23 Oct 2023 15:01:52 -0600 Subject: [PATCH 04/35] enable zram by default (#2470) --- backend/src/db/model.rs | 2 +- backend/src/version/v0_3_5.rs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/src/db/model.rs b/backend/src/db/model.rs index 2e8cf1ede..950c6505a 100644 --- a/backend/src/db/model.rs +++ b/backend/src/db/model.rs @@ -80,7 +80,7 @@ impl Database { .map(|x| format!("{x:X}")) .join(":"), system_start_time: Utc::now().to_rfc3339(), - zram: false, + zram: true, }, package_data: AllPackageData::default(), ui: serde_json::from_str(include_str!("../../../frontend/patchdb-ui-seed.json")) diff --git a/backend/src/version/v0_3_5.rs b/backend/src/version/v0_3_5.rs index bf48ac02c..6613fb888 100644 --- a/backend/src/version/v0_3_5.rs +++ b/backend/src/version/v0_3_5.rs @@ -62,6 +62,7 @@ impl VersionT for Version { } } db.mutate(|v| { + v.as_server_info_mut().as_zram_mut().ser(&true)?; for (_, pde) in v.as_package_data_mut().as_entries_mut()? { for (dependency, info) in pde .as_installed_mut() From 6e92a7d93d85beb5ed4d67268db6db3a667cdb23 Mon Sep 17 00:00:00 2001 From: Aiden McClelland <3732071+dr-bonez@users.noreply.github.com> Date: Mon, 23 Oct 2023 21:46:46 -0600 Subject: [PATCH 05/35] Bugfix/output timeout (#2471) * Fix: Test with the buf reader never finishing * fix NoOutput deserialization --------- Co-authored-by: J H <2364004+Blu-J@users.noreply.github.com> --- backend/src/procedure/docker.rs | 23 ++++++++++++++--------- backend/src/procedure/mod.rs | 8 +++++++- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/backend/src/procedure/docker.rs b/backend/src/procedure/docker.rs index 463b2f2e4..3f72993a0 100644 --- a/backend/src/procedure/docker.rs +++ b/backend/src/procedure/docker.rs @@ -396,7 +396,7 @@ impl DockerProcedure { cmd.arg("exec"); - cmd.args(self.docker_args_inject(pkg_id).await?); + cmd.args(self.docker_args_inject(pkg_id)); let input_buf = if let (Some(input), Some(format)) = (&input, &self.io_format) { cmd.stdin(std::process::Stdio::piped()); Some(format.to_vec(input)?) @@ -756,7 +756,7 @@ impl DockerProcedure { + self.args.len(), // [ARG...] ) } - async fn docker_args_inject(&self, pkg_id: &PackageId) -> Result>, Error> { + fn docker_args_inject(&self, pkg_id: &PackageId) -> Vec> { let mut res = self.new_docker_args(); if let Some(shm_size_mb) = self.shm_size_mb { res.push(OsStr::new("--shm-size").into()); @@ -769,7 +769,7 @@ impl DockerProcedure { res.extend(self.args.iter().map(|s| OsStr::new(s).into())); - Ok(res) + res } } @@ -893,13 +893,11 @@ async fn buf_reader_to_lines( limit: impl Into>, ) -> Result, Error> { let mut lines = reader.lines(); - let mut output = RingVec::new(limit.into().unwrap_or(1000)); - while let Ok(line) = lines.next_line().await { - if let Some(line) = line { - output.push(line); - } + let mut answer = RingVec::new(limit.into().unwrap_or(1000)); + while let Some(line) = lines.next_line().await? { + answer.push(line); } - let output: Vec = output.value.into_iter().collect(); + let output: Vec = answer.value.into_iter().collect(); Ok(output) } @@ -964,4 +962,11 @@ mod tests { assert_eq!(CAPACITY_IN, ring.value.capacity()); assert_eq!(CAPACITY_IN, ring.value.len()); } + + #[test] + fn tests_buf_reader_to_lines() { + let mut reader = BufReader::new("hello\nworld\n".as_bytes()); + let lines = futures::executor::block_on(buf_reader_to_lines(&mut reader, None)).unwrap(); + assert_eq!(lines, vec!["hello", "world"]); + } } diff --git a/backend/src/procedure/mod.rs b/backend/src/procedure/mod.rs index d6d01bf00..62f4de9cf 100644 --- a/backend/src/procedure/mod.rs +++ b/backend/src/procedure/mod.rs @@ -171,7 +171,13 @@ impl<'de> Deserialize<'de> for NoOutput { where D: serde::Deserializer<'de>, { - let _ = Value::deserialize(deserializer)?; + let _ = Value::deserialize(deserializer); Ok(NoOutput) } } + +#[test] +fn test_deser_no_output() { + serde_json::from_str::("").unwrap(); + serde_json::from_str::>("{\"Ok\": null}").unwrap(); +} From a96467cb3eac5f29700231aa0c2d2064c045f56a Mon Sep 17 00:00:00 2001 From: Aiden McClelland <3732071+dr-bonez@users.noreply.github.com> Date: Tue, 24 Oct 2023 15:27:33 -0600 Subject: [PATCH 06/35] fix raspi build (#2472) * fix raspi build * Update build.sh --- .github/workflows/startos-iso.yaml | 4 ++-- image-recipe/build.sh | 29 ++++++++++++++++++++++++++--- 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/.github/workflows/startos-iso.yaml b/.github/workflows/startos-iso.yaml index b33d57984..6873b29cb 100644 --- a/.github/workflows/startos-iso.yaml +++ b/.github/workflows/startos-iso.yaml @@ -112,8 +112,8 @@ jobs: format( '["ubuntu-22.04", "{0}"]', fromJson('{ - "x86_64": "buildjet-32vcpu-ubuntu-2204", - "x86_64-nonfree": "buildjet-32vcpu-ubuntu-2204", + "x86_64": "buildjet-8vcpu-ubuntu-2204", + "x86_64-nonfree": "buildjet-8vcpu-ubuntu-2204", "aarch64": "buildjet-8vcpu-ubuntu-2204-arm", "aarch64-nonfree": "buildjet-8vcpu-ubuntu-2204-arm", "raspberrypi": "buildjet-8vcpu-ubuntu-2204-arm", diff --git a/image-recipe/build.sh b/image-recipe/build.sh index 88374ff2b..bfc7921d9 100755 --- a/image-recipe/build.sh +++ b/image-recipe/build.sh @@ -1,7 +1,7 @@ #!/bin/bash set -e -MAX_IMG_SECTORS=8388608 # 4GB +MAX_IMG_SECTORS=7217792 # 4GB echo "==== StartOS Image Build ====" @@ -273,7 +273,7 @@ elif [ "${IMAGE_TYPE}" = img ]; then fi } - ROOT_PART_END=7217792 + ROOT_PART_END=$MAX_IMG_SECTORS TARGET_NAME=$prep_results_dir/${IMAGE_BASENAME}.img TARGET_SIZE=$[($ROOT_PART_END+1)*512] truncate -s $TARGET_SIZE $TARGET_NAME @@ -317,8 +317,31 @@ elif [ "${IMAGE_TYPE}" = img ]; then umount $TMPDIR/boot umount $TMPDIR + + e2fsck -fy `partition_for ${OUTPUT_DEVICE} 2` + resize2fs -M `partition_for ${OUTPUT_DEVICE} 2` + + BLOCK_COUNT=$(dumpe2fs -h `partition_for ${OUTPUT_DEVICE} 2` | awk '/^Block count:/ { print $3 }') + BLOCK_SIZE=$(dumpe2fs -h `partition_for ${OUTPUT_DEVICE} 2` | awk '/^Block size:/ { print $3 }') + SECTOR_LEN=$[$BLOCK_COUNT*$BLOCK_SIZE/512] + losetup -d $OUTPUT_DEVICE - mv $prep_results_dir/${IMAGE_BASENAME}.img $RESULTS_DIR/$IMAGE_BASENAME.iso + ( + echo d + echo 2 + echo n + echo p + echo 2 + echo 526336 + echo +$SECTOR_LEN + echo w + ) | fdisk $TARGET_NAME + + ROOT_PART_END=$[526336+$SECTOR_LEN] + TARGET_SIZE=$[($ROOT_PART_END+1)*512] + truncate -s $TARGET_SIZE $TARGET_NAME + + mv $TARGET_NAME $RESULTS_DIR/$IMAGE_BASENAME.img fi \ No newline at end of file From 531e03797496fcdcefce9b49a333055829fb5049 Mon Sep 17 00:00:00 2001 From: Aiden McClelland <3732071+dr-bonez@users.noreply.github.com> Date: Wed, 25 Oct 2023 00:17:29 -0600 Subject: [PATCH 07/35] Bugfix/argon2 mem usage (#2474) * reduce argon2 memory usage * update FE argon2 * fix missing typedefs --- backend/src/disk/mount/backup.rs | 4 ++-- frontend/package-lock.json | 6 ++++-- frontend/package.json | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/backend/src/disk/mount/backup.rs b/backend/src/disk/mount/backup.rs index a3e239b2b..a19056241 100644 --- a/backend/src/disk/mount/backup.rs +++ b/backend/src/disk/mount/backup.rs @@ -84,7 +84,7 @@ impl BackupMountGuard { argon2::hash_encoded( password.as_bytes(), &rand::random::<[u8; 16]>()[..], - &argon2::Config::default(), + &argon2::Config::rfc9106_low_mem(), ) .with_kind(crate::ErrorKind::PasswordHashGeneration)?, ); @@ -134,7 +134,7 @@ impl BackupMountGuard { argon2::hash_encoded( new_password.as_bytes(), &rand::random::<[u8; 16]>()[..], - &argon2::Config::default(), + &argon2::Config::rfc9106_low_mem(), ) .with_kind(crate::ErrorKind::PasswordHashGeneration)?, ); diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 5e2a730fe..40a67f4d9 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -23,7 +23,7 @@ "@ng-web-apis/common": "^2.0.0", "@ng-web-apis/mutation-observer": "^2.0.0", "@ng-web-apis/resize-observer": "^2.0.0", - "@start9labs/argon2": "^0.1.0", + "@start9labs/argon2": "^0.2.2", "@start9labs/emver": "^0.1.5", "@taiga-ui/addon-charts": "3.20.0", "@taiga-ui/cdk": "3.20.0", @@ -5283,7 +5283,9 @@ } }, "node_modules/@start9labs/argon2": { - "version": "0.1.0" + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@start9labs/argon2/-/argon2-0.2.2.tgz", + "integrity": "sha512-OEJYDIicwwWg0NgG3d2GSO2Qs65B0LY9dIrlXFIJZJ1mo9vcDIU0kC2Yp8dg4XMt2U16ncsgru98s9I+y5Yuaw==" }, "node_modules/@start9labs/emver": { "version": "0.1.5", diff --git a/frontend/package.json b/frontend/package.json index 28e90e9a8..e001b4484 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -48,7 +48,7 @@ "@ng-web-apis/common": "^2.0.0", "@ng-web-apis/mutation-observer": "^2.0.0", "@ng-web-apis/resize-observer": "^2.0.0", - "@start9labs/argon2": "^0.1.0", + "@start9labs/argon2": "^0.2.2", "@start9labs/emver": "^0.1.5", "@taiga-ui/addon-charts": "3.20.0", "@taiga-ui/cdk": "3.20.0", From 65728eb6ab43dde1461ccab34d44b333abc9c068 Mon Sep 17 00:00:00 2001 From: Lucy <12953208+elvece@users.noreply.github.com> Date: Wed, 25 Oct 2023 02:24:11 -0400 Subject: [PATCH 08/35] allow tab completion on final setup stage in kiosk mode (#2473) --- .../setup-wizard/src/app/pages/success/success.page.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/projects/setup-wizard/src/app/pages/success/success.page.html b/frontend/projects/setup-wizard/src/app/pages/success/success.page.html index ff2261694..b52c51efa 100644 --- a/frontend/projects/setup-wizard/src/app/pages/success/success.page.html +++ b/frontend/projects/setup-wizard/src/app/pages/success/success.page.html @@ -16,7 +16,7 @@

Setup Complete!

- +

Continue to login

From 9a545f176d0e468238adf2c50520627e21cb424d Mon Sep 17 00:00:00 2001 From: Matt Hill Date: Wed, 25 Oct 2023 12:08:39 -0600 Subject: [PATCH 09/35] diplay restoring when restoring (#2476) --- .../components/status/status.component.html | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/frontend/projects/ui/src/app/components/status/status.component.html b/frontend/projects/ui/src/app/components/status/status.component.html index 50ffa4860..fd265fd96 100644 --- a/frontend/projects/ui/src/app/components/status/status.component.html +++ b/frontend/projects/ui/src/app/components/status/status.component.html @@ -6,24 +6,25 @@ [style.font-style]="style" [style.font-weight]="weight" > - - {{ (connected$ | async) ? rendering.display : 'Unknown' }} - - this may take a while + {{ (connected$ | async) ? rendering.display : 'Unknown' }} + + + this may take a while + - Installing - {{ progress }} + {{ progress }} + +

From b28c67313311df5b50de3b275ee8f7af84563334 Mon Sep 17 00:00:00 2001 From: Matt Hill Date: Thu, 26 Oct 2023 16:02:53 -0600 Subject: [PATCH 10/35] closes #2454 (#2478) --- .../setup-wizard/src/app/modals/password/password.page.html | 2 -- frontend/projects/ui/src/app/pages/login/login.page.html | 1 - 2 files changed, 3 deletions(-) diff --git a/frontend/projects/setup-wizard/src/app/modals/password/password.page.html b/frontend/projects/setup-wizard/src/app/modals/password/password.page.html index d779077c6..ccf836737 100644 --- a/frontend/projects/setup-wizard/src/app/modals/password/password.page.html +++ b/frontend/projects/setup-wizard/src/app/modals/password/password.page.html @@ -27,7 +27,6 @@ [type]="!unmasked1 ? 'password' : 'text'" placeholder="Enter Password" (ionChange)="validate()" - maxlength="64" > Date: Fri, 27 Oct 2023 00:16:52 +0200 Subject: [PATCH 11/35] Delete Cargo.lock (#2477) --- Cargo.lock | 5607 ---------------------------------------------------- 1 file changed, 5607 deletions(-) delete mode 100644 Cargo.lock diff --git a/Cargo.lock b/Cargo.lock deleted file mode 100644 index f5e17510c..000000000 --- a/Cargo.lock +++ /dev/null @@ -1,5607 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "Inflector" -version = "0.11.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" -dependencies = [ - "lazy_static", - "regex", -] - -[[package]] -name = "addr2line" -version = "0.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9ecd88a8c8378ca913a680cd98f0f13ac67383d35993f86c90a70e3f137816b" -dependencies = [ - "gimli", -] - -[[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - -[[package]] -name = "aes" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e8b47f52ea9bae42228d07ec09eb676433d7c4ed1ebdf0f1d1c29ed446f1ab8" -dependencies = [ - "cfg-if 1.0.0", - "cipher", - "cpufeatures", - "ctr", - "opaque-debug", -] - -[[package]] -name = "ahash" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" -dependencies = [ - "getrandom 0.2.8", - "once_cell", - "version_check", -] - -[[package]] -name = "aho-corasick" -version = "0.7.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4f55bd91a0978cbfd91c457a164bab8b4001c833b7f323132c0a4e1922dd44e" -dependencies = [ - "memchr", -] - -[[package]] -name = "android_system_properties" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" -dependencies = [ - "libc", -] - -[[package]] -name = "ansi_term" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" -dependencies = [ - "winapi", -] - -[[package]] -name = "anyhow" -version = "1.0.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "216261ddc8289130e551ddcd5ce8a064710c0d064a4d2895c67151c92b5443f6" - -[[package]] -name = "arrayref" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544" - -[[package]] -name = "arrayvec" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" - -[[package]] -name = "arrayvec" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" - -[[package]] -name = "ascii-canvas" -version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8824ecca2e851cec16968d54a01dd372ef8f95b244fb84b84e70128be347c3c6" -dependencies = [ - "term", -] - -[[package]] -name = "ast_node" -version = "0.7.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc4c00309ed1c8104732df4a5fa9acc3b796b6f8531dfbd5ce0078c86f997244" -dependencies = [ - "darling 0.10.2", - "pmutil", - "proc-macro2 1.0.47", - "quote 1.0.21", - "swc_macros_common", - "syn 1.0.103", -] - -[[package]] -name = "async-stream" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dad5c83079eae9969be7fadefe640a1c566901f05ff91ab221de4b6f68d9507e" -dependencies = [ - "async-stream-impl", - "futures-core", -] - -[[package]] -name = "async-stream-impl" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10f203db73a71dfa2fb6dd22763990fa26f3d2625a6da2da900d23b87d26be27" -dependencies = [ - "proc-macro2 1.0.47", - "quote 1.0.21", - "syn 1.0.103", -] - -[[package]] -name = "async-trait" -version = "0.1.58" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e805d94e6b5001b651426cf4cd446b1ab5f319d27bab5c644f61de0a804360c" -dependencies = [ - "proc-macro2 1.0.47", - "quote 1.0.21", - "syn 1.0.103", -] - -[[package]] -name = "atoi" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7c57d12312ff59c811c0643f4d80830505833c9ffaebd193d819392b265be8e" -dependencies = [ - "num-traits", -] - -[[package]] -name = "atty" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -dependencies = [ - "hermit-abi", - "libc", - "winapi", -] - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "avahi-sys" -version = "0.10.0" -source = "git+https://github.com/Start9Labs/avahi-sys?branch=feature/dynamic-linking#12bef9e435cfb0d36cb229b9d08e2114c176ea7a" -dependencies = [ - "bindgen", - "libc", -] - -[[package]] -name = "backtrace" -version = "0.3.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cab84319d616cfb654d03394f38ab7e6f0919e181b1b57e1fd15e7fb4077d9a7" -dependencies = [ - "addr2line", - "cc", - "cfg-if 1.0.0", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", -] - -[[package]] -name = "base32" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23ce669cd6c8588f79e15cf450314f9638f967fc5770ff1c7c1deb0925ea7cfa" - -[[package]] -name = "base64" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b41b7ea54a0c9d92199de89e20e58d49f02f8e699814ef3fdf266f6f748d15c7" - -[[package]] -name = "base64" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" - -[[package]] -name = "base64ct" -version = "1.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b645a089122eccb6111b4f81cbc1a49f5900ac4666bb93ac027feaecf15607bf" - -[[package]] -name = "basic-cookies" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb53b6b315f924c7f113b162e53b3901c05fc9966baf84d201dfcc7432a4bb38" -dependencies = [ - "lalrpop", - "lalrpop-util", - "regex", -] - -[[package]] -name = "better_scoped_tls" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b73e8ecdec39e98aa3b19e8cd0b8ed8f77ccb86a6b0b2dc7cd86d105438a2123" -dependencies = [ - "scoped-tls", -] - -[[package]] -name = "bindgen" -version = "0.55.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75b13ce559e6433d360c26305643803cb52cfbabbc2b9c47ce04a58493dfb443" -dependencies = [ - "bitflags", - "cexpr", - "cfg-if 0.1.10", - "clang-sys", - "clap 2.34.0", - "env_logger 0.7.1", - "lazy_static", - "lazycell", - "log", - "peeking_take_while", - "proc-macro2 1.0.47", - "quote 1.0.21", - "regex", - "rustc-hash", - "shlex", - "which 3.1.1", -] - -[[package]] -name = "bit-set" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" -dependencies = [ - "bit-vec", -] - -[[package]] -name = "bit-vec" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitmaps" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "031043d04099746d8db04daf1fa424b2bc8bd69d92b25962dcde24da39ab64a2" -dependencies = [ - "typenum", -] - -[[package]] -name = "bitmaps" -version = "3.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "703642b98a00b3b90513279a8ede3fcfa479c126c5fb46e78f3051522f021403" - -[[package]] -name = "bitvec" -version = "0.19.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55f93d0ef3363c364d5976646a38f04cf67cfe1d4c8d160cdea02cab2c116b33" -dependencies = [ - "funty", - "radium", - "tap", - "wyz", -] - -[[package]] -name = "blake2b_simd" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72936ee4afc7f8f736d1c38383b56480b5497b4617b4a77bdbf1d2ababc76127" -dependencies = [ - "arrayref", - "arrayvec 0.7.2", - "constant_time_eq", -] - -[[package]] -name = "block-buffer" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" -dependencies = [ - "block-padding", - "generic-array", -] - -[[package]] -name = "block-buffer" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" -dependencies = [ - "generic-array", -] - -[[package]] -name = "block-padding" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" - -[[package]] -name = "bollard" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d82e7850583ead5f8bbef247e2a3c37a19bd576e8420cd262a6711921827e1e5" -dependencies = [ - "base64 0.13.1", - "bollard-stubs", - "bytes", - "futures-core", - "futures-util", - "hex", - "http", - "hyper", - "hyperlocal", - "log", - "pin-project-lite", - "serde", - "serde_derive", - "serde_json", - "serde_urlencoded", - "thiserror", - "tokio", - "tokio-util", - "url", - "winapi", -] - -[[package]] -name = "bollard-stubs" -version = "1.42.0-rc.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed59b5c00048f48d7af971b71f800fdf23e858844a6f9e4d32ca72e9399e7864" -dependencies = [ - "serde", - "serde_with 1.14.0", -] - -[[package]] -name = "bstr" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3569f383e8f1598449f1a423e72e99569137b47740b1da11ef19af3d5c3223" -dependencies = [ - "lazy_static", - "memchr", - "regex-automata", - "serde", -] - -[[package]] -name = "bumpalo" -version = "3.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "572f695136211188308f16ad2ca5c851a712c464060ae6974944458eb83880ba" - -[[package]] -name = "byteorder" -version = "1.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" - -[[package]] -name = "bytes" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec8a7b6a70fde80372154c65702f00a0f56f3e1c36abbc6c440484be248856db" - -[[package]] -name = "cc" -version = "1.0.73" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" - -[[package]] -name = "cexpr" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4aedb84272dbe89af497cf81375129abda4fc0a9e7c5d317498c15cc30c0d27" -dependencies = [ - "nom 5.1.2", -] - -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "chrono" -version = "0.4.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfd4d1b31faaa3a89d7934dbded3111da0d2ef28e3ebccdb4f0179f5929d1ef1" -dependencies = [ - "iana-time-zone", - "js-sys", - "num-integer", - "num-traits", - "serde", - "time 0.1.44", - "wasm-bindgen", - "winapi", -] - -[[package]] -name = "ciborium" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0c137568cc60b904a7724001b35ce2630fd00d5d84805fbb608ab89509d788f" -dependencies = [ - "ciborium-io", - "ciborium-ll", - "serde", -] - -[[package]] -name = "ciborium-io" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "346de753af073cc87b52b2083a506b38ac176a44cfb05497b622e27be899b369" - -[[package]] -name = "ciborium-ll" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "213030a2b5a4e0c0892b6652260cf6ccac84827b83a85a534e178e3906c4cf1b" -dependencies = [ - "ciborium-io", - "half", -] - -[[package]] -name = "cipher" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ee52072ec15386f770805afd189a01c8841be8696bed250fa2f13c4c0d6dfb7" -dependencies = [ - "generic-array", -] - -[[package]] -name = "clang-sys" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa2e27ae6ab525c3d369ded447057bca5438d86dc3a68f6faafb8269ba82ebf3" -dependencies = [ - "glob", - "libc", - "libloading", -] - -[[package]] -name = "clap" -version = "2.34.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" -dependencies = [ - "ansi_term", - "atty", - "bitflags", - "strsim 0.8.0", - "textwrap 0.11.0", - "unicode-width", - "vec_map", -] - -[[package]] -name = "clap" -version = "3.2.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71655c45cb9845d3270c9d6df84ebe72b4dad3c2ba3f7023ad47c144e4e473a5" -dependencies = [ - "atty", - "bitflags", - "clap_lex", - "indexmap", - "strsim 0.10.0", - "termcolor", - "textwrap 0.16.0", -] - -[[package]] -name = "clap_lex" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" -dependencies = [ - "os_str_bytes", -] - -[[package]] -name = "codespan-reporting" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" -dependencies = [ - "termcolor", - "unicode-width", -] - -[[package]] -name = "color-eyre" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a667583cca8c4f8436db8de46ea8233c42a7d9ae424a82d338f2e4675229204" -dependencies = [ - "backtrace", - "color-spantrace", - "eyre", - "indenter", - "once_cell", - "owo-colors", - "tracing-error 0.2.0", -] - -[[package]] -name = "color-spantrace" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ba75b3d9449ecdccb27ecbc479fdc0b87fa2dd43d2f8298f9bf0e59aacc8dce" -dependencies = [ - "once_cell", - "owo-colors", - "tracing-core", - "tracing-error 0.2.0", -] - -[[package]] -name = "const-oid" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "722e23542a15cea1f65d4a1419c4cfd7a26706c70871a13a04238ca3f40f1661" - -[[package]] -name = "constant_time_eq" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" - -[[package]] -name = "convert_case" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" - -[[package]] -name = "cookie" -version = "0.16.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "344adc371239ef32293cb1c4fe519592fcf21206c79c02854320afcdf3ab4917" -dependencies = [ - "percent-encoding", - "time 0.3.16", - "version_check", -] - -[[package]] -name = "cookie_store" -version = "0.16.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e4b6aa369f41f5faa04bb80c9b1f4216ea81646ed6124d76ba5c49a7aafd9cd" -dependencies = [ - "cookie", - "idna 0.2.3", - "log", - "publicsuffix", - "serde", - "serde_json", - "time 0.3.16", - "url", -] - -[[package]] -name = "core-foundation" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" - -[[package]] -name = "cpufeatures" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" -dependencies = [ - "libc", -] - -[[package]] -name = "crc" -version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53757d12b596c16c78b83458d732a5d1a17ab3f53f2f7412f6fb57cc8a140ab3" -dependencies = [ - "crc-catalog", -] - -[[package]] -name = "crc-catalog" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d0165d2900ae6778e36e80bbc4da3b5eefccee9ba939761f9c2882a5d9af3ff" - -[[package]] -name = "crc32fast" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" -dependencies = [ - "cfg-if 1.0.0", -] - -[[package]] -name = "crossbeam-queue" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cd42583b04998a5363558e5f9291ee5a5ff6b49944332103f251e7479a82aa7" -dependencies = [ - "cfg-if 1.0.0", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edbafec5fa1f196ca66527c1b12c2ec4745ca14b50f1ad8f9f6f720b55d11fac" -dependencies = [ - "cfg-if 1.0.0", -] - -[[package]] -name = "crunchy" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" - -[[package]] -name = "crypto-common" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" -dependencies = [ - "generic-array", - "typenum", -] - -[[package]] -name = "crypto-mac" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1d1a86f49236c215f271d40892d5fc950490551400b02ef360692c29815c714" -dependencies = [ - "generic-array", - "subtle", -] - -[[package]] -name = "csv" -version = "1.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22813a6dc45b335f9bade10bf7271dc477e81113e89eb251a0bc2a8a81c536e1" -dependencies = [ - "bstr", - "csv-core", - "itoa 0.4.8", - "ryu", - "serde", -] - -[[package]] -name = "csv-core" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b2466559f260f48ad25fe6317b3c8dac77b5bdb5763ac7d9d6103530663bc90" -dependencies = [ - "memchr", -] - -[[package]] -name = "ctr" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "049bb91fb4aaf0e3c7efa6cd5ef877dbbbd15b39dad06d9948de4ec8a75761ea" -dependencies = [ - "cipher", -] - -[[package]] -name = "current_platform" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a74858bcfe44b22016cb49337d7b6f04618c58e5dbfdef61b06b8c434324a0bc" - -[[package]] -name = "curve25519-dalek" -version = "3.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b9fdf9972b2bd6af2d913799d9ebc165ea4d2e65878e329d9c6b372c4491b61" -dependencies = [ - "byteorder", - "digest 0.9.0", - "rand_core 0.5.1", - "subtle", - "zeroize", -] - -[[package]] -name = "cxx" -version = "1.0.80" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b7d4e43b25d3c994662706a1d4fcfc32aaa6afd287502c111b237093bb23f3a" -dependencies = [ - "cc", - "cxxbridge-flags", - "cxxbridge-macro", - "link-cplusplus", -] - -[[package]] -name = "cxx-build" -version = "1.0.80" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84f8829ddc213e2c1368e51a2564c552b65a8cb6a28f31e576270ac81d5e5827" -dependencies = [ - "cc", - "codespan-reporting", - "once_cell", - "proc-macro2 1.0.47", - "quote 1.0.21", - "scratch", - "syn 1.0.103", -] - -[[package]] -name = "cxxbridge-flags" -version = "1.0.80" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e72537424b474af1460806647c41d4b6d35d09ef7fe031c5c2fa5766047cc56a" - -[[package]] -name = "cxxbridge-macro" -version = "1.0.80" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "309e4fb93eed90e1e14bea0da16b209f81813ba9fc7830c20ed151dd7bc0a4d7" -dependencies = [ - "proc-macro2 1.0.47", - "quote 1.0.21", - "syn 1.0.103", -] - -[[package]] -name = "darling" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d706e75d87e35569db781a9b5e2416cff1236a47ed380831f959382ccd5f858" -dependencies = [ - "darling_core 0.10.2", - "darling_macro 0.10.2", -] - -[[package]] -name = "darling" -version = "0.13.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" -dependencies = [ - "darling_core 0.13.4", - "darling_macro 0.13.4", -] - -[[package]] -name = "darling" -version = "0.14.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0dd3cd20dc6b5a876612a6e5accfe7f3dd883db6d07acfbf14c128f61550dfa" -dependencies = [ - "darling_core 0.14.2", - "darling_macro 0.14.2", -] - -[[package]] -name = "darling_core" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0c960ae2da4de88a91b2d920c2a7233b400bc33cb28453a2987822d8392519b" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2 1.0.47", - "quote 1.0.21", - "strsim 0.9.3", - "syn 1.0.103", -] - -[[package]] -name = "darling_core" -version = "0.13.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2 1.0.47", - "quote 1.0.21", - "strsim 0.10.0", - "syn 1.0.103", -] - -[[package]] -name = "darling_core" -version = "0.14.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a784d2ccaf7c98501746bf0be29b2022ba41fd62a2e622af997a03e9f972859f" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2 1.0.47", - "quote 1.0.21", - "strsim 0.10.0", - "syn 1.0.103", -] - -[[package]] -name = "darling_macro" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b5a2f4ac4969822c62224815d069952656cadc7084fdca9751e6d959189b72" -dependencies = [ - "darling_core 0.10.2", - "quote 1.0.21", - "syn 1.0.103", -] - -[[package]] -name = "darling_macro" -version = "0.13.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" -dependencies = [ - "darling_core 0.13.4", - "quote 1.0.21", - "syn 1.0.103", -] - -[[package]] -name = "darling_macro" -version = "0.14.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7618812407e9402654622dd402b0a89dff9ba93badd6540781526117b92aab7e" -dependencies = [ - "darling_core 0.14.2", - "quote 1.0.21", - "syn 1.0.103", -] - -[[package]] -name = "dashmap" -version = "5.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "907076dfda823b0b36d2a1bb5f90c96660a5bbcd7729e10727f07858f22c4edc" -dependencies = [ - "cfg-if 1.0.0", - "hashbrown", - "lock_api", - "once_cell", - "parking_lot_core", -] - -[[package]] -name = "data-encoding" -version = "2.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ee2393c4a91429dffb4bedf19f4d6abf27d8a732c8ce4980305d782e5426d57" - -[[package]] -name = "data-url" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a30bfce702bcfa94e906ef82421f2c0e61c076ad76030c16ee5d2e9a32fe193" -dependencies = [ - "matches", -] - -[[package]] -name = "debug_unreachable" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a032eac705ca39214d169f83e3d3da290af06d8d1d344d1baad2fd002dca4b3" -dependencies = [ - "unreachable", -] - -[[package]] -name = "deno_ast" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2989afff97ba7da10f186e9a45e946b4ef943b9d4babd2ee7b4b24cc9906b69" -dependencies = [ - "anyhow", - "base64 0.13.1", - "data-url", - "dprint-swc-ext", - "serde", - "swc_ecmascript", - "text_lines", - "url", -] - -[[package]] -name = "deno_core" -version = "0.136.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07ced67ffe84c64aee6e84e40558835752b6f12807f84d15da8f5954e2b670c5" -dependencies = [ - "anyhow", - "deno_ops", - "futures", - "indexmap", - "libc", - "log", - "once_cell", - "parking_lot", - "pin-project", - "serde", - "serde_json", - "serde_v8", - "sourcemap", - "url", - "v8", -] - -[[package]] -name = "deno_ops" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05520711837dd592d2861319ea3cf2dfd81e39bb92e41758ee9172f3623daebd" -dependencies = [ - "proc-macro-crate", - "proc-macro2 1.0.47", - "quote 1.0.21", - "syn 1.0.103", -] - -[[package]] -name = "der" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13dd2ae565c0a381dde7fade45fce95984c568bdcb4700a4fdbe3175e0380b2f" -dependencies = [ - "const-oid", - "pem-rfc7468", - "zeroize", -] - -[[package]] -name = "derive_more" -version = "0.99.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" -dependencies = [ - "convert_case", - "proc-macro2 1.0.47", - "quote 1.0.21", - "rustc_version 0.4.0", - "syn 1.0.103", -] - -[[package]] -name = "diff" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" - -[[package]] -name = "digest" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" -dependencies = [ - "generic-array", -] - -[[package]] -name = "digest" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adfbc57365a37acbd2ebf2b64d7e69bb766e2fea813521ed536f5d0520dcf86c" -dependencies = [ - "block-buffer 0.10.3", - "crypto-common", - "subtle", -] - -[[package]] -name = "dirs" -version = "4.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" -dependencies = [ - "dirs-sys", -] - -[[package]] -name = "dirs-next" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" -dependencies = [ - "cfg-if 1.0.0", - "dirs-sys-next", -] - -[[package]] -name = "dirs-sys" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" -dependencies = [ - "libc", - "redox_users", - "winapi", -] - -[[package]] -name = "dirs-sys-next" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" -dependencies = [ - "libc", - "redox_users", - "winapi", -] - -[[package]] -name = "divrem" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69dde51e8fef5e12c1d65e0929b03d66e4c0c18282bc30ed2ca050ad6f44dd82" - -[[package]] -name = "dotenvy" -version = "0.15.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03d8c417d7a8cb362e0c37e5d815f5eb7c37f79ff93707329d5a194e42e54ca0" - -[[package]] -name = "dprint-swc-ext" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3df529037ff02f1c43ae8c6cce54d9ad85546ff89cb5c1988f56130c16e16a48" -dependencies = [ - "bumpalo", - "num-bigint", - "rustc-hash", - "swc_atoms", - "swc_common", - "swc_ecmascript", - "text_lines", -] - -[[package]] -name = "ed25519" -version = "1.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e9c280362032ea4203659fc489832d0204ef09f247a0506f170dafcac08c369" -dependencies = [ - "pkcs8", - "serde", - "signature", -] - -[[package]] -name = "ed25519-dalek" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d" -dependencies = [ - "curve25519-dalek", - "ed25519", - "rand 0.7.3", - "serde", - "serde_bytes", - "sha2 0.9.9", - "zeroize", -] - -[[package]] -name = "either" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" -dependencies = [ - "serde", -] - -[[package]] -name = "embassy-os" -version = "0.3.2-rev.1" -dependencies = [ - "aes", - "async-stream", - "async-trait", - "avahi-sys", - "base32", - "base64 0.13.1", - "base64ct", - "basic-cookies", - "bollard", - "chrono", - "ciborium", - "clap 3.2.23", - "color-eyre", - "cookie_store", - "current_platform", - "digest 0.10.5", - "digest 0.9.0", - "divrem", - "ed25519", - "ed25519-dalek", - "embassy_container_init", - "emver", - "fd-lock-rs", - "futures", - "git-version", - "helpers", - "hex", - "hmac 0.12.1", - "http", - "hyper", - "hyper-ws-listener", - "imbl 2.0.0", - "indexmap", - "isocountry", - "itertools 0.10.5", - "josekit", - "js_engine", - "jsonpath_lib", - "lazy_static", - "libc", - "log", - "models", - "nix 0.25.0", - "nom 7.1.1", - "num", - "num_enum", - "openssh-keys", - "openssl", - "patch-db", - "pbkdf2", - "pin-project", - "pkcs8", - "prettytable-rs", - "proptest", - "proptest-derive", - "rand 0.7.3", - "rand 0.8.5", - "regex", - "reqwest", - "reqwest_cookie_store", - "rpassword", - "rpc-toolkit", - "rust-argon2", - "scopeguard", - "serde", - "serde_json", - "serde_with 2.0.1", - "serde_yaml", - "sha2 0.10.6", - "sha2 0.9.9", - "simple-logging", - "sqlx", - "stderrlog", - "tar", - "thiserror", - "tokio", - "tokio-stream", - "tokio-tar", - "tokio-tungstenite", - "tokio-util", - "toml", - "torut", - "tracing", - "tracing-error 0.2.0", - "tracing-futures", - "tracing-subscriber 0.3.16", - "trust-dns-server", - "typed-builder", - "url", - "uuid", -] - -[[package]] -name = "embassy_container_init" -version = "0.1.0" -dependencies = [ - "async-stream", - "color-eyre", - "futures", - "serde", - "serde_json", - "tokio", - "tokio-stream", - "tracing", - "tracing-error 0.2.0", - "tracing-futures", - "tracing-subscriber 0.3.16", -] - -[[package]] -name = "emver" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed260c4d7efaec031b9c4f6c4d3cf136e3df2bbfe50925800236f5e847f28704" -dependencies = [ - "either", - "fp-core", - "nom 6.1.2", - "serde", -] - -[[package]] -name = "ena" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7402b94a93c24e742487327a7cd839dc9d36fec9de9fb25b09f2dae459f36c3" -dependencies = [ - "log", -] - -[[package]] -name = "encode_unicode" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0" - -[[package]] -name = "encoding_rs" -version = "0.8.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9852635589dc9f9ea1b6fe9f05b50ef208c85c834a562f0c6abb1c475736ec2b" -dependencies = [ - "cfg-if 1.0.0", -] - -[[package]] -name = "endian-type" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" - -[[package]] -name = "enum-as-inner" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9720bba047d567ffc8a3cba48bf19126600e249ab7f128e9233e6376976a116" -dependencies = [ - "heck 0.4.0", - "proc-macro2 1.0.47", - "quote 1.0.21", - "syn 1.0.103", -] - -[[package]] -name = "enum_kind" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b940da354ae81ef0926c5eaa428207b8f4f091d3956c891dfbd124162bed99" -dependencies = [ - "pmutil", - "proc-macro2 1.0.47", - "swc_macros_common", - "syn 1.0.103", -] - -[[package]] -name = "env_logger" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44533bbbb3bb3c1fa17d9f2e4e38bbbaf8396ba82193c4cb1b6445d711445d36" -dependencies = [ - "atty", - "humantime 1.3.0", - "log", - "regex", - "termcolor", -] - -[[package]] -name = "env_logger" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c90bf5f19754d10198ccb95b70664fc925bd1fc090a0fd9a6ebc54acc8cd6272" -dependencies = [ - "atty", - "humantime 2.1.0", - "log", - "regex", - "termcolor", -] - -[[package]] -name = "event-listener" -version = "2.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" - -[[package]] -name = "eyre" -version = "0.6.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c2b6b5a29c02cdc822728b7d7b8ae1bab3e3b05d44522770ddd49722eeac7eb" -dependencies = [ - "indenter", - "once_cell", -] - -[[package]] -name = "fastrand" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a407cfaa3385c4ae6b23e84623d48c2798d06e3e6a1878f7f59f17b3f86499" -dependencies = [ - "instant", -] - -[[package]] -name = "fd-lock-rs" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef0f547e1d79e058664f2ea7d3a6d82b2ddd5fea4a6650b97b70c38979f34db3" -dependencies = [ - "nix 0.24.2", -] - -[[package]] -name = "filetime" -version = "0.2.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b9663d381d07ae25dc88dbdf27df458faa83a9b25336bcac83d5e452b5fc9d3" -dependencies = [ - "cfg-if 1.0.0", - "libc", - "redox_syscall 0.2.16", - "windows-sys 0.42.0", -] - -[[package]] -name = "fixedbitset" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" - -[[package]] -name = "flate2" -version = "1.0.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f82b0f4c27ad9f8bfd1f3208d882da2b09c301bc1c828fd3a00d0216d2fbbff6" -dependencies = [ - "crc32fast", - "miniz_oxide", -] - -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - -[[package]] -name = "form_urlencoded" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" -dependencies = [ - "percent-encoding", -] - -[[package]] -name = "fp-core" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "338a5feb6c7248603dfa3da758da4e99abb65e792a157fe1d657e7c2f5fbcd0b" -dependencies = [ - "itertools 0.8.2", -] - -[[package]] -name = "from_variant" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0981e470d2ab9f643df3921d54f1952ea100c39fdb6a3fdc820e20d2291df6c" -dependencies = [ - "pmutil", - "proc-macro2 1.0.47", - "swc_macros_common", - "syn 1.0.103", -] - -[[package]] -name = "fslock" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57eafdd0c16f57161105ae1b98a1238f97645f2f588438b2949c99a2af9616bf" -dependencies = [ - "libc", - "winapi", -] - -[[package]] -name = "funty" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fed34cd105917e91daa4da6b3728c47b068749d6a62c59811f06ed2ac71d9da7" - -[[package]] -name = "futures" -version = "0.3.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38390104763dc37a5145a53c29c63c1290b5d316d6086ec32c293f6736051bb0" -dependencies = [ - "futures-channel", - "futures-core", - "futures-executor", - "futures-io", - "futures-sink", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-channel" -version = "0.3.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52ba265a92256105f45b719605a571ffe2d1f0fea3807304b522c1d778f79eed" -dependencies = [ - "futures-core", - "futures-sink", -] - -[[package]] -name = "futures-core" -version = "0.3.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04909a7a7e4633ae6c4a9ab280aeb86da1236243a77b694a49eacd659a4bd3ac" - -[[package]] -name = "futures-executor" -version = "0.3.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7acc85df6714c176ab5edf386123fafe217be88c0840ec11f199441134a074e2" -dependencies = [ - "futures-core", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-intrusive" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b6bdbb8c5a42b2bb5ee8dd9dc2c7d73ce3e15d26dfe100fb347ffa3f58c672b" -dependencies = [ - "futures-core", - "lock_api", - "parking_lot", -] - -[[package]] -name = "futures-io" -version = "0.3.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00f5fb52a06bdcadeb54e8d3671f8888a39697dcb0b81b23b55174030427f4eb" - -[[package]] -name = "futures-macro" -version = "0.3.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdfb8ce053d86b91919aad980c220b1fb8401a9394410e1c289ed7e66b61835d" -dependencies = [ - "proc-macro2 1.0.47", - "quote 1.0.21", - "syn 1.0.103", -] - -[[package]] -name = "futures-sink" -version = "0.3.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39c15cf1a4aa79df40f1bb462fb39676d0ad9e366c2a33b590d7c66f4f81fcf9" - -[[package]] -name = "futures-task" -version = "0.3.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ffb393ac5d9a6eaa9d3fdf37ae2776656b706e200c8e16b1bdb227f5198e6ea" - -[[package]] -name = "futures-util" -version = "0.3.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "197676987abd2f9cadff84926f410af1c183608d36641465df73ae8211dc65d6" -dependencies = [ - "futures-channel", - "futures-core", - "futures-io", - "futures-macro", - "futures-sink", - "futures-task", - "memchr", - "pin-project-lite", - "pin-utils", - "slab", -] - -[[package]] -name = "generic-array" -version = "0.14.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" -dependencies = [ - "typenum", - "version_check", -] - -[[package]] -name = "getrandom" -version = "0.1.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" -dependencies = [ - "cfg-if 1.0.0", - "libc", - "wasi 0.9.0+wasi-snapshot-preview1", -] - -[[package]] -name = "getrandom" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" -dependencies = [ - "cfg-if 1.0.0", - "libc", - "wasi 0.11.0+wasi-snapshot-preview1", -] - -[[package]] -name = "gimli" -version = "0.26.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22030e2c5a68ec659fde1e949a745124b48e6fa8b045b7ed5bd1fe4ccc5c4e5d" - -[[package]] -name = "git-version" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6b0decc02f4636b9ccad390dcbe77b722a77efedfa393caf8379a51d5c61899" -dependencies = [ - "git-version-macro", - "proc-macro-hack", -] - -[[package]] -name = "git-version-macro" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe69f1cbdb6e28af2bac214e943b99ce8a0a06b447d15d3e61161b0423139f3f" -dependencies = [ - "proc-macro-hack", - "proc-macro2 1.0.47", - "quote 1.0.21", - "syn 1.0.103", -] - -[[package]] -name = "glob" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" - -[[package]] -name = "h2" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f9f29bc9dda355256b2916cf526ab02ce0aeaaaf2bad60d65ef3f12f11dd0f4" -dependencies = [ - "bytes", - "fnv", - "futures-core", - "futures-sink", - "futures-util", - "http", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "half" -version = "1.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" - -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" -dependencies = [ - "ahash", -] - -[[package]] -name = "hashlink" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69fe1fcf8b4278d860ad0548329f892a3631fb63f82574df68275f34cdbe0ffa" -dependencies = [ - "hashbrown", -] - -[[package]] -name = "heck" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" -dependencies = [ - "unicode-segmentation", -] - -[[package]] -name = "heck" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" -dependencies = [ - "unicode-segmentation", -] - -[[package]] -name = "helpers" -version = "0.1.0" -dependencies = [ - "color-eyre", - "futures", - "models", - "pin-project", - "tokio", -] - -[[package]] -name = "hermit-abi" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hkdf" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "791a029f6b9fc27657f6f188ec6e5e43f6911f6f878e0dc5501396e09809d437" -dependencies = [ - "hmac 0.12.1", -] - -[[package]] -name = "hmac" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a2a2320eb7ec0ebe8da8f744d7812d9fc4cb4d09344ac01898dbcb6a20ae69b" -dependencies = [ - "crypto-mac", - "digest 0.9.0", -] - -[[package]] -name = "hmac" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" -dependencies = [ - "digest 0.10.5", -] - -[[package]] -name = "http" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" -dependencies = [ - "bytes", - "fnv", - "itoa 1.0.4", -] - -[[package]] -name = "http-body" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" -dependencies = [ - "bytes", - "http", - "pin-project-lite", -] - -[[package]] -name = "httparse" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" - -[[package]] -name = "httpdate" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" - -[[package]] -name = "humantime" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df004cfca50ef23c36850aaaa59ad52cc70d0e90243c3c7737a4dd32dc7a3c4f" -dependencies = [ - "quick-error 1.2.3", -] - -[[package]] -name = "humantime" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" - -[[package]] -name = "hyper" -version = "0.14.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02c929dc5c39e335a03c405292728118860721b10190d98c2a0f0efd5baafbac" -dependencies = [ - "bytes", - "futures-channel", - "futures-core", - "futures-util", - "h2", - "http", - "http-body", - "httparse", - "httpdate", - "itoa 1.0.4", - "pin-project-lite", - "socket2", - "tokio", - "tower-service", - "tracing", - "want", -] - -[[package]] -name = "hyper-tls" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" -dependencies = [ - "bytes", - "hyper", - "native-tls", - "tokio", - "tokio-native-tls", -] - -[[package]] -name = "hyper-ws-listener" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3fb761e568fdb34ff794d284bfe1769efc5d16b9d716286451ab3a70ab82bea" -dependencies = [ - "anyhow", - "base64 0.13.1", - "env_logger 0.9.1", - "futures", - "hyper", - "log", - "sha-1", - "tokio", - "tokio-tungstenite", -] - -[[package]] -name = "hyperlocal" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fafdf7b2b2de7c9784f76e02c0935e65a8117ec3b768644379983ab333ac98c" -dependencies = [ - "futures-util", - "hex", - "hyper", - "pin-project", - "tokio", -] - -[[package]] -name = "iana-time-zone" -version = "0.1.51" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5a6ef98976b22b3b7f2f3a806f858cb862044cfa66805aa3ad84cb3d3b785ed" -dependencies = [ - "android_system_properties", - "core-foundation-sys", - "iana-time-zone-haiku", - "js-sys", - "wasm-bindgen", - "winapi", -] - -[[package]] -name = "iana-time-zone-haiku" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0703ae284fc167426161c2e3f1da3ea71d94b21bedbcc9494e92b28e334e3dca" -dependencies = [ - "cxx", - "cxx-build", -] - -[[package]] -name = "ident_case" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" - -[[package]] -name = "idna" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" -dependencies = [ - "matches", - "unicode-bidi", - "unicode-normalization", -] - -[[package]] -name = "idna" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" -dependencies = [ - "unicode-bidi", - "unicode-normalization", -] - -[[package]] -name = "if_chain" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb56e1aa765b4b4f3aadfab769793b7087bb03a4ea4920644a6d238e2df5b9ed" - -[[package]] -name = "imbl" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "543682c9082b25e63d03b5acbd65ad111fd49dd93e70843e5175db4ff81d606b" -dependencies = [ - "bitmaps 2.1.0", - "rand_core 0.6.4", - "rand_xoshiro", - "sized-chunks", - "typenum", - "version_check", -] - -[[package]] -name = "imbl" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2806b69cd9f4664844027b64465eacb444c67c1db9c778e341adff0c25cdb0d" -dependencies = [ - "bitmaps 3.2.0", - "imbl-sized-chunks", - "rand_core 0.6.4", - "rand_xoshiro", - "version_check", -] - -[[package]] -name = "imbl-sized-chunks" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6957ea0b2541c5ca561d3ef4538044af79f8a05a1eb3a3b148936aaceaa1076" -dependencies = [ - "bitmaps 3.2.0", -] - -[[package]] -name = "indenter" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" - -[[package]] -name = "indexmap" -version = "1.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e" -dependencies = [ - "autocfg", - "hashbrown", - "serde", -] - -[[package]] -name = "instant" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" -dependencies = [ - "cfg-if 1.0.0", -] - -[[package]] -name = "ipnet" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "879d54834c8c76457ef4293a689b2a8c59b076067ad77b15efafbb05f92a592b" - -[[package]] -name = "is-macro" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c068d4c6b922cd6284c609cfa6dec0e41615c9c5a1a4ba729a970d8daba05fb" -dependencies = [ - "Inflector", - "pmutil", - "proc-macro2 1.0.47", - "quote 1.0.21", - "syn 1.0.103", -] - -[[package]] -name = "isocountry" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ea1dc4bf0fb4904ba83ffdb98af3d9c325274e92e6e295e4151e86c96363e04" -dependencies = [ - "serde", - "thiserror", -] - -[[package]] -name = "itertools" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f56a2d0bc861f9165be4eb3442afd3c236d8a98afd426f65d92324ae1091a484" -dependencies = [ - "either", -] - -[[package]] -name = "itertools" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] - -[[package]] -name = "itoa" -version = "0.4.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" - -[[package]] -name = "itoa" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4217ad341ebadf8d8e724e264f13e593e0648f5b3e94b3896a5df283be015ecc" - -[[package]] -name = "josekit" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dee6af62ad98bdf699ad2ecc8323479a1fdc7aa5faa6043d93119d83f6c5fca8" -dependencies = [ - "anyhow", - "base64 0.13.1", - "flate2", - "once_cell", - "openssl", - "regex", - "serde", - "serde_json", - "thiserror", - "time 0.3.16", -] - -[[package]] -name = "js-sys" -version = "0.3.60" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49409df3e3bf0856b916e2ceaca09ee28e6871cf7d9ce97a692cacfdb2a25a47" -dependencies = [ - "wasm-bindgen", -] - -[[package]] -name = "js_engine" -version = "0.1.0" -dependencies = [ - "async-trait", - "dashmap", - "deno_ast", - "deno_core", - "dprint-swc-ext", - "embassy_container_init", - "helpers", - "models", - "reqwest", - "serde", - "serde_json", - "sha2 0.10.6", - "swc_atoms", - "swc_common", - "swc_config", - "swc_config_macro", - "swc_ecma_ast", - "swc_ecma_codegen", - "swc_ecma_codegen_macros", - "swc_ecma_parser", - "swc_ecma_transforms", - "swc_ecma_transforms_base", - "swc_ecma_transforms_classes", - "swc_ecma_transforms_macros", - "swc_ecma_transforms_proposal", - "swc_ecma_transforms_react", - "swc_ecma_transforms_typescript", - "swc_ecma_utils", - "swc_ecma_visit", - "swc_ecmascript", - "swc_eq_ignore_macros", - "swc_macros_common", - "swc_visit", - "swc_visit_macros", - "tokio", - "tracing", -] - -[[package]] -name = "json-patch" -version = "0.2.7-alpha.0" -dependencies = [ - "json-ptr", - "rand 0.7.3", - "serde", - "serde_json", - "treediff", -] - -[[package]] -name = "json-ptr" -version = "0.1.0" -dependencies = [ - "serde", - "serde_json", - "thiserror", -] - -[[package]] -name = "jsonpath_lib" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaa63191d68230cccb81c5aa23abd53ed64d83337cacbb25a7b8c7979523774f" -dependencies = [ - "log", - "serde", - "serde_json", -] - -[[package]] -name = "keccak" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9b7d56ba4a8344d6be9729995e6b06f928af29998cdf79fe390cbf6b1fee838" - -[[package]] -name = "lalrpop" -version = "0.19.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b30455341b0e18f276fa64540aff54deafb54c589de6aca68659c63dd2d5d823" -dependencies = [ - "ascii-canvas", - "atty", - "bit-set", - "diff", - "ena", - "itertools 0.10.5", - "lalrpop-util", - "petgraph", - "pico-args", - "regex", - "regex-syntax", - "string_cache", - "term", - "tiny-keccak", - "unicode-xid 0.2.4", -] - -[[package]] -name = "lalrpop-util" -version = "0.19.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcf796c978e9b4d983414f4caedc9273aa33ee214c5b887bd55fde84c85d2dc4" -dependencies = [ - "regex", -] - -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - -[[package]] -name = "lazycell" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" - -[[package]] -name = "lexical" -version = "6.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7aefb36fd43fef7003334742cbf77b243fcd36418a1d1bdd480d613a67968f6" -dependencies = [ - "lexical-core 0.8.5", -] - -[[package]] -name = "lexical-core" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6607c62aa161d23d17a9072cc5da0be67cdfc89d3afb1e8d9c842bebc2525ffe" -dependencies = [ - "arrayvec 0.5.2", - "bitflags", - "cfg-if 1.0.0", - "ryu", - "static_assertions", -] - -[[package]] -name = "lexical-core" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cde5de06e8d4c2faabc400238f9ae1c74d5412d03a7bd067645ccbc47070e46" -dependencies = [ - "lexical-parse-float", - "lexical-parse-integer", - "lexical-util", - "lexical-write-float", - "lexical-write-integer", -] - -[[package]] -name = "lexical-parse-float" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "683b3a5ebd0130b8fb52ba0bdc718cc56815b6a097e28ae5a6997d0ad17dc05f" -dependencies = [ - "lexical-parse-integer", - "lexical-util", - "static_assertions", -] - -[[package]] -name = "lexical-parse-integer" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d0994485ed0c312f6d965766754ea177d07f9c00c9b82a5ee62ed5b47945ee9" -dependencies = [ - "lexical-util", - "static_assertions", -] - -[[package]] -name = "lexical-util" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5255b9ff16ff898710eb9eb63cb39248ea8a5bb036bea8085b1a767ff6c4e3fc" -dependencies = [ - "static_assertions", -] - -[[package]] -name = "lexical-write-float" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accabaa1c4581f05a3923d1b4cfd124c329352288b7b9da09e766b0668116862" -dependencies = [ - "lexical-util", - "lexical-write-integer", - "static_assertions", -] - -[[package]] -name = "lexical-write-integer" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1b6f3d1f4422866b68192d62f77bc5c700bee84f3069f2469d7bc8c77852446" -dependencies = [ - "lexical-util", - "static_assertions", -] - -[[package]] -name = "libc" -version = "0.2.137" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc7fcc620a3bff7cdd7a365be3376c97191aeaccc2a603e600951e452615bf89" - -[[package]] -name = "libloading" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efbc0f03f9a775e9f6aed295c6a1ba2253c5757a9e03d55c6caa46a681abcddd" -dependencies = [ - "cfg-if 1.0.0", - "winapi", -] - -[[package]] -name = "link-cplusplus" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9272ab7b96c9046fbc5bc56c06c117cb639fe2d509df0c421cad82d2915cf369" -dependencies = [ - "cc", -] - -[[package]] -name = "lock_api" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "log" -version = "0.4.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" -dependencies = [ - "cfg-if 1.0.0", -] - -[[package]] -name = "matchers" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" -dependencies = [ - "regex-automata", -] - -[[package]] -name = "matches" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" - -[[package]] -name = "md-5" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5a279bb9607f9f53c22d496eade00d138d1bdcccd07d74650387cf94942a15" -dependencies = [ - "block-buffer 0.9.0", - "digest 0.9.0", - "opaque-debug", -] - -[[package]] -name = "md-5" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6365506850d44bff6e2fbcb5176cf63650e48bd45ef2fe2665ae1570e0f4b9ca" -dependencies = [ - "digest 0.10.5", -] - -[[package]] -name = "memchr" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" - -[[package]] -name = "memoffset" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" -dependencies = [ - "autocfg", -] - -[[package]] -name = "mime" -version = "0.3.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" - -[[package]] -name = "minimal-lexical" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" - -[[package]] -name = "miniz_oxide" -version = "0.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96590ba8f175222643a85693f33d26e9c8a015f599c216509b1a6894af675d34" -dependencies = [ - "adler", -] - -[[package]] -name = "mio" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5d732bc30207a6423068df043e3d02e0735b155ad7ce1a6f76fe2baa5b158de" -dependencies = [ - "libc", - "log", - "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys 0.42.0", -] - -[[package]] -name = "models" -version = "0.1.0" -dependencies = [ - "embassy_container_init", - "emver", - "patch-db", - "rand 0.8.5", - "serde", - "thiserror", - "tokio", -] - -[[package]] -name = "native-tls" -version = "0.2.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd7e2f3618557f980e0b17e8856252eee3c97fa12c54dff0ca290fb6266ca4a9" -dependencies = [ - "lazy_static", - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - -[[package]] -name = "new_debug_unreachable" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54" - -[[package]] -name = "nibble_vec" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" -dependencies = [ - "smallvec", -] - -[[package]] -name = "nix" -version = "0.23.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f866317acbd3a240710c63f065ffb1e4fd466259045ccb504130b7f668f35c6" -dependencies = [ - "bitflags", - "cc", - "cfg-if 1.0.0", - "libc", - "memoffset", -] - -[[package]] -name = "nix" -version = "0.24.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "195cdbc1741b8134346d515b3a56a1c94b0912758009cfd53f99ea0f57b065fc" -dependencies = [ - "bitflags", - "cfg-if 1.0.0", - "libc", - "memoffset", -] - -[[package]] -name = "nix" -version = "0.25.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e322c04a9e3440c327fca7b6c8a63e6890a32fa2ad689db972425f07e0d22abb" -dependencies = [ - "autocfg", - "bitflags", - "cfg-if 1.0.0", - "libc", - "memoffset", - "pin-utils", -] - -[[package]] -name = "nom" -version = "5.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffb4262d26ed83a1c0a33a38fe2bb15797329c85770da05e6b828ddb782627af" -dependencies = [ - "memchr", - "version_check", -] - -[[package]] -name = "nom" -version = "6.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7413f999671bd4745a7b624bd370a569fb6bc574b23c83a3c5ed2e453f3d5e2" -dependencies = [ - "bitvec", - "funty", - "lexical-core 0.7.6", - "memchr", - "version_check", -] - -[[package]] -name = "nom" -version = "7.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8903e5a29a317527874d0402f867152a3d21c908bb0b933e416c65e301d4c36" -dependencies = [ - "memchr", - "minimal-lexical", -] - -[[package]] -name = "nu-ansi-term" -version = "0.46.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" -dependencies = [ - "overload", - "winapi", -] - -[[package]] -name = "num" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43db66d1170d347f9a065114077f7dccb00c1b9478c89384490a3425279a4606" -dependencies = [ - "num-bigint", - "num-complex", - "num-integer", - "num-iter", - "num-rational", - "num-traits", -] - -[[package]] -name = "num-bigint" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", - "serde", -] - -[[package]] -name = "num-complex" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ae39348c8bc5fbd7f40c727a9925f03517afd2ab27d46702108b6a7e5414c19" -dependencies = [ - "num-traits", -] - -[[package]] -name = "num-integer" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" -dependencies = [ - "autocfg", - "num-traits", -] - -[[package]] -name = "num-iter" -version = "0.1.43" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d03e6c028c5dc5cac6e2dec0efda81fc887605bb3d884578bb6d6bf7514e252" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-rational" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" -dependencies = [ - "autocfg", - "num-bigint", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-traits" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" -dependencies = [ - "autocfg", -] - -[[package]] -name = "num_cpus" -version = "1.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" -dependencies = [ - "hermit-abi", - "libc", -] - -[[package]] -name = "num_enum" -version = "0.5.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf5395665662ef45796a4ff5486c5d41d29e0c09640af4c5f17fd94ee2c119c9" -dependencies = [ - "num_enum_derive", -] - -[[package]] -name = "num_enum_derive" -version = "0.5.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b0498641e53dd6ac1a4f22547548caa6864cc4933784319cd1775271c5a46ce" -dependencies = [ - "proc-macro-crate", - "proc-macro2 1.0.47", - "quote 1.0.21", - "syn 1.0.103", -] - -[[package]] -name = "num_threads" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2819ce041d2ee131036f4fc9d6ae7ae125a3a40e97ba64d04fe799ad9dabbb44" -dependencies = [ - "libc", -] - -[[package]] -name = "object" -version = "0.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21158b2c33aa6d4561f1c0a6ea283ca92bc54802a93b263e910746d679a7eb53" -dependencies = [ - "memchr", -] - -[[package]] -name = "once_cell" -version = "1.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e82dad04139b71a90c080c8463fe0dc7902db5192d939bd0950f074d014339e1" - -[[package]] -name = "opaque-debug" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" - -[[package]] -name = "openssh-keys" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7249a699cdeea261ac73f1bf9350777cb867324f44373aafb5a287365bf1771" -dependencies = [ - "base64 0.13.1", - "byteorder", - "md-5 0.9.1", - "sha2 0.9.9", - "thiserror", -] - -[[package]] -name = "openssl" -version = "0.10.42" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12fc0523e3bd51a692c8850d075d74dc062ccf251c0110668cbd921917118a13" -dependencies = [ - "bitflags", - "cfg-if 1.0.0", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c" -dependencies = [ - "proc-macro2 1.0.47", - "quote 1.0.21", - "syn 1.0.103", -] - -[[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - -[[package]] -name = "openssl-src" -version = "111.22.0+1.1.1q" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f31f0d509d1c1ae9cada2f9539ff8f37933831fd5098879e482aa687d659853" -dependencies = [ - "cc", -] - -[[package]] -name = "openssl-sys" -version = "0.9.77" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b03b84c3b2d099b81f0953422b4d4ad58761589d0229b5506356afca05a3670a" -dependencies = [ - "autocfg", - "cc", - "libc", - "openssl-src", - "pkg-config", - "vcpkg", -] - -[[package]] -name = "os_str_bytes" -version = "6.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ff7415e9ae3fff1225851df9e0d9e4e5479f947619774677a63572e55e80eff" - -[[package]] -name = "overload" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" - -[[package]] -name = "owo-colors" -version = "3.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" - -[[package]] -name = "parking_lot" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" -dependencies = [ - "lock_api", - "parking_lot_core", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dc9e0dc2adc1c69d09143aff38d3d30c5c3f0df0dad82e6d25547af174ebec0" -dependencies = [ - "cfg-if 1.0.0", - "libc", - "redox_syscall 0.2.16", - "smallvec", - "windows-sys 0.42.0", -] - -[[package]] -name = "password-hash" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7676374caaee8a325c9e7a2ae557f216c5563a171d6997b0ef8a65af35147700" -dependencies = [ - "base64ct", - "rand_core 0.6.4", - "subtle", -] - -[[package]] -name = "paste" -version = "1.0.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1de2e551fb905ac83f73f7aedf2f0cb4a0da7e35efa24a202a936269f1f18e1" - -[[package]] -name = "patch-db" -version = "0.1.0" -dependencies = [ - "async-trait", - "fd-lock-rs", - "futures", - "imbl 1.0.1", - "json-patch", - "json-ptr", - "lazy_static", - "nix 0.23.1", - "patch-db-macro", - "proptest", - "rand 0.8.5", - "serde", - "serde_cbor 0.11.1", - "serde_json", - "thiserror", - "tokio", - "tracing", - "tracing-error 0.1.2", -] - -[[package]] -name = "patch-db-macro" -version = "0.1.0" -dependencies = [ - "patch-db-macro-internals", - "proc-macro2 1.0.47", - "syn 1.0.103", -] - -[[package]] -name = "patch-db-macro-internals" -version = "0.1.0" -dependencies = [ - "heck 0.3.3", - "proc-macro2 1.0.47", - "quote 1.0.21", - "syn 1.0.103", -] - -[[package]] -name = "patch-db-util" -version = "0.1.0" -dependencies = [ - "clap 3.2.23", - "patch-db", - "serde_json", - "tokio", -] - -[[package]] -name = "pbkdf2" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" -dependencies = [ - "digest 0.10.5", - "hmac 0.12.1", - "password-hash", - "sha2 0.10.6", -] - -[[package]] -name = "peeking_take_while" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" - -[[package]] -name = "pem-rfc7468" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d159833a9105500e0398934e205e0773f0b27529557134ecfc51c27646adac" -dependencies = [ - "base64ct", -] - -[[package]] -name = "percent-encoding" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" - -[[package]] -name = "petgraph" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6d5014253a1331579ce62aa67443b4a658c5e7dd03d4bc6d302b94474888143" -dependencies = [ - "fixedbitset", - "indexmap", -] - -[[package]] -name = "phf" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fabbf1ead8a5bcbc20f5f8b939ee3f5b0f6f281b6ad3468b84656b658b455259" -dependencies = [ - "phf_macros", - "phf_shared", - "proc-macro-hack", -] - -[[package]] -name = "phf_generator" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d5285893bb5eb82e6aaf5d59ee909a06a16737a8970984dd7746ba9283498d6" -dependencies = [ - "phf_shared", - "rand 0.8.5", -] - -[[package]] -name = "phf_macros" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58fdf3184dd560f160dd73922bea2d5cd6e8f064bf4b13110abd81b03697b4e0" -dependencies = [ - "phf_generator", - "phf_shared", - "proc-macro-hack", - "proc-macro2 1.0.47", - "quote 1.0.21", - "syn 1.0.103", -] - -[[package]] -name = "phf_shared" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6796ad771acdc0123d2a88dc428b5e38ef24456743ddb1744ed628f9815c096" -dependencies = [ - "siphasher", -] - -[[package]] -name = "pico-args" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db8bcd96cb740d03149cbad5518db9fd87126a10ab519c011893b1754134c468" - -[[package]] -name = "pin-project" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad29a609b6bcd67fee905812e544992d216af9d755757c05ed2d0e15a74c6ecc" -dependencies = [ - "pin-project-internal", -] - -[[package]] -name = "pin-project-internal" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" -dependencies = [ - "proc-macro2 1.0.47", - "quote 1.0.21", - "syn 1.0.103", -] - -[[package]] -name = "pin-project-lite" -version = "0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" - -[[package]] -name = "pin-utils" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" - -[[package]] -name = "pkcs8" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9eca2c590a5f85da82668fa685c09ce2888b9430e83299debf1f34b65fd4a4ba" -dependencies = [ - "der", - "spki", -] - -[[package]] -name = "pkg-config" -version = "0.3.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" - -[[package]] -name = "pmutil" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3894e5d549cccbe44afecf72922f277f603cd4bb0219c8342631ef18fffbe004" -dependencies = [ - "proc-macro2 1.0.47", - "quote 1.0.21", - "syn 1.0.103", -] - -[[package]] -name = "ppv-lite86" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" - -[[package]] -name = "precomputed-hash" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" - -[[package]] -name = "prettytable-rs" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f375cb74c23b51d23937ffdeb48b1fbf5b6409d4b9979c1418c1de58bc8f801" -dependencies = [ - "atty", - "csv", - "encode_unicode", - "lazy_static", - "term", - "unicode-width", -] - -[[package]] -name = "proc-macro-crate" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eda0fc3b0fb7c975631757e14d9049da17374063edb6ebbcbc54d880d4fe94e9" -dependencies = [ - "once_cell", - "thiserror", - "toml", -] - -[[package]] -name = "proc-macro-hack" -version = "0.5.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" - -[[package]] -name = "proc-macro2" -version = "0.4.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" -dependencies = [ - "unicode-xid 0.1.0", -] - -[[package]] -name = "proc-macro2" -version = "1.0.47" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ea3d908b0e36316caf9e9e2c4625cdde190a7e6f440d794667ed17a1855e725" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "proptest" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e0d9cc07f18492d879586c92b485def06bc850da3118075cd45d50e9c95b0e5" -dependencies = [ - "bit-set", - "bitflags", - "byteorder", - "lazy_static", - "num-traits", - "quick-error 2.0.1", - "rand 0.8.5", - "rand_chacha 0.3.1", - "rand_xorshift", - "regex-syntax", - "rusty-fork", - "tempfile", -] - -[[package]] -name = "proptest-derive" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90b46295382dc76166cb7cf2bb4a97952464e4b7ed5a43e6cd34e1fec3349ddc" -dependencies = [ - "proc-macro2 0.4.30", - "quote 0.6.13", - "syn 0.15.44", -] - -[[package]] -name = "psl-types" -version = "2.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33cb294fe86a74cbcf50d4445b37da762029549ebeea341421c7c70370f86cac" - -[[package]] -name = "publicsuffix" -version = "2.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96a8c1bda5ae1af7f99a2962e49df150414a43d62404644d98dd5c3a93d07457" -dependencies = [ - "idna 0.3.0", - "psl-types", -] - -[[package]] -name = "quick-error" -version = "1.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" - -[[package]] -name = "quick-error" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3" - -[[package]] -name = "quote" -version = "0.6.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" -dependencies = [ - "proc-macro2 0.4.30", -] - -[[package]] -name = "quote" -version = "1.0.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" -dependencies = [ - "proc-macro2 1.0.47", -] - -[[package]] -name = "radium" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "941ba9d78d8e2f7ce474c015eea4d9c6d25b6a3327f9832ee29a4de27f91bbb8" - -[[package]] -name = "radix_trie" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" -dependencies = [ - "endian-type", - "nibble_vec", -] - -[[package]] -name = "rand" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" -dependencies = [ - "getrandom 0.1.16", - "libc", - "rand_chacha 0.2.2", - "rand_core 0.5.1", - "rand_hc", -] - -[[package]] -name = "rand" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" -dependencies = [ - "libc", - "rand_chacha 0.3.1", - "rand_core 0.6.4", -] - -[[package]] -name = "rand_chacha" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" -dependencies = [ - "ppv-lite86", - "rand_core 0.5.1", -] - -[[package]] -name = "rand_chacha" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -dependencies = [ - "ppv-lite86", - "rand_core 0.6.4", -] - -[[package]] -name = "rand_core" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" -dependencies = [ - "getrandom 0.1.16", -] - -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" -dependencies = [ - "getrandom 0.2.8", -] - -[[package]] -name = "rand_hc" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" -dependencies = [ - "rand_core 0.5.1", -] - -[[package]] -name = "rand_xorshift" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d25bf25ec5ae4a3f1b92f929810509a2f53d7dca2f50b794ff57e3face536c8f" -dependencies = [ - "rand_core 0.6.4", -] - -[[package]] -name = "rand_xoshiro" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f97cdb2a36ed4183de61b2f824cc45c9f1037f28afe0a322e9fff4c108b5aaa" -dependencies = [ - "rand_core 0.6.4", -] - -[[package]] -name = "redox_syscall" -version = "0.1.57" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" - -[[package]] -name = "redox_syscall" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" -dependencies = [ - "bitflags", -] - -[[package]] -name = "redox_users" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" -dependencies = [ - "getrandom 0.2.8", - "redox_syscall 0.2.16", - "thiserror", -] - -[[package]] -name = "regex" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c4eb3267174b8c6c2f654116623910a0fef09c4753f8dd83db29c48a0df988b" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" -dependencies = [ - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.6.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" - -[[package]] -name = "remove_dir_all" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" -dependencies = [ - "winapi", -] - -[[package]] -name = "reqwest" -version = "0.11.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "431949c384f4e2ae07605ccaa56d1d9d2ecdb5cadd4f9577ccfab29f2e5149fc" -dependencies = [ - "base64 0.13.1", - "bytes", - "cookie", - "cookie_store", - "encoding_rs", - "futures-core", - "futures-util", - "h2", - "http", - "http-body", - "hyper", - "hyper-tls", - "ipnet", - "js-sys", - "log", - "mime", - "native-tls", - "once_cell", - "percent-encoding", - "pin-project-lite", - "proc-macro-hack", - "serde", - "serde_json", - "serde_urlencoded", - "tokio", - "tokio-native-tls", - "tokio-socks", - "tokio-util", - "tower-service", - "url", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", - "winreg", -] - -[[package]] -name = "reqwest_cookie_store" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0568e27f107b933735a07b3f8cb985ecfe3d3ce2f2225f82f10b3750f5981263" -dependencies = [ - "bytes", - "cookie", - "cookie_store", - "reqwest", - "url", -] - -[[package]] -name = "ring" -version = "0.16.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" -dependencies = [ - "cc", - "libc", - "once_cell", - "spin", - "untrusted", - "web-sys", - "winapi", -] - -[[package]] -name = "rpassword" -version = "7.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20c9f5d2a0c3e2ea729ab3706d22217177770654c3ef5056b68b69d07332d3f5" -dependencies = [ - "libc", - "winapi", -] - -[[package]] -name = "rpc-toolkit" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5353673ffd8265292281141560d2b851e4da49e83e2f5e255fd473736d45ee10" -dependencies = [ - "clap 3.2.23", - "futures", - "hyper", - "lazy_static", - "openssl", - "reqwest", - "rpc-toolkit-macro", - "serde", - "serde_cbor 0.11.2", - "serde_json", - "thiserror", - "tokio", - "url", - "yajrc", -] - -[[package]] -name = "rpc-toolkit-macro" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8e4b9cb00baf2d61bcd35e98d67dcb760382a3b4540df7e63b38d053c8a7b8b" -dependencies = [ - "proc-macro2 1.0.47", - "rpc-toolkit-macro-internals", - "syn 1.0.103", -] - -[[package]] -name = "rpc-toolkit-macro-internals" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3e2ce21b936feaecdab9c9a8e75b9dca64374ccc11951a58045ad6559b75f42" -dependencies = [ - "proc-macro2 1.0.47", - "quote 1.0.21", - "syn 1.0.103", -] - -[[package]] -name = "rust-argon2" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b50162d19404029c1ceca6f6980fe40d45c8b369f6f44446fa14bb39573b5bb9" -dependencies = [ - "base64 0.13.1", - "blake2b_simd", - "constant_time_eq", - "crossbeam-utils", -] - -[[package]] -name = "rustc-demangle" -version = "0.1.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" - -[[package]] -name = "rustc-hash" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" - -[[package]] -name = "rustc_version" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" -dependencies = [ - "semver 0.9.0", -] - -[[package]] -name = "rustc_version" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" -dependencies = [ - "semver 1.0.14", -] - -[[package]] -name = "rustls" -version = "0.20.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "539a2bfe908f471bfa933876bd1eb6a19cf2176d375f82ef7f99530a40e48c2c" -dependencies = [ - "log", - "ring", - "sct", - "webpki", -] - -[[package]] -name = "rustls-pemfile" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0864aeff53f8c05aa08d86e5ef839d3dfcf07aeba2db32f12db0ef716e87bd55" -dependencies = [ - "base64 0.13.1", -] - -[[package]] -name = "rustversion" -version = "1.0.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97477e48b4cf8603ad5f7aaf897467cf42ab4218a38ef76fb14c2d6773a6d6a8" - -[[package]] -name = "rusty-fork" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb3dcc6e454c328bb824492db107ab7c0ae8fcffe4ad210136ef014458c1bc4f" -dependencies = [ - "fnv", - "quick-error 1.2.3", - "tempfile", - "wait-timeout", -] - -[[package]] -name = "ryu" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" - -[[package]] -name = "schannel" -version = "0.1.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88d6731146462ea25d9244b2ed5fd1d716d25c52e4d54aa4fb0f3c4e9854dbe2" -dependencies = [ - "lazy_static", - "windows-sys 0.36.1", -] - -[[package]] -name = "scoped-tls" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea6a9290e3c9cf0f18145ef7ffa62d68ee0bf5fcd651017e586dc7fd5da448c2" - -[[package]] -name = "scopeguard" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" - -[[package]] -name = "scratch" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8132065adcfd6e02db789d9285a0deb2f3fcb04002865ab67d5fb103533898" - -[[package]] -name = "sct" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" -dependencies = [ - "ring", - "untrusted", -] - -[[package]] -name = "security-framework" -version = "2.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bc1bb97804af6631813c55739f771071e0f2ed33ee20b68c86ec505d906356c" -dependencies = [ - "bitflags", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0160a13a177a45bfb43ce71c01580998474f556ad854dcbca936dd2841a5c556" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "semver" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" -dependencies = [ - "semver-parser", -] - -[[package]] -name = "semver" -version = "1.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e25dfac463d778e353db5be2449d1cce89bd6fd23c9f1ea21310ce6e5a1b29c4" - -[[package]] -name = "semver-parser" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" - -[[package]] -name = "serde" -version = "1.0.147" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d193d69bae983fc11a79df82342761dfbf28a99fc8d203dca4c3c1b590948965" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_bytes" -version = "0.11.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfc50e8183eeeb6178dcb167ae34a8051d63535023ae38b5d8d12beae193d37b" -dependencies = [ - "serde", -] - -[[package]] -name = "serde_cbor" -version = "0.11.1" -dependencies = [ - "half", - "serde", - "serde_derive", -] - -[[package]] -name = "serde_cbor" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bef2ebfde456fb76bbcf9f59315333decc4fda0b2b44b420243c11e0f5ec1f5" -dependencies = [ - "half", - "serde", -] - -[[package]] -name = "serde_derive" -version = "1.0.147" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f1d362ca8fc9c3e3a7484440752472d68a6caa98f1ab81d99b5dfe517cec852" -dependencies = [ - "proc-macro2 1.0.47", - "quote 1.0.21", - "syn 1.0.103", -] - -[[package]] -name = "serde_json" -version = "1.0.87" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ce777b7b150d76b9cf60d28b55f5847135a003f7d7350c6be7a773508ce7d45" -dependencies = [ - "indexmap", - "itoa 1.0.4", - "ryu", - "serde", -] - -[[package]] -name = "serde_urlencoded" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" -dependencies = [ - "form_urlencoded", - "itoa 1.0.4", - "ryu", - "serde", -] - -[[package]] -name = "serde_v8" -version = "0.47.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ca1daa2506c9d62744fff84d3534192f2e1c70cdf3bed95f298d89156c00b06" -dependencies = [ - "bytes", - "derive_more", - "serde", - "v8", -] - -[[package]] -name = "serde_with" -version = "1.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "678b5a069e50bf00ecd22d0cd8ddf7c236f68581b03db652061ed5eb13a312ff" -dependencies = [ - "serde", - "serde_with_macros 1.5.2", -] - -[[package]] -name = "serde_with" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "368f2d60d049ea019a84dcd6687b0d1e0030fe663ae105039bdf967ed5e6a9a7" -dependencies = [ - "base64 0.13.1", - "chrono", - "hex", - "indexmap", - "serde", - "serde_json", - "serde_with_macros 2.0.1", - "time 0.3.16", -] - -[[package]] -name = "serde_with_macros" -version = "1.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e182d6ec6f05393cc0e5ed1bf81ad6db3a8feedf8ee515ecdd369809bcce8082" -dependencies = [ - "darling 0.13.4", - "proc-macro2 1.0.47", - "quote 1.0.21", - "syn 1.0.103", -] - -[[package]] -name = "serde_with_macros" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ccadfacf6cf10faad22bbadf55986bdd0856edfb5d9210aa1dcf1f516e84e93" -dependencies = [ - "darling 0.14.2", - "proc-macro2 1.0.47", - "quote 1.0.21", - "syn 1.0.103", -] - -[[package]] -name = "serde_yaml" -version = "0.9.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d232d893b10de3eb7258ff01974d6ee20663d8e833263c99409d4b13a0209da" -dependencies = [ - "indexmap", - "itoa 1.0.4", - "ryu", - "serde", - "unsafe-libyaml", -] - -[[package]] -name = "sha-1" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "028f48d513f9678cda28f6e4064755b3fbb2af6acd672f2c209b62323f7aea0f" -dependencies = [ - "cfg-if 1.0.0", - "cpufeatures", - "digest 0.10.5", -] - -[[package]] -name = "sha1" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" -dependencies = [ - "cfg-if 1.0.0", - "cpufeatures", - "digest 0.10.5", -] - -[[package]] -name = "sha2" -version = "0.9.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" -dependencies = [ - "block-buffer 0.9.0", - "cfg-if 1.0.0", - "cpufeatures", - "digest 0.9.0", - "opaque-debug", -] - -[[package]] -name = "sha2" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" -dependencies = [ - "cfg-if 1.0.0", - "cpufeatures", - "digest 0.10.5", -] - -[[package]] -name = "sha3" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f81199417d4e5de3f04b1e871023acea7389672c4135918f05aa9cbf2f2fa809" -dependencies = [ - "block-buffer 0.9.0", - "digest 0.9.0", - "keccak", - "opaque-debug", -] - -[[package]] -name = "sharded-slab" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" -dependencies = [ - "lazy_static", -] - -[[package]] -name = "shlex" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fdf1b9db47230893d76faad238fd6097fd6d6a9245cd7a4d90dbd639536bbd2" - -[[package]] -name = "signal-hook-registry" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" -dependencies = [ - "libc", -] - -[[package]] -name = "signature" -version = "1.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" - -[[package]] -name = "simple-logging" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b00d48e85675326bb182a2286ea7c1a0b264333ae10f27a937a72be08628b542" -dependencies = [ - "lazy_static", - "log", - "thread-id", -] - -[[package]] -name = "siphasher" -version = "0.3.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de" - -[[package]] -name = "sized-chunks" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16d69225bde7a69b235da73377861095455d298f2b970996eec25ddbb42b3d1e" -dependencies = [ - "bitmaps 2.1.0", - "typenum", -] - -[[package]] -name = "slab" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" -dependencies = [ - "autocfg", -] - -[[package]] -name = "smallvec" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" - -[[package]] -name = "snapshot-creator" -version = "0.1.0" -dependencies = [ - "dashmap", - "deno_ast", - "deno_core", -] - -[[package]] -name = "socket2" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd" -dependencies = [ - "libc", - "winapi", -] - -[[package]] -name = "sourcemap" -version = "6.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e031f2463ecbdd5f34c950f89f5c1e1032f22c0f8e3dc4bdb2e8b6658cf61eb" -dependencies = [ - "base64 0.11.0", - "if_chain", - "lazy_static", - "regex", - "rustc_version 0.2.3", - "serde", - "serde_json", - "url", -] - -[[package]] -name = "spin" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" - -[[package]] -name = "spki" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67cf02bbac7a337dc36e4f5a693db6c21e7863f45070f7064577eb4367a3212b" -dependencies = [ - "base64ct", - "der", -] - -[[package]] -name = "sqlformat" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f87e292b4291f154971a43c3774364e2cbcaec599d3f5bf6fa9d122885dbc38a" -dependencies = [ - "itertools 0.10.5", - "nom 7.1.1", - "unicode_categories", -] - -[[package]] -name = "sqlx" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9249290c05928352f71c077cc44a464d880c63f26f7534728cca008e135c0428" -dependencies = [ - "sqlx-core", - "sqlx-macros", -] - -[[package]] -name = "sqlx-core" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcbc16ddba161afc99e14d1713a453747a2b07fc097d2009f4c300ec99286105" -dependencies = [ - "ahash", - "atoi", - "base64 0.13.1", - "bitflags", - "byteorder", - "bytes", - "chrono", - "crc", - "crossbeam-queue", - "dirs", - "dotenvy", - "either", - "event-listener", - "futures-channel", - "futures-core", - "futures-intrusive", - "futures-util", - "hashlink", - "hex", - "hkdf", - "hmac 0.12.1", - "indexmap", - "itoa 1.0.4", - "libc", - "log", - "md-5 0.10.5", - "memchr", - "once_cell", - "paste", - "percent-encoding", - "rand 0.8.5", - "rustls", - "rustls-pemfile", - "serde", - "serde_json", - "sha1", - "sha2 0.10.6", - "smallvec", - "sqlformat", - "sqlx-rt", - "stringprep", - "thiserror", - "tokio-stream", - "url", - "webpki-roots", - "whoami", -] - -[[package]] -name = "sqlx-macros" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b850fa514dc11f2ee85be9d055c512aa866746adfacd1cb42d867d68e6a5b0d9" -dependencies = [ - "dotenvy", - "either", - "heck 0.4.0", - "hex", - "once_cell", - "proc-macro2 1.0.47", - "quote 1.0.21", - "serde", - "serde_json", - "sha2 0.10.6", - "sqlx-core", - "sqlx-rt", - "syn 1.0.103", - "url", -] - -[[package]] -name = "sqlx-rt" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24c5b2d25fa654cc5f841750b8e1cdedbe21189bf9a9382ee90bfa9dd3562396" -dependencies = [ - "once_cell", - "tokio", - "tokio-rustls", -] - -[[package]] -name = "static_assertions" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" - -[[package]] -name = "stderrlog" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af95cb8a5f79db5b2af2a46f44da7594b5adbcbb65cbf87b8da0959bfdd82460" -dependencies = [ - "atty", - "chrono", - "log", - "termcolor", - "thread_local", -] - -[[package]] -name = "string_cache" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "213494b7a2b503146286049378ce02b482200519accc31872ee8be91fa820a08" -dependencies = [ - "new_debug_unreachable", - "once_cell", - "parking_lot", - "phf_shared", - "precomputed-hash", - "serde", -] - -[[package]] -name = "string_cache_codegen" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bb30289b722be4ff74a408c3cc27edeaad656e06cb1fe8fa9231fa59c728988" -dependencies = [ - "phf_generator", - "phf_shared", - "proc-macro2 1.0.47", - "quote 1.0.21", -] - -[[package]] -name = "string_enum" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "994453cd270ad0265796eb24abf5540091ed03e681c5f3c12bc33e4db33253e1" -dependencies = [ - "pmutil", - "proc-macro2 1.0.47", - "quote 1.0.21", - "swc_macros_common", - "syn 1.0.103", -] - -[[package]] -name = "stringprep" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ee348cb74b87454fff4b551cbf727025810a004f88aeacae7f85b87f4e9a1c1" -dependencies = [ - "unicode-bidi", - "unicode-normalization", -] - -[[package]] -name = "strsim" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" - -[[package]] -name = "strsim" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6446ced80d6c486436db5c078dde11a9f73d42b57fb273121e160b84f63d894c" - -[[package]] -name = "strsim" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" - -[[package]] -name = "subtle" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" - -[[package]] -name = "swc_atoms" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba8735ce37e421749498e038955abc1135eec6a4af0b54a173e55d2e5542d472" -dependencies = [ - "string_cache", - "string_cache_codegen", -] - -[[package]] -name = "swc_common" -version = "0.18.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4516bf4969a924bfd1801aed5c4b214687665898c14b7584d227827faff9d6c" -dependencies = [ - "ahash", - "ast_node", - "better_scoped_tls", - "cfg-if 1.0.0", - "debug_unreachable", - "either", - "from_variant", - "num-bigint", - "once_cell", - "rustc-hash", - "serde", - "siphasher", - "sourcemap", - "string_cache", - "swc_eq_ignore_macros", - "swc_visit", - "tracing", - "unicode-width", - "url", -] - -[[package]] -name = "swc_config" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8bb05ef56c14b95dd7e62e95960153af811b9a447287f1f6ca59f1337fb83d4" -dependencies = [ - "anyhow", - "indexmap", - "serde", - "serde_json", - "swc_config_macro", -] - -[[package]] -name = "swc_config_macro" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb64bc03d90fd5c90d6ab917bb2b1d7fbd31957df39e31ea24a3f554b4372251" -dependencies = [ - "pmutil", - "proc-macro2 1.0.47", - "quote 1.0.21", - "swc_macros_common", - "syn 1.0.103", -] - -[[package]] -name = "swc_ecma_ast" -version = "0.78.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21f40169fe465e9a93cda5fe397c3afcb69be5ba2f76c4ab22137af6effaebcc" -dependencies = [ - "is-macro", - "num-bigint", - "scoped-tls", - "serde", - "string_enum", - "swc_atoms", - "swc_common", - "unicode-id", -] - -[[package]] -name = "swc_ecma_codegen" -version = "0.108.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5eec1d30c8f85e8267a8efc66d680aa777902d567c3a05b7dfd42965a4872243" -dependencies = [ - "bitflags", - "memchr", - "num-bigint", - "once_cell", - "rustc-hash", - "sourcemap", - "swc_atoms", - "swc_common", - "swc_ecma_ast", - "swc_ecma_codegen_macros", - "tracing", -] - -[[package]] -name = "swc_ecma_codegen_macros" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59949619b2ef45eedb6c399d05f2c3c7bc678b5074b3103bb670f9e05bb99042" -dependencies = [ - "pmutil", - "proc-macro2 1.0.47", - "quote 1.0.21", - "swc_macros_common", - "syn 1.0.103", -] - -[[package]] -name = "swc_ecma_parser" -version = "0.104.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5fea08aeb2eb1469928ac7ca2d208fe7816871787e4d93e34924495e724bb25" -dependencies = [ - "either", - "enum_kind", - "lexical", - "num-bigint", - "serde", - "smallvec", - "swc_atoms", - "swc_common", - "swc_ecma_ast", - "tracing", - "typed-arena", -] - -[[package]] -name = "swc_ecma_transforms" -version = "0.154.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bce21d9e8ff785aaf9b4ac11375d9f5767630fcaf882f72e6af0516224085a6" -dependencies = [ - "swc_atoms", - "swc_common", - "swc_ecma_ast", - "swc_ecma_transforms_base", - "swc_ecma_transforms_proposal", - "swc_ecma_transforms_react", - "swc_ecma_transforms_typescript", - "swc_ecma_utils", - "swc_ecma_visit", -] - -[[package]] -name = "swc_ecma_transforms_base" -version = "0.85.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "528c99be91500ed393e04e5cfc37763b4b68b71bc4f9b54ff0cd21d714920130" -dependencies = [ - "better_scoped_tls", - "once_cell", - "phf", - "rustc-hash", - "serde", - "smallvec", - "swc_atoms", - "swc_common", - "swc_ecma_ast", - "swc_ecma_parser", - "swc_ecma_utils", - "swc_ecma_visit", - "tracing", -] - -[[package]] -name = "swc_ecma_transforms_classes" -version = "0.73.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e74a27c29def9db5ff03db4d3ab3d37701fb6d100951162223b71132908451eb" -dependencies = [ - "swc_atoms", - "swc_common", - "swc_ecma_ast", - "swc_ecma_transforms_base", - "swc_ecma_utils", - "swc_ecma_visit", -] - -[[package]] -name = "swc_ecma_transforms_macros" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18712e4aab969c6508dff3540ade6358f1e013464aa58b3d30da2ab2d9fcbbed" -dependencies = [ - "pmutil", - "proc-macro2 1.0.47", - "quote 1.0.21", - "swc_macros_common", - "syn 1.0.103", -] - -[[package]] -name = "swc_ecma_transforms_proposal" -version = "0.107.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47fc0f3b336764f89adf1899830321c3f5a7e845ede3ad5949eeb7468aa260ab" -dependencies = [ - "either", - "serde", - "smallvec", - "swc_atoms", - "swc_common", - "swc_ecma_ast", - "swc_ecma_transforms_base", - "swc_ecma_transforms_classes", - "swc_ecma_transforms_macros", - "swc_ecma_utils", - "swc_ecma_visit", -] - -[[package]] -name = "swc_ecma_transforms_react" -version = "0.114.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fbfcd197ebeb0547b59dee39a164633bcf4fb0edbae886f8046e471e6a10502" -dependencies = [ - "ahash", - "base64 0.13.1", - "dashmap", - "indexmap", - "once_cell", - "regex", - "serde", - "sha-1", - "string_enum", - "swc_atoms", - "swc_common", - "swc_config", - "swc_ecma_ast", - "swc_ecma_parser", - "swc_ecma_transforms_base", - "swc_ecma_transforms_macros", - "swc_ecma_utils", - "swc_ecma_visit", -] - -[[package]] -name = "swc_ecma_transforms_typescript" -version = "0.117.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96bf410ffcf91d85dc1f8f1bb969fa2637f9430a6917f2174ad76458c776cb89" -dependencies = [ - "serde", - "swc_atoms", - "swc_common", - "swc_ecma_ast", - "swc_ecma_transforms_base", - "swc_ecma_transforms_react", - "swc_ecma_utils", - "swc_ecma_visit", -] - -[[package]] -name = "swc_ecma_utils" -version = "0.85.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "031ac49cf598f00f048fecd87b3bda5e14b86f6ccd561ada7fce461e0a3ea8d1" -dependencies = [ - "indexmap", - "once_cell", - "swc_atoms", - "swc_common", - "swc_ecma_ast", - "swc_ecma_visit", - "tracing", -] - -[[package]] -name = "swc_ecma_visit" -version = "0.64.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2d3783a0dd1e301ae2945ab1241405f913427f9512ec62756d3d2072f7c21bb" -dependencies = [ - "num-bigint", - "swc_atoms", - "swc_common", - "swc_ecma_ast", - "swc_visit", - "tracing", -] - -[[package]] -name = "swc_ecmascript" -version = "0.157.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd35679e1dc392f776b691b125692d90a7bebd5d23ec96699cfe37d8ae8633b1" -dependencies = [ - "swc_ecma_ast", - "swc_ecma_codegen", - "swc_ecma_parser", - "swc_ecma_transforms", - "swc_ecma_utils", - "swc_ecma_visit", -] - -[[package]] -name = "swc_eq_ignore_macros" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c8f200a2eaed938e7c1a685faaa66e6d42fa9e17da5f62572d3cbc335898f5e" -dependencies = [ - "pmutil", - "proc-macro2 1.0.47", - "quote 1.0.21", - "syn 1.0.103", -] - -[[package]] -name = "swc_macros_common" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5dca3f08d02da4684c3373150f7c045128f81ea00f0c434b1b012bc65a6cce3" -dependencies = [ - "pmutil", - "proc-macro2 1.0.47", - "quote 1.0.21", - "syn 1.0.103", -] - -[[package]] -name = "swc_visit" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5c639379dd2a8a0221fa1e12fafbdd594ba53a0cace6560054da52409dfcc1a" -dependencies = [ - "either", - "swc_visit_macros", -] - -[[package]] -name = "swc_visit_macros" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3b9b72892df873972549838bf84d6c56234c7502148a7e23b5a3da6e0fedfb8" -dependencies = [ - "Inflector", - "pmutil", - "proc-macro2 1.0.47", - "quote 1.0.21", - "swc_macros_common", - "syn 1.0.103", -] - -[[package]] -name = "syn" -version = "0.15.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ca4b3b69a77cbe1ffc9e198781b7acb0c7365a883670e8f1c1bc66fba79a5c5" -dependencies = [ - "proc-macro2 0.4.30", - "quote 0.6.13", - "unicode-xid 0.1.0", -] - -[[package]] -name = "syn" -version = "1.0.103" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a864042229133ada95abf3b54fdc62ef5ccabe9515b64717bcb9a1919e59445d" -dependencies = [ - "proc-macro2 1.0.47", - "quote 1.0.21", - "unicode-ident", -] - -[[package]] -name = "synstructure" -version = "0.12.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" -dependencies = [ - "proc-macro2 1.0.47", - "quote 1.0.21", - "syn 1.0.103", - "unicode-xid 0.2.4", -] - -[[package]] -name = "tap" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" - -[[package]] -name = "tar" -version = "0.4.38" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b55807c0344e1e6c04d7c965f5289c39a8d94ae23ed5c0b57aabac549f871c6" -dependencies = [ - "filetime", - "libc", - "xattr", -] - -[[package]] -name = "tempfile" -version = "3.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" -dependencies = [ - "cfg-if 1.0.0", - "fastrand", - "libc", - "redox_syscall 0.2.16", - "remove_dir_all", - "winapi", -] - -[[package]] -name = "term" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c59df8ac95d96ff9bede18eb7300b0fda5e5d8d90960e76f8e14ae765eedbf1f" -dependencies = [ - "dirs-next", - "rustversion", - "winapi", -] - -[[package]] -name = "termcolor" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "text_lines" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e49e3c53dd04de8b8e8390bc4fab57f6db7af7d33b086fe411803e6351c9f9f9" -dependencies = [ - "serde", -] - -[[package]] -name = "textwrap" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" -dependencies = [ - "unicode-width", -] - -[[package]] -name = "textwrap" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" - -[[package]] -name = "thiserror" -version = "1.0.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10deb33631e3c9018b9baf9dcbbc4f737320d2b576bac10f6aefa048fa407e3e" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "982d17546b47146b28f7c22e3d08465f6b8903d0ea13c1660d9d84a6e7adcdbb" -dependencies = [ - "proc-macro2 1.0.47", - "quote 1.0.21", - "syn 1.0.103", -] - -[[package]] -name = "thread-id" -version = "3.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7fbf4c9d56b320106cd64fd024dadfa0be7cb4706725fc44a7d7ce952d820c1" -dependencies = [ - "libc", - "redox_syscall 0.1.57", - "winapi", -] - -[[package]] -name = "thread_local" -version = "1.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5516c27b78311c50bf42c071425c560ac799b11c30b31f87e3081965fe5e0180" -dependencies = [ - "once_cell", -] - -[[package]] -name = "time" -version = "0.1.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255" -dependencies = [ - "libc", - "wasi 0.10.0+wasi-snapshot-preview1", - "winapi", -] - -[[package]] -name = "time" -version = "0.3.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fab5c8b9980850e06d92ddbe3ab839c062c801f3927c0fb8abd6fc8e918fbca" -dependencies = [ - "itoa 1.0.4", - "libc", - "num_threads", - "serde", - "time-core", - "time-macros", -] - -[[package]] -name = "time-core" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e153e1f1acaef8acc537e68b44906d2db6436e2b35ac2c6b42640fff91f00fd" - -[[package]] -name = "time-macros" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65bb801831d812c562ae7d2bfb531f26e66e4e1f6b17307ba4149c5064710e5b" -dependencies = [ - "time-core", -] - -[[package]] -name = "tiny-keccak" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" -dependencies = [ - "crunchy", -] - -[[package]] -name = "tinyvec" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" -dependencies = [ - "tinyvec_macros", -] - -[[package]] -name = "tinyvec_macros" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" - -[[package]] -name = "tokio" -version = "1.21.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9e03c497dc955702ba729190dc4aac6f2a0ce97f913e5b1b5912fc5039d9099" -dependencies = [ - "autocfg", - "bytes", - "libc", - "memchr", - "mio", - "num_cpus", - "parking_lot", - "pin-project-lite", - "signal-hook-registry", - "socket2", - "tokio-macros", - "winapi", -] - -[[package]] -name = "tokio-macros" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9724f9a975fb987ef7a3cd9be0350edcbe130698af5b8f7a631e23d42d052484" -dependencies = [ - "proc-macro2 1.0.47", - "quote 1.0.21", - "syn 1.0.103", -] - -[[package]] -name = "tokio-native-tls" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d995660bd2b7f8c1568414c1126076c13fbb725c40112dc0120b78eb9b717b" -dependencies = [ - "native-tls", - "tokio", -] - -[[package]] -name = "tokio-rustls" -version = "0.23.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" -dependencies = [ - "rustls", - "tokio", - "webpki", -] - -[[package]] -name = "tokio-socks" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51165dfa029d2a65969413a6cc96f354b86b464498702f174a4efa13608fd8c0" -dependencies = [ - "either", - "futures-util", - "thiserror", - "tokio", -] - -[[package]] -name = "tokio-stream" -version = "0.1.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d660770404473ccd7bc9f8b28494a811bc18542b915c0855c51e8f419d5223ce" -dependencies = [ - "futures-core", - "pin-project-lite", - "tokio", - "tokio-util", -] - -[[package]] -name = "tokio-tar" -version = "0.3.0" -source = "git+https://github.com/dr-bonez/tokio-tar.git#071db00962a66f8552d418d60be7bdf1c8ed8216" -dependencies = [ - "filetime", - "futures-core", - "libc", - "redox_syscall 0.2.16", - "tokio", - "tokio-stream", - "xattr", -] - -[[package]] -name = "tokio-tungstenite" -version = "0.17.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f714dd15bead90401d77e04243611caec13726c2408afd5b31901dfcdcb3b181" -dependencies = [ - "futures-util", - "log", - "native-tls", - "tokio", - "tokio-native-tls", - "tungstenite", -] - -[[package]] -name = "tokio-util" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bb2e075f03b3d66d8d8785356224ba688d2906a371015e225beeb65ca92c740" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", - "tracing", -] - -[[package]] -name = "toml" -version = "0.5.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d82e1a7758622a465f8cee077614c73484dac5b836c02ff6a40d5d1010324d7" -dependencies = [ - "serde", -] - -[[package]] -name = "torut" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99febc413f26cf855b3a309c5872edff5c31e0ffe9c2fce5681868761df36f69" -dependencies = [ - "base32", - "base64 0.13.1", - "derive_more", - "ed25519-dalek", - "hex", - "hmac 0.11.0", - "rand 0.7.3", - "serde", - "serde_derive", - "sha2 0.9.9", - "sha3", - "tokio", -] - -[[package]] -name = "tower-service" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" - -[[package]] -name = "tracing" -version = "0.1.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" -dependencies = [ - "cfg-if 1.0.0", - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" -dependencies = [ - "proc-macro2 1.0.47", - "quote 1.0.21", - "syn 1.0.103", -] - -[[package]] -name = "tracing-core" -version = "0.1.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" -dependencies = [ - "once_cell", - "valuable", -] - -[[package]] -name = "tracing-error" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4d7c0b83d4a500748fa5879461652b361edf5c9d51ede2a2ac03875ca185e24" -dependencies = [ - "tracing", - "tracing-subscriber 0.2.25", -] - -[[package]] -name = "tracing-error" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d686ec1c0f384b1277f097b2f279a2ecc11afe8c133c1aabf036a27cb4cd206e" -dependencies = [ - "tracing", - "tracing-subscriber 0.3.16", -] - -[[package]] -name = "tracing-futures" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" -dependencies = [ - "pin-project", - "tracing", -] - -[[package]] -name = "tracing-log" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" -dependencies = [ - "lazy_static", - "log", - "tracing-core", -] - -[[package]] -name = "tracing-subscriber" -version = "0.2.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e0d2eaa99c3c2e41547cfa109e910a68ea03823cccad4a0525dcbc9b01e8c71" -dependencies = [ - "sharded-slab", - "thread_local", - "tracing-core", -] - -[[package]] -name = "tracing-subscriber" -version = "0.3.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6176eae26dd70d0c919749377897b54a9276bd7061339665dd68777926b5a70" -dependencies = [ - "matchers", - "nu-ansi-term", - "once_cell", - "regex", - "sharded-slab", - "smallvec", - "thread_local", - "tracing", - "tracing-core", - "tracing-log", -] - -[[package]] -name = "treediff" -version = "4.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52984d277bdf2a751072b5df30ec0377febdb02f7696d64c2d7d54630bac4303" -dependencies = [ - "serde_json", -] - -[[package]] -name = "trust-dns-client" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c408c32e6a9dbb38037cece35740f2cf23c875d8ca134d33631cec83f74d3fe" -dependencies = [ - "cfg-if 1.0.0", - "data-encoding", - "futures-channel", - "futures-util", - "lazy_static", - "radix_trie", - "rand 0.8.5", - "thiserror", - "time 0.3.16", - "tokio", - "tracing", - "trust-dns-proto", -] - -[[package]] -name = "trust-dns-proto" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f7f83d1e4a0e4358ac54c5c3681e5d7da5efc5a7a632c90bb6d6669ddd9bc26" -dependencies = [ - "async-trait", - "cfg-if 1.0.0", - "data-encoding", - "enum-as-inner", - "futures-channel", - "futures-io", - "futures-util", - "idna 0.2.3", - "ipnet", - "lazy_static", - "rand 0.8.5", - "smallvec", - "thiserror", - "tinyvec", - "tokio", - "tracing", - "url", -] - -[[package]] -name = "trust-dns-server" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1583cf9f8a359c9f16fdf760b79cb2be3f261b98db8027f81959c7a4f6645e2c" -dependencies = [ - "async-trait", - "bytes", - "cfg-if 1.0.0", - "enum-as-inner", - "futures-executor", - "futures-util", - "serde", - "thiserror", - "time 0.3.16", - "tokio", - "toml", - "tracing", - "trust-dns-client", - "trust-dns-proto", -] - -[[package]] -name = "try-lock" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" - -[[package]] -name = "tungstenite" -version = "0.17.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e27992fd6a8c29ee7eef28fc78349aa244134e10ad447ce3b9f0ac0ed0fa4ce0" -dependencies = [ - "base64 0.13.1", - "byteorder", - "bytes", - "http", - "httparse", - "log", - "native-tls", - "rand 0.8.5", - "sha-1", - "thiserror", - "url", - "utf-8", -] - -[[package]] -name = "typed-arena" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0685c84d5d54d1c26f7d3eb96cd41550adb97baed141a761cf335d3d33bcd0ae" - -[[package]] -name = "typed-builder" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89851716b67b937e393b3daa8423e67ddfc4bbbf1654bcf05488e95e0828db0c" -dependencies = [ - "proc-macro2 1.0.47", - "quote 1.0.21", - "syn 1.0.103", -] - -[[package]] -name = "typenum" -version = "1.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" - -[[package]] -name = "unicode-bidi" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" - -[[package]] -name = "unicode-id" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d70b6494226b36008c8366c288d77190b3fad2eb4c10533139c1c1f461127f1a" - -[[package]] -name = "unicode-ident" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3" - -[[package]] -name = "unicode-normalization" -version = "0.1.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" -dependencies = [ - "tinyvec", -] - -[[package]] -name = "unicode-segmentation" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fdbf052a0783de01e944a6ce7a8cb939e295b1e7be835a1112c3b9a7f047a5a" - -[[package]] -name = "unicode-width" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" - -[[package]] -name = "unicode-xid" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" - -[[package]] -name = "unicode-xid" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" - -[[package]] -name = "unicode_categories" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39ec24b3121d976906ece63c9daad25b85969647682eee313cb5779fdd69e14e" - -[[package]] -name = "unreachable" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f2ae5ddb18e1c92664717616dd9549dde73f539f01bd7b77c2edb2446bdff91" -dependencies = [ - "void", -] - -[[package]] -name = "unsafe-libyaml" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1e5fa573d8ac5f1a856f8d7be41d390ee973daf97c806b2c1a465e4e1406e68" - -[[package]] -name = "untrusted" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" - -[[package]] -name = "url" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" -dependencies = [ - "form_urlencoded", - "idna 0.3.0", - "percent-encoding", - "serde", -] - -[[package]] -name = "utf-8" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" - -[[package]] -name = "uuid" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "feb41e78f93363bb2df8b0e86a2ca30eed7806ea16ea0c790d757cf93f79be83" -dependencies = [ - "getrandom 0.2.8", -] - -[[package]] -name = "v8" -version = "0.43.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c87ec36fec9ea2cd5a368ae9d0a662a7c5e8caa8768ec1fcc02bea623681b98" -dependencies = [ - "bitflags", - "fslock", - "lazy_static", - "libc", - "which 4.3.0", -] - -[[package]] -name = "valuable" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" - -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - -[[package]] -name = "vec_map" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "void" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" - -[[package]] -name = "wait-timeout" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f200f5b12eb75f8c1ed65abd4b2db8a6e1b138a20de009dacee265a2498f3f6" -dependencies = [ - "libc", -] - -[[package]] -name = "want" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" -dependencies = [ - "log", - "try-lock", -] - -[[package]] -name = "wasi" -version = "0.9.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" - -[[package]] -name = "wasi" -version = "0.10.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" - -[[package]] -name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" - -[[package]] -name = "wasm-bindgen" -version = "0.2.83" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268" -dependencies = [ - "cfg-if 1.0.0", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.83" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c8ffb332579b0557b52d268b91feab8df3615f265d5270fec2a8c95b17c1142" -dependencies = [ - "bumpalo", - "log", - "once_cell", - "proc-macro2 1.0.47", - "quote 1.0.21", - "syn 1.0.103", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-futures" -version = "0.4.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23639446165ca5a5de86ae1d8896b737ae80319560fbaa4c2887b7da6e7ebd7d" -dependencies = [ - "cfg-if 1.0.0", - "js-sys", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.83" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "052be0f94026e6cbc75cdefc9bae13fd6052cdcaf532fa6c45e7ae33a1e6c810" -dependencies = [ - "quote 1.0.21", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.83" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c" -dependencies = [ - "proc-macro2 1.0.47", - "quote 1.0.21", - "syn 1.0.103", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.83" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f" - -[[package]] -name = "web-sys" -version = "0.3.60" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcda906d8be16e728fd5adc5b729afad4e444e106ab28cd1c7256e54fa61510f" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "webpki" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" -dependencies = [ - "ring", - "untrusted", -] - -[[package]] -name = "webpki-roots" -version = "0.22.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "368bfe657969fb01238bb756d351dcade285e0f6fcbd36dcb23359a5169975be" -dependencies = [ - "webpki", -] - -[[package]] -name = "which" -version = "3.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d011071ae14a2f6671d0b74080ae0cd8ebf3a6f8c9589a2cd45f23126fe29724" -dependencies = [ - "libc", -] - -[[package]] -name = "which" -version = "4.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c831fbbee9e129a8cf93e7747a82da9d95ba8e16621cae60ec2cdc849bacb7b" -dependencies = [ - "either", - "libc", - "once_cell", -] - -[[package]] -name = "whoami" -version = "1.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6631b6a2fd59b1841b622e8f1a7ad241ef0a46f2d580464ce8140ac94cbd571" -dependencies = [ - "bumpalo", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-util" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" -dependencies = [ - "winapi", -] - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "windows-sys" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" -dependencies = [ - "windows_aarch64_msvc 0.36.1", - "windows_i686_gnu 0.36.1", - "windows_i686_msvc 0.36.1", - "windows_x86_64_gnu 0.36.1", - "windows_x86_64_msvc 0.36.1", -] - -[[package]] -name = "windows-sys" -version = "0.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" -dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc 0.42.0", - "windows_i686_gnu 0.42.0", - "windows_i686_msvc 0.42.0", - "windows_x86_64_gnu 0.42.0", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc 0.42.0", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4" - -[[package]] -name = "windows_i686_gnu" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" - -[[package]] -name = "windows_i686_gnu" -version = "0.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7" - -[[package]] -name = "windows_i686_msvc" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" - -[[package]] -name = "windows_i686_msvc" -version = "0.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5" - -[[package]] -name = "winreg" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" -dependencies = [ - "winapi", -] - -[[package]] -name = "wyz" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85e60b0d1b5f99db2556934e21937020776a5d31520bf169e851ac44e6420214" - -[[package]] -name = "xattr" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d1526bbe5aaeb5eb06885f4d987bcdfa5e23187055de9b83fe00156a821fabc" -dependencies = [ - "libc", -] - -[[package]] -name = "yajrc" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b40687b4c165cb760e35730055c8840f36897e7c98099b2d3d66ba8cb624c79a" -dependencies = [ - "anyhow", - "serde", - "serde_json", - "thiserror", -] - -[[package]] -name = "zeroize" -version = "1.5.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c394b5bd0c6f669e7275d9c20aa90ae064cb22e75a1cad54e1b34088034b149f" -dependencies = [ - "zeroize_derive", -] - -[[package]] -name = "zeroize_derive" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f8f187641dad4f680d25c4bfc4225b418165984179f26ca76ec4fb6441d3a17" -dependencies = [ - "proc-macro2 1.0.47", - "quote 1.0.21", - "syn 1.0.103", - "synstructure", -] From af2b2f33c29ae6fab2ace0d8ddf2c7a474400779 Mon Sep 17 00:00:00 2001 From: Matt Hill Date: Thu, 26 Oct 2023 17:33:57 -0600 Subject: [PATCH 12/35] Fix/ntp (#2479) * rework ntp faiure handling and display to user * uptime in seconds * change how we handle ntp --------- Co-authored-by: Aiden McClelland --- backend/src/account.rs | 7 +- backend/src/context/rpc.rs | 7 +- backend/src/db/model.rs | 5 +- backend/src/init.rs | 39 ++++++++-- backend/src/lib.rs | 5 ++ backend/src/net/ssl.rs | 69 +++++++++++------ backend/src/setup.rs | 3 +- backend/src/system.rs | 63 +++++++++++++++- .../download-doc/download-doc.component.html | 4 +- .../src/services/error-toast.service.ts | 2 +- .../login/ca-wizard/ca-wizard.component.ts | 2 +- .../app/pages/server-routes/lan/lan.page.html | 2 +- .../server-metrics/server-metrics.page.html | 75 ++++++++++++------- .../server-metrics/server-metrics.page.ts | 4 +- .../server-show/server-show.page.html | 27 ++++++- .../ui/src/app/services/api/api.types.ts | 5 +- .../services/api/embassy-mock-api.service.ts | 5 +- .../ui/src/app/services/api/mock-patch.ts | 2 +- .../src/app/services/patch-db/data-model.ts | 2 +- .../ui/src/app/services/time-service.ts | 67 ++++++++--------- libs/helpers/src/rsync.rs | 2 +- 21 files changed, 284 insertions(+), 113 deletions(-) diff --git a/backend/src/account.rs b/backend/src/account.rs index 1f8d86e91..0c06f2a5f 100644 --- a/backend/src/account.rs +++ b/backend/src/account.rs @@ -1,4 +1,5 @@ -use digest::Digest; +use std::time::SystemTime; + use ed25519_dalek::SecretKey; use openssl::pkey::{PKey, Private}; use openssl::x509::X509; @@ -29,11 +30,11 @@ pub struct AccountInfo { pub root_ca_cert: X509, } impl AccountInfo { - pub fn new(password: &str) -> Result { + pub fn new(password: &str, start_time: SystemTime) -> Result { let server_id = generate_id(); let hostname = generate_hostname(); let root_ca_key = generate_key()?; - let root_ca_cert = make_root_cert(&root_ca_key, &hostname)?; + let root_ca_cert = make_root_cert(&root_ca_key, &hostname, start_time)?; Ok(Self { server_id, hostname, diff --git a/backend/src/context/rpc.rs b/backend/src/context/rpc.rs index abb122d6e..f235572e4 100644 --- a/backend/src/context/rpc.rs +++ b/backend/src/context/rpc.rs @@ -15,6 +15,7 @@ use serde::Deserialize; use sqlx::postgres::PgConnectOptions; use sqlx::PgPool; use tokio::sync::{broadcast, oneshot, Mutex, RwLock}; +use tokio::time::Instant; use tracing::instrument; use super::setup::CURRENT_SECRET; @@ -29,7 +30,7 @@ use crate::install::cleanup::{cleanup_failed, uninstall}; use crate::manager::ManagerMap; use crate::middleware::auth::HashSessionToken; use crate::net::net_controller::NetController; -use crate::net::ssl::SslManager; +use crate::net::ssl::{root_ca_start_time, SslManager}; use crate::net::wifi::WpaCli; use crate::notifications::NotificationManager; use crate::shutdown::Shutdown; @@ -123,6 +124,7 @@ pub struct RpcContextSeed { pub current_secret: Arc, pub client: Client, pub hardware: Hardware, + pub start_time: Instant, } pub struct Hardware { @@ -158,7 +160,7 @@ impl RpcContext { base.dns_bind .as_deref() .unwrap_or(&[SocketAddr::from(([127, 0, 0, 1], 53))]), - SslManager::new(&account)?, + SslManager::new(&account, root_ca_start_time().await?)?, &account.hostname, &account.key, ) @@ -214,6 +216,7 @@ impl RpcContext { .build() .with_kind(crate::ErrorKind::ParseUrl)?, hardware: Hardware { devices, ram }, + start_time: Instant::now(), }); let res = Self(seed.clone()); diff --git a/backend/src/db/model.rs b/backend/src/db/model.rs index 950c6505a..6ce3f8add 100644 --- a/backend/src/db/model.rs +++ b/backend/src/db/model.rs @@ -79,7 +79,7 @@ impl Database { .iter() .map(|x| format!("{x:X}")) .join(":"), - system_start_time: Utc::now().to_rfc3339(), + ntp_synced: false, zram: true, }, package_data: AllPackageData::default(), @@ -125,7 +125,8 @@ pub struct ServerInfo { pub password_hash: String, pub pubkey: String, pub ca_fingerprint: String, - pub system_start_time: String, + #[serde(default)] + pub ntp_synced: bool, #[serde(default)] pub zram: bool, } diff --git a/backend/src/init.rs b/backend/src/init.rs index fdbc41212..0308f684c 100644 --- a/backend/src/init.rs +++ b/backend/src/init.rs @@ -1,7 +1,7 @@ use std::fs::Permissions; use std::os::unix::fs::PermissionsExt; use std::path::Path; -use std::time::Duration; +use std::time::{Duration, SystemTime}; use color_eyre::eyre::eyre; use helpers::NonDetachingJoinHandle; @@ -19,7 +19,6 @@ use crate::install::PKG_ARCHIVE_DIR; use crate::middleware::auth::LOCAL_AUTH_COOKIE_PATH; use crate::prelude::*; use crate::sound::BEP; -use crate::system::time; use crate::util::cpupower::{ current_governor, get_available_governors, set_governor, GOVERNOR_PERFORMANCE, }; @@ -361,15 +360,28 @@ pub async fn init(cfg: &RpcContextConfig) -> Result { } } - let mut warn_time_not_synced = true; - for _ in 0..60 { + let mut time_not_synced = true; + let mut not_made_progress = 0u32; + for _ in 0..1800 { if check_time_is_synchronized().await? { - warn_time_not_synced = false; + time_not_synced = false; break; } + let t = SystemTime::now(); tokio::time::sleep(Duration::from_secs(1)).await; + if t.elapsed() + .map(|t| t > Duration::from_secs_f64(1.1)) + .unwrap_or(true) + { + not_made_progress = 0; + } else { + not_made_progress += 1; + } + if not_made_progress > 30 { + break; + } } - if warn_time_not_synced { + if time_not_synced { tracing::warn!("Timed out waiting for system time to synchronize"); } else { tracing::info!("Syncronized system clock"); @@ -385,7 +397,20 @@ pub async fn init(cfg: &RpcContextConfig) -> Result { backup_progress: None, }; - server_info.system_start_time = time().await?; + server_info.ntp_synced = if time_not_synced { + let db = db.clone(); + tokio::spawn(async move { + while !check_time_is_synchronized().await.unwrap() { + tokio::time::sleep(Duration::from_secs(30)).await; + } + db.mutate(|v| v.as_server_info_mut().as_ntp_synced_mut().ser(&true)) + .await + .unwrap() + }); + false + } else { + true + }; db.mutate(|v| { v.as_server_info_mut().ser(&server_info)?; diff --git a/backend/src/lib.rs b/backend/src/lib.rs index 67f34d785..141ef1780 100644 --- a/backend/src/lib.rs +++ b/backend/src/lib.rs @@ -17,6 +17,9 @@ lazy_static::lazy_static! { ARCH.to_string() } }; + pub static ref SOURCE_DATE: SystemTime = { + std::fs::metadata(std::env::current_exe().unwrap()).unwrap().modified().unwrap() + }; } pub mod account; @@ -62,6 +65,8 @@ pub mod util; pub mod version; pub mod volume; +use std::time::SystemTime; + pub use config::Config; pub use error::{Error, ErrorKind, ResultExt}; use rpc_toolkit::command; diff --git a/backend/src/net/ssl.rs b/backend/src/net/ssl.rs index c2cab3355..ba2f314b9 100644 --- a/backend/src/net/ssl.rs +++ b/backend/src/net/ssl.rs @@ -4,8 +4,8 @@ use std::net::IpAddr; use std::path::Path; use std::time::{SystemTime, UNIX_EPOCH}; - use futures::FutureExt; +use libc::time_t; use openssl::asn1::{Asn1Integer, Asn1Time}; use openssl::bn::{BigNum, MsbOption}; use openssl::ec::{EcGroup, EcKey}; @@ -19,15 +19,22 @@ use tokio::sync::{Mutex, RwLock}; use tracing::instrument; use crate::account::AccountInfo; -use crate::context::{RpcContext}; +use crate::context::RpcContext; use crate::hostname::Hostname; +use crate::init::check_time_is_synchronized; use crate::net::dhcp::ips; use crate::net::keys::{Key, KeyInfo}; - -use crate::{Error, ErrorKind, ResultExt}; +use crate::{Error, ErrorKind, ResultExt, SOURCE_DATE}; static CERTIFICATE_VERSION: i32 = 2; // X509 version 3 is actually encoded as '2' in the cert because fuck you. +fn unix_time(time: SystemTime) -> time_t { + time.duration_since(UNIX_EPOCH) + .map(|d| d.as_secs() as time_t) + .or_else(|_| UNIX_EPOCH.elapsed().map(|d| -(d.as_secs() as time_t))) + .unwrap_or_default() +} + #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord)] pub struct CertPair { pub ed25519: X509, @@ -57,9 +64,13 @@ impl CertPair { }), ); if cert - .not_after() - .compare(Asn1Time::days_from_now(30)?.as_ref())? - == Ordering::Greater + .not_before() + .compare(Asn1Time::days_from_now(0)?.as_ref())? + == Ordering::Less + && cert + .not_after() + .compare(Asn1Time::days_from_now(30)?.as_ref())? + == Ordering::Greater && ips.is_superset(&ip) { return Ok(cert.clone()); @@ -82,6 +93,14 @@ impl CertPair { } } +pub async fn root_ca_start_time() -> Result { + Ok(if check_time_is_synchronized().await? { + SystemTime::now() + } else { + *SOURCE_DATE + }) +} + #[derive(Debug)] pub struct SslManager { hostname: Hostname, @@ -91,9 +110,13 @@ pub struct SslManager { cert_cache: RwLock>, } impl SslManager { - pub fn new(account: &AccountInfo) -> Result { + pub fn new(account: &AccountInfo, start_time: SystemTime) -> Result { let int_key = generate_key()?; - let int_cert = make_int_cert((&account.root_ca_key, &account.root_ca_cert), &int_key)?; + let int_cert = make_int_cert( + (&account.root_ca_key, &account.root_ca_cert), + &int_key, + start_time, + )?; Ok(Self { hostname: account.hostname.clone(), root_cert: account.root_ca_cert.clone(), @@ -162,14 +185,20 @@ pub fn generate_key() -> Result, Error> { } #[instrument(skip_all)] -pub fn make_root_cert(root_key: &PKey, hostname: &Hostname) -> Result { +pub fn make_root_cert( + root_key: &PKey, + hostname: &Hostname, + start_time: SystemTime, +) -> Result { let mut builder = X509Builder::new()?; builder.set_version(CERTIFICATE_VERSION)?; - let embargo = Asn1Time::days_from_now(0)?; + let unix_start_time = unix_time(start_time); + + let embargo = Asn1Time::from_unix(unix_start_time)?; builder.set_not_before(&embargo)?; - let expiration = Asn1Time::days_from_now(3650)?; + let expiration = Asn1Time::from_unix(unix_start_time + (10 * 365 * 86400))?; builder.set_not_after(&expiration)?; builder.set_serial_number(&*rand_serial()?)?; @@ -216,14 +245,17 @@ pub fn make_root_cert(root_key: &PKey, hostname: &Hostname) -> Result, &X509), applicant: &PKey, + start_time: SystemTime, ) -> Result { let mut builder = X509Builder::new()?; builder.set_version(CERTIFICATE_VERSION)?; - let embargo = Asn1Time::days_from_now(0)?; + let unix_start_time = unix_time(start_time); + + let embargo = Asn1Time::from_unix(unix_start_time)?; builder.set_not_before(&embargo)?; - let expiration = Asn1Time::days_from_now(3650)?; + let expiration = Asn1Time::from_unix(unix_start_time + (10 * 365 * 86400))?; builder.set_not_after(&expiration)?; builder.set_serial_number(&*rand_serial()?)?; @@ -346,14 +378,7 @@ pub fn make_leaf_cert( let mut builder = X509Builder::new()?; builder.set_version(CERTIFICATE_VERSION)?; - let embargo = Asn1Time::from_unix( - SystemTime::now() - .duration_since(UNIX_EPOCH) - .map(|d| d.as_secs() as i64) - .or_else(|_| UNIX_EPOCH.elapsed().map(|d| -(d.as_secs() as i64))) - .unwrap_or_default() - - 86400, - )?; + let embargo = Asn1Time::from_unix(unix_time(SystemTime::now()) - 86400)?; builder.set_not_before(&embargo)?; // Google Apple and Mozilla reject certificate horizons longer than 397 days diff --git a/backend/src/setup.rs b/backend/src/setup.rs index f9e897d01..64c324095 100644 --- a/backend/src/setup.rs +++ b/backend/src/setup.rs @@ -31,6 +31,7 @@ use crate::disk::REPAIR_DISK_PATH; use crate::hostname::Hostname; use crate::init::{init, InitResult}; use crate::middleware::encrypt::EncryptedWire; +use crate::net::ssl::root_ca_start_time; use crate::prelude::*; use crate::util::io::{dir_copy, dir_size, Counter}; use crate::{Error, ErrorKind, ResultExt}; @@ -378,7 +379,7 @@ async fn fresh_setup( ctx: &SetupContext, embassy_password: &str, ) -> Result<(Hostname, OnionAddressV3, X509), Error> { - let account = AccountInfo::new(embassy_password)?; + let account = AccountInfo::new(embassy_password, root_ca_start_time().await?)?; let sqlite_pool = ctx.secret_store().await?; account.save(&sqlite_pool).await?; sqlite_pool.close().await; diff --git a/backend/src/system.rs b/backend/src/system.rs index aee32b50a..249ade9c3 100644 --- a/backend/src/system.rs +++ b/backend/src/system.rs @@ -1,6 +1,7 @@ use std::fmt; use chrono::Utc; +use clap::ArgMatches; use color_eyre::eyre::eyre; use futures::FutureExt; use rpc_toolkit::command; @@ -84,9 +85,65 @@ pub async fn zram(#[context] ctx: RpcContext, #[arg] enable: bool) -> Result<(), Ok(()) } -#[command] -pub async fn time() -> Result { - Ok(Utc::now().to_rfc3339()) +#[derive(Serialize, Deserialize)] +pub struct TimeInfo { + now: String, + uptime: u64, +} + +fn display_time(arg: TimeInfo, matches: &ArgMatches) { + use std::fmt::Write; + + use prettytable::*; + + if matches.is_present("format") { + return display_serializable(arg, matches); + } + + let days = arg.uptime / (24 * 60 * 60); + let days_s = arg.uptime % (24 * 60 * 60); + let hours = days_s / (60 * 60); + let hours_s = arg.uptime % (60 * 60); + let minutes = hours_s / 60; + let seconds = arg.uptime % 60; + let mut uptime_string = String::new(); + if days > 0 { + write!(&mut uptime_string, "{days} days").unwrap(); + } + if hours > 0 { + if !uptime_string.is_empty() { + uptime_string += ", "; + } + write!(&mut uptime_string, "{hours} hours").unwrap(); + } + if minutes > 0 { + if !uptime_string.is_empty() { + uptime_string += ", "; + } + write!(&mut uptime_string, "{minutes} minutes").unwrap(); + } + if !uptime_string.is_empty() { + uptime_string += ", "; + } + write!(&mut uptime_string, "{seconds} seconds").unwrap(); + + let mut table = Table::new(); + table.add_row(row![bc -> "NOW", &arg.now]); + table.add_row(row![bc -> "UPTIME", &uptime_string]); + table.print_tty(false).unwrap(); +} + +#[command(display(display_time))] +pub async fn time( + #[context] ctx: RpcContext, + #[allow(unused_variables)] + #[arg(long = "format")] + format: Option, +) -> Result { + Ok(TimeInfo { + now: Utc::now().to_rfc3339(), + uptime: ctx.start_time.elapsed().as_secs(), + }) } #[command( diff --git a/frontend/projects/setup-wizard/src/app/pages/success/download-doc/download-doc.component.html b/frontend/projects/setup-wizard/src/app/pages/success/download-doc/download-doc.component.html index 0d659241d..25fa87a2e 100644 --- a/frontend/projects/setup-wizard/src/app/pages/success/download-doc/download-doc.component.html +++ b/frontend/projects/setup-wizard/src/app/pages/success/download-doc/download-doc.component.html @@ -37,7 +37,7 @@

Download your server's Root CA and Note: This address will only work from a Tor-enabled browser. For a secure local connection and faster Tor experience, diff --git a/frontend/projects/ui/src/app/pages/server-routes/server-metrics/server-metrics.page.html b/frontend/projects/ui/src/app/pages/server-routes/server-metrics/server-metrics.page.html index c93d633c0..91b00fb28 100644 --- a/frontend/projects/ui/src/app/pages/server-routes/server-metrics/server-metrics.page.html +++ b/frontend/projects/ui/src/app/pages/server-routes/server-metrics/server-metrics.page.html @@ -4,9 +4,9 @@ Monitor - + + + @@ -16,28 +16,51 @@

- Time - - System Time - - {{ systemTime$ | async | date:'MMMM d, y, h:mm a z':'UTC' - }} - + + + +

System Time

+

+ + {{ now.value | date:'MMMM d, y, h:mm a z':'UTC' }} + +

+

+ + NTP not synced, time could be wrong + +

+
+
+ + + +

System Time

+

Loading...

+
+ +
+
+ - System Uptime - - - {{ uptime.days }} Days, {{ uptime.hours }} Hours, - {{ uptime.minutes }} Minutes - - + +

System Uptime

+

+ + + {{ uptime.days }} + Days, + {{ uptime.hours }} + Hours, + {{ uptime.minutes }} + Minutes, + {{ uptime.seconds }} + Seconds + + +

+
@@ -50,9 +73,9 @@ > {{ metric.key }} - {{ metric.value.value }} {{ metric.value.unit }} + + {{ metric.value.value }} {{ metric.value.unit }} + diff --git a/frontend/projects/ui/src/app/pages/server-routes/server-metrics/server-metrics.page.ts b/frontend/projects/ui/src/app/pages/server-routes/server-metrics/server-metrics.page.ts index 83f576919..a4c2dc325 100644 --- a/frontend/projects/ui/src/app/pages/server-routes/server-metrics/server-metrics.page.ts +++ b/frontend/projects/ui/src/app/pages/server-routes/server-metrics/server-metrics.page.ts @@ -14,8 +14,8 @@ export class ServerMetricsPage { going = false metrics: Metrics = {} - readonly systemTime$ = this.timeService.systemTime$ - readonly systemUptime$ = this.timeService.systemUptime$ + readonly now$ = this.timeService.now$ + readonly uptime$ = this.timeService.uptime$ constructor( private readonly errToast: ErrorToastService, diff --git a/frontend/projects/ui/src/app/pages/server-routes/server-show/server-show.page.html b/frontend/projects/ui/src/app/pages/server-routes/server-show/server-show.page.html index 2f119590a..760a013e6 100644 --- a/frontend/projects/ui/src/app/pages/server-routes/server-show/server-show.page.html +++ b/frontend/projects/ui/src/app/pages/server-routes/server-show/server-show.page.html @@ -15,7 +15,32 @@ - + + + +

Clock sync failure

+

+ This will cause connectivity issues. Refer to the StartOS docs to + resolve the issue. +

+
+ + Open Docs + + +
+ +

Http detected

diff --git a/frontend/projects/ui/src/app/services/api/api.types.ts b/frontend/projects/ui/src/app/services/api/api.types.ts index d5c519e69..860bc6003 100644 --- a/frontend/projects/ui/src/app/services/api/api.types.ts +++ b/frontend/projects/ui/src/app/services/api/api.types.ts @@ -42,7 +42,10 @@ export module RR { export type EchoRes = string export type GetSystemTimeReq = {} // server.time - export type GetSystemTimeRes = string + export type GetSystemTimeRes = { + now: string + uptime: number // seconds + } export type GetServerLogsReq = ServerLogsReq // server.logs & server.kernel-logs export type GetServerLogsRes = LogsRes diff --git a/frontend/projects/ui/src/app/services/api/embassy-mock-api.service.ts b/frontend/projects/ui/src/app/services/api/embassy-mock-api.service.ts index 101d5511f..96cc2941c 100644 --- a/frontend/projects/ui/src/app/services/api/embassy-mock-api.service.ts +++ b/frontend/projects/ui/src/app/services/api/embassy-mock-api.service.ts @@ -179,7 +179,10 @@ export class MockApiService extends ApiService { params: RR.GetSystemTimeReq, ): Promise { await pauseFor(2000) - return new Date().toUTCString() + return { + now: new Date().toUTCString(), + uptime: 1234567, + } } async getServerLogs( diff --git a/frontend/projects/ui/src/app/services/api/mock-patch.ts b/frontend/projects/ui/src/app/services/api/mock-patch.ts index 3c19a4da7..02faddeb7 100644 --- a/frontend/projects/ui/src/app/services/api/mock-patch.ts +++ b/frontend/projects/ui/src/app/services/api/mock-patch.ts @@ -70,7 +70,7 @@ export const mockPatchData: DataModel = { hostname: 'random-words', pubkey: 'npub1sg6plzptd64u62a878hep2kev88swjh3tw00gjsfl8f237lmu63q0uf63m', 'ca-fingerprint': 'SHA-256: 63 2B 11 99 44 40 17 DF 37 FC C3 DF 0F 3D 15', - 'system-start-time': new Date(new Date().valueOf() - 360042).toUTCString(), + 'ntp-synced': false, zram: false, platform: 'x86_64-nonfree', }, diff --git a/frontend/projects/ui/src/app/services/patch-db/data-model.ts b/frontend/projects/ui/src/app/services/patch-db/data-model.ts index 02af5e4a9..ba2dd4de7 100644 --- a/frontend/projects/ui/src/app/services/patch-db/data-model.ts +++ b/frontend/projects/ui/src/app/services/patch-db/data-model.ts @@ -76,7 +76,7 @@ export interface ServerInfo { hostname: string pubkey: string 'ca-fingerprint': string - 'system-start-time': string + 'ntp-synced': boolean zram: boolean platform: string } diff --git a/frontend/projects/ui/src/app/services/time-service.ts b/frontend/projects/ui/src/app/services/time-service.ts index 355a671ff..26d1a216b 100644 --- a/frontend/projects/ui/src/app/services/time-service.ts +++ b/frontend/projects/ui/src/app/services/time-service.ts @@ -1,54 +1,53 @@ import { Injectable } from '@angular/core' -import { - map, - shareReplay, - startWith, - switchMap, - take, - tap, -} from 'rxjs/operators' +import { map, shareReplay, startWith, switchMap } from 'rxjs/operators' import { PatchDB } from 'patch-db-client' import { DataModel } from './patch-db/data-model' import { ApiService } from './api/embassy-api.service' -import { combineLatest, from, timer } from 'rxjs' +import { combineLatest, from, interval } from 'rxjs' @Injectable({ providedIn: 'root', }) export class TimeService { - private readonly startTimeMs$ = this.patch - .watch$('server-info', 'system-start-time') - .pipe(map(startTime => new Date(startTime).valueOf())) - - readonly systemTime$ = from(this.apiService.getSystemTime({})).pipe( - switchMap(utcStr => { - const dateObj = new Date(utcStr) - const msRemaining = (60 - dateObj.getSeconds()) * 1000 - dateObj.setSeconds(0) - const current = dateObj.valueOf() - return timer(msRemaining, 60000).pipe( + private readonly time$ = from(this.apiService.getSystemTime({})).pipe( + switchMap(({ now, uptime }) => { + const current = new Date(now).valueOf() + return interval(1000).pipe( map(index => { const incremented = index + 1 - const msToAdd = 60000 * incremented - return current + msToAdd + return { + now: current + 1000 * incremented, + uptime: uptime + incremented, + } + }), + startWith({ + now: current, + uptime, }), - startWith(current), ) }), + shareReplay({ bufferSize: 1, refCount: true }), ) - readonly systemUptime$ = combineLatest([ - this.startTimeMs$, - this.systemTime$, + readonly now$ = combineLatest([ + this.time$, + this.patch.watch$('server-info', 'ntp-synced'), ]).pipe( - map(([startTime, currentTime]) => { - const ms = currentTime - startTime - const days = Math.floor(ms / (24 * 60 * 60 * 1000)) - const daysms = ms % (24 * 60 * 60 * 1000) - const hours = Math.floor(daysms / (60 * 60 * 1000)) - const hoursms = ms % (60 * 60 * 1000) - const minutes = Math.floor(hoursms / (60 * 1000)) - return { days, hours, minutes } + map(([time, synced]) => ({ + value: time.now, + synced, + })), + ) + + readonly uptime$ = this.time$.pipe( + map(({ uptime }) => { + const days = Math.floor(uptime / (24 * 60 * 60)) + const daysSec = uptime % (24 * 60 * 60) + const hours = Math.floor(daysSec / (60 * 60)) + const hoursSec = uptime % (60 * 60) + const minutes = Math.floor(hoursSec / 60) + const seconds = uptime % 60 + return { days, hours, minutes, seconds } }), ) diff --git a/libs/helpers/src/rsync.rs b/libs/helpers/src/rsync.rs index c09ac3d64..1ac24c8b2 100644 --- a/libs/helpers/src/rsync.rs +++ b/libs/helpers/src/rsync.rs @@ -71,7 +71,7 @@ impl Rsync { cmd.arg(format!("--exclude={}", exclude)); } let mut command = cmd - .arg("-acAXH") + .arg("-actAXH") .arg("--info=progress2") .arg("--no-inc-recursive") .arg(src.as_ref()) From 5a312b990033bae328667204aa2b6742e0b91469 Mon Sep 17 00:00:00 2001 From: Aiden McClelland <3732071+dr-bonez@users.noreply.github.com> Date: Fri, 27 Oct 2023 12:55:55 -0600 Subject: [PATCH 13/35] use correct sigterm_timeout (#2480) --- backend/src/manager/manager_seed.rs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/backend/src/manager/manager_seed.rs b/backend/src/manager/manager_seed.rs index 890e4a886..f90e7739f 100644 --- a/backend/src/manager/manager_seed.rs +++ b/backend/src/manager/manager_seed.rs @@ -1,6 +1,8 @@ use models::ErrorKind; use crate::context::RpcContext; +use crate::procedure::docker::DockerProcedure; +use crate::procedure::PackageProcedure; use crate::s9pk::manifest::Manifest; use crate::util::docker::stop_container; use crate::Error; @@ -16,11 +18,13 @@ impl ManagerSeed { pub async fn stop_container(&self) -> Result<(), Error> { match stop_container( &self.container_name, - self.manifest - .containers - .as_ref() - .and_then(|c| c.main.sigterm_timeout) - .map(|d| *d), + match &self.manifest.main { + PackageProcedure::Docker(DockerProcedure { + sigterm_timeout: Some(sigterm_timeout), + .. + }) => Some(**sigterm_timeout), + _ => None, + }, None, ) .await From 0865cffddfb7dd12d136bde715d15a88013c571e Mon Sep 17 00:00:00 2001 From: Aiden McClelland <3732071+dr-bonez@users.noreply.github.com> Date: Fri, 27 Oct 2023 12:56:06 -0600 Subject: [PATCH 14/35] add 1 day margin on start time (#2481) --- backend/src/net/ssl.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/backend/src/net/ssl.rs b/backend/src/net/ssl.rs index ba2f314b9..1f9397add 100644 --- a/backend/src/net/ssl.rs +++ b/backend/src/net/ssl.rs @@ -195,10 +195,10 @@ pub fn make_root_cert( let unix_start_time = unix_time(start_time); - let embargo = Asn1Time::from_unix(unix_start_time)?; + let embargo = Asn1Time::from_unix(unix_start_time - 86400)?; builder.set_not_before(&embargo)?; - let expiration = Asn1Time::from_unix(unix_start_time + (10 * 365 * 86400))?; + let expiration = Asn1Time::from_unix(unix_start_time + (10 * 364 * 86400))?; builder.set_not_after(&expiration)?; builder.set_serial_number(&*rand_serial()?)?; @@ -252,10 +252,10 @@ pub fn make_int_cert( let unix_start_time = unix_time(start_time); - let embargo = Asn1Time::from_unix(unix_start_time)?; + let embargo = Asn1Time::from_unix(unix_start_time - 86400)?; builder.set_not_before(&embargo)?; - let expiration = Asn1Time::from_unix(unix_start_time + (10 * 365 * 86400))?; + let expiration = Asn1Time::from_unix(unix_start_time + (10 * 364 * 86400))?; builder.set_not_after(&expiration)?; builder.set_serial_number(&*rand_serial()?)?; @@ -381,7 +381,7 @@ pub fn make_leaf_cert( let embargo = Asn1Time::from_unix(unix_time(SystemTime::now()) - 86400)?; builder.set_not_before(&embargo)?; - // Google Apple and Mozilla reject certificate horizons longer than 397 days + // Google Apple and Mozilla reject certificate horizons longer than 398 days // https://techbeacon.com/security/google-apple-mozilla-enforce-1-year-max-security-certifications let expiration = Asn1Time::days_from_now(397)?; builder.set_not_after(&expiration)?; From 182a0954201af3df751d6bf98ca9361e347a9552 Mon Sep 17 00:00:00 2001 From: Aiden McClelland <3732071+dr-bonez@users.noreply.github.com> Date: Fri, 27 Oct 2023 17:32:21 -0600 Subject: [PATCH 15/35] use old secret key derivation function (#2482) * use old secret key derivation function * compat * cargo --- backend/Cargo.lock | 1 + backend/Cargo.toml | 2 +- backend/src/util/crypto.rs | 12 ++++-------- system-images/compat/Cargo.lock | 1 + 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/backend/Cargo.lock b/backend/Cargo.lock index c2b316f24..1607bf7f2 100644 --- a/backend/Cargo.lock +++ b/backend/Cargo.lock @@ -4911,6 +4911,7 @@ dependencies = [ "digest 0.10.7", "divrem", "ed25519 2.2.3", + "ed25519-dalek 1.0.1", "ed25519-dalek 2.0.0", "embassy_container_init", "emver", diff --git a/backend/Cargo.toml b/backend/Cargo.toml index bd9b4e608..444ad3cf3 100644 --- a/backend/Cargo.toml +++ b/backend/Cargo.toml @@ -66,11 +66,11 @@ divrem = "1.0.0" ed25519 = { version = "2.2.3", features = ["pkcs8", "pem", "alloc"] } ed25519-dalek = { version = "2.0.0", features = [ "serde", - "hazmat", "zeroize", "rand_core", "digest", ] } +ed25519-dalek-v1 = { package = "ed25519-dalek", version = "1" } embassy_container_init = { path = "../libs/embassy_container_init" } emver = { version = "0.1.7", git = "https://github.com/Start9Labs/emver-rs.git", features = [ "serde", diff --git a/backend/src/util/crypto.rs b/backend/src/util/crypto.rs index ba9f68599..5c1aed01e 100644 --- a/backend/src/util/crypto.rs +++ b/backend/src/util/crypto.rs @@ -1,13 +1,9 @@ -use ed25519_dalek::hazmat::ExpandedSecretKey; use ed25519_dalek::{SecretKey, EXPANDED_SECRET_KEY_LENGTH}; #[inline] pub fn ed25519_expand_key(key: &SecretKey) -> [u8; EXPANDED_SECRET_KEY_LENGTH] { - let key = ExpandedSecretKey::from(key); - - let mut bytes: [u8; 64] = [0u8; 64]; - - bytes[..32].copy_from_slice(key.scalar.as_bytes()); - bytes[32..].copy_from_slice(&key.hash_prefix[..]); - bytes + ed25519_dalek_v1::ExpandedSecretKey::from( + &ed25519_dalek_v1::SecretKey::from_bytes(key).unwrap(), + ) + .to_bytes() } diff --git a/system-images/compat/Cargo.lock b/system-images/compat/Cargo.lock index f28d2379e..68b670cb0 100644 --- a/system-images/compat/Cargo.lock +++ b/system-images/compat/Cargo.lock @@ -4421,6 +4421,7 @@ dependencies = [ "digest 0.10.7", "divrem", "ed25519 2.2.3", + "ed25519-dalek 1.0.1", "ed25519-dalek 2.0.0", "embassy_container_init", "emver", From 765b5422647275fc8b674621b9c9bed72c772e43 Mon Sep 17 00:00:00 2001 From: Aiden McClelland <3732071+dr-bonez@users.noreply.github.com> Date: Fri, 27 Oct 2023 17:34:02 -0600 Subject: [PATCH 16/35] actually enable zram during migration (#2483) actually enable zram during mifration --- backend/src/version/v0_3_5.rs | 71 ++++++++++++++++++----------------- 1 file changed, 37 insertions(+), 34 deletions(-) diff --git a/backend/src/version/v0_3_5.rs b/backend/src/version/v0_3_5.rs index 6613fb888..ba28cd468 100644 --- a/backend/src/version/v0_3_5.rs +++ b/backend/src/version/v0_3_5.rs @@ -61,43 +61,46 @@ impl VersionT for Version { } } } - db.mutate(|v| { - v.as_server_info_mut().as_zram_mut().ser(&true)?; - for (_, pde) in v.as_package_data_mut().as_entries_mut()? { - for (dependency, info) in pde - .as_installed_mut() - .map(|i| i.as_dependency_info_mut().as_entries_mut()) - .transpose()? - .into_iter() - .flatten() - { - if let Some(url) = url_replacements.get(&dependency) { - info.as_icon_mut().ser(url)?; - } else { - info.as_icon_mut().ser(&DataUrl::from_slice( - "image/png", - include_bytes!("../install/package-icon.png"), - ))?; - } - let manifest = <&mut Value>::from(&mut *info) - .as_object_mut() - .and_then(|o| o.remove("manifest")); - if let Some(title) = manifest - .as_ref() - .and_then(|m| m.as_object()) - .and_then(|m| m.get("title")) - .and_then(|t| t.as_str()) - .map(|s| s.to_owned()) + let prev_zram = db + .mutate(|v| { + for (_, pde) in v.as_package_data_mut().as_entries_mut()? { + for (dependency, info) in pde + .as_installed_mut() + .map(|i| i.as_dependency_info_mut().as_entries_mut()) + .transpose()? + .into_iter() + .flatten() { - info.as_title_mut().ser(&title)?; - } else { - info.as_title_mut().ser(&dependency.to_string())?; + if let Some(url) = url_replacements.get(&dependency) { + info.as_icon_mut().ser(url)?; + } else { + info.as_icon_mut().ser(&DataUrl::from_slice( + "image/png", + include_bytes!("../install/package-icon.png"), + ))?; + } + let manifest = <&mut Value>::from(&mut *info) + .as_object_mut() + .and_then(|o| o.remove("manifest")); + if let Some(title) = manifest + .as_ref() + .and_then(|m| m.as_object()) + .and_then(|m| m.get("title")) + .and_then(|t| t.as_str()) + .map(|s| s.to_owned()) + { + info.as_title_mut().ser(&title)?; + } else { + info.as_title_mut().ser(&dependency.to_string())?; + } } } - } - Ok(()) - }) - .await?; + v.as_server_info_mut().as_zram_mut().replace(&true) + }) + .await?; + if !prev_zram { + crate::system::enable_zram().await?; + } Ok(()) } async fn down(&self, _db: PatchDb, _secrets: &PgPool) -> Result<(), Error> { From 9e554bdecdcc3fd956fd3fd50b0e4533aaf9f6bf Mon Sep 17 00:00:00 2001 From: Aiden McClelland <3732071+dr-bonez@users.noreply.github.com> Date: Mon, 30 Oct 2023 10:43:00 -0600 Subject: [PATCH 17/35] cleanup network keys on uninstall (#2484) --- ...c74b79bd10d5717b2a0ddecf22330b7d531aac7c5d.json | 14 ++++++++++++++ backend/src/install/cleanup.rs | 9 ++++++--- 2 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 backend/.sqlx/query-b203820ee1c553a4b246eac74b79bd10d5717b2a0ddecf22330b7d531aac7c5d.json diff --git a/backend/.sqlx/query-b203820ee1c553a4b246eac74b79bd10d5717b2a0ddecf22330b7d531aac7c5d.json b/backend/.sqlx/query-b203820ee1c553a4b246eac74b79bd10d5717b2a0ddecf22330b7d531aac7c5d.json new file mode 100644 index 000000000..b76542db8 --- /dev/null +++ b/backend/.sqlx/query-b203820ee1c553a4b246eac74b79bd10d5717b2a0ddecf22330b7d531aac7c5d.json @@ -0,0 +1,14 @@ +{ + "db_name": "PostgreSQL", + "query": "DELETE FROM network_keys WHERE package = $1", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [] + }, + "hash": "b203820ee1c553a4b246eac74b79bd10d5717b2a0ddecf22330b7d531aac7c5d" +} diff --git a/backend/src/install/cleanup.rs b/backend/src/install/cleanup.rs index 9d87f63e9..d90ec502c 100644 --- a/backend/src/install/cleanup.rs +++ b/backend/src/install/cleanup.rs @@ -173,7 +173,7 @@ where ); cleanup(ctx, id, &version).await?; cleanup_folder(volume_dir, Arc::new(dependents_paths)).await; - remove_tor_keys(secrets, id).await?; + remove_network_keys(secrets, id).await?; ctx.db .mutate(|d| { @@ -188,12 +188,15 @@ where } #[instrument(skip_all)] -pub async fn remove_tor_keys(secrets: &mut Ex, id: &PackageId) -> Result<(), Error> +pub async fn remove_network_keys(secrets: &mut Ex, id: &PackageId) -> Result<(), Error> where for<'a> &'a mut Ex: Executor<'a, Database = Postgres>, { + sqlx::query!("DELETE FROM network_keys WHERE package = $1", &*id) + .execute(&mut *secrets) + .await?; sqlx::query!("DELETE FROM tor WHERE package = $1", &*id) - .execute(secrets) + .execute(&mut *secrets) .await?; Ok(()) } From e5b137b331f95243003e039271524d659102a26c Mon Sep 17 00:00:00 2001 From: J H <2364004+Blu-J@users.noreply.github.com> Date: Tue, 31 Oct 2023 15:38:00 -0600 Subject: [PATCH 18/35] fix: Logging in deno to filter out the info (#2487) Co-authored-by: jh --- backend/src/bins/start_deno.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/backend/src/bins/start_deno.rs b/backend/src/bins/start_deno.rs index 43c97485a..e453e941b 100644 --- a/backend/src/bins/start_deno.rs +++ b/backend/src/bins/start_deno.rs @@ -69,13 +69,12 @@ impl PackageLogger { use tracing_subscriber::prelude::*; use tracing_subscriber::{fmt, EnvFilter}; - let filter_layer = EnvFilter::builder() - .with_default_directive( - format!("{}=info", std::module_path!().split("::").next().unwrap()) + let filter_layer = EnvFilter::default() + .add_directive( + format!("{}=warn", std::module_path!().split("::").next().unwrap()) .parse() .unwrap(), - ) - .from_env_lossy(); + ); let fmt_layer = fmt::layer().with_writer(std::io::stderr).with_target(true); let journald_layer = tracing_journald::layer() .unwrap() From 547747ff740595e5a090fac4337c17ae6c6dc9de Mon Sep 17 00:00:00 2001 From: Aiden McClelland <3732071+dr-bonez@users.noreply.github.com> Date: Wed, 1 Nov 2023 13:22:34 -0600 Subject: [PATCH 19/35] continuous deployment (#2485) * continuous deployment * fix * escape braces in format string * Update upload-ota.sh * curl fail on http error --- .github/workflows/startos-iso.yaml | 44 ++++++++++++++++++++++ Makefile | 3 ++ basename.sh | 2 +- build/registry/downloadIndexActionResult | 45 ++++++++++++++++++++++ build/registry/resync.cgi | 22 +++++++++++ build/registry/resyncRsyncRegistry | 8 ++-- build/registry/setOsCommitHash | 39 +++++++++++++++++++ build/registry/upload.cgi | 48 ++++++++++++++++++++++++ upload-ota.sh | 34 +++++++++++++++++ 9 files changed, 241 insertions(+), 4 deletions(-) create mode 100644 build/registry/downloadIndexActionResult create mode 100644 build/registry/resync.cgi create mode 100644 build/registry/setOsCommitHash create mode 100644 build/registry/upload.cgi create mode 100755 upload-ota.sh diff --git a/.github/workflows/startos-iso.yaml b/.github/workflows/startos-iso.yaml index 6873b29cb..ecf15a54f 100644 --- a/.github/workflows/startos-iso.yaml +++ b/.github/workflows/startos-iso.yaml @@ -31,6 +31,13 @@ on: - aarch64 - aarch64-nonfree - raspberrypi + deploy: + type: choice + description: Deploy + options: + - NONE + - alpha + - beta push: branches: - master @@ -191,3 +198,40 @@ jobs: name: ${{ matrix.platform }}.img path: results/*.img if: ${{ matrix.platform == 'raspberrypi' }} + + - name: Upload OTA to registry + run: >- + PLATFORM=${{ matrix.platform }} make upload-ota TARGET="${{ + fromJson('{ + "alpha": "alpha-registry-x.start9.com", + "beta": "beta-registry.start9.com", + }')[github.event.inputs.deploy] + }}" KEY="${{ + fromJson( + format('{{ + "alpha": "{0}", + "beta": "{1}", + }}', secrets.ALPHA_INDEX_KEY, secrets.BETA_INDEX_KEY) + )[github.event.inputs.deploy] + }}" + if: ${{ github.event.inputs.deploy != '' && github.event.inputs.deploy != 'NONE' }} + + index: + if: ${{ github.event.inputs.deploy != '' && github.event.inputs.deploy != 'NONE' }} + needs: [image] + runs-on: ubuntu-22.04 + steps: + - run: >- + curl "https://${{ + fromJson('{ + "alpha": "alpha-registry-x.start9.com", + "beta": "beta-registry.start9.com", + }')[github.event.inputs.deploy] + }}:8443/resync.cgi?key=${{ + fromJson( + format('{{ + "alpha": "{0}", + "beta": "{1}", + }}', secrets.ALPHA_INDEX_KEY, secrets.BETA_INDEX_KEY) + )[github.event.inputs.deploy] + }}" diff --git a/Makefile b/Makefile index 07a18aadb..583231f1b 100644 --- a/Makefile +++ b/Makefile @@ -158,6 +158,9 @@ emulate-reflash: $(ALL_TARGETS) $(MAKE) install REMOTE=$(REMOTE) SSHPASS=$(SSHPASS) DESTDIR=/media/embassy/next PLATFORM=$(PLATFORM) $(call ssh,"sudo touch /media/embassy/config/upgrade && sudo rm -f /media/embassy/config/disk.guid && sudo sync && sudo reboot") +upload-ota: results/$(BASENAME).squashfs + TARGET=$(TARGET) KEY=$(KEY) ./upload-ota.sh + build/lib/depends build/lib/conflicts: build/dpkg-deps/* build/dpkg-deps/generate.sh diff --git a/basename.sh b/basename.sh index 17eb62623..679faa5bc 100755 --- a/basename.sh +++ b/basename.sh @@ -2,7 +2,7 @@ cd "$(dirname "${BASH_SOURCE[0]}")" -PLATFORM=$(if [ -f ./PLATFORM.txt ]; then cat ./PLATFORM.txt; else echo unknown; fi) +PLATFORM="$(if [ -f ./PLATFORM.txt ]; then cat ./PLATFORM.txt; else echo unknown; fi)" VERSION="$(cat ./VERSION.txt)" GIT_HASH="$(cat ./GIT_HASH.txt)" if [[ "$GIT_HASH" =~ ^@ ]]; then diff --git a/build/registry/downloadIndexActionResult b/build/registry/downloadIndexActionResult new file mode 100644 index 000000000..4bda4c6b8 --- /dev/null +++ b/build/registry/downloadIndexActionResult @@ -0,0 +1,45 @@ +#!/bin/bash + +set -e + +RUN_ID=$1 + +if [ -z "$RUN_ID" ]; then + >&2 echo usage: $0 '' + exit 1 +fi + +TMP_DIR=/var/tmp/action-run-results/$RUN_ID + +rm -rf $TMP_DIR +mkdir -p $TMP_DIR + +cd $TMP_DIR + +for arch in x86_64 x86_64-nonfree aarch64 aarch64-nonfree raspberrypi; do + gh run download -R Start9Labs/start-os $RUN_ID -n $arch.squashfs +done + +VERSION= +HASH= +for file in $(ls *.squashfs); do + if [[ $file =~ ^startos-([0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?)-([a-f0-9]{7}(~[a-z-]+)?|unknown)_([a-z0-9_-]+).squashfs$ ]]; then + if [ -n "$VERSION" ] && [ "$VERSION" != "${BASH_REMATCH[1]}" ]; then + >&2 echo "VERSION MISMATCH: expected $VERSION got ${BASH_REMATCH[1]}" + exit 2 + fi + if [ -n "$HASH" ] && [ "$HASH" != "${BASH_REMATCH[3]}" ]; then + >&2 echo "HASH MISMATCH: expected $HASH got ${BASH_REMATCH[3]}" + exit 3 + fi + VERSION="${BASH_REMATCH[1]}" + HASH="${BASH_REMATCH[3]}" + fi +done + +mkdir -p /root/resources/eos/$VERSION +rm -rf /root/resources/eos/$VERSION/$HASH +mv $TMP_DIR /root/resources/eos/$VERSION/$HASH + +cd /root/resources/eos/$VERSION +setOsCommitHash $HASH \ No newline at end of file diff --git a/build/registry/resync.cgi b/build/registry/resync.cgi new file mode 100644 index 000000000..f8479824f --- /dev/null +++ b/build/registry/resync.cgi @@ -0,0 +1,22 @@ +#!/bin/bash + +declare -A params +while IFS='=' read -r -d '&' key value && [[ -n "$key" ]]; do + params["$key"]=$value +done <<<"${QUERY_STRING}&" + +index_key="${params['key']}" +if [ -z "$index_key" ] || [ "$index_key" != "$(cat /var/www/index_key.txt)" ]; then + echo "HTTP/1.1 401 UNAUTHORIZED" + echo "Content-Type: text/html" + echo + echo "UNAUTHORIZED" + exit +fi + +touch /tmp/resync + +echo "HTTP/1.1 200 OK" +echo "Content-Type: text/html" +echo +echo "OK: Upload successful" \ No newline at end of file diff --git a/build/registry/resyncRsyncRegistry b/build/registry/resyncRsyncRegistry index f3e803ff7..2f5aba510 100755 --- a/build/registry/resyncRsyncRegistry +++ b/build/registry/resyncRsyncRegistry @@ -6,12 +6,14 @@ # Then we are going to make sure that each of these files is then put on the rsyncd server # so the embassies can pull them down +date >> /var/log/resyncRsyncRegistry.runlog + cat > /etc/rsyncd.conf << RD uid = root gid = root use chroot = yes -max connections = 50 +max connections = 4 pid file = /var/run/rsyncd.pid exclude = lost+found/ timeout = 900 @@ -27,7 +29,7 @@ do filename=${dir##*/} version=$(echo $directory | sed -r 's/.*\///') version_dir="/srv/rsync/$version" - type=$(echo "$filename" | sed -r "s/^.*?\.(\w+)\.squashfs$/\1/") + type=$(echo "$filename" | sed -r "s/^.*?\.([a-z0-9_-]+)\.squashfs$/\1/") new_dir="$version_dir/$type" @@ -51,4 +53,4 @@ INSERTING done echo "Created rsyncd.conf file, restarting service" -systemctl restart rsync +systemctl restart rsync \ No newline at end of file diff --git a/build/registry/setOsCommitHash b/build/registry/setOsCommitHash new file mode 100644 index 000000000..8da761200 --- /dev/null +++ b/build/registry/setOsCommitHash @@ -0,0 +1,39 @@ +#!/bin/bash + +# Get the current directory +PWD=$(pwd) +HASH=$1 + +if [ -z "$HASH" ]; then + >&2 echo "usage: setOsCommitHash " + exit 1 +fi + +# Define the expected pattern for the directory +pattern="/root/resources/eos/" + +# Check if the current directory matches the pattern +if [[ $PWD =~ ^$pattern([0-9.]+)$ ]]; then + # Extract the version number from the directory path + version="${BASH_REMATCH[1]}" +else + >&2 echo "MUST BE IN OS VERSION DIRECTORY" + exit 1 +fi + +if ! [ -d "$HASH" ]; then + >&2 echo "$HASH: No such directory" + exit 1 +fi + +for file in $(ls $HASH/startos-$version-${HASH}_*.squashfs); do + if [[ $file =~ ^$HASH/startos-$version-${HASH}_([a-z0-9_-]+).squashfs$ ]]; then + arch="${BASH_REMATCH[1]}" + echo "Found arch $arch" + umount /srv/rsync/$version/$arch + rm eos.$arch.squashfs + ln -s $file eos.$arch.squashfs + fi +done + +resyncRsyncRegistry \ No newline at end of file diff --git a/build/registry/upload.cgi b/build/registry/upload.cgi new file mode 100644 index 000000000..b5dd79a82 --- /dev/null +++ b/build/registry/upload.cgi @@ -0,0 +1,48 @@ +#!/bin/bash + +declare -A params +while IFS='=' read -r -d '&' key value && [[ -n "$key" ]]; do + params["$key"]=$value +done <<<"${QUERY_STRING}&" + +index_key="${params['key']}" +if [ -z "$index_key" ] || [ "$index_key" != "$(cat /var/www/index_key.txt)" ]; then + echo "HTTP/1.1 401 UNAUTHORIZED" + echo "Content-Type: text/html" + echo + echo "UNAUTHORIZED" + exit +fi + +git_hash="${params['gitHash']}" +version="${params['version']}" +platform="${params['platform']}" +shasum="${params['shasum']}" +if [ -z "$git_hash" ] || [ -z "$version" ] || [ -z "$platform" ] || [ -z "$shasum" ]; then + echo "HTTP/1.1 400 BAD REQUEST" + echo "Content-Type: text/html" + echo + echo "BAD REQUEST: missing param" + exit +fi + +tmp_file=$(mktemp /var/tmp/tmp.XXXXXXXXXX.squashfs) +cat > $tmp_file + +if ! sha256sum $tmp_file | grep "$shasum"; then + rm $tmp_file + echo "HTTP/1.1 400 BAD REQUEST" + echo "Content-Type: text/html" + echo + echo "BAD REQUEST: shasum mismatch" +fi + +mkdir -p /var/www/resources/eos/${version}/${git_hash} +mv $tmp_file /var/www/resources/eos/${version}/${git_hash}/startos-${version}-${git_hash}_${platform}.squashfs +rm /var/www/resources/eos/${version}/eos.${platform}.squashfs +ln -rs /var/www/resources/eos/${version}/${git_hash}/startos-${version}-${git_hash}_${platform}.squashfs /var/www/resources/eos/${version}/eos.${platform}.squashfs + +echo "HTTP/1.1 200 OK" +echo "Content-Type: text/html" +echo +echo "OK: Upload successful" \ No newline at end of file diff --git a/upload-ota.sh b/upload-ota.sh new file mode 100755 index 000000000..7204486df --- /dev/null +++ b/upload-ota.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +set -e + +cd "$(dirname "${BASH_SOURCE[0]}")" + +if [ -z "$TARGET" ]; then + >&2 echo "TARGET is required" + exit 1 +fi + +if [ -z "$KEY" ]; then + >&2 echo "KEY is required" + exit 1 +fi + +PLATFORM="$(cat ./PLATFORM.txt)" +VERSION="$(cat ./VERSION.txt)" +GIT_HASH="$(cat ./GIT_HASH.txt)" +if [[ "$GIT_HASH" =~ ^@ ]]; then + GIT_HASH=unknown +else + GIT_HASH="$(echo -n "$GIT_HASH" | head -c 7)" +fi +STARTOS_ENV="$(cat ./ENVIRONMENT.txt)" +if [ -n "$STARTOS_ENV" ]; then + GIT_HASH="$GIT_HASH~${STARTOS_ENV}" +fi + +BASENAME="startos-${VERSION}-${GIT_HASH}_${PLATFORM}" + +SHASUM=$(sha256sum results/$BASENAME.squashfs | awk '{print $1}') + +curl --fail-with-body -T results/${BASENAME}.squashfs "https://${TARGET}:8443/upload.cgi?key=${KEY}&gitHash=${GIT_HASH}&version=${VERSION}&platform=${PLATFORM}&shasum=${SHASUM}" \ No newline at end of file From 2b9e7432b89d2947762cf8cf586b8222fedd600a Mon Sep 17 00:00:00 2001 From: Mariusz Kogen Date: Wed, 1 Nov 2023 20:22:49 +0100 Subject: [PATCH 20/35] Updated motd with new logo (#2488) --- build/lib/motd | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/build/lib/motd b/build/lib/motd index 5de21ec53..04b31d3f2 100755 --- a/build/lib/motd +++ b/build/lib/motd @@ -2,15 +2,23 @@ printf "\n" printf "Welcome to\n" cat << "ASCII" -╭ ━ ━ ━ ╮ ╭ ╮ ╱ ╱ ╱ ╱ ╱ ╭ ╮ ╭ ━ ━ ━ ┳ ━ ━ ━ ╮ -┃ ╭ ━ ╮ ┣ ╯ ╰ ╮ ╱ ╱ ╱ ╭ ╯ ╰ ┫ ╭ ━ ╮ ┃ ╭ ━ ╮ ┃ -┃ ╰ ━ ━ ╋ ╮ ╭ ╋ ━ ━ ┳ ┻ ╮ ╭ ┫ ┃ ╱ ┃ ┃ ╰ ━ ━ ╮ -╰ ━ ━ ╮ ┃ ┃ ┃ ┃ ╭ ╮ ┃ ╭ ┫ ┃ ┃ ┃ ╱ ┃ ┣ ━ ━ ╮ ┃ -┃ ╰ ━ ╯ ┃ ┃ ╰ ┫ ╭ ╮ ┃ ┃ ┃ ╰ ┫ ╰ ━ ╯ ┃ ╰ ━ ╯ ┃ -╰ ━ ━ ━ ╯ ╰ ━ ┻ ╯ ╰ ┻ ╯ ╰ ━ ┻ ━ ━ ━ ┻ ━ ━ ━ ╯ + + ███████ + █ █ █ + █ █ █ █ + █ █ █ █ + █ █ █ █ + █ █ █ █ + █ █ + ███████ + + _____ __ ___ __ __ + (_ | /\ |__) | / \(_ + __) | / \| \ | \__/__) ASCII +printf " $(start-cli --version | sed 's/StartOS CLI /v/g')\n\n" printf " %s (%s %s)\n" "$(uname -o)" "$(uname -r)" "$(uname -m)" -printf " $(start-cli --version | sed 's/StartOS CLI /StartOS v/g') - $(start-cli git-info)" +printf " Git Hash: $(start-cli git-info)" if [ -n "$(cat /usr/lib/startos/ENVIRONMENT.txt)" ]; then printf " ~ $(cat /usr/lib/startos/ENVIRONMENT.txt)\n" else @@ -18,7 +26,8 @@ else fi printf "\n" -printf " * Documentation: https://start9.com\n" +printf " * Documentation: https://docs.start9.com\n" printf " * Management: https://%s.local\n" "$(hostname)" -printf " * Support: https://t.me/start9_labs\n" +printf " * Support: https://start9.com/contact\n" +printf " * License: MIT\n" printf "\n" From c14ca1d7fd695732497408c42a2e35de725c96e6 Mon Sep 17 00:00:00 2001 From: Aiden McClelland <3732071+dr-bonez@users.noreply.github.com> Date: Wed, 1 Nov 2023 13:23:14 -0600 Subject: [PATCH 21/35] use existing dependency icon if available (#2489) --- backend/src/install/mod.rs | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/backend/src/install/mod.rs b/backend/src/install/mod.rs index 20f57764f..b46be0c4c 100644 --- a/backend/src/install/mod.rs +++ b/backend/src/install/mod.rs @@ -838,15 +838,15 @@ pub async fn install_s9pk( None }; - let icon_path = if let Some(marketplace_url) = &marketplace_url { - if let Some(manifest) = &manifest { - let dir = ctx - .datadir - .join(PKG_PUBLIC_DIR) - .join(&manifest.id) - .join(manifest.version.as_str()); - let icon_path = dir.join(format!("icon.{}", manifest.assets.icon_type())); - if tokio::fs::metadata(&icon_path).await.is_err() { + let icon_path = if let Some(manifest) = &manifest { + let dir = ctx + .datadir + .join(PKG_PUBLIC_DIR) + .join(&manifest.id) + .join(manifest.version.as_str()); + let icon_path = dir.join(format!("icon.{}", manifest.assets.icon_type())); + if tokio::fs::metadata(&icon_path).await.is_err() { + if let Some(marketplace_url) = &marketplace_url { tokio::fs::create_dir_all(&dir).await?; let icon = ctx .client @@ -864,10 +864,12 @@ pub async fn install_s9pk( let mut dst = File::create(&icon_path).await?; tokio::io::copy(&mut response_to_reader(icon), &mut dst).await?; dst.sync_all().await?; + Some(icon_path) + } else { + None } - Some(icon_path) } else { - None + Some(icon_path) } } else { None From 1dad7965d256455522f0d9edb5f9cb11649c96de Mon Sep 17 00:00:00 2001 From: Matt Hill Date: Wed, 1 Nov 2023 13:36:56 -0600 Subject: [PATCH 22/35] rework ca-wiz and add icons to menu for warnings (#2486) * rework ca-wiz and add icons to menu for warnings * remove root CA button from home page * load fonts before calling complete in setup wiz --- .../src/app/pages/success/success.page.ts | 28 +-- .../ui/src/app/app/menu/menu.component.html | 8 +- .../ui/src/app/app/menu/menu.component.ts | 9 + .../widget-card/widget-card.component.scss | 17 +- .../widget-list/widget-list.component.html | 9 +- .../widget-list/widget-list.component.scss | 10 +- .../widget-list/widget-list.component.ts | 34 ++-- .../login/ca-wizard/ca-wizard.component.html | 168 ++++++++---------- .../login/ca-wizard/ca-wizard.component.scss | 63 ++++--- .../login/ca-wizard/ca-wizard.component.ts | 31 +--- 10 files changed, 172 insertions(+), 205 deletions(-) diff --git a/frontend/projects/setup-wizard/src/app/pages/success/success.page.ts b/frontend/projects/setup-wizard/src/app/pages/success/success.page.ts index d9bdedd46..53bc9afab 100644 --- a/frontend/projects/setup-wizard/src/app/pages/success/success.page.ts +++ b/frontend/projects/setup-wizard/src/app/pages/success/success.page.ts @@ -45,18 +45,7 @@ export class SuccessPage { async ngAfterViewInit() { this.ngZone.runOutsideAngular(() => this.initMatrix()) - try { - const ret = await this.api.complete() - if (!this.isKiosk) { - this.torAddress = ret['tor-address'] - this.lanAddress = ret['lan-address'].replace(/^https:/, 'http:') - this.cert = ret['root-ca'] - - await this.api.exit() - } - } catch (e: any) { - await this.errCtrl.present(e) - } + setTimeout(() => this.complete(), 1000) } download() { @@ -83,6 +72,21 @@ export class SuccessPage { this.api.exit() } + private async complete() { + try { + const ret = await this.api.complete() + if (!this.isKiosk) { + this.torAddress = ret['tor-address'] + this.lanAddress = ret['lan-address'].replace(/^https:/, 'http:') + this.cert = ret['root-ca'] + + await this.api.exit() + } + } catch (e: any) { + await this.errCtrl.present(e) + } + } + private initMatrix() { this.ctx = this.canvas.nativeElement.getContext('2d')! this.canvas.nativeElement.width = window.innerWidth diff --git a/frontend/projects/ui/src/app/app/menu/menu.component.html b/frontend/projects/ui/src/app/app/menu/menu.component.html index a82ff4d7a..a54033b67 100644 --- a/frontend/projects/ui/src/app/app/menu/menu.component.html +++ b/frontend/projects/ui/src/app/app/menu/menu.component.html @@ -22,11 +22,17 @@ {{ page.title }} + !synced)), + ) + constructor( private readonly patch: PatchDB, private readonly eosService: EOSService, @@ -119,5 +127,6 @@ export class MenuComponent { private readonly splitPane: SplitPaneTracker, private readonly emver: Emver, private readonly connectionService: ConnectionService, + private readonly config: ConfigService, ) {} } diff --git a/frontend/projects/ui/src/app/components/widget-card/widget-card.component.scss b/frontend/projects/ui/src/app/components/widget-card/widget-card.component.scss index 8b9dd2124..7e8b4e7cd 100644 --- a/frontend/projects/ui/src/app/components/widget-card/widget-card.component.scss +++ b/frontend/projects/ui/src/app/components/widget-card/widget-card.component.scss @@ -19,33 +19,35 @@ ion-card { font-family: 'Open Sans'; padding: 0.6rem; font-weight: 600; - font-size: calc(12px + 0.5vw); - height: 3rem; + height: 2.4rem; } ion-card-content { - min-height: 9rem; + min-height: 8rem; display: flex; flex-direction: column; justify-content: center; align-items: center; ion-icon { - font-size: calc(90px + 0.5vw); + font-size: calc(90px + 0.4vw); --ionicon-stroke-width: 1rem; } } ion-footer { - padding: 1rem; + padding: 0 1rem; font-family: 'Open Sans'; font-size: clamp(1rem, calc(12px + 0.5vw), 1.3rem); - height: 9rem; + height: 4.5rem; width: clamp(13rem, 80%, 18rem); margin: 0 auto; * { max-width: 100%; } + p { + margin-top: 0; + } } .footer-md::before { @@ -54,9 +56,6 @@ ion-card { } @media (max-width: 900px) { - ion-card-title, ion-footer { - height: auto !important; - } ion-footer { width: 10rem; } diff --git a/frontend/projects/ui/src/app/components/widget-list/widget-list.component.html b/frontend/projects/ui/src/app/components/widget-list/widget-list.component.html index 09de70b81..2c013d1c3 100644 --- a/frontend/projects/ui/src/app/components/widget-list/widget-list.component.html +++ b/frontend/projects/ui/src/app/components/widget-list/widget-list.component.html @@ -1,14 +1,7 @@
- + - StartOS - - - - - - - -

Trust your Root Certificate Authority (CA)

-

- Download and trust your server's Root CA to establish secure, encrypted - ( - HTTPS - ) connections with your server -

-
-
- - -
- - 1 - - -
-

Download Root CA

-

Download your server's Root CA

-
- - + + + +

Trust Your Root CA

+

+ Download and trust your server's Root Certificate Authority to establish a + secure ( + HTTPS + ) connection. You will need to repeat this on every device you use to + connect to your server. +

+
    +
  1. + Download your server's Root CA + . Your server uses its Root CA to generate SSL/TLS certificates for + itself and installed services. These certificates are then used to + encrypt network traffic with your client devices. +
    + Download + -
-
- -
- - 2 - - -
-

Trust Root CA

-

Follow instructions for your OS

-
- - View Docs + +
  • + Trust your server's Root CA + . Follow instructions for your OS. By trusting your server's Root CA, + your device can verify the authenticity of encrypted communications with + your server. +
    + + View Instructions -
  • -
    - -
    - 3 -
    -

    Go To Login

    -

    - - - - -  {{ caTrusted ? 'Root CA trusted!' : 'Waiting for trust...' }} -

    - - -


    -
    -
    - - Open - + +
  • + Test + . If refreshing the page does not work, you may need to quit the browser + and re-open. + Tip: before quitting, bookmark this page or copy the URL. +
    + + Refresh + -
  • -
    -
    - - - - Skip - - - - -
    + + + + Skip + + + + + + +

    Root CA Trusted!

    +

    + You have successfully trusted your server's Root CA and may now log in + securely. +

    + + Go to login + + +
    + +
    - console.warn('Failed Https connection attempt'), - ) - } + await this.testHttps().catch(e => + console.warn('Failed Https connection attempt'), + ) } download() { - this.downloadClicked = true this.document.getElementById('install-cert')?.click() } @@ -43,21 +37,10 @@ export class CAWizardComponent { '_blank', 'noreferrer', ) - this.instructionsClicked = true - this.startDaemon() } - private async startDaemon(): Promise { - this.polling = true - while (this.polling) { - try { - await this.testHttps() - this.polling = false - } catch (e) { - console.warn('Failed Https connection attempt') - await pauseFor(2000) - } - } + refresh() { + this.document.location.reload() } launchHttps() { @@ -68,8 +51,6 @@ export class CAWizardComponent { private async testHttps() { const url = `https://${this.document.location.host}${this.relativeUrl}` await this.api.echo({ message: 'ping' }, url).then(() => { - this.downloadClicked = true - this.instructionsClicked = true this.caTrusted = true }) } From 27c5464cb6b46b2fcdb41a8eaa025c21a8a7620a Mon Sep 17 00:00:00 2001 From: Aiden McClelland <3732071+dr-bonez@users.noreply.github.com> Date: Wed, 1 Nov 2023 16:28:59 -0600 Subject: [PATCH 23/35] use low mem for all argon2 configs (#2491) * reduce argon2 memory usage * update FE argon2 * fix missing typedefs * use low mem for all argon2 configs --- backend/src/account.rs | 2 +- backend/src/auth.rs | 2 +- backend/src/backup/restore.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/src/account.rs b/backend/src/account.rs index 0c06f2a5f..cb08a0d53 100644 --- a/backend/src/account.rs +++ b/backend/src/account.rs @@ -15,7 +15,7 @@ fn hash_password(password: &str) -> Result { argon2::hash_encoded( password.as_bytes(), &rand::random::<[u8; 16]>()[..], - &argon2::Config::default(), + &argon2::Config::rfc9106_low_mem(), ) .with_kind(crate::ErrorKind::PasswordHashGeneration) } diff --git a/backend/src/auth.rs b/backend/src/auth.rs index 823480fd3..a6ae2fff0 100644 --- a/backend/src/auth.rs +++ b/backend/src/auth.rs @@ -84,7 +84,7 @@ fn gen_pwd() { argon2::hash_encoded( b"testing1234", &rand::random::<[u8; 16]>()[..], - &argon2::Config::default() + &argon2::Config::rfc9106_low_mem() ) .unwrap() ) diff --git a/backend/src/backup/restore.rs b/backend/src/backup/restore.rs index 46d0b9036..b72b319e2 100644 --- a/backend/src/backup/restore.rs +++ b/backend/src/backup/restore.rs @@ -189,7 +189,7 @@ pub async fn recover_full_embassy( os_backup.account.password = argon2::hash_encoded( embassy_password.as_bytes(), &rand::random::<[u8; 16]>()[..], - &argon2::Config::default(), + &argon2::Config::rfc9106_low_mem(), ) .with_kind(ErrorKind::PasswordHashGeneration)?; From 9c6dcc4a437476984f75f4e6d709c96f367cf8e6 Mon Sep 17 00:00:00 2001 From: Matt Hill Date: Wed, 1 Nov 2023 16:30:42 -0600 Subject: [PATCH 24/35] use keys to complete setup and redesign final buttons (#2492) --- .../src/app/pages/success/success.page.html | 42 ++++++++++------- .../src/app/pages/success/success.page.scss | 47 ++++++++----------- 2 files changed, 44 insertions(+), 45 deletions(-) diff --git a/frontend/projects/setup-wizard/src/app/pages/success/success.page.html b/frontend/projects/setup-wizard/src/app/pages/success/success.page.html index b52c51efa..6479fd07d 100644 --- a/frontend/projects/setup-wizard/src/app/pages/success/success.page.html +++ b/frontend/projects/setup-wizard/src/app/pages/success/success.page.html @@ -15,16 +15,14 @@ >

    Setup Complete!

    -
    - -
    -
    -

    Continue to login

    - -
    -
    -
    -
    + @@ -63,24 +61,34 @@
    -

    Download

    +

    DOWNLOAD

    + -
    -
    -

    Login to StartOS

    - + + Trust your Root CA +

    + In the new tab, follow instructions to trust your + server's Root CA and log in. +

    +
    + +
    +
    +

    OPEN

    + +
    -
    +
    diff --git a/frontend/projects/setup-wizard/src/app/pages/success/success.page.scss b/frontend/projects/setup-wizard/src/app/pages/success/success.page.scss index cec258241..1c3681057 100644 --- a/frontend/projects/setup-wizard/src/app/pages/success/success.page.scss +++ b/frontend/projects/setup-wizard/src/app/pages/success/success.page.scss @@ -21,6 +21,15 @@ ion-grid { height: 100%; } +.login-btn { + --background: var(--color-accent); + --border-radius: 44px; + --box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25); + --padding-start: 36px; + --padding-end: 36px; + height: 76px; +} + .grid-center-wrapper { height: 100%; width: 100%; @@ -105,34 +114,6 @@ ion-card { justify-content: center; align-items: center; } - - #exit { - background: var(--color-accent); - height: 100%; - - .container p { - font-size: 1.4rem !important; - font-weight: bold; - } - - ion-icon { - font-size: 1.7rem; - } - } - - #launch { - background: var(--alt-blue); - height: 100%; - - .container p { - font-size: 1.4rem !important; - font-weight: bold; - } - - ion-icon { - font-size: 1.7rem; - } - } #information:after { content: ''; @@ -143,6 +124,16 @@ ion-card { height: 100%; background: var(--color-accent); } + + #launch:after { + content: ''; + position: absolute; + left: 0; + top: 80%; + width: 100%; + height: 100%; + background: var(--alt-blue); + } } .card-container { From b597d0366a0ad729314064005e64d042c399cbca Mon Sep 17 00:00:00 2001 From: Matt Hill Date: Wed, 1 Nov 2023 16:30:54 -0600 Subject: [PATCH 25/35] fix time display bug and type metrics (#2490) * fix time display bug and type metrics * change metrics response * nullable temp * rename percentage used * match frontend types --------- Co-authored-by: Aiden McClelland --- Makefile | 2 +- backend/src/system.rs | 80 +++---- .../server-metrics/server-metrics.page.html | 217 ++++++++++++------ .../server-metrics/server-metrics.page.scss | 3 +- .../server-metrics/server-metrics.page.ts | 19 +- .../ui/src/app/services/api/api.fixures.ts | 134 ++++++----- .../ui/src/app/services/api/api.types.ts | 34 ++- .../ui/src/app/services/time-service.ts | 5 +- 8 files changed, 284 insertions(+), 210 deletions(-) diff --git a/Makefile b/Makefile index 583231f1b..625a4cec2 100644 --- a/Makefile +++ b/Makefile @@ -203,7 +203,7 @@ frontend/config.json: $(GIT_HASH_FILE) frontend/config-sample.json jq '.useMocks = false' frontend/config-sample.json | jq '.gitHash = "$(shell cat GIT_HASH.txt)"' > frontend/config.json frontend/patchdb-ui-seed.json: frontend/package.json - jq '."ack-welcome" = $(shell yq '.version' frontend/package.json)' frontend/patchdb-ui-seed.json > ui-seed.tmp + jq '."ack-welcome" = $(shell jq '.version' frontend/package.json)' frontend/patchdb-ui-seed.json > ui-seed.tmp mv ui-seed.tmp frontend/patchdb-ui-seed.json patch-db/client/node_modules: patch-db/client/package.json diff --git a/backend/src/system.rs b/backend/src/system.rs index 249ade9c3..989cdc4aa 100644 --- a/backend/src/system.rs +++ b/backend/src/system.rs @@ -360,60 +360,44 @@ impl<'de> Deserialize<'de> for GigaBytes { } #[derive(Deserialize, Serialize, Clone, Debug)] +#[serde(rename_all = "kebab-case")] pub struct MetricsGeneral { - #[serde(rename = "Temperature")] - temperature: Option, + pub temperature: Option, } #[derive(Deserialize, Serialize, Clone, Debug)] +#[serde(rename_all = "kebab-case")] pub struct MetricsMemory { - #[serde(rename = "Percentage Used")] pub percentage_used: Percentage, - #[serde(rename = "Total")] pub total: MebiBytes, - #[serde(rename = "Available")] pub available: MebiBytes, - #[serde(rename = "Used")] pub used: MebiBytes, - #[serde(rename = "Swap Total")] - pub swap_total: MebiBytes, - #[serde(rename = "Swap Free")] - pub swap_free: MebiBytes, - #[serde(rename = "Swap Used")] - pub swap_used: MebiBytes, + pub zram_total: MebiBytes, + pub zram_available: MebiBytes, + pub zram_used: MebiBytes, } #[derive(Deserialize, Serialize, Clone, Debug)] +#[serde(rename_all = "kebab-case")] pub struct MetricsCpu { - #[serde(rename = "User Space")] - user_space: Percentage, - #[serde(rename = "Kernel Space")] - kernel_space: Percentage, - #[serde(rename = "I/O Wait")] - wait: Percentage, - #[serde(rename = "Idle")] + percentage_used: Percentage, idle: Percentage, - #[serde(rename = "Usage")] - usage: Percentage, + user_space: Percentage, + kernel_space: Percentage, + wait: Percentage, } #[derive(Deserialize, Serialize, Clone, Debug)] +#[serde(rename_all = "kebab-case")] pub struct MetricsDisk { - #[serde(rename = "Size")] - size: GigaBytes, - #[serde(rename = "Used")] + percentage_used: Percentage, used: GigaBytes, - #[serde(rename = "Available")] available: GigaBytes, - #[serde(rename = "Percentage Used")] - used_percentage: Percentage, + capacity: GigaBytes, } #[derive(Deserialize, Serialize, Clone, Debug)] +#[serde(rename_all = "kebab-case")] pub struct Metrics { - #[serde(rename = "General")] general: MetricsGeneral, - #[serde(rename = "Memory")] memory: MetricsMemory, - #[serde(rename = "CPU")] cpu: MetricsCpu, - #[serde(rename = "Disk")] disk: MetricsDisk, } @@ -739,7 +723,7 @@ async fn get_cpu_info(last: &mut ProcStat) -> Result { kernel_space: Percentage((new.system() - last.system()) as f64 * 100.0 / total_diff as f64), idle: Percentage((new.idle - last.idle) as f64 * 100.0 / total_diff as f64), wait: Percentage((new.iowait - last.iowait) as f64 * 100.0 / total_diff as f64), - usage: Percentage((new.used() - last.used()) as f64 * 100.0 / total_diff as f64), + percentage_used: Percentage((new.used() - last.used()) as f64 * 100.0 / total_diff as f64), }; *last = new; Ok(res) @@ -752,8 +736,8 @@ pub struct MemInfo { buffers: Option, cached: Option, slab: Option, - swap_total: Option, - swap_free: Option, + zram_total: Option, + zram_free: Option, } #[instrument(skip_all)] pub async fn get_mem_info() -> Result { @@ -765,8 +749,8 @@ pub async fn get_mem_info() -> Result { buffers: None, cached: None, slab: None, - swap_total: None, - swap_free: None, + zram_total: None, + zram_free: None, }; fn get_num_kb(l: &str) -> Result { let e = Error::new( @@ -791,8 +775,8 @@ pub async fn get_mem_info() -> Result { _ if entry.starts_with("Buffers") => mem_info.buffers = Some(get_num_kb(entry)?), _ if entry.starts_with("Cached") => mem_info.cached = Some(get_num_kb(entry)?), _ if entry.starts_with("Slab") => mem_info.slab = Some(get_num_kb(entry)?), - _ if entry.starts_with("SwapTotal") => mem_info.swap_total = Some(get_num_kb(entry)?), - _ if entry.starts_with("SwapFree") => mem_info.swap_free = Some(get_num_kb(entry)?), + _ if entry.starts_with("SwapTotal") => mem_info.zram_total = Some(get_num_kb(entry)?), + _ if entry.starts_with("SwapFree") => mem_info.zram_free = Some(get_num_kb(entry)?), _ => (), } } @@ -808,24 +792,24 @@ pub async fn get_mem_info() -> Result { let buffers = ensure_present(mem_info.buffers, "Buffers")?; let cached = ensure_present(mem_info.cached, "Cached")?; let slab = ensure_present(mem_info.slab, "Slab")?; - let swap_total_k = ensure_present(mem_info.swap_total, "SwapTotal")?; - let swap_free_k = ensure_present(mem_info.swap_free, "SwapFree")?; + let zram_total_k = ensure_present(mem_info.zram_total, "SwapTotal")?; + let zram_free_k = ensure_present(mem_info.zram_free, "SwapFree")?; let total = MebiBytes(mem_total as f64 / 1024.0); let available = MebiBytes(mem_available as f64 / 1024.0); let used = MebiBytes((mem_total - mem_free - buffers - cached - slab) as f64 / 1024.0); - let swap_total = MebiBytes(swap_total_k as f64 / 1024.0); - let swap_free = MebiBytes(swap_free_k as f64 / 1024.0); - let swap_used = MebiBytes((swap_total_k - swap_free_k) as f64 / 1024.0); + let zram_total = MebiBytes(zram_total_k as f64 / 1024.0); + let zram_available = MebiBytes(zram_free_k as f64 / 1024.0); + let zram_used = MebiBytes((zram_total_k - zram_free_k) as f64 / 1024.0); let percentage_used = Percentage((total.0 - available.0) / total.0 * 100.0); Ok(MetricsMemory { percentage_used, total, available, used, - swap_total, - swap_free, - swap_used, + zram_total, + zram_available, + zram_used, }) } @@ -849,10 +833,10 @@ async fn get_disk_info() -> Result { let total_percentage = total_used as f64 / total_size as f64 * 100.0f64; Ok(MetricsDisk { - size: GigaBytes(total_size as f64 / 1_000_000_000.0), + capacity: GigaBytes(total_size as f64 / 1_000_000_000.0), used: GigaBytes(total_used as f64 / 1_000_000_000.0), available: GigaBytes(total_available as f64 / 1_000_000_000.0), - used_percentage: Percentage(total_percentage as f64), + percentage_used: Percentage(total_percentage as f64), }) } diff --git a/frontend/projects/ui/src/app/pages/server-routes/server-metrics/server-metrics.page.html b/frontend/projects/ui/src/app/pages/server-routes/server-metrics/server-metrics.page.html index 91b00fb28..0926334aa 100644 --- a/frontend/projects/ui/src/app/pages/server-routes/server-metrics/server-metrics.page.html +++ b/frontend/projects/ui/src/app/pages/server-routes/server-metrics/server-metrics.page.html @@ -11,74 +11,155 @@ - - -
    - - - - - -

    System Time

    -

    - - {{ now.value | date:'MMMM d, y, h:mm a z':'UTC' }} - -

    -

    - - NTP not synced, time could be wrong - -

    -
    - -
    - - - -

    System Time

    -

    Loading...

    -
    - -
    -
    - - - -

    System Uptime

    -

    - - - {{ uptime.days }} - Days, - {{ uptime.hours }} - Hours, - {{ uptime.minutes }} - Minutes, - {{ uptime.seconds }} - Seconds - - -

    -
    -
    -
    - - - {{ metricGroup.key }} - - {{ metric.key }} - + + + +

    System Time

    + +

    - {{ metric.value.value }} {{ metric.value.unit }} + {{ now.value | date:'MMMM d, y, h:mm a z':'UTC' }} - - - - -

    + +

    + + NTP not synced, time could be wrong + +

    + + +

    Loading...

    +
    + + + + + + +

    System Uptime

    +

    + + + {{ uptime.days }} + Days, + {{ uptime.hours }} + Hours, + {{ uptime.minutes }} + Minutes, + {{ uptime.seconds }} + Seconds + + Loading... + +

    +
    +
    + + + + + General + + Temperature + + + {{ general.temperature.value }} °C + + N/A + + + + + + Memory + + Percentage Used + {{ memory['percentage-used'].value }} % + + + Total + + {{ memory.total.value }} MiB + + + + Used + + {{ memory.used.value }} MiB + + + + Available + {{ memory.available.value }} MiB + + + zram Used + {{ memory['zram-used'].value }} MiB + + + zram Total + {{ memory['zram-total'].value }} MiB + + + zram Available + {{ memory['zram-available'].value }} MiB + + + + + CPU + + Percentage Used + {{ cpu['percentage-used'].value }} % + + + User Space + + {{ cpu['user-space'].value }} % + + + + Kernel Space + + {{ cpu['kernel-space'].value }} % + + + + Idle + {{ cpu.idle.value }} % + + + I/O Wait + {{ cpu.wait.value }} % + + + + + Disk + + Percentage Used + {{ disk['percentage-used'].value }} % + + + Capacity + + {{ disk.capacity.value }} GB + + + + Used + + {{ disk.used.value }} GB + + + + Available + {{ disk.available.value }} GB + + + + + + +
    diff --git a/frontend/projects/ui/src/app/pages/server-routes/server-metrics/server-metrics.page.scss b/frontend/projects/ui/src/app/pages/server-routes/server-metrics/server-metrics.page.scss index eea898305..36fb91260 100644 --- a/frontend/projects/ui/src/app/pages/server-routes/server-metrics/server-metrics.page.scss +++ b/frontend/projects/ui/src/app/pages/server-routes/server-metrics/server-metrics.page.scss @@ -1,3 +1,4 @@ -.metric-note { +ion-note { font-size: 16px; + color: white; } \ No newline at end of file diff --git a/frontend/projects/ui/src/app/pages/server-routes/server-metrics/server-metrics.page.ts b/frontend/projects/ui/src/app/pages/server-routes/server-metrics/server-metrics.page.ts index a4c2dc325..569d34a45 100644 --- a/frontend/projects/ui/src/app/pages/server-routes/server-metrics/server-metrics.page.ts +++ b/frontend/projects/ui/src/app/pages/server-routes/server-metrics/server-metrics.page.ts @@ -3,6 +3,7 @@ import { Metrics } from 'src/app/services/api/api.types' import { ApiService } from 'src/app/services/api/embassy-api.service' import { TimeService } from 'src/app/services/time-service' import { pauseFor, ErrorToastService } from '@start9labs/shared' +import { Subject } from 'rxjs' @Component({ selector: 'server-metrics', @@ -10,9 +11,8 @@ import { pauseFor, ErrorToastService } from '@start9labs/shared' styleUrls: ['./server-metrics.page.scss'], }) export class ServerMetricsPage { - loading = true going = false - metrics: Metrics = {} + metrics$ = new Subject() readonly now$ = this.timeService.now$ readonly uptime$ = this.timeService.uptime$ @@ -25,19 +25,7 @@ export class ServerMetricsPage { async ngOnInit() { await this.getMetrics() - let headersCount = 0 - let rowsCount = 0 - Object.values(this.metrics).forEach(groupVal => { - headersCount++ - Object.keys(groupVal).forEach(_ => { - rowsCount++ - }) - }) - const height = headersCount * 54 + rowsCount * 50 + 24 // extra 24 for room at the bottom - const elem = document.getElementById('metricSection') - if (elem) elem.style.height = `${height}px` this.startDaemon() - this.loading = false } ngOnDestroy() { @@ -59,7 +47,8 @@ export class ServerMetricsPage { private async getMetrics(): Promise { try { - this.metrics = await this.embassyApi.getServerMetrics({}) + const metrics = await this.embassyApi.getServerMetrics({}) + this.metrics$.next(metrics) } catch (e: any) { this.errToast.present(e) this.stopDaemon() diff --git a/frontend/projects/ui/src/app/services/api/api.fixures.ts b/frontend/projects/ui/src/app/services/api/api.fixures.ts index 5ab0460b1..67ddbd8d6 100644 --- a/frontend/projects/ui/src/app/services/api/api.fixures.ts +++ b/frontend/projects/ui/src/app/services/api/api.fixures.ts @@ -835,85 +835,79 @@ export module Mock { export function getServerMetrics() { return { - Group1: { - Metric1: { - value: Math.random(), - unit: 'mi/b', + general: { + temperature: { + value: '66.8', + unit: '°C', }, - Metric2: { - value: Math.random(), + }, + memory: { + 'percentage-used': { + value: '30.7', unit: '%', }, - Metric3: { - value: 10.1, + total: { + value: '31971.10', + unit: 'MiB', + }, + available: { + value: '22150.66', + unit: 'MiB', + }, + used: { + value: '8784.97', + unit: 'MiB', + }, + 'zram-total': { + value: '7992.00', + unit: 'MiB', + }, + 'zram-available': { + value: '7882.50', + unit: 'MiB', + }, + 'zram-used': { + value: '109.50', + unit: 'MiB', + }, + }, + cpu: { + 'percentage-used': { + value: '8.4', + unit: '%', + }, + 'user-space': { + value: '7.0', + unit: '%', + }, + 'kernel-space': { + value: '1.4', + unit: '%', + }, + wait: { + value: '0.5', + unit: '%', + }, + idle: { + value: '91.1', unit: '%', }, }, - Group2: { - Hmmmm1: { - value: 22.2, - unit: 'mi/b', + disk: { + capacity: { + value: '1851.60', + unit: 'GB', }, - Hmmmm2: { - value: 50, - unit: '%', + used: { + value: '859.02', + unit: 'GB', }, - Hmmmm3: { - value: 10.1, - unit: '%', + available: { + value: '992.59', + unit: 'GB', }, - }, - Group3: { - Hmmmm1: { - value: Math.random(), - unit: 'mi/b', - }, - Hmmmm2: { - value: 50, - unit: '%', - }, - Hmmmm3: { - value: 10.1, - unit: '%', - }, - }, - Group4: { - Hmmmm1: { - value: Math.random(), - unit: 'mi/b', - }, - Hmmmm2: { - value: 50, - unit: '%', - }, - Hmmmm3: { - value: 10.1, - unit: '%', - }, - }, - Group5: { - Hmmmm1: { - value: Math.random(), - unit: 'mi/b', - }, - Hmmmm2: { - value: 50, - unit: '%', - }, - Hmmmm3: { - value: 10.1, - unit: '%', - }, - Hmmmm4: { - value: Math.random(), - unit: 'mi/b', - }, - Hmmmm5: { - value: 50, - unit: '%', - }, - Hmmmm6: { - value: 10.1, + 'percentage-used': { + value: '46.4', unit: '%', }, }, diff --git a/frontend/projects/ui/src/app/services/api/api.types.ts b/frontend/projects/ui/src/app/services/api/api.types.ts index 860bc6003..9d804caf9 100644 --- a/frontend/projects/ui/src/app/services/api/api.types.ts +++ b/frontend/projects/ui/src/app/services/api/api.types.ts @@ -301,12 +301,36 @@ export interface ActionResponse { qr: boolean } +interface MetricData { + value: string + unit: string +} + export interface Metrics { - [key: string]: { - [key: string]: { - value: string | number | null - unit?: string - } + general: { + temperature: MetricData | null + } + memory: { + total: MetricData + 'percentage-used': MetricData + used: MetricData + available: MetricData + 'zram-total': MetricData + 'zram-used': MetricData + 'zram-available': MetricData + } + cpu: { + 'percentage-used': MetricData + idle: MetricData + 'user-space': MetricData + 'kernel-space': MetricData + wait: MetricData + } + disk: { + capacity: MetricData + 'percentage-used': MetricData + used: MetricData + available: MetricData } } diff --git a/frontend/projects/ui/src/app/services/time-service.ts b/frontend/projects/ui/src/app/services/time-service.ts index 26d1a216b..641144dae 100644 --- a/frontend/projects/ui/src/app/services/time-service.ts +++ b/frontend/projects/ui/src/app/services/time-service.ts @@ -3,13 +3,14 @@ import { map, shareReplay, startWith, switchMap } from 'rxjs/operators' import { PatchDB } from 'patch-db-client' import { DataModel } from './patch-db/data-model' import { ApiService } from './api/embassy-api.service' -import { combineLatest, from, interval } from 'rxjs' +import { combineLatest, interval, of } from 'rxjs' @Injectable({ providedIn: 'root', }) export class TimeService { - private readonly time$ = from(this.apiService.getSystemTime({})).pipe( + private readonly time$ = of({}).pipe( + switchMap(() => this.apiService.getSystemTime({})), switchMap(({ now, uptime }) => { const current = new Date(now).valueOf() return interval(1000).pipe( From 5735ea2b3cdb56834600b9d22d6617020c988ef0 Mon Sep 17 00:00:00 2001 From: Aiden McClelland <3732071+dr-bonez@users.noreply.github.com> Date: Wed, 1 Nov 2023 18:35:18 -0600 Subject: [PATCH 26/35] change grub os selection to say "StartOS" (#2493) * change grub os selection to say "StartOS" * readd "v" to motd --- build/lib/motd | 4 ++-- debian/postinst | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/build/lib/motd b/build/lib/motd index 04b31d3f2..bbc010881 100755 --- a/build/lib/motd +++ b/build/lib/motd @@ -16,9 +16,9 @@ cat << "ASCII" (_ | /\ |__) | / \(_ __) | / \| \ | \__/__) ASCII -printf " $(start-cli --version | sed 's/StartOS CLI /v/g')\n\n" +printf " v$(cat /usr/lib/startos/VERSION.txt)\n\n" printf " %s (%s %s)\n" "$(uname -o)" "$(uname -r)" "$(uname -m)" -printf " Git Hash: $(start-cli git-info)" +printf " Git Hash: $(cat /usr/lib/startos/GIT_HASH.txt)" if [ -n "$(cat /usr/lib/startos/ENVIRONMENT.txt)" ]; then printf " ~ $(cat /usr/lib/startos/ENVIRONMENT.txt)\n" else diff --git a/debian/postinst b/debian/postinst index 2254e02e1..6a65a749d 100755 --- a/debian/postinst +++ b/debian/postinst @@ -21,6 +21,7 @@ update-initramfs -u -k all if [ -f /etc/default/grub ]; then sed -i '/\(^\|#\)GRUB_CMDLINE_LINUX=/c\GRUB_CMDLINE_LINUX="boot=embassy"' /etc/default/grub + sed -i '/\(^\|#\)GRUB_DISTRIBUTOR=/c\GRUB_DISTRIBUTOR="StartOS v$(cat /usr/lib/startos/VERSION.txt)"' /etc/default/grub fi # change timezone From 46257116065fccd79e0884455a73afd9b72199e7 Mon Sep 17 00:00:00 2001 From: Matt Hill Date: Thu, 2 Nov 2023 09:34:00 -0600 Subject: [PATCH 27/35] better UX for http/https switching (#2494) * open https in same tab * open http in same tab, use windowRef instead of window --- .../app-interfaces/app-interfaces.page.ts | 6 ++++-- .../login/ca-wizard/ca-wizard.component.html | 8 +++++++- .../login/ca-wizard/ca-wizard.component.ts | 10 +--------- .../ui/src/app/pages/login/login.page.html | 12 +++++++++++- .../ui/src/app/pages/login/login.page.ts | 2 +- .../server-show/server-show.page.ts | 18 +++++++++++------- .../ui/src/app/services/ui-launcher.service.ts | 10 +++------- 7 files changed, 38 insertions(+), 28 deletions(-) diff --git a/frontend/projects/ui/src/app/pages/apps-routes/app-interfaces/app-interfaces.page.ts b/frontend/projects/ui/src/app/pages/apps-routes/app-interfaces/app-interfaces.page.ts index 225aa9184..825d6536d 100644 --- a/frontend/projects/ui/src/app/pages/apps-routes/app-interfaces/app-interfaces.page.ts +++ b/frontend/projects/ui/src/app/pages/apps-routes/app-interfaces/app-interfaces.page.ts @@ -1,4 +1,5 @@ -import { Component, Input } from '@angular/core' +import { Component, Inject, Input } from '@angular/core' +import { WINDOW } from '@ng-web-apis/common' import { ActivatedRoute } from '@angular/router' import { ModalController, ToastController } from '@ionic/angular' import { copyToClipboard, getPkgId } from '@start9labs/shared' @@ -91,10 +92,11 @@ export class AppInterfacesItemComponent { constructor( private readonly toastCtrl: ToastController, private readonly modalCtrl: ModalController, + @Inject(WINDOW) private readonly windowRef: Window, ) {} launch(url: string): void { - window.open(url, '_blank', 'noreferrer') + this.windowRef.open(url, '_blank', 'noreferrer') } async showQR(text: string): Promise { diff --git a/frontend/projects/ui/src/app/pages/login/ca-wizard/ca-wizard.component.html b/frontend/projects/ui/src/app/pages/login/ca-wizard/ca-wizard.component.html index 52cfc9c26..553bd360a 100644 --- a/frontend/projects/ui/src/app/pages/login/ca-wizard/ca-wizard.component.html +++ b/frontend/projects/ui/src/app/pages/login/ca-wizard/ca-wizard.component.html @@ -27,7 +27,13 @@ your device can verify the authenticity of encrypted communications with your server.
    - + View Instructions diff --git a/frontend/projects/ui/src/app/pages/login/ca-wizard/ca-wizard.component.ts b/frontend/projects/ui/src/app/pages/login/ca-wizard/ca-wizard.component.ts index 07b7f30f0..fde1c968f 100644 --- a/frontend/projects/ui/src/app/pages/login/ca-wizard/ca-wizard.component.ts +++ b/frontend/projects/ui/src/app/pages/login/ca-wizard/ca-wizard.component.ts @@ -31,21 +31,13 @@ export class CAWizardComponent { this.document.getElementById('install-cert')?.click() } - instructions() { - this.windowRef.open( - 'https://docs.start9.com/0.3.5.x/user-manual/getting-started/trust-ca/#trust-root-ca', - '_blank', - 'noreferrer', - ) - } - refresh() { this.document.location.reload() } launchHttps() { const host = this.config.getHost() - this.windowRef.open(`https://${host}`, '_blank', 'noreferrer') + this.windowRef.open(`https://${host}`, '_self') } private async testHttps() { diff --git a/frontend/projects/ui/src/app/pages/login/login.page.html b/frontend/projects/ui/src/app/pages/login/login.page.html index 4c1aa64b8..ef04eea67 100644 --- a/frontend/projects/ui/src/app/pages/login/login.page.html +++ b/frontend/projects/ui/src/app/pages/login/login.page.html @@ -11,7 +11,17 @@

    Http detected

    -

    Tor is faster over https.

    +

    + Tor is faster over https. Your Root CA must be trusted. + + View instructions + +

    Open Https diff --git a/frontend/projects/ui/src/app/pages/login/login.page.ts b/frontend/projects/ui/src/app/pages/login/login.page.ts index 4a61f2adc..15f7d588e 100644 --- a/frontend/projects/ui/src/app/pages/login/login.page.ts +++ b/frontend/projects/ui/src/app/pages/login/login.page.ts @@ -29,7 +29,7 @@ export class LoginPage { launchHttps() { const host = this.config.getHost() - this.windowRef.open(`https://${host}`, '_blank', 'noreferrer') + this.windowRef.open(`https://${host}`, '_self') } async submit() { diff --git a/frontend/projects/ui/src/app/pages/server-routes/server-show/server-show.page.ts b/frontend/projects/ui/src/app/pages/server-routes/server-show/server-show.page.ts index 82e5e3ff1..401dc19c0 100644 --- a/frontend/projects/ui/src/app/pages/server-routes/server-show/server-show.page.ts +++ b/frontend/projects/ui/src/app/pages/server-routes/server-show/server-show.page.ts @@ -22,7 +22,7 @@ import { GenericInputOptions, } from 'src/app/modals/generic-input/generic-input.component' import { ConfigService } from 'src/app/services/config.service' -import { DOCUMENT } from '@angular/common' +import { WINDOW } from '@ng-web-apis/common' import { getServerInfo } from 'src/app/util/get-server-info' import { GenericFormPage } from 'src/app/modals/generic-form/generic-form.page' import { ConfigSpec } from 'src/app/pkg-config/config-types' @@ -57,7 +57,7 @@ export class ServerShowPage { private readonly authService: AuthService, private readonly toastCtrl: ToastController, private readonly config: ConfigService, - @Inject(DOCUMENT) private readonly document: Document, + @Inject(WINDOW) private readonly windowRef: Window, ) {} async setBrowserTab(): Promise { @@ -307,7 +307,7 @@ export class ServerShowPage { async launchHttps() { const { 'tor-address': torAddress } = await getServerInfo(this.patch) - window.open(torAddress) + this.windowRef.open(torAddress, '_self') } addClick(title: string) { @@ -495,7 +495,7 @@ export class ServerShowPage { }, { title: 'Root CA', - description: `Download and trust your server's root certificate authority`, + description: `Download and trust your server's Root Certificate Authority`, icon: 'ribbon-outline', action: () => this.navCtrl.navigateForward(['root-ca'], { relativeTo: this.route }), @@ -621,7 +621,7 @@ export class ServerShowPage { description: 'Discover what StartOS can do', icon: 'map-outline', action: () => - window.open( + this.windowRef.open( 'https://docs.start9.com/0.3.5.x/user-manual', '_blank', 'noreferrer', @@ -634,7 +634,11 @@ export class ServerShowPage { description: 'Get help from the Start9 team and community', icon: 'chatbubbles-outline', action: () => - window.open('https://start9.com/contact', '_blank', 'noreferrer'), + this.windowRef.open( + 'https://start9.com/contact', + '_blank', + 'noreferrer', + ), detail: true, disabled$: of(false), }, @@ -643,7 +647,7 @@ export class ServerShowPage { description: `Support StartOS development`, icon: 'logo-bitcoin', action: () => - this.document.defaultView?.open( + this.windowRef.open( 'https://donate.start9.com', '_blank', 'noreferrer', diff --git a/frontend/projects/ui/src/app/services/ui-launcher.service.ts b/frontend/projects/ui/src/app/services/ui-launcher.service.ts index d6cb16cf3..55559bcd3 100644 --- a/frontend/projects/ui/src/app/services/ui-launcher.service.ts +++ b/frontend/projects/ui/src/app/services/ui-launcher.service.ts @@ -1,5 +1,5 @@ import { Inject, Injectable } from '@angular/core' -import { DOCUMENT } from '@angular/common' +import { WINDOW } from '@ng-web-apis/common' import { PackageDataEntry } from 'src/app/services/patch-db/data-model' import { ConfigService } from './config.service' @@ -8,15 +8,11 @@ import { ConfigService } from './config.service' }) export class UiLauncherService { constructor( - @Inject(DOCUMENT) private readonly document: Document, + @Inject(WINDOW) private readonly windowRef: Window, private readonly config: ConfigService, ) {} launch(pkg: PackageDataEntry): void { - this.document.defaultView?.open( - this.config.launchableURL(pkg), - '_blank', - 'noreferrer', - ) + this.windowRef.open(this.config.launchableURL(pkg), '_blank', 'noreferrer') } } From f54f950f81a32411aa3d915874f2732d66e80bbe Mon Sep 17 00:00:00 2001 From: Aiden McClelland <3732071+dr-bonez@users.noreply.github.com> Date: Thu, 2 Nov 2023 17:13:48 -0600 Subject: [PATCH 28/35] fix js backups (#2496) --- backend/src/volume.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/backend/src/volume.rs b/backend/src/volume.rs index 875e82096..1633b7d18 100644 --- a/backend/src/volume.rs +++ b/backend/src/volume.rs @@ -27,6 +27,12 @@ impl Volumes { volume .validate(interfaces) .with_ctx(|_| (crate::ErrorKind::ValidateS9pk, format!("Volume {}", id)))?; + if let Volume::Backup { .. } = volume { + return Err(Error::new( + eyre!("Invalid volume type \"backup\""), + ErrorKind::ParseS9pk, + )); // Volume::Backup is for internal use and shouldn't be declared in manifest + } } Ok(()) } @@ -131,7 +137,6 @@ pub enum Volume { #[serde(rename_all = "kebab-case")] Certificate { interface_id: InterfaceId }, #[serde(rename_all = "kebab-case")] - #[serde(skip)] Backup { readonly: bool }, } impl Volume { From 7ba22f1a09ce4b4bb06a2f072005f4f8ee2fb7af Mon Sep 17 00:00:00 2001 From: Aiden McClelland <3732071+dr-bonez@users.noreply.github.com> Date: Thu, 2 Nov 2023 17:33:41 -0600 Subject: [PATCH 29/35] mute errors due to failed incoming network connections (#2497) * mute errors due to failed incoming network connections * fix log entry formatting * Update cleanDanglingImages * Update cleanDanglingImages --- backend/src/bins/start_deno.rs | 11 ++++---- backend/src/config/mod.rs | 3 +-- backend/src/config/spec.rs | 2 +- backend/src/logs.rs | 8 +++++- backend/src/middleware/encrypt.rs | 3 ++- backend/src/net/vhost.rs | 41 +++++++++++++++++++++++------ backend/src/procedure/js_scripts.rs | 6 ++--- backend/src/util/mod.rs | 2 +- build/lib/motd | 1 + build/registry/cleanDanglingImages | 9 +++++++ 10 files changed, 62 insertions(+), 24 deletions(-) create mode 100644 build/registry/cleanDanglingImages diff --git a/backend/src/bins/start_deno.rs b/backend/src/bins/start_deno.rs index e453e941b..0be507082 100644 --- a/backend/src/bins/start_deno.rs +++ b/backend/src/bins/start_deno.rs @@ -69,12 +69,11 @@ impl PackageLogger { use tracing_subscriber::prelude::*; use tracing_subscriber::{fmt, EnvFilter}; - let filter_layer = EnvFilter::default() - .add_directive( - format!("{}=warn", std::module_path!().split("::").next().unwrap()) - .parse() - .unwrap(), - ); + let filter_layer = EnvFilter::default().add_directive( + format!("{}=warn", std::module_path!().split("::").next().unwrap()) + .parse() + .unwrap(), + ); let fmt_layer = fmt::layer().with_writer(std::io::stderr).with_target(true); let journald_layer = tracing_journald::layer() .unwrap() diff --git a/backend/src/config/mod.rs b/backend/src/config/mod.rs index 8224860a5..06e7770b0 100644 --- a/backend/src/config/mod.rs +++ b/backend/src/config/mod.rs @@ -14,9 +14,8 @@ use rpc_toolkit::command; use tracing::instrument; use crate::context::RpcContext; - use crate::prelude::*; -use crate::s9pk::manifest::{PackageId}; +use crate::s9pk::manifest::PackageId; use crate::util::display_none; use crate::util::serde::{display_serializable, parse_stdin_deserializable, IoFormat}; use crate::Error; diff --git a/backend/src/config/spec.rs b/backend/src/config/spec.rs index 09f7ec91e..a98ad888d 100644 --- a/backend/src/config/spec.rs +++ b/backend/src/config/spec.rs @@ -1,4 +1,4 @@ -use std::borrow::{Cow}; +use std::borrow::Cow; use std::collections::{BTreeMap, BTreeSet}; use std::fmt; use std::fmt::Debug; diff --git a/backend/src/logs.rs b/backend/src/logs.rs index 26463be35..691ae09b9 100644 --- a/backend/src/logs.rs +++ b/backend/src/logs.rs @@ -136,7 +136,13 @@ pub struct LogEntry { } impl std::fmt::Display for LogEntry { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - write!(f, "{} {}", self.timestamp, self.message) + write!( + f, + "{} {}", + self.timestamp + .to_rfc3339_opts(chrono::SecondsFormat::Millis, true), + self.message + ) } } diff --git a/backend/src/middleware/encrypt.rs b/backend/src/middleware/encrypt.rs index 010197c49..94167b7e2 100644 --- a/backend/src/middleware/encrypt.rs +++ b/backend/src/middleware/encrypt.rs @@ -13,7 +13,8 @@ pub fn pbkdf2(password: impl AsRef<[u8]>, salt: impl AsRef<[u8]>) -> CipherKey a, + Err(e) => { + tracing::trace!( "VHostController: failed to accept TLS connection on port {port}: {e}"); + tracing::trace!("{e:?}"); + return Ok(()) + } + }; tls_stream.get_mut().0.stop_buffering(); tokio::io::copy_bidirectional( &mut tls_stream, @@ -287,7 +294,14 @@ impl VHostServer { cfg.alpn_protocols.push(proto.into()); } let mut tls_stream = - mid.into_stream(Arc::new(cfg)).await?; + match mid.into_stream(Arc::new(cfg)).await { + Ok(a) => a, + Err(e) => { + tracing::trace!( "VHostController: failed to accept TLS connection on port {port}: {e}"); + tracing::trace!("{e:?}"); + return Ok(()) + } + }; tls_stream.get_mut().0.stop_buffering(); tokio::io::copy_bidirectional( &mut tls_stream, @@ -298,7 +312,14 @@ impl VHostServer { Err(AlpnInfo::Specified(alpn)) => { cfg.alpn_protocols = alpn; let mut tls_stream = - mid.into_stream(Arc::new(cfg)).await?; + match mid.into_stream(Arc::new(cfg)).await { + Ok(a) => a, + Err(e) => { + tracing::trace!( "VHostController: failed to accept TLS connection on port {port}: {e}"); + tracing::trace!("{e:?}"); + return Ok(()) + } + }; tls_stream.get_mut().0.stop_buffering(); tokio::io::copy_bidirectional( &mut tls_stream, @@ -308,10 +329,12 @@ impl VHostServer { } } .map_or_else( - |e| match e.kind() { - std::io::ErrorKind::UnexpectedEof => Ok(()), + |e| { + use std::io::ErrorKind as E; + match e.kind() { + E::UnexpectedEof | E::BrokenPipe | E::ConnectionAborted | E::ConnectionReset | E::ConnectionRefused | E::TimedOut | E::Interrupted | E::NotConnected => Ok(()), _ => Err(e), - }, + }}, |_| Ok(()), )?; } else { @@ -327,8 +350,10 @@ impl VHostServer { }); } Err(e) => { - tracing::error!("Error in VHostController on port {port}: {e}"); - tracing::debug!("{e:?}"); + tracing::trace!( + "VHostController: failed to accept connection on port {port}: {e}" + ); + tracing::trace!("{e:?}"); } } } diff --git a/backend/src/procedure/js_scripts.rs b/backend/src/procedure/js_scripts.rs index 35d85c32e..3e5d6dfa2 100644 --- a/backend/src/procedure/js_scripts.rs +++ b/backend/src/procedure/js_scripts.rs @@ -1,9 +1,7 @@ +use std::path::{Path, PathBuf}; +use std::process::Stdio; use std::sync::Arc; use std::time::Duration; -use std::{ - path::{Path, PathBuf}, - process::Stdio, -}; use color_eyre::eyre::eyre; use embassy_container_init::ProcessGroupId; diff --git a/backend/src/util/mod.rs b/backend/src/util/mod.rs index c6978802d..5ee9cbe5f 100644 --- a/backend/src/util/mod.rs +++ b/backend/src/util/mod.rs @@ -26,13 +26,13 @@ use crate::shutdown::Shutdown; use crate::{Error, ErrorKind, ResultExt as _}; pub mod config; pub mod cpupower; +pub mod crypto; pub mod docker; pub mod http_reader; pub mod io; pub mod logger; pub mod lshw; pub mod serde; -pub mod crypto; #[derive(Clone, Copy, Debug, ::serde::Deserialize, ::serde::Serialize)] pub enum Never {} diff --git a/build/lib/motd b/build/lib/motd index bbc010881..5e98aa887 100755 --- a/build/lib/motd +++ b/build/lib/motd @@ -29,5 +29,6 @@ printf "\n" printf " * Documentation: https://docs.start9.com\n" printf " * Management: https://%s.local\n" "$(hostname)" printf " * Support: https://start9.com/contact\n" +printf " * Source Code: https://github.com/Start9Labs/start-os\n" printf " * License: MIT\n" printf "\n" diff --git a/build/registry/cleanDanglingImages b/build/registry/cleanDanglingImages new file mode 100644 index 000000000..481522903 --- /dev/null +++ b/build/registry/cleanDanglingImages @@ -0,0 +1,9 @@ +#!/bin/bash + +for image in $(find /root/resources/eos/ -type f -name '*.squashfs' -mmin +240 -exec realpath {} \;); do + if ! mount | grep "^$image" > /dev/null; then + >&2 echo "Removing dangling image: $image" + rm $image + fi +done +find /root/resources/eos -type d -empty -delete From 6a399a725052656b6976192d71ffd95054760818 Mon Sep 17 00:00:00 2001 From: Lucy <12953208+elvece@users.noreply.github.com> Date: Thu, 2 Nov 2023 19:35:55 -0400 Subject: [PATCH 30/35] Fix/setup (#2495) * move enter-click directive to shared * allow enter click to continue to login in kiosk mode; adjust styling * cleanup * add styling to ca wizard * rebase new changes * mobile fixes * cleanup * cleanup * update styling * cleanup import * minor css changes --------- Co-authored-by: Matt Hill --- .../src/app/pages/success/success.page.html | 31 ++-- .../src/app/pages/success/success.page.scss | 125 ++++++++----- .../projects/setup-wizard/src/styles.scss | 2 +- .../src/directives}/enter/enter.directive.ts | 2 +- .../src/directives}/enter/enter.module.ts | 0 frontend/projects/shared/src/public-api.ts | 2 + frontend/projects/ui/src/app/app.module.ts | 6 +- .../login/ca-wizard/ca-wizard.component.html | 166 ++++++++++-------- .../login/ca-wizard/ca-wizard.component.scss | 71 ++++++-- 9 files changed, 243 insertions(+), 162 deletions(-) rename frontend/projects/{ui/src/app/app => shared/src/directives}/enter/enter.directive.ts (92%) rename frontend/projects/{ui/src/app/app => shared/src/directives}/enter/enter.module.ts (100%) diff --git a/frontend/projects/setup-wizard/src/app/pages/success/success.page.html b/frontend/projects/setup-wizard/src/app/pages/success/success.page.html index 6479fd07d..dbce29073 100644 --- a/frontend/projects/setup-wizard/src/app/pages/success/success.page.html +++ b/frontend/projects/setup-wizard/src/app/pages/success/success.page.html @@ -8,7 +8,7 @@ -
    +
    Setup Complete!
    @@ -32,8 +32,8 @@ -
    -
    +
    +
    - - Download permanent address info - + Download address info

    start.local was for setup purposes only. It will no longer work.

    -
    -
    -

    DOWNLOAD

    - -
    +
    +

    Download

    +
    -
    -
    -

    OPEN

    - +
    +

    Open

    +
    diff --git a/frontend/projects/setup-wizard/src/app/pages/success/success.page.scss b/frontend/projects/setup-wizard/src/app/pages/success/success.page.scss index 1c3681057..910849788 100644 --- a/frontend/projects/setup-wizard/src/app/pages/success/success.page.scss +++ b/frontend/projects/setup-wizard/src/app/pages/success/success.page.scss @@ -18,28 +18,24 @@ ion-content { ion-grid { max-width: 760px; - height: 100%; } -.login-btn { - --background: var(--color-accent); - --border-radius: 44px; - --box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25); - --padding-start: 36px; - --padding-end: 36px; - height: 76px; -} - -.grid-center-wrapper { - height: 100%; - width: 100%; +.inline-container { display: flex; justify-content: center; align-items: center; } +.card-container { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + gap: 1rem; +} + ion-card { - padding: 3rem; + padding: 2.4rem; h1 { color: var(--ion-color-success); @@ -53,14 +49,14 @@ ion-card { margin-bottom: 2rem; } + // download info card ion-card { - max-width: 91%; - min-width: 91%; + min-height: 260px; + width: 80%; background: #615F5F; color: var(--ion-text-color); box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25); border-radius: 44px; - margin: auto; text-align: left; cursor: pointer; position: relative; @@ -79,14 +75,6 @@ ion-card { font-size: 1.3rem; } - ion-card-content { - padding-bottom: 4rem; - - p { - padding: 1rem 0; - } - } - ion-footer { position: absolute; bottom: 10px; @@ -109,42 +97,87 @@ ion-card { } } - .container { - display: flex; - justify-content: center; - align-items: center; + .login-button { + --background: var(--color-accent); + --padding-bottom: 2.5rem; + --padding-top: 2.5rem; + --padding-start: 2.5rem; + --padding-end: 2.5rem; + --border-radius: 44px; + font-size: 1.4rem !important; + font-weight: bold; + text-transform: none; + letter-spacing: normal; + transition: all 350ms ease; + transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); + + &:hover { + transition-property: transform; + transform: scale(1.05); + transition-delay: 40ms; + } + + ion-icon { + font-size: 1.7rem; + } + } + + .launch-button { + --background: var(--alt-blue); } - #information:after { + #information:after, #launch:after { content: ''; position: absolute; left: 0; - top: 80%; + top: 79%; width: 100%; height: 100%; background: var(--color-accent); } #launch:after { - content: ''; - position: absolute; - left: 0; - top: 80%; - width: 100%; - height: 100%; background: var(--alt-blue); } + } -.card-container { - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - gap: 2rem; +.mb-12 { + margin-bottom: 3rem; } -.emphasis-warn { - font-weight: 600; - color: var(--ion-color-warning); +.pb-2 { + padding-bottom: 0.5rem; +} + +.pt-1 { + padding-top: 0.25rem; +} + + +.action-text { + font-variant-caps: all-small-caps; + padding-right: 0.5rem; + font-size: 1.5rem !important; + letter-spacing: 0.03rem; + padding-bottom: 0.1rem; +} + +@media (max-width: 700px) { + .setup { + flex-direction: column; + } + + ion-card { + ion-card { + width: 100%; + padding-bottom: unset; + } + #information:after { + top: 84%; + } + #launch:after { + top: 85%; + } + } } \ No newline at end of file diff --git a/frontend/projects/setup-wizard/src/styles.scss b/frontend/projects/setup-wizard/src/styles.scss index 64550a457..f31e2542c 100644 --- a/frontend/projects/setup-wizard/src/styles.scss +++ b/frontend/projects/setup-wizard/src/styles.scss @@ -218,7 +218,7 @@ ion-toast { * { display: inline-block; vertical-align: middle; - padding: 0.3rem; + padding-left: 0px 0.3rem; } } diff --git a/frontend/projects/ui/src/app/app/enter/enter.directive.ts b/frontend/projects/shared/src/directives/enter/enter.directive.ts similarity index 92% rename from frontend/projects/ui/src/app/app/enter/enter.directive.ts rename to frontend/projects/shared/src/directives/enter/enter.directive.ts index 2a93ad93b..8d3d6a399 100644 --- a/frontend/projects/ui/src/app/app/enter/enter.directive.ts +++ b/frontend/projects/shared/src/directives/enter/enter.directive.ts @@ -1,6 +1,6 @@ import { Directive, HostListener, Inject } from '@angular/core' import { DOCUMENT } from '@angular/common' -import { debounce } from '@start9labs/shared' +import { debounce } from '../../util/misc.util' @Directive({ selector: '[appEnter]', diff --git a/frontend/projects/ui/src/app/app/enter/enter.module.ts b/frontend/projects/shared/src/directives/enter/enter.module.ts similarity index 100% rename from frontend/projects/ui/src/app/app/enter/enter.module.ts rename to frontend/projects/shared/src/directives/enter/enter.module.ts diff --git a/frontend/projects/shared/src/public-api.ts b/frontend/projects/shared/src/public-api.ts index a14ff0110..7b1cd71b8 100644 --- a/frontend/projects/shared/src/public-api.ts +++ b/frontend/projects/shared/src/public-api.ts @@ -24,6 +24,8 @@ export * from './directives/responsive-col/responsive-col.module' export * from './directives/responsive-col/responsive-col-viewport.directive' export * from './directives/safe-links/safe-links.directive' export * from './directives/safe-links/safe-links.module' +export * from './directives/enter/enter.directive' +export * from './directives/enter/enter.module' export * from './pipes/emver/emver.module' export * from './pipes/emver/emver.pipe' diff --git a/frontend/projects/ui/src/app/app.module.ts b/frontend/projects/ui/src/app/app.module.ts index 31dd44da1..324300851 100644 --- a/frontend/projects/ui/src/app/app.module.ts +++ b/frontend/projects/ui/src/app/app.module.ts @@ -10,11 +10,12 @@ import { BrowserAnimationsModule } from '@angular/platform-browser/animations' import { IonicModule } from '@ionic/angular' import { MonacoEditorModule } from '@materia-ui/ngx-monaco-editor' import { - MarkdownModule, DarkThemeModule, + EnterModule, + LightThemeModule, + MarkdownModule, ResponsiveColModule, SharedPipesModule, - LightThemeModule, } from '@start9labs/shared' import { AppComponent } from './app.component' @@ -25,7 +26,6 @@ import { MarketplaceModule } from './marketplace.module' import { PreloaderModule } from './app/preloader/preloader.module' import { FooterModule } from './app/footer/footer.module' import { MenuModule } from './app/menu/menu.module' -import { EnterModule } from './app/enter/enter.module' import { APP_PROVIDERS } from './app.providers' import { PatchDbModule } from './services/patch-db/patch-db.module' import { ToastContainerModule } from './components/toast-container/toast-container.module' diff --git a/frontend/projects/ui/src/app/pages/login/ca-wizard/ca-wizard.component.html b/frontend/projects/ui/src/app/pages/login/ca-wizard/ca-wizard.component.html index 553bd360a..af471d23e 100644 --- a/frontend/projects/ui/src/app/pages/login/ca-wizard/ca-wizard.component.html +++ b/frontend/projects/ui/src/app/pages/login/ca-wizard/ca-wizard.component.html @@ -1,83 +1,99 @@ - +
    - -

    Trust Your Root CA

    -

    - Download and trust your server's Root Certificate Authority to establish a - secure ( - HTTPS - ) connection. You will need to repeat this on every device you use to - connect to your server. -

    -
      -
    1. - Download your server's Root CA - . Your server uses its Root CA to generate SSL/TLS certificates for - itself and installed services. These certificates are then used to - encrypt network traffic with your client devices. -
      - - Download - - -
    2. -
    3. - Trust your server's Root CA - . Follow instructions for your OS. By trusting your server's Root CA, - your device can verify the authenticity of encrypted communications with - your server. -
      - - View Instructions - - -
    4. -
    5. - Test - . If refreshing the page does not work, you may need to quit the browser - and re-open. - Tip: before quitting, bookmark this page or copy the URL. -
      - - Refresh - - -
    6. -
    - - Skip - - + + +

    Trust Your Root CA

    +

    + Download and trust your server's Root Certificate Authority to establish + a secure (HTTPS) connection. You will need to repeat this on every + device you use to connect to your server. +

    +
      +
    1. + Download your server's Root CA + - Your server uses its Root CA to generate SSL/TLS certificates for + itself and installed services. These certificates are then used to + encrypt network traffic with your client devices. +
      + + Download + + +
    2. +
    3. + Trust your server's Root CA + - Follow instructions for your OS. By trusting your server's Root CA, + your device can verify the authenticity of encrypted communications + with your server. +
      + + View Instructions + + +
    4. +
    5. + Test + - If refreshing the page does not work, you may need to quit the + browser and re-open. + Tip: before quitting, bookmark this page or copy the URL. +
      + + Refresh + + +
    6. +
    + + Skip + + +
    - -

    Root CA Trusted!

    -

    - You have successfully trusted your server's Root CA and may now log in - securely. -

    - - Go to login - - + + +

    Root CA Trusted!

    +

    + You have successfully trusted your server's Root CA and may now log in + securely. +

    + + Go to login + + +
    - +
    Date: Mon, 6 Nov 2023 19:24:15 -0500 Subject: [PATCH 31/35] fix docs links (#2498) * fix docs links * forgot to save file * fix docs links and small updates to ca wizard * add downloaded filename * fix skip detail --- .../download-doc/download-doc.component.html | 4 ++-- .../src/app/pages/success/success.page.ts | 2 +- .../backup-drives.component.html | 4 ++-- .../login/ca-wizard/ca-wizard.component.html | 22 ++++++++++--------- .../login/ca-wizard/ca-wizard.component.scss | 7 ++++++ .../ui/src/app/pages/login/login.page.html | 2 +- .../app/pages/server-routes/lan/lan.page.html | 2 +- 7 files changed, 26 insertions(+), 17 deletions(-) diff --git a/frontend/projects/setup-wizard/src/app/pages/success/download-doc/download-doc.component.html b/frontend/projects/setup-wizard/src/app/pages/success/download-doc/download-doc.component.html index 25fa87a2e..ef8c32a49 100644 --- a/frontend/projects/setup-wizard/src/app/pages/success/download-doc/download-doc.component.html +++ b/frontend/projects/setup-wizard/src/app/pages/success/download-doc/download-doc.component.html @@ -37,7 +37,7 @@

    Download your server's Root CA and Note: This address will only work from a Tor-enabled browser.

      +
    1. + Bookmark this page + - Save this page so you can access it later. You can also find the + address in the + StartOS-info.html + file downloaded at the end of initial setup. +
    2. Download your server's Root CA - Your server uses its Root CA to generate SSL/TLS certificates for @@ -37,7 +44,7 @@ size="small" shape="round" color="primary" - href="https://docs.start9.com/0.3.5.x/user-manual/getting-started/trust-ca/#trust-root-ca" + href="https://docs.start9.com/0.3.5.x/user-manual/trust-ca#establishing-trust" target="_blank" noreferrer > @@ -47,9 +54,8 @@
    3. Test - - If refreshing the page does not work, you may need to quit the - browser and re-open. - Tip: before quitting, bookmark this page or copy the URL. + - Refresh the page. If refreshing the page does not work, you may need + to quit and re-open your browser, then revisit this page.
    - + Skip + (not recommended) diff --git a/frontend/projects/ui/src/app/pages/login/ca-wizard/ca-wizard.component.scss b/frontend/projects/ui/src/app/pages/login/ca-wizard/ca-wizard.component.scss index c87093699..48b198525 100644 --- a/frontend/projects/ui/src/app/pages/login/ca-wizard/ca-wizard.component.scss +++ b/frontend/projects/ui/src/app/pages/login/ca-wizard/ca-wizard.component.scss @@ -63,6 +63,13 @@ ol { font-size: 64px; } +.skip_detail { + display: block; + font-size: 0.8rem; + margin-top: -13px; + padding-bottom: 0.5rem; +} + @media (max-width: 700px) { #trusted, #untrusted { max-width: 100%; diff --git a/frontend/projects/ui/src/app/pages/login/login.page.html b/frontend/projects/ui/src/app/pages/login/login.page.html index ef04eea67..99f6abbe8 100644 --- a/frontend/projects/ui/src/app/pages/login/login.page.html +++ b/frontend/projects/ui/src/app/pages/login/login.page.html @@ -14,7 +14,7 @@

    Tor is faster over https. Your Root CA must be trusted. For a secure local connection and faster Tor experience, From bf40a9ef6d6402773030982961b1ada1a3672795 Mon Sep 17 00:00:00 2001 From: Aiden McClelland <3732071+dr-bonez@users.noreply.github.com> Date: Mon, 6 Nov 2023 17:26:45 -0700 Subject: [PATCH 32/35] improve Invoke api (#2499) * improve Invoke api * fix formatting --- backend/src/disk/mount/filesystem/ecryptfs.rs | 24 +--- backend/src/firmware.rs | 44 +++--- backend/src/install/mod.rs | 111 +++++----------- backend/src/procedure/docker.rs | 2 - backend/src/procedure/js_scripts.rs | 114 +++++----------- backend/src/util/mod.rs | 125 +++++++++++++++--- 6 files changed, 193 insertions(+), 227 deletions(-) diff --git a/backend/src/disk/mount/filesystem/ecryptfs.rs b/backend/src/disk/mount/filesystem/ecryptfs.rs index 3c828f4c7..78570f49b 100644 --- a/backend/src/disk/mount/filesystem/ecryptfs.rs +++ b/backend/src/disk/mount/filesystem/ecryptfs.rs @@ -2,13 +2,12 @@ use std::os::unix::ffi::OsStrExt; use std::path::Path; use async_trait::async_trait; -use color_eyre::eyre::eyre; use digest::generic_array::GenericArray; use digest::{Digest, OutputSizeUser}; use sha2::Sha256; -use tokio::io::{AsyncReadExt, AsyncWriteExt}; use super::{FileSystem, MountType}; +use crate::util::Invoke; use crate::{Error, ResultExt}; pub async fn mount_ecryptfs, P1: AsRef>( @@ -17,7 +16,7 @@ pub async fn mount_ecryptfs, P1: AsRef>( key: &str, ) -> Result<(), Error> { tokio::fs::create_dir_all(dst.as_ref()).await?; - let mut ecryptfs = tokio::process::Command::new("mount") + tokio::process::Command::new("mount") .arg("-t") .arg("ecryptfs") .arg(src.as_ref()) @@ -25,22 +24,9 @@ pub async fn mount_ecryptfs, P1: AsRef>( .arg("-o") // for more information `man ecryptfs` .arg(format!("key=passphrase:passphrase_passwd={},ecryptfs_cipher=aes,ecryptfs_key_bytes=32,ecryptfs_passthrough=n,ecryptfs_enable_filename_crypto=y,no_sig_cache", key)) - .stdin(std::process::Stdio::piped()) - .stderr(std::process::Stdio::piped()) - .spawn()?; - let mut stdin = ecryptfs.stdin.take().unwrap(); - let mut stderr = ecryptfs.stderr.take().unwrap(); - stdin.write_all(b"\n").await?; - stdin.flush().await?; - stdin.shutdown().await?; - drop(stdin); - let mut err = String::new(); - stderr.read_to_string(&mut err).await?; - if !ecryptfs.wait().await?.success() { - Err(Error::new(eyre!("{}", err), crate::ErrorKind::Filesystem)) - } else { - Ok(()) - } + .input(Some(&mut std::io::Cursor::new(b"\n"))) + .invoke(crate::ErrorKind::Filesystem).await?; + Ok(()) } pub struct EcryptFS, Key: AsRef> { diff --git a/backend/src/firmware.rs b/backend/src/firmware.rs index 708ae2169..9f3e3c52c 100644 --- a/backend/src/firmware.rs +++ b/backend/src/firmware.rs @@ -1,9 +1,8 @@ use std::path::Path; -use std::process::Stdio; use async_compression::tokio::bufread::GzipDecoder; use tokio::fs::File; -use tokio::io::{AsyncRead, AsyncWriteExt, BufReader}; +use tokio::io::{AsyncRead, BufReader}; use tokio::process::Command; use crate::disk::fsck::RequiresReboot; @@ -44,36 +43,25 @@ pub async fn update_firmware() -> Result { let mut firmware_read_dir = tokio::fs::read_dir(&firmware_dir).await?; while let Some(entry) = firmware_read_dir.next_entry().await? { let filename = entry.file_name().to_string_lossy().into_owned(); - let rdr: Option> = if filename.ends_with(".rom.gz") { - Some(Box::new(GzipDecoder::new(BufReader::new( - File::open(entry.path()).await?, - )))) - } else if filename.ends_with(".rom") { - Some(Box::new(File::open(entry.path()).await?)) - } else { - None - }; + let rdr: Option> = + if filename.ends_with(".rom.gz") { + Some(Box::new(GzipDecoder::new(BufReader::new( + File::open(entry.path()).await?, + )))) + } else if filename.ends_with(".rom") { + Some(Box::new(File::open(entry.path()).await?)) + } else { + None + }; if let Some(mut rdr) = rdr { - let mut flashrom = Command::new("flashrom") + Command::new("flashrom") .arg("-p") .arg("internal") .arg("-w-") - .stdin(Stdio::piped()) - .spawn()?; - let mut rom_dest = flashrom.stdin.take().or_not_found("stdin")?; - tokio::io::copy(&mut rdr, &mut rom_dest).await?; - rom_dest.flush().await?; - rom_dest.shutdown().await?; - drop(rom_dest); - let o = flashrom.wait_with_output().await?; - if !o.status.success() { - return Err(Error::new( - eyre!("{}", std::str::from_utf8(&o.stderr)?), - ErrorKind::Firmware, - )); - } else { - return Ok(RequiresReboot(true)); - } + .input(Some(&mut rdr)) + .invoke(ErrorKind::Firmware) + .await?; + return Ok(RequiresReboot(true)); } } } diff --git a/backend/src/install/mod.rs b/backend/src/install/mod.rs index b46be0c4c..e2089608e 100644 --- a/backend/src/install/mod.rs +++ b/backend/src/install/mod.rs @@ -2,7 +2,6 @@ use std::collections::BTreeMap; use std::io::SeekFrom; use std::marker::PhantomData; use std::path::{Path, PathBuf}; -use std::process::Stdio; use std::sync::atomic::Ordering; use std::sync::Arc; use std::time::Duration; @@ -49,9 +48,9 @@ use crate::s9pk::manifest::{Manifest, PackageId}; use crate::s9pk::reader::S9pkReader; use crate::status::{MainStatus, Status}; use crate::util::docker::CONTAINER_TOOL; -use crate::util::io::{copy_and_shutdown, response_to_reader}; +use crate::util::io::response_to_reader; use crate::util::serde::{display_serializable, Port}; -use crate::util::{display_none, AsyncFileExt, Version}; +use crate::util::{display_none, AsyncFileExt, Invoke, Version}; use crate::volume::{asset_dir, script_dir}; use crate::{Error, ErrorKind, ResultExt}; @@ -953,32 +952,11 @@ pub async fn install_s9pk( tracing::info!("Install {}@{}: Unpacking Docker Images", pkg_id, version); progress .track_read_during(ctx.db.clone(), pkg_id, || async { - let mut load = Command::new(CONTAINER_TOOL) + Command::new(CONTAINER_TOOL) .arg("load") - .stdin(Stdio::piped()) - .stderr(Stdio::piped()) - .spawn()?; - let load_in = load.stdin.take().ok_or_else(|| { - Error::new( - eyre!("Could not write to stdin of docker load"), - crate::ErrorKind::Docker, - ) - })?; - let mut docker_rdr = rdr.docker_images().await?; - copy_and_shutdown(&mut docker_rdr, load_in).await?; - let res = load.wait_with_output().await?; - if !res.status.success() { - Err(Error::new( - eyre!( - "{}", - String::from_utf8(res.stderr) - .unwrap_or_else(|e| format!("Could not parse stderr: {}", e)) - ), - crate::ErrorKind::Docker, - )) - } else { - Ok(()) - } + .input(Some(&mut rdr.docker_images().await?)) + .invoke(ErrorKind::Docker) + .await }) .await?; tracing::info!("Install {}@{}: Unpacked Docker Images", pkg_id, version,); @@ -1275,57 +1253,36 @@ pub fn load_images<'a, P: AsRef + 'a + Send + Sync>( let path = entry.path(); let ext = path.extension().and_then(|ext| ext.to_str()); if ext == Some("tar") || ext == Some("s9pk") { - let mut load = Command::new(CONTAINER_TOOL) - .arg("load") - .stdin(Stdio::piped()) - .stderr(Stdio::piped()) - .spawn()?; - let load_in = load.stdin.take().ok_or_else(|| { - Error::new( - eyre!("Could not write to stdin of docker load"), - crate::ErrorKind::Docker, - ) - })?; - match ext { - Some("tar") => { - copy_and_shutdown(&mut File::open(&path).await?, load_in) - .await? - } - Some("s9pk") => match async { - let mut reader = S9pkReader::open(&path, true).await?; - copy_and_shutdown(&mut reader.docker_images().await?, load_in) - .await?; - Ok::<_, Error>(()) - } - .await - { - Ok(()) => (), - Err(e) => { - tracing::error!( - "Error loading docker images from s9pk: {e}" - ); - tracing::debug!("{e:?}"); - return Ok(()); + if let Err(e) = async { + match ext { + Some("tar") => { + Command::new(CONTAINER_TOOL) + .arg("load") + .input(Some(&mut File::open(&path).await?)) + .invoke(ErrorKind::Docker) + .await } - }, - _ => unreachable!(), - }; - - let res = load.wait_with_output().await?; - if !res.status.success() { - Err(Error::new( - eyre!( - "{}", - String::from_utf8(res.stderr).unwrap_or_else(|e| format!( - "Could not parse stderr: {}", - e - )) - ), - crate::ErrorKind::Docker, - )) - } else { - Ok(()) + Some("s9pk") => { + Command::new(CONTAINER_TOOL) + .arg("load") + .input(Some( + &mut S9pkReader::open(&path, true) + .await? + .docker_images() + .await?, + )) + .invoke(ErrorKind::Docker) + .await + } + _ => unreachable!(), + } } + .await + { + tracing::error!("Error loading docker images from s9pk: {e}"); + tracing::debug!("{e:?}"); + } + Ok(()) } else { Ok(()) } diff --git a/backend/src/procedure/docker.rs b/backend/src/procedure/docker.rs index 3f72993a0..57207d5c9 100644 --- a/backend/src/procedure/docker.rs +++ b/backend/src/procedure/docker.rs @@ -6,9 +6,7 @@ use std::os::unix::prelude::FileTypeExt; use std::path::{Path, PathBuf}; use std::time::Duration; -use async_stream::stream; use color_eyre::eyre::eyre; -use color_eyre::Report; use futures::future::{BoxFuture, Either as EitherFuture}; use futures::{FutureExt, TryStreamExt}; use helpers::{NonDetachingJoinHandle, UnixRpcClient}; diff --git a/backend/src/procedure/js_scripts.rs b/backend/src/procedure/js_scripts.rs index 3e5d6dfa2..27756b4a3 100644 --- a/backend/src/procedure/js_scripts.rs +++ b/backend/src/procedure/js_scripts.rs @@ -1,9 +1,7 @@ use std::path::{Path, PathBuf}; -use std::process::Stdio; use std::sync::Arc; use std::time::Duration; -use color_eyre::eyre::eyre; use embassy_container_init::ProcessGroupId; use helpers::UnixRpcClient; pub use js_engine::JsError; @@ -17,8 +15,8 @@ use tracing::instrument; use super::ProcedureName; use crate::prelude::*; use crate::s9pk::manifest::PackageId; -use crate::util::io::to_json_async_writer; -use crate::util::Version; +use crate::util::serde::IoFormat; +use crate::util::{Invoke, Version}; use crate::volume::Volumes; #[derive(Debug, Serialize, Deserialize, Clone)] @@ -83,45 +81,23 @@ impl JsProcedure { _gid: ProcessGroupId, _rpc_client: Option>, ) -> Result, Error> { - let runner_argument = ExecuteArgs { - procedure: self.clone(), - directory: directory.clone(), - pkg_id: pkg_id.clone(), - pkg_version: pkg_version.clone(), - name, - volumes: volumes.clone(), - input: input.and_then(|x| serde_json::to_value(x).ok()), - }; - let mut runner = Command::new("start-deno") + Command::new("start-deno") .arg("execute") - .stdin(Stdio::piped()) - .stdout(Stdio::piped()) - .stderr(Stdio::piped()) - .kill_on_drop(true) - .spawn()?; - to_json_async_writer( - &mut runner.stdin.take().or_not_found("stdin")?, - &runner_argument, - ) - .await?; - - let res = if let Some(timeout) = timeout { - tokio::time::timeout(timeout, runner.wait_with_output()) - .await - .with_kind(ErrorKind::Timeout)?? - } else { - runner.wait_with_output().await? - }; - - if res.status.success() { - serde_json::from_str::>(std::str::from_utf8(&res.stdout)?) - .with_kind(ErrorKind::Deserialization) - } else { - Err(Error::new( - eyre!("{}", String::from_utf8(res.stderr)?), - ErrorKind::Javascript, - )) - } + .input(Some(&mut std::io::Cursor::new(IoFormat::Json.to_vec( + &ExecuteArgs { + procedure: self.clone(), + directory: directory.clone(), + pkg_id: pkg_id.clone(), + pkg_version: pkg_version.clone(), + name, + volumes: volumes.clone(), + input: input.and_then(|x| serde_json::to_value(x).ok()), + }, + )?))) + .timeout(timeout) + .invoke(ErrorKind::Javascript) + .await + .and_then(|res| IoFormat::Json.from_slice(&res)) } #[instrument(skip_all)] @@ -135,45 +111,23 @@ impl JsProcedure { timeout: Option, name: ProcedureName, ) -> Result, Error> { - let runner_argument = ExecuteArgs { - procedure: self.clone(), - directory: directory.clone(), - pkg_id: pkg_id.clone(), - pkg_version: pkg_version.clone(), - name, - volumes: volumes.clone(), - input: input.and_then(|x| serde_json::to_value(x).ok()), - }; - let mut runner = Command::new("start-deno") + Command::new("start-deno") .arg("sandbox") - .stdin(Stdio::piped()) - .stdout(Stdio::piped()) - .stderr(Stdio::piped()) - .kill_on_drop(true) - .spawn()?; - to_json_async_writer( - &mut runner.stdin.take().or_not_found("stdin")?, - &runner_argument, - ) - .await?; - - let res = if let Some(timeout) = timeout { - tokio::time::timeout(timeout, runner.wait_with_output()) - .await - .with_kind(ErrorKind::Timeout)?? - } else { - runner.wait_with_output().await? - }; - - if res.status.success() { - serde_json::from_str::>(std::str::from_utf8(&res.stdout)?) - .with_kind(ErrorKind::Deserialization) - } else { - Err(Error::new( - eyre!("{}", String::from_utf8(res.stderr)?), - ErrorKind::Javascript, - )) - } + .input(Some(&mut std::io::Cursor::new(IoFormat::Json.to_vec( + &ExecuteArgs { + procedure: self.clone(), + directory: directory.clone(), + pkg_id: pkg_id.clone(), + pkg_version: pkg_version.clone(), + name, + volumes: volumes.clone(), + input: input.and_then(|x| serde_json::to_value(x).ok()), + }, + )?))) + .timeout(timeout) + .invoke(ErrorKind::Javascript) + .await + .and_then(|res| IoFormat::Json.from_slice(&res)) } #[instrument(skip_all)] diff --git a/backend/src/util/mod.rs b/backend/src/util/mod.rs index 5ee9cbe5f..2683f23c8 100644 --- a/backend/src/util/mod.rs +++ b/backend/src/util/mod.rs @@ -50,30 +50,113 @@ impl std::fmt::Display for Never { impl std::error::Error for Never {} #[async_trait::async_trait] -pub trait Invoke { +pub trait Invoke<'a> { + type Extended<'ext> + where + Self: 'ext, + 'ext: 'a; + fn timeout<'ext: 'a>(&'ext mut self, timeout: Option) -> Self::Extended<'ext>; + fn input<'ext: 'a, Input: tokio::io::AsyncRead + Unpin + Send>( + &'ext mut self, + input: Option<&'ext mut Input>, + ) -> Self::Extended<'ext>; async fn invoke(&mut self, error_kind: crate::ErrorKind) -> Result, Error>; - async fn invoke_timeout( - &mut self, - error_kind: crate::ErrorKind, - timeout: Option, - ) -> Result, Error>; } -#[async_trait::async_trait] -impl Invoke for tokio::process::Command { - async fn invoke(&mut self, error_kind: crate::ErrorKind) -> Result, Error> { - self.invoke_timeout(error_kind, None).await + +pub struct ExtendedCommand<'a> { + cmd: &'a mut tokio::process::Command, + timeout: Option, + input: Option<&'a mut (dyn tokio::io::AsyncRead + Unpin + Send)>, +} +impl<'a> std::ops::Deref for ExtendedCommand<'a> { + type Target = tokio::process::Command; + fn deref(&self) -> &Self::Target { + &*self.cmd } - async fn invoke_timeout( - &mut self, - error_kind: crate::ErrorKind, - timeout: Option, - ) -> Result, Error> { - self.kill_on_drop(true); - self.stdout(Stdio::piped()); - self.stderr(Stdio::piped()); - let res = match timeout { - None => self.output().await?, - Some(t) => tokio::time::timeout(t, self.output()) +} +impl<'a> std::ops::DerefMut for ExtendedCommand<'a> { + fn deref_mut(&mut self) -> &mut Self::Target { + self.cmd + } +} + +#[async_trait::async_trait] +impl<'a> Invoke<'a> for tokio::process::Command { + type Extended<'ext> = ExtendedCommand<'ext> + where + Self: 'ext, + 'ext: 'a; + fn timeout<'ext: 'a>(&'ext mut self, timeout: Option) -> Self::Extended<'ext> { + ExtendedCommand { + cmd: self, + timeout, + input: None, + } + } + fn input<'ext: 'a, Input: tokio::io::AsyncRead + Unpin + Send>( + &'ext mut self, + input: Option<&'ext mut Input>, + ) -> Self::Extended<'ext> { + ExtendedCommand { + cmd: self, + timeout: None, + input: if let Some(input) = input { + Some(&mut *input) + } else { + None + }, + } + } + async fn invoke(&mut self, error_kind: crate::ErrorKind) -> Result, Error> { + ExtendedCommand { + cmd: self, + timeout: None, + input: None, + } + .invoke(error_kind) + .await + } +} + +#[async_trait::async_trait] +impl<'a> Invoke<'a> for ExtendedCommand<'a> { + type Extended<'ext> = &'ext mut ExtendedCommand<'ext> + where + Self: 'ext, + 'ext: 'a; + fn timeout<'ext: 'a>(&'ext mut self, timeout: Option) -> Self::Extended<'ext> { + self.timeout = timeout; + self + } + fn input<'ext: 'a, Input: tokio::io::AsyncRead + Unpin + Send>( + &'ext mut self, + input: Option<&'ext mut Input>, + ) -> Self::Extended<'ext> { + self.input = if let Some(input) = input { + Some(&mut *input) + } else { + None + }; + self + } + async fn invoke(&mut self, error_kind: crate::ErrorKind) -> Result, Error> { + self.cmd.kill_on_drop(true); + if self.input.is_some() { + self.cmd.stdin(Stdio::piped()); + } + self.cmd.stdout(Stdio::piped()); + self.cmd.stderr(Stdio::piped()); + let mut child = self.cmd.spawn()?; + if let (Some(mut stdin), Some(input)) = (child.stdin.take(), self.input.take()) { + use tokio::io::AsyncWriteExt; + tokio::io::copy(input, &mut stdin).await?; + stdin.flush().await?; + stdin.shutdown().await?; + drop(stdin); + } + let res = match self.timeout { + None => child.wait_with_output().await?, + Some(t) => tokio::time::timeout(t, child.wait_with_output()) .await .with_kind(ErrorKind::Timeout)??, }; From 748277aa0eef739a94357311c1b9c49819dc5a73 Mon Sep 17 00:00:00 2001 From: Aiden McClelland <3732071+dr-bonez@users.noreply.github.com> Date: Tue, 7 Nov 2023 09:21:32 -0700 Subject: [PATCH 33/35] do not wait for input on btrfs repair (#2500) --- backend/src/disk/fsck/btrfs.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/backend/src/disk/fsck/btrfs.rs b/backend/src/disk/fsck/btrfs.rs index ce4e89f75..fe0cf3c33 100644 --- a/backend/src/disk/fsck/btrfs.rs +++ b/backend/src/disk/fsck/btrfs.rs @@ -23,6 +23,7 @@ pub async fn btrfs_check_repair(logicalname: impl AsRef) -> Result Date: Tue, 7 Nov 2023 11:16:02 -0700 Subject: [PATCH 34/35] disable CoW for journal (#2501) --- backend/src/init.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/backend/src/init.rs b/backend/src/init.rs index 0308f684c..dc98dae42 100644 --- a/backend/src/init.rs +++ b/backend/src/init.rs @@ -254,6 +254,17 @@ pub async fn init(cfg: &RpcContextConfig) -> Result { } } crate::disk::mount::util::bind(&log_dir, "/var/log/journal", false).await?; + match Command::new("chattr") + .arg("-R") + .arg("+C") + .arg("/var/log/journal") + .invoke(ErrorKind::Filesystem) + .await + { + Ok(_) => Ok(()), + Err(e) if e.source.to_string().contains("Operation not supported") => Ok(()), + Err(e) => Err(e), + }?; Command::new("systemctl") .arg("restart") .arg("systemd-journald") From 871f78b570f2b43321485396e17058ed98e1bc66 Mon Sep 17 00:00:00 2001 From: Matt Hill Date: Wed, 8 Nov 2023 02:31:18 -0700 Subject: [PATCH 35/35] Feature/server status restarting (#2503) * extend `server-info` * add restarting, shutting down to FE status bar * fix build --------- Co-authored-by: Aiden McClelland --- backend/src/db/model.rs | 6 +++ backend/src/init.rs | 2 + backend/src/shutdown.rs | 19 ++++++- .../projects/ui/src/app/app.component.html | 10 +--- frontend/projects/ui/src/app/app.component.ts | 15 +++++- .../connection-bar.component.ts | 26 +++++++++- .../server-show/server-show.page.ts | 21 -------- .../ui/src/app/services/api/api.fixures.ts | 2 + .../services/api/embassy-mock-api.service.ts | 49 +++++++++++++++++-- .../ui/src/app/services/api/mock-patch.ts | 2 + .../src/app/services/patch-db/data-model.ts | 2 + 11 files changed, 117 insertions(+), 37 deletions(-) diff --git a/backend/src/db/model.rs b/backend/src/db/model.rs index 6ce3f8add..72231c020 100644 --- a/backend/src/db/model.rs +++ b/backend/src/db/model.rs @@ -57,6 +57,8 @@ impl Database { backup_progress: None, updated: false, update_progress: None, + shutting_down: false, + restarting: false, }, wifi: WifiInfo { ssids: Vec::new(), @@ -166,6 +168,10 @@ pub struct ServerStatus { pub backup_progress: Option>, pub updated: bool, pub update_progress: Option, + #[serde(default)] + pub shutting_down: bool, + #[serde(default)] + pub restarting: bool, } #[derive(Debug, Deserialize, Serialize, HasModel)] diff --git a/backend/src/init.rs b/backend/src/init.rs index dc98dae42..288149f37 100644 --- a/backend/src/init.rs +++ b/backend/src/init.rs @@ -406,6 +406,8 @@ pub async fn init(cfg: &RpcContextConfig) -> Result { updated: false, update_progress: None, backup_progress: None, + shutting_down: false, + restarting: false, }; server_info.ntp_synced = if time_not_synced { diff --git a/backend/src/shutdown.rs b/backend/src/shutdown.rs index 93e5cc3d2..7a34d1e94 100644 --- a/backend/src/shutdown.rs +++ b/backend/src/shutdown.rs @@ -6,10 +6,11 @@ use rpc_toolkit::command; use crate::context::RpcContext; use crate::disk::main::export; use crate::init::{STANDBY_MODE_PATH, SYSTEM_REBUILD_PATH}; +use crate::prelude::*; use crate::sound::SHUTDOWN; use crate::util::docker::CONTAINER_TOOL; use crate::util::{display_none, Invoke}; -use crate::{Error, PLATFORM}; +use crate::PLATFORM; #[derive(Debug, Clone)] pub struct Shutdown { @@ -90,6 +91,14 @@ impl Shutdown { #[command(display(display_none))] pub async fn shutdown(#[context] ctx: RpcContext) -> Result<(), Error> { + ctx.db + .mutate(|db| { + db.as_server_info_mut() + .as_status_info_mut() + .as_shutting_down_mut() + .ser(&true) + }) + .await?; ctx.shutdown .send(Some(Shutdown { export_args: Some((ctx.disk_guid.clone(), ctx.datadir.clone())), @@ -102,6 +111,14 @@ pub async fn shutdown(#[context] ctx: RpcContext) -> Result<(), Error> { #[command(display(display_none))] pub async fn restart(#[context] ctx: RpcContext) -> Result<(), Error> { + ctx.db + .mutate(|db| { + db.as_server_info_mut() + .as_status_info_mut() + .as_restarting_mut() + .ser(&true) + }) + .await?; ctx.shutdown .send(Some(Shutdown { export_args: Some((ctx.disk_guid.clone(), ctx.datadir.clone())), diff --git a/frontend/projects/ui/src/app/app.component.html b/frontend/projects/ui/src/app/app.component.html index 29c7e11a3..0506d5214 100644 --- a/frontend/projects/ui/src/app/app.component.html +++ b/frontend/projects/ui/src/app/app.component.html @@ -26,10 +26,7 @@ type="overlay" side="end" class="right-menu container" - [class.container_offline]=" - (authService.isVerified$ | async) && - !(connection.connected$ | async) - " + [class.container_offline]="offline$ | async" [class.right-menu_hidden]="!drawer.open" [style.--side-width.px]="drawer.width" > @@ -47,10 +44,7 @@ [responsiveColViewport]="viewport" id="main-content" class="container" - [class.container_offline]=" - (authService.isVerified$ | async) && - !(connection.connected$ | async) - " + [class.container_offline]="offline$ | async" > + verified && + (!connected || status.restarting || status['shutting-down']), + ), + ) constructor( private readonly titleService: Title, diff --git a/frontend/projects/ui/src/app/components/connection-bar/connection-bar.component.ts b/frontend/projects/ui/src/app/components/connection-bar/connection-bar.component.ts index dc5388b04..9c4b07b7f 100644 --- a/frontend/projects/ui/src/app/components/connection-bar/connection-bar.component.ts +++ b/frontend/projects/ui/src/app/components/connection-bar/connection-bar.component.ts @@ -1,6 +1,8 @@ import { ChangeDetectionStrategy, Component } from '@angular/core' +import { PatchDB } from 'patch-db-client' import { combineLatest, map, Observable, startWith } from 'rxjs' import { ConnectionService } from 'src/app/services/connection.service' +import { DataModel } from 'src/app/services/patch-db/data-model' @Component({ selector: 'connection-bar', @@ -19,8 +21,11 @@ export class ConnectionBarComponent { }> = combineLatest([ this.connectionService.networkConnected$, this.websocket$.pipe(startWith(false)), + this.patch + .watch$('server-info', 'status-info') + .pipe(startWith({ restarting: false, 'shutting-down': false })), ]).pipe( - map(([network, websocket]) => { + map(([network, websocket, status]) => { if (!network) return { message: 'No Internet', @@ -35,6 +40,20 @@ export class ConnectionBarComponent { icon: 'cloud-offline-outline', dots: true, } + if (status['shutting-down']) + return { + message: 'Shutting Down', + color: 'dark', + icon: 'power', + dots: true, + } + if (status.restarting) + return { + message: 'Restarting', + color: 'dark', + icon: 'power', + dots: true, + } return { message: 'Connected', @@ -45,5 +64,8 @@ export class ConnectionBarComponent { }), ) - constructor(private readonly connectionService: ConnectionService) {} + constructor( + private readonly connectionService: ConnectionService, + private readonly patch: PatchDB, + ) {} } diff --git a/frontend/projects/ui/src/app/pages/server-routes/server-show/server-show.page.ts b/frontend/projects/ui/src/app/pages/server-routes/server-show/server-show.page.ts index 401dc19c0..2b64fcf1c 100644 --- a/frontend/projects/ui/src/app/pages/server-routes/server-show/server-show.page.ts +++ b/frontend/projects/ui/src/app/pages/server-routes/server-show/server-show.page.ts @@ -352,7 +352,6 @@ export class ServerShowPage { try { await this.embassyApi.restartServer({}) - this.presentAlertInProgress(action, ` until ${action} completes.`) } catch (e: any) { this.errToast.present(e) } finally { @@ -370,10 +369,6 @@ export class ServerShowPage { try { await this.embassyApi.shutdownServer({}) - this.presentAlertInProgress( - action, - '.

    You will need to physically power cycle the device to regain connectivity.', - ) } catch (e: any) { this.errToast.present(e) } finally { @@ -391,7 +386,6 @@ export class ServerShowPage { try { await this.embassyApi.systemRebuild({}) - this.presentAlertInProgress(action, ` until ${action} completes.`) } catch (e: any) { this.errToast.present(e) } finally { @@ -437,21 +431,6 @@ export class ServerShowPage { alert.present() } - private async presentAlertInProgress(verb: string, message: string) { - const alert = await this.alertCtrl.create({ - header: `${verb} In Progress...`, - message: `Stopping all services gracefully. This can take a while.

    If you have a speaker, your server will ♫ play a melody ♫ before shutting down. Your server will then become unreachable${message}`, - buttons: [ - { - text: 'OK', - role: 'cancel', - cssClass: 'enter-click', - }, - ], - }) - alert.present() - } - settings: ServerSettings = { Backups: [ { diff --git a/frontend/projects/ui/src/app/services/api/api.fixures.ts b/frontend/projects/ui/src/app/services/api/api.fixures.ts index 67ddbd8d6..c4db1225d 100644 --- a/frontend/projects/ui/src/app/services/api/api.fixures.ts +++ b/frontend/projects/ui/src/app/services/api/api.fixures.ts @@ -17,6 +17,8 @@ export module Mock { 'backup-progress': null, 'update-progress': null, updated: true, + restarting: false, + 'shutting-down': false, } export const MarketplaceEos: RR.GetMarketplaceEosRes = { version: '0.3.5', diff --git a/frontend/projects/ui/src/app/services/api/embassy-mock-api.service.ts b/frontend/projects/ui/src/app/services/api/embassy-mock-api.service.ts index 96cc2941c..c98a4bd87 100644 --- a/frontend/projects/ui/src/app/services/api/embassy-mock-api.service.ts +++ b/frontend/projects/ui/src/app/services/api/embassy-mock-api.service.ts @@ -302,6 +302,27 @@ export class MockApiService extends ApiService { params: RR.RestartServerReq, ): Promise { await pauseFor(2000) + + const patch = [ + { + op: PatchOp.REPLACE, + path: '/server-info/status-info/restarting', + value: true, + }, + ] + this.mockRevision(patch) + + setTimeout(() => { + const patch2 = [ + { + op: PatchOp.REPLACE, + path: '/server-info/status-info/restarting', + value: false, + }, + ] + this.mockRevision(patch2) + }, 2000) + return null } @@ -309,14 +330,34 @@ export class MockApiService extends ApiService { params: RR.ShutdownServerReq, ): Promise { await pauseFor(2000) + + const patch = [ + { + op: PatchOp.REPLACE, + path: '/server-info/status-info/shutting-down', + value: true, + }, + ] + this.mockRevision(patch) + + setTimeout(() => { + const patch2 = [ + { + op: PatchOp.REPLACE, + path: '/server-info/status-info/shutting-down', + value: false, + }, + ] + this.mockRevision(patch2) + }, 2000) + return null } async systemRebuild( - params: RR.RestartServerReq, - ): Promise { - await pauseFor(2000) - return null + params: RR.SystemRebuildReq, + ): Promise { + return this.restartServer(params) } async repairDisk(params: RR.RestartServerReq): Promise { diff --git a/frontend/projects/ui/src/app/services/api/mock-patch.ts b/frontend/projects/ui/src/app/services/api/mock-patch.ts index 02faddeb7..0c930aa8f 100644 --- a/frontend/projects/ui/src/app/services/api/mock-patch.ts +++ b/frontend/projects/ui/src/app/services/api/mock-patch.ts @@ -66,6 +66,8 @@ export const mockPatchData: DataModel = { 'backup-progress': null, updated: false, 'update-progress': null, + restarting: false, + 'shutting-down': false, }, hostname: 'random-words', pubkey: 'npub1sg6plzptd64u62a878hep2kev88swjh3tw00gjsfl8f237lmu63q0uf63m', diff --git a/frontend/projects/ui/src/app/services/patch-db/data-model.ts b/frontend/projects/ui/src/app/services/patch-db/data-model.ts index ba2dd4de7..e4ea729d9 100644 --- a/frontend/projects/ui/src/app/services/patch-db/data-model.ts +++ b/frontend/projects/ui/src/app/services/patch-db/data-model.ts @@ -96,6 +96,8 @@ export interface ServerStatusInfo { } updated: boolean 'update-progress': { size: number | null; downloaded: number } | null + restarting: boolean + 'shutting-down': boolean } export enum ServerStatus {