Feature 57 (config and provisioning): modules declare config and provisions, their files rendered from templates; synced with main (issues of feature 57, 874)

This commit is contained in:
2026-10-16 07:37:43 +00:00
parent 1a2c917abf
commit 9652b2d5ce
771 changed files with 52063 additions and 1774 deletions
+1
View File
@@ -0,0 +1 @@
{}
+56
View File
@@ -0,0 +1,56 @@
<icecast>
<!-- Written by the mesh (modules/icecast). Passwords arrive as secrets rendered into this file,
never as environment: the image's entrypoint seds ICECAST_* variables into the file only
when they are set, and none are. -->
<location>Earth</location>
<admin>icemaster@localhost</admin>
<limits>
<clients>100</clients>
<sources>2</sources>
<queue-size>524288</queue-size>
<client-timeout>30</client-timeout>
<header-timeout>15</header-timeout>
<source-timeout>10</source-timeout>
<burst-on-connect>1</burst-on-connect>
<burst-size>65535</burst-size>
</limits>
<authentication>
<source-password>${secret:source}</source-password>
<relay-password>${secret:relay}</relay-password>
<admin-user>admin</admin-user>
<admin-password>${secret:admin}</admin-password>
</authentication>
<!-- The name icecast writes into playlists (.m3u/.xspf: http://<hostname>:<port>/<mount>) and
would announce to YP (none configured). A machine's own name belongs to its assignment, and
an assignment merges only into JSON; this XML cannot take it, so the neutral default stays. -->
<hostname>localhost</hostname>
<listen-socket>
<port>8000</port>
</listen-socket>
<http-headers>
<header name="Access-Control-Allow-Origin" value="*" />
</http-headers>
<fileserve>1</fileserve>
<paths>
<basedir>/usr/share/icecast</basedir>
<logdir>/var/log/icecast</logdir>
<webroot>/usr/share/icecast/web</webroot>
<adminroot>/usr/share/icecast/admin</adminroot>
<alias source="/" destination="/status.xsl"/>
</paths>
<logging>
<accesslog>access.log</accesslog>
<errorlog>error.log</errorlog>
<loglevel>3</loglevel>
<logsize>10000</logsize>
</logging>
<security>
<chroot>0</chroot>
<!-- Starts as root, reads this 0600 root-owned file, then drops to the image's icecast user
(uid 100, group icecast 101) before serving. -->
<changeowner>
<user>icecast</user>
<group>icecast</group>
</changeowner>
</security>
</icecast>
+23 -3
View File
@@ -47,6 +47,20 @@
}
]
},
"config": {
"url": {
"type": "string",
"description": "The address the module's tools reach Icecast at, as a URL; unset, the code falls back to its environment, else this machine's Icecast on its port.",
"trusted": true,
"default": ""
},
"user": {
"type": "string",
"description": "The Icecast admin account the module's tools sign in as; unset, the code falls back to its environment, else admin.",
"trusted": true,
"default": ""
}
},
"resources": [
{
"id": "mesh-state",
@@ -71,7 +85,7 @@
"type": "file",
"path": "${dir:state}/icecast.xml",
"mode": "0600",
"content": "<icecast>\n <!-- Written by the mesh (modules/icecast). Passwords arrive as secrets rendered into this file,\n never as environment: the image's entrypoint seds ICECAST_* variables into the file only\n when they are set, and none are. -->\n <location>Earth</location>\n <admin>icemaster@localhost</admin>\n <limits>\n <clients>100</clients>\n <sources>2</sources>\n <queue-size>524288</queue-size>\n <client-timeout>30</client-timeout>\n <header-timeout>15</header-timeout>\n <source-timeout>10</source-timeout>\n <burst-on-connect>1</burst-on-connect>\n <burst-size>65535</burst-size>\n </limits>\n <authentication>\n <source-password>${secret:source}</source-password>\n <relay-password>${secret:relay}</relay-password>\n <admin-user>admin</admin-user>\n <admin-password>${secret:admin}</admin-password>\n </authentication>\n <!-- The name icecast writes into playlists (.m3u/.xspf: http://<hostname>:<port>/<mount>) and\n would announce to YP (none configured). A machine's own name belongs to its assignment, and\n an assignment merges only into JSON; this XML cannot take it, so the neutral default stays. -->\n <hostname>localhost</hostname>\n <listen-socket>\n <port>8000</port>\n </listen-socket>\n <http-headers>\n <header name=\"Access-Control-Allow-Origin\" value=\"*\" />\n </http-headers>\n <fileserve>1</fileserve>\n <paths>\n <basedir>/usr/share/icecast</basedir>\n <logdir>/var/log/icecast</logdir>\n <webroot>/usr/share/icecast/web</webroot>\n <adminroot>/usr/share/icecast/admin</adminroot>\n <alias source=\"/\" destination=\"/status.xsl\"/>\n </paths>\n <logging>\n <accesslog>access.log</accesslog>\n <errorlog>error.log</errorlog>\n <loglevel>3</loglevel>\n <logsize>10000</logsize>\n </logging>\n <security>\n <chroot>0</chroot>\n <!-- Starts as root, reads this 0600 root-owned file, then drops to the image's icecast user\n (uid 100, group icecast 101) before serving. -->\n <changeowner>\n <user>icecast</user>\n <group>icecast</group>\n </changeowner>\n </security>\n</icecast>\n"
"template": "files/icecast.xml"
},
{
"id": "net",
@@ -100,8 +114,9 @@
"type": "file",
"path": "${dir:mesh-state}/config.json",
"mode": "0600",
"content": "{}\n",
"merge": "json"
"template": "files/config.json",
"merge": "json",
"takes-config": ["url", "user"]
}
],
"build": {
@@ -123,6 +138,11 @@
"MESH_ICECAST_CONFIG_FILE": "${dir:mesh-state}/config.json",
"MESH_ICECAST_ADMIN_PASSWORD_FILE": "${dir:state}/admin.secret"
}
},
{
"name": "files",
"kind": "archive",
"from": "files"
}
]
}