From 54802d8343dcb710ced4d009995a8cc796915039 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Sun, 24 Jun 2018 13:03:39 +0300 Subject: Added password encryption. Core version 1.0.0.1 Machine Studio version 1.0.0.4 Added forced update to machine studio versions db. Removed pubxml files from gitignore. Implemented a publish profile for machine studio update service. Worked on twine.local IIS & FTP !! :( Implemented virtual host names for publish and download (MS versions) FTP sites. --- .../MachineStudioUpdateService.svc.cs | 19 ++++++++++++++----- .../Publish To Twine Local Via FTP.pubxml | 21 +++++++++++++++++++++ .../Tango.MachineStudio.UpdateService.csproj | 2 +- .../Web.Debug.config | 5 +++++ .../Web.Release.config | 5 +++++ .../Tango.MachineStudio.UpdateService/Web.config | 22 +++++++++++++++++++--- 6 files changed, 65 insertions(+), 9 deletions(-) create mode 100644 Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UpdateService/Properties/PublishProfiles/Publish To Twine Local Via FTP.pubxml (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UpdateService') diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UpdateService/MachineStudioUpdateService.svc.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UpdateService/MachineStudioUpdateService.svc.cs index 9b03cda30..4438ad188 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UpdateService/MachineStudioUpdateService.svc.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UpdateService/MachineStudioUpdateService.svc.cs @@ -30,6 +30,8 @@ namespace Tango.MachineStudio.UpdateService public String Comments { get; set; } + public bool ForcedUpdate { get; set; } + public String FilePath { get; set; } } @@ -48,7 +50,7 @@ namespace Tango.MachineStudio.UpdateService { CheckForUpdatesResponse response = new CheckForUpdatesResponse(); - using (ObservablesContext db = ObservablesContext.CreateDefaultForWeb()) + using (ObservablesContext db = ObservablesContext.CreateDefault(GetServerAddress())) { db.Configuration.LazyLoadingEnabled = false; @@ -98,7 +100,7 @@ namespace Tango.MachineStudio.UpdateService { UploadVersionResponse response = new UploadVersionResponse(); - using (ObservablesContext db = ObservablesContext.CreateDefaultForWeb()) + using (ObservablesContext db = ObservablesContext.CreateDefault(GetServerAddress())) { db.Configuration.LazyLoadingEnabled = false; @@ -134,6 +136,7 @@ namespace Tango.MachineStudio.UpdateService { UserGuid = user.Guid, Comments = request.Comments, + ForcedUpdate = request.ForcedUpdate, Token = response.Token, Version = request.Version, FilePath = response.FilePath, @@ -169,7 +172,7 @@ namespace Tango.MachineStudio.UpdateService { _pendingUploads.RemoveAll(x => x.Token == upload.Token); - using (ObservablesContext db = ObservablesContext.CreateDefaultForWeb()) + using (ObservablesContext db = ObservablesContext.CreateDefault(GetServerAddress())) { db.Configuration.LazyLoadingEnabled = false; @@ -178,7 +181,8 @@ namespace Tango.MachineStudio.UpdateService Comments = upload.Comments, FtpFilePath = upload.FilePath, UserGuid = upload.UserGuid, - Version = upload.Version + Version = upload.Version, + ForceUpdate = upload.ForcedUpdate, }); db.SaveChanges(); @@ -200,7 +204,7 @@ namespace Tango.MachineStudio.UpdateService { try { - using (ObservablesContext db = ObservablesContext.CreateDefaultForWeb()) + using (ObservablesContext db = ObservablesContext.CreateDefault(GetServerAddress())) { return db.MachineStudioVersions.FirstOrDefault().Version; } @@ -210,5 +214,10 @@ namespace Tango.MachineStudio.UpdateService throw new FaultException(ex.ToString()); } } + + private String GetServerAddress() + { + return ConfigurationManager.AppSettings["ServerAddress"].ToString(); + } } } diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UpdateService/Properties/PublishProfiles/Publish To Twine Local Via FTP.pubxml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UpdateService/Properties/PublishProfiles/Publish To Twine Local Via FTP.pubxml new file mode 100644 index 000000000..64a875aa4 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UpdateService/Properties/PublishProfiles/Publish To Twine Local Via FTP.pubxml @@ -0,0 +1,21 @@ + + + + + FTP + Release + Any CPU + + True + False + twine01 + False + True + + MachineStudioUpdateService|Roy + <_SavePWD>True + + \ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UpdateService/Tango.MachineStudio.UpdateService.csproj b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UpdateService/Tango.MachineStudio.UpdateService.csproj index 08d40b49a..8dc2d264e 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UpdateService/Tango.MachineStudio.UpdateService.csproj +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UpdateService/Tango.MachineStudio.UpdateService.csproj @@ -81,7 +81,7 @@ - + Web.config diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UpdateService/Web.Debug.config b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UpdateService/Web.Debug.config index fae9cfefa..0b30d99e4 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UpdateService/Web.Debug.config +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UpdateService/Web.Debug.config @@ -14,6 +14,11 @@ xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/> --> + + + + + + + + + + @@ -6,15 +6,31 @@ + - + - + + + + + + + + + + + + + + + -- cgit v1.3.1