@fishawack/lab-env 4.36.0 → 4.38.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24 -0
- package/adonis/0/docker-compose.yml +6 -1
- package/commands/create/cmds/key.js +1 -1
- package/commands/create/libs/vars.js +4 -1
- package/commands/create/services/aws/iam.js +15 -5
- package/commands/create/templates/elasticbeanstalk/.ebextensions/adonis/post-deploy.config +2 -4
- package/commands/create/templates/elasticbeanstalk/.ebextensions/adonis/software.config +0 -2
- package/core/1/CHANGELOG.md +6 -0
- package/core/1/entrypoint.sh +3 -0
- package/core/1/package.json +1 -1
- package/globals.js +32 -6
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
## Changelog
|
|
2
2
|
|
|
3
|
+
### 4.38.0 (2024-11-21)
|
|
4
|
+
|
|
5
|
+
#### Features
|
|
6
|
+
|
|
7
|
+
* ability to override nginx config for adonis ([7b301fa](https://bitbucket.org/fishawackdigital/lab-env/commits/7b301fa090bf0a7857f4eca4318365419452d157))
|
|
8
|
+
* **adonis:** can now override base node image on adonis builds ([4a27372](https://bitbucket.org/fishawackdigital/lab-env/commits/4a27372b45644717f848e3d8cdce0e404ffa59cf))
|
|
9
|
+
* can now provide a docker-compose in _Docker dir to append to standard config ([0a9d97d](https://bitbucket.org/fishawackdigital/lab-env/commits/0a9d97d91807fa4a55f1b0c036aedf579c88371b))
|
|
10
|
+
|
|
11
|
+
#### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **adonis:** added software and post deploy scripts to default adonis deployments ([cc67d65](https://bitbucket.org/fishawackdigital/lab-env/commits/cc67d6517eee03b0a0a409416617656057c83204))
|
|
14
|
+
|
|
15
|
+
### 4.37.0 (2024-10-22)
|
|
16
|
+
|
|
17
|
+
#### Features
|
|
18
|
+
|
|
19
|
+
* added fullstack permission type that attaches eb permissions ([f98ccaa](https://bitbucket.org/fishawackdigital/lab-env/commits/f98ccaa600f6417e1bf0764ea45f2c512c438ecd))
|
|
20
|
+
* permissions now accepted for IAM users to narrow down access ([507eceb](https://bitbucket.org/fishawackdigital/lab-env/commits/507ecebbabd2feb2d9ced604975a5f86ca9c1aaa))
|
|
21
|
+
|
|
22
|
+
#### Build Updates
|
|
23
|
+
|
|
24
|
+
* bumped nodemailer to fix punycode deprecation warning ([db4fd29](https://bitbucket.org/fishawackdigital/lab-env/commits/db4fd294fc39e0455e30319f796f3813f65c2bdc))
|
|
25
|
+
* **core/1:** Bumped lab-env-core-1 ([6d706a9](https://bitbucket.org/fishawackdigital/lab-env/commits/6d706a95e09d75de8758a5b8703056ace009191e))
|
|
26
|
+
|
|
3
27
|
### 4.36.0 (2024-10-08)
|
|
4
28
|
|
|
5
29
|
#### Features
|
|
@@ -24,7 +24,12 @@ services:
|
|
|
24
24
|
ports:
|
|
25
25
|
- "${PORT_WEB:-8000}:80"
|
|
26
26
|
node:
|
|
27
|
-
|
|
27
|
+
build:
|
|
28
|
+
context: $FW_ADONIS_0_NODE_CONTEXT
|
|
29
|
+
args:
|
|
30
|
+
version: 20.6
|
|
31
|
+
image: node
|
|
32
|
+
image: ${FW_ADONIS_0_NODE_IMAGE:-node}:${FW_ADONIS_0_NODE_VERSION:-20.6}
|
|
28
33
|
working_dir: /app
|
|
29
34
|
restart: always
|
|
30
35
|
networks:
|
|
@@ -85,7 +85,7 @@ module.exports = [
|
|
|
85
85
|
credentials[user] = {};
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
-
let res = await aws.iam.createFWIAMUser(`fw-automation-${user}`, client);
|
|
88
|
+
let res = await aws.iam.createFWIAMUser(`fw-automation-${user}`, client, _.config.users.find(d => d.username === user).permissions);
|
|
89
89
|
|
|
90
90
|
credentials[user][client] = {
|
|
91
91
|
key: res.AccessKey && res.AccessKey.AccessKeyId || res.AccessKeyMetadata[0].AccessKeyId,
|
|
@@ -24,10 +24,10 @@ module.exports.createIAMUser = async (UserName, account, tags = []) => {
|
|
|
24
24
|
return res;
|
|
25
25
|
};
|
|
26
26
|
|
|
27
|
-
module.exports.createFWIAMUser = async (UserName, account) => {
|
|
27
|
+
module.exports.createFWIAMUser = async (UserName, account, permissions) => {
|
|
28
28
|
await module.exports.createIAMUser(UserName, account);
|
|
29
29
|
|
|
30
|
-
await module.exports.syncFWIAMPolicies(UserName, account);
|
|
30
|
+
await module.exports.syncFWIAMPolicies(UserName, account, permissions);
|
|
31
31
|
|
|
32
32
|
let res = await module.exports.createAccessKeySafe(UserName, account);
|
|
33
33
|
|
|
@@ -73,10 +73,20 @@ module.exports.attachIAMPolicy = async (UserName, account, policy) => {
|
|
|
73
73
|
return res;
|
|
74
74
|
};
|
|
75
75
|
|
|
76
|
-
module.exports.syncFWIAMPolicies = async (UserName, account) => {
|
|
76
|
+
module.exports.syncFWIAMPolicies = async (UserName, account, permissions = ["auto-content", "deploy-static"]) => {
|
|
77
77
|
await module.exports.removeAllIAMPolicies(UserName, account);
|
|
78
|
-
|
|
79
|
-
|
|
78
|
+
|
|
79
|
+
if(permissions.includes("auto-content") || permissions.includes("deploy-static")){
|
|
80
|
+
await module.exports.attachIAMPolicy(UserName, account, 'arn:aws:iam::aws:policy/AmazonS3FullAccess');
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
if(permissions.includes("deploy-static")){
|
|
84
|
+
await module.exports.attachIAMPolicy(UserName, account, 'arn:aws:iam::aws:policy/CloudFrontFullAccess');
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
if(permissions.includes("deploy-fullstack")){
|
|
88
|
+
await module.exports.attachIAMPolicy(UserName, account, 'arn:aws:iam::aws:policy/AdministratorAccess-AWSElasticBeanstalk');
|
|
89
|
+
}
|
|
80
90
|
};
|
|
81
91
|
|
|
82
92
|
module.exports.removeIAMPolicy = async (UserName, account, policy) => {
|
package/core/1/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
## Changelog
|
|
2
2
|
|
|
3
|
+
### 1.6.0 (2024-10-22)
|
|
4
|
+
|
|
5
|
+
#### Features
|
|
6
|
+
|
|
7
|
+
* own global node_modules folder so local modules can be linked ([82f84fa](https://bitbucket.org/fishawackdigital/lab-env-core-1/commits/82f84faa5dfa7c009458bec4fe3a9f2b437c34bf))
|
|
8
|
+
|
|
3
9
|
### 1.5.2 (2024-10-08)
|
|
4
10
|
|
|
5
11
|
#### Bug Fixes
|
package/core/1/entrypoint.sh
CHANGED
|
@@ -8,6 +8,9 @@ if [ -z "$FW_ROOT" ]; then
|
|
|
8
8
|
# Own the node_modules folder otherwise it'll be owned by root/previous node id which will prevent writing
|
|
9
9
|
chown node /app/node_modules
|
|
10
10
|
|
|
11
|
+
# Own the global node_modules folder otherwise it'll be owned by root/previous node id which will prevent writing
|
|
12
|
+
chown node /usr/local/lib/node_modules
|
|
13
|
+
|
|
11
14
|
# Default arguments will always be bash -l, if nothing follows this just start an non login interactive shell
|
|
12
15
|
if [ -z "${@:3}" ]; then
|
|
13
16
|
exec su node
|
package/core/1/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"description": "lab-env docker config for the @fishawack/core/1 npm module",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"image": "docker buildx build --ssh default --platform linux/amd64,linux/arm64 -t fishawack/lab-env-core-1:$npm_package_version -t fishawack/lab-env-core-1:latest --push . && docker buildx build --ssh default --target alpine --platform linux/amd64,linux/arm64 -t fishawack/lab-env-core-1-alpine:$npm_package_version -t fishawack/lab-env-core-1-alpine:latest --push ."
|
package/globals.js
CHANGED
|
@@ -153,6 +153,7 @@ process.env.FW_CORE_1_IMAGE = process.env.FW_CORE_1_IMAGE || `fishawack/lab-env-
|
|
|
153
153
|
|
|
154
154
|
process.env.FW_LARAVEL_8_NGINX_IMAGE = process.env.FW_LARAVEL_8_NGINX_IMAGE || `fishawack/lab-env-laravel-8-nginx`;
|
|
155
155
|
process.env.FW_ADONIS_0_NGINX_IMAGE = process.env.FW_ADONIS_0_NGINX_IMAGE || `fishawack/lab-env-adonis-0-nginx`;
|
|
156
|
+
process.env.FW_ADONIS_0_NODE_IMAGE = process.env.FW_ADONIS_0_NODE_IMAGE || ``;
|
|
156
157
|
|
|
157
158
|
var core = `-f ${__dirname}/core/${process.env.VERSION}/docker-compose.yml`;
|
|
158
159
|
|
|
@@ -170,6 +171,7 @@ process.env.FW_WORDPRESS_0_VERSION = process.env.FW_WORDPRESS_0_VERSION || requi
|
|
|
170
171
|
process.env.FW_WORDPRESS_1_PHP_VERSION = process.env.FW_WORDPRESS_1_PHP_VERSION || require('./wordpress/1/php/package.json').version;
|
|
171
172
|
process.env.FW_WORDPRESS_1_APACHE_VERSION = process.env.FW_WORDPRESS_1_APACHE_VERSION || require('./wordpress/1/apache/package.json').version;
|
|
172
173
|
process.env.FW_ADONIS_0_NGINX_VERSION = process.env.FW_ADONIS_0_NGINX_VERSION || require('./adonis/0/nginx/package.json').version;
|
|
174
|
+
process.env.FW_ADONIS_0_NODE_VERSION = process.env.FW_ADONIS_0_NODE_VERSION || '';
|
|
173
175
|
|
|
174
176
|
// Map docker contexts
|
|
175
177
|
process.env.FW_CORE_1_CONTEXT = process.env.FW_CORE_1_CONTEXT || `${__dirname}/core/1/`;
|
|
@@ -189,28 +191,52 @@ if(existsSync(path.join(contextOverride, 'Dockerfile'))){
|
|
|
189
191
|
process.env.FW_LARAVEL_8_NGINX_VERSION = require(`${contextOverride}/package.json`).version;
|
|
190
192
|
}
|
|
191
193
|
|
|
194
|
+
// ADONIS
|
|
192
195
|
process.env.FW_ADONIS_0_NGINX_CONTEXT = process.env.FW_ADONIS_0_NGINX_CONTEXT || `${__dirname}/adonis/0/nginx/`;
|
|
193
196
|
|
|
197
|
+
contextOverride = path.join(cwd, '_Docker/adonis/0/nginx');
|
|
198
|
+
if(existsSync(path.join(contextOverride, 'Dockerfile'))){
|
|
199
|
+
process.env.FW_ADONIS_0_NGINX_CONTEXT = contextOverride;
|
|
200
|
+
process.env.FW_ADONIS_0_NGINX_IMAGE += `-${repo_safe}`;
|
|
201
|
+
process.env.FW_ADONIS_0_NGINX_VERSION = require(`${contextOverride}/package.json`).version;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
process.env.FW_ADONIS_0_NODE_CONTEXT = process.env.FW_ADONIS_0_NODE_CONTEXT || ``;
|
|
205
|
+
|
|
206
|
+
contextOverride = path.join(cwd, '_Docker/adonis/0/node');
|
|
207
|
+
if(existsSync(path.join(contextOverride, 'Dockerfile'))){
|
|
208
|
+
process.env.FW_ADONIS_0_NODE_CONTEXT = contextOverride;
|
|
209
|
+
process.env.FW_ADONIS_0_NODE_IMAGE = `fishawack/lab-env-adonis-0-node-${repo_safe}`;
|
|
210
|
+
process.env.FW_ADONIS_0_NODE_VERSION = require(`${contextOverride}/package.json`).version;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
// Copy env.example if .env doesnt exist
|
|
194
214
|
if(existsSync(path.join(cwd, '.env.example')) && !existsSync(path.join(cwd, '.env'))){
|
|
195
215
|
copyFileSync(path.join(cwd, '.env.example'), path.join(cwd, '.env'));
|
|
196
216
|
}
|
|
197
217
|
|
|
218
|
+
// If docker-compose.yml exists in project _Docker folder append to end
|
|
219
|
+
let localOverride = '';
|
|
220
|
+
if(existsSync(path.join(cwd, '_Docker/docker-compose.yml'))){
|
|
221
|
+
localOverride = `-f ${path.join(cwd, '_Docker/docker-compose.yml')}`;
|
|
222
|
+
}
|
|
223
|
+
|
|
198
224
|
if(platform === 'laravel'){
|
|
199
225
|
let container = `-f ${__dirname}/laravel/${process.env.VERSION_LARAVEL}/docker-compose.yml`;
|
|
200
226
|
|
|
201
|
-
docker = `docker compose --env-file ${path.join(cwd, '.env')} ${container} ${core} -p ${repo_safe}`;
|
|
227
|
+
docker = `docker compose --env-file ${path.join(cwd, '.env')} ${container} ${core} ${localOverride} -p ${repo_safe}`;
|
|
202
228
|
} else if(platform === 'wordpress'){
|
|
203
|
-
docker = `docker compose --env-file ${path.join(cwd, '.env')} -f ${__dirname}/wordpress/${process.env.VERSION_WORDPRESS}/docker-compose.yml ${core} -p ${repo_safe}`;
|
|
229
|
+
docker = `docker compose --env-file ${path.join(cwd, '.env')} -f ${__dirname}/wordpress/${process.env.VERSION_WORDPRESS}/docker-compose.yml ${core} ${localOverride} -p ${repo_safe}`;
|
|
204
230
|
} else if(platform === "drupal"){
|
|
205
231
|
let container = `-f ${__dirname}/drupal/9/docker-compose.yml`;
|
|
206
232
|
|
|
207
|
-
docker = `docker compose --env-file ${path.join(cwd, '.env')} ${container} ${core} -p ${repo_safe}`;
|
|
233
|
+
docker = `docker compose --env-file ${path.join(cwd, '.env')} ${container} ${core} ${localOverride} -p ${repo_safe}`;
|
|
208
234
|
} else if(platform === "craftcms"){
|
|
209
|
-
docker = `docker compose --env-file ${path.join(cwd, '.env')} -f ${__dirname}/craftcms/3/docker-compose.yml ${core} -p ${repo_safe}`;
|
|
235
|
+
docker = `docker compose --env-file ${path.join(cwd, '.env')} -f ${__dirname}/craftcms/3/docker-compose.yml ${core} ${localOverride} -p ${repo_safe}`;
|
|
210
236
|
} else if(platform === "adonis"){
|
|
211
|
-
docker = `docker compose --env-file ${path.join(cwd, '.env')} -f ${__dirname}/adonis/0/docker-compose.yml ${core} -p ${repo_safe}`;
|
|
237
|
+
docker = `docker compose --env-file ${path.join(cwd, '.env')} -f ${__dirname}/adonis/0/docker-compose.yml ${core} ${localOverride} -p ${repo_safe}`;
|
|
212
238
|
} else {
|
|
213
|
-
docker = `docker compose ${core} -p ${repo_safe}`;
|
|
239
|
+
docker = `docker compose ${core} ${localOverride} -p ${repo_safe}`;
|
|
214
240
|
}
|
|
215
241
|
|
|
216
242
|
try{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fishawack/lab-env",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.38.0",
|
|
4
4
|
"description": "Docker manager for FW",
|
|
5
5
|
"main": "cli.js",
|
|
6
6
|
"scripts": {
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"glob": "7.1.7",
|
|
36
36
|
"inquirer": "8.1.2",
|
|
37
37
|
"lodash": "^4.17.21",
|
|
38
|
-
"nodemailer": "^6.
|
|
38
|
+
"nodemailer": "^6.9.15",
|
|
39
39
|
"ora": "5.4.1",
|
|
40
40
|
"semver": "7.3.4",
|
|
41
41
|
"update-notifier": "^6.0.2",
|