Skip to content
Snippets Groups Projects
Commit e917bc29 authored by Richer Maximilien's avatar Richer Maximilien
Browse files

Merge branch 'fix_register_user_gox' into 'master'

[c] Fix cross-compilation for register command

This is a hotfix and should be pushed against v0.0.2

See merge request !38
parents 66c4467d e6b8e52d
No related branches found
No related tags found
No related merge requests found
Pipeline #
......@@ -7,6 +7,8 @@ stages:
Unit tests:
stage: test
except:
- /^[0-9]+\./
tags:
- golang
- mongo # Require an available mongo service
......@@ -40,6 +42,8 @@ Unit tests:
Integration tests:
stage: test
except:
- /^[0-9]+\./
tags:
- golang
- mongo
......@@ -53,6 +57,8 @@ Integration tests:
Code lint:
stage: test
except:
- /^[0-9]+\./
allow_failure: True
tags:
- golang
......
......@@ -8,7 +8,6 @@ import (
osuser "os/user"
"strconv"
"strings"
"time"
"dfss/dfssc/user"
"golang.org/x/crypto/ssh/terminal"
......@@ -20,17 +19,17 @@ func registerUser() {
var country, mail, organization, unit, passphrase string
var bits int
name := "Jon Doe"
u, err := osuser.Current()
if err != nil {
fmt.Println("An error occurred : ", err.Error())
return
if err == nil {
name = u.Name
}
// Get all the necessary parameters
readStringParam("Mail", "", &mail)
readStringParam("Country", time.Now().Location().String(), &country)
readStringParam("Organization", u.Name, &organization)
readStringParam("Organizational unit", u.Name, &unit)
readStringParam("Country", "FR", &country)
readStringParam("Organization", name, &organization)
readStringParam("Organizational unit", name, &unit)
readIntParam("Length of the key (2048 or 4096)", "2048", &bits)
err = readPassword(&passphrase, true)
if err != nil {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment