-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #440 from InseeFr/hot-fix/v2-auth
Hot fix: v2 auth
- Loading branch information
Showing
69 changed files
with
4,733 additions
and
5,819 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,17 @@ | ||
SKIP_PREFLIGHT_CHECK=true | ||
REACT_APP_SURVEY_API_BASE_URL= | ||
REACT_APP_LUNATIC_LOADER_WORKER_PATH=/workers/lunatic-append-worker-0.3.0-experimental.js | ||
REACT_APP_LUNATIC_SEARCH_WORKER_PATH=/workers/lunatic-searching-worker-0.3.0-experimental.js | ||
REACT_APP_LUNATIC_LABEL_WORKER_PATH=/workers/lunatic-label-worker-0.3.0-experimental.js | ||
# REACT_APP_SAVING_TIME When data is put : 'sequence' or 'page', default: sequence | ||
REACT_APP_SAVING_TIME= | ||
# REACT_APP_SAVING_STRATEGY: If data has to be send each time complete or just changed data : 'complete' or 'partial', , default: complete | ||
REACT_APP_SAVING_STRATEGY= | ||
# default: recensement | ||
REACT_APP_DEFAULT_SURVEY= | ||
# REACT_APP_AUTH_TYPE: oidc / none, default: none | ||
REACT_APP_AUTH_TYPE=oidc | ||
REACT_APP_CLIENT_ID=localhost-frontend | ||
REACT_APP_AUTHORITY=https://auth.insee.net/auth/realms/questionnaire-particuliers | ||
REACT_APP_PORTAIL_URL=https://enquetes.beta.stat-publique.fr | ||
REACT_APP_IDENTITY_PROVIDER=insee-ssp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,14 @@ | ||
FROM nginx | ||
RUN rm -rf /usr/share/nginx/html/* | ||
|
||
ADD build /usr/share/nginx/html | ||
|
||
RUN rm etc/nginx/conf.d/default.conf | ||
COPY nginx.conf etc/nginx/conf.d/ | ||
COPY ./nginx.conf /etc/nginx/conf.d/ | ||
|
||
# Copy .env file and shell script to container | ||
WORKDIR /usr/share/nginx/html | ||
COPY ./scripts/env.sh . | ||
COPY ./scripts/.env . | ||
|
||
# Make shell script executable and prevent windows encoding | ||
RUN sed -i -e 's/\r$//' env.sh && sed -i -e 's/\r$//' .env && chmod +x env.sh | ||
COPY entrypoint.sh /entrypoint.sh | ||
RUN chmod 755 /entrypoint.sh | ||
ENTRYPOINT [ "/entrypoint.sh" ] | ||
|
||
# Start Nginx server | ||
CMD ["/bin/bash", "-c", "/usr/share/nginx/html/env.sh && nginx -g \"daemon off;\""] | ||
CMD ["nginx", "-g", "daemon off;"] |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,18 @@ | ||
module.exports = { | ||
babel: { | ||
loaderOptions: (babelLoaderOptions) => { | ||
const origBabelPresetCRAIndex = babelLoaderOptions.presets.findIndex( | ||
(preset) => { | ||
return preset[0].includes('babel-preset-react-app'); | ||
} | ||
); | ||
|
||
const origBabelPresetCRA = | ||
babelLoaderOptions.presets[origBabelPresetCRAIndex]; | ||
|
||
babelLoaderOptions.presets[origBabelPresetCRAIndex] = | ||
function overridenPresetCRA(api, opts, env) { | ||
const babelPresetCRAResult = require(origBabelPresetCRA[0])( | ||
api, | ||
origBabelPresetCRA[1], | ||
env | ||
); | ||
|
||
babelPresetCRAResult.presets.forEach((preset) => { | ||
// detect @babel/preset-react with {development: true, runtime: 'automatic'} | ||
const isReactPreset = | ||
preset && | ||
preset[1] && | ||
preset[1].runtime === 'automatic' && | ||
preset[1].development === true; | ||
if (isReactPreset) { | ||
preset[1].importSource = '@welldone-software/why-did-you-render'; | ||
} | ||
}); | ||
|
||
return babelPresetCRAResult; | ||
}; | ||
const OVERLOAD = { fs: false, stream: false, os: false }; | ||
|
||
return babelLoaderOptions; | ||
}, | ||
}, | ||
// if you want to track react-redux selectors | ||
module.exports = { | ||
webpack: { | ||
alias: { | ||
'react-redux': | ||
process.env.NODE_ENV === 'development' | ||
? 'react-redux/lib' | ||
: 'react-redux', | ||
configure: (config, { env, paths }) => { | ||
const { resolve } = config; | ||
const { fallback } = resolve; | ||
|
||
return { | ||
...config, | ||
resolve: { | ||
...resolve, | ||
fallback: { ...fallback, ...OVERLOAD }, | ||
}, | ||
}; | ||
}, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/sh | ||
echo "self._env_['SKIP_PREFLIGHT_CHECK'] = '$SKIP_PREFLIGHT_CHECK';" >> /usr/share/nginx/html/env-config.js | ||
echo "self._env_['REACT_APP_SURVEY_API_BASE_URL'] = '$REACT_APP_SURVEY_API_BASE_URL';" >> /usr/share/nginx/html/env-config.js | ||
echo "self._env_['REACT_APP_LUNATIC_LOADER_WORKER_PATH'] = '$REACT_APP_LUNATIC_LOADER_WORKER_PATH';" >> /usr/share/nginx/html/env-config.js | ||
echo "self._env_['REACT_APP_LUNATIC_SEARCH_WORKER_PATH'] = '$REACT_APP_LUNATIC_SEARCH_WORKER_PATH';" >> /usr/share/nginx/html/env-config.js | ||
echo "self._env_['REACT_APP_LUNATIC_LABEL_WORKER_PATH'] = '$REACT_APP_LUNATIC_LABEL_WORKER_PATH';" >> /usr/share/nginx/html/env-config.js | ||
echo "self._env_['REACT_APP_SAVING_TIME'] = '$REACT_APP_SAVING_TIME';" >> /usr/share/nginx/html/env-config.js | ||
echo "self._env_['REACT_APP_SAVING_STRATEGY'] = '$REACT_APP_SAVING_STRATEGY';" >> /usr/share/nginx/html/env-config.js | ||
echo "self._env_['REACT_APP_DEFAULT_SURVEY'] = '$REACT_APP_DEFAULT_SURVEY';" >> /usr/share/nginx/html/env-config.js | ||
echo "self._env_['REACT_APP_AUTH_TYPE'] = '$REACT_APP_AUTH_TYPE';" >> /usr/share/nginx/html/env-config.js | ||
echo "self._env_['REACT_APP_CLIENT_ID'] = '$REACT_APP_CLIENT_ID';" >> /usr/share/nginx/html/env-config.js | ||
echo "self._env_['REACT_APP_AUTHORITY'] = '$REACT_APP_AUTHORITY';" >> /usr/share/nginx/html/env-config.js | ||
echo "self._env_['REACT_APP_PORTAIL_URL'] = '$REACT_APP_PORTAIL_URL';" >> /usr/share/nginx/html/env-config.js | ||
echo "self._env_['REACT_APP_IDENTITY_PROVIDER'] = '$REACT_APP_IDENTITY_PROVIDER';" >> /usr/share/nginx/html/env-config.js | ||
exec "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,19 @@ | ||
{ | ||
"compilerOptions": { | ||
"baseUrl": "./src" | ||
} | ||
"target": "es5", | ||
"lib": ["dom", "dom.iterable", "esnext"], | ||
"allowJs": true, | ||
"skipLibCheck": true, | ||
"esModuleInterop": true, | ||
"allowSyntheticDefaultImports": true, | ||
"strict": true, | ||
"forceConsistentCasingInFileNames": true, | ||
"noFallthroughCasesInSwitch": true, | ||
"module": "esnext", | ||
"moduleResolution": "node", | ||
"resolveJsonModule": true, | ||
"isolatedModules": true, | ||
"noEmit": true | ||
}, | ||
"include": ["src"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/* eslint-disable no-restricted-globals */ | ||
if (!self._env_) self._env_ = {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.