From bedab0f4aa81f760c6459ea9d1bf7b185a820aa2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?N=C3=ADcolas=20Lazarte=20Kaqui?= Date: Tue, 20 Sep 2011 09:13:42 -0300 Subject: [PATCH 1/9] Use password to access channel on IRC --- SparkleLib/SparkleListenerBase.cs | 12 ++++++++++-- SparkleLib/SparkleListenerIrc.cs | 6 +++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/SparkleLib/SparkleListenerBase.cs b/SparkleLib/SparkleListenerBase.cs index b9293841..e212c919 100644 --- a/SparkleLib/SparkleListenerBase.cs +++ b/SparkleLib/SparkleListenerBase.cs @@ -43,6 +43,10 @@ namespace SparkleLib { { string uri = SparkleConfig.DefaultConfig.GetFolderOptionalAttribute ( folder_name, "announcements_url"); + + string key = SparkleConfig.DefaultConfig.GetFolderOptionalAttribute ( + folder_name, "key"); + if (uri == null) { // This is SparkleShare's centralized notification service. @@ -53,6 +57,10 @@ namespace SparkleLib { uri = "irc://204.62.14.135/"; } + if (key == null) { + key = "12345"; + } + Uri announce_uri = new Uri (uri); // We use only one listener per server to keep @@ -74,10 +82,10 @@ namespace SparkleLib { listeners.Add (new SparkleListenerTcp (announce_uri, folder_identifier)); break; case "irc": - listeners.Add (new SparkleListenerIrc (announce_uri, folder_identifier)); + listeners.Add (new SparkleListenerIrc (announce_uri, folder_identifier, key)); break; default: - listeners.Add (new SparkleListenerIrc (announce_uri, folder_identifier)); + listeners.Add (new SparkleListenerIrc (announce_uri, folder_identifier, key)); break; } diff --git a/SparkleLib/SparkleListenerIrc.cs b/SparkleLib/SparkleListenerIrc.cs index c7c102bf..79027646 100644 --- a/SparkleLib/SparkleListenerIrc.cs +++ b/SparkleLib/SparkleListenerIrc.cs @@ -29,9 +29,10 @@ namespace SparkleLib { private Thread thread; private IrcClient client; private string nick; + private string key; - public SparkleListenerIrc (Uri server, string folder_identifier) : + public SparkleListenerIrc (Uri server, string folder_identifier, string key) : base (server, folder_identifier) { // Try to get a uniqueish nickname @@ -41,6 +42,8 @@ namespace SparkleLib { // with a number, so prefix an alphabetic character this.nick = "s" + this.nick.Substring (0, 7); + this.key = key; + base.channels.Add ("#" + folder_identifier); this.client = new IrcClient () { @@ -110,6 +113,7 @@ namespace SparkleLib { SparkleHelpers.DebugInfo ("ListenerIrc", "Joining channel " + channel); this.client.RfcJoin (channel); this.client.RfcMode (channel, "+s"); + this.client.RfcMode (channel, "+k " + key); } // List to the channel, this blocks the thread From 7a250888ced24e5bca69643aea8f39f5c6e917d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?N=C3=ADcolas=20Lazarte=20Kaqui?= Date: Tue, 20 Sep 2011 13:20:05 -0300 Subject: [PATCH 2/9] Fixing wrong commit --- SparkleLib/SparkleListenerIrc.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/SparkleLib/SparkleListenerIrc.cs b/SparkleLib/SparkleListenerIrc.cs index 79027646..5b65f725 100644 --- a/SparkleLib/SparkleListenerIrc.cs +++ b/SparkleLib/SparkleListenerIrc.cs @@ -142,6 +142,7 @@ namespace SparkleLib { SparkleHelpers.DebugInfo ("ListenerIrc", "Joining channel " + channel); this.client.RfcJoin (channel); this.client.RfcMode (channel, "+s"); + this.client.RfcMode (channel, "+k " + key); } } } From 8a7a71004b686abc86b2605746aab866119674bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?N=C3=ADcolas=20Lazarte=20Kaqui?= Date: Tue, 20 Sep 2011 15:11:38 -0300 Subject: [PATCH 3/9] When not set the key user try to join no key --- SparkleLib/SparkleListenerBase.cs | 4 ---- SparkleLib/SparkleListenerIrc.cs | 18 ++++++++++++++---- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/SparkleLib/SparkleListenerBase.cs b/SparkleLib/SparkleListenerBase.cs index e212c919..f865ffed 100644 --- a/SparkleLib/SparkleListenerBase.cs +++ b/SparkleLib/SparkleListenerBase.cs @@ -57,10 +57,6 @@ namespace SparkleLib { uri = "irc://204.62.14.135/"; } - if (key == null) { - key = "12345"; - } - Uri announce_uri = new Uri (uri); // We use only one listener per server to keep diff --git a/SparkleLib/SparkleListenerIrc.cs b/SparkleLib/SparkleListenerIrc.cs index 5b65f725..ab7a03ed 100644 --- a/SparkleLib/SparkleListenerIrc.cs +++ b/SparkleLib/SparkleListenerIrc.cs @@ -111,9 +111,14 @@ namespace SparkleLib { foreach (string channel in base.channels) { SparkleHelpers.DebugInfo ("ListenerIrc", "Joining channel " + channel); - this.client.RfcJoin (channel); + if (key != null) { + SparkleHelpers.DebugInfo ("ListenerIrc", "Ussing key"); + this.client.RfcJoin (channel, key); + this.client.RfcMode (channel, "+k " + key); + } else { + this.client.RfcJoin (channel); + } this.client.RfcMode (channel, "+s"); - this.client.RfcMode (channel, "+k " + key); } // List to the channel, this blocks the thread @@ -140,9 +145,14 @@ namespace SparkleLib { if (IsConnected) { SparkleHelpers.DebugInfo ("ListenerIrc", "Joining channel " + channel); - this.client.RfcJoin (channel); + if (key != null) { + SparkleHelpers.DebugInfo ("ListenerIrc", "Ussing key"); + this.client.RfcJoin (channel, key); + this.client.RfcMode (channel, "+k " + key); + } else { + this.client.RfcJoin (channel); + } this.client.RfcMode (channel, "+s"); - this.client.RfcMode (channel, "+k " + key); } } } From a88aea266eae2e1df850266110024279e10dfd7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?N=C3=ADcolas=20Lazarte=20Kaqui?= Date: Tue, 11 Oct 2011 12:11:12 -0300 Subject: [PATCH 4/9] included setting to allow or disallow access to key channels without --- SparkleLib/SparkleListenerBase.cs | 19 +++++++++++++++---- SparkleLib/SparkleListenerIrc.cs | 27 +++++++++++++++++++++------ 2 files changed, 36 insertions(+), 10 deletions(-) diff --git a/SparkleLib/SparkleListenerBase.cs b/SparkleLib/SparkleListenerBase.cs index f865ffed..93cf1dae 100644 --- a/SparkleLib/SparkleListenerBase.cs +++ b/SparkleLib/SparkleListenerBase.cs @@ -43,10 +43,14 @@ namespace SparkleLib { { string uri = SparkleConfig.DefaultConfig.GetFolderOptionalAttribute ( folder_name, "announcements_url"); - + + // Key to turn the channel access more safely. string key = SparkleConfig.DefaultConfig.GetFolderOptionalAttribute ( folder_name, "key"); - + + // Identifier to define access in IRC channel when no key is defined + string dangerous_access = SparkleConfig.DefaultConfig.GetFolderOptionalAttribute ( + folder_name, "dangerous_access"); if (uri == null) { // This is SparkleShare's centralized notification service. @@ -57,6 +61,13 @@ namespace SparkleLib { uri = "irc://204.62.14.135/"; } + // This action ensures that the Sparkleshare function normally when the key is not defined. + // It is recommended that the user asked a question to see whether or not to allow access + // to the channel without a key. + if (dangerous_access == null) { + dangerous_access = "yes"; + } + Uri announce_uri = new Uri (uri); // We use only one listener per server to keep @@ -78,10 +89,10 @@ namespace SparkleLib { listeners.Add (new SparkleListenerTcp (announce_uri, folder_identifier)); break; case "irc": - listeners.Add (new SparkleListenerIrc (announce_uri, folder_identifier, key)); + listeners.Add (new SparkleListenerIrc (announce_uri, folder_identifier, key, dangerous_access)); break; default: - listeners.Add (new SparkleListenerIrc (announce_uri, folder_identifier, key)); + listeners.Add (new SparkleListenerIrc (announce_uri, folder_identifier, key, dangerous_access)); break; } diff --git a/SparkleLib/SparkleListenerIrc.cs b/SparkleLib/SparkleListenerIrc.cs index ab7a03ed..91e4cc40 100644 --- a/SparkleLib/SparkleListenerIrc.cs +++ b/SparkleLib/SparkleListenerIrc.cs @@ -30,9 +30,10 @@ namespace SparkleLib { private IrcClient client; private string nick; private string key; + private string dangerous_access; - public SparkleListenerIrc (Uri server, string folder_identifier, string key) : + public SparkleListenerIrc (Uri server, string folder_identifier, string key, string dangerous_access) : base (server, folder_identifier) { // Try to get a uniqueish nickname @@ -42,8 +43,12 @@ namespace SparkleLib { // with a number, so prefix an alphabetic character this.nick = "s" + this.nick.Substring (0, 7); + // Key to access the channel this.key = key; + // Allow access to the channel + this.dangerous_access = dangerous_access; + base.channels.Add ("#" + folder_identifier); this.client = new IrcClient () { @@ -112,11 +117,16 @@ namespace SparkleLib { foreach (string channel in base.channels) { SparkleHelpers.DebugInfo ("ListenerIrc", "Joining channel " + channel); if (key != null) { - SparkleHelpers.DebugInfo ("ListenerIrc", "Ussing key"); + SparkleHelpers.DebugInfo ("ListenerIrc", "Key set to access the channel"); this.client.RfcJoin (channel, key); this.client.RfcMode (channel, "+k " + key); } else { - this.client.RfcJoin (channel); + if (dangerous_access == "yes") { + SparkleHelpers.DebugInfo ("ListenerIrc", "Accessing a dangerous channel change the setting to not access"); + this.client.RfcJoin (channel); + } else { + SparkleHelpers.DebugInfo ("ListenerIrc", "Dangerous channel change the setting to access"); + } } this.client.RfcMode (channel, "+s"); } @@ -146,14 +156,19 @@ namespace SparkleLib { if (IsConnected) { SparkleHelpers.DebugInfo ("ListenerIrc", "Joining channel " + channel); if (key != null) { - SparkleHelpers.DebugInfo ("ListenerIrc", "Ussing key"); + SparkleHelpers.DebugInfo ("ListenerIrc", "Key set to access the channel"); this.client.RfcJoin (channel, key); this.client.RfcMode (channel, "+k " + key); } else { - this.client.RfcJoin (channel); + if (dangerous_access == "yes") { + SparkleHelpers.DebugInfo ("ListenerIrc", "Accessing a dangerous channel change the setting to not access"); + this.client.RfcJoin (channel); + } else { + SparkleHelpers.DebugInfo ("ListenerIrc", "Dangerous channel change the setting to access"); + } } - this.client.RfcMode (channel, "+s"); } + this.client.RfcMode (channel, "+s"); } } From fdaf00afd0de8f47362264f631f3a010d807fa24 Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Sat, 15 Oct 2011 20:46:16 +0100 Subject: [PATCH 5/9] Add back README --- README | 203 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 203 insertions(+) create mode 100644 README diff --git a/README b/README new file mode 100644 index 00000000..dd50fc37 --- /dev/null +++ b/README @@ -0,0 +1,203 @@ +SparkleShare +============ + +SparkleShare is a collaboration and sharing tool that is designed to keep +things simple and to stay out of your way. It allows you to instantly sync +with any Git repository you have access to. + +Though SparkleShare is not made to be a graphical frontend +for git or a backup tool, it may be useful for other kinds of purposes as well, +like backing up small files or monitoring your favourite project. In contrast +to the projects name, we will very likely refuse to implement your personal +ponies. + +SparkleShare currently works on Linux and Mac. A Windows port and mobile +device support are planned for the future. + + +License +======= + +SparkleShare is free software and licensed under the GNU GPLv3 or later. You +are welcome to change and redistribute it under certain conditions. For more +information see the LICENSE file or visit http://www.gnu.org/licenses/gpl-3.0.html + + +Run on Linux: +============= + +Requirements: + + - git >= 1.7.0 + - gtk-sharp2 + - gvfs + - intltool + - libnotify + - mono-core >= 2.8 + - notify-sharp + - nautilus-python + - openssh + - pygtk + - webkitgtk + - webkit-sharp + + +Run the service, either click the SparkleShare launcher or: + + $ sparkleshare start + +You can stop the service via the graphical interface or by typing: + + $ sparkleshare stop + +For help: + + $ sparkleshare --help + +Note: + + SparkleShare creates its own RSA keypair in ~/config/sparkleshare/ and uses + that for authentication. Please mind this if you're planning to set up your + own server by hand. + + +Build on Linux: +=============== + +Installing the build dependencies on Debian or Ubuntu: + + $ sudo apt-get install gtk-sharp2 mono-runtime mono-devel monodevelop \ + libndesk-dbus1.0-cil-dev nant libnotify-cil-dev libgtk2.0-cil-dev \ + libwebkit-cil-dev intltool libtool python-nautilus libndesk-dbus-glib1.0-cil-dev + +For Ubuntu libappindicator support, run the following before building: + + $ sudo apt-get install libappindicator0.1-cil-dev + + +On Fedora: + + $ sudo yum install gtk-sharp2-devel mono-core mono-devel monodevelop \ + ndesk-dbus-devel ndesk-dbus-glib-devel nautilus-python-devel nant \ + notify-sharp-devel webkit-sharp-devel webkitgtk-devel libtool intltool \ + gnome-doc-utils + + +You can build and install SparkleShare like this: + + $ ./configure --prefix=/usr (or ./autogen.sh if you build from the repository) + $ make + $ sudo make install + +Note: + + Use '--prefix=/usr' if you want the Nautilus extension to work. + + +Run on Mac: +=========== + +Just double-click the SparkleShare.app. + + +Build on Mac: +============= + +Install the Mono Framework, MonoDevelop and the MonoMac plugin (you find it in Add-in Manager). + +You may need to adjust some environment variables to let the build environment tools find mono: + + $ export PATH=/Library/Frameworks/Mono.framework/Versions/Current/bin:$PATH + $ export PKG_CONFIG=/Library/Frameworks/Mono.framework/Versions/Current/bin/pkg-config + $ export PKG_CONFIG_PATH=/Library/Frameworks/Mono.framework/Versions/Current/lib/pkgconfig + +Then you need either MacPorts or Homebrew. Go on and choose one of the next two sections. + + +Using MacPorts +-------------- + +Install git, automake, and intltool: + + $ sudo port install git-core automake intltool + +Start the first part of the build: + + $ ./autogen.sh --enable-gtkui=no + $ make + +The last step will give you some errors in SparkleShare.exe, ignore these and go on to the +MonoDevelop section. + + +Using Homebrew +-------------- + +Because there are old versions of autoconf and automake installed on OS X, they are not in +the official master branch. It's easy to create the formulas: + + $ brew create $url + +Now install the formulas. + +You can have a look at this branch for the created Formulas: +https://github.com/toabi/homebrew/commits/sparkleshare + +You also have to comment out the 'keg_only' in gettext and remove it if you already +installed it. If you created the formulas install them: + + $ brew install git autoconf automake intltool gettext + +Now start the first part of the build: + + $ export ACLOCAL_FLAGS="-I /usr/local/share/aclocal" + $ cd SmartIrc4net + $ ./autogen.sh + $ cd .. + $ ./autogen.sh --enable-gtkui=no + $ make + +Ignore the error and continue to the MonoDevelop-part. + + +Building the Mac UI +------------------- + +Now that you have compiled the libraries, open 'SparkleShare/Mac/SparkleShare.sln' in +MonoDevelop and start the build. + +To create the SparkleShare.app, select Project from the menu bar +and click "Create Mac Installer..." Save the SparkleShare.app somewhere. + +Paste the contents of the following file in SparkleShare.app/Contents/MonoBundle/config: +https://raw.github.com/gist/1aeffa61bac73fc08eca/0c0f09ef9e36864c35f34fd5e8bf4f99886be193/gistfile1.txt + +Copy /Library/Frameworks/Mono.framework/Versions/Current/lib/libintl.dylib +to SparkleShare.app/Contents/Resources + +Now you should have a working .app that you can run. + + +Info +==== + +Official website: +http://www.sparkleshare.org/ + +Source code: +http://github.com/SparkleShare/ + +IRC Channel: +#sparkleshare on irc.gnome.org + +Wiki: +http://github.com/hbons/SparkleShare/wiki/ + +Report issues: +http://github.com/hbons/SparkleShare/issues/ + +Translation project: +http://www.transifex.net/projects/p/sparkleshare/ + + +Now have fun and create cool things together! :) From 91d457332b96d2539c7cd6c4d62b940d6fd5fccc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?N=C3=ADcolas=20Lazarte=20Kaqui?= Date: Sun, 16 Oct 2011 16:46:37 -0200 Subject: [PATCH 6/9] =?UTF-8?q?accepting=20the=20suggestions=20made=20?= =?UTF-8?q?=E2=80=8B=E2=80=8Bby=20hbons?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SparkleLib/SparkleListenerBase.cs | 19 ++---------- SparkleLib/SparkleListenerIrc.cs | 49 ++++++++++++++++++------------- 2 files changed, 31 insertions(+), 37 deletions(-) diff --git a/SparkleLib/SparkleListenerBase.cs b/SparkleLib/SparkleListenerBase.cs index 93cf1dae..b9293841 100644 --- a/SparkleLib/SparkleListenerBase.cs +++ b/SparkleLib/SparkleListenerBase.cs @@ -44,14 +44,6 @@ namespace SparkleLib { string uri = SparkleConfig.DefaultConfig.GetFolderOptionalAttribute ( folder_name, "announcements_url"); - // Key to turn the channel access more safely. - string key = SparkleConfig.DefaultConfig.GetFolderOptionalAttribute ( - folder_name, "key"); - - // Identifier to define access in IRC channel when no key is defined - string dangerous_access = SparkleConfig.DefaultConfig.GetFolderOptionalAttribute ( - folder_name, "dangerous_access"); - if (uri == null) { // This is SparkleShare's centralized notification service. // Don't worry, we only use this server as a backup if you @@ -61,13 +53,6 @@ namespace SparkleLib { uri = "irc://204.62.14.135/"; } - // This action ensures that the Sparkleshare function normally when the key is not defined. - // It is recommended that the user asked a question to see whether or not to allow access - // to the channel without a key. - if (dangerous_access == null) { - dangerous_access = "yes"; - } - Uri announce_uri = new Uri (uri); // We use only one listener per server to keep @@ -89,10 +74,10 @@ namespace SparkleLib { listeners.Add (new SparkleListenerTcp (announce_uri, folder_identifier)); break; case "irc": - listeners.Add (new SparkleListenerIrc (announce_uri, folder_identifier, key, dangerous_access)); + listeners.Add (new SparkleListenerIrc (announce_uri, folder_identifier)); break; default: - listeners.Add (new SparkleListenerIrc (announce_uri, folder_identifier, key, dangerous_access)); + listeners.Add (new SparkleListenerIrc (announce_uri, folder_identifier)); break; } diff --git a/SparkleLib/SparkleListenerIrc.cs b/SparkleLib/SparkleListenerIrc.cs index 91e4cc40..e3235a54 100644 --- a/SparkleLib/SparkleListenerIrc.cs +++ b/SparkleLib/SparkleListenerIrc.cs @@ -29,11 +29,11 @@ namespace SparkleLib { private Thread thread; private IrcClient client; private string nick; - private string key; - private string dangerous_access; + private string announcements_password; + private bool allow_passwordless_join; - public SparkleListenerIrc (Uri server, string folder_identifier, string key, string dangerous_access) : + public SparkleListenerIrc (Uri server, string folder_identifier) : base (server, folder_identifier) { // Try to get a uniqueish nickname @@ -43,11 +43,20 @@ namespace SparkleLib { // with a number, so prefix an alphabetic character this.nick = "s" + this.nick.Substring (0, 7); - // Key to access the channel - this.key = key; + // Key to turn the channel access more safely. + this.announcements_password = + SparkleConfig.DefaultConfig.GetConfigOption ("announcements_password"); - // Allow access to the channel - this.dangerous_access = dangerous_access; + // Identifier to define access in IRC channel when no key is defined + this.allow_passwordless_join = + SparkleConfig.DefaultConfig.GetConfigOption ("allow_passwordless_join"); + + // This action ensures that the Sparkleshare function normally when the key is not defined. + // It is recommended that the user asked a question to see whether or not to allow access + // to the channel without a key. + if (this.allow_passwordless_join == null) { + this.allow_passwordless_join = true + } base.channels.Add ("#" + folder_identifier); @@ -116,16 +125,16 @@ namespace SparkleLib { foreach (string channel in base.channels) { SparkleHelpers.DebugInfo ("ListenerIrc", "Joining channel " + channel); - if (key != null) { - SparkleHelpers.DebugInfo ("ListenerIrc", "Key set to access the channel"); - this.client.RfcJoin (channel, key); - this.client.RfcMode (channel, "+k " + key); + if (this.announcements_password != null) { + SparkleHelpers.DebugInfo ("ListenerIrc", "Password set to access the channel"); + this.client.RfcJoin (channel, this.announcements_password); + this.client.RfcMode (channel, "+k " + this.announcements_password); } else { - if (dangerous_access == "yes") { + if (allow_passwordless_join) { SparkleHelpers.DebugInfo ("ListenerIrc", "Accessing a dangerous channel change the setting to not access"); this.client.RfcJoin (channel); } else { - SparkleHelpers.DebugInfo ("ListenerIrc", "Dangerous channel change the setting to access"); + SparkleHelpers.DebugInfo ("ListenerIrc", "Dangerous channel, change the setting to access"); } } this.client.RfcMode (channel, "+s"); @@ -155,20 +164,20 @@ namespace SparkleLib { if (IsConnected) { SparkleHelpers.DebugInfo ("ListenerIrc", "Joining channel " + channel); - if (key != null) { - SparkleHelpers.DebugInfo ("ListenerIrc", "Key set to access the channel"); - this.client.RfcJoin (channel, key); - this.client.RfcMode (channel, "+k " + key); + if (this.announcements_password != null) { + SparkleHelpers.DebugInfo ("ListenerIrc", "Password set to access the channel"); + this.client.RfcJoin (channel, this.announcements_password); + this.client.RfcMode (channel, "+k " + this.announcements_password); } else { - if (dangerous_access == "yes") { + if (allow_passwordless_join) { SparkleHelpers.DebugInfo ("ListenerIrc", "Accessing a dangerous channel change the setting to not access"); this.client.RfcJoin (channel); } else { - SparkleHelpers.DebugInfo ("ListenerIrc", "Dangerous channel change the setting to access"); + SparkleHelpers.DebugInfo ("ListenerIrc", "Dangerous channel, change the setting to access"); } } + this.client.RfcMode (channel, "+s"); } - this.client.RfcMode (channel, "+s"); } } From 4268c12dcb6b72b653bfc78d70d4fd24344d0bef Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Mon, 17 Oct 2011 19:34:17 +0200 Subject: [PATCH 7/9] git: Always use user info from global config to commit. Fixes #367 --- SparkleLib/Git/SparkleFetcherGit.cs | 19 ------------------- SparkleLib/Git/SparkleRepoGit.cs | 6 +++++- 2 files changed, 5 insertions(+), 20 deletions(-) diff --git a/SparkleLib/Git/SparkleFetcherGit.cs b/SparkleLib/Git/SparkleFetcherGit.cs index 11a39046..76434db1 100755 --- a/SparkleLib/Git/SparkleFetcherGit.cs +++ b/SparkleLib/Git/SparkleFetcherGit.cs @@ -153,11 +153,6 @@ namespace SparkleLib { // the newly cloned repository private void InstallConfiguration () { - string global_config_file_path = Path.Combine (SparkleConfig.DefaultConfig.TmpPath, "config.xml"); - - if (!File.Exists (global_config_file_path)) - return; - string repo_config_file_path = SparkleHelpers.CombineMore (base.target_folder, ".git", "config"); string config = String.Join (Environment.NewLine, File.ReadAllLines (repo_config_file_path)); @@ -173,20 +168,6 @@ namespace SparkleLib { // Ignore permission changes config = config.Replace ("filemode = true", "filemode = false"); - - // Add user info - XmlDocument xml = new XmlDocument(); - xml.Load (global_config_file_path); - - XmlNode node_name = xml.SelectSingleNode ("//user/name/text()"); - XmlNode node_email = xml.SelectSingleNode ("//user/email/text()"); - - // TODO: just use commands instead of messing with the config file - config += n + - "[user]" + n + - "\tname = " + node_name.Value + n + - "\temail = " + node_email.Value + n; - // Write the config to the file TextWriter writer = new StreamWriter (repo_config_file_path); writer.WriteLine (config); diff --git a/SparkleLib/Git/SparkleRepoGit.cs b/SparkleLib/Git/SparkleRepoGit.cs index 8d7229f7..cb048e92 100755 --- a/SparkleLib/Git/SparkleRepoGit.cs +++ b/SparkleLib/Git/SparkleRepoGit.cs @@ -234,7 +234,11 @@ namespace SparkleLib { // Commits the made changes private void Commit (string message) { - SparkleGit git = new SparkleGit (LocalPath, "commit -m \"" + message + "\""); + SparkleGit git = new SparkleGit (LocalPath, + "commit -m \"" + message + "\" " + + "--author=\"" + SparkleConfig.DefaultConfig.User.Name + + " <" + SparkleConfig.DefaultConfig.User.Email + ">\""); + git.Start (); git.StandardOutput.ReadToEnd (); git.WaitForExit (); From 3fd59b76fe58a66d48863556788a0bf2efe6e5e3 Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Mon, 17 Oct 2011 19:37:35 +0200 Subject: [PATCH 8/9] git fetcher: System.Xml no longer needed here --- SparkleLib/Git/SparkleFetcherGit.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/SparkleLib/Git/SparkleFetcherGit.cs b/SparkleLib/Git/SparkleFetcherGit.cs index 76434db1..86f814f4 100755 --- a/SparkleLib/Git/SparkleFetcherGit.cs +++ b/SparkleLib/Git/SparkleFetcherGit.cs @@ -19,7 +19,6 @@ using System; using System.IO; using System.Diagnostics; using System.Text.RegularExpressions; -using System.Xml; namespace SparkleLib { From c1723899eaab0dbee23e32e22296fe933f87af7d Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Mon, 17 Oct 2011 19:54:41 +0200 Subject: [PATCH 9/9] Fix compile error and fix some style changes for merge request 368# --- SparkleLib/SparkleListenerIrc.cs | 37 ++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/SparkleLib/SparkleListenerIrc.cs b/SparkleLib/SparkleListenerIrc.cs index e3235a54..0219ec5b 100755 --- a/SparkleLib/SparkleListenerIrc.cs +++ b/SparkleLib/SparkleListenerIrc.cs @@ -43,19 +43,17 @@ namespace SparkleLib { // with a number, so prefix an alphabetic character this.nick = "s" + this.nick.Substring (0, 7); - // Key to turn the channel access more safely. - this.announcements_password = - SparkleConfig.DefaultConfig.GetConfigOption ("announcements_password"); + // Optional password to make the channel access more safe + this.announcements_password = + SparkleConfig.DefaultConfig.GetConfigOption ("announcements_password"); - // Identifier to define access in IRC channel when no key is defined - this.allow_passwordless_join = - SparkleConfig.DefaultConfig.GetConfigOption ("allow_passwordless_join"); - - // This action ensures that the Sparkleshare function normally when the key is not defined. - // It is recommended that the user asked a question to see whether or not to allow access - // to the channel without a key. - if (this.allow_passwordless_join == null) { - this.allow_passwordless_join = true + // Option to allow access to channel when no password is defined + try { + this.allow_passwordless_join = Convert.ToBoolean ( + SparkleConfig.DefaultConfig.GetConfigOption ("allow_passwordless_join")); + + } catch (Exception) { + this.allow_passwordless_join = true; } base.channels.Add ("#" + folder_identifier); @@ -119,24 +117,31 @@ namespace SparkleLib { try { // Connect, login, and join the channel int port = base.server.Port; - if (port < 0) port = 6667; + + if (port < 0) + port = 6667; + this.client.Connect (base.server.Host, port); this.client.Login (this.nick, this.nick, 8, this.nick); foreach (string channel in base.channels) { SparkleHelpers.DebugInfo ("ListenerIrc", "Joining channel " + channel); - if (this.announcements_password != null) { + + if (!string.IsNullOrEmpty (this.announcements_password)) { SparkleHelpers.DebugInfo ("ListenerIrc", "Password set to access the channel"); this.client.RfcJoin (channel, this.announcements_password); this.client.RfcMode (channel, "+k " + this.announcements_password); + } else { - if (allow_passwordless_join) { - SparkleHelpers.DebugInfo ("ListenerIrc", "Accessing a dangerous channel change the setting to not access"); + if (this.allow_passwordless_join) { + SparkleHelpers.DebugInfo ("ListenerIrc", "Accessing a dangerous channel, change the setting to not access"); this.client.RfcJoin (channel); + } else { SparkleHelpers.DebugInfo ("ListenerIrc", "Dangerous channel, change the setting to access"); } } + this.client.RfcMode (channel, "+s"); }