You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by he...@apache.org on 2015/06/15 16:22:50 UTC
[01/26] allura git commit: Add SMS charges disclaimer to phone help
text
Repository: allura
Updated Branches:
refs/heads/hs/7885 344ce7f22 -> b0743a497 (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/hs/7885
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>
[17/26] allura git commit: [#7806] reference Docker instead of Vagrant
Posted by he...@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/hs/7885
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.
[11/26] allura git commit: [#7806] ticket:778 Fix hg repo path in
docker-dev.ini
Posted by he...@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/hs/7885
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/
[23/26] allura git commit: [#7886] ticket:789 Rate limit wiki page
creation
Posted by he...@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/hs/7885
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:
[15/26] allura git commit: [#7806] use mongod --smallfiles to avoid
mongo startup errors if disk space is limited (e.g. boot2docker defaults)
Posted by he...@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/hs/7885
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
[19/26] allura git commit: [#7886] ticket:789 Helper to check if
limit is exceeded for artifact
Posted by he...@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/hs/7885
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):
[05/26] allura git commit: [#7806] ticket:773 taskd container
Posted by he...@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/hs/7885
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:
[03/26] allura git commit: [#7806] ticket:773 Don't use env vars (not
expanded, wrong mount path in result)
Posted by he...@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/hs/7885
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:
[20/26] allura git commit: [#7886] ticket:789 Rate limit ticket
creation
Posted by he...@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/hs/7885
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()
[10/26] allura git commit: [#7806] ticket:773 Make env host-mounted
to share with taskd container and allow update
Posted by he...@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/hs/7885
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
[26/26] allura git commit: [#7885] Added tooltip config to master
jinja template
Posted by he...@apache.org.
[#7885] Added tooltip config to master jinja template
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/b0743a49
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/b0743a49
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/b0743a49
Branch: refs/heads/hs/7885
Commit: b0743a49749193b868a5c0f4dfb2142aa5b6a225
Parents: 034134b
Author: Heith Seewald <hs...@slashdotmedia.com>
Authored: Mon Jun 8 15:43:53 2015 -0400
Committer: Heith Seewald <hs...@slashdotmedia.com>
Committed: Mon Jun 15 14:21:49 2015 +0000
----------------------------------------------------------------------
Allura/allura/ext/admin/widgets.py | 25 ++-
Allura/allura/lib/widgets/forms.py | 4 +
Allura/allura/nf/allura/css/allura.css | 2 +-
.../allura/public/nf/css/forge/tooltipster.css | 29 ++-
.../allura/templates/jinja_master/master.html | 223 ++++++++++---------
5 files changed, 164 insertions(+), 119 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/b0743a49/Allura/allura/ext/admin/widgets.py
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/admin/widgets.py b/Allura/allura/ext/admin/widgets.py
index 5fb5bbd..3f342fd 100644
--- a/Allura/allura/ext/admin/widgets.py
+++ b/Allura/allura/ext/admin/widgets.py
@@ -150,7 +150,14 @@ class ScreenshotAdmin(ff.ForgeForm):
fields = [
ew.InputField(name='screenshot', field_type='file',
label='New Screenshot'),
- ew.InputField(name='caption', field_type="text", label='Caption')
+ ew.InputField(name='caption',
+ field_type="text",
+ label='Caption',
+ attrs={
+ 'title': "Reuse your project name in screenshot file names and create a caption to briefly describe each screenshot.",
+ 'class': 'tooltip',
+ }
+ )
]
return fields
@@ -168,18 +175,26 @@ class MetadataAdmin(ff.AdminForm):
validator=formencode.All(
fev.UnicodeString(not_empty=True, max=40),
V.MaxBytesValidator(max=40)),
- attrs=dict(maxlength=40,
- title="This is the publicly viewable name of the project, and will appear on project listings. It should be what you want to see as the project title in search listing."))
+ attrs={'maxlength': 40,
+ 'title': "This is the publicly viewable name of the project, and will appear on project listings. It should be what you want to see as the project title in search listing.",
+ 'class': 'tooltip',
+ })
summary = ew.InputField(field_type="text", label='Short Summary',
validator=formencode.All(
fev.UnicodeString(max=70),
V.MaxBytesValidator(max=70)),
- attrs=dict(maxlength=70))
+ attrs={'maxlength': 70,
+ 'title': 'Briefly state what your project is and what it does without repeating the project name. This summary appears in Google search results beneath the project name.',
+ 'class': 'tooltip',
+ })
short_description = ew.TextArea(label='Full Description',
validator=formencode.All(
fev.UnicodeString(max=1000),
V.MaxBytesValidator(max=1000)),
- attrs=dict(title="Add a few paragraphs describing your project to new users."))
+ attrs={
+ 'title': 'Describe the full functionality of your project using related keywords. The first sentence has the most impact on search. Provide unique content that calls out keywords and describes the merits of your project.',
+ 'class': 'tooltip'
+ })
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/b0743a49/Allura/allura/lib/widgets/forms.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/widgets/forms.py b/Allura/allura/lib/widgets/forms.py
index 714a32b..f523208 100644
--- a/Allura/allura/lib/widgets/forms.py
+++ b/Allura/allura/lib/widgets/forms.py
@@ -947,6 +947,10 @@ class NeighborhoodAddProjectForm(ForgeForm):
),
ew.InputField(name='project_unixname',
label='Short Name', field_type='text',
+ attrs={
+ 'title': 'Create a URL name that matches your project name as closely as possible to improve search indexing and maximize visibility.',
+ 'class': 'tooltip'
+ },
validator=provider.shortname_validator),
ew.CheckboxSet(name='tools', options=tools_options),
])
http://git-wip-us.apache.org/repos/asf/allura/blob/b0743a49/Allura/allura/nf/allura/css/allura.css
----------------------------------------------------------------------
diff --git a/Allura/allura/nf/allura/css/allura.css b/Allura/allura/nf/allura/css/allura.css
index 18dbd62..17ee342 100644
--- a/Allura/allura/nf/allura/css/allura.css
+++ b/Allura/allura/nf/allura/css/allura.css
@@ -86,4 +86,4 @@ tr.rev div.markdown_content p {
#phone_verification_overlay iframe {
height: 320px;
-}
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/allura/blob/b0743a49/Allura/allura/public/nf/css/forge/tooltipster.css
----------------------------------------------------------------------
diff --git a/Allura/allura/public/nf/css/forge/tooltipster.css b/Allura/allura/public/nf/css/forge/tooltipster.css
index db56bc3..0c9dd4a 100755
--- a/Allura/allura/public/nf/css/forge/tooltipster.css
+++ b/Allura/allura/public/nf/css/forge/tooltipster.css
@@ -21,25 +21,32 @@
}
/* If you're using the icon option, use this next selector to style them */
+
+.tooltipster-div {
+ position: relative;
+ height: 100%;
+}
+
.tooltipster-icon {
cursor: help;
background: #00AFFE;
- font-size: medium;
- font-weight: 600;
+ font-size: small;
+ font-weight: bold;
+ height: 1.3em;
color: white;
- border: 1px solid #067DB8;
- border-radius: 15%;
+ border: 0.1em solid #067DB8;
+ border-radius: 18.5%;
position: absolute;
- padding: 0 4px;
- left: 41.3%;
- margin-top: -27.5px;
- margin-bottom: 141px;
+ display: inline-block;
+ margin-top: 0.3em;
+ top: 2.7%;
+ right: 2%;
+ z-index: 9999999;
+ padding: 0 0.3em;
}
-/* If you're using the icon option, use this next selector to style them */
.tooltipster-icon:hover {
background: #067DB8;
- border: 1px solid #00AFFE;
}
/* This is the base styling required to make all Tooltipsters work */
@@ -313,4 +320,4 @@
font-style: italic;
line-height: 16px;
padding: 8px 10px;
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/allura/blob/b0743a49/Allura/allura/templates/jinja_master/master.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/jinja_master/master.html b/Allura/allura/templates/jinja_master/master.html
index cc6b548..74b09bc 100644
--- a/Allura/allura/templates/jinja_master/master.html
+++ b/Allura/allura/templates/jinja_master/master.html
@@ -20,15 +20,17 @@
<!-- Server: {{g.server_name}} -->
{% import 'allura:templates/jinja_master/lib.html' as lib with context %}
{% if g.theme.jinja_macros %}
- {% import g.theme.jinja_macros as theme_macros with context %}
+ {% import g.theme.jinja_macros as theme_macros with context %}
{% endif %}
{% do g.register_forge_js('js/jquery-base.js', location='head_js') %}
{% do g.register_forge_js('js/jquery.notify.js') %}
+{% do g.register_forge_js('js/jquery.tooltipster.js') %}
{% do g.register_forge_js('js/modernizr.js') %}
{% do g.register_forge_js('js/sylvester.js') %}
{% do g.register_forge_js('js/pb.transformie.min.js') %}
{% do g.register_forge_js('js/allura-base.js') %}
{% do g.register_forge_css('css/forge/hilite.css') %}
+{% do g.register_forge_css('css/forge/tooltipster.css') %}
{% do g.register_css('/nf/tool_icon_css?' + g.build_key, compress=False) %}
{% do g.theme.require() %}
{% do g.resource_manager.register_widgets(c) %}
@@ -37,130 +39,147 @@
<!--[if IE 7 ]> <html lang="en" class="no-js ie7"> <![endif]-->
<!--[if IE 8 ]> <html lang="en" class="no-js ie8"> <![endif]-->
<!--[if IE 9 ]> <html lang="en" class="no-js ie9"> <![endif]-->
-<!--[if (gt IE 9)|!(IE)]>--> <html lang="en" class="no-js"> <!--<![endif]-->
- <head>
+<!--[if (gt IE 9)|!(IE)]>-->
+<html lang="en" class="no-js"> <!--<![endif]-->
+<head>
<meta content="text/html; charset=UTF-8" http-equiv="content-type"/>
<title>{% block title %}Your title goes here{% endblock %}</title>
- {{theme_macros.extra_header(g.theme_href(''))}}
+ {{ theme_macros.extra_header(g.theme_href('')) }}
<script type="text/javascript">
- /*jslint onevar: false, nomen: false, evil: true, css: true, plusplus: false, white: false, forin: true, on: true, immed: false */
- /*global confirm, alert, unescape, window, jQuery, $, net, COMSCORE */
+ /*jslint onevar: false, nomen: false, evil: true, css: true, plusplus: false, white: false, forin: true, on: true, immed: false */
+ /*global confirm, alert, unescape, window, jQuery, $, net, COMSCORE */
</script>
{% for blob in g.resource_manager.emit('head_css') %}
- {{ blob }}
+ {{ blob }}
{% endfor %}
{% for blob in g.resource_manager.emit('head_js') %}
- {{ blob }}
+ {{ blob }}
{% endfor %}
{% if c.project and c.project.neighborhood.css %}
- <style type="text/css">
- {{c.project.neighborhood.get_custom_css()|safe}}
- </style>
+ <style type="text/css">
+ {{c.project.neighborhood.get_custom_css()|safe}}
+ </style>
{% elif neighborhood and neighborhood.css %}
- <style type="text/css">
- {{neighborhood.get_custom_css()}}
- </style>
+ <style type="text/css">
+ {{neighborhood.get_custom_css()}}
+ </style>
{% endif %}
{% block extra_css %}{% endblock %}
- <style>.{{ g.antispam.honey_class }} { display:none }</style>
+ <style>.{{ g.antispam.honey_class }} {
+ display: none
+ }</style>
{% block head %}
{% endblock %}
- {% if g.production_mode %}{{g.analytics.display()}}{% endif %}
- </head>
+ {% if g.production_mode %}{{ g.analytics.display() }}{% endif %}
+</head>
- <body{% block body_attrs %}{% endblock %} id="forge">
- <h2 class="hidden">
- <span style="color:red">Error:</span> CSS did not load.<br>
- This may happen on the first request due to CSS mimetype issues.
- Try clearing your browser cache and refreshing.
- <hr>
- </h2>
- {% block body_top_js %}
+<body{% block body_attrs %}{% endblock %} id="forge">
+<h2 class="hidden">
+ <span style="color:red">Error:</span> CSS did not load.<br>
+ This may happen on the first request due to CSS mimetype issues.
+ Try clearing your browser cache and refreshing.
+ <hr>
+</h2>
+{% block body_top_js %}
{% for blob in g.resource_manager.emit('body_top_js') %}
- {{ blob }}
+ {{ blob }}
{% endfor %}
- {% endblock %}
- {{theme_macros.header(g.login_url, '/auth/logout')}}
- {{theme_macros.site_notification()}}
- {% set flash = tg.flash_obj.render('flash', use_js=False) %}
- <section id="page-body" class="{{g.document_class(neighborhood)}}">
- <div id="nav_menu_holder">
- {% block nav_menu %}
+{% endblock %}
+{{ theme_macros.header(g.login_url, '/auth/logout') }}
+{{ theme_macros.site_notification() }}
+{% set flash = tg.flash_obj.render('flash', use_js=False) %}
+<section id="page-body" class="{{ g.document_class(neighborhood) }}">
+ <div id="nav_menu_holder">
+ {% block nav_menu %}
{% include g.theme.nav_menu %}
- {% endblock %}
- </div>
- <div id="top_nav" class="">
+ {% endblock %}
+ </div>
+ <div id="top_nav" class="">
{% block top_nav %}
- {% include g.theme.top_nav %}
+ {% include g.theme.top_nav %}
{% endblock %}
- </div>
- <div id="content_base">
- {% block content_base %}
- {% if not hide_left_bar %}
- {% block sidebar_menu %}
- {% include g.theme.sidebar_menu %}
- {% endblock %}
- {% set outer_width = 20 %}
- {% else %}
- {% set outer_width = 24 %}
- {% endif %}
- {% if show_right_bar %}
- {% set inner_width = outer_width - 8 %}
- {% else %}
- {% set inner_width = outer_width %}
- {% endif %}
- <div class="grid-{{outer_width}} pad">
- <h2 class="dark{% block header_classes %} title{% endblock %}">{% block header %}{% endblock %}
- <!-- actions -->
- <small>
- {% block actions %}{% endblock %}
- </small>
- <!-- /actions -->
- </h2>
- {% block edit_box %}{% endblock %}
- <div{% if show_right_bar %} class="{% block inner_grid %}grid-{{inner_width}}"{% endblock %}{% endif %}>
- {% block before_content %}{% endblock %}
- {% block content %}{% endblock %}
- </div>
- {% if show_right_bar %}
- <div id="sidebar-right" class="grid-6 fright">
- {% block right_content %}{% endblock %}
- </div>
- {% endif %}
- {% block after_content %}{% endblock %}
- </div>
- {% endblock %}
- </div>
- </section>
- {{theme_macros.footer(g.year(), g.theme_href(''))}}
- <div id="messages">
- {% for n in h.pop_user_notifications() %}
- <section class="message {{ n.subject or 'info' }}">
+ </div>
+ <div id="content_base">
+ {% block content_base %}
+ {% if not hide_left_bar %}
+ {% block sidebar_menu %}
+ {% include g.theme.sidebar_menu %}
+ {% endblock %}
+ {% set outer_width = 20 %}
+ {% else %}
+ {% set outer_width = 24 %}
+ {% endif %}
+ {% if show_right_bar %}
+ {% set inner_width = outer_width - 8 %}
+ {% else %}
+ {% set inner_width = outer_width %}
+ {% endif %}
+ <div class="grid-{{ outer_width }} pad">
+ <h2 class="dark{% block header_classes %} title{% endblock %}">{% block header %}{% endblock %}
+ <!-- actions -->
+ <small>
+ {% block actions %}{% endblock %}
+ </small>
+ <!-- /actions -->
+ </h2>
+ {% block edit_box %}{% endblock %}
+ <div{% if show_right_bar %}
+ class="{% block inner_grid %}grid-{{ inner_width }}"{% endblock %}{% endif %}>
+ {% block before_content %}{% endblock %}
+ {% block content %}{% endblock %}
+ </div>
+ {% if show_right_bar %}
+ <div id="sidebar-right" class="grid-6 fright">
+ {% block right_content %}{% endblock %}
+ </div>
+ {% endif %}
+ {% block after_content %}{% endblock %}
+ </div>
+ {% endblock %}
+ </div>
+</section>
+{{ theme_macros.footer(g.year(), g.theme_href('')) }}
+<div id="messages">
+ {% for n in h.pop_user_notifications() %}
+ <section class="message {{ n.subject or 'info' }}">
<header>Notification:</header>
<div class="content">{{ n.text }}</div>
- </section>
- {% endfor %}
- </div>
- {% if c.show_login_overlay %}
- {{theme_macros.login_overlay()}}
- {% endif %}
- {% for blob in g.resource_manager.emit('body_js') %}
- {{ blob }}
- {% endfor %}
- {% for blob in g.resource_manager.emit('body_js_tail') %}
- {{ blob }}
+ </section>
{% endfor %}
- {% block extra_js %}{% endblock %}
- {% if neighborhood %}
- {{ neighborhood.site_specific_html | safe }}
- {% elif c.project.neighborhood %}
- {{ c.project.neighborhood.site_specific_html | safe }}
- {% endif %}
- {{theme_macros.custom_js()}}
- {% if flash %}
- <script type="text/javascript">{{flash | safe}}</script>
- {% endif %}
- </body>
+</div>
+{% if c.show_login_overlay %}
+ {{ theme_macros.login_overlay() }}
+{% endif %}
+{% for blob in g.resource_manager.emit('body_js') %}
+ {{ blob }}
+{% endfor %}
+{% for blob in g.resource_manager.emit('body_js_tail') %}
+ {{ blob }}
+{% endfor %}
+{% block extra_js %}{% endblock %}
+{% if neighborhood %}
+ {{ neighborhood.site_specific_html | safe }}
+{% elif c.project.neighborhood %}
+ {{ c.project.neighborhood.site_specific_html | safe }}
+{% endif %}
+{{ theme_macros.custom_js() }}
+{% if flash %}
+ <script type="text/javascript">{{ flash | safe }}</script>
+{% endif %}
+<script>
+ $(document).ready(function () {
+ $(".tooltip").tooltipster({
+ animation: 'fade',
+ delay: 200,
+ theme: 'tooltipster-light',
+ trigger: 'hover',
+ position: 'right',
+ iconCloning: false,
+ maxWidth: 300
+ });
+ })
+</script>
+</body>
</html>
[02/26] allura git commit: [#7806] ticket:773 Inherit docker-dev.ini
from development.ini
Posted by he...@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/hs/7885
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
[08/26] allura git commit: [#7806] ticket:773 Add solr container
Posted by he...@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/hs/7885
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
[13/26] allura git commit: [#7806] ticket:778 Add USER env var for
GitPython
Posted by he...@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/hs/7885
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
[18/26] allura git commit: [#7825] Added "new commits" email template.
Posted by he...@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/hs/7885
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'
[24/26] allura git commit: CHANGES updated for ASF release 1.3.0
Posted by he...@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/hs/7885
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
[06/26] allura git commit: [#7806] ticket:773 Mount SCM dirs to the
host and add some options for the future
Posted by he...@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/hs/7885
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:
[21/26] allura git commit: [#7886] ticket:789 Factor out rate_limit
into general helper
Posted by he...@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/hs/7885
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):
"""
[22/26] allura git commit: [#7886] ticket:789 Add options and help
text to development.ini
Posted by he...@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/hs/7885
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
[09/26] allura git commit: [#7806] ticket:773 Add license header to
new files
Posted by he...@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/hs/7885
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 \
[07/26] allura git commit: [#7806] ticket:773 Add java (jslint in
AllutaTest needs it) & svn deps to web image
Posted by he...@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/hs/7885
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
[04/26] allura git commit: [#7806] ticket:773 Basic docker containers
for Allura web and mongo
Posted by he...@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/hs/7885
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
[12/26] allura git commit: [#7806] ticket:778 Add stuff for SCM
snapshots
Posted by he...@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/hs/7885
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
[25/26] allura git commit: [#7885] Added static files for the jquery
tool tip lib
Posted by he...@apache.org.
[#7885] Added static files for the jquery tool tip lib
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/034134b0
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/034134b0
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/034134b0
Branch: refs/heads/hs/7885
Commit: 034134b0211f22e384f3ca3b4e313e7929b2aea1
Parents: 195c0b1
Author: Heith Seewald <hs...@slashdotmedia.com>
Authored: Mon Jun 8 15:42:02 2015 -0400
Committer: Heith Seewald <hs...@slashdotmedia.com>
Committed: Mon Jun 15 14:21:49 2015 +0000
----------------------------------------------------------------------
.../allura/public/nf/css/forge/tooltipster.css | 316 +++++
.../allura/public/nf/js/jquery.tooltipster.js | 1327 ++++++++++++++++++
2 files changed, 1643 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/034134b0/Allura/allura/public/nf/css/forge/tooltipster.css
----------------------------------------------------------------------
diff --git a/Allura/allura/public/nf/css/forge/tooltipster.css b/Allura/allura/public/nf/css/forge/tooltipster.css
new file mode 100755
index 0000000..db56bc3
--- /dev/null
+++ b/Allura/allura/public/nf/css/forge/tooltipster.css
@@ -0,0 +1,316 @@
+/* This is the default Tooltipster theme (feel free to modify or duplicate and create multiple themes!): */
+.tooltipster-default {
+ border-radius: 5px;
+ border: 2px solid #000;
+ background: #4c4c4c;
+ color: #fff;
+}
+
+/* Use this next selector to style things like font-size and line-height: */
+.tooltipster-default .tooltipster-content {
+ font-family: Arial, sans-serif;
+ font-size: 14px;
+ line-height: 16px;
+ padding: 8px 10px;
+ overflow: hidden;
+}
+
+/* This next selector defines the color of the border on the outside of the arrow. This will automatically match the color and size of the border set on the main tooltip styles. Set display: none; if you would like a border around the tooltip but no border around the arrow */
+.tooltipster-default .tooltipster-arrow .tooltipster-arrow-border {
+ /* border-color: ... !important; */
+}
+
+/* If you're using the icon option, use this next selector to style them */
+.tooltipster-icon {
+ cursor: help;
+ background: #00AFFE;
+ font-size: medium;
+ font-weight: 600;
+ color: white;
+ border: 1px solid #067DB8;
+ border-radius: 15%;
+ position: absolute;
+ padding: 0 4px;
+ left: 41.3%;
+ margin-top: -27.5px;
+ margin-bottom: 141px;
+}
+
+/* If you're using the icon option, use this next selector to style them */
+.tooltipster-icon:hover {
+ background: #067DB8;
+ border: 1px solid #00AFFE;
+}
+
+/* This is the base styling required to make all Tooltipsters work */
+.tooltipster-base {
+ padding: 0;
+ font-size: 0;
+ line-height: 0;
+ position: absolute;
+ left: 0;
+ top: 0;
+ z-index: 9999999;
+ pointer-events: none;
+ width: auto;
+ overflow: visible;
+}
+
+.tooltipster-base .tooltipster-content {
+ overflow: hidden;
+}
+
+/* These next classes handle the styles for the little arrow attached to the tooltip. By default, the arrow will inherit the same colors and border as what is set on the main tooltip itself. */
+.tooltipster-arrow {
+ display: block;
+ text-align: center;
+ width: 100%;
+ height: 100%;
+ position: absolute;
+ top: 0;
+ left: 0;
+ z-index: -1;
+}
+
+.tooltipster-arrow span, .tooltipster-arrow-border {
+ display: block;
+ width: 0;
+ height: 0;
+ position: absolute;
+}
+
+.tooltipster-arrow-top span, .tooltipster-arrow-top-right span, .tooltipster-arrow-top-left span {
+ border-left: 8px solid transparent !important;
+ border-right: 8px solid transparent !important;
+ border-top: 8px solid;
+ bottom: -7px;
+}
+
+.tooltipster-arrow-top .tooltipster-arrow-border, .tooltipster-arrow-top-right .tooltipster-arrow-border, .tooltipster-arrow-top-left .tooltipster-arrow-border {
+ border-left: 9px solid transparent !important;
+ border-right: 9px solid transparent !important;
+ border-top: 9px solid;
+ bottom: -7px;
+}
+
+.tooltipster-arrow-bottom span, .tooltipster-arrow-bottom-right span, .tooltipster-arrow-bottom-left span {
+ border-left: 8px solid transparent !important;
+ border-right: 8px solid transparent !important;
+ border-bottom: 8px solid;
+ top: -7px;
+}
+
+.tooltipster-arrow-bottom .tooltipster-arrow-border, .tooltipster-arrow-bottom-right .tooltipster-arrow-border, .tooltipster-arrow-bottom-left .tooltipster-arrow-border {
+ border-left: 9px solid transparent !important;
+ border-right: 9px solid transparent !important;
+ border-bottom: 9px solid;
+ top: -7px;
+}
+
+.tooltipster-arrow-top span, .tooltipster-arrow-top .tooltipster-arrow-border, .tooltipster-arrow-bottom span, .tooltipster-arrow-bottom .tooltipster-arrow-border {
+ left: 0;
+ right: 0;
+ margin: 0 auto;
+}
+
+.tooltipster-arrow-top-left span, .tooltipster-arrow-bottom-left span {
+ left: 6px;
+}
+
+.tooltipster-arrow-top-left .tooltipster-arrow-border, .tooltipster-arrow-bottom-left .tooltipster-arrow-border {
+ left: 5px;
+}
+
+.tooltipster-arrow-top-right span, .tooltipster-arrow-bottom-right span {
+ right: 6px;
+}
+
+.tooltipster-arrow-top-right .tooltipster-arrow-border, .tooltipster-arrow-bottom-right .tooltipster-arrow-border {
+ right: 5px;
+}
+
+.tooltipster-arrow-left span, .tooltipster-arrow-left .tooltipster-arrow-border {
+ border-top: 8px solid transparent !important;
+ border-bottom: 8px solid transparent !important;
+ border-left: 8px solid;
+ top: 50%;
+ margin-top: -7px;
+ right: -7px;
+}
+
+.tooltipster-arrow-left .tooltipster-arrow-border {
+ border-top: 9px solid transparent !important;
+ border-bottom: 9px solid transparent !important;
+ border-left: 9px solid;
+ margin-top: -8px;
+}
+
+.tooltipster-arrow-right span, .tooltipster-arrow-right .tooltipster-arrow-border {
+ border-top: 8px solid transparent !important;
+ border-bottom: 8px solid transparent !important;
+ border-right: 8px solid;
+ top: 50%;
+ margin-top: -7px;
+ left: -7px;
+}
+
+.tooltipster-arrow-right .tooltipster-arrow-border {
+ border-top: 9px solid transparent !important;
+ border-bottom: 9px solid transparent !important;
+ border-right: 9px solid;
+ margin-top: -8px;
+}
+
+/* Some CSS magic for the awesome animations - feel free to make your own custom animations and reference it in your Tooltipster settings! */
+
+.tooltipster-fade {
+ opacity: 0;
+ -webkit-transition-property: opacity;
+ -moz-transition-property: opacity;
+ -o-transition-property: opacity;
+ -ms-transition-property: opacity;
+ transition-property: opacity;
+}
+
+.tooltipster-fade-show {
+ opacity: 1;
+}
+
+.tooltipster-grow {
+ -webkit-transform: scale(0, 0);
+ -moz-transform: scale(0, 0);
+ -o-transform: scale(0, 0);
+ -ms-transform: scale(0, 0);
+ transform: scale(0, 0);
+ -webkit-transition-property: -webkit-transform;
+ -moz-transition-property: -moz-transform;
+ -o-transition-property: -o-transform;
+ -ms-transition-property: -ms-transform;
+ transition-property: transform;
+ -webkit-backface-visibility: hidden;
+}
+
+.tooltipster-grow-show {
+ -webkit-transform: scale(1, 1);
+ -moz-transform: scale(1, 1);
+ -o-transform: scale(1, 1);
+ -ms-transform: scale(1, 1);
+ transform: scale(1, 1);
+ -webkit-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1);
+ -webkit-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
+ -moz-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
+ -ms-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
+ -o-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
+ transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
+}
+
+.tooltipster-swing {
+ opacity: 0;
+ -webkit-transform: rotateZ(4deg);
+ -moz-transform: rotateZ(4deg);
+ -o-transform: rotateZ(4deg);
+ -ms-transform: rotateZ(4deg);
+ transform: rotateZ(4deg);
+ -webkit-transition-property: -webkit-transform, opacity;
+ -moz-transition-property: -moz-transform;
+ -o-transition-property: -o-transform;
+ -ms-transition-property: -ms-transform;
+ transition-property: transform;
+}
+
+.tooltipster-swing-show {
+ opacity: 1;
+ -webkit-transform: rotateZ(0deg);
+ -moz-transform: rotateZ(0deg);
+ -o-transform: rotateZ(0deg);
+ -ms-transform: rotateZ(0deg);
+ transform: rotateZ(0deg);
+ -webkit-transition-timing-function: cubic-bezier(0.230, 0.635, 0.495, 1);
+ -webkit-transition-timing-function: cubic-bezier(0.230, 0.635, 0.495, 2.4);
+ -moz-transition-timing-function: cubic-bezier(0.230, 0.635, 0.495, 2.4);
+ -ms-transition-timing-function: cubic-bezier(0.230, 0.635, 0.495, 2.4);
+ -o-transition-timing-function: cubic-bezier(0.230, 0.635, 0.495, 2.4);
+ transition-timing-function: cubic-bezier(0.230, 0.635, 0.495, 2.4);
+}
+
+.tooltipster-fall {
+ top: 0;
+ -webkit-transition-property: top;
+ -moz-transition-property: top;
+ -o-transition-property: top;
+ -ms-transition-property: top;
+ transition-property: top;
+ -webkit-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1);
+ -webkit-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
+ -moz-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
+ -ms-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
+ -o-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
+ transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
+}
+
+.tooltipster-fall-show {
+}
+
+.tooltipster-fall.tooltipster-dying {
+ -webkit-transition-property: all;
+ -moz-transition-property: all;
+ -o-transition-property: all;
+ -ms-transition-property: all;
+ transition-property: all;
+ top: 0px !important;
+ opacity: 0;
+}
+
+.tooltipster-slide {
+ left: -40px;
+ -webkit-transition-property: left;
+ -moz-transition-property: left;
+ -o-transition-property: left;
+ -ms-transition-property: left;
+ transition-property: left;
+ -webkit-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1);
+ -webkit-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
+ -moz-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
+ -ms-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
+ -o-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
+ transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
+}
+
+.tooltipster-slide.tooltipster-slide-show {
+}
+
+.tooltipster-slide.tooltipster-dying {
+ -webkit-transition-property: all;
+ -moz-transition-property: all;
+ -o-transition-property: all;
+ -ms-transition-property: all;
+ transition-property: all;
+ left: 0px !important;
+ opacity: 0;
+}
+
+/* CSS transition for when contenting is changing in a tooltip that is still open. The only properties that will NOT transition are: width, height, top, and left */
+.tooltipster-content-changing {
+ opacity: 0.5;
+ -webkit-transform: scale(1.1, 1.1);
+ -moz-transform: scale(1.1, 1.1);
+ -o-transform: scale(1.1, 1.1);
+ -ms-transform: scale(1.1, 1.1);
+ transform: scale(1.1, 1.1);
+}
+
+.tooltipster-light {
+ border-radius: 5px;
+ border: 0 solid #cccccc;
+ background: #0077AB;
+ color: #666666;
+}
+
+.tooltipster-light .tooltipster-content {
+ font-family: Arial, sans-serif;
+ font-size: 12px;
+ color: white;
+ font-style: italic;
+ line-height: 16px;
+ padding: 8px 10px;
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/allura/blob/034134b0/Allura/allura/public/nf/js/jquery.tooltipster.js
----------------------------------------------------------------------
diff --git a/Allura/allura/public/nf/js/jquery.tooltipster.js b/Allura/allura/public/nf/js/jquery.tooltipster.js
new file mode 100755
index 0000000..439c4f7
--- /dev/null
+++ b/Allura/allura/public/nf/js/jquery.tooltipster.js
@@ -0,0 +1,1327 @@
+/*
+
+Tooltipster 3.3.0 | 2014-11-08
+A rockin' custom tooltip jQuery plugin
+
+Developed by Caleb Jacob under the MIT license http://opensource.org/licenses/MIT
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+*/
+
+;(function ($, window, document) {
+
+ var pluginName = "tooltipster",
+ defaults = {
+ animation: 'fade',
+ arrow: true,
+ arrowColor: '',
+ autoClose: true,
+ content: null,
+ contentAsHTML: false,
+ contentCloning: true,
+ debug: true,
+ delay: 200,
+ minWidth: 0,
+ maxWidth: null,
+ functionInit: function(origin, content) {},
+ functionBefore: function(origin, continueTooltip) {
+ continueTooltip();
+ },
+ functionReady: function(origin, tooltip) {},
+ functionAfter: function(origin) {},
+ hideOnClick: false,
+ icon: '(?)',
+ iconCloning: true,
+ iconDesktop: false,
+ iconTouch: false,
+ iconTheme: 'tooltipster-icon',
+ interactive: false,
+ interactiveTolerance: 350,
+ multiple: false,
+ offsetX: 0,
+ offsetY: 0,
+ onlyOne: false,
+ position: 'top',
+ positionTracker: false,
+ positionTrackerCallback: function(origin){
+ // the default tracker callback will close the tooltip when the trigger is
+ // 'hover' (see https://github.com/iamceege/tooltipster/pull/253)
+ if(this.option('trigger') == 'hover' && this.option('autoClose')) {
+ this.hide();
+ }
+ },
+ restoration: 'current',
+ speed: 350,
+ timer: 0,
+ theme: 'tooltipster-default',
+ touchDevices: true,
+ trigger: 'hover',
+ updateAnimation: true
+ };
+
+ function Plugin(element, options) {
+
+ // list of instance variables
+
+ this.bodyOverflowX;
+ // stack of custom callbacks provided as parameters to API methods
+ this.callbacks = {
+ hide: [],
+ show: []
+ };
+ this.checkInterval = null;
+ // this will be the user content shown in the tooltip. A capital "C" is used because there is also a method called content()
+ this.Content;
+ // this is the original element which is being applied the tooltipster plugin
+ this.$el = $(element);
+ // this will be the element which triggers the appearance of the tooltip on hover/click/custom events.
+ // it will be the same as this.$el if icons are not used (see in the options), otherwise it will correspond to the created icon
+ this.$elProxy;
+ this.elProxyPosition;
+ this.enabled = true;
+ this.options = $.extend({}, defaults, options);
+ this.mouseIsOverProxy = false;
+ // a unique namespace per instance, for easy selective unbinding
+ this.namespace = 'tooltipster-'+ Math.round(Math.random()*100000);
+ // Status (capital S) can be either : appearing, shown, disappearing, hidden
+ this.Status = 'hidden';
+ this.timerHide = null;
+ this.timerShow = null;
+ // this will be the tooltip element (jQuery wrapped HTML element)
+ this.$tooltip;
+
+ // for backward compatibility
+ this.options.iconTheme = this.options.iconTheme.replace('.', '');
+ this.options.theme = this.options.theme.replace('.', '');
+
+ // launch
+
+ this._init();
+ }
+
+ Plugin.prototype = {
+
+ _init: function() {
+
+ var self = this;
+
+ // disable the plugin on old browsers (including IE7 and lower)
+ if (document.querySelector) {
+
+ // note : the content is null (empty) by default and can stay that way if the plugin remains initialized but not fed any content. The tooltip will just not appear.
+
+ // let's save the initial value of the title attribute for later restoration if need be.
+ var initialTitle = null;
+ // it will already have been saved in case of multiple tooltips
+ if (self.$el.data('tooltipster-initialTitle') === undefined) {
+
+ initialTitle = self.$el.attr('title');
+
+ // we do not want initialTitle to have the value "undefined" because of how jQuery's .data() method works
+ if (initialTitle === undefined) initialTitle = null;
+
+ self.$el.data('tooltipster-initialTitle', initialTitle);
+ }
+
+ // if content is provided in the options, its has precedence over the title attribute.
+ // Note : an empty string is considered content, only 'null' represents the absence of content.
+ // Also, an existing title="" attribute will result in an empty string content
+ if (self.options.content !== null){
+ self._content_set(self.options.content);
+ }
+ else {
+ self._content_set(initialTitle);
+ }
+
+ var c = self.options.functionInit.call(self.$el, self.$el, self.Content);
+ if(typeof c !== 'undefined') self._content_set(c);
+
+ self.$el
+ // strip the title off of the element to prevent the default tooltips from popping up
+ .removeAttr('title')
+ // to be able to find all instances on the page later (upon window events in particular)
+ .addClass('tooltipstered');
+
+ // detect if we're changing the tooltip origin to an icon
+ // note about this condition : if the device has touch capability and self.options.iconTouch is false, you'll have no icons event though you may consider your device as a desktop if it also has a mouse. Not sure why someone would have this use case though.
+ if ((!deviceHasTouchCapability && self.options.iconDesktop) || (deviceHasTouchCapability && self.options.iconTouch)) {
+
+ // TODO : the tooltip should be automatically be given an absolute position to be near the origin. Otherwise, when the origin is floating or what, it's going to be nowhere near it and disturb the position flow of the page elements. It will imply that the icon also detects when its origin moves, to follow it : not trivial.
+ // Until it's done, the icon feature does not really make sense since the user still has most of the work to do by himself
+
+ // if the icon provided is in the form of a string
+ if(typeof self.options.icon === 'string'){
+ // wrap it in a span with the icon class
+ self.$elProxy = $('<span class="'+ self.options.iconTheme +'"></span>');
+ self.$elProxy.text(self.options.icon);
+ }
+ // if it is an object (sensible choice)
+ else {
+ // (deep) clone the object if iconCloning == true, to make sure every instance has its own proxy. We use the icon without wrapping, no need to. We do not give it a class either, as the user will undoubtedly style the object on his own and since our css properties may conflict with his own
+ if (self.options.iconCloning) self.$elProxy = self.options.icon.clone(true);
+ else self.$elProxy = self.options.icon;
+ }
+
+ self.$elProxy.insertAfter(self.$el);
+ }
+ else {
+ self.$elProxy = self.$el;
+ }
+
+ // for 'click' and 'hover' triggers : bind on events to open the tooltip. Closing is now handled in _showNow() because of its bindings.
+ // Notes about touch events :
+ // - mouseenter, mouseleave and clicks happen even on pure touch devices because they are emulated. deviceIsPureTouch() is a simple attempt to detect them.
+ // - on hybrid devices, we do not prevent touch gesture from opening tooltips. It would be too complex to differentiate real mouse events from emulated ones.
+ // - we check deviceIsPureTouch() at each event rather than prior to binding because the situation may change during browsing
+ if (self.options.trigger == 'hover') {
+
+ // these binding are for mouse interaction only
+ self.$elProxy
+ .on('mouseenter.'+ self.namespace, function() {
+ if (!deviceIsPureTouch() || self.options.touchDevices) {
+ self.mouseIsOverProxy = true;
+ self._show();
+ }
+ })
+ .on('mouseleave.'+ self.namespace, function() {
+ if (!deviceIsPureTouch() || self.options.touchDevices) {
+ self.mouseIsOverProxy = false;
+ }
+ });
+
+ // for touch interaction only
+ if (deviceHasTouchCapability && self.options.touchDevices) {
+
+ // for touch devices, we immediately display the tooltip because we cannot rely on mouseleave to handle the delay
+ self.$elProxy.on('touchstart.'+ self.namespace, function() {
+ self._showNow();
+ });
+ }
+ }
+ else if (self.options.trigger == 'click') {
+
+ // note : for touch devices, we do not bind on touchstart, we only rely on the emulated clicks (triggered by taps)
+ self.$elProxy.on('click.'+ self.namespace, function() {
+ if (!deviceIsPureTouch() || self.options.touchDevices) {
+ self._show();
+ }
+ });
+ }
+ }
+ },
+
+ // this function will schedule the opening of the tooltip after the delay, if there is one
+ _show: function() {
+
+ var self = this;
+
+ if (self.Status != 'shown' && self.Status != 'appearing') {
+
+ if (self.options.delay) {
+ self.timerShow = setTimeout(function(){
+
+ // for hover trigger, we check if the mouse is still over the proxy, otherwise we do not show anything
+ if (self.options.trigger == 'click' || (self.options.trigger == 'hover' && self.mouseIsOverProxy)) {
+ self._showNow();
+ }
+ }, self.options.delay);
+ }
+ else self._showNow();
+ }
+ },
+
+ // this function will open the tooltip right away
+ _showNow: function(callback) {
+
+ var self = this;
+
+ // call our constructor custom function before continuing
+ self.options.functionBefore.call(self.$el, self.$el, function() {
+
+ // continue only if the tooltip is enabled and has any content
+ if (self.enabled && self.Content !== null) {
+
+ // save the method callback and cancel hide method callbacks
+ if (callback) self.callbacks.show.push(callback);
+ self.callbacks.hide = [];
+
+ //get rid of any appearance timer
+ clearTimeout(self.timerShow);
+ self.timerShow = null;
+ clearTimeout(self.timerHide);
+ self.timerHide = null;
+
+ // if we only want one tooltip open at a time, close all auto-closing tooltips currently open and not already disappearing
+ if (self.options.onlyOne) {
+ $('.tooltipstered').not(self.$el).each(function(i,el) {
+
+ var $el = $(el),
+ nss = $el.data('tooltipster-ns');
+
+ // iterate on all tooltips of the element
+ $.each(nss, function(i, ns){
+ var instance = $el.data(ns),
+ // we have to use the public methods here
+ s = instance.status(),
+ ac = instance.option('autoClose');
+
+ if (s !== 'hidden' && s !== 'disappearing' && ac) {
+ instance.hide();
+ }
+ });
+ });
+ }
+
+ var finish = function() {
+ self.Status = 'shown';
+
+ // trigger any show method custom callbacks and reset them
+ $.each(self.callbacks.show, function(i,c) { c.call(self.$el); });
+ self.callbacks.show = [];
+ };
+
+ // if this origin already has its tooltip open
+ if (self.Status !== 'hidden') {
+
+ // the timer (if any) will start (or restart) right now
+ var extraTime = 0;
+
+ // if it was disappearing, cancel that
+ if (self.Status === 'disappearing') {
+
+ self.Status = 'appearing';
+
+ if (supportsTransitions()) {
+
+ self.$tooltip
+ .clearQueue()
+ .removeClass('tooltipster-dying')
+ .addClass('tooltipster-'+ self.options.animation +'-show');
+
+ if (self.options.speed > 0) self.$tooltip.delay(self.options.speed);
+
+ self.$tooltip.queue(finish);
+ }
+ else {
+ // in case the tooltip was currently fading out, bring it back to life
+ self.$tooltip
+ .stop()
+ .fadeIn(finish);
+ }
+ }
+ // if the tooltip is already open, we still need to trigger the method custom callback
+ else if(self.Status === 'shown') {
+ finish();
+ }
+ }
+ // if the tooltip isn't already open, open that sucker up!
+ else {
+
+ self.Status = 'appearing';
+
+ // the timer (if any) will start when the tooltip has fully appeared after its transition
+ var extraTime = self.options.speed;
+
+ // disable horizontal scrollbar to keep overflowing tooltips from jacking with it and then restore it to its previous value
+ self.bodyOverflowX = $('body').css('overflow-x');
+ $('body').css('overflow-x', 'hidden');
+
+ // get some other settings related to building the tooltip
+ var animation = 'tooltipster-' + self.options.animation,
+ animationSpeed = '-webkit-transition-duration: '+ self.options.speed +'ms; -webkit-animation-duration: '+ self.options.speed +'ms; -moz-transition-duration: '+ self.options.speed +'ms; -moz-animation-duration: '+ self.options.speed +'ms; -o-transition-duration: '+ self.options.speed +'ms; -o-animation-duration: '+ self.options.speed +'ms; -ms-transition-duration: '+ self.options.speed +'ms; -ms-animation-duration: '+ self.options.speed +'ms; transition-duration: '+ self.options.speed +'ms; animation-duration: '+ self.options.speed +'ms;',
+ minWidth = self.options.minWidth ? 'min-width:'+ Math.round(self.options.minWidth) +'px;' : '',
+ maxWidth = self.options.maxWidth ? 'max-width:'+ Math.round(self.options.maxWidth) +'px;' : '',
+ pointerEvents = self.options.interactive ? 'pointer-events: auto;' : '';
+
+ // build the base of our tooltip
+ self.$tooltip = $('<div class="tooltipster-base '+ self.options.theme +'" style="'+ minWidth +' '+ maxWidth +' '+ pointerEvents +' '+ animationSpeed +'"><div class="tooltipster-content"></div></div>');
+
+ // only add the animation class if the user has a browser that supports animations
+ if (supportsTransitions()) self.$tooltip.addClass(animation);
+
+ // insert the content
+ self._content_insert();
+
+ // attach
+ self.$tooltip.appendTo('body');
+
+ // do all the crazy calculations and positioning
+ self.reposition();
+
+ // call our custom callback since the content of the tooltip is now part of the DOM
+ self.options.functionReady.call(self.$el, self.$el, self.$tooltip);
+
+ // animate in the tooltip
+ if (supportsTransitions()) {
+
+ self.$tooltip.addClass(animation + '-show');
+
+ if(self.options.speed > 0) self.$tooltip.delay(self.options.speed);
+
+ self.$tooltip.queue(finish);
+ }
+ else {
+ self.$tooltip.css('display', 'none').fadeIn(self.options.speed, finish);
+ }
+
+ // will check if our tooltip origin is removed while the tooltip is shown
+ self._interval_set();
+
+ // reposition on scroll (otherwise position:fixed element's tooltips will move away form their origin) and on resize (in case position can/has to be changed)
+ $(window).on('scroll.'+ self.namespace +' resize.'+ self.namespace, function() {
+ self.reposition();
+ });
+
+ // auto-close bindings
+ if (self.options.autoClose) {
+
+ // in case a listener is already bound for autoclosing (mouse or touch, hover or click), unbind it first
+ $('body').off('.'+ self.namespace);
+
+ // here we'll have to set different sets of bindings for both touch and mouse
+ if (self.options.trigger == 'hover') {
+
+ // if the user touches the body, hide
+ if (deviceHasTouchCapability) {
+ // timeout 0 : explanation below in click section
+ setTimeout(function() {
+ // we don't want to bind on click here because the initial touchstart event has not yet triggered its click event, which is thus about to happen
+ $('body').on('touchstart.'+ self.namespace, function() {
+ self.hide();
+ });
+ }, 0);
+ }
+
+ // if we have to allow interaction
+ if (self.options.interactive) {
+
+ // touch events inside the tooltip must not close it
+ if (deviceHasTouchCapability) {
+ self.$tooltip.on('touchstart.'+ self.namespace, function(event) {
+ event.stopPropagation();
+ });
+ }
+
+ // as for mouse interaction, we get rid of the tooltip only after the mouse has spent some time out of it
+ var tolerance = null;
+
+ self.$elProxy.add(self.$tooltip)
+ // hide after some time out of the proxy and the tooltip
+ .on('mouseleave.'+ self.namespace + '-autoClose', function() {
+ clearTimeout(tolerance);
+ tolerance = setTimeout(function(){
+ self.hide();
+ }, self.options.interactiveTolerance);
+ })
+ // suspend timeout when the mouse is over the proxy or the tooltip
+ .on('mouseenter.'+ self.namespace + '-autoClose', function() {
+ clearTimeout(tolerance);
+ });
+ }
+ // if this is a non-interactive tooltip, get rid of it if the mouse leaves
+ else {
+ self.$elProxy.on('mouseleave.'+ self.namespace + '-autoClose', function() {
+ self.hide();
+ });
+ }
+
+ // close the tooltip when the proxy gets a click (common behavior of native tooltips)
+ if (self.options.hideOnClick) {
+
+ self.$elProxy.on('click.'+ self.namespace + '-autoClose', function() {
+ self.hide();
+ });
+ }
+ }
+ // here we'll set the same bindings for both clicks and touch on the body to hide the tooltip
+ else if(self.options.trigger == 'click'){
+
+ // use a timeout to prevent immediate closing if the method was called on a click event and if options.delay == 0 (because of bubbling)
+ setTimeout(function() {
+ $('body').on('click.'+ self.namespace +' touchstart.'+ self.namespace, function() {
+ self.hide();
+ });
+ }, 0);
+
+ // if interactive, we'll stop the events that were emitted from inside the tooltip to stop autoClosing
+ if (self.options.interactive) {
+
+ // note : the touch events will just not be used if the plugin is not enabled on touch devices
+ self.$tooltip.on('click.'+ self.namespace +' touchstart.'+ self.namespace, function(event) {
+ event.stopPropagation();
+ });
+ }
+ }
+ }
+ }
+
+ // if we have a timer set, let the countdown begin
+ if (self.options.timer > 0) {
+
+ self.timerHide = setTimeout(function() {
+ self.timerHide = null;
+ self.hide();
+ }, self.options.timer + extraTime);
+ }
+ }
+ });
+ },
+
+ _interval_set: function() {
+
+ var self = this;
+
+ self.checkInterval = setInterval(function() {
+
+ // if the tooltip and/or its interval should be stopped
+ if (
+ // if the origin has been removed
+ $('body').find(self.$el).length === 0
+ // if the elProxy has been removed
+ || $('body').find(self.$elProxy).length === 0
+ // if the tooltip has been closed
+ || self.Status == 'hidden'
+ // if the tooltip has somehow been removed
+ || $('body').find(self.$tooltip).length === 0
+ ) {
+ // remove the tooltip if it's still here
+ if (self.Status == 'shown' || self.Status == 'appearing') self.hide();
+
+ // clear this interval as it is no longer necessary
+ self._interval_cancel();
+ }
+ // if everything is alright
+ else {
+ // compare the former and current positions of the elProxy to reposition the tooltip if need be
+ if(self.options.positionTracker){
+
+ var p = self._repositionInfo(self.$elProxy),
+ identical = false;
+
+ // compare size first (a change requires repositioning too)
+ if(areEqual(p.dimension, self.elProxyPosition.dimension)){
+
+ // for elements with a fixed position, we track the top and left properties (relative to window)
+ if(self.$elProxy.css('position') === 'fixed'){
+ if(areEqual(p.position, self.elProxyPosition.position)) identical = true;
+ }
+ // otherwise, track total offset (relative to document)
+ else {
+ if(areEqual(p.offset, self.elProxyPosition.offset)) identical = true;
+ }
+ }
+
+ if(!identical){
+ self.reposition();
+ self.options.positionTrackerCallback.call(self, self.$el);
+ }
+ }
+ }
+ }, 200);
+ },
+
+ _interval_cancel: function() {
+ clearInterval(this.checkInterval);
+ // clean delete
+ this.checkInterval = null;
+ },
+
+ _content_set: function(content) {
+ // clone if asked. Cloning the object makes sure that each instance has its own version of the content (in case a same object were provided for several instances)
+ // reminder : typeof null === object
+ if (typeof content === 'object' && content !== null && this.options.contentCloning) {
+ content = content.clone(true);
+ }
+ this.Content = content;
+ },
+
+ _content_insert: function() {
+
+ var self = this,
+ $d = this.$tooltip.find('.tooltipster-content');
+
+ if (typeof self.Content === 'string' && !self.options.contentAsHTML) {
+ $d.text(self.Content);
+ }
+ else {
+ $d
+ .empty()
+ .append(self.Content);
+ }
+ },
+
+ _update: function(content) {
+
+ var self = this;
+
+ // change the content
+ self._content_set(content);
+
+ if (self.Content !== null) {
+
+ // update the tooltip if it is open
+ if (self.Status !== 'hidden') {
+
+ // reset the content in the tooltip
+ self._content_insert();
+
+ // reposition and resize the tooltip
+ self.reposition();
+
+ // if we want to play a little animation showing the content changed
+ if (self.options.updateAnimation) {
+
+ if (supportsTransitions()) {
+
+ self.$tooltip.css({
+ 'width': '',
+ '-webkit-transition': 'all ' + self.options.speed + 'ms, width 0ms, height 0ms, left 0ms, top 0ms',
+ '-moz-transition': 'all ' + self.options.speed + 'ms, width 0ms, height 0ms, left 0ms, top 0ms',
+ '-o-transition': 'all ' + self.options.speed + 'ms, width 0ms, height 0ms, left 0ms, top 0ms',
+ '-ms-transition': 'all ' + self.options.speed + 'ms, width 0ms, height 0ms, left 0ms, top 0ms',
+ 'transition': 'all ' + self.options.speed + 'ms, width 0ms, height 0ms, left 0ms, top 0ms'
+ }).addClass('tooltipster-content-changing');
+
+ // reset the CSS transitions and finish the change animation
+ setTimeout(function() {
+
+ if(self.Status != 'hidden'){
+
+ self.$tooltip.removeClass('tooltipster-content-changing');
+
+ // after the changing animation has completed, reset the CSS transitions
+ setTimeout(function() {
+
+ if(self.Status !== 'hidden'){
+ self.$tooltip.css({
+ '-webkit-transition': self.options.speed + 'ms',
+ '-moz-transition': self.options.speed + 'ms',
+ '-o-transition': self.options.speed + 'ms',
+ '-ms-transition': self.options.speed + 'ms',
+ 'transition': self.options.speed + 'ms'
+ });
+ }
+ }, self.options.speed);
+ }
+ }, self.options.speed);
+ }
+ else {
+ self.$tooltip.fadeTo(self.options.speed, 0.5, function() {
+ if(self.Status != 'hidden'){
+ self.$tooltip.fadeTo(self.options.speed, 1);
+ }
+ });
+ }
+ }
+ }
+ }
+ else {
+ self.hide();
+ }
+ },
+
+ _repositionInfo: function($el) {
+ return {
+ dimension: {
+ height: $el.outerHeight(false),
+ width: $el.outerWidth(false)
+ },
+ offset: $el.offset(),
+ position: {
+ left: parseInt($el.css('left')),
+ top: parseInt($el.css('top'))
+ }
+ };
+ },
+
+ hide: function(callback) {
+
+ var self = this;
+
+ // save the method custom callback and cancel any show method custom callbacks
+ if (callback) self.callbacks.hide.push(callback);
+ self.callbacks.show = [];
+
+ // get rid of any appearance timeout
+ clearTimeout(self.timerShow);
+ self.timerShow = null;
+ clearTimeout(self.timerHide);
+ self.timerHide = null;
+
+ var finishCallbacks = function() {
+ // trigger any hide method custom callbacks and reset them
+ $.each(self.callbacks.hide, function(i,c) { c.call(self.$el); });
+ self.callbacks.hide = [];
+ };
+
+ // hide
+ if (self.Status == 'shown' || self.Status == 'appearing') {
+
+ self.Status = 'disappearing';
+
+ var finish = function() {
+
+ self.Status = 'hidden';
+
+ // detach our content object first, so the next jQuery's remove() call does not unbind its event handlers
+ if (typeof self.Content == 'object' && self.Content !== null) {
+ self.Content.detach();
+ }
+
+ self.$tooltip.remove();
+ self.$tooltip = null;
+
+ // unbind orientationchange, scroll and resize listeners
+ $(window).off('.'+ self.namespace);
+
+ $('body')
+ // unbind any auto-closing click/touch listeners
+ .off('.'+ self.namespace)
+ .css('overflow-x', self.bodyOverflowX);
+
+ // unbind any auto-closing click/touch listeners
+ $('body').off('.'+ self.namespace);
+
+ // unbind any auto-closing hover listeners
+ self.$elProxy.off('.'+ self.namespace + '-autoClose');
+
+ // call our constructor custom callback function
+ self.options.functionAfter.call(self.$el, self.$el);
+
+ // call our method custom callbacks functions
+ finishCallbacks();
+ };
+
+ if (supportsTransitions()) {
+
+ self.$tooltip
+ .clearQueue()
+ .removeClass('tooltipster-' + self.options.animation + '-show')
+ // for transitions only
+ .addClass('tooltipster-dying');
+
+ if(self.options.speed > 0) self.$tooltip.delay(self.options.speed);
+
+ self.$tooltip.queue(finish);
+ }
+ else {
+ self.$tooltip
+ .stop()
+ .fadeOut(self.options.speed, finish);
+ }
+ }
+ // if the tooltip is already hidden, we still need to trigger the method custom callback
+ else if(self.Status == 'hidden') {
+ finishCallbacks();
+ }
+
+ return self;
+ },
+
+ // the public show() method is actually an alias for the private showNow() method
+ show: function(callback) {
+ this._showNow(callback);
+ return this;
+ },
+
+ // 'update' is deprecated in favor of 'content' but is kept for backward compatibility
+ update: function(c) {
+ return this.content(c);
+ },
+ content: function(c) {
+ // getter method
+ if(typeof c === 'undefined'){
+ return this.Content;
+ }
+ // setter method
+ else {
+ this._update(c);
+ return this;
+ }
+ },
+
+ reposition: function() {
+
+ var self = this;
+
+ // in case the tooltip has been removed from DOM manually
+ if ($('body').find(self.$tooltip).length !== 0) {
+
+ // reset width
+ self.$tooltip.css('width', '');
+
+ // find variables to determine placement
+ self.elProxyPosition = self._repositionInfo(self.$elProxy);
+ var arrowReposition = null,
+ windowWidth = $(window).width(),
+ // shorthand
+ proxy = self.elProxyPosition,
+ tooltipWidth = self.$tooltip.outerWidth(false),
+ tooltipInnerWidth = self.$tooltip.innerWidth() + 1, // this +1 stops FireFox from sometimes forcing an additional text line
+ tooltipHeight = self.$tooltip.outerHeight(false);
+
+ // if this is an <area> tag inside a <map>, all hell breaks loose. Recalculate all the measurements based on coordinates
+ if (self.$elProxy.is('area')) {
+ var areaShape = self.$elProxy.attr('shape'),
+ mapName = self.$elProxy.parent().attr('name'),
+ map = $('img[usemap="#'+ mapName +'"]'),
+ mapOffsetLeft = map.offset().left,
+ mapOffsetTop = map.offset().top,
+ areaMeasurements = self.$elProxy.attr('coords') !== undefined ? self.$elProxy.attr('coords').split(',') : undefined;
+
+ if (areaShape == 'circle') {
+ var areaLeft = parseInt(areaMeasurements[0]),
+ areaTop = parseInt(areaMeasurements[1]),
+ areaWidth = parseInt(areaMeasurements[2]);
+ proxy.dimension.height = areaWidth * 2;
+ proxy.dimension.width = areaWidth * 2;
+ proxy.offset.top = mapOffsetTop + areaTop - areaWidth;
+ proxy.offset.left = mapOffsetLeft + areaLeft - areaWidth;
+ }
+ else if (areaShape == 'rect') {
+ var areaLeft = parseInt(areaMeasurements[0]),
+ areaTop = parseInt(areaMeasurements[1]),
+ areaRight = parseInt(areaMeasurements[2]),
+ areaBottom = parseInt(areaMeasurements[3]);
+ proxy.dimension.height = areaBottom - areaTop;
+ proxy.dimension.width = areaRight - areaLeft;
+ proxy.offset.top = mapOffsetTop + areaTop;
+ proxy.offset.left = mapOffsetLeft + areaLeft;
+ }
+ else if (areaShape == 'poly') {
+ var areaXs = [],
+ areaYs = [],
+ areaSmallestX = 0,
+ areaSmallestY = 0,
+ areaGreatestX = 0,
+ areaGreatestY = 0,
+ arrayAlternate = 'even';
+
+ for (var i = 0; i < areaMeasurements.length; i++) {
+ var areaNumber = parseInt(areaMeasurements[i]);
+
+ if (arrayAlternate == 'even') {
+ if (areaNumber > areaGreatestX) {
+ areaGreatestX = areaNumber;
+ if (i === 0) {
+ areaSmallestX = areaGreatestX;
+ }
+ }
+
+ if (areaNumber < areaSmallestX) {
+ areaSmallestX = areaNumber;
+ }
+
+ arrayAlternate = 'odd';
+ }
+ else {
+ if (areaNumber > areaGreatestY) {
+ areaGreatestY = areaNumber;
+ if (i == 1) {
+ areaSmallestY = areaGreatestY;
+ }
+ }
+
+ if (areaNumber < areaSmallestY) {
+ areaSmallestY = areaNumber;
+ }
+
+ arrayAlternate = 'even';
+ }
+ }
+
+ proxy.dimension.height = areaGreatestY - areaSmallestY;
+ proxy.dimension.width = areaGreatestX - areaSmallestX;
+ proxy.offset.top = mapOffsetTop + areaSmallestY;
+ proxy.offset.left = mapOffsetLeft + areaSmallestX;
+ }
+ else {
+ proxy.dimension.height = map.outerHeight(false);
+ proxy.dimension.width = map.outerWidth(false);
+ proxy.offset.top = mapOffsetTop;
+ proxy.offset.left = mapOffsetLeft;
+ }
+ }
+
+ // our function and global vars for positioning our tooltip
+ var myLeft = 0,
+ myLeftMirror = 0,
+ myTop = 0,
+ offsetY = parseInt(self.options.offsetY),
+ offsetX = parseInt(self.options.offsetX),
+ // this is the arrow position that will eventually be used. It may differ from the position option if the tooltip cannot be displayed in this position
+ practicalPosition = self.options.position;
+
+ // a function to detect if the tooltip is going off the screen horizontally. If so, reposition the crap out of it!
+ function dontGoOffScreenX() {
+
+ var windowLeft = $(window).scrollLeft();
+
+ // if the tooltip goes off the left side of the screen, line it up with the left side of the window
+ if((myLeft - windowLeft) < 0) {
+ arrowReposition = myLeft - windowLeft;
+ myLeft = windowLeft;
+ }
+
+ // if the tooltip goes off the right of the screen, line it up with the right side of the window
+ if (((myLeft + tooltipWidth) - windowLeft) > windowWidth) {
+ arrowReposition = myLeft - ((windowWidth + windowLeft) - tooltipWidth);
+ myLeft = (windowWidth + windowLeft) - tooltipWidth;
+ }
+ }
+
+ // a function to detect if the tooltip is going off the screen vertically. If so, switch to the opposite!
+ function dontGoOffScreenY(switchTo, switchFrom) {
+ // if it goes off the top off the page
+ if(((proxy.offset.top - $(window).scrollTop() - tooltipHeight - offsetY - 12) < 0) && (switchFrom.indexOf('top') > -1)) {
+ practicalPosition = switchTo;
+ }
+
+ // if it goes off the bottom of the page
+ if (((proxy.offset.top + proxy.dimension.height + tooltipHeight + 12 + offsetY) > ($(window).scrollTop() + $(window).height())) && (switchFrom.indexOf('bottom') > -1)) {
+ practicalPosition = switchTo;
+ myTop = (proxy.offset.top - tooltipHeight) - offsetY - 12;
+ }
+ }
+
+ if(practicalPosition == 'top') {
+ var leftDifference = (proxy.offset.left + tooltipWidth) - (proxy.offset.left + proxy.dimension.width);
+ myLeft = (proxy.offset.left + offsetX) - (leftDifference / 2);
+ myTop = (proxy.offset.top - tooltipHeight) - offsetY - 12;
+ dontGoOffScreenX();
+ dontGoOffScreenY('bottom', 'top');
+ }
+
+ if(practicalPosition == 'top-left') {
+ myLeft = proxy.offset.left + offsetX;
+ myTop = (proxy.offset.top - tooltipHeight) - offsetY - 12;
+ dontGoOffScreenX();
+ dontGoOffScreenY('bottom-left', 'top-left');
+ }
+
+ if(practicalPosition == 'top-right') {
+ myLeft = (proxy.offset.left + proxy.dimension.width + offsetX) - tooltipWidth;
+ myTop = (proxy.offset.top - tooltipHeight) - offsetY - 12;
+ dontGoOffScreenX();
+ dontGoOffScreenY('bottom-right', 'top-right');
+ }
+
+ if(practicalPosition == 'bottom') {
+ var leftDifference = (proxy.offset.left + tooltipWidth) - (proxy.offset.left + proxy.dimension.width);
+ myLeft = proxy.offset.left - (leftDifference / 2) + offsetX;
+ myTop = (proxy.offset.top + proxy.dimension.height) + offsetY + 12;
+ dontGoOffScreenX();
+ dontGoOffScreenY('top', 'bottom');
+ }
+
+ if(practicalPosition == 'bottom-left') {
+ myLeft = proxy.offset.left + offsetX;
+ myTop = (proxy.offset.top + proxy.dimension.height) + offsetY + 12;
+ dontGoOffScreenX();
+ dontGoOffScreenY('top-left', 'bottom-left');
+ }
+
+ if(practicalPosition == 'bottom-right') {
+ myLeft = (proxy.offset.left + proxy.dimension.width + offsetX) - tooltipWidth;
+ myTop = (proxy.offset.top + proxy.dimension.height) + offsetY + 12;
+ dontGoOffScreenX();
+ dontGoOffScreenY('top-right', 'bottom-right');
+ }
+
+ if(practicalPosition == 'left') {
+ myLeft = proxy.offset.left - offsetX - tooltipWidth - 12;
+ myLeftMirror = proxy.offset.left + offsetX + proxy.dimension.width + 12;
+ var topDifference = (proxy.offset.top + tooltipHeight) - (proxy.offset.top + proxy.dimension.height);
+ myTop = proxy.offset.top - (topDifference / 2) - offsetY;
+
+ // if the tooltip goes off boths sides of the page
+ if((myLeft < 0) && ((myLeftMirror + tooltipWidth) > windowWidth)) {
+ var borderWidth = parseFloat(self.$tooltip.css('border-width')) * 2,
+ newWidth = (tooltipWidth + myLeft) - borderWidth;
+ self.$tooltip.css('width', newWidth + 'px');
+
+ tooltipHeight = self.$tooltip.outerHeight(false);
+ myLeft = proxy.offset.left - offsetX - newWidth - 12 - borderWidth;
+ topDifference = (proxy.offset.top + tooltipHeight) - (proxy.offset.top + proxy.dimension.height);
+ myTop = proxy.offset.top - (topDifference / 2) - offsetY;
+ }
+
+ // if it only goes off one side, flip it to the other side
+ else if(myLeft < 0) {
+ myLeft = proxy.offset.left + offsetX + proxy.dimension.width + 12;
+ arrowReposition = 'left';
+ }
+ }
+
+ if(practicalPosition == 'right') {
+ myLeft = proxy.offset.left + offsetX + proxy.dimension.width + 12;
+ myLeftMirror = proxy.offset.left - offsetX - tooltipWidth - 12;
+ var topDifference = (proxy.offset.top + tooltipHeight) - (proxy.offset.top + proxy.dimension.height);
+ myTop = proxy.offset.top - (topDifference / 2) - offsetY;
+
+ // if the tooltip goes off boths sides of the page
+ if(((myLeft + tooltipWidth) > windowWidth) && (myLeftMirror < 0)) {
+ var borderWidth = parseFloat(self.$tooltip.css('border-width')) * 2,
+ newWidth = (windowWidth - myLeft) - borderWidth;
+ self.$tooltip.css('width', newWidth + 'px');
+
+ tooltipHeight = self.$tooltip.outerHeight(false);
+ topDifference = (proxy.offset.top + tooltipHeight) - (proxy.offset.top + proxy.dimension.height);
+ myTop = proxy.offset.top - (topDifference / 2) - offsetY;
+ }
+
+ // if it only goes off one side, flip it to the other side
+ else if((myLeft + tooltipWidth) > windowWidth) {
+ myLeft = proxy.offset.left - offsetX - tooltipWidth - 12;
+ arrowReposition = 'right';
+ }
+ }
+
+ // if arrow is set true, style it and append it
+ if (self.options.arrow) {
+
+ var arrowClass = 'tooltipster-arrow-' + practicalPosition;
+
+ // set color of the arrow
+ if(self.options.arrowColor.length < 1) {
+ var arrowColor = self.$tooltip.css('background-color');
+ }
+ else {
+ var arrowColor = self.options.arrowColor;
+ }
+
+ // if the tooltip was going off the page and had to re-adjust, we need to update the arrow's position
+ if (!arrowReposition) {
+ arrowReposition = '';
+ }
+ else if (arrowReposition == 'left') {
+ arrowClass = 'tooltipster-arrow-right';
+ arrowReposition = '';
+ }
+ else if (arrowReposition == 'right') {
+ arrowClass = 'tooltipster-arrow-left';
+ arrowReposition = '';
+ }
+ else {
+ arrowReposition = 'left:'+ Math.round(arrowReposition) +'px;';
+ }
+
+ // building the logic to create the border around the arrow of the tooltip
+ if ((practicalPosition == 'top') || (practicalPosition == 'top-left') || (practicalPosition == 'top-right')) {
+ var tooltipBorderWidth = parseFloat(self.$tooltip.css('border-bottom-width')),
+ tooltipBorderColor = self.$tooltip.css('border-bottom-color');
+ }
+ else if ((practicalPosition == 'bottom') || (practicalPosition == 'bottom-left') || (practicalPosition == 'bottom-right')) {
+ var tooltipBorderWidth = parseFloat(self.$tooltip.css('border-top-width')),
+ tooltipBorderColor = self.$tooltip.css('border-top-color');
+ }
+ else if (practicalPosition == 'left') {
+ var tooltipBorderWidth = parseFloat(self.$tooltip.css('border-right-width')),
+ tooltipBorderColor = self.$tooltip.css('border-right-color');
+ }
+ else if (practicalPosition == 'right') {
+ var tooltipBorderWidth = parseFloat(self.$tooltip.css('border-left-width')),
+ tooltipBorderColor = self.$tooltip.css('border-left-color');
+ }
+ else {
+ var tooltipBorderWidth = parseFloat(self.$tooltip.css('border-bottom-width')),
+ tooltipBorderColor = self.$tooltip.css('border-bottom-color');
+ }
+
+ if (tooltipBorderWidth > 1) {
+ tooltipBorderWidth++;
+ }
+
+ var arrowBorder = '';
+ if (tooltipBorderWidth !== 0) {
+ var arrowBorderSize = '',
+ arrowBorderColor = 'border-color: '+ tooltipBorderColor +';';
+ if (arrowClass.indexOf('bottom') !== -1) {
+ arrowBorderSize = 'margin-top: -'+ Math.round(tooltipBorderWidth) +'px;';
+ }
+ else if (arrowClass.indexOf('top') !== -1) {
+ arrowBorderSize = 'margin-bottom: -'+ Math.round(tooltipBorderWidth) +'px;';
+ }
+ else if (arrowClass.indexOf('left') !== -1) {
+ arrowBorderSize = 'margin-right: -'+ Math.round(tooltipBorderWidth) +'px;';
+ }
+ else if (arrowClass.indexOf('right') !== -1) {
+ arrowBorderSize = 'margin-left: -'+ Math.round(tooltipBorderWidth) +'px;';
+ }
+ arrowBorder = '<span class="tooltipster-arrow-border" style="'+ arrowBorderSize +' '+ arrowBorderColor +';"></span>';
+ }
+
+ // if the arrow already exists, remove and replace it
+ self.$tooltip.find('.tooltipster-arrow').remove();
+
+ // build out the arrow and append it
+ var arrowConstruct = '<div class="'+ arrowClass +' tooltipster-arrow" style="'+ arrowReposition +'">'+ arrowBorder +'<span style="border-color:'+ arrowColor +';"></span></div>';
+ self.$tooltip.append(arrowConstruct);
+ }
+
+ // position the tooltip
+ self.$tooltip.css({'top': Math.round(myTop) + 'px', 'left': Math.round(myLeft) + 'px'});
+ }
+
+ return self;
+ },
+
+ enable: function() {
+ this.enabled = true;
+ return this;
+ },
+
+ disable: function() {
+ // hide first, in case the tooltip would not disappear on its own (autoClose false)
+ this.hide();
+ this.enabled = false;
+ return this;
+ },
+
+ destroy: function() {
+
+ var self = this;
+
+ self.hide();
+
+ // remove the icon, if any
+ if (self.$el[0] !== self.$elProxy[0]) {
+ self.$elProxy.remove();
+ }
+
+ self.$el
+ .removeData(self.namespace)
+ .off('.'+ self.namespace);
+
+ var ns = self.$el.data('tooltipster-ns');
+
+ // if there are no more tooltips on this element
+ if(ns.length === 1){
+
+ // optional restoration of a title attribute
+ var title = null;
+ if (self.options.restoration === 'previous'){
+ title = self.$el.data('tooltipster-initialTitle');
+ }
+ else if(self.options.restoration === 'current'){
+
+ // old school technique to stringify when outerHTML is not supported
+ title =
+ (typeof self.Content === 'string') ?
+ self.Content :
+ $('<div></div>').append(self.Content).html();
+ }
+
+ if (title) {
+ self.$el.attr('title', title);
+ }
+
+ // final cleaning
+ self.$el
+ .removeClass('tooltipstered')
+ .removeData('tooltipster-ns')
+ .removeData('tooltipster-initialTitle');
+ }
+ else {
+ // remove the instance namespace from the list of namespaces of tooltips present on the element
+ ns = $.grep(ns, function(el, i){
+ return el !== self.namespace;
+ });
+ self.$el.data('tooltipster-ns', ns);
+ }
+
+ return self;
+ },
+
+ elementIcon: function() {
+ return (this.$el[0] !== this.$elProxy[0]) ? this.$elProxy[0] : undefined;
+ },
+
+ elementTooltip: function() {
+ return this.$tooltip ? this.$tooltip[0] : undefined;
+ },
+
+ // public methods but for internal use only
+ // getter if val is ommitted, setter otherwise
+ option: function(o, val) {
+ if (typeof val == 'undefined') return this.options[o];
+ else {
+ this.options[o] = val;
+ return this;
+ }
+ },
+ status: function() {
+ return this.Status;
+ }
+ };
+
+ $.fn[pluginName] = function () {
+
+ // for using in closures
+ var args = arguments;
+
+ // if we are not in the context of jQuery wrapped HTML element(s) :
+ // this happens when calling static methods in the form $.fn.tooltipster('methodName'), or when calling $(sel).tooltipster('methodName or options') where $(sel) does not match anything
+ if (this.length === 0) {
+
+ // if the first argument is a method name
+ if (typeof args[0] === 'string') {
+
+ var methodIsStatic = true;
+
+ // list static methods here (usable by calling $.fn.tooltipster('methodName');)
+ switch (args[0]) {
+
+ case 'setDefaults':
+ // change default options for all future instances
+ $.extend(defaults, args[1]);
+ break;
+
+ default:
+ methodIsStatic = false;
+ break;
+ }
+
+ // $.fn.tooltipster('methodName') calls will return true
+ if (methodIsStatic) return true;
+ // $(sel).tooltipster('methodName') calls will return the list of objects event though it's empty because chaining should work on empty lists
+ else return this;
+ }
+ // the first argument is undefined or an object of options : we are initalizing but there is no element matched by selector
+ else {
+ // still chainable : same as above
+ return this;
+ }
+ }
+ // this happens when calling $(sel).tooltipster('methodName or options') where $(sel) matches one or more elements
+ else {
+
+ // method calls
+ if (typeof args[0] === 'string') {
+
+ var v = '#*$~&';
+
+ this.each(function() {
+
+ // retrieve the namepaces of the tooltip(s) that exist on that element. We will interact with the first tooltip only.
+ var ns = $(this).data('tooltipster-ns'),
+ // self represents the instance of the first tooltipster plugin associated to the current HTML object of the loop
+ self = ns ? $(this).data(ns[0]) : null;
+
+ // if the current element holds a tooltipster instance
+ if (self) {
+
+ if (typeof self[args[0]] === 'function') {
+ // note : args[1] and args[2] may not be defined
+ var resp = self[args[0]](args[1], args[2]);
+ }
+ else {
+ throw new Error('Unknown method .tooltipster("' + args[0] + '")');
+ }
+
+ // if the function returned anything other than the instance itself (which implies chaining)
+ if (resp !== self){
+ v = resp;
+ // return false to stop .each iteration on the first element matched by the selector
+ return false;
+ }
+ }
+ else {
+ throw new Error('You called Tooltipster\'s "' + args[0] + '" method on an uninitialized element');
+ }
+ });
+
+ return (v !== '#*$~&') ? v : this;
+ }
+ // first argument is undefined or an object : the tooltip is initializing
+ else {
+
+ var instances = [],
+ // is there a defined value for the multiple option in the options object ?
+ multipleIsSet = args[0] && typeof args[0].multiple !== 'undefined',
+ // if the multiple option is set to true, or if it's not defined but set to true in the defaults
+ multiple = (multipleIsSet && args[0].multiple) || (!multipleIsSet && defaults.multiple),
+ // same for debug
+ debugIsSet = args[0] && typeof args[0].debug !== 'undefined',
+ debug = (debugIsSet && args[0].debug) || (!debugIsSet && defaults.debug);
+
+ // initialize a tooltipster instance for each element if it doesn't already have one or if the multiple option is set, and attach the object to it
+ this.each(function () {
+
+ var go = false,
+ ns = $(this).data('tooltipster-ns'),
+ instance = null;
+
+ if (!ns) {
+ go = true;
+ }
+ else if (multiple) {
+ go = true;
+ }
+ else if (debug) {
+ console.log('Tooltipster: one or more tooltips are already attached to this element: ignoring. Use the "multiple" option to attach more tooltips.');
+ }
+
+ if (go) {
+ instance = new Plugin(this, args[0]);
+
+ // save the reference of the new instance
+ if (!ns) ns = [];
+ ns.push(instance.namespace);
+ $(this).data('tooltipster-ns', ns)
+
+ // save the instance itself
+ $(this).data(instance.namespace, instance);
+ }
+
+ instances.push(instance);
+ });
+
+ if (multiple) return instances;
+ else return this;
+ }
+ }
+ };
+
+ // quick & dirty compare function (not bijective nor multidimensional)
+ function areEqual(a,b) {
+ var same = true;
+ $.each(a, function(i, el){
+ if(typeof b[i] === 'undefined' || a[i] !== b[i]){
+ same = false;
+ return false;
+ }
+ });
+ return same;
+ }
+
+ // detect if this device can trigger touch events
+ var deviceHasTouchCapability = !!('ontouchstart' in window);
+
+ // we'll assume the device has no mouse until we detect any mouse movement
+ var deviceHasMouse = false;
+ $('body').one('mousemove', function() {
+ deviceHasMouse = true;
+ });
+
+ function deviceIsPureTouch() {
+ return (!deviceHasMouse && deviceHasTouchCapability);
+ }
+
+ // detecting support for CSS transitions
+ function supportsTransitions() {
+ var b = document.body || document.documentElement,
+ s = b.style,
+ p = 'transition';
+
+ if(typeof s[p] == 'string') {return true; }
+
+ v = ['Moz', 'Webkit', 'Khtml', 'O', 'ms'],
+ p = p.charAt(0).toUpperCase() + p.substr(1);
+ for(var i=0; i<v.length; i++) {
+ if(typeof s[v[i] + p] == 'string') { return true; }
+ }
+ return false;
+ }
+})( jQuery, window, document );
[14/26] allura git commit: [#7806] ticket:778 Add conteiners for
in/out mail
Posted by he...@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/hs/7885
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
[16/26] allura git commit: [#7806] ticket:778 Add docker docs
Posted by he...@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/hs/7885
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