From d604c01114bdbbf56fb455b60b8bc0ce6dbb8e38 Mon Sep 17 00:00:00 2001 From: ariskadatabisnis Date: Tue, 30 Jun 2026 13:10:35 +0700 Subject: [PATCH 1/3] chat --- Files/BackOne/addons/comms-core/addon.json | 10 + Makefile | 4 + Support/BackOne/app/addon-loader.js | 57 + Support/BackOne/app/auth-store.js | 195 ++ Support/BackOne/app/contacts-store.js | 57 + Support/BackOne/app/index.html | 42 + Support/BackOne/app/main.js | 228 ++ Support/BackOne/app/network-session.js | 178 + Support/BackOne/app/peer-directory.js | 266 ++ Support/BackOne/app/peer-picker.js | 151 + Support/BackOne/app/styles.css | 53 + addons/chat/addon.json | 30 + addons/chat/frontend/index.js | 160 + addons/comms-core/addon.json | 10 + addons/comms-core/schema.sql | 32 + addons/updater/addon.json | 10 + addons/updater/backone-updater | 129 + addons/updater/merge-local-conf.sh | 55 + .../migrations/001_zerotier_to_backone.sh | 12 + .../migrations/002_register_addon_host.sh | 8 + .../003_enable_webserver_defaults.sh | 7 + addons/updater/rebuild-addon-manifest.sh | 60 + addons/updater/sync-authtoken.sh | 53 + addons/video/addon.json | 30 + addons/video/frontend/index.js | 206 ++ addons/voice/addon.json | 31 + addons/voice/frontend/index.js | 164 + app-shell/dist/addon-loader.js | 57 + app-shell/dist/auth-store.js | 195 ++ app-shell/dist/contacts-store.js | 57 + app-shell/dist/index.html | 43 + app-shell/dist/main.js | 237 ++ app-shell/dist/network-session.js | 178 + app-shell/dist/peer-directory.js | 266 ++ app-shell/dist/peer-picker.js | 193 ++ app-shell/dist/styles.css | 643 ++++ app-tray/addon.json | 6 + app-tray/backone-tray-autostart.desktop | 9 + app-tray/backone-tray.desktop | 8 + app-tray/backone-tray.py | 127 + backone.spec | 11 +- ci/scripts/bump_version.sh | 34 + ci/scripts/munge_debian_changelog.sh | 2 +- ci/scripts/sync-authtoken.sh | 53 + controller/EmbeddedNetworkController.cpp | 6 + ...1de74b130f35082fb45a12e9ead42ad5c775f9b64f | 1825 ++++++++++ ...6353de7a884a79d3f1d6b3fbf48f99037f5f95fe27 | 1462 ++++++++ debian/.debhelper/bucket/index | 2 + .../dh_installchangelogs.dch.trimmed | 257 ++ .../installed-by-dh_installman | 0 .../dh_installchangelogs.dch.trimmed | 257 ++ .../installed-by-dh_installman | 0 .../dh_installchangelogs.dch.trimmed | 257 ++ .../installed-by-dh_installman | 0 .../dh_installchangelogs.dch.trimmed | 257 ++ .../installed-by-dh_installman | 0 .../dh_installchangelogs.dch.trimmed | 257 ++ .../installed-by-dh_installman | 0 .../dh_installchangelogs.dch.trimmed | 257 ++ .../installed-by-dh_installman | 0 .../dh_installchangelogs.dch.trimmed | 257 ++ .../installed-by-dh_installman | 0 debian/backone-addon-chat.postinst | 12 + debian/backone-addon-chat.substvars | 2 + debian/backone-addon-chat/DEBIAN/control | 12 + debian/backone-addon-chat/DEBIAN/md5sums | 3 + debian/backone-addon-chat/DEBIAN/postinst | 12 + .../share/doc/backone-addon-chat/changelog.gz | Bin 0 -> 1335 bytes debian/backone-addon-common.postinst | 12 + debian/backone-addon-comms-core.postinst | 12 + debian/backone-addon-comms-core.substvars | 2 + .../backone-addon-comms-core/DEBIAN/control | 13 + .../backone-addon-comms-core/DEBIAN/md5sums | 3 + .../backone-addon-comms-core/DEBIAN/postinst | 12 + .../doc/backone-addon-comms-core/changelog.gz | Bin 0 -> 1338 bytes debian/backone-addon-updater.postinst | 12 + debian/backone-addon-updater.substvars | 2 + debian/backone-addon-updater/DEBIAN/control | 12 + debian/backone-addon-updater/DEBIAN/md5sums | 8 + debian/backone-addon-updater/DEBIAN/postinst | 12 + .../usr/bin/backone-updater | 1 + .../doc/backone-addon-updater/changelog.gz | Bin 0 -> 1335 bytes debian/backone-addon-video.postinst | 12 + debian/backone-addon-video.substvars | 2 + debian/backone-addon-video/DEBIAN/control | 12 + debian/backone-addon-video/DEBIAN/md5sums | 3 + debian/backone-addon-video/DEBIAN/postinst | 12 + .../doc/backone-addon-video/changelog.gz | Bin 0 -> 1335 bytes debian/backone-addon-voice.postinst | 12 + debian/backone-addon-voice.substvars | 2 + debian/backone-addon-voice/DEBIAN/control | 12 + debian/backone-addon-voice/DEBIAN/md5sums | 3 + debian/backone-addon-voice/DEBIAN/postinst | 12 + .../doc/backone-addon-voice/changelog.gz | Bin 0 -> 1335 bytes debian/backone-app-shell.postinst | 15 + debian/backone-app-shell.substvars | 2 + debian/backone-app-shell/DEBIAN/control | 12 + debian/backone-app-shell/DEBIAN/md5sums | 11 + debian/backone-app-shell/DEBIAN/postinst | 15 + .../share/doc/backone-app-shell/changelog.gz | Bin 0 -> 1335 bytes debian/backone-app-tray.postinst | 12 + debian/backone-app-tray.substvars | 2 + debian/backone-app-tray/DEBIAN/conffiles | 1 + debian/backone-app-tray/DEBIAN/control | 13 + debian/backone-app-tray/DEBIAN/md5sums | 4 + debian/backone-app-tray/DEBIAN/postinst | 12 + .../autostart/backone-tray-autostart.desktop | 9 + debian/backone-app-tray/usr/bin/backone-tray | 127 + .../share/applications/backone-tray.desktop | 8 + .../share/doc/backone-app-tray/changelog.gz | Bin 0 -> 1335 bytes debian/backone.postinst.debhelper | 30 + debian/backone.postrm.debhelper | 12 + debian/backone.prerm.debhelper | 5 + debian/backone.service | 12 + debian/backone.substvars | 3 + debian/changelog | 23 + debian/control | 77 +- debian/debhelper-build-stamp | 8 + debian/postinst | 30 +- debian/preinst | 13 + debian/prerm | 13 + debian/rules | 24 +- debian/version | 1 + doc/backone-cli.1 | 83 + doc/backone-idtool.1 | 84 + doc/backone.8 | 104 + ext/installfiles/linux/backone.te | 14 + ext/libpqxx-7.7.3/config/config.guess | 1618 +++++---- ext/libpqxx-7.7.3/config/config.sub | 2983 +++++++++-------- make-linux.mk | 29 +- make-mac.mk | 8 + make-windows.mk | 16 + make/install-addons.mk | 102 + objects.mk | 1 + one.cpp | 20 +- osdep/OSUtils.cpp | 14 + osdep/OSUtils.hpp | 5 + pkg/common/platform-paths.sh | 49 + pkg/mac/build-addon-pkgs.sh | 49 + pkg/mac/scripts/postinstall | 18 + pkg/windows/build-addon-packages.ps1 | 65 + service/AddonHost.cpp | 283 ++ service/AddonHost.hpp | 66 + service/OneService.cpp | 65 +- version.h | 2 +- 145 files changed, 13678 insertions(+), 2169 deletions(-) create mode 100644 Files/BackOne/addons/comms-core/addon.json create mode 100644 Support/BackOne/app/addon-loader.js create mode 100644 Support/BackOne/app/auth-store.js create mode 100644 Support/BackOne/app/contacts-store.js create mode 100644 Support/BackOne/app/index.html create mode 100644 Support/BackOne/app/main.js create mode 100644 Support/BackOne/app/network-session.js create mode 100644 Support/BackOne/app/peer-directory.js create mode 100644 Support/BackOne/app/peer-picker.js create mode 100644 Support/BackOne/app/styles.css create mode 100644 addons/chat/addon.json create mode 100644 addons/chat/frontend/index.js create mode 100644 addons/comms-core/addon.json create mode 100644 addons/comms-core/schema.sql create mode 100644 addons/updater/addon.json create mode 100755 addons/updater/backone-updater create mode 100644 addons/updater/merge-local-conf.sh create mode 100755 addons/updater/migrations/001_zerotier_to_backone.sh create mode 100755 addons/updater/migrations/002_register_addon_host.sh create mode 100644 addons/updater/migrations/003_enable_webserver_defaults.sh create mode 100755 addons/updater/rebuild-addon-manifest.sh create mode 100755 addons/updater/sync-authtoken.sh create mode 100644 addons/video/addon.json create mode 100644 addons/video/frontend/index.js create mode 100644 addons/voice/addon.json create mode 100644 addons/voice/frontend/index.js create mode 100644 app-shell/dist/addon-loader.js create mode 100644 app-shell/dist/auth-store.js create mode 100644 app-shell/dist/contacts-store.js create mode 100644 app-shell/dist/index.html create mode 100644 app-shell/dist/main.js create mode 100644 app-shell/dist/network-session.js create mode 100644 app-shell/dist/peer-directory.js create mode 100644 app-shell/dist/peer-picker.js create mode 100644 app-shell/dist/styles.css create mode 100644 app-tray/addon.json create mode 100644 app-tray/backone-tray-autostart.desktop create mode 100644 app-tray/backone-tray.desktop create mode 100755 app-tray/backone-tray.py create mode 100755 ci/scripts/bump_version.sh create mode 100644 ci/scripts/sync-authtoken.sh create mode 100755 debian/.debhelper/bucket/files/1ee0b1581032c46aac6ebd1de74b130f35082fb45a12e9ead42ad5c775f9b64f create mode 100755 debian/.debhelper/bucket/files/8131853dbc8c3be5171fa96353de7a884a79d3f1d6b3fbf48f99037f5f95fe27 create mode 100644 debian/.debhelper/bucket/index create mode 100644 debian/.debhelper/generated/backone-addon-chat/dh_installchangelogs.dch.trimmed create mode 100644 debian/.debhelper/generated/backone-addon-chat/installed-by-dh_installman create mode 100644 debian/.debhelper/generated/backone-addon-comms-core/dh_installchangelogs.dch.trimmed create mode 100644 debian/.debhelper/generated/backone-addon-comms-core/installed-by-dh_installman create mode 100644 debian/.debhelper/generated/backone-addon-updater/dh_installchangelogs.dch.trimmed create mode 100644 debian/.debhelper/generated/backone-addon-updater/installed-by-dh_installman create mode 100644 debian/.debhelper/generated/backone-addon-video/dh_installchangelogs.dch.trimmed create mode 100644 debian/.debhelper/generated/backone-addon-video/installed-by-dh_installman create mode 100644 debian/.debhelper/generated/backone-addon-voice/dh_installchangelogs.dch.trimmed create mode 100644 debian/.debhelper/generated/backone-addon-voice/installed-by-dh_installman create mode 100644 debian/.debhelper/generated/backone-app-shell/dh_installchangelogs.dch.trimmed create mode 100644 debian/.debhelper/generated/backone-app-shell/installed-by-dh_installman create mode 100644 debian/.debhelper/generated/backone-app-tray/dh_installchangelogs.dch.trimmed create mode 100644 debian/.debhelper/generated/backone-app-tray/installed-by-dh_installman create mode 100755 debian/backone-addon-chat.postinst create mode 100644 debian/backone-addon-chat.substvars create mode 100644 debian/backone-addon-chat/DEBIAN/control create mode 100644 debian/backone-addon-chat/DEBIAN/md5sums create mode 100755 debian/backone-addon-chat/DEBIAN/postinst create mode 100644 debian/backone-addon-chat/usr/share/doc/backone-addon-chat/changelog.gz create mode 100755 debian/backone-addon-common.postinst create mode 100755 debian/backone-addon-comms-core.postinst create mode 100644 debian/backone-addon-comms-core.substvars create mode 100644 debian/backone-addon-comms-core/DEBIAN/control create mode 100644 debian/backone-addon-comms-core/DEBIAN/md5sums create mode 100755 debian/backone-addon-comms-core/DEBIAN/postinst create mode 100644 debian/backone-addon-comms-core/usr/share/doc/backone-addon-comms-core/changelog.gz create mode 100755 debian/backone-addon-updater.postinst create mode 100644 debian/backone-addon-updater.substvars create mode 100644 debian/backone-addon-updater/DEBIAN/control create mode 100644 debian/backone-addon-updater/DEBIAN/md5sums create mode 100755 debian/backone-addon-updater/DEBIAN/postinst create mode 120000 debian/backone-addon-updater/usr/bin/backone-updater create mode 100644 debian/backone-addon-updater/usr/share/doc/backone-addon-updater/changelog.gz create mode 100755 debian/backone-addon-video.postinst create mode 100644 debian/backone-addon-video.substvars create mode 100644 debian/backone-addon-video/DEBIAN/control create mode 100644 debian/backone-addon-video/DEBIAN/md5sums create mode 100755 debian/backone-addon-video/DEBIAN/postinst create mode 100644 debian/backone-addon-video/usr/share/doc/backone-addon-video/changelog.gz create mode 100755 debian/backone-addon-voice.postinst create mode 100644 debian/backone-addon-voice.substvars create mode 100644 debian/backone-addon-voice/DEBIAN/control create mode 100644 debian/backone-addon-voice/DEBIAN/md5sums create mode 100755 debian/backone-addon-voice/DEBIAN/postinst create mode 100644 debian/backone-addon-voice/usr/share/doc/backone-addon-voice/changelog.gz create mode 100755 debian/backone-app-shell.postinst create mode 100644 debian/backone-app-shell.substvars create mode 100644 debian/backone-app-shell/DEBIAN/control create mode 100644 debian/backone-app-shell/DEBIAN/md5sums create mode 100755 debian/backone-app-shell/DEBIAN/postinst create mode 100644 debian/backone-app-shell/usr/share/doc/backone-app-shell/changelog.gz create mode 100644 debian/backone-app-tray.postinst create mode 100644 debian/backone-app-tray.substvars create mode 100644 debian/backone-app-tray/DEBIAN/conffiles create mode 100644 debian/backone-app-tray/DEBIAN/control create mode 100644 debian/backone-app-tray/DEBIAN/md5sums create mode 100755 debian/backone-app-tray/DEBIAN/postinst create mode 100644 debian/backone-app-tray/etc/xdg/autostart/backone-tray-autostart.desktop create mode 100755 debian/backone-app-tray/usr/bin/backone-tray create mode 100644 debian/backone-app-tray/usr/share/applications/backone-tray.desktop create mode 100644 debian/backone-app-tray/usr/share/doc/backone-app-tray/changelog.gz create mode 100644 debian/backone.postinst.debhelper create mode 100644 debian/backone.postrm.debhelper create mode 100644 debian/backone.prerm.debhelper create mode 100644 debian/backone.service create mode 100644 debian/backone.substvars create mode 100644 debian/debhelper-build-stamp create mode 100644 debian/preinst create mode 100644 debian/prerm mode change 100644 => 100755 debian/rules create mode 100644 debian/version create mode 100644 doc/backone-cli.1 create mode 100644 doc/backone-idtool.1 create mode 100644 doc/backone.8 create mode 100644 ext/installfiles/linux/backone.te create mode 100644 make-windows.mk create mode 100644 make/install-addons.mk create mode 100644 pkg/common/platform-paths.sh create mode 100755 pkg/mac/build-addon-pkgs.sh create mode 100755 pkg/mac/scripts/postinstall create mode 100644 pkg/windows/build-addon-packages.ps1 create mode 100644 service/AddonHost.cpp create mode 100644 service/AddonHost.hpp diff --git a/Files/BackOne/addons/comms-core/addon.json b/Files/BackOne/addons/comms-core/addon.json new file mode 100644 index 0000000..dae6899 --- /dev/null +++ b/Files/BackOne/addons/comms-core/addon.json @@ -0,0 +1,10 @@ +{ + "id": "comms-core", + "name": "Comms Core", + "version": "1.17.1", + "requires": [], + "backend": { + "routes": ["/controller/comms"], + "websocketEvents": ["presence", "incoming_call", "call_state", "chat_message"] + } +} diff --git a/Makefile b/Makefile index 1bedf30..c9dec26 100644 --- a/Makefile +++ b/Makefile @@ -27,6 +27,10 @@ ifeq ($(OSTYPE),NetBSD) include make-netbsd.mk endif +ifeq ($(OS),Windows_NT) + include make-windows.mk +endif + drone: @echo "rendering .drone.yaml from .drone.jsonnet" drone jsonnet --format --stream diff --git a/Support/BackOne/app/addon-loader.js b/Support/BackOne/app/addon-loader.js new file mode 100644 index 0000000..5fffc36 --- /dev/null +++ b/Support/BackOne/app/addon-loader.js @@ -0,0 +1,57 @@ +window.BackOneRingingPopup = { + _audio: null, + showIncomingCall({ callerName, callType, callId, onAccept, onReject }) { + const el = document.getElementById('ringing-popup'); + if (!el) return; + el.classList.remove('ringing-hidden'); + el.innerHTML = ` +
+

Incoming ${callType} call

+

${callerName || 'Unknown peer'}

+ + +
`; + el.querySelector('.ringing-accept').onclick = () => { this.dismiss(); onAccept && onAccept(callId); }; + el.querySelector('.ringing-reject').onclick = () => { this.dismiss(); onReject && onReject(callId); }; + this.playRingtone(); + if (Notification.permission === 'default') Notification.requestPermission(); + if (Notification.permission === 'granted') { + new Notification(`Incoming ${callType} call`, { body: callerName || 'BackOne peer' }); + } + }, + dismiss() { + const el = document.getElementById('ringing-popup'); + if (el) { el.classList.add('ringing-hidden'); el.innerHTML = ''; } + this.stopRingtone(); + }, + playRingtone() { + this.stopRingtone(); + try { + this._audio = new Audio('data:audio/wav;base64,UklGRnoGAABXQVZFZm10IBAAAAABAAEAQB8AAEAfAAABAAgAZGF0YQoGAACBhYqFbF1fdJivrJBhNjVgodDbq2EcBj+a2/LDciUFLIHO8tiJNwgZaLvt559NEAxQp+PwtmMcBjiR1/LMeSwFJHfH8N2QQAoUXrTp66hVFApGn+DyvmwhBSuBzvLZiTYIG2m98OScTgwOUarm7blmHgU7k9n1unEiBC13y+/ek0EKElyx5+ytWBUIQ5zd8sFuJAUwgM/z2Ik6CBxpvfDknE4MDlGq5u25Zh4FO5PZ9br'); + this._audio.loop = true; + this._audio.play().catch(() => {}); + } catch (_) {} + }, + stopRingtone() { + if (this._audio) { this._audio.pause(); this._audio = null; } + } +}; + +async function loadAddonManifest() { + const res = await fetch('/app/addons/manifest.json', { cache: 'no-store' }); + if (!res.ok) { + console.warn('manifest.json fetch failed:', res.status); + return []; + } + const data = await res.json(); + return Array.isArray(data) ? data : []; +} + +async function loadAddonModule(entry) { + const entryPath = entry.frontend && entry.frontend.entry ? entry.frontend.entry : `/app/addons/${entry.id}/index.js`; + await import(entryPath); + const factory = window.BackOneAddons && window.BackOneAddons[entry.id]; + return factory ? factory() : null; +} + +window.BackOneAddonLoader = { loadAddonManifest, loadAddonModule }; diff --git a/Support/BackOne/app/auth-store.js b/Support/BackOne/app/auth-store.js new file mode 100644 index 0000000..533f850 --- /dev/null +++ b/Support/BackOne/app/auth-store.js @@ -0,0 +1,195 @@ +/** + * BackOne API auth — same token as backone-cli (~/.backOneOneAuthToken / X-ZT1-Auth). + */ +window.BackOneAuth = (function () { + const LS_KEY = 'backone.authToken'; + let cache = null; + + function trimToken(s) { + return String(s || '').replace(/\s+/g, ''); + } + + function tokenFromUrl() { + try { + const params = new URLSearchParams(location.search); + const fromQuery = trimToken(params.get('auth') || params.get('token')); + if (fromQuery) return fromQuery; + const hash = (location.hash || '').replace(/^#\/?/, ''); + const hashParams = new URLSearchParams(hash.includes('?') ? hash.split('?')[1] : ''); + return trimToken(hashParams.get('auth') || hashParams.get('token')); + } catch (_) { + return ''; + } + } + + async function probeToken(token) { + if (!token) return false; + try { + const res = await fetch('/network', { + cache: 'no-store', + headers: { 'X-ZT1-Auth': token } + }); + return res.ok; + } catch (_) { + return false; + } + } + + async function fetchAuthtoken() { + for (const path of ['/api/backone/authtoken', '/app/api/authtoken']) { + try { + const res = await fetch(path, { cache: 'no-store' }); + if (res.ok) { + const data = await res.json(); + const token = trimToken(data && data.token); + if (token) return token; + } + } catch (_) { + /* try next */ + } + } + return ''; + } + + async function resolveToken() { + const urlToken = tokenFromUrl(); + if (urlToken) { + if (await probeToken(urlToken)) { + return urlToken; + } + } + + const stored = trimToken(localStorage.getItem(LS_KEY)); + if (stored && await probeToken(stored)) { + return stored; + } + + const apiToken = await fetchAuthtoken(); + if (apiToken && await probeToken(apiToken)) { + return apiToken; + } + + if (stored) return stored; + if (apiToken) return apiToken; + if (urlToken) return urlToken; + return ''; + } + + async function getToken() { + if (cache) return cache; + cache = await resolveToken(); + return cache || ''; + } + + async function authHeaders(extra) { + const token = await getToken(); + const headers = Object.assign({}, extra || {}); + if (token) { + headers['X-ZT1-Auth'] = token; + } + return headers; + } + + async function fetchWithAuth(path, options) { + options = options || {}; + const headers = await authHeaders(options.headers || {}); + return fetch(path, Object.assign({}, options, { headers })); + } + + async function apiGet(path) { + const res = await fetchWithAuth(path, { cache: 'no-store' }); + if (!res.ok) throw new Error(`${path} returned ${res.status}`); + return res.json(); + } + + async function apiGetFirst(paths) { + let lastErr = null; + for (const path of paths) { + try { + return await apiGet(path); + } catch (err) { + lastErr = err; + } + } + throw lastErr || new Error('API request failed'); + } + + async function apiSend(path, method, body) { + const headers = await authHeaders( + body != null ? { 'Content-Type': 'application/json' } : {} + ); + const res = await fetch(path, { + method, + headers, + body: body != null ? JSON.stringify(body) : undefined + }); + if (!res.ok) { + const text = await res.text().catch(() => ''); + throw new Error(text || `${method} ${path} returned ${res.status}`); + } + if (res.status === 204) { + return { result: true }; + } + const text = await res.text(); + if (!text) { + return { result: true }; + } + try { + return JSON.parse(text); + } catch (_) { + return { result: true }; + } + } + + async function apiSendFirst(paths, method, body) { + let lastErr = null; + for (const path of paths) { + try { + return await apiSend(path, method, body); + } catch (err) { + lastErr = err; + } + } + throw lastErr || new Error(`${method} failed`); + } + + /** Store token from ~/.backOneOneAuthToken (same as backone-cli). */ + async function setUserToken(token) { + cache = trimToken(token); + if (cache) { + localStorage.setItem(LS_KEY, cache); + } else { + localStorage.removeItem(LS_KEY); + } + return cache; + } + + async function validateCurrentToken() { + cache = null; + const token = await getToken(); + if (!token) return false; + return probeToken(token); + } + + function invalidate() { + cache = null; + } + + async function init() { + return getToken(); + } + + return { + getToken, + authHeaders, + fetchWithAuth, + apiGet, + apiGetFirst, + apiSend, + apiSendFirst, + setUserToken, + validateCurrentToken, + invalidate, + init + }; +})(); diff --git a/Support/BackOne/app/contacts-store.js b/Support/BackOne/app/contacts-store.js new file mode 100644 index 0000000..01a0cd8 --- /dev/null +++ b/Support/BackOne/app/contacts-store.js @@ -0,0 +1,57 @@ +window.BackOneContacts = (function () { + let cache = null; + + async function load() { + if (cache) return cache; + try { + const res = await BackOneAuth.fetchWithAuth('/api/backone/contacts', { cache: 'no-store' }) + .catch(() => BackOneAuth.fetchWithAuth('/app/api/contacts', { cache: 'no-store' })); + if (!res.ok) { + cache = {}; + return cache; + } + cache = await res.json(); + if (!cache || typeof cache !== 'object') cache = {}; + } catch (_) { + cache = {}; + } + return cache; + } + + function getDisplayName(peerId, controllerName) { + const c = cache || {}; + const entry = c[peerId]; + if (entry && entry.nickname) return entry.nickname; + if (controllerName) return controllerName; + return peerId; + } + + function getNickname(peerId) { + const entry = (cache || {})[peerId]; + return entry && entry.nickname ? entry.nickname : ''; + } + + async function setNickname(peerId, nickname) { + await load(); + const patch = {}; + patch[peerId] = { nickname: nickname || '' }; + const res = await BackOneAuth.fetchWithAuth('/api/backone/contacts', { + method: 'PUT', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify(patch) + }).catch(() => BackOneAuth.fetchWithAuth('/app/api/contacts', { + method: 'PUT', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify(patch) + })); + if (!res.ok) throw new Error('Failed to save nickname'); + cache = await res.json(); + return cache; + } + + function invalidate() { + cache = null; + } + + return { load, getDisplayName, getNickname, setNickname, invalidate }; +})(); diff --git a/Support/BackOne/app/index.html b/Support/BackOne/app/index.html new file mode 100644 index 0000000..e44c47a --- /dev/null +++ b/Support/BackOne/app/index.html @@ -0,0 +1,42 @@ + + + + + + BackOne + + + +
+

BackOne

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

Select an addon from the navigation bar.

+
+
+ + + + + + + + + diff --git a/Support/BackOne/app/main.js b/Support/BackOne/app/main.js new file mode 100644 index 0000000..a4daa4f --- /dev/null +++ b/Support/BackOne/app/main.js @@ -0,0 +1,228 @@ +window.BackOneAddons = window.BackOneAddons || {}; + +const addonButtons = {}; +let addonModules = {}; +let coreRefreshTimer = null; + +function hashAddonId() { + const h = (location.hash || '').replace(/^#\/?/, '').toLowerCase(); + if (h === 'voice' || h === 'video' || h === 'chat') return h; + return ''; +} + +function activateAddon(id) { + const btn = addonButtons[id]; + if (!btn) return; + btn.click(); +} + +function escapeHtml(s) { + return String(s).replace(/&/g, '&').replace(//g, '>'); +} + +function networkLabel(n) { + if (!n) return ''; + return n.name ? `${n.name} (${n.id})` : n.id; +} + +function renderCoreStatus(statusEl) { + const core = BackOneNetworkSession.getCoreStatus(); + const net = BackOneNetworkSession.getActiveNetwork(); + if (!core.online) { + statusEl.innerHTML = ' BackOne offline — start backone service'; + return; + } + const netPart = net ? networkLabel(net) : 'no network joined'; + const addr = core.address ? ` · ${escapeHtml(core.address)}` : ''; + const authNote = core.authenticated + ? ' · auth token OK' + : ' · paste ~/.backOneOneAuthToken below'; + statusEl.innerHTML = + ` BackOne online${addr} · ` + + `${escapeHtml(netPart)} · ${core.leafPeerCount} peer(s)${authNote}`; +} + +async function initAuthTokenBar(statusEl, onSaved) { + const bar = document.getElementById('auth-token-bar'); + const input = document.getElementById('auth-token-input'); + const saveBtn = document.getElementById('auth-token-save'); + if (!bar || !input || !saveBtn) return; + + async function refreshAuthUi() { + const ok = await BackOneAuth.validateCurrentToken(); + bar.classList.toggle('auth-token-hidden', ok); + if (!ok && !input.value) { + input.placeholder = 'Paste from ~/.backOneOneAuthToken'; + } + return ok; + } + + saveBtn.addEventListener('click', async () => { + const token = input.value.trim(); + if (!token) { + if (statusEl) statusEl.textContent = 'Paste the token from ~/.backOneOneAuthToken'; + return; + } + saveBtn.disabled = true; + await BackOneAuth.setUserToken(token); + BackOneAuth.invalidate(); + const ok = await BackOneAuth.validateCurrentToken(); + if (!ok) { + if (statusEl) statusEl.textContent = 'Token rejected — check ~/.backOneOneAuthToken matches the running backone service'; + saveBtn.disabled = false; + return; + } + input.value = ''; + bar.classList.add('auth-token-hidden'); + if (typeof onSaved === 'function') await onSaved(); + saveBtn.disabled = false; + }); + + await refreshAuthUi(); + return refreshAuthUi; +} + +async function initNetworkBar() { + const bar = document.getElementById('network-bar'); + if (!bar) return; + + const netSel = bar.querySelector('#global-network'); + const joinInput = bar.querySelector('#global-join-id'); + const joinBtn = bar.querySelector('#global-join-btn'); + const leaveBtn = bar.querySelector('#global-leave-btn'); + const statusEl = bar.querySelector('#global-network-status'); + + async function reloadNetworkList(selectId) { + await BackOneNetworkSession.syncFromCore(); + const networks = await BackOneNetworkSession.loadNetworks(); + netSel.innerHTML = networks.map(n => + `` + ).join('') || ''; + + const want = (selectId || BackOneNetworkSession.getNetworkId() || '').toLowerCase(); + if (want && networks.some(n => (n.id || '').toLowerCase() === want)) { + netSel.value = networks.find(n => (n.id || '').toLowerCase() === want).id; + await BackOneNetworkSession.selectNetwork(netSel.value); + } else if (networks.length === 1) { + netSel.value = networks[0].id; + await BackOneNetworkSession.selectNetwork(networks[0].id); + } else if (networks.length > 0 && BackOneNetworkSession.getNetworkId()) { + netSel.value = BackOneNetworkSession.getNetworkId(); + } + renderCoreStatus(statusEl); + } + + netSel.addEventListener('change', async () => { + if (!netSel.value) return; + statusEl.textContent = 'Switching network…'; + await BackOneNetworkSession.selectNetwork(netSel.value); + await BackOneNetworkSession.syncFromCore(); + renderCoreStatus(statusEl); + }); + + joinBtn.addEventListener('click', async () => { + const id = BackOnePeerDirectory.normalizeNetworkId(joinInput.value); + if (!id) { + statusEl.textContent = 'Enter a 16-digit hexadecimal network ID'; + return; + } + joinBtn.disabled = true; + leaveBtn.disabled = true; + statusEl.textContent = `Joining ${id}…`; + try { + await BackOneNetworkSession.joinNetwork(id); + joinInput.value = ''; + await reloadNetworkList(id); + } catch (err) { + statusEl.textContent = err.message || 'Join failed'; + } finally { + joinBtn.disabled = false; + leaveBtn.disabled = false; + } + }); + + leaveBtn.addEventListener('click', async () => { + const id = netSel.value || BackOneNetworkSession.getNetworkId(); + if (!id) { + statusEl.textContent = 'Select a network to leave'; + return; + } + if (!confirm(`Leave network ${networkLabel(BackOneNetworkSession.getActiveNetwork() || { id })}?`)) return; + joinBtn.disabled = true; + leaveBtn.disabled = true; + statusEl.textContent = `Leaving ${id}…`; + try { + await BackOneNetworkSession.leaveNetwork(id); + await reloadNetworkList(); + } catch (err) { + statusEl.textContent = err.message || 'Leave failed'; + } finally { + joinBtn.disabled = false; + leaveBtn.disabled = false; + } + }); + + BackOneNetworkSession.subscribe(() => renderCoreStatus(statusEl)); + + const refreshAuthUi = await initAuthTokenBar(statusEl, () => reloadNetworkList()); + + await reloadNetworkList(); + if (refreshAuthUi) await refreshAuthUi(); + + coreRefreshTimer = setInterval(() => { + BackOneNetworkSession.syncFromCore().then(() => renderCoreStatus(statusEl)); + }, 45000); +} + +async function initAppShell() { + await BackOneAuth.init(); + await initNetworkBar(); + + const nav = document.getElementById('addon-nav'); + const panel = document.getElementById('addon-panel'); + const addons = await BackOneAddonLoader.loadAddonManifest(); + if (!addons.length) { + panel.innerHTML = '

No UI addons found. Install backone-addon-voice, backone-addon-video, or backone-addon-chat, then run: sudo backone-updater rebuild-manifest and restart backone.

'; + return; + } + + for (const entry of addons) { + const mod = await BackOneAddonLoader.loadAddonModule(entry); + if (mod) addonModules[entry.id] = mod; + const btn = document.createElement('button'); + btn.dataset.addonId = entry.id; + btn.textContent = (entry.frontend && entry.frontend.navLabel) || entry.name || entry.id; + btn.onclick = () => { + nav.querySelectorAll('button').forEach(b => b.classList.remove('active')); + btn.classList.add('active'); + panel.innerHTML = ''; + if (addonModules[entry.id] && addonModules[entry.id].mount) { + addonModules[entry.id].mount(panel); + } else { + panel.innerHTML = `

Addon "${entry.id}" loaded.

`; + } + }; + addonButtons[entry.id] = btn; + nav.appendChild(btn); + } + + const fromHash = hashAddonId(); + if (fromHash && addonButtons[fromHash]) { + activateAddon(fromHash); + } else { + nav.querySelector('button')?.click(); + } +} + +window.addEventListener('hashchange', () => { + const id = hashAddonId(); + if (id) activateAddon(id); +}); + +document.addEventListener('visibilitychange', () => { + if (document.visibilityState === 'visible') { + BackOneNetworkSession.syncFromCore(); + } +}); + +document.addEventListener('DOMContentLoaded', initAppShell); diff --git a/Support/BackOne/app/network-session.js b/Support/BackOne/app/network-session.js new file mode 100644 index 0000000..4a394a6 --- /dev/null +++ b/Support/BackOne/app/network-session.js @@ -0,0 +1,178 @@ +/** + * Single BackOne core network for all addons (same as backone-cli listnetworks/join). + */ +window.BackOneNetworkSession = (function () { + const NETWORK_KEY = 'backone.lastNetworkId'; + const PEER_KEY = 'backone.lastPeerId'; + + let activeNetwork = null; + let selectedPeer = null; + let coreStatus = { online: false, address: '', networkCount: 0, leafPeerCount: 0, authenticated: false }; + const listeners = new Set(); + + function emit() { + const snap = { + network: activeNetwork, + networkId: getNetworkId(), + peer: selectedPeer, + core: { ...coreStatus } + }; + listeners.forEach(fn => { + try { fn(snap); } catch (_) { /* ignore */ } + }); + } + + function getNetworkId() { + return (localStorage.getItem(NETWORK_KEY) || '').toLowerCase(); + } + + function setNetworkId(id) { + const nwid = BackOnePeerDirectory.normalizeNetworkId(id); + if (nwid) { + localStorage.setItem(NETWORK_KEY, nwid); + } else { + localStorage.removeItem(NETWORK_KEY); + } + BackOnePeerDirectory.setLastNetworkId(nwid); + return nwid; + } + + function getSelectedPeerId() { + return (localStorage.getItem(PEER_KEY) || '').toLowerCase(); + } + + function setSelectedPeer(peer) { + selectedPeer = peer || null; + if (peer && peer.peerId) { + localStorage.setItem(PEER_KEY, peer.peerId); + } else { + localStorage.removeItem(PEER_KEY); + } + emit(); + } + + function pickDefaultNetworkId(networks) { + if (!networks.length) return ''; + const stored = getNetworkId(); + if (stored && networks.some(n => (n.id || '').toLowerCase() === stored)) { + return stored; + } + const preferred = networks.find(n => n.status === 'OK') + || networks.find(n => n.status === 'REQUESTING_CONFIGURATION') + || networks[0]; + return preferred ? (preferred.id || '').toLowerCase() : ''; + } + + /** + * On app start: read BackOne core state (same as backone-cli info / listnetworks / peers). + */ + async function syncFromCore() { + const token = await BackOneAuth.getToken(); + const [status, networks, cliPeers] = await Promise.all([ + BackOnePeerDirectory.loadCoreStatus(), + BackOnePeerDirectory.loadNetworks(), + BackOnePeerDirectory.loadCliPeers() + ]); + + coreStatus = { + online: !!(status && status.online), + address: (status && status.address) || '', + version: (status && status.version) || '', + networkCount: networks.length, + leafPeerCount: BackOnePeerDirectory.countLeafPeers(cliPeers), + authenticated: !!token + }; + + const pick = pickDefaultNetworkId(networks); + if (pick) { + setNetworkId(pick); + activeNetwork = networks.find(n => (n.id || '').toLowerCase() === pick) + || await BackOnePeerDirectory.loadNetwork(pick); + } else { + setNetworkId(''); + activeNetwork = null; + } + + emit(); + return { coreStatus, activeNetwork, networks }; + } + + async function refresh() { + const id = getNetworkId(); + if (!id) { + activeNetwork = null; + emit(); + return null; + } + activeNetwork = await BackOnePeerDirectory.loadNetwork(id); + if (!activeNetwork) { + activeNetwork = { id, name: id, status: 'UNKNOWN' }; + } + emit(); + return activeNetwork; + } + + async function loadNetworks() { + return BackOnePeerDirectory.loadNetworks(); + } + + async function selectNetwork(nwid) { + const id = setNetworkId(nwid); + if (!id) { + await refresh(); + return null; + } + return refresh(); + } + + async function joinNetwork(nwid) { + const id = BackOnePeerDirectory.normalizeNetworkId(nwid); + if (!id) throw new Error('Network ID must be 16 hexadecimal characters'); + await BackOnePeerDirectory.joinNetwork(id); + return syncFromCore(); + } + + async function leaveNetwork(nwid) { + const id = BackOnePeerDirectory.normalizeNetworkId(nwid || getNetworkId()); + if (!id) throw new Error('No network selected'); + await BackOnePeerDirectory.leaveNetwork(id); + if (getNetworkId() === id) { + setNetworkId(''); + selectedPeer = null; + localStorage.removeItem(PEER_KEY); + } + return syncFromCore(); + } + + function subscribe(fn) { + listeners.add(fn); + return () => listeners.delete(fn); + } + + function requireNetworkId() { + const id = getNetworkId(); + if (!id) throw new Error('Join a BackOne network first (same as backone-cli join)'); + return id; + } + + function getCoreStatus() { + return { ...coreStatus }; + } + + return { + getNetworkId, + getActiveNetwork: () => activeNetwork, + getCoreStatus, + getSelectedPeer: () => selectedPeer, + getSelectedPeerId, + setSelectedPeer, + selectNetwork, + joinNetwork, + leaveNetwork, + loadNetworks, + syncFromCore, + refresh, + subscribe, + requireNetworkId + }; +})(); diff --git a/Support/BackOne/app/peer-directory.js b/Support/BackOne/app/peer-directory.js new file mode 100644 index 0000000..cff0511 --- /dev/null +++ b/Support/BackOne/app/peer-directory.js @@ -0,0 +1,266 @@ +window.BackOnePeerDirectory = (function () { + const NETWORK_KEY = 'backone.lastNetworkId'; + const API = { + peers: ['/api/backone/peers', '/app/api/peers', '/peer'], + networks: ['/api/backone/networks', '/app/api/networks', '/network'], + status: ['/api/backone/status', '/app/api/status', '/status'], + network: (id) => [ + `/api/backone/network/${id}`, + `/app/api/network/${id}`, + `/network/${id}` + ], + members: (id) => [ + `/api/backone/network/${id}/members`, + `/app/api/network/${id}/members`, + `/unstable/controller/network/${id}/member` + ], + join: (id) => [ + `/api/backone/network/${id}`, + `/app/api/network/${id}`, + `/network/${id}` + ], + leave: (id) => [ + `/api/backone/network/${id}`, + `/app/api/network/${id}`, + `/network/${id}` + ] + }; + + function apiGet(path) { + return BackOneAuth.apiGet(path); + } + + /** Same data as `backone-cli -j peers` (GET /peer). */ + async function loadCliPeers() { + try { + const peers = await BackOneAuth.apiGetFirst(API.peers); + return Array.isArray(peers) ? peers : []; + } catch (_) { + return []; + } + } + + /** Same data as `backone-cli -j listnetworks` (GET /network). */ + async function loadNetworks() { + try { + const nets = await BackOneAuth.apiGetFirst(API.networks); + return Array.isArray(nets) ? nets : []; + } catch (_) { + return []; + } + } + + /** Same data as `backone-cli -j info` (GET /status). */ + async function loadCoreStatus() { + try { + return await BackOneAuth.apiGetFirst(API.status); + } catch (_) { + try { + const res = await fetch('/health', { cache: 'no-store' }); + return { online: res.ok }; + } catch (_2) { + return { online: false }; + } + } + } + + function countLeafPeers(cliPeers) { + if (!Array.isArray(cliPeers)) return 0; + return cliPeers.filter(p => !p.role || p.role === 'LEAF').length; + } + + async function loadNetwork(nwid) { + if (!nwid) return null; + const networks = await loadNetworks(); + const found = networks.find(n => n.id === nwid); + if (found) return found; + try { + return await BackOneAuth.apiGetFirst(API.network(nwid)); + } catch (_) { + return null; + } + } + + function getLastNetworkId() { + return localStorage.getItem(NETWORK_KEY) || ''; + } + + function setLastNetworkId(nwid) { + if (nwid) localStorage.setItem(NETWORK_KEY, nwid); + } + + function peerIsOnline(p) { + if (!p) return false; + const paths = p.paths || []; + return paths.some(x => x.active && !x.expired); + } + + function peerLinkLabel(p) { + if (!p) return ''; + if (p.tunneled) return 'RELAY'; + const paths = p.paths || []; + for (const path of paths) { + if (path.preferred && path.active && !path.expired) { + return 'DIRECT'; + } + } + for (const path of paths) { + if (path.active && !path.expired) { + return 'DIRECT'; + } + } + return 'RELAY'; + } + + function peerPreferredPath(p) { + if (!p) return ''; + const paths = p.paths || []; + for (const path of paths) { + if (path.preferred && path.address) return path.address; + } + for (const path of paths) { + if (path.active && path.address) return path.address; + } + return ''; + } + + function cliPeerMap(cliPeers) { + const map = {}; + for (const p of cliPeers) { + const id = (p.address || '').toLowerCase(); + if (id) map[id] = p; + } + return map; + } + + async function loadMemberMap(nwid) { + if (!nwid) return {}; + try { + const data = await BackOneAuth.apiGetFirst(API.members(nwid)); + const map = {}; + if (data && Array.isArray(data.data)) { + for (const m of data.data) { + const id = (m.id || '').toLowerCase(); + if (id) map[id] = m; + } + } + return map; + } catch (_) { + return {}; + } + } + + function buildPeerEntry(peerId, member, cliPeer, networkId, networkName) { + const controllerName = member ? (member.name || '') : ''; + const ips = member && member.ipAssignments ? member.ipAssignments : []; + return { + peerId, + networkId: networkId || '', + networkName: networkName || '', + displayName: BackOneContacts.getDisplayName(peerId, controllerName), + controllerName, + nickname: BackOneContacts.getNickname(peerId), + online: peerIsOnline(cliPeer), + latency: cliPeer && typeof cliPeer.latency === 'number' ? cliPeer.latency : null, + role: (cliPeer && cliPeer.role) || (member ? 'LEAF' : ''), + version: (cliPeer && cliPeer.version) || '', + link: cliPeer ? peerLinkLabel(cliPeer) : '', + path: cliPeer ? peerPreferredPath(cliPeer) : '', + ip: ips.length ? ips[0] : '', + onNetwork: !!member + }; + } + + async function loadPeersForNetwork(nwid) { + if (!nwid) return []; + + const [cliPeers, members, selfStatus, network] = await Promise.all([ + loadCliPeers(), + loadMemberMap(nwid), + loadCoreStatus().catch(() => ({})), + loadNetwork(nwid) + ]); + await BackOneContacts.load(); + + const selfId = ((selfStatus && selfStatus.address) || '').toLowerCase(); + const networkId = nwid; + const networkName = network ? (network.name || network.id || nwid) : nwid; + const cliById = cliPeerMap(cliPeers); + const out = []; + + if (Object.keys(members).length > 0) { + for (const peerId of Object.keys(members)) { + const member = members[peerId]; + if (!member || member.authorized === false) continue; + if (peerId === selfId) continue; + out.push(buildPeerEntry(peerId, member, cliById[peerId], networkId, networkName)); + } + } else { + for (const peerId of Object.keys(cliById)) { + const p = cliById[peerId]; + if (!peerId || peerId.length !== 10 || peerId === selfId) continue; + if (p.role && p.role !== 'LEAF') continue; + out.push(buildPeerEntry(peerId, null, p, networkId, networkName)); + } + } + + out.sort((a, b) => { + if (a.online !== b.online) return a.online ? -1 : 1; + return a.displayName.localeCompare(b.displayName); + }); + return out; + } + + function searchPeers(query, list) { + const q = (query || '').trim().toLowerCase(); + if (!q) return list; + return list.filter(p => + p.displayName.toLowerCase().includes(q) || + p.peerId.includes(q) || + (p.networkName || '').toLowerCase().includes(q) || + (p.networkId || '').includes(q) || + (p.controllerName || '').toLowerCase().includes(q) || + (p.role || '').toLowerCase().includes(q) || + (p.path || '').toLowerCase().includes(q) || + (p.ip || '').toLowerCase().includes(q) + ); + } + + function normalizeNetworkId(input) { + const id = String(input || '').replace(/[^0-9a-fA-F]/g, '').toLowerCase(); + return id.length === 16 ? id : ''; + } + + async function joinNetwork(nwid) { + const id = normalizeNetworkId(nwid); + if (!id) { + throw new Error('Network ID must be 16 hexadecimal characters'); + } + return BackOneAuth.apiSendFirst(API.join(id), 'POST', {}); + } + + async function leaveNetwork(nwid) { + const id = normalizeNetworkId(nwid); + if (!id) { + throw new Error('Network ID must be 16 hexadecimal characters'); + } + return BackOneAuth.apiSendFirst(API.leave(id), 'DELETE'); + } + + return { + loadCliPeers, + loadNetworks, + loadNetwork, + loadCoreStatus, + countLeafPeers, + loadPeersForNetwork, + getLastNetworkId, + setLastNetworkId, + joinNetwork, + leaveNetwork, + normalizeNetworkId, + searchPeers, + peerIsOnline, + peerLinkLabel + }; +})(); diff --git a/Support/BackOne/app/peer-picker.js b/Support/BackOne/app/peer-picker.js new file mode 100644 index 0000000..9eb830f --- /dev/null +++ b/Support/BackOne/app/peer-picker.js @@ -0,0 +1,151 @@ +window.BackOnePeerPicker = function PeerPicker(container, options) { + options = options || {}; + const onSelect = options.onSelect || (() => {}); + const onNetworkChange = options.onNetworkChange || (() => {}); + const onAction = options.onAction || null; + const actionLabel = options.actionLabel || 'Select'; + const showActionButton = options.showActionButton !== false; + const useSharedNetwork = options.useSharedNetwork !== false; + + let selectedPeer = null; + let peers = []; + let currentNetwork = null; + let unsub = null; + + container.innerHTML = ` +
+
BackOne core · same network as backone-cli
+
+ + +
+ ${showActionButton ? `` : ''} +
`; + + const netBanner = container.querySelector('#pp-network-banner'); + const searchInput = container.querySelector('#pp-search'); + const listEl = container.querySelector('#pp-list'); + const selectedEl = container.querySelector('#pp-selected'); + const actionBtn = container.querySelector('#pp-action'); + + function networkLabel(n) { + if (!n) return ''; + return n.name ? `${n.name} (${n.id})` : n.id; + } + + function renderNetworkBanner() { + if (!useSharedNetwork) return; + const id = BackOneNetworkSession.getNetworkId(); + const core = BackOneNetworkSession.getCoreStatus(); + if (!core.online) { + netBanner.innerHTML = 'BackOne offline — peers from backone-cli unavailable'; + return; + } + if (!currentNetwork || !id) { + netBanner.innerHTML = 'No network — core reports ' + core.networkCount + ' joined (use header bar or backone-cli listnetworks)'; + return; + } + netBanner.textContent = `Network: ${networkLabel(currentNetwork)} · ${peers.length} contact(s) · ${core.leafPeerCount} VL1 peer(s) from core`; + } + + function renderList() { + const q = searchInput.value; + const filtered = BackOnePeerDirectory.searchPeers(q, peers); + const netTag = currentNetwork ? escapeHtml(currentNetwork.name || currentNetwork.id) : ''; + listEl.innerHTML = filtered.map(p => { + const lat = p.latency != null ? `${p.latency}ms` : '—'; + const meta = [p.role || 'LEAF', lat, p.link || ''].filter(Boolean).join(' · '); + const ip = p.ip ? ` · ${escapeHtml(p.ip)}` : ''; + return ` +
  • + + + ${escapeHtml(p.displayName)} + ${escapeHtml(p.peerId)} · ${escapeHtml(meta)}${netTag ? ' · ' + netTag : ''}${ip} + + +
  • `; + }).join('') || '
  • No peers on the active network — check backone-cli peers and controller members
  • '; + + listEl.querySelectorAll('.peer-item').forEach(li => { + li.addEventListener('click', (ev) => { + if (ev.target.classList.contains('peer-edit')) return; + const id = li.dataset.id; + selectedPeer = peers.find(x => x.peerId === id) || null; + if (selectedPeer) BackOneNetworkSession.setSelectedPeer(selectedPeer); + renderList(); + renderSelected(); + if (selectedPeer) onSelect(selectedPeer, currentNetwork); + }); + const editBtn = li.querySelector('.peer-edit'); + if (editBtn) { + editBtn.addEventListener('click', async (ev) => { + ev.stopPropagation(); + const id = li.dataset.id; + const peer = peers.find(x => x.peerId === id); + if (!peer) return; + const nick = prompt('Nickname for ' + peer.peerId, peer.nickname || peer.controllerName || ''); + if (nick === null) return; + await BackOneContacts.setNickname(peer.peerId, nick); + BackOneContacts.invalidate(); + await refreshPeers(); + }); + } + }); + } + + function renderSelected() { + if (!selectedPeer) { + selectedEl.textContent = ''; + if (actionBtn) actionBtn.disabled = true; + return; + } + const net = currentNetwork ? networkLabel(currentNetwork) : BackOneNetworkSession.getNetworkId(); + selectedEl.innerHTML = `Selected: ${escapeHtml(selectedPeer.displayName)} (${escapeHtml(selectedPeer.peerId)})${net ? ` on ${escapeHtml(net)}` : ''}`; + if (actionBtn) actionBtn.disabled = !BackOneNetworkSession.getNetworkId(); + } + + function escapeHtml(s) { + return String(s).replace(/&/g, '&').replace(//g, '>'); + } + + async function refreshPeers() { + currentNetwork = BackOneNetworkSession.getActiveNetwork(); + if (useSharedNetwork && BackOneNetworkSession.getNetworkId() && !currentNetwork) { + currentNetwork = await BackOneNetworkSession.refresh(); + } + renderNetworkBanner(); + const nwid = BackOneNetworkSession.getNetworkId(); + await BackOneContacts.load(); + peers = nwid ? await BackOnePeerDirectory.loadPeersForNetwork(nwid) : []; + const lastPeerId = BackOneNetworkSession.getSelectedPeerId(); + if (lastPeerId) { + selectedPeer = peers.find(p => p.peerId === lastPeerId) || BackOneNetworkSession.getSelectedPeer(); + } + renderList(); + renderSelected(); + onNetworkChange(currentNetwork, peers); + } + + searchInput.addEventListener('input', renderList); + if (actionBtn) { + actionBtn.addEventListener('click', () => { + if (selectedPeer && onAction) onAction(selectedPeer, currentNetwork); + }); + } + + if (useSharedNetwork) { + unsub = BackOneNetworkSession.subscribe(() => refreshPeers()); + } + + refreshPeers(); + + return { + getSelectedPeer: () => selectedPeer, + getSelectedNetwork: () => currentNetwork, + refresh: refreshPeers, + destroy: () => { if (unsub) unsub(); } + }; +}; diff --git a/Support/BackOne/app/styles.css b/Support/BackOne/app/styles.css new file mode 100644 index 0000000..fa92292 --- /dev/null +++ b/Support/BackOne/app/styles.css @@ -0,0 +1,53 @@ +body { font-family: system-ui, sans-serif; margin: 0; background: #0f1419; color: #e7ecf1; } +header { display: flex; align-items: center; gap: 1rem; padding: 1rem; background: #1a2332; border-bottom: 1px solid #2d3a4d; flex-wrap: wrap; } +header h1 { margin: 0; font-size: 1.25rem; } +.network-bar { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; flex: 1; min-width: 280px; } +.network-bar-label { font-size: 0.85rem; color: #8b9bb4; } +.network-bar select, .network-bar input { background: #0f1419; color: #e7ecf1; border: 1px solid #2d3a4d; border-radius: 4px; padding: 0.35rem 0.5rem; } +.network-bar input { width: 10rem; } +.network-bar button { background: #2d5a8a; color: #fff; border: none; padding: 0.35rem 0.65rem; border-radius: 4px; cursor: pointer; } +.network-bar-status { font-size: 0.8rem; color: #6b8cae; flex: 1 1 100%; } +.auth-token-bar { display: flex; align-items: center; gap: 0.5rem; flex: 1 1 100%; } +.auth-token-hidden { display: none; } +.auth-token-label { font-size: 0.85rem; color: #8b9bb4; } +.auth-token-bar input { background: #0f1419; color: #e7ecf1; border: 1px solid #2d3a4d; border-radius: 4px; padding: 0.35rem 0.5rem; width: 16rem; } +.auth-token-bar button { background: #2d5a8a; color: #fff; border: none; padding: 0.35rem 0.65rem; border-radius: 4px; cursor: pointer; } +.core-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 0.35rem; vertical-align: middle; } +.core-dot.online { background: #2ecc71; } +.core-dot.offline { background: #e74c3c; } +nav { display: flex; gap: 0.5rem; flex-wrap: wrap; } +nav button { background: #2d5a8a; color: #fff; border: none; padding: 0.5rem 1rem; border-radius: 6px; cursor: pointer; } +nav button.active { background: #4a90d9; } +main { padding: 1.5rem; } +.ringing-hidden { display: none; } +#ringing-popup { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; z-index: 1000; } +#ringing-popup.ringing-hidden { display: none; } +.ringing-card { background: #1a2332; padding: 2rem; border-radius: 12px; text-align: center; min-width: 280px; } +.ringing-card button { margin: 0.5rem; padding: 0.6rem 1.2rem; border: none; border-radius: 6px; cursor: pointer; } +.ringing-accept { background: #2ecc71; color: #000; } +.ringing-reject { background: #e74c3c; color: #fff; } +.peer-picker { max-width: 480px; } +.peer-picker-core { font-size: 0.75rem; color: #6b8cae; margin-bottom: 0.5rem; text-transform: uppercase; letter-spacing: 0.04em; } +.peer-network-banner { font-size: 0.85rem; color: #8b9bb4; margin-bottom: 0.75rem; padding: 0.4rem 0.5rem; background: #1a2332; border-radius: 4px; } +.peer-network-warn { color: #e6a23c; } +.peer-picker-row { display: block; margin-bottom: 0.75rem; } +.peer-picker-row select, .peer-picker-row input { width: 100%; margin-top: 0.25rem; padding: 0.4rem; background: #1a2332; color: #e7ecf1; border: 1px solid #2d3a4d; border-radius: 4px; } +.peer-list { list-style: none; padding: 0; margin: 0.5rem 0; max-height: 280px; overflow: auto; border: 1px solid #2d3a4d; border-radius: 6px; } +.peer-item { display: flex; align-items: center; gap: 0.5rem; padding: 0.6rem 0.75rem; cursor: pointer; border-bottom: 1px solid #2d3a4d; } +.peer-item:last-child { border-bottom: none; } +.peer-item:hover, .peer-item.active { background: #243044; } +.peer-dot { width: 8px; height: 8px; border-radius: 50%; background: #666; flex-shrink: 0; } +.peer-item.online .peer-dot { background: #2ecc71; } +.peer-main { flex: 1; min-width: 0; } +.peer-name { display: block; } +.peer-sub { color: #8b9bb4; font-size: 0.8rem; } +.peer-edit { background: transparent; border: none; color: #8b9bb4; cursor: pointer; padding: 0.25rem; } +.peer-empty { padding: 1rem; color: #8b9bb4; } +.peer-selected { margin: 0.5rem 0; min-height: 1.25rem; } +.chat-layout { display: flex; gap: 1rem; min-height: 400px; } +.chat-peers { flex: 0 0 280px; } +.chat-thread-panel { flex: 1; display: flex; flex-direction: column; } +.chat-thread-header { padding-bottom: 0.5rem; border-bottom: 1px solid #2d3a4d; margin-bottom: 0.5rem; } +#chat-thread { flex: 1; overflow: auto; border: 1px solid #2d3a4d; padding: 0.5rem; border-radius: 6px; margin-bottom: 0.5rem; } +.video-remote-label { position: absolute; bottom: 4px; left: 4px; background: rgba(0,0,0,0.6); padding: 2px 6px; font-size: 0.75rem; border-radius: 4px; } +.video-wrap { position: relative; display: inline-block; } diff --git a/addons/chat/addon.json b/addons/chat/addon.json new file mode 100644 index 0000000..f2cc745 --- /dev/null +++ b/addons/chat/addon.json @@ -0,0 +1,30 @@ +{ + "id": "chat", + "name": "Chat P2P", + "version": "1.17.1", + "requires": ["comms-core"], + "backoneCore": { + "apis": [ + "/app/api/peers", + "/app/api/networks", + "POST /app/api/network/{nwid}", + "DELETE /app/api/network/{nwid}", + "/app/api/network/{nwid}", + "/app/api/network/{nwid}/members", + "/app/api/authtoken", + "/app/api/contacts" + ] + }, + "backend": { + "routes": ["/controller/comms/network"], + "websocketEvents": ["chat_message", "typing"] + }, + "frontend": { + "entry": "/app/addons/chat/index.js", + "navLabel": "Chat", + "icon": "chat" + }, + "settings": { + "attachmentMaxBytes": 10485760 + } +} diff --git a/addons/chat/frontend/index.js b/addons/chat/frontend/index.js new file mode 100644 index 0000000..14f0d81 --- /dev/null +++ b/addons/chat/frontend/index.js @@ -0,0 +1,160 @@ +window.BackOneAddons = window.BackOneAddons || {}; + +window.BackOneAddons.chat = function chatAddon() { + const messagesByPeer = {}; + let selectedPeer = null; + let root = null; + + function getThread(peerId) { + if (!messagesByPeer[peerId]) messagesByPeer[peerId] = []; + return messagesByPeer[peerId]; + } + + function networkLabel() { + const n = BackOneNetworkSession.getActiveNetwork(); + return n ? (n.name || n.id) : BackOneNetworkSession.getNetworkId(); + } + + function updateConnectionBar() { + const bar = root?.querySelector('#chat-conn-bar'); + if (!bar || !window.BackOneCommLayout) return; + bar.innerHTML = BackOneCommLayout.connectionBarHtml( + selectedPeer, + BackOneNetworkSession.getActiveNetwork() + ); + } + + function renderHeader() { + const header = root?.querySelector('#chat-header'); + if (!header) return; + const net = networkLabel(); + if (!selectedPeer) { + header.textContent = net ? `Select a contact on ${net}` : 'Join a network in the header bar'; + return; + } + header.innerHTML = `${selectedPeer.displayName || selectedPeer.peerId} ${selectedPeer.peerId}${net ? ' · ' + net : ''}`; + updateConnectionBar(); + } + + return { + mount(container) { + root = container; + container.innerHTML = ` +
    + +
    +
    +
    Chat P2P > Select contact
    +
    +
    +
    Select a contact
    +
    +
    + +
    + + +
    +
    +
    +
    +
    +
    `; + + const thread = container.querySelector('#chat-thread'); + const input = container.querySelector('#chat-input'); + const fileInput = container.querySelector('#chat-file'); + const sendBtn = container.querySelector('#chat-send'); + + function updateInputs() { + const ok = !!BackOneNetworkSession.getNetworkId() && !!selectedPeer; + input.disabled = !ok; + fileInput.disabled = !ok; + sendBtn.disabled = !ok; + renderHeader(); + const bc = root.querySelector('#chat-breadcrumb-peer'); + if (bc) bc.textContent = selectedPeer ? (selectedPeer.displayName || selectedPeer.peerId) : 'Select contact'; + } + + const render = () => { + if (!selectedPeer) { + thread.innerHTML = '

    Choose a peer from the list

    '; + return; + } + const messages = getThread(selectedPeer.peerId); + thread.innerHTML = messages.map(m => + `
    ${m.senderName || m.sender || 'me'}: ${m.body || ''}${m.file ? ` [${m.file}]` : ''}
    ` + ).join(''); + thread.scrollTop = thread.scrollHeight; + }; + + BackOnePeerPicker(container.querySelector('#chat-peer-picker'), { + layout: 'sidebar', + showActionButton: false, + onSelect(peer) { + selectedPeer = peer; + updateInputs(); + render(); + }, + onNetworkChange() { + selectedPeer = null; + updateInputs(); + render(); + } + }); + + BackOneNetworkSession.subscribe(() => { + updateInputs(); + render(); + }); + + sendBtn.onclick = async () => { + const networkId = BackOneNetworkSession.getNetworkId(); + if (!selectedPeer || !networkId) return; + const body = input.value.trim(); + const selfName = 'me'; + if (fileInput.files.length) { + const fd = new FormData(); + fd.append('file', fileInput.files[0]); + fd.append('networkId', networkId); + await BackOneAuth.fetchWithAuth(`/controller/comms/network/${networkId}/chat/attachment`, { + method: 'POST', + body: fd + }).catch(() => {}); + getThread(selectedPeer.peerId).push({ + sender: selfName, + senderName: selfName, + body: '', + file: fileInput.files[0].name + }); + fileInput.value = ''; + } + if (body) { + await BackOneAuth.fetchWithAuth(`/controller/comms/network/${networkId}/chat`, { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ body, targetId: selectedPeer.peerId, networkId }) + }).catch(() => {}); + getThread(selectedPeer.peerId).push({ + sender: selfName, + senderName: selfName, + body + }); + input.value = ''; + } + render(); + }; + + updateInputs(); + render(); + } + }; +}; diff --git a/addons/comms-core/addon.json b/addons/comms-core/addon.json new file mode 100644 index 0000000..dae6899 --- /dev/null +++ b/addons/comms-core/addon.json @@ -0,0 +1,10 @@ +{ + "id": "comms-core", + "name": "Comms Core", + "version": "1.17.1", + "requires": [], + "backend": { + "routes": ["/controller/comms"], + "websocketEvents": ["presence", "incoming_call", "call_state", "chat_message"] + } +} diff --git a/addons/comms-core/schema.sql b/addons/comms-core/schema.sql new file mode 100644 index 0000000..a7d5a83 --- /dev/null +++ b/addons/comms-core/schema.sql @@ -0,0 +1,32 @@ +-- BackOne comms-core addon schema (PostgreSQL) +CREATE TABLE IF NOT EXISTS backone_calls ( + id TEXT PRIMARY KEY, + network_id TEXT NOT NULL, + caller_id TEXT NOT NULL, + callee_id TEXT NOT NULL, + call_type TEXT NOT NULL CHECK (call_type IN ('voice', 'video')), + state TEXT NOT NULL, + sdp_offer TEXT, + sdp_answer TEXT, + created_at BIGINT NOT NULL +); + +CREATE TABLE IF NOT EXISTS backone_chat_messages ( + id TEXT PRIMARY KEY, + network_id TEXT NOT NULL, + sender_id TEXT NOT NULL, + body TEXT, + attachment_id TEXT, + created_at BIGINT NOT NULL +); + +CREATE TABLE IF NOT EXISTS backone_attachments ( + id TEXT PRIMARY KEY, + network_id TEXT NOT NULL, + sender_id TEXT NOT NULL, + filename TEXT NOT NULL, + mime_type TEXT NOT NULL, + size_bytes BIGINT NOT NULL, + storage_path TEXT NOT NULL, + created_at BIGINT NOT NULL +); diff --git a/addons/updater/addon.json b/addons/updater/addon.json new file mode 100644 index 0000000..e68031d --- /dev/null +++ b/addons/updater/addon.json @@ -0,0 +1,10 @@ +{ + "id": "updater", + "name": "BackOne Updater", + "version": "1.17.1", + "requires": [], + "backend": { + "routes": [], + "websocketEvents": [] + } +} diff --git a/addons/updater/backone-updater b/addons/updater/backone-updater new file mode 100755 index 0000000..2ea7006 --- /dev/null +++ b/addons/updater/backone-updater @@ -0,0 +1,129 @@ +#!/bin/bash +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +if [ -f "${SCRIPT_DIR}/platform-paths.sh" ]; then + # shellcheck source=platform-paths.sh + . "${SCRIPT_DIR}/platform-paths.sh" +else + # shellcheck source=../../pkg/common/platform-paths.sh + . "${SCRIPT_DIR}/../../pkg/common/platform-paths.sh" +fi +backone_resolve_paths + +HOME_DIR="${BACKONE_HOME}" +STAMP="${HOME_DIR}/.installed-version" +LOG_DIR="${BACKONE_LOG_DIR:-/var/log/backone}" +LOG_FILE="${LOG_DIR}/updater.log" +MIGRATIONS="${BACKONE_ADDONS_DIR}/updater/migrations" +LEGACY_HOME="/var/lib/zerotier-one" + +log() { + mkdir -p "$LOG_DIR" + echo "$(date -Iseconds) $*" | tee -a "$LOG_FILE" +} + +read_version() { + if [ -f "$STAMP" ]; then + cat "$STAMP" + else + echo '{"package":"backone","version":"0.0.0","schemaVersion":0}' + fi +} + +write_version() { + local version="${1:-$(cat debian/version 2>/dev/null || echo 1.15.0)}" + mkdir -p "$HOME_DIR" + cat > "$STAMP" </dev/null || true +} + +run_migrations() { + local scope="${1:-all}" + [ -d "$MIGRATIONS" ] || return 0 + for script in "$MIGRATIONS"/*; do + [ -f "$script" ] || continue + case "$(basename "$script")" in + 001_*) + [ "$scope" = "all" ] || [ "$scope" = "core" ] || continue + ;; + 002_*) + [ "$scope" = "all" ] || [ "$scope" = "core" ] || continue + ;; + 003_*) + [ "$scope" = "all" ] || [ "$scope" = "core" ] || continue + ;; + *) + if [ "$scope" != "all" ] && [ "$scope" != "$ADDON_SCOPE" ]; then + continue + fi + ;; + esac + log "Running migration: $(basename "$script")" + BACKONE_HOME="$HOME_DIR" bash "$script" || log "Migration warning: $(basename "$script")" + done +} + +migrate_zerotier() { + if [ -d "$LEGACY_HOME" ] && [ ! -f "$HOME_DIR/identity.public" ]; then + log "Migrating $LEGACY_HOME -> $HOME_DIR" + mkdir -p "$HOME_DIR" + cp -a "$LEGACY_HOME/." "$HOME_DIR/" 2>/dev/null || true + ln -sfn "$HOME_DIR" "$LEGACY_HOME" 2>/dev/null || true + fi +} + +rebuild_manifest() { + local registry="${HOME_DIR}/addons.d/enabled.json" + mkdir -p "${HOME_DIR}/addons.d" + if [ ! -f "$registry" ]; then + echo '[]' > "$registry" + fi + local script_dir manifest_script + script_dir="$(cd "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" && pwd)" + manifest_script="${script_dir}/rebuild-addon-manifest.sh" + if [ ! -x "$manifest_script" ]; then + echo "backone-updater: ${manifest_script} not found" >&2 + exit 1 + fi + local count + count="$(BACKONE_HOME="$HOME_DIR" BACKONE_ADDONS_DIR="${BACKONE_ADDONS_DIR}" bash "$manifest_script")" + log "Wrote ${HOME_DIR}/app/addons/manifest.json (${count} UI addons)" +} + +cmd_migrate() { + local scope="all" + ADDON_SCOPE="" + while [ $# -gt 0 ]; do + case "$1" in + --core) scope="core"; shift ;; + --addon) ADDON_SCOPE="$2"; scope="addon"; shift 2 ;; + --dry-run) + log "Dry run: would migrate scope=$scope addon=$ADDON_SCOPE" + ls -1 "$MIGRATIONS" 2>/dev/null || true + exit 0 + ;; + *) shift ;; + esac + done + migrate_zerotier + run_migrations "$scope" + write_version + rebuild_manifest + log "Migration complete" +} + +cmd_status() { + echo "Installed: $(read_version)" + echo "Package version: $(cat "${BACKONE_ADDONS_DIR}/comms-core/addon.json" 2>/dev/null | grep '"version"' | head -1 || cat debian/version 2>/dev/null || echo unknown)" + echo "Addons registry: ${HOME_DIR}/addons.d/enabled.json" +} + +case "${1:-}" in + migrate) shift; cmd_migrate "$@" ;; + status) cmd_status ;; + rebuild-manifest) rebuild_manifest ;; + *) echo "Usage: backone-updater migrate [--core|--addon ID] [--dry-run] | status | rebuild-manifest" >&2; exit 1 ;; +esac diff --git a/addons/updater/merge-local-conf.sh b/addons/updater/merge-local-conf.sh new file mode 100644 index 0000000..5fd7fee --- /dev/null +++ b/addons/updater/merge-local-conf.sh @@ -0,0 +1,55 @@ +#!/bin/bash +# Deep-merge JSON into /var/lib/backone/local.conf (idempotent). +set -euo pipefail + +HOME_DIR="${BACKONE_HOME:-/var/lib/backone}" +CONF="${HOME_DIR}/local.conf" +PATCH="${1:-}" + +if [ -z "$PATCH" ] && [ ! -t 0 ]; then + PATCH="$(cat)" +fi + +if [ -z "$PATCH" ]; then + echo "Usage: merge-local-conf.sh '' or pipe JSON on stdin" >&2 + exit 1 +fi + +python3 - "$CONF" "$PATCH" <<'PY' +import json +import os +import sys + +conf_path, patch_raw = sys.argv[1], sys.argv[2] + +def deep_merge(base, patch): + if not isinstance(base, dict) or not isinstance(patch, dict): + return patch + out = dict(base) + for k, v in patch.items(): + if k in out and isinstance(out[k], dict) and isinstance(v, dict): + out[k] = deep_merge(out[k], v) + else: + out[k] = v + return out + +patch = json.loads(patch_raw) +current = {} +if os.path.isfile(conf_path): + with open(conf_path, encoding="utf-8") as f: + try: + current = json.load(f) + except json.JSONDecodeError: + current = {} +if not isinstance(current, dict): + current = {} + +merged = deep_merge(current, patch) +os.makedirs(os.path.dirname(conf_path), exist_ok=True) +with open(conf_path, "w", encoding="utf-8") as f: + json.dump(merged, f, indent=2) + f.write("\n") +PY + +chown backone:backone "$CONF" 2>/dev/null || true +chmod 644 "$CONF" 2>/dev/null || true diff --git a/addons/updater/migrations/001_zerotier_to_backone.sh b/addons/updater/migrations/001_zerotier_to_backone.sh new file mode 100755 index 0000000..5010d84 --- /dev/null +++ b/addons/updater/migrations/001_zerotier_to_backone.sh @@ -0,0 +1,12 @@ +#!/bin/bash +set -euo pipefail +BACKONE_HOME="${BACKONE_HOME:-/var/lib/backone}" +LEGACY="/var/lib/zerotier-one" +if [ -d "$LEGACY" ] && [ ! -f "$BACKONE_HOME/identity.public" ]; then + mkdir -p "$BACKONE_HOME" + cp -an "$LEGACY/." "$BACKONE_HOME/" 2>/dev/null || cp -a "$LEGACY/." "$BACKONE_HOME/" +fi +if ! getent passwd backone >/dev/null 2>&1 && getent passwd zerotier-one >/dev/null 2>&1; then + usermod -l backone -d "$BACKONE_HOME" zerotier-one 2>/dev/null || true +fi +chown -R backone:backone "$BACKONE_HOME" 2>/dev/null || true diff --git a/addons/updater/migrations/002_register_addon_host.sh b/addons/updater/migrations/002_register_addon_host.sh new file mode 100755 index 0000000..469fb7f --- /dev/null +++ b/addons/updater/migrations/002_register_addon_host.sh @@ -0,0 +1,8 @@ +#!/bin/bash +set -euo pipefail +BACKONE_HOME="${BACKONE_HOME:-/var/lib/backone}" +mkdir -p "$BACKONE_HOME/addons.d" "$BACKONE_HOME/app/addons" +if [ ! -f "$BACKONE_HOME/addons.d/enabled.json" ]; then + echo '[]' > "$BACKONE_HOME/addons.d/enabled.json" +fi +chown -R backone:backone "$BACKONE_HOME/addons.d" "$BACKONE_HOME/app" 2>/dev/null || true diff --git a/addons/updater/migrations/003_enable_webserver_defaults.sh b/addons/updater/migrations/003_enable_webserver_defaults.sh new file mode 100644 index 0000000..ad94e07 --- /dev/null +++ b/addons/updater/migrations/003_enable_webserver_defaults.sh @@ -0,0 +1,7 @@ +#!/bin/bash +set -euo pipefail +BACKONE_HOME="${BACKONE_HOME:-/var/lib/backone}" +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" +if [ -x "${SCRIPT_DIR}/merge-local-conf.sh" ]; then + BACKONE_HOME="$BACKONE_HOME" bash "${SCRIPT_DIR}/merge-local-conf.sh" '{"settings":{"enableWebServer":true}}' +fi diff --git a/addons/updater/rebuild-addon-manifest.sh b/addons/updater/rebuild-addon-manifest.sh new file mode 100755 index 0000000..21b5418 --- /dev/null +++ b/addons/updater/rebuild-addon-manifest.sh @@ -0,0 +1,60 @@ +#!/bin/bash +# Writes $BACKONE_HOME/app/addons/manifest.json from installed addon.json files. +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +if [ -f "${SCRIPT_DIR}/platform-paths.sh" ]; then + # shellcheck source=platform-paths.sh + . "${SCRIPT_DIR}/platform-paths.sh" +else + # shellcheck source=../../pkg/common/platform-paths.sh + . "${SCRIPT_DIR}/../../pkg/common/platform-paths.sh" +fi +backone_resolve_paths + +HOME_DIR="${BACKONE_HOME}" +ADDONS_DIR="${BACKONE_ADDONS_DIR}" +MANIFEST="${HOME_DIR}/app/addons/manifest.json" + +mkdir -p "${HOME_DIR}/app/addons" "${HOME_DIR}/addons.d" + +if ! command -v python3 >/dev/null 2>&1; then + echo "rebuild-addon-manifest: python3 required" >&2 + exit 1 +fi + +python3 - "$ADDONS_DIR" "$MANIFEST" <<'PY' +import json +import os +import sys + +addons_dir, manifest_path = sys.argv[1], sys.argv[2] +out = [] +if os.path.isdir(addons_dir): + for name in sorted(os.listdir(addons_dir)): + path = os.path.join(addons_dir, name, "addon.json") + if not os.path.isfile(path): + continue + with open(path, encoding="utf-8") as f: + m = json.load(f) + if "frontend" not in m: + continue + item = { + "id": m["id"], + "name": m.get("name", m["id"]), + "version": m.get("version", "0.0.0"), + "frontend": m["frontend"], + } + if "requires" in m: + item["requires"] = m["requires"] + out.append(item) + +os.makedirs(os.path.dirname(manifest_path), exist_ok=True) +with open(manifest_path, "w", encoding="utf-8") as f: + json.dump(out, f, indent=2) + f.write("\n") +print(len(out)) +PY + +chown backone:backone "$MANIFEST" 2>/dev/null || true +chmod 644 "$MANIFEST" 2>/dev/null || true diff --git a/addons/updater/sync-authtoken.sh b/addons/updater/sync-authtoken.sh new file mode 100755 index 0000000..13232e9 --- /dev/null +++ b/addons/updater/sync-authtoken.sh @@ -0,0 +1,53 @@ +#!/bin/sh +# Keep ~/.backOneOneAuthToken and /var/lib/backone/authtoken.secret in sync (same as backone-cli). +set -e + +BACKONE_HOME="${BACKONE_HOME:-/var/lib/backone}" +SECRET="${BACKONE_HOME}/authtoken.secret" + +trim_token() { + tr -d '\n\r \t' < "$1" +} + +sync_for_user() { + user="$1" + home="$2" + [ -n "$user" ] && [ -n "$home" ] && [ -d "$home" ] || return 0 + user_token="${home}/.backOneOneAuthToken" + + if [ -f "$user_token" ] && [ -s "$user_token" ]; then + ut="$(trim_token "$user_token")" + [ -n "$ut" ] || return 0 + st="" + if [ -f "$SECRET" ]; then + st="$(trim_token "$SECRET" 2>/dev/null || true)" + fi + if [ "$ut" != "$st" ]; then + printf '%s' "$ut" > "$SECRET" + chown backone:backone "$SECRET" 2>/dev/null || true + chmod 0600 "$SECRET" 2>/dev/null || true + echo "Synced ${SECRET} from ${user_token}" + fi + return 0 + fi + + if [ -f "$SECRET" ]; then + install -o "$user" -g "$(id -gn "$user" 2>/dev/null || echo "$user")" -m 0600 "$SECRET" "$user_token" 2>/dev/null \ + || cp "$SECRET" "$user_token" + chown "$user":"$(id -gn "$user" 2>/dev/null || echo "$user")" "$user_token" 2>/dev/null || true + chmod 0600 "$user_token" 2>/dev/null || true + echo "Installed ${user_token} from ${SECRET}" + fi +} + +if [ -n "${SUDO_USER:-}" ] && [ "$SUDO_USER" != "root" ]; then + home="$(getent passwd "$SUDO_USER" | cut -d: -f6)" + sync_for_user "$SUDO_USER" "$home" +fi + +if [ -n "${USER:-}" ] && [ "$USER" != "root" ] && [ "$USER" != "${SUDO_USER:-}" ]; then + home="$(getent passwd "$USER" | cut -d: -f6)" + sync_for_user "$USER" "$home" +fi + +exit 0 diff --git a/addons/video/addon.json b/addons/video/addon.json new file mode 100644 index 0000000..77d85c4 --- /dev/null +++ b/addons/video/addon.json @@ -0,0 +1,30 @@ +{ + "id": "video", + "name": "Video Call P2P", + "version": "1.17.1", + "requires": ["comms-core", "voice"], + "backoneCore": { + "apis": [ + "/app/api/peers", + "/app/api/networks", + "POST /app/api/network/{nwid}", + "DELETE /app/api/network/{nwid}", + "/app/api/network/{nwid}", + "/app/api/network/{nwid}/members", + "/app/api/authtoken", + "/app/api/contacts" + ] + }, + "backend": { + "routes": ["/controller/comms/call"], + "websocketEvents": ["incoming_call", "call_state"] + }, + "frontend": { + "entry": "/app/addons/video/index.js", + "navLabel": "Video", + "icon": "video" + }, + "settings": { + "enableVideoCall": true + } +} diff --git a/addons/video/frontend/index.js b/addons/video/frontend/index.js new file mode 100644 index 0000000..40dda4e --- /dev/null +++ b/addons/video/frontend/index.js @@ -0,0 +1,206 @@ +window.BackOneAddons = window.BackOneAddons || {}; + +window.BackOneAddons.video = function videoAddon() { + let pc = null; + let picker = null; + let selectedPeer = null; + let inCall = false; + let localStream = null; + let micEnabled = true; + let camEnabled = true; + let root = null; + + function networkLabel() { + const n = BackOneNetworkSession.getActiveNetwork(); + return n ? (n.name || n.id) : BackOneNetworkSession.getNetworkId(); + } + + function updateConnectionBar() { + const bar = root?.querySelector('#video-conn-bar'); + if (!bar || !window.BackOneCommLayout) return; + bar.innerHTML = BackOneCommLayout.connectionBarHtml( + selectedPeer, + BackOneNetworkSession.getActiveNetwork() + ); + } + + function updateHeadStatus() { + const statusEl = root?.querySelector('#video-head-status'); + const breadcrumb = root?.querySelector('#video-breadcrumb-peer'); + if (!statusEl) return; + if (inCall && selectedPeer) { + statusEl.innerHTML = `Connected · ${selectedPeer.latency != null ? selectedPeer.latency + 'ms' : '—'}`; + if (breadcrumb) breadcrumb.textContent = selectedPeer.peerId; + } else if (selectedPeer) { + statusEl.textContent = 'Ready'; + if (breadcrumb) breadcrumb.textContent = selectedPeer.peerId; + } else { + statusEl.textContent = ''; + if (breadcrumb) breadcrumb.textContent = '—'; + } + } + + function updateCallButtons() { + const callBtn = root?.querySelector('#video-call'); + if (callBtn) callBtn.disabled = !selectedPeer || !BackOneNetworkSession.getNetworkId() || inCall; + const selectedLabel = root?.querySelector('#video-selected-label'); + if (selectedLabel) { + selectedLabel.innerHTML = selectedPeer + ? `Selected: ${selectedPeer.peerId.slice(0, 10)}…` + : 'Selected: —'; + } + updateHeadStatus(); + updateConnectionBar(); + } + + function showPlaceholder(show) { + const ph = root?.querySelector('#video-placeholder'); + const remote = root?.querySelector('#video-remote'); + if (ph) ph.style.display = show ? 'block' : 'none'; + if (remote) remote.style.display = show ? 'none' : 'block'; + } + + function hangUp() { + if (pc) { pc.close(); pc = null; } + if (localStream) { + localStream.getTracks().forEach(t => t.stop()); + localStream = null; + } + const local = root?.querySelector('#video-local'); + const remote = root?.querySelector('#video-remote'); + if (local) local.srcObject = null; + if (remote) remote.srcObject = null; + inCall = false; + micEnabled = true; + camEnabled = true; + showPlaceholder(true); + updateCallButtons(); + window.BackOneRingingPopup?.dismiss(); + } + + return { + mount(container) { + root = container; + container.innerHTML = ` +
    + +
    +
    +
    Video Call P2P > ${inCall ? 'Connected to' : 'Select peer'} —
    +
    +
    +
    +
    Remote
    +
    +
    👤
    +
    —
    +
    Remote Peer
    +
    + +
    + +
    +
    + + + + +
    +
    +
    +
    +
    `; + + const callBtn = container.querySelector('#video-call'); + + picker = BackOnePeerPicker(container.querySelector('#video-picker'), { + layout: 'sidebar', + showActionButton: false, + onSelect(peer) { + selectedPeer = peer; + const phPeer = root.querySelector('#video-ph-peer'); + if (phPeer) phPeer.textContent = peer.peerId; + updateCallButtons(); + }, + onNetworkChange() { + if (!inCall) selectedPeer = null; + updateCallButtons(); + } + }); + + BackOneNetworkSession.subscribe(() => updateCallButtons()); + + callBtn.onclick = async () => { + const peer = selectedPeer || picker.getSelectedPeer(); + const networkId = BackOneNetworkSession.getNetworkId(); + if (!peer || !networkId) return; + try { + pc = new RTCPeerConnection(); + pc.ontrack = (ev) => { + root.querySelector('#video-remote').srcObject = ev.streams[0]; + showPlaceholder(false); + }; + localStream = await navigator.mediaDevices.getUserMedia({ audio: true, video: true }); + root.querySelector('#video-local').srcObject = localStream; + localStream.getTracks().forEach(t => pc.addTrack(t, localStream)); + const offer = await pc.createOffer(); + await pc.setLocalDescription(offer); + await BackOneAuth.fetchWithAuth('/controller/comms/call', { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ + type: 'video', + networkId, + targetId: peer.peerId, + sdp: offer.sdp + }) + }); + inCall = true; + root.querySelector('#video-breadcrumb-state').textContent = 'Connected to'; + updateCallButtons(); + } catch (err) { + hangUp(); + alert(err.message || 'Call failed'); + } + }; + + container.querySelector('#video-hangup').onclick = hangUp; + container.querySelector('#video-hangup-stage').onclick = hangUp; + + container.querySelector('#video-mic').onclick = () => { + if (!localStream) return; + micEnabled = !micEnabled; + localStream.getAudioTracks().forEach(t => { t.enabled = micEnabled; }); + container.querySelector('#video-mic').textContent = micEnabled ? 'Mic' : 'Mic off'; + }; + + container.querySelector('#video-cam').onclick = () => { + if (!localStream) return; + camEnabled = !camEnabled; + localStream.getVideoTracks().forEach(t => { t.enabled = camEnabled; }); + container.querySelector('#video-cam').textContent = camEnabled ? 'Camera' : 'Camera off'; + }; + + container.querySelector('#video-fs').onclick = () => { + const stage = container.querySelector('.comm-stage'); + if (stage.requestFullscreen) stage.requestFullscreen(); + }; + + showPlaceholder(true); + updateCallButtons(); + } + }; +}; diff --git a/addons/voice/addon.json b/addons/voice/addon.json new file mode 100644 index 0000000..912271d --- /dev/null +++ b/addons/voice/addon.json @@ -0,0 +1,31 @@ +{ + "id": "voice", + "name": "Voice Call P2P", + "version": "1.17.1", + "requires": ["comms-core"], + "backoneCore": { + "apis": [ + "/app/api/peers", + "/app/api/networks", + "POST /app/api/network/{nwid}", + "DELETE /app/api/network/{nwid}", + "/app/api/network/{nwid}", + "/app/api/network/{nwid}/members", + "/app/api/authtoken", + "/app/api/contacts" + ] + }, + "backend": { + "routes": ["/controller/comms/call"], + "websocketEvents": ["incoming_call", "call_state"] + }, + "frontend": { + "entry": "/app/addons/voice/index.js", + "navLabel": "Voice", + "icon": "phone" + }, + "settings": { + "enableVoiceCall": true, + "ringTimeoutSec": 30 + } +} diff --git a/addons/voice/frontend/index.js b/addons/voice/frontend/index.js new file mode 100644 index 0000000..b06003e --- /dev/null +++ b/addons/voice/frontend/index.js @@ -0,0 +1,164 @@ +window.BackOneAddons = window.BackOneAddons || {}; + +window.BackOneAddons.voice = function voiceAddon() { + let pc = null; + let picker = null; + let selectedPeer = null; + let inCall = false; + let localStream = null; + let micEnabled = true; + let root = null; + + function updateConnectionBar() { + const bar = root?.querySelector('#voice-conn-bar'); + if (!bar || !window.BackOneCommLayout) return; + bar.innerHTML = BackOneCommLayout.connectionBarHtml( + selectedPeer, + BackOneNetworkSession.getActiveNetwork() + ); + } + + function updateHeadStatus() { + const statusEl = root?.querySelector('#voice-head-status'); + const breadcrumb = root?.querySelector('#voice-breadcrumb-peer'); + if (!statusEl) return; + if (inCall && selectedPeer) { + statusEl.innerHTML = `Connected · ${selectedPeer.latency != null ? selectedPeer.latency + 'ms' : '—'}`; + if (breadcrumb) breadcrumb.textContent = selectedPeer.peerId; + } else if (selectedPeer) { + statusEl.textContent = 'Ready'; + if (breadcrumb) breadcrumb.textContent = selectedPeer.peerId; + } else { + statusEl.textContent = ''; + if (breadcrumb) breadcrumb.textContent = '—'; + } + } + + function updateCallButtons() { + const callBtn = root?.querySelector('#voice-call'); + if (callBtn) callBtn.disabled = !selectedPeer || !BackOneNetworkSession.getNetworkId() || inCall; + const selectedLabel = root?.querySelector('#voice-selected-label'); + if (selectedLabel) { + selectedLabel.innerHTML = selectedPeer + ? `Selected: ${selectedPeer.peerId.slice(0, 10)}…` + : 'Selected: —'; + } + updateHeadStatus(); + updateConnectionBar(); + } + + function hangUp() { + if (pc) { pc.close(); pc = null; } + if (localStream) { + localStream.getTracks().forEach(t => t.stop()); + localStream = null; + } + inCall = false; + micEnabled = true; + updateCallButtons(); + window.BackOneRingingPopup?.dismiss(); + } + + return { + mount(container) { + root = container; + container.innerHTML = ` +
    + +
    +
    +
    Voice Call P2P > Select peer —
    +
    +
    +
    +
    +
    🎙
    +
    —
    +
    Select a peer to call
    +
    +
    + + +
    +
    +
    +
    +
    `; + + const callBtn = container.querySelector('#voice-call'); + const stageLabel = container.querySelector('#voice-stage-label'); + + picker = BackOnePeerPicker(container.querySelector('#voice-picker'), { + layout: 'sidebar', + showActionButton: false, + onSelect(peer) { + selectedPeer = peer; + root.querySelector('#voice-ph-peer').textContent = peer.peerId; + if (!inCall) stageLabel.textContent = `Ready to call ${peer.displayName || peer.peerId}`; + updateCallButtons(); + }, + onNetworkChange() { + if (!inCall) selectedPeer = null; + updateCallButtons(); + } + }); + + BackOneNetworkSession.subscribe(() => updateCallButtons()); + + callBtn.onclick = async () => { + const peer = selectedPeer || picker.getSelectedPeer(); + const networkId = BackOneNetworkSession.getNetworkId(); + if (!peer || !networkId) return; + try { + pc = new RTCPeerConnection(); + localStream = await navigator.mediaDevices.getUserMedia({ audio: true, video: false }); + localStream.getTracks().forEach(t => pc.addTrack(t, localStream)); + const offer = await pc.createOffer(); + await pc.setLocalDescription(offer); + await BackOneAuth.fetchWithAuth('/controller/comms/call', { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ + type: 'voice', + networkId, + targetId: peer.peerId, + sdp: offer.sdp + }) + }); + inCall = true; + root.querySelector('#voice-breadcrumb-state').textContent = 'Connected to'; + stageLabel.textContent = `In call with ${peer.displayName || peer.peerId}`; + updateCallButtons(); + } catch (err) { + hangUp(); + alert(err.message || 'Call failed'); + } + }; + + container.querySelector('#voice-hangup').onclick = hangUp; + container.querySelector('#voice-hangup-stage').onclick = hangUp; + + container.querySelector('#voice-mic').onclick = () => { + if (!localStream) return; + micEnabled = !micEnabled; + localStream.getAudioTracks().forEach(t => { t.enabled = micEnabled; }); + container.querySelector('#voice-mic').textContent = micEnabled ? 'Mic' : 'Mic off'; + }; + + updateCallButtons(); + } + }; +}; diff --git a/app-shell/dist/addon-loader.js b/app-shell/dist/addon-loader.js new file mode 100644 index 0000000..5fffc36 --- /dev/null +++ b/app-shell/dist/addon-loader.js @@ -0,0 +1,57 @@ +window.BackOneRingingPopup = { + _audio: null, + showIncomingCall({ callerName, callType, callId, onAccept, onReject }) { + const el = document.getElementById('ringing-popup'); + if (!el) return; + el.classList.remove('ringing-hidden'); + el.innerHTML = ` +
    +

    Incoming ${callType} call

    +

    ${callerName || 'Unknown peer'}

    + + +
    `; + el.querySelector('.ringing-accept').onclick = () => { this.dismiss(); onAccept && onAccept(callId); }; + el.querySelector('.ringing-reject').onclick = () => { this.dismiss(); onReject && onReject(callId); }; + this.playRingtone(); + if (Notification.permission === 'default') Notification.requestPermission(); + if (Notification.permission === 'granted') { + new Notification(`Incoming ${callType} call`, { body: callerName || 'BackOne peer' }); + } + }, + dismiss() { + const el = document.getElementById('ringing-popup'); + if (el) { el.classList.add('ringing-hidden'); el.innerHTML = ''; } + this.stopRingtone(); + }, + playRingtone() { + this.stopRingtone(); + try { + this._audio = new Audio('data:audio/wav;base64,UklGRnoGAABXQVZFZm10IBAAAAABAAEAQB8AAEAfAAABAAgAZGF0YQoGAACBhYqFbF1fdJivrJBhNjVgodDbq2EcBj+a2/LDciUFLIHO8tiJNwgZaLvt559NEAxQp+PwtmMcBjiR1/LMeSwFJHfH8N2QQAoUXrTp66hVFApGn+DyvmwhBSuBzvLZiTYIG2m98OScTgwOUarm7blmHgU7k9n1unEiBC13y+/ek0EKElyx5+ytWBUIQ5zd8sFuJAUwgM/z2Ik6CBxpvfDknE4MDlGq5u25Zh4FO5PZ9br'); + this._audio.loop = true; + this._audio.play().catch(() => {}); + } catch (_) {} + }, + stopRingtone() { + if (this._audio) { this._audio.pause(); this._audio = null; } + } +}; + +async function loadAddonManifest() { + const res = await fetch('/app/addons/manifest.json', { cache: 'no-store' }); + if (!res.ok) { + console.warn('manifest.json fetch failed:', res.status); + return []; + } + const data = await res.json(); + return Array.isArray(data) ? data : []; +} + +async function loadAddonModule(entry) { + const entryPath = entry.frontend && entry.frontend.entry ? entry.frontend.entry : `/app/addons/${entry.id}/index.js`; + await import(entryPath); + const factory = window.BackOneAddons && window.BackOneAddons[entry.id]; + return factory ? factory() : null; +} + +window.BackOneAddonLoader = { loadAddonManifest, loadAddonModule }; diff --git a/app-shell/dist/auth-store.js b/app-shell/dist/auth-store.js new file mode 100644 index 0000000..533f850 --- /dev/null +++ b/app-shell/dist/auth-store.js @@ -0,0 +1,195 @@ +/** + * BackOne API auth — same token as backone-cli (~/.backOneOneAuthToken / X-ZT1-Auth). + */ +window.BackOneAuth = (function () { + const LS_KEY = 'backone.authToken'; + let cache = null; + + function trimToken(s) { + return String(s || '').replace(/\s+/g, ''); + } + + function tokenFromUrl() { + try { + const params = new URLSearchParams(location.search); + const fromQuery = trimToken(params.get('auth') || params.get('token')); + if (fromQuery) return fromQuery; + const hash = (location.hash || '').replace(/^#\/?/, ''); + const hashParams = new URLSearchParams(hash.includes('?') ? hash.split('?')[1] : ''); + return trimToken(hashParams.get('auth') || hashParams.get('token')); + } catch (_) { + return ''; + } + } + + async function probeToken(token) { + if (!token) return false; + try { + const res = await fetch('/network', { + cache: 'no-store', + headers: { 'X-ZT1-Auth': token } + }); + return res.ok; + } catch (_) { + return false; + } + } + + async function fetchAuthtoken() { + for (const path of ['/api/backone/authtoken', '/app/api/authtoken']) { + try { + const res = await fetch(path, { cache: 'no-store' }); + if (res.ok) { + const data = await res.json(); + const token = trimToken(data && data.token); + if (token) return token; + } + } catch (_) { + /* try next */ + } + } + return ''; + } + + async function resolveToken() { + const urlToken = tokenFromUrl(); + if (urlToken) { + if (await probeToken(urlToken)) { + return urlToken; + } + } + + const stored = trimToken(localStorage.getItem(LS_KEY)); + if (stored && await probeToken(stored)) { + return stored; + } + + const apiToken = await fetchAuthtoken(); + if (apiToken && await probeToken(apiToken)) { + return apiToken; + } + + if (stored) return stored; + if (apiToken) return apiToken; + if (urlToken) return urlToken; + return ''; + } + + async function getToken() { + if (cache) return cache; + cache = await resolveToken(); + return cache || ''; + } + + async function authHeaders(extra) { + const token = await getToken(); + const headers = Object.assign({}, extra || {}); + if (token) { + headers['X-ZT1-Auth'] = token; + } + return headers; + } + + async function fetchWithAuth(path, options) { + options = options || {}; + const headers = await authHeaders(options.headers || {}); + return fetch(path, Object.assign({}, options, { headers })); + } + + async function apiGet(path) { + const res = await fetchWithAuth(path, { cache: 'no-store' }); + if (!res.ok) throw new Error(`${path} returned ${res.status}`); + return res.json(); + } + + async function apiGetFirst(paths) { + let lastErr = null; + for (const path of paths) { + try { + return await apiGet(path); + } catch (err) { + lastErr = err; + } + } + throw lastErr || new Error('API request failed'); + } + + async function apiSend(path, method, body) { + const headers = await authHeaders( + body != null ? { 'Content-Type': 'application/json' } : {} + ); + const res = await fetch(path, { + method, + headers, + body: body != null ? JSON.stringify(body) : undefined + }); + if (!res.ok) { + const text = await res.text().catch(() => ''); + throw new Error(text || `${method} ${path} returned ${res.status}`); + } + if (res.status === 204) { + return { result: true }; + } + const text = await res.text(); + if (!text) { + return { result: true }; + } + try { + return JSON.parse(text); + } catch (_) { + return { result: true }; + } + } + + async function apiSendFirst(paths, method, body) { + let lastErr = null; + for (const path of paths) { + try { + return await apiSend(path, method, body); + } catch (err) { + lastErr = err; + } + } + throw lastErr || new Error(`${method} failed`); + } + + /** Store token from ~/.backOneOneAuthToken (same as backone-cli). */ + async function setUserToken(token) { + cache = trimToken(token); + if (cache) { + localStorage.setItem(LS_KEY, cache); + } else { + localStorage.removeItem(LS_KEY); + } + return cache; + } + + async function validateCurrentToken() { + cache = null; + const token = await getToken(); + if (!token) return false; + return probeToken(token); + } + + function invalidate() { + cache = null; + } + + async function init() { + return getToken(); + } + + return { + getToken, + authHeaders, + fetchWithAuth, + apiGet, + apiGetFirst, + apiSend, + apiSendFirst, + setUserToken, + validateCurrentToken, + invalidate, + init + }; +})(); diff --git a/app-shell/dist/contacts-store.js b/app-shell/dist/contacts-store.js new file mode 100644 index 0000000..01a0cd8 --- /dev/null +++ b/app-shell/dist/contacts-store.js @@ -0,0 +1,57 @@ +window.BackOneContacts = (function () { + let cache = null; + + async function load() { + if (cache) return cache; + try { + const res = await BackOneAuth.fetchWithAuth('/api/backone/contacts', { cache: 'no-store' }) + .catch(() => BackOneAuth.fetchWithAuth('/app/api/contacts', { cache: 'no-store' })); + if (!res.ok) { + cache = {}; + return cache; + } + cache = await res.json(); + if (!cache || typeof cache !== 'object') cache = {}; + } catch (_) { + cache = {}; + } + return cache; + } + + function getDisplayName(peerId, controllerName) { + const c = cache || {}; + const entry = c[peerId]; + if (entry && entry.nickname) return entry.nickname; + if (controllerName) return controllerName; + return peerId; + } + + function getNickname(peerId) { + const entry = (cache || {})[peerId]; + return entry && entry.nickname ? entry.nickname : ''; + } + + async function setNickname(peerId, nickname) { + await load(); + const patch = {}; + patch[peerId] = { nickname: nickname || '' }; + const res = await BackOneAuth.fetchWithAuth('/api/backone/contacts', { + method: 'PUT', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify(patch) + }).catch(() => BackOneAuth.fetchWithAuth('/app/api/contacts', { + method: 'PUT', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify(patch) + })); + if (!res.ok) throw new Error('Failed to save nickname'); + cache = await res.json(); + return cache; + } + + function invalidate() { + cache = null; + } + + return { load, getDisplayName, getNickname, setNickname, invalidate }; +})(); diff --git a/app-shell/dist/index.html b/app-shell/dist/index.html new file mode 100644 index 0000000..baabe4e --- /dev/null +++ b/app-shell/dist/index.html @@ -0,0 +1,43 @@ + + + + + + BackOne + + + +
    +
    +

    BackOne

    + Offline +
    +
    + + + + + +
    + + +
    +
    + +
    +
    +
    + + + + + + + + + diff --git a/app-shell/dist/main.js b/app-shell/dist/main.js new file mode 100644 index 0000000..5fa8c11 --- /dev/null +++ b/app-shell/dist/main.js @@ -0,0 +1,237 @@ +window.BackOneAddons = window.BackOneAddons || {}; + +const addonButtons = {}; +let addonModules = {}; +let coreRefreshTimer = null; + +function hashAddonId() { + const h = (location.hash || '').replace(/^#\/?/, '').toLowerCase(); + if (h === 'voice' || h === 'video' || h === 'chat') return h; + return ''; +} + +function activateAddon(id) { + const btn = addonButtons[id]; + if (!btn) return; + btn.click(); +} + +function escapeHtml(s) { + return String(s).replace(/&/g, '&').replace(//g, '>'); +} + +function networkLabel(n) { + if (!n) return ''; + return n.name ? `${n.name} (${n.id})` : n.id; +} + +function updateCoreBadge(statusEl) { + const badge = document.getElementById('core-status-badge'); + const core = BackOneNetworkSession.getCoreStatus(); + if (badge) { + badge.textContent = core.online ? 'Online' : 'Offline'; + badge.classList.toggle('online', core.online); + badge.classList.toggle('offline', !core.online); + } + if (!statusEl) return; + if (!core.online) { + statusEl.textContent = 'Start the backone service to use networks and peers'; + return; + } + const net = BackOneNetworkSession.getActiveNetwork(); + const netPart = net ? networkLabel(net) : 'no network joined'; + statusEl.textContent = `${netPart} · ${core.leafPeerCount} peer(s)`; +} + +async function initAuthTokenBar(statusEl, onSaved) { + const bar = document.getElementById('auth-token-bar'); + const input = document.getElementById('auth-token-input'); + const saveBtn = document.getElementById('auth-token-save'); + if (!bar || !input || !saveBtn) return; + + async function refreshAuthUi() { + const ok = await BackOneAuth.validateCurrentToken(); + bar.classList.toggle('auth-token-hidden', ok); + if (!ok && !input.value) { + input.placeholder = 'Paste from ~/.backOneOneAuthToken'; + } + return ok; + } + + saveBtn.addEventListener('click', async () => { + const token = input.value.trim(); + if (!token) { + if (statusEl) statusEl.textContent = 'Paste the token from ~/.backOneOneAuthToken'; + return; + } + saveBtn.disabled = true; + await BackOneAuth.setUserToken(token); + BackOneAuth.invalidate(); + const ok = await BackOneAuth.validateCurrentToken(); + if (!ok) { + if (statusEl) statusEl.textContent = 'Token rejected — check ~/.backOneOneAuthToken'; + saveBtn.disabled = false; + return; + } + input.value = ''; + bar.classList.add('auth-token-hidden'); + if (typeof onSaved === 'function') await onSaved(); + saveBtn.disabled = false; + }); + + await refreshAuthUi(); + return refreshAuthUi; +} + +async function initNetworkBar() { + const bar = document.getElementById('network-bar'); + if (!bar) return; + + const netSel = bar.querySelector('#global-network'); + const joinInput = bar.querySelector('#global-join-id'); + const joinBtn = bar.querySelector('#global-join-btn'); + const leaveBtn = bar.querySelector('#global-leave-btn'); + const statusEl = bar.querySelector('#global-network-status'); + + async function reloadNetworkList(selectId) { + await BackOneNetworkSession.syncFromCore(); + const networks = await BackOneNetworkSession.loadNetworks(); + netSel.innerHTML = networks.map(n => + `` + ).join('') || ''; + + const want = (selectId || BackOneNetworkSession.getNetworkId() || '').toLowerCase(); + if (want && networks.some(n => (n.id || '').toLowerCase() === want)) { + netSel.value = networks.find(n => (n.id || '').toLowerCase() === want).id; + await BackOneNetworkSession.selectNetwork(netSel.value); + } else if (networks.length === 1) { + netSel.value = networks[0].id; + await BackOneNetworkSession.selectNetwork(networks[0].id); + } else if (networks.length > 0 && BackOneNetworkSession.getNetworkId()) { + netSel.value = BackOneNetworkSession.getNetworkId(); + } + updateCoreBadge(statusEl); + } + + netSel.addEventListener('change', async () => { + if (!netSel.value) return; + statusEl.textContent = 'Switching network…'; + await BackOneNetworkSession.selectNetwork(netSel.value); + await BackOneNetworkSession.syncFromCore(); + updateCoreBadge(statusEl); + }); + + joinBtn.addEventListener('click', async () => { + const id = BackOnePeerDirectory.normalizeNetworkId(joinInput.value); + if (!id) { + statusEl.textContent = 'Enter a 16-digit hexadecimal network ID'; + return; + } + joinBtn.disabled = true; + leaveBtn.disabled = true; + statusEl.textContent = `Joining ${id}…`; + try { + await BackOneNetworkSession.joinNetwork(id); + joinInput.value = ''; + await reloadNetworkList(id); + } catch (err) { + statusEl.textContent = err.message || 'Join failed'; + } finally { + joinBtn.disabled = false; + leaveBtn.disabled = false; + } + }); + + leaveBtn.addEventListener('click', async () => { + const id = netSel.value || BackOneNetworkSession.getNetworkId(); + if (!id) { + statusEl.textContent = 'Select a network to leave'; + return; + } + if (!confirm(`Leave network ${networkLabel(BackOneNetworkSession.getActiveNetwork() || { id })}?`)) return; + joinBtn.disabled = true; + leaveBtn.disabled = true; + statusEl.textContent = `Leaving ${id}…`; + try { + await BackOneNetworkSession.leaveNetwork(id); + await reloadNetworkList(); + } catch (err) { + statusEl.textContent = err.message || 'Leave failed'; + } finally { + joinBtn.disabled = false; + leaveBtn.disabled = false; + } + }); + + BackOneNetworkSession.subscribe(() => updateCoreBadge(statusEl)); + + const refreshAuthUi = await initAuthTokenBar(statusEl, () => reloadNetworkList()); + + await reloadNetworkList(); + if (refreshAuthUi) await refreshAuthUi(); + + coreRefreshTimer = setInterval(() => { + BackOneNetworkSession.syncFromCore().then(() => updateCoreBadge(statusEl)); + }, 45000); +} + +async function initAppShell() { + await BackOneAuth.init(); + await initNetworkBar(); + + const nav = document.getElementById('addon-nav'); + const panel = document.getElementById('addon-panel'); + const addons = await BackOneAddonLoader.loadAddonManifest(); + if (!addons.length) { + panel.innerHTML = '

    No UI addons found. Install backone-addon-voice, backone-addon-video, or backone-addon-chat, then run: sudo backone-updater rebuild-manifest and restart backone.

    '; + return; + } + + const navOrder = ['chat', 'video', 'voice']; + const sorted = [...addons].sort((a, b) => { + const ia = navOrder.indexOf(a.id); + const ib = navOrder.indexOf(b.id); + return (ia < 0 ? 99 : ia) - (ib < 0 ? 99 : ib); + }); + + for (const entry of sorted) { + const mod = await BackOneAddonLoader.loadAddonModule(entry); + if (mod) addonModules[entry.id] = mod; + const btn = document.createElement('button'); + btn.dataset.addonId = entry.id; + btn.textContent = (entry.frontend && entry.frontend.navLabel) || entry.name || entry.id; + btn.onclick = () => { + nav.querySelectorAll('button').forEach(b => b.classList.remove('active')); + btn.classList.add('active'); + panel.innerHTML = ''; + location.hash = entry.id; + if (addonModules[entry.id] && addonModules[entry.id].mount) { + addonModules[entry.id].mount(panel); + } else { + panel.innerHTML = `

    Addon "${entry.id}" loaded.

    `; + } + }; + addonButtons[entry.id] = btn; + nav.appendChild(btn); + } + + const fromHash = hashAddonId(); + if (fromHash && addonButtons[fromHash]) { + activateAddon(fromHash); + } else { + nav.querySelector('button')?.click(); + } +} + +window.addEventListener('hashchange', () => { + const id = hashAddonId(); + if (id) activateAddon(id); +}); + +document.addEventListener('visibilitychange', () => { + if (document.visibilityState === 'visible') { + BackOneNetworkSession.syncFromCore(); + } +}); + +document.addEventListener('DOMContentLoaded', initAppShell); diff --git a/app-shell/dist/network-session.js b/app-shell/dist/network-session.js new file mode 100644 index 0000000..4a394a6 --- /dev/null +++ b/app-shell/dist/network-session.js @@ -0,0 +1,178 @@ +/** + * Single BackOne core network for all addons (same as backone-cli listnetworks/join). + */ +window.BackOneNetworkSession = (function () { + const NETWORK_KEY = 'backone.lastNetworkId'; + const PEER_KEY = 'backone.lastPeerId'; + + let activeNetwork = null; + let selectedPeer = null; + let coreStatus = { online: false, address: '', networkCount: 0, leafPeerCount: 0, authenticated: false }; + const listeners = new Set(); + + function emit() { + const snap = { + network: activeNetwork, + networkId: getNetworkId(), + peer: selectedPeer, + core: { ...coreStatus } + }; + listeners.forEach(fn => { + try { fn(snap); } catch (_) { /* ignore */ } + }); + } + + function getNetworkId() { + return (localStorage.getItem(NETWORK_KEY) || '').toLowerCase(); + } + + function setNetworkId(id) { + const nwid = BackOnePeerDirectory.normalizeNetworkId(id); + if (nwid) { + localStorage.setItem(NETWORK_KEY, nwid); + } else { + localStorage.removeItem(NETWORK_KEY); + } + BackOnePeerDirectory.setLastNetworkId(nwid); + return nwid; + } + + function getSelectedPeerId() { + return (localStorage.getItem(PEER_KEY) || '').toLowerCase(); + } + + function setSelectedPeer(peer) { + selectedPeer = peer || null; + if (peer && peer.peerId) { + localStorage.setItem(PEER_KEY, peer.peerId); + } else { + localStorage.removeItem(PEER_KEY); + } + emit(); + } + + function pickDefaultNetworkId(networks) { + if (!networks.length) return ''; + const stored = getNetworkId(); + if (stored && networks.some(n => (n.id || '').toLowerCase() === stored)) { + return stored; + } + const preferred = networks.find(n => n.status === 'OK') + || networks.find(n => n.status === 'REQUESTING_CONFIGURATION') + || networks[0]; + return preferred ? (preferred.id || '').toLowerCase() : ''; + } + + /** + * On app start: read BackOne core state (same as backone-cli info / listnetworks / peers). + */ + async function syncFromCore() { + const token = await BackOneAuth.getToken(); + const [status, networks, cliPeers] = await Promise.all([ + BackOnePeerDirectory.loadCoreStatus(), + BackOnePeerDirectory.loadNetworks(), + BackOnePeerDirectory.loadCliPeers() + ]); + + coreStatus = { + online: !!(status && status.online), + address: (status && status.address) || '', + version: (status && status.version) || '', + networkCount: networks.length, + leafPeerCount: BackOnePeerDirectory.countLeafPeers(cliPeers), + authenticated: !!token + }; + + const pick = pickDefaultNetworkId(networks); + if (pick) { + setNetworkId(pick); + activeNetwork = networks.find(n => (n.id || '').toLowerCase() === pick) + || await BackOnePeerDirectory.loadNetwork(pick); + } else { + setNetworkId(''); + activeNetwork = null; + } + + emit(); + return { coreStatus, activeNetwork, networks }; + } + + async function refresh() { + const id = getNetworkId(); + if (!id) { + activeNetwork = null; + emit(); + return null; + } + activeNetwork = await BackOnePeerDirectory.loadNetwork(id); + if (!activeNetwork) { + activeNetwork = { id, name: id, status: 'UNKNOWN' }; + } + emit(); + return activeNetwork; + } + + async function loadNetworks() { + return BackOnePeerDirectory.loadNetworks(); + } + + async function selectNetwork(nwid) { + const id = setNetworkId(nwid); + if (!id) { + await refresh(); + return null; + } + return refresh(); + } + + async function joinNetwork(nwid) { + const id = BackOnePeerDirectory.normalizeNetworkId(nwid); + if (!id) throw new Error('Network ID must be 16 hexadecimal characters'); + await BackOnePeerDirectory.joinNetwork(id); + return syncFromCore(); + } + + async function leaveNetwork(nwid) { + const id = BackOnePeerDirectory.normalizeNetworkId(nwid || getNetworkId()); + if (!id) throw new Error('No network selected'); + await BackOnePeerDirectory.leaveNetwork(id); + if (getNetworkId() === id) { + setNetworkId(''); + selectedPeer = null; + localStorage.removeItem(PEER_KEY); + } + return syncFromCore(); + } + + function subscribe(fn) { + listeners.add(fn); + return () => listeners.delete(fn); + } + + function requireNetworkId() { + const id = getNetworkId(); + if (!id) throw new Error('Join a BackOne network first (same as backone-cli join)'); + return id; + } + + function getCoreStatus() { + return { ...coreStatus }; + } + + return { + getNetworkId, + getActiveNetwork: () => activeNetwork, + getCoreStatus, + getSelectedPeer: () => selectedPeer, + getSelectedPeerId, + setSelectedPeer, + selectNetwork, + joinNetwork, + leaveNetwork, + loadNetworks, + syncFromCore, + refresh, + subscribe, + requireNetworkId + }; +})(); diff --git a/app-shell/dist/peer-directory.js b/app-shell/dist/peer-directory.js new file mode 100644 index 0000000..cff0511 --- /dev/null +++ b/app-shell/dist/peer-directory.js @@ -0,0 +1,266 @@ +window.BackOnePeerDirectory = (function () { + const NETWORK_KEY = 'backone.lastNetworkId'; + const API = { + peers: ['/api/backone/peers', '/app/api/peers', '/peer'], + networks: ['/api/backone/networks', '/app/api/networks', '/network'], + status: ['/api/backone/status', '/app/api/status', '/status'], + network: (id) => [ + `/api/backone/network/${id}`, + `/app/api/network/${id}`, + `/network/${id}` + ], + members: (id) => [ + `/api/backone/network/${id}/members`, + `/app/api/network/${id}/members`, + `/unstable/controller/network/${id}/member` + ], + join: (id) => [ + `/api/backone/network/${id}`, + `/app/api/network/${id}`, + `/network/${id}` + ], + leave: (id) => [ + `/api/backone/network/${id}`, + `/app/api/network/${id}`, + `/network/${id}` + ] + }; + + function apiGet(path) { + return BackOneAuth.apiGet(path); + } + + /** Same data as `backone-cli -j peers` (GET /peer). */ + async function loadCliPeers() { + try { + const peers = await BackOneAuth.apiGetFirst(API.peers); + return Array.isArray(peers) ? peers : []; + } catch (_) { + return []; + } + } + + /** Same data as `backone-cli -j listnetworks` (GET /network). */ + async function loadNetworks() { + try { + const nets = await BackOneAuth.apiGetFirst(API.networks); + return Array.isArray(nets) ? nets : []; + } catch (_) { + return []; + } + } + + /** Same data as `backone-cli -j info` (GET /status). */ + async function loadCoreStatus() { + try { + return await BackOneAuth.apiGetFirst(API.status); + } catch (_) { + try { + const res = await fetch('/health', { cache: 'no-store' }); + return { online: res.ok }; + } catch (_2) { + return { online: false }; + } + } + } + + function countLeafPeers(cliPeers) { + if (!Array.isArray(cliPeers)) return 0; + return cliPeers.filter(p => !p.role || p.role === 'LEAF').length; + } + + async function loadNetwork(nwid) { + if (!nwid) return null; + const networks = await loadNetworks(); + const found = networks.find(n => n.id === nwid); + if (found) return found; + try { + return await BackOneAuth.apiGetFirst(API.network(nwid)); + } catch (_) { + return null; + } + } + + function getLastNetworkId() { + return localStorage.getItem(NETWORK_KEY) || ''; + } + + function setLastNetworkId(nwid) { + if (nwid) localStorage.setItem(NETWORK_KEY, nwid); + } + + function peerIsOnline(p) { + if (!p) return false; + const paths = p.paths || []; + return paths.some(x => x.active && !x.expired); + } + + function peerLinkLabel(p) { + if (!p) return ''; + if (p.tunneled) return 'RELAY'; + const paths = p.paths || []; + for (const path of paths) { + if (path.preferred && path.active && !path.expired) { + return 'DIRECT'; + } + } + for (const path of paths) { + if (path.active && !path.expired) { + return 'DIRECT'; + } + } + return 'RELAY'; + } + + function peerPreferredPath(p) { + if (!p) return ''; + const paths = p.paths || []; + for (const path of paths) { + if (path.preferred && path.address) return path.address; + } + for (const path of paths) { + if (path.active && path.address) return path.address; + } + return ''; + } + + function cliPeerMap(cliPeers) { + const map = {}; + for (const p of cliPeers) { + const id = (p.address || '').toLowerCase(); + if (id) map[id] = p; + } + return map; + } + + async function loadMemberMap(nwid) { + if (!nwid) return {}; + try { + const data = await BackOneAuth.apiGetFirst(API.members(nwid)); + const map = {}; + if (data && Array.isArray(data.data)) { + for (const m of data.data) { + const id = (m.id || '').toLowerCase(); + if (id) map[id] = m; + } + } + return map; + } catch (_) { + return {}; + } + } + + function buildPeerEntry(peerId, member, cliPeer, networkId, networkName) { + const controllerName = member ? (member.name || '') : ''; + const ips = member && member.ipAssignments ? member.ipAssignments : []; + return { + peerId, + networkId: networkId || '', + networkName: networkName || '', + displayName: BackOneContacts.getDisplayName(peerId, controllerName), + controllerName, + nickname: BackOneContacts.getNickname(peerId), + online: peerIsOnline(cliPeer), + latency: cliPeer && typeof cliPeer.latency === 'number' ? cliPeer.latency : null, + role: (cliPeer && cliPeer.role) || (member ? 'LEAF' : ''), + version: (cliPeer && cliPeer.version) || '', + link: cliPeer ? peerLinkLabel(cliPeer) : '', + path: cliPeer ? peerPreferredPath(cliPeer) : '', + ip: ips.length ? ips[0] : '', + onNetwork: !!member + }; + } + + async function loadPeersForNetwork(nwid) { + if (!nwid) return []; + + const [cliPeers, members, selfStatus, network] = await Promise.all([ + loadCliPeers(), + loadMemberMap(nwid), + loadCoreStatus().catch(() => ({})), + loadNetwork(nwid) + ]); + await BackOneContacts.load(); + + const selfId = ((selfStatus && selfStatus.address) || '').toLowerCase(); + const networkId = nwid; + const networkName = network ? (network.name || network.id || nwid) : nwid; + const cliById = cliPeerMap(cliPeers); + const out = []; + + if (Object.keys(members).length > 0) { + for (const peerId of Object.keys(members)) { + const member = members[peerId]; + if (!member || member.authorized === false) continue; + if (peerId === selfId) continue; + out.push(buildPeerEntry(peerId, member, cliById[peerId], networkId, networkName)); + } + } else { + for (const peerId of Object.keys(cliById)) { + const p = cliById[peerId]; + if (!peerId || peerId.length !== 10 || peerId === selfId) continue; + if (p.role && p.role !== 'LEAF') continue; + out.push(buildPeerEntry(peerId, null, p, networkId, networkName)); + } + } + + out.sort((a, b) => { + if (a.online !== b.online) return a.online ? -1 : 1; + return a.displayName.localeCompare(b.displayName); + }); + return out; + } + + function searchPeers(query, list) { + const q = (query || '').trim().toLowerCase(); + if (!q) return list; + return list.filter(p => + p.displayName.toLowerCase().includes(q) || + p.peerId.includes(q) || + (p.networkName || '').toLowerCase().includes(q) || + (p.networkId || '').includes(q) || + (p.controllerName || '').toLowerCase().includes(q) || + (p.role || '').toLowerCase().includes(q) || + (p.path || '').toLowerCase().includes(q) || + (p.ip || '').toLowerCase().includes(q) + ); + } + + function normalizeNetworkId(input) { + const id = String(input || '').replace(/[^0-9a-fA-F]/g, '').toLowerCase(); + return id.length === 16 ? id : ''; + } + + async function joinNetwork(nwid) { + const id = normalizeNetworkId(nwid); + if (!id) { + throw new Error('Network ID must be 16 hexadecimal characters'); + } + return BackOneAuth.apiSendFirst(API.join(id), 'POST', {}); + } + + async function leaveNetwork(nwid) { + const id = normalizeNetworkId(nwid); + if (!id) { + throw new Error('Network ID must be 16 hexadecimal characters'); + } + return BackOneAuth.apiSendFirst(API.leave(id), 'DELETE'); + } + + return { + loadCliPeers, + loadNetworks, + loadNetwork, + loadCoreStatus, + countLeafPeers, + loadPeersForNetwork, + getLastNetworkId, + setLastNetworkId, + joinNetwork, + leaveNetwork, + normalizeNetworkId, + searchPeers, + peerIsOnline, + peerLinkLabel + }; +})(); diff --git a/app-shell/dist/peer-picker.js b/app-shell/dist/peer-picker.js new file mode 100644 index 0000000..dec84bc --- /dev/null +++ b/app-shell/dist/peer-picker.js @@ -0,0 +1,193 @@ +window.BackOnePeerPicker = function PeerPicker(container, options) { + options = options || {}; + const onSelect = options.onSelect || (() => {}); + const onNetworkChange = options.onNetworkChange || (() => {}); + const onAction = options.onAction || null; + const actionLabel = options.actionLabel || 'Select'; + const showActionButton = options.showActionButton !== false; + const useSharedNetwork = options.useSharedNetwork !== false; + const layout = options.layout || 'default'; + + let selectedPeer = null; + let peers = []; + let currentNetwork = null; + let unsub = null; + + if (layout === 'sidebar') { + container.innerHTML = ` +
    +
    + +
      +
      `; + } else { + container.innerHTML = ` +
      +
      BackOne core · same network as backone-cli
      +
      + +
        +
        + ${showActionButton ? `` : ''} +
        `; + } + + const netBanner = container.querySelector('#pp-network-banner'); + const searchInput = container.querySelector('#pp-search'); + const listEl = container.querySelector('#pp-list'); + const selectedEl = container.querySelector('#pp-selected'); + const actionBtn = container.querySelector('#pp-action'); + + function networkLabel(n) { + if (!n) return ''; + return n.name ? `${n.name} (${n.id})` : n.id; + } + + function renderNetworkBanner() { + if (!useSharedNetwork) return; + const id = BackOneNetworkSession.getNetworkId(); + const core = BackOneNetworkSession.getCoreStatus(); + if (!core.online) { + netBanner.innerHTML = 'BackOne offline — peers unavailable'; + return; + } + if (!currentNetwork || !id) { + netBanner.innerHTML = 'No network — join one in the header bar'; + return; + } + const labelSuffix = `${peers.length} contact(s) · ${core.leafPeerCount} VL1 peer(s) from core`; + if (layout === 'sidebar') { + netBanner.textContent = `${networkLabel(currentNetwork)} · ${labelSuffix}`; + } else { + netBanner.textContent = `Network: ${networkLabel(currentNetwork)} · ${textSuffix}`; + } + } + + function renderList() { + const q = searchInput.value; + const filtered = BackOnePeerDirectory.searchPeers(q, peers); + const netTag = currentNetwork ? (currentNetwork.name || currentNetwork.id) : ''; + listEl.innerHTML = filtered.map(p => { + const lat = p.latency != null ? `${p.latency}ms` : '—'; + const link = p.link || 'DIRECT'; + const meta = [p.role || 'LEAF', lat, link, netTag].filter(Boolean).join(' · '); + return ` +
      • + + + ${escapeHtml(p.displayName || p.peerId)} + ${escapeHtml(meta)} + + +
      • `; + }).join('') || '
      • No peers on this network
      • '; + + listEl.querySelectorAll('.peer-item').forEach(li => { + li.addEventListener('click', (ev) => { + if (ev.target.classList.contains('peer-edit')) return; + const id = li.dataset.id; + selectedPeer = peers.find(x => x.peerId === id) || null; + if (selectedPeer) BackOneNetworkSession.setSelectedPeer(selectedPeer); + renderList(); + renderSelected(); + if (selectedPeer) onSelect(selectedPeer, currentNetwork); + }); + const editBtn = li.querySelector('.peer-edit'); + if (editBtn) { + editBtn.addEventListener('click', async (ev) => { + ev.stopPropagation(); + const id = li.dataset.id; + const peer = peers.find(x => x.peerId === id); + if (!peer) return; + const nick = prompt('Nickname for ' + peer.peerId, peer.nickname || peer.controllerName || ''); + if (nick === null) return; + await BackOneContacts.setNickname(peer.peerId, nick); + BackOneContacts.invalidate(); + await refreshPeers(); + }); + } + }); + } + + function renderSelected() { + if (layout === 'sidebar') return; + if (!selectedPeer) { + if (selectedEl) selectedEl.textContent = ''; + if (actionBtn) actionBtn.disabled = true; + return; + } + const net = currentNetwork ? networkLabel(currentNetwork) : BackOneNetworkSession.getNetworkId(); + if (selectedEl) { + selectedEl.innerHTML = `Selected: ${escapeHtml(selectedPeer.displayName)} (${escapeHtml(selectedPeer.peerId)})${net ? ` on ${escapeHtml(net)}` : ''}`; + } + if (actionBtn) actionBtn.disabled = !BackOneNetworkSession.getNetworkId(); + } + + function escapeHtml(s) { + return String(s).replace(/&/g, '&').replace(//g, '>'); + } + + async function refreshPeers() { + currentNetwork = BackOneNetworkSession.getActiveNetwork(); + if (useSharedNetwork && BackOneNetworkSession.getNetworkId() && !currentNetwork) { + currentNetwork = await BackOneNetworkSession.refresh(); + } + renderNetworkBanner(); + const nwid = BackOneNetworkSession.getNetworkId(); + await BackOneContacts.load(); + peers = nwid ? await BackOnePeerDirectory.loadPeersForNetwork(nwid) : []; + const lastPeerId = BackOneNetworkSession.getSelectedPeerId(); + if (lastPeerId) { + selectedPeer = peers.find(p => p.peerId === lastPeerId) || BackOneNetworkSession.getSelectedPeer(); + } + renderList(); + renderSelected(); + onNetworkChange(currentNetwork, peers); + } + + searchInput.addEventListener('input', renderList); + if (actionBtn) { + actionBtn.addEventListener('click', () => { + if (selectedPeer && onAction) onAction(selectedPeer, currentNetwork); + }); + } + + if (useSharedNetwork) { + unsub = BackOneNetworkSession.subscribe(() => refreshPeers()); + } + + refreshPeers(); + + return { + getSelectedPeer: () => selectedPeer, + getSelectedNetwork: () => currentNetwork, + getPeers: () => peers, + refresh: refreshPeers, + destroy: () => { if (unsub) unsub(); } + }; +}; + +window.BackOneCommLayout = { + connectionBarHtml(peer, network) { + const netLabel = network + ? (network.name ? `${network.name} (${network.id})` : network.id) + : BackOneNetworkSession.getNetworkId() || '—'; + const lat = peer && peer.latency != null ? `${peer.latency}ms` : '—'; + const latClass = peer && peer.latency != null && peer.latency < 100 ? 'latency-ok' : ''; + return ` +
        ${escapeHtml(netLabel)}
        +
        ${peer ? escapeHtml(peer.peerId) : '—'}
        +
        ${peer ? escapeHtml(peer.role || 'LEAF') : '—'}
        +
        ${peer ? escapeHtml(peer.link || 'DIRECT') : '—'}
        +
        ${lat}
        +
        `; + } +}; + +function escapeHtml(s) { + return String(s).replace(/&/g, '&').replace(//g, '>'); +} diff --git a/app-shell/dist/styles.css b/app-shell/dist/styles.css new file mode 100644 index 0000000..8a7482a --- /dev/null +++ b/app-shell/dist/styles.css @@ -0,0 +1,643 @@ +:root { + --bg: #0f1419; + --surface: #1a2332; + --surface-2: #243044; + --border: #2d3a4d; + --text: #e7ecf1; + --muted: #8b9bb4; + --accent: #4a90d9; + --accent-dim: #2d5a8a; + --ok: #2ecc71; + --warn: #e6a23c; + --danger: #e74c3c; +} + +* { box-sizing: border-box; } + +body { + font-family: system-ui, -apple-system, sans-serif; + margin: 0; + background: var(--bg); + color: var(--text); + min-height: 100vh; + display: flex; + flex-direction: column; +} + +.app-header { + display: flex; + align-items: center; + gap: 1rem; + padding: 0.65rem 1rem; + background: var(--surface); + border-bottom: 1px solid var(--border); + flex-wrap: wrap; +} + +.app-brand { + display: flex; + align-items: center; + gap: 0.6rem; +} + +.app-brand h1 { + margin: 0; + font-size: 1.15rem; + font-weight: 600; +} + +.core-badge { + font-size: 0.75rem; + padding: 0.15rem 0.55rem; + border-radius: 999px; + font-weight: 500; +} + +.core-badge.online { + background: rgba(46, 204, 113, 0.15); + color: var(--ok); + border: 1px solid rgba(46, 204, 113, 0.35); +} + +.core-badge.offline { + background: rgba(231, 76, 60, 0.12); + color: var(--danger); + border: 1px solid rgba(231, 76, 60, 0.3); +} + +.network-bar { + display: flex; + align-items: center; + gap: 0.45rem; + flex-wrap: wrap; + flex: 1; + min-width: 240px; +} + +.network-bar-label { font-size: 0.82rem; color: var(--muted); } + +.network-bar select, +.network-bar input, +.auth-token-bar input { + background: var(--bg); + color: var(--text); + border: 1px solid var(--border); + border-radius: 6px; + padding: 0.35rem 0.5rem; + font-size: 0.85rem; +} + +.network-bar input { width: 9.5rem; } + +.network-bar button, +.auth-token-bar button { + background: var(--accent-dim); + color: #fff; + border: none; + padding: 0.35rem 0.65rem; + border-radius: 6px; + cursor: pointer; + font-size: 0.85rem; +} + +.network-bar-status { + font-size: 0.75rem; + color: #6b8cae; + flex: 1 1 100%; +} + +.auth-token-bar { + display: flex; + align-items: center; + gap: 0.5rem; + flex: 1 1 100%; +} + +.auth-token-hidden { display: none; } + +.auth-token-label { font-size: 0.82rem; color: var(--muted); } + +.auth-token-bar input { width: 14rem; } + +.addon-nav { + display: flex; + gap: 0.35rem; + margin-left: auto; +} + +.addon-nav button { + background: transparent; + color: var(--muted); + border: 1px solid transparent; + padding: 0.4rem 0.85rem; + border-radius: 6px; + cursor: pointer; + font-size: 0.88rem; +} + +.addon-nav button:hover { color: var(--text); background: var(--surface-2); } + +.addon-nav button.active { + background: var(--accent); + color: #fff; + border-color: var(--accent); +} + +.addon-panel { + flex: 1; + display: flex; + flex-direction: column; + min-height: 0; + overflow: hidden; +} + +.addon-panel > p { + padding: 1.5rem; + margin: 0; +} + +/* —— comm layout (voice / video / chat) —— */ + +.comm-layout { + display: flex; + flex: 1; + min-height: 0; + overflow: hidden; +} + +.comm-sidebar { + width: 300px; + flex-shrink: 0; + display: flex; + flex-direction: column; + border-right: 1px solid var(--border); + background: var(--bg); + min-height: 0; +} + +.comm-sidebar-head { + padding: 1rem 1rem 0.5rem; + border-bottom: 1px solid var(--border); +} + +.comm-sidebar-head h2 { + margin: 0 0 0.35rem; + font-size: 1.05rem; + font-weight: 600; +} + +.comm-sidebar-sub { + margin: 0; + font-size: 0.72rem; + color: var(--muted); + text-transform: uppercase; + letter-spacing: 0.04em; + line-height: 1.4; +} + +.comm-sidebar-body { + flex: 1; + min-height: 0; + overflow: auto; + padding: 0.75rem 1rem; + display: flex; + flex-direction: column; +} + +.comm-sidebar-actions { + padding: 0.75rem 1rem 1rem; + border-top: 1px solid var(--border); + display: flex; + flex-direction: column; + gap: 0.5rem; +} + +.comm-selected-label { + font-size: 0.78rem; + color: var(--muted); + margin-bottom: 0.15rem; +} + +.comm-selected-label strong { + color: var(--text); + font-family: ui-monospace, monospace; +} + +.comm-main { + flex: 1; + display: flex; + flex-direction: column; + min-width: 0; + min-height: 0; + background: #0a0e14; +} + +.comm-main-head { + display: flex; + align-items: center; + justify-content: space-between; + padding: 0.65rem 1rem; + border-bottom: 1px solid var(--border); + background: var(--surface); + font-size: 0.85rem; +} + +.comm-breadcrumb { + color: var(--muted); +} + +.comm-breadcrumb strong { color: var(--text); } + +.comm-head-status { + display: flex; + align-items: center; + gap: 0.75rem; + color: var(--muted); + font-size: 0.82rem; +} + +.comm-head-status .connected { + color: var(--ok); + font-weight: 500; +} + +.comm-stage { + flex: 1; + position: relative; + display: flex; + align-items: center; + justify-content: center; + min-height: 0; + background: #000; +} + +.comm-stage video { + width: 100%; + height: 100%; + object-fit: contain; + background: #000; +} + +.comm-remote-placeholder { + text-align: center; + color: var(--muted); +} + +.comm-remote-placeholder .avatar { + width: 72px; + height: 72px; + border-radius: 50%; + background: var(--surface-2); + margin: 0 auto 0.75rem; + display: flex; + align-items: center; + justify-content: center; + font-size: 2rem; + color: #5a6a7d; +} + +.comm-remote-placeholder .peer-id { + font-family: ui-monospace, monospace; + color: var(--text); + font-size: 0.95rem; +} + +.comm-remote-tag { + position: absolute; + top: 12px; + left: 12px; + background: rgba(0, 0, 0, 0.55); + padding: 0.2rem 0.55rem; + border-radius: 4px; + font-size: 0.75rem; + display: flex; + align-items: center; + gap: 0.35rem; +} + +.comm-remote-tag .dot { + width: 6px; + height: 6px; + border-radius: 50%; + background: var(--accent); +} + +.comm-call-controls { + position: absolute; + bottom: 1.25rem; + left: 50%; + transform: translateX(-50%); + display: flex; + gap: 0.5rem; + padding: 0.45rem; + background: rgba(26, 35, 50, 0.92); + border-radius: 10px; + border: 1px solid var(--border); +} + +.comm-call-controls button { + background: var(--surface-2); + color: var(--text); + border: 1px solid var(--border); + padding: 0.45rem 0.85rem; + border-radius: 6px; + cursor: pointer; + font-size: 0.82rem; +} + +.comm-call-controls button.danger { + background: var(--danger); + border-color: var(--danger); + color: #fff; +} + +.comm-connection-bar { + display: flex; + flex-wrap: wrap; + gap: 1.25rem 2rem; + padding: 0.65rem 1rem; + background: var(--surface); + border-top: 1px solid var(--border); + font-size: 0.78rem; +} + +.comm-stat label { + display: block; + color: var(--muted); + font-size: 0.68rem; + text-transform: uppercase; + letter-spacing: 0.04em; + margin-bottom: 0.15rem; +} + +.comm-stat span { + font-family: ui-monospace, monospace; + font-size: 0.82rem; +} + +.comm-stat .latency-ok { color: var(--ok); } + +.comm-quality { + display: inline-flex; + align-items: flex-end; + gap: 2px; + height: 14px; +} + +.comm-quality span { + width: 3px; + background: var(--ok); + border-radius: 1px; +} + +.comm-quality span:nth-child(1) { height: 4px; } +.comm-quality span:nth-child(2) { height: 7px; } +.comm-quality span:nth-child(3) { height: 10px; } +.comm-quality span:nth-child(4) { height: 14px; } + +/* —— peer picker —— */ + +.peer-picker { display: flex; flex-direction: column; flex: 1; min-height: 0; } + +.peer-info-box { + font-size: 0.82rem; + color: #9eb4d0; + margin-bottom: 0.75rem; + padding: 0.55rem 0.65rem; + background: rgba(45, 90, 138, 0.25); + border: 1px solid rgba(74, 144, 217, 0.25); + border-radius: 6px; + line-height: 1.35; +} + +.peer-picker-row { display: block; margin-bottom: 0.65rem; } + +.peer-picker-row input { + width: 100%; + margin-top: 0.25rem; + padding: 0.45rem 0.55rem; + background: var(--surface); + color: var(--text); + border: 1px solid var(--border); + border-radius: 6px; + font-size: 0.85rem; +} + +.peer-list { + list-style: none; + padding: 0; + margin: 0; + --peer-row-height: 3.25rem; + max-height: calc(var(--peer-row-height) * 10); + flex: 0 1 auto; + overflow-x: hidden; + overflow-y: auto; + border: 1px solid var(--border); + border-radius: 6px; + scrollbar-gutter: stable; +} + +.peer-item { + display: flex; + align-items: flex-start; + gap: 0.5rem; + min-height: var(--peer-row-height); + padding: 0.55rem 0.65rem; + cursor: pointer; + border-bottom: 1px solid var(--border); + box-sizing: border-box; +} + +.peer-item:last-child { border-bottom: none; } + +.peer-item:hover, +.peer-item.active { + background: var(--surface-2); +} + +.peer-item.active { border-left: 3px solid var(--accent); padding-left: calc(0.65rem - 3px); } + +.peer-dot { + width: 8px; + height: 8px; + border-radius: 50%; + background: #666; + flex-shrink: 0; + margin-top: 0.35rem; +} + +.peer-item.online .peer-dot { background: var(--ok); } + +.peer-main { flex: 1; min-width: 0; } + +.peer-name { + display: block; + font-family: ui-monospace, monospace; + font-size: 0.88rem; +} + +.peer-sub { + color: var(--muted); + font-size: 0.72rem; + display: block; + margin-top: 0.15rem; +} + +.peer-edit { + background: transparent; + border: none; + color: var(--muted); + cursor: pointer; + padding: 0.2rem; + font-size: 0.85rem; +} + +.peer-empty { padding: 1rem; color: var(--muted); font-size: 0.85rem; } + +.peer-network-warn { color: var(--warn); } + +.btn-primary { + background: var(--accent); + color: #fff; + border: none; + padding: 0.55rem 1rem; + border-radius: 6px; + cursor: pointer; + font-size: 0.88rem; + font-weight: 500; +} + +.btn-primary:disabled { + opacity: 0.45; + cursor: not-allowed; +} + +.btn-secondary { + background: var(--surface-2); + color: var(--text); + border: 1px solid var(--border); + padding: 0.55rem 1rem; + border-radius: 6px; + cursor: pointer; + font-size: 0.88rem; +} + +/* —— chat —— */ + +.chat-thread-panel { + flex: 1; + display: flex; + flex-direction: column; + min-height: 0; + padding: 1rem; +} + +.chat-thread-header { + padding-bottom: 0.5rem; + border-bottom: 1px solid var(--border); + margin-bottom: 0.5rem; + font-size: 0.9rem; +} + +#chat-thread { + flex: 1; + overflow: auto; + border: 1px solid var(--border); + padding: 0.75rem; + border-radius: 6px; + margin-bottom: 0.5rem; + background: var(--surface); +} + +.chat-compose { + display: flex; + flex-direction: column; + gap: 0.5rem; +} + +.chat-compose textarea { + width: 100%; + padding: 0.5rem; + background: var(--surface); + color: var(--text); + border: 1px solid var(--border); + border-radius: 6px; + resize: vertical; +} + +.chat-compose-row { + display: flex; + gap: 0.5rem; + align-items: center; +} + +/* —— voice stage —— */ + +.voice-stage-inner { + text-align: center; + padding: 2rem; +} + +.voice-stage-inner .avatar { + width: 96px; + height: 96px; + border-radius: 50%; + background: var(--surface-2); + margin: 0 auto 1rem; + display: flex; + align-items: center; + justify-content: center; + font-size: 2.5rem; +} + +/* —— ringing popup —— */ + +.ringing-hidden { display: none; } + +#ringing-popup { + position: fixed; + inset: 0; + background: rgba(0, 0, 0, 0.6); + display: flex; + align-items: center; + justify-content: center; + z-index: 1000; +} + +#ringing-popup.ringing-hidden { display: none; } + +.ringing-card { + background: var(--surface); + padding: 2rem; + border-radius: 12px; + text-align: center; + min-width: 280px; +} + +.ringing-card button { + margin: 0.5rem; + padding: 0.6rem 1.2rem; + border: none; + border-radius: 6px; + cursor: pointer; +} + +.ringing-accept { background: var(--ok); color: #000; } +.ringing-reject { background: var(--danger); color: #fff; } + +.video-local-pip { + position: absolute; + bottom: 4.5rem; + right: 1rem; + width: 160px; + border-radius: 8px; + overflow: hidden; + border: 2px solid var(--border); + background: #000; +} + +.video-local-pip video { + width: 100%; + height: auto; + display: block; +} diff --git a/app-tray/addon.json b/app-tray/addon.json new file mode 100644 index 0000000..1e9a5bf --- /dev/null +++ b/app-tray/addon.json @@ -0,0 +1,6 @@ +{ + "id": "app-tray", + "name": "BackOne Tray", + "version": "1.17.0", + "requires": [] +} diff --git a/app-tray/backone-tray-autostart.desktop b/app-tray/backone-tray-autostart.desktop new file mode 100644 index 0000000..59ed475 --- /dev/null +++ b/app-tray/backone-tray-autostart.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Type=Application +Name=BackOne Tray +Comment=Start BackOne tray icon at login +Exec=/usr/bin/backone-tray +Icon=network-workgroup +Terminal=false +X-GNOME-Autostart-enabled=true +Hidden=false diff --git a/app-tray/backone-tray.desktop b/app-tray/backone-tray.desktop new file mode 100644 index 0000000..d31939c --- /dev/null +++ b/app-tray/backone-tray.desktop @@ -0,0 +1,8 @@ +[Desktop Entry] +Type=Application +Name=BackOne Tray +Comment=BackOne system tray for voice, video, and chat +Exec=/usr/bin/backone-tray +Icon=network-workgroup +Terminal=false +Categories=Network; diff --git a/app-tray/backone-tray.py b/app-tray/backone-tray.py new file mode 100755 index 0000000..3826865 --- /dev/null +++ b/app-tray/backone-tray.py @@ -0,0 +1,127 @@ +#!/usr/bin/env python3 +"""BackOne system tray — opens /app UI and addon deep links.""" +import os +import signal +import subprocess +import sys +import threading +import urllib.request + +import gi +gi.require_version('Gtk', '3.0') +try: + gi.require_version('AyatanaAppIndicator3', '0.1') + from gi.repository import AyatanaAppIndicator3 as AppIndicator3 +except (ImportError, ValueError): + gi.require_version('AppIndicator3', '0.1') + from gi.repository import AppIndicator3 + +from gi.repository import GLib, Gtk + +APP_URL = os.environ.get('BACKONE_APP_URL', 'http://127.0.0.1:9993/app/') +HEALTH_URL = os.environ.get('BACKONE_HEALTH_URL', 'http://127.0.0.1:9993/health') +ICON_NAME = 'network-workgroup' + + +class BackOneTray: + def __init__(self): + self._windows = [] + self.indicator = AppIndicator3.Indicator.new( + 'backone-tray', + ICON_NAME, + AppIndicator3.IndicatorCategory.APPLICATION_STATUS, + ) + self.indicator.set_status(AppIndicator3.IndicatorStatus.ACTIVE) + self.indicator.set_menu(self._build_menu()) + try: + self.indicator.connect('activate', lambda *_: self._open_url(APP_URL)) + except TypeError: + pass + self._update_status() + GLib.timeout_add_seconds(30, self._on_timer) + + def _build_menu(self): + menu = Gtk.Menu() + + def add_item(label, callback): + item = Gtk.MenuItem(label=label) + item.connect('activate', lambda *_: callback()) + item.show() + menu.append(item) + return item + + add_item('Open BackOne App', lambda: self._open_url(APP_URL)) + add_item('Voice', lambda: self._open_url(APP_URL + '#/voice')) + add_item('Video', lambda: self._open_url(APP_URL + '#/video')) + add_item('Chat', lambda: self._open_url(APP_URL + '#/chat')) + menu.append(Gtk.SeparatorMenuItem()) + add_item('Restart BackOne Service', self._restart_service) + add_item('Quit Tray', Gtk.main_quit) + menu.show() + return menu + + def _service_ok(self): + try: + with urllib.request.urlopen(HEALTH_URL, timeout=2) as resp: + return resp.status == 200 + except Exception: + return False + + def _update_status(self): + title = 'BackOne (online)' if self._service_ok() else 'BackOne (offline)' + self.indicator.set_title(title) + + def _on_timer(self): + self._update_status() + return True + + def _open_url(self, url): + if self._try_webkit(url): + return + for cmd in ( + ['xdg-open', url], + ['gio', 'open', url], + ['sensible-browser', url], + ): + try: + subprocess.Popen(cmd, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) + return + except OSError: + continue + + def _try_webkit(self, url): + try: + gi.require_version('WebKit2', '4.1') + except ValueError: + try: + gi.require_version('WebKit2', '4.0') + except ValueError: + return False + from gi.repository import WebKit2 + + win = Gtk.Window(title='BackOne') + win.set_default_size(900, 640) + view = WebKit2.WebView() + view.load_uri(url) + win.add(view) + win.connect('destroy', lambda w: self._windows.remove(w) if w in self._windows else None) + self._windows.append(win) + win.show_all() + return True + + def _restart_service(self): + subprocess.Popen( + ['pkexec', 'systemctl', 'restart', 'backone'], + stdout=subprocess.DEVNULL, + stderr=subprocess.DEVNULL, + ) + + +def main(): + signal.signal(signal.SIGINT, signal.SIG_DFL) + BackOneTray() + Gtk.main() + + +if __name__ == '__main__': + sys.exit(main()) diff --git a/backone.spec b/backone.spec index 532dfc5..73e979f 100644 --- a/backone.spec +++ b/backone.spec @@ -1,5 +1,5 @@ Name: backone -Version: 1.14.1 +Version: 1.17.1 Release: 1%{?dist} Summary: BackOne global ethernet switch @@ -155,6 +155,15 @@ chmod 0755 $RPM_BUILD_ROOT/etc/init.d/backone %endif %changelog +* Tue Jun 30 2026 Dedy Sutanto - 1.17.1 +- Fix /api/backone routes and reinstallable Web UI packages + +* Tue Jun 30 2026 Dedy Sutanto - 1.17.0 +- Tray app, auto web server, peer contact UI + +* Tue Jun 30 2026 Dedy Sutanto - 1.16.0 +- Release notes + * Tue Oct 8 2024 Dedy Sutanto - 1.14.1 - see https://github.com/proitlab/BackOne for release notes diff --git a/ci/scripts/bump_version.sh b/ci/scripts/bump_version.sh new file mode 100755 index 0000000..59d5e0f --- /dev/null +++ b/ci/scripts/bump_version.sh @@ -0,0 +1,34 @@ +#!/bin/bash +set -euo pipefail + +if [ $# -lt 1 ]; then + echo "Usage: $0 [changelog message]" >&2 + exit 1 +fi + +VERSION="$1" +MESSAGE="${2:-see https://github.com/proitlab/BackOne for release notes}" +ROOT="$(cd "$(dirname "$0")/../.." && pwd)" +IFS='.' read -r MAJ MIN REV <<< "${VERSION%%-*}" +REV="${REV:-0}" + +sed -i "s/^#define ZEROTIER_ONE_VERSION_MAJOR .*/#define ZEROTIER_ONE_VERSION_MAJOR ${MAJ}/" "$ROOT/version.h" +sed -i "s/^#define ZEROTIER_ONE_VERSION_MINOR .*/#define ZEROTIER_ONE_VERSION_MINOR ${MIN}/" "$ROOT/version.h" +sed -i "s/^#define ZEROTIER_ONE_VERSION_REVISION .*/#define ZEROTIER_ONE_VERSION_REVISION ${REV}/" "$ROOT/version.h" +sed -i "s/^#define ZEROTIER_ONE_VERSION_BUILD .*/#define ZEROTIER_ONE_VERSION_BUILD 0/" "$ROOT/version.h" + +echo "$VERSION" > "$ROOT/debian/version" + +"$ROOT/ci/scripts/munge_debian_changelog.sh" "$ROOT/debian/changelog" "$VERSION" \ + "Dedy Sutanto " "$MESSAGE" + +"$ROOT/ci/scripts/munge_rpm_spec.sh" "$ROOT/backone.spec" "$VERSION" \ + "Dedy Sutanto " "$MESSAGE" + +for addon in comms-core voice video chat updater app-tray; do + if [ -f "$ROOT/addons/$addon/addon.json" ]; then + sed -i "s/\"version\": \"[^\"]*\"/\"version\": \"${VERSION}\"/" "$ROOT/addons/$addon/addon.json" + fi +done + +echo "Bumped to ${VERSION}" diff --git a/ci/scripts/munge_debian_changelog.sh b/ci/scripts/munge_debian_changelog.sh index d37cb06..2f8dd32 100755 --- a/ci/scripts/munge_debian_changelog.sh +++ b/ci/scripts/munge_debian_changelog.sh @@ -31,7 +31,7 @@ else fi awk -v version=${VERSION} -v date=${DATE} -v name=${NAME} -v message=${MESSAGE} \ - 'BEGIN{print "zerotier-one (" version ") stable; urgency=medium\n\n * " message "\n\n -- " name " " date "\n" }{ print }' \ + 'BEGIN{print "backone (" version ") stable; urgency=medium\n\n * " message "\n\n -- " name " " date "\n" }{ print }' \ ${FILE} > ${FILE}.new mv ${FILE}.new ${FILE} diff --git a/ci/scripts/sync-authtoken.sh b/ci/scripts/sync-authtoken.sh new file mode 100644 index 0000000..13232e9 --- /dev/null +++ b/ci/scripts/sync-authtoken.sh @@ -0,0 +1,53 @@ +#!/bin/sh +# Keep ~/.backOneOneAuthToken and /var/lib/backone/authtoken.secret in sync (same as backone-cli). +set -e + +BACKONE_HOME="${BACKONE_HOME:-/var/lib/backone}" +SECRET="${BACKONE_HOME}/authtoken.secret" + +trim_token() { + tr -d '\n\r \t' < "$1" +} + +sync_for_user() { + user="$1" + home="$2" + [ -n "$user" ] && [ -n "$home" ] && [ -d "$home" ] || return 0 + user_token="${home}/.backOneOneAuthToken" + + if [ -f "$user_token" ] && [ -s "$user_token" ]; then + ut="$(trim_token "$user_token")" + [ -n "$ut" ] || return 0 + st="" + if [ -f "$SECRET" ]; then + st="$(trim_token "$SECRET" 2>/dev/null || true)" + fi + if [ "$ut" != "$st" ]; then + printf '%s' "$ut" > "$SECRET" + chown backone:backone "$SECRET" 2>/dev/null || true + chmod 0600 "$SECRET" 2>/dev/null || true + echo "Synced ${SECRET} from ${user_token}" + fi + return 0 + fi + + if [ -f "$SECRET" ]; then + install -o "$user" -g "$(id -gn "$user" 2>/dev/null || echo "$user")" -m 0600 "$SECRET" "$user_token" 2>/dev/null \ + || cp "$SECRET" "$user_token" + chown "$user":"$(id -gn "$user" 2>/dev/null || echo "$user")" "$user_token" 2>/dev/null || true + chmod 0600 "$user_token" 2>/dev/null || true + echo "Installed ${user_token} from ${SECRET}" + fi +} + +if [ -n "${SUDO_USER:-}" ] && [ "$SUDO_USER" != "root" ]; then + home="$(getent passwd "$SUDO_USER" | cut -d: -f6)" + sync_for_user "$SUDO_USER" "$home" +fi + +if [ -n "${USER:-}" ] && [ "$USER" != "root" ] && [ "$USER" != "${SUDO_USER:-}" ]; then + home="$(getent passwd "$USER" | cut -d: -f6)" + sync_for_user "$USER" "$home" +fi + +exit 0 diff --git a/controller/EmbeddedNetworkController.cpp b/controller/EmbeddedNetworkController.cpp index 14c3725..7dee499 100644 --- a/controller/EmbeddedNetworkController.cpp +++ b/controller/EmbeddedNetworkController.cpp @@ -1120,6 +1120,12 @@ void EmbeddedNetworkController::configureHTTPControlPlane( }; s.Get(memberListPath2, memberListGet2); sv6.Get(memberListPath2, memberListGet2); + std::string appMemberListPath = "/app/api/network/([0-9a-fA-F]{16})/members"; + s.Get(appMemberListPath, memberListGet2); + sv6.Get(appMemberListPath, memberListGet2); + std::string backoneMemberListPath = "/api/backone/network/([0-9a-fA-F]{16})/members"; + s.Get(backoneMemberListPath, memberListGet2); + sv6.Get(backoneMemberListPath, memberListGet2); auto memberGet = [&, setContent](const httplib::Request &req, httplib::Response &res) { auto networkID = req.matches[1]; diff --git a/debian/.debhelper/bucket/files/1ee0b1581032c46aac6ebd1de74b130f35082fb45a12e9ead42ad5c775f9b64f b/debian/.debhelper/bucket/files/1ee0b1581032c46aac6ebd1de74b130f35082fb45a12e9ead42ad5c775f9b64f new file mode 100755 index 0000000..dd2ca93 --- /dev/null +++ b/debian/.debhelper/bucket/files/1ee0b1581032c46aac6ebd1de74b130f35082fb45a12e9ead42ad5c775f9b64f @@ -0,0 +1,1825 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright 1992-2016 Free Software Foundation, Inc. + +timestamp='2016-11-04' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see . +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). + + +# Please send patches to . +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.sub ($timestamp) + +Copyright 1992-2016 Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit ;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ + linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ + knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ + kopensolaris*-gnu* | cloudabi*-eabi* | \ + storm-chaos* | os2-emx* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + android-linux) + os=-linux-android + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple | -axis | -knuth | -cray | -microblaze*) + os= + basic_machine=$1 + ;; + -bluegene*) + os=-cnk + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco6) + os=-sco5v6 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5v6*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*178) + os=-lynxos178 + ;; + -lynx*5) + os=-lynxos5 + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | aarch64 | aarch64_be \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ + | arc | arceb \ + | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ + | avr | avr32 \ + | ba \ + | be32 | be64 \ + | bfin \ + | c4x | c8051 | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | e2k | epiphany \ + | fido | fr30 | frv | ft32 \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | hexagon \ + | i370 | i860 | i960 | ia64 \ + | ip2k | iq2000 \ + | k1om \ + | le32 | le64 \ + | lm32 \ + | m32c | m32r | m32rle | m68000 | m68k | m88k \ + | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64octeon | mips64octeonel \ + | mips64orion | mips64orionel \ + | mips64r5900 | mips64r5900el \ + | mips64vr | mips64vrel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa32r6 | mipsisa32r6el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64r6 | mipsisa64r6el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipsr5900 | mipsr5900el \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | moxie \ + | mt \ + | msp430 \ + | nds32 | nds32le | nds32be \ + | nios | nios2 | nios2eb | nios2el \ + | ns16k | ns32k \ + | open8 | or1k | or1knd | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle \ + | pru \ + | pyramid \ + | riscv32 | riscv64 \ + | rl78 | rx \ + | score \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ + | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ + | spu \ + | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ + | ubicom32 \ + | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ + | visium \ + | we32k \ + | x86 | xc16x | xstormy16 | xtensa \ + | z8k | z80) + basic_machine=$basic_machine-unknown + ;; + c54x) + basic_machine=tic54x-unknown + ;; + c55x) + basic_machine=tic55x-unknown + ;; + c6x) + basic_machine=tic6x-unknown + ;; + leon|leon[3-9]) + basic_machine=sparc-$basic_machine + ;; + m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + ms1) + basic_machine=mt-unknown + ;; + + strongarm | thumb | xscale) + basic_machine=arm-unknown + ;; + xgate) + basic_machine=$basic_machine-unknown + os=-none + ;; + xscaleeb) + basic_machine=armeb-unknown + ;; + + xscaleel) + basic_machine=armel-unknown + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i*86 | x86_64) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | aarch64-* | aarch64_be-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* | avr32-* \ + | ba-* \ + | be32-* | be64-* \ + | bfin-* | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* \ + | c8051-* | clipper-* | craynv-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | e2k-* | elxsi-* \ + | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | hexagon-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* | iq2000-* \ + | k1om-* \ + | le32-* | le64-* \ + | lm32-* \ + | m32c-* | m32r-* | m32rle-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ + | microblaze-* | microblazeel-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64octeon-* | mips64octeonel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64r5900-* | mips64r5900el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mips64vr5900-* | mips64vr5900el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa32r6-* | mipsisa32r6el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64r6-* | mipsisa64r6el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipsr5900-* | mipsr5900el-* \ + | mipstx39-* | mipstx39el-* \ + | mmix-* \ + | mt-* \ + | msp430-* \ + | nds32-* | nds32le-* | nds32be-* \ + | nios-* | nios2-* | nios2eb-* | nios2el-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | open8-* \ + | or1k*-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ + | pru-* \ + | pyramid-* \ + | riscv32-* | riscv64-* \ + | rl78-* | romp-* | rs6000-* | rx-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ + | sparclite-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ + | tahoe-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tile*-* \ + | tron-* \ + | ubicom32-* \ + | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ + | vax-* \ + | visium-* \ + | we32k-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* \ + | xstormy16-* | xtensa*-* \ + | ymp-* \ + | z8k-* | z80-*) + ;; + # Recognize the basic CPU types without company name, with glob match. + xtensa*) + basic_machine=$basic_machine-unknown + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + abacus) + basic_machine=abacus-unknown + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amd64) + basic_machine=x86_64-pc + ;; + amd64-*) + basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-unknown + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aros) + basic_machine=i386-pc + os=-aros + ;; + asmjs) + basic_machine=asmjs-unknown + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + blackfin) + basic_machine=bfin-unknown + os=-linux + ;; + blackfin-*) + basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + bluegene*) + basic_machine=powerpc-ibm + os=-cnk + ;; + c54x-*) + basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c55x-*) + basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c6x-*) + basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; + cegcc) + basic_machine=arm-unknown + os=-cegcc + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | j90) + basic_machine=j90-cray + os=-unicos + ;; + craynv) + basic_machine=craynv-cray + os=-unicosmp + ;; + cr16 | cr16-*) + basic_machine=cr16-unknown + os=-elf + ;; + crds | unos) + basic_machine=m68k-crds + ;; + crisv32 | crisv32-* | etraxfs*) + basic_machine=crisv32-axis + ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; + crx) + basic_machine=crx-unknown + os=-elf + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=-tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=-tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + dicos) + basic_machine=i686-pc + os=-dicos + ;; + djgpp) + basic_machine=i586-pc + os=-msdosdjgpp + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + e500v[12]) + basic_machine=powerpc-unknown + os=$os"spe" + ;; + e500v[12]-*) + basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + os=$os"spe" + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; + i*86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i*86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i*86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i*86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + leon-*|leon[3-9]-*) + basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'` + ;; + m68knommu) + basic_machine=m68k-unknown + os=-linux + ;; + m68knommu-*) + basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + microblaze*) + basic_machine=microblaze-xilinx + ;; + mingw64) + basic_machine=x86_64-pc + os=-mingw64 + ;; + mingw32) + basic_machine=i686-pc + os=-mingw32 + ;; + mingw32ce) + basic_machine=arm-unknown + os=-mingw32ce + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; + moxiebox) + basic_machine=moxie-unknown + os=-moxiebox + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + ms1-*) + basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` + ;; + msys) + basic_machine=i686-pc + os=-msys + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + nacl) + basic_machine=le32-unknown + os=-nacl + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; + np1) + basic_machine=np1-gould + ;; + neo-tandem) + basic_machine=neo-tandem + ;; + nse-tandem) + basic_machine=nse-tandem + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + openrisc | openrisc-*) + basic_machine=or32-unknown + ;; + os400) + basic_machine=powerpc-ibm + os=-os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + parisc) + basic_machine=hppa-unknown + os=-linux + ;; + parisc-*) + basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pc98) + basic_machine=i386-pc + ;; + pc98-*) + basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium | p5 | k5 | k6 | nexgen | viac3) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon | athlon_*) + basic_machine=i686-pc + ;; + pentiumii | pentium2 | pentiumiii | pentium3) + basic_machine=i686-pc + ;; + pentium4) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium4-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=power-ibm + ;; + ppc | ppcbe) basic_machine=powerpc-unknown + ;; + ppc-* | ppcbe-*) + basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + rdos | rdos64) + basic_machine=x86_64-pc + os=-rdos + ;; + rdos32) + basic_machine=i386-pc + os=-rdos + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + s390 | s390-*) + basic_machine=s390-ibm + ;; + s390x | s390x-*) + basic_machine=s390x-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sb1) + basic_machine=mipsisa64sb1-unknown + ;; + sb1el) + basic_machine=mipsisa64sb1el-unknown + ;; + sde) + basic_machine=mipsisa32-sde + os=-elf + ;; + sei) + basic_machine=mips-sei + os=-seiux + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sh5el) + basic_machine=sh5le-unknown + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparclite-wrs | simso-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + strongarm-* | thumb-*) + basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3e) + basic_machine=alphaev5-cray + os=-unicos + ;; + t90) + basic_machine=t90-cray + os=-unicos + ;; + tile*) + basic_machine=$basic_machine-unknown + os=-linux-gnu + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + tpf) + basic_machine=s390x-ibm + os=-tpf + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + xbox) + basic_machine=i686-pc + os=-mingw32 + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + xscale-* | xscalee[bl]-*) + basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` + ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + z80-*-coff) + basic_machine=z80-unknown + os=-sim + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + romp) + basic_machine=romp-ibm + ;; + mmix) + basic_machine=mmix-knuth + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp10) + # there are many clones, so DEC is not a safe bet + basic_machine=pdp10-unknown + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) + basic_machine=sh-unknown + ;; + sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -auroraux) + os=-auroraux + ;; + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -svr4*) + os=-sysv4 + ;; + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # First accept the basic system types. + # The portable systems comes first. + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ + | -sym* | -kopensolaris* | -plan9* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* | -aros* | -cloudabi* | -sortix* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ + | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \ + | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ + | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* | -cegcc* \ + | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ + | -linux-newlib* | -linux-musl* | -linux-uclibc* \ + | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ + | -onefs* | -tirtos* | -phoenix* | -fuchsia*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto-qnx*) + ;; + -nto*) + os=`echo $os | sed -e 's|nto|nto-qnx|'` + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -linux-dietlibc) + os=-linux-dietlibc + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -opened*) + os=-openedition + ;; + -os400*) + os=-os400 + ;; + -wince*) + os=-wince + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -atheos*) + os=-atheos + ;; + -syllable*) + os=-syllable + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -nova*) + os=-rtmk-nova + ;; + -ns2 ) + os=-nextstep2 + ;; + -nsk*) + os=-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -tpf*) + os=-tpf + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; + -xenix) + os=-xenix + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; + -aros*) + os=-aros + ;; + -zvmoe) + os=-zvmoe + ;; + -dicos*) + os=-dicos + ;; + -nacl*) + ;; + -ios) + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + score-*) + os=-elf + ;; + spu-*) + os=-elf + ;; + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + c4x-* | tic4x-*) + os=-coff + ;; + c8051-*) + os=-elf + ;; + hexagon-*) + os=-elf + ;; + tic54x-*) + os=-coff + ;; + tic55x-*) + os=-coff + ;; + tic6x-*) + os=-coff + ;; + # This must come before the *-dec entry. + pdp10-*) + os=-tops20 + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + ;; + m68*-cisco) + os=-aout + ;; + mep-*) + os=-elf + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + or32-*) + os=-coff + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-be) + os=-beos + ;; + *-haiku) + os=-haiku + ;; + *-ibm) + os=-aix + ;; + *-knuth) + os=-mmixware + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -cnk*|-aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs* | -opened*) + vendor=ibm + ;; + -os400*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -tpf*) + vendor=ibm + ;; + -vxsim* | -vxworks* | -windiss*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + vendor=atari + ;; + -vos*) + vendor=stratus + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os +exit + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/debian/.debhelper/bucket/files/8131853dbc8c3be5171fa96353de7a884a79d3f1d6b3fbf48f99037f5f95fe27 b/debian/.debhelper/bucket/files/8131853dbc8c3be5171fa96353de7a884a79d3f1d6b3fbf48f99037f5f95fe27 new file mode 100755 index 0000000..2e9ad7f --- /dev/null +++ b/debian/.debhelper/bucket/files/8131853dbc8c3be5171fa96353de7a884a79d3f1d6b3fbf48f99037f5f95fe27 @@ -0,0 +1,1462 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright 1992-2016 Free Software Foundation, Inc. + +timestamp='2016-10-02' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see . +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). +# +# Originally written by Per Bothner; maintained since 2000 by Ben Elliston. +# +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess +# +# Please send patches to . + + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright 1992-2016 Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + +trap 'exit 1' 1 2 15 + +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. + +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +# Portable tmp directory creation inspired by the Autoconf team. + +set_cc_for_build=' +trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; +: ${TMPDIR=/tmp} ; + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; +dummy=$tmp/dummy ; +tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; +case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int x;" > $dummy.c ; + for c in cc gcc c89 c99 ; do + if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac ; set_cc_for_build= ;' + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +case "${UNAME_SYSTEM}" in +Linux|GNU|GNU/*) + # If the system lacks a compiler, then just pick glibc. + # We could probably try harder. + LIBC=gnu + + eval $set_cc_for_build + cat <<-EOF > $dummy.c + #include + #if defined(__UCLIBC__) + LIBC=uclibc + #elif defined(__dietlibc__) + LIBC=dietlibc + #else + LIBC=gnu + #endif + EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` + ;; +esac + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + sysctl="sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ + /sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || \ + echo unknown)` + case "${UNAME_MACHINE_ARCH}" in + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + sh5el) machine=sh5le-unknown ;; + earmv*) + arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'` + endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'` + machine=${arch}${endian}-unknown + ;; + *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently (or will in the future) and ABI. + case "${UNAME_MACHINE_ARCH}" in + earm*) + os=netbsdelf + ;; + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ELF__ + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # Determine ABI tags. + case "${UNAME_MACHINE_ARCH}" in + earm*) + expr='s/^earmv[0-9]/-eabi/;s/eb$//' + abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"` + ;; + esac + # The OS release + # Debian GNU/NetBSD machines have a different userland, and + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. + case "${UNAME_VERSION}" in + Debian*) + release='-gnu' + ;; + *) + release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2` + ;; + esac + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}${abi}" + exit ;; + *:Bitrig:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} + exit ;; + *:OpenBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} + exit ;; + *:LibertyBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${UNAME_RELEASE} + exit ;; + *:ekkoBSD:*:*) + echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + exit ;; + *:SolidBSD:*:*) + echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} + exit ;; + macppc:MirBSD:*:*) + echo powerpc-unknown-mirbsd${UNAME_RELEASE} + exit ;; + *:MirBSD:*:*) + echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} + exit ;; + *:Sortix:*:*) + echo ${UNAME_MACHINE}-unknown-sortix + exit ;; + alpha:OSF1:*:*) + case $UNAME_RELEASE in + *4.0) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + ;; + *5.*) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + ;; + esac + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + case "$ALPHA_CPU_TYPE" in + "EV4 (21064)") + UNAME_MACHINE=alpha ;; + "EV4.5 (21064)") + UNAME_MACHINE=alpha ;; + "LCA4 (21066/21068)") + UNAME_MACHINE=alpha ;; + "EV5 (21164)") + UNAME_MACHINE=alphaev5 ;; + "EV5.6 (21164A)") + UNAME_MACHINE=alphaev56 ;; + "EV5.6 (21164PC)") + UNAME_MACHINE=alphapca56 ;; + "EV5.7 (21164PC)") + UNAME_MACHINE=alphapca57 ;; + "EV6 (21264)") + UNAME_MACHINE=alphaev6 ;; + "EV6.7 (21264A)") + UNAME_MACHINE=alphaev67 ;; + "EV6.8CB (21264C)") + UNAME_MACHINE=alphaev68 ;; + "EV6.8AL (21264B)") + UNAME_MACHINE=alphaev68 ;; + "EV6.8CX (21264D)") + UNAME_MACHINE=alphaev68 ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE=alphaev69 ;; + "EV7 (21364)") + UNAME_MACHINE=alphaev7 ;; + "EV7.9 (21364A)") + UNAME_MACHINE=alphaev79 ;; + esac + # A Pn.n version is a patched version. + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + # Reset EXIT trap before exiting to avoid spurious non-zero exit code. + exitcode=$? + trap '' 0 + exit $exitcode ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix + exit ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-morphos + exit ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit ;; + *:z/VM:*:*) + echo s390-ibm-zvmoe + exit ;; + *:OS400:*:*) + echo powerpc-ibm-os400 + exit ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit ;; + arm*:riscos:*:*|arm*:RISCOS:*:*) + echo arm-unknown-riscos + exit ;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit ;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit ;; + DRS?6000:unix:4.0:6*) + echo sparc-icl-nx6 + exit ;; + DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) echo sparc-icl-nx7; exit ;; + esac ;; + s390x:SunOS:*:*) + echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) + echo i386-pc-auroraux${UNAME_RELEASE} + exit ;; + i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) + eval $set_cc_for_build + SUN_ARCH=i386 + # If there is a compiler, see if it is configured for 64-bit objects. + # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. + # This test works for both compilers. + if [ "$CC_FOR_BUILD" != no_compiler_found ]; then + if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + SUN_ARCH=x86_64 + fi + fi + echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = x && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit ;; + m68k:machten:*:*) + echo m68k-apple-machten${UNAME_RELEASE} + exit ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && + dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`$dummy $dummyarg` && + { echo "$SYSTEM_NAME"; exit; } + echo mips-mips-riscos${UNAME_RELEASE} + exit ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit ;; + Motorola:*:4.3:PL8-*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ + [ ${TARGET_BINARY_INTERFACE}x = x ] + then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else + echo i586-dg-dgux${UNAME_RELEASE} + fi + exit ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + exit ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` + then + echo "$SYSTEM_NAME" + else + echo rs6000-ibm-aix3.2.5 + fi + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit ;; + *:AIX:*:[4567]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/lslpp ] ; then + IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | + awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 + 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH=hppa2.0n ;; + 64) HP_ARCH=hppa2.0w ;; + '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 + esac ;; + esac + fi + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS="" $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + test -z "$HP_ARCH" && HP_ARCH=hppa + fi ;; + esac + if [ ${HP_ARCH} = hppa2.0w ] + then + eval $set_cc_for_build + + # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating + # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler + # generating 64-bit code. GNU and HP use different nomenclature: + # + # $ CC_FOR_BUILD=cc ./config.guess + # => hppa2.0w-hp-hpux11.23 + # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess + # => hppa64-hp-hpux11.23 + + if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | + grep -q __LP64__ + then + HP_ARCH=hppa2.0w + else + HP_ARCH=hppa64 + fi + fi + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit ;; + 3050*:HI-UX:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + echo unknown-hitachi-hiuxwe2 + exit ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + *:UNICOS/mp:*:*) + echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + 5000:UNIX_System_V:4.*:*) + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:FreeBSD:*:*) + UNAME_PROCESSOR=`/usr/bin/uname -p` + case ${UNAME_PROCESSOR} in + amd64) + echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + *) + echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + esac + exit ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit ;; + *:MINGW64*:*) + echo ${UNAME_MACHINE}-pc-mingw64 + exit ;; + *:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit ;; + *:MSYS*:*) + echo ${UNAME_MACHINE}-pc-msys + exit ;; + i*:windows32*:*) + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 + exit ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit ;; + *:Interix*:*) + case ${UNAME_MACHINE} in + x86) + echo i586-pc-interix${UNAME_RELEASE} + exit ;; + authenticamd | genuineintel | EM64T) + echo x86_64-unknown-interix${UNAME_RELEASE} + exit ;; + IA64) + echo ia64-unknown-interix${UNAME_RELEASE} + exit ;; + esac ;; + [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) + echo i${UNAME_MACHINE}-pc-mks + exit ;; + 8664:Windows_NT:*) + echo x86_64-pc-mks + exit ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i586-pc-interix + exit ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit ;; + amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) + echo x86_64-unknown-cygwin + exit ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + *:GNU:*:*) + # the GNU system + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit ;; + *:GNU/*:*:*) + # other systems with GNU libc and userland + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} + exit ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit ;; + aarch64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + aarch64_be:Linux:*:*) + UNAME_MACHINE=aarch64_be + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep -q ld.so.1 + if test "$?" = 0 ; then LIBC=gnulibc1 ; fi + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + arc:Linux:*:* | arceb:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + arm*:Linux:*:*) + eval $set_cc_for_build + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_EABI__ + then + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + else + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi + else + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf + fi + fi + exit ;; + avr32*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + cris:Linux:*:*) + echo ${UNAME_MACHINE}-axis-linux-${LIBC} + exit ;; + crisv32:Linux:*:*) + echo ${UNAME_MACHINE}-axis-linux-${LIBC} + exit ;; + e2k:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + frv:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + hexagon:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + i*86:Linux:*:*) + echo ${UNAME_MACHINE}-pc-linux-${LIBC} + exit ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + k1om:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + m32r*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + mips:Linux:*:* | mips64:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef ${UNAME_MACHINE} + #undef ${UNAME_MACHINE}el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=${UNAME_MACHINE}el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=${UNAME_MACHINE} + #else + CPU= + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } + ;; + mips64el:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + openrisc*:Linux:*:*) + echo or1k-unknown-linux-${LIBC} + exit ;; + or32:Linux:*:* | or1k*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + padre:Linux:*:*) + echo sparc-unknown-linux-${LIBC} + exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-${LIBC} + exit ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; + PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; + *) echo hppa-unknown-linux-${LIBC} ;; + esac + exit ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-${LIBC} + exit ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-${LIBC} + exit ;; + ppc64le:Linux:*:*) + echo powerpc64le-unknown-linux-${LIBC} + exit ;; + ppcle:Linux:*:*) + echo powerpcle-unknown-linux-${LIBC} + exit ;; + riscv32:Linux:*:* | riscv64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux-${LIBC} + exit ;; + sh64*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + tile*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + vax:Linux:*:*) + echo ${UNAME_MACHINE}-dec-linux-${LIBC} + exit ;; + x86_64:Linux:*:*) + echo ${UNAME_MACHINE}-pc-linux-${LIBC} + exit ;; + xtensa*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 + exit ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit ;; + i*86:syllable:*:*) + echo ${UNAME_MACHINE}-pc-syllable + exit ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit ;; + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + fi + exit ;; + i*86:*:5:[678]*) + # UnixWare 7.x, OpenUNIX and OpenServer 6. + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + exit ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i586. + # Note: whatever this is, it MUST be the same as what config.sub + # prints for the "djgpp" host, or else GDB configure will decide that + # this is a cross-build. + echo i586-pc-msdosdjgpp + exit ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi + exit ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit ;; + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv + exit ;; + M680?0:D-NIX:5.3:*) + echo m68k-diab-dnix + exit ;; + M68*:*:R3V[5678]*:*) + test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; + 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; + NCR*:*:4.2:* | MPRAS*:*:4.2:*) + OS_REL='.3' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit ;; + i*86:VOS:*:*) + # From Paul.Green@stratus.com. + echo ${UNAME_MACHINE}-stratus-vos + exit ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi + exit ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit ;; + BePC:Haiku:*:*) # Haiku running on Intel PC compatible. + echo i586-pc-haiku + exit ;; + x86_64:Haiku:*:*) + echo x86_64-unknown-haiku + exit ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux${UNAME_RELEASE} + exit ;; + SX-7:SUPER-UX:*:*) + echo sx7-nec-superux${UNAME_RELEASE} + exit ;; + SX-8:SUPER-UX:*:*) + echo sx8-nec-superux${UNAME_RELEASE} + exit ;; + SX-8R:SUPER-UX:*:*) + echo sx8r-nec-superux${UNAME_RELEASE} + exit ;; + SX-ACE:SUPER-UX:*:*) + echo sxace-nec-superux${UNAME_RELEASE} + exit ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Darwin:*:*) + UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown + eval $set_cc_for_build + if test "$UNAME_PROCESSOR" = unknown ; then + UNAME_PROCESSOR=powerpc + fi + if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then + if [ "$CC_FOR_BUILD" != no_compiler_found ]; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + case $UNAME_PROCESSOR in + i386) UNAME_PROCESSOR=x86_64 ;; + powerpc) UNAME_PROCESSOR=powerpc64 ;; + esac + fi + fi + elif test "$UNAME_PROCESSOR" = i386 ; then + # Avoid executing cc on OS X 10.9, as it ships with a stub + # that puts up a graphical alert prompting to install + # developer tools. Any system running Mac OS X 10.7 or + # later (Darwin 11 and later) is required to have a 64-bit + # processor. This is not true of the ARM version of Darwin + # that Apple uses in portable devices. + UNAME_PROCESSOR=x86_64 + fi + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + exit ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = x86; then + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + exit ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit ;; + NEO-?:NONSTOP_KERNEL:*:*) + echo neo-tandem-nsk${UNAME_RELEASE} + exit ;; + NSE-*:NONSTOP_KERNEL:*:*) + echo nse-tandem-nsk${UNAME_RELEASE} + exit ;; + NSR-?:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = 386; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 + exit ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit ;; + SEI:*:*:SEIUX) + echo mips-sei-seiux${UNAME_RELEASE} + exit ;; + *:DragonFly:*:*) + echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit ;; + *:*VMS:*:*) + UNAME_MACHINE=`(uname -p) 2>/dev/null` + case "${UNAME_MACHINE}" in + A*) echo alpha-dec-vms ; exit ;; + I*) echo ia64-dec-vms ; exit ;; + V*) echo vax-dec-vms ; exit ;; + esac ;; + *:XENIX:*:SysV) + echo i386-pc-xenix + exit ;; + i*86:skyos:*:*) + echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE} | sed -e 's/ .*$//'` + exit ;; + i*86:rdos:*:*) + echo ${UNAME_MACHINE}-pc-rdos + exit ;; + i*86:AROS:*:*) + echo ${UNAME_MACHINE}-pc-aros + exit ;; + x86_64:VMkernel:*:*) + echo ${UNAME_MACHINE}-unknown-esx + exit ;; + amd64:Isilon\ OneFS:*:*) + echo x86_64-unknown-onefs + exit ;; +esac + +cat >&2 </dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = ${UNAME_MACHINE} +UNAME_RELEASE = ${UNAME_RELEASE} +UNAME_SYSTEM = ${UNAME_SYSTEM} +UNAME_VERSION = ${UNAME_VERSION} +EOF + +exit 1 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/debian/.debhelper/bucket/index b/debian/.debhelper/bucket/index new file mode 100644 index 0000000..fa26844 --- /dev/null +++ b/debian/.debhelper/bucket/index @@ -0,0 +1,2 @@ +8131853dbc8c3be5171fa96353de7a884a79d3f1d6b3fbf48f99037f5f95fe27 ext/libpqxx-7.7.3/config/config.guess +1ee0b1581032c46aac6ebd1de74b130f35082fb45a12e9ead42ad5c775f9b64f ext/libpqxx-7.7.3/config/config.sub diff --git a/debian/.debhelper/generated/backone-addon-chat/dh_installchangelogs.dch.trimmed b/debian/.debhelper/generated/backone-addon-chat/dh_installchangelogs.dch.trimmed new file mode 100644 index 0000000..e11e45c --- /dev/null +++ b/debian/.debhelper/generated/backone-addon-chat/dh_installchangelogs.dch.trimmed @@ -0,0 +1,257 @@ +backone (1.17.1) stable; urgency=medium + + * Fix /api/backone routes and reinstallable Web UI packages + + -- Dedy Sutanto Tue, 30 Jun 2026 12:02:07 +0700 + +backone (1.17.0) stable; urgency=medium + + * Tray app, auto web server, peer contact UI + + -- Dedy Sutanto Tue, 30 Jun 2026 09:55:07 +0700 + +backone (1.16.0) stable; urgency=medium + + * Release notes + + -- Dedy Sutanto Tue, 30 Jun 2026 08:59:49 +0700 + +backone (1.15.0) stable; urgency=medium + + * Separated addon architecture: voice, video, chat, updater + + -- Dedy Sutanto Tue, 30 Jun 2026 08:37:16 +0700 +zerotier-one (1.14.1) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Wed, 11 Sep 2024 01:00:00 -0700 + +zerotier-one (1.14.0) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Tue, 19 Mar 2024 01:00:00 -0700 + +zerotier-one (1.12.2) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Tue, 12 Sep 2023 01:00:00 -0700 + +zerotier-one (1.12.1) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Fri, 25 Aug 2023 01:00:00 -0700 + +zerotier-one (1.12.0) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Thu, 17 Aug 2023 01:00:00 -0700 + +zerotier-one (1.10.6) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Tue, 21 Mar 2023 01:00:00 -0700 + +zerotier-one (1.10.5) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Fri, 10 Mar 2023 01:00:00 -0700 + +zerotier-one (1.10.4) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Mon, 06 Mar 2023 01:00:00 -0700 + +zerotier-one (1.10.3) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Sat, 21 Jan 2023 01:00:00 -0700 + +zerotier-one (1.10.2) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Thu, 13 Oct 2022 01:00:00 -0700 + +zerotier-one (1.10.1) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Mon, 27 Jun 2022 01:00:00 -0700 + +zerotier-one (1.10.0) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Fri, 03 Jun 2022 01:00:00 -0700 + +zerotier-one (1.8.10) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Tue, 10 May 2022 01:00:00 -0700 + +zerotier-one (1.8.9) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Mon, 25 Apr 2022 01:00:00 -0700 + +zerotier-one (1.8.8) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Mon, 11 Apr 2022 01:00:00 -0700 + +zerotier-one (1.8.7) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Mon, 21 Mar 2022 01:00:00 -0700 + +zerotier-one (1.8.6) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Mon, 07 Mar 2022 01:00:00 -0700 + +zerotier-one (1.8.5) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Fri, 17 Dec 2021 01:00:00 -0700 + +zerotier-one (1.8.4) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Mon, 23 Nov 2021 01:00:00 -0700 + +zerotier-one (1.8.3) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Mon, 15 Nov 2021 01:00:00 -0700 + +zerotier-one (1.8.2) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Mon, 08 Nov 2021 01:00:00 -0700 + +zerotier-one (1.8.1) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Wed, 20 Oct 2021 01:00:00 -0700 + +zerotier-one (1.8.0) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Wed, 15 Sep 2021 01:00:00 -0700 + +zerotier-one (1.6.6) unstable; urgency=medium + + * Backport endpoint mitigation against address collision attack. + + -- Adam Ierymenko Tue, 21 Sep 2021 01:00:00 -0700 + +zerotier-one (1.6.5) unstable; urgency=medium + + * Fix path filtering bug that could cause "software laser" effect. + * Fix printf overflow in CLI (not exploitable or security related) + * Fix Windows device enumeration issue. + + -- Adam Ierymenko Tue, 13 Apr 2021 01:00:00 -0700 + +zerotier-one (1.6.4) unstable; urgency=medium + + * REALLY fix a problem causing nodes to go into a "coma" with some network configurations. + + -- Adam Ierymenko Tue, 15 Feb 2021 01:00:00 -0700 + +zerotier-one (1.6.3-1) unstable; urgency=medium + + * Fix a problem causing nodes to go into a "coma" with some network configurations. + + -- Adam Ierymenko Tue, 02 Feb 2021 01:00:00 -0700 + +zerotier-one (1.6.2-2) unstable; urgency=medium + + * This is a minor update to the 1.6.2 package to address issues with + running on ARMv6 CPUs like the Raspberry Pi Zero and original v1 Pi. + + -- Adam Ierymenko Tue, 31 Nov 2020 01:00:00 -0700 + +zerotier-one (1.6.2) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Mon, 30 Nov 2020 01:00:00 -0700 + +zerotier-one (1.6.1) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Tue, 24 Nov 2020 01:00:00 -0700 + +zerotier-one (1.6.0) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Thu, 19 Nov 2020 01:00:00 -0700 + +zerotier-one (1.5.0) unstable; urgency=medium + + * Version 1.5.0 is actually 1.6.0-beta1 + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Mon, 05 Aug 2020 01:00:00 -0700 + +zerotier-one (1.4.6) unstable; urgency=medium + + * Update default root server list + * Fix build flags on "armhf" (32-bit ARM) platforms for better + compatibility with Pi Zero and other devices. + * Fix license text in one.cpp. + * Add a clarification to LICENSE.txt. + + -- Adam Ierymenko Fri, 30 Aug 2019 01:00:00 -0700 + +zerotier-one (1.4.4) unstable; urgency=medium + + * See https://github.com/zerotier/ZeroTierOne for release notes. + * License changed to BSL 1.1 + + -- Adam Ierymenko Fri, 23 Aug 2019 01:00:00 -0700 + +zerotier-one (1.4.2-2) unstable; urgency=medium + + * See https://github.com/zerotier/ZeroTierOne for release notes. + * This is a new build that fixes a binary build issue with containers and SELinux + + -- Adam Ierymenko Thu, 04 Aug 2019 01:00:00 -0700 + +zerotier-one (1.4.2) unstable; urgency=medium + + * See https://github.com/zerotier/ZeroTierOne for release notes. + + -- Adam Ierymenko Thu, 04 Aug 2019 01:00:00 -0700 + +zerotier-one (1.4.0) unstable; urgency=medium + + * See https://github.com/zerotier/ZeroTierOne for release notes. + + -- Adam Ierymenko Thu, 29 Jul 2019 01:00:00 -0700 + +# Older entries have been removed from this changelog. +# To read the complete changelog use `apt changelog backone-addon-chat`. diff --git a/debian/.debhelper/generated/backone-addon-chat/installed-by-dh_installman b/debian/.debhelper/generated/backone-addon-chat/installed-by-dh_installman new file mode 100644 index 0000000..e69de29 diff --git a/debian/.debhelper/generated/backone-addon-comms-core/dh_installchangelogs.dch.trimmed b/debian/.debhelper/generated/backone-addon-comms-core/dh_installchangelogs.dch.trimmed new file mode 100644 index 0000000..b138f51 --- /dev/null +++ b/debian/.debhelper/generated/backone-addon-comms-core/dh_installchangelogs.dch.trimmed @@ -0,0 +1,257 @@ +backone (1.17.1) stable; urgency=medium + + * Fix /api/backone routes and reinstallable Web UI packages + + -- Dedy Sutanto Tue, 30 Jun 2026 12:02:07 +0700 + +backone (1.17.0) stable; urgency=medium + + * Tray app, auto web server, peer contact UI + + -- Dedy Sutanto Tue, 30 Jun 2026 09:55:07 +0700 + +backone (1.16.0) stable; urgency=medium + + * Release notes + + -- Dedy Sutanto Tue, 30 Jun 2026 08:59:49 +0700 + +backone (1.15.0) stable; urgency=medium + + * Separated addon architecture: voice, video, chat, updater + + -- Dedy Sutanto Tue, 30 Jun 2026 08:37:16 +0700 +zerotier-one (1.14.1) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Wed, 11 Sep 2024 01:00:00 -0700 + +zerotier-one (1.14.0) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Tue, 19 Mar 2024 01:00:00 -0700 + +zerotier-one (1.12.2) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Tue, 12 Sep 2023 01:00:00 -0700 + +zerotier-one (1.12.1) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Fri, 25 Aug 2023 01:00:00 -0700 + +zerotier-one (1.12.0) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Thu, 17 Aug 2023 01:00:00 -0700 + +zerotier-one (1.10.6) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Tue, 21 Mar 2023 01:00:00 -0700 + +zerotier-one (1.10.5) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Fri, 10 Mar 2023 01:00:00 -0700 + +zerotier-one (1.10.4) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Mon, 06 Mar 2023 01:00:00 -0700 + +zerotier-one (1.10.3) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Sat, 21 Jan 2023 01:00:00 -0700 + +zerotier-one (1.10.2) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Thu, 13 Oct 2022 01:00:00 -0700 + +zerotier-one (1.10.1) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Mon, 27 Jun 2022 01:00:00 -0700 + +zerotier-one (1.10.0) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Fri, 03 Jun 2022 01:00:00 -0700 + +zerotier-one (1.8.10) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Tue, 10 May 2022 01:00:00 -0700 + +zerotier-one (1.8.9) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Mon, 25 Apr 2022 01:00:00 -0700 + +zerotier-one (1.8.8) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Mon, 11 Apr 2022 01:00:00 -0700 + +zerotier-one (1.8.7) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Mon, 21 Mar 2022 01:00:00 -0700 + +zerotier-one (1.8.6) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Mon, 07 Mar 2022 01:00:00 -0700 + +zerotier-one (1.8.5) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Fri, 17 Dec 2021 01:00:00 -0700 + +zerotier-one (1.8.4) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Mon, 23 Nov 2021 01:00:00 -0700 + +zerotier-one (1.8.3) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Mon, 15 Nov 2021 01:00:00 -0700 + +zerotier-one (1.8.2) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Mon, 08 Nov 2021 01:00:00 -0700 + +zerotier-one (1.8.1) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Wed, 20 Oct 2021 01:00:00 -0700 + +zerotier-one (1.8.0) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Wed, 15 Sep 2021 01:00:00 -0700 + +zerotier-one (1.6.6) unstable; urgency=medium + + * Backport endpoint mitigation against address collision attack. + + -- Adam Ierymenko Tue, 21 Sep 2021 01:00:00 -0700 + +zerotier-one (1.6.5) unstable; urgency=medium + + * Fix path filtering bug that could cause "software laser" effect. + * Fix printf overflow in CLI (not exploitable or security related) + * Fix Windows device enumeration issue. + + -- Adam Ierymenko Tue, 13 Apr 2021 01:00:00 -0700 + +zerotier-one (1.6.4) unstable; urgency=medium + + * REALLY fix a problem causing nodes to go into a "coma" with some network configurations. + + -- Adam Ierymenko Tue, 15 Feb 2021 01:00:00 -0700 + +zerotier-one (1.6.3-1) unstable; urgency=medium + + * Fix a problem causing nodes to go into a "coma" with some network configurations. + + -- Adam Ierymenko Tue, 02 Feb 2021 01:00:00 -0700 + +zerotier-one (1.6.2-2) unstable; urgency=medium + + * This is a minor update to the 1.6.2 package to address issues with + running on ARMv6 CPUs like the Raspberry Pi Zero and original v1 Pi. + + -- Adam Ierymenko Tue, 31 Nov 2020 01:00:00 -0700 + +zerotier-one (1.6.2) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Mon, 30 Nov 2020 01:00:00 -0700 + +zerotier-one (1.6.1) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Tue, 24 Nov 2020 01:00:00 -0700 + +zerotier-one (1.6.0) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Thu, 19 Nov 2020 01:00:00 -0700 + +zerotier-one (1.5.0) unstable; urgency=medium + + * Version 1.5.0 is actually 1.6.0-beta1 + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Mon, 05 Aug 2020 01:00:00 -0700 + +zerotier-one (1.4.6) unstable; urgency=medium + + * Update default root server list + * Fix build flags on "armhf" (32-bit ARM) platforms for better + compatibility with Pi Zero and other devices. + * Fix license text in one.cpp. + * Add a clarification to LICENSE.txt. + + -- Adam Ierymenko Fri, 30 Aug 2019 01:00:00 -0700 + +zerotier-one (1.4.4) unstable; urgency=medium + + * See https://github.com/zerotier/ZeroTierOne for release notes. + * License changed to BSL 1.1 + + -- Adam Ierymenko Fri, 23 Aug 2019 01:00:00 -0700 + +zerotier-one (1.4.2-2) unstable; urgency=medium + + * See https://github.com/zerotier/ZeroTierOne for release notes. + * This is a new build that fixes a binary build issue with containers and SELinux + + -- Adam Ierymenko Thu, 04 Aug 2019 01:00:00 -0700 + +zerotier-one (1.4.2) unstable; urgency=medium + + * See https://github.com/zerotier/ZeroTierOne for release notes. + + -- Adam Ierymenko Thu, 04 Aug 2019 01:00:00 -0700 + +zerotier-one (1.4.0) unstable; urgency=medium + + * See https://github.com/zerotier/ZeroTierOne for release notes. + + -- Adam Ierymenko Thu, 29 Jul 2019 01:00:00 -0700 + +# Older entries have been removed from this changelog. +# To read the complete changelog use `apt changelog backone-addon-comms-core`. diff --git a/debian/.debhelper/generated/backone-addon-comms-core/installed-by-dh_installman b/debian/.debhelper/generated/backone-addon-comms-core/installed-by-dh_installman new file mode 100644 index 0000000..e69de29 diff --git a/debian/.debhelper/generated/backone-addon-updater/dh_installchangelogs.dch.trimmed b/debian/.debhelper/generated/backone-addon-updater/dh_installchangelogs.dch.trimmed new file mode 100644 index 0000000..973da32 --- /dev/null +++ b/debian/.debhelper/generated/backone-addon-updater/dh_installchangelogs.dch.trimmed @@ -0,0 +1,257 @@ +backone (1.17.1) stable; urgency=medium + + * Fix /api/backone routes and reinstallable Web UI packages + + -- Dedy Sutanto Tue, 30 Jun 2026 12:02:07 +0700 + +backone (1.17.0) stable; urgency=medium + + * Tray app, auto web server, peer contact UI + + -- Dedy Sutanto Tue, 30 Jun 2026 09:55:07 +0700 + +backone (1.16.0) stable; urgency=medium + + * Release notes + + -- Dedy Sutanto Tue, 30 Jun 2026 08:59:49 +0700 + +backone (1.15.0) stable; urgency=medium + + * Separated addon architecture: voice, video, chat, updater + + -- Dedy Sutanto Tue, 30 Jun 2026 08:37:16 +0700 +zerotier-one (1.14.1) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Wed, 11 Sep 2024 01:00:00 -0700 + +zerotier-one (1.14.0) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Tue, 19 Mar 2024 01:00:00 -0700 + +zerotier-one (1.12.2) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Tue, 12 Sep 2023 01:00:00 -0700 + +zerotier-one (1.12.1) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Fri, 25 Aug 2023 01:00:00 -0700 + +zerotier-one (1.12.0) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Thu, 17 Aug 2023 01:00:00 -0700 + +zerotier-one (1.10.6) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Tue, 21 Mar 2023 01:00:00 -0700 + +zerotier-one (1.10.5) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Fri, 10 Mar 2023 01:00:00 -0700 + +zerotier-one (1.10.4) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Mon, 06 Mar 2023 01:00:00 -0700 + +zerotier-one (1.10.3) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Sat, 21 Jan 2023 01:00:00 -0700 + +zerotier-one (1.10.2) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Thu, 13 Oct 2022 01:00:00 -0700 + +zerotier-one (1.10.1) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Mon, 27 Jun 2022 01:00:00 -0700 + +zerotier-one (1.10.0) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Fri, 03 Jun 2022 01:00:00 -0700 + +zerotier-one (1.8.10) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Tue, 10 May 2022 01:00:00 -0700 + +zerotier-one (1.8.9) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Mon, 25 Apr 2022 01:00:00 -0700 + +zerotier-one (1.8.8) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Mon, 11 Apr 2022 01:00:00 -0700 + +zerotier-one (1.8.7) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Mon, 21 Mar 2022 01:00:00 -0700 + +zerotier-one (1.8.6) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Mon, 07 Mar 2022 01:00:00 -0700 + +zerotier-one (1.8.5) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Fri, 17 Dec 2021 01:00:00 -0700 + +zerotier-one (1.8.4) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Mon, 23 Nov 2021 01:00:00 -0700 + +zerotier-one (1.8.3) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Mon, 15 Nov 2021 01:00:00 -0700 + +zerotier-one (1.8.2) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Mon, 08 Nov 2021 01:00:00 -0700 + +zerotier-one (1.8.1) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Wed, 20 Oct 2021 01:00:00 -0700 + +zerotier-one (1.8.0) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Wed, 15 Sep 2021 01:00:00 -0700 + +zerotier-one (1.6.6) unstable; urgency=medium + + * Backport endpoint mitigation against address collision attack. + + -- Adam Ierymenko Tue, 21 Sep 2021 01:00:00 -0700 + +zerotier-one (1.6.5) unstable; urgency=medium + + * Fix path filtering bug that could cause "software laser" effect. + * Fix printf overflow in CLI (not exploitable or security related) + * Fix Windows device enumeration issue. + + -- Adam Ierymenko Tue, 13 Apr 2021 01:00:00 -0700 + +zerotier-one (1.6.4) unstable; urgency=medium + + * REALLY fix a problem causing nodes to go into a "coma" with some network configurations. + + -- Adam Ierymenko Tue, 15 Feb 2021 01:00:00 -0700 + +zerotier-one (1.6.3-1) unstable; urgency=medium + + * Fix a problem causing nodes to go into a "coma" with some network configurations. + + -- Adam Ierymenko Tue, 02 Feb 2021 01:00:00 -0700 + +zerotier-one (1.6.2-2) unstable; urgency=medium + + * This is a minor update to the 1.6.2 package to address issues with + running on ARMv6 CPUs like the Raspberry Pi Zero and original v1 Pi. + + -- Adam Ierymenko Tue, 31 Nov 2020 01:00:00 -0700 + +zerotier-one (1.6.2) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Mon, 30 Nov 2020 01:00:00 -0700 + +zerotier-one (1.6.1) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Tue, 24 Nov 2020 01:00:00 -0700 + +zerotier-one (1.6.0) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Thu, 19 Nov 2020 01:00:00 -0700 + +zerotier-one (1.5.0) unstable; urgency=medium + + * Version 1.5.0 is actually 1.6.0-beta1 + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Mon, 05 Aug 2020 01:00:00 -0700 + +zerotier-one (1.4.6) unstable; urgency=medium + + * Update default root server list + * Fix build flags on "armhf" (32-bit ARM) platforms for better + compatibility with Pi Zero and other devices. + * Fix license text in one.cpp. + * Add a clarification to LICENSE.txt. + + -- Adam Ierymenko Fri, 30 Aug 2019 01:00:00 -0700 + +zerotier-one (1.4.4) unstable; urgency=medium + + * See https://github.com/zerotier/ZeroTierOne for release notes. + * License changed to BSL 1.1 + + -- Adam Ierymenko Fri, 23 Aug 2019 01:00:00 -0700 + +zerotier-one (1.4.2-2) unstable; urgency=medium + + * See https://github.com/zerotier/ZeroTierOne for release notes. + * This is a new build that fixes a binary build issue with containers and SELinux + + -- Adam Ierymenko Thu, 04 Aug 2019 01:00:00 -0700 + +zerotier-one (1.4.2) unstable; urgency=medium + + * See https://github.com/zerotier/ZeroTierOne for release notes. + + -- Adam Ierymenko Thu, 04 Aug 2019 01:00:00 -0700 + +zerotier-one (1.4.0) unstable; urgency=medium + + * See https://github.com/zerotier/ZeroTierOne for release notes. + + -- Adam Ierymenko Thu, 29 Jul 2019 01:00:00 -0700 + +# Older entries have been removed from this changelog. +# To read the complete changelog use `apt changelog backone-addon-updater`. diff --git a/debian/.debhelper/generated/backone-addon-updater/installed-by-dh_installman b/debian/.debhelper/generated/backone-addon-updater/installed-by-dh_installman new file mode 100644 index 0000000..e69de29 diff --git a/debian/.debhelper/generated/backone-addon-video/dh_installchangelogs.dch.trimmed b/debian/.debhelper/generated/backone-addon-video/dh_installchangelogs.dch.trimmed new file mode 100644 index 0000000..ce6cec7 --- /dev/null +++ b/debian/.debhelper/generated/backone-addon-video/dh_installchangelogs.dch.trimmed @@ -0,0 +1,257 @@ +backone (1.17.1) stable; urgency=medium + + * Fix /api/backone routes and reinstallable Web UI packages + + -- Dedy Sutanto Tue, 30 Jun 2026 12:02:07 +0700 + +backone (1.17.0) stable; urgency=medium + + * Tray app, auto web server, peer contact UI + + -- Dedy Sutanto Tue, 30 Jun 2026 09:55:07 +0700 + +backone (1.16.0) stable; urgency=medium + + * Release notes + + -- Dedy Sutanto Tue, 30 Jun 2026 08:59:49 +0700 + +backone (1.15.0) stable; urgency=medium + + * Separated addon architecture: voice, video, chat, updater + + -- Dedy Sutanto Tue, 30 Jun 2026 08:37:16 +0700 +zerotier-one (1.14.1) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Wed, 11 Sep 2024 01:00:00 -0700 + +zerotier-one (1.14.0) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Tue, 19 Mar 2024 01:00:00 -0700 + +zerotier-one (1.12.2) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Tue, 12 Sep 2023 01:00:00 -0700 + +zerotier-one (1.12.1) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Fri, 25 Aug 2023 01:00:00 -0700 + +zerotier-one (1.12.0) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Thu, 17 Aug 2023 01:00:00 -0700 + +zerotier-one (1.10.6) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Tue, 21 Mar 2023 01:00:00 -0700 + +zerotier-one (1.10.5) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Fri, 10 Mar 2023 01:00:00 -0700 + +zerotier-one (1.10.4) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Mon, 06 Mar 2023 01:00:00 -0700 + +zerotier-one (1.10.3) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Sat, 21 Jan 2023 01:00:00 -0700 + +zerotier-one (1.10.2) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Thu, 13 Oct 2022 01:00:00 -0700 + +zerotier-one (1.10.1) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Mon, 27 Jun 2022 01:00:00 -0700 + +zerotier-one (1.10.0) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Fri, 03 Jun 2022 01:00:00 -0700 + +zerotier-one (1.8.10) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Tue, 10 May 2022 01:00:00 -0700 + +zerotier-one (1.8.9) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Mon, 25 Apr 2022 01:00:00 -0700 + +zerotier-one (1.8.8) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Mon, 11 Apr 2022 01:00:00 -0700 + +zerotier-one (1.8.7) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Mon, 21 Mar 2022 01:00:00 -0700 + +zerotier-one (1.8.6) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Mon, 07 Mar 2022 01:00:00 -0700 + +zerotier-one (1.8.5) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Fri, 17 Dec 2021 01:00:00 -0700 + +zerotier-one (1.8.4) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Mon, 23 Nov 2021 01:00:00 -0700 + +zerotier-one (1.8.3) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Mon, 15 Nov 2021 01:00:00 -0700 + +zerotier-one (1.8.2) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Mon, 08 Nov 2021 01:00:00 -0700 + +zerotier-one (1.8.1) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Wed, 20 Oct 2021 01:00:00 -0700 + +zerotier-one (1.8.0) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Wed, 15 Sep 2021 01:00:00 -0700 + +zerotier-one (1.6.6) unstable; urgency=medium + + * Backport endpoint mitigation against address collision attack. + + -- Adam Ierymenko Tue, 21 Sep 2021 01:00:00 -0700 + +zerotier-one (1.6.5) unstable; urgency=medium + + * Fix path filtering bug that could cause "software laser" effect. + * Fix printf overflow in CLI (not exploitable or security related) + * Fix Windows device enumeration issue. + + -- Adam Ierymenko Tue, 13 Apr 2021 01:00:00 -0700 + +zerotier-one (1.6.4) unstable; urgency=medium + + * REALLY fix a problem causing nodes to go into a "coma" with some network configurations. + + -- Adam Ierymenko Tue, 15 Feb 2021 01:00:00 -0700 + +zerotier-one (1.6.3-1) unstable; urgency=medium + + * Fix a problem causing nodes to go into a "coma" with some network configurations. + + -- Adam Ierymenko Tue, 02 Feb 2021 01:00:00 -0700 + +zerotier-one (1.6.2-2) unstable; urgency=medium + + * This is a minor update to the 1.6.2 package to address issues with + running on ARMv6 CPUs like the Raspberry Pi Zero and original v1 Pi. + + -- Adam Ierymenko Tue, 31 Nov 2020 01:00:00 -0700 + +zerotier-one (1.6.2) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Mon, 30 Nov 2020 01:00:00 -0700 + +zerotier-one (1.6.1) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Tue, 24 Nov 2020 01:00:00 -0700 + +zerotier-one (1.6.0) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Thu, 19 Nov 2020 01:00:00 -0700 + +zerotier-one (1.5.0) unstable; urgency=medium + + * Version 1.5.0 is actually 1.6.0-beta1 + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Mon, 05 Aug 2020 01:00:00 -0700 + +zerotier-one (1.4.6) unstable; urgency=medium + + * Update default root server list + * Fix build flags on "armhf" (32-bit ARM) platforms for better + compatibility with Pi Zero and other devices. + * Fix license text in one.cpp. + * Add a clarification to LICENSE.txt. + + -- Adam Ierymenko Fri, 30 Aug 2019 01:00:00 -0700 + +zerotier-one (1.4.4) unstable; urgency=medium + + * See https://github.com/zerotier/ZeroTierOne for release notes. + * License changed to BSL 1.1 + + -- Adam Ierymenko Fri, 23 Aug 2019 01:00:00 -0700 + +zerotier-one (1.4.2-2) unstable; urgency=medium + + * See https://github.com/zerotier/ZeroTierOne for release notes. + * This is a new build that fixes a binary build issue with containers and SELinux + + -- Adam Ierymenko Thu, 04 Aug 2019 01:00:00 -0700 + +zerotier-one (1.4.2) unstable; urgency=medium + + * See https://github.com/zerotier/ZeroTierOne for release notes. + + -- Adam Ierymenko Thu, 04 Aug 2019 01:00:00 -0700 + +zerotier-one (1.4.0) unstable; urgency=medium + + * See https://github.com/zerotier/ZeroTierOne for release notes. + + -- Adam Ierymenko Thu, 29 Jul 2019 01:00:00 -0700 + +# Older entries have been removed from this changelog. +# To read the complete changelog use `apt changelog backone-addon-video`. diff --git a/debian/.debhelper/generated/backone-addon-video/installed-by-dh_installman b/debian/.debhelper/generated/backone-addon-video/installed-by-dh_installman new file mode 100644 index 0000000..e69de29 diff --git a/debian/.debhelper/generated/backone-addon-voice/dh_installchangelogs.dch.trimmed b/debian/.debhelper/generated/backone-addon-voice/dh_installchangelogs.dch.trimmed new file mode 100644 index 0000000..494c917 --- /dev/null +++ b/debian/.debhelper/generated/backone-addon-voice/dh_installchangelogs.dch.trimmed @@ -0,0 +1,257 @@ +backone (1.17.1) stable; urgency=medium + + * Fix /api/backone routes and reinstallable Web UI packages + + -- Dedy Sutanto Tue, 30 Jun 2026 12:02:07 +0700 + +backone (1.17.0) stable; urgency=medium + + * Tray app, auto web server, peer contact UI + + -- Dedy Sutanto Tue, 30 Jun 2026 09:55:07 +0700 + +backone (1.16.0) stable; urgency=medium + + * Release notes + + -- Dedy Sutanto Tue, 30 Jun 2026 08:59:49 +0700 + +backone (1.15.0) stable; urgency=medium + + * Separated addon architecture: voice, video, chat, updater + + -- Dedy Sutanto Tue, 30 Jun 2026 08:37:16 +0700 +zerotier-one (1.14.1) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Wed, 11 Sep 2024 01:00:00 -0700 + +zerotier-one (1.14.0) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Tue, 19 Mar 2024 01:00:00 -0700 + +zerotier-one (1.12.2) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Tue, 12 Sep 2023 01:00:00 -0700 + +zerotier-one (1.12.1) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Fri, 25 Aug 2023 01:00:00 -0700 + +zerotier-one (1.12.0) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Thu, 17 Aug 2023 01:00:00 -0700 + +zerotier-one (1.10.6) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Tue, 21 Mar 2023 01:00:00 -0700 + +zerotier-one (1.10.5) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Fri, 10 Mar 2023 01:00:00 -0700 + +zerotier-one (1.10.4) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Mon, 06 Mar 2023 01:00:00 -0700 + +zerotier-one (1.10.3) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Sat, 21 Jan 2023 01:00:00 -0700 + +zerotier-one (1.10.2) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Thu, 13 Oct 2022 01:00:00 -0700 + +zerotier-one (1.10.1) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Mon, 27 Jun 2022 01:00:00 -0700 + +zerotier-one (1.10.0) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Fri, 03 Jun 2022 01:00:00 -0700 + +zerotier-one (1.8.10) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Tue, 10 May 2022 01:00:00 -0700 + +zerotier-one (1.8.9) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Mon, 25 Apr 2022 01:00:00 -0700 + +zerotier-one (1.8.8) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Mon, 11 Apr 2022 01:00:00 -0700 + +zerotier-one (1.8.7) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Mon, 21 Mar 2022 01:00:00 -0700 + +zerotier-one (1.8.6) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Mon, 07 Mar 2022 01:00:00 -0700 + +zerotier-one (1.8.5) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Fri, 17 Dec 2021 01:00:00 -0700 + +zerotier-one (1.8.4) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Mon, 23 Nov 2021 01:00:00 -0700 + +zerotier-one (1.8.3) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Mon, 15 Nov 2021 01:00:00 -0700 + +zerotier-one (1.8.2) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Mon, 08 Nov 2021 01:00:00 -0700 + +zerotier-one (1.8.1) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Wed, 20 Oct 2021 01:00:00 -0700 + +zerotier-one (1.8.0) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Wed, 15 Sep 2021 01:00:00 -0700 + +zerotier-one (1.6.6) unstable; urgency=medium + + * Backport endpoint mitigation against address collision attack. + + -- Adam Ierymenko Tue, 21 Sep 2021 01:00:00 -0700 + +zerotier-one (1.6.5) unstable; urgency=medium + + * Fix path filtering bug that could cause "software laser" effect. + * Fix printf overflow in CLI (not exploitable or security related) + * Fix Windows device enumeration issue. + + -- Adam Ierymenko Tue, 13 Apr 2021 01:00:00 -0700 + +zerotier-one (1.6.4) unstable; urgency=medium + + * REALLY fix a problem causing nodes to go into a "coma" with some network configurations. + + -- Adam Ierymenko Tue, 15 Feb 2021 01:00:00 -0700 + +zerotier-one (1.6.3-1) unstable; urgency=medium + + * Fix a problem causing nodes to go into a "coma" with some network configurations. + + -- Adam Ierymenko Tue, 02 Feb 2021 01:00:00 -0700 + +zerotier-one (1.6.2-2) unstable; urgency=medium + + * This is a minor update to the 1.6.2 package to address issues with + running on ARMv6 CPUs like the Raspberry Pi Zero and original v1 Pi. + + -- Adam Ierymenko Tue, 31 Nov 2020 01:00:00 -0700 + +zerotier-one (1.6.2) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Mon, 30 Nov 2020 01:00:00 -0700 + +zerotier-one (1.6.1) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Tue, 24 Nov 2020 01:00:00 -0700 + +zerotier-one (1.6.0) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Thu, 19 Nov 2020 01:00:00 -0700 + +zerotier-one (1.5.0) unstable; urgency=medium + + * Version 1.5.0 is actually 1.6.0-beta1 + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Mon, 05 Aug 2020 01:00:00 -0700 + +zerotier-one (1.4.6) unstable; urgency=medium + + * Update default root server list + * Fix build flags on "armhf" (32-bit ARM) platforms for better + compatibility with Pi Zero and other devices. + * Fix license text in one.cpp. + * Add a clarification to LICENSE.txt. + + -- Adam Ierymenko Fri, 30 Aug 2019 01:00:00 -0700 + +zerotier-one (1.4.4) unstable; urgency=medium + + * See https://github.com/zerotier/ZeroTierOne for release notes. + * License changed to BSL 1.1 + + -- Adam Ierymenko Fri, 23 Aug 2019 01:00:00 -0700 + +zerotier-one (1.4.2-2) unstable; urgency=medium + + * See https://github.com/zerotier/ZeroTierOne for release notes. + * This is a new build that fixes a binary build issue with containers and SELinux + + -- Adam Ierymenko Thu, 04 Aug 2019 01:00:00 -0700 + +zerotier-one (1.4.2) unstable; urgency=medium + + * See https://github.com/zerotier/ZeroTierOne for release notes. + + -- Adam Ierymenko Thu, 04 Aug 2019 01:00:00 -0700 + +zerotier-one (1.4.0) unstable; urgency=medium + + * See https://github.com/zerotier/ZeroTierOne for release notes. + + -- Adam Ierymenko Thu, 29 Jul 2019 01:00:00 -0700 + +# Older entries have been removed from this changelog. +# To read the complete changelog use `apt changelog backone-addon-voice`. diff --git a/debian/.debhelper/generated/backone-addon-voice/installed-by-dh_installman b/debian/.debhelper/generated/backone-addon-voice/installed-by-dh_installman new file mode 100644 index 0000000..e69de29 diff --git a/debian/.debhelper/generated/backone-app-shell/dh_installchangelogs.dch.trimmed b/debian/.debhelper/generated/backone-app-shell/dh_installchangelogs.dch.trimmed new file mode 100644 index 0000000..109adca --- /dev/null +++ b/debian/.debhelper/generated/backone-app-shell/dh_installchangelogs.dch.trimmed @@ -0,0 +1,257 @@ +backone (1.17.1) stable; urgency=medium + + * Fix /api/backone routes and reinstallable Web UI packages + + -- Dedy Sutanto Tue, 30 Jun 2026 12:02:07 +0700 + +backone (1.17.0) stable; urgency=medium + + * Tray app, auto web server, peer contact UI + + -- Dedy Sutanto Tue, 30 Jun 2026 09:55:07 +0700 + +backone (1.16.0) stable; urgency=medium + + * Release notes + + -- Dedy Sutanto Tue, 30 Jun 2026 08:59:49 +0700 + +backone (1.15.0) stable; urgency=medium + + * Separated addon architecture: voice, video, chat, updater + + -- Dedy Sutanto Tue, 30 Jun 2026 08:37:16 +0700 +zerotier-one (1.14.1) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Wed, 11 Sep 2024 01:00:00 -0700 + +zerotier-one (1.14.0) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Tue, 19 Mar 2024 01:00:00 -0700 + +zerotier-one (1.12.2) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Tue, 12 Sep 2023 01:00:00 -0700 + +zerotier-one (1.12.1) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Fri, 25 Aug 2023 01:00:00 -0700 + +zerotier-one (1.12.0) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Thu, 17 Aug 2023 01:00:00 -0700 + +zerotier-one (1.10.6) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Tue, 21 Mar 2023 01:00:00 -0700 + +zerotier-one (1.10.5) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Fri, 10 Mar 2023 01:00:00 -0700 + +zerotier-one (1.10.4) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Mon, 06 Mar 2023 01:00:00 -0700 + +zerotier-one (1.10.3) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Sat, 21 Jan 2023 01:00:00 -0700 + +zerotier-one (1.10.2) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Thu, 13 Oct 2022 01:00:00 -0700 + +zerotier-one (1.10.1) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Mon, 27 Jun 2022 01:00:00 -0700 + +zerotier-one (1.10.0) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Fri, 03 Jun 2022 01:00:00 -0700 + +zerotier-one (1.8.10) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Tue, 10 May 2022 01:00:00 -0700 + +zerotier-one (1.8.9) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Mon, 25 Apr 2022 01:00:00 -0700 + +zerotier-one (1.8.8) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Mon, 11 Apr 2022 01:00:00 -0700 + +zerotier-one (1.8.7) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Mon, 21 Mar 2022 01:00:00 -0700 + +zerotier-one (1.8.6) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Mon, 07 Mar 2022 01:00:00 -0700 + +zerotier-one (1.8.5) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Fri, 17 Dec 2021 01:00:00 -0700 + +zerotier-one (1.8.4) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Mon, 23 Nov 2021 01:00:00 -0700 + +zerotier-one (1.8.3) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Mon, 15 Nov 2021 01:00:00 -0700 + +zerotier-one (1.8.2) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Mon, 08 Nov 2021 01:00:00 -0700 + +zerotier-one (1.8.1) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Wed, 20 Oct 2021 01:00:00 -0700 + +zerotier-one (1.8.0) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Wed, 15 Sep 2021 01:00:00 -0700 + +zerotier-one (1.6.6) unstable; urgency=medium + + * Backport endpoint mitigation against address collision attack. + + -- Adam Ierymenko Tue, 21 Sep 2021 01:00:00 -0700 + +zerotier-one (1.6.5) unstable; urgency=medium + + * Fix path filtering bug that could cause "software laser" effect. + * Fix printf overflow in CLI (not exploitable or security related) + * Fix Windows device enumeration issue. + + -- Adam Ierymenko Tue, 13 Apr 2021 01:00:00 -0700 + +zerotier-one (1.6.4) unstable; urgency=medium + + * REALLY fix a problem causing nodes to go into a "coma" with some network configurations. + + -- Adam Ierymenko Tue, 15 Feb 2021 01:00:00 -0700 + +zerotier-one (1.6.3-1) unstable; urgency=medium + + * Fix a problem causing nodes to go into a "coma" with some network configurations. + + -- Adam Ierymenko Tue, 02 Feb 2021 01:00:00 -0700 + +zerotier-one (1.6.2-2) unstable; urgency=medium + + * This is a minor update to the 1.6.2 package to address issues with + running on ARMv6 CPUs like the Raspberry Pi Zero and original v1 Pi. + + -- Adam Ierymenko Tue, 31 Nov 2020 01:00:00 -0700 + +zerotier-one (1.6.2) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Mon, 30 Nov 2020 01:00:00 -0700 + +zerotier-one (1.6.1) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Tue, 24 Nov 2020 01:00:00 -0700 + +zerotier-one (1.6.0) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Thu, 19 Nov 2020 01:00:00 -0700 + +zerotier-one (1.5.0) unstable; urgency=medium + + * Version 1.5.0 is actually 1.6.0-beta1 + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Mon, 05 Aug 2020 01:00:00 -0700 + +zerotier-one (1.4.6) unstable; urgency=medium + + * Update default root server list + * Fix build flags on "armhf" (32-bit ARM) platforms for better + compatibility with Pi Zero and other devices. + * Fix license text in one.cpp. + * Add a clarification to LICENSE.txt. + + -- Adam Ierymenko Fri, 30 Aug 2019 01:00:00 -0700 + +zerotier-one (1.4.4) unstable; urgency=medium + + * See https://github.com/zerotier/ZeroTierOne for release notes. + * License changed to BSL 1.1 + + -- Adam Ierymenko Fri, 23 Aug 2019 01:00:00 -0700 + +zerotier-one (1.4.2-2) unstable; urgency=medium + + * See https://github.com/zerotier/ZeroTierOne for release notes. + * This is a new build that fixes a binary build issue with containers and SELinux + + -- Adam Ierymenko Thu, 04 Aug 2019 01:00:00 -0700 + +zerotier-one (1.4.2) unstable; urgency=medium + + * See https://github.com/zerotier/ZeroTierOne for release notes. + + -- Adam Ierymenko Thu, 04 Aug 2019 01:00:00 -0700 + +zerotier-one (1.4.0) unstable; urgency=medium + + * See https://github.com/zerotier/ZeroTierOne for release notes. + + -- Adam Ierymenko Thu, 29 Jul 2019 01:00:00 -0700 + +# Older entries have been removed from this changelog. +# To read the complete changelog use `apt changelog backone-app-shell`. diff --git a/debian/.debhelper/generated/backone-app-shell/installed-by-dh_installman b/debian/.debhelper/generated/backone-app-shell/installed-by-dh_installman new file mode 100644 index 0000000..e69de29 diff --git a/debian/.debhelper/generated/backone-app-tray/dh_installchangelogs.dch.trimmed b/debian/.debhelper/generated/backone-app-tray/dh_installchangelogs.dch.trimmed new file mode 100644 index 0000000..aa0083b --- /dev/null +++ b/debian/.debhelper/generated/backone-app-tray/dh_installchangelogs.dch.trimmed @@ -0,0 +1,257 @@ +backone (1.17.1) stable; urgency=medium + + * Fix /api/backone routes and reinstallable Web UI packages + + -- Dedy Sutanto Tue, 30 Jun 2026 12:02:07 +0700 + +backone (1.17.0) stable; urgency=medium + + * Tray app, auto web server, peer contact UI + + -- Dedy Sutanto Tue, 30 Jun 2026 09:55:07 +0700 + +backone (1.16.0) stable; urgency=medium + + * Release notes + + -- Dedy Sutanto Tue, 30 Jun 2026 08:59:49 +0700 + +backone (1.15.0) stable; urgency=medium + + * Separated addon architecture: voice, video, chat, updater + + -- Dedy Sutanto Tue, 30 Jun 2026 08:37:16 +0700 +zerotier-one (1.14.1) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Wed, 11 Sep 2024 01:00:00 -0700 + +zerotier-one (1.14.0) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Tue, 19 Mar 2024 01:00:00 -0700 + +zerotier-one (1.12.2) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Tue, 12 Sep 2023 01:00:00 -0700 + +zerotier-one (1.12.1) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Fri, 25 Aug 2023 01:00:00 -0700 + +zerotier-one (1.12.0) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Thu, 17 Aug 2023 01:00:00 -0700 + +zerotier-one (1.10.6) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Tue, 21 Mar 2023 01:00:00 -0700 + +zerotier-one (1.10.5) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Fri, 10 Mar 2023 01:00:00 -0700 + +zerotier-one (1.10.4) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Mon, 06 Mar 2023 01:00:00 -0700 + +zerotier-one (1.10.3) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Sat, 21 Jan 2023 01:00:00 -0700 + +zerotier-one (1.10.2) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Thu, 13 Oct 2022 01:00:00 -0700 + +zerotier-one (1.10.1) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Mon, 27 Jun 2022 01:00:00 -0700 + +zerotier-one (1.10.0) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Fri, 03 Jun 2022 01:00:00 -0700 + +zerotier-one (1.8.10) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Tue, 10 May 2022 01:00:00 -0700 + +zerotier-one (1.8.9) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Mon, 25 Apr 2022 01:00:00 -0700 + +zerotier-one (1.8.8) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Mon, 11 Apr 2022 01:00:00 -0700 + +zerotier-one (1.8.7) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Mon, 21 Mar 2022 01:00:00 -0700 + +zerotier-one (1.8.6) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Mon, 07 Mar 2022 01:00:00 -0700 + +zerotier-one (1.8.5) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Fri, 17 Dec 2021 01:00:00 -0700 + +zerotier-one (1.8.4) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Mon, 23 Nov 2021 01:00:00 -0700 + +zerotier-one (1.8.3) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Mon, 15 Nov 2021 01:00:00 -0700 + +zerotier-one (1.8.2) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Mon, 08 Nov 2021 01:00:00 -0700 + +zerotier-one (1.8.1) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Wed, 20 Oct 2021 01:00:00 -0700 + +zerotier-one (1.8.0) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Wed, 15 Sep 2021 01:00:00 -0700 + +zerotier-one (1.6.6) unstable; urgency=medium + + * Backport endpoint mitigation against address collision attack. + + -- Adam Ierymenko Tue, 21 Sep 2021 01:00:00 -0700 + +zerotier-one (1.6.5) unstable; urgency=medium + + * Fix path filtering bug that could cause "software laser" effect. + * Fix printf overflow in CLI (not exploitable or security related) + * Fix Windows device enumeration issue. + + -- Adam Ierymenko Tue, 13 Apr 2021 01:00:00 -0700 + +zerotier-one (1.6.4) unstable; urgency=medium + + * REALLY fix a problem causing nodes to go into a "coma" with some network configurations. + + -- Adam Ierymenko Tue, 15 Feb 2021 01:00:00 -0700 + +zerotier-one (1.6.3-1) unstable; urgency=medium + + * Fix a problem causing nodes to go into a "coma" with some network configurations. + + -- Adam Ierymenko Tue, 02 Feb 2021 01:00:00 -0700 + +zerotier-one (1.6.2-2) unstable; urgency=medium + + * This is a minor update to the 1.6.2 package to address issues with + running on ARMv6 CPUs like the Raspberry Pi Zero and original v1 Pi. + + -- Adam Ierymenko Tue, 31 Nov 2020 01:00:00 -0700 + +zerotier-one (1.6.2) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Mon, 30 Nov 2020 01:00:00 -0700 + +zerotier-one (1.6.1) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Tue, 24 Nov 2020 01:00:00 -0700 + +zerotier-one (1.6.0) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Thu, 19 Nov 2020 01:00:00 -0700 + +zerotier-one (1.5.0) unstable; urgency=medium + + * Version 1.5.0 is actually 1.6.0-beta1 + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Mon, 05 Aug 2020 01:00:00 -0700 + +zerotier-one (1.4.6) unstable; urgency=medium + + * Update default root server list + * Fix build flags on "armhf" (32-bit ARM) platforms for better + compatibility with Pi Zero and other devices. + * Fix license text in one.cpp. + * Add a clarification to LICENSE.txt. + + -- Adam Ierymenko Fri, 30 Aug 2019 01:00:00 -0700 + +zerotier-one (1.4.4) unstable; urgency=medium + + * See https://github.com/zerotier/ZeroTierOne for release notes. + * License changed to BSL 1.1 + + -- Adam Ierymenko Fri, 23 Aug 2019 01:00:00 -0700 + +zerotier-one (1.4.2-2) unstable; urgency=medium + + * See https://github.com/zerotier/ZeroTierOne for release notes. + * This is a new build that fixes a binary build issue with containers and SELinux + + -- Adam Ierymenko Thu, 04 Aug 2019 01:00:00 -0700 + +zerotier-one (1.4.2) unstable; urgency=medium + + * See https://github.com/zerotier/ZeroTierOne for release notes. + + -- Adam Ierymenko Thu, 04 Aug 2019 01:00:00 -0700 + +zerotier-one (1.4.0) unstable; urgency=medium + + * See https://github.com/zerotier/ZeroTierOne for release notes. + + -- Adam Ierymenko Thu, 29 Jul 2019 01:00:00 -0700 + +# Older entries have been removed from this changelog. +# To read the complete changelog use `apt changelog backone-app-tray`. diff --git a/debian/.debhelper/generated/backone-app-tray/installed-by-dh_installman b/debian/.debhelper/generated/backone-app-tray/installed-by-dh_installman new file mode 100644 index 0000000..e69de29 diff --git a/debian/backone-addon-chat.postinst b/debian/backone-addon-chat.postinst new file mode 100755 index 0000000..1379578 --- /dev/null +++ b/debian/backone-addon-chat.postinst @@ -0,0 +1,12 @@ +#!/bin/sh -e +case "$1" in + configure) + if [ -x /usr/lib/backone/addons/updater/backone-updater ]; then + /usr/lib/backone/addons/updater/backone-updater rebuild-manifest || true + elif [ -x /usr/lib/backone/addons/updater/rebuild-addon-manifest.sh ]; then + BACKONE_HOME=/var/lib/backone /usr/lib/backone/addons/updater/rebuild-addon-manifest.sh || true + fi + ;; +esac +#DEBHELPER# +exit 0 diff --git a/debian/backone-addon-chat.substvars b/debian/backone-addon-chat.substvars new file mode 100644 index 0000000..978fc8b --- /dev/null +++ b/debian/backone-addon-chat.substvars @@ -0,0 +1,2 @@ +misc:Depends= +misc:Pre-Depends= diff --git a/debian/backone-addon-chat/DEBIAN/control b/debian/backone-addon-chat/DEBIAN/control new file mode 100644 index 0000000..17120ca --- /dev/null +++ b/debian/backone-addon-chat/DEBIAN/control @@ -0,0 +1,12 @@ +Package: backone-addon-chat +Source: backone +Version: 1.17.1 +Architecture: all +Maintainer: Dedy Sutanto +Installed-Size: 28 +Depends: backone, backone-addon-comms-core, backone-app-shell +Section: net +Priority: optional +Homepage: https://backone.cloud +Description: BackOne chat P2P addon + Text chat with image and document attachments over BackOne. diff --git a/debian/backone-addon-chat/DEBIAN/md5sums b/debian/backone-addon-chat/DEBIAN/md5sums new file mode 100644 index 0000000..6c51301 --- /dev/null +++ b/debian/backone-addon-chat/DEBIAN/md5sums @@ -0,0 +1,3 @@ +cb73fba9ab4a23ff5f4dc1e3fa7d6520 usr/lib/backone/addons/chat/addon.json +6020963c701ef2f1c4c4c8a78f2d6845 usr/share/doc/backone-addon-chat/changelog.gz +463936e9518d72d5ce8f85b746e0b8b5 var/lib/backone/app/addons/chat/index.js diff --git a/debian/backone-addon-chat/DEBIAN/postinst b/debian/backone-addon-chat/DEBIAN/postinst new file mode 100755 index 0000000..9bd50cc --- /dev/null +++ b/debian/backone-addon-chat/DEBIAN/postinst @@ -0,0 +1,12 @@ +#!/bin/sh -e +case "$1" in + configure) + if [ -x /usr/lib/backone/addons/updater/backone-updater ]; then + /usr/lib/backone/addons/updater/backone-updater rebuild-manifest || true + elif [ -x /usr/lib/backone/addons/updater/rebuild-addon-manifest.sh ]; then + BACKONE_HOME=/var/lib/backone /usr/lib/backone/addons/updater/rebuild-addon-manifest.sh || true + fi + ;; +esac + +exit 0 diff --git a/debian/backone-addon-chat/usr/share/doc/backone-addon-chat/changelog.gz b/debian/backone-addon-chat/usr/share/doc/backone-addon-chat/changelog.gz new file mode 100644 index 0000000000000000000000000000000000000000..247910e5a75885e50db16204753139b95def578c GIT binary patch literal 1335 zcmV-71<3jziwFP!000021I?LhZ`(E$hQH@m9AsbG%~mMMm)N_YY3BkdoTP};72Bs$ z(y>fLA_a=H2`Zt1og0xMCkQTL!g)DSCacx;IFd5~-}9S;8mah?YVzJZd za55cC9^)A9<5*z9H8+?5PZA}8>v$y$#>Q%#!di)#?zR>Qsvg8EZhByggs#`mW)8rxWu&b>*NU6v-#|7G3#Gm-OLtVp1@LR%FEBB^=i(ugy(RMdYhxX zB~nh`J<)uB)!g5URZh4cG3kNtJ8>ND0GK~zj9$>MC4PjLb;w)E>rdc<>z2HM7j(`W zH2Q{Zc)QGpw_5Zd7{ZxNTl03B4=YRhjt}5v-l*$*2>d30Tk#IN&Ig|z#5?Ga_d>}Y zu+c%hVTZg6=QETK@3?Hu8+1P2Lb#$?1@Q)Lc>S*PAs9Dy+=`cVJ>FQ@p7)f9JNGwN zAGU3IC!MDQ*;}F8;+}SmOS7{BaL1jidv9)Sa7Uec#rP21?yY!C3z692`YmufcVaTM zOSNu`8+Ja_hKJw=o#*c9A-J6{GXvI48`|Kq&R505X4SSIceKBdz2@<4p|k;%Nuh)^ zkP9PHZiL&5NV(f#ayt_m%MxOhWumP9F@_pGYproW6npEN+a)WwS;10d2DOkWM6~oW zD{ctdW(maHlJ>`?TAB^l2pK&JeGIr0lbiZ-AKd`}m%l=Rg^aPjOW(Kq(Z>rB%XxNtKzV1axUxX_WT+w%nX|a6EPhb{s5a=G!Icm8nbB8Cf*HIs z&O56kh@z-3I7<>LR&mC)Sc(g zlarKUw~@QqNz>Db)8U3bTv3mYB#P@|zLO$eahYP`B7MD>Q||ds-vAE}39^NS{0Ct^ zxRAunF6F9e7fmYMF(pLg6XYKCKb85^*;E|@3Q2>sN~pzbE~LGCa`9k;gS7ddmH9SN zuY?(SDZ35_;3Zd+5IP8n9qLNoq_hNbJe~(JN@Jx{R84mh!TAt004}#ohASP literal 0 HcmV?d00001 diff --git a/debian/backone-addon-common.postinst b/debian/backone-addon-common.postinst new file mode 100755 index 0000000..1379578 --- /dev/null +++ b/debian/backone-addon-common.postinst @@ -0,0 +1,12 @@ +#!/bin/sh -e +case "$1" in + configure) + if [ -x /usr/lib/backone/addons/updater/backone-updater ]; then + /usr/lib/backone/addons/updater/backone-updater rebuild-manifest || true + elif [ -x /usr/lib/backone/addons/updater/rebuild-addon-manifest.sh ]; then + BACKONE_HOME=/var/lib/backone /usr/lib/backone/addons/updater/rebuild-addon-manifest.sh || true + fi + ;; +esac +#DEBHELPER# +exit 0 diff --git a/debian/backone-addon-comms-core.postinst b/debian/backone-addon-comms-core.postinst new file mode 100755 index 0000000..1379578 --- /dev/null +++ b/debian/backone-addon-comms-core.postinst @@ -0,0 +1,12 @@ +#!/bin/sh -e +case "$1" in + configure) + if [ -x /usr/lib/backone/addons/updater/backone-updater ]; then + /usr/lib/backone/addons/updater/backone-updater rebuild-manifest || true + elif [ -x /usr/lib/backone/addons/updater/rebuild-addon-manifest.sh ]; then + BACKONE_HOME=/var/lib/backone /usr/lib/backone/addons/updater/rebuild-addon-manifest.sh || true + fi + ;; +esac +#DEBHELPER# +exit 0 diff --git a/debian/backone-addon-comms-core.substvars b/debian/backone-addon-comms-core.substvars new file mode 100644 index 0000000..978fc8b --- /dev/null +++ b/debian/backone-addon-comms-core.substvars @@ -0,0 +1,2 @@ +misc:Depends= +misc:Pre-Depends= diff --git a/debian/backone-addon-comms-core/DEBIAN/control b/debian/backone-addon-comms-core/DEBIAN/control new file mode 100644 index 0000000..75ae4e9 --- /dev/null +++ b/debian/backone-addon-comms-core/DEBIAN/control @@ -0,0 +1,13 @@ +Package: backone-addon-comms-core +Source: backone +Version: 1.17.1 +Architecture: amd64 +Maintainer: Dedy Sutanto +Installed-Size: 15 +Depends: backone +Recommends: postgresql-client, redis-tools +Section: net +Priority: optional +Homepage: https://backone.cloud +Description: BackOne comms core addon (signaling backend) + Shared signaling backend for voice, video, and chat addons. diff --git a/debian/backone-addon-comms-core/DEBIAN/md5sums b/debian/backone-addon-comms-core/DEBIAN/md5sums new file mode 100644 index 0000000..8486baa --- /dev/null +++ b/debian/backone-addon-comms-core/DEBIAN/md5sums @@ -0,0 +1,3 @@ +afd892e714b0637552f6fc56040e860a usr/lib/backone/addons/comms-core/addon.json +51ec6efb47fa207fa716611711defd8f usr/lib/backone/addons/comms-core/schema.sql +4b992da672501c1ed9da4a0c09d59986 usr/share/doc/backone-addon-comms-core/changelog.gz diff --git a/debian/backone-addon-comms-core/DEBIAN/postinst b/debian/backone-addon-comms-core/DEBIAN/postinst new file mode 100755 index 0000000..9bd50cc --- /dev/null +++ b/debian/backone-addon-comms-core/DEBIAN/postinst @@ -0,0 +1,12 @@ +#!/bin/sh -e +case "$1" in + configure) + if [ -x /usr/lib/backone/addons/updater/backone-updater ]; then + /usr/lib/backone/addons/updater/backone-updater rebuild-manifest || true + elif [ -x /usr/lib/backone/addons/updater/rebuild-addon-manifest.sh ]; then + BACKONE_HOME=/var/lib/backone /usr/lib/backone/addons/updater/rebuild-addon-manifest.sh || true + fi + ;; +esac + +exit 0 diff --git a/debian/backone-addon-comms-core/usr/share/doc/backone-addon-comms-core/changelog.gz b/debian/backone-addon-comms-core/usr/share/doc/backone-addon-comms-core/changelog.gz new file mode 100644 index 0000000000000000000000000000000000000000..4dea30c639666ba7c427ee51a983734d80da26ea GIT binary patch literal 1338 zcmV-A1;zRwiwFP!000021I?LhZ`(E$hQH@m9AsbG%~o{rCH5|8+POdqCn@4|#rCO` zbSx8*NP!nS-ml-GWF;+-)pD{`1&qWOl6uao!}F3<%#vFv5MBgcF!q9%pbd+2{28pu zP$b)53rx8!j*b9+gtz<-PFTrL;$1H#tw9Y;q@a)s>YL}TJAA|#KAb~I?O2AIy7&9= zJEmJ$Si^*o@Jp)ecdvGXc}Xs9`WwKF#U4aHyt4vAKO8|2PJMcf;U|CW`$tFd7tH?G znQs)^0xQcNFiV%+5ST`_M%9B7Q9&YwVTmEy=Rx|D>2UZjkfVK&*O(*I2tu0Yishe9 zhm+}G@)*Z(AIAbqrkKGLSei-!OeHIBFfmr)6xNa_bhR~4QT8BNG1CKErqo_Nn>iX! zgVB!pZ&cE7RQ-l~;1bh{uahHO&*rnU#jJmMbu(LdMG8x)C@(*g)~h+sQdYn@s%?Sd zmPi?W_IUI8RdanWkpJ&zpZ$OUFSpKAH+N8koQ80 z9{8h!c%u$^7tUuWAKo$1nm6oxzD00Fs|w-`+wcZm=R-Jd?6?)L-}QX+qxQU~MBKT* zx%#ke%RA{j9mw8F)fV@(Yg}5L9e_LTT-|$fYlA!L+$+Y1;C64tW7>!$4mW6l+qn~y zp$UNt|`o$RP_^iFg0a5I&Z|;<=WM&0Ro*PtLWDwKV z%dD6oXq%^yFiYAWYq>NVrVw(v73vspxx~bH4}(x&vjn+Dwan!PxPUkFb9g~F4e+ka zC9f!e?x)7YDsHy!#=7&Hm-mBwryW6AC+q4JW0wEGU=JY^1t%Cwfbs**eJQ zEZK(e7UQ<@Mg5>nVtgN=`Qagf~7}o^io)SO@g| z(?yAb#wz?aqIB(Sk$(to(D{MR;1JyI&&ww5afkbH|3Fn)Rn@qfD2cHw&$rdw@cS_u z7JQop(fz^Y{=f$NE&D?~(NkP9n;TG)ys3V^Leo~8`??ofPR6&)S*G3WK4z*|Esxf*HIs z&O56|5M^06I7?G1R!PnjU-G2(Ln=)3^Eb20#mqBz=II*{nwho4ltlX_ZnXhf8B^-% z$w@}B+t^*~q#5bN>2O1Du4u$Z62%QM-${|In8+}7k-lEcDffb>AAm=P1lhtu{(~?d zTu9(%mvYszixw5`F(t(06XYKCFO~V!*;G9QoC|yRu6t&!>u3c7ef%Wf)IN*0ttlvDN8$z|qIw;M?< wSXwPgTye_L;6n>=tNTx^G@pI7dj{ICo~!n$Poe3r!cX4OKcK{#HG>}j0C6g&BLDyZ literal 0 HcmV?d00001 diff --git a/debian/backone-addon-updater.postinst b/debian/backone-addon-updater.postinst new file mode 100755 index 0000000..1379578 --- /dev/null +++ b/debian/backone-addon-updater.postinst @@ -0,0 +1,12 @@ +#!/bin/sh -e +case "$1" in + configure) + if [ -x /usr/lib/backone/addons/updater/backone-updater ]; then + /usr/lib/backone/addons/updater/backone-updater rebuild-manifest || true + elif [ -x /usr/lib/backone/addons/updater/rebuild-addon-manifest.sh ]; then + BACKONE_HOME=/var/lib/backone /usr/lib/backone/addons/updater/rebuild-addon-manifest.sh || true + fi + ;; +esac +#DEBHELPER# +exit 0 diff --git a/debian/backone-addon-updater.substvars b/debian/backone-addon-updater.substvars new file mode 100644 index 0000000..978fc8b --- /dev/null +++ b/debian/backone-addon-updater.substvars @@ -0,0 +1,2 @@ +misc:Depends= +misc:Pre-Depends= diff --git a/debian/backone-addon-updater/DEBIAN/control b/debian/backone-addon-updater/DEBIAN/control new file mode 100644 index 0000000..b5527cb --- /dev/null +++ b/debian/backone-addon-updater/DEBIAN/control @@ -0,0 +1,12 @@ +Package: backone-addon-updater +Source: backone +Version: 1.17.1 +Architecture: all +Maintainer: Dedy Sutanto +Installed-Size: 28 +Depends: backone +Section: net +Priority: optional +Homepage: https://backone.cloud +Description: BackOne version updater addon + Migrates installations between BackOne and addon versions. diff --git a/debian/backone-addon-updater/DEBIAN/md5sums b/debian/backone-addon-updater/DEBIAN/md5sums new file mode 100644 index 0000000..3e29275 --- /dev/null +++ b/debian/backone-addon-updater/DEBIAN/md5sums @@ -0,0 +1,8 @@ +bee18cfe55163e6f4cf1d8a22c19dfa8 usr/lib/backone/addons/updater/addon.json +fbc9822a89457454f09b87ba35182052 usr/lib/backone/addons/updater/backone-updater +86727de17602883708f38bdc69d68196 usr/lib/backone/addons/updater/merge-local-conf.sh +1a944e1b0c1afdcff4b75c11f1a18ce0 usr/lib/backone/addons/updater/migrations/001_zerotier_to_backone.sh +5f8f8cd7bba7204f08b4d1a7e7b0dd4c usr/lib/backone/addons/updater/migrations/002_register_addon_host.sh +2fac4021a24721dee1bac76557171998 usr/lib/backone/addons/updater/migrations/003_enable_webserver_defaults.sh +9e532d47a1b291f26457aaff04864920 usr/lib/backone/addons/updater/rebuild-addon-manifest.sh +dbf8511a07dbd23850fe2553d78dcf6a usr/share/doc/backone-addon-updater/changelog.gz diff --git a/debian/backone-addon-updater/DEBIAN/postinst b/debian/backone-addon-updater/DEBIAN/postinst new file mode 100755 index 0000000..9bd50cc --- /dev/null +++ b/debian/backone-addon-updater/DEBIAN/postinst @@ -0,0 +1,12 @@ +#!/bin/sh -e +case "$1" in + configure) + if [ -x /usr/lib/backone/addons/updater/backone-updater ]; then + /usr/lib/backone/addons/updater/backone-updater rebuild-manifest || true + elif [ -x /usr/lib/backone/addons/updater/rebuild-addon-manifest.sh ]; then + BACKONE_HOME=/var/lib/backone /usr/lib/backone/addons/updater/rebuild-addon-manifest.sh || true + fi + ;; +esac + +exit 0 diff --git a/debian/backone-addon-updater/usr/bin/backone-updater b/debian/backone-addon-updater/usr/bin/backone-updater new file mode 120000 index 0000000..39bbde1 --- /dev/null +++ b/debian/backone-addon-updater/usr/bin/backone-updater @@ -0,0 +1 @@ +../lib/backone/addons/updater/backone-updater \ No newline at end of file diff --git a/debian/backone-addon-updater/usr/share/doc/backone-addon-updater/changelog.gz b/debian/backone-addon-updater/usr/share/doc/backone-addon-updater/changelog.gz new file mode 100644 index 0000000000000000000000000000000000000000..2fb1018630d24cb91198adc44a1bdc2615541af7 GIT binary patch literal 1335 zcmV-71<3jziwFP!000021I?LhZ`(E$hQH@m9AsbG%~mMMm)N_YY3BkdoTP};72Bs$ z(y>fLA_a=H2`Zt1og0xMCkQTL!g)DSCacx;IFd5~-}9S;8mah?YVzJZd za55cC9^)A9<5*z9H8+?5PZA}8>v$y$#>Q%#!di)#?zR>Qsvg8EZhByggs#`mW)8rxWu&b>*NU6v-#|7G3#Gm-OLtVp1@LR%FEBB^=i(ugy(RMdYhxX zB~nh`J<)uB)!g5URZh4cG3kNtJ8>ND0GK~zj9$>MC4PjLb;w)E>rdc<>z2HM7j(`W zH2Q{Zc)QGpw_5Zd7{ZxNTl03B4=YRhjt}5v-l*$*2>d30Tk#IN&Ig|z#5?Ga_d>}Y zu+c%hVTZg6=QETK@3?Hu8+1P2Lb#$?1@Q)Lc>S*PAs9Dy+=`cVJ>FQ@p7)f9JNGwN zAGU3IC!MDQ*;}F8;+}SmOS7{BaL1jidv9)Sa7Uec#rP21?yY!C3z692`YmufcVaTM zOSNu`8+Ja_hKJw=o#*c9A-J6{GXvI48`|Kq&R505X4SSIceKBdz2@<4p|k;%Nuh)^ zkP9PHZiL&5NV(f#ayt_m%MxOhWumP9F@_pGYproW6npEN+a)WwS;10d2DOkWM6~oW zD{ctdW(maHlJ>`?TAB^l2pK&JeGIr0lbiZ-AKd`}m%l=Rg^aPjOW(Kq(Z>rB%XxNtKzV1axUxX_WT+w%nX|a6EPhb{s5a=G!Icm8nbB8Cf*HIs z&O56kh@z-3I7<>LR&mC)Sc(g zlarKUw~@QqNz>Db)8U3bTv3mYB#P@|zLO$eahYP`B7MD>Q||ds-vAE}39^NS{0Ct^ zxRAunF6F9e7fmYMF(pLg6XYKCKb85^*;E|@3Q2>sN~pzbE~LGCa`9k;gS7ddmH9SN zuY?(SDZ35_;3Zd+5IP8n9qLNoq_hNbJhOt)bx{g^be}=%n*Pd005_wpJo66 literal 0 HcmV?d00001 diff --git a/debian/backone-addon-video.postinst b/debian/backone-addon-video.postinst new file mode 100755 index 0000000..1379578 --- /dev/null +++ b/debian/backone-addon-video.postinst @@ -0,0 +1,12 @@ +#!/bin/sh -e +case "$1" in + configure) + if [ -x /usr/lib/backone/addons/updater/backone-updater ]; then + /usr/lib/backone/addons/updater/backone-updater rebuild-manifest || true + elif [ -x /usr/lib/backone/addons/updater/rebuild-addon-manifest.sh ]; then + BACKONE_HOME=/var/lib/backone /usr/lib/backone/addons/updater/rebuild-addon-manifest.sh || true + fi + ;; +esac +#DEBHELPER# +exit 0 diff --git a/debian/backone-addon-video.substvars b/debian/backone-addon-video.substvars new file mode 100644 index 0000000..978fc8b --- /dev/null +++ b/debian/backone-addon-video.substvars @@ -0,0 +1,2 @@ +misc:Depends= +misc:Pre-Depends= diff --git a/debian/backone-addon-video/DEBIAN/control b/debian/backone-addon-video/DEBIAN/control new file mode 100644 index 0000000..875a40f --- /dev/null +++ b/debian/backone-addon-video/DEBIAN/control @@ -0,0 +1,12 @@ +Package: backone-addon-video +Source: backone +Version: 1.17.1 +Architecture: all +Maintainer: Dedy Sutanto +Installed-Size: 25 +Depends: backone, backone-addon-comms-core, backone-addon-voice, backone-app-shell +Section: net +Priority: optional +Homepage: https://backone.cloud +Description: BackOne video call P2P addon + P2P video calling with ringing popup over the BackOne overlay. diff --git a/debian/backone-addon-video/DEBIAN/md5sums b/debian/backone-addon-video/DEBIAN/md5sums new file mode 100644 index 0000000..93398a8 --- /dev/null +++ b/debian/backone-addon-video/DEBIAN/md5sums @@ -0,0 +1,3 @@ +b50ba09efcb821add4a37b940c457c92 usr/lib/backone/addons/video/addon.json +f2cf6c14a4db3363befe75d07dca482b usr/share/doc/backone-addon-video/changelog.gz +a589ab06e5b078b87e397c0a5e65e401 var/lib/backone/app/addons/video/index.js diff --git a/debian/backone-addon-video/DEBIAN/postinst b/debian/backone-addon-video/DEBIAN/postinst new file mode 100755 index 0000000..9bd50cc --- /dev/null +++ b/debian/backone-addon-video/DEBIAN/postinst @@ -0,0 +1,12 @@ +#!/bin/sh -e +case "$1" in + configure) + if [ -x /usr/lib/backone/addons/updater/backone-updater ]; then + /usr/lib/backone/addons/updater/backone-updater rebuild-manifest || true + elif [ -x /usr/lib/backone/addons/updater/rebuild-addon-manifest.sh ]; then + BACKONE_HOME=/var/lib/backone /usr/lib/backone/addons/updater/rebuild-addon-manifest.sh || true + fi + ;; +esac + +exit 0 diff --git a/debian/backone-addon-video/usr/share/doc/backone-addon-video/changelog.gz b/debian/backone-addon-video/usr/share/doc/backone-addon-video/changelog.gz new file mode 100644 index 0000000000000000000000000000000000000000..70958ab0d9276108b54fa977d0cc2cc609ed4029 GIT binary patch literal 1335 zcmV-71<3jziwFP!000021I?LhZ`(E$hQH@m9AsbG%~mMMm)N_YY3BkdoTP};72Bs$ z(y>fLA_a=H2`Zt1og0xMCkQTL!g)DSCacx;IFd5~-}9S;8mah?YVzJZd za55cC9^)A9<5*z9H8+?5PZA}8>v$y$#>Q%#!di)#?zR>Qsvg8EZhByggs#`mW)8rxWu&b>*NU6v-#|7G3#Gm-OLtVp1@LR%FEBB^=i(ugy(RMdYhxX zB~nh`J<)uB)!g5URZh4cG3kNtJ8>ND0GK~zj9$>MC4PjLb;w)E>rdc<>z2HM7j(`W zH2Q{Zc)QGpw_5Zd7{ZxNTl03B4=YRhjt}5v-l*$*2>d30Tk#IN&Ig|z#5?Ga_d>}Y zu+c%hVTZg6=QETK@3?Hu8+1P2Lb#$?1@Q)Lc>S*PAs9Dy+=`cVJ>FQ@p7)f9JNGwN zAGU3IC!MDQ*;}F8;+}SmOS7{BaL1jidv9)Sa7Uec#rP21?yY!C3z692`YmufcVaTM zOSNu`8+Ja_hKJw=o#*c9A-J6{GXvI48`|Kq&R505X4SSIceKBdz2@<4p|k;%Nuh)^ zkP9PHZiL&5NV(f#ayt_m%MxOhWumP9F@_pGYproW6npEN+a)WwS;10d2DOkWM6~oW zD{ctdW(maHlJ>`?TAB^l2pK&JeGIr0lbiZ-AKd`}m%l=Rg^aPjOW(Kq(Z>rB%XxNtKzV1axUxX_WT+w%nX|a6EPhb{s5a=G!Icm8nbB8Cf*HIs z&O56kh@z-3I7<>LR&mC)Sc(g zlarKUw~@QqNz>Db)8U3bTv3mYB#P@|zLO$eahYP`B7MD>Q||ds-vAE}39^NS{0Ct^ zxRAunF6F9e7fmYMF(pLg6XYKCKb85^*;E|@3Q2>sN~pzbE~LGCa`9k;gS7ddmH9SN zuY?(SDZ35_;3Zd+5IP8n9qLNoq_hNbJc!zg!;)l`UlHLFED-|0051oofH57 literal 0 HcmV?d00001 diff --git a/debian/backone-addon-voice.postinst b/debian/backone-addon-voice.postinst new file mode 100755 index 0000000..1379578 --- /dev/null +++ b/debian/backone-addon-voice.postinst @@ -0,0 +1,12 @@ +#!/bin/sh -e +case "$1" in + configure) + if [ -x /usr/lib/backone/addons/updater/backone-updater ]; then + /usr/lib/backone/addons/updater/backone-updater rebuild-manifest || true + elif [ -x /usr/lib/backone/addons/updater/rebuild-addon-manifest.sh ]; then + BACKONE_HOME=/var/lib/backone /usr/lib/backone/addons/updater/rebuild-addon-manifest.sh || true + fi + ;; +esac +#DEBHELPER# +exit 0 diff --git a/debian/backone-addon-voice.substvars b/debian/backone-addon-voice.substvars new file mode 100644 index 0000000..978fc8b --- /dev/null +++ b/debian/backone-addon-voice.substvars @@ -0,0 +1,2 @@ +misc:Depends= +misc:Pre-Depends= diff --git a/debian/backone-addon-voice/DEBIAN/control b/debian/backone-addon-voice/DEBIAN/control new file mode 100644 index 0000000..1dd8bd9 --- /dev/null +++ b/debian/backone-addon-voice/DEBIAN/control @@ -0,0 +1,12 @@ +Package: backone-addon-voice +Source: backone +Version: 1.17.1 +Architecture: all +Maintainer: Dedy Sutanto +Installed-Size: 24 +Depends: backone, backone-addon-comms-core, backone-app-shell +Section: net +Priority: optional +Homepage: https://backone.cloud +Description: BackOne voice call P2P addon + P2P voice calling with ringing popup over the BackOne overlay. diff --git a/debian/backone-addon-voice/DEBIAN/md5sums b/debian/backone-addon-voice/DEBIAN/md5sums new file mode 100644 index 0000000..035a223 --- /dev/null +++ b/debian/backone-addon-voice/DEBIAN/md5sums @@ -0,0 +1,3 @@ +cb9c4fe7a9fe5cd4748522249933cde5 usr/lib/backone/addons/voice/addon.json +8c0d667eb292b835a170c3d46c8ce16a usr/share/doc/backone-addon-voice/changelog.gz +3b48d55aa718993b14ebd23b6e9bceaa var/lib/backone/app/addons/voice/index.js diff --git a/debian/backone-addon-voice/DEBIAN/postinst b/debian/backone-addon-voice/DEBIAN/postinst new file mode 100755 index 0000000..9bd50cc --- /dev/null +++ b/debian/backone-addon-voice/DEBIAN/postinst @@ -0,0 +1,12 @@ +#!/bin/sh -e +case "$1" in + configure) + if [ -x /usr/lib/backone/addons/updater/backone-updater ]; then + /usr/lib/backone/addons/updater/backone-updater rebuild-manifest || true + elif [ -x /usr/lib/backone/addons/updater/rebuild-addon-manifest.sh ]; then + BACKONE_HOME=/var/lib/backone /usr/lib/backone/addons/updater/rebuild-addon-manifest.sh || true + fi + ;; +esac + +exit 0 diff --git a/debian/backone-addon-voice/usr/share/doc/backone-addon-voice/changelog.gz b/debian/backone-addon-voice/usr/share/doc/backone-addon-voice/changelog.gz new file mode 100644 index 0000000000000000000000000000000000000000..83597851bcbd612aa810e0d0b0de44c77fcd1a0b GIT binary patch literal 1335 zcmV-71<3jziwFP!000021I?LhZ`(E$hQH@m9AsbG%~mMMm)N_YY3BkdoTP};72Bs$ z(y>fLA_a=H2`Zt1og0xMCkQTL!g)DSCacx;IFd5~-}9S;8mah?YVzJZd za55cC9^)A9<5*z9H8+?5PZA}8>v$y$#>Q%#!di)#?zR>Qsvg8EZhByggs#`mW)8rxWu&b>*NU6v-#|7G3#Gm-OLtVp1@LR%FEBB^=i(ugy(RMdYhxX zB~nh`J<)uB)!g5URZh4cG3kNtJ8>ND0GK~zj9$>MC4PjLb;w)E>rdc<>z2HM7j(`W zH2Q{Zc)QGpw_5Zd7{ZxNTl03B4=YRhjt}5v-l*$*2>d30Tk#IN&Ig|z#5?Ga_d>}Y zu+c%hVTZg6=QETK@3?Hu8+1P2Lb#$?1@Q)Lc>S*PAs9Dy+=`cVJ>FQ@p7)f9JNGwN zAGU3IC!MDQ*;}F8;+}SmOS7{BaL1jidv9)Sa7Uec#rP21?yY!C3z692`YmufcVaTM zOSNu`8+Ja_hKJw=o#*c9A-J6{GXvI48`|Kq&R505X4SSIceKBdz2@<4p|k;%Nuh)^ zkP9PHZiL&5NV(f#ayt_m%MxOhWumP9F@_pGYproW6npEN+a)WwS;10d2DOkWM6~oW zD{ctdW(maHlJ>`?TAB^l2pK&JeGIr0lbiZ-AKd`}m%l=Rg^aPjOW(Kq(Z>rB%XxNtKzV1axUxX_WT+w%nX|a6EPhb{s5a=G!Icm8nbB8Cf*HIs z&O56kh@z-3I7<>LR&mC)Sc(g zlarKUw~@QqNz>Db)8U3bTv3mYB#P@|zLO$eahYP`B7MD>Q||ds-vAE}39^NS{0Ct^ zxRAunF6F9e7fmYMF(pLg6XYKCKb85^*;E|@3Q2>sN~pzbE~LGCa`9k;gS7ddmH9SN zuY?(SDZ35_;3Zd+5IP8n9qLNoq_hNbJc!zlKROz`UmTDoDY5<005GVox1=4 literal 0 HcmV?d00001 diff --git a/debian/backone-app-shell.postinst b/debian/backone-app-shell.postinst new file mode 100755 index 0000000..8193f54 --- /dev/null +++ b/debian/backone-app-shell.postinst @@ -0,0 +1,15 @@ +#!/bin/sh -e +case "$1" in + configure) + if [ -x /usr/lib/backone/addons/updater/backone-updater ]; then + /usr/lib/backone/addons/updater/backone-updater rebuild-manifest || true + elif [ -x /usr/lib/backone/addons/updater/rebuild-addon-manifest.sh ]; then + BACKONE_HOME=/var/lib/backone /usr/lib/backone/addons/updater/rebuild-addon-manifest.sh || true + fi + if [ -x /usr/lib/backone/addons/updater/merge-local-conf.sh ]; then + BACKONE_HOME=/var/lib/backone /usr/lib/backone/addons/updater/merge-local-conf.sh '{"settings":{"enableWebServer":true}}' || true + fi + ;; +esac +#DEBHELPER# +exit 0 diff --git a/debian/backone-app-shell.substvars b/debian/backone-app-shell.substvars new file mode 100644 index 0000000..978fc8b --- /dev/null +++ b/debian/backone-app-shell.substvars @@ -0,0 +1,2 @@ +misc:Depends= +misc:Pre-Depends= diff --git a/debian/backone-app-shell/DEBIAN/control b/debian/backone-app-shell/DEBIAN/control new file mode 100644 index 0000000..9af68a8 --- /dev/null +++ b/debian/backone-app-shell/DEBIAN/control @@ -0,0 +1,12 @@ +Package: backone-app-shell +Source: backone +Version: 1.17.1 +Architecture: all +Maintainer: Dedy Sutanto +Installed-Size: 56 +Depends: backone +Section: net +Priority: optional +Homepage: https://backone.cloud +Description: BackOne web app shell host + Minimal web UI host that dynamically loads separated BackOne addons. diff --git a/debian/backone-app-shell/DEBIAN/md5sums b/debian/backone-app-shell/DEBIAN/md5sums new file mode 100644 index 0000000..71eb1e1 --- /dev/null +++ b/debian/backone-app-shell/DEBIAN/md5sums @@ -0,0 +1,11 @@ +ddc11210878af47483c00a896bc49c7f usr/share/doc/backone-app-shell/changelog.gz +3d02f4314de4d3628cb193610174fcde var/lib/backone/app/addon-loader.js +49d4fd44dcbabedd7037c9a59fb9da3a var/lib/backone/app/auth-store.js +fc714bc78bb3127f5bf96a4aaecf9684 var/lib/backone/app/contacts-store.js +7babf02e4ba1ca836f844acc5940d7b8 var/lib/backone/app/index.html +802d8d5241ba3587f8ba66e986de3395 var/lib/backone/app/main.js +07908ab7ebed73d83ce776fd5ce68e94 var/lib/backone/app/network-session.js +2c328cb61a8c74e9c64cac2e00ca37c5 var/lib/backone/app/peer-directory.js +b8229c43483474ac0f9eb47e756b0773 var/lib/backone/app/peer-picker.js +dbbb653bdddf96ee5d520c9bb4ab976b var/lib/backone/app/styles.css +99914b932bd37a50b983c5e7c90ae93b var/lib/backone/contacts.json diff --git a/debian/backone-app-shell/DEBIAN/postinst b/debian/backone-app-shell/DEBIAN/postinst new file mode 100755 index 0000000..52aa269 --- /dev/null +++ b/debian/backone-app-shell/DEBIAN/postinst @@ -0,0 +1,15 @@ +#!/bin/sh -e +case "$1" in + configure) + if [ -x /usr/lib/backone/addons/updater/backone-updater ]; then + /usr/lib/backone/addons/updater/backone-updater rebuild-manifest || true + elif [ -x /usr/lib/backone/addons/updater/rebuild-addon-manifest.sh ]; then + BACKONE_HOME=/var/lib/backone /usr/lib/backone/addons/updater/rebuild-addon-manifest.sh || true + fi + if [ -x /usr/lib/backone/addons/updater/merge-local-conf.sh ]; then + BACKONE_HOME=/var/lib/backone /usr/lib/backone/addons/updater/merge-local-conf.sh '{"settings":{"enableWebServer":true}}' || true + fi + ;; +esac + +exit 0 diff --git a/debian/backone-app-shell/usr/share/doc/backone-app-shell/changelog.gz b/debian/backone-app-shell/usr/share/doc/backone-app-shell/changelog.gz new file mode 100644 index 0000000000000000000000000000000000000000..c9fe129ac6d1c3cf53fbd8d932190dba9f8bd982 GIT binary patch literal 1335 zcmV-71<3jziwFP!000021I?LhZ`(E$hQH@m9AsbG%~o{rCH5|8+POdqCn@4|#rCO` zbSx90NP(p6c)xy!l9jYTR?Ep&6)@l%Nj>M);dx0aX34FR2rmLJ7<<7>FqXvve}+`C9X?_VAI_nmb}U0f-TQs` z9n&o=O3S2G@JnjyPp@`^d5KVE`WwJai9LvXcvngY{cr?9IQ8i@hM)Yg?;jn-UoiV$ zXTH&F3#=%5z)HI8hQJK!HR>J|h#C?lElVuXJ`d8LOozjNfgJ6Fyhee{AV_7OE0%vc z9Zsf$$zvSDeH;rcm}VAJU}>r(FrBQp#l)5xr?6H$p{uQVimC_6irF5NMM~}Uvzepu zG#Kre|3)CvEwwU!VuWn`wFHd2qH09-I(t0)LS;}%aN4?Ea z-V!OJ?;dZyziO`UB`PP}kC^r#2%I<$cL07c^?iClzn1tBUcW=$O5R`s7fiS04ZW~) z-muX(YQx)QKD^bu2jLLT%B(eSr}?ldN#F4SyuLT;Iv>KI$=_DI!>;oo@DJi0bjW+5 zWDoq&LA+6iybI?uln?KiY|R^XKHnm^qE!X)hHZF*uJa)rH+I~L*YA41`B8h`QzGu% z-&}pzw&k64o(^Phg>H*`+BGh%&JMsGcdqWexwXL^b?z18LvXvd;xTPR5{DbK!0p_L z$ zic1SQw>)E(yR(Rlxf3RLGNI8JNR$xVRR35@9iO$=I3S9>_064<70j++$%RGDWd<>A zz3hrvf-Xf02`fqaW22UK!!&}RTcM8umrG2n_b>?cwM$TI)Jvf@z$LtypTi5fX@GZy zP`si5x}OGSjAENP;~blb?bx6WSA z&gSz!Nwhm)6uP2@d8L#SP^uISSOu9P8R(tCF`=+y*l<$XsGM>c?MCTaccQoCSy>19 zoF&^3-eTM~zNjCxNsR9!G(S8fw6MRojNh!dp?o6toJ-2b`dH9KWmgE*AkAU0`>~nB zRR)?WP#Ok6mr^=SC^^rrFV-V?^ZtVY!Edn|=bD)!My zKV6h4Xsp6-BTCoK7Ws$Z2Av=13=YBV{=96`9(TAO_Yc&SRaK3viIUio39+r_hTo6T zvf$e+i0%(A_XjrEZ`mK}iJsz;mBNBnt_2)D9E}f(%e+>k|gfIf-4JzPln24E}X?xW$}vwK(#^d49+~*r=YKr1haT& zop)A`Ac~@HaF(W2tP;UAU-G2(Ln=)3^Eb20#muvJ_URiCnwho4ltlX_ZnXhfSzDOt z$w@}Bm$AFpNi))k)8U3bT+xV+B#IkizLO$ZF_~fNB7MD>Q|<*%KLC#o39^NS{0Ct^ zxRAunF6F9a7cDB>V@in0C&)eOe=75-v#ELr$R$nEDxns$IhW<#lZ%HxI7plSS($GW zh5wyK5l-M;DISmF2e=X`l@63vb4rjETO-vSlyvc&mfcjaw8|-kD5vVFBUI*5w;M$* tSXwPgTyYX;@u3B{)%_<{*w232Jp=8tqUf6y3h~K1`Um|HDVcm9008pAnK1wW literal 0 HcmV?d00001 diff --git a/debian/backone-app-tray.postinst b/debian/backone-app-tray.postinst new file mode 100644 index 0000000..1379578 --- /dev/null +++ b/debian/backone-app-tray.postinst @@ -0,0 +1,12 @@ +#!/bin/sh -e +case "$1" in + configure) + if [ -x /usr/lib/backone/addons/updater/backone-updater ]; then + /usr/lib/backone/addons/updater/backone-updater rebuild-manifest || true + elif [ -x /usr/lib/backone/addons/updater/rebuild-addon-manifest.sh ]; then + BACKONE_HOME=/var/lib/backone /usr/lib/backone/addons/updater/rebuild-addon-manifest.sh || true + fi + ;; +esac +#DEBHELPER# +exit 0 diff --git a/debian/backone-app-tray.substvars b/debian/backone-app-tray.substvars new file mode 100644 index 0000000..978fc8b --- /dev/null +++ b/debian/backone-app-tray.substvars @@ -0,0 +1,2 @@ +misc:Depends= +misc:Pre-Depends= diff --git a/debian/backone-app-tray/DEBIAN/conffiles b/debian/backone-app-tray/DEBIAN/conffiles new file mode 100644 index 0000000..15f7c63 --- /dev/null +++ b/debian/backone-app-tray/DEBIAN/conffiles @@ -0,0 +1 @@ +/etc/xdg/autostart/backone-tray-autostart.desktop diff --git a/debian/backone-app-tray/DEBIAN/control b/debian/backone-app-tray/DEBIAN/control new file mode 100644 index 0000000..fd61c66 --- /dev/null +++ b/debian/backone-app-tray/DEBIAN/control @@ -0,0 +1,13 @@ +Package: backone-app-tray +Source: backone +Version: 1.17.1 +Architecture: all +Maintainer: Dedy Sutanto +Installed-Size: 26 +Depends: backone, backone-app-shell, python3, python3-gi, gir1.2-gtk-3.0, gir1.2-ayatanaappindicator3-0.1, gir1.2-webkit2-4.1 | gir1.2-webkit2-4.0 +Recommends: backone-addon-chat, backone-addon-voice, backone-addon-video +Section: net +Priority: optional +Homepage: https://backone.cloud +Description: BackOne system tray application + Panel icon that opens the BackOne web UI and addon deep links. diff --git a/debian/backone-app-tray/DEBIAN/md5sums b/debian/backone-app-tray/DEBIAN/md5sums new file mode 100644 index 0000000..1ed85a1 --- /dev/null +++ b/debian/backone-app-tray/DEBIAN/md5sums @@ -0,0 +1,4 @@ +09b4c2c58f50ae9ec9eec6259e175a64 usr/bin/backone-tray +6c6597429cd44dc70291194acdf9a8ea usr/lib/backone/addons/app-tray/addon.json +4dd693abb526f9f30e2bae1a645d8bd2 usr/share/applications/backone-tray.desktop +bc2d8da8c630475f844feb987667b53e usr/share/doc/backone-app-tray/changelog.gz diff --git a/debian/backone-app-tray/DEBIAN/postinst b/debian/backone-app-tray/DEBIAN/postinst new file mode 100755 index 0000000..9bd50cc --- /dev/null +++ b/debian/backone-app-tray/DEBIAN/postinst @@ -0,0 +1,12 @@ +#!/bin/sh -e +case "$1" in + configure) + if [ -x /usr/lib/backone/addons/updater/backone-updater ]; then + /usr/lib/backone/addons/updater/backone-updater rebuild-manifest || true + elif [ -x /usr/lib/backone/addons/updater/rebuild-addon-manifest.sh ]; then + BACKONE_HOME=/var/lib/backone /usr/lib/backone/addons/updater/rebuild-addon-manifest.sh || true + fi + ;; +esac + +exit 0 diff --git a/debian/backone-app-tray/etc/xdg/autostart/backone-tray-autostart.desktop b/debian/backone-app-tray/etc/xdg/autostart/backone-tray-autostart.desktop new file mode 100644 index 0000000..59ed475 --- /dev/null +++ b/debian/backone-app-tray/etc/xdg/autostart/backone-tray-autostart.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Type=Application +Name=BackOne Tray +Comment=Start BackOne tray icon at login +Exec=/usr/bin/backone-tray +Icon=network-workgroup +Terminal=false +X-GNOME-Autostart-enabled=true +Hidden=false diff --git a/debian/backone-app-tray/usr/bin/backone-tray b/debian/backone-app-tray/usr/bin/backone-tray new file mode 100755 index 0000000..3826865 --- /dev/null +++ b/debian/backone-app-tray/usr/bin/backone-tray @@ -0,0 +1,127 @@ +#!/usr/bin/env python3 +"""BackOne system tray — opens /app UI and addon deep links.""" +import os +import signal +import subprocess +import sys +import threading +import urllib.request + +import gi +gi.require_version('Gtk', '3.0') +try: + gi.require_version('AyatanaAppIndicator3', '0.1') + from gi.repository import AyatanaAppIndicator3 as AppIndicator3 +except (ImportError, ValueError): + gi.require_version('AppIndicator3', '0.1') + from gi.repository import AppIndicator3 + +from gi.repository import GLib, Gtk + +APP_URL = os.environ.get('BACKONE_APP_URL', 'http://127.0.0.1:9993/app/') +HEALTH_URL = os.environ.get('BACKONE_HEALTH_URL', 'http://127.0.0.1:9993/health') +ICON_NAME = 'network-workgroup' + + +class BackOneTray: + def __init__(self): + self._windows = [] + self.indicator = AppIndicator3.Indicator.new( + 'backone-tray', + ICON_NAME, + AppIndicator3.IndicatorCategory.APPLICATION_STATUS, + ) + self.indicator.set_status(AppIndicator3.IndicatorStatus.ACTIVE) + self.indicator.set_menu(self._build_menu()) + try: + self.indicator.connect('activate', lambda *_: self._open_url(APP_URL)) + except TypeError: + pass + self._update_status() + GLib.timeout_add_seconds(30, self._on_timer) + + def _build_menu(self): + menu = Gtk.Menu() + + def add_item(label, callback): + item = Gtk.MenuItem(label=label) + item.connect('activate', lambda *_: callback()) + item.show() + menu.append(item) + return item + + add_item('Open BackOne App', lambda: self._open_url(APP_URL)) + add_item('Voice', lambda: self._open_url(APP_URL + '#/voice')) + add_item('Video', lambda: self._open_url(APP_URL + '#/video')) + add_item('Chat', lambda: self._open_url(APP_URL + '#/chat')) + menu.append(Gtk.SeparatorMenuItem()) + add_item('Restart BackOne Service', self._restart_service) + add_item('Quit Tray', Gtk.main_quit) + menu.show() + return menu + + def _service_ok(self): + try: + with urllib.request.urlopen(HEALTH_URL, timeout=2) as resp: + return resp.status == 200 + except Exception: + return False + + def _update_status(self): + title = 'BackOne (online)' if self._service_ok() else 'BackOne (offline)' + self.indicator.set_title(title) + + def _on_timer(self): + self._update_status() + return True + + def _open_url(self, url): + if self._try_webkit(url): + return + for cmd in ( + ['xdg-open', url], + ['gio', 'open', url], + ['sensible-browser', url], + ): + try: + subprocess.Popen(cmd, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) + return + except OSError: + continue + + def _try_webkit(self, url): + try: + gi.require_version('WebKit2', '4.1') + except ValueError: + try: + gi.require_version('WebKit2', '4.0') + except ValueError: + return False + from gi.repository import WebKit2 + + win = Gtk.Window(title='BackOne') + win.set_default_size(900, 640) + view = WebKit2.WebView() + view.load_uri(url) + win.add(view) + win.connect('destroy', lambda w: self._windows.remove(w) if w in self._windows else None) + self._windows.append(win) + win.show_all() + return True + + def _restart_service(self): + subprocess.Popen( + ['pkexec', 'systemctl', 'restart', 'backone'], + stdout=subprocess.DEVNULL, + stderr=subprocess.DEVNULL, + ) + + +def main(): + signal.signal(signal.SIGINT, signal.SIG_DFL) + BackOneTray() + Gtk.main() + + +if __name__ == '__main__': + sys.exit(main()) diff --git a/debian/backone-app-tray/usr/share/applications/backone-tray.desktop b/debian/backone-app-tray/usr/share/applications/backone-tray.desktop new file mode 100644 index 0000000..d31939c --- /dev/null +++ b/debian/backone-app-tray/usr/share/applications/backone-tray.desktop @@ -0,0 +1,8 @@ +[Desktop Entry] +Type=Application +Name=BackOne Tray +Comment=BackOne system tray for voice, video, and chat +Exec=/usr/bin/backone-tray +Icon=network-workgroup +Terminal=false +Categories=Network; diff --git a/debian/backone-app-tray/usr/share/doc/backone-app-tray/changelog.gz b/debian/backone-app-tray/usr/share/doc/backone-app-tray/changelog.gz new file mode 100644 index 0000000000000000000000000000000000000000..ae9d774b88e5d49da151687dec53160157bd8ef0 GIT binary patch literal 1335 zcmV-71<3jziwFP!000021I?LhZ`(E$hQH@m9AsbG%~mMMm)N_YY3BkdoTP};72Bs$ z(y>fLA_a=HV5#EYBIN^mjiFUoTvIa}wG69W3Qr|3d-Qgof@ZlT^YR6M7se8W< zzhkn6g*99n1-~R^{prA^>+|p$?1XiM6qwYb0s3BI;@YoRT^B~z|IvoBBrxWu&b>*NU6v-#|7G3#Gm-OLtVp1@LR%FEBB^=i(ugy(RMdYhxX zB~nh`J<)uB)m-0;RZh4cG3kNtJ8>ND0GK~zj9$>MC4PjLb;w)E>rdc<>z2HM7j(`W zH2Q{Zc)QGpw_5Zd7{ZxNTl03B4=YRhjt}5v-l*$*2>d30Tk#IN&Ig|z#5?Ga_d>}Y zu+c%hVTZg6=QETK@3?Hu8+1P3Lb#$;1@Q)Lc>S*PAs9Dy+=`cVJ>OW^p7)f9JNGwN zAGU3IC!MDQ*;}F8;+}SmORKX3aL1jidv9)Sa7Uec#rP21?yY!C8`?TAB^l2pQc9eGIrv&7hHVYcqZy7QZt_k(;CGEtin5?qTINm-ktt`!w!Y4I6Lny@k5HnQ!lv)8k; z`TS23?G8AFuBc&NDdhx|D!~$rf>ea!Q1~%y1SwsroN^h>M(JC3qPG;Ot%H2d zl5GfYF=`uM*!SBc#`h5#3l0e_=k+(p|Dl9T++sD(H7|<@wcf&e0e=x^b@HsVNQLAXtbO|Z z>7s;wV->88C|x^S$PU5vJ3r7F9D>{ZdD)~r?r=ZuAE+yLR&mC)Sc(g zlarKUw~@QpNi))k)8U3bT+xV+B#IkizLO$eahYP`B7MD>Q||dsKL8I839^NS{0Ct^ zxRAunF6F9a7cDB>V@im~C&)eOe=75-v#ELrC?rkNDxns$xsdkm$;E>W4$|g-R_5D8 z!M@Wdf(g8{+2c|C09RQ;r30nWf)ZrK*GP2-C0#tHWj7Tpt#V2s%BgzlWGeNj+l`_Y tJgF8Xt~h0A@Sz2`)%_=4n9qLNJp=9YqUamVx1YSDe*h0wWPy7h008ZmksAO2 literal 0 HcmV?d00001 diff --git a/debian/backone.postinst.debhelper b/debian/backone.postinst.debhelper new file mode 100644 index 0000000..a9d9afa --- /dev/null +++ b/debian/backone.postinst.debhelper @@ -0,0 +1,30 @@ +# Automatically added by dh_systemd_enable/13.14.1ubuntu5 +if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then + # The following line should be removed in trixie or trixie+1 + deb-systemd-helper unmask 'backone.service' >/dev/null || true + + # was-enabled defaults to true, so new installations run enable. + if deb-systemd-helper --quiet was-enabled 'backone.service'; then + # Enables the unit on first installation, creates new + # symlinks on upgrades if the unit file has changed. + deb-systemd-helper enable 'backone.service' >/dev/null || true + else + # Update the statefile to add new symlinks (if any), which need to be + # cleaned up on purge. Also remove old symlinks. + deb-systemd-helper update-state 'backone.service' >/dev/null || true + fi +fi +# End automatically added section +# Automatically added by dh_systemd_start/13.14.1ubuntu5 +if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then + if [ -d /run/systemd/system ]; then + systemctl --system daemon-reload >/dev/null || true + if [ -n "$2" ]; then + _dh_action=restart + else + _dh_action=start + fi + deb-systemd-invoke $_dh_action 'backone.service' >/dev/null || true + fi +fi +# End automatically added section diff --git a/debian/backone.postrm.debhelper b/debian/backone.postrm.debhelper new file mode 100644 index 0000000..7b3bb55 --- /dev/null +++ b/debian/backone.postrm.debhelper @@ -0,0 +1,12 @@ +# Automatically added by dh_systemd_start/13.14.1ubuntu5 +if [ "$1" = remove ] && [ -d /run/systemd/system ] ; then + systemctl --system daemon-reload >/dev/null || true +fi +# End automatically added section +# Automatically added by dh_systemd_enable/13.14.1ubuntu5 +if [ "$1" = "purge" ]; then + if [ -x "/usr/bin/deb-systemd-helper" ]; then + deb-systemd-helper purge 'backone.service' >/dev/null || true + fi +fi +# End automatically added section diff --git a/debian/backone.prerm.debhelper b/debian/backone.prerm.debhelper new file mode 100644 index 0000000..cf18579 --- /dev/null +++ b/debian/backone.prerm.debhelper @@ -0,0 +1,5 @@ +# Automatically added by dh_systemd_start/13.14.1ubuntu5 +if [ -z "${DPKG_ROOT:-}" ] && [ "$1" = remove ] && [ -d /run/systemd/system ] ; then + deb-systemd-invoke stop 'backone.service' >/dev/null || true +fi +# End automatically added section diff --git a/debian/backone.service b/debian/backone.service new file mode 100644 index 0000000..e7bac18 --- /dev/null +++ b/debian/backone.service @@ -0,0 +1,12 @@ +[Unit] +Description=BackOne network virtualization service +After=network-online.target network.target +Wants=network-online.target + +[Service] +ExecStart=/usr/sbin/backone +Restart=always +KillMode=process + +[Install] +WantedBy=multi-user.target diff --git a/debian/backone.substvars b/debian/backone.substvars new file mode 100644 index 0000000..6044afc --- /dev/null +++ b/debian/backone.substvars @@ -0,0 +1,3 @@ +shlibs:Depends=libc6 (>= 2.38), libgcc-s1 (>= 3.0), libstdc++6 (>= 13.1) +misc:Depends= +misc:Pre-Depends= diff --git a/debian/changelog b/debian/changelog index 660562f..3267116 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,26 @@ +backone (1.17.1) stable; urgency=medium + + * Fix /api/backone routes and reinstallable Web UI packages + + -- Dedy Sutanto Tue, 30 Jun 2026 12:02:07 +0700 + +backone (1.17.0) stable; urgency=medium + + * Tray app, auto web server, peer contact UI + + -- Dedy Sutanto Tue, 30 Jun 2026 09:55:07 +0700 + +backone (1.16.0) stable; urgency=medium + + * Release notes + + -- Dedy Sutanto Tue, 30 Jun 2026 08:59:49 +0700 + +backone (1.15.0) stable; urgency=medium + + * Separated addon architecture: voice, video, chat, updater + + -- Dedy Sutanto Tue, 30 Jun 2026 08:37:16 +0700 zerotier-one (1.14.1) unstable; urgency=medium * See RELEASE-NOTES.md for release notes. diff --git a/debian/control b/debian/control index b0c178a..90c647f 100644 --- a/debian/control +++ b/debian/control @@ -1,19 +1,66 @@ -Source: zerotier-one -Maintainer: Adam Ierymenko +Source: backone Section: net Priority: optional -Standards-Version: 3.9.6 -Build-Depends: debhelper -Vcs-Git: git://github.com/zerotier/ZeroTierOne -Vcs-Browser: https://github.com/zerotier/ZeroTierOne -Homepage: https://www.zerotier.com/ +Maintainer: Dedy Sutanto +Standards-Version: 4.6.0 +Build-Depends: debhelper (>= 12), make, g++, openssl, libssl-dev +Homepage: https://backone.cloud +Vcs-Browser: https://github.com/proitlab/BackOne +Vcs-Git: https://github.com/proitlab/BackOne.git -Package: zerotier-one +Package: backone Architecture: any -Depends: adduser, libstdc++6 (>= 5), openssl -Homepage: https://www.zerotier.com/ -Description: ZeroTier network virtualization service - ZeroTier One lets you join ZeroTier virtual networks and - have them appear as tun/tap ports on your system. See - https://www.zerotier.com/ for instructions and - documentation. +Depends: ${shlibs:Depends}, ${misc:Depends}, adduser, openssl, systemd +Replaces: zerotier-one +Conflicts: zerotier-one +Provides: zerotier-one +Suggests: backone-app-shell, backone-app-tray, backone-addon-comms-core, backone-addon-updater +Description: BackOne network virtualization service (core) + BackOne provides software-defined virtual networking. This package + contains the core daemon only. Install addon packages for comms features. + +Package: backone-app-shell +Architecture: all +Depends: ${misc:Depends}, backone +Description: BackOne web app shell host + Minimal web UI host that dynamically loads separated BackOne addons. + +Package: backone-app-tray +Architecture: all +Depends: ${misc:Depends}, backone, backone-app-shell, python3, python3-gi, + gir1.2-gtk-3.0, gir1.2-ayatanaappindicator3-0.1, + gir1.2-webkit2-4.1 | gir1.2-webkit2-4.0 +Recommends: backone-addon-chat, backone-addon-voice, backone-addon-video +Description: BackOne system tray application + Panel icon that opens the BackOne web UI and addon deep links. + +Package: backone-addon-comms-core +Architecture: any +Depends: ${misc:Depends}, backone +Recommends: postgresql-client, redis-tools +Description: BackOne comms core addon (signaling backend) + Shared signaling backend for voice, video, and chat addons. + +Package: backone-addon-voice +Architecture: all +Depends: ${misc:Depends}, backone, backone-addon-comms-core, backone-app-shell +Description: BackOne voice call P2P addon + P2P voice calling with ringing popup over the BackOne overlay. + +Package: backone-addon-video +Architecture: all +Depends: ${misc:Depends}, backone, backone-addon-comms-core, backone-addon-voice, backone-app-shell +Description: BackOne video call P2P addon + P2P video calling with ringing popup over the BackOne overlay. + +Package: backone-addon-chat +Architecture: all +Depends: ${misc:Depends}, backone, backone-addon-comms-core, backone-app-shell +Description: BackOne chat P2P addon + Text chat with image and document attachments over BackOne. + +Package: backone-addon-updater +Architecture: all +Depends: ${misc:Depends}, backone +Description: BackOne version updater addon + Migrates installations between BackOne and addon versions. diff --git a/debian/debhelper-build-stamp b/debian/debhelper-build-stamp new file mode 100644 index 0000000..eac8041 --- /dev/null +++ b/debian/debhelper-build-stamp @@ -0,0 +1,8 @@ +backone +backone-app-shell +backone-addon-comms-core +backone-addon-voice +backone-addon-video +backone-addon-chat +backone-addon-updater +backone-app-tray diff --git a/debian/postinst b/debian/postinst index b6e7471..a1c49c7 100644 --- a/debian/postinst +++ b/debian/postinst @@ -2,10 +2,32 @@ case "$1" in configure) - if ! id zerotier-one >>/dev/null 2>&1; then - useradd --system --user-group --home-dir /var/lib/zerotier-one --shell /usr/sbin/nologin --no-create-home zerotier-one - fi - ;; + if ! getent passwd backone >/dev/null 2>&1; then + useradd --system --user-group --home-dir /var/lib/backone --shell /usr/sbin/nologin --no-create-home backone + fi + mkdir -p /var/lib/backone/addons.d + chown -R backone:backone /var/lib/backone 2>/dev/null || true + if [ -x /usr/lib/backone/addons/updater/backone-updater ]; then + /usr/lib/backone/addons/updater/backone-updater migrate --core || true + /usr/lib/backone/addons/updater/backone-updater rebuild-manifest || true + fi + if [ -x /usr/lib/backone/addons/updater/merge-local-conf.sh ]; then + BACKONE_HOME=/var/lib/backone /usr/lib/backone/addons/updater/merge-local-conf.sh '{"settings":{"enableWebServer":true}}' || true + fi + # Drop legacy manual-install unit that runs /opt/backone instead of /usr/sbin/backone + if [ -f /etc/systemd/system/backone.service ] && grep -q '/opt/backone' /etc/systemd/system/backone.service 2>/dev/null; then + echo "Removing stale /etc/systemd/system/backone.service (was pointing at /opt/backone)" + rm -f /etc/systemd/system/backone.service + systemctl daemon-reload 2>/dev/null || true + fi + if [ -x /usr/lib/backone/addons/updater/sync-authtoken.sh ]; then + /usr/lib/backone/addons/updater/sync-authtoken.sh || true + elif [ -x /usr/share/backone/sync-authtoken.sh ]; then + /usr/share/backone/sync-authtoken.sh || true + fi + ;; esac #DEBHELPER# + +exit 0 diff --git a/debian/preinst b/debian/preinst new file mode 100644 index 0000000..b82d466 --- /dev/null +++ b/debian/preinst @@ -0,0 +1,13 @@ +#!/bin/sh -e + +case "$1" in + upgrade|install) + if command -v systemctl >/dev/null 2>&1; then + systemctl stop backone.service 2>/dev/null || systemctl stop zerotier-one.service 2>/dev/null || true + fi + ;; +esac + +#DEBHELPER# + +exit 0 diff --git a/debian/prerm b/debian/prerm new file mode 100644 index 0000000..1301246 --- /dev/null +++ b/debian/prerm @@ -0,0 +1,13 @@ +#!/bin/sh -e + +case "$1" in + remove|upgrade|deconfigure) + if command -v systemctl >/dev/null 2>&1; then + systemctl stop backone.service 2>/dev/null || true + fi + ;; +esac + +#DEBHELPER# + +exit 0 diff --git a/debian/rules b/debian/rules old mode 100644 new mode 100755 index 81fde68..a1dddcf --- a/debian/rules +++ b/debian/rules @@ -1,5 +1,7 @@ #!/usr/bin/make -f +export DH_VERBOSE=1 + CFLAGS=-O3 -fstack-protector-strong CXXFLAGS=-O3 -fstack-protector-strong @@ -7,10 +9,26 @@ CXXFLAGS=-O3 -fstack-protector-strong dh $@ --with systemd override_dh_auto_build: - make + $(MAKE) one + +override_dh_auto_install: + $(MAKE) install-core DESTDIR=$(CURDIR)/debian/backone + $(MAKE) install-app-shell DESTDIR=$(CURDIR)/debian/backone-app-shell + $(MAKE) install-app-tray DESTDIR=$(CURDIR)/debian/backone-app-tray + $(MAKE) install-addon-comms-core DESTDIR=$(CURDIR)/debian/backone-addon-comms-core + $(MAKE) install-addon-voice DESTDIR=$(CURDIR)/debian/backone-addon-voice + $(MAKE) install-addon-video DESTDIR=$(CURDIR)/debian/backone-addon-video + $(MAKE) install-addon-chat DESTDIR=$(CURDIR)/debian/backone-addon-chat + $(MAKE) install-addon-updater DESTDIR=$(CURDIR)/debian/backone-addon-updater + +override_dh_install: + +override_dh_installdocs: + +override_dh_systemd_install: + dh_systemd_install --name=backone override_dh_systemd_start: - dh_systemd_start --restart-after-upgrade + dh_systemd_start --name=backone --restart-after-upgrade override_dh_installinit: - dh_installinit --name=zerotier-one -- defaults diff --git a/debian/version b/debian/version new file mode 100644 index 0000000..511a76e --- /dev/null +++ b/debian/version @@ -0,0 +1 @@ +1.17.1 diff --git a/doc/backone-cli.1 b/doc/backone-cli.1 new file mode 100644 index 0000000..ecf16ac --- /dev/null +++ b/doc/backone-cli.1 @@ -0,0 +1,83 @@ +.TH "ZEROTIER\-CLI" "1" "December 2016" "" "" +.SH "NAME" +\fBbackone-cli\fR \- control local BackOne virtual network service +.SH SYNOPSIS +.P +\fBbackone\-cli\fP [\-switches] [arguments] +.SH DESCRIPTION +.P +\fBbackone\-cli\fR provides a simple command line interface to the local JSON API of the BackOne virtual network endpoint service backone\-one(8)\. +.P +By default \fBbackone\-cli\fR must be run as root or with \fBsudo\fP\|\. If you want to allow an unprivileged user to use \fBbackone\-cli\fR to control the system BackOne service, you can create a local copy of the BackOne service authorization token in the user's home directory: +.P +.RS 2 +.nf +sudo cp /var/lib/backone\-one/authtoken\.secret /home/user/\.zeroTierOneAuthToken +chown user /home/user/\.zeroTierOneAuthToken +chmod 0600 /home/user/\.zeroTierOneAuthToken +.fi +.RE +.P +(The location of BackOne's service home may differ by platform\. See backone\-one(8)\.) +.P +Note that this gives the user the power to connect or disconnect the system to or from any virtual network, which is a significant permission\. +.P +\fBbackone\-cli\fR has several command line arguments that are visible in \fBhelp\fP output\. The two most commonly used are \fB\-j\fP for raw JSON output and \fB\-D\fP to specify an alternative BackOne service working directory\. Raw JSON output is easier to parse in scripts and also contains verbose details not present in the tabular output\. The \fB\-D\fP option specifies where the service's backone\-one\.port and authtoken\.secret files are located if the service is not running at the default location for your system\. +.SH COMMANDS +.RS 0 +.IP \(bu 2 +\fBhelp\fP: +Displays \fBbackone\-cli\fR help\. +.IP \(bu 2 +\fBinfo\fP: +Shows information about this device including its 10\-digit BackOne address and apparent connection status\. Use \fB\-j\fP for more verbose output\. +.IP \(bu 2 +\fBlistpeers\fP: +This command lists the BackOne VL1 (virtual layer 1, the peer to peer network) peers this service knows about and has recently (within the past 30 minutes or so) communicated with\. These are not necessarily all the devices on your virtual network(s), and may also include a few devices not on any virtual network you've joined\. These are typically either root servers or network controllers\. +.IP \(bu 2 +\fBlistnetworks\fP: +This lists the networks your system belongs to and some information about them, such as any BackOne\-managed IP addresses you have been assigned\. (IP addresses assigned manually to BackOne interfaces will not be listed here\. Use the standard network interface commands to see these\.) +.IP \(bu 2 +\fBjoin\fP: +To join a network just use \fBjoin\fP and its 16\-digit hex network ID\. That's it\. Then use \fBlistnetworks\fP to see the status\. You'll either get a reply from the network controller with a certificate and other info such as IP assignments, or you'll get "access denied\." In this case you'll need the administrator of this network to authorize your device by its 10\-digit device ID (visible with \fBinfo\fP) on the network's controller\. +.IP \(bu 2 +\fBleave\fP: +Leaving a network is as easy as joining it\. This disconnects from the network and deletes its interface from the system\. Note that peers on the network may hang around in \fBlistpeers\fP for up to 30 minutes until they time out due to lack of traffic\. But if they no longer share a network with you, they can't actually communicate with you in any meaningful way\. + +.RE +.SH EXAMPLES +.P +Join "Earth," BackOne's big public party line network: +.P +.RS 2 +.nf +$ sudo backone\-cli join 8056c2e21c000001 +$ sudo backone\-cli listnetworks +( wait until you get an Earth IP ) +$ ping earth\.backone\.net +( you should now be able to ping our Earth test IP ) +.fi +.RE +.P +Leave "Earth": +.P +.RS 2 +.nf +$ sudo backone\-cli leave 8056c2e21c000001 +.fi +.RE +.P +List VL1 peers: +.P +.RS 2 +.nf +$ sudo backone\-cli listpeers +.fi +.RE +.SH COPYRIGHT +.P +(c)2011\-2016 BackOne, Inc\. \-\- https://www\.backone\.com/ \-\- https://github\.com/backone +.SH SEE ALSO +.P +backone\-one(8), backone\-idtool(1) + diff --git a/doc/backone-idtool.1 b/doc/backone-idtool.1 new file mode 100644 index 0000000..d1ac196 --- /dev/null +++ b/doc/backone-idtool.1 @@ -0,0 +1,84 @@ +.TH "ZEROTIER\-IDTOOL" "1" "December 2016" "" "" +.SH "NAME" +\fBbackone-idtool\fR \- tool for creating and manipulating BackOne identities +.SH SYNOPSIS +.P +\fBbackone\-idtool\fP [args] +.SH DESCRIPTION +.P +\fBbackone\-idtool\fR is a command line utility for doing things with BackOne identities\. A BackOne identity consists of a public/private key pair (or just the public if it's only an identity\.public) and a 10\-digit hexadecimal BackOne address derived from the public key by way of a proof of work based hash function\. +.SH COMMANDS +.P +When command arguments call for a public or secret (full) identity, the identity can be specified as a path to a file or directly on the command line\. +.RS 0 +.IP \(bu 2 +\fBhelp\fP: +Display help\. (Also running with no command does this\.) +.IP \(bu 2 +\fBgenerate\fP [secret file] [public file] [vanity]: +Generate a new BackOne identity\. If a secret file is specified, the full identity including the private key will be written to this file\. If the public file is specified, the public portion will be written there\. If no file paths are specified the full secret identity is output to STDOUT\. The vanity prefix is a series of hexadecimal digits that the generated identity's address should start with\. Typically this isn't used, and if it's specified generation can take a very long time due to the intrinsic cost of generating identities with their proof of work function\. Generating an identity with a known 16\-bit (4 digit) prefix on a 2\.8ghz Core i5 (using one core) takes an average of two hours\. +.IP \(bu 2 +\fBvalidate\fP : +Locally validate an identity's key and proof of work function correspondence\. +.IP \(bu 2 +\fBgetpublic\fP : +Extract the public portion of an identity\.secret and print to STDOUT\. +.IP \(bu 2 +\fBsign\fP : +Sign a file's contents with SHA512+ECC\-256 (ed25519)\. The signature is output in hex to STDOUT\. +.IP \(bu 2 +\fBverify\fP : +Verify a signature created with \fBsign\fP\|\. +.IP \(bu 2 +\fBmkcom\fP [id,value,maxdelta] [\|\.\.\.]: +Create and sign a network membership certificate\. This is not generally useful since network controllers do this automatically and is included mostly for testing purposes\. + +.RE +.SH EXAMPLES +.P +Generate and dump a new identity: +.P +.RS 2 +.nf +$ backone\-idtool generate +.fi +.RE +.P +Generate and write a new identity, both secret and public parts: +.P +.RS 2 +.nf +$ backone\-idtool generate identity\.secret identity\.public +.fi +.RE +.P +Generate a vanity address that begins with the hex digits "beef" (this will take a while!): +.P +.RS 2 +.nf +$ backone\-idtool generate beef\.secret beef\.public beef +.fi +.RE +.P +Sign a file with an identity's secret key: +.P +.RS 2 +.nf +$ backone\-idtool sign identity\.secret last_will_and_testament\.txt +.fi +.RE +.P +Verify a file's signature with a public key: +.P +.RS 2 +.nf +$ backone\-idtool verify identity\.public last_will_and_testament\.txt +.fi +.RE +.SH COPYRIGHT +.P +(c)2011\-2016 BackOne, Inc\. \-\- https://www\.backone\.com/ \-\- https://github\.com/backone +.SH SEE ALSO +.P +backone\-one(8), backone\-cli(1) + diff --git a/doc/backone.8 b/doc/backone.8 new file mode 100644 index 0000000..806ff0c --- /dev/null +++ b/doc/backone.8 @@ -0,0 +1,104 @@ +.TH "ZEROTIER\-ONE" "8" "December 2016" "" "" +.SH "NAME" +\fBbackone\fR \- BackOne virtual network endpoint service +.SH SYNOPSIS +.P +\fBbackone\-one\fP [\-switches] [working directory] +.SH DESCRIPTION +.P +\fBbackone\-one\fR is the service/daemon responsible for connecting a Unix (Linux/BSD/OSX) system to one or more BackOne virtual networks and presenting those networks to the system as virtual network ports\. You can think of it as a peer to peer VPN client\. +.P +It's typically run by init systems like systemd (Linux) or launchd (Mac) rather than directly by the user, and it must be run as root unless you give it the \fB\-U\fP switch and don't plan on actually joining networks (e\.g\. to run a network controller microservice only)\. +.P +The \fBbackone\-one\fR service keeps its state and other files in a working directory\. If this directory is not specified at launch it defaults to "/var/lib/backone\-one" on Linux, "/Library/Application Support/BackOne/One" on Mac, and "/var/db/backone\-one" on FreeBSD and other similar BSDs\. The working directory should persist\. It shouldn't be automatically cleaned by system cleanup daemons or stored in a volatile location\. Loss of its identity\.secret file results in loss of this system's unique 10\-digit BackOne address and key\. +.P +Multiple instances of \fBbackone\-one\fR can be run on the same system as long as they are run with different primary ports (see switches) and a different working directory\. But since a single service can join any number of networks, typically there's no point in doing this\. +.P +The \fBbackone\-one\fR service is controlled via a JSON API available at 127\.0\.0\.1: with the default primary port being 9993\. Access to this API requires an authorization token normally found in the authtoken\.secret file in the service's working directory\. On some platforms access may be guarded by other measures such as socket peer UID/GID lookup if additional security options are enabled (this is not the default)\. +.P +The first time the service is started in a fresh working directory, it generates a BackOne identity\. On slow systems this process can take ten seconds or more due to an anti\-DDOS/anti\-counterfeit proof of work function used by BackOne in address generation\. This only happens once, and once generated the result is saved in identity\.secret in the working directory\. This file represents and defines/claims your BackOne address and associated ECC\-256 key pair\. +.SH SWITCHES +.RS 0 +.IP \(bu 2 +\fB\-h\fP: +Display help\. +.IP \(bu 2 +\fB\-v\fP: +Display BackOne One version\. +.IP \(bu 2 +\fB\-U\fP: +Skip privilege check and allow to be run by non\-privileged user\. This is typically used when \fBbackone\-one\fR is built with the network controller option included\. In this case the BackOne service might only be acting as a network controller and might never actually join networks, in which case it does not require elevated system permissions\. +.IP \(bu 2 +\fB\-p\fP: +Specify a different primary port\. If this is not given the default is 9993\. If zero is given a random port is chosen each time\. +.IP \(bu 2 +\fB\-d\fP: +Fork and run as a daemon\. +.IP \(bu 2 +\fB\-i\fP: +Invoke the \fBbackone\-idtool\fR personality, in which case the binary behaves like backone\-idtool(1)\. This happens automatically if the name of the binary (or a symlink to it) is backone\-idtool\. +.IP \(bu 2 +\fB\-q\fP: +Invoke the \fBbackone\-cli\fR personality, in which case the binary behaves like backone\-cli(1)\. This happens automatically if the name of the binary (or a symlink to it) is backone\-cli\. + +.RE +.SH EXAMPLES +.P +Run as daemon with OS default working directory and default port: +.P +.RS 2 +.nf +$ sudo backone\-one \-d +.fi +.RE +.P +Run as daemon with a different working directory and port: +.P +.RS 2 +.nf +$ sudo backone\-one \-d \-p12345 /tmp/backone\-working\-directory\-test +.fi +.RE +.SH FILES +.P +These are found in the service's working directory\. +.RS 0 +.IP \(bu 2 +\fBidentity\.public\fP: +The public portion of your BackOne identity, which is your 10\-digit hex address and the associated public key\. +.IP \(bu 2 +\fBidentity\.secret\fP: +Your full BackOne identity including its private key\. This file identifies the system on the network, which means you can move a BackOne address around by copying this file and you should back up this file if you want to save your system's static BackOne address\. This file must be protected, since theft of its secret key will allow anyone to impersonate your device on any network and decrypt traffic\. For network controllers this file is particularly sensitive since it constitutes the private key for a certificate authority for the controller's networks\. +.IP \(bu 2 +\fBauthtoken\.secret\fP: +The secret token used to authenticate requests to the service's local JSON API\. If it does not exist it is generated from a secure random source on service start\. To use, send it in the "X\-ZT1\-Auth" header with HTTP requests to 127\.0\.0\.1:\|\. +.IP \(bu 2 +\fBdevicemap\fP: +Remembers mappings of zt# interface numbers to BackOne networks so they'll persist across restarts\. On some systems that support longer interface names that can encode the network ID (such as FreeBSD) this file may not be present\. +.IP \(bu 2 +\fBbackone\-one\.pid\fP: +BackOne's PID\. This file is deleted on normal shutdown\. +.IP \(bu 2 +\fBbackone\-one\.port\fP: +BackOne's primary port, which is also where its JSON API is found at 127\.0\.0\.1:\|\. This file is created on startup and is read by backone\-cli(1) to determine where it should find the control API\. +.IP \(bu 2 +\fBcontroller\.db\fP: +If the BackOne One service is built with the network controller enabled, this file contains the controller's SQLite3 database\. +.IP \(bu 2 +\fBcontroller\.db\.backup\fP: +If the BackOne One service is built with the network controller enabled, it periodically backs up its controller\.db database in this file (currently every 5 minutes if there have been changes)\. Since this file is not a currently in use SQLite3 database it's safer to back up without corruption\. On new backups the file is rotated out rather than being rewritten in place\. +.IP \(bu 2 +\fBiddb\.d/\fP (directory): +Caches the public identity of every peer BackOne has spoken with in the last 60 days\. This directory and its contents can be deleted, but this may result in slower connection initations since it will require that we go out and re\-fetch full identities for peers we're speaking to\. +.IP \(bu 2 +\fBnetworks\.d\fP (directory): +This caches network configurations and certificate information for networks you belong to\. BackOne scans this directory for \|\.conf files on startup to recall its networks, so "touch"ing an empty \|\.conf file in this directory is a way of pre\-configuring BackOne to join a specific network on startup without using the API\. If the config file is empty ZeroTIer will just fetch it from the network's controller\. + +.RE +.SH COPYRIGHT +.P +(c)2011\-2016 BackOne, Inc\. \-\- https://www\.backone\.com/ \-\- https://github\.com/backone +.SH SEE ALSO +.P +backone\-cli(1), backone\-idtool(1) + diff --git a/ext/installfiles/linux/backone.te b/ext/installfiles/linux/backone.te new file mode 100644 index 0000000..80f43a1 --- /dev/null +++ b/ext/installfiles/linux/backone.te @@ -0,0 +1,14 @@ + +module backone 1.0; + +require { + type unconfined_t; + type initrc_t; + class memprotect mmap_zero; +} + +#============= initrc_t ============== +allow initrc_t self:memprotect mmap_zero; + +#============= unconfined_t ============== +allow unconfined_t self:memprotect mmap_zero; diff --git a/ext/libpqxx-7.7.3/config/config.guess b/ext/libpqxx-7.7.3/config/config.guess index 2e9ad7f..7f76b62 100755 --- a/ext/libpqxx-7.7.3/config/config.guess +++ b/ext/libpqxx-7.7.3/config/config.guess @@ -1,12 +1,14 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright 1992-2016 Free Software Foundation, Inc. +# Copyright 1992-2022 Free Software Foundation, Inc. -timestamp='2016-10-02' +# shellcheck disable=SC2006,SC2268 # see below for rationale + +timestamp='2022-01-09' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or +# the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but @@ -15,7 +17,7 @@ timestamp='2016-10-02' # General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program; if not, see . +# along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -27,11 +29,19 @@ timestamp='2016-10-02' # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess +# https://git.savannah.gnu.org/cgit/config.git/plain/config.guess # # Please send patches to . +# The "shellcheck disable" line above the timestamp inhibits complaints +# about features and limitations of the classic Bourne shell that were +# superseded or lifted in POSIX. However, this script identifies a wide +# variety of pre-POSIX systems that do not have POSIX shells at all, and +# even some reasonably current systems (Solaris 10 as case-in-point) still +# have a pre-POSIX /bin/sh. + + me=`echo "$0" | sed -e 's,.*/,,'` usage="\ @@ -39,7 +49,7 @@ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. -Operation modes: +Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit @@ -50,7 +60,7 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2016 Free Software Foundation, Inc. +Copyright 1992-2022 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -84,7 +94,8 @@ if test $# != 0; then exit 1 fi -trap 'exit 1' 1 2 15 +# Just in case it came from the environment. +GUESS= # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires @@ -96,66 +107,90 @@ trap 'exit 1' 1 2 15 # Portable tmp directory creation inspired by the Autoconf team. -set_cc_for_build=' -trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; -trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; -: ${TMPDIR=/tmp} ; - { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || - { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || - { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || - { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; -dummy=$tmp/dummy ; -tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; -case $CC_FOR_BUILD,$HOST_CC,$CC in - ,,) echo "int x;" > $dummy.c ; - for c in cc gcc c89 c99 ; do - if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then - CC_FOR_BUILD="$c"; break ; - fi ; - done ; - if test x"$CC_FOR_BUILD" = x ; then - CC_FOR_BUILD=no_compiler_found ; - fi - ;; - ,,*) CC_FOR_BUILD=$CC ;; - ,*,*) CC_FOR_BUILD=$HOST_CC ;; -esac ; set_cc_for_build= ;' +tmp= +# shellcheck disable=SC2172 +trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15 + +set_cc_for_build() { + # prevent multiple calls if $tmp is already set + test "$tmp" && return 0 + : "${TMPDIR=/tmp}" + # shellcheck disable=SC2039,SC3028 + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } + dummy=$tmp/dummy + case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in + ,,) echo "int x;" > "$dummy.c" + for driver in cc gcc c89 c99 ; do + if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then + CC_FOR_BUILD=$driver + break + fi + done + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; + esac +} # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) -if (test -f /.attbin/uname) >/dev/null 2>&1 ; then +if test -f /.attbin/uname ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown -UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown -case "${UNAME_SYSTEM}" in +case $UNAME_SYSTEM in Linux|GNU|GNU/*) - # If the system lacks a compiler, then just pick glibc. - # We could probably try harder. - LIBC=gnu + LIBC=unknown - eval $set_cc_for_build - cat <<-EOF > $dummy.c + set_cc_for_build + cat <<-EOF > "$dummy.c" #include #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc - #else + #elif defined(__GLIBC__) LIBC=gnu + #else + #include + /* First heuristic to detect musl libc. */ + #ifdef __DEFINED_va_list + LIBC=musl + #endif #endif EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` + cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` + eval "$cc_set_libc" + + # Second heuristic to detect musl libc. + if [ "$LIBC" = unknown ] && + command -v ldd >/dev/null && + ldd --version 2>&1 | grep -q ^musl; then + LIBC=musl + fi + + # If the system lacks a compiler, then just pick glibc. + # We could probably try harder. + if [ "$LIBC" = unknown ]; then + LIBC=gnu + fi ;; esac # Note: order is significant - the case branches are not exclusive. -case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in +case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, @@ -167,32 +202,32 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". - sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ - /sbin/$sysctl 2>/dev/null || \ - /usr/sbin/$sysctl 2>/dev/null || \ + /sbin/sysctl -n hw.machine_arch 2>/dev/null || \ + /usr/sbin/sysctl -n hw.machine_arch 2>/dev/null || \ echo unknown)` - case "${UNAME_MACHINE_ARCH}" in + case $UNAME_MACHINE_ARCH in + aarch64eb) machine=aarch64_be-unknown ;; armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; earmv*) - arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'` - endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'` + arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` + endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` machine=${arch}${endian}-unknown ;; - *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + *) machine=$UNAME_MACHINE_ARCH-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently (or will in the future) and ABI. - case "${UNAME_MACHINE_ARCH}" in + case $UNAME_MACHINE_ARCH in earm*) os=netbsdelf ;; arm*|i386|m68k|ns32k|sh3*|sparc|vax) - eval $set_cc_for_build + set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then @@ -208,10 +243,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in ;; esac # Determine ABI tags. - case "${UNAME_MACHINE_ARCH}" in + case $UNAME_MACHINE_ARCH in earm*) expr='s/^earmv[0-9]/-eabi/;s/eb$//' - abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"` + abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` ;; esac # The OS release @@ -219,47 +254,68 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. - case "${UNAME_VERSION}" in + case $UNAME_VERSION in Debian*) release='-gnu' ;; *) - release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2` + release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "${machine}-${os}${release}${abi}" - exit ;; + GUESS=$machine-${os}${release}${abi-} + ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} - exit ;; + GUESS=$UNAME_MACHINE_ARCH-unknown-bitrig$UNAME_RELEASE + ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} - exit ;; + GUESS=$UNAME_MACHINE_ARCH-unknown-openbsd$UNAME_RELEASE + ;; + *:SecBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/SecBSD.//'` + GUESS=$UNAME_MACHINE_ARCH-unknown-secbsd$UNAME_RELEASE + ;; *:LibertyBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${UNAME_RELEASE} - exit ;; + GUESS=$UNAME_MACHINE_ARCH-unknown-libertybsd$UNAME_RELEASE + ;; + *:MidnightBSD:*:*) + GUESS=$UNAME_MACHINE-unknown-midnightbsd$UNAME_RELEASE + ;; *:ekkoBSD:*:*) - echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} - exit ;; + GUESS=$UNAME_MACHINE-unknown-ekkobsd$UNAME_RELEASE + ;; *:SolidBSD:*:*) - echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} - exit ;; + GUESS=$UNAME_MACHINE-unknown-solidbsd$UNAME_RELEASE + ;; + *:OS108:*:*) + GUESS=$UNAME_MACHINE-unknown-os108_$UNAME_RELEASE + ;; macppc:MirBSD:*:*) - echo powerpc-unknown-mirbsd${UNAME_RELEASE} - exit ;; + GUESS=powerpc-unknown-mirbsd$UNAME_RELEASE + ;; *:MirBSD:*:*) - echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} - exit ;; + GUESS=$UNAME_MACHINE-unknown-mirbsd$UNAME_RELEASE + ;; *:Sortix:*:*) - echo ${UNAME_MACHINE}-unknown-sortix - exit ;; + GUESS=$UNAME_MACHINE-unknown-sortix + ;; + *:Twizzler:*:*) + GUESS=$UNAME_MACHINE-unknown-twizzler + ;; + *:Redox:*:*) + GUESS=$UNAME_MACHINE-unknown-redox + ;; + mips:OSF1:*.*) + GUESS=mips-dec-osf1 + ;; alpha:OSF1:*:*) + # Reset EXIT trap before exiting to avoid spurious non-zero exit code. + trap '' 0 case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` @@ -273,7 +329,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` - case "$ALPHA_CPU_TYPE" in + case $ALPHA_CPU_TYPE in "EV4 (21064)") UNAME_MACHINE=alpha ;; "EV4.5 (21064)") @@ -310,126 +366,121 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` - # Reset EXIT trap before exiting to avoid spurious non-zero exit code. - exitcode=$? - trap '' 0 - exit $exitcode ;; - Alpha\ *:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # Should we change UNAME_MACHINE based on the output of uname instead - # of the specific Alpha model? - echo alpha-pc-interix - exit ;; - 21064:Windows_NT:50:3) - echo alpha-dec-winnt3.5 - exit ;; + OSF_REL=`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + GUESS=$UNAME_MACHINE-dec-osf$OSF_REL + ;; Amiga*:UNIX_System_V:4.0:*) - echo m68k-unknown-sysv4 - exit ;; + GUESS=m68k-unknown-sysv4 + ;; *:[Aa]miga[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-amigaos - exit ;; + GUESS=$UNAME_MACHINE-unknown-amigaos + ;; *:[Mm]orph[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-morphos - exit ;; + GUESS=$UNAME_MACHINE-unknown-morphos + ;; *:OS/390:*:*) - echo i370-ibm-openedition - exit ;; + GUESS=i370-ibm-openedition + ;; *:z/VM:*:*) - echo s390-ibm-zvmoe - exit ;; + GUESS=s390-ibm-zvmoe + ;; *:OS400:*:*) - echo powerpc-ibm-os400 - exit ;; + GUESS=powerpc-ibm-os400 + ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - echo arm-acorn-riscix${UNAME_RELEASE} - exit ;; + GUESS=arm-acorn-riscix$UNAME_RELEASE + ;; arm*:riscos:*:*|arm*:RISCOS:*:*) - echo arm-unknown-riscos - exit ;; + GUESS=arm-unknown-riscos + ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) - echo hppa1.1-hitachi-hiuxmpp - exit ;; + GUESS=hppa1.1-hitachi-hiuxmpp + ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. - if test "`(/bin/universe) 2>/dev/null`" = att ; then - echo pyramid-pyramid-sysv3 - else - echo pyramid-pyramid-bsd - fi - exit ;; + case `(/bin/universe) 2>/dev/null` in + att) GUESS=pyramid-pyramid-sysv3 ;; + *) GUESS=pyramid-pyramid-bsd ;; + esac + ;; NILE*:*:*:dcosx) - echo pyramid-pyramid-svr4 - exit ;; + GUESS=pyramid-pyramid-svr4 + ;; DRS?6000:unix:4.0:6*) - echo sparc-icl-nx6 - exit ;; + GUESS=sparc-icl-nx6 + ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in - sparc) echo sparc-icl-nx7; exit ;; - esac ;; + sparc) GUESS=sparc-icl-nx7 ;; + esac + ;; s390x:SunOS:*:*) - echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=$UNAME_MACHINE-ibm-solaris2$SUN_REL + ;; sun4H:SunOS:5.*:*) - echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=sparc-hal-solaris2$SUN_REL + ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=sparc-sun-solaris2$SUN_REL + ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) - echo i386-pc-auroraux${UNAME_RELEASE} - exit ;; + GUESS=i386-pc-auroraux$UNAME_RELEASE + ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) - eval $set_cc_for_build + set_cc_for_build SUN_ARCH=i386 # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. - if [ "$CC_FOR_BUILD" != no_compiler_found ]; then + if test "$CC_FOR_BUILD" != no_compiler_found; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + (CCOPTS="" $CC_FOR_BUILD -m64 -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH=x86_64 fi fi - echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=$SUN_ARCH-pc-solaris2$SUN_REL + ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. - echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=sparc-sun-solaris3$SUN_REL + ;; sun4*:SunOS:*:*) - case "`/usr/bin/arch -k`" in + case `/usr/bin/arch -k` in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. - echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` - exit ;; + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/'` + GUESS=sparc-sun-sunos$SUN_REL + ;; sun3*:SunOS:*:*) - echo m68k-sun-sunos${UNAME_RELEASE} - exit ;; + GUESS=m68k-sun-sunos$UNAME_RELEASE + ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` - test "x${UNAME_RELEASE}" = x && UNAME_RELEASE=3 - case "`/bin/arch`" in + test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 + case `/bin/arch` in sun3) - echo m68k-sun-sunos${UNAME_RELEASE} + GUESS=m68k-sun-sunos$UNAME_RELEASE ;; sun4) - echo sparc-sun-sunos${UNAME_RELEASE} + GUESS=sparc-sun-sunos$UNAME_RELEASE ;; esac - exit ;; + ;; aushp:SunOS:*:*) - echo sparc-auspex-sunos${UNAME_RELEASE} - exit ;; + GUESS=sparc-auspex-sunos$UNAME_RELEASE + ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor @@ -439,44 +490,44 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit ;; + GUESS=m68k-atari-mint$UNAME_RELEASE + ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit ;; + GUESS=m68k-atari-mint$UNAME_RELEASE + ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit ;; + GUESS=m68k-atari-mint$UNAME_RELEASE + ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} - exit ;; + GUESS=m68k-milan-mint$UNAME_RELEASE + ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} - exit ;; + GUESS=m68k-hades-mint$UNAME_RELEASE + ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${UNAME_RELEASE} - exit ;; + GUESS=m68k-unknown-mint$UNAME_RELEASE + ;; m68k:machten:*:*) - echo m68k-apple-machten${UNAME_RELEASE} - exit ;; + GUESS=m68k-apple-machten$UNAME_RELEASE + ;; powerpc:machten:*:*) - echo powerpc-apple-machten${UNAME_RELEASE} - exit ;; + GUESS=powerpc-apple-machten$UNAME_RELEASE + ;; RISC*:Mach:*:*) - echo mips-dec-mach_bsd4.3 - exit ;; + GUESS=mips-dec-mach_bsd4.3 + ;; RISC*:ULTRIX:*:*) - echo mips-dec-ultrix${UNAME_RELEASE} - exit ;; + GUESS=mips-dec-ultrix$UNAME_RELEASE + ;; VAX*:ULTRIX*:*:*) - echo vax-dec-ultrix${UNAME_RELEASE} - exit ;; + GUESS=vax-dec-ultrix$UNAME_RELEASE + ;; 2020:CLIX:*:* | 2430:CLIX:*:*) - echo clipper-intergraph-clix${UNAME_RELEASE} - exit ;; + GUESS=clipper-intergraph-clix$UNAME_RELEASE + ;; mips:*:*:UMIPS | mips:*:*:RISCos) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { @@ -485,95 +536,96 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) - printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) - printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) - printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF - $CC_FOR_BUILD -o $dummy $dummy.c && - dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && - SYSTEM_NAME=`$dummy $dummyarg` && + $CC_FOR_BUILD -o "$dummy" "$dummy.c" && + dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`"$dummy" "$dummyarg"` && { echo "$SYSTEM_NAME"; exit; } - echo mips-mips-riscos${UNAME_RELEASE} - exit ;; + GUESS=mips-mips-riscos$UNAME_RELEASE + ;; Motorola:PowerMAX_OS:*:*) - echo powerpc-motorola-powermax - exit ;; + GUESS=powerpc-motorola-powermax + ;; Motorola:*:4.3:PL8-*) - echo powerpc-harris-powermax - exit ;; + GUESS=powerpc-harris-powermax + ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) - echo powerpc-harris-powermax - exit ;; + GUESS=powerpc-harris-powermax + ;; Night_Hawk:Power_UNIX:*:*) - echo powerpc-harris-powerunix - exit ;; + GUESS=powerpc-harris-powerunix + ;; m88k:CX/UX:7*:*) - echo m88k-harris-cxux7 - exit ;; + GUESS=m88k-harris-cxux7 + ;; m88k:*:4*:R4*) - echo m88k-motorola-sysv4 - exit ;; + GUESS=m88k-motorola-sysv4 + ;; m88k:*:3*:R3*) - echo m88k-motorola-sysv3 - exit ;; + GUESS=m88k-motorola-sysv3 + ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` - if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110 then - if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ - [ ${TARGET_BINARY_INTERFACE}x = x ] + if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \ + test "$TARGET_BINARY_INTERFACE"x = x then - echo m88k-dg-dgux${UNAME_RELEASE} + GUESS=m88k-dg-dgux$UNAME_RELEASE else - echo m88k-dg-dguxbcs${UNAME_RELEASE} + GUESS=m88k-dg-dguxbcs$UNAME_RELEASE fi else - echo i586-dg-dgux${UNAME_RELEASE} + GUESS=i586-dg-dgux$UNAME_RELEASE fi - exit ;; + ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) - echo m88k-dolphin-sysv3 - exit ;; + GUESS=m88k-dolphin-sysv3 + ;; M88*:*:R3*:*) # Delta 88k system running SVR3 - echo m88k-motorola-sysv3 - exit ;; + GUESS=m88k-motorola-sysv3 + ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) - echo m88k-tektronix-sysv3 - exit ;; + GUESS=m88k-tektronix-sysv3 + ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) - echo m68k-tektronix-bsd - exit ;; + GUESS=m68k-tektronix-bsd + ;; *:IRIX*:*:*) - echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` - exit ;; + IRIX_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/g'` + GUESS=mips-sgi-irix$IRIX_REL + ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. - echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id - exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + GUESS=romp-ibm-aix # uname -m gives an 8 hex-code CPU id + ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) - echo i386-ibm-aix - exit ;; + GUESS=i386-ibm-aix + ;; ia64:AIX:*:*) - if [ -x /usr/bin/oslevel ] ; then + if test -x /usr/bin/oslevel ; then IBM_REV=`/usr/bin/oslevel` else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + IBM_REV=$UNAME_VERSION.$UNAME_RELEASE fi - echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} - exit ;; + GUESS=$UNAME_MACHINE-ibm-aix$IBM_REV + ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" #include main() @@ -584,77 +636,77 @@ EOF exit(0); } EOF - if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` + if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` then - echo "$SYSTEM_NAME" + GUESS=$SYSTEM_NAME else - echo rs6000-ibm-aix3.2.5 + GUESS=rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then - echo rs6000-ibm-aix3.2.4 + GUESS=rs6000-ibm-aix3.2.4 else - echo rs6000-ibm-aix3.2 + GUESS=rs6000-ibm-aix3.2 fi - exit ;; + ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` - if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi - if [ -x /usr/bin/lslpp ] ; then - IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | + if test -x /usr/bin/lslpp ; then + IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | \ awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + IBM_REV=$UNAME_VERSION.$UNAME_RELEASE fi - echo ${IBM_ARCH}-ibm-aix${IBM_REV} - exit ;; + GUESS=$IBM_ARCH-ibm-aix$IBM_REV + ;; *:AIX:*:*) - echo rs6000-ibm-aix - exit ;; - ibmrt:4.4BSD:*|romp-ibm:BSD:*) - echo romp-ibm-bsd4.4 - exit ;; + GUESS=rs6000-ibm-aix + ;; + ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) + GUESS=romp-ibm-bsd4.4 + ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and - echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to - exit ;; # report: romp-ibm BSD 4.3 + GUESS=romp-ibm-bsd$UNAME_RELEASE # 4.3 with uname added to + ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) - echo rs6000-bull-bosx - exit ;; + GUESS=rs6000-bull-bosx + ;; DPX/2?00:B.O.S.:*:*) - echo m68k-bull-sysv3 - exit ;; + GUESS=m68k-bull-sysv3 + ;; 9000/[34]??:4.3bsd:1.*:*) - echo m68k-hp-bsd - exit ;; + GUESS=m68k-hp-bsd + ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) - echo m68k-hp-bsd4.4 - exit ;; + GUESS=m68k-hp-bsd4.4 + ;; 9000/[34678]??:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - case "${UNAME_MACHINE}" in - 9000/31? ) HP_ARCH=m68000 ;; - 9000/[34]?? ) HP_ARCH=m68k ;; + HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'` + case $UNAME_MACHINE in + 9000/31?) HP_ARCH=m68000 ;; + 9000/[34]??) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) - if [ -x /usr/bin/getconf ]; then + if test -x /usr/bin/getconf; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` - case "${sc_cpu_version}" in + case $sc_cpu_version in 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 - case "${sc_kernel_bits}" in + case $sc_kernel_bits in 32) HP_ARCH=hppa2.0n ;; 64) HP_ARCH=hppa2.0w ;; '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 esac ;; esac fi - if [ "${HP_ARCH}" = "" ]; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + if test "$HP_ARCH" = ""; then + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" #define _HPUX_SOURCE #include @@ -687,13 +739,13 @@ EOF exit (0); } EOF - (CCOPTS="" $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac - if [ ${HP_ARCH} = hppa2.0w ] + if test "$HP_ARCH" = hppa2.0w then - eval $set_cc_for_build + set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler @@ -712,15 +764,15 @@ EOF HP_ARCH=hppa64 fi fi - echo ${HP_ARCH}-hp-hpux${HPUX_REV} - exit ;; + GUESS=$HP_ARCH-hp-hpux$HPUX_REV + ;; ia64:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - echo ia64-hp-hpux${HPUX_REV} - exit ;; + HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'` + GUESS=ia64-hp-hpux$HPUX_REV + ;; 3050*:HI-UX:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" #include int main () @@ -745,38 +797,38 @@ EOF exit (0); } EOF - $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` && { echo "$SYSTEM_NAME"; exit; } - echo unknown-hitachi-hiuxwe2 - exit ;; - 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) - echo hppa1.1-hp-bsd - exit ;; + GUESS=unknown-hitachi-hiuxwe2 + ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) + GUESS=hppa1.1-hp-bsd + ;; 9000/8??:4.3bsd:*:*) - echo hppa1.0-hp-bsd - exit ;; + GUESS=hppa1.0-hp-bsd + ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) - echo hppa1.0-hp-mpeix - exit ;; - hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) - echo hppa1.1-hp-osf - exit ;; + GUESS=hppa1.0-hp-mpeix + ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) + GUESS=hppa1.1-hp-osf + ;; hp8??:OSF1:*:*) - echo hppa1.0-hp-osf - exit ;; + GUESS=hppa1.0-hp-osf + ;; i*86:OSF1:*:*) - if [ -x /usr/sbin/sysversion ] ; then - echo ${UNAME_MACHINE}-unknown-osf1mk + if test -x /usr/sbin/sysversion ; then + GUESS=$UNAME_MACHINE-unknown-osf1mk else - echo ${UNAME_MACHINE}-unknown-osf1 + GUESS=$UNAME_MACHINE-unknown-osf1 fi - exit ;; + ;; parisc*:Lites*:*:*) - echo hppa1.1-hp-lites - exit ;; + GUESS=hppa1.1-hp-lites + ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) - echo c1-convex-bsd - exit ;; + GUESS=c1-convex-bsd + ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd @@ -784,139 +836,148 @@ EOF fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) - echo c34-convex-bsd - exit ;; + GUESS=c34-convex-bsd + ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) - echo c38-convex-bsd - exit ;; + GUESS=c38-convex-bsd + ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) - echo c4-convex-bsd - exit ;; + GUESS=c4-convex-bsd + ;; CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=ymp-cray-unicos$CRAY_REL + ;; CRAY*[A-Z]90:*:*:*) - echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) - echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=t90-cray-unicos$CRAY_REL + ;; CRAY*T3E:*:*:*) - echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=alphaev5-cray-unicosmk$CRAY_REL + ;; CRAY*SV1:*:*:*) - echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=sv1-cray-unicos$CRAY_REL + ;; *:UNICOS/mp:*:*) - echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=craynv-cray-unicosmp$CRAY_REL + ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` - echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; + FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'` + GUESS=${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} + ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` - echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; + FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` + GUESS=sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} + ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) - echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} - exit ;; + GUESS=$UNAME_MACHINE-pc-bsdi$UNAME_RELEASE + ;; sparc*:BSD/OS:*:*) - echo sparc-unknown-bsdi${UNAME_RELEASE} - exit ;; + GUESS=sparc-unknown-bsdi$UNAME_RELEASE + ;; *:BSD/OS:*:*) - echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} - exit ;; + GUESS=$UNAME_MACHINE-unknown-bsdi$UNAME_RELEASE + ;; + arm:FreeBSD:*:*) + UNAME_PROCESSOR=`uname -p` + set_cc_for_build + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabi + else + FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabihf + fi + ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` - case ${UNAME_PROCESSOR} in + case $UNAME_PROCESSOR in amd64) - echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; - *) - echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + UNAME_PROCESSOR=x86_64 ;; + i386) + UNAME_PROCESSOR=i586 ;; esac - exit ;; + FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL + ;; i*:CYGWIN*:*) - echo ${UNAME_MACHINE}-pc-cygwin - exit ;; + GUESS=$UNAME_MACHINE-pc-cygwin + ;; *:MINGW64*:*) - echo ${UNAME_MACHINE}-pc-mingw64 - exit ;; + GUESS=$UNAME_MACHINE-pc-mingw64 + ;; *:MINGW*:*) - echo ${UNAME_MACHINE}-pc-mingw32 - exit ;; + GUESS=$UNAME_MACHINE-pc-mingw32 + ;; *:MSYS*:*) - echo ${UNAME_MACHINE}-pc-msys - exit ;; - i*:windows32*:*) - # uname -m includes "-pc" on this system. - echo ${UNAME_MACHINE}-mingw32 - exit ;; + GUESS=$UNAME_MACHINE-pc-msys + ;; i*:PW*:*) - echo ${UNAME_MACHINE}-pc-pw32 - exit ;; + GUESS=$UNAME_MACHINE-pc-pw32 + ;; + *:SerenityOS:*:*) + GUESS=$UNAME_MACHINE-pc-serenity + ;; *:Interix*:*) - case ${UNAME_MACHINE} in + case $UNAME_MACHINE in x86) - echo i586-pc-interix${UNAME_RELEASE} - exit ;; + GUESS=i586-pc-interix$UNAME_RELEASE + ;; authenticamd | genuineintel | EM64T) - echo x86_64-unknown-interix${UNAME_RELEASE} - exit ;; + GUESS=x86_64-unknown-interix$UNAME_RELEASE + ;; IA64) - echo ia64-unknown-interix${UNAME_RELEASE} - exit ;; + GUESS=ia64-unknown-interix$UNAME_RELEASE + ;; esac ;; - [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) - echo i${UNAME_MACHINE}-pc-mks - exit ;; - 8664:Windows_NT:*) - echo x86_64-pc-mks - exit ;; - i*:Windows_NT*:* | Pentium*:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we - # UNAME_MACHINE based on the output of uname instead of i386? - echo i586-pc-interix - exit ;; i*:UWIN*:*) - echo ${UNAME_MACHINE}-pc-uwin - exit ;; + GUESS=$UNAME_MACHINE-pc-uwin + ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) - echo x86_64-unknown-cygwin - exit ;; - p*:CYGWIN*:*) - echo powerpcle-unknown-cygwin - exit ;; + GUESS=x86_64-pc-cygwin + ;; prep*:SunOS:5.*:*) - echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=powerpcle-unknown-solaris2$SUN_REL + ;; *:GNU:*:*) # the GNU system - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` - exit ;; + GNU_ARCH=`echo "$UNAME_MACHINE" | sed -e 's,[-/].*$,,'` + GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's,/.*$,,'` + GUESS=$GNU_ARCH-unknown-$LIBC$GNU_REL + ;; *:GNU/*:*:*) # other systems with GNU libc and userland - echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} - exit ;; - i*86:Minix:*:*) - echo ${UNAME_MACHINE}-pc-minix - exit ;; + GNU_SYS=`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"` + GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC + ;; + *:Minix:*:*) + GUESS=$UNAME_MACHINE-unknown-minix + ;; aarch64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; alpha:Linux:*:*) - case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; @@ -927,183 +988,225 @@ EOF esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC=gnulibc1 ; fi - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - arc:Linux:*:* | arceb:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + arc:Linux:*:* | arceb:Linux:*:* | arc32:Linux:*:* | arc64:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; arm*:Linux:*:*) - eval $set_cc_for_build + set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then - echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi + GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabi else - echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf + GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabihf fi fi - exit ;; + ;; avr32*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; cris:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-axis-linux-$LIBC + ;; crisv32:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-axis-linux-$LIBC + ;; e2k:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; frv:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; hexagon:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; i*86:Linux:*:*) - echo ${UNAME_MACHINE}-pc-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-pc-linux-$LIBC + ;; ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; k1om:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + loongarch32:Linux:*:* | loongarch64:Linux:*:* | loongarchx32:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; m32r*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; mips:Linux:*:* | mips64:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + set_cc_for_build + IS_GLIBC=0 + test x"${LIBC}" = xgnu && IS_GLIBC=1 + sed 's/^ //' << EOF > "$dummy.c" #undef CPU - #undef ${UNAME_MACHINE} - #undef ${UNAME_MACHINE}el + #undef mips + #undef mipsel + #undef mips64 + #undef mips64el + #if ${IS_GLIBC} && defined(_ABI64) + LIBCABI=gnuabi64 + #else + #if ${IS_GLIBC} && defined(_ABIN32) + LIBCABI=gnuabin32 + #else + LIBCABI=${LIBC} + #endif + #endif + + #if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 + CPU=mipsisa64r6 + #else + #if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 + CPU=mipsisa32r6 + #else + #if defined(__mips64) + CPU=mips64 + #else + CPU=mips + #endif + #endif + #endif + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=${UNAME_MACHINE}el + MIPS_ENDIAN=el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=${UNAME_MACHINE} + MIPS_ENDIAN= #else - CPU= + MIPS_ENDIAN= #endif #endif EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } + cc_set_vars=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'` + eval "$cc_set_vars" + test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; } ;; mips64el:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; openrisc*:Linux:*:*) - echo or1k-unknown-linux-${LIBC} - exit ;; + GUESS=or1k-unknown-linux-$LIBC + ;; or32:Linux:*:* | or1k*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; padre:Linux:*:*) - echo sparc-unknown-linux-${LIBC} - exit ;; + GUESS=sparc-unknown-linux-$LIBC + ;; parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-${LIBC} - exit ;; + GUESS=hppa64-unknown-linux-$LIBC + ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; - PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; - *) echo hppa-unknown-linux-${LIBC} ;; + PA7*) GUESS=hppa1.1-unknown-linux-$LIBC ;; + PA8*) GUESS=hppa2.0-unknown-linux-$LIBC ;; + *) GUESS=hppa-unknown-linux-$LIBC ;; esac - exit ;; + ;; ppc64:Linux:*:*) - echo powerpc64-unknown-linux-${LIBC} - exit ;; + GUESS=powerpc64-unknown-linux-$LIBC + ;; ppc:Linux:*:*) - echo powerpc-unknown-linux-${LIBC} - exit ;; + GUESS=powerpc-unknown-linux-$LIBC + ;; ppc64le:Linux:*:*) - echo powerpc64le-unknown-linux-${LIBC} - exit ;; + GUESS=powerpc64le-unknown-linux-$LIBC + ;; ppcle:Linux:*:*) - echo powerpcle-unknown-linux-${LIBC} - exit ;; - riscv32:Linux:*:* | riscv64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=powerpcle-unknown-linux-$LIBC + ;; + riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-ibm-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-ibm-linux-$LIBC + ;; sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; sh*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; sparc:Linux:*:* | sparc64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; tile*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; vax:Linux:*:*) - echo ${UNAME_MACHINE}-dec-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-dec-linux-$LIBC + ;; x86_64:Linux:*:*) - echo ${UNAME_MACHINE}-pc-linux-${LIBC} - exit ;; + set_cc_for_build + LIBCABI=$LIBC + if test "$CC_FOR_BUILD" != no_compiler_found; then + if (echo '#ifdef __ILP32__'; echo IS_X32; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_X32 >/dev/null + then + LIBCABI=${LIBC}x32 + fi + fi + GUESS=$UNAME_MACHINE-pc-linux-$LIBCABI + ;; xtensa*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. - echo i386-sequent-sysv4 - exit ;; + GUESS=i386-sequent-sysv4 + ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. - echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} - exit ;; + GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION + ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. - echo ${UNAME_MACHINE}-pc-os2-emx - exit ;; + GUESS=$UNAME_MACHINE-pc-os2-emx + ;; i*86:XTS-300:*:STOP) - echo ${UNAME_MACHINE}-unknown-stop - exit ;; + GUESS=$UNAME_MACHINE-unknown-stop + ;; i*86:atheos:*:*) - echo ${UNAME_MACHINE}-unknown-atheos - exit ;; + GUESS=$UNAME_MACHINE-unknown-atheos + ;; i*86:syllable:*:*) - echo ${UNAME_MACHINE}-pc-syllable - exit ;; + GUESS=$UNAME_MACHINE-pc-syllable + ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) - echo i386-unknown-lynxos${UNAME_RELEASE} - exit ;; + GUESS=i386-unknown-lynxos$UNAME_RELEASE + ;; i*86:*DOS:*:*) - echo ${UNAME_MACHINE}-pc-msdosdjgpp - exit ;; - i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) - UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + GUESS=$UNAME_MACHINE-pc-msdosdjgpp + ;; + i*86:*:4.*:*) + UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then - echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + GUESS=$UNAME_MACHINE-univel-sysv$UNAME_REL else - echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + GUESS=$UNAME_MACHINE-pc-sysv$UNAME_REL fi - exit ;; + ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in @@ -1111,12 +1214,12 @@ EOF *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac - echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} - exit ;; + GUESS=$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 @@ -1126,11 +1229,11 @@ EOF && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 - echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + GUESS=$UNAME_MACHINE-pc-sco$UNAME_REL else - echo ${UNAME_MACHINE}-pc-sysv32 + GUESS=$UNAME_MACHINE-pc-sysv32 fi - exit ;; + ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about @@ -1138,31 +1241,31 @@ EOF # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configure will decide that # this is a cross-build. - echo i586-pc-msdosdjgpp - exit ;; + GUESS=i586-pc-msdosdjgpp + ;; Intel:Mach:3*:*) - echo i386-pc-mach3 - exit ;; + GUESS=i386-pc-mach3 + ;; paragon:*:*:*) - echo i860-intel-osf1 - exit ;; + GUESS=i860-intel-osf1 + ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then - echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + GUESS=i860-stardent-sysv$UNAME_RELEASE # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. - echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + GUESS=i860-unknown-sysv$UNAME_RELEASE # Unknown i860-SVR4 fi - exit ;; + ;; mini*:CTIX:SYS*5:*) # "miniframe" - echo m68010-convergent-sysv - exit ;; + GUESS=m68010-convergent-sysv + ;; mc68k:UNIX:SYSTEM5:3.51m) - echo m68k-convergent-sysv - exit ;; + GUESS=m68k-convergent-sysv + ;; M680?0:D-NIX:5.3:*) - echo m68k-diab-dnix - exit ;; + GUESS=m68k-diab-dnix + ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) @@ -1170,9 +1273,9 @@ EOF test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; @@ -1181,249 +1284,437 @@ EOF test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) - echo m68k-unknown-lynxos${UNAME_RELEASE} - exit ;; + GUESS=m68k-unknown-lynxos$UNAME_RELEASE + ;; mc68030:UNIX_System_V:4.*:*) - echo m68k-atari-sysv4 - exit ;; + GUESS=m68k-atari-sysv4 + ;; TSUNAMI:LynxOS:2.*:*) - echo sparc-unknown-lynxos${UNAME_RELEASE} - exit ;; + GUESS=sparc-unknown-lynxos$UNAME_RELEASE + ;; rs6000:LynxOS:2.*:*) - echo rs6000-unknown-lynxos${UNAME_RELEASE} - exit ;; + GUESS=rs6000-unknown-lynxos$UNAME_RELEASE + ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) - echo powerpc-unknown-lynxos${UNAME_RELEASE} - exit ;; + GUESS=powerpc-unknown-lynxos$UNAME_RELEASE + ;; SM[BE]S:UNIX_SV:*:*) - echo mips-dde-sysv${UNAME_RELEASE} - exit ;; + GUESS=mips-dde-sysv$UNAME_RELEASE + ;; RM*:ReliantUNIX-*:*:*) - echo mips-sni-sysv4 - exit ;; + GUESS=mips-sni-sysv4 + ;; RM*:SINIX-*:*:*) - echo mips-sni-sysv4 - exit ;; + GUESS=mips-sni-sysv4 + ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` - echo ${UNAME_MACHINE}-sni-sysv4 + GUESS=$UNAME_MACHINE-sni-sysv4 else - echo ns32k-sni-sysv + GUESS=ns32k-sni-sysv fi - exit ;; + ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says - echo i586-unisys-sysv4 - exit ;; + GUESS=i586-unisys-sysv4 + ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm - echo hppa1.1-stratus-sysv4 - exit ;; + GUESS=hppa1.1-stratus-sysv4 + ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. - echo i860-stratus-sysv4 - exit ;; + GUESS=i860-stratus-sysv4 + ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. - echo ${UNAME_MACHINE}-stratus-vos - exit ;; + GUESS=$UNAME_MACHINE-stratus-vos + ;; *:VOS:*:*) # From Paul.Green@stratus.com. - echo hppa1.1-stratus-vos - exit ;; + GUESS=hppa1.1-stratus-vos + ;; mc68*:A/UX:*:*) - echo m68k-apple-aux${UNAME_RELEASE} - exit ;; + GUESS=m68k-apple-aux$UNAME_RELEASE + ;; news*:NEWS-OS:6*:*) - echo mips-sony-newsos6 - exit ;; + GUESS=mips-sony-newsos6 + ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) - if [ -d /usr/nec ]; then - echo mips-nec-sysv${UNAME_RELEASE} + if test -d /usr/nec; then + GUESS=mips-nec-sysv$UNAME_RELEASE else - echo mips-unknown-sysv${UNAME_RELEASE} + GUESS=mips-unknown-sysv$UNAME_RELEASE fi - exit ;; + ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. - echo powerpc-be-beos - exit ;; + GUESS=powerpc-be-beos + ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. - echo powerpc-apple-beos - exit ;; + GUESS=powerpc-apple-beos + ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. - echo i586-pc-beos - exit ;; + GUESS=i586-pc-beos + ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. - echo i586-pc-haiku - exit ;; + GUESS=i586-pc-haiku + ;; x86_64:Haiku:*:*) - echo x86_64-unknown-haiku - exit ;; + GUESS=x86_64-unknown-haiku + ;; SX-4:SUPER-UX:*:*) - echo sx4-nec-superux${UNAME_RELEASE} - exit ;; + GUESS=sx4-nec-superux$UNAME_RELEASE + ;; SX-5:SUPER-UX:*:*) - echo sx5-nec-superux${UNAME_RELEASE} - exit ;; + GUESS=sx5-nec-superux$UNAME_RELEASE + ;; SX-6:SUPER-UX:*:*) - echo sx6-nec-superux${UNAME_RELEASE} - exit ;; + GUESS=sx6-nec-superux$UNAME_RELEASE + ;; SX-7:SUPER-UX:*:*) - echo sx7-nec-superux${UNAME_RELEASE} - exit ;; + GUESS=sx7-nec-superux$UNAME_RELEASE + ;; SX-8:SUPER-UX:*:*) - echo sx8-nec-superux${UNAME_RELEASE} - exit ;; + GUESS=sx8-nec-superux$UNAME_RELEASE + ;; SX-8R:SUPER-UX:*:*) - echo sx8r-nec-superux${UNAME_RELEASE} - exit ;; + GUESS=sx8r-nec-superux$UNAME_RELEASE + ;; SX-ACE:SUPER-UX:*:*) - echo sxace-nec-superux${UNAME_RELEASE} - exit ;; + GUESS=sxace-nec-superux$UNAME_RELEASE + ;; Power*:Rhapsody:*:*) - echo powerpc-apple-rhapsody${UNAME_RELEASE} - exit ;; + GUESS=powerpc-apple-rhapsody$UNAME_RELEASE + ;; *:Rhapsody:*:*) - echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} - exit ;; + GUESS=$UNAME_MACHINE-apple-rhapsody$UNAME_RELEASE + ;; + arm64:Darwin:*:*) + GUESS=aarch64-apple-darwin$UNAME_RELEASE + ;; *:Darwin:*:*) - UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown - eval $set_cc_for_build - if test "$UNAME_PROCESSOR" = unknown ; then - UNAME_PROCESSOR=powerpc + UNAME_PROCESSOR=`uname -p` + case $UNAME_PROCESSOR in + unknown) UNAME_PROCESSOR=powerpc ;; + esac + if command -v xcode-select > /dev/null 2> /dev/null && \ + ! xcode-select --print-path > /dev/null 2> /dev/null ; then + # Avoid executing cc if there is no toolchain installed as + # cc will be a stub that puts up a graphical alert + # prompting the user to install developer tools. + CC_FOR_BUILD=no_compiler_found + else + set_cc_for_build fi - if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then - if [ "$CC_FOR_BUILD" != no_compiler_found ]; then - if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - case $UNAME_PROCESSOR in - i386) UNAME_PROCESSOR=x86_64 ;; - powerpc) UNAME_PROCESSOR=powerpc64 ;; - esac - fi + if test "$CC_FOR_BUILD" != no_compiler_found; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + case $UNAME_PROCESSOR in + i386) UNAME_PROCESSOR=x86_64 ;; + powerpc) UNAME_PROCESSOR=powerpc64 ;; + esac + fi + # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc + if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_PPC >/dev/null + then + UNAME_PROCESSOR=powerpc fi elif test "$UNAME_PROCESSOR" = i386 ; then - # Avoid executing cc on OS X 10.9, as it ships with a stub - # that puts up a graphical alert prompting to install - # developer tools. Any system running Mac OS X 10.7 or - # later (Darwin 11 and later) is required to have a 64-bit - # processor. This is not true of the ARM version of Darwin - # that Apple uses in portable devices. - UNAME_PROCESSOR=x86_64 + # uname -m returns i386 or x86_64 + UNAME_PROCESSOR=$UNAME_MACHINE fi - echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} - exit ;; + GUESS=$UNAME_PROCESSOR-apple-darwin$UNAME_RELEASE + ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = x86; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi - echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} - exit ;; + GUESS=$UNAME_PROCESSOR-$UNAME_MACHINE-nto-qnx$UNAME_RELEASE + ;; *:QNX:*:4*) - echo i386-pc-qnx - exit ;; - NEO-?:NONSTOP_KERNEL:*:*) - echo neo-tandem-nsk${UNAME_RELEASE} - exit ;; + GUESS=i386-pc-qnx + ;; + NEO-*:NONSTOP_KERNEL:*:*) + GUESS=neo-tandem-nsk$UNAME_RELEASE + ;; NSE-*:NONSTOP_KERNEL:*:*) - echo nse-tandem-nsk${UNAME_RELEASE} - exit ;; - NSR-?:NONSTOP_KERNEL:*:*) - echo nsr-tandem-nsk${UNAME_RELEASE} - exit ;; + GUESS=nse-tandem-nsk$UNAME_RELEASE + ;; + NSR-*:NONSTOP_KERNEL:*:*) + GUESS=nsr-tandem-nsk$UNAME_RELEASE + ;; + NSV-*:NONSTOP_KERNEL:*:*) + GUESS=nsv-tandem-nsk$UNAME_RELEASE + ;; + NSX-*:NONSTOP_KERNEL:*:*) + GUESS=nsx-tandem-nsk$UNAME_RELEASE + ;; *:NonStop-UX:*:*) - echo mips-compaq-nonstopux - exit ;; + GUESS=mips-compaq-nonstopux + ;; BS2000:POSIX*:*:*) - echo bs2000-siemens-sysv - exit ;; + GUESS=bs2000-siemens-sysv + ;; DS/*:UNIX_System_V:*:*) - echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} - exit ;; + GUESS=$UNAME_MACHINE-$UNAME_SYSTEM-$UNAME_RELEASE + ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. - if test "$cputype" = 386; then + if test "${cputype-}" = 386; then UNAME_MACHINE=i386 - else - UNAME_MACHINE="$cputype" + elif test "x${cputype-}" != x; then + UNAME_MACHINE=$cputype fi - echo ${UNAME_MACHINE}-unknown-plan9 - exit ;; + GUESS=$UNAME_MACHINE-unknown-plan9 + ;; *:TOPS-10:*:*) - echo pdp10-unknown-tops10 - exit ;; + GUESS=pdp10-unknown-tops10 + ;; *:TENEX:*:*) - echo pdp10-unknown-tenex - exit ;; + GUESS=pdp10-unknown-tenex + ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) - echo pdp10-dec-tops20 - exit ;; + GUESS=pdp10-dec-tops20 + ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) - echo pdp10-xkl-tops20 - exit ;; + GUESS=pdp10-xkl-tops20 + ;; *:TOPS-20:*:*) - echo pdp10-unknown-tops20 - exit ;; + GUESS=pdp10-unknown-tops20 + ;; *:ITS:*:*) - echo pdp10-unknown-its - exit ;; + GUESS=pdp10-unknown-its + ;; SEI:*:*:SEIUX) - echo mips-sei-seiux${UNAME_RELEASE} - exit ;; + GUESS=mips-sei-seiux$UNAME_RELEASE + ;; *:DragonFly:*:*) - echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` - exit ;; + DRAGONFLY_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_MACHINE-unknown-dragonfly$DRAGONFLY_REL + ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` - case "${UNAME_MACHINE}" in - A*) echo alpha-dec-vms ; exit ;; - I*) echo ia64-dec-vms ; exit ;; - V*) echo vax-dec-vms ; exit ;; + case $UNAME_MACHINE in + A*) GUESS=alpha-dec-vms ;; + I*) GUESS=ia64-dec-vms ;; + V*) GUESS=vax-dec-vms ;; esac ;; *:XENIX:*:SysV) - echo i386-pc-xenix - exit ;; + GUESS=i386-pc-xenix + ;; i*86:skyos:*:*) - echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE} | sed -e 's/ .*$//'` - exit ;; + SKYOS_REL=`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'` + GUESS=$UNAME_MACHINE-pc-skyos$SKYOS_REL + ;; i*86:rdos:*:*) - echo ${UNAME_MACHINE}-pc-rdos - exit ;; - i*86:AROS:*:*) - echo ${UNAME_MACHINE}-pc-aros - exit ;; + GUESS=$UNAME_MACHINE-pc-rdos + ;; + i*86:Fiwix:*:*) + GUESS=$UNAME_MACHINE-pc-fiwix + ;; + *:AROS:*:*) + GUESS=$UNAME_MACHINE-unknown-aros + ;; x86_64:VMkernel:*:*) - echo ${UNAME_MACHINE}-unknown-esx - exit ;; + GUESS=$UNAME_MACHINE-unknown-esx + ;; amd64:Isilon\ OneFS:*:*) - echo x86_64-unknown-onefs - exit ;; + GUESS=x86_64-unknown-onefs + ;; + *:Unleashed:*:*) + GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE + ;; +esac + +# Do we have a guess based on uname results? +if test "x$GUESS" != x; then + echo "$GUESS" + exit +fi + +# No uname command or uname output not recognized. +set_cc_for_build +cat > "$dummy.c" < +#include +#endif +#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) +#if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) +#include +#if defined(_SIZE_T_) || defined(SIGLOST) +#include +#endif +#endif +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); +#endif + +#if defined (vax) +#if !defined (ultrix) +#include +#if defined (BSD) +#if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +#else +#if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +#else + printf ("vax-dec-bsd\n"); exit (0); +#endif +#endif +#else + printf ("vax-dec-bsd\n"); exit (0); +#endif +#else +#if defined(_SIZE_T_) || defined(SIGLOST) + struct utsname un; + uname (&un); + printf ("vax-dec-ultrix%s\n", un.release); exit (0); +#else + printf ("vax-dec-ultrix\n"); exit (0); +#endif +#endif +#endif +#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) +#if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) +#if defined(_SIZE_T_) || defined(SIGLOST) + struct utsname *un; + uname (&un); + printf ("mips-dec-ultrix%s\n", un.release); exit (0); +#else + printf ("mips-dec-ultrix\n"); exit (0); +#endif +#endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`"$dummy"` && + { echo "$SYSTEM_NAME"; exit; } + +# Apollos put the system type in the environment. +test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; } + +echo "$0: unable to guess system type" >&2 + +case $UNAME_MACHINE:$UNAME_SYSTEM in + mips:Linux | mips64:Linux) + # If we got here on MIPS GNU/Linux, output extra information. + cat >&2 <&2 <&2 </dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` -UNAME_MACHINE = ${UNAME_MACHINE} -UNAME_RELEASE = ${UNAME_RELEASE} -UNAME_SYSTEM = ${UNAME_SYSTEM} -UNAME_VERSION = ${UNAME_VERSION} +UNAME_MACHINE = "$UNAME_MACHINE" +UNAME_RELEASE = "$UNAME_RELEASE" +UNAME_SYSTEM = "$UNAME_SYSTEM" +UNAME_VERSION = "$UNAME_VERSION" EOF +fi exit 1 # Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" diff --git a/ext/libpqxx-7.7.3/config/config.sub b/ext/libpqxx-7.7.3/config/config.sub index dd2ca93..dba16e8 100755 --- a/ext/libpqxx-7.7.3/config/config.sub +++ b/ext/libpqxx-7.7.3/config/config.sub @@ -1,12 +1,14 @@ #! /bin/sh # Configuration validation subroutine script. -# Copyright 1992-2016 Free Software Foundation, Inc. +# Copyright 1992-2022 Free Software Foundation, Inc. -timestamp='2016-11-04' +# shellcheck disable=SC2006,SC2268 # see below for rationale + +timestamp='2022-01-03' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or +# the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but @@ -15,7 +17,7 @@ timestamp='2016-11-04' # General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program; if not, see . +# along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -33,7 +35,7 @@ timestamp='2016-11-04' # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub +# https://git.savannah.gnu.org/cgit/config.git/plain/config.sub # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases @@ -50,6 +52,13 @@ timestamp='2016-11-04' # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. +# The "shellcheck disable" line above the timestamp inhibits complaints +# about features and limitations of the classic Bourne shell that were +# superseded or lifted in POSIX. However, this script identifies a wide +# variety of pre-POSIX systems that do not have POSIX shells at all, and +# even some reasonably current systems (Solaris 10 as case-in-point) still +# have a pre-POSIX /bin/sh. + me=`echo "$0" | sed -e 's,.*/,,'` usage="\ @@ -57,7 +66,7 @@ Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS Canonicalize a configuration name. -Operation modes: +Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit @@ -67,7 +76,7 @@ Report bugs and patches to ." version="\ GNU config.sub ($timestamp) -Copyright 1992-2016 Free Software Foundation, Inc. +Copyright 1992-2022 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -89,12 +98,12 @@ while test $# -gt 0 ; do - ) # Use stdin as input. break ;; -* ) - echo "$me: invalid option $1$help" + echo "$me: invalid option $1$help" >&2 exit 1 ;; *local*) # First pass through any local machine types. - echo $1 + echo "$1" exit ;; * ) @@ -110,1244 +119,1186 @@ case $# in exit 1;; esac -# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). -# Here we must recognize all the valid KERNEL-OS combinations. -maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` -case $maybe_os in - nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ - linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ - knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ - kopensolaris*-gnu* | cloudabi*-eabi* | \ - storm-chaos* | os2-emx* | rtmk-nova*) - os=-$maybe_os - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` - ;; - android-linux) - os=-linux-android - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown - ;; - *) - basic_machine=`echo $1 | sed 's/-[^-]*$//'` - if [ $basic_machine != $1 ] - then os=`echo $1 | sed 's/.*-/-/'` - else os=; fi - ;; -esac +# Split fields of configuration type +# shellcheck disable=SC2162 +saved_IFS=$IFS +IFS="-" read field1 field2 field3 field4 <&2 + exit 1 ;; - -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ - -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ - -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ - -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ - -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ - -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple | -axis | -knuth | -cray | -microblaze*) - os= - basic_machine=$1 + *-*-*-*) + basic_machine=$field1-$field2 + basic_os=$field3-$field4 ;; - -bluegene*) - os=-cnk + *-*-*) + # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two + # parts + maybe_os=$field2-$field3 + case $maybe_os in + nto-qnx* | linux-* | uclinux-uclibc* \ + | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \ + | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \ + | storm-chaos* | os2-emx* | rtmk-nova*) + basic_machine=$field1 + basic_os=$maybe_os + ;; + android-linux) + basic_machine=$field1-unknown + basic_os=linux-android + ;; + *) + basic_machine=$field1-$field2 + basic_os=$field3 + ;; + esac ;; - -sim | -cisco | -oki | -wec | -winbond) - os= - basic_machine=$1 + *-*) + # A lone config we happen to match not fitting any pattern + case $field1-$field2 in + decstation-3100) + basic_machine=mips-dec + basic_os= + ;; + *-*) + # Second component is usually, but not always the OS + case $field2 in + # Prevent following clause from handling this valid os + sun*os*) + basic_machine=$field1 + basic_os=$field2 + ;; + zephyr*) + basic_machine=$field1-unknown + basic_os=$field2 + ;; + # Manufacturers + dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \ + | att* | 7300* | 3300* | delta* | motorola* | sun[234]* \ + | unicom* | ibm* | next | hp | isi* | apollo | altos* \ + | convergent* | ncr* | news | 32* | 3600* | 3100* \ + | hitachi* | c[123]* | convex* | sun | crds | omron* | dg \ + | ultra | tti* | harris | dolphin | highlevel | gould \ + | cbm | ns | masscomp | apple | axis | knuth | cray \ + | microblaze* | sim | cisco \ + | oki | wec | wrs | winbond) + basic_machine=$field1-$field2 + basic_os= + ;; + *) + basic_machine=$field1 + basic_os=$field2 + ;; + esac + ;; + esac ;; - -scout) - ;; - -wrs) - os=-vxworks - basic_machine=$1 - ;; - -chorusos*) - os=-chorusos - basic_machine=$1 - ;; - -chorusrdb) - os=-chorusrdb - basic_machine=$1 - ;; - -hiux*) - os=-hiuxwe2 - ;; - -sco6) - os=-sco5v6 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco5) - os=-sco3.2v5 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco4) - os=-sco3.2v4 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2.[4-9]*) - os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2v[4-9]*) - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco5v6*) - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco*) - os=-sco3.2v2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -udk*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -isc) - os=-isc2.2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -clix*) - basic_machine=clipper-intergraph - ;; - -isc*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -lynx*178) - os=-lynxos178 - ;; - -lynx*5) - os=-lynxos5 - ;; - -lynx*) - os=-lynxos - ;; - -ptx*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` - ;; - -windowsnt*) - os=`echo $os | sed -e 's/windowsnt/winnt/'` - ;; - -psos*) - os=-psos - ;; - -mint | -mint[0-9]*) - basic_machine=m68k-atari - os=-mint + *) + # Convert single-component short-hands not valid as part of + # multi-component configurations. + case $field1 in + 386bsd) + basic_machine=i386-pc + basic_os=bsd + ;; + a29khif) + basic_machine=a29k-amd + basic_os=udi + ;; + adobe68k) + basic_machine=m68010-adobe + basic_os=scout + ;; + alliant) + basic_machine=fx80-alliant + basic_os= + ;; + altos | altos3068) + basic_machine=m68k-altos + basic_os= + ;; + am29k) + basic_machine=a29k-none + basic_os=bsd + ;; + amdahl) + basic_machine=580-amdahl + basic_os=sysv + ;; + amiga) + basic_machine=m68k-unknown + basic_os= + ;; + amigaos | amigados) + basic_machine=m68k-unknown + basic_os=amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + basic_os=sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + basic_os=sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + basic_os=bsd + ;; + aros) + basic_machine=i386-pc + basic_os=aros + ;; + aux) + basic_machine=m68k-apple + basic_os=aux + ;; + balance) + basic_machine=ns32k-sequent + basic_os=dynix + ;; + blackfin) + basic_machine=bfin-unknown + basic_os=linux + ;; + cegcc) + basic_machine=arm-unknown + basic_os=cegcc + ;; + convex-c1) + basic_machine=c1-convex + basic_os=bsd + ;; + convex-c2) + basic_machine=c2-convex + basic_os=bsd + ;; + convex-c32) + basic_machine=c32-convex + basic_os=bsd + ;; + convex-c34) + basic_machine=c34-convex + basic_os=bsd + ;; + convex-c38) + basic_machine=c38-convex + basic_os=bsd + ;; + cray) + basic_machine=j90-cray + basic_os=unicos + ;; + crds | unos) + basic_machine=m68k-crds + basic_os= + ;; + da30) + basic_machine=m68k-da30 + basic_os= + ;; + decstation | pmax | pmin | dec3100 | decstatn) + basic_machine=mips-dec + basic_os= + ;; + delta88) + basic_machine=m88k-motorola + basic_os=sysv3 + ;; + dicos) + basic_machine=i686-pc + basic_os=dicos + ;; + djgpp) + basic_machine=i586-pc + basic_os=msdosdjgpp + ;; + ebmon29k) + basic_machine=a29k-amd + basic_os=ebmon + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + basic_os=ose + ;; + gmicro) + basic_machine=tron-gmicro + basic_os=sysv + ;; + go32) + basic_machine=i386-pc + basic_os=go32 + ;; + h8300hms) + basic_machine=h8300-hitachi + basic_os=hms + ;; + h8300xray) + basic_machine=h8300-hitachi + basic_os=xray + ;; + h8500hms) + basic_machine=h8500-hitachi + basic_os=hms + ;; + harris) + basic_machine=m88k-harris + basic_os=sysv3 + ;; + hp300 | hp300hpux) + basic_machine=m68k-hp + basic_os=hpux + ;; + hp300bsd) + basic_machine=m68k-hp + basic_os=bsd + ;; + hppaosf) + basic_machine=hppa1.1-hp + basic_os=osf + ;; + hppro) + basic_machine=hppa1.1-hp + basic_os=proelf + ;; + i386mach) + basic_machine=i386-mach + basic_os=mach + ;; + isi68 | isi) + basic_machine=m68k-isi + basic_os=sysv + ;; + m68knommu) + basic_machine=m68k-unknown + basic_os=linux + ;; + magnum | m3230) + basic_machine=mips-mips + basic_os=sysv + ;; + merlin) + basic_machine=ns32k-utek + basic_os=sysv + ;; + mingw64) + basic_machine=x86_64-pc + basic_os=mingw64 + ;; + mingw32) + basic_machine=i686-pc + basic_os=mingw32 + ;; + mingw32ce) + basic_machine=arm-unknown + basic_os=mingw32ce + ;; + monitor) + basic_machine=m68k-rom68k + basic_os=coff + ;; + morphos) + basic_machine=powerpc-unknown + basic_os=morphos + ;; + moxiebox) + basic_machine=moxie-unknown + basic_os=moxiebox + ;; + msdos) + basic_machine=i386-pc + basic_os=msdos + ;; + msys) + basic_machine=i686-pc + basic_os=msys + ;; + mvs) + basic_machine=i370-ibm + basic_os=mvs + ;; + nacl) + basic_machine=le32-unknown + basic_os=nacl + ;; + ncr3000) + basic_machine=i486-ncr + basic_os=sysv4 + ;; + netbsd386) + basic_machine=i386-pc + basic_os=netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + basic_os=linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + basic_os=newsos + ;; + news1000) + basic_machine=m68030-sony + basic_os=newsos + ;; + necv70) + basic_machine=v70-nec + basic_os=sysv + ;; + nh3000) + basic_machine=m68k-harris + basic_os=cxux + ;; + nh[45]000) + basic_machine=m88k-harris + basic_os=cxux + ;; + nindy960) + basic_machine=i960-intel + basic_os=nindy + ;; + mon960) + basic_machine=i960-intel + basic_os=mon960 + ;; + nonstopux) + basic_machine=mips-compaq + basic_os=nonstopux + ;; + os400) + basic_machine=powerpc-ibm + basic_os=os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + basic_os=ose + ;; + os68k) + basic_machine=m68k-none + basic_os=os68k + ;; + paragon) + basic_machine=i860-intel + basic_os=osf + ;; + parisc) + basic_machine=hppa-unknown + basic_os=linux + ;; + psp) + basic_machine=mipsallegrexel-sony + basic_os=psp + ;; + pw32) + basic_machine=i586-unknown + basic_os=pw32 + ;; + rdos | rdos64) + basic_machine=x86_64-pc + basic_os=rdos + ;; + rdos32) + basic_machine=i386-pc + basic_os=rdos + ;; + rom68k) + basic_machine=m68k-rom68k + basic_os=coff + ;; + sa29200) + basic_machine=a29k-amd + basic_os=udi + ;; + sei) + basic_machine=mips-sei + basic_os=seiux + ;; + sequent) + basic_machine=i386-sequent + basic_os= + ;; + sps7) + basic_machine=m68k-bull + basic_os=sysv2 + ;; + st2000) + basic_machine=m68k-tandem + basic_os= + ;; + stratus) + basic_machine=i860-stratus + basic_os=sysv4 + ;; + sun2) + basic_machine=m68000-sun + basic_os= + ;; + sun2os3) + basic_machine=m68000-sun + basic_os=sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + basic_os=sunos4 + ;; + sun3) + basic_machine=m68k-sun + basic_os= + ;; + sun3os3) + basic_machine=m68k-sun + basic_os=sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + basic_os=sunos4 + ;; + sun4) + basic_machine=sparc-sun + basic_os= + ;; + sun4os3) + basic_machine=sparc-sun + basic_os=sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + basic_os=sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + basic_os=solaris2 + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + basic_os= + ;; + sv1) + basic_machine=sv1-cray + basic_os=unicos + ;; + symmetry) + basic_machine=i386-sequent + basic_os=dynix + ;; + t3e) + basic_machine=alphaev5-cray + basic_os=unicos + ;; + t90) + basic_machine=t90-cray + basic_os=unicos + ;; + toad1) + basic_machine=pdp10-xkl + basic_os=tops20 + ;; + tpf) + basic_machine=s390x-ibm + basic_os=tpf + ;; + udi29k) + basic_machine=a29k-amd + basic_os=udi + ;; + ultra3) + basic_machine=a29k-nyu + basic_os=sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + basic_os=none + ;; + vaxv) + basic_machine=vax-dec + basic_os=sysv + ;; + vms) + basic_machine=vax-dec + basic_os=vms + ;; + vsta) + basic_machine=i386-pc + basic_os=vsta + ;; + vxworks960) + basic_machine=i960-wrs + basic_os=vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + basic_os=vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + basic_os=vxworks + ;; + xbox) + basic_machine=i686-pc + basic_os=mingw32 + ;; + ymp) + basic_machine=ymp-cray + basic_os=unicos + ;; + *) + basic_machine=$1 + basic_os= + ;; + esac ;; esac -# Decode aliases for certain CPU-COMPANY combinations. +# Decode 1-component or ad-hoc basic machines case $basic_machine in - # Recognize the basic CPU types without company name. - # Some are omitted here because they have special meanings below. - 1750a | 580 \ - | a29k \ - | aarch64 | aarch64_be \ - | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ - | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ - | am33_2.0 \ - | arc | arceb \ - | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ - | avr | avr32 \ - | ba \ - | be32 | be64 \ - | bfin \ - | c4x | c8051 | clipper \ - | d10v | d30v | dlx | dsp16xx \ - | e2k | epiphany \ - | fido | fr30 | frv | ft32 \ - | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ - | hexagon \ - | i370 | i860 | i960 | ia64 \ - | ip2k | iq2000 \ - | k1om \ - | le32 | le64 \ - | lm32 \ - | m32c | m32r | m32rle | m68000 | m68k | m88k \ - | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ - | mips | mipsbe | mipseb | mipsel | mipsle \ - | mips16 \ - | mips64 | mips64el \ - | mips64octeon | mips64octeonel \ - | mips64orion | mips64orionel \ - | mips64r5900 | mips64r5900el \ - | mips64vr | mips64vrel \ - | mips64vr4100 | mips64vr4100el \ - | mips64vr4300 | mips64vr4300el \ - | mips64vr5000 | mips64vr5000el \ - | mips64vr5900 | mips64vr5900el \ - | mipsisa32 | mipsisa32el \ - | mipsisa32r2 | mipsisa32r2el \ - | mipsisa32r6 | mipsisa32r6el \ - | mipsisa64 | mipsisa64el \ - | mipsisa64r2 | mipsisa64r2el \ - | mipsisa64r6 | mipsisa64r6el \ - | mipsisa64sb1 | mipsisa64sb1el \ - | mipsisa64sr71k | mipsisa64sr71kel \ - | mipsr5900 | mipsr5900el \ - | mipstx39 | mipstx39el \ - | mn10200 | mn10300 \ - | moxie \ - | mt \ - | msp430 \ - | nds32 | nds32le | nds32be \ - | nios | nios2 | nios2eb | nios2el \ - | ns16k | ns32k \ - | open8 | or1k | or1knd | or32 \ - | pdp10 | pdp11 | pj | pjl \ - | powerpc | powerpc64 | powerpc64le | powerpcle \ - | pru \ - | pyramid \ - | riscv32 | riscv64 \ - | rl78 | rx \ - | score \ - | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ - | sh64 | sh64le \ - | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ - | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ - | spu \ - | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ - | ubicom32 \ - | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ - | visium \ - | we32k \ - | x86 | xc16x | xstormy16 | xtensa \ - | z8k | z80) - basic_machine=$basic_machine-unknown + # Here we handle the default manufacturer of certain CPU types. It is in + # some cases the only manufacturer, in others, it is the most popular. + w89k) + cpu=hppa1.1 + vendor=winbond ;; - c54x) - basic_machine=tic54x-unknown + op50n) + cpu=hppa1.1 + vendor=oki ;; - c55x) - basic_machine=tic55x-unknown + op60c) + cpu=hppa1.1 + vendor=oki ;; - c6x) - basic_machine=tic6x-unknown + ibm*) + cpu=i370 + vendor=ibm + ;; + orion105) + cpu=clipper + vendor=highlevel + ;; + mac | mpw | mac-mpw) + cpu=m68k + vendor=apple + ;; + pmac | pmac-mpw) + cpu=powerpc + vendor=apple + ;; + + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + cpu=m68000 + vendor=att + ;; + 3b*) + cpu=we32k + vendor=att + ;; + bluegene*) + cpu=powerpc + vendor=ibm + basic_os=cnk + ;; + decsystem10* | dec10*) + cpu=pdp10 + vendor=dec + basic_os=tops10 + ;; + decsystem20* | dec20*) + cpu=pdp10 + vendor=dec + basic_os=tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + cpu=m68k + vendor=motorola + ;; + dpx2*) + cpu=m68k + vendor=bull + basic_os=sysv3 + ;; + encore | umax | mmax) + cpu=ns32k + vendor=encore + ;; + elxsi) + cpu=elxsi + vendor=elxsi + basic_os=${basic_os:-bsd} + ;; + fx2800) + cpu=i860 + vendor=alliant + ;; + genix) + cpu=ns32k + vendor=ns + ;; + h3050r* | hiux*) + cpu=hppa1.1 + vendor=hitachi + basic_os=hiuxwe2 + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + cpu=hppa1.0 + vendor=hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + cpu=m68000 + vendor=hp + ;; + hp9k3[2-9][0-9]) + cpu=m68k + vendor=hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + cpu=hppa1.0 + vendor=hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + cpu=hppa1.1 + vendor=hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + cpu=hppa1.1 + vendor=hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + cpu=hppa1.1 + vendor=hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + cpu=hppa1.1 + vendor=hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + cpu=hppa1.0 + vendor=hp + ;; + i*86v32) + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + basic_os=sysv32 + ;; + i*86v4*) + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + basic_os=sysv4 + ;; + i*86v) + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + basic_os=sysv + ;; + i*86sol2) + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + basic_os=solaris2 + ;; + j90 | j90-cray) + cpu=j90 + vendor=cray + basic_os=${basic_os:-unicos} + ;; + iris | iris4d) + cpu=mips + vendor=sgi + case $basic_os in + irix*) + ;; + *) + basic_os=irix4 + ;; + esac + ;; + miniframe) + cpu=m68000 + vendor=convergent + ;; + *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*) + cpu=m68k + vendor=atari + basic_os=mint + ;; + news-3600 | risc-news) + cpu=mips + vendor=sony + basic_os=newsos + ;; + next | m*-next) + cpu=m68k + vendor=next + case $basic_os in + openstep*) + ;; + nextstep*) + ;; + ns2*) + basic_os=nextstep2 + ;; + *) + basic_os=nextstep3 + ;; + esac + ;; + np1) + cpu=np1 + vendor=gould + ;; + op50n-* | op60c-*) + cpu=hppa1.1 + vendor=oki + basic_os=proelf + ;; + pa-hitachi) + cpu=hppa1.1 + vendor=hitachi + basic_os=hiuxwe2 + ;; + pbd) + cpu=sparc + vendor=tti + ;; + pbb) + cpu=m68k + vendor=tti + ;; + pc532) + cpu=ns32k + vendor=pc532 + ;; + pn) + cpu=pn + vendor=gould + ;; + power) + cpu=power + vendor=ibm + ;; + ps2) + cpu=i386 + vendor=ibm + ;; + rm[46]00) + cpu=mips + vendor=siemens + ;; + rtpc | rtpc-*) + cpu=romp + vendor=ibm + ;; + sde) + cpu=mipsisa32 + vendor=sde + basic_os=${basic_os:-elf} + ;; + simso-wrs) + cpu=sparclite + vendor=wrs + basic_os=vxworks + ;; + tower | tower-32) + cpu=m68k + vendor=ncr + ;; + vpp*|vx|vx-*) + cpu=f301 + vendor=fujitsu + ;; + w65) + cpu=w65 + vendor=wdc + ;; + w89k-*) + cpu=hppa1.1 + vendor=winbond + basic_os=proelf + ;; + none) + cpu=none + vendor=none ;; leon|leon[3-9]) - basic_machine=sparc-$basic_machine + cpu=sparc + vendor=$basic_machine ;; - m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) - basic_machine=$basic_machine-unknown - os=-none - ;; - m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) - ;; - ms1) - basic_machine=mt-unknown + leon-*|leon[3-9]-*) + cpu=sparc + vendor=`echo "$basic_machine" | sed 's/-.*//'` ;; - strongarm | thumb | xscale) - basic_machine=arm-unknown + *-*) + # shellcheck disable=SC2162 + saved_IFS=$IFS + IFS="-" read cpu vendor <&2 - exit 1 - ;; - # Recognize the basic CPU types with company name. - 580-* \ - | a29k-* \ - | aarch64-* | aarch64_be-* \ - | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ - | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ - | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ - | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ - | avr-* | avr32-* \ - | ba-* \ - | be32-* | be64-* \ - | bfin-* | bs2000-* \ - | c[123]* | c30-* | [cjt]90-* | c4x-* \ - | c8051-* | clipper-* | craynv-* | cydra-* \ - | d10v-* | d30v-* | dlx-* \ - | e2k-* | elxsi-* \ - | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ - | h8300-* | h8500-* \ - | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ - | hexagon-* \ - | i*86-* | i860-* | i960-* | ia64-* \ - | ip2k-* | iq2000-* \ - | k1om-* \ - | le32-* | le64-* \ - | lm32-* \ - | m32c-* | m32r-* | m32rle-* \ - | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ - | microblaze-* | microblazeel-* \ - | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ - | mips16-* \ - | mips64-* | mips64el-* \ - | mips64octeon-* | mips64octeonel-* \ - | mips64orion-* | mips64orionel-* \ - | mips64r5900-* | mips64r5900el-* \ - | mips64vr-* | mips64vrel-* \ - | mips64vr4100-* | mips64vr4100el-* \ - | mips64vr4300-* | mips64vr4300el-* \ - | mips64vr5000-* | mips64vr5000el-* \ - | mips64vr5900-* | mips64vr5900el-* \ - | mipsisa32-* | mipsisa32el-* \ - | mipsisa32r2-* | mipsisa32r2el-* \ - | mipsisa32r6-* | mipsisa32r6el-* \ - | mipsisa64-* | mipsisa64el-* \ - | mipsisa64r2-* | mipsisa64r2el-* \ - | mipsisa64r6-* | mipsisa64r6el-* \ - | mipsisa64sb1-* | mipsisa64sb1el-* \ - | mipsisa64sr71k-* | mipsisa64sr71kel-* \ - | mipsr5900-* | mipsr5900el-* \ - | mipstx39-* | mipstx39el-* \ - | mmix-* \ - | mt-* \ - | msp430-* \ - | nds32-* | nds32le-* | nds32be-* \ - | nios-* | nios2-* | nios2eb-* | nios2el-* \ - | none-* | np1-* | ns16k-* | ns32k-* \ - | open8-* \ - | or1k*-* \ - | orion-* \ - | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ - | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ - | pru-* \ - | pyramid-* \ - | riscv32-* | riscv64-* \ - | rl78-* | romp-* | rs6000-* | rx-* \ - | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ - | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ - | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ - | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ - | tahoe-* \ - | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ - | tile*-* \ - | tron-* \ - | ubicom32-* \ - | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ - | vax-* \ - | visium-* \ - | we32k-* \ - | x86-* | x86_64-* | xc16x-* | xps100-* \ - | xstormy16-* | xtensa*-* \ - | ymp-* \ - | z8k-* | z80-*) - ;; - # Recognize the basic CPU types without company name, with glob match. - xtensa*) - basic_machine=$basic_machine-unknown - ;; - # Recognize the various machine names and aliases which stand - # for a CPU type and a company and sometimes even an OS. - 386bsd) - basic_machine=i386-unknown - os=-bsd - ;; - 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) - basic_machine=m68000-att - ;; - 3b*) - basic_machine=we32k-att - ;; - a29khif) - basic_machine=a29k-amd - os=-udi - ;; - abacus) - basic_machine=abacus-unknown - ;; - adobe68k) - basic_machine=m68010-adobe - os=-scout - ;; - alliant | fx80) - basic_machine=fx80-alliant - ;; - altos | altos3068) - basic_machine=m68k-altos - ;; - am29k) - basic_machine=a29k-none - os=-bsd - ;; - amd64) - basic_machine=x86_64-pc - ;; - amd64-*) - basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - amdahl) - basic_machine=580-amdahl - os=-sysv - ;; - amiga | amiga-*) - basic_machine=m68k-unknown - ;; - amigaos | amigados) - basic_machine=m68k-unknown - os=-amigaos - ;; - amigaunix | amix) - basic_machine=m68k-unknown - os=-sysv4 - ;; - apollo68) - basic_machine=m68k-apollo - os=-sysv - ;; - apollo68bsd) - basic_machine=m68k-apollo - os=-bsd - ;; - aros) - basic_machine=i386-pc - os=-aros - ;; - asmjs) - basic_machine=asmjs-unknown - ;; - aux) - basic_machine=m68k-apple - os=-aux - ;; - balance) - basic_machine=ns32k-sequent - os=-dynix - ;; - blackfin) - basic_machine=bfin-unknown - os=-linux - ;; - blackfin-*) - basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux - ;; - bluegene*) - basic_machine=powerpc-ibm - os=-cnk - ;; - c54x-*) - basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - c55x-*) - basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - c6x-*) - basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - c90) - basic_machine=c90-cray - os=-unicos - ;; - cegcc) - basic_machine=arm-unknown - os=-cegcc - ;; - convex-c1) - basic_machine=c1-convex - os=-bsd - ;; - convex-c2) - basic_machine=c2-convex - os=-bsd - ;; - convex-c32) - basic_machine=c32-convex - os=-bsd - ;; - convex-c34) - basic_machine=c34-convex - os=-bsd - ;; - convex-c38) - basic_machine=c38-convex - os=-bsd - ;; - cray | j90) - basic_machine=j90-cray - os=-unicos - ;; - craynv) - basic_machine=craynv-cray - os=-unicosmp - ;; - cr16 | cr16-*) - basic_machine=cr16-unknown - os=-elf - ;; - crds | unos) - basic_machine=m68k-crds - ;; - crisv32 | crisv32-* | etraxfs*) - basic_machine=crisv32-axis - ;; - cris | cris-* | etrax*) - basic_machine=cris-axis - ;; - crx) - basic_machine=crx-unknown - os=-elf - ;; - da30 | da30-*) - basic_machine=m68k-da30 - ;; - decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) - basic_machine=mips-dec - ;; - decsystem10* | dec10*) - basic_machine=pdp10-dec - os=-tops10 - ;; - decsystem20* | dec20*) - basic_machine=pdp10-dec - os=-tops20 - ;; - delta | 3300 | motorola-3300 | motorola-delta \ - | 3300-motorola | delta-motorola) - basic_machine=m68k-motorola - ;; - delta88) - basic_machine=m88k-motorola - os=-sysv3 - ;; - dicos) - basic_machine=i686-pc - os=-dicos - ;; - djgpp) - basic_machine=i586-pc - os=-msdosdjgpp - ;; - dpx20 | dpx20-*) - basic_machine=rs6000-bull - os=-bosx - ;; - dpx2* | dpx2*-bull) - basic_machine=m68k-bull - os=-sysv3 - ;; - e500v[12]) - basic_machine=powerpc-unknown - os=$os"spe" - ;; - e500v[12]-*) - basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` - os=$os"spe" - ;; - ebmon29k) - basic_machine=a29k-amd - os=-ebmon - ;; - elxsi) - basic_machine=elxsi-elxsi - os=-bsd - ;; - encore | umax | mmax) - basic_machine=ns32k-encore - ;; - es1800 | OSE68k | ose68k | ose | OSE) - basic_machine=m68k-ericsson - os=-ose - ;; - fx2800) - basic_machine=i860-alliant - ;; - genix) - basic_machine=ns32k-ns - ;; - gmicro) - basic_machine=tron-gmicro - os=-sysv - ;; - go32) - basic_machine=i386-pc - os=-go32 - ;; - h3050r* | hiux*) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - h8300hms) - basic_machine=h8300-hitachi - os=-hms - ;; - h8300xray) - basic_machine=h8300-hitachi - os=-xray - ;; - h8500hms) - basic_machine=h8500-hitachi - os=-hms - ;; - harris) - basic_machine=m88k-harris - os=-sysv3 - ;; - hp300-*) - basic_machine=m68k-hp - ;; - hp300bsd) - basic_machine=m68k-hp - os=-bsd - ;; - hp300hpux) - basic_machine=m68k-hp - os=-hpux - ;; - hp3k9[0-9][0-9] | hp9[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k2[0-9][0-9] | hp9k31[0-9]) - basic_machine=m68000-hp - ;; - hp9k3[2-9][0-9]) - basic_machine=m68k-hp - ;; - hp9k6[0-9][0-9] | hp6[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k7[0-79][0-9] | hp7[0-79][0-9]) - basic_machine=hppa1.1-hp - ;; - hp9k78[0-9] | hp78[0-9]) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][13679] | hp8[0-9][13679]) - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][0-9] | hp8[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hppa-next) - os=-nextstep3 - ;; - hppaosf) - basic_machine=hppa1.1-hp - os=-osf - ;; - hppro) - basic_machine=hppa1.1-hp - os=-proelf - ;; - i370-ibm* | ibm*) - basic_machine=i370-ibm - ;; - i*86v32) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv32 - ;; - i*86v4*) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv4 - ;; - i*86v) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv - ;; - i*86sol2) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-solaris2 - ;; - i386mach) - basic_machine=i386-mach - os=-mach - ;; - i386-vsta | vsta) - basic_machine=i386-unknown - os=-vsta - ;; - iris | iris4d) - basic_machine=mips-sgi - case $os in - -irix*) - ;; - *) - os=-irix4 - ;; - esac - ;; - isi68 | isi) - basic_machine=m68k-isi - os=-sysv - ;; - leon-*|leon[3-9]-*) - basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'` - ;; - m68knommu) - basic_machine=m68k-unknown - os=-linux - ;; - m68knommu-*) - basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux - ;; - m88k-omron*) - basic_machine=m88k-omron - ;; - magnum | m3230) - basic_machine=mips-mips - os=-sysv - ;; - merlin) - basic_machine=ns32k-utek - os=-sysv - ;; - microblaze*) - basic_machine=microblaze-xilinx - ;; - mingw64) - basic_machine=x86_64-pc - os=-mingw64 - ;; - mingw32) - basic_machine=i686-pc - os=-mingw32 - ;; - mingw32ce) - basic_machine=arm-unknown - os=-mingw32ce - ;; - miniframe) - basic_machine=m68000-convergent - ;; - *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; - mips3*-*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` - ;; - mips3*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown - ;; - monitor) - basic_machine=m68k-rom68k - os=-coff - ;; - morphos) - basic_machine=powerpc-unknown - os=-morphos - ;; - moxiebox) - basic_machine=moxie-unknown - os=-moxiebox - ;; - msdos) - basic_machine=i386-pc - os=-msdos - ;; - ms1-*) - basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` - ;; - msys) - basic_machine=i686-pc - os=-msys - ;; - mvs) - basic_machine=i370-ibm - os=-mvs - ;; - nacl) - basic_machine=le32-unknown - os=-nacl - ;; - ncr3000) - basic_machine=i486-ncr - os=-sysv4 - ;; - netbsd386) - basic_machine=i386-unknown - os=-netbsd - ;; - netwinder) - basic_machine=armv4l-rebel - os=-linux - ;; - news | news700 | news800 | news900) - basic_machine=m68k-sony - os=-newsos - ;; - news1000) - basic_machine=m68030-sony - os=-newsos - ;; - news-3600 | risc-news) - basic_machine=mips-sony - os=-newsos - ;; - necv70) - basic_machine=v70-nec - os=-sysv - ;; - next | m*-next ) - basic_machine=m68k-next - case $os in - -nextstep* ) - ;; - -ns2*) - os=-nextstep2 - ;; - *) - os=-nextstep3 - ;; - esac - ;; - nh3000) - basic_machine=m68k-harris - os=-cxux - ;; - nh[45]000) - basic_machine=m88k-harris - os=-cxux - ;; - nindy960) - basic_machine=i960-intel - os=-nindy - ;; - mon960) - basic_machine=i960-intel - os=-mon960 - ;; - nonstopux) - basic_machine=mips-compaq - os=-nonstopux - ;; - np1) - basic_machine=np1-gould - ;; - neo-tandem) - basic_machine=neo-tandem - ;; - nse-tandem) - basic_machine=nse-tandem - ;; - nsr-tandem) - basic_machine=nsr-tandem - ;; - op50n-* | op60c-*) - basic_machine=hppa1.1-oki - os=-proelf - ;; - openrisc | openrisc-*) - basic_machine=or32-unknown - ;; - os400) - basic_machine=powerpc-ibm - os=-os400 - ;; - OSE68000 | ose68000) - basic_machine=m68000-ericsson - os=-ose - ;; - os68k) - basic_machine=m68k-none - os=-os68k - ;; - pa-hitachi) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - paragon) - basic_machine=i860-intel - os=-osf - ;; - parisc) - basic_machine=hppa-unknown - os=-linux - ;; - parisc-*) - basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux - ;; - pbd) - basic_machine=sparc-tti - ;; - pbb) - basic_machine=m68k-tti - ;; - pc532 | pc532-*) - basic_machine=ns32k-pc532 + cpu=$basic_machine + vendor=pc ;; + # These rules are duplicated from below for sake of the special case above; + # i.e. things that normalized to x86 arches should also default to "pc" pc98) - basic_machine=i386-pc + cpu=i386 + vendor=pc ;; - pc98-*) - basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` + x64 | amd64) + cpu=x86_64 + vendor=pc ;; - pentium | p5 | k5 | k6 | nexgen | viac3) - basic_machine=i586-pc + # Recognize the basic CPU types without company name. + *) + cpu=$basic_machine + vendor=unknown ;; - pentiumpro | p6 | 6x86 | athlon | athlon_*) - basic_machine=i686-pc +esac + +unset -v basic_machine + +# Decode basic machines in the full and proper CPU-Company form. +case $cpu-$vendor in + # Here we handle the default manufacturer of certain CPU types in canonical form. It is in + # some cases the only manufacturer, in others, it is the most popular. + craynv-unknown) + vendor=cray + basic_os=${basic_os:-unicosmp} ;; - pentiumii | pentium2 | pentiumiii | pentium3) - basic_machine=i686-pc + c90-unknown | c90-cray) + vendor=cray + basic_os=${Basic_os:-unicos} ;; - pentium4) - basic_machine=i786-pc + fx80-unknown) + vendor=alliant ;; - pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) - basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + romp-unknown) + vendor=ibm ;; - pentiumpro-* | p6-* | 6x86-* | athlon-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + mmix-unknown) + vendor=knuth ;; - pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + microblaze-unknown | microblazeel-unknown) + vendor=xilinx ;; - pentium4-*) - basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + rs6000-unknown) + vendor=ibm ;; - pn) - basic_machine=pn-gould + vax-unknown) + vendor=dec ;; - power) basic_machine=power-ibm + pdp11-unknown) + vendor=dec ;; - ppc | ppcbe) basic_machine=powerpc-unknown + we32k-unknown) + vendor=att ;; - ppc-* | ppcbe-*) - basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + cydra-unknown) + vendor=cydrome ;; - ppcle | powerpclittle) - basic_machine=powerpcle-unknown + i370-ibm*) + vendor=ibm ;; - ppcle-* | powerpclittle-*) - basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + orion-unknown) + vendor=highlevel ;; - ppc64) basic_machine=powerpc64-unknown - ;; - ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64le | powerpc64little) - basic_machine=powerpc64le-unknown - ;; - ppc64le-* | powerpc64little-*) - basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ps2) - basic_machine=i386-ibm - ;; - pw32) - basic_machine=i586-unknown - os=-pw32 - ;; - rdos | rdos64) - basic_machine=x86_64-pc - os=-rdos - ;; - rdos32) - basic_machine=i386-pc - os=-rdos - ;; - rom68k) - basic_machine=m68k-rom68k - os=-coff - ;; - rm[46]00) - basic_machine=mips-siemens - ;; - rtpc | rtpc-*) - basic_machine=romp-ibm - ;; - s390 | s390-*) - basic_machine=s390-ibm - ;; - s390x | s390x-*) - basic_machine=s390x-ibm - ;; - sa29200) - basic_machine=a29k-amd - os=-udi - ;; - sb1) - basic_machine=mipsisa64sb1-unknown - ;; - sb1el) - basic_machine=mipsisa64sb1el-unknown - ;; - sde) - basic_machine=mipsisa32-sde - os=-elf - ;; - sei) - basic_machine=mips-sei - os=-seiux - ;; - sequent) - basic_machine=i386-sequent - ;; - sh) - basic_machine=sh-hitachi - os=-hms - ;; - sh5el) - basic_machine=sh5le-unknown - ;; - sh64) - basic_machine=sh64-unknown - ;; - sparclite-wrs | simso-wrs) - basic_machine=sparclite-wrs - os=-vxworks - ;; - sps7) - basic_machine=m68k-bull - os=-sysv2 - ;; - spur) - basic_machine=spur-unknown - ;; - st2000) - basic_machine=m68k-tandem - ;; - stratus) - basic_machine=i860-stratus - os=-sysv4 - ;; - strongarm-* | thumb-*) - basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - sun2) - basic_machine=m68000-sun - ;; - sun2os3) - basic_machine=m68000-sun - os=-sunos3 - ;; - sun2os4) - basic_machine=m68000-sun - os=-sunos4 - ;; - sun3os3) - basic_machine=m68k-sun - os=-sunos3 - ;; - sun3os4) - basic_machine=m68k-sun - os=-sunos4 - ;; - sun4os3) - basic_machine=sparc-sun - os=-sunos3 - ;; - sun4os4) - basic_machine=sparc-sun - os=-sunos4 - ;; - sun4sol2) - basic_machine=sparc-sun - os=-solaris2 - ;; - sun3 | sun3-*) - basic_machine=m68k-sun - ;; - sun4) - basic_machine=sparc-sun - ;; - sun386 | sun386i | roadrunner) - basic_machine=i386-sun - ;; - sv1) - basic_machine=sv1-cray - os=-unicos - ;; - symmetry) - basic_machine=i386-sequent - os=-dynix - ;; - t3e) - basic_machine=alphaev5-cray - os=-unicos - ;; - t90) - basic_machine=t90-cray - os=-unicos - ;; - tile*) - basic_machine=$basic_machine-unknown - os=-linux-gnu - ;; - tx39) - basic_machine=mipstx39-unknown - ;; - tx39el) - basic_machine=mipstx39el-unknown - ;; - toad1) - basic_machine=pdp10-xkl - os=-tops20 - ;; - tower | tower-32) - basic_machine=m68k-ncr - ;; - tpf) - basic_machine=s390x-ibm - os=-tpf - ;; - udi29k) - basic_machine=a29k-amd - os=-udi - ;; - ultra3) - basic_machine=a29k-nyu - os=-sym1 - ;; - v810 | necv810) - basic_machine=v810-nec - os=-none - ;; - vaxv) - basic_machine=vax-dec - os=-sysv - ;; - vms) - basic_machine=vax-dec - os=-vms - ;; - vpp*|vx|vx-*) - basic_machine=f301-fujitsu - ;; - vxworks960) - basic_machine=i960-wrs - os=-vxworks - ;; - vxworks68) - basic_machine=m68k-wrs - os=-vxworks - ;; - vxworks29k) - basic_machine=a29k-wrs - os=-vxworks - ;; - w65*) - basic_machine=w65-wdc - os=-none - ;; - w89k-*) - basic_machine=hppa1.1-winbond - os=-proelf - ;; - xbox) - basic_machine=i686-pc - os=-mingw32 - ;; - xps | xps100) - basic_machine=xps100-honeywell - ;; - xscale-* | xscalee[bl]-*) - basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` - ;; - ymp) - basic_machine=ymp-cray - os=-unicos - ;; - z8k-*-coff) - basic_machine=z8k-unknown - os=-sim - ;; - z80-*-coff) - basic_machine=z80-unknown - os=-sim - ;; - none) - basic_machine=none-none - os=-none + xps-unknown | xps100-unknown) + cpu=xps100 + vendor=honeywell ;; -# Here we handle the default manufacturer of certain CPU types. It is in -# some cases the only manufacturer, in others, it is the most popular. - w89k) - basic_machine=hppa1.1-winbond + # Here we normalize CPU types with a missing or matching vendor + armh-unknown | armh-alt) + cpu=armv7l + vendor=alt + basic_os=${basic_os:-linux-gnueabihf} ;; - op50n) - basic_machine=hppa1.1-oki + dpx20-unknown | dpx20-bull) + cpu=rs6000 + vendor=bull + basic_os=${basic_os:-bosx} ;; - op60c) - basic_machine=hppa1.1-oki + + # Here we normalize CPU types irrespective of the vendor + amd64-*) + cpu=x86_64 ;; - romp) - basic_machine=romp-ibm + blackfin-*) + cpu=bfin + basic_os=linux ;; - mmix) - basic_machine=mmix-knuth + c54x-*) + cpu=tic54x ;; - rs6000) - basic_machine=rs6000-ibm + c55x-*) + cpu=tic55x ;; - vax) - basic_machine=vax-dec + c6x-*) + cpu=tic6x ;; - pdp10) - # there are many clones, so DEC is not a safe bet - basic_machine=pdp10-unknown + e500v[12]-*) + cpu=powerpc + basic_os=${basic_os}"spe" ;; - pdp11) - basic_machine=pdp11-dec + mips3*-*) + cpu=mips64 ;; - we32k) - basic_machine=we32k-att + ms1-*) + cpu=mt ;; - sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) - basic_machine=sh-unknown + m68knommu-*) + cpu=m68k + basic_os=linux ;; - sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) - basic_machine=sparc-sun + m9s12z-* | m68hcs12z-* | hcs12z-* | s12z-*) + cpu=s12z ;; - cydra) - basic_machine=cydra-cydrome + openrisc-*) + cpu=or32 ;; - orion) - basic_machine=orion-highlevel + parisc-*) + cpu=hppa + basic_os=linux ;; - orion105) - basic_machine=clipper-highlevel + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + cpu=i586 ;; - mac | mpw | mac-mpw) - basic_machine=m68k-apple + pentiumpro-* | p6-* | 6x86-* | athlon-* | athalon_*-*) + cpu=i686 ;; - pmac | pmac-mpw) - basic_machine=powerpc-apple + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) + cpu=i686 ;; - *-unknown) - # Make sure to match an already-canonicalized machine name. + pentium4-*) + cpu=i786 ;; + pc98-*) + cpu=i386 + ;; + ppc-* | ppcbe-*) + cpu=powerpc + ;; + ppcle-* | powerpclittle-*) + cpu=powerpcle + ;; + ppc64-*) + cpu=powerpc64 + ;; + ppc64le-* | powerpc64little-*) + cpu=powerpc64le + ;; + sb1-*) + cpu=mipsisa64sb1 + ;; + sb1el-*) + cpu=mipsisa64sb1el + ;; + sh5e[lb]-*) + cpu=`echo "$cpu" | sed 's/^\(sh.\)e\(.\)$/\1\2e/'` + ;; + spur-*) + cpu=spur + ;; + strongarm-* | thumb-*) + cpu=arm + ;; + tx39-*) + cpu=mipstx39 + ;; + tx39el-*) + cpu=mipstx39el + ;; + x64-*) + cpu=x86_64 + ;; + xscale-* | xscalee[bl]-*) + cpu=`echo "$cpu" | sed 's/^xscale/arm/'` + ;; + arm64-* | aarch64le-*) + cpu=aarch64 + ;; + + # Recognize the canonical CPU Types that limit and/or modify the + # company names they are paired with. + cr16-*) + basic_os=${basic_os:-elf} + ;; + crisv32-* | etraxfs*-*) + cpu=crisv32 + vendor=axis + ;; + cris-* | etrax*-*) + cpu=cris + vendor=axis + ;; + crx-*) + basic_os=${basic_os:-elf} + ;; + neo-tandem) + cpu=neo + vendor=tandem + ;; + nse-tandem) + cpu=nse + vendor=tandem + ;; + nsr-tandem) + cpu=nsr + vendor=tandem + ;; + nsv-tandem) + cpu=nsv + vendor=tandem + ;; + nsx-tandem) + cpu=nsx + vendor=tandem + ;; + mipsallegrexel-sony) + cpu=mipsallegrexel + vendor=sony + ;; + tile*-*) + basic_os=${basic_os:-linux-gnu} + ;; + *) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 + # Recognize the canonical CPU types that are allowed with any + # company name. + case $cpu in + 1750a | 580 \ + | a29k \ + | aarch64 | aarch64_be \ + | abacus \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] \ + | alphapca5[67] | alpha64pca5[67] \ + | am33_2.0 \ + | amdgcn \ + | arc | arceb | arc32 | arc64 \ + | arm | arm[lb]e | arme[lb] | armv* \ + | avr | avr32 \ + | asmjs \ + | ba \ + | be32 | be64 \ + | bfin | bpf | bs2000 \ + | c[123]* | c30 | [cjt]90 | c4x \ + | c8051 | clipper | craynv | csky | cydra \ + | d10v | d30v | dlx | dsp16xx \ + | e2k | elxsi | epiphany \ + | f30[01] | f700 | fido | fr30 | frv | ft32 | fx80 \ + | h8300 | h8500 \ + | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | hexagon \ + | i370 | i*86 | i860 | i960 | ia16 | ia64 \ + | ip2k | iq2000 \ + | k1om \ + | le32 | le64 \ + | lm32 \ + | loongarch32 | loongarch64 | loongarchx32 \ + | m32c | m32r | m32rle \ + | m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k \ + | m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x \ + | m88110 | m88k | maxq | mb | mcore | mep | metag \ + | microblaze | microblazeel \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64eb | mips64el \ + | mips64octeon | mips64octeonel \ + | mips64orion | mips64orionel \ + | mips64r5900 | mips64r5900el \ + | mips64vr | mips64vrel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa32r3 | mipsisa32r3el \ + | mipsisa32r5 | mipsisa32r5el \ + | mipsisa32r6 | mipsisa32r6el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64r3 | mipsisa64r3el \ + | mipsisa64r5 | mipsisa64r5el \ + | mipsisa64r6 | mipsisa64r6el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipsr5900 | mipsr5900el \ + | mipstx39 | mipstx39el \ + | mmix \ + | mn10200 | mn10300 \ + | moxie \ + | mt \ + | msp430 \ + | nds32 | nds32le | nds32be \ + | nfp \ + | nios | nios2 | nios2eb | nios2el \ + | none | np1 | ns16k | ns32k | nvptx \ + | open8 \ + | or1k* \ + | or32 \ + | orion \ + | picochip \ + | pdp10 | pdp11 | pj | pjl | pn | power \ + | powerpc | powerpc64 | powerpc64le | powerpcle | powerpcspe \ + | pru \ + | pyramid \ + | riscv | riscv32 | riscv32be | riscv64 | riscv64be \ + | rl78 | romp | rs6000 | rx \ + | s390 | s390x \ + | score \ + | sh | shl \ + | sh[1234] | sh[24]a | sh[24]ae[lb] | sh[23]e | she[lb] | sh[lb]e \ + | sh[1234]e[lb] | sh[12345][lb]e | sh[23]ele | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet \ + | sparclite \ + | sparcv8 | sparcv9 | sparcv9b | sparcv9v | sv1 | sx* \ + | spu \ + | tahoe \ + | thumbv7* \ + | tic30 | tic4x | tic54x | tic55x | tic6x | tic80 \ + | tron \ + | ubicom32 \ + | v70 | v850 | v850e | v850e1 | v850es | v850e2 | v850e2v3 \ + | vax \ + | visium \ + | w65 \ + | wasm32 | wasm64 \ + | we32k \ + | x86 | x86_64 | xc16x | xgate | xps100 \ + | xstormy16 | xtensa* \ + | ymp \ + | z8k | z80) + ;; + + *) + echo Invalid configuration \`"$1"\': machine \`"$cpu-$vendor"\' not recognized 1>&2 + exit 1 + ;; + esac ;; esac # Here we canonicalize certain aliases for manufacturers. -case $basic_machine in - *-digital*) - basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` +case $vendor in + digital*) + vendor=dec ;; - *-commodore*) - basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + commodore*) + vendor=cbm ;; *) ;; @@ -1355,203 +1306,215 @@ esac # Decode manufacturer-specific aliases for certain operating systems. -if [ x"$os" != x"" ] +if test x$basic_os != x then + +# First recognize some ad-hoc cases, or perhaps split kernel-os, or else just +# set os. +case $basic_os in + gnu/linux*) + kernel=linux + os=`echo "$basic_os" | sed -e 's|gnu/linux|gnu|'` + ;; + os2-emx) + kernel=os2 + os=`echo "$basic_os" | sed -e 's|os2-emx|emx|'` + ;; + nto-qnx*) + kernel=nto + os=`echo "$basic_os" | sed -e 's|nto-qnx|qnx|'` + ;; + *-*) + # shellcheck disable=SC2162 + saved_IFS=$IFS + IFS="-" read kernel os <&2 - exit 1 + # No normalization, but not necessarily accepted, that comes below. ;; esac + else # Here we handle the default operating systems that come with various machines. @@ -1564,261 +1527,363 @@ else # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. -case $basic_machine in +kernel= +case $cpu-$vendor in score-*) - os=-elf + os=elf ;; spu-*) - os=-elf + os=elf ;; *-acorn) - os=-riscix1.2 + os=riscix1.2 ;; arm*-rebel) - os=-linux + kernel=linux + os=gnu ;; arm*-semi) - os=-aout + os=aout ;; c4x-* | tic4x-*) - os=-coff + os=coff ;; c8051-*) - os=-elf + os=elf + ;; + clipper-intergraph) + os=clix ;; hexagon-*) - os=-elf + os=elf ;; tic54x-*) - os=-coff + os=coff ;; tic55x-*) - os=-coff + os=coff ;; tic6x-*) - os=-coff + os=coff ;; # This must come before the *-dec entry. pdp10-*) - os=-tops20 + os=tops20 ;; pdp11-*) - os=-none + os=none ;; *-dec | vax-*) - os=-ultrix4.2 + os=ultrix4.2 ;; m68*-apollo) - os=-domain + os=domain ;; i386-sun) - os=-sunos4.0.2 + os=sunos4.0.2 ;; m68000-sun) - os=-sunos3 + os=sunos3 ;; m68*-cisco) - os=-aout + os=aout ;; mep-*) - os=-elf + os=elf ;; mips*-cisco) - os=-elf + os=elf ;; mips*-*) - os=-elf + os=elf ;; or32-*) - os=-coff + os=coff ;; *-tti) # must be before sparc entry or we get the wrong os. - os=-sysv3 + os=sysv3 ;; sparc-* | *-sun) - os=-sunos4.1.1 + os=sunos4.1.1 + ;; + pru-*) + os=elf ;; *-be) - os=-beos - ;; - *-haiku) - os=-haiku + os=beos ;; *-ibm) - os=-aix + os=aix ;; *-knuth) - os=-mmixware + os=mmixware ;; *-wec) - os=-proelf + os=proelf ;; *-winbond) - os=-proelf + os=proelf ;; *-oki) - os=-proelf + os=proelf ;; *-hp) - os=-hpux + os=hpux ;; *-hitachi) - os=-hiux + os=hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) - os=-sysv + os=sysv ;; *-cbm) - os=-amigaos + os=amigaos ;; *-dg) - os=-dgux + os=dgux ;; *-dolphin) - os=-sysv3 + os=sysv3 ;; m68k-ccur) - os=-rtu + os=rtu ;; m88k-omron*) - os=-luna - ;; - *-next ) - os=-nextstep - ;; - *-sequent) - os=-ptx - ;; - *-crds) - os=-unos - ;; - *-ns) - os=-genix - ;; - i370-*) - os=-mvs + os=luna ;; *-next) - os=-nextstep3 + os=nextstep + ;; + *-sequent) + os=ptx + ;; + *-crds) + os=unos + ;; + *-ns) + os=genix + ;; + i370-*) + os=mvs ;; *-gould) - os=-sysv + os=sysv ;; *-highlevel) - os=-bsd + os=bsd ;; *-encore) - os=-bsd + os=bsd ;; *-sgi) - os=-irix + os=irix ;; *-siemens) - os=-sysv4 + os=sysv4 ;; *-masscomp) - os=-rtu + os=rtu ;; f30[01]-fujitsu | f700-fujitsu) - os=-uxpv + os=uxpv ;; *-rom68k) - os=-coff + os=coff ;; *-*bug) - os=-coff + os=coff ;; *-apple) - os=-macos + os=macos ;; *-atari*) - os=-mint + os=mint + ;; + *-wrs) + os=vxworks ;; *) - os=-none + os=none ;; esac + fi +# Now, validate our (potentially fixed-up) OS. +case $os in + # Sometimes we do "kernel-libc", so those need to count as OSes. + musl* | newlib* | relibc* | uclibc*) + ;; + # Likewise for "kernel-abi" + eabi* | gnueabi*) + ;; + # VxWorks passes extra cpu info in the 4th filed. + simlinux | simwindows | spe) + ;; + # Now accept the basic system types. + # The portable systems comes first. + # Each alternative MUST end in a * to match a version number. + gnu* | android* | bsd* | mach* | minix* | genix* | ultrix* | irix* \ + | *vms* | esix* | aix* | cnk* | sunos | sunos[34]* \ + | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \ + | sym* | plan9* | psp* | sim* | xray* | os68k* | v88r* \ + | hiux* | abug | nacl* | netware* | windows* \ + | os9* | macos* | osx* | ios* \ + | mpw* | magic* | mmixware* | mon960* | lnews* \ + | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \ + | aos* | aros* | cloudabi* | sortix* | twizzler* \ + | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \ + | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \ + | mirbsd* | netbsd* | dicos* | openedition* | ose* \ + | bitrig* | openbsd* | secbsd* | solidbsd* | libertybsd* | os108* \ + | ekkobsd* | freebsd* | riscix* | lynxos* | os400* \ + | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \ + | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \ + | udi* | lites* | ieee* | go32* | aux* | hcos* \ + | chorusrdb* | cegcc* | glidix* | serenity* \ + | cygwin* | msys* | pe* | moss* | proelf* | rtems* \ + | midipix* | mingw32* | mingw64* | mint* \ + | uxpv* | beos* | mpeix* | udk* | moxiebox* \ + | interix* | uwin* | mks* | rhapsody* | darwin* \ + | openstep* | oskit* | conix* | pw32* | nonstopux* \ + | storm-chaos* | tops10* | tenex* | tops20* | its* \ + | os2* | vos* | palmos* | uclinux* | nucleus* | morphos* \ + | scout* | superux* | sysv* | rtmk* | tpf* | windiss* \ + | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \ + | skyos* | haiku* | rdos* | toppers* | drops* | es* \ + | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \ + | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \ + | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* | zephyr* \ + | fiwix* ) + ;; + # This one is extra strict with allowed versions + sco3.2v2 | sco3.2v[4-9]* | sco5v6*) + # Don't forget version if it is 3.2v4 or newer. + ;; + none) + ;; + *) + echo Invalid configuration \`"$1"\': OS \`"$os"\' not recognized 1>&2 + exit 1 + ;; +esac + +# As a final step for OS-related things, validate the OS-kernel combination +# (given a valid OS), if there is a kernel. +case $kernel-$os in + linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* \ + | linux-musl* | linux-relibc* | linux-uclibc* ) + ;; + uclinux-uclibc* ) + ;; + -dietlibc* | -newlib* | -musl* | -relibc* | -uclibc* ) + # These are just libc implementations, not actual OSes, and thus + # require a kernel. + echo "Invalid configuration \`$1': libc \`$os' needs explicit kernel." 1>&2 + exit 1 + ;; + kfreebsd*-gnu* | kopensolaris*-gnu*) + ;; + vxworks-simlinux | vxworks-simwindows | vxworks-spe) + ;; + nto-qnx*) + ;; + os2-emx) + ;; + *-eabi* | *-gnueabi*) + ;; + -*) + # Blank kernel with real OS is always fine. + ;; + *-*) + echo "Invalid configuration \`$1': Kernel \`$kernel' not known to work with OS \`$os'." 1>&2 + exit 1 + ;; +esac + # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. -vendor=unknown -case $basic_machine in - *-unknown) - case $os in - -riscix*) +case $vendor in + unknown) + case $cpu-$os in + *-riscix*) vendor=acorn ;; - -sunos*) + *-sunos*) vendor=sun ;; - -cnk*|-aix*) + *-cnk* | *-aix*) vendor=ibm ;; - -beos*) + *-beos*) vendor=be ;; - -hpux*) + *-hpux*) vendor=hp ;; - -mpeix*) + *-mpeix*) vendor=hp ;; - -hiux*) + *-hiux*) vendor=hitachi ;; - -unos*) + *-unos*) vendor=crds ;; - -dgux*) + *-dgux*) vendor=dg ;; - -luna*) + *-luna*) vendor=omron ;; - -genix*) + *-genix*) vendor=ns ;; - -mvs* | -opened*) + *-clix*) + vendor=intergraph + ;; + *-mvs* | *-opened*) vendor=ibm ;; - -os400*) + *-os400*) vendor=ibm ;; - -ptx*) + s390-* | s390x-*) + vendor=ibm + ;; + *-ptx*) vendor=sequent ;; - -tpf*) + *-tpf*) vendor=ibm ;; - -vxsim* | -vxworks* | -windiss*) + *-vxsim* | *-vxworks* | *-windiss*) vendor=wrs ;; - -aux*) + *-aux*) vendor=apple ;; - -hms*) + *-hms*) vendor=hitachi ;; - -mpw* | -macos*) + *-mpw* | *-macos*) vendor=apple ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + *-*mint | *-mint[0-9]* | *-*MiNT | *-MiNT[0-9]*) vendor=atari ;; - -vos*) + *-vos*) vendor=stratus ;; esac - basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac -echo $basic_machine$os +echo "$cpu-$vendor-${kernel:+$kernel-}$os" exit # Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" diff --git a/make-linux.mk b/make-linux.mk index f113fea..4d39281 100644 --- a/make-linux.mk +++ b/make-linux.mk @@ -480,6 +480,12 @@ install: FORCE cat doc/backone-idtool.1 | gzip -9 >$(DESTDIR)/usr/share/man/man1/backone-idtool.1.gz cp ext/installfiles/linux/backone.te $(DESTDIR)/var/lib/backone/backone.te +install-core: install FORCE + +include make/install-addons.mk + +install-all: install-core install-addons FORCE + # Uninstall preserves identity.public and identity.secret since the user might # want to save these. These are your BackOne address. @@ -511,9 +517,12 @@ echo_flags: @echo "=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~" debian: echo_flags - @echo "building deb package" - debuild --no-lintian -I -i -us -uc -nc -b - # debuild --no-lintian -b -uc -us + @echo "building deb packages (core + addons)" + dpkg-buildpackage -us -uc -b -nc + +debian-core: echo_flags one + @echo "building core deb only" + dpkg-buildpackage -us -uc -b -nc # debian: FORCE # debuild --no-lintian -I -i -us -uc -nc -b @@ -521,6 +530,15 @@ debian: echo_flags debian-clean: FORCE rm -rf debian/files debian/backone*.debhelper debian/backone.substvars debian/*.log debian/backone debian/.debhelper debian/debhelper-build-stamp +# Cross-platform addon packages (mac .pkg / windows .zip) — run on target OS +mac-addon-pkgs: + @echo "Run on macOS: make mac-addon-pkgs" + @bash pkg/mac/build-addon-pkgs.sh + +windows-addon-pkgs: + @echo "Run on Windows: make windows-addon-pkgs" + @powershell -NoProfile -ExecutionPolicy Bypass -File pkg/windows/build-addon-packages.ps1 + redhat: @echo "building rpm package" rpmbuild --target `rpm -q bash --qf "%{arch}"` -ba backone.spec @@ -565,4 +583,9 @@ munge_deb: @echo "Updating debian/changelog to $(VERSION)" ci/scripts/munge_debian_changelog.sh debian/changelog $(VERSION) "Dedy Sutanto " "see https://github.com/proitlab/BackOne for release notes" +bump-version: + @:$(call check_defined, VERSION) + @:$(call check_defined, MESSAGE) + ci/scripts/bump_version.sh $(VERSION) "$(MESSAGE)" + FORCE: diff --git a/make-mac.mk b/make-mac.mk index ee44d45..1fe37c3 100644 --- a/make-mac.mk +++ b/make-mac.mk @@ -214,4 +214,12 @@ distclean: clean realclean: clean +include make/install-addons.mk + +mac-addon-pkgs: FORCE + bash pkg/mac/build-addon-pkgs.sh + +mac-addon-staging: install-addons FORCE + @echo "macOS addon staging complete" + FORCE: diff --git a/make-windows.mk b/make-windows.mk new file mode 100644 index 0000000..679fcae --- /dev/null +++ b/make-windows.mk @@ -0,0 +1,16 @@ +# Windows BackOne build rules (addon packaging; run on Windows with MSYS make or Git Bash). + +TOPDIR=$(shell pwd) +include objects.mk + +ADDON_VERSION ?= $(shell cat debian/version 2>/dev/null || echo 1.17.1) + +include make/install-addons.mk + +windows-addon-pkgs: FORCE + powershell -NoProfile -ExecutionPolicy Bypass -File pkg/windows/build-addon-packages.ps1 + +windows-addon-staging: install-addons FORCE + @echo "Windows addon staging complete under build/windows-addon-staging" + +FORCE: diff --git a/make/install-addons.mk b/make/install-addons.mk new file mode 100644 index 0000000..fe50aa4 --- /dev/null +++ b/make/install-addons.mk @@ -0,0 +1,102 @@ +# BackOne addon install paths and targets (linux, mac, windows). +# Included from make-linux.mk, make-mac.mk, and make-windows.mk. + +ifndef BACKONE_PLATFORM + ifeq ($(OSTYPE),Darwin) + BACKONE_PLATFORM := mac + else ifeq ($(OSTYPE),Linux) + BACKONE_PLATFORM := linux + else ifeq ($(OS),Windows_NT) + BACKONE_PLATFORM := windows + else + BACKONE_PLATFORM := linux + endif +endif + +ifeq ($(BACKONE_PLATFORM),linux) + BACKONE_HOME_PREFIX ?= $(DESTDIR)/var/lib/backone + BACKONE_ADDONS_PREFIX ?= $(DESTDIR)/usr/lib/backone/addons + BACKONE_BIN_PREFIX ?= $(DESTDIR)/usr/bin +else ifeq ($(BACKONE_PLATFORM),mac) + BACKONE_HOME_PREFIX ?= $(DESTDIR)/Library/Application Support/BackOne + BACKONE_ADDONS_PREFIX ?= $(DESTDIR)/Library/Application Support/BackOne/addons + BACKONE_BIN_PREFIX ?= $(DESTDIR)/usr/local/bin +else ifeq ($(BACKONE_PLATFORM),windows) + BACKONE_HOME_PREFIX ?= $(DESTDIR)/ProgramData/BackOne + BACKONE_ADDONS_PREFIX ?= $(DESTDIR)/Program Files/BackOne/addons + BACKONE_BIN_PREFIX ?= $(DESTDIR)/Program Files/BackOne/bin +endif + +ADDON_VERSION ?= $(shell cat debian/version 2>/dev/null || echo 1.17.1) + +install-app-shell: FORCE + mkdir -p "$(BACKONE_HOME_PREFIX)/app" + cp -r app-shell/dist/* "$(BACKONE_HOME_PREFIX)/app/" + mkdir -p "$(BACKONE_HOME_PREFIX)" + printf '{}' > "$(BACKONE_HOME_PREFIX)/contacts.json" + +install-app-tray: FORCE +ifeq ($(BACKONE_PLATFORM),linux) + mkdir -p "$(BACKONE_BIN_PREFIX)" + mkdir -p "$(BACKONE_ADDONS_PREFIX)/app-tray" + mkdir -p "$(DESTDIR)/usr/share/applications" + mkdir -p "$(DESTDIR)/etc/xdg/autostart" + cp app-tray/backone-tray.py "$(BACKONE_BIN_PREFIX)/backone-tray" + chmod 755 "$(BACKONE_BIN_PREFIX)/backone-tray" + cp app-tray/addon.json "$(BACKONE_ADDONS_PREFIX)/app-tray/" + cp app-tray/backone-tray.desktop "$(DESTDIR)/usr/share/applications/" + cp app-tray/backone-tray-autostart.desktop "$(DESTDIR)/etc/xdg/autostart/" +else + @echo "install-app-tray: skipped on $(BACKONE_PLATFORM) (Linux-only)" +endif + +install-addon-comms-core: FORCE + mkdir -p "$(BACKONE_ADDONS_PREFIX)/comms-core" + cp addons/comms-core/addon.json "$(BACKONE_ADDONS_PREFIX)/comms-core/" + cp addons/comms-core/schema.sql "$(BACKONE_ADDONS_PREFIX)/comms-core/" + +install-addon-voice: FORCE + mkdir -p "$(BACKONE_ADDONS_PREFIX)/voice" + mkdir -p "$(BACKONE_HOME_PREFIX)/app/addons/voice" + cp addons/voice/addon.json "$(BACKONE_ADDONS_PREFIX)/voice/" + cp addons/voice/frontend/index.js "$(BACKONE_HOME_PREFIX)/app/addons/voice/" + +install-addon-video: FORCE + mkdir -p "$(BACKONE_ADDONS_PREFIX)/video" + mkdir -p "$(BACKONE_HOME_PREFIX)/app/addons/video" + cp addons/video/addon.json "$(BACKONE_ADDONS_PREFIX)/video/" + cp addons/video/frontend/index.js "$(BACKONE_HOME_PREFIX)/app/addons/video/" + +install-addon-chat: FORCE + mkdir -p "$(BACKONE_ADDONS_PREFIX)/chat" + mkdir -p "$(BACKONE_HOME_PREFIX)/app/addons/chat" + mkdir -p "$(BACKONE_ADDONS_PREFIX)/chat/attachments" + cp addons/chat/addon.json "$(BACKONE_ADDONS_PREFIX)/chat/" + cp addons/chat/frontend/index.js "$(BACKONE_HOME_PREFIX)/app/addons/chat/" + +install-addon-updater: FORCE + mkdir -p "$(BACKONE_ADDONS_PREFIX)/updater/migrations" + cp addons/updater/addon.json "$(BACKONE_ADDONS_PREFIX)/updater/" + cp addons/updater/backone-updater "$(BACKONE_ADDONS_PREFIX)/updater/" + cp addons/updater/rebuild-addon-manifest.sh "$(BACKONE_ADDONS_PREFIX)/updater/" + cp addons/updater/merge-local-conf.sh "$(BACKONE_ADDONS_PREFIX)/updater/" + cp addons/updater/sync-authtoken.sh "$(BACKONE_ADDONS_PREFIX)/updater/" + cp pkg/common/platform-paths.sh "$(BACKONE_ADDONS_PREFIX)/updater/" + chmod 755 "$(BACKONE_ADDONS_PREFIX)/updater/backone-updater" + chmod 755 "$(BACKONE_ADDONS_PREFIX)/updater/rebuild-addon-manifest.sh" + chmod 755 "$(BACKONE_ADDONS_PREFIX)/updater/merge-local-conf.sh" + chmod 755 "$(BACKONE_ADDONS_PREFIX)/updater/sync-authtoken.sh" + cp addons/updater/migrations/* "$(BACKONE_ADDONS_PREFIX)/updater/migrations/" + mkdir -p "$(BACKONE_BIN_PREFIX)" +ifeq ($(BACKONE_PLATFORM),linux) + ln -sf ../lib/backone/addons/updater/backone-updater "$(BACKONE_BIN_PREFIX)/backone-updater" +else + cp addons/updater/backone-updater "$(BACKONE_BIN_PREFIX)/backone-updater" + chmod 755 "$(BACKONE_BIN_PREFIX)/backone-updater" +endif + +install-addon-manifest: install-addon-comms-core install-addon-voice install-addon-video install-addon-chat install-addon-updater FORCE + BACKONE_HOME="$(BACKONE_HOME_PREFIX)" BACKONE_ADDONS_DIR="$(BACKONE_ADDONS_PREFIX)" \ + bash addons/updater/rebuild-addon-manifest.sh || true + +install-addons: install-app-shell install-app-tray install-addon-comms-core install-addon-voice install-addon-video install-addon-chat install-addon-updater install-addon-manifest FORCE diff --git a/objects.mk b/objects.mk index 1d8a6c0..178ebbd 100644 --- a/objects.mk +++ b/objects.mk @@ -44,5 +44,6 @@ ONE_OBJS=\ osdep/Http.o \ osdep/OSUtils.o \ service/SoftwareUpdater.o \ + service/AddonHost.o \ service/OneService.o diff --git a/one.cpp b/one.cpp index 2b9b7be..7af32a8 100644 --- a/one.cpp +++ b/one.cpp @@ -271,23 +271,23 @@ static int cli(int argc,char **argv) } if (!authToken.length()) { - OSUtils::readFile((homeDir + ZT_PATH_SEPARATOR_S + "authtoken.secret").c_str(),authToken); #ifdef __UNIX_LIKE__ - if (!authToken.length()) { - const char *hd = getenv("HOME"); - if (hd) { - char p[4096]; + const char *hd = getenv("HOME"); + if (hd) { + char p[4096]; #ifdef __APPLE__ - OSUtils::ztsnprintf(p,sizeof(p),"%s/Library/Application Support/BackOne/authtoken.secret",hd); + OSUtils::ztsnprintf(p,sizeof(p),"%s/Library/Application Support/BackOne/authtoken.secret",hd); #else - OSUtils::ztsnprintf(p,sizeof(p),"%s/.backOneOneAuthToken",hd); + OSUtils::ztsnprintf(p,sizeof(p),"%s/.backOneOneAuthToken",hd); #endif - OSUtils::readFile(p,authToken); - } + OSUtils::readFile(p,authToken); } #endif if (!authToken.length()) { - fprintf(stderr,"%s: authtoken.secret not found or readable in %s (try again as root)" ZT_EOL_S,argv[0],homeDir.c_str()); + OSUtils::readFile((homeDir + ZT_PATH_SEPARATOR_S + "authtoken.secret").c_str(),authToken); + } + if (!authToken.length()) { + fprintf(stderr,"%s: authtoken not found (~/.backOneOneAuthToken or %s/authtoken.secret)" ZT_EOL_S,argv[0],homeDir.c_str()); return 2; } } diff --git a/osdep/OSUtils.cpp b/osdep/OSUtils.cpp index 5a69b97..fe88b98 100644 --- a/osdep/OSUtils.cpp +++ b/osdep/OSUtils.cpp @@ -466,6 +466,20 @@ std::string OSUtils::platformDefaultHomePath() #endif // __UNIX_LIKE__ or not... } +std::string OSUtils::platformDefaultSystemAddonsPath() +{ +#ifdef __APPLE__ + return std::string("/Library/Application Support/BackOne/addons"); +#elif defined(__WINDOWS__) + char buf[16384]; + if (SUCCEEDED(SHGetFolderPathA(NULL,CSIDL_PROGRAM_FILES,NULL,0,buf))) + return (std::string(buf) + "\\BackOne\\addons"); + return std::string("C:\\Program Files\\BackOne\\addons"); +#else + return std::string("/usr/lib/backone/addons"); +#endif +} + #ifndef OMIT_JSON_SUPPORT // Inline these massive JSON operations in one place only to reduce binary footprint and compile time nlohmann::json OSUtils::jsonParse(const std::string &buf) { return nlohmann::json::parse(buf.c_str()); } diff --git a/osdep/OSUtils.hpp b/osdep/OSUtils.hpp index f8214ef..f4419e4 100644 --- a/osdep/OSUtils.hpp +++ b/osdep/OSUtils.hpp @@ -285,6 +285,11 @@ public: */ static std::string platformDefaultHomePath(); + /** + * @return Platform default path for packaged BackOne system addons + */ + static std::string platformDefaultSystemAddonsPath(); + #ifndef OMIT_JSON_SUPPORT static nlohmann::json jsonParse(const std::string &buf); static std::string jsonDump(const nlohmann::json &j,int indentation = 1); diff --git a/pkg/common/platform-paths.sh b/pkg/common/platform-paths.sh new file mode 100644 index 0000000..0d260b7 --- /dev/null +++ b/pkg/common/platform-paths.sh @@ -0,0 +1,49 @@ +# Shared BackOne install paths for addon packaging scripts. +# Source this file; do not execute directly. + +_backone_detect_platform() { + case "$(uname -s 2>/dev/null)" in + Darwin) BACKONE_PLATFORM=mac ;; + Linux) BACKONE_PLATFORM=linux ;; + MINGW*|MSYS*|CYGWIN*) BACKONE_PLATFORM=windows ;; + *) BACKONE_PLATFORM=linux ;; + esac +} + +_backone_default_home() { + case "${BACKONE_PLATFORM}" in + mac) printf '%s\n' "/Library/Application Support/BackOne" ;; + windows) + if [ -n "${ProgramData:-}" ]; then + printf '%s\n' "${ProgramData}/BackOne" + elif [ -n "${PROGRAMDATA:-}" ]; then + printf '%s\n' "${PROGRAMDATA}/BackOne" + else + printf '%s\n' "/c/ProgramData/BackOne" + fi + ;; + *) printf '%s\n' "/var/lib/backone" ;; + esac +} + +_backone_default_addons_dir() { + case "${BACKONE_PLATFORM}" in + mac) printf '%s\n' "/Library/Application Support/BackOne/addons" ;; + windows) + if [ -n "${ProgramFiles:-}" ]; then + printf '%s\n' "${ProgramFiles}/BackOne/addons" + elif [ -n "${PROGRAMFILES:-}" ]; then + printf '%s\n' "${PROGRAMFILES}/BackOne/addons" + else + printf '%s\n' "/c/Program Files/BackOne/addons" + fi + ;; + *) printf '%s\n' "/usr/lib/backone/addons" ;; + esac +} + +backone_resolve_paths() { + _backone_detect_platform + BACKONE_HOME="${BACKONE_HOME:-$(_backone_default_home)}" + BACKONE_ADDONS_DIR="${BACKONE_ADDONS_DIR:-$(_backone_default_addons_dir)}" +} diff --git a/pkg/mac/build-addon-pkgs.sh b/pkg/mac/build-addon-pkgs.sh new file mode 100755 index 0000000..6d6c873 --- /dev/null +++ b/pkg/mac/build-addon-pkgs.sh @@ -0,0 +1,49 @@ +#!/bin/bash +# Build macOS .pkg installers for BackOne addons (mirrors debian/backone-addon-* packages). +set -euo pipefail + +ROOT="$(cd "$(dirname "$0")/../.." && pwd)" +VERSION="$(cat "${ROOT}/debian/version" 2>/dev/null || echo 1.17.1)" +STAGING="${ROOT}/build/mac-addon-staging" +PKGOUT="${ROOT}/build/mac-addon-pkgs" +SCRIPTS="${ROOT}/pkg/mac/scripts" + +if ! command -v pkgbuild >/dev/null 2>&1; then + echo "pkgbuild not found; run this script on macOS with Xcode command-line tools" >&2 + exit 1 +fi + +rm -rf "${STAGING}" "${PKGOUT}" +mkdir -p "${PKGOUT}" + +build_component_pkg() { + local pkg_name="$1" + local install_target="$2" + local identifier="$3" + local staging="${STAGING}/${pkg_name}" + local output="${PKGOUT}/${pkg_name}-${VERSION}.pkg" + + rm -rf "${staging}" + mkdir -p "${staging}" + make -C "${ROOT}" BACKONE_PLATFORM=mac DESTDIR="${staging}" "${install_target}" + chmod 755 "${SCRIPTS}/postinstall" + + pkgbuild \ + --root "${staging}" \ + --install-location / \ + --identifier "${identifier}" \ + --version "${VERSION}" \ + --scripts "${SCRIPTS}" \ + "${output}" + + echo "built ${output}" +} + +build_component_pkg backone-app-shell install-app-shell com.backone.app-shell +build_component_pkg backone-addon-comms-core install-addon-comms-core com.backone.addon.comms-core +build_component_pkg backone-addon-voice install-addon-voice com.backone.addon.voice +build_component_pkg backone-addon-video install-addon-video com.backone.addon.video +build_component_pkg backone-addon-chat install-addon-chat com.backone.addon.chat +build_component_pkg backone-addon-updater install-addon-updater com.backone.addon.updater + +echo "All macOS addon packages are in ${PKGOUT}" diff --git a/pkg/mac/scripts/postinstall b/pkg/mac/scripts/postinstall new file mode 100755 index 0000000..86c8180 --- /dev/null +++ b/pkg/mac/scripts/postinstall @@ -0,0 +1,18 @@ +#!/bin/bash +# Postinstall for macOS BackOne addon packages (pkgbuild expects this filename). +set -euo pipefail + +ADDONS_DIR="/Library/Application Support/BackOne/addons" +HOME_DIR="/Library/Application Support/BackOne" + +if [ -x "${ADDONS_DIR}/updater/backone-updater" ]; then + BACKONE_HOME="${HOME_DIR}" BACKONE_ADDONS_DIR="${ADDONS_DIR}" \ + "${ADDONS_DIR}/updater/backone-updater" rebuild-manifest || true +fi + +if [ -x "${ADDONS_DIR}/updater/merge-local-conf.sh" ]; then + BACKONE_HOME="${HOME_DIR}" "${ADDONS_DIR}/updater/merge-local-conf.sh" \ + '{"settings":{"enableWebServer":true}}' || true +fi + +exit 0 diff --git a/pkg/windows/build-addon-packages.ps1 b/pkg/windows/build-addon-packages.ps1 new file mode 100644 index 0000000..3975539 --- /dev/null +++ b/pkg/windows/build-addon-packages.ps1 @@ -0,0 +1,65 @@ +#Requires -Version 5.1 +<# +.SYNOPSIS + Build Windows addon packages for BackOne (mirrors debian/backone-addon-* packages). + +.DESCRIPTION + Creates per-addon ZIP archives with the same layout as Linux .deb packages: + ProgramData\BackOne\app\... + Program Files\BackOne\addons\... +#> +param( + [string]$Version = (Get-Content -Path (Join-Path $PSScriptRoot "..\..\debian\version") -ErrorAction SilentlyContinue), + [string]$Arch = "x64" +) + +$ErrorActionPreference = "Stop" +$Root = (Resolve-Path (Join-Path $PSScriptRoot "..\..")).Path +if (-not $Version) { $Version = "1.17.1" } + +$StagingRoot = Join-Path $Root "build\windows-addon-staging" +$OutDir = Join-Path $Root "build\windows-addon-pkgs" +$Make = "make" + +function Invoke-MakeInstall { + param( + [string]$Target, + [string]$StageDir + ) + if (Test-Path $StageDir) { Remove-Item -Recurse -Force $StageDir } + New-Item -ItemType Directory -Path $StageDir | Out-Null + & $Make -C $Root BACKONE_PLATFORM=windows DESTDIR="$StageDir" $Target + if ($LASTEXITCODE -ne 0) { throw "make $Target failed" } +} + +function New-AddonZip { + param( + [string]$PackageName, + [string]$InstallTarget + ) + $StageDir = Join-Path $StagingRoot $PackageName + Invoke-MakeInstall -Target $InstallTarget -StageDir $StageDir + + $ZipPath = Join-Path $OutDir "${PackageName}-${Version}-win-${Arch}.zip" + if (Test-Path $ZipPath) { Remove-Item -Force $ZipPath } + Compress-Archive -Path (Join-Path $StageDir "*") -DestinationPath $ZipPath -Force + Write-Host "built $ZipPath" +} + +if (Test-Path $OutDir) { Remove-Item -Recurse -Force $OutDir } +New-Item -ItemType Directory -Path $OutDir | Out-Null + +$Packages = @( + @{ Name = "backone-app-shell"; Target = "install-app-shell" }, + @{ Name = "backone-addon-comms-core"; Target = "install-addon-comms-core" }, + @{ Name = "backone-addon-voice"; Target = "install-addon-voice" }, + @{ Name = "backone-addon-video"; Target = "install-addon-video" }, + @{ Name = "backone-addon-chat"; Target = "install-addon-chat" }, + @{ Name = "backone-addon-updater"; Target = "install-addon-updater" } +) + +foreach ($pkg in $Packages) { + New-AddonZip -PackageName $pkg.Name -InstallTarget $pkg.Target +} + +Write-Host "All Windows addon packages are in $OutDir" diff --git a/service/AddonHost.cpp b/service/AddonHost.cpp new file mode 100644 index 0000000..3a3b55e --- /dev/null +++ b/service/AddonHost.cpp @@ -0,0 +1,283 @@ +/* + * Copyright (c)2019 ZeroTier, Inc. + * + * Use of this software is governed by the Business Source License included + * in the LICENSE.TXT file in the project's root directory. + */ +/****/ + +#include "AddonHost.hpp" + +#include "../node/Constants.hpp" +#include "../osdep/OSUtils.hpp" + +namespace ZeroTier { + +AddonHost::AddonHost(const std::string &homePath) : + _homePath(homePath), + _systemAddonsPath(OSUtils::platformDefaultSystemAddonsPath()), + _enabledRegistryPath(homePath + ZT_PATH_SEPARATOR_S "addons.d" + ZT_PATH_SEPARATOR_S "enabled.json") +{ +} + +bool AddonHost::isAddonEnabled(const std::string &id, const nlohmann::json &localConfig) const +{ + try { + if (localConfig.contains("settings") && localConfig["settings"].is_object()) { + const nlohmann::json &settings = localConfig["settings"]; + if (settings.contains("enabledAddons") && settings["enabledAddons"].is_array()) { + for (const auto &entry : settings["enabledAddons"]) { + if (entry.is_string() && entry.get() == id) { + return true; + } + } + return false; + } + } + } catch ( ... ) { + } + return true; +} + +void AddonHost::loadFromDirectory(const std::string &dir, bool systemDir) +{ + if (!OSUtils::fileExists(dir.c_str(), false)) { + return; + } + const std::vector entries(OSUtils::listDirectory(dir.c_str())); + for (std::vector::const_iterator i(entries.begin()); i != entries.end(); ++i) { + if (*i == "." || *i == "..") { + continue; + } + const std::string manifestPath = dir + ZT_PATH_SEPARATOR_S + *i + ZT_PATH_SEPARATOR_S "addon.json"; + std::string manifestRaw; + if (!OSUtils::readFile(manifestPath.c_str(), manifestRaw)) { + continue; + } + try { + nlohmann::json manifest = OSUtils::jsonParse(manifestRaw); + if (!manifest.contains("id") || !manifest["id"].is_string()) { + continue; + } + AddonEntry entry; + entry.id = manifest["id"].get(); + entry.name = manifest.contains("name") && manifest["name"].is_string() + ? manifest["name"].get() : entry.id; + entry.version = manifest.contains("version") && manifest["version"].is_string() + ? manifest["version"].get() : "0.0.0"; + entry.manifest = manifest; + entry.systemPath = dir + ZT_PATH_SEPARATOR_S + *i; + if (systemDir) { + entry.appPath = _homePath + ZT_PATH_SEPARATOR_S "app" + ZT_PATH_SEPARATOR_S "addons" + + ZT_PATH_SEPARATOR_S + entry.id; + } else { + entry.appPath = entry.systemPath + ZT_PATH_SEPARATOR_S "frontend"; + } + for (std::vector::iterator j(_addons.begin()); j != _addons.end(); ++j) { + if (j->id == entry.id) { + * j = entry; + goto next_entry; + } + } + _addons.push_back(entry); + } catch ( ... ) { + } + next_entry:; + } +} + +void AddonHost::load(const nlohmann::json &localConfig) +{ + _addons.clear(); + loadFromDirectory(_systemAddonsPath, true); + loadFromDirectory(_homePath + ZT_PATH_SEPARATOR_S "addons.d", false); + std::vector filtered; + for (std::vector::const_iterator i(_addons.begin()); i != _addons.end(); ++i) { + if (isAddonEnabled(i->id, localConfig)) { + filtered.push_back(*i); + } + } + _addons.swap(filtered); +} + +nlohmann::json AddonHost::mergedManifest() const +{ + nlohmann::json out = nlohmann::json::array(); + for (std::vector::const_iterator i(_addons.begin()); i != _addons.end(); ++i) { + if (!i->manifest.contains("frontend") || !i->manifest["frontend"].is_object()) { + continue; + } + nlohmann::json item = nlohmann::json::object(); + item["id"] = i->id; + item["name"] = i->name; + item["version"] = i->version; + if (i->manifest.contains("frontend") && i->manifest["frontend"].is_object()) { + item["frontend"] = i->manifest["frontend"]; + } + if (i->manifest.contains("requires") && i->manifest["requires"].is_array()) { + item["requires"] = i->manifest["requires"]; + } + out.push_back(item); + } + return out; +} + +void AddonHost::configureStaticMounts(httplib::Server &s, httplib::Server &sv6) +{ + for (std::vector::const_iterator i(_addons.begin()); i != _addons.end(); ++i) { + if (!OSUtils::fileExists((i->appPath + ZT_PATH_SEPARATOR_S "index.js").c_str()) + && !OSUtils::fileExists((i->appPath + ZT_PATH_SEPARATOR_S "index.html").c_str())) { + continue; + } + const std::string mountPath = std::string("/app/addons/") + i->id; + s.set_mount_point(mountPath, i->appPath); + sv6.set_mount_point(mountPath, i->appPath); + } +} + +void AddonHost::configureRoutes( + httplib::Server &s, + httplib::Server &sv6, + const std::function &setContent) +{ + auto manifestGet = [this, setContent](const httplib::Request &req, httplib::Response &res) { + setContent(req, res, mergedManifest().dump()); + }; + s.Get("/app/addons/manifest.json", manifestGet); + sv6.Get("/app/addons/manifest.json", manifestGet); + + const std::string contactsPath = _homePath + ZT_PATH_SEPARATOR_S "contacts.json"; + + auto contactsGet = [contactsPath, setContent](const httplib::Request &req, httplib::Response &res) { + std::string raw; + if (!OSUtils::readFile(contactsPath.c_str(), raw)) { + setContent(req, res, "{}"); + return; + } + try { + nlohmann::json c = OSUtils::jsonParse(raw); + if (!c.is_object()) { + setContent(req, res, "{}"); + return; + } + setContent(req, res, c.dump()); + } catch ( ... ) { + setContent(req, res, "{}"); + } + }; + s.Get("/app/api/contacts", contactsGet); + sv6.Get("/app/api/contacts", contactsGet); + s.Get("/api/backone/contacts", contactsGet); + sv6.Get("/api/backone/contacts", contactsGet); + + auto contactsPut = [contactsPath, setContent](const httplib::Request &req, httplib::Response &res) { + try { + nlohmann::json incoming = OSUtils::jsonParse(req.body); + if (!incoming.is_object()) { + res.status = 400; + setContent(req, res, "{\"error\":\"body must be a JSON object\"}"); + return; + } + nlohmann::json merged = nlohmann::json::object(); + std::string existing; + if (OSUtils::readFile(contactsPath.c_str(), existing)) { + nlohmann::json cur = OSUtils::jsonParse(existing); + if (cur.is_object()) { + merged = cur; + } + } + for (auto it = incoming.begin(); it != incoming.end(); ++it) { + merged[it.key()] = it.value(); + } + const std::string out = merged.dump(); + if (!OSUtils::writeFile(contactsPath.c_str(), out.data(), (unsigned int)out.length())) { + res.status = 500; + setContent(req, res, "{\"error\":\"could not write contacts\"}"); + return; + } + OSUtils::lockDownFile(contactsPath.c_str(), false); + setContent(req, res, merged.dump()); + } catch ( ... ) { + res.status = 400; + setContent(req, res, "{\"error\":\"invalid JSON\"}"); + } + }; + s.Put("/app/api/contacts", contactsPut); + s.Post("/app/api/contacts", contactsPut); + sv6.Put("/app/api/contacts", contactsPut); + sv6.Post("/app/api/contacts", contactsPut); + s.Put("/api/backone/contacts", contactsPut); + s.Post("/api/backone/contacts", contactsPut); + sv6.Put("/api/backone/contacts", contactsPut); + sv6.Post("/api/backone/contacts", contactsPut); + + const std::string authTokenPath = _homePath + ZT_PATH_SEPARATOR_S "authtoken.secret"; + + auto authtokenGet = [authTokenPath, setContent](const httplib::Request &req, httplib::Response &res) { + std::string token; + if (!OSUtils::readFile(authTokenPath.c_str(), token)) { + res.status = 404; + setContent(req, res, "{\"error\":\"authtoken not found\"}"); + return; + } + while (!token.empty() && (token.back() == '\n' || token.back() == '\r' || token.back() == ' ' || token.back() == '\t')) { + token.pop_back(); + } + size_t start = 0; + while (start < token.size() && (token[start] == ' ' || token[start] == '\t' || token[start] == '\n' || token[start] == '\r')) { + ++start; + } + if (start > 0) { + token = token.substr(start); + } + nlohmann::json out = nlohmann::json::object(); + out["token"] = token; + out["source"] = "authtoken.secret"; + setContent(req, res, out.dump()); + }; + s.Get("/app/api/authtoken", authtokenGet); + sv6.Get("/app/api/authtoken", authtokenGet); + s.Get("/api/backone/authtoken", authtokenGet); + sv6.Get("/api/backone/authtoken", authtokenGet); +} + +bool AddonHost::hasUiAddons(const std::string &homePath) +{ + const std::string manifestPath = homePath + ZT_PATH_SEPARATOR_S "app" + ZT_PATH_SEPARATOR_S "addons" + + ZT_PATH_SEPARATOR_S "manifest.json"; + std::string manifestRaw; + if (OSUtils::readFile(manifestPath.c_str(), manifestRaw)) { + try { + nlohmann::json manifest = OSUtils::jsonParse(manifestRaw); + if (manifest.is_array() && !manifest.empty()) { + return true; + } + } catch ( ... ) { + } + } + const std::string addonsDir(OSUtils::platformDefaultSystemAddonsPath()); + if (!OSUtils::fileExists(addonsDir.c_str(), false)) { + return false; + } + const std::vector entries(OSUtils::listDirectory(addonsDir.c_str())); + for (std::vector::const_iterator i(entries.begin()); i != entries.end(); ++i) { + if (*i == "." || *i == "..") { + continue; + } + std::string manifestRaw2; + const std::string path = addonsDir + ZT_PATH_SEPARATOR_S + *i + ZT_PATH_SEPARATOR_S "addon.json"; + if (!OSUtils::readFile(path.c_str(), manifestRaw2)) { + continue; + } + try { + nlohmann::json m = OSUtils::jsonParse(manifestRaw2); + if (m.contains("frontend") && m["frontend"].is_object()) { + return true; + } + } catch ( ... ) { + } + } + return false; +} + +} // namespace ZeroTier diff --git a/service/AddonHost.hpp b/service/AddonHost.hpp new file mode 100644 index 0000000..ad5fc44 --- /dev/null +++ b/service/AddonHost.hpp @@ -0,0 +1,66 @@ +/* + * Copyright (c)2019 ZeroTier, Inc. + * + * Use of this software is governed by the Business Source License included + * in the LICENSE.TXT file in the project's root directory. + */ +/****/ + +#ifndef ZT_ADDONHOST_HPP +#define ZT_ADDONHOST_HPP + +#include +#include + +#include +#include + +namespace ZeroTier { + +/** + * Loads separated BackOne addons from /usr/lib/backone/addons and + * /var/lib/backone/addons.d, serves merged UI manifest and static mounts. + */ +class AddonHost +{ +public: + struct AddonEntry + { + std::string id; + std::string name; + std::string version; + std::string systemPath; + std::string appPath; + nlohmann::json manifest; + }; + + AddonHost(const std::string &homePath); + + void load(const nlohmann::json &localConfig); + + nlohmann::json mergedManifest() const; + + const std::vector &addons() const { return _addons; } + + void configureStaticMounts(httplib::Server &s, httplib::Server &sv6); + + void configureRoutes( + httplib::Server &s, + httplib::Server &sv6, + const std::function &setContent); + + static bool hasUiAddons(const std::string &homePath); + +private: + bool isAddonEnabled(const std::string &id, const nlohmann::json &localConfig) const; + void loadFromDirectory(const std::string &dir, bool systemDir); + + std::string _homePath; + std::string _systemAddonsPath; + std::string _enabledRegistryPath; + std::vector _addons; +}; + +} // namespace ZeroTier + +#endif diff --git a/service/OneService.cpp b/service/OneService.cpp index cf2d7fe..4654873 100644 --- a/service/OneService.cpp +++ b/service/OneService.cpp @@ -58,6 +58,7 @@ #include "OneService.hpp" #include "SoftwareUpdater.hpp" +#include "AddonHost.hpp" #include @@ -811,6 +812,8 @@ public: bool _allowSecondaryPort; bool _enableWebServer; + AddonHost _addonHost; + unsigned int _primaryPort; unsigned int _secondaryPort; unsigned int _tertiaryPort; @@ -895,6 +898,7 @@ public: OneServiceImpl(const char *hp,unsigned int port) : _homePath((hp) ? hp : ".") + ,_addonHost((hp) ? hp : ".") ,_controllerDbPath(_homePath + ZT_PATH_SEPARATOR_S "controller.d") ,_networksPath(_homePath + ZT_PATH_SEPARATOR_S "networks.d") ,_moonsPath(_homePath + ZT_PATH_SEPARATOR_S "moons.d") @@ -1613,6 +1617,12 @@ public: } }; + { + Mutex::Lock lc(_localConfig_m); + _addonHost.load(_localConfig); + } + _addonHost.configureRoutes(_controlPlane, _controlPlaneV6, setContent); + // // static file server for app ui' // @@ -1639,8 +1649,6 @@ public: if (ret) { // fallback to /index.html for paths that don't exist for SPAs auto indexFallbackGet = [](const httplib::Request &req, httplib::Response &res) { - // fprintf(stderr, "fallback \n"); - auto match = req.matches[1]; if (match.matched) { @@ -1664,8 +1672,6 @@ public: }; auto slashRedirect = [](const httplib::Request &req, httplib::Response &res) { - // fprintf(stderr, "redirect \n"); - // add .html std::string htmlFile; char htmlPath[16384]; @@ -1690,16 +1696,18 @@ public: // }; // auto fix no trailing slash by adding .html or redirecting to path/ - _controlPlane.Get(appUiPath + R"((/[\w|-]+)+$)", slashRedirect); - _controlPlaneV6.Get(appUiPath + R"((/[\w|-]+)+$)", slashRedirect); + _controlPlane.Get("/app(?!/api)(/[\w|-]+)+$", slashRedirect); + _controlPlaneV6.Get("/app(?!/api)(/[\w|-]+)+$", slashRedirect); // // 404 missing assets for *.ext paths // s.Get(appUiPath + R"(/\.\w+$)", missingAssetGet); // sv6.Get(appUiPath + R"(/\.\w+$)", missingAssetGet); // fallback to index.html for unknown paths/files - _controlPlane.Get(appUiPath + R"((/[\w|-]+)(/[\w|-]+)*/$)", indexFallbackGet); - _controlPlaneV6.Get(appUiPath + R"((/[\w|-]+)(/[\w|-]+)*/$)", indexFallbackGet); + _controlPlane.Get("/app(?!/api)(/[\w|-]+)(/[\w|-]+)*/$", indexFallbackGet); + _controlPlaneV6.Get("/app(?!/api)(/[\w|-]+)(/[\w|-]+)*/$", indexFallbackGet); + + _addonHost.configureStaticMounts(_controlPlane, _controlPlaneV6); } } @@ -1759,6 +1767,11 @@ public: isAuth = true; } + // Addon JSON API (outside /app static mount) + if (req.path.rfind("/api/backone", 0) == 0) { + isAuth = true; + } + if (!isAuth) { // check auth token if (req.has_header("x-zt1-auth")) { @@ -2027,6 +2040,10 @@ public: }; _controlPlane.Get(networkListPath, networkListGet); _controlPlaneV6.Get(networkListPath, networkListGet); + _controlPlane.Get("/app/api/networks", networkListGet); + _controlPlaneV6.Get("/app/api/networks", networkListGet); + _controlPlane.Get("/api/backone/networks", networkListGet); + _controlPlaneV6.Get("/api/backone/networks", networkListGet); auto networkGet = [&, setContent](const httplib::Request &req, httplib::Response &res) { Mutex::Lock _l(_nets_m); @@ -2045,6 +2062,10 @@ public: }; _controlPlane.Get(networkPath, networkGet); _controlPlaneV6.Get(networkPath, networkGet); + _controlPlane.Get("/app/api/network/([0-9a-fA-F]{16})", networkGet); + _controlPlaneV6.Get("/app/api/network/([0-9a-fA-F]{16})", networkGet); + _controlPlane.Get("/api/backone/network/([0-9a-fA-F]{16})", networkGet); + _controlPlaneV6.Get("/api/backone/network/([0-9a-fA-F]{16})", networkGet); auto networkPost = [&, setContent](const httplib::Request &req, httplib::Response &res) { auto input = req.matches[1]; @@ -2119,6 +2140,18 @@ public: }; _controlPlane.Delete(networkPath, networkDelete); _controlPlaneV6.Delete(networkPath, networkDelete); + _controlPlane.Post("/app/api/network/([0-9a-fA-F]{16})", networkPost); + _controlPlane.Put("/app/api/network/([0-9a-fA-F]{16})", networkPost); + _controlPlaneV6.Post("/app/api/network/([0-9a-fA-F]{16})", networkPost); + _controlPlaneV6.Put("/app/api/network/([0-9a-fA-F]{16})", networkPost); + _controlPlane.Delete("/app/api/network/([0-9a-fA-F]{16})", networkDelete); + _controlPlaneV6.Delete("/app/api/network/([0-9a-fA-F]{16})", networkDelete); + _controlPlane.Post("/api/backone/network/([0-9a-fA-F]{16})", networkPost); + _controlPlane.Put("/api/backone/network/([0-9a-fA-F]{16})", networkPost); + _controlPlaneV6.Post("/api/backone/network/([0-9a-fA-F]{16})", networkPost); + _controlPlaneV6.Put("/api/backone/network/([0-9a-fA-F]{16})", networkPost); + _controlPlane.Delete("/api/backone/network/([0-9a-fA-F]{16})", networkDelete); + _controlPlaneV6.Delete("/api/backone/network/([0-9a-fA-F]{16})", networkDelete); auto peerListGet = [&, setContent](const httplib::Request &req, httplib::Response &res) { ZT_PeerList *pl = _node->peers(); @@ -2139,6 +2172,10 @@ public: }; _controlPlane.Get(peerListPath, peerListGet); _controlPlaneV6.Get(peerListPath, peerListGet); + _controlPlane.Get("/app/api/peers", peerListGet); + _controlPlaneV6.Get("/app/api/peers", peerListGet); + _controlPlane.Get("/api/backone/peers", peerListGet); + _controlPlaneV6.Get("/api/backone/peers", peerListGet); auto peerGet = [&, setContent](const httplib::Request &req, httplib::Response &res) { ZT_PeerList *pl = _node->peers(); @@ -2229,6 +2266,10 @@ public: }; _controlPlane.Get(statusPath, statusGet); _controlPlaneV6.Get(statusPath, statusGet); + _controlPlane.Get("/app/api/status", statusGet); + _controlPlaneV6.Get("/app/api/status", statusGet); + _controlPlane.Get("/api/backone/status", statusGet); + _controlPlaneV6.Get("/api/backone/status", statusGet); #if ZT_SSO_ENABLED std::string ssoPath = "/sso"; @@ -2586,7 +2627,13 @@ public: } _allowTcpFallbackRelay = (OSUtils::jsonBool(settings["allowTcpFallbackRelay"],true) && !_node->bondController()->inUse()); _forceTcpRelay = (_forceTcpRelayTmp && !_node->bondController()->inUse()); - _enableWebServer = (OSUtils::jsonBool(settings["enableWebServer"],false)); + if (settings.contains("enableWebServer") && !settings["enableWebServer"].is_null()) { + _enableWebServer = OSUtils::jsonBool(settings["enableWebServer"],false); + } else if (AddonHost::hasUiAddons(_homePath)) { + _enableWebServer = true; + } else { + _enableWebServer = false; + } #ifdef ZT_TCP_FALLBACK_RELAY _fallbackRelayAddress = InetAddress(OSUtils::jsonString(settings["tcpFallbackRelay"], ZT_TCP_FALLBACK_RELAY).c_str()); diff --git a/version.h b/version.h index 8fff820..056f469 100644 --- a/version.h +++ b/version.h @@ -22,7 +22,7 @@ /** * Minor version */ -#define ZEROTIER_ONE_VERSION_MINOR 14 +#define ZEROTIER_ONE_VERSION_MINOR 17 /** * Revision -- 2.54.0 From a45fa67ed29479d09fa9f770e3566fa3cb3268a2 Mon Sep 17 00:00:00 2001 From: ariskadatabisnis Date: Tue, 30 Jun 2026 13:44:11 +0700 Subject: [PATCH 2/3] chat addon --- app-tray/backone-tray.py | 89 +++++++++++++++++++++++++++++++- debian/backone-app-tray.postinst | 8 +++ debian/backone.service | 1 + debian/postinst | 5 ++ 4 files changed, 102 insertions(+), 1 deletion(-) diff --git a/app-tray/backone-tray.py b/app-tray/backone-tray.py index 3826865..8b3849d 100755 --- a/app-tray/backone-tray.py +++ b/app-tray/backone-tray.py @@ -5,6 +5,7 @@ import signal import subprocess import sys import threading +import time import urllib.request import gi @@ -21,11 +22,13 @@ from gi.repository import GLib, Gtk APP_URL = os.environ.get('BACKONE_APP_URL', 'http://127.0.0.1:9993/app/') HEALTH_URL = os.environ.get('BACKONE_HEALTH_URL', 'http://127.0.0.1:9993/health') ICON_NAME = 'network-workgroup' +SERVICE_WAIT_SECONDS = int(os.environ.get('BACKONE_SERVICE_WAIT', '45')) class BackOneTray: def __init__(self): self._windows = [] + self._service_ready = False self.indicator = AppIndicator3.Indicator.new( 'backone-tray', ICON_NAME, @@ -39,6 +42,7 @@ class BackOneTray: pass self._update_status() GLib.timeout_add_seconds(30, self._on_timer) + GLib.idle_add(self._bootstrap_service) def _build_menu(self): menu = Gtk.Menu() @@ -67,15 +71,94 @@ class BackOneTray: except Exception: return False + def _systemd_active(self): + try: + result = subprocess.run( + ['systemctl', 'is-active', 'backone'], + capture_output=True, + text=True, + timeout=5, + ) + return result.returncode == 0 and result.stdout.strip() == 'active' + except (OSError, subprocess.TimeoutExpired): + return False + + def _start_service(self): + for cmd in ( + ['systemctl', 'start', 'backone'], + ['pkexec', 'systemctl', 'start', 'backone'], + ): + try: + result = subprocess.run( + cmd, + capture_output=True, + timeout=30, + ) + if result.returncode == 0: + return True + except (OSError, subprocess.TimeoutExpired): + continue + return False + + def _wait_for_service(self, timeout=SERVICE_WAIT_SECONDS): + deadline = time.time() + timeout + while time.time() < deadline: + if self._service_ok(): + self._service_ready = True + return True + time.sleep(0.5) + return False + + def _ensure_service(self): + if self._service_ok(): + self._service_ready = True + return True + if not self._systemd_active(): + self._start_service() + return self._wait_for_service() + + def _bootstrap_service(self): + def worker(): + ready = self._ensure_service() + GLib.idle_add(self._on_bootstrap_done, ready) + threading.Thread(target=worker, daemon=True).start() + return False + + def _on_bootstrap_done(self, ready): + self._service_ready = ready + self._update_status() + return False + def _update_status(self): - title = 'BackOne (online)' if self._service_ok() else 'BackOne (offline)' + online = self._service_ok() + self._service_ready = online + title = 'BackOne (online)' if online else 'BackOne (offline)' self.indicator.set_title(title) def _on_timer(self): self._update_status() return True + def _show_offline_dialog(self): + dialog = Gtk.MessageDialog( + transient_for=None, + flags=0, + message_type=Gtk.MessageType.ERROR, + buttons=Gtk.ButtonsType.OK, + text='BackOne service is not running', + ) + dialog.format_secondary_text( + 'Could not reach the BackOne web server on 127.0.0.1:9993.\n\n' + 'Use "Restart BackOne Service" from the tray menu, or run:\n' + ' sudo systemctl start backone' + ) + dialog.run() + dialog.destroy() + def _open_url(self, url): + if not self._ensure_service(): + self._show_offline_dialog() + return if self._try_webkit(url): return for cmd in ( @@ -115,6 +198,10 @@ class BackOneTray: stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, ) + def worker(): + ready = self._wait_for_service(timeout=30) + GLib.idle_add(self._on_bootstrap_done, ready) + threading.Thread(target=worker, daemon=True).start() def main(): diff --git a/debian/backone-app-tray.postinst b/debian/backone-app-tray.postinst index 1379578..d90d17f 100644 --- a/debian/backone-app-tray.postinst +++ b/debian/backone-app-tray.postinst @@ -6,6 +6,14 @@ case "$1" in elif [ -x /usr/lib/backone/addons/updater/rebuild-addon-manifest.sh ]; then BACKONE_HOME=/var/lib/backone /usr/lib/backone/addons/updater/rebuild-addon-manifest.sh || true fi + if [ -x /usr/lib/backone/addons/updater/merge-local-conf.sh ]; then + BACKONE_HOME=/var/lib/backone /usr/lib/backone/addons/updater/merge-local-conf.sh '{"settings":{"enableWebServer":true}}' || true + fi + if [ -d /run/systemd/system ]; then + systemctl daemon-reload 2>/dev/null || true + systemctl enable backone.service 2>/dev/null || true + systemctl start backone.service 2>/dev/null || true + fi ;; esac #DEBHELPER# diff --git a/debian/backone.service b/debian/backone.service index e7bac18..3618c2d 100644 --- a/debian/backone.service +++ b/debian/backone.service @@ -6,6 +6,7 @@ Wants=network-online.target [Service] ExecStart=/usr/sbin/backone Restart=always +RestartSec=5 KillMode=process [Install] diff --git a/debian/postinst b/debian/postinst index a1c49c7..26c59be 100644 --- a/debian/postinst +++ b/debian/postinst @@ -20,6 +20,11 @@ case "$1" in rm -f /etc/systemd/system/backone.service systemctl daemon-reload 2>/dev/null || true fi + # backone must run as root; older packages shipped User=backone which prevents startup + if [ -f /usr/lib/systemd/system/backone.service ] && grep -q '^User=backone' /usr/lib/systemd/system/backone.service 2>/dev/null; then + sed -i '/^User=backone$/d; /^Group=backone$/d; /^StateDirectory=backone$/d' /usr/lib/systemd/system/backone.service + systemctl daemon-reload 2>/dev/null || true + fi if [ -x /usr/lib/backone/addons/updater/sync-authtoken.sh ]; then /usr/lib/backone/addons/updater/sync-authtoken.sh || true elif [ -x /usr/share/backone/sync-authtoken.sh ]; then -- 2.54.0 From 813d3aa06efc313aeee30c279b6f7ac0da434a55 Mon Sep 17 00:00:00 2001 From: ariskadatabisnis Date: Thu, 2 Jul 2026 09:12:57 +0700 Subject: [PATCH 3/3] secure chat addon and stun --- OpenType-TT/BackOneLogo-Regular-SVG.ttf | Bin 0 -> 26352 bytes OpenType-TT/BackOneLogo-Regular.ttf | Bin 0 -> 23304 bytes addons/chat/addon.json | 2 +- addons/chat/frontend/index.js | 145 ++++--- addons/secure-chat/addon.json | 27 ++ addons/secure-chat/frontend/index.js | 186 ++++++++ addons/updater/backone-updater | 3 + .../migrations/004_webrtc_ice_defaults.sh | 14 + .../migrations/005_enable_webhub_defaults.sh | 44 ++ addons/video/addon.json | 2 +- addons/video/frontend/index.js | 122 +++--- addons/voice/addon.json | 2 +- addons/voice/frontend/index.js | 103 +++-- addons/webhub/addon.json | 15 + addons/webhub/backone-webhub | 343 +++++++++++++++ addons/webhub/backone-webhub.service | 15 + app-shell/dist/index.html | 2 + app-shell/dist/main.js | 32 +- app-shell/dist/styles.css | 331 +++++++++++++- app-shell/dist/webhub-client.js | 170 ++++++++ app-shell/dist/webrtc-session.js | 352 +++++++++++++++ ci/scripts/bump_version.sh | 2 +- controller/CommsController.cpp | 405 ++++++++++++++++++ controller/CommsController.hpp | 35 ++ debian/backone-addon-common.postinst | 2 +- .../backone-addon-secure-chat/DEBIAN/control | 12 + .../backone-addon-secure-chat/DEBIAN/postinst | 12 + debian/backone-addon-webhub.postinst | 16 + debian/control | 20 +- debian/rules | 3 + make/install-addons.mk | 47 +- objects.mk | 1 + pkg/common/platform-paths.sh | 34 ++ pkg/common/resolve-install-path.sh | 18 + pkg/mac/build-addon-pkgs.sh | 2 + pkg/windows/build-addon-packages.ps1 | 2 + production_webrtc_ab20e1d2.plan.md | 214 +++++++++ secure_chat_addon_plan_a08dbee2.plan.md | 212 +++++++++ service/AddonHost.cpp | 1 + service/OneService.cpp | 8 + 40 files changed, 2767 insertions(+), 189 deletions(-) create mode 100755 OpenType-TT/BackOneLogo-Regular-SVG.ttf create mode 100755 OpenType-TT/BackOneLogo-Regular.ttf create mode 100644 addons/secure-chat/addon.json create mode 100644 addons/secure-chat/frontend/index.js create mode 100755 addons/updater/migrations/004_webrtc_ice_defaults.sh create mode 100755 addons/updater/migrations/005_enable_webhub_defaults.sh create mode 100644 addons/webhub/addon.json create mode 100755 addons/webhub/backone-webhub create mode 100644 addons/webhub/backone-webhub.service create mode 100644 app-shell/dist/webhub-client.js create mode 100644 app-shell/dist/webrtc-session.js create mode 100644 controller/CommsController.cpp create mode 100644 controller/CommsController.hpp create mode 100644 debian/backone-addon-secure-chat/DEBIAN/control create mode 100755 debian/backone-addon-secure-chat/DEBIAN/postinst create mode 100644 debian/backone-addon-webhub.postinst create mode 100755 pkg/common/resolve-install-path.sh create mode 100644 production_webrtc_ab20e1d2.plan.md create mode 100644 secure_chat_addon_plan_a08dbee2.plan.md diff --git a/OpenType-TT/BackOneLogo-Regular-SVG.ttf b/OpenType-TT/BackOneLogo-Regular-SVG.ttf new file mode 100755 index 0000000000000000000000000000000000000000..68a070e0a33d0de04c7c6c23381fdfc43b324aea GIT binary patch literal 26352 zcmeHv3vg8DeeZX67p=6b)pJ3Mo@ez$NLuYV`xYPp5;ii=L^epoF_w)$*aA@yV7tzZ z)25D#8{gc?9g$>m6Ho4pwVZj;y;V_5F* z|2@uQR}#1(cG9UBvFH2FIp6uee*ee!KP#p&#;Wk2kFk-l(OWUXVE?Q5EZs5IZ+;@& zxffH9VSM-4u3PngI{m$7#y(WVSn#j!Jv4cw;?C-ejCr@>njhSIVotCA&FU}V)+cd& z@BSkP4$Z9!B^g`R&Y0&P4@@3Af_dEgp;CO79+-J>|J>0}{230v%h7?O^}ROr zQLI&t^XX|!biCGhJH{gzw@)9Md*DaYo)<6%ecC-Uv-eK^Zuf~(jP2Tt^UocceBg-Z z0j&?`rZLtJPac|j=JH>bFt!`d^Hv_2JvNs+_;il3JrSJ$w18d=Y5(u zr{7N+$4B>8u6>g=fK>dv{C^+g2Y-9%<8#+uy~65=1;$F4hd%Iwd&=1r9O&#CD68i) z{EYf`uJ_03o#Mz9WyOYlKIzbVg%k^6sT zPwv^mkr$TdhcL=mfCZtD5UXI7P*63iVYLv@a<+oiu?SlULu>#AO{|%U z*1I2H6lSYy;Z}Qikz6 z!Zxv6*sW|c8)dh#Eo>{>#j^fDMtKV|Q+i}YW$J-|KQ~IgV zeW&zW^y$fcXM7#}6DOulP4w$$*x2|%{D1p+^vwE+2J3KYVqyU6_-Gy6g3C`$V1@hS z3i#wx{a10(vfeHF8E@y#@ehojd1R#F%=(duhGO{+(kM|HSX$&kixFH~4)TLsyvm}~CGu*}Ttykv6(5PFYx4)`o** zae$=1;Twpt;lT+xQB4!otYUED9Qow z<<;Q|Pg}G#=1FPQ(UqQPtG{G~PuBBZqhN^z1l1a&dfkc1Mq|&ihh6 z@)u8hO8ZH^PWwsVg8MYx;`-Ud^Q(WN{p6kB%SVvsc!*06qztd#!we@k z9YlNw5f35*@cbbNE>Lxr>F3X~Fg{nGj~lh1*&>-Ju1=~cVuEIpwKceYZbWsBRU`B4)=Xa= zs}6hoEUNWr%ftQ>e_Lx;XDXRVuhG((G$_ubA@{l!bgs>7pTty?7Oq=SmyjoWw9c;1 zby}P6WWFo^NBJ|_PHnsPH@WYZBwgNx3zICg6_i0UDysut>_eC# zkW@|fr?G36jcH6-WT|zeS!aj1}HmK0P?6+ue&%g0^s}mK+JJYDHqq)`~$gH%R8^5Tx2UfZAd5Bj@2@DQbm!IFed`q!u8l z1xRWEl3IYI79gnwNNNF+T7aY$AgKjNY5|g36p~tiq!x~(7A)I)Uf?rLh!UPq0fy_T zSw@>e2$2N1ns}c!x`Yoy7zTF?Yqr5Jd zzu@8e;i?KqOHg=#3h)2sshw(Q!$YX-#9ux8wH?6~L9O@l;JlCF>I;A-{F;aA#^o{w zoP!Ulh6o``is2MdS8C)voZ(45LVbp?hKeqEbwqHZa%#DcRsIv|7oBVM9Dq&{9P3B< z`e#`bQVv17E43;u-7%=qqYyDFJcu!f*c3XNy?mmrwX>@o;_Q7%3slsHdPftDP3ERm zliTL!x8J>LliAdm80`(!SL83gl!sZPECp0vTJQC>5A8D3eYXwtRCVr{fB6z*zP+=m zXJE81W9}Mi_j%W!*LoGbD?smSh~kRgdYfJigrjZ%y;RsQx~3!EoZozGuvXzbaXXw+DyZxqyZ?3lk$3OMfU zu&8VE4}qEd#3gPC=ZE}lL%YbA`Jf-*r5_GzH=ALPurEmYmP<^OgUl3+m#{G=KlkI4 z=8qCqB3%9)D-mEN0<1)Ul?bpB0ahZwN(5Mm04ot-B?7EOfRzZaf}Bf4od~cJ;aG`a z*#Rt1v1|mNG@g{>LnN)j5M;+4cZ5;KCTA_^)KX`t}Wr4O5h?;tt@8;oDoOXABZ>*s3!!7mf?=ghCj+=h2EPDk4S?1FXbphY0B8+>)&OV?fYtzL4S?1FXbphY zfTA@3S_3w%id0Fd(;DrROi@X;xr?!~uOgl_vRS80R}h^mB%L9f&JZR;pfdzIL!dK+ z1wx=R1Uf^YGXy$ApfdzIL!dLH=nR2QgdL>2CA0ehkZyZG)0(FZj|Um2unHQ z6PYHdRz|K6L#$NM=q<}c%j|F^>EJTUvTi3GMY(mHL>RY4XeYl^>%zxJbyay%-sGrF zV2UXuVmyyhGJD%1$L~syxhzB0$)EL7olhC9NJJHfB9|6 zLh)BTwiNk|@-*)-%4uzn_=a@`d-kvaCw)1$UV4bW9!L3>q>1E$dI4>M1!oORj0mj& z*#+8A(B&IR7ZkN`G2+Y(@?s?j+x77MB_)wO=hIe1{sIY~`+bh5wQk<}iIsi_Z&{ki zDrFScDb-=(W-+T1o=ebW%ld6qn_M4eLUBG65289%YynM|IcJL*T>gU4qEnBCn^$RP zb_FN_$K9{Mm#rmUF~}`5S*}@SwTQMhRzv{}SE{HL0#Nm^P@M1{PQ`#HXJ#iDw)jKw zrs75i_SQz-yvPj$o0mG$Tb;B?6+%F`!w(R1RB7-^(h4jpuGALq97xxw_6b}rLD{Wc zP!`1=u%Z;s{imukZ5g<|gpitDUcU3Rh)&!|dH=Vw&R^7?`$!CZ4tuVk3G4_^h!uK- z7-W#82*5)GnX?sOmkSG5#W^k)gt^gJ>_s_`1Y4)!3ww5Rt|GCr7RX5kU{~F(>{;#! zBfq5l;W1}4v@=Y(D`>k?gz1}^#)_AoSTs*S)N%s=EAY!Zm~~WO48|FF05i; z{@|T*cb;2!yZ6HzNU;s1X|O7`7zB|kKqS?sI*4?J69MLTOXh-Uf9V3GGT5XC9p~Uz zQ8y>Kmd>GP*n~{!95mO&%BpK}Aay0!qUwJoNGv~3rx;s_Q;;a%2hh?9lQz1sZBeH2 z{R&k7U0Tc==^5-OIli`c&BjR2y3Wf_E!#tzV;cwJxwrY&Sjjh@SiSR>T&;Ia)A-n} z{P617)iJR}H@3UU%eU^hOnt~dU>z%fl*5wJMr8kdHzj~F=4K`T!djwG$Z~Mo3x(8D zMy84Zv7@}u6tyTStO)%xe#A@Y!pUW-RiPs1fNy~|#e%x2M$d?J8nnk@qjogXm2pj>L2skEEG?8*ljL^i0 zV`3XkY;#Q5Rkc)NFI~|~(MV2=(ZrZ5-GbbCeBvpiiq6GB$qHsXBXdVE)oT%ftK3TJ zDNzv-iB~5GuN1HB0{oh*M)b)0=o+D>Hz<))y3v3fl^Tc)NGvTLDsFJ@Ba3w{XEA2!o>O#RPlGiGSh)tR>Nq|5>42hCNK@2E}0R=IjAO;k~fPxrM z5CaNgKtT*BhyevLpdbbm#1sl*KtW8PAPqy8eaL7l?IH7|Nf&t_GI_Kgsc(too_d-h z>FVmNuKNBf+GhV}KeGFdJMQ@Cr30Poo3h#5ZT`<{wJ$vX{PX#Le(N_j+}F2f&-f#y z|5Yo~op6$}7HY&yH^1zi)JO#q!k~276b3;fw$9qc8rCj`rIQ zOm7}N{h9pt^E>k&%>PCHd(S?r1?kl}nG4~_WW!DyFCo#CFuVUPTgbKxiP04?DZJG@ zFu7yq^>ck?4P+!L+p`oo;ITqAc)47%`ec zwB=z0a-BMpo`Wk~(JkDxt>Xo`0^FVJ*dBxIxQzuXzgKGDT{PD|Y7MEhhI9;w*U{FU zXw20C;&p&{9Uxu@h}Qw)b%1ysAYKQE*8$>nfOs7sUI&QdR?%#z1H|h%#BF@T>w@2O zJ9@8mE2^vfCBQd_H~L6Xa}bd)hL=Ee;RK?guRk)rXU~T|^45{7Kg~a$Kc$`cmiC+$ z@PAGl{l`~cc_n}L(*FOl>yA76ric8W(>JDDTT>gOm-gphe*r&Qjh5fMb!z{XQ7x{S z+8=1oXsOT7f9tvY#r&JkK07)(b?<0rTevIJ-k$BO{o)sZ{x6XJuOMfG{r9?i%|#V} zbdXh6go%>$q7o4FrXnSujWFdPOj#B}c0%UfB6G(Pr|H4~?Cr3hTl+Crt(c&!f(IHk zu*zMy8V65n+0>GlmNlHslZ?%F7;Ppdn~6yoSM6;Ko*an=q-D@Iq5gBe9w1`f67^qE zuYCdm^JOI!h)9LNBH#--QBDZ|-pg)x%Bje|%k5;_zuTJvQY_LsM6|3acKA`iU?tTa z{8b@Q5-TH6v;jX}QM%+ioDsZ{(b6E4Bh`hb_xy?4|Fc)W)kyO(%djyF`toZQL! z&h~7QU7I`Co-~%=mQB0(&I(Yo3O>b$H6huwcM}yyg`XOtsA5WVR&YgNp&AhN>J{{T zL5z-6alpxs48Ar$GC34(ZMh_$>LhxRi-?phVcQ$aMsP}#Q%X-sY7O7L{j{Rn(Gd0& zH6E|Z4)MfTjI_Z$QB;Q@& zyYW1J`&|hLZ8T=Yi!OM%$Y0{2O>Lz}xn-k9~Y zcqmX~4GwMzu3Vh(y*?i2>D@9{&m}6cXgdPfpHx@%8gz-C$KkqAr8bSh{MWnV6uW2*N(4MTQ6*{B6vA#8AqH~%C!?7 z=PrdhEA}R!VQUp(t1_1>sMm^8cNrmU9$mS78P?)mShd?<7`Vw)7b#2@z~l|5FBUJT z?iQ}{gAMfH{_t{@0YABaeu;i%jWlL$zZ!{2qPrui#ZnZfFI3NCTssma-*B;z(ZnP5yR+*1ODV zM_J~6d(za}75_CmEDyF}f8Sc((W)|WNzFw(>bj077 zyxl5d^!4&(X9km^_U+tL?f%-Ky#t~! z=-e)1_jOWeSBm3dylcB(3(hyzM@BYw(A%_kZ=b)Rd>S6w&aj0&$@tj!ZtY15*$$X4 z=hb8-1(wq)uqRbeRYwb~Xz_PUih*vM&PA(gEO^HR_R{T+KSii&F1GH)vs$@8cHeL6TFdZ z)Wf30zmKgO=)vyYxZZHKdpCH)*=nZ3K)}YYYO_W7F00?-+QluZUzg~&SlbT-8cHqX zH;1jEd*8unSifj{1(=uguVr^Gi3?fy+9}h!>8&UzL7%@qEfw1z7WC4J{9#coyhK06 z-N5joUnT)mg8T-4ZLry5-xwS2ion<2d~ewOc1eWu@sBW4TeQqK(74*d)ro2 zkydL*G=AKBxb7Z_E9+aLM`C@!%G$}p!F$rwuw$`t9eFR&({RdLaDbxGetG?UYGsfu zS-lKbo>Y{=F44nZns+o87yBXlbwOJ#9AF`Bk6W-iu;fQGR7_*O4HtT{?Tqr+CXs3G1e| z796r(y&w;^te5C5xOlK?W_$Nq_3ac3H?gH4b-?=xE?i0-*z_;aPjJz{&{q3RZ6i2j zo>{O*Wz+m_`Uoy2xDspyEX0%kUbYV$Jde3~{)PGn0`>nv+XEyst3Tk%*@|qt$WE5% z4=iOTR!sV3wFMk@(Czl^MRC;b3&=0iz+j8L;xBb0pEk4DeU5)GXycx>p0(b9_eJkT z-*(@ZmOWV#E*UBLT*>SH+x=hhzg~K0=?}_QmCXmr14jb+;9T%$<(tbtA6gN*ucD^n z^~#S|UaUG%^=kEr>c6d-tNHud+iL$fyfOUP@{;BEEq`sroh$ybuD)(Q!Xo=4f3kAp z%73okQ~!g8)`mwL&Np^8{`V$N(|FU1&9UYuS{hp(ZFybaqyI448vT6qO6%>dFSNzm z9%%b+d#wG5_E$UZ>A2Flzwz zYll2uhU@Q<$0e9QB#+B*?<4X!fR^Vc?`txr; zmd9Rp7yG$9_OVXw1M+woTcMql$0eBmq&zNT6`EQzz~b8Taz4aXX+IsFJ@Vkug9oPP zbTe)yHcsAq|Bk~`TW1fG>`|T0;!wxb^z58I10n(&W@dCw-ZA~?)Um0fC#Lqr z@JDH8*%9_2JIW5?kETttIjF(J_xn!MAiapw~KvqlH)LD_Ca@f2x6(KGxu+kFEHg3H<@p zh40l1?p>IMh3_qV?md!6qJ9cbo&`6$^;|Kl!vskZ(>P1=nZYMXA^;v|@K1M0?-(CV zK_VoV6Zn50BtlIZ`q4fs{`#UAIsWJU9L>YLnpg9oiMI@I#J(SYm3HI5=daQFj~_l5 zkH<%Rd*g9~{xg9_4S#*Ml5QFpKTpndqAH%I(him{@J64*0mnHcXDQGRXmnS_4eWaWOu7Rxc128 z+_b*`;LOar*0xkG8PA!mI;h)bq|8JtnbG61cru$yB@BJoFyhHr&N-DyreeudMmLh# zn2|N~WHJ*=WKHXH*huDLiBww8B-61}Hlg>$b*z$$r8E36mB__1rany5xpV@QVX0iq zOl5U5VPfr!wUn7Qld&|eRnIhYriry_Jx*03j+GSEe6ZEb<;++-t@F`vB54p2VwA{a z(y@3>$13qyE}?Ck#e#K#VSw(O zj{8AgPS2#k7GFOeGg4T`z%Zu|Co<_A36uCu<9bjRk0sJ17DYA=wnV=$FY zl0~Tr*nT|2?~LP_3EYtcT3`Z39F|44n#@2Gcr@;ar3hasAR|r_3EY4SQv?Ap1C0P) z_E>6)j6+|R8X88 z!%ku8IovPKo7n{SVQDi9ql1BG;fCRb(?EX~{sh;jA-IH|h8btU0LGvsrKjL8OlZd% zXW$ztgjo~h9&n(;h1w zZB-X2n}^Y4;+DZ<~$O#KH2*HWS~=+1O!F_YnNX%fQ@idY%%8PRFZwcrRKGdX;wAIK^ z;D(!#69S4jqbAG*+&PU6m=NhH2?!DNvaoT4LnsCpKw|(ifPu@>8LHU literal 0 HcmV?d00001 diff --git a/OpenType-TT/BackOneLogo-Regular.ttf b/OpenType-TT/BackOneLogo-Regular.ttf new file mode 100755 index 0000000000000000000000000000000000000000..e2c1b6631fcaa847cffa8431584024edd852d17e GIT binary patch literal 23304 zcmeHP32}(b1%o*i#HxQ6c2wi`~_TkAI>-J+`sFVLkmKS8Ow?==K9sH(S!T3 zp3m5}({#UGdvDu$=)kAGhuv>7w(*YLW1~BoUm5#2&Yi`pb2k?1UMasC_r^U~?e1F+ z-TI5&u4n19@Va5|_>H4~*>Gfnu`Nq*{^?srZ{6>@l{e$uFplH?e{IFHYB z=j|UqcxdUKN0#FAvvK}+`wxumUtfNwn=v1K-u=WWz5emZf4Omc-tsqD8A!$7$$!6F z?ELifCk~x|`7A3X78vs~7j5u|_v8qYj&<3afSNtA$j*zdTrzCO+$>1ZkIGfm^emb8Gy6_ig ztb(@qqjPj$`cwC3p)WHAQdrKkxK!-xbF?LH=|%f=Kee_ce=qKL5a+O+@1^fW?-ie; zwlT3i|1zyvUNx3|d=?j$!KcuV~+*?~(U~^Do!L2Vncr)RcGXp{eNvw_SMWIH!RNwVfa~q1)-1-%LQWd zS(p{DLI|jc6|*Rdu@V?!87Qb=m8=RjkYLrUhSjntajTQr69uvE^(9TgiH0VXIj$NLhndA6v`TvCG(c*3T|y8`u?WBiqCV z*dV)-UB!mj)oe4{!nU$uHo~^Sd0fM;h2a6?pf(#OPevHR+IDvP`SaMPqd1O6am3HR z$=LZ{od3C!6Df@TK0vMki>3|J%s)8%RnG4nndav|InDYio`eS6+plY$X1pmLU%RJo zieHZdR}&T%Ca~vjim#h;*R8v1xMn0i5ufPaF%e%E-#xlx%2Ow{I59RcvM4^qhKBdx z|Eq@+Q>#YGjNP%3k#5|_L-)a3aQVat?r@X31GZvm(K%d{)wCf#JIcOwc`t zhHDa2M<*uACcuX}o@U?9Sl}#kVU=2dBybN%V(m0PI*6NLQT=H&W=Uce#I9$PHa4}W5TQ=Q|XD%HF%stG9yD@n;1|RhU{KFrGXgGsbiXvDY zf+xkFZB@ip5YOQM%HZvixbAY|3XBBT4g(~M%AQ1wjjS9|3t?Iav)q*<$KfyQS*Y+Zg8Oq=Q7^e)d`Bb zIwALHF`cV%nG0zvCWG>Zlqsr$Ffy!F$bojS4OVTsNHs22VCZTM zEv&ID1Zg2?(PlR-bW5lZNDQ>hwbR+fSGt$+wn{+A>*KlZMqZub9gBG}umcn=u1~^c z!BIt=D|t=4i9h0D{EOH&r%$G5(j#YCdKlZ8-_LU{dyBi&*Il@D-QdE@x;NFhOHY4S zA5@=NH96y9Cnt{`n>=}z%}h?_PG&54PwLN-pM=i_75s}ng9iKh8$Vmvo_jdCqA`|O zQs-%Df9;;Sm9$^u&5lgs=JK;<-oD9lApK`9`OhBYs-LlHMPba;N-N2{m1KS#L8?{& zs1_#QcLENUqE@I;AgKySssfU#fTSuQsR~G{0+OnLq$(h(3P`E~lB$5DDj=y!BdH2V zsuD=5!fl&QNPKn@qNFF(fDwACRM93ALSz9zT~~_NGtwn+DAX#%CrzCU`5Xy-aN-*` z`wf(wQ%IoGZz=sYZ@qJKPBfUFaS8nhRRxqKXgolLH-BSdP#>D`kSaU!A>2bpm$cp^xKTM( zdwE6M+6AKZjIed>iY%o=4Wpz^{hx2Lve zOIv62<=u_>$$`m}ry=uA$^6Fd{^qW>Ej_g!_o@@TNz+>ldS5{l*YuW}^l}i6x&ib? z$Qn9GzcTjKC+k!06;e=9L`veto8_g*UD4LJVEe$aW1z5)C|uuIUd96_2vsN2r^?D3 z*SD8**45k(>gon2XR-mu!8(Jw8eb2XNspWsmT;oSSJShFe3=LO0bUltL2YGw(F=M& z$u~z~A_ru4z<3E8Lu$JdTUtLrScwVw3#`O|l^C!R16E?dN(@+u0V^?JB?hd-fRz}q z5(8FZzzT9M8Fga7N=#rShTC@I_7uzdu%+Wsb$km+D>DR{amOBEw6UpG!}!#3ow7y! zrp1m602?!ic(gep4rp^dE7k(Wv0gvrSP3|CEax>6xK>2#`<*jB+f8@&*s?b)oX%YM z`^-$u_nd~6+CpW(l%f0UY&yThI=y(E5yKZF@{1Og!eSbJ1*!FW@=fRG@l9U12vjRY zY?n3SsQLpD2LhF4g#bwqAPE8_L4YI(kOTpeAV3lXNP+-K5FiNxBtd{A2#^FdNP+-K z5FpV4H7p*PnJEDG(k=20-rQ|V*?7pdSE0IdPg8UU>U&>8@( z0ni!%tpU&)0IdPg8UU>U&>GOR20&}Tq*aruD79LnnUZNL$u_qz=6?+Fq@0agWm-&h z7ArbKCY>QHhCpWsbcR4@2sa3U&JgGffzA-<41vxN=nR3*kft*PIuUk|?vlePgM)!5 zo;|mkC;hp5u3SZk8~^2#k1a$5uvJJo#0}gpRY)rBBZn^&K-#0AB@?=^&gf(imLW-J zRMMv-s53-$^81vAQFNNjF|w{RDg%)3_adaFN6yeCc#BuQMaEfph0rSu9Ym|#&C*%e zavb)dtguanDeXpyPK2-yOMD{JB-N_O6=H~$IvTxYn5f?jSBefHvn8y-N{1u2ZXpr2 zm?AWjU#fNC;}daRc~ahFsZC&t9Z1AP9;IdWwn2{1mL3aPhK!T1H&LBW8Ldo2HHR{n zmU%2RkT&7~)%>m*{zX`V$YrEGthMvz$WT`iZ>uD4GVD3IbFN5!bGfh5T_kKtVJ@ib z!pftxls65=f(F;YXwK$8->Rwud4U9~on!lv$v^VLfybWu@kgXAARjB=&2|*j5SulU zO>2%w8L?Sk8U{uR)dHu4ceeN|KQecPO|oFEfr$~R6(Bo98ydQzku;;JeTxxic91)jAZ^zr`b%0OX~Czdi1Z8z zU-*52r{#9u77;6pEW9nDg(X@U&N?L=A#UcfI_bG2U8bzx*0srnVI~#lLGd7~Q_U98 zbVhJCm%*iHq!z7uY_;>M?98kH72t&XmH0BXBq|2gGE?Q6QC7=nYhpzf&~T-iS}6cs z4@<>K?_pI8c(P`8l3{~C6mL3i)SOO(ZC1|@f3ra`q0V`VJ!hh;I)0BbTOGv4i<>fn%$mk@Tl>48ob^e_8 z+)QF)INjbeUnNF z@-M9=0fiKS+a@TakTNn|49Jf1Y)dqv$TcGL>tauo(3y)_dQ_n!XSZjTF~zL931enN zy76Hfmbxj$g>s3rQY^_H4fT|yZv0RKnlsQ)RH_C_;!sbLbd$C1%)`{8>|NHh+$$QF zq^Gyt<3RuE$-ED}@YKoR#fUskO7uRcsZyQME!lhG(}5-PoaRdVJMYhG&CS z`7zE{TJuA%ew0FfltO-#LVlD&ew0FfltO-#LVlD&ew0FfltO-#LVjHe`B4h_Mad>q z0>>vECh}&VY%s%Jb`^9X$lK$8X6Hm`${8L9R5Pl3dryI{2c0r%LR&LXv-H6i_2awpspI0Cc~uq<@Y zLWgCcj~4nY3ma)+qh-OYs+AI(=!zzaMrvV*7KUu;7UVAClSmnLbanmgU&*I+6au0iX4uftjhbF>?BfA8wwVXycSqQ+(rv+BtW1bg+xiAAO#epfPxfI zkOB%)KtT#9NC5>YpdbYlq=14HP>=!&QW^y*pdckt&N(+o@Sad>8ekL^Phi-ulIfSV_P?G-u&^?yOOIamMmF%x$m>Q@Y!dcc_#gvw?4f3 zrsi$ihL2|dHTUypj`JhwiS(z>{r2>(^z=(Fc{V=PzkcVA{{G^kg{xOKEqvg?pa0^) zzpJageAn*v{l`9&em*^zzAF9w^benUiU&C?TjfI7Yh!DyHtr?Sc$qo>RwHE7g{0_; zloH-T5t!^T^TN5lwgxg1o$VQl?6zBo&KWWEH+=is7nRj39+3wuU`MSydWZv$#U5&D zp;obUX)_?oe5xoGIIE&LQpTXc=9{_%vM%XjM`A)t641nGPBG;-jwDAE5O})AJb!y9oMj6-Vd`|@hqCHk6J(~Eg&5O z;!$ed$-!I{5RU@lQ9wKjh(`hOC?FmM#G`3h->{Kz-? z(>&n&9Pj_tOE0~Yo<6+&vKY@5T>jOAu}Pfx5(^q#A>=Q0J9zTd!rw7&WH)xDny{s z2S&LIS7YI6IUAc7)2fCuc~Y_245O9AWF;}F;;Pxk5Xq4oKpF;p3F<%V;{h_(%~St5 zX6+*gm?yPVAR-+C9l)1zqMQ)^y@_3Im6OB2t9G*K-_53g5{t4987&K(4nF}Hlu+#< z9u<-$u{Hutt}bTvF~~QESsW>oPQ}kL=@JaBce^Rwdq-b@k9Uz{cN1?#ctUl^%AKn3 zOwXp+HMz6(q;U&j+0@0iR)E|n_%t8Jf@0I`CTfl{w;WMaGbJZ0xFRrH4TyU6Eatu- zCXQ6G+scm$z9v5^Ih1a#NRdx<5Xn>5bJOxPz-Dt*6B_8oqwhF-^B+AnbAs z9?z)>@!;f1nU( zpTKL8EdilMW0!o;1rHbbye?{LYelM-jXu=e2Vi6aG?l-+xf7*Ep|AGg!_>;w=jXK7 zci7~{QJVhO_4dU|%a5f`?G!!i45%CC4AMz1crF3@PT1!qrd;5Eq;hSHIUh#Ql%VJ#!#qM5oR;{0iR9Tmw>*?&NIJuDbZ601C&pQ&2g!SbJqNxp?+TaFC0>|SF+|dy!`2|R@Fzln zKIU+6^KfP3MD+SZoTq2YY?Y5=@?}0m1{3pvdzBXXkQVun7Wt4C`H&X*kQVun7Wt4C z`H&X*kQVun7Wt4C`H&X*bXw#?TI7>yk?i9e@e(^1><&{2sFOc>xJVZRLKbs9{B`!X z)~>EKCuqHZ9#x~)%n8g!FT{Zu1#uYp4NO+@V(a)Cwe{@wDub7`ma)Wntz0wVv34o+ zS=pO_hK;*OTUEJSM!n`p-BpAzd9>y7e%wn;VRg4ZGjNls&QX}mg2{_cUkqMQ-OXO* zOTQ@bSjF0`@xp;e73MYkY-+Qor8dxIB#9rczht{@0QABa=U_WHq$Q_Ax@a>xb}M1vB9 zOd0Vt288QcQ9sc9L==l=S67V)Edvy-3~R|i4Fjtdbuny)Ix|Yhp{BkIiNxmf7utP= zBT+0T7RoJ6f+Q^@6;IU)N7h+ErJ8XXxuW3;H4#R?LoZ03XbYfNc3CT5 zLqDkRk{94brSztunz0*xkG}Yq@u;ORvVK#oi@=t{b%L$T6D&w;z}bgPWf7s{8d8B7O_Zx20O>nrTp-YpA*+7wfr)jU>Gk%-xAV&3j&fg1WD%w#mNxlqk>T)DzkyXAJOgw!p9#?9+BDFp6N21H(=F19@RCI zCAgTo@M84T3^&}A^(!K2<-|hb%UK%sZy3Ho`!4f2LtD?$)>{Z+&aA}$o}V+M5h#~{ z<@Du^Tzm@(j9|cvZ*S}@*wiftg}!B_?izh?`nghf-ZPa6nkT+?PkW1}ZVC2R*5w{< zZ}HZUSm%_jjSpGf$SHYLH5ueIR%F0(981O_zUxCW-ej}QdFD;f3o@bt7bC8r>Wp-n< zvUQlelw*|tpQGfd@$jF}9L4sXVTbL#n>mWz_WsC6CWsY(oHG-fJ{*4DOj=dBZuVW& zf;lrW9RECS-~$_#2>Ht%XoEc;yfDuyK}64DJ{GMFhB-$-w*G;j^tUf26NY%ueyX1l#RVw@wtGTU_|NTW+-OLee zOb8{I3Yd+j`1?6Nu<$%&=lMO&4G%#4FSNwxE@~N4{ZnFG)mJhp@yOz5H?&sX6JexdU$a=^d@%DK? z=Y7?8weL~itJ&9Nzvy4!pA6&#_6O3zL&4W`*5`aaR2;e~w;=b`yieqv%0H6-a`;I2 zrv--!{^;x0SwFR$X>i*@^OG z`QKK!Duyebt4vkiTUB0lSJkWWZSkKZsuQ12oUOjP`q`S6npw5-R3x7tfhu8xC+M4nGw;kBCYxkjeTT5Ge@92#;59}MeVtm*5 zRb#sj?;Sm`W$eJgJ>&c0t*Mq}^gFZ5ESEH^YnHXOw016AcSTogo8@fWc?Zi`{oWh! ziR1gm){P&C(^>4sv9x>qP<$_l2&~?_H!jFK7(Xy}aO}X5u^lP=D9t$A&u(J}*dF|7 z+HQ6TYG}jv{prU`d)X*{O6_JSV;>vC&ytSgigElL*BG{k@l!UVc-Iyj9bgCX?r~fd z$L~F*@a|>!md>DsAuo=GSO_hxhGiX=&;6Y;S34rT^N1 OMvh;f%_EkH%l`p&g|=V- literal 0 HcmV?d00001 diff --git a/addons/chat/addon.json b/addons/chat/addon.json index f2cc745..6b0ccb6 100644 --- a/addons/chat/addon.json +++ b/addons/chat/addon.json @@ -2,7 +2,7 @@ "id": "chat", "name": "Chat P2P", "version": "1.17.1", - "requires": ["comms-core"], + "requires": ["comms-core", "webhub"], "backoneCore": { "apis": [ "/app/api/peers", diff --git a/addons/chat/frontend/index.js b/addons/chat/frontend/index.js index 14f0d81..9688588 100644 --- a/addons/chat/frontend/index.js +++ b/addons/chat/frontend/index.js @@ -4,12 +4,27 @@ window.BackOneAddons.chat = function chatAddon() { const messagesByPeer = {}; let selectedPeer = null; let root = null; + let unsubChat = null; + + function escapeHtml(s) { + return String(s).replace(/&/g, '&').replace(//g, '>'); + } + + function clearSessionMessages() { + Object.keys(messagesByPeer).forEach(k => delete messagesByPeer[k]); + } function getThread(peerId) { if (!messagesByPeer[peerId]) messagesByPeer[peerId] = []; return messagesByPeer[peerId]; } + function formatTime(ts) { + if (!ts) return ''; + const d = new Date(ts); + return d.toLocaleString(undefined, { hour: '2-digit', minute: '2-digit', month: 'short', day: 'numeric' }); + } + function networkLabel() { const n = BackOneNetworkSession.getActiveNetwork(); return n ? (n.name || n.id) : BackOneNetworkSession.getNetworkId(); @@ -32,35 +47,37 @@ window.BackOneAddons.chat = function chatAddon() { header.textContent = net ? `Select a contact on ${net}` : 'Join a network in the header bar'; return; } - header.innerHTML = `${selectedPeer.displayName || selectedPeer.peerId} ${selectedPeer.peerId}${net ? ' · ' + net : ''}`; + header.innerHTML = `${escapeHtml(selectedPeer.displayName || selectedPeer.peerId)} ${escapeHtml(selectedPeer.peerId)}${net ? ' · ' + escapeHtml(net) : ''}`; updateConnectionBar(); } + function selfName() { + const addr = (BackOneNetworkSession.getCoreStatus().address || '').toLowerCase(); + return addr ? addr.slice(0, 10) + '…' : 'me'; + } + return { mount(container) { root = container; + clearSessionMessages(); container.innerHTML = ` -
        +
        -
        -
        Chat P2P > Select contact
        -
        Select a contact
        -
        +
        -
        @@ -71,31 +88,63 @@ window.BackOneAddons.chat = function chatAddon() { const thread = container.querySelector('#chat-thread'); const input = container.querySelector('#chat-input'); - const fileInput = container.querySelector('#chat-file'); const sendBtn = container.querySelector('#chat-send'); - function updateInputs() { - const ok = !!BackOneNetworkSession.getNetworkId() && !!selectedPeer; - input.disabled = !ok; - fileInput.disabled = !ok; - sendBtn.disabled = !ok; - renderHeader(); - const bc = root.querySelector('#chat-breadcrumb-peer'); - if (bc) bc.textContent = selectedPeer ? (selectedPeer.displayName || selectedPeer.peerId) : 'Select contact'; - } - const render = () => { if (!selectedPeer) { - thread.innerHTML = '

        Choose a peer from the list

        '; + thread.innerHTML = '

        Choose a contact from the list

        '; return; } const messages = getThread(selectedPeer.peerId); - thread.innerHTML = messages.map(m => - `
        ${m.senderName || m.sender || 'me'}: ${m.body || ''}${m.file ? ` [${m.file}]` : ''}
        ` - ).join(''); + if (!messages.length) { + thread.innerHTML = '

        No messages yet — start the conversation

        '; + return; + } + thread.innerHTML = messages.map(m => ` +
        +
        + ${escapeHtml(m.senderName || m.sender || 'peer')} + ${escapeHtml(formatTime(m.at))} +
        + ${m.body ? `
        ${escapeHtml(m.body)}
        ` : ''} +
        `).join(''); thread.scrollTop = thread.scrollHeight; }; + function updateInputs() { + const networkId = BackOneNetworkSession.getNetworkId(); + const ok = !!networkId && !!selectedPeer; + input.disabled = !ok; + sendBtn.disabled = !ok; + renderHeader(); + } + + if (unsubChat) unsubChat(); + unsubChat = BackOneWebHubClient.subscribe('chat_message', (msg) => { + const networkId = BackOneNetworkSession.getNetworkId(); + if (!networkId || (msg.networkId && msg.networkId.toLowerCase() !== networkId)) return; + const senderId = (msg.senderId || '').toLowerCase(); + const peerId = selectedPeer?.peerId?.toLowerCase(); + if (!peerId || senderId !== peerId) { + if (senderId) { + getThread(senderId).push({ + sender: senderId, + senderName: msg.senderName || senderId, + body: msg.body || '', + at: msg.at || Date.now() + }); + } + return; + } + getThread(peerId).push({ + sender: senderId, + senderName: msg.senderName || senderId, + body: msg.body || '', + at: msg.at || Date.now() + }); + render(); + }); + BackOnePeerPicker(container.querySelector('#chat-peer-picker'), { layout: 'sidebar', showActionButton: false, @@ -106,6 +155,7 @@ window.BackOneAddons.chat = function chatAddon() { }, onNetworkChange() { selectedPeer = null; + clearSessionMessages(); updateInputs(); render(); } @@ -116,40 +166,27 @@ window.BackOneAddons.chat = function chatAddon() { render(); }); - sendBtn.onclick = async () => { + sendBtn.onclick = () => { const networkId = BackOneNetworkSession.getNetworkId(); if (!selectedPeer || !networkId) return; const body = input.value.trim(); - const selfName = 'me'; - if (fileInput.files.length) { - const fd = new FormData(); - fd.append('file', fileInput.files[0]); - fd.append('networkId', networkId); - await BackOneAuth.fetchWithAuth(`/controller/comms/network/${networkId}/chat/attachment`, { - method: 'POST', - body: fd - }).catch(() => {}); - getThread(selectedPeer.peerId).push({ - sender: selfName, - senderName: selfName, - body: '', - file: fileInput.files[0].name - }); - fileInput.value = ''; - } - if (body) { - await BackOneAuth.fetchWithAuth(`/controller/comms/network/${networkId}/chat`, { - method: 'POST', - headers: { 'Content-Type': 'application/json' }, - body: JSON.stringify({ body, targetId: selectedPeer.peerId, networkId }) - }).catch(() => {}); - getThread(selectedPeer.peerId).push({ - sender: selfName, - senderName: selfName, - body - }); - input.value = ''; - } + if (!body) return; + const now = Date.now(); + const name = selfName(); + BackOneWebHubClient.send({ + type: 'chat_message', + networkId, + targetId: selectedPeer.peerId, + senderName: name, + body + }); + getThread(selectedPeer.peerId).push({ + sender: 'me', + senderName: name, + body, + at: now + }); + input.value = ''; render(); }; diff --git a/addons/secure-chat/addon.json b/addons/secure-chat/addon.json new file mode 100644 index 0000000..42dba0d --- /dev/null +++ b/addons/secure-chat/addon.json @@ -0,0 +1,27 @@ +{ + "id": "secure-chat", + "name": "Secure Chat", + "version": "1.17.1", + "requires": ["comms-core", "webhub"], + "backoneCore": { + "apis": [ + "/app/api/peers", + "/app/api/networks", + "POST /app/api/network/{nwid}", + "DELETE /app/api/network/{nwid}", + "/app/api/network/{nwid}", + "/app/api/network/{nwid}/members", + "/app/api/authtoken", + "/app/api/contacts" + ] + }, + "backend": { + "routes": ["/controller/comms/network"], + "websocketEvents": ["secure_chat_message"] + }, + "frontend": { + "entry": "/app/addons/secure-chat/index.js", + "navLabel": "Secure Chat", + "icon": "chat" + } +} diff --git a/addons/secure-chat/frontend/index.js b/addons/secure-chat/frontend/index.js new file mode 100644 index 0000000..c4110f6 --- /dev/null +++ b/addons/secure-chat/frontend/index.js @@ -0,0 +1,186 @@ +window.BackOneAddons = window.BackOneAddons || {}; + +window.BackOneAddons['secure-chat'] = function secureChatAddon() { + const messagesByPeer = {}; + let selectedPeer = null; + let root = null; + let unsubChat = null; + + function escapeHtml(s) { + return String(s).replace(/&/g, '&').replace(//g, '>'); + } + + function clearSessionMessages() { + Object.keys(messagesByPeer).forEach(k => delete messagesByPeer[k]); + } + + function getThread(peerId) { + if (!messagesByPeer[peerId]) messagesByPeer[peerId] = []; + return messagesByPeer[peerId]; + } + + function formatTime(ts) { + if (!ts) return ''; + const d = new Date(ts); + return d.toLocaleString(undefined, { hour: '2-digit', minute: '2-digit', month: 'short', day: 'numeric' }); + } + + function networkLabel() { + const n = BackOneNetworkSession.getActiveNetwork(); + return n ? (n.name || n.id) : BackOneNetworkSession.getNetworkId(); + } + + function renderHeader() { + const header = root?.querySelector('#secure-chat-header'); + if (!header) return; + const net = networkLabel(); + if (!selectedPeer) { + header.textContent = net ? `Select a contact on ${net}` : 'Join a network in the header bar'; + return; + } + header.innerHTML = `${escapeHtml(selectedPeer.displayName || selectedPeer.peerId)} ${escapeHtml(selectedPeer.peerId)}${net ? ' · ' + escapeHtml(net) : ''}`; + } + + function selfName() { + const addr = (BackOneNetworkSession.getCoreStatus().address || '').toLowerCase(); + return addr ? addr.slice(0, 10) + '…' : 'me'; + } + + return { + mount(container) { + root = container; + clearSessionMessages(); + container.innerHTML = ` +
        + +
        +
        +
        Select a contact
        +
        +
        + +
        + +
        +
        +
        +
        +
        `; + + const thread = container.querySelector('#secure-chat-thread'); + const input = container.querySelector('#secure-chat-input'); + const sendBtn = container.querySelector('#secure-chat-send'); + + const render = () => { + if (!selectedPeer) { + thread.innerHTML = '

        Choose a contact from the list

        '; + return; + } + const messages = getThread(selectedPeer.peerId); + if (!messages.length) { + thread.innerHTML = '

        No messages yet — start the conversation

        '; + return; + } + thread.innerHTML = messages.map(m => ` +
        +
        + ${escapeHtml(m.senderName || m.sender || 'me')} + ${escapeHtml(formatTime(m.at))} +
        + ${m.body ? `
        ${escapeHtml(m.body)}
        ` : ''} +
        `).join(''); + thread.scrollTop = thread.scrollHeight; + }; + + function updateInputs() { + const networkId = BackOneNetworkSession.getNetworkId(); + const ok = !!networkId && !!selectedPeer; + input.disabled = !ok; + sendBtn.disabled = !ok; + renderHeader(); + } + + if (unsubChat) unsubChat(); + unsubChat = BackOneWebHubClient.subscribe('chat_message', (msg) => { + const networkId = BackOneNetworkSession.getNetworkId(); + if (!networkId || (msg.networkId && msg.networkId.toLowerCase() !== networkId)) return; + const senderId = (msg.senderId || '').toLowerCase(); + const peerId = selectedPeer?.peerId?.toLowerCase(); + if (!peerId || senderId !== peerId) { + if (senderId) { + getThread(senderId).push({ + sender: senderId, + senderName: msg.senderName || senderId, + body: msg.body || '', + at: msg.at || Date.now() + }); + } + return; + } + getThread(peerId).push({ + sender: senderId, + senderName: msg.senderName || senderId, + body: msg.body || '', + at: msg.at || Date.now() + }); + render(); + }); + + BackOnePeerPicker(container.querySelector('#secure-chat-peer-picker'), { + layout: 'sidebar', + showActionButton: false, + onSelect(peer) { + selectedPeer = peer; + updateInputs(); + render(); + }, + onNetworkChange() { + selectedPeer = null; + clearSessionMessages(); + updateInputs(); + render(); + } + }); + + BackOneNetworkSession.subscribe(() => { + updateInputs(); + render(); + }); + + sendBtn.onclick = () => { + const networkId = BackOneNetworkSession.getNetworkId(); + if (!selectedPeer || !networkId) return; + const body = input.value.trim(); + if (!body) return; + const now = Date.now(); + const name = selfName(); + BackOneWebHubClient.send({ + type: 'chat_message', + networkId, + targetId: selectedPeer.peerId, + senderName: name, + body + }); + getThread(selectedPeer.peerId).push({ + sender: 'me', + senderName: name, + body, + at: now + }); + input.value = ''; + render(); + }; + + updateInputs(); + render(); + } + }; +}; diff --git a/addons/updater/backone-updater b/addons/updater/backone-updater index 2ea7006..2b17b41 100755 --- a/addons/updater/backone-updater +++ b/addons/updater/backone-updater @@ -55,6 +55,9 @@ run_migrations() { 003_*) [ "$scope" = "all" ] || [ "$scope" = "core" ] || continue ;; + 004_*|005_*) + [ "$scope" = "all" ] || [ "$scope" = "core" ] || continue + ;; *) if [ "$scope" != "all" ] && [ "$scope" != "$ADDON_SCOPE" ]; then continue diff --git a/addons/updater/migrations/004_webrtc_ice_defaults.sh b/addons/updater/migrations/004_webrtc_ice_defaults.sh new file mode 100755 index 0000000..e1694a5 --- /dev/null +++ b/addons/updater/migrations/004_webrtc_ice_defaults.sh @@ -0,0 +1,14 @@ +#!/bin/bash +set -euo pipefail +BACKONE_HOME="${BACKONE_HOME:-/var/lib/backone}" +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" +if [ -x "${SCRIPT_DIR}/merge-local-conf.sh" ]; then + BACKONE_HOME="$BACKONE_HOME" bash "${SCRIPT_DIR}/merge-local-conf.sh" '{ + "settings": { + "icePreferOverlay": true, + "iceServers": [{"urls": "stun:stun.l.google.com:19302"}], + "iceFallbackTimeoutMs": 8000, + "webhubPort": 9994 + } + }' +fi diff --git a/addons/updater/migrations/005_enable_webhub_defaults.sh b/addons/updater/migrations/005_enable_webhub_defaults.sh new file mode 100755 index 0000000..3053353 --- /dev/null +++ b/addons/updater/migrations/005_enable_webhub_defaults.sh @@ -0,0 +1,44 @@ +#!/bin/bash +set -euo pipefail +BACKONE_HOME="${BACKONE_HOME:-/var/lib/backone}" +CONF="${BACKONE_HOME}/local.conf" + +python3 - "$CONF" <<'PY' +import json +import os +import sys + +path = sys.argv[1] +defaults = ["comms-core", "webhub", "voice", "video", "chat"] +current = {} +if os.path.isfile(path): + with open(path, encoding="utf-8") as f: + try: + current = json.load(f) + except json.JSONDecodeError: + current = {} +if not isinstance(current, dict): + current = {} +settings = current.setdefault("settings", {}) +if not isinstance(settings, dict): + settings = {} + current["settings"] = settings +enabled = settings.get("enabledAddons") +if enabled is None: + # No explicit list — all installed addons stay enabled. + sys.exit(0) +if not isinstance(enabled, list): + enabled = [] +merged = list(enabled) +for addon in defaults: + if addon not in merged: + merged.append(addon) +settings["enabledAddons"] = merged +os.makedirs(os.path.dirname(path), exist_ok=True) +with open(path, "w", encoding="utf-8") as f: + json.dump(current, f, indent=2) + f.write("\n") +PY + +chown backone:backone "$CONF" 2>/dev/null || true +chmod 644 "$CONF" 2>/dev/null || true diff --git a/addons/video/addon.json b/addons/video/addon.json index 77d85c4..18b8d9e 100644 --- a/addons/video/addon.json +++ b/addons/video/addon.json @@ -2,7 +2,7 @@ "id": "video", "name": "Video Call P2P", "version": "1.17.1", - "requires": ["comms-core", "voice"], + "requires": ["comms-core", "webhub", "voice"], "backoneCore": { "apis": [ "/app/api/peers", diff --git a/addons/video/frontend/index.js b/addons/video/frontend/index.js index 40dda4e..8e7b7dc 100644 --- a/addons/video/frontend/index.js +++ b/addons/video/frontend/index.js @@ -1,20 +1,13 @@ window.BackOneAddons = window.BackOneAddons || {}; window.BackOneAddons.video = function videoAddon() { - let pc = null; let picker = null; let selectedPeer = null; let inCall = false; - let localStream = null; let micEnabled = true; let camEnabled = true; let root = null; - function networkLabel() { - const n = BackOneNetworkSession.getActiveNetwork(); - return n ? (n.name || n.id) : BackOneNetworkSession.getNetworkId(); - } - function updateConnectionBar() { const bar = root?.querySelector('#video-conn-bar'); if (!bar || !window.BackOneCommLayout) return; @@ -53,19 +46,40 @@ window.BackOneAddons.video = function videoAddon() { updateConnectionBar(); } - function showPlaceholder(show) { - const ph = root?.querySelector('#video-placeholder'); - const remote = root?.querySelector('#video-remote'); - if (ph) ph.style.display = show ? 'block' : 'none'; - if (remote) remote.style.display = show ? 'none' : 'block'; + function updateCallLayout() { + const layout = root?.querySelector('.comm-layout'); + if (layout) layout.classList.toggle('video-in-call', inCall); } - function hangUp() { - if (pc) { pc.close(); pc = null; } - if (localStream) { - localStream.getTracks().forEach(t => t.stop()); - localStream = null; + function showPlaceholder(show) { + const stage = root?.querySelector('.video-stage'); + const remote = root?.querySelector('#video-remote'); + const phLabel = root?.querySelector('#video-ph-label'); + if (stage) stage.classList.toggle('has-remote', !show); + if (remote) remote.classList.toggle('active', !show); + if (phLabel && show) { + phLabel.textContent = inCall + ? 'Waiting for remote peer…' + : (selectedPeer ? 'Ready to call' : 'Select a peer to start a video call'); } + updateCallLayout(); + } + + function bindStreams() { + const local = root?.querySelector('#video-local'); + const remote = root?.querySelector('#video-remote'); + const localStream = BackOneWebRtcSession.getLocalStream(); + const remoteStream = BackOneWebRtcSession.getRemoteStream(); + if (local && localStream) local.srcObject = localStream; + if (remote && remoteStream && remoteStream.getTracks().length) { + remote.srcObject = remoteStream; + showPlaceholder(false); + root?.querySelector('#video-breadcrumb-state')?.textContent = 'Connected to'; + } + } + + async function hangUp() { + await BackOneWebRtcSession.hangUp(); const local = root?.querySelector('#video-local'); const remote = root?.querySelector('#video-remote'); if (local) local.srcObject = null; @@ -73,6 +87,8 @@ window.BackOneAddons.video = function videoAddon() { inCall = false; micEnabled = true; camEnabled = true; + const breadcrumbState = root?.querySelector('#video-breadcrumb-state'); + if (breadcrumbState) breadcrumbState.textContent = 'Select peer'; showPlaceholder(true); updateCallButtons(); window.BackOneRingingPopup?.dismiss(); @@ -99,20 +115,23 @@ window.BackOneAddons.video = function videoAddon() {
        -
        Video Call P2P > ${inCall ? 'Connected to' : 'Select peer'} —
        +
        Video Call P2P > Select peer —
        -
        -
        Remote
        -
        -
        👤
        -
        —
        -
        Remote Peer
        +
        +
        +
        +
        👤
        +
        —
        +
        Select a peer to start a video call
        +
        +
        -
        + You
        +
        Remote
        @@ -133,6 +152,7 @@ window.BackOneAddons.video = function videoAddon() { selectedPeer = peer; const phPeer = root.querySelector('#video-ph-peer'); if (phPeer) phPeer.textContent = peer.peerId; + if (!inCall) showPlaceholder(true); updateCallButtons(); }, onNetworkChange() { @@ -142,45 +162,41 @@ window.BackOneAddons.video = function videoAddon() { }); BackOneNetworkSession.subscribe(() => updateCallButtons()); + BackOneWebRtcSession.subscribe((event) => { + if (event === 'call-started') { + inCall = true; + updateCallButtons(); + bindStreams(); + } + if (event === 'remote-track' || event === 'call-accepted') bindStreams(); + if (event === 'call-ended') { + inCall = false; + showPlaceholder(true); + updateCallButtons(); + } + }); callBtn.onclick = async () => { const peer = selectedPeer || picker.getSelectedPeer(); - const networkId = BackOneNetworkSession.getNetworkId(); - if (!peer || !networkId) return; + if (!peer || !BackOneNetworkSession.getNetworkId()) return; try { - pc = new RTCPeerConnection(); - pc.ontrack = (ev) => { - root.querySelector('#video-remote').srcObject = ev.streams[0]; - showPlaceholder(false); - }; - localStream = await navigator.mediaDevices.getUserMedia({ audio: true, video: true }); - root.querySelector('#video-local').srcObject = localStream; - localStream.getTracks().forEach(t => pc.addTrack(t, localStream)); - const offer = await pc.createOffer(); - await pc.setLocalDescription(offer); - await BackOneAuth.fetchWithAuth('/controller/comms/call', { - method: 'POST', - headers: { 'Content-Type': 'application/json' }, - body: JSON.stringify({ - type: 'video', - networkId, - targetId: peer.peerId, - sdp: offer.sdp - }) - }); inCall = true; - root.querySelector('#video-breadcrumb-state').textContent = 'Connected to'; + root.querySelector('#video-breadcrumb-state').textContent = 'Connecting to'; + updateCallLayout(); updateCallButtons(); + await BackOneWebRtcSession.startOutgoingCall(peer, 'video'); + bindStreams(); } catch (err) { - hangUp(); + await hangUp(); alert(err.message || 'Call failed'); } }; - container.querySelector('#video-hangup').onclick = hangUp; - container.querySelector('#video-hangup-stage').onclick = hangUp; + container.querySelector('#video-hangup').onclick = () => hangUp(); + container.querySelector('#video-hangup-stage').onclick = () => hangUp(); container.querySelector('#video-mic').onclick = () => { + const localStream = BackOneWebRtcSession.getLocalStream(); if (!localStream) return; micEnabled = !micEnabled; localStream.getAudioTracks().forEach(t => { t.enabled = micEnabled; }); @@ -188,6 +204,7 @@ window.BackOneAddons.video = function videoAddon() { }; container.querySelector('#video-cam').onclick = () => { + const localStream = BackOneWebRtcSession.getLocalStream(); if (!localStream) return; camEnabled = !camEnabled; localStream.getVideoTracks().forEach(t => { t.enabled = camEnabled; }); @@ -199,7 +216,10 @@ window.BackOneAddons.video = function videoAddon() { if (stage.requestFullscreen) stage.requestFullscreen(); }; + const active = BackOneWebRtcSession.getActiveCall(); + inCall = !!active && active.callType === 'video'; showPlaceholder(true); + if (inCall) bindStreams(); updateCallButtons(); } }; diff --git a/addons/voice/addon.json b/addons/voice/addon.json index 912271d..77a0927 100644 --- a/addons/voice/addon.json +++ b/addons/voice/addon.json @@ -2,7 +2,7 @@ "id": "voice", "name": "Voice Call P2P", "version": "1.17.1", - "requires": ["comms-core"], + "requires": ["comms-core", "webhub"], "backoneCore": { "apis": [ "/app/api/peers", diff --git a/addons/voice/frontend/index.js b/addons/voice/frontend/index.js index b06003e..6e23e4c 100644 --- a/addons/voice/frontend/index.js +++ b/addons/voice/frontend/index.js @@ -1,13 +1,16 @@ window.BackOneAddons = window.BackOneAddons || {}; window.BackOneAddons.voice = function voiceAddon() { - let pc = null; let picker = null; let selectedPeer = null; let inCall = false; - let localStream = null; let micEnabled = true; let root = null; + let remoteAudio = null; + + function escapeHtml(s) { + return String(s).replace(/&/g, '&').replace(//g, '>'); + } function updateConnectionBar() { const bar = root?.querySelector('#voice-conn-bar'); @@ -34,6 +37,16 @@ window.BackOneAddons.voice = function voiceAddon() { } } + function updateActiveBanner() { + const banner = root?.querySelector('#voice-active-banner'); + const label = root?.querySelector('#voice-active-label'); + if (!banner) return; + banner.style.display = inCall && selectedPeer ? 'flex' : 'none'; + if (label && selectedPeer) { + label.textContent = `In call with ${selectedPeer.displayName || selectedPeer.peerId}`; + } + } + function updateCallButtons() { const callBtn = root?.querySelector('#voice-call'); if (callBtn) callBtn.disabled = !selectedPeer || !BackOneNetworkSession.getNetworkId() || inCall; @@ -45,16 +58,26 @@ window.BackOneAddons.voice = function voiceAddon() { } updateHeadStatus(); updateConnectionBar(); + updateActiveBanner(); } - function hangUp() { - if (pc) { pc.close(); pc = null; } - if (localStream) { - localStream.getTracks().forEach(t => t.stop()); - localStream = null; + function syncInCallState() { + const active = BackOneWebRtcSession.getActiveCall(); + inCall = !!active && (active.callType === 'voice' || !active.callType); + if (inCall && active.peer) { + selectedPeer = active.peer.peerId ? active.peer : selectedPeer; + root?.querySelector('#voice-breadcrumb-state')?.textContent = 'Connected to'; } + updateCallButtons(); + } + + async function hangUp() { + await BackOneWebRtcSession.hangUp(); inCall = false; micEnabled = true; + if (remoteAudio) remoteAudio.srcObject = null; + const breadcrumbState = root?.querySelector('#voice-breadcrumb-state'); + if (breadcrumbState) breadcrumbState.textContent = 'Select peer'; updateCallButtons(); window.BackOneRingingPopup?.dismiss(); } @@ -63,11 +86,11 @@ window.BackOneAddons.voice = function voiceAddon() { mount(container) { root = container; container.innerHTML = ` -
        +