new file structure & koneksi ke DB

This commit is contained in:
mario
2025-05-14 10:23:33 +07:00
parent 8289881df3
commit dd4451c2a8
18 changed files with 753 additions and 243 deletions

View File

@@ -40,11 +40,14 @@ type Config struct {
} `mapstructure:"shortlink"`
Database struct {
Host string `mapstructure:"host"`
Port int `mapstructure:"port"`
User string `mapstructure:"user"`
Password string `mapstructure:"password"`
Name string `mapstructure:"name"`
Host string `mapstructure:"host"`
Port int `mapstructure:"port"`
User string `mapstructure:"user"`
Password string `mapstructure:"password"`
Name string `mapstructure:"name"`
MaxOpenConns int `mapstructure:"max_open_conns"`
MaxIdleConns int `mapstructure:"max_idle_conns"`
ConnMaxLifetimeMins int `mapstructure:"conn_max_lifetime_mins"`
} `mapstructure:"database"`
AllowedOrigins []string `mapstructure:"allowed_origins"`

View File

@@ -17,7 +17,7 @@ auth:
jwt_secret: "vQ6PQqUyh7pBNOytClgN+Nw1XBq7F8Qo6VP3VwIqvHY=" # Change this in production!
access_token_expiry: 1440 # minutes (24 hours)
refresh_token_expiry: 168 # hours (7 days)
enable_database_auth: false # Set to true when ready to use database
enable_database_auth: true # Changed to true to use database
shortlink:
base_url: "http://localhost:3333" # The base URL for generated OHIF Auth shortlinks
@@ -27,9 +27,12 @@ shortlink:
database:
host: "localhost"
port: 3306
user: "dbuser"
password: "dbpassword" # Consider using environment variables for sensitive data
user: "root"
password: "alfandi102938" # Change this to your MariaDB password
name: "ohif_proxy"
max_open_conns: 10
max_idle_conns: 5
conn_max_lifetime_mins: 60
allowed_origins:
- "*" # For development; restrict this in production