Skip to content

Commit

Permalink
Clarify EULA application since 2019
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <[email protected]>
  • Loading branch information
alexellis committed Nov 18, 2024
1 parent dc46f5f commit 39509ce
Show file tree
Hide file tree
Showing 43 changed files with 169 additions and 86 deletions.
4 changes: 4 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ This project follows the contributing guide for [OpenFaaS](https://github.com/op

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

## Third party contributions

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).

## Update the version

### Helm
Expand Down
25 changes: 18 additions & 7 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
All contributions from Alex Ellis & OpenFaaS Ltd are licensed under the
OpenFaaS Community Edition (CE) EULA between the years 2017,2019-2024.

Contributions from third-parties are licensed under the MIT license.

A license is required for commercial use of OpenFaaS CE:
https://github.com/openfaas/faas/blob/master/EULA.md

A separate commercial license covering all contributions can be purchased
from OpenFaaS Ltd, with details available at: https://openfaas.com/pricing

MIT License

Copyright (c) 2024 OpenFaaS Ltd
Copyright (c) 2024 OpenFaaS Author(s)
Copyright (c) 2024 Alex Ellis
Copyright (c) 2016-2018 Alex Ellis
Copyright (c) 2018 OpenFaaS Author(s)

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

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

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

3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,4 +141,5 @@ Check the contributor guide in `CONTRIBUTING.md` for more details on the workflo

## License

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

30 changes: 23 additions & 7 deletions main.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// License: OpenFaaS Community Edition (CE) EULA
// Copyright (c) 2017,2019-2024 OpenFaaS Author(s)

// Copyright (c) Alex Ellis 2017. All rights reserved.
// Copyright (c) OpenFaaS Author(s) 2020. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

package main

