Commit Graph

114 Commits

Author SHA1 Message Date
MacRimi a921aac51e disk_host: open host mount path for unprivileged LXC bind-mounts
The fstab-only mount method explicitly says "for LXC bind-mounts" in
its dialog wording, but the mount point left behind by mkfs +
mkdir is owned root:root with mode 0755. An unprivileged LXC sees
the directory through its uid offset (root inside → host uid 100000)
which lands under the directory's "others" bits — so the container
can read but never write, and the user has to track down the
chmod / setfacl step manually.

lxc-mount-manager_minimal.sh already offers exactly this fix as
`lmm_offer_host_permissions` when the user adds the bind-mount
through that script, but the disk-side script never closed its half
of the loop. Add a small `_apply_lxc_bind_mount_perms` helper that
runs `chmod o+rwx` plus `setfacl o::rwx + default ACL` whenever
MODE_FSTAB=1, and call it from both `mount_disk_permanently`
(format path) and `mount_existing_disk` (use_existing path). Pure
pvesm-only mounts keep the original behaviour — chmod o+rwx on a
VM/backup storage isn't desirable.

Verified on .55 against the existing /mnt/disk-sda + LXC 112
(unprivileged): unprivileged container root could not write before
(Permission denied), writes succeed after the perms are applied and
land on the host as uid 100000 as expected.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-02 18:21:27 +02:00
MacRimi 15ed0f84e7 disk_host: surface fstab-only mounts in view, filter out network shares
Two related gaps in the disk-host script that surfaced while testing
the new dual-flow (pvesm / fstab-only / both) added earlier today.

view_disk_storages used to read only from `pvesm status`, so a disk
added via the new fstab-only path — exactly the case where the user
wants a local disk available for LXC bind-mounts without registering
it as a Proxmox storage — never showed up. Replicate the same fstab
scan remove_disk_storage already performs and list those mounts in a
second section underneath the pvesm ones. Empty state and wording
updated so the panel no longer claims "No local storage configured
in Proxmox" when fstab-only mounts are present.

Both view_disk_storages (new code) and remove_disk_storage (existing
fstab branch) were happily picking up `/mnt/Archivos` and any other
CIFS/NFS share mounted under /mnt. samba_host.sh and nfs_host.sh own
those — surfacing them in the local-disk menus would let a user
remove a network share from the wrong screen. Filter by fstype
(skip cifs/smbfs/nfs/nfs4/nfsv4/sshfs/fuse) and additionally require
that the resolved source be a real block device, which drops bind
mounts and anything else whose backing source isn't a disk.

Verified on .55 with the test disk-sda fstab-only mount alongside
the existing //192.168.0.15/Archivos CIFS mount: only disk-sda is
listed by the local-disk view/remove flows.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-02 18:15:37 +02:00
MacRimi 2a376d2c9b scripts/share: don't reboot a stopped CT, add fstab-only mode to disk_host
Two release-day fixes in the host-side share tooling, both reported
during testing of the v1.2.2 candidate.

lxc-mount-manager_minimal.sh
  After adding a mount point on a stopped LXC the script offered to
  `pct reboot $ct` unconditionally — which fails on a stopped CT
  because `pct reboot` only accepts running ones, so the user saw a
  bogus "Failed to restart" right after a successful mount. Gate the
  prompt on `pct status` and, when the CT is stopped, tell the user
  the mount will activate on next start instead of trying to reboot
  it. The matching restart prompt in the remove flow (around line
  540) was already doing the check correctly; this just brings the
  add flow in line.

disk_host.sh
  The script always registered the disk as a Proxmox storage via
  `pvesm add dir|zfspool`. nfs_host.sh and samba_host.sh already
  offered a dual-flow chooser ("Proxmox storage" / "host fstab only"
  / both) so a user could mount the share on the host for LXC
  bind-mounts without surfacing it as a Proxmox storage. Replicate
  that chooser for local disks:

  * new `select_mount_method` checklist with `pvesm` and `fstab`,
    inserted after filesystem selection. ZFS is forced into the
    pvesm path because a ZFS pool can't be expressed as an fstab
    mount.
  * `configure_disk_storage` skips the Content Types prompt when
    only fstab is selected and renames "Storage ID" → "Mount Name"
    in the same case so the wording matches what the user will
    actually see (or not see) in Proxmox.
  * `format_and_mount_disk` title and summary lines adapt to the
    chosen mode.
  * the trailing `add_proxmox_dir_storage` call in `add_local_disk_storage`
    runs only when `MODE_PVESM=1`; in fstab-only mode the final
    message points users at the LXC Mount Manager for bind-mounts.

  Verified end-to-end on a 32 GB USB disk against LXC 112
  (unprivileged) on .55: fstab-only path → bind-mount → root inside
  CT writes mapped to host uid 100000, regular user writes mapped to
  host uid 101000, both reads/writes successful from inside the
  container.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-02 18:03:00 +02:00
