瀏覽代碼

activation fixes

tags/v0.1.6
Jonathan Cobb 5 年之前
父節點
當前提交
5605eca23f
共有 8 個檔案被更改,包括 88 行新增17 行删除
  1. +19
    -9
      bubble-server/src/main/java/bubble/server/BubbleConfiguration.java
  2. +1
    -0
      bubble-server/src/main/java/bubble/service/boot/ActivationService.java
  3. +1
    -1
      bubble-server/src/main/java/bubble/service/boot/StandardSelfNodeService.java
  4. +0
    -1
      bubble-server/src/main/resources/message_templates/en_US/server/post_auth/ResourceMessages.properties
  5. +63
    -2
      bubble-server/src/main/resources/message_templates/en_US/server/pre_auth/ResourceMessages.properties
  6. +2
    -2
      bubble-server/src/test/java/bubble/test/dev/BlankDevServerTest.java
  7. +1
    -1
      bubble-web
  8. +1
    -1
      utils/cobbzilla-wizard

+ 19
- 9
bubble-server/src/main/java/bubble/server/BubbleConfiguration.java 查看文件

@@ -40,6 +40,7 @@ import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
import java.beans.Transient;
import java.io.File;
import java.util.*;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;

import static bubble.ApiConstants.*;
@@ -221,15 +222,24 @@ public class BubbleConfiguration extends PgRestServerConfiguration

@Getter(lazy=true) private final List<String> cloudDriverClasses
= ClasspathScanner.scan(CloudServiceDriver.class, CloudServiceDriver.CLOUD_DRIVER_PACKAGE).stream()
.map(c -> c.getClass().getName())
.collect(Collectors.toList());

@Getter(lazy=true) private final Map<String, Object> publicSystemConfigs = MapBuilder.build(new Object[][] {
{ TAG_ALLOW_REGISTRATION, getThisNetwork().getBooleanTag(TAG_ALLOW_REGISTRATION, false) },
{ TAG_SAGE_LAUNCHER, isSageLauncher() },
{ TAG_PAYMENTS_ENABLED, paymentsEnabled() },
{ TAG_CLOUD_DRIVERS, getCloudDriverClasses() }
});
.map(Class::getName)
.collect(Collectors.toList());

private final AtomicReference<Map<String, Object>> publicSystemConfigs = new AtomicReference<>();
public Map<String, Object> getPublicSystemConfigs () {
synchronized (publicSystemConfigs) {
if (publicSystemConfigs.get() == null) {
publicSystemConfigs.set(MapBuilder.build(new Object[][]{
{TAG_ALLOW_REGISTRATION, getThisNetwork() == null ? null : getThisNetwork().getBooleanTag(TAG_ALLOW_REGISTRATION, false)},
{TAG_SAGE_LAUNCHER, isSageLauncher()},
{TAG_PAYMENTS_ENABLED, paymentsEnabled()},
{TAG_CLOUD_DRIVERS, getCloudDriverClasses()}
}));
}
return publicSystemConfigs.get();
}
}
public void refreshPublicSystemConfigs () { synchronized (publicSystemConfigs) { publicSystemConfigs.set(null); } }

@Getter @Setter private String[] disallowedCountries;



+ 1
- 0
bubble-server/src/main/java/bubble/service/boot/ActivationService.java 查看文件

@@ -144,6 +144,7 @@ public class ActivationService {
domainDAO.update(domain.setRoles(domainRoles));

selfNodeService.initThisNode(node);
configuration.refreshPublicSystemConfigs();

return node;
}


+ 1
- 1
bubble-server/src/main/java/bubble/service/boot/StandardSelfNodeService.java 查看文件

@@ -171,7 +171,7 @@ public class StandardSelfNodeService implements SelfNodeService {
}

private final AutoRefreshingReference<BubbleNetwork> thisNet = new AutoRefreshingReference<>() {
@Override public BubbleNetwork refresh() { return networkDAO.findByUuid(getThisNode().getNetwork()); }
@Override public BubbleNetwork refresh() { return getThisNode() == null ? null : networkDAO.findByUuid(getThisNode().getNetwork()); }
@Override public long getTimeout() { return DAYS.toMillis(1); }
};
@Override public BubbleNetwork getThisNetwork () { return thisNet.get(); }


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

@@ -26,7 +26,6 @@ label_menu_logout_icon=fa fa-sign-out-alt

