diff --git a/scripts/install b/scripts/install index 30f864a..b3624ca 100644 --- a/scripts/install +++ b/scripts/install @@ -162,6 +162,7 @@ virtualenv "$final_path/local" set -o nounset cd "$final_path" pip install --upgrade pip + pip install pyramid_chameleon CFLAGS="-Wno-error -Wno-error=format-security" \ ARCHFLAGS="-Wno-error=unused-command-line-argument-hard-error-in-future" \ pip install --requirement "$final_path/requirements.txt" @@ -171,6 +172,10 @@ virtualenv "$final_path/local" touch "$final_path/local/COMPLETE" ) +# Add nice homepage +cp -r ../sources/page $final_path/syncserver/ +(cd "$final_path/syncserver" && patch -p1 < $YNH_CWD/../sources/homepage.patch) || echo "Unable to apply patches" + #================================================= # GENERIC FINALIZATION #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index bbfdbe2..57cfb9c 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -170,6 +170,7 @@ virtualenv "$final_path/local" set -o nounset cd "$final_path" pip install --upgrade pip + pip install pyramid_chameleon CFLAGS="-Wno-error -Wno-error=format-security" \ ARCHFLAGS="-Wno-error=unused-command-line-argument-hard-error-in-future" \ pip install --requirement "$final_path/requirements.txt" @@ -179,6 +180,9 @@ virtualenv "$final_path/local" touch "$final_path/local/COMPLETE" ) +# Add nice homepage +cp -r ../sources/page $final_path/syncserver/ +(cd "$final_path/syncserver" && patch -p1 < $YNH_CWD/../sources/homepage.patch) || echo "Unable to apply patches" #================================================= # GENERIC FINALIZATION diff --git a/sources/homepage.patch b/sources/homepage.patch new file mode 100644 index 0000000..ecc28dd --- /dev/null +++ b/sources/homepage.patch @@ -0,0 +1,48 @@ +diff -Naur a/__init__.py b/__init__.py +--- a/__init__.py 2018-08-22 17:54:00.369070610 +0200 ++++ b/__init__.py 2018-08-22 20:11:39.861463512 +0200 +@@ -11,6 +11,10 @@ + from pyramid.response import Response + 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 ++ + try: + import requests.packages.urllib3.contrib.pyopenssl + HAS_PYOPENSSL = True +@@ -135,13 +139,27 @@ + config.scan("syncserver", ignore=["syncserver.wsgi_app"]) + config.include("syncstorage", route_prefix="/storage") + config.include("tokenserver", route_prefix="/token") ++ config.include('pyramid_chameleon') + +- # Add a top-level "it works!" view. +- def itworks(request): +- return Response("it works!") +- +- config.add_route('itworks', '/') +- config.add_view(itworks, route_name='itworks') ++ # 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 ++ ) ++ # Documentation for Hybrid routing can be found here ++ # http://docs.pylonsproject.org/projects/pyramid/en/1.0-branch/narr/hybrid.html#using-subpath-in-a-route-pattern ++ config.add_route('index', '/*subpath', 'www') # subpath is a reserved word ++ config.add_view(www, route_name='index') + + + def import_settings_from_environment_variables(settings, environ=None): diff --git a/sources/page/index.pt b/sources/page/index.pt new file mode 100644 index 0000000..8a91299 --- /dev/null +++ b/sources/page/index.pt @@ -0,0 +1,663 @@ + + + + + + + + + + + + + + Firefox Sync Server — Keep Synced on your own + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
+ + +
+ +
+
+
+ +
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+ +
+
+
+
+
+
+ + +
+
+
+ + +
+

+ It looks like you’re running an older version of Firefox. +

+
+ +
+

+ The new version of Sync only works with the latest version of Firefox +

+
+ +
+

+ + Sync is just one of the great features you’ll only get with Firefox. + +

+
+ + + +
+ + +
+ + + +
+ + + +
+ + + +
+ +
+ +
+

+ + Download Firefox + — English (US) +

+ +
+ +
+ + +
+

Your system may not meet the requirements for Firefox, but you can try one of these versions:

+ +
+

+ + Download Firefox + — English (US) +

+ +
+ +
+

+ Your system doesn't meet the requirements to run Firefox. +

+

+ Your system doesn't meet the requirements to run Firefox. +

+

+ Please follow these instructions to install Firefox. +

+ + + + Firefox Privacy + +
+
+
+ + + +
+

Get started with Sync in four easy steps:

