Commit 487deae1 authored by segfault's avatar segfault

Make prosody work inside a container

parent 57a0ab36
......@@ -15,6 +15,16 @@ from onionkit.mountpoint import MountPoint
logger = getLogger(__name__)
class DataDir(MountPoint):
source = Path("data")
target = Path("/var/lib/prosody")
owner = "prosody"
group = "prosody"
is_dir = True
data_dir = DataDir()
class ConfigDir(MountPoint):
source = Path("config")
target = Path("/etc/prosody")
......@@ -22,14 +32,12 @@ class ConfigDir(MountPoint):
group = "prosody"
is_dir = True
config_dir = ConfigDir()
class ProsodyConfigFile(DataFile):
source = Path(config_dir.source, "prosody.cfg.lua")
owner = "root"
group = "prosody"
mode = 0o644
# Users that add additional VirtualHost entries must list them after
# the default one which will be used for the hidden service.
......@@ -73,7 +81,6 @@ VirtualHost "localhost"
f.truncate()
f.write(config)
config_file = ProsodyConfigFile()
......@@ -128,7 +135,7 @@ class ProsodyServer(OnionService):
data_files = [
config_dir,
config_file,
MountPoint(source=Path("data"), target=Path("/var/lib/prosody"), owner="prosody", group="prosody", is_dir=True)
data_dir
]
@property
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment