From 4d96a462cf08f2e9da0fee53acb946e207533f65 Mon Sep 17 00:00:00 2001 From: Pierre-Antoine Rault Date: Wed, 14 Dec 2016 03:29:16 +0100 Subject: [PATCH] modified urls --- scripts/upgrade | 4 + sources/requirements.txt | 1 + sources/syncserver/__init__.py | 14 ++++ .../syncserver/page/{index.html => index.pt} | 75 +++---------------- 4 files changed, 30 insertions(+), 64 deletions(-) rename sources/syncserver/page/{index.html => index.pt} (95%) diff --git a/scripts/upgrade b/scripts/upgrade index e4fa985..f2a4a27 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -36,12 +36,16 @@ then sudo swapon $tmp_swap_file fi +# Modify assets to take path into account +sudo find ../sources/syncserver/page/sync_files/ -type f -exec sed -i -e "s@media\/img@$path\/media\/img@g" {} \; + # Copy files to the right place sudo mkdir -p $final_path sudo cp -a ../sources/* $final_path sudo cp ../conf/ffsync /etc/init.d/ sudo cp ../conf/ffsync.logrotate /etc/logrotate.d/ffsync + # Set permissions to ffsync directory sudo useradd ffsync -d $final_path sudo chown ffsync:ffsync -R $final_path diff --git a/sources/requirements.txt b/sources/requirements.txt index 2980219..3223893 100644 --- a/sources/requirements.txt +++ b/sources/requirements.txt @@ -1,6 +1,7 @@ cornice==0.16.2 gunicorn==19.1.1 pyramid==1.5 +pyramid_chameleon==0.3 requests==2.7 simplejson==3.4 SQLAlchemy==0.9.4 diff --git a/sources/syncserver/__init__.py b/sources/syncserver/__init__.py index de45409..33731f1 100644 --- a/sources/syncserver/__init__.py +++ b/sources/syncserver/__init__.py @@ -8,6 +8,9 @@ from urlparse import urlparse, urlunparse from pyramid.events import NewRequest, subscriber from pyramid.static import static_view +from pyramid.view import view_config +from pyramid.renderers import render, render_to_response +from pyramid.response import Response import mozsvc.config @@ -87,8 +90,19 @@ def includeme(config): config.scan("syncserver") config.include("syncstorage", route_prefix="/storage") config.include("tokenserver", route_prefix="/token") + config.include('pyramid_chameleon') # Add a top-level explaination view. + # First view, available at http://localhost:6543/ + def page(request): + result = render('page/index.pt', + {'public_url':public_url}, + request=request) + response = Response(result) + return response + config.add_route('page', '/') + config.add_view(page, route_name='page') + www = static_view( os.path.realpath(os.path.dirname(__file__)+"/page/"), use_subpath=True diff --git a/sources/syncserver/page/index.html b/sources/syncserver/page/index.pt similarity index 95% rename from sources/syncserver/page/index.html rename to sources/syncserver/page/index.pt index ad14833..8a91299 100644 --- a/sources/syncserver/page/index.html +++ b/sources/syncserver/page/index.pt @@ -37,23 +37,6 @@ help support Mozilla. Firefox Sync Server — Keep Synced on your own - - - - - - - - - - - - - - - - - @@ -143,9 +126,6 @@ help support Mozilla. - - - - - - - - - - - - - - - - - - - - - -
-
+ +
+
@@ -201,14 +164,14 @@ help support Mozilla. -
- - - - - - +
@@ -300,7 +257,7 @@ help support Mozilla.
-
+
@@ -354,13 +311,6 @@ help support Mozilla. - - - - - - -
@@ -595,9 +545,7 @@ help support Mozilla.
-
-
@@ -615,7 +563,7 @@ help support Mozilla. with a path of "token/1.0/sync/1.5":


- identity.sync.tokenserver.uri: http://{this page’s url}/token/1.0/sync/1.5 + identity.sync.tokenserver.uri: ${public_url}/token/1.0/sync/1.5

Since Firefox 33, Firefox for Android has supported custom sync servers, @@ -651,7 +599,7 @@ See how to

-
+

Change the Sync server on each installation

@@ -671,11 +619,10 @@ See
how to -