In order to mitigate against the brute force attacks against Gitlab accounts, we are moving to all edu-ID Logins. We would like to remind you to link your account with your edu-id. Login will be possible only by edu-ID after December 31, 2021. Here you can find the instructions for linking your account.

If you don't have a SWITCH edu-ID, you can create one with this guide here

kind regards

config.go 906 Bytes
Newer Older
Jürgen Enge's avatar
Jürgen Enge committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package main

import (
	"github.com/BurntSushi/toml"
	"log"
	"time"
)

type duration struct {
	Duration time.Duration
}

func (d *duration) UnmarshalText(text []byte) error {
	var err error
	d.Duration, err = time.ParseDuration(string(text))
	return err
}

type ConfigImageMagick struct {
	Identify string
	Convert  string
	Wsl      bool
	Timeout  duration
	Remap    string
	Colors   int
	Resize   string
}

type Config struct {
Jürgen Enge's avatar
Jürgen Enge committed
30
31
32
33
34
35
36
37
38
39
40
	Logfile         string
	Loglevel        string
	AccessLog       string
	CertPEM         string
	KeyPEM          string
	Addr            string
	HistogramPrefix string
	JwtKey          string
	JwtAlg          []string
	ImageMagick     ConfigImageMagick
	Colormap        map[string]string
Jürgen Enge's avatar
Jürgen Enge committed
41
42
43
44
45
46
47
48
49
50
}

func LoadConfig(filepath string) Config {
	var conf Config
	_, err := toml.DecodeFile(filepath, &conf)
	if err != nil {
		log.Fatalln("Error on loading config: ", err)
	}
	return conf
}