Closed fabienmoyon closed 3 years ago
ex:
window.openpaas = {
//AUTH_PROVIDER: 'basic'
AUTH_PROVIDER: 'oidc',
OPENPAAS_URL: 'http://backend.open-paas.org.local',
BASE_HREF: '/inbox/',
APP_GRID_ITEMS: '[{ "name": "Calendar", "url": "/calendar/" }, { "name": "Contacts", "url": "/contacts/" }, { "name": "Inbox", "url": "/inbox/" }]',
AUTH_PROVIDER_SETTINGS: {
authority: 'http://auth.open-paas.org.local/auth/realms/master',
client_id: 'openpaas',
redirect_uri: 'http://inbox.open-paas.org.local/inbox/#/auth/oidc/callback',
silent_redirect_uri: 'http://inbox.open-paas.org.local/inbox/auth/silent-renew.html',
post_logout_redirect_uri: 'http://inbox.open-paas.org.local/',
response_type: 'code',
scope: 'openid email profile'
}
};
There is a webpack plugin to solve the BASE_HREF (publicPath on webpack) problem. https://www.npmjs.com/package/webpack-dynamic-public-path Since we use webpack ^4.43.0 this should be compatible. We should test it to see if it solves the problem correctly.
ok so after investigation :
OPENPAAS_URL
will be rename by API_BASE_URL
in to openpaas.js
will be used to overload ESN restangular
BASE_HREF
in to openpaas.js
will be used to overload base(href=base) script(src="BASE_HREF/env/openpaas.js") and inbox restangular
@renaudboyer, @huy-ta @rezk2ll need also to be done in Calendar module and after done for others SPA (coutact, account and admin)
Second step need also to improve this workflow for script(src="/socket.io/socket.io.js")
@chamerling can you please have a look, told us if we don't miss something and validate what we want to do to be able to use run time configuration
cc @huy-ta @rezk2ll @tuanlc @renaudboyer
It's ok for the calendar team
seems we can already use one variable to setup API BASE URL:
OPENPAAS_API_URL
is already defined and must be used. Please update the doc and the .env
samples
cc @rezk2ll
Static configuration done
Dynamic configuration will be dealt here: #237
CURRENTLY
For now at the run time ,we support to configure the
AUTH_PROVIDER_SETTINGS
in to theopenpaas.js
.GOAL
The goal is to able to use run time configuration
EXPECTED
Like it was done for the
AUTH_PROVIDER_SETTINGS
we need also to have theOPENPAAS_URL
, theBASE_HREF
and theAPP_GRID_ITEMS
in to theopenpaas.js
LINKS
https://github.com/OpenPaaS-Suite/esn-frontend-inbox/blob/f96115397f368dc7b71101ba0bbf2fefe31d1c18/webpack.commons.js
https://github.com/OpenPaaS-Suite/esn-frontend-common-libs/blob/1131687b39fb989a5b41fafac2b5c8e99ac50cda/src/frontend/js/modules/auth/client.js maintenant
https://github.com/OpenPaaS-Suite/openpaas-front