Skip to content

Commit

Permalink
add rock patch
Browse files Browse the repository at this point in the history
  • Loading branch information
kelkawi-a committed Sep 7, 2024
1 parent 50a2b5b commit e1aa1bc
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 38 deletions.
4 changes: 4 additions & 0 deletions .trivyignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Ignore vulnerabilities on stdlib
CVE-2024-24790
CVE-2023-24538
CVE-2023-24540
15 changes: 15 additions & 0 deletions airbyte_ui_rock/patches/vite-config-http.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright 2024 Canonical Ltd.
# See LICENSE file for licensing details.

diff --git a/airbyte-webapp/vite.config.mts b/airbyte-webapp/vite.config.mts
index 4cf29fa0de..6359ab2a55 100644
--- a/airbyte-webapp/vite.config.mts
+++ b/airbyte-webapp/vite.config.mts
@@ -118,6 +118,7 @@ export default defineConfig(() => {
},
},
server: {
+ https: false,
host: true,
port: Number(process.env.PORT) || 3000,
strictPort: true,
51 changes: 13 additions & 38 deletions airbyte_ui_rock/rockcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,19 @@ services:
environment:
PORT: "8080"

# Please refer to
# https://discourse.ubuntu.com/t/unifying-user-identity-across-snaps-and-rocks/36469
# for more information about shared user.
# The UID 584792 corresponds to _daemon_ user.
run_user: _daemon_

parts:
patches:
plugin: dump
source: ./patches
organize:
vite-config-http.patch: patches/vite-config-http.patch
stage:
- patches/vite-config-http.patch
prime:
- "-*"

airbyte-webapp:
after: [patches]
plugin: dump
source: https://github.com/airbytehq/airbyte-platform.git # yamllint disable-line
source-type: git
Expand All @@ -40,22 +45,13 @@ parts:
- coreutils
- bash
override-build: |
git apply ${CRAFT_STAGE}/patches/*.patch
curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
source ~/.bashrc
cd airbyte-webapp
nvm install
npm install -g [email protected] --force
# corepack enable && corepack install
# corepack install --global [email protected]
# Programmatically update vite.config.mts to set https: false
if grep -q "https:" vite.config.mts; then
# Modify the existing https setting
sed -i 's/https: true/https: false/' vite.config.mts
else
# Add https: false to the server section if not present
sed -i '/server: {/a\ https: false,' vite.config.mts
fi
pnpm install
pnpm run build
Expand All @@ -77,24 +73,3 @@ parts:
- bin/node
- bin/pnpm
- lib
# permissions:
# - path: airbyte-webapp
# owner: 584792
# group: 584792
# mode: "755"
# - path: airbyte-connector-builder-resources
# owner: 584792
# group: 584792
# mode: "755"
# - path: bin/node
# owner: 584792
# group: 584792
# mode: "755"
# - path: bin/pnpm
# owner: 584792
# group: 584792
# mode: "755"
# - path: lib
# owner: 584792
# group: 584792
# mode: "755"

0 comments on commit e1aa1bc

Please sign in to comment.