@le-space/rootfs 0.1.49 → 0.1.51

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -393,6 +393,8 @@ function createDockerRootfsExecutionPlan(plan, options = {}) {
393
393
  const containerProjectDir = projectMountPath;
394
394
  const containerContractPath = containerPathForProjectFile(plan.contractPath, plan.projectDir, projectMountPath, "contractPath");
395
395
  const containerOutDir = containerPathForProjectFile(plan.outDir, plan.projectDir, projectMountPath, "outDir");
396
+ const hostUid = typeof process.getuid === "function" ? String(process.getuid()) : "1000";
397
+ const hostGid = typeof process.getgid === "function" ? String(process.getgid()) : "1000";
396
398
  return {
397
399
  mode: "docker",
398
400
  reason: "Using Dockerized Debian/libguestfs builder.",
@@ -428,6 +430,10 @@ function createDockerRootfsExecutionPlan(plan, options = {}) {
428
430
  `ROOTFS_IMAGE_SIZE=${plan.rootfsImageSize}`,
429
431
  "-e",
430
432
  `PROJECT_DIR=${containerProjectDir}`,
433
+ "-e",
434
+ `HOST_UID=${hostUid}`,
435
+ "-e",
436
+ `HOST_GID=${hostGid}`,
431
437
  "-v",
432
438
  `${plan.projectDir}:${projectMountPath}`,
433
439
  "-v",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@le-space/rootfs",
3
- "version": "0.1.49",
3
+ "version": "0.1.51",
4
4
  "description": "Shared rootfs contract parsing, reference profile assets, and build helpers.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -12,6 +12,8 @@ IMAGE="${OUT_DIR}/aleph-uc-go-peer.qcow2"
12
12
  APP_BINARY="${OUT_DIR}/universal-chat-go"
13
13
  ROOTFS_IMAGE_SIZE="${ROOTFS_IMAGE_SIZE:-20G}"
14
14
  ROOTFS_BUILD_TMPDIR=""
15
+ HOST_UID="${HOST_UID:-}"
16
+ HOST_GID="${HOST_GID:-}"
15
17
 
16
18
  require() {
17
19
  command -v "$1" >/dev/null 2>&1 || {
@@ -103,3 +105,7 @@ virt-customize \
103
105
  --run-command "systemctl enable ${ROOTFS_CONTRACT_MAIN_SERVICE}"
104
106
 
105
107
  echo "Rootfs image ready at ${IMAGE}"
108
+
109
+ if [ -n "${HOST_UID}" ] && [ -n "${HOST_GID}" ]; then
110
+ chown -R "${HOST_UID}:${HOST_GID}" "${OUT_DIR}"
111
+ fi