@blitzbrowser/blitzbrowser 1.1.1 → 1.1.3
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/.github/workflows/cicd.yml +39 -0
- package/Dockerfile +3 -1
- package/README.md +116 -1
- package/dist/app.module.js +18 -15
- package/dist/app.module.js.map +1 -1
- package/dist/components/browser-instance.component.js +1 -1
- package/dist/components/browser-instance.component.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/docker-compose.yml +34 -15
- package/package.json +4 -4
- package/src/app.module.ts +20 -16
- package/src/components/browser-instance.component.ts +1 -1
package/docker-compose.yml
CHANGED
|
@@ -1,23 +1,42 @@
|
|
|
1
1
|
services:
|
|
2
|
-
s3:
|
|
3
|
-
image: minio/minio:RELEASE.2025-04-22T22-12-26Z
|
|
4
|
-
ports:
|
|
5
|
-
- "8001:9001"
|
|
6
|
-
- "8000:9000"
|
|
7
|
-
environment:
|
|
8
|
-
MINIO_ROOT_USER: admin
|
|
9
|
-
MINIO_ROOT_PASSWORD: admin123
|
|
10
|
-
command: server --console-address ":9001" /data
|
|
11
|
-
restart: always
|
|
12
2
|
blitzbrowser:
|
|
13
|
-
|
|
14
|
-
|
|
3
|
+
build:
|
|
4
|
+
context: .
|
|
5
|
+
dockerfile: Dockerfile
|
|
15
6
|
ports:
|
|
16
7
|
- "9999:9999"
|
|
17
8
|
environment:
|
|
18
9
|
S3_ENDPOINT: http://s3:9000
|
|
19
|
-
S3_ACCESS_KEY_ID:
|
|
20
|
-
S3_SECRET_ACCESS_KEY:
|
|
10
|
+
S3_ACCESS_KEY_ID: rustfsadmin
|
|
11
|
+
S3_SECRET_ACCESS_KEY: rustfsadmin
|
|
21
12
|
S3_USER_DATA_BUCKET: user-data
|
|
22
13
|
shm_size: "2gb"
|
|
23
|
-
restart: always
|
|
14
|
+
restart: always
|
|
15
|
+
s3:
|
|
16
|
+
image: rustfs/rustfs
|
|
17
|
+
ports:
|
|
18
|
+
- "9000:9000"
|
|
19
|
+
- "9001:9001"
|
|
20
|
+
environment:
|
|
21
|
+
RUSTFS_VOLUMES: /data
|
|
22
|
+
RUSTFS_ADDRESS: :9000
|
|
23
|
+
RUSTFS_ACCESS_KEY: rustfsadmin
|
|
24
|
+
RUSTFS_SECRET_KEY: rustfsadmin
|
|
25
|
+
RUSTFS_CONSOLE_ENABLE: true
|
|
26
|
+
restart: always
|
|
27
|
+
volumes:
|
|
28
|
+
- s3_data:/data
|
|
29
|
+
# RustFS volume permissions fixer service
|
|
30
|
+
volume-permission-helper:
|
|
31
|
+
image: alpine
|
|
32
|
+
volumes:
|
|
33
|
+
- s3_data:/data
|
|
34
|
+
command: >
|
|
35
|
+
sh -c "
|
|
36
|
+
chown -R 10001:10001 /data &&
|
|
37
|
+
echo 'Volume Permissions fixed' &&
|
|
38
|
+
exit 0
|
|
39
|
+
"
|
|
40
|
+
restart: "no"
|
|
41
|
+
volumes:
|
|
42
|
+
s3_data:
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blitzbrowser/blitzbrowser",
|
|
3
|
-
"version": "1.1.
|
|
4
|
-
"description": "Deploying, scaling and managing browsers
|
|
3
|
+
"version": "1.1.3",
|
|
4
|
+
"description": "Deploying, scaling and managing headful browsers in docker.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"@aws-sdk/client-s3": "^3.911.0",
|
|
9
|
-
"@blitzbrowser/tunnel": "2.0.
|
|
9
|
+
"@blitzbrowser/tunnel": "2.0.3",
|
|
10
10
|
"@nestjs/common": "^10.0.0",
|
|
11
11
|
"@nestjs/core": "^10.0.0",
|
|
12
12
|
"@nestjs/platform-express": "^10.0.0",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"testEnvironment": "node"
|
|
63
63
|
},
|
|
64
64
|
"scripts": {
|
|
65
|
-
"build": "rm -
|
|
65
|
+
"build": "rm -rf ./dist && nest build",
|
|
66
66
|
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
|
|
67
67
|
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix"
|
|
68
68
|
}
|
package/src/app.module.ts
CHANGED
|
@@ -6,6 +6,25 @@ import { BrowserPoolService } from './services/browser-pool.service';
|
|
|
6
6
|
import { TimezoneService } from './services/timezone.service';
|
|
7
7
|
import { CDPController } from './controllers/cdp.controller';
|
|
8
8
|
|
|
9
|
+
const USER_DATA_PROVIDERS = Object.keys(process.env).filter(k => k.startsWith('S3_')).length === 0 ? [] : [
|
|
10
|
+
{
|
|
11
|
+
provide: S3Client,
|
|
12
|
+
useFactory: async () => {
|
|
13
|
+
return new S3Client({
|
|
14
|
+
region: 'auto',
|
|
15
|
+
endpoint: process.env.S3_ENDPOINT,
|
|
16
|
+
credentials: {
|
|
17
|
+
accessKeyId: process.env.S3_ACCESS_KEY_ID,
|
|
18
|
+
secretAccessKey: process.env.S3_SECRET_ACCESS_KEY,
|
|
19
|
+
},
|
|
20
|
+
forcePathStyle: true,
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
|
|
25
|
+
UserDataService,
|
|
26
|
+
]
|
|
27
|
+
|
|
9
28
|
@Module({
|
|
10
29
|
imports: [],
|
|
11
30
|
controllers: [
|
|
@@ -13,22 +32,7 @@ import { CDPController } from './controllers/cdp.controller';
|
|
|
13
32
|
StatusController,
|
|
14
33
|
],
|
|
15
34
|
providers: [
|
|
16
|
-
|
|
17
|
-
provide: S3Client,
|
|
18
|
-
useFactory: async () => {
|
|
19
|
-
return new S3Client({
|
|
20
|
-
region: 'auto',
|
|
21
|
-
endpoint: process.env.S3_ENDPOINT,
|
|
22
|
-
credentials: {
|
|
23
|
-
accessKeyId: process.env.S3_ACCESS_KEY_ID,
|
|
24
|
-
secretAccessKey: process.env.S3_SECRET_ACCESS_KEY,
|
|
25
|
-
},
|
|
26
|
-
forcePathStyle: true,
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
|
|
31
|
-
UserDataService,
|
|
35
|
+
...USER_DATA_PROVIDERS,
|
|
32
36
|
BrowserPoolService,
|
|
33
37
|
TimezoneService
|
|
34
38
|
],
|
|
@@ -401,7 +401,7 @@ export class BrowserInstance extends EventEmitter<BrowserInstanceEvents> {
|
|
|
401
401
|
|
|
402
402
|
this.#browser_instance_process = spawn(
|
|
403
403
|
`tini`,
|
|
404
|
-
['-s', `--`, `node`,
|
|
404
|
+
['-s', `--`, `node`, `${__dirname}/../../dist/components/browser-instance.process.js`],
|
|
405
405
|
{
|
|
406
406
|
stdio: ['pipe', 'pipe', 'pipe', 'ipc'],
|
|
407
407
|
env: {
|