diff --git a/.gitignore b/.gitignore index 872e37d3a..6b3124602 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ db/*.sqlite3 log/*.log tmp/**/* +gpg/diaspora*/* diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 1da4454c5..99f155736 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -4,5 +4,8 @@ class UsersController < ApplicationController def index @users = User.sort(:created_at.desc).all end - + def show + @user= Person.where(:id => params[:id]).first + @user_profile = @user.profile + end end diff --git a/app/models/user.rb b/app/models/user.rb index f3c695f3d..6bb136a2f 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -40,11 +40,9 @@ class User < Person generate_key end self.key_fingerprint = GPGME.list_keys(nil, true).first.subkeys.first.fingerprint - puts self.key_fingerprint end def generate_key - puts "Yo, generating a key." ctx = GPGME::Ctx.new paramstring = " Key-Type: DSA diff --git a/app/views/users/show.html.haml b/app/views/users/show.html.haml index 01cfb9999..f922e19b8 100644 --- a/app/views/users/show.html.haml +++ b/app/views/users/show.html.haml @@ -1 +1,12 @@ %h1 user page! +.span-18.last + %h1= "#{@user.real_name}" +- if @user_profile + %p + %b url + %p + = @user.url + %p + %b Key Fingerprint + %p + = @user.key_fingerprint diff --git a/config/environment.rb b/config/environment.rb index 695be6a22..d8d7f075a 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -4,5 +4,5 @@ Haml::Template.options[:format] = :html5 # Initialize the rails application Diaspora::Application.initialize! -ENV['GNUPGHOME'] = File.expand_path("../../db/gpg-#{Rails.env}/", __FILE__) +ENV['GNUPGHOME'] = File.expand_path("../../gpg-#{Rails.env}/", __FILE__) GPGME::check_version({}) diff --git a/db/gpg-development/pubring.gpg b/db/gpg-development/pubring.gpg deleted file mode 100644 index cb573f9bd..000000000 Binary files a/db/gpg-development/pubring.gpg and /dev/null differ diff --git a/db/gpg-development/pubring.gpg~ b/db/gpg-development/pubring.gpg~ deleted file mode 100644 index 44ac03229..000000000 Binary files a/db/gpg-development/pubring.gpg~ and /dev/null differ diff --git a/db/gpg-development/random_seed b/db/gpg-development/random_seed deleted file mode 100644 index 4d35367ab..000000000 Binary files a/db/gpg-development/random_seed and /dev/null differ diff --git a/db/gpg-development/secring.gpg b/db/gpg-development/secring.gpg deleted file mode 100644 index 4d44acc6b..000000000 Binary files a/db/gpg-development/secring.gpg and /dev/null differ diff --git a/db/gpg-development/trustdb.gpg b/db/gpg-development/trustdb.gpg deleted file mode 100644 index 3e1b582af..000000000 Binary files a/db/gpg-development/trustdb.gpg and /dev/null differ diff --git a/db/gpg-test/pubring.gpg b/db/gpg-test/pubring.gpg deleted file mode 100644 index 506acc069..000000000 Binary files a/db/gpg-test/pubring.gpg and /dev/null differ diff --git a/db/gpg-test/pubring.gpg~ b/db/gpg-test/pubring.gpg~ deleted file mode 100644 index 60008a7ba..000000000 Binary files a/db/gpg-test/pubring.gpg~ and /dev/null differ diff --git a/db/gpg-test/random_seed b/db/gpg-test/random_seed deleted file mode 100644 index 335e73236..000000000 Binary files a/db/gpg-test/random_seed and /dev/null differ diff --git a/db/gpg-test/secring.gpg b/db/gpg-test/secring.gpg deleted file mode 100644 index eaca4a8eb..000000000 Binary files a/db/gpg-test/secring.gpg and /dev/null differ diff --git a/db/gpg-test/trustdb.gpg b/db/gpg-test/trustdb.gpg deleted file mode 100644 index 0afcfe942..000000000 Binary files a/db/gpg-test/trustdb.gpg and /dev/null differ diff --git a/lib/tasks/gpg.rake b/lib/tasks/gpg.rake new file mode 100644 index 000000000..9d7e82223 --- /dev/null +++ b/lib/tasks/gpg.rake @@ -0,0 +1,8 @@ +namespace :gpg do + desc 'Clear the gpg keyrings' + task :clear do + ctx = GPGME::Ctx.new + keys = ctx.keys + keys.each{|k| ctx.delete_key(k, true)} + end +end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index eac2acf4b..a414acb20 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -31,7 +31,6 @@ RSpec.configure do |config| DatabaseCleaner.clean end config.after(:suite) do - gpgdir = File.expand_path("../../db/gpg-#{Rails.env}", __FILE__) ctx = GPGME::Ctx.new keys = ctx.keys keys.each{|k| ctx.delete_key(k, true)}