# Profile fields
field_label_url=URL
field_label_description=Description
field_label_administrator=Administrator
field_label_suspended=Suspended
field_label_auto_update_policy=Auto-Update Policy


+ 63
- 2
bubble-server/src/main/resources/message_templates/en_US/server/pre_auth/ResourceMessages.properties 查看文件

@@ -34,6 +34,19 @@ err.country.invalid=Country is invalid
err.parent.notFound=Parent account does not exist
err.accountInit.timeout=Timeout initializing new account

# Activation form
form_title_activation=Activate Bubble
field_label_description=Description
field_label_network_name=Network Name
field_label_dns_service=DNS Service
field_label_storage_service=Storage Service
form_section_title_dns=DNS
form_section_title_storage=Storage
form_section_title_domain=Domain
form_section_title_credentials=Credentials
form_section_title_config=Configuration
button_label_activate=Activate

# Login/Registration form
form_title_login=Login
field_label_username=Username
@@ -71,33 +84,63 @@ err.driverConfig.initFailure=Cloud driver failed to initialize properlyu
err.ec.param.invalid=Parameter is invalid
err.ec.fieldType.none_set=Field type was not set

# Driver names
# Cloud drivers
driver_bubble.cloud.authenticator.TOTPAuthenticatorDriver=TOTP Service
description_bubble.cloud.authenticator.TOTPAuthenticatorDriver=A TOTP authentication service that is compatible with common authenticators, like Google Authenticator. This service runs locally and does not use any cloud APIs.

driver_bubble.cloud.compute.vultr.VultrDriver=Vultr Compute Cloud
description_bubble.cloud.compute.vultr.VultrDriver=Use <a href="https://www.vultr.com/">Vultr</a> to launch new Bubbles
driver_credential_API-Key.bubble.cloud.compute.vultr.VultrDriver=Vultr API Key
driver_config_regions_bubble.cloud.compute.vultr.VultrDriver=Regions JSON
driver_config_description_regions_bubble.cloud.compute.vultr.VultrDriver=Array of bubble.cloud.CloudRegion objects. Determines which regions are supported, and defines latitude/longitude to enable geo-aware decisions.
driver_config_sizes_bubble.cloud.compute.vultr.VultrDriver=Instance Sizes JSON
driver_config_sizes_description_regions_bubble.cloud.compute.vultr.VultrDriver=Array of bubble.cloud.compute.ComputeNodeSize objects. Determines which instance sizes are supported.
driver_config_config_bubble.cloud.compute.vultr.VultrDriver=Additional Config JSON
driver_config_config_description_regions_bubble.cloud.compute.vultr.VultrDriver=Array of configuration options in the form [ {name: "...", "value": ...} ] There must be one option named 'os' that contains the Operating System image to use when launching Bubbles.

driver_bubble.cloud.compute.digitalocean.DigitalOceanDriver=DigitalOcean Compute Cloud
description_bubble.cloud.compute.digitalocean.DigitalOceanDriver=Use <a href="https://www.digitalocean.com/">DigitalOcean</a> to launch new Bubbles
driver_credential_apiKey.bubble.cloud.compute.digitalocean.DigitalOceanDriver=DigitalOcean API Key
driver_config_regions_bubble.cloud.compute.digitalocean.DigitalOceanDriver=Regions JSON
driver_config__description_regions_bubble.cloud.compute.digitalocean.DigitalOceanDriver=Array of bubble.cloud.CloudRegion objects. Determines which regions are supported, and defines latitude/longitude to enable geo-aware decisions.
driver_config_sizes_bubble.cloud.compute.digitalocean.DigitalOceanDriver=Instance Sizes JSON
driver_config_sizes_description_bubble.cloud.compute.digitalocean.DigitalOceanDriver=Array of bubble.cloud.compute.ComputeNodeSize objects. Determines which instance sizes are supported.
driver_config_config_bubble.cloud.compute.digitalocean.DigitalOceanDriver=Additional Config JSON
driver_config_config_description_regions_bubble.cloud.compute.digitalocean.DigitalOceanDriver=Array of configuration options in the form [ {name: "...", "value": ...} ] There must be one option named 'os' that contains the Operating System image to use when launching Bubbles.

