You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by je...@apache.org on 2015/06/17 17:17:09 UTC
[01/35] allura git commit: Add SMS charges disclaimer to phone help
text
Repository: allura
Updated Branches:
refs/heads/ib/7884 ce895e460 -> ac73590ba (forced update)
Add SMS charges disclaimer to phone help text
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/69dd7f89
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/69dd7f89
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/69dd7f89
Branch: refs/heads/ib/7884
Commit: 69dd7f89ac7f7d1c5852ae9b6ec40d6bcfb59d79
Parents: a31af67
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Thu Jun 11 21:35:55 2015 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Thu Jun 11 21:35:55 2015 +0000
----------------------------------------------------------------------
Allura/allura/templates/phone_verification_fragment.html | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/69dd7f89/Allura/allura/templates/phone_verification_fragment.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/phone_verification_fragment.html b/Allura/allura/templates/phone_verification_fragment.html
index 1c61db4..fad9acd 100644
--- a/Allura/allura/templates/phone_verification_fragment.html
+++ b/Allura/allura/templates/phone_verification_fragment.html
@@ -63,6 +63,7 @@
below (e.g. 1-311-555-2368 or +61 8 5550 1757). You'll receive
an SMS message with a PIN you need to provide on the next step.
Your phone number will only be recorded by our SMS provider.
+ Standard SMS rates may apply.
</p>
{% endblock phone_validation_message_number %}
</div>
[32/35] allura git commit: [#7884] ticket:799 Add new feature to the
bottom
Posted by je...@apache.org.
[#7884] ticket:799 Add new feature to the bottom
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/c91cb3fc
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/c91cb3fc
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/c91cb3fc
Branch: refs/heads/ib/7884
Commit: c91cb3fc746b0c1488cf007dabe883caf62b3b4f
Parents: dcdc3af
Author: Igor Bondarenko <je...@gmail.com>
Authored: Fri Jun 12 10:26:15 2015 +0000
Committer: Igor Bondarenko <je...@gmail.com>
Committed: Wed Jun 17 14:14:16 2015 +0300
----------------------------------------------------------------------
Allura/allura/ext/admin/widgets.py | 1 +
Allura/allura/lib/widgets/form_fields.py | 2 ++
.../lib/widgets/resources/js/sortable_repeated_field.js | 7 ++++++-
3 files changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/c91cb3fc/Allura/allura/ext/admin/widgets.py
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/admin/widgets.py b/Allura/allura/ext/admin/widgets.py
index 572db5d..9e6e39d 100644
--- a/Allura/allura/ext/admin/widgets.py
+++ b/Allura/allura/ext/admin/widgets.py
@@ -196,6 +196,7 @@ class MetadataAdmin(ff.AdminForm):
empty_msg='No features yet',
nonempty_msg='Drag and drop features to reorder. '
'Leave empty to delete a feature.',
+ append_to='bottom',
button=ew.InputField(
css_class='add',
field_type='button',
http://git-wip-us.apache.org/repos/asf/allura/blob/c91cb3fc/Allura/allura/lib/widgets/form_fields.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/widgets/form_fields.py b/Allura/allura/lib/widgets/form_fields.py
index 7d94e47..be3fd1a 100644
--- a/Allura/allura/lib/widgets/form_fields.py
+++ b/Allura/allura/lib/widgets/form_fields.py
@@ -412,6 +412,7 @@ class SortableRepeatedMixin(JQueryMixin):
'flist_cls',
'stub_cls',
'msg_cls',
+ 'append_to',
]
defaults = dict(
container_cls='sortable-repeated-field',
@@ -419,6 +420,7 @@ class SortableRepeatedMixin(JQueryMixin):
flist_cls='sortable-field-list',
stub_cls='sortable-field-stub',
msg_cls='sortable-field-message',
+ append_to='top',
empty_msg='No fields have been defined',
nonempty_msg='Drag and drop the fields to reorder',
repetitions=0)
http://git-wip-us.apache.org/repos/asf/allura/blob/c91cb3fc/Allura/allura/lib/widgets/resources/js/sortable_repeated_field.js
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/widgets/resources/js/sortable_repeated_field.js b/Allura/allura/lib/widgets/resources/js/sortable_repeated_field.js
index 71006ad..ca78493 100644
--- a/Allura/allura/lib/widgets/resources/js/sortable_repeated_field.js
+++ b/Allura/allura/lib/widgets/resources/js/sortable_repeated_field.js
@@ -25,6 +25,7 @@
flist_cls:'sortable-field-list',
stub_cls:'sortable-field-stub',
msg_cls:'sortable-field-message',
+ append_to:'top', // append new field to top by default. Also supports 'bottom'
};
$.fn.SortableRepeatedField = function(options) {
@@ -116,7 +117,11 @@
.replace(tpl_name, self.fld_name() + '-0'));
});
$new_field.find('.hasDatepicker').removeClass('hasDatepicker');
- self.data.$flist.prepend($new_field);
+ if (self.opts.append_to == 'top') {
+ self.data.$flist.prepend($new_field);
+ } else {
+ self.data.$flist.append($new_field);
+ }
_renumberFields();
_manageMessages();
// Trigger event reattachment, etc.
[24/35] allura git commit: CHANGES updated for ASF release 1.3.0
Posted by je...@apache.org.
CHANGES updated for ASF release 1.3.0
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/195c0b10
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/195c0b10
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/195c0b10
Branch: refs/heads/ib/7884
Commit: 195c0b10086d84c4306063405626197ce54dbe28
Parents: be5c811
Author: Igor Bondarenko <je...@gmail.com>
Authored: Mon Jun 15 13:34:43 2015 +0300
Committer: Igor Bondarenko <je...@gmail.com>
Committed: Mon Jun 15 13:34:43 2015 +0300
----------------------------------------------------------------------
CHANGES | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 79 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/195c0b10/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 76a4292..5f4f0a9 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,82 @@
+Version 1.3.0 (June 2015)
+
+Upgrade Instructions
+
+ * Run: cd Allura; paster script development.ini allura/scripts/trim_emails.py
+
+New Features
+
+ Webhooks:
+ * [#4542] Implement webhooks
+ * [#7832] APIs to manage webhooks
+ * [#7829] Webhooks documentation
+ Merge requests:
+ * [#7830] One-click merge
+ * [#7865] Config options to disable one-click merge requests
+ * [#7866] Run can_merge in background, and cache results
+ * [#7882] Option to use a tmp dir for git ops on merge request view
+ * [#7872] Show markdown preview/help buttons for merge requests
+ Phone verification:
+ * [#7868] Phone verification system
+ * [#7881] Clean up phone numbers before using them
+ * [#7887] Better messaging for phone validation
+ Other:
+ * [#7806] Create a docker image for Allura
+ * [#7886] Config options to limit ticket & wiki page creation
+ * [#7840] Support Authorization header for OAuth
+ * [#7633] API for has_access
+ * [#6057] Adding an external link should be one step, not two
+ * [#7850] Ability to close discussion on a ticket
+ * [#6107] Disable email posting for the forum? [ss3579]
+
+Security
+
+ * [#7786] Invalidate pwd reset tokens after email change
+ * [#7893] CSRF checks don't work on login
+
+Bug Fixes & Minor Improvements
+
+ Tickets:
+ * [#6017] Should show attachment changelog when ticket gains an attachment
+ * [#5467] Create Issue Button Should Always Appear (Only possibly refer to an explanation for why it was disabled).
+ * [#7834] Bug: viewing a ticket updates its 'updated' date
+ * [#7874] UnicodeEncodeError on ticket attachment diff
+ Code Repositories:
+ * [#7837] Use repo directly instead of DiffInfoDoc
+ * [#7843] Handle quotes in filenames on commit view
+ * [#7857] Retry svnsync repo clone failures
+ * [#7825] Update "new commits" email template
+ * [#7836] Merge request shows 0 commits, if upstream has new commits
+ Wiki:
+ * [#7841] wiki code to not show delete authors.
+ User Profile:
+ * [#7072] User can't access personal subscriptions page [ss6565]
+ * [#7833] Trim emails before saving them to mongo NEEDS SCRIPT
+ Tools Configuration:
+ * [#7817] Replace "mount point" field with URL field, on tool creation forms
+ * [#7820] Validate URLs when configuring external link tool
+ Importers:
+ * [#7864] Error on google code import with paginated comments
+ * [#7854] Decode html entities in importers; and make taskd easier to debug
+ Activity Stream:
+ * [#7823] Commit activity is assigned to wrong person
+ * [#7082] Filter deleted, unmoderated, or spam artifacts from Activity Stream
+ * [#7888] has_activity_access/deleted error
+ Administration:
+ * [#7892] script/task to disable list users
+ For Developers:
+ * [#7827] Upgrade jQuery to latest version
+ * [#7835] Update theme for the documentation.
+ * [#7855] Upgrade docutils, Pygments and Babel, so docs can be built easily
+ * [#7869] During tests, apply patches only once
+ * [#7870] Clean up .ini files
+ Other:
+ * [#1731] Cannot delete a post, after deleting its parent
+ * [#7852] Don't update mod time when viewing artifact creates a cache
+ * [#7856] Error looking up user by email address when email is invalid
+ * [#7876] projects macro display_mode=list is missing CSS
+
+
Version 1.2.1 (February 2015)
Bug Fixes & Minor Improvements
[21/35] allura git commit: [#7886] ticket:789 Rate limit ticket
creation
Posted by je...@apache.org.
[#7886] ticket:789 Rate limit ticket creation
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/1004b078
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/1004b078
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/1004b078
Branch: refs/heads/ib/7884
Commit: 1004b07892ca6dafb9a19d963fb880f7d3a3cd93
Parents: d22046c
Author: Igor Bondarenko <je...@gmail.com>
Authored: Wed Jun 10 08:41:17 2015 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Fri Jun 12 18:44:25 2015 +0000
----------------------------------------------------------------------
Allura/allura/lib/exceptions.py | 7 +++
.../forgetracker/tests/functional/test_rest.py | 25 +++++++--
.../forgetracker/tests/functional/test_root.py | 55 +++++++++++++++++++-
ForgeTracker/forgetracker/tracker_main.py | 14 +++++
4 files changed, 95 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/1004b078/Allura/allura/lib/exceptions.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/exceptions.py b/Allura/allura/lib/exceptions.py
index 21dd1d2..45843bf 100644
--- a/Allura/allura/lib/exceptions.py
+++ b/Allura/allura/lib/exceptions.py
@@ -15,6 +15,7 @@
# specific language governing permissions and limitations
# under the License.
+import webob
from formencode import Invalid
@@ -99,3 +100,9 @@ class CompoundError(ForgeError):
parts.append(' ' + line)
parts.append('</%s>\n' % self.__class__.__name__)
return ''.join(parts)
+
+
+class HTTPTooManyRequests(webob.exc.HTTPClientError):
+ code = 429
+ title = 'Too Many Requests'
+ explanation = 'Too Many Requests'
http://git-wip-us.apache.org/repos/asf/allura/blob/1004b078/ForgeTracker/forgetracker/tests/functional/test_rest.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tests/functional/test_rest.py b/ForgeTracker/forgetracker/tests/functional/test_rest.py
index 0932435..7d8d91a 100644
--- a/ForgeTracker/forgetracker/tests/functional/test_rest.py
+++ b/ForgeTracker/forgetracker/tests/functional/test_rest.py
@@ -18,7 +18,9 @@
from pylons import tmpl_context as c
from datadiff.tools import assert_equal
+from nose.tools import assert_not_equal
from mock import patch
+from tg import config
from allura.lib import helpers as h
from allura.tests import decorators as td
@@ -41,18 +43,18 @@ class TestTrackerApiBase(TestRestApiBase):
h.set_context('test', 'bugs', neighborhood='Projects')
self.tracker_globals = c.app.globals
- def create_ticket(self):
+ def create_ticket(self, summary=None, status=None):
return self.api_post(
'/rest/p/test/bugs/new',
wrap_args='ticket_form',
params=dict(
- summary='test new ticket',
+ summary=summary or 'test new ticket',
status=self.tracker_globals.open_status_names.split()[0],
labels='',
description='',
assigned_to='',
- **{'custom_fields._milestone': ''})
- )
+ **{'custom_fields._milestone': ''}),
+ status=status)
class TestRestNewTicket(TestTrackerApiBase):
@@ -81,6 +83,21 @@ class TestRestNewTicket(TestTrackerApiBase):
def test_invalid_ticket(self):
self.app.get('/rest/p/test/bugs/2', status=404)
+ def test_create_limit(self):
+ self.create_ticket(summary='First ticket')
+ # Set rate limit to unlimit
+ with h.push_config(config, **{'forgetracker.rate_limits': '{}'}):
+ summary = 'Second ticket'
+ self.create_ticket(summary=summary)
+ t = TM.Ticket.query.get(summary=summary)
+ assert_not_equal(t, None)
+ # Set rate limit to 1 in first hour of project
+ with h.push_config(config, **{'forgetracker.rate_limits': '{"3600": 1}'}):
+ summary = 'Third ticket'
+ self.create_ticket(summary=summary, status=429)
+ t = TM.Ticket.query.get(summary=summary)
+ assert_equal(t, None)
+
class TestRestUpdateTicket(TestTrackerApiBase):
http://git-wip-us.apache.org/repos/asf/allura/blob/1004b078/ForgeTracker/forgetracker/tests/functional/test_root.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tests/functional/test_root.py b/ForgeTracker/forgetracker/tests/functional/test_root.py
index 7f67b3a..122d707 100644
--- a/ForgeTracker/forgetracker/tests/functional/test_root.py
+++ b/ForgeTracker/forgetracker/tests/functional/test_root.py
@@ -28,11 +28,20 @@ import mock
import PIL
from mock import patch
-from nose.tools import assert_true, assert_false, assert_equal, assert_in
-from nose.tools import assert_raises, assert_not_in, assert_items_equal
+from nose.tools import (
+ assert_true,
+ assert_false,
+ assert_equal,
+ assert_in,
+ assert_raises,
+ assert_not_in,
+ assert_items_equal,
+ assert_not_equal,
+)
from formencode.variabledecode import variable_encode
from pylons import tmpl_context as c
from pylons import app_globals as g
+from tg import config
from alluratest.controller import TestController, setup_basic_test
from allura import model as M
@@ -2363,6 +2372,48 @@ class TestFunctionalController(TrackerTestController):
assert query_filter_choices.call_count == 1
assert query_filter_choices.call_args[0][0] == '!status_s:wont-fix && !status_s:closed'
+ def test_rate_limit_new(self):
+ self.new_ticket(summary='First ticket')
+ # Set rate limit to unlimit
+ with h.push_config(config, **{'forgetracker.rate_limits': '{}'}):
+ r = self.app.get('/bugs/new/')
+ assert_equal(r.status_int, 200)
+ # Set rate limit to 1 in first hour of project
+ with h.push_config(config, **{'forgetracker.rate_limits': '{"3600": 1}'}):
+ r = self.app.get('/bugs/new/')
+ assert_equal(r.status_int, 302)
+ assert_equal(r.location, 'http://localhost/bugs/')
+ wf = json.loads(self.webflash(r))
+ assert_equal(wf['status'], 'error')
+ assert_equal(
+ wf['message'],
+ 'Ticket creation rate limit exceeded. Please try again later.')
+
+ def test_rate_limit_save_ticket(self):
+ # Set rate limit to unlimit
+ with h.push_config(config, **{'forgetracker.rate_limits': '{}'}):
+ summary = 'Ticket w/o limit'
+ post_data = {'ticket_form.summary': summary}
+ r = self.app.post('/bugs/save_ticket', post_data).follow()
+ assert_in(summary, r)
+ t = tm.Ticket.query.get(summary=summary)
+ assert_not_equal(t, None)
+ # Set rate limit to 1 in first hour of project
+ with h.push_config(config, **{'forgetracker.rate_limits': '{"3600": 1}'}):
+ summary = 'Ticket with limit'
+ post_data = {'ticket_form.summary': summary}
+ r = self.app.post('/bugs/save_ticket', post_data)
+ assert_equal(r.status_int, 302)
+ assert_equal(r.location, 'http://localhost/bugs/')
+ wf = json.loads(self.webflash(r))
+ assert_equal(wf['status'], 'error')
+ assert_equal(
+ wf['message'],
+ 'Ticket creation rate limit exceeded. Please try again later.')
+ assert_not_in(summary, r.follow())
+ t = tm.Ticket.query.get(summary=summary)
+ assert_equal(t, None)
+
class TestMilestoneAdmin(TrackerTestController):
def _post(self, params, **kw):
http://git-wip-us.apache.org/repos/asf/allura/blob/1004b078/ForgeTracker/forgetracker/tracker_main.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tracker_main.py b/ForgeTracker/forgetracker/tracker_main.py
index e69e349..68b1a0c 100644
--- a/ForgeTracker/forgetracker/tracker_main.py
+++ b/ForgeTracker/forgetracker/tracker_main.py
@@ -57,6 +57,7 @@ from allura.lib import validators as V
from allura.lib.widgets import form_fields as ffw
from allura.lib.widgets.subscriptions import SubscribeForm
from allura.lib.plugin import ImportIdConverter
+from allura.lib import exceptions as forge_exc
from allura.controllers import AppDiscussionController, AppDiscussionRestController
from allura.controllers import attachments as att
from allura.controllers import BaseController
@@ -630,6 +631,13 @@ class RootController(BaseController, FeedController):
def _check_security(self):
require_access(c.app, 'read')
+ def rate_limit(self, redir='..'):
+ if TM.Ticket.is_limit_exceeded(c.app.config):
+ msg = 'Ticket creation rate limit exceeded. '
+ log.warn(msg + c.app.config.url())
+ flash(msg + 'Please try again later.', 'error')
+ redirect(redir)
+
@expose('json:')
def bin_counts(self, *args, **kw):
bin_counts = []
@@ -865,6 +873,7 @@ class RootController(BaseController, FeedController):
@expose('jinja:forgetracker:templates/tracker/new_ticket.html')
def new(self, description=None, summary=None, labels=None, **kw):
require_access(c.app, 'create')
+ self.rate_limit(redir='..')
c.ticket_form = W.ticket_form
help_msg = c.app.config.options.get('TicketHelpNew', '').strip()
return dict(action=c.app.config.url() + 'save_ticket',
@@ -901,6 +910,7 @@ class RootController(BaseController, FeedController):
require_access(ticket, 'update')
else:
require_access(c.app, 'create')
+ self.rate_limit(redir='.')
ticket = TM.Ticket.new()
ticket.update(ticket_form)
c.app.globals.invalidate_bin_counts()
@@ -1786,6 +1796,10 @@ class RootRestController(BaseController, AppRestControllerMixin):
@validate(W.ticket_form, error_handler=h.json_validation_error)
def new(self, ticket_form=None, **post_data):
require_access(c.app, 'create')
+ if TM.Ticket.is_limit_exceeded(c.app.config):
+ msg = 'Ticket creation rate limit exceeded. '
+ log.warn(msg + c.app.config.url())
+ raise forge_exc.HTTPTooManyRequests()
if c.app.globals.milestone_names is None:
c.app.globals.milestone_names = ''
ticket = TM.Ticket.new()
[27/35] allura git commit: [#7889] Add parameter to bypass the limit
for markdown conversion
Posted by je...@apache.org.
[#7889] Add parameter to bypass the limit for markdown conversion
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/a52e33f9
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/a52e33f9
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/a52e33f9
Branch: refs/heads/ib/7884
Commit: a52e33f9c4fd0f5f649f403225a2ca21da812d06
Parents: 9d26281
Author: Heith Seewald <hs...@slashdotmedia.com>
Authored: Mon Jun 15 13:37:03 2015 -0400
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Tue Jun 16 15:59:05 2015 +0000
----------------------------------------------------------------------
Allura/allura/lib/app_globals.py | 6 +++---
Allura/development.ini | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/a52e33f9/Allura/allura/lib/app_globals.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/app_globals.py b/Allura/allura/lib/app_globals.py
index 05fc254..7a13969 100644
--- a/Allura/allura/lib/app_globals.py
+++ b/Allura/allura/lib/app_globals.py
@@ -70,8 +70,8 @@ log = logging.getLogger(__name__)
class ForgeMarkdown(markdown.Markdown):
- def convert(self, source):
- if len(source) > asint(config.get('markdown_render_max_length', 40000)):
+ def convert(self, source, render_limit=True):
+ if render_limit and len(source) > asint(config.get('markdown_render_max_length', 40000)):
# if text is too big, markdown can take a long time to process it,
# so we return it as a plain text
log.info('Text is too big. Skipping markdown processing')
@@ -113,7 +113,7 @@ class ForgeMarkdown(markdown.Markdown):
# Convert the markdown and time the result.
start = time.time()
- html = self.convert(source_text)
+ html = self.convert(source_text, render_limit=False)
render_time = time.time() - start
threshold = config.get('markdown_cache_threshold')
http://git-wip-us.apache.org/repos/asf/allura/blob/a52e33f9/Allura/development.ini
----------------------------------------------------------------------
diff --git a/Allura/development.ini b/Allura/development.ini
index 20ef1ca..c81ed24 100644
--- a/Allura/development.ini
+++ b/Allura/development.ini
@@ -442,7 +442,7 @@ site_notification.impressions = 0
; posts. Remove entirely to cache nothing.
markdown_cache_threshold = .1
; markdown text longer than max length will not be converted to html
-markdown_render_max_length = 999999999
+markdown_render_max_length = 100000
; Don't add rel=nofollow to these domains when generating links from Markdown content
;nofollow_exempt_domains =
[14/35] allura git commit: [#7806] ticket:778 Add conteiners for
in/out mail
Posted by je...@apache.org.
[#7806] ticket:778 Add conteiners for in/out mail
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/25a242ff
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/25a242ff
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/25a242ff
Branch: refs/heads/ib/7884
Commit: 25a242ff5a131bfcaafe76f60b0459ded6f93086
Parents: a165692
Author: Igor Bondarenko <je...@gmail.com>
Authored: Sat May 30 15:00:20 2015 +0300
Committer: Dave Brondsema <da...@brondsema.net>
Committed: Fri Jun 12 11:43:35 2015 -0400
----------------------------------------------------------------------
Allura/docker-dev.ini | 7 +++++--
docker-compose.yml | 19 +++++++++++++++++++
2 files changed, 24 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/25a242ff/Allura/docker-dev.ini
----------------------------------------------------------------------
diff --git a/Allura/docker-dev.ini b/Allura/docker-dev.ini
index 0ce00eb..d35fd17 100644
--- a/Allura/docker-dev.ini
+++ b/Allura/docker-dev.ini
@@ -43,8 +43,11 @@ scm.repos.tarball.url_prefix = http://localhost:8080/
solr.server = http://solr:8983/solr
-;forgemail.host = smtp
-;forgemail.port = 8825
+smtp_server = outmail
+smtp_port = 8826
+
+forgemail.host = 0.0.0.0
+forgemail.port = 8825
[filter-app:profile]
use=egg:keas.profile#profiler
http://git-wip-us.apache.org/repos/asf/allura/blob/25a242ff/docker-compose.yml
----------------------------------------------------------------------
diff --git a/docker-compose.yml b/docker-compose.yml
index 586afed..230b3d5 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -34,6 +34,7 @@ web:
links:
- mongo
- solr
+ - outmail
taskd:
image: allura_web
@@ -44,6 +45,7 @@ taskd:
links:
- mongo
- solr
+ - outmail
solr:
build: solr_config
@@ -60,3 +62,20 @@ mongo:
- "27017"
volumes:
- /allura-data/mongo:/data/db
+
+outmail:
+ image: allura_web
+ command: python -m smtpd -n -c DebuggingServer 0.0.0.0:8826
+ expose:
+ - "8826"
+
+inmail:
+ image: allura_web
+ working_dir: /allura/Allura
+ command: paster smtp_server docker-dev.ini
+ volumes_from:
+ - web
+ ports:
+ - "8825:8825"
+ links:
+ - mongo
[02/35] allura git commit: [#7806] ticket:773 Inherit docker-dev.ini
from development.ini
Posted by je...@apache.org.
[#7806] ticket:773 Inherit docker-dev.ini from development.ini
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/15adba65
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/15adba65
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/15adba65
Branch: refs/heads/ib/7884
Commit: 15adba65b3ac78ff89a8240d666bf1e1594fc27f
Parents: 5ceb84d
Author: Igor Bondarenko <je...@gmail.com>
Authored: Thu May 21 17:37:22 2015 +0300
Committer: Dave Brondsema <da...@brondsema.net>
Committed: Fri Jun 12 11:43:29 2015 -0400
----------------------------------------------------------------------
Allura/docker-dev.ini | 457 +--------------------------------------------
1 file changed, 1 insertion(+), 456 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/15adba65/Allura/docker-dev.ini
----------------------------------------------------------------------
diff --git a/Allura/docker-dev.ini b/Allura/docker-dev.ini
index 0343dd3..37378a1 100644
--- a/Allura/docker-dev.ini
+++ b/Allura/docker-dev.ini
@@ -15,484 +15,29 @@
; specific language governing permissions and limitations
; under the License.
-
-;
-; Allura configuration
-;
-; Default config values are shown in this file.
-; Commented-out configurations are examples that you can use if you want.
-;
-; Logging configuration is at the end of the file (starting at [loggers])
-;
-; There are many settings you should change for your site (name, domain, secret keys, etc)
-; More settings should be changed for good performance in a production site (no autoreload, no debugging, etc)
-;
-; You may copy this file to make a new configuration file (e.g. production.ini)
-; Or inherit from this file by starting your .ini file like this:
-; [app:main]
-; use = config:development.ini#main
-; Then just use the new file name instead of development.ini for any paster commands you run.
-
-
-[DEFAULT]
-; this section is for a few settings that are shared with error handling middleware
-
-; WARNING: *THE LINE BELOW MUST BE CHANGED ON A PRODUCTION ENVIRONMENT*
-; Debug mode will enable the interactive debugging tool, allowing ANYONE to
-; execute malicious code after an exception is raised.
-debug = true
-; If you want to receive an email for every unhandled HTTP 500 error, set your email address here:
-;email_to = you@yourdomain.com
-error_email_from = paste@localhost
-
-; SMTP settings for outgoing mail
-smtp_tls = false
-smtp_ssl = false
-;smtp_user = some_user
-;smtp_password = some_password
-smtp_timeout = 10
-smtp_server = localhost
-smtp_port = 8826
-; Reply-To and From address often used in email notifications:
-forgemail.return_path = noreply@localhost
-
-
-;
-; Settings for `paster serve` command
-;
[server:main]
use = egg:Paste#http
host = 0.0.0.0
port = 8080
-
-;
-; The main allura settings
-;
[app:main]
-use = egg:Allura
-full_stack = true
-
-; Change this to your website's name
-site_name = Allura
-; Change these to your website's domain
-domain = localhost
-; Change this to your website's full URL
-base_url = http://localhost:8080
-; This should be the same as base_url
-forgemail.url = http://localhost:8080
-
-; Used to uniquify references to static resources, can be a timestamp or any unique value
-; This should be updated each time you deploy (or make significant changes, like new tools, new css)
-build_key=1276635823
-
-; Used by Turbogears / Pylons in some cases. Not particularly relevant for Allura.
-cache_dir = %(here)s/data
-
-; Cache Neighborhood objects for N seconds (speeds up requests).
-; Set to 0 to disable (the default).
-;neighborhood.cache.duration = 0
-
-; Template cache settings
-; See http://jinja.pocoo.org/docs/api/#jinja2.Environment
-jinja_cache_size = -1
-;jinja_bytecode_cache_type = filesystem
-;jinja_bytecode_cache_type = memcached
-;memcached_host =
-
-; Docs at http://beaker.readthedocs.org/en/latest/configuration.html#session-options
-; and http://beaker.readthedocs.org/en/latest/modules/session.html#beaker.session.CookieSession
-beaker.session.key = allura
-beaker.session.type = cookie
-beaker.session.httponly = true
-; set this to true if you use HTTPS. If you use force_ssl.logged_in, this will be set automatically when logged in and not when not.
-beaker.session.secure = false
-; CHANGE THIS VALUE FOR YOUR SITE
-beaker.session.validate_key = 714bfe3612c42390726f
-
-; Google Analytics account for tracking
-;ga.account = UA-XXXXX-X
-
-; Project registration system. Only local is available, unless you write a custom one for custom integration.
-registration.method = local
-theme = allura
-
-; For LDAP see https://forge-allura.apache.org/docs/getting_started/installation.html#using-ldap
-;auth.method = ldap
-auth.method = local
-auth.remember_for = 365 ; in days, for the "remember me" checkbox on login
-
-; Customize login/logout URLs only if you have some custom authentication set up.
-auth.login_url = /auth/
-auth.logout_url = /auth/logout
-; the login fragement URL shows just the form, not a whole page. It is used within a login overlay on some pages
-auth.login_fragment_url = /auth/login_fragment/
-auth.post_logout_url = /
-
-auth.min_password_len = 6
-auth.max_password_len = 30
-
-; password expiration options (disabled if neither is set)
-;auth.pwdexpire.days = 1
-;auth.pwdexpire.before = 1401949912 ; unix timestamp
-
-; if using LDAP, also run `pip install python-ldap` in your Allura environment
-
-auth.ldap.server = ldaps://localhost/
-auth.ldap.suffix = ou=people,dc=localdomain
-auth.ldap.admin_dn = cn=admin,dc=localdomain
-auth.ldap.admin_password = secret
-auth.ldap.schroot_name = scm
-auth.ldap.use_schroot = false
-auth.ldap.password.algorithm = 6
-auth.ldap.password.rounds = 6000
-auth.ldap.password.salt_len = 16
-; "autoregister" allows users to log in to Allura with an existing LDAP account
-; If using ldap, with autoregister, you should also set "allow_user_registration"
-; to false below.
-; Set "autoregister" to false to require user to register in Allura to create
-; the LDAP record and Allura record for the user.
-auth.ldap.autoregister = true
-
-auth.allow_user_registration = true
-auth.allow_user_to_disable_account = true
-auth.allow_edit_prefs = true
-auth.allow_password_change = true
-auth.allow_upload_ssh_key = false
-auth.allow_user_messages_config = true
-auth.allow_birth_date = true
-auth.allow_non_primary_email_password_reset = true
-auth.require_email_addr = true
-; List of social network options to use on user account settings
-socialnetworks = Facebook, Linkedin, Twitter, Google+
-
-; In seconds
-auth.recovery_hash_expiry_period = 600
-
-user_prefs_storage.method = local
-; user_prefs_storage.method = ldap
-; If using ldap, you can specify which fields to use for a preference.
-; Any fields not specified here will be stored locally in mongo
-user_prefs_storage.ldap.fields.display_name = cn
-
-; Limit the number of emails a user can claim.
-user_prefs.maximum_claimed_emails = 20
-
-; Control the order of sections on the user profile page
-;user_profile_sections.order = activity, personal-data, skills
-
-; Site admins will be the same as the admins of this project:
-site_admin_project = allura
-site_admin_project_nbhd = Projects
-
-; Spam filtering service: mollom or akismet
-;spam.method = akismet
-; for akismet:
-;spam.key =
-; for mollom:
-;spam.public_key =
-;spam.private_key =
-
-; Webhook timeout in seconds
-webhook.timeout = 30
-; List of pauses between retries, if hook fails (in seconds)
-webhook.retry = 60 120 240
-; Limit rate of webhook firing (in seconds, default = 30)
-; Option format: webhook.<hook type>.limit,
-; all '-' in hook type must be changed to '_'
-; e.g. for repo-push webhook:
-webhook.repo_push.limit = 30
-; Limit max number of hooks that can be created for given project/app
-; Option name format: same as above.
-; Value format: json dict, where keys are app names (as appears in
-; `WebhookSender.triggered_by`) and values are actual limits (default=3), e.g.:
-webhook.repo_push.max_hooks = {"git": 3, "hg": 3, "svn": 3}
-
-; Additional fields for admin project/user search
-; Note: whitespace after comma is important!
-;search.project.additional_search_fields = private, url, title
-;search.user.additional_search_fields = email_addresses
-
-; Additional fields to show in the result of admin project/user search
-; Note: whitespace after comma is important!
-;search.project.additional_display_fields = private, url, title
-;search.user.additional_display_fields = email_addresses
-
-; To make all pages use ssl: (also set beaker.session.secure above)
-;force_ssl.pattern = .
-; To use ssl if and only if a user is logged in:
-;force_ssl.logged_in = true
-; If you set force_ssl.logged_in, you probably want some URLs to be ssl when logged out:
-;force_ssl.pattern = ^/auth|^/[a-z0-9-]+/import_project/ ; import_project uses a login overlay
-; And to permit some URLs to be accessed over http anyway:
-;no_redirect.pattern = ^/nf/\d+/_(ew|static)_/|^/rest/|^/nf/tool_icon_css|^/auth/refresh_repo
-
-
-; Set the locations of some static resources. ("ew" stands for EasyWidgets library)
-; script_name is the path that is handled by the application
-; url_base is the prefix that references to the static resources should have
-; If you use a CDN, put your CDN prefix in the url_base values
-ew.script_name = /nf/%(build_key)s/_ew_/
-ew.url_base = /nf/%(build_key)s/_ew_/
-static.script_name = /nf/%(build_key)s/_static_/
-static.url_base = /nf/%(build_key)s/_static_/
-
-; Expires header for "static" resources served through allura (e.g. icons, attachments, /nf/tool_icon_css)
-files_expires_header_secs = 1209600 ; 2 weeks
-
-ew.extra_headers = [ ('Access-Control-Allow-Origin', '*') ]
-
-; If your environment (e.g. behind a server-side proxy) needs to look at an http header to get the actual remote addr
-;ip_address_header = X-Forwarded-For
-
-; SCM settings for local development
-scm.host.ro.git = /srv/git$path
-scm.host.rw.git = /srv/git$path
-; remote access varies by configuration. If you are using a vagrant VM, this should work:
-;scm.host.rw.git = ssh://vagrant@localhost:2222/srv/git$path
-scm.host.ro.hg = /srv/hg$path
-scm.host.rw.hg = /srv/hg$path
-scm.host.ro.svn = file:///srv/svn$path/
-scm.host.rw.svn = file:///srv/svn$path/
-
-; SCM settings for chroot + ldap configuration. See Allura/docs/getting_started/scm_host.rst
-;scm.host.ro.git = git://git.localhost$path
-;scm.host.rw.git = ssh://$username@localhost:8022/scm-repo$path
-;scm.host.ro.hg = http://hg.localhost$path
-;scm.host.rw.hg = ssh://$username@localhost:8022/scm-repo$path
-;scm.host.ro.svn = http://svn.localhost$path/
-;scm.host.rw.svn = svn+ssh://localhost:8022/scm-repo$path/
-
-; SCM settings for https (sorry no docs for setting these up)
-; these settings are currently required by the template, no matter what
-scm.host.https.git = https://$username@localhost:8022/scm-repo$path
-scm.host.https_anon.git = https://localhost:8022/scm-repo$path
-scm.host.https.hg = https://$username@localhost:8022/scm-repo$path
-scm.host.https_anon.hg = https://localhost:8022/scm-repo$path
-scm.host.https.svn = https://localhost:8022/scm-repo$path/
-scm.host.https_anon.svn = https://localhost:8022/scm-repo$path/
-
-scm.clone.git = git clone $source_url $dest_path
-scm.clone.hg = hg clone $source_url $dest_path
-scm.clone.ro.svn = svn checkout $source_url $dest_path
-scm.clone.https_anon.svn = svn checkout $source_url $dest_path
-scm.clone.svn = svn checkout --username=$username $source_url $dest_path
+use = config:development.ini#main
-scm.repos.root = /srv
-scm.repos.tarball.enable = false
-scm.repos.tarball.root = /usr/share/nginx/www/
-scm.repos.tarball.url_prefix = http://localhost/
-scm.repos.tarball.zip_binary = /usr/bin/zip
-
-; SCM imports (currently just SVN) will retry if it fails
-; You can control the number of tries and delay between tries here:
-scm.import.retry_count = 50
-scm.import.retry_sleep_secs = 5
-
-; One-click merge is enabled by default, but can be turned off on for each type of repo
-scm.merge.git.disabled = false
-scm.merge.hg.disabled = false
-
-
-; bulk_export_enabled = true
-; If you keep bulk_export_enabled, you should set up your server to securely share bulk_export_path with users somehow
-bulk_export_path = /tmp/bulk_export/{nbhd}/{project}
-bulk_export_filename = {project}-backup-{date:%Y-%m-%d-%H%M%S}.zip
-; You will need to specify site-specific instructions here for accessing the exported files.
-bulk_export_download_instructions = Sample instructions for {project}
-
-importer_upload_path = /tmp/importer_upload/{nbhd}/{project}
-
-; To disable any plugin, tool, importer, etc from being available, you can use the disable_entry_points config option.
-; Specify the keys and values as they are declared in the tool's "setup.py" file.
-; Examples:
-;disable_entry_points.importers = google-code-tracker, google-code-repo
-;disable_entry_points.allura.project_importers = google-code
-
-; Importers specifically, can be left enabled but not linked to. You have to know the URL to use it. Example:
-;hidden_importers = trac-tickets
-
-; GitHub importer keys. For github ticket import, it is best to set
-; up an app at https://github.com/settings/applications Use the root URL
-; of your Allura instance for both URLs, and enter client values here:
-;github_importer.client_id =
-;github_importer.client_secret =
-
-; If your site has docs about specific importers, you can add them here and
-; they'll appear on the import forms
-;doc.url.importers.Google Code = http://...
-
-; List of oauth API keys permitted to use special forum import API
-; (should be converted to newer importer system)
-;oauth.can_import_forum = api-key-1234, fa832r0fdsafd, f23f80sdf32fd
-
-
-; space-separated list of tool names that are valid options
-; for project admins to set for their 'support_page' field
-; this field is not used by default in Allura, so this option
-; is disabled by default
-;support_tool_choices = wiki tickets discussion
-
-; Control how /categories URL can be accessed to edit trove categories (used in project categories and user skills)
-; Default: everyone
-trovecategories.enableediting = true
-; Nobody:
-;trovecategories.enableediting = false
-; Site admins only:
-;trovecategories.enableediting = admin
-
-; ActivityStream
activitystream.master = mongodb://mongo:27017
-activitystream.database = activitystream
-activitystream.activity_collection = activities
-activitystream.node_collection = nodes
-activitystream.timeline_collection = timelines
-activitystream.enabled = true
-activitystream.recording.enabled = true
-; Ming setup
-; These don't necessarily have to be separate databases, they could
-; be all in the same database if desired
ming.main.uri = mongodb://mongo:27017/allura
-ming.main.auto_ensure_indexes = False
ming.project.uri = mongodb://mongo:27017/project-data
-ming.project.auto_ensure_indexes = False
ming.task.uri = mongodb://mongo:27017/task
-ming.task.auto_ensure_indexes = False
-;ming.zarkov.uri = mongodb://127.0.0.1:27017/zarkov
-;ming.zarkov.auto_ensure_indexes = False
-
-; Zarkov host setting, requires the zarkov and gevent libraries.
-;zarkov.host = tcp://127.0.0.1:9000
-
-; A float from 0-1 representing a % of requests to measure timing on.
-; Sampled requests will have timing logged to stats.log (can change file in [handler_timermiddleware] logging section)
-stats.sample_rate = 1
-
-; Taskd setup
-; number of seconds to sleep between checking for new tasks
-monq.poll_interval=2
-
-; SOLR setup
-solr.server = http://localhost:8983/solr
-; Alternate server to use just for querying
-;solr.query_server =
-; Shorter timeout for search queries (longer timeout for saving to solr)
-solr.short_timeout = 10
-; commit on every add/delete?
-solr.commit = false
-; commit add operations within N ms
-solr.commitWithin = 10000
-; Use improved data types for labels and custom fields?
-; New Allura deployments should leave this set to true. Existing deployments
-; should set to false until existing data has been reindexed. Reindexing will
-; convert existing label and custom field data to more appropriate solr types.
-solr.use_new_types = true
-
-; Incoming email settings. Used when you run: paster smtp_server development.ini
-; address to listen to
-forgemail.host = 0.0.0.0
-forgemail.port = 8825
-; domain suffix for your mail, change this. You also need to route *.*.*.forgemail.domain to the above host/port via
-; your mail and DNS configuration
-forgemail.domain = .in.localhost
-
-; Specify the number of projects allowed to be created by a user
-; depending on the age of their user account.
-; Keys are number of seconds, values are max number of projects allowed
-; (including the default user-project, so you probably want to add 1)
-; This example allows for 1 project if the account is less than an hour old
-; and 5 projects if the account is less than a day old. No limits after that
-;project.rate_limits = {"3600": 2, "86400": 6}
-
-; set this to "false" if you are deploying to production and want performance improvements
-auto_reload_templates = true
-
-; How frequently users can send messages, in seconds
-user_message.time_interval = 3600
-; Max number of messages that can be sent within that time interval.
-user_message.max_messages = 20
-
-; Default number of times to show a sitewide notification
-; See https://forge-allura.apache.org/docs/getting_started/administration.html#site-notifications
-site_notification.impressions = 0
-
-; When rendering discussion post Markdown to html, if the render takes longer
-; than `markdown_cache_threshold` (in seconds), the resulting html will be
-; cached and served from cache on subsequent requests. Set to 0 to cache all
-; posts. Remove entirely to cache nothing.
-markdown_cache_threshold = .1
-; markdown text longer than max length will not be converted to html
-markdown_render_max_length = 999999999
-; Don't add rel=nofollow to these domains when generating links from Markdown content
-;nofollow_exempt_domains =
-
-; Export control choices on the project admin overview page.
-show_export_control = false
-
-; By default project admins can soft-delete their projects.
-; A soft-deleted project will still be in the database and visible to admins, but not to others.
-allow_project_delete = true
-allow_project_undelete = true
-; Advanced settings for controlling "Last Commit Doc" algorithm used when visiting any repo browse page
-lcd_thread_chunk_size = 10
-lcd_timeout = 60
-
-;
-; Settings for the Blog tool
-;
-; Enable or disable external RSS feed importing in ForgeBlog tool.
-; Default is "false". This feature requires GPL library "html2text". Install it with following command:
-; pip install -e git://github.com/brondsem/html2text.git#egg=html2text
-; You will also need to run `paster pull-rss-feeds development.ini` in a cron job to fetch them.
-forgeblog.exfeed = false
-
-;
-; Settings for the Chat tool
-;
-forgechat.host = irc.freenode.net
-forgechat.port = 6667
-ircbot.nick = allurabot
-
-;
-; Settings for ShortUrl tool
-;
-; Override this if you set up an additional shortening mechanism (e.g. custom short domain)
-short_url.url_pattern = {base_url}/{nbhd}/{project}/{mount_point}/{short_name}
-
-
-;
-; Settings for UserStats tool
-;
-userstats.count_lines_of_code = true
-
-
-;
-; Optional settings for profiling with https://pypi.python.org/pypi/keas.profile
-;
[filter-app:profile]
use=egg:keas.profile#profiler
next=main
-
-;
-; setup for the taskd background daemon request controller
-;
[app:task]
use = main
override_root = task ; TurboGears will use controllers/task.py as root controller
-
-
-;
-; Logging configuration
-;
-; Add additional loggers, handlers, formatters here
-; Uses python's logging config file format
-; https://docs.python.org/2/library/logging.config.html#configuration-file-format
-;
[loggers]
keys = root, allura, sqlalchemy, paste, pylons, taskdstatus, timermiddleware, tmw_details
[04/35] allura git commit: [#7806] ticket:773 Basic docker containers
for Allura web and mongo
Posted by je...@apache.org.
[#7806] ticket:773 Basic docker containers for Allura web and mongo
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/6e364168
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/6e364168
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/6e364168
Branch: refs/heads/ib/7884
Commit: 6e364168ed22274c5b291cfbcdecfaf984d2f9b2
Parents: 69dd7f8
Author: Igor Bondarenko <je...@gmail.com>
Authored: Thu May 21 15:03:35 2015 +0300
Committer: Dave Brondsema <da...@brondsema.net>
Committed: Fri Jun 12 11:43:29 2015 -0400
----------------------------------------------------------------------
Allura/docker-dev.ini | 588 +++++++++++++++++++++++++++++++++++++++++++++
Dockerfile | 18 ++
docker-compose.yml | 16 ++
3 files changed, 622 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/6e364168/Allura/docker-dev.ini
----------------------------------------------------------------------
diff --git a/Allura/docker-dev.ini b/Allura/docker-dev.ini
new file mode 100644
index 0000000..0343dd3
--- /dev/null
+++ b/Allura/docker-dev.ini
@@ -0,0 +1,588 @@
+; Licensed to the Apache Software Foundation (ASF) under one
+; or more contributor license agreements. See the NOTICE file
+; distributed with this work for additional information
+; regarding copyright ownership. The ASF licenses this file
+; to you under the Apache License, Version 2.0 (the
+; "License"); you may not use this file except in compliance
+; with the License. You may obtain a copy of the License at
+;
+; http://www.apache.org/licenses/LICENSE-2.0
+;
+; Unless required by applicable law or agreed to in writing,
+; software distributed under the License is distributed on an
+; "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+; KIND, either express or implied. See the License for the
+; specific language governing permissions and limitations
+; under the License.
+
+
+;
+; Allura configuration
+;
+; Default config values are shown in this file.
+; Commented-out configurations are examples that you can use if you want.
+;
+; Logging configuration is at the end of the file (starting at [loggers])
+;
+; There are many settings you should change for your site (name, domain, secret keys, etc)
+; More settings should be changed for good performance in a production site (no autoreload, no debugging, etc)
+;
+; You may copy this file to make a new configuration file (e.g. production.ini)
+; Or inherit from this file by starting your .ini file like this:
+; [app:main]
+; use = config:development.ini#main
+; Then just use the new file name instead of development.ini for any paster commands you run.
+
+
+[DEFAULT]
+; this section is for a few settings that are shared with error handling middleware
+
+; WARNING: *THE LINE BELOW MUST BE CHANGED ON A PRODUCTION ENVIRONMENT*
+; Debug mode will enable the interactive debugging tool, allowing ANYONE to
+; execute malicious code after an exception is raised.
+debug = true
+; If you want to receive an email for every unhandled HTTP 500 error, set your email address here:
+;email_to = you@yourdomain.com
+error_email_from = paste@localhost
+
+; SMTP settings for outgoing mail
+smtp_tls = false
+smtp_ssl = false
+;smtp_user = some_user
+;smtp_password = some_password
+smtp_timeout = 10
+smtp_server = localhost
+smtp_port = 8826
+; Reply-To and From address often used in email notifications:
+forgemail.return_path = noreply@localhost
+
+
+;
+; Settings for `paster serve` command
+;
+[server:main]
+use = egg:Paste#http
+host = 0.0.0.0
+port = 8080
+
+
+;
+; The main allura settings
+;
+[app:main]
+use = egg:Allura
+full_stack = true
+
+; Change this to your website's name
+site_name = Allura
+; Change these to your website's domain
+domain = localhost
+; Change this to your website's full URL
+base_url = http://localhost:8080
+; This should be the same as base_url
+forgemail.url = http://localhost:8080
+
+; Used to uniquify references to static resources, can be a timestamp or any unique value
+; This should be updated each time you deploy (or make significant changes, like new tools, new css)
+build_key=1276635823
+
+; Used by Turbogears / Pylons in some cases. Not particularly relevant for Allura.
+cache_dir = %(here)s/data
+
+; Cache Neighborhood objects for N seconds (speeds up requests).
+; Set to 0 to disable (the default).
+;neighborhood.cache.duration = 0
+
+; Template cache settings
+; See http://jinja.pocoo.org/docs/api/#jinja2.Environment
+jinja_cache_size = -1
+;jinja_bytecode_cache_type = filesystem
+;jinja_bytecode_cache_type = memcached
+;memcached_host =
+
+; Docs at http://beaker.readthedocs.org/en/latest/configuration.html#session-options
+; and http://beaker.readthedocs.org/en/latest/modules/session.html#beaker.session.CookieSession
+beaker.session.key = allura
+beaker.session.type = cookie
+beaker.session.httponly = true
+; set this to true if you use HTTPS. If you use force_ssl.logged_in, this will be set automatically when logged in and not when not.
+beaker.session.secure = false
+; CHANGE THIS VALUE FOR YOUR SITE
+beaker.session.validate_key = 714bfe3612c42390726f
+
+; Google Analytics account for tracking
+;ga.account = UA-XXXXX-X
+
+; Project registration system. Only local is available, unless you write a custom one for custom integration.
+registration.method = local
+theme = allura
+
+; For LDAP see https://forge-allura.apache.org/docs/getting_started/installation.html#using-ldap
+;auth.method = ldap
+auth.method = local
+auth.remember_for = 365 ; in days, for the "remember me" checkbox on login
+
+; Customize login/logout URLs only if you have some custom authentication set up.
+auth.login_url = /auth/
+auth.logout_url = /auth/logout
+; the login fragement URL shows just the form, not a whole page. It is used within a login overlay on some pages
+auth.login_fragment_url = /auth/login_fragment/
+auth.post_logout_url = /
+
+auth.min_password_len = 6
+auth.max_password_len = 30
+
+; password expiration options (disabled if neither is set)
+;auth.pwdexpire.days = 1
+;auth.pwdexpire.before = 1401949912 ; unix timestamp
+
+; if using LDAP, also run `pip install python-ldap` in your Allura environment
+
+auth.ldap.server = ldaps://localhost/
+auth.ldap.suffix = ou=people,dc=localdomain
+auth.ldap.admin_dn = cn=admin,dc=localdomain
+auth.ldap.admin_password = secret
+auth.ldap.schroot_name = scm
+auth.ldap.use_schroot = false
+auth.ldap.password.algorithm = 6
+auth.ldap.password.rounds = 6000
+auth.ldap.password.salt_len = 16
+; "autoregister" allows users to log in to Allura with an existing LDAP account
+; If using ldap, with autoregister, you should also set "allow_user_registration"
+; to false below.
+; Set "autoregister" to false to require user to register in Allura to create
+; the LDAP record and Allura record for the user.
+auth.ldap.autoregister = true
+
+auth.allow_user_registration = true
+auth.allow_user_to_disable_account = true
+auth.allow_edit_prefs = true
+auth.allow_password_change = true
+auth.allow_upload_ssh_key = false
+auth.allow_user_messages_config = true
+auth.allow_birth_date = true
+auth.allow_non_primary_email_password_reset = true
+auth.require_email_addr = true
+; List of social network options to use on user account settings
+socialnetworks = Facebook, Linkedin, Twitter, Google+
+
+; In seconds
+auth.recovery_hash_expiry_period = 600
+
+user_prefs_storage.method = local
+; user_prefs_storage.method = ldap
+; If using ldap, you can specify which fields to use for a preference.
+; Any fields not specified here will be stored locally in mongo
+user_prefs_storage.ldap.fields.display_name = cn
+
+; Limit the number of emails a user can claim.
+user_prefs.maximum_claimed_emails = 20
+
+; Control the order of sections on the user profile page
+;user_profile_sections.order = activity, personal-data, skills
+
+; Site admins will be the same as the admins of this project:
+site_admin_project = allura
+site_admin_project_nbhd = Projects
+
+; Spam filtering service: mollom or akismet
+;spam.method = akismet
+; for akismet:
+;spam.key =
+; for mollom:
+;spam.public_key =
+;spam.private_key =
+
+; Webhook timeout in seconds
+webhook.timeout = 30
+; List of pauses between retries, if hook fails (in seconds)
+webhook.retry = 60 120 240
+; Limit rate of webhook firing (in seconds, default = 30)
+; Option format: webhook.<hook type>.limit,
+; all '-' in hook type must be changed to '_'
+; e.g. for repo-push webhook:
+webhook.repo_push.limit = 30
+; Limit max number of hooks that can be created for given project/app
+; Option name format: same as above.
+; Value format: json dict, where keys are app names (as appears in
+; `WebhookSender.triggered_by`) and values are actual limits (default=3), e.g.:
+webhook.repo_push.max_hooks = {"git": 3, "hg": 3, "svn": 3}
+
+; Additional fields for admin project/user search
+; Note: whitespace after comma is important!
+;search.project.additional_search_fields = private, url, title
+;search.user.additional_search_fields = email_addresses
+
+; Additional fields to show in the result of admin project/user search
+; Note: whitespace after comma is important!
+;search.project.additional_display_fields = private, url, title
+;search.user.additional_display_fields = email_addresses
+
+; To make all pages use ssl: (also set beaker.session.secure above)
+;force_ssl.pattern = .
+; To use ssl if and only if a user is logged in:
+;force_ssl.logged_in = true
+; If you set force_ssl.logged_in, you probably want some URLs to be ssl when logged out:
+;force_ssl.pattern = ^/auth|^/[a-z0-9-]+/import_project/ ; import_project uses a login overlay
+; And to permit some URLs to be accessed over http anyway:
+;no_redirect.pattern = ^/nf/\d+/_(ew|static)_/|^/rest/|^/nf/tool_icon_css|^/auth/refresh_repo
+
+
+; Set the locations of some static resources. ("ew" stands for EasyWidgets library)
+; script_name is the path that is handled by the application
+; url_base is the prefix that references to the static resources should have
+; If you use a CDN, put your CDN prefix in the url_base values
+ew.script_name = /nf/%(build_key)s/_ew_/
+ew.url_base = /nf/%(build_key)s/_ew_/
+static.script_name = /nf/%(build_key)s/_static_/
+static.url_base = /nf/%(build_key)s/_static_/
+
+; Expires header for "static" resources served through allura (e.g. icons, attachments, /nf/tool_icon_css)
+files_expires_header_secs = 1209600 ; 2 weeks
+
+ew.extra_headers = [ ('Access-Control-Allow-Origin', '*') ]
+
+; If your environment (e.g. behind a server-side proxy) needs to look at an http header to get the actual remote addr
+;ip_address_header = X-Forwarded-For
+
+; SCM settings for local development
+scm.host.ro.git = /srv/git$path
+scm.host.rw.git = /srv/git$path
+; remote access varies by configuration. If you are using a vagrant VM, this should work:
+;scm.host.rw.git = ssh://vagrant@localhost:2222/srv/git$path
+scm.host.ro.hg = /srv/hg$path
+scm.host.rw.hg = /srv/hg$path
+scm.host.ro.svn = file:///srv/svn$path/
+scm.host.rw.svn = file:///srv/svn$path/
+
+; SCM settings for chroot + ldap configuration. See Allura/docs/getting_started/scm_host.rst
+;scm.host.ro.git = git://git.localhost$path
+;scm.host.rw.git = ssh://$username@localhost:8022/scm-repo$path
+;scm.host.ro.hg = http://hg.localhost$path
+;scm.host.rw.hg = ssh://$username@localhost:8022/scm-repo$path
+;scm.host.ro.svn = http://svn.localhost$path/
+;scm.host.rw.svn = svn+ssh://localhost:8022/scm-repo$path/
+
+; SCM settings for https (sorry no docs for setting these up)
+; these settings are currently required by the template, no matter what
+scm.host.https.git = https://$username@localhost:8022/scm-repo$path
+scm.host.https_anon.git = https://localhost:8022/scm-repo$path
+scm.host.https.hg = https://$username@localhost:8022/scm-repo$path
+scm.host.https_anon.hg = https://localhost:8022/scm-repo$path
+scm.host.https.svn = https://localhost:8022/scm-repo$path/
+scm.host.https_anon.svn = https://localhost:8022/scm-repo$path/
+
+scm.clone.git = git clone $source_url $dest_path
+scm.clone.hg = hg clone $source_url $dest_path
+scm.clone.ro.svn = svn checkout $source_url $dest_path
+scm.clone.https_anon.svn = svn checkout $source_url $dest_path
+scm.clone.svn = svn checkout --username=$username $source_url $dest_path
+
+scm.repos.root = /srv
+scm.repos.tarball.enable = false
+scm.repos.tarball.root = /usr/share/nginx/www/
+scm.repos.tarball.url_prefix = http://localhost/
+scm.repos.tarball.zip_binary = /usr/bin/zip
+
+; SCM imports (currently just SVN) will retry if it fails
+; You can control the number of tries and delay between tries here:
+scm.import.retry_count = 50
+scm.import.retry_sleep_secs = 5
+
+; One-click merge is enabled by default, but can be turned off on for each type of repo
+scm.merge.git.disabled = false
+scm.merge.hg.disabled = false
+
+
+; bulk_export_enabled = true
+; If you keep bulk_export_enabled, you should set up your server to securely share bulk_export_path with users somehow
+bulk_export_path = /tmp/bulk_export/{nbhd}/{project}
+bulk_export_filename = {project}-backup-{date:%Y-%m-%d-%H%M%S}.zip
+; You will need to specify site-specific instructions here for accessing the exported files.
+bulk_export_download_instructions = Sample instructions for {project}
+
+importer_upload_path = /tmp/importer_upload/{nbhd}/{project}
+
+; To disable any plugin, tool, importer, etc from being available, you can use the disable_entry_points config option.
+; Specify the keys and values as they are declared in the tool's "setup.py" file.
+; Examples:
+;disable_entry_points.importers = google-code-tracker, google-code-repo
+;disable_entry_points.allura.project_importers = google-code
+
+; Importers specifically, can be left enabled but not linked to. You have to know the URL to use it. Example:
+;hidden_importers = trac-tickets
+
+; GitHub importer keys. For github ticket import, it is best to set
+; up an app at https://github.com/settings/applications Use the root URL
+; of your Allura instance for both URLs, and enter client values here:
+;github_importer.client_id =
+;github_importer.client_secret =
+
+; If your site has docs about specific importers, you can add them here and
+; they'll appear on the import forms
+;doc.url.importers.Google Code = http://...
+
+; List of oauth API keys permitted to use special forum import API
+; (should be converted to newer importer system)
+;oauth.can_import_forum = api-key-1234, fa832r0fdsafd, f23f80sdf32fd
+
+
+; space-separated list of tool names that are valid options
+; for project admins to set for their 'support_page' field
+; this field is not used by default in Allura, so this option
+; is disabled by default
+;support_tool_choices = wiki tickets discussion
+
+; Control how /categories URL can be accessed to edit trove categories (used in project categories and user skills)
+; Default: everyone
+trovecategories.enableediting = true
+; Nobody:
+;trovecategories.enableediting = false
+; Site admins only:
+;trovecategories.enableediting = admin
+
+; ActivityStream
+activitystream.master = mongodb://mongo:27017
+activitystream.database = activitystream
+activitystream.activity_collection = activities
+activitystream.node_collection = nodes
+activitystream.timeline_collection = timelines
+activitystream.enabled = true
+activitystream.recording.enabled = true
+
+; Ming setup
+; These don't necessarily have to be separate databases, they could
+; be all in the same database if desired
+ming.main.uri = mongodb://mongo:27017/allura
+ming.main.auto_ensure_indexes = False
+ming.project.uri = mongodb://mongo:27017/project-data
+ming.project.auto_ensure_indexes = False
+ming.task.uri = mongodb://mongo:27017/task
+ming.task.auto_ensure_indexes = False
+;ming.zarkov.uri = mongodb://127.0.0.1:27017/zarkov
+;ming.zarkov.auto_ensure_indexes = False
+
+; Zarkov host setting, requires the zarkov and gevent libraries.
+;zarkov.host = tcp://127.0.0.1:9000
+
+; A float from 0-1 representing a % of requests to measure timing on.
+; Sampled requests will have timing logged to stats.log (can change file in [handler_timermiddleware] logging section)
+stats.sample_rate = 1
+
+; Taskd setup
+; number of seconds to sleep between checking for new tasks
+monq.poll_interval=2
+
+; SOLR setup
+solr.server = http://localhost:8983/solr
+; Alternate server to use just for querying
+;solr.query_server =
+; Shorter timeout for search queries (longer timeout for saving to solr)
+solr.short_timeout = 10
+; commit on every add/delete?
+solr.commit = false
+; commit add operations within N ms
+solr.commitWithin = 10000
+; Use improved data types for labels and custom fields?
+; New Allura deployments should leave this set to true. Existing deployments
+; should set to false until existing data has been reindexed. Reindexing will
+; convert existing label and custom field data to more appropriate solr types.
+solr.use_new_types = true
+
+; Incoming email settings. Used when you run: paster smtp_server development.ini
+; address to listen to
+forgemail.host = 0.0.0.0
+forgemail.port = 8825
+; domain suffix for your mail, change this. You also need to route *.*.*.forgemail.domain to the above host/port via
+; your mail and DNS configuration
+forgemail.domain = .in.localhost
+
+; Specify the number of projects allowed to be created by a user
+; depending on the age of their user account.
+; Keys are number of seconds, values are max number of projects allowed
+; (including the default user-project, so you probably want to add 1)
+; This example allows for 1 project if the account is less than an hour old
+; and 5 projects if the account is less than a day old. No limits after that
+;project.rate_limits = {"3600": 2, "86400": 6}
+
+; set this to "false" if you are deploying to production and want performance improvements
+auto_reload_templates = true
+
+; How frequently users can send messages, in seconds
+user_message.time_interval = 3600
+; Max number of messages that can be sent within that time interval.
+user_message.max_messages = 20
+
+; Default number of times to show a sitewide notification
+; See https://forge-allura.apache.org/docs/getting_started/administration.html#site-notifications
+site_notification.impressions = 0
+
+; When rendering discussion post Markdown to html, if the render takes longer
+; than `markdown_cache_threshold` (in seconds), the resulting html will be
+; cached and served from cache on subsequent requests. Set to 0 to cache all
+; posts. Remove entirely to cache nothing.
+markdown_cache_threshold = .1
+; markdown text longer than max length will not be converted to html
+markdown_render_max_length = 999999999
+; Don't add rel=nofollow to these domains when generating links from Markdown content
+;nofollow_exempt_domains =
+
+; Export control choices on the project admin overview page.
+show_export_control = false
+
+; By default project admins can soft-delete their projects.
+; A soft-deleted project will still be in the database and visible to admins, but not to others.
+allow_project_delete = true
+allow_project_undelete = true
+
+; Advanced settings for controlling "Last Commit Doc" algorithm used when visiting any repo browse page
+lcd_thread_chunk_size = 10
+lcd_timeout = 60
+
+
+;
+; Settings for the Blog tool
+;
+; Enable or disable external RSS feed importing in ForgeBlog tool.
+; Default is "false". This feature requires GPL library "html2text". Install it with following command:
+; pip install -e git://github.com/brondsem/html2text.git#egg=html2text
+; You will also need to run `paster pull-rss-feeds development.ini` in a cron job to fetch them.
+forgeblog.exfeed = false
+
+;
+; Settings for the Chat tool
+;
+forgechat.host = irc.freenode.net
+forgechat.port = 6667
+ircbot.nick = allurabot
+
+;
+; Settings for ShortUrl tool
+;
+; Override this if you set up an additional shortening mechanism (e.g. custom short domain)
+short_url.url_pattern = {base_url}/{nbhd}/{project}/{mount_point}/{short_name}
+
+
+;
+; Settings for UserStats tool
+;
+userstats.count_lines_of_code = true
+
+
+;
+; Optional settings for profiling with https://pypi.python.org/pypi/keas.profile
+;
+[filter-app:profile]
+use=egg:keas.profile#profiler
+next=main
+
+
+;
+; setup for the taskd background daemon request controller
+;
+[app:task]
+use = main
+override_root = task ; TurboGears will use controllers/task.py as root controller
+
+
+
+;
+; Logging configuration
+;
+; Add additional loggers, handlers, formatters here
+; Uses python's logging config file format
+; https://docs.python.org/2/library/logging.config.html#configuration-file-format
+;
+[loggers]
+keys = root, allura, sqlalchemy, paste, pylons, taskdstatus, timermiddleware, tmw_details
+
+[handlers]
+keys = console, stats, taskdstatus, timermiddleware
+
+[formatters]
+keys = generic, stats, timermiddleware
+
+; If you create additional loggers, add them as a key to [loggers]
+[logger_root]
+level = INFO
+handlers = console, stats
+
+[logger_allura]
+level = INFO
+handlers =
+qualname = allura
+
+[logger_sqlalchemy]
+level = INFO
+handlers =
+qualname = sqlalchemy.engine
+; "level = INFO" logs SQL queries.
+; "level = DEBUG" logs SQL queries and results.
+; "level = WARN" logs neither. (Recommended for production systems.)
+
+[logger_paste]
+level = INFO
+qualname = paste
+handlers =
+
+[logger_pylons]
+level = INFO
+qualname = pylons
+handlers =
+
+[logger_tmw_details]
+; DEBUG will include every instrumented call in our logging
+level = INFO
+qualname = timermiddleware
+handlers =
+
+[logger_taskdstatus]
+level = INFO
+qualname = taskdstatus
+handlers = taskdstatus
+
+[logger_timermiddleware]
+level = INFO
+handlers = timermiddleware
+qualname = stats
+propagate = 0
+
+; If you create additional handlers, add them as a key to [handlers]
+[handler_console]
+class = StreamHandler
+args = (sys.stderr,)
+level = NOTSET
+formatter = generic
+
+[handler_stats]
+class = allura.lib.utils.StatsHandler
+args = ('rtstats.log', 'allura', 1)
+level = NOTSET
+formatter = stats
+
+[handler_taskdstatus]
+class = handlers.WatchedFileHandler
+args = ('taskd_status.log', 'a')
+level = NOTSET
+formatter = generic
+
+[handler_timermiddleware]
+class = handlers.WatchedFileHandler
+; if you run 'paster serve' in allura/Allura/ then that's where this file will be
+; you may want to hard-code a specific directory here.
+args = ('stats.log', 'a')
+level = NOTSET
+formatter = timermiddleware
+
+; If you create additional formatters, add them as a key to [formatters]
+[formatter_generic]
+format = %(asctime)s,%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
+datefmt = %H:%M:%S
+
+[formatter_stats]
+format = %(asctime)s %(created)d %(kwpairs)s
+datefmt = %d/%b/%Y:%H:%M:%S UTC
+
+[formatter_timermiddleware]
+format = {"time": "%(asctime)s,%(msecs)03d", "level": "%(levelname)-5.5s", "name": "%(name)s", "message": %(message)s}
+datefmt = %Y-%m-%d %H:%M:%S
http://git-wip-us.apache.org/repos/asf/allura/blob/6e364168/Dockerfile
----------------------------------------------------------------------
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..1c8e06f
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,18 @@
+FROM ubuntu:12.04
+
+RUN apt-get update && apt-get install -y \
+ python-dev \
+ libssl-dev \
+ libldap2-dev \
+ libsasl2-dev \
+ libjpeg8-dev \
+ zlib1g-dev \
+ python-pip
+
+ENV basedir /allura
+
+ADD . ${basedir}
+WORKDIR ${basedir}
+
+RUN pip install -r requirements.txt
+RUN ./rebuild-all.bash
http://git-wip-us.apache.org/repos/asf/allura/blob/6e364168/docker-compose.yml
----------------------------------------------------------------------
diff --git a/docker-compose.yml b/docker-compose.yml
new file mode 100644
index 0000000..8b7ac88
--- /dev/null
+++ b/docker-compose.yml
@@ -0,0 +1,16 @@
+web:
+ build: .
+ working_dir: ${basedir}
+ command: paster serve Allura/docker-dev.ini --reload
+ ports:
+ - "8080:8080"
+ volumes:
+ - .:/${basedir}
+ links:
+ - mongo
+mongo:
+ image: mongo:2.6
+ expose:
+ - "27017"
+ volumes:
+ - /allura-data/mongo:/data/db
[09/35] allura git commit: [#7806] ticket:773 Add license header to
new files
Posted by je...@apache.org.
[#7806] ticket:773 Add license header to new files
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/d2be0850
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/d2be0850
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/d2be0850
Branch: refs/heads/ib/7884
Commit: d2be0850f6f538c5f13ce43a57ff342b501e5932
Parents: 92e7184
Author: Igor Bondarenko <je...@gmail.com>
Authored: Mon May 25 15:48:33 2015 +0300
Committer: Dave Brondsema <da...@brondsema.net>
Committed: Fri Jun 12 11:43:32 2015 -0400
----------------------------------------------------------------------
Dockerfile | 17 +++++++++++++++++
docker-compose.yml | 17 +++++++++++++++++
solr_config/Dockerfile | 17 +++++++++++++++++
3 files changed, 51 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/d2be0850/Dockerfile
----------------------------------------------------------------------
diff --git a/Dockerfile b/Dockerfile
index 0be1159..26ee833 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,3 +1,20 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
FROM ubuntu:12.04
RUN apt-get update && apt-get install -y \
http://git-wip-us.apache.org/repos/asf/allura/blob/d2be0850/docker-compose.yml
----------------------------------------------------------------------
diff --git a/docker-compose.yml b/docker-compose.yml
index d0a8a3b..835f91a 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -1,3 +1,20 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
web:
build: .
working_dir: /allura
http://git-wip-us.apache.org/repos/asf/allura/blob/d2be0850/solr_config/Dockerfile
----------------------------------------------------------------------
diff --git a/solr_config/Dockerfile b/solr_config/Dockerfile
index 27876e5..107768f 100644
--- a/solr_config/Dockerfile
+++ b/solr_config/Dockerfile
@@ -1,3 +1,20 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
FROM ubuntu:12.04
RUN apt-get update && apt-get install -y \
[35/35] allura git commit: [#7884] ticket:805 Fix test
Posted by je...@apache.org.
[#7884] ticket:805 Fix test
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/ac73590b
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/ac73590b
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/ac73590b
Branch: refs/heads/ib/7884
Commit: ac73590ba4d33b6b8c75b38442daedb62243abad
Parents: 1f185c5
Author: Igor Bondarenko <je...@gmail.com>
Authored: Wed Jun 17 17:37:36 2015 +0300
Committer: Igor Bondarenko <je...@gmail.com>
Committed: Wed Jun 17 17:37:36 2015 +0300
----------------------------------------------------------------------
Allura/allura/tests/functional/test_admin.py | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/ac73590b/Allura/allura/tests/functional/test_admin.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/functional/test_admin.py b/Allura/allura/tests/functional/test_admin.py
index bd7f373..28931c0 100644
--- a/Allura/allura/tests/functional/test_admin.py
+++ b/Allura/allura/tests/functional/test_admin.py
@@ -170,8 +170,10 @@ class TestProjectAdmin(TestController):
'features-1.feature': ' ',
'features-2.feature': ' Two '})
r = self.app.get('/admin/overview')
- features = r.html.find('fieldset').findAll('input', {'type': 'text'})
- assert_equals(len(features), 2+1) # two features + extra empty input
+ features = r.html.find('div', {'id': 'features'})
+ features = features.findAll('input', {'type': 'text'})
+ # two features + extra empty input + stub hidden input for js
+ assert_equals(len(features), 2+1+1)
assert_equals(features[0]['value'], u'One')
assert_equals(features[1]['value'], u'Two')
proj = M.Project.query.get(shortname='test')
[13/35] allura git commit: [#7806] ticket:778 Add stuff for SCM
snapshots
Posted by je...@apache.org.
[#7806] ticket:778 Add stuff for SCM snapshots
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/05ca971d
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/05ca971d
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/05ca971d
Branch: refs/heads/ib/7884
Commit: 05ca971d9fb4ca337328f40b47c9c49314ae3649
Parents: 260e5f5
Author: Igor Bondarenko <je...@gmail.com>
Authored: Sat May 30 13:31:44 2015 +0300
Committer: Dave Brondsema <da...@brondsema.net>
Committed: Fri Jun 12 11:43:34 2015 -0400
----------------------------------------------------------------------
Allura/docker-dev.ini | 4 ++++
Dockerfile | 5 +++++
docker-compose.yml | 1 +
3 files changed, 10 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/05ca971d/Allura/docker-dev.ini
----------------------------------------------------------------------
diff --git a/Allura/docker-dev.ini b/Allura/docker-dev.ini
index 2e22df7..0ce00eb 100644
--- a/Allura/docker-dev.ini
+++ b/Allura/docker-dev.ini
@@ -37,6 +37,10 @@ scm.host.rw.hg = /allura-data/scm/hg$path
scm.host.ro.svn = file:///allura-data/scm/svn$path/
scm.host.rw.svn = file:///allura-data/scm/svn$path/
+scm.repos.tarball.enable = true
+scm.repos.tarball.root = /allura-data/scm/snapshots/
+scm.repos.tarball.url_prefix = http://localhost:8080/
+
solr.server = http://solr:8983/solr
;forgemail.host = smtp
http://git-wip-us.apache.org/repos/asf/allura/blob/05ca971d/Dockerfile
----------------------------------------------------------------------
diff --git a/Dockerfile b/Dockerfile
index 26ee833..e054b6f 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -27,7 +27,12 @@ RUN apt-get update && apt-get install -y \
libjpeg8-dev \
zlib1g-dev \
python-pip \
+ zip \
subversion \
python-svn
+# Snapshot generation for SVN (and maybe other SCMs) might fail without this
+RUN locale-gen en_US.UTF-8
+ENV LANG en_US.UTF-8
+
WORKDIR /allura
http://git-wip-us.apache.org/repos/asf/allura/blob/05ca971d/docker-compose.yml
----------------------------------------------------------------------
diff --git a/docker-compose.yml b/docker-compose.yml
index 835f91a..586afed 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -30,6 +30,7 @@ web:
- /allura-data/scm/git:/allura-data/scm/git
- /allura-data/scm/hg:/allura-data/scm/hg
- /allura-data/scm/svn:/allura-data/scm/svn
+ - /allura-data/scm/snapshots:/allura-data/scm/snapshots
links:
- mongo
- solr
[08/35] allura git commit: [#7806] ticket:773 Add solr container
Posted by je...@apache.org.
[#7806] ticket:773 Add solr container
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/03296bff
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/03296bff
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/03296bff
Branch: refs/heads/ib/7884
Commit: 03296bffe61737e166a9555fc7d725e50b41f076
Parents: 5e297da
Author: Igor Bondarenko <je...@gmail.com>
Authored: Thu May 21 19:18:41 2015 +0300
Committer: Dave Brondsema <da...@brondsema.net>
Committed: Fri Jun 12 11:43:31 2015 -0400
----------------------------------------------------------------------
Allura/docker-dev.ini | 2 +-
docker-compose.yml | 11 +++++++++++
solr_config/Dockerfile | 15 +++++++++++++++
3 files changed, 27 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/03296bff/Allura/docker-dev.ini
----------------------------------------------------------------------
diff --git a/Allura/docker-dev.ini b/Allura/docker-dev.ini
index f33f264..34cb040 100644
--- a/Allura/docker-dev.ini
+++ b/Allura/docker-dev.ini
@@ -37,7 +37,7 @@ scm.host.rw.hg = /allura-data/scm/srv/hg$path
scm.host.ro.svn = file:///allura-data/scm/svn$path/
scm.host.rw.svn = file:///allura-data/scm/svn$path/
-;solr.server = http://solr:8983/solr
+solr.server = http://solr:8983/solr
;forgemail.host = smtp
;forgemail.port = 8825
http://git-wip-us.apache.org/repos/asf/allura/blob/03296bff/docker-compose.yml
----------------------------------------------------------------------
diff --git a/docker-compose.yml b/docker-compose.yml
index 853c0de..38b3764 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -12,6 +12,7 @@ web:
- /allura-data/scm/svn:/allura-data/scm/svn
links:
- mongo
+ - solr
taskd:
image: allura_web
@@ -24,6 +25,16 @@ taskd:
- /allura-data/scm/svn:/allura-data/scm/svn
links:
- mongo
+ - solr
+
+solr:
+ build: solr_config
+ working_dir: /solr/solr-4.2.1/example
+ command: java -jar start.jar
+ ports:
+ - "8983:8983"
+ volumes:
+ - /allura-data/solr:/solr/solr-4.2.1/example/solr/collection1/data
mongo:
image: mongo:2.6
http://git-wip-us.apache.org/repos/asf/allura/blob/03296bff/solr_config/Dockerfile
----------------------------------------------------------------------
diff --git a/solr_config/Dockerfile b/solr_config/Dockerfile
new file mode 100644
index 0000000..27876e5
--- /dev/null
+++ b/solr_config/Dockerfile
@@ -0,0 +1,15 @@
+FROM ubuntu:12.04
+
+RUN apt-get update && apt-get install -y \
+ default-jre-headless \
+ wget \
+ tar
+
+ENV basedir /solr
+
+ADD . ${basedir}
+WORKDIR ${basedir}
+
+RUN wget -nv http://archive.apache.org/dist/lucene/solr/4.2.1/solr-4.2.1.tgz
+RUN tar xf solr-4.2.1.tgz && rm -f solr-4.2.1.tgz
+RUN cp -f schema.xml solr-4.2.1/example/solr/collection1/conf
[10/35] allura git commit: [#7806] ticket:773 Make env host-mounted
to share with taskd container and allow update
Posted by je...@apache.org.
[#7806] ticket:773 Make env host-mounted to share with taskd container and allow update
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/92e7184f
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/92e7184f
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/92e7184f
Branch: refs/heads/ib/7884
Commit: 92e7184fea115287ec33fcecc2566103cf338873
Parents: 2f4c16b
Author: Igor Bondarenko <je...@gmail.com>
Authored: Mon May 25 15:33:40 2015 +0300
Committer: Dave Brondsema <da...@brondsema.net>
Committed: Fri Jun 12 11:43:32 2015 -0400
----------------------------------------------------------------------
.gitignore | 1 +
Dockerfile | 8 +-------
docker-compose.yml | 12 ++++++------
3 files changed, 8 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/92e7184f/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
index cb2f607..44b29e3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -25,6 +25,7 @@ var/
.nose-stopwatch-times
.noseids
env
+env-docker
Allura/allura/templates/home
Allura/allura/templates/var
Allura/production.ini
http://git-wip-us.apache.org/repos/asf/allura/blob/92e7184f/Dockerfile
----------------------------------------------------------------------
diff --git a/Dockerfile b/Dockerfile
index 1fc3181..0be1159 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -13,10 +13,4 @@ RUN apt-get update && apt-get install -y \
subversion \
python-svn
-ENV basedir /allura
-
-ADD . ${basedir}
-WORKDIR ${basedir}
-
-RUN pip install -r requirements.txt
-RUN ./rebuild-all.bash
+WORKDIR /allura
http://git-wip-us.apache.org/repos/asf/allura/blob/92e7184f/docker-compose.yml
----------------------------------------------------------------------
diff --git a/docker-compose.yml b/docker-compose.yml
index 38b3764..d0a8a3b 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -1,11 +1,14 @@
web:
build: .
working_dir: /allura
- command: paster serve Allura/docker-dev.ini --reload
+ command: bash -c 'cd Allura && paster serve docker-dev.ini --reload'
ports:
- "8080:8080"
volumes:
- .:/allura
+ # mount env to allow update and sharing with taskd container
+ - env-docker/python:/usr/local/lib/python2.7
+ - env-docker/bin:/usr/local/bin
# mounting it separatelly to create git, svn, hg directories automatically
- /allura-data/scm/git:/allura-data/scm/git
- /allura-data/scm/hg:/allura-data/scm/hg
@@ -18,11 +21,8 @@ taskd:
image: allura_web
working_dir: /allura/Allura
command: paster taskd docker-dev.ini
- volumes:
- - .:/allura
- - /allura-data/scm/git:/allura-data/scm/git
- - /allura-data/scm/hg:/allura-data/scm/hg
- - /allura-data/scm/svn:/allura-data/scm/svn
+ volumes_from:
+ - web
links:
- mongo
- solr
[29/35] allura git commit: [#7884] Add "Project Features"
functionality
Posted by je...@apache.org.
[#7884] Add "Project Features" functionality
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/f09621bf
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/f09621bf
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/f09621bf
Branch: refs/heads/ib/7884
Commit: f09621bf7d07a0c75f8c2a8eebc760e4c4f4c87c
Parents: 976b98b
Author: Igor Bondarenko <je...@gmail.com>
Authored: Thu Jun 11 15:08:04 2015 +0000
Committer: Igor Bondarenko <je...@gmail.com>
Committed: Wed Jun 17 14:14:15 2015 +0300
----------------------------------------------------------------------
Allura/allura/ext/admin/admin_main.py | 13 ++++++++
.../templates/admin_widgets/features_field.html | 32 ++++++++++++++++++++
.../templates/admin_widgets/metadata_admin.html | 7 ++++-
.../ext/admin/templates/project_overview.html | 2 +-
Allura/allura/ext/admin/widgets.py | 18 +++++++++++
Allura/allura/lib/helpers.py | 12 ++++++++
Allura/allura/model/project.py | 1 +
Allura/allura/tests/functional/test_admin.py | 16 ++++++++++
8 files changed, 99 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/f09621bf/Allura/allura/ext/admin/admin_main.py
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/admin/admin_main.py b/Allura/allura/ext/admin/admin_main.py
index 46cdf9c..5bde57c 100644
--- a/Allura/allura/ext/admin/admin_main.py
+++ b/Allura/allura/ext/admin/admin_main.py
@@ -222,6 +222,10 @@ class ProjectAdminController(BaseController):
def overview(self, **kw):
c.markdown_editor = W.markdown_editor
c.metadata_admin = W.metadata_admin
+ # need this because features field expects data in specific format
+ metadata_admin_value = h.fixed_attrs_proxy(
+ c.project,
+ features=[{'feature': f} for f in c.project.features])
c.explain_export_modal = W.explain_export_modal
show_export_control = asbool(config.get('show_export_control', False))
allow_project_delete = asbool(config.get('allow_project_delete', True))
@@ -236,6 +240,7 @@ class ProjectAdminController(BaseController):
'please contact <a href="mailto:{contact}">{contact}</a>.'.format(contact=config['us_export_contact'])
return dict(show_export_control=show_export_control,
allow_project_delete=allow_project_delete,
+ metadata_admin_value=metadata_admin_value,
explain_export_text=explain_export_text)
@without_trailing_slash
@@ -354,6 +359,7 @@ class ProjectAdminController(BaseController):
@expose()
@require_post()
@validate(W.metadata_admin, error_handler=overview)
+ @h.vardec
def update(self, name=None,
short_description=None,
summary='',
@@ -370,6 +376,7 @@ class ProjectAdminController(BaseController):
export_controlled=False,
export_control_type=None,
tracking_id='',
+ features=None,
**kw):
require_access(c.project, 'update')
@@ -470,6 +477,12 @@ class ProjectAdminController(BaseController):
h.log_action(log, 'change project tracking ID').info('')
M.AuditLog.log('change project tracking ID to %s', tracking_id)
c.project.tracking_id = tracking_id
+ features = [f['feature'].strip() for f in features or []
+ if f.get('feature', '').strip()]
+ if features != c.project.features:
+ h.log_action(log, 'change project features').info('')
+ M.AuditLog.log('change project features to %s', features)
+ c.project.features = features
if icon is not None and icon != '':
if c.project.icon:
http://git-wip-us.apache.org/repos/asf/allura/blob/f09621bf/Allura/allura/ext/admin/templates/admin_widgets/features_field.html
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/admin/templates/admin_widgets/features_field.html b/Allura/allura/ext/admin/templates/admin_widgets/features_field.html
new file mode 100644
index 0000000..c5ef066
--- /dev/null
+++ b/Allura/allura/ext/admin/templates/admin_widgets/features_field.html
@@ -0,0 +1,32 @@
+{#-
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-#}
+
+<div class="{{css_class}}">
+ {% for f in widget.fields %}
+ {% set ctx=widget.context_for(f) %}
+ <div data-name="{{f.name}}">
+ {% if f.show_label %}
+ <div class="grid-4"><label>{{f.label}}:</label></div>
+ <div class="grid-14">{{f.display(**ctx)}}</div>
+ {% else %}
+ <div>{{f.display(**ctx)}}</div>
+ {% endif %}
+ </div>
+ {% endfor %}
+</div>
http://git-wip-us.apache.org/repos/asf/allura/blob/f09621bf/Allura/allura/ext/admin/templates/admin_widgets/metadata_admin.html
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/admin/templates/admin_widgets/metadata_admin.html b/Allura/allura/ext/admin/templates/admin_widgets/metadata_admin.html
index 16d1349..a9f9758 100644
--- a/Allura/allura/ext/admin/templates/admin_widgets/metadata_admin.html
+++ b/Allura/allura/ext/admin/templates/admin_widgets/metadata_admin.html
@@ -48,7 +48,12 @@
{{widget.display_field(widget.fields.short_description) }}
<div style="clear:both"> </div>
-
+
+ <fieldset class="preferences">
+ <legend>{{ widget.display_label(widget.fields.features) }}</legend>
+ {{ widget.display_field(widget.fields.features) }}
+ </fieldset>
+
{% if tg.config.get('support_tool_choices') %}
Preferred Support Page (for users of your project):<br>
{% if c.form_errors.get('support_page_url') %}
http://git-wip-us.apache.org/repos/asf/allura/blob/f09621bf/Allura/allura/ext/admin/templates/project_overview.html
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/admin/templates/project_overview.html b/Allura/allura/ext/admin/templates/project_overview.html
index 3991241..90eca92 100644
--- a/Allura/allura/ext/admin/templates/project_overview.html
+++ b/Allura/allura/ext/admin/templates/project_overview.html
@@ -26,7 +26,7 @@
{% if c.project.deleted %}
<div class="notice">This project has been deleted and is not visible to non-admin users</div>
{% endif %}
- {{c.metadata_admin.display(value=c.project,
+ {{c.metadata_admin.display(value=metadata_admin_value,
show_export_control=show_export_control,
allow_project_delete=allow_project_delete)}}
http://git-wip-us.apache.org/repos/asf/allura/blob/f09621bf/Allura/allura/ext/admin/widgets.py
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/admin/widgets.py b/Allura/allura/ext/admin/widgets.py
index 5fb5bbd..4ea1fcd 100644
--- a/Allura/allura/ext/admin/widgets.py
+++ b/Allura/allura/ext/admin/widgets.py
@@ -155,6 +155,11 @@ class ScreenshotAdmin(ff.ForgeForm):
return fields
+class FeaturesField(ew.CompoundField):
+ template = 'jinja:allura.ext.admin:templates/admin_widgets/features_field.html'
+ fields = [ew.TextField(name='feature', show_label=False)]
+
+
class MetadataAdmin(ff.AdminForm):
template = 'jinja:allura.ext.admin:templates/admin_widgets/metadata_admin.html'
defaults = dict(
@@ -180,6 +185,19 @@ class MetadataAdmin(ff.AdminForm):
fev.UnicodeString(max=1000),
V.MaxBytesValidator(max=1000)),
attrs=dict(title="Add a few paragraphs describing your project to new users."))
+ # Apparently, child field must be CompoundField with custom template
+ # for SortableRepeatedField to work properly, that's why FeaturesField
+ # is not just ew.TextField
+ features = ffw.SortableRepeatedField(
+ label='Features',
+ empty_msg='No features yet',
+ nonempty_msg='Drag and drop features to reorder. '
+ 'Leave empty to delete a feature.',
+ button=ew.InputField(
+ css_class='add',
+ field_type='button',
+ value='Add feature'),
+ field=FeaturesField())
icon = ew.FileField(label='Icon')
external_homepage = ew.InputField(field_type="text", label='Homepage',
validator=fev.URL(add_http=True))
http://git-wip-us.apache.org/repos/asf/allura/blob/f09621bf/Allura/allura/lib/helpers.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/helpers.py b/Allura/allura/lib/helpers.py
index 1c562f0..3a85c19 100644
--- a/Allura/allura/lib/helpers.py
+++ b/Allura/allura/lib/helpers.py
@@ -526,6 +526,18 @@ class proxy(object):
return self._obj(*args, **kwargs)
+class fixed_attrs_proxy(proxy):
+ """
+ On attribute lookup, if keyword parameter matching attribute name was
+ provided during object construction, returns it's value. Otherwise proxies
+ to obj.
+ """
+ def __init__(self, obj, **kw):
+ self._obj = obj
+ for k, v in kw.iteritems():
+ setattr(self, k, v)
+
+
def render_genshi_plaintext(template_name, **template_vars):
assert os.path.exists(template_name)
fd = open(template_name)
http://git-wip-us.apache.org/repos/asf/allura/blob/f09621bf/Allura/allura/model/project.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/project.py b/Allura/allura/model/project.py
index 2ad3be4..9d6cb2a 100644
--- a/Allura/allura/model/project.py
+++ b/Allura/allura/model/project.py
@@ -248,6 +248,7 @@ class Project(SearchIndexable, MappedClass, ActivityNode, ActivityObject):
trove_environment = FieldProperty([S.ObjectId])
tracking_id = FieldProperty(str, if_missing='')
is_nbhd_project = FieldProperty(bool, if_missing=False)
+ features = FieldProperty([str])
# transient properties
notifications_disabled = False
http://git-wip-us.apache.org/repos/asf/allura/blob/f09621bf/Allura/allura/tests/functional/test_admin.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/functional/test_admin.py b/Allura/allura/tests/functional/test_admin.py
index d239591..bd7f373 100644
--- a/Allura/allura/tests/functional/test_admin.py
+++ b/Allura/allura/tests/functional/test_admin.py
@@ -161,6 +161,22 @@ class TestProjectAdmin(TestController):
r = self.app.get('/admin/audit/')
assert "uninstall tool test-tool" in r.body, r.body
+ def test_features(self):
+ proj = M.Project.query.get(shortname='test')
+ assert_equals(proj.features, [])
+ with audits(u"change project features to \[u'One', u'Two'\]"):
+ self.app.post('/admin/update', params={
+ 'features-0.feature': 'One',
+ 'features-1.feature': ' ',
+ 'features-2.feature': ' Two '})
+ r = self.app.get('/admin/overview')
+ features = r.html.find('fieldset').findAll('input', {'type': 'text'})
+ assert_equals(len(features), 2+1) # two features + extra empty input
+ assert_equals(features[0]['value'], u'One')
+ assert_equals(features[1]['value'], u'Two')
+ proj = M.Project.query.get(shortname='test')
+ assert_equals(proj.features, [u'One', u'Two'])
+
def test_admin_export_control(self):
self.app.get('/admin/')
with audits('change project export controlled status to True'):
[22/35] allura git commit: [#7886] ticket:789 Rate limit wiki page
creation
Posted by je...@apache.org.
[#7886] ticket:789 Rate limit wiki page creation
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/6936ce2d
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/6936ce2d
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/6936ce2d
Branch: refs/heads/ib/7884
Commit: 6936ce2df44b2b55f3940c600a023c26c2445150
Parents: 1004b07
Author: Igor Bondarenko <je...@gmail.com>
Authored: Wed Jun 10 09:36:02 2015 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Fri Jun 12 18:44:26 2015 +0000
----------------------------------------------------------------------
.../forgewiki/tests/functional/test_rest.py | 20 +++++++-
.../forgewiki/tests/functional/test_root.py | 48 +++++++++++++++++++-
ForgeWiki/forgewiki/wiki_main.py | 13 ++++++
3 files changed, 79 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/6936ce2d/ForgeWiki/forgewiki/tests/functional/test_rest.py
----------------------------------------------------------------------
diff --git a/ForgeWiki/forgewiki/tests/functional/test_rest.py b/ForgeWiki/forgewiki/tests/functional/test_rest.py
index 23021d2..6a5de3b 100644
--- a/ForgeWiki/forgewiki/tests/functional/test_rest.py
+++ b/ForgeWiki/forgewiki/tests/functional/test_rest.py
@@ -19,7 +19,7 @@
import json
-from nose.tools import assert_equal, assert_in
+from nose.tools import assert_equal, assert_in, assert_not_equal
import simplejson
import tg
@@ -27,6 +27,8 @@ from allura.lib import helpers as h
from allura.tests import decorators as td
from alluratest.controller import TestRestApiBase
+from forgewiki.model import Page
+
class TestWikiApi(TestRestApiBase):
@@ -84,6 +86,22 @@ class TestWikiApi(TestRestApiBase):
assert_equal(r.json['text'], data['text'])
assert_equal(r.json['labels'], data['labels'].split(','))
+ def test_create_page_limit(self):
+ data = {
+ 'text': 'Embrace the Dark Side',
+ 'labels': 'head hunting,dark side'
+ }
+ # Set rate limit to unlimit
+ with h.push_config(tg.config, **{'forgewiki.rate_limits': '{}'}):
+ r = self.api_post(u'/rest/p/test/wiki/page1/', status=200, **data)
+ p = Page.query.get(title='page1')
+ assert_not_equal(p, None)
+ # Set rate limit to 1 in first hour of project
+ with h.push_config(tg.config, **{'forgewiki.rate_limits': '{"3600": 1}'}):
+ r = self.api_post(u'/rest/p/test/wiki/page2/', status=429, **data)
+ p = Page.query.get(title='page2')
+ assert_equal(p, None)
+
# http://blog.watchfire.com/wfblog/2011/10/json-based-xss-exploitation.html
def test_json_encoding_security(self):
self.api_post('/rest/p/test/wiki/foo.html',
http://git-wip-us.apache.org/repos/asf/allura/blob/6936ce2d/ForgeWiki/forgewiki/tests/functional/test_root.py
----------------------------------------------------------------------
diff --git a/ForgeWiki/forgewiki/tests/functional/test_root.py b/ForgeWiki/forgewiki/tests/functional/test_root.py
index f5f49e6..aea9028 100644
--- a/ForgeWiki/forgewiki/tests/functional/test_root.py
+++ b/ForgeWiki/forgewiki/tests/functional/test_root.py
@@ -20,11 +20,13 @@
import os
import StringIO
import allura
+import json
import PIL
-from nose.tools import assert_true, assert_equal, assert_in
+from nose.tools import assert_true, assert_equal, assert_in, assert_not_equal
from ming.orm.ormsession import ThreadLocalORMSession
from mock import patch
+from tg import config
from allura import model as M
from allura.lib import helpers as h
@@ -770,3 +772,47 @@ class TestRootController(TestController):
r = self.app.get('/p/test/wiki/Home/', extra_environ={'username': str(user.username)})
link = r.html.find('a', {'href': '/p/test/wiki/subscribe?subscribe=True'})
assert link is not None
+
+ def test_rate_limit_new_page(self):
+ # Set rate limit to unlimit
+ with h.push_config(config, **{'forgewiki.rate_limits': '{}'}):
+ r = self.app.get('/p/test/wiki/new-page-title/')
+ assert_equal(r.status_int, 302)
+ assert_equal(
+ r.location,
+ 'http://localhost/p/test/wiki/new-page-title/edit')
+ assert_equal(self.webflash(r), '')
+ # Set rate limit to 1 in first hour of project
+ with h.push_config(config, **{'forgewiki.rate_limits': '{"3600": 1}'}):
+ r = self.app.get('/p/test/wiki/new-page-title/')
+ assert_equal(r.status_int, 302)
+ assert_equal(r.location, 'http://localhost/p/test/wiki/')
+ wf = json.loads(self.webflash(r))
+ assert_equal(wf['status'], 'error')
+ assert_equal(
+ wf['message'],
+ 'Page creation rate limit exceeded. Please try again later.')
+
+ def test_rate_limit_update(self):
+ # Set rate limit to unlimit
+ with h.push_config(config, **{'forgewiki.rate_limits': '{}'}):
+ r = self.app.post(
+ '/p/test/wiki/page1/update',
+ dict(text='Some text', title='page1')).follow()
+ assert_in('Some text', r)
+ p = model.Page.query.get(title='page1')
+ assert_not_equal(p, None)
+ # Set rate limit to 1 in first hour of project
+ with h.push_config(config, **{'forgewiki.rate_limits': '{"3600": 1}'}):
+ r = self.app.post(
+ '/p/test/wiki/page2/update',
+ dict(text='Some text', title='page2'))
+ assert_equal(r.status_int, 302)
+ assert_equal(r.location, 'http://localhost/p/test/wiki/')
+ wf = json.loads(self.webflash(r))
+ assert_equal(wf['status'], 'error')
+ assert_equal(
+ wf['message'],
+ 'Page creation rate limit exceeded. Please try again later.')
+ p = model.Page.query.get(title='page2')
+ assert_equal(p, None)
http://git-wip-us.apache.org/repos/asf/allura/blob/6936ce2d/ForgeWiki/forgewiki/wiki_main.py
----------------------------------------------------------------------
diff --git a/ForgeWiki/forgewiki/wiki_main.py b/ForgeWiki/forgewiki/wiki_main.py
index 8ab3f3d..cfaec31 100644
--- a/ForgeWiki/forgewiki/wiki_main.py
+++ b/ForgeWiki/forgewiki/wiki_main.py
@@ -37,6 +37,7 @@ from allura.app import Application, SitemapEntry, DefaultAdminController, Config
from allura.lib.search import search_app
from allura.lib.decorators import require_post
from allura.lib.security import require_access, has_access
+from allura.lib import exceptions as forge_exc
from allura.controllers import AppDiscussionController, BaseController, AppDiscussionRestController
from allura.controllers import DispatchIndex
from allura.controllers import attachments as ac
@@ -489,6 +490,14 @@ class PageController(BaseController, FeedController):
require_access(self.page, 'delete')
else:
require_access(c.app, 'create')
+ self.rate_limit()
+
+ def rate_limit(self):
+ if WM.Page.is_limit_exceeded(c.app.config):
+ msg = 'Page creation rate limit exceeded. '
+ log.warn(msg + c.app.config.url())
+ flash(msg + 'Please try again later.', 'error')
+ redirect('..')
def fake_page(self):
return dict(
@@ -803,6 +812,10 @@ class PageRestController(BaseController):
with h.notifications_disabled(c.project):
if not self.page:
require_access(c.app, 'create')
+ if WM.Page.is_limit_exceeded(c.app.config):
+ log.warn('Page creation rate limit exceeded. %s',
+ c.app.config.url())
+ raise forge_exc.HTTPTooManyRequests()
self.page = WM.Page.upsert(title)
self.page.viewable_by = ['all']
else:
[17/35] allura git commit: [#7806] reference Docker instead of Vagrant
Posted by je...@apache.org.
[#7806] reference Docker instead of Vagrant
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/b2a1b10d
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/b2a1b10d
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/b2a1b10d
Branch: refs/heads/ib/7884
Commit: b2a1b10d574a1dd107fa76226f46840fbdfae08b
Parents: e7f1995
Author: Dave Brondsema <da...@brondsema.net>
Authored: Fri Jun 12 11:43:04 2015 -0400
Committer: Dave Brondsema <da...@brondsema.net>
Committed: Fri Jun 12 11:43:37 2015 -0400
----------------------------------------------------------------------
INSTALL.markdown | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/b2a1b10d/INSTALL.markdown
----------------------------------------------------------------------
diff --git a/INSTALL.markdown b/INSTALL.markdown
index 220d11f..d9a64ee 100644
--- a/INSTALL.markdown
+++ b/INSTALL.markdown
@@ -17,9 +17,9 @@
under the License.
-->
-# Sandbox Creation
+# Step-by-Step Installation
-For a faster setup with a pre-packaged machine image, see [Install and Run Allura - Vagrant](https://forge-allura.apache.org/p/allura/wiki/Install%20and%20Run%20Allura%20-%20Vagrant/) instead.
+For a simpler setup using Docker images, see INSTALL-Docker.markdown instead.
In these instructions, we'll use [VirtualBox](http://www.virtualbox.org) and [Ubuntu 12.04](http://ubuntu.com) (11.10 works too) to create a disposable sandbox for Allura development/testing. Allura should work on other Linux systems (including OSX), but setting up all the dependencies will be different.
[31/35] allura git commit: [#7884] ticket:799 Add id to features
section, so that we can refer it in url easily
Posted by je...@apache.org.
[#7884] ticket:799 Add id to features section, so that we can refer it in url easily
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/cdbde12f
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/cdbde12f
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/cdbde12f
Branch: refs/heads/ib/7884
Commit: cdbde12f0ea4107cb4b5a5954db335284cdc468a
Parents: c91cb3f
Author: Igor Bondarenko <je...@gmail.com>
Authored: Fri Jun 12 13:49:59 2015 +0000
Committer: Igor Bondarenko <je...@gmail.com>
Committed: Wed Jun 17 14:14:16 2015 +0300
----------------------------------------------------------------------
.../allura/ext/admin/templates/admin_widgets/metadata_admin.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/cdbde12f/Allura/allura/ext/admin/templates/admin_widgets/metadata_admin.html
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/admin/templates/admin_widgets/metadata_admin.html b/Allura/allura/ext/admin/templates/admin_widgets/metadata_admin.html
index a9f9758..bebef0c 100644
--- a/Allura/allura/ext/admin/templates/admin_widgets/metadata_admin.html
+++ b/Allura/allura/ext/admin/templates/admin_widgets/metadata_admin.html
@@ -49,7 +49,7 @@
<div style="clear:both"> </div>
- <fieldset class="preferences">
+ <fieldset class="preferences" id="features">
<legend>{{ widget.display_label(widget.fields.features) }}</legend>
{{ widget.display_field(widget.fields.features) }}
</fieldset>
[19/35] allura git commit: [#7886] ticket:789 Helper to check if
limit is exceeded for artifact
Posted by je...@apache.org.
[#7886] ticket:789 Helper to check if limit is exceeded for artifact
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/d22046ce
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/d22046ce
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/d22046ce
Branch: refs/heads/ib/7884
Commit: d22046ce603f7ec97a1c2ba3b38011f8c22446b7
Parents: be93d3d
Author: Igor Bondarenko <je...@gmail.com>
Authored: Wed Jun 10 07:48:45 2015 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Fri Jun 12 18:44:25 2015 +0000
----------------------------------------------------------------------
Allura/allura/model/artifact.py | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/d22046ce/Allura/allura/model/artifact.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/artifact.py b/Allura/allura/model/artifact.py
index 32ebc10..1d4e230 100644
--- a/Allura/allura/model/artifact.py
+++ b/Allura/allura/model/artifact.py
@@ -32,6 +32,8 @@ from webhelpers import feedgenerator as FG
from allura.lib import helpers as h
from allura.lib import security
from allura.lib import utils
+from allura.lib import plugin
+from allura.lib import exceptions as forge_exc
from allura.lib.search import SearchIndexable
from .session import main_orm_session
@@ -408,6 +410,26 @@ class Artifact(MappedClass, SearchIndexable):
'''Persistent, email-friendly (Message-ID header) id of this artifact'''
return h.gen_message_id(self._id)
+ @classmethod
+ def is_limit_exceeded(cls, app_config):
+ """
+ Returns True if any of artifact creation rate limits are exceeded,
+ False otherwise
+ """
+ pkg = cls.__module__.split('.', 1)[0]
+ opt = u'{}.rate_limits'.format(pkg)
+ count = cls.query.find(dict(app_config_id=app_config._id)).count()
+ provider = plugin.ProjectRegistrationProvider.get()
+ start = provider.registration_date(app_config.project)
+ # have to have the replace because, the generation_time is offset-aware
+ # UTC and h.rate_limit uses offset-naive UTC dates
+ start = start.replace(tzinfo=None)
+ try:
+ h.rate_limit(opt, count, start)
+ except forge_exc.RatelimitError:
+ return True
+ return False
+
class Snapshot(Artifact):
[03/35] allura git commit: [#7806] ticket:773 Don't use env vars (not
expanded, wrong mount path in result)
Posted by je...@apache.org.
[#7806] ticket:773 Don't use env vars (not expanded, wrong mount path in result)
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/5ceb84de
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/5ceb84de
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/5ceb84de
Branch: refs/heads/ib/7884
Commit: 5ceb84dea49c6a15cb47fa9494ccf6adb9f4b7bd
Parents: 6e36416
Author: Igor Bondarenko <je...@gmail.com>
Authored: Thu May 21 17:22:58 2015 +0300
Committer: Dave Brondsema <da...@brondsema.net>
Committed: Fri Jun 12 11:43:29 2015 -0400
----------------------------------------------------------------------
docker-compose.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/5ceb84de/docker-compose.yml
----------------------------------------------------------------------
diff --git a/docker-compose.yml b/docker-compose.yml
index 8b7ac88..b64d4d4 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -1,11 +1,11 @@
web:
build: .
- working_dir: ${basedir}
+ working_dir: /allura
command: paster serve Allura/docker-dev.ini --reload
ports:
- "8080:8080"
volumes:
- - .:/${basedir}
+ - .:/allura
links:
- mongo
mongo:
[05/35] allura git commit: [#7806] ticket:773 Mount SCM dirs to the
host and add some options for the future
Posted by je...@apache.org.
[#7806] ticket:773 Mount SCM dirs to the host and add some options for the future
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/e43ece79
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/e43ece79
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/e43ece79
Branch: refs/heads/ib/7884
Commit: e43ece79da64580e131a730968c473fb4e2210ba
Parents: 15adba6
Author: Igor Bondarenko <je...@gmail.com>
Authored: Thu May 21 17:57:03 2015 +0300
Committer: Dave Brondsema <da...@brondsema.net>
Committed: Fri Jun 12 11:43:30 2015 -0400
----------------------------------------------------------------------
Allura/docker-dev.ini | 12 ++++++++++++
Dockerfile | 1 +
docker-compose.yml | 5 +++++
3 files changed, 18 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/e43ece79/Allura/docker-dev.ini
----------------------------------------------------------------------
diff --git a/Allura/docker-dev.ini b/Allura/docker-dev.ini
index 37378a1..f33f264 100644
--- a/Allura/docker-dev.ini
+++ b/Allura/docker-dev.ini
@@ -29,6 +29,18 @@ ming.main.uri = mongodb://mongo:27017/allura
ming.project.uri = mongodb://mongo:27017/project-data
ming.task.uri = mongodb://mongo:27017/task
+scm.repos.root = /allura-data/scm
+scm.host.ro.git = /allura-data/scm/git$path
+scm.host.rw.git = /allura-data/scm/git$path
+scm.host.ro.hg = /allura-data/scm/hg$path
+scm.host.rw.hg = /allura-data/scm/srv/hg$path
+scm.host.ro.svn = file:///allura-data/scm/svn$path/
+scm.host.rw.svn = file:///allura-data/scm/svn$path/
+
+;solr.server = http://solr:8983/solr
+
+;forgemail.host = smtp
+;forgemail.port = 8825
[filter-app:profile]
use=egg:keas.profile#profiler
http://git-wip-us.apache.org/repos/asf/allura/blob/e43ece79/Dockerfile
----------------------------------------------------------------------
diff --git a/Dockerfile b/Dockerfile
index 1c8e06f..ed8efe0 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,6 +1,7 @@
FROM ubuntu:12.04
RUN apt-get update && apt-get install -y \
+ git-core \
python-dev \
libssl-dev \
libldap2-dev \
http://git-wip-us.apache.org/repos/asf/allura/blob/e43ece79/docker-compose.yml
----------------------------------------------------------------------
diff --git a/docker-compose.yml b/docker-compose.yml
index b64d4d4..0444ba8 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -6,6 +6,11 @@ web:
- "8080:8080"
volumes:
- .:/allura
+
+ # mounting it separatelly to create git, svn, hg directories automatically
+ - /allura-data/scm/git:/allura-data/scm/git
+ - /allura-data/scm/hg:/allura-data/scm/hg
+ - /allura-data/scm/svn:/allura-data/scm/svn
links:
- mongo
mongo:
[18/35] allura git commit: [#7825] Added "new commits" email template.
Posted by je...@apache.org.
[#7825] Added "new commits" email template.
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/51fc93b4
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/51fc93b4
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/51fc93b4
Branch: refs/heads/ib/7884
Commit: 51fc93b4758757eb69ec9e10be415c4c27b19701
Parents: b2a1b10
Author: Heith Seewald <hs...@slashdotmedia.com>
Authored: Tue May 26 20:36:50 2015 -0400
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Fri Jun 12 18:18:41 2015 +0000
----------------------------------------------------------------------
Allura/allura/model/repo_refresh.py | 48 ++++++++++++--------
Allura/allura/model/repository.py | 2 +-
Allura/allura/templates/mail/commits.md | 24 ++++++++++
.../tests/functional/test_controllers.py | 4 +-
.../forgegit/tests/model/test_repository.py | 10 ++--
.../forgesvn/tests/model/test_repository.py | 12 +++--
6 files changed, 68 insertions(+), 32 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/51fc93b4/Allura/allura/model/repo_refresh.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/repo_refresh.py b/Allura/allura/model/repo_refresh.py
index 1711bc3..fca220f 100644
--- a/Allura/allura/model/repo_refresh.py
+++ b/Allura/allura/model/repo_refresh.py
@@ -360,10 +360,18 @@ def unknown_commit_ids(all_commit_ids):
def send_notifications(repo, commit_ids):
- '''Create appropriate notification and feed objects for a refresh'''
+ """Create appropriate notification and feed objects for a refresh
+
+ :param repo: A repository artifact instance.
+ :type repo: Repository
+
+ :param commit_ids: A list of commit hash strings.
+ :type commit_ids: list
+ """
from allura.model import Feed, Notification
commit_msgs = []
base_url = tg.config['base_url']
+ last_branch = []
for oids in utils.chunked_iter(commit_ids, QSIZE):
chunk = list(oids)
index = dict(
@@ -382,26 +390,30 @@ def send_notifications(repo, commit_ids):
author_name=ci.authored.name,
link=href,
unique_id=href)
- branches = repo.symbolics_for_commit(ci)[0]
- commit_msgs.append('%s: %s by %s %s%s' % (
- ",".join(b for b in branches),
- summary, ci.authored.name, base_url, ci.url()))
+
+ summary = g.markdown_commit.convert(ci.message) if ci.message else ""
+
+ current_branch = repo.symbolics_for_commit(ci)[0]
+ if last_branch == current_branch:
+ branches = []
+ else:
+ branches = current_branch
+ last_branch = branches
+
+ commit_msgs.append(dict(
+ author=ci.authored.name,
+ date=ci.authored.date.strftime("%m/%d/%Y %H:%M"),
+ summary=summary,
+ branches=branches,
+ commit_url=base_url + href))
+
if commit_msgs:
if len(commit_msgs) > 1:
- subject = '%d new commits to %s %s' % (
- len(commit_msgs), repo.app.project.name, repo.app.config.options.mount_label)
- text = '\n\n'.join(commit_msgs)
+ subject = u"{} new commits to {}".format(len(commit_msgs), repo.app.config.options.mount_label)
else:
- subject = '{0} - {1}: {2}'.format(
- repo.shorthand_for_commit(ci._id),
- ci.authored.name,
- summary)
- branches = repo.symbolics_for_commit(ci)[0]
- text_branches = ('%s: ' % ",".join(b for b in branches)
- if branches else '')
- text = "%s%s %s%s" % (text_branches,
- ci.message,
- base_url, ci.url())
+ subject = u'New commit by {}'.format(commit_msgs[0]['author'])
+ template = g.jinja2_env.get_template("allura:templates/mail/commits.md")
+ text = u"\n\n-----".join([template.render(d) for d in commit_msgs])
Notification.post(
artifact=repo,
http://git-wip-us.apache.org/repos/asf/allura/blob/51fc93b4/Allura/allura/model/repository.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/repository.py b/Allura/allura/model/repository.py
index ec623a3..022343f 100644
--- a/Allura/allura/model/repository.py
+++ b/Allura/allura/model/repository.py
@@ -578,7 +578,7 @@ class Repository(Artifact, ActivityObject):
result.update(
name_s=self.name,
type_s=self.type_s,
- title='Repository %s %s' % (self.project.name, self.name))
+ title=u'{} {} repository'.format(self.project.name, self.app.tool_label))
return result
@property
http://git-wip-us.apache.org/repos/asf/allura/blob/51fc93b4/Allura/allura/templates/mail/commits.md
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/mail/commits.md b/Allura/allura/templates/mail/commits.md
new file mode 100644
index 0000000..7d4e4b1
--- /dev/null
+++ b/Allura/allura/templates/mail/commits.md
@@ -0,0 +1,24 @@
+{# <!---
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+--> #}
+{% if branches %}## Branch: {% for b in branches %} {{ b }} {% endfor%}{% endif %}
+
+{{summary}}
+
+By {{ author }} on {{ date }}
+[**View Changes**]({{ commit_url }})
http://git-wip-us.apache.org/repos/asf/allura/blob/51fc93b4/ForgeGit/forgegit/tests/functional/test_controllers.py
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/functional/test_controllers.py b/ForgeGit/forgegit/tests/functional/test_controllers.py
index 1312188..917f765 100644
--- a/ForgeGit/forgegit/tests/functional/test_controllers.py
+++ b/ForgeGit/forgegit/tests/functional/test_controllers.py
@@ -264,9 +264,7 @@ class TestRootController(_TestCase):
assert '<table class="side-by-side-diff">' in r
def test_refresh(self):
- notification = M.Notification.query.find(
- dict(subject='[test:src-git] 5 new commits to Test Project Git')
- ).first()
+ notification = M.Notification.query.find({'subject': '[test:src-git] 5 new commits to Git'}).first()
assert notification
domain = '.'.join(
reversed(c.app.url[1:-1].split('/'))).replace('_', '-')
http://git-wip-us.apache.org/repos/asf/allura/blob/51fc93b4/ForgeGit/forgegit/tests/model/test_repository.py
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/model/test_repository.py b/ForgeGit/forgegit/tests/model/test_repository.py
index 936fbee..349efe6 100644
--- a/ForgeGit/forgegit/tests/model/test_repository.py
+++ b/ForgeGit/forgegit/tests/model/test_repository.py
@@ -29,7 +29,7 @@ from pylons import tmpl_context as c, app_globals as g
import tg
from ming.base import Object
from ming.orm import ThreadLocalORMSession, session
-from nose.tools import assert_equal
+from nose.tools import assert_equal, assert_in
from testfixtures import TempDirectory
from datadiff.tools import assert_equals
@@ -376,15 +376,15 @@ class TestGitRepo(unittest.TestCase, RepoImplTestBase):
send_notifications(
self.repo, ['1e146e67985dcd71c74de79613719bef7bddca4a', ])
ThreadLocalORMSession.flush_all()
- n = M.Notification.query.find(
- dict(subject='[test:src-git] [1e146e] - Rick Copeland: Change README')).first()
+
+ n = M.Notification.query.find({'subject': u'[test:src-git] New commit by Rick Copeland'}).first()
assert n
- assert 'master: ' in n.text, n.text
+ assert_in('Change README', n.text)
send_notifications(
self.repo, ['1e146e67985dcd71c74de79613719bef7bddca4a', 'df30427c488aeab84b2352bdf88a3b19223f9d7a'])
ThreadLocalORMSession.flush_all()
assert M.Notification.query.find(
- dict(subject='[test:src-git] 2 new commits to Test Project Git')).first()
+ dict(subject=u'[test:src-git] 2 new commits to Git')).first()
def test_tarball(self):
tmpdir = tg.config['scm.repos.tarball.root']
http://git-wip-us.apache.org/repos/asf/allura/blob/51fc93b4/ForgeSVN/forgesvn/tests/model/test_repository.py
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/tests/model/test_repository.py b/ForgeSVN/forgesvn/tests/model/test_repository.py
index 744d30a..79beb52 100644
--- a/ForgeSVN/forgesvn/tests/model/test_repository.py
+++ b/ForgeSVN/forgesvn/tests/model/test_repository.py
@@ -27,7 +27,7 @@ from zipfile import ZipFile
from collections import defaultdict
from pylons import tmpl_context as c, app_globals as g
import mock
-from nose.tools import assert_equal
+from nose.tools import assert_equal, assert_in
from datadiff.tools import assert_equals
import tg
import ming
@@ -693,10 +693,10 @@ class TestSVNRev(unittest.TestCase):
ThreadLocalORMSession.flush_all()
send_notifications(self.repo, [self.repo.rev_to_commit_id(1)])
ThreadLocalORMSession.flush_all()
- n = M.Notification.query.find(
- dict(subject='[test:src] [r1] - rick446: Create readme')).first()
+ n = M.Notification.query.find({u'subject': u'[test:src] New commit by rick446'}).first()
assert n
- assert_equal(n.text, 'Create readme http://localhost:8080/p/test/src/1/')
+ assert_in(u'By rick446', n.text)
+ assert_in(u'Create readme', n.text)
class _Test(unittest.TestCase):
@@ -869,6 +869,7 @@ class TestRepo(_TestWithRepo):
M.repository.CommitDoc(dict(
authored=dict(
name=committer_name,
+ date=datetime(2010, 10, 8, 15, 32, 48, 0),
email=committer_email),
_id=oid)).m.insert()
self.repo._impl.refresh_commit_info = refresh_commit_info
@@ -880,7 +881,8 @@ class TestRepo(_TestWithRepo):
notifications = M.Notification.query.find().all()
for n in notifications:
if '100 new commits' in n.subject:
- assert "master,branch: by %s http://localhost:8080/ci/foo99" % committer_name in n.text
+ assert_in(u'By Test Committer on 10/08/2010 15:32', n.text)
+ assert_in(u'http://localhost:8080/ci/foo99/', n.text)
break
else:
assert False, 'Did not find notification'
[25/35] allura git commit: [#7898] Improve UX for Icon upload/edit
Posted by je...@apache.org.
[#7898] Improve UX for Icon upload/edit
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/069de217
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/069de217
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/069de217
Branch: refs/heads/ib/7884
Commit: 069de217ac320b56a9d9654184ef99fe440edcdf
Parents: 195c0b1
Author: Heith Seewald <hs...@slashdotmedia.com>
Authored: Mon Jun 15 16:49:06 2015 -0400
Committer: Heith Seewald <hs...@slashdotmedia.com>
Committed: Mon Jun 15 16:49:06 2015 -0400
----------------------------------------------------------------------
.../ext/admin/templates/admin_widgets/metadata_admin.html | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/069de217/Allura/allura/ext/admin/templates/admin_widgets/metadata_admin.html
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/admin/templates/admin_widgets/metadata_admin.html b/Allura/allura/ext/admin/templates/admin_widgets/metadata_admin.html
index f894be5..16d1349 100644
--- a/Allura/allura/ext/admin/templates/admin_widgets/metadata_admin.html
+++ b/Allura/allura/ext/admin/templates/admin_widgets/metadata_admin.html
@@ -99,9 +99,9 @@
</div>
{% else %}
<div class="viewer">
- No icon has been created.{% if c.project.is_user_project %} A gravatar image associated with your primary email
- address will be used instead if you have created one at <a href="http://gravatar.com/">gravatar.com</a>.{% endif %}
- <a id="edit-icon" href="#" title="Edit"><b data-icon="p" class="ico ico-pencil"></b></a>
+ No {% if c.project.is_user_project %}user{% endif %} icon. <a id="edit-icon" href="#" title="Edit">Upload one <b data-icon="p" class="ico ico-pencil"></b></a>
+ {% if c.project.is_user_project %}<br><small>
+ Or a <a href="http://gravatar.com/">gravatar.com</a> image will be used if available.</small>{% endif %}
</div>
{% endif %}
<div id="project-icon-upload" class="hidden">
[20/35] allura git commit: [#7886] ticket:789 Factor out rate_limit
into general helper
Posted by je...@apache.org.
[#7886] ticket:789 Factor out rate_limit into general helper
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/be93d3d3
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/be93d3d3
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/be93d3d3
Branch: refs/heads/ib/7884
Commit: be93d3d31a75d174e13953a7d7f620d1e53006db
Parents: 51fc93b
Author: Igor Bondarenko <je...@gmail.com>
Authored: Wed Jun 10 06:42:09 2015 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Fri Jun 12 18:44:25 2015 +0000
----------------------------------------------------------------------
Allura/allura/lib/exceptions.py | 6 +++++-
Allura/allura/lib/helpers.py | 17 +++++++++++++++++
Allura/allura/lib/plugin.py | 18 ++++++------------
3 files changed, 28 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/be93d3d3/Allura/allura/lib/exceptions.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/exceptions.py b/Allura/allura/lib/exceptions.py
index f796d99..21dd1d2 100644
--- a/Allura/allura/lib/exceptions.py
+++ b/Allura/allura/lib/exceptions.py
@@ -39,7 +39,11 @@ class ProjectOverlimitError(ForgeError):
pass
-class ProjectRatelimitError(ForgeError):
+class RatelimitError(ForgeError):
+ pass
+
+
+class ProjectRatelimitError(RatelimitError):
pass
http://git-wip-us.apache.org/repos/asf/allura/blob/be93d3d3/Allura/allura/lib/helpers.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/helpers.py b/Allura/allura/lib/helpers.py
index 396d7d6..1c562f0 100644
--- a/Allura/allura/lib/helpers.py
+++ b/Allura/allura/lib/helpers.py
@@ -1226,3 +1226,20 @@ def get_user_status(user):
return 'disabled'
elif pending:
return 'pending'
+
+
+def rate_limit(cfg_opt, artifact_count, start_date, exception=None):
+ """
+ Check the various config-defined artifact creation rate limits, and if any
+ are exceeded, raise exception.
+ """
+ if exception is None:
+ exception = exc.RatelimitError
+ rate_limits = json.loads(tg.config.get(cfg_opt, '{}'))
+ now = datetime.utcnow()
+ for rate, count in rate_limits.items():
+ age = now - start_date
+ age = (age.microseconds +
+ (age.seconds + age.days * 24 * 3600) * 10 ** 6) / 10 ** 6
+ if age < int(rate) and artifact_count >= count:
+ raise exception()
http://git-wip-us.apache.org/repos/asf/allura/blob/be93d3d3/Allura/allura/lib/plugin.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/plugin.py b/Allura/allura/lib/plugin.py
index 860292f..d66704e 100644
--- a/Allura/allura/lib/plugin.py
+++ b/Allura/allura/lib/plugin.py
@@ -44,7 +44,6 @@ import tg
from tg import config, request, redirect, response
from pylons import tmpl_context as c, app_globals as g
from webob import exc
-from bson.tz_util import FixedOffset
from paste.deploy.converters import asbool, asint
from ming.utils import LazyProperty
@@ -696,18 +695,13 @@ class ProjectRegistrationProvider(object):
"""
if security.has_access(neighborhood, 'admin', user=user)():
return
- # have to have the replace because, despite being UTC,
- # the result from utcnow() is still offset-naive :-(
- # maybe look into making the mongo connection offset-naive?
- now = datetime.utcnow().replace(tzinfo=FixedOffset(0, 'UTC'))
+ opt = 'project.rate_limits'
project_count = len(list(user.my_projects()))
- rate_limits = json.loads(config.get('project.rate_limits', '{}'))
- for rate, count in rate_limits.items():
- user_age = now - user._id.generation_time
- user_age = (user_age.microseconds +
- (user_age.seconds + user_age.days * 24 * 3600) * 10 ** 6) / 10 ** 6
- if user_age < int(rate) and project_count >= count:
- raise forge_exc.ProjectRatelimitError()
+ # have to have the replace because, the generation_time is offset-aware
+ # UTC and h.rate_limit uses offset-naive UTC dates
+ start_date = user._id.generation_time.replace(tzinfo=None)
+ e = forge_exc.ProjectRatelimitError
+ h.rate_limit(opt, project_count, start_date, exception=e)
def phone_verified(self, user, neighborhood):
"""
[12/35] allura git commit: [#7806] ticket:778 Add USER env var for
GitPython
Posted by je...@apache.org.
[#7806] ticket:778 Add USER env var for GitPython
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/a1656926
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/a1656926
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/a1656926
Branch: refs/heads/ib/7884
Commit: a165692627cfdcda264aed0dc2f1fd85214f2d43
Parents: 05ca971
Author: Igor Bondarenko <je...@gmail.com>
Authored: Sat May 30 13:45:37 2015 +0300
Committer: Dave Brondsema <da...@brondsema.net>
Committed: Fri Jun 12 11:43:34 2015 -0400
----------------------------------------------------------------------
Dockerfile | 4 ++++
1 file changed, 4 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/a1656926/Dockerfile
----------------------------------------------------------------------
diff --git a/Dockerfile b/Dockerfile
index e054b6f..916ed33 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -35,4 +35,8 @@ RUN apt-get update && apt-get install -y \
RUN locale-gen en_US.UTF-8
ENV LANG en_US.UTF-8
+# GitPython uses this to determine current user when committing (used in
+# tests). If this is not set, it uses os.getlogin, which fails inside docker.
+ENV USER root
+
WORKDIR /allura
[07/35] allura git commit: [#7806] ticket:773 Add java (jslint in
AllutaTest needs it) & svn deps to web image
Posted by je...@apache.org.
[#7806] ticket:773 Add java (jslint in AllutaTest needs it) & svn deps to web image
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/2f4c16b9
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/2f4c16b9
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/2f4c16b9
Branch: refs/heads/ib/7884
Commit: 2f4c16b91a02f3c2515a114338121255deca32a2
Parents: 03296bf
Author: Igor Bondarenko <je...@gmail.com>
Authored: Mon May 25 13:35:38 2015 +0300
Committer: Dave Brondsema <da...@brondsema.net>
Committed: Fri Jun 12 11:43:31 2015 -0400
----------------------------------------------------------------------
Dockerfile | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/2f4c16b9/Dockerfile
----------------------------------------------------------------------
diff --git a/Dockerfile b/Dockerfile
index ed8efe0..1fc3181 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -2,13 +2,16 @@ FROM ubuntu:12.04
RUN apt-get update && apt-get install -y \
git-core \
+ default-jre-headless \
python-dev \
libssl-dev \
libldap2-dev \
libsasl2-dev \
libjpeg8-dev \
zlib1g-dev \
- python-pip
+ python-pip \
+ subversion \
+ python-svn
ENV basedir /allura
[26/35] allura git commit: [#4802] UX improvments when editing wiki
pages
Posted by je...@apache.org.
[#4802] UX improvments when editing wiki pages
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/9d26281f
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/9d26281f
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/9d26281f
Branch: refs/heads/ib/7884
Commit: 9d26281ff4b37fdc718f9b40987511629851619d
Parents: 069de21
Author: Heith Seewald <hs...@slashdotmedia.com>
Authored: Mon Jun 15 14:52:16 2015 -0400
Committer: Igor Bondarenko <je...@gmail.com>
Committed: Tue Jun 16 13:19:14 2015 +0300
----------------------------------------------------------------------
ForgeWiki/forgewiki/templates/wiki/page_view.html | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/9d26281f/ForgeWiki/forgewiki/templates/wiki/page_view.html
----------------------------------------------------------------------
diff --git a/ForgeWiki/forgewiki/templates/wiki/page_view.html b/ForgeWiki/forgewiki/templates/wiki/page_view.html
index 2f4d95f..0420ecf 100644
--- a/ForgeWiki/forgewiki/templates/wiki/page_view.html
+++ b/ForgeWiki/forgewiki/templates/wiki/page_view.html
@@ -42,7 +42,7 @@
{% block actions %}
{% if not page['deleted'] %}
{% if c.user and c.user != c.user.anonymous() %}
- <a href="edit" title="Edit"><b data-icon="{{g.icons['pencil'].char}}" class="ico {{g.icons['pencil'].css}}" title="Edit"></b></a>
+ <a href="edit" title="Edit"><b data-icon="{{g.icons['pencil'].char}}" class="ico {{g.icons['pencil'].css}}" title="Edit"></b> Edit</a>
{% endif %}
<a href="history" title="History"><b data-icon="{{g.icons['history'].char}}" class="ico {{g.icons['history'].css}}" title="History"></b></a>
{% elif h.has_access(page, 'delete')() %}
@@ -108,8 +108,12 @@
<hr style="margin-top: 1em; margin-bottom: 2em; clear:both;">
{{lib.related_artifacts(page)}}
{% if page.discussion_thread and c.app.show_discussion %}
- {% set thread = page.discussion_thread %}
- <div>{{c.thread.display(value=thread,page=pagenum,limit=limit,count=count)}}</div>
+ {% if h.has_access(page, 'edit')() or page.discussion_thread.num_replies > 0 %}
+ <div id="discussion_holder"><h2>Discussion</h2>
+ {% set thread = page.discussion_thread %}
+ <div>{{ c.thread.display(value=thread,page=pagenum,limit=limit,count=count) }}</div>
+ </div>
+ {% endif %}
{% endif %}
{{c.confirmation.display(content='')}}
[16/35] allura git commit: [#7806] ticket:778 Add docker docs
Posted by je...@apache.org.
[#7806] ticket:778 Add docker docs
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/7164f508
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/7164f508
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/7164f508
Branch: refs/heads/ib/7884
Commit: 7164f5083e97ae9462a6841a9f5ce97e079ad2ea
Parents: 25a242f
Author: Igor Bondarenko <je...@gmail.com>
Authored: Sat May 30 15:37:05 2015 +0300
Committer: Dave Brondsema <da...@brondsema.net>
Committed: Fri Jun 12 11:43:36 2015 -0400
----------------------------------------------------------------------
INSTALL-docker.markdown | 112 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 112 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/7164f508/INSTALL-docker.markdown
----------------------------------------------------------------------
diff --git a/INSTALL-docker.markdown b/INSTALL-docker.markdown
new file mode 100644
index 0000000..5330084
--- /dev/null
+++ b/INSTALL-docker.markdown
@@ -0,0 +1,112 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+
+# General info
+
+## Allura runs on following docker containers:
+
+- web
+- mongo
+- taskd
+- solr
+- inmail
+- outmail
+
+## Host-mounted volumes (created on first run)
+
+Current directory mounted as `/allura` inside containers.
+
+Python environment:
+
+- `env-docker/python`
+- `env-docker/bin`
+
+Services data:
+
+- `/allura-data/mongo` - mongo data
+- `/allura-data/solr` - SOLR index
+- `/allura-data/scm/{git,hg,svn}` - code repositories
+- `/allura-data/scm/snapshots` - generated code snapshots
+
+## Ports, exposed to host system:
+
+- 8080 - webapp
+- 8983 - SOLR admin panel (http://localhost:8983/solr/)
+- 8825 - incoming mail listener
+
+
+# First run
+
+Install [Docker](http://docs.docker.com/installation/)
+and [Docker Compose](https://docs.docker.com/compose/install/).
+
+Build/fetch all required images:
+
+ ~$ docker-compose build
+
+Install requirements:
+
+ ~$ docker-compose run web pip install -r requirements.txt
+
+Install Allura packages:
+
+ ~$ docker-compose run web ./rebuild-all.bash
+
+Initialize database with test data:
+
+ ~$ docker-compose run web bash -c 'cd Allura && paster setup-app docker-dev.ini'
+
+Start containers in background:
+
+ ~$ docker-compose up -d
+
+# Useful commands
+
+Restarting all containers:
+
+ ~$ docker-compose up -d
+
+View logs from all services:
+
+ ~$ docker-compose logs
+
+You can specify one or more services to view logs only from them, e.g. to see
+outgoing mail:
+
+ ~$ docker-compose logs outmail
+
+Update requirements and reinstall apps:
+
+ ~$ docker-compose run web pip install -r requirements.txt
+ ~$ docker-compose run web ./rebuild-all.bash
+
+You may want to restart at least taskd container after that in order for it to
+pick up changes.
+
+Running all tests:
+
+ ~$ docker-compose run web ./run_tests
+
+Running subset of tests:
+
+ ~$ docker-compose run web bash -c 'cd ForgeGit && nosetests forgegit.tests.functional.test_controllers:TestFork'
+
+Connecting to mongo directly:
+
+ ~$ docker-compose run mongo mongo --host mongo
[30/35] allura git commit: [#7884] ticket:799 Add icon for drag & drop
Posted by je...@apache.org.
[#7884] ticket:799 Add icon for drag & drop
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/dcdc3afb
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/dcdc3afb
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/dcdc3afb
Branch: refs/heads/ib/7884
Commit: dcdc3afb2079af5639e8fb65d3e0ff60345b43e4
Parents: f09621b
Author: Igor Bondarenko <je...@gmail.com>
Authored: Fri Jun 12 10:12:58 2015 +0000
Committer: Igor Bondarenko <je...@gmail.com>
Committed: Wed Jun 17 14:14:15 2015 +0300
----------------------------------------------------------------------
.../templates/admin_widgets/features_field.html | 17 ++++++-----------
Allura/allura/ext/admin/widgets.py | 5 ++++-
2 files changed, 10 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/dcdc3afb/Allura/allura/ext/admin/templates/admin_widgets/features_field.html
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/admin/templates/admin_widgets/features_field.html b/Allura/allura/ext/admin/templates/admin_widgets/features_field.html
index c5ef066..5d70528 100644
--- a/Allura/allura/ext/admin/templates/admin_widgets/features_field.html
+++ b/Allura/allura/ext/admin/templates/admin_widgets/features_field.html
@@ -18,15 +18,10 @@
-#}
<div class="{{css_class}}">
- {% for f in widget.fields %}
- {% set ctx=widget.context_for(f) %}
- <div data-name="{{f.name}}">
- {% if f.show_label %}
- <div class="grid-4"><label>{{f.label}}:</label></div>
- <div class="grid-14">{{f.display(**ctx)}}</div>
- {% else %}
- <div>{{f.display(**ctx)}}</div>
- {% endif %}
- </div>
- {% endfor %}
+ {% set f = widget.fields[0] %}
+ {% set ctx = widget.context_for(f) %}
+ <div data-name="{{f.name}}">
+ <span class="ui-icon ui-icon-arrowthick-2-n-s" style="display:inline-block;"></span>
+ {{f.display(**ctx)}}
+ </div>
</div>
http://git-wip-us.apache.org/repos/asf/allura/blob/dcdc3afb/Allura/allura/ext/admin/widgets.py
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/admin/widgets.py b/Allura/allura/ext/admin/widgets.py
index 4ea1fcd..572db5d 100644
--- a/Allura/allura/ext/admin/widgets.py
+++ b/Allura/allura/ext/admin/widgets.py
@@ -157,7 +157,10 @@ class ScreenshotAdmin(ff.ForgeForm):
class FeaturesField(ew.CompoundField):
template = 'jinja:allura.ext.admin:templates/admin_widgets/features_field.html'
- fields = [ew.TextField(name='feature', show_label=False)]
+ fields = [ew.TextField(name='feature', attrs={'style': 'width:89%'})]
+
+ def resources(self):
+ yield ew.CSSLink('allura/css/smoothness/jquery-ui-1.8.4.custom.css')
class MetadataAdmin(ff.AdminForm):
[23/35] allura git commit: [#7886] ticket:789 Add options and help
text to development.ini
Posted by je...@apache.org.
[#7886] ticket:789 Add options and help text to development.ini
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/be5c8111
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/be5c8111
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/be5c8111
Branch: refs/heads/ib/7884
Commit: be5c8111fa8a2c581c305045e26ee363a25aa44b
Parents: 6936ce2
Author: Igor Bondarenko <je...@gmail.com>
Authored: Wed Jun 10 09:40:36 2015 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Fri Jun 12 18:44:26 2015 +0000
----------------------------------------------------------------------
Allura/development.ini | 7 +++++++
1 file changed, 7 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/be5c8111/Allura/development.ini
----------------------------------------------------------------------
diff --git a/Allura/development.ini b/Allura/development.ini
index d5a12f4..20ef1ca 100644
--- a/Allura/development.ini
+++ b/Allura/development.ini
@@ -417,6 +417,13 @@ forgemail.domain = .in.localhost
; and 5 projects if the account is less than a day old. No limits after that
;project.rate_limits = {"3600": 2, "86400": 6}
+; Specify the number of artifacts allowed to be created by a user
+; depending on the age of the project.
+; Currently supports only tickets and wiki page creation rate limiting.
+; See project.rate_limits help text above for keys & values meaning.
+;forgewiki.rate_limits = {"3600": 100, "172800": 10000}
+;forgetracker.rate_limits = {"3600": 100, "172800": 10000}
+
; set this to "false" if you are deploying to production and want performance improvements
auto_reload_templates = true
[06/35] allura git commit: [#7806] ticket:773 taskd container
Posted by je...@apache.org.
[#7806] ticket:773 taskd container
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/5e297da5
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/5e297da5
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/5e297da5
Branch: refs/heads/ib/7884
Commit: 5e297da5d92f3e912a099686944ae07d15ee2569
Parents: e43ece7
Author: Igor Bondarenko <je...@gmail.com>
Authored: Thu May 21 18:38:48 2015 +0300
Committer: Dave Brondsema <da...@brondsema.net>
Committed: Fri Jun 12 11:43:30 2015 -0400
----------------------------------------------------------------------
docker-compose.yml | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/5e297da5/docker-compose.yml
----------------------------------------------------------------------
diff --git a/docker-compose.yml b/docker-compose.yml
index 0444ba8..853c0de 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -6,13 +6,25 @@ web:
- "8080:8080"
volumes:
- .:/allura
-
# mounting it separatelly to create git, svn, hg directories automatically
- /allura-data/scm/git:/allura-data/scm/git
- /allura-data/scm/hg:/allura-data/scm/hg
- /allura-data/scm/svn:/allura-data/scm/svn
links:
- mongo
+
+taskd:
+ image: allura_web
+ working_dir: /allura/Allura
+ command: paster taskd docker-dev.ini
+ volumes:
+ - .:/allura
+ - /allura-data/scm/git:/allura-data/scm/git
+ - /allura-data/scm/hg:/allura-data/scm/hg
+ - /allura-data/scm/svn:/allura-data/scm/svn
+ links:
+ - mongo
+
mongo:
image: mongo:2.6
expose:
[33/35] allura git commit: [#7884] ticket:805 Improve
SortableRepeatedField widget and features UI
Posted by je...@apache.org.
[#7884] ticket:805 Improve SortableRepeatedField widget and features UI
- change styles to fit with the rest of the page
- cursor: move for the "move" icon
- hide "add" button and help messages
- add new field, when user focuses last one
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/10f0a0c3
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/10f0a0c3
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/10f0a0c3
Branch: refs/heads/ib/7884
Commit: 10f0a0c342d21be60d6f1488bbfa023e9b5ab719
Parents: cdbde12
Author: Igor Bondarenko <je...@gmail.com>
Authored: Wed Jun 17 15:40:48 2015 +0300
Committer: Igor Bondarenko <je...@gmail.com>
Committed: Wed Jun 17 16:27:16 2015 +0300
----------------------------------------------------------------------
.../ext/admin/templates/admin_widgets/features_field.html | 2 +-
.../ext/admin/templates/admin_widgets/metadata_admin.html | 7 ++++---
Allura/allura/ext/admin/widgets.py | 10 +++-------
Allura/allura/lib/widgets/form_fields.py | 5 +++++
.../lib/widgets/resources/js/sortable_repeated_field.js | 10 ++++++++++
.../allura/templates/widgets/sortable_repeated_field.html | 10 +++++++---
6 files changed, 30 insertions(+), 14 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/10f0a0c3/Allura/allura/ext/admin/templates/admin_widgets/features_field.html
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/admin/templates/admin_widgets/features_field.html b/Allura/allura/ext/admin/templates/admin_widgets/features_field.html
index 5d70528..413158a 100644
--- a/Allura/allura/ext/admin/templates/admin_widgets/features_field.html
+++ b/Allura/allura/ext/admin/templates/admin_widgets/features_field.html
@@ -21,7 +21,7 @@
{% set f = widget.fields[0] %}
{% set ctx = widget.context_for(f) %}
<div data-name="{{f.name}}">
- <span class="ui-icon ui-icon-arrowthick-2-n-s" style="display:inline-block;"></span>
+ <span class="ui-icon ui-icon-arrowthick-2-n-s" style="display:inline-block;cursor:move;"></span>
{{f.display(**ctx)}}
</div>
</div>
http://git-wip-us.apache.org/repos/asf/allura/blob/10f0a0c3/Allura/allura/ext/admin/templates/admin_widgets/metadata_admin.html
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/admin/templates/admin_widgets/metadata_admin.html b/Allura/allura/ext/admin/templates/admin_widgets/metadata_admin.html
index bebef0c..b313dfc 100644
--- a/Allura/allura/ext/admin/templates/admin_widgets/metadata_admin.html
+++ b/Allura/allura/ext/admin/templates/admin_widgets/metadata_admin.html
@@ -49,10 +49,11 @@
<div style="clear:both"> </div>
- <fieldset class="preferences" id="features">
- <legend>{{ widget.display_label(widget.fields.features) }}</legend>
+ <div id="features">
+ {{ widget.display_label(widget.fields.features) }}
{{ widget.display_field(widget.fields.features) }}
- </fieldset>
+ </div>
+ <br>
{% if tg.config.get('support_tool_choices') %}
Preferred Support Page (for users of your project):<br>
http://git-wip-us.apache.org/repos/asf/allura/blob/10f0a0c3/Allura/allura/ext/admin/widgets.py
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/admin/widgets.py b/Allura/allura/ext/admin/widgets.py
index 9e6e39d..0d5cae9 100644
--- a/Allura/allura/ext/admin/widgets.py
+++ b/Allura/allura/ext/admin/widgets.py
@@ -193,14 +193,10 @@ class MetadataAdmin(ff.AdminForm):
# is not just ew.TextField
features = ffw.SortableRepeatedField(
label='Features',
- empty_msg='No features yet',
- nonempty_msg='Drag and drop features to reorder. '
- 'Leave empty to delete a feature.',
+ show_msg=False,
+ show_button=False,
append_to='bottom',
- button=ew.InputField(
- css_class='add',
- field_type='button',
- value='Add feature'),
+ extra_field_on_focus_name='feature',
field=FeaturesField())
icon = ew.FileField(label='Icon')
external_homepage = ew.InputField(field_type="text", label='Homepage',
http://git-wip-us.apache.org/repos/asf/allura/blob/10f0a0c3/Allura/allura/lib/widgets/form_fields.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/widgets/form_fields.py b/Allura/allura/lib/widgets/form_fields.py
index be3fd1a..77665f9 100644
--- a/Allura/allura/lib/widgets/form_fields.py
+++ b/Allura/allura/lib/widgets/form_fields.py
@@ -413,6 +413,7 @@ class SortableRepeatedMixin(JQueryMixin):
'stub_cls',
'msg_cls',
'append_to',
+ 'extra_field_on_focus_name',
]
defaults = dict(
container_cls='sortable-repeated-field',
@@ -423,7 +424,11 @@ class SortableRepeatedMixin(JQueryMixin):
append_to='top',
empty_msg='No fields have been defined',
nonempty_msg='Drag and drop the fields to reorder',
+ show_msg=True,
+ show_button=True,
+ extra_field_on_focus_name=None,
repetitions=0)
+
button = ew.InputField(
css_class='add', field_type='button', value='New Field')
http://git-wip-us.apache.org/repos/asf/allura/blob/10f0a0c3/Allura/allura/lib/widgets/resources/js/sortable_repeated_field.js
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/widgets/resources/js/sortable_repeated_field.js b/Allura/allura/lib/widgets/resources/js/sortable_repeated_field.js
index ca78493..5371299 100644
--- a/Allura/allura/lib/widgets/resources/js/sortable_repeated_field.js
+++ b/Allura/allura/lib/widgets/resources/js/sortable_repeated_field.js
@@ -26,6 +26,7 @@
stub_cls:'sortable-field-stub',
msg_cls:'sortable-field-message',
append_to:'top', // append new field to top by default. Also supports 'bottom'
+ extra_field_on_focus_name:null,
};
$.fn.SortableRepeatedField = function(options) {
@@ -85,6 +86,11 @@
self.data.$delete_buttons.one('click', _deleteField);
self.data.$flist.sortable({stop:_renumberFields});
self.data.$stub.hide();
+ if (self.opts.extra_field_on_focus_name) {
+ self.data.$flist.find('.' + self.opts.field_cls)
+ .find('input[name$=' + self.opts.extra_field_on_focus_name + ']')
+ .off('focus').last().on('focus', _addExtraField);
+ }
_manageMessages();
},
fld_name: function() {
@@ -159,5 +165,9 @@
});
});
}
+ function _addExtraField() {
+ $(this).off('focus');
+ _addField();
+ }
};
}(jQuery));
http://git-wip-us.apache.org/repos/asf/allura/blob/10f0a0c3/Allura/allura/templates/widgets/sortable_repeated_field.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/widgets/sortable_repeated_field.html b/Allura/allura/templates/widgets/sortable_repeated_field.html
index dc41694..538d14f 100644
--- a/Allura/allura/templates/widgets/sortable_repeated_field.html
+++ b/Allura/allura/templates/widgets/sortable_repeated_field.html
@@ -20,18 +20,22 @@
xmlns:py="http://genshi.edgewall.org/"
class="$container_cls"
py:attrs="{'data-name':name}">
- <div><p
+ <div><py:if test="show_msg"><p
class="$msg_cls"
data-empty-message="$empty_msg"
data-nonempty-message="$nonempty_msg"
- /></div>
- ${widget.button.display()}
+ /></py:if></div>
+ <py:if test="show_button">${widget.button.display()}</py:if>
<br style="clear:both"/>
<div class="$flist_cls">
<py:for each="i in xrange(repetitions)"
py:with="ctx=widget.context_for(i)">
${widget.field.display(css_class=field_cls, **ctx)}
</py:for>
+ <py:if test="extra_field_on_focus_name"
+ py:with="ctx=widget.context_for(repetitions)">
+ ${widget.field.display(css_class=field_cls, **ctx)}
+ </py:if>
${widget.field.display(name=name+'#', css_class=stub_cls)}
</div>
</div>
[11/35] allura git commit: [#7806] ticket:778 Fix hg repo path in
docker-dev.ini
Posted by je...@apache.org.
[#7806] ticket:778 Fix hg repo path in docker-dev.ini
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/260e5f53
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/260e5f53
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/260e5f53
Branch: refs/heads/ib/7884
Commit: 260e5f53c8955f3ec6de79dbba675f362e374ea2
Parents: d2be085
Author: Igor Bondarenko <je...@gmail.com>
Authored: Sat May 30 11:16:18 2015 +0300
Committer: Dave Brondsema <da...@brondsema.net>
Committed: Fri Jun 12 11:43:33 2015 -0400
----------------------------------------------------------------------
Allura/docker-dev.ini | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/260e5f53/Allura/docker-dev.ini
----------------------------------------------------------------------
diff --git a/Allura/docker-dev.ini b/Allura/docker-dev.ini
index 34cb040..2e22df7 100644
--- a/Allura/docker-dev.ini
+++ b/Allura/docker-dev.ini
@@ -33,7 +33,7 @@ scm.repos.root = /allura-data/scm
scm.host.ro.git = /allura-data/scm/git$path
scm.host.rw.git = /allura-data/scm/git$path
scm.host.ro.hg = /allura-data/scm/hg$path
-scm.host.rw.hg = /allura-data/scm/srv/hg$path
+scm.host.rw.hg = /allura-data/scm/hg$path
scm.host.ro.svn = file:///allura-data/scm/svn$path/
scm.host.rw.svn = file:///allura-data/scm/svn$path/
[34/35] allura git commit: [#7884] ticket:805 Fix sortable fields in
Firefox
Posted by je...@apache.org.
[#7884] ticket:805 Fix sortable fields in Firefox
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/1f185c54
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/1f185c54
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/1f185c54
Branch: refs/heads/ib/7884
Commit: 1f185c544be6b9809ae74914b4b440799b194be6
Parents: 10f0a0c
Author: Igor Bondarenko <je...@gmail.com>
Authored: Wed Jun 17 16:37:13 2015 +0300
Committer: Igor Bondarenko <je...@gmail.com>
Committed: Wed Jun 17 16:37:13 2015 +0300
----------------------------------------------------------------------
Allura/allura/templates/widgets/sortable_repeated_field.html | 2 ++
1 file changed, 2 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/1f185c54/Allura/allura/templates/widgets/sortable_repeated_field.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/widgets/sortable_repeated_field.html b/Allura/allura/templates/widgets/sortable_repeated_field.html
index 538d14f..7f28091 100644
--- a/Allura/allura/templates/widgets/sortable_repeated_field.html
+++ b/Allura/allura/templates/widgets/sortable_repeated_field.html
@@ -19,7 +19,9 @@
<div xmlns="http://www.w3.org/1999/xhtml"
xmlns:py="http://genshi.edgewall.org/"
class="$container_cls"
+ style="overflow:auto;"
py:attrs="{'data-name':name}">
+ <!-- We need "overflow:auto" for sortable.js to properly work in Firefox http://stackoverflow.com/a/3393282/4640690 -->
<div><py:if test="show_msg"><p
class="$msg_cls"
data-empty-message="$empty_msg"
[15/35] allura git commit: [#7806] use mongod --smallfiles to avoid
mongo startup errors if disk space is limited (e.g. boot2docker defaults)
Posted by je...@apache.org.
[#7806] use mongod --smallfiles to avoid mongo startup errors if disk space is limited (e.g. boot2docker defaults)
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/e7f1995b
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/e7f1995b
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/e7f1995b
Branch: refs/heads/ib/7884
Commit: e7f1995b509c3fe412f110a0caab70194827ad91
Parents: 7164f50
Author: Dave Brondsema <da...@brondsema.net>
Authored: Fri Jun 12 11:37:51 2015 -0400
Committer: Dave Brondsema <da...@brondsema.net>
Committed: Fri Jun 12 11:43:36 2015 -0400
----------------------------------------------------------------------
docker-compose.yml | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/e7f1995b/docker-compose.yml
----------------------------------------------------------------------
diff --git a/docker-compose.yml b/docker-compose.yml
index 230b3d5..8c75cb4 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -62,6 +62,7 @@ mongo:
- "27017"
volumes:
- /allura-data/mongo:/data/db
+ command: mongod --smallfiles
outmail:
image: allura_web
[28/35] allura git commit: [#7890] ticket:801 Ensure Ming's session
contains neighborhood, before changing it
Posted by je...@apache.org.
[#7890] ticket:801 Ensure Ming's session contains neighborhood, before changing it
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/976b98b8
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/976b98b8
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/976b98b8
Branch: refs/heads/ib/7884
Commit: 976b98b867de6e964cba414d7fa5c4550b7cf038
Parents: a52e33f
Author: Igor Bondarenko <je...@gmail.com>
Authored: Mon Jun 15 17:27:23 2015 +0300
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Tue Jun 16 18:23:47 2015 +0000
----------------------------------------------------------------------
Allura/allura/controllers/project.py | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/976b98b8/Allura/allura/controllers/project.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/project.py b/Allura/allura/controllers/project.py
index 2f6d9be..195115f 100644
--- a/Allura/allura/controllers/project.py
+++ b/Allura/allura/controllers/project.py
@@ -642,7 +642,12 @@ class NeighborhoodAdminController(object):
@require_post()
@validate(W.neighborhood_overview_form, error_handler=overview)
def update(self, name=None, css=None, homepage=None, project_template=None, icon=None, **kw):
- nbhd = self.neighborhood
+ # We need to get neighborhood from Mongo to populate Ming's session. If
+ # neighborhood object is coming from cache (i.e.
+ # neighborhood.cache.duration is set), then it will be absent in Ming's
+ # session for current thread, thus all changes will not be flushed to
+ # disk. See #7890 for details.
+ nbhd = M.Neighborhood.query.get(_id=self.neighborhood._id)
c.project = nbhd.neighborhood_project
h.log_if_changed(nbhd, 'name', name,
'change neighborhood name to %s' % name)