Commit Graph

29 Commits

Author SHA1 Message Date
Johannes Zellner 26dbd50cf2 Ensure we don't crash if mount status does not include some strings 2021-10-26 14:54:56 +02:00
Johannes Zellner d1a7172895 Add remount route for mountlike backup storages 2021-10-11 18:12:11 +02:00
Johannes Zellner 9eed3af8b6 add volume remount 2021-10-11 16:22:56 +02:00
Girish Ramakrishnan ae4a091261 pass debug for safe call 2021-09-29 20:15:54 -07:00
Girish Ramakrishnan 3bcd32c56d restore: mount all volumes before restoring apps
fixes #786
2021-09-28 11:51:01 -07:00
Girish Ramakrishnan d79206f978 mounts: volume -> mounts
this code is shared by volume code and backup code
2021-09-28 11:44:09 -07:00
Girish Ramakrishnan 004e812d60 merge backupdb into backups.js 2021-07-14 15:10:45 -07:00
Girish Ramakrishnan fd9964c2cb mount: always use mountpoint for getting mount state
for ssfs.fuse, we get this on ubuntu 18:

root@my:/etc/systemd/system# systemctl status mnt-cloudronbackup.mount
● mnt-cloudronbackup.mount - backup
   Loaded: loaded (/etc/systemd/system/mnt-cloudronbackup.mount; enabled; vendor preset: enabled)
   Active: active (mounted) (Result: exit-code) since Sat 2021-07-10 00:16:53 UTC; 40s ago
    Where: /mnt/cloudronbackup
     What: root@149.28.218.27:/mnt/backups
  Process: 8273 ExecUnmount=/bin/umount /mnt/cloudronbackup -c (code=exited, status=32)
  Process: 8288 ExecMount=/bin/mount root@149.28.218.27:/mnt/backups /mnt/cloudronbackup -t fuse.sshfs -o allow_other,port=22,IdentityFile=/home/yellowtent/platformdata/sshfs/id_rsa_149.28.2
    Tasks: 0 (limit: 2314)
   CGroup: /system.slice/mnt-cloudronbackup.mount

Jul 10 00:16:53 my.cloudron.space systemd[1]: Mounting backup...
Jul 10 00:16:53 my.cloudron.space mount[8288]: read: Connection reset by peer
Jul 10 00:16:53 my.cloudron.space systemd[1]: mnt-cloudronbackup.mount: Mount process exited, code=exited status=1
Jul 10 00:16:53 my.cloudron.space systemd[1]: Mounted backup.

so even though the mount failed, it says active/mounted. sad.
2021-07-09 17:50:29 -07:00
Girish Ramakrishnan c93284e6fb mount: json parsing of error message 2021-07-09 16:59:57 -07:00
Girish Ramakrishnan bad6e39d59 volume: add filesystem type for shared folders
rename noop to mountpoint
2021-06-25 10:12:28 -07:00
Girish Ramakrishnan 1ce4875db1 volumes: set hostPath based on volume id
this is required for the file browser to work which does operations
based on the id

fixes #789
2021-06-24 17:32:41 -07:00
Girish Ramakrishnan 87b2b63043 sshfs: add StrictHostKeyChecking=no so that it can connect the first time 2021-06-24 15:10:00 -07:00
Girish Ramakrishnan 02263e8921 add back mountpoint check 2021-06-22 15:52:50 -07:00
Girish Ramakrishnan 15ff43369f mount: if unmount failed, do not proceed 2021-06-22 13:03:44 -07:00
Girish Ramakrishnan ceddabd691 Fix tryAddMount usage 2021-06-21 23:13:37 -07:00
Girish Ramakrishnan 3ba2f96d51 volume: remove private fields 2021-06-21 16:35:08 -07:00
Girish Ramakrishnan 6ace8d1ac5 volumes: fix various mount related issues
Various notes on mounting:

* The permissions come from the mounted file system and not the mount point.
This means that if we change the perms before mounting, it is overridden by
whatever is in the actual file system.

* uid/gid only works for permission-less file systems

SFTP container notes:

* Assumes that nothing changed if the host path hasn't changed. This means that
if a user changes the disk uuid, reload doesn't work.

* Not sure how/why, but even after unmounting the container can still access the old
mount files (!). With ext4 on disk change or nfs after root path change, the file manager
continues to be able to access the old mounts (despite umount succeeding).

All this led to following changes:

* Remove editing of volumes. Just allow editing username/password.
* edit UI then just also provides a way to re-mount.
* Change mode of mountpoint to be 777 post mounting for ease of use. Otherwise, we have to
make the user do this by ssh. this can always become options later.
2021-06-21 16:11:48 -07:00
Girish Ramakrishnan 79ec7fb245 volumes: make sshfs work 2021-06-20 23:39:35 -07:00
Girish Ramakrishnan 87c22a4670 mount: mount as 777 for max compat
for cifs, file_mode can be 666
2021-06-20 22:48:37 -07:00
Girish Ramakrishnan 90657af7f2 mount: fix nfs re-mounting 2021-06-18 23:48:39 -07:00
Girish Ramakrishnan ecf2ff9e15 mount: better error message detection 2021-06-18 23:02:53 -07:00
Girish Ramakrishnan 5f509f802f install sshfs 2021-06-18 14:46:54 -07:00
Girish Ramakrishnan e6e875814e systemctl show --value does not work on ubuntu 16 2021-06-18 14:29:03 -07:00
Girish Ramakrishnan 0a5a24ba2e add tryAddMount
we try to add a mount. if it fails, it will revert to the previous mount config.

there was a plan to make this work based on systemd-mount but we hit this bug - https://bugzilla.redhat.com/show_bug.cgi?id=1708996
2021-05-21 22:32:51 -07:00
Girish Ramakrishnan 59db625ad9 volumes: wait for mount during add/update
this is a better feedback mechanism for the user
2021-05-19 11:08:33 -07:00
Johannes Zellner 1785b0352a Add initial sshfs support 2021-05-18 17:27:32 +02:00
Girish Ramakrishnan 14bb928d41 backups: fix various mount issues 2021-05-17 22:58:40 -07:00
Girish Ramakrishnan c7474511aa fix volume test 2021-05-17 16:23:37 -07:00
Girish Ramakrishnan aae40f506b backups: add mounting config 2021-05-14 15:27:07 -07:00