MacRimi f27b3d480a Update lxc-mount-manager_minimal.sh 2026-06-02 17:49:37 +02:00
MacRimi 3143fedb7a Updates scripts share 2026-05-26 17:21:24 +02:00
MacRimi 2dc3a2b93c Update scripts share 2026-05-26 12:41:50 +02:00
MacRimi 4112323961 Update AppImage 2026-05-20 18:14:32 +02:00
MacRimi 1087a87ea2 Update samba_lxc_server.sh 2026-05-20 16:32:03 +02:00
MacRimi 2f919de9e3 update beta ProxMenux 1.2.1.1-beta 2026-05-09 18:59:59 +02:00
MacRimi 4843fae0eb Update scripts 2026-04-12 20:32:34 +02:00
MacRimi 5826b0419b update pci_passthrough_helpers.sh 2026-04-05 11:24:08 +02:00
MacRimi 5f5dc171be update scripts gpu 2026-04-01 23:09:51 +02:00
MacRimi d497763e38 Update repository and clean up 2026-03-26 19:03:01 +01:00
MacRimi bebf0e692a Update License 2026-01-19 17:15:00 +01:00
cod378 ba88c7b0f6 refactor: switch from remote URLs to local script execution 2025-11-03 01:41:39 +00:00
cod378 4359d92ffe refactor: switch from remote URLs to local script execution 2025-11-03 01:40:38 +00:00
cod378 16c7513e82 refactor: switch from remote URLs to local script execution 2025-11-03 01:39:15 +00:00
cod378 4572478ad8 refactor: switch from remote URLs to local script execution 2025-11-03 01:38:05 +00:00
cod378 02b5cd61bd refactor: switch from remote URLs to local script execution 2025-11-03 01:36:57 +00:00
cod378 bff07311b2 refactor: switch from remote URLs to local script execution 2025-11-03 01:34:44 +00:00
cod378 44cc89b9d5 refactor: switch from remote URLs to local file paths 2025-11-03 01:33:04 +00:00
cod378 fa1e6c6c64 refactor: switch from remote URLs to local script execution 2025-11-03 01:27:37 +00:00
MacRimi f1fa6b03d5 change license CC-BY-NC-4.0 2025-11-01 00:10:46 +01:00
MacRimi c61f568170 Update nfs_lxc_server.sh 2025-09-27 18:50:50 +02:00
MacRimi 5a31c36097 update menu share 2025-09-10 18:05:06 +02:00
MacRimi f8b2ccec40 Update commands_share.sh 2025-09-10 13:48:17 +02:00
MacRimi e858dc582d Update commands_share.sh 2025-09-10 13:47:13 +02:00
MacRimi dd737f4b46 Update commands_share.sh 2025-09-10 13:46:02 +02:00
MacRimi f0bc238b6d Update commands_share.sh 2025-09-10 13:35:16 +02:00
MacRimi af55424850 Update lxc-mount-manager_minimal.sh 2025-09-10 13:16:54 +02:00
MacRimi 902534baff update menu shared 2025-09-10 12:57:17 +02:00
MacRimi 6daa630040 Update nfs_host.sh 2025-09-10 12:53:09 +02:00
MacRimi 0b2b86673b Update lxc-mount-manager_minimal.sh 2025-09-10 12:31:49 +02:00
MacRimi 4430201cd2 Update lxc-mount-manager_minimal.sh 2025-09-10 12:16:25 +02:00
MacRimi 7c7963a83e Create lxc-mount-manager_minimal.sh 2025-09-10 11:10:02 +02:00
MacRimi 6ef77c731c Update guia.md 2025-09-08 17:44:17 +02:00
MacRimi 29b0f61958 Update guia.md 2025-09-08 17:43:39 +02:00
MacRimi e944b2ecdd Update guia.md 2025-09-08 17:24:23 +02:00
MacRimi 41819c46a3 Update guia.md 2025-09-08 17:21:58 +02:00
MacRimi 13f391a6f0 Update guia.md 2025-09-08 17:14:52 +02:00
MacRimi 85a3d44f2c Update guia.md 2025-09-08 17:05:26 +02:00
MacRimi 0792392058 Update guia.md 2025-09-08 16:42:46 +02:00
MacRimi ff5083ada0 Update guia.md 2025-09-08 16:20:10 +02:00
MacRimi 62841677bc Update guia.md 2025-09-08 16:06:50 +02:00
MacRimi 1761cf53a2 Update guia.md 2025-09-08 15:27:32 +02:00
MacRimi a771efc5fa Update guia.md 2025-09-08 15:08:02 +02:00
MacRimi ed049da76a Update guia.md 2025-09-08 15:03:10 +02:00
MacRimi 30d0706a1c Create guia.md 2025-09-08 15:01:00 +02:00
MacRimi a9c1acf204 Update lxc-mount-manager.sh 2025-09-08 11:15:52 +02:00
MacRimi 81c4f5814c Update samba_host.sh 2025-09-08 10:40:59 +02:00