code.gitea.io/gitea@v1.19.3/modules/setting/camo.go (about)

     1  // Copyright 2023 The Gitea Authors. All rights reserved.
     2  // SPDX-License-Identifier: MIT
     3  
     4  package setting
     5  
     6  import "code.gitea.io/gitea/modules/log"
     7  
     8  var Camo = struct {
     9  	Enabled   bool
    10  	ServerURL string `ini:"SERVER_URL"`
    11  	HMACKey   string `ini:"HMAC_KEY"`
    12  	Allways   bool
    13  }{}
    14  
    15  func loadCamoFrom(rootCfg ConfigProvider) {
    16  	mustMapSetting(rootCfg, "camo", &Camo)
    17  	if Camo.Enabled {
    18  		if Camo.ServerURL == "" || Camo.HMACKey == "" {
    19  			log.Fatal(`Camo settings require "SERVER_URL" and HMAC_KEY`)
    20  		}
    21  	}
    22  }