driver_bubble.cloud.dns.godaddy.GoDaddyDnsDriver=GoDaddy DNS
description_bubble.cloud.dns.godaddy.GoDaddyDnsDriver=Use <a href="https://www.godaddy.com/">GoDaddy</a> to manage DNS records for Bubbles
driver_credential_GODADDY_API_KEY_bubble.cloud.dns.godaddy.GoDaddyDnsDriver=GoDaddy API Key
driver_credential_GODADDY_API_SECRET_bubble.cloud.dns.godaddy.GoDaddyDnsDriver=GoDaddy Secret Key

driver_bubble.cloud.dns.route53.Route53DnsDriver=Amazon Route53 DNS
description_bubble.cloud.dns.route53.Route53DnsDriver=Use <a href="https://aws.amazon.com/route53/">Amazon Route53</a> to manage DNS records for Bubbles
driver_credential_AWS_ACCESS_KEY_ID_bubble.cloud.dns.route53.Route53DnsDriver=AWS Access Key
driver_credential_AWS_SECRET_KEY_bubble.cloud.dns.route53.Route53DnsDriver=AWS Secret Key

driver_bubble.cloud.email.SmtpEmailDriver=SMTP Email
description_bubble.cloud.email.SmtpEmailDriver=Connect to any standard SMTP service to deliver email.
description_bubble.cloud.email.SmtpEmailDriver=Connect to any standard SMTP service to deliver email
driver_credential_user_bubble.cloud.email.SmtpEmailDriver=SMTP User
driver_credential_password_bubble.cloud.email.SmtpEmailDriver=SMTP Password
driver_credential_host_bubble.cloud.email.SmtpEmailDriver=SMTP Hostname
driver_credential_port_bubble.cloud.email.SmtpEmailDriver=SMTP Port
driver_config_tlsEnabled_bubble.cloud.email.SmtpEmailDriver=Enable TLS

driver_bubble.cloud.geoCode.google.GoogleGeoCodeDriver=Google Geocoding API
description_bubble.cloud.geoCode.google.GoogleGeoCodeDriver=Use the <a href="https://developers.google.com/maps/documentation/javascript/geocoding">Google Geocoding API</a> to convert place names to latitude/longitude.
driver_credential_apiKey_bubble.cloud.geoCode.google.GoogleGeoCodeDriver=Google API Key

driver_bubble.cloud.geoLocation.maxmind.MaxMindDriver=MaxMind GeoIP Database
description_bubble.cloud.geoLocation.maxmind.MaxMindDriver=Use the <a href="https://maxmind.com/">MaxMind</a> GeoIP database to resolve IP addresses to city/region/country. This services runs locally using a database file and does not use any cloud APIs, except to download the database file.
driver_credential_apiKey_bubble.cloud.geoLocation.maxmind.MaxMindDriver=MaxMind API Key
driver_config_url_bubble.cloud.geoLocation.maxmind.MaxMindDriver=MaxMind Database File URL
driver_config_description_url_bubble.cloud.geoLocation.maxmind.MaxMindDriver=URL to download the database file from. You can use [[apiKey]] in the URL, and it will be replaced with your MaxMind API Key when the download is made.
driver_config_file_bubble.cloud.geoLocation.maxmind.MaxMindDriver=MaxMind Database File Regex
driver_config_description_file_bubble.cloud.geoLocation.maxmind.MaxMindDriver=A regular expression used to find the MaxMind database file within the downloaded ZIP file or tarball.

driver_bubble.cloud.geoTime.google.GoogleGeoTimeDriver=Google Time Zone API
description_bubble.cloud.geoTime.google.GoogleGeoTimeDriver=Use the <a href="https://developers.google.com/maps/documentation/timezone">Google Time Zone API</a> to resolve IP addresses to time zones.
driver_credential_apiKey_bubble.cloud.geoTime.google.GoogleGeoTimeDriver=Google API Key

driver_bubble.cloud.payment.free.FreePaymentDriver=Free
description_bubble.cloud.payment.free.FreePaymentDriver=Allows users to add Account Plans without actually paying for anything.
@@ -107,12 +150,30 @@ description_bubble.cloud.payment.code.CodePaymentDriver=Supports invitation code

driver_bubble.cloud.payment.stripe.StripePaymentDriver=Stripe Payments
description_bubble.cloud.payment.stripe.StripePaymentDriver=Allows payment for Account Plans using credit and debit cards via the <a href="https://stripe.com/">Stripe</a> payments service.
driver_credential_secretApiKey_bubble.cloud.payment.stripe.StripePaymentDriver=Stripe Secret API Key
driver_config_publicApiKey_bubble.cloud.payment.stripe.StripePaymentDriver=Stripe Public API Key
driver_config_description_publicApiKey_bubble.cloud.payment.stripe.StripePaymentDriver=Your Stripe Public API Key

