Added usage of new updated shuffle-shared with bugfixes for infinite loops and label management
This commit is contained in:
@@ -19,7 +19,7 @@ require (
|
|||||||
github.com/gorilla/mux v1.8.0
|
github.com/gorilla/mux v1.8.0
|
||||||
github.com/h2non/filetype v1.1.3
|
github.com/h2non/filetype v1.1.3
|
||||||
github.com/satori/go.uuid v1.2.0
|
github.com/satori/go.uuid v1.2.0
|
||||||
github.com/shuffle/shuffle-shared v0.3.71
|
github.com/shuffle/shuffle-shared v0.3.74
|
||||||
golang.org/x/crypto v0.3.0
|
golang.org/x/crypto v0.3.0
|
||||||
google.golang.org/api v0.103.0
|
google.golang.org/api v0.103.0
|
||||||
google.golang.org/appengine v1.6.7
|
google.golang.org/appengine v1.6.7
|
||||||
|
|||||||
@@ -2062,6 +2062,15 @@ func handleWebhookCallback(resp http.ResponseWriter, request *http.Request) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Find user agent header
|
||||||
|
userAgent := request.Header.Get("User-Agent")
|
||||||
|
if strings.Contains(strings.ToLower(userAgent), "microsoftpreview") || strings.Contains(strings.ToLower(userAgent), "googlebot") {
|
||||||
|
log.Printf("[AUDIT] Blocking googlebot and microsoftbot for webhooks. UA: '%s'", userAgent)
|
||||||
|
resp.WriteHeader(400)
|
||||||
|
resp.Write([]byte(`{"success": false, "reason": "Google/Microsoft preview bots not allowed. Please change the useragent."}`))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// ID: webhook_<UID>
|
// ID: webhook_<UID>
|
||||||
if len(hookId) != 44 {
|
if len(hookId) != 44 {
|
||||||
log.Printf("[INFO] Couldn't handle hookId. Too short in webhook: %d", len(hookId))
|
log.Printf("[INFO] Couldn't handle hookId. Too short in webhook: %d", len(hookId))
|
||||||
|
|||||||
@@ -0,0 +1,83 @@
|
|||||||
|
import React, { useState, useEffect } from "react";
|
||||||
|
import ReactGA from 'react-ga4';
|
||||||
|
import theme from "../theme";
|
||||||
|
|
||||||
|
import { useTheme } from "@material-ui/core/styles";
|
||||||
|
import {
|
||||||
|
Paper,
|
||||||
|
Typography,
|
||||||
|
Divider,
|
||||||
|
Button,
|
||||||
|
Grid,
|
||||||
|
Card,
|
||||||
|
} from "@material-ui/core";
|
||||||
|
|
||||||
|
import { useAlert } from "react-alert";
|
||||||
|
|
||||||
|
const Branding = (props) => {
|
||||||
|
const { globalUrl, userdata, serverside, billingInfo, stripeKey, selectedOrganization, handleGetOrg, } = props;
|
||||||
|
const alert = useAlert();
|
||||||
|
const [publishingInfo, setPublishingInfo] = useState("");
|
||||||
|
|
||||||
|
// Should enable / disable org branding
|
||||||
|
const handleChangePublishing = () => {
|
||||||
|
console.log("Handle change publishing");
|
||||||
|
}
|
||||||
|
|
||||||
|
const isOrganizationReady = () => {
|
||||||
|
// A simple checklist to ensure the button shows up properly
|
||||||
|
if (selectedOrganization.name === selectedOrganization.org) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (selectedOrganization.large_image === "" || selectedOrganization.large_image === theme.palette.defaultImage) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<Typography variant="h6" style={{ marginTop: 20, marginBottom: 10 }}>
|
||||||
|
Branding
|
||||||
|
</Typography>
|
||||||
|
<Typography variant="body1" color="textSecondary" style={{ marginTop: 20, marginBottom: 10 }}>
|
||||||
|
You can customize your organization's branding by uploading a logo, changing the color scheme and a lot more.
|
||||||
|
</Typography>
|
||||||
|
|
||||||
|
<Divider style={{marginTop: 50, marginBottom: 50, }} />
|
||||||
|
<h2>
|
||||||
|
Creator Network
|
||||||
|
</h2>
|
||||||
|
<div style={{ display: "flex", width: 700, }}>
|
||||||
|
<div>
|
||||||
|
<span>
|
||||||
|
<Typography variant="body1" color="textSecondary">
|
||||||
|
By changing publishing settings, you agree to our <a href="/docs/terms_of_service" target="_blank" style={{ textDecoration: "none", color: "#f86a3e"}}>Terms of Service</a>, and acknowledge that your organization's non-sensitive data will be turned into a <a target="_blank" style={{ textDecoration: "none", color: "#f86a3e"}} href="https://shuffler.io/creators">creator account</a>. Support: support@shuffler.io
|
||||||
|
|
||||||
|
</Typography>
|
||||||
|
<Button
|
||||||
|
style={{ height: 40, marginTop: 10, width: 300, }}
|
||||||
|
variant="outlined"
|
||||||
|
color="primary"
|
||||||
|
disabled={() => {
|
||||||
|
return isOrganizationReady()
|
||||||
|
}}
|
||||||
|
onClick={() => {
|
||||||
|
handleChangePublishing();
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Join Creator Network
|
||||||
|
</Button>
|
||||||
|
<Typography variant="body1" color="textSecondary" style={{ marginTop: 20, marginBottom: 10 }}>
|
||||||
|
{publishingInfo}
|
||||||
|
</Typography>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Branding;
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
hello this is test
|
||||||
|
hello this is test
|
||||||
|
hello this is test
|
||||||
|
hello this is test
|
||||||
@@ -8,7 +8,7 @@ require (
|
|||||||
github.com/docker/docker v23.0.0+incompatible
|
github.com/docker/docker v23.0.0+incompatible
|
||||||
github.com/mackerelio/go-osstat v0.2.3
|
github.com/mackerelio/go-osstat v0.2.3
|
||||||
github.com/satori/go.uuid v1.2.0
|
github.com/satori/go.uuid v1.2.0
|
||||||
github.com/shuffle/shuffle-shared v0.3.66
|
github.com/shuffle/shuffle-shared v0.3.74
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
|
|||||||
@@ -198,6 +198,8 @@ github.com/shuffle/shuffle-shared v0.3.51 h1:+JPEGw6R4a320who+SrGP/VqBxZdKPdcLw/
|
|||||||
github.com/shuffle/shuffle-shared v0.3.51/go.mod h1:jQrYySmvp/0De5ftrAaY6xwwr7TMfqBmBxQ2AX9yrjQ=
|
github.com/shuffle/shuffle-shared v0.3.51/go.mod h1:jQrYySmvp/0De5ftrAaY6xwwr7TMfqBmBxQ2AX9yrjQ=
|
||||||
github.com/shuffle/shuffle-shared v0.3.52 h1:d9OycFpuWxrcgHdP2vplKAkY8n+oK5vW02vRK9X+azs=
|
github.com/shuffle/shuffle-shared v0.3.52 h1:d9OycFpuWxrcgHdP2vplKAkY8n+oK5vW02vRK9X+azs=
|
||||||
github.com/shuffle/shuffle-shared v0.3.52/go.mod h1:jQrYySmvp/0De5ftrAaY6xwwr7TMfqBmBxQ2AX9yrjQ=
|
github.com/shuffle/shuffle-shared v0.3.52/go.mod h1:jQrYySmvp/0De5ftrAaY6xwwr7TMfqBmBxQ2AX9yrjQ=
|
||||||
|
github.com/shuffle/shuffle-shared v0.3.66 h1:M8iK88pk42vE5Up05t8QJZXWjNMt3XXC0vA93QVmPkE=
|
||||||
|
github.com/shuffle/shuffle-shared v0.3.66/go.mod h1:jQrYySmvp/0De5ftrAaY6xwwr7TMfqBmBxQ2AX9yrjQ=
|
||||||
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e h1:MRM5ITcdelLK2j1vwZ3Je0FKVCfqOLp5zO6trqMLYs0=
|
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e h1:MRM5ITcdelLK2j1vwZ3Je0FKVCfqOLp5zO6trqMLYs0=
|
||||||
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e/go.mod h1:XV66xRDqSt+GTGFMVlhk3ULuV0y9ZmzeVGR4mloJI3M=
|
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e/go.mod h1:XV66xRDqSt+GTGFMVlhk3ULuV0y9ZmzeVGR4mloJI3M=
|
||||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ require (
|
|||||||
github.com/gorilla/mux v1.8.0
|
github.com/gorilla/mux v1.8.0
|
||||||
github.com/patrickmn/go-cache v2.1.0+incompatible
|
github.com/patrickmn/go-cache v2.1.0+incompatible
|
||||||
github.com/satori/go.uuid v1.2.0
|
github.com/satori/go.uuid v1.2.0
|
||||||
github.com/shuffle/shuffle-shared v0.3.62
|
github.com/shuffle/shuffle-shared v0.3.74
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
|
|||||||
Reference in New Issue
Block a user