azukaar / Cosmos-Server

☁️ The Most Secure and Easy Selfhosted Home Server. Take control of your data and privacy without sacrificing security and stability (Authentication, anti-DDOS, anti-bot)
https://cosmos-cloud.io
Other
3.1k stars 112 forks source link

[FEAT]: Ability to map NFS mounts in Market Installs/ServApps #89

Open Lockszmith-GH opened 12 months ago

Lockszmith-GH commented 12 months ago

Feature Description

Baiscally, a UI implementation to define the following docker-compose equivalent config:

volumes:
  example:
    driver_opts:
      type: "nfs"
      o: "addr=10.40.0.199,nolock,soft,rw"
      device: ":/docker/example"

https://stackoverflow.com/a/46481637/799379

azukaar commented 12 months ago

I have long term plan for the volume side of thing (mounting any kind of network storage like Drive, Dropbox, etc...) so this wont probably be needed as is

Lockszmith-GH commented 12 months ago

That sounds great. But here we're talking about supporting exisitng implementation.

I'm running Cosmos as a VM on a TrueNAS SCALE, the best way to connect to the NAS shares is using NFS mounts.

Will using a predefined volume, one created with docker volumes from the command line work? I'll try and report here if it doesn't

azukaar commented 11 months ago

Not from the UI but you can support it by simply using the snipet you linked earlier with the compose import tool

Lockszmith-GH commented 11 months ago

Just wanted to update that indeed, using volumes defined externally, are selectable via the volumes drop down (although is not sorted).

So until such a feature exists, I manage these volumes in a docker compose separate from cosmos.

Something like this docker-compose.yml (click to expand) ```yaml version: "3.7" services: shell: image: bash:latest restart: "no" container_name: arr-bash command: -c 'echo "network and volumes are setup."' volumes: - apps-nfs-remote:/data/nfs-remote - local-other:/data/local-other networks: - a-network networks: a-network: name: a-network volumes: apps-nfs-remote: name: apps-nfs-remote driver: local driver_opts: type: "nfs" o: "addr=example.local,nolock,soft,rw" device: ":/path/to/nfs/export" local-other: name: local-other driver: local driver_opts: type: "none" o: "bind" device: "./path/to/other/" ```

This allows me to docker compose up to apply changes, and if some maintenance is required, I can remove all of that with docker compose down --volumes.

As long as I don't define actual docker volumes in that file, there is no data-loss.

Let me know if you need me to open a separate feature request for the sorting of the volumes picker.

azukaar commented 11 months ago

volume picker needs a makeover with search integrated and so on, it kinda sucks right now :/