If volume location changes, we re-create the volume. However, volume
can only be removed if all the containers using it are deleted. For
example, the scheduler might be running a container using it.
currently, it defaults to the container name. apps might use this hostname
for communication with child containers. but this breaks if app gets updated
and gets a new hostname
Add a table and the install/configure routes. Initially, I thought
we can just keep the env vars in docker container but that doesn't
work since we create the container only later in apptask. And if the
container gets deleted we lose this information.
During restore, only the superfluous addons are teardown. Rest of
the addons are kept as-is. This is done to preserve the addon
configuration across restores (thus preserving db passwords).
We then rely on the restoreApp logic to call restore in each addon.
Each restore currently setup, clear and them imports the backup.
With the volume changes, we have moved volume create/delete to the
localstorage addon. Currently, the localstorage addon has no concept of restore
because the backup download extracts it directly into the volume.
Because of the above, during the restore code path, we don't teardown
the localstorage addon and thus files are left behind in appid/data/. This
prevents deleteAppDir() from removing the appid/ directory.
The fix is to add a new 'clear' command to addons. Before restore, we
clear the addons.
https://docs.docker.com/engine/api/v1.32/#tag/Network
"Note that it uses a different, smaller representation of a network
than inspecting a single network. For example, the list of containers
attached to the network is not propagated in API versions 1.28 and up."
Verified using:
curl --unix-socket /var/run/docker.sock http::/networks/cloudron
All Cloudron containers need to have the nameserver 172.18.0.1. This was
being done at the daemon level, however since there are also iptables
rules restricting access to the nameserver from containers that aren't
on the Cloudron Docker network, this broke DNS for non-Cloudron
containers.
Since the DNS is only required for Cloudron containers in the first
place, this patch specifies 172.18.0.1 as the nameserver when Cloudron
creates a container and reverts the change at the daemon level