+
+
    +
  1. Open the menu in the top right of Firefox and select “Sign in to Sync.
  2. + +
  3. Click “Get started” in the tab that opens.
  4. +
  5. Enter an email address and password to “Create a Firefox Account.
  6. +
  7. Click “Next” to get a verification sent to your email.
  8. +
+

After you check your email and click the verification link, you’ll be all set! Firefox will automatically sync in the background from then on.

+
+ +
+ + + + +
+

How to set up Sync in five easy steps:

+
+
    + +
  1. Tap the Menu button (either below the screen or at the top right corner of the browser).
  2. +
  3. Select Settings (you may need to tap More first).
  4. +
  5. Tap Sync and then Get Started.
  6. +
  7. The Create a Firefox Account page will open in a new tab.
  8. +
  9. Fill out the form and click Next.
  10. +
+

After you check your email and click the verification link, you’ll be ready to go! Don’t forget to connect all your other devices to get the most of Sync.

+
+ +
+ +
+
+
+ + + +
+
+
+
+

How to sync your Firefox with this server instead of Mozilla’s?

+

+ You can safely use the Mozilla-hosted Firefox Accounts server in combination with a self-hosted sync storage server. The authentication and encryption protocols are designed so that the account server does not know the user’s plaintext password, and therefore cannot access their stored sync data. +

+ Alternatively, you can also Run your own Firefox Accounts Server to control all aspects of the system. The process for doing so is currently very experimental and not well documented. +

+

+ To configure Firefox to talk to your new Sync server, go to "about:config", + search for "identity.sync.tokenserver.uri" and change its value to the URL of your server + with a path of "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, + should be a breeze. +

+

Solving problems with Android

+

The sure-fire way to know what Sync on Android is really doing is to + observe the Android device log using adb logcat. You’ll want to bump + your log-level: +


+ adb shell setprop log.tag.FxAccounts VERBOSE +
+

+ Then, you can observe the log using: +

+
+ adb logcat | grep FxAccounts +
+

+ It’s best to observe the log while you force a sync from the Android Settings App. You should see output like: +

+
+D FxAccounts(...) fennec :: BaseResource :: HTTP GET https://token.stage.mozaws.net/1.0/sync/1.5
+...
+D FxAccounts(...) fennec :: BaseResource :: HTTP GET https://sync-4-us-east-1.stage.mozaws.net/

+See how to file a good Android Sync bug for details. + +

+
+ +
+
+
+ +
+
+
+
+

Change the Sync server on each installation

