<commit_before>package config

import (
	"flag"
	"os"
)

var (
	// Port of API server
	Port string

	// MongoURL url to connect to mongodb
	MongoURL string

	// DatabaseDriver backend db driver
	//DatabaseDriver string

	// DatabaseName is a name of database
	DatabaseName string

	// MountPathPrefix base mounted share path
	MountPathPrefix string

	// LogFileName path to logfile
	LogFileName string

	// LocalSecretKey secret key to authenticate local services
	LocalSecretKey string
)

func init() {
	loadConfigFile()

	flag.StringVar(&Port, "p", "4945", "Api port")
	flag.StringVar(&LogFileName, "l", "", "Path to log file (default: stdout)")
	flag.StringVar(&MongoURL, "m", "mongodb://127.0.0.1:27017/swanager", "Mongodb url")
	//flag.StringVar(&DatabaseDriver, "d", "mongo", "Database driver (default: mongo)")
	flag.StringVar(&DatabaseName, "db", "swanager", "Database name (default: swanager)")
	flag.StringVar(&MountPathPrefix, "share", "/home/da4nik/docker/data", "Mount point base path (default: /data)")
	flag.StringVar(&LocalSecretKey, "lsk", "", "Secret key to authenticate local services (default: none, won't be authenticated)")
	flag.Parse()

	Port = getEnvValue("SWANAGER_PORT", Port)
	LogFileName = getEnvValue("SWANAGER_LOG", LogFileName)
	MongoURL = getEnvValue("SWANAGER_MONGO_URL", MongoURL)
	//DatabaseDriver = getEnvValue("SWANAGER_DB_DRIVER", DatabaseDriver)
	DatabaseName = getEnvValue("SWANAGER_DB_NAME", DatabaseName)
	MountPathPrefix = getEnvValue("SWANAGER_PATH_PREFIX", MountPathPrefix)
	LocalSecretKey = getEnvValue("SWANAGER_LOCAL_SECRET_KEY", LocalSecretKey)
}

func getEnvValue(varName string, currentValue string) string {
	if os.Getenv(varName) != "" {
		return os.Getenv(varName)
	}
	return currentValue
}

func loadConfigFile() {
	// TODO: Read config from file
}<commit_msg>Base mount path reverted to normal<commit_after>package config

import (
	"flag"
	"os"
)

var (
	// Port of API server
	Port string

	// MongoURL url to connect to mongodb
	MongoURL string

	// DatabaseDriver backend db driver
	//DatabaseDriver string

	// DatabaseName is a name of database
	DatabaseName string

	// MountPathPrefix base mounted share path
	MountPathPrefix string

	// LogFileName path to logfile
	LogFileName string

	// LocalSecretKey secret key to authenticate local services
	LocalSecretKey string
)

func init() {
	loadConfigFile()

	flag.StringVar(&Port, "p", "4945", "Api port")
	flag.StringVar(&LogFileName, "l", "", "Path to log file (default: stdout)")
	flag.StringVar(&MongoURL, "m", "mongodb://127.0.0.1:27017/swanager", "Mongodb url")
	//flag.StringVar(&DatabaseDriver, "d", "mongo", "Database driver (default: mongo)")
	flag.StringVar(&DatabaseName, "db", "swanager", "Database name (default: swanager)")
	flag.StringVar(&MountPathPrefix, "share", "/data", "Mount point base path (default: /data)")
	flag.StringVar(&LocalSecretKey, "lsk", "", "Secret key to authenticate local services (default: none, won't be authenticated)")
	flag.Parse()

	Port = getEnvValue("SWANAGER_PORT", Port)
	LogFileName = getEnvValue("SWANAGER_LOG", LogFileName)
	MongoURL = getEnvValue("SWANAGER_MONGO_URL", MongoURL)
	//DatabaseDriver = getEnvValue("SWANAGER_DB_DRIVER", DatabaseDriver)
	DatabaseName = getEnvValue("SWANAGER_DB_NAME", DatabaseName)
	MountPathPrefix = getEnvValue("SWANAGER_PATH_PREFIX", MountPathPrefix)
	LocalSecretKey = getEnvValue("SWANAGER_LOCAL_SECRET_KEY", LocalSecretKey)
}

func getEnvValue(varName string, currentValue string) string {
	if os.Getenv(varName) != "" {
		return os.Getenv(varName)
	}
	return currentValue
}

func loadConfigFile() {
	// TODO: Read config from file
}
{'fraction_non_alphanumeric': 0.12410566868464502, 'fraction_numerical': 0.0085305448541552, 'mean_word_length': 5.5026833631484795, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '715855', 'n_tokens_mistral': 1246, 'n_tokens_neox': 1191, 'n_words': 313}