Expand All @@ -9,6 +11,7 @@ import (
"flag"
"fmt"
"log"
"net/http"
"time"

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

flag.Parse()

mode := "controller"

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

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

printFunctionExecutionTime := true

proxyHandler := proxy.NewHandlerFunc(config.FaaSConfig, functionLookup, printFunctionExecutionTime)

if err := handlers.Check(functionList); err != nil {
msg := fmt.Sprintf("Function invocations disabled due to error: %s.", err.Error())
log.Print(msg)

proxyHandler = func(w http.ResponseWriter, r *http.Request) {
http.Error(w, msg, http.StatusMethodNotAllowed)
}
}

bootstrapHandlers := providertypes.FaaSHandlers{
FunctionProxy: proxy.NewHandlerFunc(config.FaaSConfig, functionLookup, printFunctionExecutionTime),
FunctionProxy: proxyHandler,
DeleteFunction: handlers.MakeDeleteHandler(config.DefaultFunctionNamespace, kubeClient),
DeployFunction: handlers.MakeDeployHandler(config.DefaultFunctionNamespace, factory, functionList),
FunctionLister: handlers.MakeFunctionReader(config.DefaultFunctionNamespace, deployLister),
Expand Down
4 changes: 3 additions & 1 deletion pkg/config/read_config.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// License: OpenFaaS Community Edition (CE) EULA
// Copyright (c) 2017,2019-2024 OpenFaaS Author(s)

// Copyright (c) Alex Ellis 2017. All rights reserved.
// Copyright (c) OpenFaaS Author(s) 2020. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
package config

import (
Expand Down
4 changes: 3 additions & 1 deletion pkg/config/read_config_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// License: OpenFaaS Community Edition (CE) EULA
// Copyright (c) 2017,2019-2024 OpenFaaS Author(s)

// Copyright (c) Alex Ellis 2017. All rights reserved.
// Copyright 2020 OpenFaaS Author(s)
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

package config

Expand Down
6 changes: 4 additions & 2 deletions pkg/handlers/delete.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Copyright (c) Alex Ellis 2017. All rights reserved.
// License: OpenFaaS Community Edition (CE) EULA
// Copyright (c) 2017,2019-2024 OpenFaaS Author(s)

// Copyright (c) Alex Ellis 2017. All rights reserved\.
// Copyright 2020 OpenFaaS Author(s)
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

package handlers

Expand Down
6 changes: 3 additions & 3 deletions pkg/handlers/deploy.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// License: OpenFaaS Community Edition (CE) EULA
// Copyright (c) 2017,2019-2024 OpenFaaS Author(s)

// Copyright (c) Alex Ellis 2017. All rights reserved.
// Copyright 2020 OpenFaaS Author(s)
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

package handlers

Expand Down Expand Up @@ -377,8 +379,6 @@ func getMinReplicaCount(labels map[string]string) *int32 {
if err == nil && minReplicas > 0 {
return int32p(int32(minReplicas))
}

log.Println(err)
}

return nil
Expand Down
4 changes: 2 additions & 2 deletions pkg/handlers/deploy_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright 2020 OpenFaaS Author(s)
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
// License: OpenFaaS Community Edition (CE) EULA
// Copyright (c) 2017,2019-2024 OpenFaaS Author(s)

package handlers

Expand Down
4 changes: 2 additions & 2 deletions pkg/handlers/errors.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright 2020 OpenFaaS Author(s)
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
// License: OpenFaaS Community Edition (CE) EULA
// Copyright (c) 2017,2019-2024 OpenFaaS Author(s)

package handlers

Expand Down
4 changes: 2 additions & 2 deletions pkg/handlers/errors_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright 2020 OpenFaaS Author(s)
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
// License: OpenFaaS Community Edition (CE) EULA
// Copyright (c) 2017,2019-2024 OpenFaaS Author(s)

package handlers

Expand Down
6 changes: 4 additions & 2 deletions pkg/handlers/handlers_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Copyright (c) Alex Ellis 2017. All rights reserved.
// License: OpenFaaS Community Edition (CE) EULA
// Copyright (c) 2017,2019-2024 OpenFaaS Author(s)

// Copyright (c) Alex Ellis 2017. All rights reserved\.
// Copyright 2020 OpenFaaS Author(s)
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

package handlers

Expand Down
4 changes: 2 additions & 2 deletions pkg/handlers/health.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright 2020 OpenFaaS Author(s)
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
// License: OpenFaaS Community Edition (CE) EULA
// Copyright (c) 2017,2019-2024 OpenFaaS Author(s)

package handlers

Expand Down
4 changes: 2 additions & 2 deletions pkg/handlers/info.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright 2020 OpenFaaS Author(s)
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
// License: OpenFaaS Community Edition (CE) EULA
// Copyright (c) 2017,2019-2024 OpenFaaS Author(s)

package handlers

Expand Down
4 changes: 2 additions & 2 deletions pkg/handlers/info_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright 2020 OpenFaaS Author(s)
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
// License: OpenFaaS Community Edition (CE) EULA
// Copyright (c) 2017,2019-2024 OpenFaaS Author(s)

package handlers

Expand Down
3 changes: 3 additions & 0 deletions pkg/handlers/informers.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// License: OpenFaaS Community Edition (CE) EULA
// Copyright (c) 2017,2019-2024 OpenFaaS Author(s)

package handlers

import (
Expand Down
25 changes: 25 additions & 0 deletions pkg/handlers/license.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// License: OpenFaaS Community Edition (CE) EULA
// Copyright (c) 2017,2019-2024 OpenFaaS Author(s)

package handlers

import (
"fmt"

"github.com/openfaas/faas-netes/pkg/k8s"
)

// Check checks the OpenFaaS installation against the OpenFaaS CE EULA
// which this code is licensed under.
func Check(functionList *k8s.FunctionList) error {
total, err := functionList.Count()
if err != nil {
return err
}

if total > MaxFunctions {
return fmt.Errorf("the OpenFaaS CE EULA only permits: %d functions, visit https://openfaas.com/pricing to upgrade to OpenFaaS Standard", MaxFunctions)
}

return nil
}
6 changes: 4 additions & 2 deletions pkg/handlers/namespaces.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Copyright (c) Alex Ellis 2017. All rights reserved.
// License: OpenFaaS Community Edition (CE) EULA
// Copyright (c) 2017,2019-2024 OpenFaaS Author(s)

// Copyright (c) Alex Ellis 2017. All rights reserved\.
// Copyright 2020 OpenFaaS Author(s)
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

package handlers

Expand Down
4 changes: 2 additions & 2 deletions pkg/handlers/namespaces_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright 2020 OpenFaaS Author(s)
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
// License: OpenFaaS Community Edition (CE) EULA
// Copyright (c) 2017,2019-2024 OpenFaaS Author(s)

package handlers

Expand Down
6 changes: 4 additions & 2 deletions pkg/handlers/reader.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Copyright (c) Alex Ellis 2017. All rights reserved.
// License: OpenFaaS Community Edition (CE) EULA
// Copyright (c) 2017,2019-2024 OpenFaaS Author(s)

// Copyright (c) Alex Ellis 2017. All rights reserved\.
// Copyright 2020 OpenFaaS Author(s)
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

package handlers

Expand Down
6 changes: 4 additions & 2 deletions pkg/handlers/replica_reader.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// License: OpenFaaS Community Edition (CE) EULA
// Copyright (c) 2017,2019-2024 OpenFaaS Author(s)

// Copyright (c) Alex Ellis 2017. All rights reserved.
// Copyright 2020 OpenFaaS Author(s)
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

package handlers

Expand All @@ -25,7 +27,7 @@ const MaxReplicas = 5

// MaxFunctions licensed for OpenFaaS CE is 15
// a license for OpenFaaS Standard is required to increase this limit.
const MaxFunctions = 15
const MaxFunctions = 10

// MakeReplicaReader reads the amount of replicas for a deployment
func MakeReplicaReader(defaultNamespace string, lister v1.DeploymentLister) http.HandlerFunc {
Expand Down
6 changes: 4 additions & 2 deletions pkg/handlers/replica_updater.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Copyright (c) Alex Ellis 2017. All rights reserved.
// License: OpenFaaS Community Edition (CE) EULA
// Copyright (c) 2017,2019-2024 OpenFaaS Author(s)

// Copyright (c) Alex Ellis 2017. All rights reserved\.
// Copyright 2020 OpenFaaS Author(s)
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

package handlers

Expand Down
4 changes: 2 additions & 2 deletions pkg/handlers/secrets.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright 2020 OpenFaaS Author(s)
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
// License: OpenFaaS Community Edition (CE) EULA
// Copyright (c) 2017,2019-2024 OpenFaaS Author(s)

package handlers

Expand Down
4 changes: 2 additions & 2 deletions pkg/handlers/secrets_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright 2020 OpenFaaS Author(s)
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
// License: OpenFaaS Community Edition (CE) EULA
// Copyright (c) 2017,2019-2024 OpenFaaS Author(s)

package handlers

Expand Down
4 changes: 2 additions & 2 deletions pkg/handlers/update.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright 2020 OpenFaaS Author(s)
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
// License: OpenFaaS Community Edition (CE) EULA
// Copyright (c) 2017,2019-2024 OpenFaaS Author(s)

package handlers

Expand Down
6 changes: 4 additions & 2 deletions pkg/handlers/validate.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Copyright (c) Alex Ellis 2017. All rights reserved.
// License: OpenFaaS Community Edition (CE) EULA
// Copyright (c) 2017,2019-2024 OpenFaaS Author(s)

// Copyright (c) Alex Ellis 2017. All rights reserved\.
// Copyright 2020 OpenFaaS Author(s)
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

package handlers

Expand Down
3 changes: 3 additions & 0 deletions pkg/handlers/validate_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// License: OpenFaaS Community Edition (CE) EULA
// Copyright (c) 2017,2019-2024 OpenFaaS Author(s)

package handlers

import (
Expand Down
4 changes: 2 additions & 2 deletions pkg/k8s/config.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright 2020 OpenFaaS Authors
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
// License: OpenFaaS Community Edition (CE) EULA
// Copyright (c) 2017,2019-2024 OpenFaaS Author(s)

package k8s

Expand Down
4 changes: 2 additions & 2 deletions pkg/k8s/errors.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright 2020 OpenFaaS Authors
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
// License: OpenFaaS Community Edition (CE) EULA
// Copyright (c) 2017,2019-2024 OpenFaaS Author(s)

package k8s

Expand Down
4 changes: 2 additions & 2 deletions pkg/k8s/factory.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright 2020 OpenFaaS Authors
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
// License: OpenFaaS Community Edition (CE) EULA
// Copyright (c) 2017,2019-2024 OpenFaaS Author(s)

package k8s

Expand Down
4 changes: 2 additions & 2 deletions pkg/k8s/factory_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright 2020 OpenFaaS Authors
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
// License: OpenFaaS Community Edition (CE) EULA
// Copyright (c) 2017,2019-2024 OpenFaaS Author(s)

package k8s

Expand Down
Loading

0 comments on commit 39509ce

Please sign in to comment.