浏览代码

add sendMetrics flag, set ansible ctx vars depending on value

tags/v0.8.0
Jonathan Cobb 5 年前
父节点
当前提交
12b7568836
共有 5 个文件被更改,包括 20 次插入3 次删除
  1. +4
    -0
      bubble-server/src/main/java/bubble/model/bill/AccountPlan.java
  2. +6
    -2
      bubble-server/src/main/java/bubble/model/cloud/BubbleNetwork.java
  3. +6
    -0
      bubble-server/src/main/java/bubble/service/cloud/AnsiblePrepService.java
  4. +3
    -0
      bubble-server/src/main/resources/message_templates/en_US/server/post_auth/ResourceMessages.properties
  5. +1
    -1
      bubble-web

+ 4
- 0
bubble-server/src/main/java/bubble/model/bill/AccountPlan.java 查看文件

@@ -146,6 +146,9 @@ public class AccountPlan extends IdentifiableBase implements HasAccount {
@Transient @Getter @Setter private transient String forkHost = null;
public boolean hasForkHost () { return !empty(forkHost); }

@Transient @Getter @Setter private transient Boolean sendMetrics = null;
public boolean sendMetrics () { return bool(sendMetrics); }

public BubbleNetwork bubbleNetwork(Account account,
BubbleDomain domain,
BubblePlan plan,
@@ -157,6 +160,7 @@ public class AccountPlan extends IdentifiableBase implements HasAccount {
.setTimezone(getTimezone())
.setAccount(account.getUuid())
.setSshKey(getSshKey())
.setSendMetrics(sendMetrics())
.setDomain(domain.getUuid())
.setDomainName(domain.getName())
.setFootprint(getFootprint())


+ 6
- 2
bubble-server/src/main/java/bubble/model/cloud/BubbleNetwork.java 查看文件

@@ -34,8 +34,7 @@ import static bubble.ApiConstants.ROOT_NETWORK_UUID;
import static bubble.model.cloud.BubbleDomain.DOMAIN_NAME_MAXLEN;
import static bubble.model.cloud.BubbleNetworkState.created;
import static bubble.server.BubbleConfiguration.getDEFAULT_LOCALE;
import static org.cobbzilla.util.daemon.ZillaRuntime.die;
import static org.cobbzilla.util.daemon.ZillaRuntime.empty;
import static org.cobbzilla.util.daemon.ZillaRuntime.*;
import static org.cobbzilla.util.http.HttpSchemes.SCHEME_HTTPS;
import static org.cobbzilla.util.reflect.ReflectionUtil.copy;
import static org.cobbzilla.util.string.ValidationRegexes.HOST_PART_PATTERN;
@@ -154,6 +153,11 @@ public class BubbleNetwork extends IdentifiableBase implements HasNetwork, HasBu
@Type(type=ENCRYPTED_STRING) @Column(columnDefinition="varchar("+(100+ENC_PAD)+") NOT NULL")
@Getter @Setter private String timezone = "America/New_York";

@ECSearchable @ECField(index=140)
@Column(nullable=false)
@ECIndex @Getter @Setter private Boolean sendMetrics = false;
public boolean sendMetrics() { return bool(sendMetrics); }

@Embedded @Getter @Setter private BubbleTags tags;

@Transient @Getter @Setter private transient String forkHost;


+ 6
- 0
bubble-server/src/main/java/bubble/service/cloud/AnsiblePrepService.java 查看文件

@@ -80,6 +80,12 @@ public class AnsiblePrepService {
ctx.put("sslPort", network.getSslPort());
ctx.put("publicBaseUri", network.getPublicUri());

if (network.sendMetrics()) {
ctx.put("errbit_url", configuration.getErrorApi().getUrl());
ctx.put("errbit_key", configuration.getErrorApi().getKey());
ctx.put("errbit_env", node.getFqdn());
}

ctx.put("network", network);
ctx.put("node", node);
ctx.put("roles", installRoles.stream().map(AnsibleRole::getRoleName).collect(Collectors.toList()));


+ 3
- 0
bubble-server/src/main/resources/message_templates/en_US/server/post_auth/ResourceMessages.properties 查看文件

@@ -202,12 +202,15 @@ field_label_network_fork_host=Fork Host
field_description_network_fork_host=The current Sage Launcher will be forked onto this host.
field_label_network_domain=Domain
field_label_plan=Plan
message_plan_max_accounts=You can create up to {{max}} user accounts on this Bubble
message_plan_no_max_accounts=This plan supports an unlimited number of user accounts
field_label_show_advanced_plan_options=Show All Options
field_label_region=Location
field_label_footprint=Footprint
field_label_network_ssh_key=SSH Key
field_description_network_ssh_key=You can SSH into the Bubble with this key
message_network_ssh_key_do_not_install=Do not install any SSH key
field_label_send_metrics=Send error reports and usage statistics
field_label_paymentMethod=Payment
err_noPaymentMethods=No payment methods are configured. Contact the administrator of this system.
msg_km_distance_away=km away


+ 1
- 1
bubble-web

@@ -1 +1 @@
Subproject commit 77a70b6af46b485843bce74a259d731090a6cf46
Subproject commit a268aa39ec1f0373d15af7b52477c81e561137bd

正在加载...
取消
保存