Skip to content

Commit 39509ce

Browse files
committed
Clarify EULA application since 2019
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <[email protected]>
1 parent dc46f5f commit 39509ce

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+169
-86
lines changed

CONTRIBUTING.md

+4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ This project follows the contributing guide for [OpenFaaS](https://github.com/op
44

55
The project-level contributing guide contains instructions specifically relating to faas-netes.
66

7+
## Third party contributions
8+
9+
All third-party contributions are licensed under the MIT license, all OpenFaaS Ltd contributions are licensed under the [OpenFaaS CE EULA](https://github.com/openfaas/faas/blob/master/EULA.md).
10+
711
## Update the version
812

913
### Helm

LICENSE

+18-7
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
1+
All contributions from Alex Ellis & OpenFaaS Ltd are licensed under the
2+
OpenFaaS Community Edition (CE) EULA between the years 2017,2019-2024.
3+
4+
Contributions from third-parties are licensed under the MIT license.
5+
6+
A license is required for commercial use of OpenFaaS CE:
7+
https://github.com/openfaas/faas/blob/master/EULA.md
8+
9+
A separate commercial license covering all contributions can be purchased
10+
from OpenFaaS Ltd, with details available at: https://openfaas.com/pricing
11+
112
MIT License
213

3-
Copyright (c) 2024 OpenFaaS Ltd
4-
Copyright (c) 2024 OpenFaaS Author(s)
5-
Copyright (c) 2024 Alex Ellis
14+
Copyright (c) 2016-2018 Alex Ellis
15+
Copyright (c) 2018 OpenFaaS Author(s)
616

717
Permission is hereby granted, free of charge, to any person obtaining a copy
818
of this software and associated documentation files (the "Software"), to deal
@@ -11,13 +21,14 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1121
copies of the Software, and to permit persons to whom the Software is
1222
furnished to do so, subject to the following conditions:
1323

14-
The above copyright notice and this permission notice shall be included in all
15-
copies or substantial portions of the Software.
24+
The above copyright notice and this permission notice shall be included in
25+
all copies or substantial portions of the Software.
1626

1727
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1828
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1929
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2030
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
2131
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23-
SOFTWARE.
32+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
33+
THE SOFTWARE.
34+

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -141,4 +141,5 @@ Check the contributor guide in `CONTRIBUTING.md` for more details on the workflo
141141

142142
## License
143143

144-
This project is licensed under the MIT License.
144+
See the [LICENSE](./LICENSE) file for details.
145+

main.go

+23-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
// License: OpenFaaS Community Edition (CE) EULA
2+
// Copyright (c) 2017,2019-2024 OpenFaaS Author(s)
3+
14
// Copyright (c) Alex Ellis 2017. All rights reserved.
25
// Copyright (c) OpenFaaS Author(s) 2020. All rights reserved.
3-
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
46

57
package main
68

@@ -9,6 +11,7 @@ import (
911
"flag"
1012
"fmt"
1113
"log"
14+
"net/http"
1215
"time"
1316

1417
clientset "github.com/openfaas/faas-netes/pkg/client/clientset/versioned"
@@ -56,12 +59,13 @@ func main() {
5659

5760
flag.Parse()
5861

59-
mode := "controller"
60-
6162
sha, release := version.GetReleaseInfo()
62-
fmt.Printf("faas-netes - Community Edition (CE)\n"+
63-
"Warning: Commercial use limited to 60 days.\n"+
64-
"\nVersion: %s Commit: %s Mode: %s\n", release, sha, mode)
63+
fmt.Printf(`faas-netes - Community Edition (CE)
64+
Warning: Commercial use limited to 60 days.
65+
Learn more: https://github.com/openfaas/faas/blob/master/EULA.md
66+
67+
Version: %s Commit: %s
68+
`, release, sha)
6569

6670
if err := config.ConnectivityCheck(); err != nil {
6771
log.Fatalf("Error checking connectivity, OpenFaaS CE cannot be run in an offline environment: %s", err.Error())
@@ -194,8 +198,20 @@ func runController(setup serverSetup) {
194198
functionList := k8s.NewFunctionList(config.DefaultFunctionNamespace, deployLister)
195199

196200
printFunctionExecutionTime := true
201+
202+
proxyHandler := proxy.NewHandlerFunc(config.FaaSConfig, functionLookup, printFunctionExecutionTime)
203+
204+
if err := handlers.Check(functionList); err != nil {
205+
msg := fmt.Sprintf("Function invocations disabled due to error: %s.", err.Error())
206+
log.Print(msg)
207+
208+
proxyHandler = func(w http.ResponseWriter, r *http.Request) {
209+
http.Error(w, msg, http.StatusMethodNotAllowed)
210+
}
211+
}
212+
197213
bootstrapHandlers := providertypes.FaaSHandlers{
198-
FunctionProxy: proxy.NewHandlerFunc(config.FaaSConfig, functionLookup, printFunctionExecutionTime),
214+
FunctionProxy: proxyHandler,
199215
DeleteFunction: handlers.MakeDeleteHandler(config.DefaultFunctionNamespace, kubeClient),
200216
DeployFunction: handlers.MakeDeployHandler(config.DefaultFunctionNamespace, factory, functionList),
201217
FunctionLister: handlers.MakeFunctionReader(config.DefaultFunctionNamespace, deployLister),

pkg/config/read_config.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
// License: OpenFaaS Community Edition (CE) EULA
2+
// Copyright (c) 2017,2019-2024 OpenFaaS Author(s)
3+
14
// Copyright (c) Alex Ellis 2017. All rights reserved.
25
// Copyright (c) OpenFaaS Author(s) 2020. All rights reserved.
3-
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
46
package config
57

68
import (

pkg/config/read_config_test.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
// License: OpenFaaS Community Edition (CE) EULA
2+
// Copyright (c) 2017,2019-2024 OpenFaaS Author(s)
3+
14
// Copyright (c) Alex Ellis 2017. All rights reserved.
25
// Copyright 2020 OpenFaaS Author(s)
3-
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
46

57
package config
68

pkg/handlers/delete.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
// Copyright (c) Alex Ellis 2017. All rights reserved.
1+
// License: OpenFaaS Community Edition (CE) EULA
2+
// Copyright (c) 2017,2019-2024 OpenFaaS Author(s)
3+
4+
// Copyright (c) Alex Ellis 2017. All rights reserved\.
25
// Copyright 2020 OpenFaaS Author(s)
3-
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
46

57
package handlers
68

pkg/handlers/deploy.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
// License: OpenFaaS Community Edition (CE) EULA
2+
// Copyright (c) 2017,2019-2024 OpenFaaS Author(s)
3+
14
// Copyright (c) Alex Ellis 2017. All rights reserved.
25
// Copyright 2020 OpenFaaS Author(s)
3-
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
46

57
package handlers
68

@@ -377,8 +379,6 @@ func getMinReplicaCount(labels map[string]string) *int32 {
377379
if err == nil && minReplicas > 0 {
378380
return int32p(int32(minReplicas))
379381
}
380-
381-
log.Println(err)
382382
}
383383

384384
return nil

pkg/handlers/deploy_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// Copyright 2020 OpenFaaS Author(s)
2-
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
1+
// License: OpenFaaS Community Edition (CE) EULA
2+
// Copyright (c) 2017,2019-2024 OpenFaaS Author(s)
33

44
package handlers
55

pkg/handlers/errors.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// Copyright 2020 OpenFaaS Author(s)
2-
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
1+
// License: OpenFaaS Community Edition (CE) EULA
2+
// Copyright (c) 2017,2019-2024 OpenFaaS Author(s)
33

44
package handlers
55

pkg/handlers/errors_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// Copyright 2020 OpenFaaS Author(s)
2-
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
1+
// License: OpenFaaS Community Edition (CE) EULA
2+
// Copyright (c) 2017,2019-2024 OpenFaaS Author(s)
33

44
package handlers
55

pkg/handlers/handlers_test.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
// Copyright (c) Alex Ellis 2017. All rights reserved.
1+
// License: OpenFaaS Community Edition (CE) EULA
2+
// Copyright (c) 2017,2019-2024 OpenFaaS Author(s)
3+
4+
// Copyright (c) Alex Ellis 2017. All rights reserved\.
25
// Copyright 2020 OpenFaaS Author(s)
3-
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
46

57
package handlers
68

pkg/handlers/health.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// Copyright 2020 OpenFaaS Author(s)
2-
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
1+
// License: OpenFaaS Community Edition (CE) EULA
2+
// Copyright (c) 2017,2019-2024 OpenFaaS Author(s)
33

44
package handlers
55

pkg/handlers/info.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// Copyright 2020 OpenFaaS Author(s)
2-
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
1+
// License: OpenFaaS Community Edition (CE) EULA
2+
// Copyright (c) 2017,2019-2024 OpenFaaS Author(s)
33

44
package handlers
55

pkg/handlers/info_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// Copyright 2020 OpenFaaS Author(s)
2-
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
1+
// License: OpenFaaS Community Edition (CE) EULA
2+
// Copyright (c) 2017,2019-2024 OpenFaaS Author(s)
33

44
package handlers
55

pkg/handlers/informers.go

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// License: OpenFaaS Community Edition (CE) EULA
2+
// Copyright (c) 2017,2019-2024 OpenFaaS Author(s)
3+
14
package handlers
25

36
import (

pkg/handlers/license.go

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// License: OpenFaaS Community Edition (CE) EULA
2+
// Copyright (c) 2017,2019-2024 OpenFaaS Author(s)
3+
4+
package handlers
5+
6+
import (
7+
"fmt"
8+
9+
"github.com/openfaas/faas-netes/pkg/k8s"
10+
)
11+
12+
// Check checks the OpenFaaS installation against the OpenFaaS CE EULA
13+
// which this code is licensed under.
14+
func Check(functionList *k8s.FunctionList) error {
15+
total, err := functionList.Count()
16+
if err != nil {
17+
return err
18+
}
19+
20+
if total > MaxFunctions {
21+
return fmt.Errorf("the OpenFaaS CE EULA only permits: %d functions, visit https://openfaas.com/pricing to upgrade to OpenFaaS Standard", MaxFunctions)
22+
}
23+
24+
return nil
25+
}

pkg/handlers/namespaces.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
// Copyright (c) Alex Ellis 2017. All rights reserved.
1+
// License: OpenFaaS Community Edition (CE) EULA
2+
// Copyright (c) 2017,2019-2024 OpenFaaS Author(s)
3+
4+
// Copyright (c) Alex Ellis 2017. All rights reserved\.
25
// Copyright 2020 OpenFaaS Author(s)
3-
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
46

57
package handlers
68

pkg/handlers/namespaces_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// Copyright 2020 OpenFaaS Author(s)
2-
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
1+
// License: OpenFaaS Community Edition (CE) EULA
2+
// Copyright (c) 2017,2019-2024 OpenFaaS Author(s)
33

44
package handlers
55

pkg/handlers/reader.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
// Copyright (c) Alex Ellis 2017. All rights reserved.
1+
// License: OpenFaaS Community Edition (CE) EULA
2+
// Copyright (c) 2017,2019-2024 OpenFaaS Author(s)
3+
4+
// Copyright (c) Alex Ellis 2017. All rights reserved\.
25
// Copyright 2020 OpenFaaS Author(s)
3-
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
46

57
package handlers
68

pkg/handlers/replica_reader.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
// License: OpenFaaS Community Edition (CE) EULA
2+
// Copyright (c) 2017,2019-2024 OpenFaaS Author(s)
3+
14
// Copyright (c) Alex Ellis 2017. All rights reserved.
25
// Copyright 2020 OpenFaaS Author(s)
3-
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
46

57
package handlers
68

@@ -25,7 +27,7 @@ const MaxReplicas = 5
2527

2628
// MaxFunctions licensed for OpenFaaS CE is 15
2729
// a license for OpenFaaS Standard is required to increase this limit.
28-
const MaxFunctions = 15
30+
const MaxFunctions = 10
2931

3032
// MakeReplicaReader reads the amount of replicas for a deployment
3133
func MakeReplicaReader(defaultNamespace string, lister v1.DeploymentLister) http.HandlerFunc {

pkg/handlers/replica_updater.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
// Copyright (c) Alex Ellis 2017. All rights reserved.
1+
// License: OpenFaaS Community Edition (CE) EULA
2+
// Copyright (c) 2017,2019-2024 OpenFaaS Author(s)
3+
4+
// Copyright (c) Alex Ellis 2017. All rights reserved\.
25
// Copyright 2020 OpenFaaS Author(s)
3-
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
46

57
package handlers
68

pkg/handlers/secrets.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// Copyright 2020 OpenFaaS Author(s)
2-
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
1+
// License: OpenFaaS Community Edition (CE) EULA
2+
// Copyright (c) 2017,2019-2024 OpenFaaS Author(s)
33

44
package handlers
55

pkg/handlers/secrets_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// Copyright 2020 OpenFaaS Author(s)
2-
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
1+
// License: OpenFaaS Community Edition (CE) EULA
2+
// Copyright (c) 2017,2019-2024 OpenFaaS Author(s)
33

44
package handlers
55

pkg/handlers/update.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// Copyright 2020 OpenFaaS Author(s)
2-
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
1+
// License: OpenFaaS Community Edition (CE) EULA
2+
// Copyright (c) 2017,2019-2024 OpenFaaS Author(s)
33

44
package handlers
55

pkg/handlers/validate.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
// Copyright (c) Alex Ellis 2017. All rights reserved.
1+
// License: OpenFaaS Community Edition (CE) EULA
2+
// Copyright (c) 2017,2019-2024 OpenFaaS Author(s)
3+
4+
// Copyright (c) Alex Ellis 2017. All rights reserved\.
25
// Copyright 2020 OpenFaaS Author(s)
3-
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
46

57
package handlers
68

pkg/handlers/validate_test.go

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// License: OpenFaaS Community Edition (CE) EULA
2+
// Copyright (c) 2017,2019-2024 OpenFaaS Author(s)
3+
14
package handlers
25

36
import (

pkg/k8s/config.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// Copyright 2020 OpenFaaS Authors
2-
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
1+
// License: OpenFaaS Community Edition (CE) EULA
2+
// Copyright (c) 2017,2019-2024 OpenFaaS Author(s)
33

44
package k8s
55

pkg/k8s/errors.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// Copyright 2020 OpenFaaS Authors
2-
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
1+
// License: OpenFaaS Community Edition (CE) EULA
2+
// Copyright (c) 2017,2019-2024 OpenFaaS Author(s)
33

44
package k8s
55

pkg/k8s/factory.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// Copyright 2020 OpenFaaS Authors
2-
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
1+
// License: OpenFaaS Community Edition (CE) EULA
2+
// Copyright (c) 2017,2019-2024 OpenFaaS Author(s)
33

44
package k8s
55

pkg/k8s/factory_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// Copyright 2020 OpenFaaS Authors
2-
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
1+
// License: OpenFaaS Community Edition (CE) EULA
2+
// Copyright (c) 2017,2019-2024 OpenFaaS Author(s)
33

44
package k8s
55

0 commit comments

Comments
 (0)