+ +
+ +
+
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + diff --git a/sources/page/media/fonts/opensans-bold.5cf854f3d1c0.woff2 b/sources/page/media/fonts/opensans-bold.5cf854f3d1c0.woff2 new file mode 100644 index 0000000..4ed695b Binary files /dev/null and b/sources/page/media/fonts/opensans-bold.5cf854f3d1c0.woff2 differ diff --git a/sources/page/media/fonts/opensans-italic.c86748d08341.woff2 b/sources/page/media/fonts/opensans-italic.c86748d08341.woff2 new file mode 100644 index 0000000..2bd1366 Binary files /dev/null and b/sources/page/media/fonts/opensans-italic.c86748d08341.woff2 differ diff --git a/sources/page/media/fonts/opensans-light.2120033991a4.woff2 b/sources/page/media/fonts/opensans-light.2120033991a4.woff2 new file mode 100644 index 0000000..21b4222 Binary files /dev/null and b/sources/page/media/fonts/opensans-light.2120033991a4.woff2 differ diff --git a/sources/page/media/fonts/opensans-lightitalic.580ce2d5ac1d.woff2 b/sources/page/media/fonts/opensans-lightitalic.580ce2d5ac1d.woff2 new file mode 100644 index 0000000..c2f5521 Binary files /dev/null and b/sources/page/media/fonts/opensans-lightitalic.580ce2d5ac1d.woff2 differ diff --git a/sources/page/media/fonts/opensans-regular.668362de763a.woff2 b/sources/page/media/fonts/opensans-regular.668362de763a.woff2 new file mode 100644 index 0000000..845dc73 Binary files /dev/null and b/sources/page/media/fonts/opensans-regular.668362de763a.woff2 differ diff --git a/sources/page/media/img/firefox/family/nav-sprite.56fbf5a8d218.png b/sources/page/media/img/firefox/family/nav-sprite.56fbf5a8d218.png new file mode 100644 index 0000000..ed3264c Binary files /dev/null and b/sources/page/media/img/firefox/family/nav-sprite.56fbf5a8d218.png differ diff --git a/sources/page/media/img/firefox/sync/device-lineup.a60618c7dacb.png b/sources/page/media/img/firefox/sync/device-lineup.a60618c7dacb.png new file mode 100644 index 0000000..f0ab7c9 Binary files /dev/null and b/sources/page/media/img/firefox/sync/device-lineup.a60618c7dacb.png differ diff --git a/sources/page/media/img/firefox/sync/icons.b80c6430793b.png b/sources/page/media/img/firefox/sync/icons.b80c6430793b.png new file mode 100644 index 0000000..b65f592 Binary files /dev/null and b/sources/page/media/img/firefox/sync/icons.b80c6430793b.png differ diff --git a/sources/page/media/img/sandstone/bg-gradient-sky.7ea325995978.png b/sources/page/media/img/sandstone/bg-gradient-sky.7ea325995978.png new file mode 100644 index 0000000..cf82e53 Binary files /dev/null and b/sources/page/media/img/sandstone/bg-gradient-sky.7ea325995978.png differ diff --git a/sources/page/media/img/sandstone/footer-mozilla.fafef0912042.png b/sources/page/media/img/sandstone/footer-mozilla.fafef0912042.png new file mode 100644 index 0000000..9f874d0 Binary files /dev/null and b/sources/page/media/img/sandstone/footer-mozilla.fafef0912042.png differ diff --git a/sources/page/media/img/sandstone/grain.855f29e0c686.png b/sources/page/media/img/sandstone/grain.855f29e0c686.png new file mode 100644 index 0000000..dd4b1e6 Binary files /dev/null and b/sources/page/media/img/sandstone/grain.855f29e0c686.png differ diff --git a/sources/page/media/img/tabzilla/tabzilla-static.953a65a1f4a4.png b/sources/page/media/img/tabzilla/tabzilla-static.953a65a1f4a4.png new file mode 100644 index 0000000..67861f5 Binary files /dev/null and b/sources/page/media/img/tabzilla/tabzilla-static.953a65a1f4a4.png differ diff --git a/sources/page/sync_files/btn-app-store.svg b/sources/page/sync_files/btn-app-store.svg new file mode 100644 index 0000000..d8c6294 --- /dev/null +++ b/sources/page/sync_files/btn-app-store.svg @@ -0,0 +1,142 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sources/page/sync_files/btn-google-play.png b/sources/page/sync_files/btn-google-play.png new file mode 100644 index 0000000..1bce4de Binary files /dev/null and b/sources/page/sync_files/btn-google-play.png differ diff --git a/sources/page/sync_files/common-bundle.js b/sources/page/sync_files/common-bundle.js new file mode 100644 index 0000000..024ed67 --- /dev/null +++ b/sources/page/sync_files/common-bundle.js @@ -0,0 +1,21 @@ +/*! jQuery v1.11.3 | (c) 2005, 2015 jQuery Foundation, Inc. | jquery.org/license */ +;function triggerIEDownload(e,t){"use strict";var n=t!==undefined?t:navigator.userAgent;e&&window.site.platform==="windows"&&/MSIE\s[1-8]\./.test(n)&&(window.open(e,"download_window","toolbar=0,location=no,directories=0,status=0,scrollbars=0,resizeable=0,width=1,height=1,top=0,left=0"),window.focus())}function initDownloadLinks(){$(".download-link").each(function(){var e=$(this);e.click(function(){triggerIEDownload(e.data("direct-link"))})}),$(".download-list").attr("role","presentation")}function initMobileDownloadLinks(){site.platform==="android"&&$('a[href^="https://play.google.com/store/apps/"]').each(function(){$(this).attr("href",$(this).attr("href").replace("https://play.google.com/store/apps/","market://"))}),site.platform==="ios"&&$('a[href^="https://itunes.apple.com/"]').each(function(){$(this).attr("href",$(this).attr("href").replace("https://","itms-apps://"))})}function maybeSwitchToDistDownloadLinks(e){if(!e.distribution||e.distribution==="default")return;var t=e.distribution.toLowerCase();$("a[data-"+t+"-link]").each(function(){$(this).attr("href",$(this).data(t+"Link"))})}function initLangSwitcher(){var e=$("#page-language-select"),t=e.val();e.change(function(){window.dataLayer.push({event:"change-language",languageSelected:e.val(),previousLanguage:t}),$("#lang_form").attr("action",window.location.hash||"#"),$("#lang_form").submit()})}!function(e,t){"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){function g(e){var t="length"in e&&e.length,n=h.type(e);return"function"===n||h.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e}function S(e,t,n){if(h.isFunction(t))return h.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return h.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(E.test(t))return h.filter(t,e,n);t=h.filter(t,e)}return h.grep(e,function(e){return h.inArray(e,t)>=0!==n})}function A(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}function _(e){var t=M[e]={};return h.each(e.match(O)||[],function(e,n){t[n]=!0}),t}function P(){T.addEventListener?(T.removeEventListener("DOMContentLoaded",H,!1),e.removeEventListener("load",H,!1)):(T.detachEvent("onreadystatechange",H),e.detachEvent("onload",H))}function H(){(T.addEventListener||"load"===event.type||"complete"===T.readyState)&&(P(),h.ready())}function q(e,t,n){if(void 0===n&&1===e.nodeType){var r="data-"+t.replace(I,"-$1").toLowerCase();if(n=e.getAttribute(r),"string"==typeof n){try{n="true"===n?!0:"false"===n?!1:"null"===n?null:+n+""===n?+n:F.test(n)?h.parseJSON(n):n}catch(i){}h.data(e,t,n)}else n=void 0}return n}function R(e){var t;for(t in e)if(("data"!==t||!h.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}function U(e,t,r,i){if(h.acceptData(e)){var s,o,u=h.expando,a=e.nodeType,f=a?h.cache:e,l=a?e[u]:e[u]&&u;if(l&&f[l]&&(i||f[l].data)||void 0!==r||"string"!=typeof t)return l||(l=a?e[u]=n.pop()||h.guid++:u),f[l]||(f[l]=a?{}:{toJSON:h.noop}),("object"==typeof t||"function"==typeof t)&&(i?f[l]=h.extend(f[l],t):f[l].data=h.extend(f[l].data,t)),o=f[l],i||(o.data||(o.data={}),o=o.data),void 0!==r&&(o[h.camelCase(t)]=r),"string"==typeof t?(s=o[t],null==s&&(s=o[h.camelCase(t)])):s=o,s}}function z(e,t,n){if(h.acceptData(e)){var r,i,s=e.nodeType,o=s?h.cache:e,u=s?e[h.expando]:h.expando;if(o[u]){if(t&&(r=n?o[u]:o[u].data)){h.isArray(t)?t=t.concat(h.map(t,h.camelCase)):t in r?t=[t]:(t=h.camelCase(t),t=t in r?[t]:t.split(" ")),i=t.length;while(i--)delete r[t[i]];if(n?!R(r):!h.isEmptyObject(r))return}(n||(delete o[u].data,R(o[u])))&&(s?h.cleanData([e],!0):l.deleteExpando||o!=o.window?delete o[u]:o[u]=null)}}}function et(){return!0}function tt(){return!1}function nt(){try{return T.activeElement}catch(e){}}function rt(e){var t=it.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}function wt(e,t){var n,r,i=0,s=typeof e.getElementsByTagName!==B?e.getElementsByTagName(t||"*"):typeof e.querySelectorAll!==B?e.querySelectorAll(t||"*"):void 0;if(!s)for(s=[],n=e.childNodes||e;null!=(r=n[i]);i++)!t||h.nodeName(r,t)?s.push(r):h.merge(s,wt(r,t));return void 0===t||t&&h.nodeName(e,t)?h.merge([e],s):s}function Et(e){J.test(e.type)&&(e.defaultChecked=e.checked)}function St(e,t){return h.nodeName(e,"table")&&h.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function xt(e){return e.type=(null!==h.find.attr(e,"type"))+"/"+e.type,e}function Tt(e){var t=vt.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function Nt(e,t){for(var n,r=0;null!=(n=e[r]);r++)h._data(n,"globalEval",!t||h._data(t[r],"globalEval"))}function Ct(e,t){if(1===t.nodeType&&h.hasData(e)){var n,r,i,s=h._data(e),o=h._data(t,s),u=s.events;if(u){delete o.handle,o.events={};for(n in u)for(r=0,i=u[n].length;i>r;r++)h.event.add(t,n,u[n][r])}o.data&&(o.data=h.extend({},o.data))}}function kt(e,t){var n,r,i;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!l.noCloneEvent&&t[h.expando]){i=h._data(t);for(r in i.events)h.removeEvent(t,r,i.handle);t.removeAttribute(h.expando)}"script"===n&&t.text!==e.text?(xt(t).text=e.text,Tt(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),l.html5Clone&&e.innerHTML&&!h.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&J.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}}function Ot(t,n){var r,i=h(n.createElement(t)).appendTo(n.body),s=e.getDefaultComputedStyle&&(r=e.getDefaultComputedStyle(i[0]))?r.display:h.css(i[0],"display");return i.detach(),s}function Mt(e){var t=T,n=At[e];return n||(n=Ot(e,t),"none"!==n&&n||(Lt=(Lt|| +h("