create-seamless 0.0.5 → 0.0.7

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.
Files changed (2) hide show
  1. package/index.js +35 -17
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -227,8 +227,6 @@ Review each subproject for its specific license before deploying to production.
227
227
  `;
228
228
 
229
229
  const GENERATED_DOCKER_COMPOSE = `
230
- version: "3.9"
231
-
232
230
  services:
233
231
  db:
234
232
  image: postgres:16
@@ -236,27 +234,36 @@ services:
236
234
  ports:
237
235
  - "5432:5432"
238
236
  environment:
239
- POSTGRES_USER: seamless
240
- POSTGRES_PASSWORD: seamless
241
- POSTGRES_DB: seamless
237
+ POSTGRES_USER: myuser
238
+ POSTGRES_PASSWORD: mypassword
239
+ POSTGRES_DB: postgres
242
240
  volumes:
243
241
  - pgdata:/var/lib/postgresql/data
242
+ - ./postgres_init:/docker-entrypoint-initdb.d
243
+ healthcheck:
244
+ test: ["CMD-SHELL", "pg_isready -U myuser -d postgres"]
245
+ interval: 5s
246
+ timeout: 5s
247
+ retries: 5
244
248
 
245
249
  auth:
246
250
  container_name: seamless-auth
247
- build: ./auth
251
+ build:
252
+ context: ./auth
253
+ dockerfile: Dockerfile.dev
248
254
  ports:
249
255
  - "${authPort}:${authPort}"
250
256
  env_file:
251
257
  - ./auth/.env
252
258
  environment:
253
- - DB_HOST: db
254
- - ISSUER=http://auth:${authPort}
259
+ DB_HOST: db
260
+ ISSUER: http://auth:${authPort}
255
261
  volumes:
256
262
  - ./auth:/app
257
263
  - /app/node_modules
258
264
  depends_on:
259
- - db
265
+ db:
266
+ condition: service_healthy
260
267
 
261
268
  api:
262
269
  container_name: seamless-api
@@ -266,13 +273,13 @@ services:
266
273
  env_file:
267
274
  - ./api/.env
268
275
  environment:
269
- - AUTH_SERVER_URL=http://auth:${authPort}
276
+ AUTH_SERVER_URL: http://auth:${authPort}
270
277
  volumes:
271
278
  - ./api:/app
272
279
  - /app/node_modules
273
280
  depends_on:
274
- - auth
275
- - db
281
+ db:
282
+ condition: service_healthy
276
283
 
277
284
  web:
278
285
  container_name: seamless-web
@@ -358,9 +365,10 @@ async function downloadRepo(repo, dest) {
358
365
  DEFAULT_ROLES: "user,betaUser",
359
366
  AVAILABLE_ROLES: "user,admin,betaUser,team",
360
367
 
368
+ DB_LOGGING: "false",
361
369
  DB_HOST: "localhost",
362
370
  DB_PORT: "5432",
363
- DB_NAME: "seamless-auth",
371
+ DB_NAME: "seamless_auth",
364
372
  DB_USER: "myuser",
365
373
  DB_PASSWORD: "mypassword",
366
374
 
@@ -374,7 +382,7 @@ async function downloadRepo(repo, dest) {
374
382
  JWKS_ACTIVE_KID: "dev-main",
375
383
 
376
384
  RPID: "localhost",
377
- ORIGINS: `http://localhost:${apiPort}`,
385
+ ORIGINS: `http://localhost:${webPort}`,
378
386
  });
379
387
  }
380
388
 
@@ -386,17 +394,17 @@ async function downloadRepo(repo, dest) {
386
394
 
387
395
  writeEnv(dir, {
388
396
  AUTH_SERVER_URL: `http://localhost:${authPort}`,
389
- APP_ORIGIN: `http://localhost:${webPort}`,
397
+ APP_ORIGIN: `http://localhost:${apiPort}`,
398
+ UI_ORIGIN: `http://localhost:${webPort}`,
390
399
  COOKIE_SIGNING_KEY: randomBytes(32).toString("hex"),
391
400
  API_SERVICE_TOKEN: API_SERVICE_TOKEN,
392
401
 
393
402
  DB_HOST: "localhost",
394
403
  DB_PORT: "5432",
395
- DB_NAME: "seamless-auth",
404
+ DB_NAME: "seamless_api",
396
405
  DB_USER: "myuser",
397
406
  DB_PASSWORD: "mypassword",
398
407
 
399
- DB_NAME: "seamless",
400
408
  SQL_LOGGING: "false",
401
409
  });
402
410
  }
@@ -427,6 +435,16 @@ async function downloadRepo(repo, dest) {
427
435
  );
428
436
  }
429
437
 
438
+ const pgDir = path.join(root, "postgres_init");
439
+ fs.mkdirSync(pgDir);
440
+ fs.writeFileSync(
441
+ path.join(pgDir, "init.sql"),
442
+ `
443
+ CREATE DATABASE seamless_auth;
444
+ CREATE DATABASE seamless_api;
445
+ `,
446
+ );
447
+
430
448
  console.log(`
431
449
  ╔════════════════════════════════════════╗
432
450
  ║ S E A M L E S S ║
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-seamless",
3
- "version": "0.0.5",
3
+ "version": "0.0.7",
4
4
  "description": "The starter script for Seamless Auth",
5
5
  "homepage": "https://github.com/fells-code/create-seamless#readme",
6
6
  "bugs": {