Add license_key support for masque and warp Cloudflare profiles

This commit is contained in:
Shtorm
2026-08-11 23:36:15 +03:00
parent 6126cc2158
commit e8f6936480
7 changed files with 44 additions and 1 deletions

View File

@@ -237,6 +237,11 @@ func (w *Endpoint) createConfig() (*Config, error) {
return nil, err
}
}
if w.options.Profile.LicenseKey != "" && profile.Account.License != w.options.Profile.LicenseKey {
if _, err = api.UpdateAccount(w.ctx, profile.Token, profile.ID, w.options.Profile.LicenseKey); err != nil {
return nil, E.New("failed to apply license key: ", err)
}
}
return &Config{
PrivateKey: privateKey.String(),
Interface: profile.Config.Interface,