Merge remote-tracking branch 'origin/master' into dbkr/debrepo

This commit is contained in:
David Baker 2019-12-13 17:19:38 +00:00
commit 54421f8dc6
6 changed files with 48 additions and 8 deletions

20
README
View File

@ -14,7 +14,8 @@ so the first step is to get a working copy of Riot. There are a few ways of doin
``` ```
# Fetch the prebuilt release Riot package from the riot.im GitHub releases page. The version # Fetch the prebuilt release Riot package from the riot.im GitHub releases page. The version
# fetched will be the same as the local riot-desktop package. # fetched will be the same as the local riot-desktop package.
yarn run fetch --noverify # We're explicitly asking for no config, so the package Riot will have no config.json.
yarn run fetch --noverify --cfgdir ''
``` ```
...or if you'd like to use GPG to verify the downloaded package: ...or if you'd like to use GPG to verify the downloaded package:
@ -24,14 +25,14 @@ yarn run fetch --noverify
# once. # once.
yarn run fetch --importkey yarn run fetch --importkey
# Fetch the package and verify the signature # Fetch the package and verify the signature
yarn run fetch yarn run fetch --cfgdir ''
``` ```
...or either of the above, but fetching a specific version of Riot: ...or either of the above, but fetching a specific version of Riot:
``` ```
# Fetch the prebuilt release Riot package from the riot.im GitHub releases page. The version # Fetch the prebuilt release Riot package from the riot.im GitHub releases page. The version
# fetched will be the same as the local riot-desktop package. # fetched will be the same as the local riot-desktop package.
yarn run fetch --noverify v1.5.6 yarn run fetch --noverify --cfgdir '' v1.5.6
``` ```
If you only want to run the app locally and don't need to build packages, you can If you only want to run the app locally and don't need to build packages, you can
@ -75,3 +76,16 @@ If you'd just like to run the electron app locally for development:
yarn add electron yarn add electron
yarn start yarn start
``` ```
Config
======
If you'd like the packaged Riot to have a configuration file, you can create a
config directory and place `config.json` in there, then specify this directory
with the `--cfgdir` option to `yarn run fetch`, eg:
```
mkdir myconfig
cp /path/to/my/config.json myconfig/
yarn run fetch --cfgdir myconfig
```
The config dir for the official Riot.im app is in `riot.im`. If you use this,
your app will auto-update itself using builds from Riot.im.

View File

@ -18,9 +18,9 @@
"start": "electron .", "start": "electron .",
"lint": "eslint src/", "lint": "eslint src/",
"build": "yarn run setversion && electron-builder", "build": "yarn run setversion && electron-builder",
"indocker": "scripts/indocker.sh", "in-docker": "scripts/in-docker.sh",
"docker:build": "yarn run indocker yarn run build", "docker:build": "yarn run in-docker yarn run build",
"docker:install": "yarn run indocker yarn install", "docker:install": "yarn run in-docker yarn install",
"debrepo": "scripts/mkrepo.sh", "debrepo": "scripts/mkrepo.sh",
"clean": "rimraf webapp.asar dist packages deploys" "clean": "rimraf webapp.asar dist packages deploys"
}, },

View File

@ -7,7 +7,7 @@ Depends: libgtk-3-0, libnotify4, libnss3, libxss1, libxtst6, xdg-utils, libatspi
Provides: riot-web Provides: riot-web
Conflicts: riot-web Conflicts: riot-web
Replaces: riot-web Replaces: riot-web
Section: default Section: net
Priority: extra Priority: extra
Homepage: https://riot.im/ Homepage: https://riot.im/
Description: Description:

View File

@ -10,7 +10,11 @@ exports.default = async function(context) {
// from the keychain, so we need to get it from the environment. // from the keychain, so we need to get it from the environment.
const userId = process.env.NOTARIZE_APPLE_ID; const userId = process.env.NOTARIZE_APPLE_ID;
if (userId === undefined) { if (userId === undefined) {
throw new Error("User ID not found. Set NOTARIZE_APPLE_ID."); console.log("*************************************");
console.log("* NOTARIZE_APPLE_ID is not set. *");
console.log("* This build will NOT be notarised. *");
console.log("*************************************");
return;
} }
console.log("Notarising macOS app. This may be some time."); console.log("Notarising macOS app. This may be some time.");

View File

@ -58,6 +58,7 @@ async function main() {
let importkey = false; let importkey = false;
let pkgDir = 'packages'; let pkgDir = 'packages';
let deployDir = 'deploys'; let deployDir = 'deploys';
let cfgDir;
let targetVersion; let targetVersion;
while (process.argv.length > 2) { while (process.argv.length > 2) {
@ -76,6 +77,11 @@ async function main() {
process.argv.shift(); process.argv.shift();
deployDir = process.argv[2]; deployDir = process.argv[2];
break; break;
case '--cfgdir':
case '-d':
process.argv.shift();
cfgDir = process.argv[2];
break;
default: default:
targetVersion = process.argv[2]; targetVersion = process.argv[2];
} }
@ -118,6 +124,13 @@ async function main() {
}); });
return 0; return 0;
} }
if (cfgDir === undefined) {
console.log("No config directory set");
console.log("Specify a config directory with --cfgdir or -d");
console.log("To build with no config (and no auto-update), pass the empty string (-d '')");
return 1;
}
if (verify && !haveGpg) { if (verify && !haveGpg) {
console.log("No working GPG binary: install GPG or pass --noverify to skip verification"); console.log("No working GPG binary: install GPG or pass --noverify to skip verification");
@ -186,6 +199,15 @@ async function main() {
} catch (e) { } catch (e) {
} }
if (cfgDir.length) {
const configJsonSource = path.join(cfgDir, 'config.json');
const configJsonDest = path.join(expectedDeployDir, 'config.json');
console.log(configJsonSource + ' -> ' + configJsonDest);
await fsPromises.copyFile(configJsonSource, configJsonDest);
} else {
console.log("Skipping config file");
}
console.log("Pack " + expectedDeployDir + " -> " + ASAR_PATH); console.log("Pack " + expectedDeployDir + " -> " + ASAR_PATH);
await asar.createPackage(expectedDeployDir, ASAR_PATH); await asar.createPackage(expectedDeployDir, ASAR_PATH);
console.log("Done!"); console.log("Done!");