cookiecloud

package
v0.1.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 24, 2025 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Command = &cobra.Command{
	Use:     "cookiecloud",
	Aliases: []string{"cc"},
	Short:   "Use cookiecloud to sync site cookies or import sites.",
	Long: `Use cookiecloud to sync site cookies or import sites.
To use this feature, add the cookiecloud servers to config file, e.g. :

ptool.toml
----------
[[cookieclouds]]
server = 'https://cookiecloud.example.com'
uuid = 'uuid'
password = 'password'
----------

See also:
* CookieCloud: https://github.com/easychen/CookieCloud`,
	Args: cobra.MatchAll(cobra.ExactArgs(0), cobra.OnlyValidArgs),
}

Functions

func ParseProfile

func ParseProfile(profile string) []*config.CookiecloudConfigStruct

Types

type Ccdata_struct

type Ccdata_struct struct {
	Label string
	Sites []string
	Data  *CookiecloudData
}
type Cookie struct {
	Domain string
	Name   string
	Value  string
	Path   string
}

func (*Cookie) IsCDN added in v0.1.10

func (cookie *Cookie) IsCDN() bool

Check whether this cookie is set by the CDN or similar reverse-proxy services, which is not associated with authentication & authorization.

type CookieCloudBody

type CookieCloudBody struct {
	Uuid      string `json:"uuid,omitempty"`
	Encrypted string `json:"encrypted,omitempty"`
}

type CookiecloudData

type CookiecloudData struct {
	// host => [{name,value,domain}...]
	Cookie_data map[string][]map[string]any `json:"cookie_data"`
}

func GetCookiecloudData

func GetCookiecloudData(server string, uuid string, password string,
	proxy string, timeout int64) (*CookiecloudData, error)

If proxy is empty, will try to get proxy from HTTP_PROXY & HTTPS_PROXY envs.

func (*CookiecloudData) GetEffectiveCookie

func (cookiecloudData *CookiecloudData) GetEffectiveCookie(urlOrDomain string, all bool, format string) (
	string, []*Cookie, error)

If all is false, only return cookies which is valid for both the hostname and path part of the urlOrDomain, in the case of urlOrDomain being a domain, it's path is assumed to be "/". If all is true, path check is skipped and all cookies which domain match will be included. format: "http" - http request "Cookie" header; "js" - JavaScript document.cookie="" code snippet

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL