mirror of
https://github.com/pezkuwichain/pezkuwi-subquery.git
synced 2026-10-22 11:46:16 +00:00
ci: deploy over a pinned, single-purpose key instead of root
deploy-vps reached subquery1 as root, through appleboy/ssh-action referenced by tag, with a key whose comment (mamostehp@MamostePC) made it look like a person's. It now uses plain ssh with SUBQUERY_DEPLOY_KEY, which the host pins (authorized_keys restrict,command=) to ops/host/subquery-deploy-ssh: the commit SHA is its only input. subquery-deploy, run through sudo, does what the workflow's script did, with three changes: - It deploys exactly the SHA CI was triggered for, and only a commit on main. - The host's local edits to tracked files (the indexer manifests) are put back whether the deploy succeeds or fails. Before, a failed build exited before `stash pop` and left them stashed. - Only tracked files are stashed. Stashing untracked ones too (.yarn/, which yarn install recreates) made every pop fail half-way; that is how 13 stash entries piled up on the host. test-deploy.sh covers this against a scratch clone (red with the restore trap removed); CI runs it with shellcheck. subquery1's host key is pinned. The indexer endpoints themselves are unchanged. Actions pinned to SHAs; the secret scanner's own AGPL licence is allowed in dependency review.
This commit is contained in:
1 parent
01a4903337
commit
7ec6d9971f
9 files changed
+190
-41
No files matched your search
@@ -18,10 +18,10 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
|
||||
with:
|
||||
node-version: '18'
|
||||
|
||||
@@ -49,20 +49,23 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
|
||||
|
||||
- name: Dependency Review
|
||||
uses: actions/dependency-review-action@v4
|
||||
uses: actions/dependency-review-action@2031cfc080254a8a887f58cffee85186f0e49e48 # v4.9.0
|
||||
with:
|
||||
fail-on-severity: high
|
||||
deny-licenses: GPL-3.0, AGPL-3.0
|
||||
# The light client is an optional dependency of @pezkuwi/rpc-provider,
|
||||
# so it is listed in the bots' lockfiles, but their images are built
|
||||
# with --omit=optional and never contain it (checked in ci.yml, bots).
|
||||
# TruffleHog (AGPL-3.0) is the secret scanner this workflow runs; it
|
||||
# executes in CI and is never shipped, served or distributed.
|
||||
allow-dependencies-licenses: >-
|
||||
pkg:npm/@bizinikiwi/connect,
|
||||
pkg:npm/@bizinikiwi/connect-extension-protocol,
|
||||
pkg:npm/@bizinikiwi/connect-known-chains
|
||||
pkg:npm/@bizinikiwi/connect-known-chains,
|
||||
pkg:githubactions/trufflesecurity/trufflehog
|
||||
|
||||
secret-scan:
|
||||
name: Secret Scan
|
||||
@@ -70,12 +73,12 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: TruffleHog Secret Scan
|
||||
uses: trufflesecurity/trufflehog@main
|
||||
uses: trufflesecurity/trufflehog@e76dff8a7e57d6df0c60ad8cbf5d5cba505a8fc9 # v3.99.2
|
||||
with:
|
||||
path: ./
|
||||
base: ${{ github.event.repository.default_branch }}
|
||||
|
||||
Reference in new issue
Block a user