Commit b81115fa authored by Vivien Alger's avatar Vivien Alger

Merge branch 'etherpad-lite' into davstorage-ajaxplorer

parents 771cc32f 2c5f0da3
...@@ -84,6 +84,7 @@ setup(name=name, ...@@ -84,6 +84,7 @@ setup(name=name,
'certificate_authority = slapos.recipe.certificate_authority:Recipe', 'certificate_authority = slapos.recipe.certificate_authority:Recipe',
'certificate_authority.request = slapos.recipe.certificate_authority:Request', 'certificate_authority.request = slapos.recipe.certificate_authority:Request',
'check_page_content = slapos.recipe.check_page_content:Recipe', 'check_page_content = slapos.recipe.check_page_content:Recipe',
'check_page_content_phantomjs = slapos.recipe.check_page_content:PhantomJSRecipe',
'check_port_listening = slapos.recipe.check_port_listening:Recipe', 'check_port_listening = slapos.recipe.check_port_listening:Recipe',
'check_url_available = slapos.recipe.check_url_available:Recipe', 'check_url_available = slapos.recipe.check_url_available:Recipe',
'cloud9 = slapos.recipe.cloud9:Recipe', 'cloud9 = slapos.recipe.cloud9:Recipe',
......
...@@ -49,3 +49,26 @@ class Recipe(GenericBaseRecipe): ...@@ -49,3 +49,26 @@ class Recipe(GenericBaseRecipe):
) )
return [promise] return [promise]
class PhantomJSRecipe(GenericBaseRecipe):
"""
Create script for checking page content at url with js script
"""
def install(self):
config = {
'script-path': self.options['script-path'].strip(),
'dash-path': self.options['dash-path'].strip(),
'phantomjs-path': self.options['phantomjs-path'].strip(),
'phantomjs-options': self.options.get('phantomjs-options','')
}
promise = self.createExecutable(
self.options['path'].strip(),
self.substituteTemplate(
self.getTemplateFilename('check_page_content_phantomjs.in'),
config
)
)
return [promise]
\ No newline at end of file
#!%(dash-path)s
# BEWARE: This file is operated by slapgrid
# BEWARE: It will be overwritten automatically
%(phantomjs-path)s %(phantomjs-options)s %(script-path)s
if [ $? != 0 ]; then
echo "PhantomJS script returned non zero output" >&2
exit 1
fi
\ No newline at end of file
...@@ -16,13 +16,18 @@ extends = ...@@ -16,13 +16,18 @@ extends =
../../component/git/buildout.cfg ../../component/git/buildout.cfg
../../component/nodejs/buildout.cfg ../../component/nodejs/buildout.cfg
../../component/postgresql/buildout.cfg ../../component/postgresql/buildout.cfg
../../component/phantomjs/buildout.cfg
parts = parts =
postgresql postgresql
nodejs nodejs
phantomjs
etherpad-lite-repository etherpad-lite-repository
install-deps install-deps
template template
template-html10n
template-index-promise-js
template-pad-promise-js
lxml-python lxml-python
eggs eggs
instance-recipe-egg instance-recipe-egg
...@@ -59,16 +64,24 @@ mode = 0644 ...@@ -59,16 +64,24 @@ mode = 0644
[instance-etherpad-lite] [instance-etherpad-lite]
recipe = slapos.recipe.template recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-etherpad-lite.cfg url = ${:_profile_base_location_}/instance-etherpad-lite.cfg
md5sum = 64ae9271f20e432ddc0516fe1bb17076 md5sum = dea0ee49ff3a87bd146e3d6bd6d68167
output = ${buildout:directory}/template-etherpad-lite.cfg output = ${buildout:directory}/template-etherpad-lite.cfg
mode = 0644 mode = 0644
[template-html10n]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/templates/${:filename}
filename = html10n.js
mode = 0644
md5sum = 6f90afdcc50bb5020896c95162d83834
output = ${etherpad-lite-repository:location}/src/static/js/${:filename}
[template-conf] [template-conf]
recipe = slapos.recipe.download recipe = slapos.recipe.download
url = ${:_profile_base_location_}/templates/${:filename} url = ${:_profile_base_location_}/templates/${:filename}
mode = 0644 mode = 0644
filename = settings.json.in filename = settings.json.in
md5sum = f9baee09003676fc1141f9bf4481f6a3 md5sum = d95264e66e2691b094d40a65d88ce681
location = ${buildout:parts-directory}/${:_buildout_section_name_} location = ${buildout:parts-directory}/${:_buildout_section_name_}
[template-run-script] [template-run-script]
...@@ -96,5 +109,21 @@ recipe = plone.recipe.command ...@@ -96,5 +109,21 @@ recipe = plone.recipe.command
command = ${template-deps-script:output} command = ${template-deps-script:output}
update-command = command update-command = command
[template-index-promise-js]
recipe = slapos.recipe.download
url = ${:_profile_base_location_}/templates/${:filename}
filename = test-index.js.in
mode = 0644
md5sum = 7ee12b1c284c2c6260689b21bb35176e
location = ${buildout:parts-directory}/${:_buildout_section_name_}
[template-pad-promise-js]
recipe = slapos.recipe.download
url = ${:_profile_base_location_}/templates/${:filename}
filename = test-pad.js.in
mode = 0644
md5sum = 43dc2ee94e65cc7f5fa4c3d6a868eebe
location = ${buildout:parts-directory}/${:_buildout_section_name_}
[lxml-python] [lxml-python]
python = python2.7 python = python2.7
...@@ -2,6 +2,9 @@ ...@@ -2,6 +2,9 @@
parts = parts =
etherpad-lite etherpad-lite
publish-connection-informations publish-connection-informations
check-index-promise
# XXX-Vivien: postponed till we can make it fast enough
# check-pad-promise
eggs-directory = ${buildout:eggs-directory} eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory} develop-eggs-directory = ${buildout:develop-eggs-directory}
...@@ -27,10 +30,11 @@ promises = $${rootdirectory:etc}/promise/ ...@@ -27,10 +30,11 @@ promises = $${rootdirectory:etc}/promise/
recipe = slapos.cookbook:mkdirectory recipe = slapos.cookbook:mkdirectory
etherpad-conf = $${rootdirectory:etc}/etherpad/ etherpad-conf = $${rootdirectory:etc}/etherpad/
etherpad-repository-location = $${buildout:directory}/parts/etherpad-lite-repository etherpad-repository-location = $${buildout:directory}/parts/etherpad-lite-repository
promise-js = $${rootdirectory:etc}/js/
[publish-connection-informations] [publish-connection-informations]
recipe = slapos.cookbook:publish recipe = slapos.cookbook:publish
url = $${request-frontend:connection-site_url} url = $${request-frontend:config-url}
[etherpad-conf-generation] [etherpad-conf-generation]
recipe = slapos.recipe.template recipe = slapos.recipe.template
...@@ -38,6 +42,7 @@ url = ${template-conf:location}/${template-conf:filename} ...@@ -38,6 +42,7 @@ url = ${template-conf:location}/${template-conf:filename}
ip = $${slap-network-information:global-ipv6} ip = $${slap-network-information:global-ipv6}
dirtydb-location = $${rootdirectory:var}/dirty.db dirtydb-location = $${rootdirectory:var}/dirty.db
port = 9001 port = 9001
welcome-message = Bienvenue sur Etherpad!\n\nLe texte que vous écrivez est synchronisez en ce moment même, pour que tout le monde puisse voir la page avec le même texte. Cela vous permet de collaborer sur des documents sans aucun problème!\n
mode = 0644 mode = 0644
output = $${directory:etherpad-conf}/settings.json output = $${directory:etherpad-conf}/settings.json
...@@ -67,5 +72,34 @@ name = Frontend ...@@ -67,5 +72,34 @@ name = Frontend
software-url = http://git.erp5.org/gitweb/slapos.git/blob_plain/HEAD:/software/apache-frontend/software.cfg software-url = http://git.erp5.org/gitweb/slapos.git/blob_plain/HEAD:/software/apache-frontend/software.cfg
slave = true slave = true
config = url config = url
config-url = http://$${etherpad-conf-generation:ip}:$${etherpad-conf-generation:port} config-url = http://[$${etherpad-conf-generation:ip}]:$${etherpad-conf-generation:port}
return = site_url return = site_url
[index-promise-js]
recipe = slapos.recipe.template
url = ${template-index-promise-js:location}/${template-index-promise-js:filename}
content-url = $${publish-connection-informations:url}
mode = 0644
output = $${directory:promise-js}/test-index.js
[pad-promise-js]
recipe = slapos.recipe.template
url = ${template-pad-promise-js:location}/${template-pad-promise-js:filename}
content-url = $${publish-connection-informations:url}
welcome-message = $${etherpad-conf-generation:welcome-message}
mode = 0644
output = $${directory:promise-js}/test-pad.js
[check-index-promise]
recipe = slapos.cookbook:check_page_content_phantomjs
path = $${basedirectory:promises}/check-index-promise
dash-path = ${dash:location}/bin/dash
phantomjs-path = ${phantomjs:location}/phantomjs-slapos
script-path = $${index-promise-js:output}
[check-pad-promise]
recipe = slapos.cookbook:check_page_content_phantomjs
path = $${basedirectory:promises}/check-pad-promise
dash-path = ${dash:location}/bin/dash
phantomjs-path = ${phantomjs:location}/phantomjs-slapos
script-path = $${pad-promise-js:output}
\ No newline at end of file
...@@ -15,7 +15,8 @@ develop = ...@@ -15,7 +15,8 @@ develop =
recipe = slapos.recipe.build:gitclone recipe = slapos.recipe.build:gitclone
repository = http://git.erp5.org/repos/slapos.git repository = http://git.erp5.org/repos/slapos.git
git-executable = ${git:location}/bin/git git-executable = ${git:location}/bin/git
revision = 45243101321daeecaf755b9788b11259dd6bdfff #revision = 45243101321daeecaf755b9788b11259dd6bdfff
branch = etherpad-lite
[slapos.toolbox-repository] [slapos.toolbox-repository]
recipe = slapos.recipe.build:gitclone recipe = slapos.recipe.build:gitclone
......
This diff is collapsed.
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
*/ */
//the default text of a pad //the default text of a pad
"defaultPadText" : "Bienvenue sur Etherpad!\n\nLe texte que vous écrivez est synchronisez en ce moment même, pour que tout le monde puisse voir la page avec le même texte. Cela vous permet de collaborer sur des documents sans aucun problème!\n", "defaultPadText" : "${:welcome-message}",
/* Users must have a session to access pads. This effectively allows only group pads to be accessed. */ /* Users must have a session to access pads. This effectively allows only group pads to be accessed. */
"requireSession" : false, "requireSession" : false,
......
var page = require('webpage').create();
url = '${:content-url}'
page.open(url, function (status) {
var text = page.evaluate(function(){
return document.getElementById('button').textContent
});
if(text !== "" && text !== null) {
phantom.exit();
} else {
phantom.exit(1);
}
});
var page = require('webpage').create();
url = '${:content-url}/p/test'
page.open(url, function (status) {
setTimeout(function(){
var text = page.evaluate(function(){
var container = document.getElementById('editorcontainer');
var iframe = container.firstChild;
container = iframe.contentDocument.getElementById('outerdocbody');
iframe = container.firstChild;
container = iframe.contentDocument.getElementById('innerdocbody');
return container.textContent;
});
if (text === null) {
phantom.exit();
} else {
phantom.exit(1);
}
},2500);
});
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment