@@ -124,7 +124,22 @@ protected function replacePlaceholders(Server $server, object $configs)
124124 }
125125
126126 foreach ($ value as $ find => $ replace ) {
127- $ append ['replace ' ][] = ['match ' => $ find , 'value ' => $ replace ];
127+ if (is_object ($ replace )) {
128+ foreach ($ replace as $ match => $ replaceWith ) {
129+ $ append ['replace ' ][] = [
130+ 'match ' => $ find ,
131+ 'if_value ' => $ match ,
132+ 'replace_with ' => $ replaceWith ,
133+ ];
134+ }
135+
136+ continue ;
137+ }
138+
139+ $ append ['replace ' ][] = [
140+ 'match ' => $ find ,
141+ 'replace_with ' => $ replace ,
142+ ];
128143 }
129144 }
130145
@@ -155,17 +170,13 @@ protected function matchAndReplaceKeys(string $value, array $structure): ?string
155170 return self ::NOT_MATCHED ;
156171 }
157172
158- // We don't want to do anything with config keys since the Daemon will need to handle
159- // that. For example, the Spigot egg uses "config.docker.interface" to identify the Docker
160- // interface to proxy through, but the Panel would be unaware of that.
161- if (Str::startsWith ($ key , 'config. ' )) {
162- return "{{ {$ key }}} " ;
163- }
164-
165173 // The legacy Daemon would set SERVER_MEMORY, SERVER_IP, and SERVER_PORT with their
166174 // respective values on the Daemon side. Ensure that anything referencing those properly
167175 // replaces them with the matching config value.
168176 switch ($ key ) {
177+ case 'config.docker.interface ' :
178+ $ key = 'config.docker.network.interface ' ;
179+ break ;
169180 case 'server.build.env.SERVER_MEMORY ' :
170181 case 'env.SERVER_MEMORY ' :
171182 $ key = 'server.build.memory ' ;
@@ -180,6 +191,13 @@ protected function matchAndReplaceKeys(string $value, array $structure): ?string
180191 break ;
181192 }
182193
194+ // We don't want to do anything with config keys since the Daemon will need to handle
195+ // that. For example, the Spigot egg uses "config.docker.interface" to identify the Docker
196+ // interface to proxy through, but the Panel would be unaware of that.
197+ if (Str::startsWith ($ key , 'config. ' )) {
198+ return "{{ {$ key }}} " ;
199+ }
200+
183201 // Replace anything starting with "server." with the value out of the server configuration
184202 // array that used to be created for the old daemon.
185203 if (Str::startsWith ($ key , 'server. ' )) {
0 commit comments