Format + documentation
This commit is contained in:
parent
a84ac778ad
commit
158eda06de
6 changed files with 31 additions and 27 deletions
|
@ -30,6 +30,15 @@ Guichet requires go 1.13 or later.
|
|||
To build Guichet, clone this repository outside of your `$GOPATH`.
|
||||
Then, run `make` in the root of the repo.
|
||||
|
||||
## Releasing Guichet
|
||||
|
||||
To build Guichet in a controlled environment, because you plan to release it for example, please use Nix.
|
||||
|
||||
```bash
|
||||
nix-build -A bin # build only the Go binary
|
||||
nix-build -A pkg # build the binary and add the ressources
|
||||
nix-build -A docker # build a docker container
|
||||
```
|
||||
|
||||
## Configuration of Guichet
|
||||
|
||||
|
|
18
default.nix
18
default.nix
|
@ -11,6 +11,7 @@ let
|
|||
})
|
||||
];
|
||||
};
|
||||
in rec {
|
||||
bin = pkgs.gomod.buildGoApplication {
|
||||
pname = "guichet-bin";
|
||||
version = "0.1.0";
|
||||
|
@ -26,23 +27,18 @@ let
|
|||
platforms = platforms.linux;
|
||||
};
|
||||
};
|
||||
in
|
||||
pkgs.stdenv.mkDerivation {
|
||||
pkg = pkgs.stdenv.mkDerivation {
|
||||
pname = "guichet";
|
||||
version = "0.1.0";
|
||||
src = ./.;
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/
|
||||
|
||||
cat > guichet <<EOF
|
||||
#!${pkgs.bash}/bin/bash
|
||||
cd $out
|
||||
${bin}/bin/guichet \$@
|
||||
EOF
|
||||
chmod +x guichet
|
||||
|
||||
cp guichet $out/guichet
|
||||
cp ${bin}/bin/guichet $out/guichet
|
||||
cp -r templates static $out/
|
||||
'';
|
||||
};
|
||||
/*docker = pkgs.xxx {
|
||||
|
||||
};*/
|
||||
}
|
||||
|
|
1
main.go
1
main.go
|
@ -101,7 +101,6 @@ func readConfig() ConfigFile {
|
|||
exPath := filepath.Dir(ex)
|
||||
config_file.Resources = append(config_file.Resources, exPath)
|
||||
}
|
||||
fmt.Println(config_file.Resources)
|
||||
|
||||
return config_file
|
||||
}
|
||||
|
|
|
@ -122,7 +122,7 @@ func handlePasswd(w http.ResponseWriter, r *http.Request) {
|
|||
data.NoMatchError = true
|
||||
} else {
|
||||
modify_request := ldap.NewModifyRequest(login.Info.DN, nil)
|
||||
pw, err := SSHAEncode(password);
|
||||
pw, err := SSHAEncode(password)
|
||||
if err == nil {
|
||||
modify_request.Replace("userpassword", []string{pw})
|
||||
err := login.conn.Modify(modify_request)
|
||||
|
|
Loading…
Reference in a new issue