1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-01-18 07:52:23 +01:00

define default_protocol & default_host from the UI + fix email_from + various minor fixes

This commit is contained in:
Sylvain 2020-06-01 17:32:32 +02:00
parent 092bd8f482
commit 478a6c409d
28 changed files with 144 additions and 58 deletions

View File

@ -28,10 +28,10 @@ angular.module('application', ['ngCookies', 'ngResource', 'ngSanitize', 'ui.rout
// first we check the user acceptance
const cookiesConsent = document.cookie.replace(/(?:(?:^|.*;\s*)fab-manager-cookies-consent\s*=\s*([^;]*).*$)|^.*$/, '$1');
if (cookiesConsent === 'accept') {
AnalyticsProvider.setAccount(Fablab.gaId);
AnalyticsProvider.setAccount(Fablab.trackingId);
// track all routes (or not)
AnalyticsProvider.trackPages(true);
AnalyticsProvider.setDomainName(Fablab.defaultHost);
AnalyticsProvider.setDomainName(Fablab.baseHostUrl);
AnalyticsProvider.useAnalytics(true);
AnalyticsProvider.setPageEvent('$stateChangeSuccess');
} else {

View File

@ -569,7 +569,7 @@ Application.Controllers.controller('InvoicesController', ['$scope', '$state', 'I
{ settings: Object.values($scope.settings) },
function () { growl.success(_t('app.admin.invoices.codes_customization_success')); },
function (error) {
growl.error('unexpected_error_occurred');
growl.error('app.admin.invoices.unexpected_error_occurred');
console.error(error);
}
);

View File

@ -314,6 +314,29 @@ Application.Controllers.controller('SettingsController', ['$scope', '$rootScope'
$scope.codeMirrorEditor = editor;
}
/**
* Assign the current URL to the settings ( base_url_protocol & base_url_host )
* and save them to teh database.
*/
$scope.detectFillUrl = function () {
$scope.allSettings.base_url_protocol = window.location.protocol.match(/^([a-z]+):?$/)[1]
$scope.allSettings.base_url_host = window.location.host;
Setting.bulkUpdate(
{
settings: [
{ name: 'base_url_protocol', value: $scope.allSettings.base_url_protocol } ,
{ name: 'base_url_host', value: $scope.allSettings.base_url_host }
]
},
function () { growl.success(_t('app.admin.settings.customization_of_SETTING_successfully_saved', { SETTING: _t(`app.admin.settings.base_url`) })); },
function (error) {
growl.error('app.admin.settings.an_error_occurred_saving_the_setting');
console.error(error);
}
);
}
/**
* Setup the feature-tour for the admin/settings page.
* This is intended as a contextual help (when pressing F1)

View File

@ -32,7 +32,7 @@ Application.Controllers.controller('CookiesController', ['$scope', '$cookies', '
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', Fablab.gaId, 'auto');
ga('create', Fablab.trackingId, 'auto');
ga('send', 'pageview');
/* eslint-enable */
};
@ -50,8 +50,8 @@ Application.Controllers.controller('CookiesController', ['$scope', '$cookies', '
$scope.learnMoreUrl = '#!/privacy-policy';
}
});
// if the GA_ID environment variable was not set, only functional cookies will be set, so user consent is not required
if (!Fablab.gaId) $scope.cookiesState = 'ignore';
// if the tracking ID was not set in the settings, only functional cookies will be set, so user consent is not required
if (!Fablab.trackingId) $scope.cookiesState = 'ignore';
};
const readCookie = function () {

View File

@ -9,16 +9,27 @@ Application.Directives.directive('textSetting', ['Setting', 'growl', '_t',
classes: '@',
faIcon: '@',
placeholder: '@',
required: '<'
required: '<',
type: '@'
},
templateUrl: '<%= asset_path "admin/settings/text.html" %>',
link ($scope, element, attributes) {
// if type is not specified, use text as default
if (typeof $scope.type === 'undefined') {
$scope.type = 'text';
}
// The setting
$scope.setting = {
name: $scope.name,
value: $scope.settings[$scope.name]
};
$scope.$watch(`settings.${$scope.name}`, function (newValue, oldValue, scope) {
if (newValue !== oldValue) {
$scope.setting.value = newValue;
}
});
/**
* Callback to save the setting value to the database
* @param setting {{value:*, name:string}} note that the value will be stringified

View File

@ -1031,15 +1031,15 @@ angular.module('application.router', ['ui.router'])
resolve: {
settingsPromise: ['Setting', function (Setting) {
return Setting.query({
names: `['twitter_name', 'about_title', 'about_body', 'tracking_id', 'facebook_app_id', 'email_from', \
names: `['twitter_name', 'about_title', 'about_body', 'tracking_id', 'facebook_app_id', 'base_url_host', \
'privacy_body', 'privacy_dpo', 'about_contacts', 'book_overlapping_slots', 'invoicing_module', \
'home_blogpost', 'machine_explications_alert', 'training_explications_alert', 'slot_duration', \
'training_information_message', 'subscription_explications_alert', 'event_explications_alert', \
'space_explications_alert', 'booking_window_start', 'booking_window_end', 'events_in_calendar', \
'booking_move_enable', 'booking_move_delay', 'booking_cancel_enable', 'feature_tour_display', \
'booking_cancel_delay', 'main_color', 'secondary_color', 'spaces_module', 'twitter_analytics', \
'fablab_name', 'name_genre', 'reminder_enable', 'plans_module', \
'reminder_delay', 'visibility_yearly', 'visibility_others', \
'fablab_name', 'name_genre', 'reminder_enable', 'plans_module', 'base_url_protocol', \
'reminder_delay', 'visibility_yearly', 'visibility_others', 'email_from', \
'display_name_enable', 'machines_sort_by', 'fab_analytics', \
'link_name', 'home_content', 'home_css', 'phone_required']` }).$promise;
}],

View File

@ -374,10 +374,40 @@
settings="allSettings"
label="app.admin.settings.general.email_from"
fa-icon="fa-paper-plane"
placeholder="noreply@example.com">
placeholder="noreply@example.com"
type="email"
required="true">
</text-setting>
</div>
</div>
<div class="row">
<h3 class="m-l" translate>{{ 'app.admin.settings.general.site_url' }}</h3>
<p class="alert alert-warning m-h-md" ng-bind-html="'app.admin.settings.general.site_url_info_html' | translate:{ NAME:('app.admin.settings.general.auto_fill' | translate) }"></p>
<div class="col-md-4">
<text-setting name="base_url_protocol"
settings="allSettings"
label="app.admin.settings.general.protocol"
fa-icon="fa-globe"
placeholder="https"
required="true">
</text-setting>
</div>
<div class="col-md-4 col-md-offset-1">
<text-setting name="base_url_host"
settings="allSettings"
label="app.admin.settings.general.host"
fa-icon="fa-server"
placeholder="example.com"
required="true">
</text-setting>
</div>
<div class="col-md-1">
<button class="btn btn-default m-t-lg" ng-click="detectFillUrl()">
<i class="fa fa-search m-r-sm"></i>
<span translate>{{ 'app.admin.settings.general.auto_fill' }}</span>
</button>
</div>
</div>
</div>
</div>

View File

@ -69,6 +69,20 @@
placeholder="UA-000000-2">
</text-setting>
</div>
<div class="col-md-4 col-md-offset-1">
<text-setting name="base_url_host"
settings="allSettings"
label="app.admin.settings.general.host"
fa-icon="fa-server"
placeholder="example.com"
required="true">
</text-setting>
</div>
<div class="col-md-1">
<button class="btn btn-default m-t-lg" ng-click="detectFillUrl()" title="{{ 'app.admin.settings.general.auto_fill' | translate }}">
<i class="fa fa-search"></i>
</button>
</div>
</div>
<div class="row">

View File

@ -5,7 +5,7 @@
<div class="input-group-addon" ng-if="faIcon">
<i class="fa {{faIcon}}"></i>
</div>
<input type="text"
<input type="{{type}}"
class="form-control"
id="setting-{{setting.name}}"
placeholder="{{placeholder}}"

View File

@ -50,7 +50,10 @@ class ApplicationController < ActionController::Base
end
def default_url_options
{ host: Rails.application.secrets.default_host, protocol: Rails.application.secrets.default_protocol }
{
host: Setting.get('base_url_host'),
protocol: Setting.get('base_url_protocol')
}
end
def permission_denied

View File

@ -2,7 +2,7 @@
# Mailer configuration
class BaseMailer < ActionMailer::Base
default from: Setting.get('mail_from')
default from: Setting.get('email_from')
layout 'notifications_mailer'
helper :application

View File

@ -2,7 +2,7 @@
# Handle most of the emails sent by the platform. Triggered by notifications
class NotificationsMailer < NotifyWith::NotificationsMailer
default from: Setting.get('mail_from')
default from: Setting.get('email_from')
layout 'notifications_mailer'
helper :application

View File

@ -5,5 +5,5 @@ class OverwrittenDeviseMailer < Devise::Mailer
helper :application
include Devise::Controllers::UrlHelpers
default template_path: 'devise/mailer'
default from: ->(*) { Setting.get('mail_from') }
default from: Setting.get('email_from')
end

View File

@ -89,7 +89,9 @@ class Setting < ApplicationRecord
recaptcha_site_key
recaptcha_secret_key
feature_tour_display
email_from] }
email_from
base_url_protocol
base_url_host] }
def value
last_value = history_values.order(HistoryValue.arel_table['created_at'].desc).first
last_value&.value

View File

@ -28,8 +28,8 @@
Fablab.withoutOnlinePayment = ('<%= Rails.application.secrets.fablab_without_online_payments %>' === 'true');
Fablab.fablabWithoutWallet = ('<%= Rails.application.secrets.fablab_without_wallet %>' === 'true');
Fablab.disqusShortname = "<%= Rails.application.secrets.disqus_shortname %>";
Fablab.defaultHost = "<%= Rails.application.secrets.default_host %>";
Fablab.gaId = "<%= Setting.get('tracking_id') %>";
Fablab.baseHostUrl = "<%= Setting.get('base_url_host') %>";
Fablab.trackingId = "<%= Setting.get('tracking_id') %>";
Fablab.superadminId = parseInt("<%= User.superadmin&.id %>", 10);
// i18n stuff

View File

@ -30,8 +30,8 @@ Rails.application.configure do
end
config.action_controller.default_url_options = {
host: Rails.application.secrets.default_host,
protocol: Rails.application.secrets.default_protocol
host: Setting.get('base_url_host'),
protocol: Setting.get('base_url_protocol')
}
# Store uploaded files on the local file system (see config/storage.yml for options)
@ -46,8 +46,8 @@ Rails.application.configure do
config.action_mailer.smtp_settings = { address: 'fabmanager-mailcatcher', port: 1025 }
config.action_mailer.raise_delivery_errors = false
config.action_mailer.default_url_options = {
host: Rails.application.secrets.default_host,
protocol: Rails.application.secrets.default_protocol
host: Setting.get('base_url_host'),
protocol: Setting.get('base_url_protocol')
}
# Print deprecation notices to the Rails logger.

View File

@ -21,8 +21,8 @@ Rails.application.configure do
# config.require_master_key = true
config.action_controller.default_url_options = {
host: Rails.application.secrets.default_host,
protocol: Rails.application.secrets.default_protocol
host: Setting.get('base_url_host'),
protocol: Setting.get('base_url_protocol')
}
# Disable serving static files from the `/public` folder by default since
@ -78,8 +78,8 @@ Rails.application.configure do
config.action_mailer.perform_caching = false
config.action_mailer.default_url_options = {
host: Rails.application.secrets.default_host,
protocol: Rails.application.secrets.default_protocol
host: Setting.get('base_url_host'),
protocol: Setting.get('base_url_protocol')
}
# config.action_mailer.perform_deliveries = true
# config.action_mailer.raise_delivery_errors = false

View File

@ -17,8 +17,8 @@ Rails.application.configure do
config.action_controller.perform_caching = true
config.action_controller.default_url_options = {
host: Rails.application.secrets.default_host,
protocol: Rails.application.secrets.default_protocol
host: Setting.get('base_url_host'),
protocol: Setting.get('base_url_protocol')
}
# Enable Rack::Cache to put a simple HTTP cache in front of your application
@ -89,8 +89,8 @@ Rails.application.configure do
# config.serve_static_assets = true
config.action_mailer.default_url_options = {
host: Rails.application.secrets.default_host,
protocol: Rails.application.secrets.default_protocol
host: Setting.get('base_url_host'),
protocol: Setting.get('base_url_protocol')
}
# config.action_mailer.perform_deliveries = true
# config.action_mailer.raise_delivery_errors = false

View File

@ -25,8 +25,8 @@ Rails.application.configure do
config.action_controller.perform_caching = false
config.action_controller.default_url_options = {
host: Rails.application.secrets.default_host,
protocol: Rails.application.secrets.default_protocol
host: Setting.get('base_url_host'),
protocol: Setting.get('base_url_protocol')
}
# Raise exceptions instead of rendering exception templates.

View File

@ -562,6 +562,7 @@ en:
accounting_Space_label: "Spaces label"
general_space_label: "Account label for all spaces"
codes_customization_success: "Customization of the accounting codes successfully saved."
unexpected_error_occurred: "An unexpected error occurred while saving the codes. Please try again later."
export_accounting_data: "Export accounting data"
export_to: "Export to the accounting software"
export_is_running: "Export is running. You'll be notified when it's ready."
@ -1050,6 +1051,9 @@ en:
recaptcha_secret_key: "reCAPTCHA Secret Key"
feature_tour_display: "feature tour display"
email_from: "expeditor's address"
base_url_protocol: "site protocol"
base_url_host: "site host"
base_url: "site url"
general:
general: "General"
title: "Title"
@ -1083,6 +1087,11 @@ en:
email: "Email"
email_info: "The email address from which notifications will be sent. You can use a non-existing address (like noreply@...) or an existing address if you want to allow your members to reply to the notifications they receive."
email_from: "Expeditor's address"
site_url: "Site url"
auto_fill: "Detect and fill"
site_url_info_html: "<p>Your members will receive email notifications containing links to this instance of Fab-manager. You must properly configure the URL of this instance, to prevent broken links.</p><p>To prevent any mistake, please favor the use of the button <strong>{NAME}</strong> below.</p><p>The host name is also used for visits statistics.</p>"
protocol: "Protocol"
host: "Host"
privacy:
title: "Privacy"
privacy_policy: "Privacy policy"
@ -1117,7 +1126,7 @@ en:
online_payment: "Is the online payment module active?"
invoices: "Is the invoicing module active?"
openlab: "Is the project sharing module (OpenLab) active?"
tracking_id_info_html: "To enable the statistical tracking of the visits using Google Analytics, set your tracking ID here. It is in the form UA-000000-2. Visit <a href='https://analytics.google.com/analytics/web/' target='_blank'>the Google Analytics website</a> to get one.<strong>Warning:</strong> if you enable this feature, remember to write it in your privacy policy, above."
tracking_id_info_html: "<p>To enable the statistical tracking of the visits using Google Analytics, set your tracking ID here. It is in the form UA-000000-2. Visit <a href='https://analytics.google.com/analytics/web/' target='_blank'>the Google Analytics website</a> to get one.<br/><strong>Warning:</strong> if you enable this feature, remember to write it in your privacy policy, above.</p><p>The host name is also required to use Google Analytics. You can get it by clicking on the adjacent button. This last parameter is used elsewhere, please set it carefully.</p>"
tracking_id: "Tracking ID"
open_api_clients:
add_new_client: "Create new API client"

View File

@ -562,6 +562,7 @@ fr:
accounting_Space_label: "Libellé espaces"
general_space_label: "Libellé du compte pour tous les espaces"
codes_customization_success: "La personnalisation des codes comptables a bien été enregistrée."
unexpected_error_occurred: "Une erreur inattendue est survenue lors de l'enregitrement des codes. Veuillez réessayer plus tard."
export_accounting_data: "Exporter les données comptables"
export_to: "Exporter vers le logiciel comptable"
export_is_running: "L'export est en cours. Vous serez notifié lorsqu'il sera prêt."
@ -895,6 +896,7 @@ fr:
#global application parameters and customization
settings:
customize_the_application: "Personnalisation de l'application"
fablab_name: "Nom du FabLab"
about: "A propos"
customize_information_messages: "Personnaliser les messages d'informations"
message_of_the_machine_booking_page: "Message sur la page de réservation d'une machine :"
@ -1049,17 +1051,18 @@ fr:
recaptcha_secret_key: "clef secrète reCAPTCHA"
feature_tour_display: "l'affichage des visites guidées"
email_from: "l'adresse de l'expéditeur"
base_url_protocol: "protocole du site"
base_url_host: "l'hôte du site"
base_url: "l'url du site"
general:
general: "Général"
title: "Titre"
fablab_title: "Titre du FabLab"
fablab_name: "Nom du FabLab"
title_concordance: "Accord du titre"
male: "Masculin."
female: "Féminin."
neutral: "Neutre."
eg: "ex :"
about: "A propos"
the_team: "L'équipe"
male_preposition: "du"
female_preposition: "de la"
@ -1084,6 +1087,11 @@ fr:
email: "Courriel"
email_info: "L'adresse de courriel depuis laquelle les notifications seront envoyées. Vous pouvez utiliser une adresse qui n'existe pas (comme ne-pas-repondre@...) ou une adresse existante si vous voulez que vos membres puisse répondre aux notifications qu'ils reçoivent."
email_from: "Adresse de l'expéditeur"
site_url: "URL du site"
auto_fill: "Détecter et remplir"
site_url_info_html: "<p>Vos membres recevront les notifications par courriel contenant des liens vers cette instance de Fab-manager. Vous devez configurer correctement l'URL de cette instance, pour éviter les liens cassés.</p><p>Pour éviter toute erreur, veuillez favoriser l'utilisation du bouton <strong>{NAME}</strong> ci-dessous.</p><p>Le nom d'hôte est également utilisé pour les statistiques de visites.</p>"
protocol: "Protocole"
host: "Hôte"
privacy:
title: "Confidentialité"
privacy_policy: "Politique de confidentialité"
@ -1118,7 +1126,7 @@ fr:
online_payment: "Le module de paiement par carte bancaire est-il actif ?"
invoices: "Le module est facturation est-il actif ?"
openlab: "Le module de partage de projets (OpenLab) est-il actif ?"
tracking_id_info_html: "Pour activer les suivi statistique des visites utilisant Google Analytics, définissez ici votre ID de suivi. Il se présente sous la forme UA-000000-2. Visitez <a href='https://analytics.google.com/analytics/web/' target='_blank'>le site web de Google Analytics</a> pour en obtenir un.<br/><strong>Attention :</strong> si vous activez cette fonctionnalité, pensez à l'indiquer dans votre politique de confidentialité, ci-dessus."
tracking_id_info_html: "<p>Pour activer les suivi statistique des visites utilisant Google Analytics, définissez ici votre ID de suivi. Il se présente sous la forme UA-000000-2. Visitez <a href='https://analytics.google.com/analytics/web/' target='_blank'>le site web de Google Analytics</a> pour en obtenir un.<br/><strong>Attention :</strong> si vous activez cette fonctionnalité, pensez à l'indiquer dans votre politique de confidentialité, ci-dessus.</p><p>Le nom d'hôte est également requis pour pouvoir utiliser Google Analytics. Vous pouvez l'obtenir en cliquant sur le bouton adjacent. Ce dernier paramètre est utilisé ailleurs, veuillez le définir avec soin.</p>"
tracking_id: "ID de suivi"
open_api_clients:
add_new_client: "Créer un compte client"

View File

@ -19,8 +19,6 @@ development:
fablab_without_online_payments: <%= ENV["FABLAB_WITHOUT_ONLINE_PAYMENT"] %>
fablab_without_wallet: <%= ENV["FABLAB_WITHOUT_WALLET"] %>
user_confirmation_needed_to_sign_in: <%= ENV["USER_CONFIRMATION_NEEDED_TO_SIGN_IN"] %>
default_host: <%= ENV["DEFAULT_HOST"] %>
default_protocol: <%= ENV["DEFAULT_PROTOCOL"] %>
time_zone: <%= ENV["TIME_ZONE"] %>
week_starting_day: <%= ENV["WEEK_STARTING_DAY"] %>
d3_date_format: <%= ENV["D3_DATE_FORMAT"].dump %> # .dump is needed as the value may start by a '%', see https://github.com/tenderlove/psych/issues/75
@ -56,8 +54,6 @@ test:
fablab_without_online_payments: false
fablab_without_wallet: false
user_confirmation_needed_to_sign_in: <%= ENV["USER_CONFIRMATION_NEEDED_TO_SIGN_IN"] %>
default_host: <%= ENV["DEFAULT_HOST"] %>
default_protocol: <%= ENV["DEFAULT_PROTOCOL"] %>
time_zone: Paris
week_starting_day: monday
d3_date_format: '%d/%m/%y'
@ -93,8 +89,6 @@ staging:
fablab_without_online_payments: <%= ENV["FABLAB_WITHOUT_ONLINE_PAYMENT"] %>
fablab_without_wallet: <%= ENV["FABLAB_WITHOUT_WALLET"] %>
user_confirmation_needed_to_sign_in: <%= ENV["USER_CONFIRMATION_NEEDED_TO_SIGN_IN"] %>
default_host: <%= ENV["DEFAULT_HOST"] %>
default_protocol: <%= ENV["DEFAULT_PROTOCOL"] %>
delivery_method: <%= ENV['DELIVERY_METHOD'] %>
smtp_address: <%= ENV["SMTP_ADDRESS"] %>
smtp_port: <%= ENV["SMTP_PORT"] %>
@ -141,8 +135,6 @@ production:
fablab_without_online_payments: <%= ENV["FABLAB_WITHOUT_ONLINE_PAYMENT"] %>
fablab_without_wallet: <%= ENV["FABLAB_WITHOUT_WALLET"] %>
user_confirmation_needed_to_sign_in: <%= ENV["USER_CONFIRMATION_NEEDED_TO_SIGN_IN"] %>
default_host: <%= ENV["DEFAULT_HOST"] %>
default_protocol: <%= ENV["DEFAULT_PROTOCOL"] %>
delivery_method: <%= ENV['DELIVERY_METHOD'] %>
smtp_address: <%= ENV["SMTP_ADDRESS"] %>
smtp_port: <%= ENV["SMTP_PORT"] %>

View File

@ -105,13 +105,12 @@ Set to 'false' if you don't want this behaviour.
Configure the Rails' Action Mailer delivery method.
See http://guides.rubyonrails.org/action_mailer_basics.html#action-mailer-configuration for more details.
<a name="DEFAULT_HOST"></a><a name="DEFAULT_PROTOCOL"></a><a name="SMTP_ADDRESS"></a><a name="SMTP_PORT"></a><a name="SMTP_USER_NAME"></a><a name="SMTP_PASSWORD"></a><a name="SMTP_AUTHENTICATION"></a><a name="SMTP_ENABLE_STARTTLS_AUTO"></a><a name="SMTP_OPENSSL_VERIFY_MODE"></a><a name="SMTP_TLS"></a>
</a><a name="SMTP_ADDRESS"></a><a name="SMTP_PORT"></a><a name="SMTP_USER_NAME"></a><a name="SMTP_PASSWORD"></a><a name="SMTP_AUTHENTICATION"></a><a name="SMTP_ENABLE_STARTTLS_AUTO"></a><a name="SMTP_OPENSSL_VERIFY_MODE"></a><a name="SMTP_TLS"></a>
DEFAULT_HOST, DEFAULT_PROTOCOL, SMTP_ADDRESS, SMTP_PORT, SMTP_USER_NAME, SMTP_PASSWORD, SMTP_AUTHENTICATION, SMTP_ENABLE_STARTTLS_AUTO, SMTP_OPENSSL_VERIFY_MODE & SMTP_TLS
SMTP_ADDRESS, SMTP_PORT, SMTP_USER_NAME, SMTP_PASSWORD, SMTP_AUTHENTICATION, SMTP_ENABLE_STARTTLS_AUTO, SMTP_OPENSSL_VERIFY_MODE & SMTP_TLS
When DELIVERY_METHOD is set to **smtp**, configure the SMTP server parameters.
See https://guides.rubyonrails.org/action_mailer_basics.html#action-mailer-configuration for more details.
DEFAULT_HOST is also used to configure Google Analytics.
<a name="DISQUS_SHORTNAME"></a>
DISQUS_SHORTNAME

View File

@ -22,10 +22,6 @@ FABLAB_WITHOUT_WALLET=false
USER_CONFIRMATION_NEEDED_TO_SIGN_IN=false
# Configure carefully!
DEFAULT_HOST=localhost:5000
DEFAULT_PROTOCOL=http
# Email config
DELIVERY_METHOD=smtp
SMTP_ADDRESS=

View File

@ -4,7 +4,7 @@
class FabHub
def self.version_check_payload
uuid = Setting.get('uuid')
origin = Setting.get('origin') || "#{Rails.application.secrets.default_protocol}://#{Rails.application.secrets.default_host}"
origin = Setting.get('origin') || "#{Setting.get('base_url_protocol')}://#{Setting.get('base_url_host')}"
{
uuid: uuid,
origin: origin,

View File

@ -119,7 +119,9 @@ namespace :fablab do
%w[_ RECAPTCHA_SITE_KEY recaptcha_site_key],
%w[_ RECAPTCHA_SECRET_KEY recaptcha_secret_key],
%w[_ FEATURE_TOUR_DISPLAY feature_tour_display once],
%w[_ DEFAULT_MAIL_FROM email_from]
%w[_ DEFAULT_MAIL_FROM email_from],
%w[_ DEFAULT_HOST base_url_host demo.fab-manager.com],
%w[_ DEFAULT_PROTOCOL base_url_protocol https]
]
mapping.each do |m|

View File

@ -16,9 +16,6 @@ FABLAB_WITHOUT_WALLET=false
SLOT_DURATION=60
FEATURE_TOUR_DISPLAY=once
DEFAULT_HOST=demo.fab-manager.com
DEFAULT_PROTOCOL=http
DELIVERY_METHOD=smtp
SMTP_ADDRESS=smtp.sendgrid.net
SMTP_PORT=587

View File

@ -235,7 +235,7 @@ configure_env_file()
local doc variables secret
doc=$(\curl -sSL https://raw.githubusercontent.com/sleede/fab-manager/master/doc/environment.md)
variables=(STRIPE_API_KEY STRIPE_PUBLISHABLE_KEY STRIPE_CURRENCY INVOICE_PREFIX FABLAB_WITHOUT_ONLINE_PAYMENT FABLAB_WITHOUT_WALLET \
USER_CONFIRMATION_NEEDED_TO_SIGN_IN DEFAULT_MAIL_FROM DELIVERY_METHOD DEFAULT_HOST DEFAULT_PROTOCOL SMTP_ADDRESS SMTP_PORT SMTP_USER_NAME SMTP_PASSWORD SMTP_AUTHENTICATION \
USER_CONFIRMATION_NEEDED_TO_SIGN_IN DELIVERY_METHOD SMTP_ADDRESS SMTP_PORT SMTP_USER_NAME SMTP_PASSWORD SMTP_AUTHENTICATION \
SMTP_ENABLE_STARTTLS_AUTO SMTP_OPENSSL_VERIFY_MODE SMTP_TLS DISQUS_SHORTNAME \
LOG_LEVEL ALLOWED_EXTENSIONS ALLOWED_MIME_TYPES MAX_IMAGE_SIZE MAX_CAO_SIZE MAX_IMPORT_SIZE DISK_SPACE_MB_ALERT \
SUPERADMIN_EMAIL APP_LOCALE RAILS_LOCALE MOMENT_LOCALE SUMMERNOTE_LOCALE ANGULAR_LOCALE FULLCALENDAR_LOCALE ELASTICSEARCH_LANGUAGE_ANALYZER TIME_ZONE \