Fixed password change bug

This commit is contained in:
frikky
2021-05-27 21:01:23 +02:00
parent 06b74cf4da
commit d920158cd6
11 changed files with 62 additions and 29 deletions
+3 -2
View File
@@ -46,8 +46,9 @@ SHUFFLE_BASE_IMAGE_TAG_SUFFIX="-0.8.60"
# Used for auto-cleanup of containers. REALLY important at scale.
SHUFFLE_CONTAINER_AUTO_CLEANUP=false
SHUFFLE_ELASTIC=true
SHUFFLE_OPENSEARCH_URL="http://shuffle-opensearch:9200"
SHUFFLE_OPENSEARCH_URL=http://shuffle-opensearch:9200
SHUFFLE_OPENSEARCH_USERNAME=""
SHUFFLE_OPENSEARCH_PASSWORD=""
SHUFFLE_ELASTIC="true"
SHUFFLE_OPENSEARCH_CERTIFICATE_FILE=""
+2 -2
View File
@@ -2,7 +2,7 @@ module shuffle
go 1.13
//replace github.com/frikky/shuffle-shared => ../../../../git/shuffle-shared
replace github.com/frikky/shuffle-shared => ../../../../git/shuffle-shared
//replace github.com/frikky/kin-openapi => ../../../../git/kin-openapi
@@ -24,7 +24,7 @@ require (
github.com/elastic/go-elasticsearch/v7 v7.12.0 // indirect
github.com/elastic/go-elasticsearch/v8 v8.0.0-20210519083322-55daf7425ecb // indirect
github.com/frikky/kin-openapi v0.39.0
github.com/frikky/shuffle-shared v0.0.50
github.com/frikky/shuffle-shared v0.0.51
github.com/fsouza/go-dockerclient v1.7.2 // indirect
github.com/ghodss/yaml v1.0.0
github.com/go-git/go-billy/v5 v5.0.0
+2
View File
@@ -159,6 +159,8 @@ github.com/frikky/shuffle-shared v0.0.49 h1:fChF0Nh/bMuXZg67Pt9XXn9+mH4IlKgB3dAz
github.com/frikky/shuffle-shared v0.0.49/go.mod h1:BknTfpun3qte5bumR3OqQHf9XWPIsyj8woiXCjIlbBc=
github.com/frikky/shuffle-shared v0.0.50 h1:dQIXf4mwUHuEVsXiMtZaSznz6vWt+C0KjyTAsAgMs3s=
github.com/frikky/shuffle-shared v0.0.50/go.mod h1:BknTfpun3qte5bumR3OqQHf9XWPIsyj8woiXCjIlbBc=
github.com/frikky/shuffle-shared v0.0.51 h1:JrCGoRNj/LkAvSlkyx7tLv7ToNtJDIAqKqiA/poO+G4=
github.com/frikky/shuffle-shared v0.0.51/go.mod h1:BknTfpun3qte5bumR3OqQHf9XWPIsyj8woiXCjIlbBc=
github.com/fsouza/go-dockerclient v1.7.2 h1:bBEAcqLTkpq205jooP5RVroUKiVEWgGecHyeZc4OFjo=
github.com/fsouza/go-dockerclient v1.7.2/go.mod h1:+ugtMCVRwnPfY7d8/baCzZ3uwB0BrG5DB8OzbtxaRz8=
github.com/getkin/kin-openapi v0.8.0 h1:a6TQjTqwkyscC4/hShJX7WhCVE+4bi9lzw61XHQW5hE=
+28 -9
View File
@@ -15,6 +15,7 @@ import (
"errors"
"path/filepath"
"crypto/tls"
"fmt"
"io"
"io/ioutil"
@@ -4240,7 +4241,7 @@ func runInitEs(ctx context.Context) {
cloneOptions.ReferenceName = plumbing.ReferenceName(branch)
}
log.Printf("Getting apps from %s", url)
log.Printf("[DEBUG] Getting apps from %s", url)
r, err := git.Clone(storer, fs, cloneOptions)
@@ -5649,7 +5650,7 @@ func initHandlers() {
//requestCache = cache.New(5*time.Minute, 10*time.Minute)
dbclient, err = datastore.NewClient(ctx, gceProject, option.WithGRPCDialOption(grpc.WithNoProxy()))
if err != nil {
panic(fmt.Sprintf("[DEBUG] Database client error during init: %s", err))
log.Fatalf("[DEBUG] Database client error during init: %s", err)
}
esUrl := os.Getenv("SHUFFLE_OPENSEARCH_URL")
@@ -5657,15 +5658,33 @@ func initHandlers() {
esUrl = "http://shuffle-opensearch:9200"
}
es, err := elasticsearch.NewClient(
elasticsearch.Config{
Addresses: []string{esUrl},
Username: os.Getenv("SHUFFLE_OPENSEARCH_USERNAME"),
Password: os.Getenv("SHUFFLE_OPENSEARCH_PASSWORD"),
config := elasticsearch.Config{
Addresses: []string{esUrl},
Username: os.Getenv("SHUFFLE_OPENSEARCH_USERNAME"),
Password: os.Getenv("SHUFFLE_OPENSEARCH_PASSWORD"),
Transport: &http.Transport{
MaxIdleConnsPerHost: 100,
ResponseHeaderTimeout: time.Second,
TLSClientConfig: &tls.Config{
MinVersion: tls.VersionTLS11,
},
},
)
}
certificateLocation := os.Getenv("SHUFFLE_OPENSEARCH_CERTIFICATE_FILE")
if len(certificateLocation) > 0 {
cert, err := ioutil.ReadFile(certificateLocation)
if err != nil {
log.Fatalf("[WARNING] Failed configuring certificates: %s not found", err)
} else {
config.CACert = cert
}
log.Printf("[INFO] Added certificate %#v elastic client.", certificateLocation)
}
es, err := elasticsearch.NewClient(config)
if err != nil {
panic(fmt.Sprintf("[DEBUG] Database client for ELASTICSEARCH error during init: %s", err))
log.Fatalf("[DEBUG] Database client for ELASTICSEARCH error during init (fatal): %s", err)
}
elasticConfig := "elasticsearch"
+2 -2
View File
@@ -3421,7 +3421,7 @@ func iterateOpenApiGithub(fs billy.Filesystem, dir []os.FileInfo, extra string,
//log.Printf("%s", string(readFile))
swagger, err := openapi3.NewSwaggerLoader().LoadSwaggerFromData([]byte(parsedOpenApi.Body))
if err != nil {
log.Printf("Swagger validation error in loop (%s): %s", filename, err)
log.Printf("[WARNING] Swagger validation error in loop (%s): %s. Continuing.", filename, err)
continue
}
@@ -3432,7 +3432,7 @@ func iterateOpenApiGithub(fs billy.Filesystem, dir []os.FileInfo, extra string,
//log.Printf("Should generate yaml")
swagger, api, _, err := shuffle.GenerateYaml(swagger, parsedOpenApi.ID)
if err != nil {
log.Printf("Failed building and generating yaml in loop (%s): %s", filename, err)
log.Printf("Failed building and generating yaml in loop (2) (%s): %s. Continuing.", filename, err)
continue
}
+3 -2
View File
@@ -17,7 +17,7 @@ services:
- backend
backend:
#build: ./backend
image: ghcr.io/frikky/shuffle-backend:0.8.93
image: ghcr.io/frikky/shuffle-backend:0.8.95
container_name: shuffle-backend
hostname: ${BACKEND_HOSTNAME}
# Here for debugging:
@@ -29,9 +29,10 @@ services:
- /var/run/docker.sock:/var/run/docker.sock
- ${SHUFFLE_APP_HOTLOAD_LOCATION}:/shuffle-apps
- ${SHUFFLE_FILE_LOCATION}:/shuffle-files
#- ${SHUFFLE_OPENSEARCH_CERTIFICATE_FILE}:/shuffle-files/es_certificate
environment:
- DATASTORE_EMULATOR_HOST=shuffle-database:8000
- SHUFFLE_OPENSEARCH_URL=http://shuffle-opensearch:9200
#- SHUFFLE_OPENSEARCH_URL=${SHUFFLE_OPENSEARCH_URL}
- SHUFFLE_APP_HOTLOAD_FOLDER=/shuffle-apps
- SHUFFLE_FILE_LOCATION=/shuffle-files
- ORG_ID=${ORG_ID}
+17 -8
View File
@@ -6,6 +6,7 @@ import { GetIconInfo } from "../views/Workflows.jsx";
import { sortByKey } from "../views/AngularWorkflow.jsx";
import { useTheme } from '@material-ui/core/styles';
import NestedMenuItem from "material-ui-nested-menu-item";
//import NestedMenuItem from "./NestedMenu.jsx";
import {Popper, TextField, Drawer, Button, Paper, Grid, Tabs, InputAdornment, Tab, ButtonBase, Tooltip, Select, MenuItem, Divider, Dialog, Modal, DialogActions, DialogTitle, InputLabel, DialogContent, FormControl, IconButton, Menu, Input, FormGroup, FormControlLabel, Typography, Checkbox, Breadcrumbs, CircularProgress, Switch, Fade} from '@material-ui/core';
import {GetApp as GetAppIcon, Search as SearchIcon, ArrowUpward as ArrowUpwardIcon, Visibility as VisibilityIcon, Done as DoneIcon, Close as CloseIcon, Error as ErrorIcon, FindReplace as FindreplaceIcon, ArrowLeft as ArrowLeftIcon, Cached as CachedIcon, DirectionsRun as DirectionsRunIcon, Add as AddIcon, Polymer as PolymerIcon, FormatListNumbered as FormatListNumberedIcon, Create as CreateIcon, PlayArrow as PlayArrowIcon, AspectRatio as AspectRatioIcon, MoreVert as MoreVertIcon, Apps as AppsIcon, Schedule as ScheduleIcon, FavoriteBorder as FavoriteBorderIcon, Pause as PauseIcon, Delete as DeleteIcon, AddCircleOutline as AddCircleOutlineIcon, Save as SaveIcon, KeyboardArrowLeft as KeyboardArrowLeftIcon, KeyboardArrowRight as KeyboardArrowRightIcon, ArrowBack as ArrowBackIcon, Settings as SettingsIcon, LockOpen as LockOpenIcon, ExpandMore as ExpandMoreIcon, VpnKey as VpnKeyIcon} from '@material-ui/icons';
@@ -921,6 +922,7 @@ const ParsedAction = (props) => {
border: `2px solid #f85a3e`,
color: "white",
marginTop: 2,
maxHeight: 400,
}}
>
{actionlist.map(innerdata => {
@@ -970,11 +972,11 @@ const ParsedAction = (props) => {
const handleMouseover = () => {
if (innerdata.type === "Execution Argument") {
handleExecArgumentHover(true)
} else if (innerdata.type === "action") {
handleActionHover(true, innerdata.id)
}
}
handleExecArgumentHover(true)
} else if (innerdata.type === "action") {
handleActionHover(true, innerdata.id)
}
}
const handleMouseOut = () => {
if (innerdata.type === "Execution Argument") {
@@ -999,8 +1001,15 @@ const ParsedAction = (props) => {
</div>
}
parentMenuOpen={!!menuPosition}
style={{backgroundColor: theme.palette.inputColor, color: "white", minWidth: 250,}}
style={{backgroundColor: theme.palette.inputColor, color: "white", minWidth: 250, maxWidth: 250, maxHeight: 400, scrollX: "", }}
//PaperProps={{
// style: {
// maxHeight: 400,
// width: 250,
// }
//}}
onClick={() => {
console.log("CLICKED: ", innerdata)
handleItemClick([innerdata])
}}
>
@@ -1008,7 +1017,7 @@ const ParsedAction = (props) => {
// FIXME: Should be recursive in here
const icon = pathdata.type === "value" ? <VpnKeyIcon style={iconStyle} /> : pathdata.type === "list" ? <FormatListNumberedIcon style={iconStyle} /> : <ExpandMoreIcon style={iconStyle} />
return (
<MenuItem key={pathdata.name} style={{backgroundColor: theme.palette.inputColor, color: "white", minWidth: 250, }} value={pathdata} onMouseOver={() => {}}
<MenuItem key={pathdata.name} style={{backgroundColor: theme.palette.inputColor, color: "white", minWidth: 250, }} value={pathdata} onMouseOver={() => {console.log("HOVER: ", pathdata)}}
onClick={() => {
handleItemClick([innerdata, pathdata])
}}
@@ -1024,7 +1033,7 @@ const ParsedAction = (props) => {
})}
</NestedMenuItem>
:
<MenuItem key={innerdata.name} style={{backgroundColor: theme.palette.inputColor, color: "white"}} value={innerdata} onMouseOver={() => handleMouseover()} onMouseOut={() => {handleMouseOut()}}
<MenuItem key={innerdata.name} style={{backgroundColor: theme.palette.inputColor, color: "white", minWidth: 250, maxWidth: 250, marginRight: 250, }} value={innerdata} onMouseOver={() => handleMouseover()} onMouseOut={() => {handleMouseOut()}}
onClick={() => {
handleItemClick([innerdata])
}}
+1 -1
View File
@@ -2700,7 +2700,7 @@ const Admin = (props) => {
<Tab label=<span><LockIcon style={iconStyle} />App Authentication</span>/>
<Tab label=<span><DescriptionIcon style={iconStyle} />Files</span> />
<Tab label=<span><ScheduleIcon style={iconStyle} />Schedules</span> />
{/*isCloud ? null : <Tab label=<span><EcoIcon style={iconStyle} />Environments</span>/>*/}
{isCloud ? null : <Tab label=<span><EcoIcon style={iconStyle} />Environments</span>/>}
{window.location.protocol == "http:" && window.location.port === "3000" ? <Tab label=<span><CloudIcon style={iconStyle} /> Hybrid</span>/> : null}
{window.location.protocol == "http:" && window.location.port === "3000" ? <Tab label=<span><BusinessIcon style={iconStyle} /> Organizations</span>/> : null}
{window.location.protocol === "http:" && window.location.port === "3000" ? <Tab label=<span><LockIcon style={iconStyle} />Categories</span>/> : null}
+1 -1
View File
@@ -2270,7 +2270,7 @@ const AngularWorkflow = (props) => {
case 90:
if (previouskey === 17) {
console.log("CTRL+Z")
handleHistoryUndo()
//handleHistoryUndo()
}
break;
+1 -1
View File
@@ -1144,7 +1144,7 @@ const Apps = (props) => {
.then((response) => {
setIsLoading(false)
if (response.status === 200) {
alert.success("Hotloaded apps!")
//alert.success("Hotloaded apps!")
getApps()
}
+2 -1
View File
@@ -29,6 +29,7 @@ const Settings = (props) => {
const [userInfo, ] = useState(userdata)
const [userSettings, setUserSettings] = useState({})
const isCloud = window.location.host === "localhost:3002" || window.location.host === "shuffler.io"
const bodyDivStyle = {
margin: "auto",
@@ -421,7 +422,7 @@ const Settings = (props) => {
/>
</div>
<Button
disabled={(newPassword.length < 10 || newPassword2.length < 10) || newPassword !== newPassword2 || currentPassword.length < 10}
disabled={(isCloud && (newPassword.length < 10 || newPassword2.length < 10 || currentPassword.length < 10)) || newPassword !== newPassword2 || newPassword.length === 0}
style={{width: "100%", height: "60px", marginTop: "10px"}}
variant="contained"
color="primary"