Fixed docker env bugs, and issues from PR
This commit is contained in:
@@ -55,6 +55,9 @@ define('SECURE_AUTH_SALT', 'Ku5k]% pS[eN,))rR4%JF7c5l;w(NVFvLir-:|-N07`[yp/U*J2x
|
|||||||
define('LOGGED_IN_SALT', 'AS,kWNt-W~}c(# tsmi$hEx{XD|`<vXO{hT$|0KPLt$z!`6x>J28>nf~*8jsfFkc');
|
define('LOGGED_IN_SALT', 'AS,kWNt-W~}c(# tsmi$hEx{XD|`<vXO{hT$|0KPLt$z!`6x>J28>nf~*8jsfFkc');
|
||||||
define('NONCE_SALT', '5}W)&1O:bSk@p=Uj1QJIuT<91:LHv+`Ix=;y37LaPwNWa&EW$;E~jU45+.-;%]2}');
|
define('NONCE_SALT', '5}W)&1O:bSk@p=Uj1QJIuT<91:LHv+`Ix=;y37LaPwNWa&EW$;E~jU45+.-;%]2}');
|
||||||
|
|
||||||
|
define('JWT_AUTH_SECRET_KEY', 'z={bYHD+B[NE>o${e:t~LZ]b!2n8knYwjAsRzB5`|8IM-#d/kv+#V-1900e1ia2M');
|
||||||
|
define('JWT_AUTH_CORS_ENABLE', true);
|
||||||
|
|
||||||
|
|
||||||
//For case when wordpress is behind reverse proxy https -> http
|
//For case when wordpress is behind reverse proxy https -> http
|
||||||
//With this settings, siteurl and home have to be https://....
|
//With this settings, siteurl and home have to be https://....
|
||||||
|
|||||||
@@ -20,14 +20,13 @@ services:
|
|||||||
context: .
|
context: .
|
||||||
dockerfile: frontend.dockerfile
|
dockerfile: frontend.dockerfile
|
||||||
args:
|
args:
|
||||||
- REACT_APP_TEST_URL
|
- API_URL
|
||||||
- REACT_APP_PROD_URL
|
|
||||||
- REACT_APP_DEV_URL
|
|
||||||
volumes:
|
volumes:
|
||||||
- ./log/frontend/:/var/log/apache2/
|
- ./log/frontend/:/var/log/apache2/
|
||||||
ports:
|
ports:
|
||||||
- '8080:80'
|
- '8080:80'
|
||||||
|
|
||||||
|
|
||||||
db:
|
db:
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
|
|||||||
@@ -1,12 +1,15 @@
|
|||||||
|
|
||||||
# BEGIN WordPress
|
# BEGIN WordPress
|
||||||
<IfModule mod_rewrite.c>
|
<IfModule mod_rewrite.c>
|
||||||
RewriteEngine On
|
RewriteEngine On
|
||||||
RewriteBase /api/
|
RewriteBase /
|
||||||
RewriteRule ^index\.php$ - [L]
|
RewriteRule ^index\.php$ - [L]
|
||||||
RewriteCond %{REQUEST_FILENAME} !-f
|
RewriteCond %{REQUEST_FILENAME} !-f
|
||||||
RewriteCond %{REQUEST_FILENAME} !-d
|
RewriteCond %{REQUEST_FILENAME} !-d
|
||||||
RewriteRule . /api/index.php [L]
|
RewriteRule . /index.php [L]
|
||||||
|
RewriteCond %{HTTP:Authorization} ^(.*)
|
||||||
|
RewriteRule ^(.*) - [E=HTTP_AUTHORIZATION:%1]
|
||||||
</IfModule>
|
</IfModule>
|
||||||
|
SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
|
||||||
# END WordPress
|
# END WordPress
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,14 @@
|
|||||||
FROM php:7.0-apache
|
FROM php:7.0-apache
|
||||||
|
ARG API_URL
|
||||||
|
ENV REACT_APP_API_URL=${API_URL}
|
||||||
|
|
||||||
ARG REACT_APP_TEST_URL
|
ARG REACT_APP_TEST_URL
|
||||||
ARG REACT_APP_PROD_URL
|
ARG REACT_APP_PROD_URL
|
||||||
ARG REACT_APP_DEV_URL
|
ARG REACT_APP_DEV_URL
|
||||||
|
|
||||||
ENV REACT_APP_TEST_URL ${REACT_APP_TEST_URL}
|
ENV REACT_APP_TEST_URL ${API_URL}
|
||||||
ENV REACT_APP_PROD_URL ${REACT_APP_PROD_URL}}
|
ENV REACT_APP_PROD_URL ${APIP_URL}
|
||||||
ENV REACT_APP_DEV_URL ${REACT_APP_DEV_URL}
|
ENV REACT_APP_DEV_URL ${API_URL}
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y git unzip gnupg
|
RUN apt-get update && apt-get install -y git unzip gnupg
|
||||||
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash -
|
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash -
|
||||||
|
|||||||
@@ -38,17 +38,14 @@ export const validateAccessToken = (token) => {
|
|||||||
return dispatch => {
|
return dispatch => {
|
||||||
dispatch(validateToken());
|
dispatch(validateToken());
|
||||||
return htmlClient.fetch({
|
return htmlClient.fetch({
|
||||||
url: `http://localhost//wp-json/jwt-auth/v1/token/validate`,
|
url: `${API_SERVER}/wp-json/jwt-auth/v1/token/validate`,
|
||||||
method: 'post'
|
method: 'post'
|
||||||
})
|
})
|
||||||
.then(response => {
|
.then(response => {
|
||||||
if (response.data && response.data.status === 200) {
|
if (response.data && response.data.data.status === 200) {
|
||||||
|
|
||||||
// TODO: Implement refresh logic on backend as it was on old wias , or find a nother way
|
// TODO: Implement refresh logic on backend as it was on old wias , or find a nother way
|
||||||
// to handle token validation another way
|
// to handle token validation another way
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// const serverTime = response.data.serverTime || 1;
|
// const serverTime = response.data.serverTime || 1;
|
||||||
|
|
||||||
dispatch(loggedIn({
|
dispatch(loggedIn({
|
||||||
@@ -77,7 +74,7 @@ export const validateCredentials = (username, password) => {
|
|||||||
|
|
||||||
dispatch(login());
|
dispatch(login());
|
||||||
return htmlClient.fetch({
|
return htmlClient.fetch({
|
||||||
url: `http://localhost/wp-json/jwt-auth/v1/token`,
|
url: `${API_SERVER}/wp-json/jwt-auth/v1/token`,
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: {
|
data: {
|
||||||
"username": username,
|
"username": username,
|
||||||
|
|||||||
@@ -16,6 +16,6 @@ const API_SERVER_BASE = (() => {
|
|||||||
return process.env.REACT_APP_DEV_URL;
|
return process.env.REACT_APP_DEV_URL;
|
||||||
})();
|
})();
|
||||||
|
|
||||||
const API_SERVER = API_SERVER_BASE + '/' + API_VERSION;
|
const API_SERVER = API_SERVER_BASE
|
||||||
|
|
||||||
export {APPLICAITON_MODE, API_SERVER_BASE, API_SERVER, APPLICATION_NAME}
|
export {APPLICAITON_MODE, API_SERVER_BASE, API_SERVER, APPLICATION_NAME}
|
||||||
|
|||||||
Reference in New Issue
Block a user