v1.10.88 품질·보안 개선과 미디어 카탈로그 database 전환을 반영한다.
세션·로그인 제한, ZIP/업로드 스트리밍, CSP 최소 강제와 Report-Only, Playwright 격리 검증을 추가하고 미디어 목록을 reconcile 후 database 모드로 고정한다. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -49,6 +49,11 @@ const envValues = readEnvFile()
|
||||
const databaseName = process.env.POSTGRES_DB || envValues.POSTGRES_DB || 'sori_studio'
|
||||
const databaseUser = process.env.POSTGRES_USER || envValues.POSTGRES_USER || 'sori_studio'
|
||||
|
||||
if (migrationEnvironment === 'test' && !databaseName.endsWith('_test')) {
|
||||
console.error(`테스트 DB 이름은 _test로 끝나야 합니다: ${databaseName}`)
|
||||
process.exit(1)
|
||||
}
|
||||
|
||||
/**
|
||||
* SQL 문자열 리터럴 이스케이프
|
||||
* @param {string} value - SQL 문자열 값
|
||||
@@ -96,7 +101,11 @@ const runCommand = (command, args, options = {}) => {
|
||||
* @param {string[]} args - compose 하위 명령 인자
|
||||
* @returns {string[]} 전체 docker compose 인자
|
||||
*/
|
||||
const getComposeArgs = (args) => ['compose', '--env-file', envFile, ...args]
|
||||
const getComposeArgs = (args) => [
|
||||
'compose',
|
||||
...(existsSync(join(rootDir, envFile)) ? ['--env-file', envFile] : []),
|
||||
...args
|
||||
]
|
||||
|
||||
/**
|
||||
* psql 실행 인자 생성
|
||||
@@ -234,8 +243,14 @@ const getAppliedMigrationFiles = () => {
|
||||
* @returns {void}
|
||||
*/
|
||||
const runMigrationFile = (fileName) => {
|
||||
runCommand('docker', getPsqlArgs(['-f', `${containerMigrationsDir}/${fileName}`]))
|
||||
runSql(`INSERT INTO ${schemaMigrationsTable} (file_name) VALUES ('${escapeSqlLiteral(fileName)}') ON CONFLICT (file_name) DO NOTHING;`)
|
||||
const recordSql = `INSERT INTO ${schemaMigrationsTable} (file_name) VALUES ('${escapeSqlLiteral(fileName)}') ON CONFLICT (file_name) DO NOTHING;`
|
||||
runCommand('docker', getPsqlArgs([
|
||||
'--single-transaction',
|
||||
'-f',
|
||||
`${containerMigrationsDir}/${fileName}`,
|
||||
'-c',
|
||||
recordSql
|
||||
]))
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user