mirror of
https://github.com/kovetskiy/mark.git
synced 2025-12-15 05:37:36 +08:00
Rename insecure flag to insecure-skip-tls-verify
This commit is contained in:
parent
b36d7aa135
commit
e82c425471
@ -98,7 +98,7 @@ func (tracer *tracer) Printf(format string, args ...interface{}) {
|
|||||||
log.Tracef(nil, tracer.prefix+" "+format, args...)
|
log.Tracef(nil, tracer.prefix+" "+format, args...)
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewAPI(baseURL string, username string, password string, insecure bool) *API {
|
func NewAPI(baseURL string, username string, password string, insecureSkipVerify bool) *API {
|
||||||
var auth *gopencils.BasicAuth
|
var auth *gopencils.BasicAuth
|
||||||
if username != "" {
|
if username != "" {
|
||||||
auth = &gopencils.BasicAuth{
|
auth = &gopencils.BasicAuth{
|
||||||
@ -108,7 +108,7 @@ func NewAPI(baseURL string, username string, password string, insecure bool) *AP
|
|||||||
}
|
}
|
||||||
|
|
||||||
var httpClient *http.Client
|
var httpClient *http.Client
|
||||||
if insecure {
|
if insecureSkipVerify {
|
||||||
httpClient = &http.Client{
|
httpClient = &http.Client{
|
||||||
Transport: &http.Transport{
|
Transport: &http.Transport{
|
||||||
TLSClientConfig: &tls.Config{
|
TLSClientConfig: &tls.Config{
|
||||||
|
|||||||
22
util/cli.go
22
util/cli.go
@ -49,7 +49,7 @@ func RunMark(ctx context.Context, cmd *cli.Command) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
api := confluence.NewAPI(creds.BaseURL, creds.Username, creds.Password, cmd.Bool("insecure"))
|
api := confluence.NewAPI(creds.BaseURL, creds.Username, creds.Password, cmd.Bool("insecure-skip-tls-verify"))
|
||||||
|
|
||||||
files, err := doublestar.FilepathGlob(cmd.String("files"))
|
files, err := doublestar.FilepathGlob(cmd.String("files"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -220,11 +220,11 @@ func processFile(
|
|||||||
}
|
}
|
||||||
|
|
||||||
cfg := types.MarkConfig{
|
cfg := types.MarkConfig{
|
||||||
MermaidScale: cmd.Float("mermaid-scale"),
|
MermaidScale: cmd.Float("mermaid-scale"),
|
||||||
D2Scale: cmd.Float("d2-scale"),
|
D2Scale: cmd.Float("d2-scale"),
|
||||||
DropFirstH1: cmd.Bool("drop-h1"),
|
DropFirstH1: cmd.Bool("drop-h1"),
|
||||||
StripNewlines: cmd.Bool("strip-linebreaks"),
|
StripNewlines: cmd.Bool("strip-linebreaks"),
|
||||||
Features: cmd.StringSlice("features"),
|
Features: cmd.StringSlice("features"),
|
||||||
}
|
}
|
||||||
html, _ := mark.CompileMarkdown(markdown, stdlib, file, cfg)
|
html, _ := mark.CompileMarkdown(markdown, stdlib, file, cfg)
|
||||||
fmt.Println(html)
|
fmt.Println(html)
|
||||||
@ -299,11 +299,11 @@ func processFile(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
cfg := types.MarkConfig{
|
cfg := types.MarkConfig{
|
||||||
MermaidScale: cmd.Float("mermaid-scale"),
|
MermaidScale: cmd.Float("mermaid-scale"),
|
||||||
D2Scale: cmd.Float("d2-scale"),
|
D2Scale: cmd.Float("d2-scale"),
|
||||||
DropFirstH1: cmd.Bool("drop-h1"),
|
DropFirstH1: cmd.Bool("drop-h1"),
|
||||||
StripNewlines: cmd.Bool("strip-linebreaks"),
|
StripNewlines: cmd.Bool("strip-linebreaks"),
|
||||||
Features: cmd.StringSlice("features"),
|
Features: cmd.StringSlice("features"),
|
||||||
}
|
}
|
||||||
|
|
||||||
html, inlineAttachments := mark.CompileMarkdown(markdown, stdlib, file, cfg)
|
html, inlineAttachments := mark.CompileMarkdown(markdown, stdlib, file, cfg)
|
||||||
|
|||||||
@ -197,10 +197,10 @@ var Flags = []cli.Flag{
|
|||||||
Sources: cli.NewValueSourceChain(cli.EnvVar("MARK_FEATURES"), altsrctoml.TOML("features", altsrc.NewStringPtrSourcer(&filename))),
|
Sources: cli.NewValueSourceChain(cli.EnvVar("MARK_FEATURES"), altsrctoml.TOML("features", altsrc.NewStringPtrSourcer(&filename))),
|
||||||
},
|
},
|
||||||
&cli.BoolFlag{
|
&cli.BoolFlag{
|
||||||
Name: "insecure",
|
Name: "insecure-skip-tls-verify",
|
||||||
Value: false,
|
Value: false,
|
||||||
Usage: "skip TLS certificate verification (useful for self-signed certificates)",
|
Usage: "skip TLS certificate verification (useful for self-signed certificates)",
|
||||||
Sources: cli.NewValueSourceChain(cli.EnvVar("MARK_INSECURE"), altsrctoml.TOML("insecure", altsrc.NewStringPtrSourcer(&filename))),
|
Sources: cli.NewValueSourceChain(cli.EnvVar("MARK_INSECURE_SKIP_TLS_VERIFY"), altsrctoml.TOML("insecure-skip-tls-verify", altsrc.NewStringPtrSourcer(&filename))),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user