Added keyrings to gitignore, symlinked to shared dir in cap scripts

This commit is contained in:
ilya 2010-07-08 20:54:11 -04:00
parent 9e8426ceb4
commit a5db2cd231
17 changed files with 25 additions and 5 deletions

1
.gitignore vendored
View file

@ -5,3 +5,4 @@
db/*.sqlite3 db/*.sqlite3
log/*.log log/*.log
tmp/**/* tmp/**/*
gpg/diaspora*/*

View file

@ -4,5 +4,8 @@ class UsersController < ApplicationController
def index def index
@users = User.sort(:created_at.desc).all @users = User.sort(:created_at.desc).all
end end
def show
@user= Person.where(:id => params[:id]).first
@user_profile = @user.profile
end
end end

View file

@ -40,11 +40,9 @@ class User < Person
generate_key generate_key
end end
self.key_fingerprint = GPGME.list_keys(nil, true).first.subkeys.first.fingerprint self.key_fingerprint = GPGME.list_keys(nil, true).first.subkeys.first.fingerprint
puts self.key_fingerprint
end end
def generate_key def generate_key
puts "Yo, generating a key."
ctx = GPGME::Ctx.new ctx = GPGME::Ctx.new
paramstring = "<GnupgKeyParms format=\"internal\"> paramstring = "<GnupgKeyParms format=\"internal\">
Key-Type: DSA Key-Type: DSA

View file

@ -1 +1,12 @@
%h1 user page! %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

View file

@ -4,5 +4,5 @@ Haml::Template.options[:format] = :html5
# Initialize the rails application # Initialize the rails application
Diaspora::Application.initialize! 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({}) GPGME::check_version({})

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

8
lib/tasks/gpg.rake Normal file
View file

@ -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

View file

@ -31,7 +31,6 @@ RSpec.configure do |config|
DatabaseCleaner.clean DatabaseCleaner.clean
end end
config.after(:suite) do config.after(:suite) do
gpgdir = File.expand_path("../../db/gpg-#{Rails.env}", __FILE__)
ctx = GPGME::Ctx.new ctx = GPGME::Ctx.new
keys = ctx.keys keys = ctx.keys
keys.each{|k| ctx.delete_key(k, true)} keys.each{|k| ctx.delete_key(k, true)}