diff --git a/cmd/main-api/config.yml-dev-example b/cmd/main-api/config.yml-dev-example new file mode 100644 index 00000000..75d7f0d2 --- /dev/null +++ b/cmd/main-api/config.yml-dev-example @@ -0,0 +1,59 @@ +appCfg: + fullName: SIMRS-X Main API + codeName: simrs-x-mapi + version: 0.1.0 + env: development + lang: en + +httpCfg: + host: 127.0.0.1 + port: 8000 + +loggerCfg: + hideTime: true + hideLevel: true + +langCfg: + active: en + path: ../../assets/language/id + fileName: data.json + +dbCfg: + dsn: host=localhost user=user password=password dbname=simrs-main port=5432 sslmode=disable TimeZone=Asia/Jakarta + maxOpenConns: 5 + maxIdleConns: 5 + maxIdleTime: 100 + +msCfg: + dsn: 127.0.0.1:6379 + +minioCfg: + endpoint: localhost:9000 + region: ap-southeast-1 + accessKey: admin + secretKey: 12341234 + useSsl: false + bucketName: + - patient + - encounter + +corsCfg: + allowedOrigin: + allowedMethod: + +satuSehatCfg: + host: localhost:8200 + +bpjsCfg: + baseUrl: + +syncUrlCfg: + enable: false + targetHost: + prefix: new-to-old + source: old-app + secretKey: new-world-order!! + +docsCfg: + path: ../../assets/docs/ + domain: redacted \ No newline at end of file diff --git a/cmd/main-api/config.yml-docker-example b/cmd/main-api/config.yml-docker-example new file mode 100644 index 00000000..c9a4d6df --- /dev/null +++ b/cmd/main-api/config.yml-docker-example @@ -0,0 +1,59 @@ +appCfg: + fullName: SIMRS-X Main API + codeName: simrs-x-main-api + version: 0.1.0 + env: development + lang: en + +httpCfg: + host: 0.0.0.0 + port: 8000 + +loggerCfg: + hideTime: true + hideLevel: true + +langCfg: + active: en + path: assets/language/id + fileName: data.json + +dbCfg: + dsn: host=simrs-x-main-db user=rssa password=Wh4t-A-Beautiful-D@y dbname=default port=5432 sslmode=disable TimeZone=Asia/Jakarta + maxOpenConns: 5 + maxIdleConns: 5 + maxIdleTime: 100 + +msCfg: + dsn: simrs-x-redis:6379 + +minioCfg: + endpoint: simrs-x-minio:9000 + region: ap-southeast-1 + accessKey: admin + secretKey: 12341234 + useSsl: false + bucketName: + - patient + - encounter + +corsCfg: + allowedOrigin: + allowedMethod: + +satuSehatCfg: + host: simrs-x-satusehat-api:8001 + +bpjsCfg: + baseUrl: simrs-x-bpjs-api:8002 + +syncConsumerUrlCfg: + enable: false + targetHost: http://simrs-x-sync-api:8009/ + prefix: new-to-old + source: old-app + secretKey: new-world-order!! + +docsCfg: + path: assets/docs/ + domain: simrs-x-main-api \ No newline at end of file diff --git a/cmd/main-api/config.yml-example b/cmd/main-api/config.yml-example deleted file mode 100644 index 7b70146f..00000000 --- a/cmd/main-api/config.yml-example +++ /dev/null @@ -1,77 +0,0 @@ -appCfg: - fullName: BPJS Bridge - codeName: simrs-vx - version: 0.1.0 - env: development - lang: en - -httpCfg: - host: - port: - -dbCfg: - dsn: - maxOpenConns: 5 - maxIdleConns: 5 - maxIdleTime: 100 - -multiDbCfg: - - dbs : - name: - dsn: - maxOpenConns: - maxIdleConns: - maxIdleTime: - - bpjs - name: bpjs - dsn: - maxOpenConns: - maxIdleConns: - maxIdleTime: - -loggerCfg: - hideTime: - hideLevel: - -msCfg: - dsn: - -langCfg: - active: - path: - fileName: - -minioCfg: - endpoint: - region: - accessKey: - secretKey: - useSsl: - bucketName: - - patient - -corsCfg: - allowedOrigin: - allowedMethod: - -satuSehatCfg: - host: localhost:8200 - -corsCfg: - allowedOrigins: - - http://example.com - allowedMethod: - -bpjsCfg: - baseUrl: - -syncUrlCfg: - enable: false - targetHost: - prefix: new-to-old - source: old-app - secretKey: new-world-order!! - -docsCfg: - path: ../../assets/docs/ - domain: redacted \ No newline at end of file diff --git a/cmd/sync-migration/atlas.hcl.example b/cmd/main-migration/atlas.hcl-dev-example similarity index 56% rename from cmd/sync-migration/atlas.hcl.example rename to cmd/main-migration/atlas.hcl-dev-example index 857d1352..577c3a6e 100644 --- a/cmd/sync-migration/atlas.hcl.example +++ b/cmd/main-migration/atlas.hcl-dev-example @@ -9,11 +9,11 @@ data "external_schema" "gorm" { env "gorm" { src = data.external_schema.gorm.url - dev = "" // dsn db to check the diff + dev = "postgresql://user:password@localhost:5432/simrs-dev?sslmode=disable" // dsn db to check the diff migration { dir = "file://migrations" } - url = "" // dsn db to apply + url = "postgresql://user:password@localhost:5432/simrs-main?sslmode=disable" // dsn db to apply format { migrate { diff = "{{ sql . \" \" }}" diff --git a/cmd/main-migration/atlas.hcl-docker-example b/cmd/main-migration/atlas.hcl-docker-example new file mode 100644 index 00000000..9f22e04b --- /dev/null +++ b/cmd/main-migration/atlas.hcl-docker-example @@ -0,0 +1,22 @@ +data "external_schema" "gorm" { + program = [ + "go", + "run", + "-mod=mod", + ".", + ] +} + +env "gorm" { + src = data.external_schema.gorm.url + dev = "postgresql://user:password@simrs-x-main-db:5432/dev?sslmode=disable" // dsn db to check the diff + migration { + dir = "file://migrations" + } + url = "postgresql://user:password@simrs-x-main-db:5432/default?sslmode=disable" // dsn db to apply + format { + migrate { + diff = "{{ sql . \" \" }}" + } + } +} diff --git a/cmd/sync-api/config.yml-example b/cmd/sync-api/config.yml-dev-example similarity index 55% rename from cmd/sync-api/config.yml-example rename to cmd/sync-api/config.yml-dev-example index 96e4a6d2..73e06584 100644 --- a/cmd/sync-api/config.yml-example +++ b/cmd/sync-api/config.yml-dev-example @@ -5,23 +5,9 @@ appCfg: env: development lang: en -dbCfg: - dsn: - maxOpenConns: 5 - maxIdleConns: 5 - maxIdleTime: 100 - -multiDbCfg: - dbs : - - name: simrs_sync - dsn: - maxOpenConns: 5 - maxIdleConns: 5 - maxIdleTime: 100 - httpCfg: host: 127.0.0.1 - port: 8002 + port: 8009 loggerCfg: hideTime: true @@ -32,6 +18,25 @@ langCfg: path: ../../assets/language/en fileName: data.json +dbCfg: + dsn: host=simrs-x-main-db user=user password=password dbname=simrs-sync port=5439 sslmode=disable TimeZone=Asia/Jakarta + maxOpenConns: 5 + maxIdleConns: 5 + maxIdleTime: 100 + +multiDbCfg: + dbs : + - name: simrs + dsn: postgres://simrs:rssajaya@10.10.123.249/simrs?sslmode=disable + maxOpenConns: 5 + maxIdleConns: 5 + maxIdleTime: 100 + - name: satu + dsn: postgres://postgres:satu_dev@10.10.123.199:5023/satu_db?sslmode=disable + maxOpenConns: 5 + maxIdleConns: 5 + maxIdleTime: 100 + corsCfg: allowedOrigin: allowedMethod: GET, POST, PUT, PATCH, DELETE, OPTIONS diff --git a/cmd/sync-api/config.yml-docker-example b/cmd/sync-api/config.yml-docker-example new file mode 100644 index 00000000..adfaaa12 --- /dev/null +++ b/cmd/sync-api/config.yml-docker-example @@ -0,0 +1,50 @@ +appCfg: + fullName: SIMRS Sync + codeName: simrs-sync + version: 0.1.0 + env: development + lang: en + +httpCfg: + host: 0.0.0.0 + port: 8009 + +loggerCfg: + hideTime: true + hideLevel: true + +langCfg: + active: en + path: assets/language/en + fileName: data.json + +dbCfg: + dsn: host=simrs-x-sync-db user=rssa password=Th3-N3xt-Level-C0d3 dbname=default port=5432 sslmode=disable TimeZone=Asia/Jakarta + maxOpenConns: 5 + maxIdleConns: 5 + maxIdleTime: 100 + +multiDbCfg: + dbs : + - name: simrs + dsn: postgres://simrs:rssajaya@10.10.123.249/simrs?sslmode=disable + maxOpenConns: 5 + maxIdleConns: 5 + maxIdleTime: 100 + - name: satu + dsn: postgres://postgres:satu_dev@10.10.123.199:5023/satu_db?sslmode=disable + maxOpenConns: 5 + maxIdleConns: 5 + maxIdleTime: 100 + +corsCfg: + allowedOrigin: + allowedMethod: GET, POST, PUT, PATCH, DELETE, OPTIONS + +syncPartnerCfg: + oldSource: + oldSecretKey: + oldHost: + newSource: + newSecretKey: + newHost: diff --git a/cmd/main-migration/atlas.hcl.example b/cmd/sync-migration/atlas.hcl-dev-example similarity index 57% rename from cmd/main-migration/atlas.hcl.example rename to cmd/sync-migration/atlas.hcl-dev-example index 3d02232d..acc93ae0 100644 --- a/cmd/main-migration/atlas.hcl.example +++ b/cmd/sync-migration/atlas.hcl-dev-example @@ -1,22 +1,22 @@ -data "external_schema" "gorm" { - program = [ - "go", - "run", - "-mod=mod", - ".", - ] -} - -env "gorm" { - src = data.external_schema.gorm.url - dev = "" // dsn db to check the diff - migration { - dir = "file://migrations" - } - url = "" // dsn db to apply - format { - migrate { - diff = "{{ sql . \" \" }}" - } - } +data "external_schema" "gorm" { + program = [ + "go", + "run", + "-mod=mod", + ".", + ] +} + +env "gorm" { + src = data.external_schema.gorm.url + dev = "postgresql://user:password@localhost:5439/dev?sslmode=disable" // dsn db to check the diff + migration { + dir = "file://migrations" + } + url = "postgresql://user:password@localhost:5439/simrs-sync?sslmode=disable" // dsn db to apply + format { + migrate { + diff = "{{ sql . \" \" }}" + } + } } \ No newline at end of file diff --git a/cmd/sync-migration/atlas.hcl-docker-example b/cmd/sync-migration/atlas.hcl-docker-example new file mode 100644 index 00000000..23dd1b13 --- /dev/null +++ b/cmd/sync-migration/atlas.hcl-docker-example @@ -0,0 +1,22 @@ +data "external_schema" "gorm" { + program = [ + "go", + "run", + "-mod=mod", + ".", + ] +} + +env "gorm" { + src = data.external_schema.gorm.url + dev = "postgresql://user:password@simrs-x-sync-db:5432/dev?sslmode=disable" // dsn db to check the diff + migration { + dir = "file://migrations" + } + url = "postgresql://user:password@simrs-x-sync-db:5432/default?sslmode=disable" // dsn db to apply + format { + migrate { + diff = "{{ sql . \" \" }}" + } + } +} \ No newline at end of file