Skip to content

Commit

Permalink
make it better.
Browse files Browse the repository at this point in the history
  • Loading branch information
Qolzam committed Mar 21, 2020
1 parent b880007 commit 66d8d11
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 9 deletions.
4 changes: 2 additions & 2 deletions cmd/ofcc.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ func CheckInitStep(projectPath string) {
}

func CheckIngredient(projectPath string, githubUsername string) {
helpURL := "https://github.com/Qolzam/telar-cli/blob/master/docs/ofcc-setup/1.md"
helpURL := "https://github.com/Qolzam/telar-cli/blob/master/docs/ofcc-setup/2.md"
echoInput("loadingCheckIngredients", true)

// Check kubeseal
Expand Down Expand Up @@ -306,7 +306,7 @@ func starteploy(clientInput ClientInputs) {
URL: fmt.Sprintf("https://%s.o6s.io", clientInput.GithubUsername),
WebsocketURL: clientInput.WebsocketURL,
MongoDBHost: clientInput.MongoDBHost,
MongoDatabase: clientInput.MongoDBHost,
MongoDatabase: clientInput.MongoDBName,
RecaptchaSiteKey: clientInput.SiteKeyRecaptcha,
RefEmail: clientInput.Gmail,
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/secret.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func createSecretFile(pathWD, name string, telarSecrets *TelarSecrets) error {
args["redis-pwd"] = telarSecrets.RedisPwd
args["admin-username"] = telarSecrets.AdminUsername
args["admin-password"] = telarSecrets.AdminPwd
args["payload-secret"] = telarSecrets.RecaptchaKey
args["payload-secret"] = telarSecrets.PayloadSecret
args["ref-email-pass"] = telarSecrets.RefEmailPwd
args["phone-auth-token"] = telarSecrets.PhoneAuthToken
args["phone-auth-id"] = telarSecrets.PhoneAuthId
Expand Down
10 changes: 6 additions & 4 deletions cmd/stack.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"fmt"
"io/ioutil"
"path"
"strings"

"github.com/jinzhu/copier"
stack "github.com/openfaas/faas-cli/stack"
Expand Down Expand Up @@ -39,14 +40,14 @@ func applyConfig(telarConfig TelarConfig) error {
fmt.Printf("\n[INFO] Applied auth config successfully %s", telarWebRepoPath)

fmt.Printf("\n[INFO] Applying storage config %s", telarWebRepoPath)
err = applyStorageConfig(telarWebRepoPath, telarConfig.ClientID)
err = applyStorageConfig(telarWebRepoPath, telarConfig.Bucket)
if isError(err) {
return err
}
fmt.Printf("\n[INFO] Applied storage config successfully %s", telarWebRepoPath)

fmt.Printf("\n[INFO] Applying ts-ui config %s", telarConfig.PathWD)
err = applyTSUIConfig(telarConfig.PathWD, telarConfig.WebsocketURL)
err = applyTSUIConfig(telarConfig.PathWD, telarConfig.WebsocketURL, telarConfig.URL)
if isError(err) {
return err
}
Expand All @@ -68,7 +69,7 @@ func applyAppConfig(repoPath, mongoDBHost, mongoDatabase, recaptchaSiteKey, refE
return err
}

envs["mongo_user"] = mongoDBHost
envs["mongo_host"] = strings.Replace(mongoDBHost, "<password>", "%s", -1)
envs["mongo_database"] = mongoDatabase
envs["recaptcha_site_key"] = recaptchaSiteKey
envs["ref_email"] = refEmail
Expand Down Expand Up @@ -195,7 +196,7 @@ func createStack(pathWD string) error {
return nil
}

func applyTSUIConfig(pathWD string, websocketURL string) error {
func applyTSUIConfig(pathWD, websocketURL, gateway string) error {
filePath := path.Join(pathWD, "ts-ui/stack.yml")
stackFile, err := stack.ParseYAMLFile(filePath, "", "", false)
if err != nil {
Expand All @@ -206,6 +207,7 @@ func applyTSUIConfig(pathWD string, websocketURL string) error {
if name == "web" {
envs := make(map[string]string)
envs["websocket_url"] = websocketURL
envs["gateway_url"] = gateway
//combine all environment variables
allEnvironment, envErr := compileEnvironment([]string{}, function.Environment, envs)
if envErr != nil {
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ require (
github.com/gobuffalo/packr v1.30.1
github.com/gorilla/websocket v1.4.1
github.com/jinzhu/copier v0.0.0-20190924061706-b57f9002281a
github.com/karalabe/xgo v0.0.0-20191115072854-c5ccff8648a7 // indirect
github.com/openfaas/faas v0.0.0-20200308203816-1eea381dd5b8 // indirect
github.com/openfaas/faas-cli v0.0.0-20200226083118-b0a70a3f4f20
github.com/openfaas/faas-provider v0.15.0 // indirect
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqx
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
github.com/jstemmer/go-junit-report v0.9.1 h1:6QPYqodiu3GuPL+7mfx+NwDdp2eTkp9IfEUpgAwUN0o=
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
github.com/karalabe/xgo v0.0.0-20191115072854-c5ccff8648a7 h1:AYzjK/SHz6m6mg5iuFwkrAhCc14jvCpW9d6frC9iDPE=
github.com/karalabe/xgo v0.0.0-20191115072854-c5ccff8648a7/go.mod h1:iYGcTYIPUvEWhFo6aKUuLchs+AV4ssYdyuBbQJZGcBk=
github.com/karrick/godirwalk v1.8.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaRPx4tDPEn4=
github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA=
github.com/karrick/godirwalk v1.10.12/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA=
Expand Down
Binary file modified telar-cli
Binary file not shown.
2 changes: 1 addition & 1 deletion ui/src/components/GoogleReCaptcha/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export default function GoogleReCaptcha() {
<br />
<br />
<Typography className={classes.title} color="textPrimary" gutterBottom>
Enter your valid site key and reCaptcha key
Enter your valid Google reCaptcha site key and secret key
</Typography>
<TextField
required
Expand Down
2 changes: 1 addition & 1 deletion ui/src/components/StepDone/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default function StepDone() {
<Typography gutterBottom variant="h5" component="h2">
Done
</Typography>
<Typography variant="body2" color="textSecondary" component="p">
<Typography variant="body2" color="textSecondary">
Wait until the build and deployment is done. To start login into admin page {`https://${githubUsername}.o6s.io/admin/login`}. Wait until you seen welcome page.
Now your Telar social is ready to use!😍🏆
- Signup page: {`https://${githubUsername}.o6s.io/auth/signup`}
Expand Down

0 comments on commit 66d8d11

Please sign in to comment.