Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 40
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
with:
persist-credentials: false

- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,13 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 50
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3.7.0

- uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
- uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0

- uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6.19.2
with:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/platform-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ jobs:
runs-on: ${{ matrix.os }}
timeout-minutes: 20
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
Expand Down
38 changes: 25 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ jobs:
if: github.ref == 'refs/heads/main'
run: echo "Release source is main."

- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
Expand All @@ -47,7 +49,9 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 50
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
Expand Down Expand Up @@ -116,7 +120,7 @@ jobs:
sha256sum "run-spaceapp-${{ inputs.version }}.tgz"
> "run-spaceapp-${{ inputs.version }}.tgz.sha256"

- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: public-release-source-candidate-${{ inputs.version }}
path: ${{ runner.temp }}/release-artifacts/
Expand All @@ -138,15 +142,17 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 65
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Create sanitized container context
run: >-
node scripts/public-export.mjs
--output "$RUNNER_TEMP/spaceapp-public-export"

- uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3.7.0
- uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
- uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0

- uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6.19.2
with:
Expand Down Expand Up @@ -197,7 +203,7 @@ jobs:

- name: Upload full candidate image report
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: trivy-full-${{ matrix.target }}-${{ matrix.arch }}
path: trivy-full-${{ matrix.target }}-${{ matrix.arch }}.json
Expand All @@ -216,9 +222,11 @@ jobs:
packages: write
id-token: write
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
- uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0

- uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0
with:
Expand Down Expand Up @@ -261,7 +269,7 @@ jobs:
-xzf "$RUNNER_TEMP/release-artifacts/spaceapp-public-export-${{ inputs.version }}.tar.gz"

- uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3.7.0
- uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
- uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0

- uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0
with:
Expand All @@ -278,7 +286,7 @@ jobs:
push: true
tags: ghcr.io/oll4com/spaceapp-${{ matrix.target }}:${{ inputs.version }}
sbom: true
provenance: mode=max
provenance: mode=max,version=v1
cache-from: type=gha,scope=publish-${{ matrix.target }}
cache-to: type=gha,mode=max,scope=publish-${{ matrix.target }}

Expand All @@ -293,9 +301,11 @@ jobs:
packages: write
id-token: write
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
- uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0

- uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0
with:
Expand All @@ -319,7 +329,9 @@ jobs:
packages: write
id-token: write
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
Expand Down
25 changes: 16 additions & 9 deletions .github/workflows/security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 35
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
persist-credentials: false

- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
Expand Down Expand Up @@ -83,7 +84,7 @@ jobs:

- name: Upload full filesystem report
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: trivy-full-filesystem
path: trivy-full-filesystem.json
Expand All @@ -96,7 +97,7 @@ jobs:
format: spdx-json
output-file: spaceapp-source.spdx.json

- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: source-sbom
path: spaceapp-source.spdx.json
Expand All @@ -107,8 +108,10 @@ jobs:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
- uses: actions/dependency-review-action@2031cfc080254a8a887f58cffee85186f0e49e48 # v4.9.0
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/dependency-review-action@a1d282b36b6f3519aa1f3fc636f609c47dddb294 # v5.0.0
with:
fail-on-severity: high

Expand All @@ -117,7 +120,9 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 35
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- uses: github/codeql-action/init@4187e74d05793876e9989daffde9c3e66b4acd07 # v3.37.3
with:
Expand Down Expand Up @@ -145,9 +150,11 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 55
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
- uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0

- uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6.19.2
with:
Expand Down Expand Up @@ -196,7 +203,7 @@ jobs:

- name: Upload full image report
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: trivy-full-${{ matrix.target }}
path: trivy-full-${{ matrix.target }}.json
Expand Down
15 changes: 14 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@ Semantic Versioning.

## [Unreleased]

## [0.1.5] - 2026-07-24

- fix release verification for compact multi-platform OCI attestations so
large browser SBOMs no longer exceed the verifier process buffer;
- remove CodeQL command, JavaScript, and redirect injection paths;
- prove global and per-route API rate-limit ordering with runtime regression
coverage;
- update React, React DOM, Lucide, Vite, and release workflow actions while
preserving immutable full-SHA action pins;
- keep TypeScript 5.9 until the TypeScript 7 compiler API is stable enough for
the release security tests.

## [0.1.4] - 2026-07-24

- install and start signed Docker Desktop automatically on Windows and macOS
Expand Down Expand Up @@ -50,7 +62,8 @@ Initial public release:
- portable backup, restore, update, and rollback commands;
- no telemetry by default.

[Unreleased]: https://github.com/oll4com/spaceapp/compare/v0.1.4...HEAD
[Unreleased]: https://github.com/oll4com/spaceapp/compare/v0.1.5...HEAD
[0.1.5]: https://github.com/oll4com/spaceapp/releases/tag/v0.1.5
[0.1.4]: https://github.com/oll4com/spaceapp/releases/tag/v0.1.4
[0.1.3]: https://github.com/oll4com/spaceapp/releases/tag/v0.1.3
[0.1.2]: https://github.com/oll4com/spaceapp/releases/tag/v0.1.2
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ and telemetry is disabled by default.
spaceapp status
spaceapp logs
spaceapp backup
spaceapp update 0.1.4
spaceapp update 0.1.5
spaceapp rollback
spaceapp down
spaceapp uninstall
Expand Down
73 changes: 63 additions & 10 deletions apps/api/src/browser-sessions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1157,6 +1157,63 @@ function readRuntimeValue<T>(result: { result?: { value?: T } }): T | null {
return result.result && "value" in result.result ? (result.result.value ?? null) : null;
}

interface ElementScreenshotClip {
x: number;
y: number;
width: number;
height: number;
scale: number;
}

interface CdpCommandSender {
send(
method: string,
params?: Record<string, unknown>,
sessionId?: string
): Promise<unknown>;
}

export async function resolveElementScreenshotClip(
client: CdpCommandSender,
cdpSessionId: string,
selector: string
): Promise<ElementScreenshotClip | null> {
const documentResult = await client.send(
"DOM.getDocument",
{ depth: 0, pierce: true },
cdpSessionId
) as { root?: { nodeId?: number } };
const rootNodeId = documentResult.root?.nodeId;
if (!Number.isInteger(rootNodeId) || !rootNodeId || rootNodeId <= 0) return null;

const queryResult = await client.send(
"DOM.querySelector",
{ nodeId: rootNodeId, selector },
cdpSessionId
) as { nodeId?: number };
if (!Number.isInteger(queryResult.nodeId) || !queryResult.nodeId || queryResult.nodeId <= 0) {
return null;
}

const boxResult = await client.send(
"DOM.getBoxModel",
{ nodeId: queryResult.nodeId },
cdpSessionId
) as { model?: { border?: number[] } };
const border = boxResult.model?.border;
if (!Array.isArray(border) || border.length < 8 || border.some((value) => !Number.isFinite(value))) {
return null;
}
const xCoordinates = border.filter((_value, index) => index % 2 === 0);
const yCoordinates = border.filter((_value, index) => index % 2 === 1);
const x = Math.min(...xCoordinates);
const y = Math.min(...yCoordinates);
const width = Math.max(...xCoordinates) - x;
const height = Math.max(...yCoordinates) - y;
if (width <= 0 || height <= 0) return null;
return { x, y, width, height, scale: 1 };
}

export function createBrowserSessionManager(options: { store: SpaceStore; config: SpaceApiConfig }): BrowserSessionManager {
const { store, config } = options;
const runtimes = new Map<string, BrowserRuntime>();
Expand Down Expand Up @@ -1809,17 +1866,13 @@ export function createBrowserSessionManager(options: { store: SpaceStore; config
const size = metrics.contentSize;
if (size?.width && size.height) clip = { x: size.x ?? 0, y: size.y ?? 0, width: size.width, height: size.height, scale: 1 };
} else if (job.options.target === "ELEMENT" && job.options.selector) {
const result = await runtime.client.send<{ result?: { value?: { x: number; y: number; width: number; height: number } | null } }>(
"Runtime.evaluate",
{
expression: `(() => { const element = document.querySelector(${JSON.stringify(job.options.selector)}); if (!element) return null; const r = element.getBoundingClientRect(); return { x: r.x + scrollX, y: r.y + scrollY, width: r.width, height: r.height }; })()`,
returnByValue: true
},
runtime.cdpSessionId
const value = await resolveElementScreenshotClip(
runtime.client,
runtime.cdpSessionId,
job.options.selector
);
const value = readRuntimeValue(result);
if (!value || value.width <= 0 || value.height <= 0) throw new SpaceNotFoundError(`Browser element ${job.options.selector} was not found.`);
clip = { ...value, scale: 1 };
if (!value) throw new SpaceNotFoundError(`Browser element ${job.options.selector} was not found.`);
clip = value;
}
const screenshot = await runtime.client.send<{ data: string }>(
"Page.captureScreenshot",
Expand Down
Loading
Loading