Quellcode durchsuchen

- Adds to webpack CORIOLIS_URL environment variable to be used for API url
- Adds openId federation url
- Fixes quotas on config

George Vrancianu vor 8 Jahren
Ursprung
Commit
bed472cf21
2 geänderte Dateien mit 39 neuen und 33 gelöschten Zeilen
  1. 32 31
      src/config.sample.js
  2. 7 2
      tools/webpack.config.js

+ 32 - 31
src/config.sample.js

@@ -20,7 +20,7 @@
 
 export const port = process.env.PORT || 3000;
 export const host = process.env.WEBSITE_HOSTNAME || `localhost:${port}`;
-export const coriolisUrl = "/"
+export const coriolisUrl = CORIOLIS_URL || "/"
 export const defaultDomain = "default";
 
 // Number of instances in wizard Migrate VMs step
@@ -45,18 +45,19 @@ export const servicesUrl = {
   endpoints: coriolisUrl + "coriolis/endpoints",
   coriolis: coriolisUrl + "coriolis",
   migrations: coriolisUrl + "coriolis/migrations",
-  barbican: coriolisUrl + "barbican"
+  barbican: coriolisUrl + "barbican",
+  openId: coriolisUrl + "identity/OS-FEDERATION/identity_providers/google/protocols/openid/auth"
 }
 
 export const providerType = {
-  "import_migration": 1,
-  "export_migration": 2,
-  "import_replica": 4,
-  "export_replica": 8,
-  "endpoint": 16
+  import_migration: 1,
+  export_migration: 2,
+  import_replica: 4,
+  export_replica: 8,
+  endpoint: 16
 }
 
-export const useSecret = false; // flag to use secret_ref for endpoints
+export const useSecret = true; // flag to use secret_ref for endpoints
 
 export const tasksPollTimeout = 5000 // milliseconds
 
@@ -127,27 +128,27 @@ export const auth = {
 };
 
 export const defaultLabels = {
-  "username": "Username",
-  "password": "Password",
-  "host": "Host",
-  "port": "Port",
-  "allow_untrusted": "Allow untrusted",
-  "identity_api_version": "Identity Version",
-  "auth_url": "Auth URL",
-  "user_domain_name": "User Domain Name",
-  "project_name": "Project Name",
-  "project_domain_name": "Project Domain Name",
-  "flavor_name": "Flavor Name",
-  "hypervisor_type": "Hypervisor Type",
-  "container_format": "Container Format",
-  "disk_format": "Disk Format",
-  "glance_upload": "Glance Upload",
-  "keypair_name": "Keypair name",
-  "fip_pool_name": "Floating IP Pool",
-  "migr_fip_pool_name": "Migration Floating IP Pool",
-  "migr_flavor_name": "Migration Flavor Name",
-  "migr_image_name": "Migration Image Name",
-  "migr_image_name_map": "Migration Image Name Map",
-  "delete_disks_on_vm_termination": "Delete disks on VM termination",
-  "set_dhcp": "Set DHCP",
+  username: "Username",
+  password: "Password",
+  host: "Host",
+  port: "Port",
+  allow_untrusted: "Allow untrusted",
+  identity_api_version: "Identity Version",
+  auth_url: "Auth URL",
+  user_domain_name: "User Domain Name",
+  project_name: "Project Name",
+  project_domain_name: "Project Domain Name",
+  flavor_name: "Flavor Name",
+  hypervisor_type: "Hypervisor Type",
+  container_format: "Container Format",
+  disk_format: "Disk Format",
+  glance_upload: "Glance Upload",
+  keypair_name: "Keypair name",
+  fip_pool_name: "Floating IP Pool",
+  migr_fip_pool_name: "Migration Floating IP Pool",
+  migr_flavor_name: "Migration Flavor Name",
+  migr_image_name: "Migration Image Name",
+  migr_image_name_map: "Migration Image Name Map",
+  delete_disks_on_vm_termination: "Delete disks on VM termination",
+  set_dhcp: "Set DHCP",
 }

+ 7 - 2
tools/webpack.config.js

@@ -125,7 +125,11 @@ const clientConfig = extend(true, {}, config, {
   devtool: DEBUG ? 'cheap-module-eval-source-map' : false,
   plugins: [
     ...config.plugins,
-    new webpack.DefinePlugin({ ...GLOBALS, 'process.env.BROWSER': true }),
+    new webpack.DefinePlugin({
+      ...GLOBALS,
+      'process.env.BROWSER': true,
+      CORIOLIS_URL: JSON.stringify(process.env.CORIOLIS_URL)
+    }),
     new AssetsPlugin({
       path: path.join(__dirname, '../build'),
       filename: 'assets.js',
@@ -180,7 +184,8 @@ const serverConfig = extend(true, {}, config, {
   devtool: 'source-map',
   plugins: [
     ...config.plugins,
-    new webpack.DefinePlugin({ ...GLOBALS, 'process.env.BROWSER': false }),
+    new webpack.DefinePlugin({ ...GLOBALS, 'process.env.BROWSER': false,
+      CORIOLIS_URL: JSON.stringify(process.env.CORIOLIS_URL) }),
     new webpack.BannerPlugin('require("source-map-support").install();',
       { raw: true, entryOnly: false }),
   ],