#216: Added backend components for Org settings
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
NAME=shuffle-app_sdk
|
NAME=shuffle-app_sdk
|
||||||
VERSION=0.8.3
|
VERSION=0.8.31
|
||||||
|
|
||||||
docker rmi docker.pkg.github.com/frikky/shuffle/$NAME:$VERSION --force
|
docker rmi docker.pkg.github.com/frikky/shuffle/$NAME:$VERSION --force
|
||||||
docker build . -t frikky/shuffle:app_sdk -t frikky/$NAME:$VERSION -t docker.pkg.github.com/frikky/shuffle/$NAME:$VERSION -t ghcr.io/frikky/$NAME:$VERSION
|
docker build . -t frikky/shuffle:app_sdk -t frikky/$NAME:$VERSION -t docker.pkg.github.com/frikky/shuffle/$NAME:$VERSION -t ghcr.io/frikky/$NAME:$VERSION
|
||||||
|
|||||||
+14
-11
@@ -3435,18 +3435,18 @@ func handleWebhookCallback(resp http.ResponseWriter, request *http.Request) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
parsedBody := string(body)
|
//parsedBody := string(body)
|
||||||
//parsedBody = strings.Replace(parsedBody, "\"", "\\\"", -1)
|
//parsedBody = strings.Replace(parsedBody, "\"", "\\\"", -1)
|
||||||
if len(parsedBody) > 0 {
|
//if len(parsedBody) > 0 {
|
||||||
if string(parsedBody[0]) == `"` && string(parsedBody[len(parsedBody)-1]) == "\"" {
|
// if string(parsedBody[0]) == `"` && string(parsedBody[len(parsedBody)-1]) == "\"" {
|
||||||
parsedBody = parsedBody[1 : len(parsedBody)-1]
|
// parsedBody = parsedBody[1 : len(parsedBody)-1]
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
|
|
||||||
newBody := ExecutionStruct{
|
newBody := ExecutionStruct{
|
||||||
Start: hook.Start,
|
Start: hook.Start,
|
||||||
ExecutionSource: "webhook",
|
ExecutionSource: "webhook",
|
||||||
ExecutionArgument: string(parsedBody),
|
ExecutionArgument: string(body),
|
||||||
}
|
}
|
||||||
|
|
||||||
b, err := json.Marshal(newBody)
|
b, err := json.Marshal(newBody)
|
||||||
@@ -7611,10 +7611,11 @@ func handleEditOrg(resp http.ResponseWriter, request *http.Request) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type ReturnData struct {
|
type ReturnData struct {
|
||||||
Image string `json:"image" datastore:"image"`
|
Image string `json:"image" datastore:"image"`
|
||||||
Name string `json:"name" datastore:"name"`
|
Name string `json:"name" datastore:"name"`
|
||||||
Description string `json:"description" datastore:"description"`
|
Description string `json:"description" datastore:"description"`
|
||||||
OrgId string `json:"org_id" datastore:"org_id"`
|
OrgId string `json:"org_id" datastore:"org_id"`
|
||||||
|
Defaults Defaults `json:"defaults" datastore:"defaults"`
|
||||||
}
|
}
|
||||||
|
|
||||||
var tmpData ReturnData
|
var tmpData ReturnData
|
||||||
@@ -7685,6 +7686,8 @@ func handleEditOrg(resp http.ResponseWriter, request *http.Request) {
|
|||||||
org.Image = tmpData.Image
|
org.Image = tmpData.Image
|
||||||
org.Name = tmpData.Name
|
org.Name = tmpData.Name
|
||||||
org.Description = tmpData.Description
|
org.Description = tmpData.Description
|
||||||
|
org.Defaults = tmpData.Defaults
|
||||||
|
|
||||||
//log.Printf("Org: %#v", org)
|
//log.Printf("Org: %#v", org)
|
||||||
err = setOrg(ctx, *org, org.Id)
|
err = setOrg(ctx, *org, org.Id)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -116,6 +116,14 @@ type Org struct {
|
|||||||
SyncFeatures SyncFeatures `json:"sync_features" datastore:"sync_features"`
|
SyncFeatures SyncFeatures `json:"sync_features" datastore:"sync_features"`
|
||||||
Created int64 `json:"created" datastore:"created"`
|
Created int64 `json:"created" datastore:"created"`
|
||||||
Edited int64 `json:"edited" datastore:"edited"`
|
Edited int64 `json:"edited" datastore:"edited"`
|
||||||
|
Defaults Defaults `json:"defaults" datastore:"defaults"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type Defaults struct {
|
||||||
|
AppDownloadRepo string `json:"app_download_repo" datastore:"app_download_repo"`
|
||||||
|
AppDownloadBranch string `json:"app_download_branch" datastore:"app_download_branch"`
|
||||||
|
WorkflowDownloadRepo string `json:"workflow_download_repo" datastore:"workflow_download_repo"`
|
||||||
|
WorkflowDownloadBranch string `json:"workflow_download_branch" datastore:"workflow_download_branch"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type AppAuthenticationStorage struct {
|
type AppAuthenticationStorage struct {
|
||||||
@@ -5134,9 +5142,12 @@ func loadSpecificApps(resp http.ResponseWriter, request *http.Request) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// Field1 & 2 can be a lot of things..
|
// Field1 & 2 can be a lot of things.
|
||||||
|
// Field1 = Username
|
||||||
|
// Field2 = Password
|
||||||
type tmpStruct struct {
|
type tmpStruct struct {
|
||||||
URL string `json:"url"`
|
URL string `json:"url"`
|
||||||
|
Branch string `json:"branch"`
|
||||||
Field1 string `json:"field_1"`
|
Field1 string `json:"field_1"`
|
||||||
Field2 string `json:"field_2"`
|
Field2 string `json:"field_2"`
|
||||||
ForceUpdate bool `json:"force_update"`
|
ForceUpdate bool `json:"force_update"`
|
||||||
@@ -5159,6 +5170,10 @@ func loadSpecificApps(resp http.ResponseWriter, request *http.Request) {
|
|||||||
URL: tmpBody.URL,
|
URL: tmpBody.URL,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(tmpBody.Branch) > 0 && tmpBody.Branch != "master" && tmpBody.Branch != "main" {
|
||||||
|
cloneOptions.ReferenceName = plumbing.ReferenceName(tmpBody.Branch)
|
||||||
|
}
|
||||||
|
|
||||||
// FIXME: Better auth.
|
// FIXME: Better auth.
|
||||||
if len(tmpBody.Field1) > 0 && len(tmpBody.Field2) > 0 {
|
if len(tmpBody.Field1) > 0 && len(tmpBody.Field2) > 0 {
|
||||||
cloneOptions.Auth = &http2.BasicAuth{
|
cloneOptions.Auth = &http2.BasicAuth{
|
||||||
|
|||||||
+1
-1
@@ -45,7 +45,7 @@ services:
|
|||||||
- database
|
- database
|
||||||
orborus:
|
orborus:
|
||||||
#build: ./functions/onprem/orborus
|
#build: ./functions/onprem/orborus
|
||||||
image: ghcr.io/frikky/shuffle-orborus:0.8.0
|
image: ghcr.io/frikky/shuffle-orborus:0.8.3
|
||||||
container_name: shuffle-orborus
|
container_name: shuffle-orborus
|
||||||
hostname: shuffle-orborus
|
hostname: shuffle-orborus
|
||||||
networks:
|
networks:
|
||||||
|
|||||||
@@ -402,7 +402,7 @@ const AngularWorkflow = (props) => {
|
|||||||
|
|
||||||
if (!visited.includes(item.action.label)) {
|
if (!visited.includes(item.action.label)) {
|
||||||
if (executionRunning) {
|
if (executionRunning) {
|
||||||
alert.show("WAITING FOR "+item.action.label+" with result "+item.result)
|
//alert.show("WAITING FOR "+item.action.label+" with result "+item.result)
|
||||||
visited.push(item.action.label)
|
visited.push(item.action.label)
|
||||||
setVisited(visited)
|
setVisited(visited)
|
||||||
}
|
}
|
||||||
@@ -424,7 +424,7 @@ const AngularWorkflow = (props) => {
|
|||||||
|
|
||||||
if (!visited.includes(item.action.label)) {
|
if (!visited.includes(item.action.label)) {
|
||||||
if (executionRunning) {
|
if (executionRunning) {
|
||||||
alert.show("Success in node "+item.action.label)
|
//alert.show("Success in node "+item.action.label)
|
||||||
//+" with result "+item.result)
|
//+" with result "+item.result)
|
||||||
visited.push(item.action.label)
|
visited.push(item.action.label)
|
||||||
setVisited(visited)
|
setVisited(visited)
|
||||||
@@ -459,7 +459,7 @@ const AngularWorkflow = (props) => {
|
|||||||
currentnode.addClass('failure-highlight')
|
currentnode.addClass('failure-highlight')
|
||||||
|
|
||||||
if (!visited.includes(item.action.label)) {
|
if (!visited.includes(item.action.label)) {
|
||||||
alert.error("Success for "+item.action.label+" with result "+item.result)
|
alert.error("Error for "+item.action.label+" with result "+item.result)
|
||||||
visited.push(item.action.label)
|
visited.push(item.action.label)
|
||||||
setVisited(visited)
|
setVisited(visited)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,6 @@ echo "Running docker build with $NAME:$VERSION"
|
|||||||
docker build . -t frikky/shuffle:$NAME -t docker.pkg.github.com/frikky/shuffle/$NAME:$VERSION -t frikky/$NAME:$VERSION -t ghcr.io/frikky/$NAME:$VERSION
|
docker build . -t frikky/shuffle:$NAME -t docker.pkg.github.com/frikky/shuffle/$NAME:$VERSION -t frikky/$NAME:$VERSION -t ghcr.io/frikky/$NAME:$VERSION
|
||||||
|
|
||||||
#docker push frikky/$NAME:$VERSION
|
#docker push frikky/$NAME:$VERSION
|
||||||
#docker push frikky/shuffle:$NAME
|
|
||||||
# docker push docker.pkg.github.com/frikky/shuffle/$NAME:$VERSION
|
# docker push docker.pkg.github.com/frikky/shuffle/$NAME:$VERSION
|
||||||
|
docker push frikky/shuffle:$NAME
|
||||||
docker push ghcr.io/frikky/$NAME:$VERSION
|
docker push ghcr.io/frikky/$NAME:$VERSION
|
||||||
|
|||||||
Reference in New Issue
Block a user