private void AddUserPassword() { var settings = CementSettings.Get(); if (settings.UserName == null || settings.EncryptedPassword == null) { return; } startInfo.Domain = settings.Domain ?? Environment.MachineName; startInfo.UserName = settings.UserName; var decryptedPassword = Helper.Decrypt(settings.EncryptedPassword); var password = new SecureString(); foreach (var c in decryptedPassword) { password.AppendChar(c); } startInfo.Password = password; }
public static IList <Package> GetPackages() { return(CementSettings.Get().Packages ?? throw new CementException("Packages not specified.")); }
public static IList <Package> GetPackages() { return(CementSettings.Get().Packages); }
public string GetNewCommitHash() { var webClient = new WebClient(); try { var infoModel = JsonConvert.DeserializeObject <InfoResponseModel>(webClient.DownloadString($"{CementSettings.Get().CementServer}/api/v1/cement/info/head/" + branch)); return(infoModel?.CommitHash); } catch (WebException ex) { log.LogError("Fail self-update ", ex); if (ex.Status == WebExceptionStatus.ProtocolError && ex.Response != null) { var resp = (HttpWebResponse)ex.Response; if (resp.StatusCode == HttpStatusCode.NotFound) // HTTP 404 { ConsoleWriter.WriteError("Failed to look for updates on branch " + branch + ". Server responsed 404"); return(null); } } ConsoleWriter.WriteError("Failed to look for updates on branch " + branch + ": " + ex.Message); return(null); } }