diff --git a/domain-server/resources/web/js/shared.js b/domain-server/resources/web/js/shared.js index f4053ebddc..3c7dd2705c 100644 --- a/domain-server/resources/web/js/shared.js +++ b/domain-server/resources/web/js/shared.js @@ -52,6 +52,7 @@ var URLs = { // STABLE METAVERSE_URL: https://metaverse.highfidelity.com // STAGING METAVERSE_URL: https://staging.highfidelity.com METAVERSE_URL: 'https://metaverse.highfidelity.com', + CDN_URL: 'https://cdn.highfidelity.com', PLACE_URL: 'https://hifi.place', }; diff --git a/domain-server/src/DomainServer.cpp b/domain-server/src/DomainServer.cpp index 9fea49d2da..0d30560691 100644 --- a/domain-server/src/DomainServer.cpp +++ b/domain-server/src/DomainServer.cpp @@ -70,13 +70,7 @@ const QString DomainServer::REPLACEMENT_FILE_EXTENSION = ".replace"; int const DomainServer::EXIT_CODE_REBOOT = 234923; -#if USE_STABLE_GLOBAL_SERVICES -const QString ICE_SERVER_DEFAULT_HOSTNAME = "ice.highfidelity.com"; -#else -const QString ICE_SERVER_DEFAULT_HOSTNAME = "dev-ice.highfidelity.com"; -#endif - -QString DomainServer::_iceServerAddr { ICE_SERVER_DEFAULT_HOSTNAME }; +QString DomainServer::_iceServerAddr { NetworkingConstants::ICE_SERVER_DEFAULT_HOSTNAME }; int DomainServer::_iceServerPort { ICE_SERVER_DEFAULT_PORT }; bool DomainServer::_overrideDomainID { false }; QUuid DomainServer::_overridingDomainID; diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 85c2d4abe0..05ddcd5bd3 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -347,7 +347,6 @@ static const QString STANDARD_TO_ACTION_MAPPING_NAME = "Standard to Action"; static const QString NO_MOVEMENT_MAPPING_NAME = "Standard to Action (No Movement)"; static const QString NO_MOVEMENT_MAPPING_JSON = PathUtils::resourcesPath() + "/controllers/standard_nomovement.json"; -static const QString MARKETPLACE_CDN_HOSTNAME = "mpassets.highfidelity.com"; static const int INTERVAL_TO_CHECK_HMD_WORN_STATUS = 500; // milliseconds static const QString DESKTOP_DISPLAY_PLUGIN_NAME = "Desktop"; static const QString ACTIVE_DISPLAY_PLUGIN_SETTING_NAME = "activeDisplayPlugin"; @@ -7620,7 +7619,7 @@ bool Application::askToLoadScript(const QString& scriptFilenameOrURL) { QUrl scriptURL { scriptFilenameOrURL }; - if (scriptURL.host().endsWith(MARKETPLACE_CDN_HOSTNAME)) { + if (scriptURL.host().endsWith(NetworkingConstants::MARKETPLACE_CDN_HOSTNAME)) { int startIndex = shortName.lastIndexOf('/') + 1; int endIndex = shortName.lastIndexOf('?'); shortName = shortName.mid(startIndex, endIndex - startIndex); @@ -7743,7 +7742,7 @@ bool Application::askToReplaceDomainContent(const QString& url) { const int MAX_CHARACTERS_PER_LINE = 90; if (DependencyManager::get()->getThisNodeCanReplaceContent()) { QUrl originURL { url }; - if (originURL.host().endsWith(MARKETPLACE_CDN_HOSTNAME)) { + if (originURL.host().endsWith(NetworkingConstants::MARKETPLACE_CDN_HOSTNAME)) { // Create a confirmation dialog when this call is made static const QString infoText = simpleWordWrap("Your domain's content will be replaced with a new content set. " "If you want to save what you have now, create a backup before proceeding. For more information about backing up " diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index b07117b4be..54ed23d80d 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -799,19 +799,19 @@ Menu::Menu() { // Help > Vircadia Docs action = addActionToQMenuAndActionHash(helpMenu, "Online Documentation"); connect(action, &QAction::triggered, qApp, [] { - QDesktopServices::openUrl(QUrl("https://docs.vircadia.dev/")); + QDesktopServices::openUrl(NetworkingConstants::HELP_DOCS_URL); }); // Help > Vircadia Forum /* action = addActionToQMenuAndActionHash(helpMenu, "Online Forums"); connect(action, &QAction::triggered, qApp, [] { - QDesktopServices::openUrl(QUrl("https://forums.highfidelity.com/")); + QDesktopServices::openUrl(NetworkingConstants::HELP_FORUM_URL)); }); */ // Help > Scripting Reference action = addActionToQMenuAndActionHash(helpMenu, "Online Script Reference"); connect(action, &QAction::triggered, qApp, [] { - QDesktopServices::openUrl(QUrl("https://apidocs.vircadia.dev/")); + QDesktopServices::openUrl(NetworkingConstants::HELP_SCRIPTING_REFERENCE_URL); }); addActionToQMenuAndActionHash(helpMenu, "Controls Reference", 0, qApp, SLOT(showHelp())); @@ -821,13 +821,13 @@ Menu::Menu() { // Help > Release Notes action = addActionToQMenuAndActionHash(helpMenu, "Release Notes"); connect(action, &QAction::triggered, qApp, [] { - QDesktopServices::openUrl(QUrl("https://docs.vircadia.dev/release-notes.html")); + QDesktopServices::openUrl(NetworkingConstants::HELP_RELEASE_NOTES_URL); }); // Help > Report a Bug! action = addActionToQMenuAndActionHash(helpMenu, "Report a Bug!"); connect(action, &QAction::triggered, qApp, [] { - QDesktopServices::openUrl(QUrl("https://github.com/kasenvr/project-athena/issues")); + QDesktopServices::openUrl(NetworkingConstants::HELP_BUG_REPORT_URL); }); } diff --git a/libraries/auto-updater/src/AutoUpdater.cpp b/libraries/auto-updater/src/AutoUpdater.cpp index 300a22983a..d8afac59b2 100644 --- a/libraries/auto-updater/src/AutoUpdater.cpp +++ b/libraries/auto-updater/src/AutoUpdater.cpp @@ -16,6 +16,7 @@ #include #include #include +#include #include AutoUpdater::AutoUpdater() : @@ -36,18 +37,15 @@ void AutoUpdater::checkForUpdate() { this->getLatestVersionData(); } -const QUrl BUILDS_XML_URL("https://highfidelity.com/builds.xml"); -const QUrl MASTER_BUILDS_XML_URL("https://highfidelity.com/dev-builds.xml"); - void AutoUpdater::getLatestVersionData() { QNetworkAccessManager& networkAccessManager = NetworkAccessManager::getInstance(); QUrl buildsURL; if (BuildInfo::BUILD_TYPE == BuildInfo::BuildType::Stable) { - buildsURL = BUILDS_XML_URL; + buildsURL = NetworkingConstants::BUILDS_XML_URL; } else if (BuildInfo::BUILD_TYPE == BuildInfo::BuildType::Master) { - buildsURL = MASTER_BUILDS_XML_URL; + buildsURL = NetworkingConstants::MASTER_BUILDS_XML_URL; } QNetworkRequest latestVersionRequest(buildsURL); diff --git a/libraries/networking/src/NetworkingConstants.h b/libraries/networking/src/NetworkingConstants.h index 3bd84bc977..1d28205310 100644 --- a/libraries/networking/src/NetworkingConstants.h +++ b/libraries/networking/src/NetworkingConstants.h @@ -27,6 +27,28 @@ namespace NetworkingConstants { const QUrl METAVERSE_SERVER_URL_STABLE { "https://metaverse.highfidelity.com" }; const QUrl METAVERSE_SERVER_URL_STAGING { "https://staging-metaverse.vircadia.com" }; + + // Web Engine requests to this parent domain have an account authorization header added + const QString AUTH_HOSTNAME_BASE = "highfidelity.com"; + + const QUrl BUILDS_XML_URL("https://highfidelity.com/builds.xml"); + const QUrl MASTER_BUILDS_XML_URL("https://highfidelity.com/dev-builds.xml"); + + +#if USE_STABLE_GLOBAL_SERVICES + const QString ICE_SERVER_DEFAULT_HOSTNAME = "ice.highfidelity.com"; +#else + const QString ICE_SERVER_DEFAULT_HOSTNAME = "dev-ice.highfidelity.com"; +#endif + + const QString MARKETPLACE_CDN_HOSTNAME = "mpassets.highfidelity.com"; + + const QUrl HELP_DOCS_URL { "https://docs.vircadia.dev" }; + const QUrl HELP_FORUM_URL { "https://forums.vircadia.dev" }; + const QUrl HELP_SCRIPTING_REFERENCE_URL{ "https://apidocs.vircadia.dev/" }; + const QUrl HELP_RELEASE_NOTES_URL{ "https://docs.vircadia.dev/release-notes.html" }; + const QUrl HELP_BUG_REPORT_URL{ "https://github.com/kasenvr/project-athena/issues" }; + } const QString HIFI_URL_SCHEME_ABOUT = "about"; diff --git a/libraries/ui/src/ui/types/RequestFilters.cpp b/libraries/ui/src/ui/types/RequestFilters.cpp index 943dd02c29..9287559289 100644 --- a/libraries/ui/src/ui/types/RequestFilters.cpp +++ b/libraries/ui/src/ui/types/RequestFilters.cpp @@ -29,7 +29,7 @@ namespace { auto metaverseServerURL = MetaverseAPI::getCurrentMetaverseServerURL(); static const QStringList HF_HOSTS = { "highfidelity.com", "highfidelity.io", - metaverseServerURL.toString(), "metaverse.highfidelity.io" + metaverseServerURL.toString(), }; const auto& scheme = url.scheme(); const auto& host = url.host(); diff --git a/script-archive/avatarSelector.js b/script-archive/avatarSelector.js index 119044e35a..9dca3f6494 100644 --- a/script-archive/avatarSelector.js +++ b/script-archive/avatarSelector.js @@ -155,7 +155,7 @@ var avatars = {}; function changeLobbyTextures() { var req = new XMLHttpRequest(); - req.open("GET", "https://metaverse.highfidelity.com/api/v1/marketplace?category=head+%26+body&limit=21", false); + req.open("GET", URLs.METAVERSE_URL + "/api/v1/marketplace?category=head+%26+body&limit=21", false); req.send(); // Data returned is randomized. avatars = JSON.parse(req.responseText).data.items; diff --git a/script-archive/entityScripts/recordingEntityScript.js b/script-archive/entityScripts/recordingEntityScript.js index 3d1b6f46df..4281fbc64e 100644 --- a/script-archive/entityScripts/recordingEntityScript.js +++ b/script-archive/entityScripts/recordingEntityScript.js @@ -21,8 +21,8 @@ var START_MESSAGE = "recordingStarted"; var STOP_MESSAGE = "recordingEnded"; var PARTICIPATING_MESSAGE = "participatingToRecording"; - var RECORDING_ICON_URL = "http://cdn.highfidelity.com/alan/production/icons/ICO_rec-active.svg"; - var NOT_RECORDING_ICON_URL = "http://cdn.highfidelity.com/alan/production/icons/ICO_rec-inactive.svg"; + var RECORDING_ICON_URL = URLs.CDN_URL + "/alan/production/icons/ICO_rec-active.svg"; + var NOT_RECORDING_ICON_URL = URLs.CDN_URL + "/alan/production/icons/ICO_rec-inactive.svg"; var ICON_WIDTH = 60; var ICON_HEIGHT = 60; var overlay = null; diff --git a/script-archive/lobby.js b/script-archive/lobby.js index 7a06cdd906..d89fbe1f9d 100644 --- a/script-archive/lobby.js +++ b/script-archive/lobby.js @@ -153,7 +153,7 @@ var places = {}; function changeLobbyTextures() { var req = new XMLHttpRequest(); - req.open("GET", "https://metaverse.highfidelity.com/api/v1/places?limit=21", false); + req.open("GET", URLs.METAVERSE_URL + "/api/v1/places?limit=21", false); req.send(); places = JSON.parse(req.responseText).data.places; diff --git a/script-archive/winterSmashUp/targetPractice/targetPracticeGame.js b/script-archive/winterSmashUp/targetPractice/targetPracticeGame.js index 5e2612ded6..4e7f39821d 100644 --- a/script-archive/winterSmashUp/targetPractice/targetPracticeGame.js +++ b/script-archive/winterSmashUp/targetPractice/targetPracticeGame.js @@ -14,7 +14,7 @@ const GAME_CHANNEL = 'winterSmashUpGame'; const SCORE_POST_URL = 'https://script.google.com/macros/s/AKfycbwZAMx6cMBx6-8NGEhR8ELUA-dldtpa_4P55z38Q4vYHW6kneg/exec'; -const MODEL_URL = 'http://cdn.highfidelity.com/chris/production/winter/game/'; +const MODEL_URL = URLs.CDN_URL + '/chris/production/winter/game/'; const MAX_GAME_TIME = 120; //seconds const TARGET_CLOSE_OFFSET = 0.5; const MILLISECS_IN_SEC = 1000; diff --git a/scripts/system/html/js/SnapshotReview.js b/scripts/system/html/js/SnapshotReview.js index 1e8be9d644..71e468265f 100644 --- a/scripts/system/html/js/SnapshotReview.js +++ b/scripts/system/html/js/SnapshotReview.js @@ -440,7 +440,7 @@ function updateShareInfo(containerID, storyID) { } var shareBar = document.getElementById(containerID + "shareBar"), parentDiv = document.getElementById(containerID), - shareURL = "https://highfidelity.com/user_stories/" + storyID, + shareURL = URLs.METAVERSE_URL + "/user_stories/" + storyID, facebookButton = document.getElementById(containerID + "facebookButton"), twitterButton = document.getElementById(containerID + "twitterButton"); diff --git a/server-console/src/main.js b/server-console/src/main.js index d8d6fea4bf..f645d6af4c 100644 --- a/server-console/src/main.js +++ b/server-console/src/main.js @@ -56,7 +56,7 @@ const menuNotificationIcon = path.join(__dirname, '../resources/tray-menu-notifi const DELETE_LOG_FILES_OLDER_THAN_X_SECONDS = 60 * 60 * 24 * 7; // 7 Days const LOG_FILE_REGEX = /(domain-server|ac-monitor|ac)-.*-std(out|err).txt/; -const HOME_CONTENT_URL = "http://cdn.highfidelity.com/content-sets/home-tutorial-RC40.tar.gz"; +const HOME_CONTENT_URL = URLs.CDN_URL + "/content-sets/home-tutorial-RC40.tar.gz"; const buildInfo = GetBuildInfo(); diff --git a/server-console/src/modules/hf-notifications.js b/server-console/src/modules/hf-notifications.js index 1ddbd1d307..dfc07ed77c 100644 --- a/server-console/src/modules/hf-notifications.js +++ b/server-console/src/modules/hf-notifications.js @@ -19,7 +19,7 @@ const MARKETPLACE_NOTIFICATION_POLL_TIME_MS = 600 * 1000; const OSX_CLICK_DELAY_TIMEOUT = 500; -const METAVERSE_SERVER_URL= process.env.HIFI_METAVERSE_URL ? process.env.HIFI_METAVERSE_URL : 'https://metaverse.highfidelity.com' +const METAVERSE_SERVER_URL = process.env.HIFI_METAVERSE_URL ? process.env.HIFI_METAVERSE_URL : URLs.METAVERSE_URL const STORIES_URL= '/api/v1/user_stories'; const USERS_URL= '/api/v1/users'; const ECONOMIC_ACTIVITY_URL= '/api/v1/commerce/history';