OpenMediaVault-Plugin-Developers / openmediavault-compose

openmediavault plugin for docker-compose
14 stars 5 forks source link

Stacks get lost after re-setup of docker #1

Closed HannesJo0139 closed 1 year ago

HannesJo0139 commented 1 year ago

Today I had to uninstall and purge docker due to an issue of btrfs driver. After re-setup all the compose stacks were gone. The files still exist in the sharedfolder. But I assume I have to re-enter them manually? If so, for future versions it would be awesome to have some function that imports existing config files.

ryecoaaron commented 1 year ago

If you "apt-get remove openmediavault-compose" before purging docker, you wouldn't have lost the database entries and then the plugin could've just recreated all of the files. I will look at importing all compose folders in the proper setup in a directory but it won't import just any compose file.

HannesJo0139 commented 1 year ago

Ah that's nice to know if there is a next time. Yeah I think importing any compose file is unnecessary, but for instance lets say there is a directory swag/ with swag.yml and swag.env in it. So if it matches the plugin's pattern perfectly you could probably just import that stack?

ryecoaaron commented 1 year ago

yes but I was thinking it would import all of them instead of one at a time. Which would be preferrable?

HannesJo0139 commented 1 year ago

Yeah that would be great. So in my case after pointing to the correct sharedfolder, everything would have showed up at once.

ryecoaaron commented 1 year ago

ok. that shouldn't be too hard. That is basically what the create from example is doing now.

ryecoaaron commented 1 year ago

6.3 is in the repo. Tested importing 30 randomly generated with this script to generate:

#!/bin/bash
#rm -rf /tmp/compose
for i in 1 2 3 4 5 6 7 8 9 10; do
  prefix="$(openssl rand -hex 4)"
  path="/tmp/compose/${prefix}${i}"
  echo "${path}"
  mkdir -p ${path}
  echo "# ${i} compose" > ${path}/${prefix}${i}.yml
  echo "# ${i} env" > ${path}/${prefix}${i}.env
done