2023-07-21 06:23:03 +02:00
|
|
|
/*
|
|
|
|
Guichet provides a user-management system around an LDAP Directory
|
|
|
|
|
|
|
|
Oriniated with deuxfleurs.fr and advanced by resdigita.com
|
|
|
|
*/
|
2020-02-09 14:46:52 +01:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2020-02-09 15:01:20 +01:00
|
|
|
"crypto/rand"
|
2023-07-21 06:37:18 +02:00
|
|
|
// "crypto/tls"
|
2023-07-21 06:23:03 +02:00
|
|
|
|
|
|
|
// "encoding/json"
|
2020-02-09 16:46:26 +01:00
|
|
|
"flag"
|
2023-07-21 06:23:03 +02:00
|
|
|
// "fmt"
|
|
|
|
// "io/ioutil"
|
2020-02-09 16:46:26 +01:00
|
|
|
"log"
|
2023-07-21 06:23:03 +02:00
|
|
|
|
|
|
|
// "os"
|
2023-07-25 21:35:22 +02:00
|
|
|
// "strings"
|
2020-02-09 14:46:52 +01:00
|
|
|
|
2020-02-09 23:04:37 +01:00
|
|
|
"github.com/gorilla/sessions"
|
2020-02-09 14:46:52 +01:00
|
|
|
)
|
|
|
|
|
2020-02-09 15:44:18 +01:00
|
|
|
const SESSION_NAME = "guichet_session"
|
|
|
|
|
2020-02-09 16:46:26 +01:00
|
|
|
var store sessions.Store = nil
|
|
|
|
|
2020-02-09 14:46:52 +01:00
|
|
|
func main() {
|
2023-07-25 21:35:22 +02:00
|
|
|
|
2020-02-09 15:01:20 +01:00
|
|
|
flag.Parse()
|
2020-02-09 14:46:52 +01:00
|
|
|
|
2020-02-09 15:44:18 +01:00
|
|
|
config_file := readConfig()
|
|
|
|
config = &config_file
|
2020-02-10 15:26:02 +01:00
|
|
|
|
|
|
|
session_key := make([]byte, 32)
|
|
|
|
n, err := rand.Read(session_key)
|
|
|
|
if err != nil || n != 32 {
|
|
|
|
log.Fatal(err)
|
|
|
|
}
|
|
|
|
store = sessions.NewCookieStore(session_key)
|
2023-07-25 21:35:22 +02:00
|
|
|
_, err = makeGVRouter()
|
2020-02-09 14:46:52 +01:00
|
|
|
if err != nil {
|
|
|
|
log.Fatal("Cannot start http server: ", err)
|
|
|
|
}
|
|
|
|
}
|