Skip to main content

Module shared_root

Module shared_root 

Source
Expand description

A srv given a data folder of its own must not write into the real shared folder by accident.

The shared folder (shared/: agent definitions, accounts, the shared store) follows the AgentMux home, not the data folder. A srv started with only a data folder outside the home (AGENTMUX_DATA_DIR or --wavedata) therefore kept its own databases in that folder and still wrote the agents it created into the real ~/.agentmux/shared. Where shared data goes has to be said: by a home override (an isolated home) or by AGENTMUX_SHARED_DIR (the launcher always exports it).

Functionsยง

guard_shared_folder ๐Ÿ”’
Before any shared file is opened: refuse_unlisted_shared_root, then claim the shared folder for this srvโ€™s version (shared_guard).
refusal ๐Ÿ”’
Why srv must not start, or None. home is the AgentMux home as it was when srv started; home_override and shared_dir_set say whether AGENTMUX_HOME_OVERRIDE and AGENTMUX_SHARED_DIR were given.
refuse_unlisted_shared_root ๐Ÿ”’
refusal for this process; exits with the reason on stderr when it applies.