-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #50 from tawoe/container
Reformat Copyright notice / Add container run script
- Loading branch information
Showing
47 changed files
with
115 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ server-dist | |
coverage | ||
*.local | ||
.env | ||
.env_* | ||
|
||
/cypress/videos/ | ||
/cypress/screenshots/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
VITE_OBP_API_HOST=VITE_OBP_API_HOST | ||
VITE_OBP_API_MANAGER_HOST=VITE_OBP_API_MANAGER_HOST | ||
VITE_OBP_API_VERSION=v5.1.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module GoHelpers | ||
|
||
go 1.21 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
package main | ||
|
||
import ( | ||
"log" | ||
"net/url" | ||
"os" | ||
"path/filepath" | ||
"regexp" | ||
"strings" | ||
) | ||
|
||
func main() { | ||
config := []string{"VITE_OBP_API_HOST", "VITE_OBP_API_MANAGER_HOST"} | ||
configMap := make(map[string]string) | ||
|
||
for _, key := range config { | ||
rawURL := os.Getenv(key) | ||
if rawURL == "" { | ||
continue | ||
} | ||
cleanURL := checkURL(rawURL) | ||
configMap[key] = cleanURL | ||
} | ||
|
||
dir := "/opt/app-root/src/assets" | ||
pattern := "index-.*\\.js$" | ||
|
||
re, err := regexp.Compile(pattern) | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
|
||
files, err := os.ReadDir(dir) | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
|
||
for _, file := range files { | ||
if re.MatchString(file.Name()) { | ||
filePath := filepath.Join(dir, file.Name()) | ||
content, err := os.ReadFile(filePath) | ||
if err != nil { | ||
panic(err) | ||
} | ||
modifiedContent := string(content) | ||
for old, new := range configMap { | ||
modifiedContent = strings.Replace(modifiedContent, old, new, -1) | ||
} | ||
err = os.WriteFile(filePath, []byte(modifiedContent), 0644) | ||
if err != nil { | ||
panic(err) | ||
} | ||
} | ||
} | ||
|
||
} | ||
|
||
func checkURL(rawURL string) string { | ||
|
||
parsedURL, err := url.Parse(rawURL) | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
|
||
validURL := regexp.MustCompile(`^https?:\/\/[^\s/$.?#].[^\s]*$`) | ||
if !validURL.MatchString(rawURL) { | ||
log.Fatal("Invalid URL or potential code injection detected") | ||
} | ||
|
||
cleanURL := &url.URL{ | ||
Scheme: parsedURL.Scheme, | ||
Host: parsedURL.Host, | ||
Path: parsedURL.Path, | ||
} | ||
return cleanURL.String() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
/* | ||
* * | ||
* Open Bank Project - API Explorer II | ||
* Copyright (C) 2023-2024, TESOBE GmbH | ||
* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
/* | ||
* * | ||
* Open Bank Project - API Explorer II | ||
* Copyright (C) 2023-2024, TESOBE GmbH | ||
* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
/* | ||
* * | ||
* Open Bank Project - API Explorer II | ||
* Copyright (C) 2023-2024, TESOBE GmbH | ||
* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
/* | ||
* * | ||
* Open Bank Project - API Explorer II | ||
* Copyright (C) 2023-2024, TESOBE GmbH | ||
* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
/* | ||
* * | ||
* Open Bank Project - API Explorer II | ||
* Copyright (C) 2023-2024, TESOBE GmbH | ||
* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
/* | ||
* * | ||
* Open Bank Project - API Explorer II | ||
* Copyright (C) 2023-2024, TESOBE GmbH | ||
* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
/* | ||
* * | ||
* Open Bank Project - API Explorer II | ||
* Copyright (C) 2023-2024, TESOBE GmbH | ||
* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
/* | ||
* * | ||
* Open Bank Project - API Explorer II | ||
* Copyright (C) 2023-2024, TESOBE GmbH | ||
* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
/* | ||
* * | ||
* Open Bank Project - API Explorer II | ||
* Copyright (C) 2023-2024, TESOBE GmbH | ||
* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
/* | ||
* * | ||
* Open Bank Project - API Explorer II | ||
* Copyright (C) 2023-2024, TESOBE GmbH | ||
* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
/* | ||
* * | ||
* Open Bank Project - API Explorer II | ||
* Copyright (C) 2023-2024, TESOBE GmbH | ||
* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
/* | ||
* * | ||
* Open Bank Project - API Explorer II | ||
* Copyright (C) 2023-2024, TESOBE GmbH | ||
* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
/* | ||
* * | ||
* Open Bank Project - API Explorer II | ||
* Copyright (C) 2023-2024, TESOBE GmbH | ||
* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
/* | ||
* * | ||
* Open Bank Project - API Explorer II | ||
* Copyright (C) 2023-2024, TESOBE GmbH | ||
* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
/* | ||
* * | ||
* Open Bank Project - API Explorer II | ||
* Copyright (C) 2023-2024, TESOBE GmbH | ||
* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
/* | ||
* * | ||
* Open Bank Project - API Explorer II | ||
* Copyright (C) 2023-2024, TESOBE GmbH | ||
* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
/* | ||
* * | ||
* Open Bank Project - API Explorer II | ||
* Copyright (C) 2023-2024, TESOBE GmbH | ||
* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
/* | ||
* * | ||
* Open Bank Project - API Explorer II | ||
* Copyright (C) 2023-2024, TESOBE GmbH | ||
* | ||
|
Oops, something went wrong.