driver_bubble.cloud.sms.twilio.TwilioSmsDriver=Twilio SMS
description_bubble.cloud.sms.twilio.TwilioSmsDriver=Deliver SMS messages via <a href="https://twilio.com/">Twilio</a>.
driver_credential_accountSID_bubble.cloud.sms.twilio.TwilioSmsDriver=Twilio Account SID
driver_credential_authToken_bubble.cloud.sms.twilio.TwilioSmsDriver=Twilio Auth Token
driver_credential_fromPhoneNumber_bubble.cloud.sms.twilio.TwilioSmsDriver=From Phone Number

driver_bubble.cloud.storage.s3.S3StorageDriver=Amazon S3 Storage
description_bubble.cloud.storage.s3.S3StorageDriver=Supports storage for <a href="https://aws.amazon.com/s3/">Amazon S3</a>. Data is encrypted locally, S3 never sees unencrypted data.
driver_credential_AWS_ACCESS_KEY_ID_bubble.cloud.storage.s3.S3StorageDriver=AWS Access Key
driver_credential_AWS_SECRET_KEY_bubble.cloud.storage.s3.S3StorageDriver=AWS Secret Key
driver_config_region_bubble.cloud.storage.s3.S3StorageDriver=AWS Region
driver_config_description_region_bubble.cloud.storage.s3.S3StorageDriver=The AWS Region to use. Must be a valid name in the AWS <a href="https://github.com/aws/aws-sdk-java/blob/master/aws-java-sdk-core/src/main/java/com/amazonaws/regions/Regions.java">Regions</a> enum class.
driver_config_bucket_bubble.cloud.storage.s3.S3StorageDriver=S3 Bucket Name
driver_config_description_bucket_bubble.cloud.storage.s3.S3StorageDriver=The name of the S3 bucket to use. The credentials provided in AWS Access Key and AWS Secret key must have permissions to read, write, and list objects in this bucket.
driver_config_prefix_bubble.cloud.storage.s3.S3StorageDriver=S3 Bucket Prefix
driver_config_description_prefix_bubble.cloud.storage.s3.S3StorageDriver=The bucket prefix (subdirectory) to use. All objects stored in S3 will be put under this prefix. This allows you to use the same S3 Bucket for multiple Bubbles, as long as they each use a distinct prefix.
driver_config_listFetchSize_bubble.cloud.storage.s3.S3StorageDriver=S3 List Fetch Size
driver_config_description_listFetchSize_bubble.cloud.storage.s3.S3StorageDriver=The "batch size" to use when making S3 list requests

driver_bubble.cloud.storage.local.LocalStorageDriver=Local Storage
description_bubble.cloud.storage.local.LocalStorageDriver=Supports local filesystem storage.
driver_config_baseDir_bubble.cloud.storage.local.LocalStorageDriver=Local Storage Base Directory
driver_config_description_baseDir_bubble.cloud.storage.local.LocalStorageDriver=Base directory to use for storage. Must be writeable by the user account running the Bubble API server. If not an absolute path, it is relative to the user account running the Bubble API server.

+ 2
- 2
bubble-server/src/test/java/bubble/test/dev/BlankDevServerTest.java 查看文件

@@ -22,8 +22,8 @@ public class BlankDevServerTest extends BubbleModelTestBase {
super.onStart(server);
}

@Test public void runDevServer () throws Exception {
log.info("runDevServer: Bubble API server started and model initialized. You may now begin testing.");
@Test public void runBlankServer () throws Exception {
log.info("runBlankServer: Bubble API server started and model initialized. You may now begin testing.");
sleep(DAYS.toMillis(30), "running dev server");
}



+ 1
- 1
bubble-web

@@ -1 +1 @@
Subproject commit fe10ccfcc9663a178928328b86038185521f45e8
Subproject commit 6c141907a646db2d5357bff3607391a23407de8c

+ 1
- 1
utils/cobbzilla-wizard

@@ -1 +1 @@
Subproject commit b86ae9027fbf97f206266b2c66ff84d6e8eaf505
Subproject commit 22bc9dc582dc9d1cf5269ff2fa36e178c97a47c3

Loading…
取消
儲存