Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/diaspora/diaspora.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Changelog.md6
-rw-r--r--Gemfile3
-rw-r--r--Gemfile.lock8
-rw-r--r--config/initializers/sidekiq.rb3
-rw-r--r--config/unicorn.rb3
-rw-r--r--lib/diaspora/guid.rb2
6 files changed, 23 insertions, 2 deletions
diff --git a/Changelog.md b/Changelog.md
index 8afc63935..6eddc4e26 100644
--- a/Changelog.md
+++ b/Changelog.md
@@ -1,5 +1,11 @@
# Head
+## Change in guid generation
+
+This version will break federation to pods running on versions prior 0.1.1.0.
+
+Read more in [#4249](https://github.com/diaspora/diaspora/pull/4249) and [#4883](https://github.com/diaspora/diaspora/pull/4883)
+
## Refactor
* Drop number of followers from tags page [#4717](https://github.com/diaspora/diaspora/issues/4717)
* Remove some unused beta code [#4738](https://github.com/diaspora/diaspora/issues/4738)
diff --git a/Gemfile b/Gemfile
index 219dc2532..d0f33404e 100644
--- a/Gemfile
+++ b/Gemfile
@@ -50,6 +50,9 @@ gem 'fog', '1.19.0'
gem 'mini_magick', '3.7.0'
gem 'remotipart', '1.2.1'
+# GUID generation
+gem 'uuid', '2.3.7'
+
# Localization
gem 'http_accept_language', '1.0.2'
diff --git a/Gemfile.lock b/Gemfile.lock
index b6c729d42..ca5847aba 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -223,6 +223,8 @@ GEM
rb-fsevent (>= 0.9.3)
rb-inotify (>= 0.9)
lumberjack (1.0.4)
+ macaddr (1.6.1)
+ systemu (~> 2.5.0)
mail (2.5.4)
mime-types (~> 1.16)
treetop (~> 1.4.8)
@@ -411,6 +413,7 @@ GEM
activemodel (~> 3.0)
railties (~> 3.0)
subexec (0.2.3)
+ systemu (2.5.2)
test_after_commit (0.2.2)
thor (0.18.1)
thread_safe (0.1.3)
@@ -435,8 +438,10 @@ GEM
kgio (~> 2.6)
rack
raindrops (~> 0.7)
- warden (1.2.3)
+ uuid (2.3.7)
+ macaddr (~> 1.0)
rack (>= 1.0)
+ warden (1.2.3)
webmock (1.16.1)
addressable (>= 2.2.7)
crack (>= 0.3.2)
@@ -532,6 +537,7 @@ DEPENDENCIES
typhoeus (= 0.6.7)
uglifier (= 2.1.2)
unicorn (= 4.8.0)
+ uuid (= 2.3.7)
webmock (= 1.16.1)
will_paginate (= 3.0.5)
zip-zip
diff --git a/config/initializers/sidekiq.rb b/config/initializers/sidekiq.rb
index 65c6bdec4..a1ff43592 100644
--- a/config/initializers/sidekiq.rb
+++ b/config/initializers/sidekiq.rb
@@ -44,6 +44,9 @@ Sidekiq.configure_server do |config|
ENV['DATABASE_URL'] = "#{database_url}?pool=#{AppConfig.environment.sidekiq.concurrency.get}"
ActiveRecord::Base.establish_connection
end
+
+ # Make sure each Sidekiq process has its own sequence of UUIDs
+ UUID.generator.next_sequence
end
Sidekiq.configure_client do |config|
diff --git a/config/unicorn.rb b/config/unicorn.rb
index e02a9dcc0..52963a762 100644
--- a/config/unicorn.rb
+++ b/config/unicorn.rb
@@ -48,4 +48,7 @@ end
after_fork do |server, worker|
# If using preload_app, enable this line
ActiveRecord::Base.establish_connection
+
+ # We don't generate uuids in the frontend, but let's be on the safe side
+ UUID.generator.next_sequence
end
diff --git a/lib/diaspora/guid.rb b/lib/diaspora/guid.rb
index c94e56eac..6f509a543 100644
--- a/lib/diaspora/guid.rb
+++ b/lib/diaspora/guid.rb
@@ -13,6 +13,6 @@ module Diaspora::Guid
# @return [String] The model's guid.
def set_guid
- self.guid = SecureRandom.hex(8) if self.guid.blank?
+ self.guid = UUID.generate :compact if self.guid.blank?
end
end