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. --- .gitignore | 2 - Software/DB/Tango.db | Bin 12242944 -> 12242944 bytes Software/DB/Tango.mdf | Bin 75497472 -> 75497472 bytes Software/DB/Tango_log.ldf | Bin 1572864 -> 1572864 bytes .../Update/UpdateServiceHelper.cs | 4 +- .../Update/UploadVersionRequest.cs | 3 + .../Tango.MachineStudio.Publisher/MainWindow.xaml | 2 + .../Tango.MachineStudio.Publisher/MainWindowVM.cs | 9 ++ .../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 +++- .../Tango.BL/Entities/MachineStudioVersion.cs | 20 ++++ .../Tango.BL/ObservablesContextExtension.cs | 9 -- .../Tango.DAL.Remote/DB/MACHINE_STUDIO_VERSIONS.cs | 1 + .../Tango.DAL.Remote/DB/RemoteADO.edmx | 3 + .../Tango.DAL.Remote/DB/RemoteADO.edmx.diagram | 126 ++++++++++----------- Software/Visual_Studio/Versioning/Core.cs | 4 +- Software/Visual_Studio/Versioning/MachineStudio.cs | 4 +- .../Web/Tango.MachineService/App_Data/Tango.db | Bin 12238848 -> 12242944 bytes 22 files changed, 172 insertions(+), 89 deletions(-) create mode 100644 Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UpdateService/Properties/PublishProfiles/Publish To Twine Local Via FTP.pubxml diff --git a/.gitignore b/.gitignore index ceda39a8f..22a80df8a 100644 --- a/.gitignore +++ b/.gitignore @@ -150,8 +150,6 @@ publish/ *.azurePubxml # TODO: Comment the next line if you want to checkin your web deploy settings # but database connection strings (with potential passwords) will be unencrypted -*.pubxml -*.publishproj # Microsoft Azure Web App publish settings. Comment the next line if you want to # checkin your Azure Web App publish settings, but sensitive information contained diff --git a/Software/DB/Tango.db b/Software/DB/Tango.db index a42b5d174..8dbc6d1f9 100644 Binary files a/Software/DB/Tango.db and b/Software/DB/Tango.db differ diff --git a/Software/DB/Tango.mdf b/Software/DB/Tango.mdf index b847f2e6f..b7e028b76 100644 Binary files a/Software/DB/Tango.mdf and b/Software/DB/Tango.mdf differ diff --git a/Software/DB/Tango_log.ldf b/Software/DB/Tango_log.ldf index d9e6c0c96..018e24e2e 100644 Binary files a/Software/DB/Tango_log.ldf and b/Software/DB/Tango_log.ldf differ diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Update/UpdateServiceHelper.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Update/UpdateServiceHelper.cs index 2194ec5cf..067e4470d 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Update/UpdateServiceHelper.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Update/UpdateServiceHelper.cs @@ -13,8 +13,8 @@ namespace Tango.MachineStudio.Common.Update public static ChannelFactory GetUpdateServiceChannel() { BasicHttpBinding binding = new BasicHttpBinding(BasicHttpSecurityMode.None); - binding.ReceiveTimeout = TimeSpan.FromSeconds(20); - binding.SendTimeout = TimeSpan.FromSeconds(20); + binding.ReceiveTimeout = TimeSpan.FromSeconds(60); + binding.SendTimeout = TimeSpan.FromSeconds(60); binding.MaxBufferPoolSize = 6553600; binding.MaxBufferSize = 6553600; binding.MaxReceivedMessageSize = 6553600; diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Update/UploadVersionRequest.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Update/UploadVersionRequest.cs index 71ce04f1f..18f29eda2 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Update/UploadVersionRequest.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Update/UploadVersionRequest.cs @@ -21,5 +21,8 @@ namespace Tango.MachineStudio.Common.Update [DataMember] public String Comments { get; set; } + + [DataMember] + public bool ForcedUpdate { get; set; } } } diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Publisher/MainWindow.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Publisher/MainWindow.xaml index abbfa0aa6..404faf4ab 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Publisher/MainWindow.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Publisher/MainWindow.xaml @@ -48,6 +48,8 @@ Comments + + Forced Update diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Publisher/MainWindowVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Publisher/MainWindowVM.cs index 622d3b0d0..11222e806 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Publisher/MainWindowVM.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Publisher/MainWindowVM.cs @@ -50,6 +50,14 @@ namespace Tango.MachineStudio.Publisher set { _comments = value; RaisePropertyChangedAuto(); } } + private bool _forcesUpdate; + + public bool ForcedUpdate + { + get { return _forcesUpdate; } + set { _forcesUpdate = value; RaisePropertyChangedAuto(); } + } + private String _currentVersion; public String CurrentVersion @@ -135,6 +143,7 @@ namespace Tango.MachineStudio.Publisher Password = Password, Version = CurrentVersion.ToString(), Comments = Comments, + ForcedUpdate = ForcedUpdate, }); tempFile = Path.Combine(Path.GetTempPath(), response.FileName); 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 @@ + - + - + + + + + + + + + + + + + + + diff --git a/Software/Visual_Studio/Tango.BL/Entities/MachineStudioVersion.cs b/Software/Visual_Studio/Tango.BL/Entities/MachineStudioVersion.cs index ccc6df2cb..63f6563ed 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/MachineStudioVersion.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/MachineStudioVersion.cs @@ -105,6 +105,26 @@ namespace Tango.BL.Entities } + protected Boolean _forceupdate; + /// + /// Gets or sets the machinestudioversion force update. + /// + [Column("FORCE_UPDATE")] + + public Boolean ForceUpdate + { + get + { + return _forceupdate; + } + + set + { + _forceupdate = value; RaisePropertyChanged(nameof(ForceUpdate)); + } + + } + protected User _user; /// /// Gets or sets the machinestudioversion user. diff --git a/Software/Visual_Studio/Tango.BL/ObservablesContextExtension.cs b/Software/Visual_Studio/Tango.BL/ObservablesContextExtension.cs index 4c703a96b..8c0957e9a 100644 --- a/Software/Visual_Studio/Tango.BL/ObservablesContextExtension.cs +++ b/Software/Visual_Studio/Tango.BL/ObservablesContextExtension.cs @@ -80,14 +80,5 @@ namespace Tango.BL return new ObservablesContext(source); } } - - /// - /// Creates a default remote database context by the address specified in . - /// - /// - public static ObservablesContext CreateDefaultForWeb() - { - return new ObservablesContext("localhost\\SQLTWINE"); - } } } diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/MACHINE_STUDIO_VERSIONS.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/MACHINE_STUDIO_VERSIONS.cs index 9d0fa2365..622c0a0df 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/MACHINE_STUDIO_VERSIONS.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/MACHINE_STUDIO_VERSIONS.cs @@ -21,6 +21,7 @@ namespace Tango.DAL.Remote.DB public string FTP_FILE_PATH { get; set; } public string COMMENTS { get; set; } public string USER_GUID { get; set; } + public bool FORCE_UPDATE { get; set; } public virtual USER USER { get; set; } } diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx index 345ae44a6..2ee958a76 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx @@ -623,6 +623,7 @@ + @@ -3445,6 +3446,7 @@ + @@ -5512,6 +5514,7 @@ + diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram index 758efb978..444ab934a 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram @@ -5,78 +5,78 @@ - - - - - - + + + + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - + + - - - - - - - - - - - + + + + + + + + + + + diff --git a/Software/Visual_Studio/Versioning/Core.cs b/Software/Visual_Studio/Versioning/Core.cs index bec2da6bb..48dbbbe41 100644 --- a/Software/Visual_Studio/Versioning/Core.cs +++ b/Software/Visual_Studio/Versioning/Core.cs @@ -9,5 +9,5 @@ using System.Runtime.InteropServices; [assembly: AssemblyCopyright("Copyright © Twine LTD 2017")] [assembly: AssemblyTrademark("Twine LTD")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyVersion("1.0.0.1")] +[assembly: AssemblyFileVersion("1.0.0.1")] diff --git a/Software/Visual_Studio/Versioning/MachineStudio.cs b/Software/Visual_Studio/Versioning/MachineStudio.cs index 0a2db2385..1b1f0b15b 100644 --- a/Software/Visual_Studio/Versioning/MachineStudio.cs +++ b/Software/Visual_Studio/Versioning/MachineStudio.cs @@ -9,5 +9,5 @@ using System.Runtime.InteropServices; [assembly: AssemblyCopyright("Copyright © Twine LTD 2017")] [assembly: AssemblyTrademark("Twine LTD")] -[assembly: AssemblyVersion("1.0.0.3")] -[assembly: AssemblyFileVersion("1.0.0.3")] +[assembly: AssemblyVersion("1.0.0.4")] +[assembly: AssemblyFileVersion("1.0.0.4")] diff --git a/Software/Visual_Studio/Web/Tango.MachineService/App_Data/Tango.db b/Software/Visual_Studio/Web/Tango.MachineService/App_Data/Tango.db index b84eaae37..a42b5d174 100644 Binary files a/Software/Visual_Studio/Web/Tango.MachineService/App_Data/Tango.db and b/Software/Visual_Studio/Web/Tango.MachineService/App_Data/Tango.db differ -- cgit v1.3.1