@@ -1305,32 +1305,57 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal
1305
1305
$ serviceLabels = $ serviceLabels ->merge ($ defaultLabels );
1306
1306
if (! $ isDatabase && $ fqdns ->count () > 0 ) {
1307
1307
if ($ fqdns ) {
1308
- switch ($ resource ->destination ->server ->proxyType ()) {
1309
- case ProxyTypes::TRAEFIK_V2 ->value :
1310
- $ serviceLabels = $ serviceLabels ->merge (fqdnLabelsForTraefik (
1311
- uuid: $ resource ->uuid ,
1312
- domains: $ fqdns ,
1313
- is_force_https_enabled: true ,
1314
- serviceLabels: $ serviceLabels ,
1315
- is_gzip_enabled: $ savedService ->isGzipEnabled (),
1316
- is_stripprefix_enabled: $ savedService ->isStripprefixEnabled (),
1317
- service_name: $ serviceName ,
1318
- image: data_get ($ service , 'image ' )
1319
- ));
1320
- break ;
1321
- case ProxyTypes::CADDY ->value :
1322
- $ serviceLabels = $ serviceLabels ->merge (fqdnLabelsForCaddy (
1323
- network: $ resource ->destination ->network ,
1324
- uuid: $ resource ->uuid ,
1325
- domains: $ fqdns ,
1326
- is_force_https_enabled: true ,
1327
- serviceLabels: $ serviceLabels ,
1328
- is_gzip_enabled: $ savedService ->isGzipEnabled (),
1329
- is_stripprefix_enabled: $ savedService ->isStripprefixEnabled (),
1330
- service_name: $ serviceName ,
1331
- image: data_get ($ service , 'image ' )
1332
- ));
1333
- break ;
1308
+ $ shouldGenerateLabelsExactly = $ resource ->server ->settings ->generate_exact_labels ;
1309
+ if ($ shouldGenerateLabelsExactly ) {
1310
+ switch ($ resource ->server ->proxyType ()) {
1311
+ case ProxyTypes::TRAEFIK ->value :
1312
+ $ serviceLabels = $ serviceLabels ->merge (fqdnLabelsForTraefik (
1313
+ uuid: $ resource ->uuid ,
1314
+ domains: $ fqdns ,
1315
+ is_force_https_enabled: true ,
1316
+ serviceLabels: $ serviceLabels ,
1317
+ is_gzip_enabled: $ savedService ->isGzipEnabled (),
1318
+ is_stripprefix_enabled: $ savedService ->isStripprefixEnabled (),
1319
+ service_name: $ serviceName ,
1320
+ image: data_get ($ service , 'image ' )
1321
+ ));
1322
+ break ;
1323
+ case ProxyTypes::CADDY ->value :
1324
+ $ serviceLabels = $ serviceLabels ->merge (fqdnLabelsForCaddy (
1325
+ network: $ resource ->destination ->network ,
1326
+ uuid: $ resource ->uuid ,
1327
+ domains: $ fqdns ,
1328
+ is_force_https_enabled: true ,
1329
+ serviceLabels: $ serviceLabels ,
1330
+ is_gzip_enabled: $ savedService ->isGzipEnabled (),
1331
+ is_stripprefix_enabled: $ savedService ->isStripprefixEnabled (),
1332
+ service_name: $ serviceName ,
1333
+ image: data_get ($ service , 'image ' )
1334
+ ));
1335
+ break ;
1336
+ }
1337
+ } else {
1338
+ $ serviceLabels = $ serviceLabels ->merge (fqdnLabelsForTraefik (
1339
+ uuid: $ resource ->uuid ,
1340
+ domains: $ fqdns ,
1341
+ is_force_https_enabled: true ,
1342
+ serviceLabels: $ serviceLabels ,
1343
+ is_gzip_enabled: $ savedService ->isGzipEnabled (),
1344
+ is_stripprefix_enabled: $ savedService ->isStripprefixEnabled (),
1345
+ service_name: $ serviceName ,
1346
+ image: data_get ($ service , 'image ' )
1347
+ ));
1348
+ $ serviceLabels = $ serviceLabels ->merge (fqdnLabelsForCaddy (
1349
+ network: $ resource ->destination ->network ,
1350
+ uuid: $ resource ->uuid ,
1351
+ domains: $ fqdns ,
1352
+ is_force_https_enabled: true ,
1353
+ serviceLabels: $ serviceLabels ,
1354
+ is_gzip_enabled: $ savedService ->isGzipEnabled (),
1355
+ is_stripprefix_enabled: $ savedService ->isStripprefixEnabled (),
1356
+ service_name: $ serviceName ,
1357
+ image: data_get ($ service , 'image ' )
1358
+ ));
1334
1359
}
1335
1360
}
1336
1361
}
@@ -2037,35 +2062,63 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal
2037
2062
});
2038
2063
}
2039
2064
}
2040
- switch ($ server ->proxyType ()) {
2041
- case ProxyTypes::TRAEFIK_V2 ->value :
2042
- $ serviceLabels = $ serviceLabels ->merge (
2043
- fqdnLabelsForTraefik (
2044
- uuid: $ resource ->uuid ,
2045
- domains: $ fqdns ,
2046
- serviceLabels: $ serviceLabels ,
2047
- generate_unique_uuid: $ resource ->build_pack === 'dockercompose ' ,
2048
- image: data_get ($ service , 'image ' ),
2049
- is_force_https_enabled: $ resource ->isForceHttpsEnabled (),
2050
- is_gzip_enabled: $ resource ->isGzipEnabled (),
2051
- is_stripprefix_enabled: $ resource ->isStripprefixEnabled (),
2052
- )
2053
- );
2054
- break ;
2055
- case ProxyTypes::CADDY ->value :
2056
- $ serviceLabels = $ serviceLabels ->merge (
2057
- fqdnLabelsForCaddy (
2058
- network: $ resource ->destination ->network ,
2059
- uuid: $ resource ->uuid ,
2060
- domains: $ fqdns ,
2061
- serviceLabels: $ serviceLabels ,
2062
- image: data_get ($ service , 'image ' ),
2063
- is_force_https_enabled: $ resource ->isForceHttpsEnabled (),
2064
- is_gzip_enabled: $ resource ->isGzipEnabled (),
2065
- is_stripprefix_enabled: $ resource ->isStripprefixEnabled (),
2066
- )
2067
- );
2068
- break ;
2065
+ $ shouldGenerateLabelsExactly = $ server ->settings ->generate_exact_labels ;
2066
+ if ($ shouldGenerateLabelsExactly ) {
2067
+ switch ($ server ->proxyType ()) {
2068
+ case ProxyTypes::TRAEFIK ->value :
2069
+ $ serviceLabels = $ serviceLabels ->merge (
2070
+ fqdnLabelsForTraefik (
2071
+ uuid: $ resource ->uuid ,
2072
+ domains: $ fqdns ,
2073
+ serviceLabels: $ serviceLabels ,
2074
+ generate_unique_uuid: $ resource ->build_pack === 'dockercompose ' ,
2075
+ image: data_get ($ service , 'image ' ),
2076
+ is_force_https_enabled: $ resource ->isForceHttpsEnabled (),
2077
+ is_gzip_enabled: $ resource ->isGzipEnabled (),
2078
+ is_stripprefix_enabled: $ resource ->isStripprefixEnabled (),
2079
+ )
2080
+ );
2081
+ break ;
2082
+ case ProxyTypes::CADDY ->value :
2083
+ $ serviceLabels = $ serviceLabels ->merge (
2084
+ fqdnLabelsForCaddy (
2085
+ network: $ resource ->destination ->network ,
2086
+ uuid: $ resource ->uuid ,
2087
+ domains: $ fqdns ,
2088
+ serviceLabels: $ serviceLabels ,
2089
+ image: data_get ($ service , 'image ' ),
2090
+ is_force_https_enabled: $ resource ->isForceHttpsEnabled (),
2091
+ is_gzip_enabled: $ resource ->isGzipEnabled (),
2092
+ is_stripprefix_enabled: $ resource ->isStripprefixEnabled (),
2093
+ )
2094
+ );
2095
+ break ;
2096
+ }
2097
+ } else {
2098
+ $ serviceLabels = $ serviceLabels ->merge (
2099
+ fqdnLabelsForTraefik (
2100
+ uuid: $ resource ->uuid ,
2101
+ domains: $ fqdns ,
2102
+ serviceLabels: $ serviceLabels ,
2103
+ generate_unique_uuid: $ resource ->build_pack === 'dockercompose ' ,
2104
+ image: data_get ($ service , 'image ' ),
2105
+ is_force_https_enabled: $ resource ->isForceHttpsEnabled (),
2106
+ is_gzip_enabled: $ resource ->isGzipEnabled (),
2107
+ is_stripprefix_enabled: $ resource ->isStripprefixEnabled (),
2108
+ )
2109
+ );
2110
+ $ serviceLabels = $ serviceLabels ->merge (
2111
+ fqdnLabelsForCaddy (
2112
+ network: $ resource ->destination ->network ,
2113
+ uuid: $ resource ->uuid ,
2114
+ domains: $ fqdns ,
2115
+ serviceLabels: $ serviceLabels ,
2116
+ image: data_get ($ service , 'image ' ),
2117
+ is_force_https_enabled: $ resource ->isForceHttpsEnabled (),
2118
+ is_gzip_enabled: $ resource ->isGzipEnabled (),
2119
+ is_stripprefix_enabled: $ resource ->isStripprefixEnabled (),
2120
+ )
2121
+ );
2069
2122
}
2070
2123
}
2071
2124
}
0 commit comments