Skip to content

Commit 14eec6d

Browse files
committed
Merge branch 'develop' into matthew/postcss
2 parents 69bedf0 + 641a5c2 commit 14eec6d

10 files changed

Lines changed: 193 additions & 49 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,32 @@
1+
Changes in [0.9.6](https://github.com/vector-im/riot-web/releases/tag/v0.9.6) (2017-01-16)
2+
==========================================================================================
3+
[Full Changelog](https://github.com/vector-im/riot-web/compare/v0.9.6-rc.1...v0.9.6)
4+
5+
* Update to matrix-js-sdk 0.9.6 for video calling fix
6+
7+
Changes in [0.9.6-rc.1](https://github.com/vector-im/riot-web/releases/tag/v0.9.6-rc.1) (2017-01-13)
8+
====================================================================================================
9+
[Full Changelog](https://github.com/vector-im/riot-web/compare/v0.9.5...v0.9.6-rc.1)
10+
11+
* Build the js-sdk in the CI script
12+
[\#2920](https://github.com/vector-im/riot-web/pull/2920)
13+
* Hopefully fix Windows shortcuts
14+
[\#2917](https://github.com/vector-im/riot-web/pull/2917)
15+
* Update README now the js-sdk has a transpile step
16+
[\#2921](https://github.com/vector-im/riot-web/pull/2921)
17+
* Use the role for 'toggle dev tools'
18+
[\#2915](https://github.com/vector-im/riot-web/pull/2915)
19+
* Enable screen sharing easter-egg in desktop app
20+
[\#2909](https://github.com/vector-im/riot-web/pull/2909)
21+
* make electron send email validation URLs with a nextlink of riot.im
22+
[\#2808](https://github.com/vector-im/riot-web/pull/2808)
23+
* add Debian Stretch install steps to readme
24+
[\#2809](https://github.com/vector-im/riot-web/pull/2809)
25+
* Update desktop build instructions fixes #2792
26+
[\#2793](https://github.com/vector-im/riot-web/pull/2793)
27+
* CSS for the delete threepid button
28+
[\#2784](https://github.com/vector-im/riot-web/pull/2784)
29+
130
Changes in [0.9.5](https://github.com/vector-im/riot-web/releases/tag/v0.9.5) (2016-12-24)
231
==========================================================================================
332
[Full Changelog](https://github.com/vector-im/riot-web/compare/v0.9.4...v0.9.5)

‎README.md‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ https://riot.im/develop for those who like living dangerously.
1414
To host your own copy of Riot, the quickest bet is to use a pre-built
1515
released version of Riot:
1616

17-
1. Download the latest version from https://github.com/vector-im/vector-web/releases
17+
1. Download the latest version from https://github.com/vector-im/riot-web/releases
1818
1. Untar the tarball on your web server
1919
1. Move (or symlink) the vector-x.x.x directory to an appropriate name
2020
1. If desired, copy `config.sample.json` to `config.json` and edit it
@@ -44,7 +44,7 @@ access to Riot (or other apps) due to sharing the same domain.
4444

4545
We have put some coarse mitigations into place to try to protect against this
4646
situation, but it's still not good practice to do it in the first place. See
47-
https://github.com/vector-im/vector-web/issues/1977 for more details.
47+
https://github.com/vector-im/riot-web/issues/1977 for more details.
4848

4949
Building From Source
5050
====================
@@ -53,8 +53,8 @@ Riot is a modular webapp built with modern ES6 and requires a npm build system
5353
to build.
5454

5555
1. Install or update `node.js` so that your `npm` is at least at version `2.0.0`
56-
1. Clone the repo: `git clone https://github.com/vector-im/vector-web.git`
57-
1. Switch to the vector-web directory: `cd vector-web`
56+
1. Clone the repo: `git clone https://github.com/vector-im/riot-web.git`
57+
1. Switch to the riot-web directory: `cd riot-web`
5858
1. Install the prerequisites: `npm install`
5959
1. If you are using the `develop` branch of vector-web, you will probably need
6060
to rebuild some of the dependencies, due to
@@ -109,7 +109,7 @@ Running as a Desktop app
109109
========================
110110

111111
Riot can also be run as a desktop app, wrapped in electron. You can download a
112-
pre-built version from https://riot.im/download/desktop/ or, if you prefer,
112+
pre-built version from https://riot.im/desktop.html or, if you prefer,
113113
built it yourself.
114114

115115
To run as a desktop app:
@@ -179,13 +179,13 @@ the `component-index.js` for the app (used in future for skinning)
179179
development on Riot forcing `matrix-react-sdk` to move fast at the expense of
180180
maintaining a clear abstraction between the two.** Hacking on Riot inevitably
181181
means hacking equally on `matrix-react-sdk`, and there are bits of
182-
`matrix-react-sdk` behaviour incorrectly residing in the `vector-web` project
182+
`matrix-react-sdk` behaviour incorrectly residing in the `riot-web` project
183183
(e.g. matrix-react-sdk specific CSS), and a bunch of Riot specific behaviour
184184
in the `matrix-react-sdk` (grep for `vector` / `riot`). This separation problem will be
185185
solved asap once development on Riot (and thus matrix-react-sdk) has
186186
stabilised. Until then, the two projects should basically be considered as a
187187
single unit. In particular, `matrix-react-sdk` issues are currently filed
188-
against `vector-web` in github.
188+
against `riot-web` in github.
189189

190190
Please note that Riot is intended to run correctly without access to the public
191191
internet. So please don't depend on resources (JS libs, CSS, images, fonts)
@@ -220,8 +220,8 @@ Then similarly with `matrix-react-sdk`:
220220

221221
Finally, build and start Riot itself:
222222

223-
1. `git clone git@github.com:vector-im/vector-web.git`
224-
1. `cd vector-web`
223+
1. `git clone git@github.com:vector-im/riot-web.git`
224+
1. `cd riot-web`
225225
1. `git checkout develop`
226226
1. `npm install`
227227
1. `rm -r node_modules/matrix-js-sdk; ln -s ../../matrix-js-sdk node_modules/`

‎electron/src/electron-main.js‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,16 @@ function startAutoUpdate(update_base_url) {
112112
// 204 No Content. On windows it takes a base path and looks for
113113
// files under that path.
114114
if (process.platform == 'darwin') {
115-
electron.autoUpdater.setFeedURL(update_base_url + 'macos/');
115+
// include the current version in the URL we hit. Electron doesn't add
116+
// it anywhere (apart from the User-Agent) so it's up to us. We could
117+
// (and previously did) just use the User-Agent, but this doesn't
118+
// rely on NSURLConnection setting the User-Agent to what we expect,
119+
// and also acts as a convenient cache-buster to ensure that when the
120+
// app updates it always gets a fresh value to avoid update-looping.
121+
electron.autoUpdater.setFeedURL(
122+
update_base_url +
123+
'macos/?localVersion=' + encodeURIComponent(electron.app.getVersion())
124+
);
116125
} else if (process.platform == 'win32') {
117126
electron.autoUpdater.setFeedURL(update_base_url + 'win32/' + process.arch + '/');
118127
} else {

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "riot-web",
33
"productName": "Riot",
44
"main": "electron/src/electron-main.js",
5-
"version": "0.9.5",
5+
"version": "0.9.6",
66
"description": "A feature-rich client for Matrix.org",
77
"author": "Vector Creations Ltd.",
88
"repository": {

‎scripts/redeploy.py‎

Lines changed: 118 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,32 @@
11
#!/usr/bin/env python
2+
#
3+
# auto-deploy script for https://riot.im/develop
4+
#
5+
# Listens for HTTP hits. When it gets one, downloads the artifact from jenkins
6+
# and deploys it as the new version.
7+
#
8+
# Requires the following python packages:
9+
#
10+
# - requests
11+
# - flask
12+
#
213
from __future__ import print_function
314
import json, requests, tarfile, argparse, os, errno
15+
import time
416
from urlparse import urljoin
517
from flask import Flask, jsonify, request, abort
18+
619
app = Flask(__name__)
720

8-
arg_jenkins_url, arg_extract_path, arg_should_clean, arg_symlink, arg_config_location = (
9-
None, None, None, None, None
10-
)
21+
arg_jenkins_url = None
22+
arg_extract_path = None
23+
arg_bundles_path = None
24+
arg_should_clean = None
25+
arg_symlink = None
26+
arg_config_location = None
27+
28+
class DeployException(Exception):
29+
pass
1130

1231
def download_file(url):
1332
local_filename = url.split('/')[-1]
@@ -57,6 +76,9 @@ def on_receive_jenkins_poke():
5776
abort(400, "Missing or bad build number")
5877
return
5978

79+
return fetch_jenkins_build(job_name, build_num)
80+
81+
def fetch_jenkins_build(job_name, build_num):
6082
artifact_url = urljoin(
6183
arg_jenkins_url, "job/%s/%s/api/json" % (job_name, build_num)
6284
)
@@ -106,27 +128,38 @@ def on_receive_jenkins_poke():
106128
arg_jenkins_url, "job/%s/%s/artifact/%s" % (job_name, build_num, tar_gz_path)
107129
)
108130

109-
print("Retrieving .tar.gz file: %s" % tar_gz_url)
131+
# we extract into a directory based on the build number. This avoids the
132+
# problem of multiple builds building the same git version and thus having
133+
# the same tarball name. That would lead to two potential problems:
134+
# (a) sometimes jenkins serves corrupted artifacts; we would replace
135+
# a good deploy with a bad one
136+
# (b) we'll be overwriting the live deployment, which means people might
137+
# see half-written files.
138+
build_dir = os.path.join(arg_extract_path, "%s-#%s" % (job_name, build_num))
139+
try:
140+
deploy_tarball(tar_gz_url, build_dir)
141+
except DeployException as e:
142+
abort(400, e.message)
143+
144+
return jsonify({})
145+
146+
def deploy_tarball(tar_gz_url, build_dir):
147+
"""Download a tarball from jenkins and deploy it as the new version
148+
"""
149+
print("Deploying %s to %s" % (tar_gz_url, build_dir))
150+
151+
if os.path.exists(build_dir):
152+
raise DeployException(
153+
"Not deploying. We have previously deployed this build."
154+
)
155+
os.mkdir(build_dir)
110156

111157
# we rely on the fact that flask only serves one request at a time to
112158
# ensure that we do not overwrite a tarball from a concurrent request.
113159
filename = download_file(tar_gz_url)
114160
print("Downloaded file: %s" % filename)
115161

116162
try:
117-
# we extract into a directory based on the build number. This avoids the
118-
# problem of multiple builds building the same git version and thus having
119-
# the same tarball name. That would lead to two potential problems:
120-
# (a) sometimes jenkins serves corrupted artifacts; we would replace
121-
# a good deploy with a bad one
122-
# (b) we'll be overwriting the live deployment, which means people might
123-
# see half-written files.
124-
build_dir = os.path.join(arg_extract_path, "%s-#%s" % (job_name, build_num))
125-
if os.path.exists(build_dir):
126-
abort(400, "Not deploying. We have previously deployed this build.")
127-
return
128-
os.mkdir(build_dir)
129-
130163
untar_to(filename, build_dir)
131164
print("Extracted to: %s" % build_dir)
132165
finally:
@@ -139,9 +172,47 @@ def on_receive_jenkins_poke():
139172
if arg_config_location:
140173
create_symlink(source=arg_config_location, linkname=os.path.join(extracted_dir, 'config.json'))
141174

175+
if arg_bundles_path:
176+
extracted_bundles = os.path.join(extracted_dir, 'bundles')
177+
move_bundles(source=extracted_bundles, dest=arg_bundles_path)
178+
179+
# replace the (hopefully now empty) extracted_bundles dir with a
180+
# symlink to the common dir.
181+
relpath = os.path.relpath(arg_bundles_path, extracted_dir)
182+
os.rmdir(extracted_bundles)
183+
print ("Symlink %s -> %s" % (extracted_bundles, relpath))
184+
os.symlink(relpath, extracted_bundles)
185+
142186
create_symlink(source=extracted_dir, linkname=arg_symlink)
143187

144-
return jsonify({})
188+
def move_bundles(source, dest):
189+
"""Move the contents of the 'bundles' directory to a common dir
190+
191+
We check that we will not be overwriting anything before we proceed.
192+
193+
Args:
194+
source (str): path to 'bundles' within the extracted tarball
195+
dest (str): target common directory
196+
"""
197+
198+
if not os.path.isdir(dest):
199+
os.mkdir(dest)
200+
201+
# build a map from source to destination, checking for non-existence as we go.
202+
renames = {}
203+
for f in os.listdir(source):
204+
dst = os.path.join(dest, f)
205+
if os.path.exists(dst):
206+
raise DeployException(
207+
"Not deploying. The bundle includes '%s' which we have previously deployed."
208+
% f
209+
)
210+
renames[os.path.join(source, f)] = dst
211+
212+
for (src, dst) in renames.iteritems():
213+
print ("Move %s -> %s" % (src, dst))
214+
os.rename(src, dst)
215+
145216

146217
if __name__ == "__main__":
147218
parser = argparse.ArgumentParser("Runs a Vector redeployment server.")
@@ -161,6 +232,13 @@ def on_receive_jenkins_poke():
161232
"The location to extract .tar.gz files to."
162233
)
163234
)
235+
parser.add_argument(
236+
"-b", "--bundles-dir", dest="bundles_dir", help=(
237+
"A directory to move the contents of the 'bundles' directory to. A \
238+
symlink to the bundles directory will also be written inside the \
239+
extracted tarball. Example: './bundles'."
240+
)
241+
)
164242
parser.add_argument(
165243
"-c", "--clean", dest="clean", action="store_true", default=False, help=(
166244
"Remove .tar.gz files after they have been downloaded and extracted."
@@ -179,18 +257,34 @@ def on_receive_jenkins_poke():
179257
To this location."
180258
)
181259
)
260+
parser.add_argument(
261+
"--test", dest="tarball_uri", help=(
262+
"Don't start an HTTP listener. Instead download a build from Jenkins \
263+
immediately."
264+
),
265+
)
266+
182267
args = parser.parse_args()
183268
if args.jenkins.endswith("/"): # important for urljoin
184269
arg_jenkins_url = args.jenkins
185270
else:
186271
arg_jenkins_url = args.jenkins + "/"
187272
arg_extract_path = args.extract
273+
arg_bundles_path = args.bundles_dir
188274
arg_should_clean = args.clean
189275
arg_symlink = args.symlink
190276
arg_config_location = args.config
191-
print(
192-
"Listening on port %s. Extracting to %s%s. Symlinking to %s. Jenkins URL: %s. Config location: %s" %
193-
(args.port, arg_extract_path,
194-
" (clean after)" if arg_should_clean else "", arg_symlink, arg_jenkins_url, arg_config_location)
195-
)
196-
app.run(host="0.0.0.0", port=args.port, debug=True)
277+
278+
if not os.path.isdir(arg_extract_path):
279+
os.mkdir(arg_extract_path)
280+
281+
if args.tarball_uri is not None:
282+
build_dir = os.path.join(arg_extract_path, "test-%i" % (time.time()))
283+
deploy_tarball(args.tarball_uri, build_dir)
284+
else:
285+
print(
286+
"Listening on port %s. Extracting to %s%s. Symlinking to %s. Jenkins URL: %s. Config location: %s" %
287+
(args.port, arg_extract_path,
288+
" (clean after)" if arg_should_clean else "", arg_symlink, arg_jenkins_url, arg_config_location)
289+
)
290+
app.run(host="0.0.0.0", port=args.port, debug=True)

‎src/skins/vector/css/matrix-react-sdk/views/elements/_DirectorySearchBox.scss‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ input[type=text].mx_DirectorySearchBox_input:focus {
4444
padding-right: 10px;
4545
background-color: $plinth-bg-color;
4646
border-radius: 3px;
47-
background-image: url('img/icon-return.svg');
47+
background-image: url('../../img/icon-return.svg');
4848
background-position: 8px 70%;
4949
background-repeat: no-repeat;
5050
text-indent: 18px;
@@ -61,7 +61,7 @@ input[type=text].mx_DirectorySearchBox_input:focus {
6161
.mx_DirectorySearchBox_clear {
6262
display: inline-block;
6363
vertical-align: middle;
64-
background: url('img/icon_context_delete.svg');
64+
background: url('../../img/icon_context_delete.svg');
6565
background-position: 0 50%;
6666
background-repeat: no-repeat;
6767
width: 15px;

‎src/skins/vector/css/matrix-react-sdk/views/rooms/_RoomTile.scss‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ limitations under the License.
6565
position: absolute;
6666
content: "";
6767
border-radius: 40px;
68-
background-image: url("img/icons_ellipsis.svg");
68+
background-image: url("../../img/icons_ellipsis.svg");
6969
background-size: 25px;
7070
width: 24px;
7171
height: 24px;

0 commit comments

Comments
 (0)