Compare commits
No commits in common. "4bf318a9c26bdbd91982c134cb4962c593f194cc" and "98b871a5eda718195abc087aa8cd8b9cc4a81441" have entirely different histories.
4bf318a9c2
...
98b871a5ed
@ -15,13 +15,12 @@ type DB struct {
|
|||||||
|
|
||||||
func NewDB(cfg *config.Config) (*DB, error) {
|
func NewDB(cfg *config.Config) (*DB, error) {
|
||||||
dsn := fmt.Sprintf(
|
dsn := fmt.Sprintf(
|
||||||
"host=%s user=%s password=%s dbname=%s port=%v sslmode=%s",
|
"host=%s user=%s password=%s dbname=%s port=%v sslmode=disable",
|
||||||
cfg.Database.Host,
|
cfg.Database.Host,
|
||||||
cfg.Database.Username,
|
cfg.Database.Username,
|
||||||
cfg.Database.Password,
|
cfg.Database.Password,
|
||||||
cfg.Database.DB,
|
cfg.Database.DB,
|
||||||
cfg.Database.Port,
|
cfg.Database.Port,
|
||||||
cfg.Database.SslMode,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
if dsn == "" {
|
if dsn == "" {
|
||||||
|
|||||||
43
env/debug.yaml
vendored
43
env/debug.yaml
vendored
@ -1,43 +0,0 @@
|
|||||||
server:
|
|
||||||
base-url: https://api.legalgo.id/core
|
|
||||||
local-url: http://localhost:3300
|
|
||||||
port: 3300
|
|
||||||
|
|
||||||
jwt:
|
|
||||||
token:
|
|
||||||
expires-ttl: 1440
|
|
||||||
secret: "5Lm25V3Qd7aut8dr4QUxm5PZUrSFs"
|
|
||||||
|
|
||||||
postgresql:
|
|
||||||
host: dpg-d046h549c44c739arfv0-a.singapore-postgres.render.com
|
|
||||||
port: 5432
|
|
||||||
driver: postgres
|
|
||||||
db: legalgonews_prod
|
|
||||||
username: legalgo_admin
|
|
||||||
password: "656ogwc0JlLEVQyHnT5RrrYa7762iBQQ"
|
|
||||||
ssl-mode: require
|
|
||||||
max-idle-connections-in-second: 600
|
|
||||||
max-open-connections-in-second: 600
|
|
||||||
connection-max-life-time-in-second: 600
|
|
||||||
debug: false
|
|
||||||
|
|
||||||
oss:
|
|
||||||
access_key_id: GTK7i3SVy9llQeGH0Htv
|
|
||||||
access_key_secret: 2psmKXZFpevA9n5ntSDRMqFBpZuSz32dvtXjYclf
|
|
||||||
endpoint: news-cdn.legalgo.id
|
|
||||||
bucket_name: uploads
|
|
||||||
log_level: Error
|
|
||||||
host_url: https://news-cdn.legalgo.id
|
|
||||||
public_url: https://news-cdn.legalgo.id
|
|
||||||
|
|
||||||
redis:
|
|
||||||
host: singapore-keyvalue.render.com
|
|
||||||
port: 6379
|
|
||||||
username: red-d046l42dbo4c73ea9iag
|
|
||||||
password: 7cZvu08JKuO9MPNxBb97tZCVNj0ZGNp2
|
|
||||||
db: 5
|
|
||||||
ssl: false
|
|
||||||
max-idle-connections-in-second: 600
|
|
||||||
max-open-connections-in-second: 600
|
|
||||||
connection-max-life-time-in-second: 600
|
|
||||||
debug: false
|
|
||||||
42
env/production.yaml
vendored
42
env/production.yaml
vendored
@ -1,42 +0,0 @@
|
|||||||
server:
|
|
||||||
base-url: https://api.legalgo.id/core
|
|
||||||
local-url: http://localhost:3300
|
|
||||||
port: 3300
|
|
||||||
|
|
||||||
jwt:
|
|
||||||
token:
|
|
||||||
expires-ttl: 1440
|
|
||||||
secret: "5Lm25V3Qd7aut8dr4QUxm5PZUrSFs"
|
|
||||||
|
|
||||||
postgresql:
|
|
||||||
host: dpg-d046h549c44c739arfv0-a
|
|
||||||
port: 5432
|
|
||||||
driver: postgres
|
|
||||||
db: legalgonews_prod
|
|
||||||
username: legalgo_admin
|
|
||||||
password: "656ogwc0JlLEVQyHnT5RrrYa7762iBQQ"
|
|
||||||
ssl-mode: disable
|
|
||||||
max-idle-connections-in-second: 600
|
|
||||||
max-open-connections-in-second: 600
|
|
||||||
connection-max-life-time-in-second: 600
|
|
||||||
debug: false
|
|
||||||
|
|
||||||
oss:
|
|
||||||
access_key_id: GTK7i3SVy9llQeGH0Htv
|
|
||||||
access_key_secret: 2psmKXZFpevA9n5ntSDRMqFBpZuSz32dvtXjYclf
|
|
||||||
endpoint: news-cdn.legalgo.id
|
|
||||||
bucket_name: uploads
|
|
||||||
log_level: Error
|
|
||||||
host_url: https://news-cdn.legalgo.id
|
|
||||||
public_url: https://news-cdn.legalgo.id
|
|
||||||
|
|
||||||
redis:
|
|
||||||
host: red-d046l42dbo4c73ea9iag
|
|
||||||
port: 6379
|
|
||||||
password: 7cZvu08JKuO9MPNxBb97tZCVNj0ZGNp2
|
|
||||||
db: 5
|
|
||||||
ssl: false
|
|
||||||
max-idle-connections-in-second: 600
|
|
||||||
max-open-connections-in-second: 600
|
|
||||||
connection-max-life-time-in-second: 600
|
|
||||||
debug: false
|
|
||||||
43
env/staging.yaml
vendored
43
env/staging.yaml
vendored
@ -1,43 +0,0 @@
|
|||||||
server:
|
|
||||||
base-url: https://api.legalgo.id/core
|
|
||||||
local-url: http://localhost:3300
|
|
||||||
port: 3300
|
|
||||||
|
|
||||||
jwt:
|
|
||||||
token:
|
|
||||||
expires-ttl: 1440
|
|
||||||
secret: "5Lm25V3Qd7aut8dr4QUxm5PZUrSFs"
|
|
||||||
|
|
||||||
postgresql:
|
|
||||||
host: dpg-d04bi9juibrs73augcc0-a.singapore-postgres.render.com
|
|
||||||
port: 5432
|
|
||||||
driver: postgres
|
|
||||||
db: legalgonews_dev
|
|
||||||
username: legalgo_admin
|
|
||||||
password: "5h7DCBR1T8pug6AlbrHXqIDAr9o2vnky"
|
|
||||||
ssl-mode: require
|
|
||||||
max-idle-connections-in-second: 600
|
|
||||||
max-open-connections-in-second: 600
|
|
||||||
connection-max-life-time-in-second: 600
|
|
||||||
debug: false
|
|
||||||
|
|
||||||
oss:
|
|
||||||
access_key_id: GTK7i3SVy9llQeGH0Htv
|
|
||||||
access_key_secret: 2psmKXZFpevA9n5ntSDRMqFBpZuSz32dvtXjYclf
|
|
||||||
endpoint: news-cdn.legalgo.id
|
|
||||||
bucket_name: uploads-staging
|
|
||||||
log_level: Error
|
|
||||||
host_url: https://news-cdn.legalgo.id
|
|
||||||
public_url: https://news-cdn.legalgo.id
|
|
||||||
|
|
||||||
redis:
|
|
||||||
host: singapore-keyvalue.render.com
|
|
||||||
port: 6379
|
|
||||||
username: red-d04bhi49c44c739fk91g
|
|
||||||
password: KncWOoEiJXOSycCWBxMQECpWmYm76vew
|
|
||||||
db: 5
|
|
||||||
ssl: false
|
|
||||||
max-idle-connections-in-second: 600
|
|
||||||
max-open-connections-in-second: 600
|
|
||||||
connection-max-life-time-in-second: 600
|
|
||||||
debug: false
|
|
||||||
@ -66,7 +66,7 @@ func (r *OssRepositoryImpl) GetPublicURL(fileName string) string {
|
|||||||
if fileName == "" {
|
if fileName == "" {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
return fmt.Sprintf("%s/%s%s", r.cfg.GetPublicURL(), r.cfg.GetBucketName(), fileName)
|
return fmt.Sprintf("%s:%s%s", r.cfg.GetPublicURL(), r.cfg.GetBucketName(), fileName)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *OssRepositoryImpl) DeleteObject(ctx context.Context, fileName string) error {
|
func (r *OssRepositoryImpl) DeleteObject(ctx context.Context, fileName string) error {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user