diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000000..06ed5905eb
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,10 @@
+trigger_deploy:
+ stage: deploy
+ script:
+ - curl -X POST
+ --form "token=$TRIGGER_TOKEN"
+ --form "ref=master"
+ --form "variables[UPSTREAM_COMMIT_SHA]=$CI_COMMIT_SHA"
+ https://gitlab.com/api/v4/projects/12825884/trigger/pipeline
+ only:
+ - develop
diff --git a/README.md b/README.md
index 2b48b4280a..958fc1e933 100644
--- a/README.md
+++ b/README.md
@@ -8,7 +8,7 @@
-
+
diff --git a/packages/strapi-admin/admin/src/translations/en.json b/packages/strapi-admin/admin/src/translations/en.json
index 5fb8b81988..74a4a7b663 100644
--- a/packages/strapi-admin/admin/src/translations/en.json
+++ b/packages/strapi-admin/admin/src/translations/en.json
@@ -41,7 +41,7 @@
"app.components.HomePage.support.link": "GET YOUR T-SHIRT NOW",
"app.components.HomePage.welcome": "Welcome on board!",
"app.components.HomePage.welcome.again": "Welcome ",
- "app.components.HomePage.welcomeBlock.content": "We are happy to have you as one of community member. We are constantly looking for feedback so feel free to send us DM on ",
+ "app.components.HomePage.welcomeBlock.content": "We are happy to have you as part of the community. We are constantly looking for feedback so feel free to send us DM on ",
"app.components.HomePage.welcomeBlock.content.again": "We hope you are making progress on your project... Feel free to read the latest new about Strapi. We are giving our best to improve the product based on your feedback.",
"app.components.HomePage.welcomeBlock.content.issues": "issues.",
"app.components.HomePage.welcomeBlock.content.raise": " or raise ",
diff --git a/packages/strapi-helper-plugin/lib/src/testUtils/commonTrads.json b/packages/strapi-helper-plugin/lib/src/testUtils/commonTrads.json
index a2b939cff2..ec9ea99d29 100644
--- a/packages/strapi-helper-plugin/lib/src/testUtils/commonTrads.json
+++ b/packages/strapi-helper-plugin/lib/src/testUtils/commonTrads.json
@@ -41,7 +41,7 @@
"app.components.HomePage.support.link": "GET YOUR T-SHIRT NOW",
"app.components.HomePage.welcome": "Welcome on board!",
"app.components.HomePage.welcome.again": "Welcome ",
- "app.components.HomePage.welcomeBlock.content": "We are happy to have you as one of community member. We are constantly looking for feedback so feel free to send us DM on ",
+ "app.components.HomePage.welcomeBlock.content": "We are happy to have you as part of the community. We are constantly looking for feedback so feel free to send us DM on ",
"app.components.HomePage.welcomeBlock.content.again": "We hope you are making progress on your project... Feel free to read the latest new about Strapi. We are giving our best to improve the product based on your feedback.",
"app.components.HomePage.welcomeBlock.content.issues": "issues.",
"app.components.HomePage.welcomeBlock.content.raise": " or raise ",
diff --git a/packages/strapi-plugin-users-permissions/services/UsersPermissions.js b/packages/strapi-plugin-users-permissions/services/UsersPermissions.js
index cb4f06be29..481c265da2 100644
--- a/packages/strapi-plugin-users-permissions/services/UsersPermissions.js
+++ b/packages/strapi-plugin-users-permissions/services/UsersPermissions.js
@@ -130,7 +130,7 @@ module.exports = {
},
},
(err, response, body) => {
- if (response.statusCode !== 200 || err) {
+ if (err || response.statusCode !== 200) {
return resolve([]);
}
diff --git a/packages/strapi/lib/load/__tests__/check-reserved-filename.test.js b/packages/strapi/lib/load/__tests__/check-reserved-filename.test.js
new file mode 100644
index 0000000000..7ac7a1202e
--- /dev/null
+++ b/packages/strapi/lib/load/__tests__/check-reserved-filename.test.js
@@ -0,0 +1,27 @@
+const checkReservedFilename = require('../check-reserved-filename');
+
+describe('check-reserved-filename', () => {
+ const table = [
+ // matches
+ ['config/functions.json', true],
+ ['config/functions/bootstrapi.js', true],
+ ['config/layout.json', true],
+ ['config/hook.json', true],
+ ['config/middleware.json', true],
+ ['config/environments/test/database.json', true],
+ ['config/environments/development/request.json', true],
+ ['config/environments/production/server.json', true],
+ ['config/environments/staging/response.json', true],
+ ['config/environments/qa/security.json', true],
+
+ // dont match
+ ['config/application.json', false],
+ ['config/custom.json', false],
+ ['config/environments/qa/custom.json', false],
+ ['config/environments/qa/other.json', false],
+ ];
+
+ test.each(table)('Path %s should return %s', (path, expected) => {
+ expect(checkReservedFilename(path)).toBe(expected);
+ });
+});
diff --git a/packages/strapi/lib/load/check-reserved-filename.js b/packages/strapi/lib/load/check-reserved-filename.js
new file mode 100644
index 0000000000..30b309fd91
--- /dev/null
+++ b/packages/strapi/lib/load/check-reserved-filename.js
@@ -0,0 +1,27 @@
+'use strict';
+
+const _ = require('lodash');
+const minimatch = require('minimatch');
+
+const envMatcher = new minimatch.Minimatch(
+ 'config/environments/*/+(request|database|server|security|response).+(json|js)'
+);
+
+// files to load with filename key
+const prefixedPaths = [
+ 'functions',
+ 'policies',
+ 'locales',
+ 'hook',
+ 'middleware',
+ 'language',
+ 'queries',
+ 'layout',
+];
+
+module.exports = function checkReservedFilenames(file) {
+ if (envMatcher.match(file)) return true;
+ return _.some(prefixedPaths, e => file.indexOf(`config/${e}`) >= 0)
+ ? true
+ : false;
+};
diff --git a/packages/strapi/lib/load/load-config-files.js b/packages/strapi/lib/load/load-config-files.js
index 80813fc04d..1fcbf87507 100644
--- a/packages/strapi/lib/load/load-config-files.js
+++ b/packages/strapi/lib/load/load-config-files.js
@@ -1,6 +1,8 @@
-const _ = require('lodash');
+'use strict';
+
const loadFiles = require('./load-files');
const requireFileAndParse = require('./require-file-parse');
+const checkReservedFilename = require('./check-reserved-filename');
/**
* @param {string} dir - directory from which to load configs
@@ -9,38 +11,11 @@ const requireFileAndParse = require('./require-file-parse');
const laodConfigFiles = (dir, pattern = 'config/**/*.+(js|json)') =>
loadFiles(dir, pattern, {
requireFn: requireFileAndParse,
- shouldUseFileNameAsKey,
+ shouldUseFileNameAsKey: checkReservedFilename,
globArgs: {
// used to load .init.json at first startup
- dot: true
+ dot: true,
},
});
-const shouldUseFileNameAsKey = file => {
- return _.some(prefixedPaths, e => file.indexOf(`config/${e}`) >= 0)
- ? true
- : false;
-};
-
-// files to load with filename key
-const prefixedPaths = [
- ...['staging', 'production', 'development'].reduce((acc, env) => {
- return acc.concat(
- `environments/${env}/database`,
- `environments/${env}/security`,
- `environments/${env}/request`,
- `environments/${env}/response`,
- `environments/${env}/server`
- );
- }, []),
- 'functions',
- 'policies',
- 'locales',
- 'hook',
- 'middleware',
- 'language',
- 'queries',
- 'layout',
-];
-
module.exports = laodConfigFiles;
diff --git a/packages/strapi/lib/load/load-files.js b/packages/strapi/lib/load/load-files.js
index bbcaddf19f..eb6bb75d00 100644
--- a/packages/strapi/lib/load/load-files.js
+++ b/packages/strapi/lib/load/load-files.js
@@ -1,3 +1,5 @@
+'use strict';
+
const path = require('path');
const glob = require('./glob');
const _ = require('lodash');
diff --git a/packages/strapi/package.json b/packages/strapi/package.json
index ef78e1551f..15636cd86e 100644
--- a/packages/strapi/package.json
+++ b/packages/strapi/package.json
@@ -38,6 +38,7 @@
"koa-session": "^5.5.1",
"koa-static": "^4.0.1",
"lodash": "^4.17.5",
+ "minimatch": "^3.0.4",
"node-fetch": "^1.7.3",
"node-machine-id": "^1.1.10",
"node-schedule": "^1.2.0",
diff --git a/test/config/front/testUtils/commonTrads.json b/test/config/front/testUtils/commonTrads.json
index a2b939cff2..ec9ea99d29 100644
--- a/test/config/front/testUtils/commonTrads.json
+++ b/test/config/front/testUtils/commonTrads.json
@@ -41,7 +41,7 @@
"app.components.HomePage.support.link": "GET YOUR T-SHIRT NOW",
"app.components.HomePage.welcome": "Welcome on board!",
"app.components.HomePage.welcome.again": "Welcome ",
- "app.components.HomePage.welcomeBlock.content": "We are happy to have you as one of community member. We are constantly looking for feedback so feel free to send us DM on ",
+ "app.components.HomePage.welcomeBlock.content": "We are happy to have you as part of the community. We are constantly looking for feedback so feel free to send us DM on ",
"app.components.HomePage.welcomeBlock.content.again": "We hope you are making progress on your project... Feel free to read the latest new about Strapi. We are giving our best to improve the product based on your feedback.",
"app.components.HomePage.welcomeBlock.content.issues": "issues.",
"app.components.HomePage.welcomeBlock.content.raise": " or raise ",