feat(install): build the Flutter web app in Docker, optional ./install --apk, chosen web password, startup report
This commit is contained in:
@@ -38,15 +38,29 @@ class AppUpdate {
|
||||
}
|
||||
}
|
||||
|
||||
/// Where a server's app builds live: the preview origin beside it (same host,
|
||||
/// port 8096) under `/updates/`.
|
||||
Uri? updatesBaseFor(Uri endpoint) {
|
||||
/// Where a build set its update feed (`--dart-define=PIPELINES_UPDATES_URL`),
|
||||
/// blank for the default.
|
||||
const configuredUpdatesUrl = String.fromEnvironment('PIPELINES_UPDATES_URL');
|
||||
|
||||
/// The update feed for [endpoint]: `/updates/` on the server's own web origin
|
||||
/// (the installed web proxy serves the APK there), or [configured] when the
|
||||
/// build named another feed.
|
||||
Uri? updatesBaseFor(Uri endpoint, {String configured = configuredUpdatesUrl}) {
|
||||
final override = configured.trim();
|
||||
if (override.isNotEmpty) {
|
||||
final parsed = Uri.tryParse(override);
|
||||
if (parsed != null && parsed.hasScheme && parsed.host.isNotEmpty) {
|
||||
return parsed.path.endsWith('/')
|
||||
? parsed
|
||||
: parsed.replace(path: '${parsed.path}/');
|
||||
}
|
||||
}
|
||||
if (endpoint.host.isEmpty) return null;
|
||||
final secure = endpoint.scheme == 'wss' || endpoint.scheme == 'https';
|
||||
return Uri(
|
||||
scheme: secure ? 'https' : 'http',
|
||||
host: endpoint.host,
|
||||
port: 8096,
|
||||
port: endpoint.hasPort ? endpoint.port : null,
|
||||
path: '/updates/',
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user