[Xfce4-commits] <moka:nick/maintainer-improvements> Add views for account request.
Nick Schermer
noreply at xfce.org
Mon Apr 4 21:42:01 CEST 2011
Updating branch refs/heads/nick/maintainer-improvements
to ee8528458933e6a848112545e70633bd68f68b5d (commit)
from f0cbd15279a22a66a812061f61539e966c2d1a29 (commit)
commit ee8528458933e6a848112545e70633bd68f68b5d
Author: Nick Schermer <nick at xfce.org>
Date: Mon Apr 4 18:11:00 2011 +0200
Add views for account request.
lib/controllers/request.rb | 24 ++++++++++++++++++++++++
lib/moka.rb | 2 ++
lib/views/head.erb | 3 ++-
lib/views/request.erb | 35 +++++++++++++++++++++++++++++++++++
lib/views/request_finished.erb | 9 +++++++++
lib/views/request_sshinfo.erb | 31 +++++++++++++++++++++++++++++++
moka.gemspec | 4 ++++
7 files changed, 107 insertions(+), 1 deletions(-)
diff --git a/lib/controllers/request.rb b/lib/controllers/request.rb
new file mode 100644
index 0000000..0971830
--- /dev/null
+++ b/lib/controllers/request.rb
@@ -0,0 +1,24 @@
+module Moka
+ module Controllers
+ module Request
+ include Moka::Models
+
+ def self.registered(app)
+ app.get '/request' do
+
+ view :request
+ end
+
+ app.get '/request/sshinfo' do
+
+ view :request_sshinfo
+ end
+
+ app.post '/request' do
+
+ view :request_finished
+ end
+ end
+ end
+ end
+end
diff --git a/lib/moka.rb b/lib/moka.rb
index c60673f..593d956 100755
--- a/lib/moka.rb
+++ b/lib/moka.rb
@@ -23,6 +23,7 @@ require File.join(directory, 'controllers', 'authentication')
require File.join(directory, 'controllers', 'collections')
require File.join(directory, 'controllers', 'projects')
require File.join(directory, 'controllers', 'maintainers')
+require File.join(directory, 'controllers', 'request')
require File.join(directory, 'middleware', 'feeds')
require File.join(directory, 'middleware', 'identica')
@@ -40,6 +41,7 @@ module Moka
register Moka::Controllers::Projects
register Moka::Controllers::Collections
register Moka::Controllers::Maintainers
+ register Moka::Controllers::Request
authentication_initialize
diff --git a/lib/views/head.erb b/lib/views/head.erb
index 92c7c40..ef32520 100755
--- a/lib/views/head.erb
+++ b/lib/views/head.erb
@@ -11,7 +11,8 @@
<% if env['warden'].authenticated? %>
<a href="/">Manage Releases</a>
<% else %>
- <a href="/login">Manage Releases</a>
+ <a href="/login">Login</a>
+ <a href="/request">Request Account</a>
<% end %>
<% if env['warden'].authenticated? and authentication_user %>
<% if authentication_user.is_admin %>
diff --git a/lib/views/request.erb b/lib/views/request.erb
new file mode 100644
index 0000000..a73f871
--- /dev/null
+++ b/lib/views/request.erb
@@ -0,0 +1,35 @@
+<%= header :title => "Request Developer Account" %>
+<h2>Introduction</h2>
+<p>The following form allows you to submit your user info to request an Xfce
+ developers account. This account needs to be approved by one of the Xfce developers,
+ so it is wise to introduce yourself on the
+ <a href="http://www.xfce.org/community">Xfce4-dev</a> mailing list first, else
+ the request will be rejected.</p>
+<p>Translators don't need a developer account, they can sign up at the
+ <a href="https://translations.xfce.org/">translation</a> page and request to
+ join a translation team after registration.</p>
+
+<h2>Account Information</h2>
+<form method="post">
+ <fieldset>
+ <p><label for="username">Login Name:</label>
+ <input type="text" name="username" value="<%= params[:username] %>"/></p>
+ <p><label for="realname">Real Name:</label>
+ <input type="text" name="realname" value="<%= params[:realname] %>"/></p>
+ <p><label for="email">Email address:</label>
+ <input type="text" name="email" value="<%= params[:email] %>"/></p>
+ <hr />
+ <p class="quote">The password needs to be at least 6 characters long.</p>
+ <p><label for="password">Password:</label>
+ <input type="password" name="password" value=""/></p>
+ <p><label for="password2">Confirm password:</label>
+ <input type="password" name="password2" value=""/></p>
+ <hr />
+ <p class="quote">The public key is required to push git commits over ssh. Make sure you provide the publickey and
+ not the fingerprint... Read more about how to generate and use SSH keys <a href="/request/sshinfo">here</a>.</p>
+ <p><label for="pubkeys">SSH public-keys:</label>
+ <textarea id="pubkeys" name="pubkeys" rows="5" wrap="off"><%= params[:pubkeys] %></textarea></p>
+ <p class="quote"><input type="submit" value="Submit"/></p>
+ </fieldset>
+</form>
+<%= footer %>
diff --git a/lib/views/request_finished.erb b/lib/views/request_finished.erb
new file mode 100644
index 0000000..2af10c1
--- /dev/null
+++ b/lib/views/request_finished.erb
@@ -0,0 +1,9 @@
+<%= header :title => "Request Developer Account" %>
+<h2>Done</h2>
+<p>Thank you for submitting your account information. We will process the
+ account as soon as possible and you will receive and email once the
+ account has been activated.</p>
+
+<p><a href="/">Take me back</a></p>
+
+<%= footer %>
diff --git a/lib/views/request_sshinfo.erb b/lib/views/request_sshinfo.erb
new file mode 100644
index 0000000..e1f6aaa
--- /dev/null
+++ b/lib/views/request_sshinfo.erb
@@ -0,0 +1,31 @@
+<%= header :title => "Use and create SSH keys" %>
+<h2>Introduction</h2>
+<p>For a secure connection to push git commits, the Xfce project uses
+ SSH keys to authorize on the server. This has the advantage a secure
+ connection is established between the server with simple passwords.</p>
+
+<h2>Generating SSh keys</h2>
+<p>SSH keys are stored in your home directory in the <em>~/.ssh</em>
+ directory. To generate a key pair use the following command:</p>
+
+<pre>~ $ <strong>cd ~/.ssh</strong>
+~/.ssh $ <strong>ssh-keygen -t dsa -f id_dsa</strong>
+Generating public/private dsa key pair.
+Enter passphrase (empty for no passphrase): <strong>[ENTER]</strong>
+Enter same passphrase again: <strong>[ENTER]</strong>
+Your identification has been saved in id_dsa.
+Your public key has been saved in id_dsa.pub.
+The key fingerprint is:
+e7:c3:bd:c9:33:2e:19:33:b2:62:75:74:b3:99:b1:99 user at localhost</pre>
+
+<p>After you have created the key files, you should submit the
+ <em>id_dsa.pub</em> file to us in the text field. This string looks
+ like <em>ssh-dss ... user at localhost</em>. Afterwards you can maintain
+ the keys through this website. We will add the pubkey to your
+ <em>~/.ssh/authorized_keys</em> file on the Xfce server and
+ you can then log onto our server without a password.</p>
+
+<h2>Using SSH keys with GIT</h2>
+<p>You can read about this in the <a href="http://wiki.xfce.org/dev/howto/git#committers">
+ Xfce Wiki</a></p>
+<%= footer %>
diff --git a/moka.gemspec b/moka.gemspec
index 0880a24..6e4b147 100644
--- a/moka.gemspec
+++ b/moka.gemspec
@@ -23,6 +23,7 @@ Gem::Specification.new do |s|
"lib/controllers/collections.rb",
"lib/controllers/maintainers.rb",
"lib/controllers/projects.rb",
+ "lib/controllers/request.rb",
"lib/helpers/general.rb",
"lib/middleware/feeds.rb",
"lib/middleware/identica.rb",
@@ -56,6 +57,9 @@ Gem::Specification.new do |s|
"lib/views/project_new_release_tarball.erb",
"lib/views/project_release_delete.erb",
"lib/views/project_release_update.erb",
+ "lib/views/request.erb",
+ "lib/views/request_finished.erb",
+ "lib/views/request_sshinfo.erb",
"lib/views/stylesheet.sass"
]
s.homepage = %q{http://git.xfce.org/jannis/moka}
More information about the Xfce4-commits
mailing list