HEAVY: migrate accounts and logs to service/repo architecture

This commit is contained in:
ari melody 2026-07-31 02:43:45 +01:00
parent 5c255fb34b
commit 49e14b5bc5
Signed by: ari
GPG key ID: CF99829C92678188
37 changed files with 1019 additions and 687 deletions

View file

@ -1,28 +1,28 @@
package controller
import (
"errors"
"fmt"
"os"
"strconv"
"errors"
"fmt"
"os"
"strconv"
"arimelody-web/model"
"arimelody-web/model/app"
"github.com/pelletier/go-toml/v2"
"github.com/pelletier/go-toml/v2"
)
func GetConfig() model.Config {
func GetConfig() app.Config {
configFile := os.Getenv("ARIMELODY_CONFIG")
if configFile == "" {
configFile = "config.toml"
}
config := model.Config{
config := app.Config{
BaseUrl: "https://arimelody.space",
Host: "0.0.0.0",
Port: 8080,
TrustedProxies: []string{ "127.0.0.1" },
DB: model.DBConfig{
DB: app.DBConfig{
Host: "127.0.0.1",
Port: 5432,
User: "arimelody",
@ -53,7 +53,7 @@ func GetConfig() model.Config {
return config
}
func handleConfigOverrides(config *model.Config) error {
func handleConfigOverrides(config *app.Config) error {
var err error
if env, has := os.LookupEnv("ARIMELODY_BASE_URL"); has { config.BaseUrl = env }