forked from wailsapp/wails
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'wailsapp:master' into master
- Loading branch information
Showing
551 changed files
with
42,890 additions
and
259 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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Security Policy | ||
|
||
## Supported Versions | ||
|
||
| Version | Supported | | ||
| ------- | ------------------ | | ||
| 2.x.x | :white_check_mark: | | ||
| 3.0.x-alpha | :x: | | ||
|
||
|
||
## Reporting a Vulnerability | ||
|
||
If you believe you have found a security vulnerability in our project, we encourage you to let us know right away. | ||
We will investigate all legitimate reports and do our best to quickly fix the problem. | ||
|
||
Before reporting though, please review our security policy below. | ||
|
||
### How to Report | ||
|
||
To report a security vulnerability, please use GitHub's [private vulnerability reporting](https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing-information-about-vulnerabilities/privately-reporting-a-security-vulnerability) feature. If possible, please include as much information as possible. | ||
This may include steps to reproduce, impact of the vulnerability, and anything else you believe would help us understand the problem. | ||
**Please do not include any sensitive or personal information in your report**. | ||
|
||
### What to Expect | ||
|
||
When you report a vulnerability, here's what you can expect: | ||
|
||
- **Acknowledgement**: We will acknowledge your email within 48 hours, and you'll receive a more detailed response to your email within 72 hours indicating the next steps in handling your report. | ||
|
||
- **Updates**: After the initial reply to your report, our team will keep you informed of the progress being made towards a fix and full announcement. These updates will be sent at least once a week. | ||
|
||
- **Confidentiality**: We will maintain strict confidentiality of your report until the security issue is resolved. | ||
|
||
- **Issue Resolution**: If the issue is confirmed, we will release a patch as soon as possible depending on complexity of the fix. | ||
|
||
- **Recognition**: We recognize and appreciate every individual who helps us identify and fix vulnerabilities in our project. While we do not currently have a bounty program, we would be happy to publicly acknowledge your responsible disclosure. | ||
|
||
We strive to make Wails safe for everyone, and we greatly appreciate the assistance of security researchers and users in helping us identify and fix vulnerabilities. Thank you for your contribution to the security of this project. |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,103 +1,5 @@ | ||
package flags | ||
|
||
import ( | ||
"fmt" | ||
"os" | ||
"runtime" | ||
"strings" | ||
|
||
"github.com/leaanthony/slicer" | ||
"github.com/pterm/pterm" | ||
"github.com/wailsapp/wails/v2/internal/system" | ||
) | ||
|
||
type Common struct { | ||
NoColour bool `description:"Disable colour in output"` | ||
} | ||
|
||
type Target struct { | ||
Platform string | ||
Arch string | ||
} | ||
|
||
func defaultTarget() Target { | ||
defaultPlatform := os.Getenv("GOOS") | ||
if defaultPlatform == "" { | ||
defaultPlatform = runtime.GOOS | ||
} | ||
defaultArch := os.Getenv("GOARCH") | ||
if defaultArch == "" { | ||
if system.IsAppleSilicon { | ||
defaultArch = "arm64" | ||
} else { | ||
defaultArch = runtime.GOARCH | ||
} | ||
} | ||
|
||
return Target{ | ||
Platform: defaultPlatform, | ||
Arch: defaultArch, | ||
} | ||
} | ||
|
||
type TargetsCollection []Target | ||
|
||
func (c TargetsCollection) MacTargetsCount() int { | ||
count := 0 | ||
|
||
for _, t := range c { | ||
if strings.HasPrefix(t.Platform, "darwin") { | ||
count++ | ||
} | ||
} | ||
|
||
return count | ||
} | ||
|
||
func (t Target) String() string { | ||
if t.Arch != "" { | ||
return fmt.Sprintf("%s/%s", t.Platform, t.Arch) | ||
} | ||
|
||
return t.Platform | ||
} | ||
|
||
func parseTargets(platform string) TargetsCollection { | ||
allowedPlatforms := map[string]bool{ | ||
"windows": true, | ||
"linux": true, | ||
"darwin": true, | ||
} | ||
|
||
if !allowedPlatforms[platform] { | ||
pterm.Error.Println("platform argument must be one of 'windows', 'linux', or 'darwin'") | ||
os.Exit(1) | ||
} | ||
|
||
var result []Target | ||
var targets slicer.StringSlicer | ||
|
||
targets.AddSlice(strings.Split(platform, ",")) | ||
targets.Deduplicate() | ||
|
||
targets.Each(func(platform string) { | ||
target := Target{ | ||
Platform: "", | ||
Arch: "", | ||
} | ||
|
||
platformSplit := strings.Split(platform, "/") | ||
|
||
target.Platform = platformSplit[0] | ||
|
||
if len(platformSplit) > 1 { | ||
target.Arch = platformSplit[1] | ||
} else { | ||
target.Arch = defaultTarget().Arch | ||
} | ||
|
||
result = append(result, target) | ||
}) | ||
|
||
return result | ||
} |
Oops, something went wrong.