From: Peter Amstutz Date: Tue, 2 Jul 2019 17:42:17 +0000 (-0400) Subject: 14812: Fix lib/config tests X-Git-Tag: 2.0.0~272^2~15 X-Git-Url: https://git.arvados.org/arvados.git/commitdiff_plain/cf98484b422c29dfa251da5a176e18096f09aa7a 14812: Fix lib/config tests Arvados-DCO-1.1-Signed-off-by: Peter Amstutz --- diff --git a/apps/workbench/config/arvados_config.rb b/apps/workbench/config/arvados_config.rb index d571cda09a..baceff5016 100644 --- a/apps/workbench/config/arvados_config.rb +++ b/apps/workbench/config/arvados_config.rb @@ -19,14 +19,6 @@ require 'config_loader' require 'config_validators' require 'open3' -begin - # If secret_token.rb exists here, we need to load it first. - require_relative 'secret_token.rb' -rescue LoadError - # Normally secret_token.rb is missing and the secret token is - # configured by application.yml (i.e., here!) instead. -end - # Load the defaults, used by config:migrate and fallback loading # legacy application.yml Open3.popen2("arvados-server", "config-defaults") do |stdin, stdout, status_thread| @@ -93,7 +85,6 @@ arvcfg.declare_config "Services.Workbench2.ExternalURL", URI, :workbench2_url arvcfg.declare_config "Users.AnonymousUserToken", String, :anonymous_user_token -arvcfg.declare_config "Workbench.SecretToken", String, :secret_token arvcfg.declare_config "Workbench.SecretKeyBase", String, :secret_key_base arvcfg.declare_config "Workbench.ApplicationMimetypesWithViewIcon", Hash, :application_mimetypes_with_view_icon, ->(cfg, k, v) { diff --git a/build/run-tests.sh b/build/run-tests.sh index 143320c489..6572765b9a 100755 --- a/build/run-tests.sh +++ b/build/run-tests.sh @@ -988,7 +988,7 @@ pythonstuff=( ) declare -a gostuff -gostuff=($(git grep -lw func | grep \\.go | sed -e 's/\/[^\/]*$//' | sort -u)) +gostuff=($(cd "$WORKSPACE" && git grep -lw func | grep \\.go | sed -e 's/\/[^\/]*$//' | sort -u)) install_apps/workbench() { cd "$WORKSPACE/apps/workbench" \ diff --git a/lib/config/config.default.yml b/lib/config/config.default.yml index 8137998277..f17c13d2a9 100644 --- a/lib/config/config.default.yml +++ b/lib/config/config.default.yml @@ -666,24 +666,23 @@ Clusters: ShowUserAgreementInline: false SecretKeyBase: "" RepositoryCache: /var/www/arvados-workbench/current/tmp/git - UserProfileFormFields: - SAMPLE: - exampleTextValue: # key that will be set in properties - Type: text # - FormFieldTitle: "" - FormFieldDescription: "" - Required: true - Position: 1 - exampleOptionsValue: - Type: select - FormFieldTitle: "" - FormFieldDescription: "" - Required: true - Position: 1 - Options: - red: {} - blue: {} - yellow: {} + UserProfileFormFields: {} + # exampleTextValue: # key that will be set in properties + # Type: text # + # FormFieldTitle: "" + # FormFieldDescription: "" + # Required: true + # Position: 1 + # exampleOptionsValue: + # Type: select + # FormFieldTitle: "" + # FormFieldDescription: "" + # Required: true + # Position: 1 + # Options: + # red: {} + # blue: {} + # yellow: {} UserProfileFormMessage: 'Welcome to Arvados. All required fields must be completed before you can proceed.' # Mimetypes of applications for which the view icon diff --git a/lib/config/export.go b/lib/config/export.go index faf542e6f7..0eb5736093 100644 --- a/lib/config/export.go +++ b/lib/config/export.go @@ -55,77 +55,116 @@ func ExportJSON(w io.Writer, cluster *arvados.Cluster) error { // exists. var whitelist = map[string]bool{ // | sort -t'"' -k2,2 - "API": true, - "API.AsyncPermissionsUpdateInterval": false, - "API.DisabledAPIs": false, - "API.MaxIndexDatabaseRead": false, - "API.MaxItemsPerResponse": true, - "API.MaxRequestAmplification": false, - "API.MaxRequestSize": true, - "API.RailsSessionSecretToken": false, - "API.RequestTimeout": true, - "AuditLogs": false, - "AuditLogs.MaxAge": false, - "AuditLogs.MaxDeleteBatch": false, - "AuditLogs.UnloggedAttributes": false, - "Collections": true, - "Collections.BlobSigning": true, - "Collections.BlobSigningKey": false, - "Collections.BlobSigningTTL": true, - "Collections.CollectionVersioning": false, - "Collections.DefaultReplication": true, - "Collections.DefaultTrashLifetime": true, - "Collections.ManagedProperties": true, - "Collections.ManagedProperties.*": true, - "Collections.ManagedProperties.*.*": true, - "Collections.PreserveVersionIfIdle": true, - "Collections.TrashSweepInterval": false, - "Containers": true, - "Containers.CloudVMs": false, - "Containers.DefaultKeepCacheRAM": true, - "Containers.DispatchPrivateKey": false, - "Containers.JobsAPI": true, - "Containers.JobsAPI.CrunchJobUser": false, - "Containers.JobsAPI.CrunchJobWrapper": false, - "Containers.JobsAPI.CrunchRefreshTrigger": false, - "Containers.JobsAPI.DefaultDockerImage": false, - "Containers.JobsAPI.Enable": true, - "Containers.JobsAPI.GitInternalDir": false, - "Containers.JobsAPI.ReuseJobIfOutputsDiffer": false, - "Containers.Logging": false, - "Containers.LogReuseDecisions": false, - "Containers.MaxComputeVMs": false, - "Containers.MaxDispatchAttempts": false, - "Containers.MaxRetryAttempts": true, - "Containers.SLURM": false, - "Containers.StaleLockTimeout": false, - "Containers.SupportedDockerImageFormats": true, - "Containers.UsePreemptibleInstances": true, - "EnableBetaController14287": false, - "Git": false, - "InstanceTypes": true, - "InstanceTypes.*": true, - "InstanceTypes.*.*": true, - "Login": false, - "Mail": false, - "ManagementToken": false, - "PostgreSQL": false, - "RemoteClusters": true, - "RemoteClusters.*": true, - "RemoteClusters.*.ActivateUsers": true, - "RemoteClusters.*.Host": true, - "RemoteClusters.*.Insecure": true, - "RemoteClusters.*.Proxy": true, - "RemoteClusters.*.Scheme": true, - "Services": true, - "Services.*": true, - "Services.*.ExternalURL": true, - "Services.*.InternalURLs": false, - "SystemLogs": false, - "SystemRootToken": false, - "TLS": false, - "Users": false, - "Workbench": false, + "API": true, + "API.AsyncPermissionsUpdateInterval": false, + "API.DisabledAPIs": false, + "API.MaxIndexDatabaseRead": false, + "API.MaxItemsPerResponse": true, + "API.MaxRequestAmplification": false, + "API.MaxRequestSize": true, + "API.RailsSessionSecretToken": false, + "API.RequestTimeout": true, + "AuditLogs": false, + "AuditLogs.MaxAge": false, + "AuditLogs.MaxDeleteBatch": false, + "AuditLogs.UnloggedAttributes": false, + "Collections": true, + "Collections.BlobSigning": true, + "Collections.BlobSigningKey": false, + "Collections.BlobSigningTTL": true, + "Collections.CollectionVersioning": false, + "Collections.DefaultReplication": true, + "Collections.DefaultTrashLifetime": true, + "Collections.ManagedProperties": true, + "Collections.ManagedProperties.*": true, + "Collections.ManagedProperties.*.*": true, + "Collections.PreserveVersionIfIdle": true, + "Collections.TrashSweepInterval": false, + "Containers": true, + "Containers.CloudVMs": false, + "Containers.DefaultKeepCacheRAM": true, + "Containers.DispatchPrivateKey": false, + "Containers.JobsAPI": true, + "Containers.JobsAPI.CrunchJobUser": false, + "Containers.JobsAPI.CrunchJobWrapper": false, + "Containers.JobsAPI.CrunchRefreshTrigger": false, + "Containers.JobsAPI.DefaultDockerImage": false, + "Containers.JobsAPI.Enable": true, + "Containers.JobsAPI.GitInternalDir": false, + "Containers.JobsAPI.ReuseJobIfOutputsDiffer": false, + "Containers.Logging": false, + "Containers.LogReuseDecisions": false, + "Containers.MaxComputeVMs": false, + "Containers.MaxDispatchAttempts": false, + "Containers.MaxRetryAttempts": true, + "Containers.SLURM": false, + "Containers.StaleLockTimeout": false, + "Containers.SupportedDockerImageFormats": true, + "Containers.UsePreemptibleInstances": true, + "EnableBetaController14287": false, + "Git": false, + "InstanceTypes": true, + "InstanceTypes.*": true, + "InstanceTypes.*.*": true, + "Login": false, + "Mail": false, + "ManagementToken": false, + "PostgreSQL": false, + "RemoteClusters": true, + "RemoteClusters.*": true, + "RemoteClusters.*.ActivateUsers": true, + "RemoteClusters.*.Host": true, + "RemoteClusters.*.Insecure": true, + "RemoteClusters.*.Proxy": true, + "RemoteClusters.*.Scheme": true, + "Services": true, + "Services.*": true, + "Services.*.ExternalURL": true, + "Services.*.InternalURLs": false, + "SystemLogs": false, + "SystemRootToken": false, + "TLS": false, + "Users": true, + "Users.AnonymousUserToken": true, + "Users.AdminNotifierEmailFrom": false, + "Users.AutoAdminFirstUser": false, + "Users.AutoAdminUserWithEmail": false, + "Users.AutoSetupNewUsers": false, + "Users.AutoSetupNewUsersWithRepository": false, + "Users.AutoSetupNewUsersWithVmUUID": false, + "Users.AutoSetupUsernameBlacklist": false, + "Users.EmailSubjectPrefix": false, + "Users.NewInactiveUserNotificationRecipients": false, + "Users.NewUserNotificationRecipients": false, + "Users.NewUsersAreActive": false, + "Users.UserNotifierEmailFrom": false, + "Users.UserProfileNotificationAddress": false, + "Workbench": true, + "Workbench.ActivationContactLink": false, + "Workbench.APIClientConnectTimeout": true, + "Workbench.APIClientReceiveTimeout": true, + "Workbench.APIResponseCompression": false, + "Workbench.ApplicationMimetypesWithViewIcon": false, + "Workbench.ArvadosDocsite": true, + "Workbench.ArvadosPublicDataDocURL": true, + "Workbench.EnableGettingStartedPopup": true, + "Workbench.EnablePublicProjectsPage": true, + "Workbench.FileViewersConfigURL": true, + "Workbench.LogViewerMaxBytes": true, + "Workbench.MultiSiteSearch": true, + "Workbench.Repositories": false, + "Workbench.RepositoryCache": false, + "Workbench.RunningJobLogRecordsToFetch": true, + "Workbench.SecretKeyBase": false, + "Workbench.ShowRecentCollectionsOnDashboard": true, + "Workbench.ShowUserAgreementInline": false, + "Workbench.ShowUserNotifications": false, + "Workbench.SiteName": true, + "Workbench.Theme": true, + "Workbench.TrustAllContent": false, + "Workbench.UserProfileFormFields": true, + "Workbench.UserProfileFormMessage": true, + "Workbench.VocabularyURL": true, } func redactUnsafe(m map[string]interface{}, mPrefix, lookupPrefix string) error { diff --git a/lib/config/generated_config.go b/lib/config/generated_config.go index ba576ee5b9..1bb046ff95 100644 --- a/lib/config/generated_config.go +++ b/lib/config/generated_config.go @@ -672,24 +672,23 @@ Clusters: ShowUserAgreementInline: false SecretKeyBase: "" RepositoryCache: /var/www/arvados-workbench/current/tmp/git - UserProfileFormFields: - SAMPLE: - exampleTextValue: # key that will be set in properties - Type: text # - FormFieldTitle: "" - FormFieldDescription: "" - Required: true - Position: 1 - exampleOptionsValue: - Type: select - FormFieldTitle: "" - FormFieldDescription: "" - Required: true - Position: 1 - Options: - red: {} - blue: {} - yellow: {} + UserProfileFormFields: {} + # exampleTextValue: # key that will be set in properties + # Type: text # + # FormFieldTitle: "" + # FormFieldDescription: "" + # Required: true + # Position: 1 + # exampleOptionsValue: + # Type: select + # FormFieldTitle: "" + # FormFieldDescription: "" + # Required: true + # Position: 1 + # Options: + # red: {} + # blue: {} + # yellow: {} UserProfileFormMessage: 'Welcome to Arvados. All required fields must be completed before you can proceed.' # Mimetypes of applications for which the view icon diff --git a/sdk/go/arvados/config.go b/sdk/go/arvados/config.go index 2165e87f52..943e0a07ad 100644 --- a/sdk/go/arvados/config.go +++ b/sdk/go/arvados/config.go @@ -113,6 +113,7 @@ type Cluster struct { Insecure bool } Users struct { + AnonymousUserToken string AdminNotifierEmailFrom string AutoAdminFirstUser bool AutoAdminUserWithEmail string @@ -144,12 +145,12 @@ type Cluster struct { RepositoryCache string RunningJobLogRecordsToFetch int SecretKeyBase string - SecretToken string ShowRecentCollectionsOnDashboard bool ShowUserAgreementInline bool ShowUserNotifications bool SiteName string Theme string + TrustAllContent bool UserProfileFormFields map[string]struct { Type string FormFieldTitle string