Commit f3dc178f authored by Rafael Monnerat's avatar Rafael Monnerat

slaprunner: Remove git server features from webrunner.

parent 7bf2cf5a
...@@ -139,17 +139,6 @@ Example : ...@@ -139,17 +139,6 @@ Example :
<parameter id="custom-frontend-basic-auth">true</parameter> <parameter id="custom-frontend-basic-auth">true</parameter>
</instance> </instance>
Git repositories :
------------------
It is easy to give access to your git repository/ies to everyone, or to clone it on your own computer. For this, fetch the git_url parameter returned by your webrunner instance. It should look like that : https://[IPV6]:PORT/git/YourRepo.git/
To create the repo, go to the folder srv/runner/project and initiate a new git repo (git init/clone --bare YourRepo). Then, to clone the repo, just append its name to the previous URL.
Please notice that your repositories are in public access for reading. However, an account is needed to push to the repository (use your webrunner account, or create a new user in the parameters section of the webrunner).
For the moment, the PORT is the port of monitoring, which is 9685.
Things to notice for the nex developer : Things to notice for the nex developer :
---------------------------------------- ----------------------------------------
......
...@@ -18,7 +18,7 @@ md5sum = 8d6878ff1d2e75010c50a1a2b0c13b24 ...@@ -18,7 +18,7 @@ md5sum = 8d6878ff1d2e75010c50a1a2b0c13b24
[template-runner] [template-runner]
filename = instance-runner.cfg filename = instance-runner.cfg
md5sum = 7100c6678576c285322f1445029cd4f2 md5sum = 46b998f29f5d990d5f2281dd2cbca81d
[template-runner-import-script] [template-runner-import-script]
filename = template/runner-import.sh.jinja2 filename = template/runner-import.sh.jinja2
...@@ -34,7 +34,7 @@ md5sum = b992bb3391de9d6d422bfa8011d8ffc4 ...@@ -34,7 +34,7 @@ md5sum = b992bb3391de9d6d422bfa8011d8ffc4
[template-resilient] [template-resilient]
filename = instance-resilient.cfg.jinja2 filename = instance-resilient.cfg.jinja2
md5sum = 105ed7f54f251c64a2d34559360a5604 md5sum = bd0ad0b80d2b39189f9665c48f1b3830
[template_nginx_conf] [template_nginx_conf]
filename = nginx_conf.in filename = nginx_conf.in
...@@ -42,7 +42,7 @@ md5sum = 2b06f7eb9a1d45d250d4b92a944db925 ...@@ -42,7 +42,7 @@ md5sum = 2b06f7eb9a1d45d250d4b92a944db925
[template_httpd_conf] [template_httpd_conf]
filename = httpd_conf.in filename = httpd_conf.in
md5sum = 40825ef2d259ae3b86dfd2f28f597d3a md5sum = 1d96c29b931383b2a87b9ae049d07d74
[template_launcher] [template_launcher]
filename = launcher.in filename = launcher.in
......
...@@ -96,33 +96,3 @@ Alias /share {{ parameters.runner_home }} ...@@ -96,33 +96,3 @@ Alias /share {{ parameters.runner_home }}
</LimitExcept> </LimitExcept>
</Directory> </Directory>
SetEnv GIT_HTTP_EXPORT_ALL
ScriptSock {{ parameters.cgid_sock }}
ScriptAlias /git/ {{ parameters.git_http_backend }}/
ScriptAlias /git-public/ {{ parameters.git_http_backend }}/
RewriteCond %{QUERY_STRING} service=git-receive-pack [OR]
RewriteCond %{REQUEST_URI} /git-receive-pack$
<LocationMatch "^/git/">
SetEnv GIT_PROJECT_ROOT {{ parameters.project_private_folder }}
Order Deny,Allow
Deny from env=AUTHREQUIRED
AuthType Basic
AuthName "Git Access"
AuthUserFile "{{ parameters.htpasswd_file }}"
Require valid-user
</LocationMatch>
<LocationMatch "^/git-public/">
SetEnv GIT_PROJECT_ROOT {{ parameters.project_public_folder }}
Order Deny,Allow
Deny from env=AUTHREQUIRED
AuthType Basic
AuthName "Git Access"
AuthUserFile "{{ parameters.htpasswd_file }}"
Require valid-user
Satisfy any
</LocationMatch>
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
{% set number_of_instances = 2 %} {% set number_of_instances = 2 %}
{% endif %} {% endif %}
{% set slaprunner_return = ['init-user', 'init-password', 'url', 'ssh-public-key', 'resilient-ssh-url', 'notification-id', 'ip', 'backend-url', 'url', 'ssh-url', 'ssh-command', 'webdav-url', 'public-url', 'git-public-url', 'git-private-url'] -%} {% set slaprunner_return = ['init-user', 'init-password', 'url', 'ssh-public-key', 'resilient-ssh-url', 'notification-id', 'ip', 'backend-url', 'url', 'ssh-url', 'ssh-command', 'webdav-url', 'public-url'] -%}
{% set monitor_return = ['monitor-base-url', 'monitor-url', 'monitor-user', 'monitor-password'] -%} {% set monitor_return = ['monitor-base-url', 'monitor-url', 'monitor-user', 'monitor-password'] -%}
{% set monitor_parameter = {'monitor-cors-domains': slapparameter_dict.pop('monitor-cors-domains', "monitor.app.officejs.com")} -%} {% set monitor_parameter = {'monitor-cors-domains': slapparameter_dict.pop('monitor-cors-domains', "monitor.app.officejs.com")} -%}
{% set monitor_dict = {'parameter': monitor_parameter, 'return': monitor_return, 'set-monitor-url': True} -%} {% set monitor_dict = {'parameter': monitor_parameter, 'return': monitor_return, 'set-monitor-url': True} -%}
...@@ -72,8 +72,6 @@ init-password = ${publish-early:init-password} ...@@ -72,8 +72,6 @@ init-password = ${publish-early:init-password}
ssh-command = ${request-runner:connection-ssh-command} ssh-command = ${request-runner:connection-ssh-command}
webdav-url = ${request-runner:connection-webdav-url} webdav-url = ${request-runner:connection-webdav-url}
public-url = ${request-runner:connection-public-url} public-url = ${request-runner:connection-public-url}
git-public-url = ${request-runner:connection-git-public-url}
git-private-url = ${request-runner:connection-git-private-url}
{% if slapparameter_dict.get('custom-frontend-backend-url') -%} {% if slapparameter_dict.get('custom-frontend-backend-url') -%}
custom-frontend-url = ${request-runner:connection-custom-frontend-url} custom-frontend-url = ${request-runner:connection-custom-frontend-url}
{% endif %} {% endif %}
......
...@@ -29,14 +29,6 @@ ...@@ -29,14 +29,6 @@
"public_url": { "public_url": {
"description": "Url of the public folder of your runner", "description": "Url of the public folder of your runner",
"type": "string" "type": "string"
},
"git_public_url": {
"description": "Public url of your repositories.",
"type": "string"
},
"git_private_url": {
"description": "Private url for your repositories. You can use it to push.",
"type": "string"
} }
}, },
"type": "object" "type": "object"
......
...@@ -151,8 +151,6 @@ project-test = $${:test}/project ...@@ -151,8 +151,6 @@ project-test = $${:test}/project
software-test = $${:test}/software software-test = $${:test}/software
instance-test = $${:test}/instance instance-test = $${:test}/instance
sessions = $${buildout:directory}/.sessions sessions = $${buildout:directory}/.sessions
private-project = $${:home}/.git-private
public-project = $${:home}/.git-public
[slaprunner] [slaprunner]
slaprunner = ${buildout:bin-directory}/slaprunner slaprunner = ${buildout:bin-directory}/slaprunner
...@@ -389,11 +387,7 @@ htpasswd_file = $${directory:etc}/.htpasswd ...@@ -389,11 +387,7 @@ htpasswd_file = $${directory:etc}/.htpasswd
etc_dir = $${directory:etc} etc_dir = $${directory:etc}
var_dir = $${directory:var} var_dir = $${directory:var}
project_folder = $${directory:project} project_folder = $${directory:project}
project_private_folder = $${runnerdirectory:private-project}
project_public_folder = $${runnerdirectory:public-project}
runner_home = $${runnerdirectory:home} runner_home = $${runnerdirectory:home}
git_http_backend = ${git:location}/libexec/git-core/git-http-backend
cgid_sock = $${directory:run}/cgid.sock
httpd_cors_file = $${slaprunner-httpd-cors:location} httpd_cors_file = $${slaprunner-httpd-cors:location}
[httpd-conf] [httpd-conf]
...@@ -591,8 +585,6 @@ init-user = $${runner-htpasswd:user} ...@@ -591,8 +585,6 @@ init-user = $${runner-htpasswd:user}
init-password = $${runner-htpasswd:password} init-password = $${runner-htpasswd:password}
ssh-command = ssh $${user-info:pw-name}@$${slap-network-information:global-ipv6} -p $${runner-sshd-port:port} ssh-command = ssh $${user-info:pw-name}@$${slap-network-information:global-ipv6} -p $${runner-sshd-port:port}
ssh-url = ssh://$${user-info:pw-name};fingerprint=$${runner-sshd-publickey-fingerprint:fingerprint}@[$${slap-network-information:global-ipv6}]:$${runner-sshd-port:port} ssh-url = ssh://$${user-info:pw-name};fingerprint=$${runner-sshd-publickey-fingerprint:fingerprint}@[$${slap-network-information:global-ipv6}]:$${runner-sshd-port:port}
git-public-url = https://[$${httpd-parameters:global_ip}]:$${httpd-parameters:global_port}/git-public/
git-private-url = https://[$${httpd-parameters:global_ip}]:$${httpd-parameters:global_port}/git/
monitor-base-url = $${monitor-publish-parameters:monitor-base-url} monitor-base-url = $${monitor-publish-parameters:monitor-base-url}
{% if slapparameter_dict.get('no-ipv4-frontend', 'false') == 'false' -%} {% if slapparameter_dict.get('no-ipv4-frontend', 'false') == 'false' -%}
url = https://$${request-frontend:connection-domain} url = https://$${request-frontend:connection-domain}
......
...@@ -49,7 +49,6 @@ setUpModule, SlapOSInstanceTestCase = makeModuleSetUpAndTestCaseClass( ...@@ -49,7 +49,6 @@ setUpModule, SlapOSInstanceTestCase = makeModuleSetUpAndTestCaseClass(
os.path.join(os.path.dirname(__file__), '..', os.path.join(os.path.dirname(__file__), '..',
'software%s.cfg' % ("-py3" if six.PY3 else "")))) 'software%s.cfg' % ("-py3" if six.PY3 else ""))))
class SlaprunnerTestCase(SlapOSInstanceTestCase): class SlaprunnerTestCase(SlapOSInstanceTestCase):
# Slaprunner uses unix sockets, so it needs short paths. # Slaprunner uses unix sockets, so it needs short paths.
__partition_reference__ = 's' __partition_reference__ = 's'
...@@ -106,26 +105,6 @@ class TestWeb(SlaprunnerTestCase): ...@@ -106,26 +105,6 @@ class TestWeb(SlaprunnerTestCase):
self.assertEqual(requests.codes.ok, hello.status_code) self.assertEqual(requests.codes.ok, hello.status_code)
self.assertIn('<b>Hello</b>', hello.text) self.assertIn('<b>Hello</b>', hello.text)
# git seems broken, these are 404 now...
@unittest.expectedFailure
def test_git_private(self):
parameter_dict = self.computer_partition.getConnectionParameterDict()
url = parameter_dict['git-private']
resp = requests.get(url, verify=False)
self.assertEqual(requests.codes.unauthorized, resp.status_code)
resp = requests.get(
url,
verify=False,
auth=(parameter_dict['init-user'], parameter_dict['init-password']))
self.assertEqual(requests.codes.ok, resp.status_code)
@unittest.expectedFailure
def test_git_public(self):
parameter_dict = self.computer_partition.getConnectionParameterDict()
url = parameter_dict['git-public']
resp = requests.get(url, verify=False)
self.assertEqual(requests.codes.ok, resp.status_code)
class TestSSH(SlaprunnerTestCase): class TestSSH(SlaprunnerTestCase):
@classmethod @classmethod
...@@ -275,6 +254,7 @@ class ServicesTestCase(SlaprunnerTestCase): ...@@ -275,6 +254,7 @@ class ServicesTestCase(SlaprunnerTestCase):
class TestInstanceResilient(SlaprunnerTestCase): class TestInstanceResilient(SlaprunnerTestCase):
instance_max_retry = 20 instance_max_retry = 20
@classmethod @classmethod
def getInstanceSoftwareType(cls): def getInstanceSoftwareType(cls):
return 'resilient' return 'resilient'
...@@ -287,8 +267,6 @@ class TestInstanceResilient(SlaprunnerTestCase): ...@@ -287,8 +267,6 @@ class TestInstanceResilient(SlaprunnerTestCase):
'backend-url', 'backend-url',
'feed-url-runner-1-pull', 'feed-url-runner-1-pull',
'feed-url-runner-1-push', 'feed-url-runner-1-push',
'git-private-url',
'git-public-url',
'init-password', 'init-password',
'init-user', 'init-user',
'monitor-base-url', 'monitor-base-url',
......
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