Skip to content

Commit b73d8b6

Browse files
authored
Merge pull request #196 from kirtangajjar/feature/remove-site-create-limit
✨️ Remove site create limit for WordPress sites
2 parents 7034b0d + 960f49e commit b73d8b6

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

src/Site_WP_Docker.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ public function generate_docker_compose_yml( array $filters = [], $volumes ) {
3535
[ 'name' => 'org.label-schema.vendor=EasyEngine' ],
3636
[ 'name' => 'io.easyengine.site=${VIRTUAL_HOST}' ],
3737
],
38+
'subnet_ip' => $filters['subnet_ip']
3839
],
3940
];
4041

src/WordPress.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -257,11 +257,11 @@ public function __construct() {
257257
*/
258258
public function create( $args, $assoc_args ) {
259259

260-
$this->check_site_count();
261260
\EE\Utils\delem_log( 'site create start' );
262261
$this->logger->debug( 'args:', $args );
263262
$this->logger->debug( 'assoc_args:', empty( $assoc_args ) ? array( 'NULL' ) : $assoc_args );
264-
$this->site_data['site_url'] = strtolower( \EE\Utils\remove_trailing_slash( $args[0] ) );
263+
$this->site_data['site_url'] = strtolower( \EE\Utils\remove_trailing_slash( $args[0] ) );
264+
$this->site_data['subnet_ip'] = \EE\Site\Utils\get_subnet_ip();
265265

266266
$mu = \EE\Utils\get_flag_value( $assoc_args, 'mu' );
267267
$this->site_data['app_sub_type'] = $mu ?? 'wp';
@@ -430,6 +430,7 @@ public function create( $args, $assoc_args ) {
430430
\EE::log( 'Configuring project.' );
431431

432432
$this->create_site( $assoc_args );
433+
433434
\EE\Utils\delem_log( 'site create end' );
434435
}
435436

@@ -821,6 +822,7 @@ public function dump_docker_compose_yml( $additional_filters = [] ) {
821822
$filter['site_prefix'] = \EE_DOCKER::get_docker_style_prefix( $this->site_data['site_url'] );
822823
$filter['php_version'] = ( string ) $this->site_data['php_version'];
823824
$filter['alias_domains'] = implode( ',', array_diff( explode( ',', $this->site_data['alias_domains'] ), [ $this->site_data['site_url'] ] ) );
825+
$filter['subnet_ip'] = $this->site_data['subnet_ip'];
824826
$site_docker = new Site_WP_Docker();
825827

826828
foreach ( $additional_filters as $key => $addon_filter ) {
@@ -1361,10 +1363,10 @@ private function setup_vip( $assoc_args ) {
13611363
* Function to save the site configuration entry into database.
13621364
*/
13631365
private function create_site_db_entry() {
1364-
$ssl = null;
13651366

13661367
$data = [
13671368
'site_url' => $this->site_data['site_url'],
1369+
'subnet_ip' => $this->site_data['subnet_ip'],
13681370
'site_type' => $this->site_data['site_type'],
13691371
'app_admin_url' => $this->site_data['app_admin_url'],
13701372
'app_admin_email' => $this->site_data['app_admin_email'],

templates/docker-compose.mustache

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ networks:
8383
{{#label}}
8484
- "{{name}}"
8585
{{/label}}
86+
ipam:
87+
config:
88+
- subnet: '{{subnet_ip}}'
8689
{{/networks_labels}}
8790
global-frontend-network:
8891
external:

0 commit comments

Comments
 (0)