Commit b5dbeba1 authored by Weblate's avatar Weblate

Merge remote-tracking branch 'origin/master'

parents d0e257a5 4215ee99
......@@ -118,6 +118,24 @@ at once. This can be achieved using :djadmin:`import_project`.
First you need to create project which will contain all subprojects and then
it's just a matter of running :djadmin:`import_project`.
.. _private:
Accessing private repositories
------------------------------
In case you want Weblate to access private repository it needs to get to it
somehow. Most frequently used method here is based on SSH. To have access to
such repository, you generate SSH key for Weblate and authorize it to access
the repository.
You can generate or display key currently used by Weblate in the admin
interface (follow :guilabel:`SSH keys` link on main admin page).
.. note::
The keys need to be without password to make it work, so be sure they are
well protected against malicious usage.
.. seealso:: :ref:`manage`
Updating repositories
......@@ -167,6 +185,8 @@ first, otherwise push will fail.
You can also enable automatic pushing changes on commit, this can be done in
project configuration.
.. seealso:: :ref:`private` for setting up SSH keys
.. _merge-rebase:
Merge or rebase
......
......@@ -18,6 +18,15 @@
</tr>
<tr>
<th scope="row"><a href="ssh/">{% trans "SSH keys" %}</a></th>
<th></th>
<th></th>
</tr>
</table>
</div>
......
{% extends "admin/base_site.html" %}
{% load i18n %}
{% block title %}{% trans "SSH keys" %}{% endblock %}
{% block breadcrumbs %}
<div class="breadcrumbs"><a href="../">
{% trans "Home" %}</a> &rsaquo; {% trans "SSH" %}
</div>{% endblock %}
{% block content %}
<div id="content-main">
{% if public_key %}
<h1>{% trans "Public SSH key" %}</h1>
<p>{% trans "Weblate currently uses following SSH key:" %}</p>
<textarea style="width:100%">{{ public_key.key }}</textarea>
{% endif %}
<p>{% blocktrans %}You can find more information about setting up SSH keys in <a href="{{ ssh_docs }}">the Weblate manual</a>.{% endblocktrans %}</p>
</div>
{% endblock %}
......@@ -22,9 +22,33 @@ from weblate.trans.models import SubProject
from django.template import RequestContext
from django.shortcuts import render_to_response
from django.contrib.admin.views.decorators import staff_member_required
import weblate
import os
@staff_member_required
def report(request):
return render_to_response("admin/report.html", RequestContext(request, {
'subprojects': SubProject.objects.all()
}))
@staff_member_required
def ssh(request):
key_path = os.path.expanduser('~/.ssh/id_rsa.pub')
if os.path.exists(key_path):
key_data = file(key_path).read()
key_type, key_fingerprint, key_id = key_data.strip().split()
key = {
'key': key_data,
'type': key_type,
'fingerprint': key_fingerprint,
'id': key_id,
}
else:
key = None
return render_to_response("admin/ssh.html", RequestContext(request, {
'public_key': key,
'ssh_docs': 'http://weblate.readthedocs.org/en/weblate-%s/admin.html#private' % weblate.VERSION,
}))
......@@ -115,6 +115,7 @@ urlpatterns = patterns('',
# Admin interface
url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
url(r'^admin/report/$', 'weblate.trans.admin_views.report'),
url(r'^admin/ssh/$', 'weblate.trans.admin_views.ssh'),
url(r'^admin/', include(admin.site.urls)),
# Auth
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment