<commit_before>package main

import (
	"os"
)

func parseConfig() error {
	defaults := map[string]string{
		"POSTGRES": "postgres://postgres:postgres@0.0.0.0/commento?sslmode=disable",

		"PORT":   "8080",
		"ORIGIN": "",

		"CDN_PREFIX": "",

		"SMTP_USERNAME":     "",
		"SMTP_PASSWORD":     "",
		"SMTP_HOST":         "",
		"SMTP_FROM_ADDRESS": "",

		"OAUTH_GOOGLE_KEY":    "",
		"OAUTH_GOOGLE_SECRET": "",
	}

	for key, value := range defaults {
		if os.Getenv(key) == "" {
			os.Setenv(key, value)
		}
	}

	// Mandatory config parameters
	for _, env := range []string{"POSTGRES", "PORT", "ORIGIN"} {
		if os.Getenv(env) == "" {
			logger.Fatalf("missing %s environment variable", env)
			return errorMissingConfig
		}
	}

	if os.Getenv("CDN_PREFIX") == "" {
		os.Setenv("CDN_PREFIX", os.Getenv("ORIGIN"))
	}

	return nil
}<commit_msg>config.go: use a COMMENTO_ prefix<commit_after>package main

import (
	"os"
)

func parseConfig() error {
	defaults := map[string]string{
		"POSTGRES": "postgres://postgres:postgres@0.0.0.0/commento?sslmode=disable",

		"PORT":   "8080",
		"ORIGIN": "",

		"CDN_PREFIX": "",

		"SMTP_USERNAME":     "",
		"SMTP_PASSWORD":     "",
		"SMTP_HOST":         "",
		"SMTP_FROM_ADDRESS": "",

		"OAUTH_GOOGLE_KEY":    "",
		"OAUTH_GOOGLE_SECRET": "",
	}

	for key, value := range defaults {
		if os.Getenv("COMMENTO_" + key) == "" {
			os.Setenv(key, value)
		} else {
			os.Setenv(key, os.Getenv("COMMENTO_" + key))
		}
	}

	// Mandatory config parameters
	for _, env := range []string{"POSTGRES", "PORT", "ORIGIN"} {
		if os.Getenv(env) == "" {
			logger.Fatalf("missing %s environment variable", env)
			return errorMissingConfig
		}
	}

	if os.Getenv("CDN_PREFIX") == "" {
		os.Setenv("CDN_PREFIX", os.Getenv("ORIGIN"))
	}

	return nil
}
{'fraction_non_alphanumeric': 0.19345741680767062, 'fraction_numerical': 0.009024252679075015, 'mean_word_length': 3.5721649484536084, 'pattern_counts': {'":': 20, '<': 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': '1818499', 'n_tokens_mistral': 767, 'n_tokens_neox': 702, 'n_words': 117}