Compare commits

...
Author SHA1 Message Date
marc 7896df41cd better build 2021-12-17 15:06:51 +01:00
marc 718a127ef3 known hosts 2021-12-13 17:15:44 +01:00
marc 1ff8e36234 ssh config 2021-12-13 17:14:31 +01:00
marc 18c602245e docker-compose 2021-12-13 16:45:34 +01:00
marc 37a61266f7 ssh 2021-12-13 16:41:26 +01:00
marc 55a16089c2 docker-compose + Dockerfile that work 2021-11-26 15:46:00 +01:00
marc 80ac5292b4 dockerfile 2021-11-26 15:41:27 +01:00
marc 5fb3a107ae docker-compose for using mongo with no dependencies by bind mouting the x11 server 2021-11-26 15:32:00 +01:00
Dj Walker-Morgan a715e33068 Update (C) date 2021-11-08 09:30:35 +00:00
Dj Walker-Morgan dbd03d410d Update README, remove survey 2021-11-08 09:22:56 +00:00
Gokhan Simsek e6ac9ec513 Changelog 2021-07-28 12:37:28 +03:00
Gokhan Simsek c58ed4a0d4 Minor fix 2021-07-28 12:09:17 +03:00
Gokhan Simsek 751c0b0ea8 Refactoring 2021-07-28 11:23:43 +03:00
Gokhan Simsek 526ae7065a Refactoring 2021-07-28 11:05:23 +03:00
Gokhan Simsek 860903cce8 Adding DefaultDB option support for From URI feature 2021-07-28 11:02:14 +03:00
Gokhan Simsek 1e1a7c84b5 Refactoring 2021-07-21 14:01:30 +03:00
Gokhan Simsek c7d97b23aa Adding AuthMechanism option support for From URI feature 2021-07-21 13:28:51 +03:00
Gokhan Simsek bf4cb999d7 Adding clearSslTab func. 2021-07-21 10:49:24 +03:00
Gokhan Simsek c6a4eb0494 Rename 2021-07-21 10:36:21 +03:00
Gokhan Simsek f94e7ce981 Adding TLS options support for From URI feature 2021-07-14 14:34:16 +03:00
Gokhan Simsek dd415d07af Adding feature auto-fill connection settings from standard URI (MongoDB Standard Connection String Format) 2021-07-14 10:02:46 +03:00
Gokhan Simsek 06b67b0adc Adding clear AuthTab func 2021-07-14 09:59:39 +03:00
Gokhan Simsek bd9a2e8227 Release 1.4.4 2021-06-29 13:11:14 +03:00
Gokhan Simsek ccd8299240 macOS, Windows: Fix Welcome Tab not loading the new content issue (disable/bypass HTTP cache) 2021-06-29 13:10:50 +03:00
kathrynvargas a288e5a3c6 Update README.md 2021-06-23 17:13:54 +02:00
Gökhan Şimşek 48f7dfde82 Update CHANGELOG 2021-01-14 11:04:25 +03:00
Gökhan Şimşek 0ee5fcfb6f Update CHANGELOG 2021-01-14 11:04:03 +03:00
Gokhan Simsek 9345ea05ea SSH should not be used when the SSL tab itself is disabled 2021-01-12 15:13:41 +03:00
Gökhan Şimşek c15e8932c6 Update CHANGELOG 2021-01-06 16:55:30 +03:00
Gokhan Simsek 10167d2d19 Minor change 2021-01-06 15:07:39 +03:00
Gokhan Simsek c260a63148 #1285 #1340: Disable SSH tab for existing replica set connections as well 2021-01-06 11:34:48 +03:00
Gokhan Simsek ea78a367ef AboutDialog: Minor change 2021-01-06 11:24:36 +03:00
Gokhan Simsek 74c644c933 #1285 #1340: Disable unsupported SSH tab for replica set connections 2021-01-06 11:04:23 +03:00
Gokhan Simsek 255a9bc2a9 Merge branch 'master' of https://github.com/Studio3T/robomongo 2021-01-06 11:00:25 +03:00
Gökhan Şimşek 968d9fcd5c Create README.md 2021-01-06 09:57:31 +03:00
Gokhan Simsek d76ea6668f Minor renaming 2021-01-06 09:52:01 +03:00
Gökhan Şimşek b789f817f9 Update README.md 2021-01-05 22:16:13 +03:00
Gökhan Şimşek 7ca8fe22d7 Update README.md 2021-01-05 17:21:57 +03:00
Gokhan Simsek 4ea4e1f569 Add set-mongo-warning-level-3.py 2021-01-05 17:18:36 +03:00
Gokhan Simsek e94bf825d3 Add rebuild script 2021-01-05 17:15:12 +03:00
Gokhan Simsek bdc9779df2 run-cppcheck.bat: Enable FILE or DIR argument passing 2021-01-04 17:57:10 +03:00
Gokhan Simsek 2291b09b58 Add more clang-tidy checks 2021-01-04 16:53:35 +03:00
Gokhan Simsek 32df0b7f34 AboutDialog: Add month and year 2021-01-04 13:02:03 +03:00
Gokhan Simsek 5e56af0b5a Enable Clang Tidy for Visual Studio 2019 2021-01-04 12:59:55 +03:00
Gokhan Simsek 6ec457de3d Update run-clang-tidy 2020-12-31 15:27:54 +03:00
Gokhan Simsek b4c58b1704 Update scan-build script 2020-12-30 12:34:30 +03:00
Gökhan Şimşek c3ea3488d2 Delete notes.txt 2020-12-30 11:09:54 +03:00
Gökhan Şimşek eb6f8a6cac Update README.md 2020-12-30 11:07:56 +03:00
Gökhan Şimşek e2d0456626 Rename HELP.md to readme.md 2020-12-30 11:05:56 +03:00
Gökhan Şimşek c183aa8b12 Update README.md 2020-12-30 10:58:55 +03:00
Gökhan Şimşek 9c5abff8cd Update README.md 2020-12-30 10:54:57 +03:00
Gokhan Simsek b794a7702d Minor changes 2020-12-30 10:53:28 +03:00
Gokhan Simsek 310a77e3a7 Merge branch 'master' of https://github.com/Studio3T/robomongo 2020-12-30 10:43:07 +03:00
Gokhan Simsek b37c92d9f9 Remove unused script 2020-12-30 10:42:17 +03:00
Gökhan Şimşek 665569ba82 Update README.md 2020-12-30 10:41:38 +03:00
Gökhan Şimşek 4bade27e12 Update CHANGELOG 2020-12-30 10:32:35 +03:00
Gokhan Simsek b010ab9525 Minor fix 2020-12-29 12:13:48 +03:00
Gökhan Şimşek 199a1864aa Update WelcomeTab.cpp 2020-12-29 11:26:20 +03:00
Gokhan Simsek 0272164072 Minor refactoring 2020-12-29 10:55:50 +03:00
Gokhan Simsek e24de27fd3 Import some keys 2020-12-29 10:53:44 +03:00
Gokhan Simsek e712897fea Minor change 2020-12-29 10:43:21 +03:00
Gokhan Simsek 660aaeb344 Refactoring 2020-12-29 09:59:53 +03:00
Gokhan Simsek 679a878b49 Update/merge main_window.jpg 2020-12-29 09:58:22 +03:00
Gokhan Simsek fa57ae5c3b Add default size for ExplorerWidget 2020-12-29 09:57:11 +03:00
Gokhan Simsek a613793d45 macOS: Prevent clang warning 2020-12-29 09:56:34 +03:00
Gokhan Simsek eaef3dde49 #1556: Remember left explorer widget size 2020-12-28 19:00:59 +03:00
Gokhan Simsek 545a39c522 Fix broken F2, F3, F4 shortcuts for tabbed result view 2020-12-28 11:49:26 +03:00
Gokhan Simsek a1042458b6 #1790: macOS: Set one re-order limit per new connections window workaround for Qt bug came in Qt 5.12.8 2020-12-24 15:17:12 +03:00
Gokhan Simsek 1415744f9b Fix a crash when new shell tab executed in server unreachable case 2020-12-22 17:07:21 +03:00
Gokhan Simsek 80c2e440db Refactoring visual studio code analysis script 2020-12-22 17:01:52 +03:00
Gökhan Şimşek 2809227838 Update README.md 2020-12-22 12:51:06 +03:00
Gökhan Şimşek 5233f2924d Update README.md 2020-12-22 12:50:39 +03:00
Gokhan Simsek a7e5589733 Refatoring clang-tidy script 2020-12-21 11:38:36 +03:00
Gokhan Simsek 3c7fff901a Refactoring static code analysis script 2020-12-21 10:10:53 +03:00
Gökhan Şimşek 821307f699 Update README.md 2020-12-18 18:25:51 +03:00
Gökhan Şimşek 3cf634cb75 Update README.md 2020-12-18 18:17:19 +03:00
Gokhan Simsek f7efb5af75 New WelcomeTab: Open links in external browser 2020-12-18 17:53:31 +03:00
Gökhan Şimşek aa11d3bd49 Update README.md 2020-12-18 15:31:32 +03:00
Gökhan Şimşek 16a61dc512 Update README.md 2020-12-18 15:27:24 +03:00
Gökhan Şimşek 4090a79450 Rename RuntimeDependencies.md to Debug.md 2020-12-18 15:21:22 +03:00
Gökhan Şimşek a619671277 Update README.md 2020-12-18 15:18:05 +03:00
Gokhan Simsek b92c1a1652 Minor change 2020-12-18 11:11:36 +03:00
Gokhan Simsek e97c74154b Update changelog for v1.4.3 2020-12-18 11:06:52 +03:00
Gokhan Simsek 138191cc22 Minor rename 2020-12-18 10:26:08 +03:00
Gokhan Simsek 58b214b16c Fix broken unit tests 2020-12-18 09:58:47 +03:00
Gökhan Şimşek 911acd7e4d Update BuildRobo3TOnMacAndLinux.md 2020-12-17 19:39:56 +03:00
Gokhan Simsek b745b575bc #1661: Attempt to fix a crash during paging used in tabbed result window 2020-12-16 15:58:57 +03:00
Gokhan Simsek 7a02188ac6 Removing unused code 2020-12-15 16:32:35 +03:00
Gokhan Simsek f41b340e79 Disable right click 2020-12-15 11:18:15 +03:00
Gokhan Simsek 901b6e86c7 Linux: Keeping old Welcome Tab due to run time QtWebEngine errors 2020-12-14 18:43:06 +03:00
Gokhan Simsek 583d43c054 macOS BigSur upgrade 2020-12-11 13:02:32 +03:00
Gökhan Şimşek 1fd2a061b0 Update BuildRobo3TOnMacAndLinux.md 2020-12-11 12:36:13 +03:00
Gökhan Şimşek 7c7ee58cd3 Update BuildRobo3TOnMacAndLinux.md 2020-12-10 12:34:06 +03:00
Gokhan Simsek cfa95fd3f5 macOS: New Welcome Tab using/adding QtWebEngine 2020-12-10 12:00:26 +03:00
Gokhan Simsek 89c9e78878 Minor cleaning 2020-12-10 11:53:23 +03:00
Gokhan Simsek bc074e446a Fix previously broken IPv6 setting 2020-12-10 10:05:45 +03:00
Gokhan Simsek baee06dcdd Minor update 2020-12-09 18:38:00 +03:00
Gokhan Simsek a6a6c8409a Windows: New Welcome Tab using/adding QtWebEngine 2020-12-09 14:58:21 +03:00
Gökhan Şimşek 11baf2bb9d Update README.md 2020-12-08 09:53:30 +03:00
Gökhan Şimşek 071d59c72a Update README.md 2020-12-08 09:51:28 +03:00
Gokhan Simsek 65ee72bda3 Starting v1.4.3 2020-12-01 10:46:13 +03:00
Gokhan Simsek 7800b65d1a Deleting unused trash folder 2020-12-01 10:23:21 +03:00
Gökhan Şimşek 56d260a65d Add files via upload
Add Qt build system png
2020-10-23 09:26:50 +03:00
Gokhan Simsek 6d0397a1d7 Minor change 2020-10-22 17:36:17 +03:00
Gokhan Simsek fdebb06059 Cmake: Start debug program with console window 2020-10-22 11:02:49 +03:00
Gokhan Simsek c6ef7bba81 Fix broken build number 2020-10-21 11:18:20 +03:00
Gokhan Simsek 86509495f3 Update changelog for v1.4.2 2020-10-20 16:58:18 +03:00
Gokhan Simsek 086e6b7d21 Update version to 1.4.2 2020-10-20 11:11:13 +03:00
Gokhan Simsek f47afbddc8 #1694: Attempt to fix broken paging in DocumentDB 2020-10-20 11:07:22 +03:00
Gokhan Simsek 14f545ff45 Adding trimmed results 2020-09-27 22:02:26 +03:00
Gökhan Şimşek bf09a3d9c6 Update build_scan-build 2020-09-27 18:55:55 +03:00
Gökhan Şimşek 93cadb5a6b Update configure_scan-build 2020-09-27 18:55:20 +03:00
Gökhan Şimşek 0dd68201f6 Update CHANGELOG 2020-09-15 15:38:43 +03:00
Gökhan Şimşek ba646c4ac0 Update README.md 2020-09-11 11:04:17 +03:00
Gökhan Şimşek 46c50d2aa7 Update README.md 2020-09-11 11:01:48 +03:00
Gokhan Simsek 122dbd953c Generate cmake error when BUILD_NUMBER is empty 2020-09-09 18:23:41 +03:00
Gokhan Simsek a0c7666e4e Import from 1.4.0 2020-09-09 17:31:03 +03:00
Gokhan Simsek 4185b0b19a Patch 1.4.1 2020-09-09 17:30:52 +03:00
Gokhan Simsek a9478b95cc Minor change 2020-09-09 17:14:19 +03:00
Gokhan Simsek c68933f445 #1766: Adding native styles for Windows and macOS 2020-09-09 12:00:18 +03:00
Gokhan Simsek e7dd60c036 #1761 #1768 #1771: macOS: Forcing light mode 2020-09-09 11:58:21 +03:00
Gokhan Simsek 17ca161e55 Minor UI fix 2020-09-09 11:32:39 +03:00
Gokhan Simsek e66f627407 #1766: Windows: Attempt to fix broken native theme 2020-09-09 11:32:20 +03:00
Gokhan Simsek c39312356e AboutDialog: Adding build number 2020-09-09 10:45:18 +03:00
Gökhan Şimşek ac8afdd98f Update CHANGELOG 2020-09-04 16:38:33 +03:00
Gokhan Simsek 21e067937a Linux: Adding libstdc++ shared lib 2020-09-04 11:02:38 +03:00
Gokhan Simsek 12e54ccda9 #1757: Disabling IPv6 due to unexpected behaviors 2020-09-03 14:12:14 +03:00
Gokhan Simsek e658a7b293 Adding clang-tidy results 2020-08-31 11:51:33 +03:00
Gökhan Şimşek 49478e873d Update README.md 2020-08-28 10:13:47 +03:00
Gökhan Şimşek 30efcb2a68 Update README.md 2020-08-27 14:37:01 +03:00
Gökhan Şimşek 7866fde20d Update README.md 2020-08-27 14:32:00 +03:00
Gökhan Şimşek 30e903eec0 Update README.md 2020-08-27 14:28:00 +03:00
Gökhan Şimşek d9dedd37ee Update README.md 2020-08-27 14:26:58 +03:00
Gökhan Şimşek 61d4ea742f Update README.md 2020-08-27 14:26:20 +03:00
Gökhan Şimşek 02594f4dea Update README.md 2020-08-27 14:25:36 +03:00
Gokhan Simsek a61e33cad9 macOS: Adding scan-build output 2020-08-24 09:21:12 +03:00
Gokhan Simsek 347edc4b62 Windows: Adding visual studio RunCodeAnalysis script and some of its results with various rules 2020-08-21 18:16:49 +03:00
Gokhan Simsek 728f29152f macOS: Adding scan-build scripts 2020-08-21 17:21:12 +03:00
Gökhan Şimşek fdde4da323 Update BuildRobo3TOnWindows.md 2020-08-18 11:58:30 +03:00
Gökhan Şimşek 31bcd3609b Update BuildRobo3TOnMacAndLinux.md 2020-08-18 11:56:56 +03:00
Gokhan Simsek ef4b8cd27b Update Bar: Minor change 2020-08-18 10:07:44 +03:00
Gokhan Simsek dcfc524ad7 Spell check 2020-08-18 10:07:29 +03:00
Gokhan Simsek 5c161325bb MainWindow: Updating endpoint URL for updates bar 2020-08-16 13:27:05 +03:00
Gokhan Simsek cd02e61710 WelcomeTab: Updating image and content URLs 2020-08-16 11:53:38 +03:00
Gökhan Şimşek 1ee2e7cd9d Update CHANGELOG 2020-08-12 10:38:26 +03:00
Gokhan Simsek a92edc9fa7 Small update 2020-08-12 09:54:56 +03:00
Gokhan Simsek 3eb03362a4 #1714, #1653: Attempt to fix previously broken IPv6 support 2020-08-07 16:31:37 +03:00
Gokhan Simsek aaf9794491 Minor change 2020-08-07 16:26:20 +03:00
Gokhan Simsek ffe519248f Linux: Run from install dir 2020-08-07 12:08:56 +03:00
Gokhan Simsek ecdc0164ee Changing URL for updates and minor refactoring 2020-08-07 12:07:49 +03:00
Gokhan Simsek 2dd7dccaca Minor change 2020-08-04 12:13:05 +03:00
Gokhan Simsek d5780a018a Adding debugLog() function 2020-08-04 12:12:53 +03:00
Gokhan Simsek 7a8b4413fc Adding user controlled debugMode flag into config file 2020-08-04 12:11:59 +03:00
Gokhan Simsek b598062db6 WelcomeTab: Decreasing header font sizes 2020-08-04 10:00:42 +03:00
Gokhan Simsek 78187f9d6d #1685: Adding feature (config file flag) "disableHttpsFeatures", removing "useHttps". 2020-07-31 15:50:11 +03:00
Gokhan Simsek e6c070d469 #1685: Changing all HTTP post/request to HTTPS. 2020-07-31 15:48:09 +03:00
Gökhan Şimşek 750fd9d500 Update BuildRobo3TOnWindows.md 2020-07-30 15:07:51 +03:00
Gökhan Şimşek 9f5e755037 Update BuildRobo3TOnMacAndLinux.md 2020-07-30 15:07:24 +03:00
Gökhan Şimşek f43e7e3665 Update RuntimeDependencies.md 2020-07-30 14:12:22 +03:00
Gökhan Şimşek fc35ae44dd Update BuildRobo3TOnWindows.md 2020-07-27 20:13:33 +03:00
Gökhan Şimşek 805842ae96 Update BuildRobo3TOnWindows.md 2020-07-27 20:10:45 +03:00
Gokhan Simsek fc925444d8 #1696: Attempt to fix the problem when connected with a user defined on a non-admin auth. db, only auth db is shown 2020-07-17 18:47:49 +03:00
Gokhan Simsek 6163b7f7e3 Adding vectorContains() generic helper function 2020-07-15 15:26:24 +03:00
Gokhan Simsek 2dcbc0f5e9 Using manuallyVisibleDbs whether there is an exception or not 2020-07-15 15:25:02 +03:00
Gokhan Simsek 3c05095538 Code review of all Robo 1.4 changes 2020-07-15 10:24:51 +03:00
Gokhan Simsek 27c2bddc5c Adding dependencies into About dialog 2020-07-14 14:55:22 +03:00
Gokhan Simsek 2303d8a547 Minor change 2020-07-14 14:45:23 +03:00
Gökhan Şimşek 03a125e02d Update README.md 2020-07-14 09:59:57 +03:00
Gokhan Simsek 04f4fb4281 Adding esprima info 2020-07-14 09:59:15 +03:00
Gokhan Simsek fd66b3561c Minor refactoring 2020-07-14 09:50:54 +03:00
Gokhan Simsek cb4514e72c Minor change 2020-07-08 16:35:43 +03:00
Gokhan Simsek 27a4ec14c7 Attempt to fix cropped From SRV button text for Win 10 HiDPI 2020-07-08 16:35:18 +03:00
Gökhan Şimşek aa3ebd1f7f Update BuildRobo3TOnMacAndLinux.md 2020-07-08 10:13:43 +03:00
Gokhan Simsek f459a4aacb Merge branch 'master' of https://github.com/Studio3T/robomongo 2020-07-06 18:12:19 +03:00
Gökhan Şimşek 418b47ba3c Update BuildRobo3TOnMacAndLinux.md 2020-07-06 18:05:16 +03:00
Gokhan Simsek 393d09df0d SSH: Adding supported keys info text 2020-07-06 17:41:36 +03:00
Gökhan Şimşek 115d4b582a Update BuildRobo3TOnMacAndLinux.md 2020-07-06 17:39:32 +03:00
Gökhan Şimşek 1c5663dd83 Update RuntimeDependencies.md 2020-07-06 17:37:44 +03:00
Gokhan Simsek 8050e638a9 Open connection settings window relative to parent (connections window) and remember its size 2020-07-02 17:10:48 +03:00
Gökhan Şimşek eb58b93173 Update RuntimeDependencies.md 2020-07-01 10:20:07 +03:00
Gökhan Şimşek 99486802ef Update RuntimeDependencies.md 2020-07-01 10:18:46 +03:00
Gokhan Simsek 6c52d4df9b Updating build diagram 2020-06-30 18:36:39 +03:00
Gokhan Simsek 269e47a249 Disabling a warning 2020-06-30 12:18:59 +03:00
Gökhan Şimşek 5753989b79 Update BuildRobo3TOnMacAndLinux.md 2020-06-30 10:48:04 +03:00
Gokhan Simsek 466be55df4 Updating build diagram 2020-06-30 10:01:01 +03:00
Gökhan Şimşek 74f30b87ad Update BuildRobo3TOnWindows.md 2020-06-29 16:41:23 +03:00
Gökhan Şimşek 63d70483aa Update BuildRobo3TOnMacAndLinux.md 2020-06-29 16:31:14 +03:00
Gokhan Simsek 6b0eaecdf1 #1719, #1530, #1590: For Windows, macOS: Upgrading libssh2 to latest version (v1.9.0) which adds support for ECDSA and ED25519 keys. 2020-06-29 12:12:29 +03:00
Gokhan Simsek 9049457543 Adding version number for third-party libs 2020-06-25 11:48:48 +03:00
Gokhan Simsek f6ac157993 #1728: Removing an obsolete function which caused crash when Users folder expanded and minor refactoring 2020-06-24 17:45:45 +03:00
Gokhan Simsek e7cd0b65d6 Minor refactoring 2020-06-23 10:07:37 +03:00
Gokhan Simsek 8b8b0a1b8c Adding more logging and minor refactoring 2020-06-23 10:03:27 +03:00
Gokhan Simsek 8dae0b7973 Minor change 2020-06-19 11:10:15 +03:00
Gokhan Simsek d1d54c50d7 Adding function sendLog() 2020-06-19 10:24:55 +03:00
Gokhan Simsek 4f82013a55 Minor refactoring 2020-06-18 15:48:19 +03:00
Gokhan Simsek 3a5159b060 Adding APP version into connect function and some refactoring 2020-06-18 14:23:38 +03:00
Gokhan Simsek 617f2d5669 Refactoring 2020-06-18 13:50:25 +03:00
Gokhan Simsek 3d02aa687e Adding logging for scope reset 2020-06-18 11:54:27 +03:00
Gokhan Simsek 3bcd0a8509 #1686 #1628: Attempt to fix these two cases which seems to have the same root cause 2020-06-18 10:28:22 +03:00
Gokhan Simsek c240ab4e8e Updating reconnect handling for failed ExecuteScriptRequest 2020-06-18 09:46:56 +03:00
Gokhan Simsek 8e2d47f793 Fixing logging of failed ping events 2020-06-16 14:07:17 +03:00
Gokhan Simsek 3c993deedf Minor change/fix 2020-06-16 09:33:25 +03:00
Gokhan Simsek 82d7116664 Minor UI changes 2020-06-16 09:33:00 +03:00
Gokhan Simsek 015cea9c07 Making QMessageBox window usage generic 2020-06-15 16:09:03 +03:00
Gokhan Simsek 359c5b3c81 Remove ASCII characters '\t', '\n', '\v', '\f', '\r', and ' ' from msg string 2020-06-15 11:22:51 +03:00
Gokhan Simsek 5c3312179c Updating error handling of failing listdatabase command 2020-06-15 11:16:34 +03:00
Gokhan Simsek 70d5c19a43 Minor refactoring 2020-06-14 18:55:45 +03:00
Gokhan Simsek 9f62c44460 #1696 #1368 #389: Adding feature "Manually specify visible databases" into connection settings auth. tab 2020-06-14 18:55:16 +03:00
Gokhan Simsek 542fd12343 Attempt to fix a bug seen when Collections folder refreshed and replica set is unreachable 2020-06-11 09:16:44 +03:00
Gokhan Simsek 0763be425c Updating code due to the fact that getReplicaSetInfo() may throw now 2020-06-11 09:15:35 +03:00
Gokhan Simsek 6b3c983e67 Minor renaming 2020-06-10 14:05:26 +03:00
Gokhan Simsek 638c7b2fbe Minor refactoring 2020-06-10 13:46:16 +03:00
Gokhan Simsek a55b7c8069 Showing error and hint to the user for the case where Robo fails to get the list of databases 2020-06-10 11:46:30 +03:00
Gokhan Simsek 318fc6d676 Renaming to AddEditIndexDialog 2020-06-09 17:00:18 +03:00
Gokhan Simsek 705a55e49f Adding warning dialog for Edit Index 2020-06-09 16:45:15 +03:00
Gokhan Simsek 39aba89186 Minor change 2020-06-09 14:25:06 +03:00
Gokhan Simsek f7bbbee464 Minor renaming 2020-06-09 14:20:54 +03:00
Gokhan Simsek 48dbd9f7d9 Fix drop index error handling and logging 2020-06-09 14:16:25 +03:00
Gokhan Simsek 1b8ed947f3 Adding new event AddEditIndexResponse 2020-06-09 11:48:00 +03:00
Gokhan Simsek cb3ff65d05 Renaming to DropCollectionIndexResponse 2020-06-09 09:48:33 +03:00
Gokhan Simsek d32581084d Code refactoring 2020-06-08 18:14:34 +03:00
Gokhan Simsek 950b25236c Renaming ExplorerCollectionIndexesTreeItem to ExplorerCollectionIndexItem 2020-06-08 18:01:00 +03:00
Gokhan Simsek fecdbc8658 Renaming ExplorerCollectionDirIndexesTreeItem to ExplorerCollectionIndexesDir 2020-06-08 16:54:22 +03:00
Gokhan Simsek 1e8932b390 Removing unused code 2020-06-08 14:24:57 +03:00
Gokhan Simsek 28ae1d81a8 #1692: Try to recover(create) the dropped (old) index when the creation of new index fails 2020-06-08 14:00:34 +03:00
Gokhan Simsek d7ad941d1e #1692: Renaming to IndexInfo 2020-06-08 10:52:08 +03:00
Gokhan Simsek 0ebbf9ab33 #1692: Renaming and cleaning unused code 2020-06-08 10:50:12 +03:00
Gokhan Simsek 7c4282688a #1692: Removing unsupported "drop duplicates" option 2020-06-07 18:01:13 +03:00
Gokhan Simsek e892601440 #1692: Ceate & edit index: Fix for not working "text weights" 2020-06-07 17:18:01 +03:00
Gokhan Simsek dbda800374 #1692: Re-writing buggy create & edit index, removing dependency to old index data (oldInfo) 2020-06-07 16:44:45 +03:00
Gokhan Simsek ba0f5edfea #1692: First changes to get create & edit index work with MongoDB 4.2 2020-06-05 18:08:35 +03:00
Gokhan Simsek 5953c9cccb Minor change 2020-06-04 16:57:12 +03:00
Gokhan Simsek ba95dddf12 Minor changes 2020-06-01 14:36:23 +03:00
Gokhan Simsek 10371accfb Removing "Optional" string from "Set Name" label due to confusions reported by users 2020-06-01 10:30:57 +03:00
Gokhan Simsek 815d6c1286 Try to get the last error for all connections 2020-06-01 10:23:59 +03:00
Gokhan Simsek c00c0cb387 Removing unused class 2020-05-29 10:35:24 +03:00
Gokhan Simsek c8433a884b Additional change for previous commit 2020-05-29 10:34:56 +03:00
Gokhan Simsek 7f2aad3593 Renaming SSL to TLS 2020-05-28 16:40:19 +03:00
Gokhan Simsek cfedd020b9 Deleting no longer working code 2020-05-28 10:09:54 +03:00
Gokhan Simsek 116f5b5c54 Fix for Robo failing give error and got stuck connecting gif for unreachable Mongo Atlas connections 2020-05-27 09:22:54 +03:00
Gokhan Simsek 5b3b3fdf84 First working connection to Mongo Atlas 2020-05-22 09:34:27 +03:00
Gokhan Simsek 84bc19f71f Adding Program Architecture.jpg 2020-05-21 09:22:43 +03:00
Gokhan Simsek a8ddba48b7 Fix macOS and ubuntu build error for previous commit 2020-05-20 12:22:47 +03:00
Gokhan Simsek fac8d9dcab Refactoring App::_servers into unique_ptr 2020-05-20 10:47:01 +03:00
Gokhan Simsek f561dc7191 Need to delete server first since its address is taken from shell 2020-05-18 16:57:34 +03:00
Gokhan Simsek 116014918b Fix linux packaging error 2020-05-18 12:57:50 +03:00
Gokhan Simsek 0d9543a0d8 Adding config. file path of version 1.3.1 2020-05-18 12:35:27 +03:00
Gokhan Simsek f75f210675 Update duplicateCollection() 2020-05-15 11:47:12 +03:00
Gokhan Simsek cbc3c93fae Cleaning getFunctions() 2020-05-15 11:01:19 +03:00
Gokhan Simsek f2f91d23a9 Refactoring App::closeShell() function 2020-05-14 15:24:20 +03:00
Gokhan Simsek a976a59ce2 Windows: Adding script to automate installing debug dlls 2020-05-14 10:36:28 +03:00
Gokhan Simsek 87f07c6509 Fix for broken script engine and removing _dbAuth due to mongo commit 82e05d6: SERVER-39128 Avoid double-authentication 2020-05-13 11:07:31 +03:00
Gokhan Simsek 04c369cdf8 Minor fix for clang warning 2020-05-11 17:27:07 +03:00
Gokhan Simsek 9c1d4ac2fc Forgotten if defines for previous commit 2020-05-11 17:13:06 +03:00
Gokhan Simsek 391b45fba1 Linux: Suppressing a warning from qscintilla library 2020-05-11 17:02:30 +03:00
Gökhan Şimşek 7184e02207 Update BuildRobo3TOnWindows.md 2020-05-11 12:16:24 +03:00
Gökhan Şimşek 96693edb8b MongoDB 4.2: Update build doc. for macOS & Ubuntu 2020-05-08 18:16:57 +03:00
Gökhan Şimşek 6eb2f24bb1 MongoDB 4.2: Update build doc. for Windows 2020-05-08 15:46:28 +03:00
Gokhan Simsek 1dc8f1b30a Ubuntu: Adding roboshell build objects 2020-05-08 11:04:04 +03:00
Gokhan Simsek 8d20980aa9 macOS and Ubuntu: Disabling sprintf format warnings for external code 2020-05-07 16:52:39 +03:00
Gokhan Simsek a01868c49c macOS and Ubuntu: Disabling warning unused return value. This source file comes from mongo. 2020-05-07 15:09:15 +03:00
Gokhan Simsek 0764d25df4 Ubuntu: Adding -lcurl 2020-05-07 11:32:03 +03:00
Gokhan Simsek 44906870e4 macOS: First version builds with roboshell-v4.2 2020-05-06 13:46:23 +03:00
Gokhan Simsek 6ec34a9936 First version builds with roboshell-v4.2 and connects to local MongoDB version 4.2 server on Windows 2020-04-30 21:46:48 +03:00
Gökhan Şimşek 2b72077225 Create cppcheck_output_Apr2019 2019-04-12 17:12:22 +03:00
Gökhan Şimşek 0d1627d243 Update BuildRobo3TOnWindows.md 2019-04-04 09:52:46 +03:00
Gökhan Şimşek 63d288d85f Update BuildRobo3TOnMacAndLinux.md 2019-04-04 09:43:34 +03:00
Gokhan Simsek fb4aaa54ad Adding Welcome_Tab.jpg 2019-04-03 12:24:32 +03:00
Gokhan Simsek 7419c4060e WelcomeTab: Enabling using of HTTPS for RSS download for Linux 2019-03-22 10:20:47 +03:00
Gokhan Simsek be89b5c12a WelcomeTab: Final UI adjustments 2019-03-22 10:20:05 +03:00
Gökhan Şimşek e34f24e183 Update README.md 2019-03-18 16:19:13 +03:00
Gökhan Şimşek 0a98ba0487 Update README.md 2019-03-18 16:18:00 +03:00
Gökhan Şimşek 5a70800a31 Update README.md 2019-03-18 16:14:35 +03:00
Gokhan Simsek bbc0eb8d6f Updating changelog for version 1.3 2019-03-18 15:47:23 +03:00
Gokhan Simsek 8a1cca4198 #731: Making SSL "pemPassphrase" encrypted as well in config file 2019-03-16 15:06:50 +03:00
Gokhan Simsek 3f2ef3b8b5 Code comments refactoring 2019-03-16 14:37:40 +03:00
Gokhan Simsek 2e31e70881 Making SSH "passphrase" in config file encrypted 2019-03-16 14:37:10 +03:00
Gokhan Simsek 8e8d655e66 Creating config. folder tree and file before everything 2019-03-13 17:18:15 +03:00
Gokhan Simsek d138308fce Adding beta config. file path and disabling beta version 2019-03-13 16:10:30 +03:00
Gokhan Simsek 7ed61ccbb6 Code review between commits 2e371d2 and 8f00817: Minor refactorings 2019-03-13 15:40:19 +03:00
Gokhan Simsek 29a91f4730 Code review between commits 2e371d2 and 8f00817: Minor comment only changes 2019-03-13 15:39:33 +03:00
Gokhan Simsek 8f00817927 Minor UI fix for Windows 2019-03-13 09:28:19 +03:00
Gokhan Simsek 0696b8d073 Adding horizontal line for New Feature: Support DNS SRV based MongoDB connections #1588 2019-03-12 12:12:59 +03:00
Gokhan Simsek de247b3b5b Linux UI refactoring for New Feature: Support DNS SRV based MongoDB connections #1588 2019-03-12 12:06:12 +03:00
Gokhan Simsek 0dfe32f594 MacOS UI refactoring for New Feature: Support DNS SRV based MongoDB connections #1588 2019-03-12 10:28:29 +03:00
Gokhan Simsek 5d3f2cd6fa Windows UI refactoring for New Feature: Support DNS SRV based MongoDB connections #1588 2019-03-12 10:16:34 +03:00
Gokhan Simsek 8c48d6a90f Adding error handling and logging for initKey() #731 2019-03-07 14:40:26 +03:00
Gokhan Simsek a58c15aee3 Adding random key generation and save/load from local key file for #731 2019-03-07 09:15:06 +03:00
Gokhan Simsek f27efd7af0 Linux UI adjustments for New Feature: Support DNS SRV based MongoDB connections #1588 2019-03-06 09:33:04 +03:00
Gokhan Simsek 6882dff4fc MacOS UI adjustments for New Feature: Support DNS SRV based MongoDB connections #1588 2019-03-05 16:56:54 +03:00
Gokhan Simsek 230eb927a0 Adding SSL tab and Advanced tab changes for new feature: Support DNS SRV based MongoDB connections #1588 2019-03-04 17:09:44 +03:00
Gokhan Simsek 365a067755 First changes for New Feature: Support DNS SRV based MongoDB connections #1588 2019-03-04 14:30:03 +03:00
Gokhan Simsek b2751af4e3 Fixing alignment problem of Default Database text in connection settings dialog 2019-03-04 09:45:30 +03:00
Gokhan Simsek f83772efb9 First code changes for #1588: New Feature: Support DNS SRV based MongoDB connections. And some UI size and alignment updates 2019-03-01 17:16:37 +03:00
Gokhan Simsek 23b23e0e86 Tabbed output feature: Close tab on middle mouse button 2019-02-27 11:03:28 +03:00
Gokhan Simsek 98d6871300 Tabbed output feature: Fixing some visual issues for MacOS 2019-02-26 17:57:02 +03:00
Gokhan Simsek 21978735a1 #1591 #1403: Tabbed output feature: Adding tooltip to show full statement on tab hover 2019-02-26 15:58:08 +03:00
Gokhan Simsek d3a3d8b6ef Some refactoring and fixing bug related to button "maximize output" 2019-02-26 15:54:38 +03:00
Gokhan Simsek 97af0e28fc #1591 #1403: Tabbed output feature: Some style changes for all platforms 2019-02-26 11:22:47 +03:00
Gokhan Simsek 7c68547dfa Minor correction 2019-02-26 09:42:25 +03:00
Gokhan Simsek 7d30c12fb7 Minor refactoring 2019-02-26 09:36:57 +03:00
Gokhan Simsek 0f551b6d25 #1591 #1403: Tabbed output feature: Visual adjustments for MacOS 2019-02-26 09:36:32 +03:00
Gokhan Simsek 198803dee0 #1591 #1403: Tabbed output feature: Setting tab title to short query string 2019-02-23 17:26:50 +03:00
Gokhan Simsek 1d9d6941ec New feature tabbed output window for query results more than 2. #1591 #1403. 2019-02-23 15:20:11 +03:00
Gokhan Simsek 3deba89063 Unit tests for RoboCrypt basic functionality 2019-02-22 12:45:02 +03:00
Gokhan Simsek 4d93a94ef6 Updating configuration summary 2019-02-21 17:51:16 +03:00
Gokhan Simsek 8b34c228e7 Updating configuration summary 2019-02-21 17:46:52 +03:00
Gokhan Simsek 7d2bfd702c Robo 1.3: To silence CMake warning: "Policy CMP0071 is not set: Let AUTOMOC and AUTOUIC process GENERATED files." 2019-02-21 17:46:28 +03:00
Gokhan Simsek 09d42500e6 Linux: Updating unit test cmake file - linking is still not working 2019-02-21 15:15:01 +03:00
Gökhan Şimşek 51f0f94a37 Update BuildRobo3TOnMacAndLinux.md 2019-02-21 12:08:55 +03:00
Gokhan Simsek 293564be75 Windows: Need to install Qt DLLs for robo_unit_tests exe 2019-02-21 11:53:32 +03:00
Gokhan Simsek 4917f8df79 Adding RoboCrypt unit test file and major refactoring of robo unit tests cmake file 2019-02-21 10:02:01 +03:00
Gokhan Simsek 0def5df6c8 More changes for #731: Minor changes 2019-02-20 09:41:04 +03:00
Gokhan Simsek 83696b3a99 Updating run_tests script 2019-02-19 17:59:05 +03:00
Gokhan Simsek 7a2c7f83aa Refactoring unit test cmake file and disabling unit testing for Linux 2019-02-19 17:52:19 +03:00
Gokhan Simsek 2547311ef4 Attempt to fix #731: Robomongo stores passwords in plain text 2019-02-19 10:52:46 +03:00
Gokhan Simsek 5eea6e491a #1554: Changes for support for creating version 4 UUID 2019-02-19 10:27:14 +03:00
Gokhan Simsek 57984545ab Putting uuidhelpers.js back in order to modify it 2019-02-19 10:26:17 +03:00
Gokhan Simsek d19c51c517 Minor refactorings 2019-02-18 22:58:54 +03:00
Gokhan Simsek 94860b6995 Adding schematics 2019-02-18 18:30:53 +03:00
Gokhan Simsek 43c1cea1d2 Minor renaming 2019-02-18 09:33:34 +03:00
Gokhan Simsek 3b188a9970 Minor refactorings and minor fix 2019-02-18 09:09:24 +03:00
1795 changed files with 146775 additions and 166991 deletions
+1
View File
@@ -97,3 +97,4 @@ Desktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
.vscode/settings.json
.vs/
+193 -131
View File
@@ -1,147 +1,209 @@
Latest Version:
Robo 3T 1.2.1 (19 Feb, 2018)
http://blog.robomongo.org/robo-3t-1-2
Download latest version:
https://robomongo.org/download
Robo 3T 1.2.1:
Major Features:
Robo 3T 1.4.4 (Aug/2021)
New Features:
- Support for Standard Connection String Format (Mongo URI)
Fixes:
- Fix Welcome Tab not loading the new content issue by disable/bypass HTTP cache
Robo 3T 1.4.3 (Jan/2021)
New Features:
- macOS Big Sur support
- New Welcome Tab - embeds Chromium using QtWebEngine (Windows, macOS only)
- Database explorer section has smaller default width (#1556)
- Remember size of database explorer section
- Import keys from old version: autoExpand, lineNumbers, debugMode and shellTimeoutSec
Fixes:
- Disable unsupported SSH tab for replica set connections (#1285 #1340)
- Fix crash when new shell tab executed in server unreachable case
- Fix crash when paging used in tabbed result window (#1661)
- Fix broken F2, F3, F4 shortcuts for tabbed result view
- One time re-order limit per new connections window to prevent data loss (macOS, #1790)
- Fix previously broken IPv6 support from command line: robo3t --ipv6
Robo 3T 1.4.2 (Oct/2020)
Fixes:
- Fix broken paging in DocumentDB (#1694)
Robo 3T 1.4.1 (Sep/2020)
Fixes:
- Force light mode on macOS (#1761, #1768, #1771)
- Fix broken macOS native theme/look (#1766)
- Fix broken Windows native theme/look
Robo 3T 1.4.0 (Aug/2020)
blog.robomongo.org/robo-3t-1-4/
New Features:
- Mongo shell 4.2 upgrade
- Support for Ubuntu 20.04 and macOS 10.15 (Catalina)
- SSH: ECDSA and Ed25519 keys support on Windows & macOS (#1719, #1530, #1590)
- Manually specify visible databases (#1696, #1368, #389)
Improvements:
- Qt Upgrade (v5.12.8 - Apr/2020, Windows & macOS only)
- OpenSSL upgrade (v1.1.1f - Mar/2020, Windows & macOS only)
- libssh2 upgrade (v1.9.0 - Jun/2019, Windows & macOS only)
Fixes:
- Authentication database option isn't used properly (#1696)
- Add/Edit index ops fixed (re-written) (#1692)
- Crash when expanding admin users (#1728)
- Unable to run query after shell timeout reached (#1529)
Robo 3T 1.3.1 (Apr, 2019)
http://blog.robomongo.org/robo-3t-1-3
New Features:
- Biggest change in this version is Mongo Shell version upgrade from 3.4 to 4.0.5.
- Support for importing from DNS SRV based MongoDB connection strings
- Query results windows now supports tabbed output #1591 #1403
- Adding support for SCRAM-SHA-256 auth mechanism #1569
- Support for Ubuntu 18.04 and Mac 10.14.
- Support for creating version 4 UUID #1554
Improvements:
- Encrypted passwords are used in config. file instead of clear text passwords
- Showing much better error reason string from Mongo drivers for connection failures
Fixes:
- Broken create/edit/view user features fixed and updated #638 #1041
- Attempt to fix #1547: Crash when right click on existing results plus a new long running query
- Fix for application crash when adding index with invalid JSON
- 'Repair Database' in Robo3T needs a confirm dialog box #1568
- Robo 3T the input space causes connection failure #1551
- Crash when loading results + right click #1547
- Attempt to fix major connection problems seen with the second edit/add/remove document operation after MongoDB 4.0 upgrade #1603
- Attempt to fix #1581: For CRUD ops showing progress bar and disabling context menu while waiting for edit op to finish
- Fixing UI issue where Functions folder freezing with "Functions..." when fails to refresh
- Fix for #1529: Pagination does not work when the aggregation queries have dotted fields
Robo 3T 1.3.0 Beta (16 Feb, 2019)
Details: https://github.com/Studio3T/robomongo/releases/tag/v1.3.0-beta
Robo 3T 1.2.1 (19 Feb, 2018)
http://blog.robomongo.org/robo-3t-1-2
Fixes:
- Aggregate query results are not pagaeble
- Big double numbers are showing incorrectly #1447
- Editing a document from a projection causes data loss (override) (#881)
- Error: Resources temporarily unavailable. Error when starting up SSH session: -8 #1426
- robo3t 1.1 failed to start on Ubuntu 17.04 #1385
- Robo 3T is not opening on MacOS High Sierra (#1412)
- Cannot load list of indexes #1454
- Robo 3T is not buildable on latest MacOS High Sierra
Improvements
- Qt version upgraded from Qt 5.7.0 to Qt 5.9.3
- Auto switch to HTTP from HTTPS if the program crashes due to HTTPS related operations
- Improvements for Robo 3T is crashing constantly on High Sierra #1412
- PR: Improved query time formatting (#1358) #1455
Robo 3T 1.2.0 Beta (18 Dec, 2017)
https://github.com/Studio3T/robomongo/releases/tag/v1.2.0-beta
Improvements & Fixes:
- Qt version upgraded from Qt 5.7.0 to Qt 5.9.3
- Fix for "Cannot load list of indexes #1454"
- Improvements for Robo 3T is crashing constantly on High Sierra #1412
- PR: Improved query time formatting (#1358) #1455
- Fix for "Robo 3T is not buildable on latest MacOS vesion High Sierra"
- Fix attempt for "Error: Resources temporarily unavailable. Error when starting up SSH session: -8 #1426"
- Fix for "robo3t 1.1 failed to start on Ubuntu 17.04 #1385"
Robo 3T 1.1 (13 June, 2017)
http://blog.robomongo.org/robomongo-1-1/
New Features:
- MongoDB 3.4 support
- Replica set support.
- New NumberDecimal (Decimal128) data type support
- ECMAScript 2015 aka ES6 Support (Modernized JavaScript Implementation)
- Re-naming from Robomongo to Robo 3T
Improvements & Fixes:
- Stability Improvements: Fix included to prevent a crash on MACOS Sierra
- Shell timeout is configurable on UI now 'Options->Change Shell Timeout'
- Fix for Robomongo Shell Timeout Issue (silently, prematurely finishing long lasting scripts)
- Security Improvements: OpenSSL version upgrade to openssl-1.0.1u (22-Sep-2016)
- Tool chain upgrades: Modern C++14 features are enabled and usable for developers
Robomongo 1.1 Beta (12 May, 2017)
https://github.com/Studio3T/robomongo/releases/tag/v1.1.0-beta
New Features:
- MongoDB 3.4 Support
- New NumberDecimal (Decimal128) data type support
- ECMAScript 2015 (Modernized JavaScript Implementation aka ES6) Support
Improvements:
- Security Improvements: OpenSSL version upgrade to openssl-1.0.1u (22-Sep-2016)
- Tool Chain Improvements: Modern C++14 features are enabled
Robomongo 1.0 (21 Apr, 2017)
http://blog.robomongo.org/robomongo-1-0
New Features:
- Update Notifications Bar
- Welcome Tab
- New operation logging for almost all operations.
- Welcome Wizard
Major Fixes/Improvements:
- Fix for Robomongo Shell Timeout Issue (silently, prematurely finishing long lasting scripts)
- New NumberDecimal (Decimal128) data type support
- Aggregate query results are pagaeble now
- Fix for Big double numbers are showing incorrectly #1447
- Fix for Editing a document from a projection causes data loss (override) (#881)
- Improved error handling (no double error windows) for almost all operations.
Improvements:
- Replica set name configurable on UI
- Configuration file system location change
- "About Robomongo" dialog changes
Fixes:
- Fix to avoid the same set name problem (https://github.com/Studio3T/robomongo/issues/1302)
- Timestamp value is represented incorrectly (https://github.com/Studio3T/robomongo/issues/1159)
- Local Timezone shows wrong date (https://github.com/Studio3T/robomongo/issues/501)
* What's new in Robo 3T 1.2.1 (19 Feb, 2018)
http://blog.robomongo.org/robo-3t-1-2
Fixes:
- Aggregate query results are not pagaeble
- Big double numbers are showing incorrectly #1447
- Editing a document from a projection causes data loss (override) (#881)
- Error: Resources temporarily unavailable. Error when starting up SSH session: -8 #1426
- robo3t 1.1 failed to start on Ubuntu 17.04 #1385
- Robo 3T is not opening on MacOS High Sierra (#1412)
- Cannot load list of indexes #1454
- Robo 3T is not buildable on latest MacOS High Sierra
Improvements
- Qt version upgraded from Qt 5.7.0 to Qt 5.9.3
- Auto switch to HTTP from HTTPS if the program crashes due to HTTPS related operations
- Improvements for Robo 3T is crashing constantly on High Sierra #1412
- PR: Improved query time formatting (#1358) #1455
* What's new in Robo 3T 1.2.0 Beta (18 Dec, 2017)
https://github.com/Studio3T/robomongo/releases/tag/v1.2.0-beta
Improvements & Fixes:
- Qt version upgraded from Qt 5.7.0 to Qt 5.9.3
- Fix for "Cannot load list of indexes #1454"
- Improvements for Robo 3T is crashing constantly on High Sierra #1412
- PR: Improved query time formatting (#1358) #1455
- Fix for "Robo 3T is not buildable on latest MacOS vesion High Sierra"
- Fix attempt for "Error: Resources temporarily unavailable. Error when starting up SSH session: -8 #1426"
- Fix for "robo3t 1.1 failed to start on Ubuntu 17.04 #1385"
* What's new in Robo 3T 1.1 (13 June, 2017)
http://blog.robomongo.org/robomongo-1-1/
New Features:
- MongoDB 3.4 support
- New NumberDecimal (Decimal128) data type support
- ECMAScript 2015 aka ES6 Support (Modernized JavaScript Implementation)
- Re-naming from Robomongo to Robo 3T
Improvements & Fixes:
- Stability Improvements: Fix included to prevent a crash on MACOS Sierra
- Shell timeout is configurable on UI now 'Options->Change Shell Timeout'
- Fix for Robomongo Shell Timeout Issue (silently, prematurely finishing long lasting scripts)
- Security Improvements: OpenSSL version upgrade to openssl-1.0.1u (22-Sep-2016)
- Tool chain upgrades: Modern C++14 features are enabled and usable for developers
* What's new in Robomongo 1.1 Beta (12 May, 2017)
https://github.com/Studio3T/robomongo/releases/tag/v1.1.0-beta
New Features:
- MongoDB 3.4 Support
- New NumberDecimal (Decimal128) data type support
- ECMAScript 2015 (Modernized JavaScript Implementation aka ES6) Support
Improvements:
- Security Improvements: OpenSSL version upgrade to openssl-1.0.1u (22-Sep-2016)
- Tool Chain Improvements: Modern C++14 features are enabled
* What's new in Robomongo 1.0 (21 Apr, 2017)
http://blog.robomongo.org/robomongo-1-0
New Features:
- Update Notifications Bar
- Welcome Tab
- Welcome Wizard
Improvements:
- Replica set name configurable on UI
- Configuration file system location change
- "About Robomongo" dialog changes
Fixes:
- Fix to avoid the same set name problem (https://github.com/Studio3T/robomongo/issues/1302)
- Timestamp value is represented incorrectly (https://github.com/Studio3T/robomongo/issues/1159)
- Local Timezone shows wrong date (https://github.com/Studio3T/robomongo/issues/501)
- Time zone shown as "000:00" when UTC +00:00 is used as local timezone(https://github.com/Studio3T/robomongo/issues/1309)
- Time zone shown as "000:00" when UTC +00:00 is used as local timezone(https://github.com/Studio3T/robomongo/issues/1309)
* What's new in Robomongo 1.0-RC1 (1 Feb, 2017)
http://blog.robomongo.org/robomongo-1-rc1/
Robomongo 1.0-RC1 (1 Feb, 2017)
http://blog.robomongo.org/robomongo-1-rc1/
New Features:
- Replica set support.
- New 'Attributes' column in connections list window showing connection properties such as 'Replica Set', 'SSL' and 'SSH'.
- New operation logging for almost all operations.
New Features:
- Replica set support.
- New 'Attributes' column in connections list window showing connection properties such as 'Replica Set', 'SSL' and 'SSH'.
- New operation logging for almost all operations.
Improvements:
- Improved error handling (no double error windows) for all fail and success conditions for the following operations:
. Create, Drop Database
. Create, Edit User
. Create, Drop, Duplicate, Rename Collection
. Insert Document
. Remove document, Delete document, Remove all documents (triggered both from explorer and from result widget)
. Refresh Users
. Refresh Functions
. Refresh Collections
. Connection establish & refresh server fail and success cases.
- Windows size is saved and restored for Edit, View and Insert Document dialogs.
- Connections are automatically imported from the latest Robomongo version.
- Better error reporting/handling and logging have been added for the operations below:
. Create, Drop Function
. Drop User
- More informative and adjusted log level prefix strings haven added for log window. (Error, Warn, Info etc..).
- After a new connection is created, now the focus goes to the newly created connection (end of list) instead of the
beginning of connections list. And when Robomongo is opened, the focus goes to the end of the connection list instead
of beginning.
- Error messages added and error handling for 'remove document', 'remove all documents' operations triggered explorer
and single or multi 'delete document' from results window have been re-implemented and improved.
- Relevant errors are shown for the following cases now:
. Drop attempt of non-existing collection.
. Duplicating a collection with a collection name which already exists finishes silently.
Fixes:
- Fix for the problem where the connections list comes empty if the Robomongo config file or it's directory do not exist.
- Fix for the problem where 'in-progress bar' widget was not centered on main window for "Update Documents/Remove Documents"
operations. https://github.com/paralect/robomongo/issues/1256
- Fix for two problems where the operations 'insert or update documents' in one tab was causing auto reloading of other
unrelated tabs and also multiple error windows to popup. https://github.com/paralect/robomongo/issues/1236
- Fix for the problem where the operations 'remove document', 'remove all documents' triggered explorer and single or
multi 'delete document' from results window were causing auto reloading of other unrelated tabs.
Improvements:
- Improved error handling (no double error windows) for all fail and success conditions for the following operations:
. Create, Drop Database
. Create, Edit User
. Create, Drop, Duplicate, Rename Collection
. Insert Document
. Remove document, Delete document, Remove all documents (triggered both from explorer and from result widget)
. Refresh Users
. Refresh Functions
. Refresh Collections
. Connection establish & refresh server fail and success cases.
- Windows size is saved and restored for Edit, View and Insert Document dialogs.
- Connections are automatically imported from the latest Robomongo version.
- Better error reporting/handling and logging have been added for the operations below:
. Create, Drop Function
. Drop User
- More informative and adjusted log level prefix strings haven added for log window. (Error, Warn, Info etc..).
- After a new connection is created, now the focus goes to the newly created connection (end of list) instead of the
beginning of connections list. And when Robomongo is opened, the focus goes to the end of the connection list instead
of beginning.
- Error messages added and error handling for 'remove document', 'remove all documents' operations triggered explorer
and single or multi 'delete document' from results window have been re-implemented and improved.
- Relevant errors are shown for the following cases now:
. Drop attempt of non-existing collection.
. Duplicating a collection with a collection name which already exists finishes silently.
Fixes:
- Fix for the problem where the connections list comes empty if the Robomongo config file or it's directory do not exist.
- Fix for the problem where 'in-progress bar' widget was not centered on main window for "Update Documents/Remove Documents"
operations. https://github.com/paralect/robomongo/issues/1256
- Fix for two problems where the operations 'insert or update documents' in one tab was causing auto reloading of other
unrelated tabs and also multiple error windows to popup. https://github.com/paralect/robomongo/issues/1236
- Fix for the problem where the operations 'remove document', 'remove all documents' triggered explorer and single or
multi 'delete document' from results window were causing auto reloading of other unrelated tabs.
Robomongo 0.9:
+25 -12
View File
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.0.0)
cmake_minimum_required(VERSION 3.8.0)
project(Robomongo)
# Where to look first for CMake modules, before "${CMAKE_ROOT}/Modules" is checked
@@ -6,13 +6,13 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
# Project version
set(PROJECT_VERSION_MAJOR "1")
set(PROJECT_VERSION_MINOR "3")
set(PROJECT_VERSION_PATCH "0")
set(PROJECT_VERSION_MINOR "4")
set(PROJECT_VERSION_PATCH "4")
set(PROJECT_VERSION_BUILD "")
set(PROJECT_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}${PROJECT_VERSION_BUILD}")
# Enable C++14 features
set(CMAKE_CXX_STANDARD 14)
# Enable C++17 features
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Modules
@@ -33,26 +33,39 @@ find_package(Qt5Widgets REQUIRED)
find_package(Qt5PrintSupport REQUIRED)
find_package(Qt5Network REQUIRED)
find_package(Qt5Xml REQUIRED)
if(NOT SYSTEM_LINUX)
find_package(Qt5WebEngineWidgets REQUIRED)
endif()
find_package(MongoDB REQUIRED)
find_package(OpenSSL REQUIRED)
if (SYSTEM_MACOSX)
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.11)
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.14)
find_package(Qt5MacExtras REQUIRED)
endif()
# Projects
set(LIBSSH2_VERSION 1.9.0)
if(SYSTEM_LINUX)
set(LIBSSH2_VERSION 1.7.0)
endif()
set(LIBSSH2_DIR src/third-party/libssh2-${LIBSSH2_VERSION})
set(QJSON_VERSION 0.8.1)
set(QJSON_DIR src/third-party/qjson-${QJSON_VERSION})
set(QSCINTILLA_VERSION 2.8.4)
set(QSCINTILLA_DIR src/third-party/qscintilla-${QSCINTILLA_VERSION})
set(ESPRIMA_VERSION 2.7.3)
set(ESPRIMA_DIR src/third-party/esprima-${ESPRIMA_VERSION})
# todo: Use equivalent vars from googletest cmake files. Currently they are somehow not working.
set(GOOGLE_TEST_VERSION 1.8.1)
set(GOOGLE_TEST_DIR src/third-party/googletest-${GOOGLE_TEST_VERSION})
# Projects
add_subdirectory(src/third-party/libssh2)
add_subdirectory(${LIBSSH2_DIR})
add_subdirectory(src/robomongo/ssh)
add_subdirectory(src/third-party/qjson)
add_subdirectory(src/third-party/qscintilla)
add_subdirectory(${QJSON_DIR})
add_subdirectory(${QSCINTILLA_DIR})
add_subdirectory(${GOOGLE_TEST_DIR})
add_subdirectory(src/robomongo)
add_subdirectory(src/robomongo-unit-tests)
# Show configuration summary
include(RobomongoConfigurationSummary)
include(RobomongoConfigurationSummary)
+24
View File
@@ -0,0 +1,24 @@
FROM debian
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get install -y --no-install-recommends --fix-missing\
libgl-dev \
qt5dxcb-plugin \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/
ADD https://download-test.robomongo.org/linux/robo3t-1.3.1-linux-x86_64-7419c406.tar.gz /opt/robo3t.tar.gz
RUN cd /opt/ \
&& mkdir robo3t \
&& tar -C /opt/robo3t --strip-components 1 -xzf robo3t.tar.gz && rm robo3t.tar.gz \
&& ls /opt/robo3t
VOLUME /root/.3T
VOLUME /root/.config/3T
RUN apt update && apt upgrade -y && apt autoremove -y
RUN apt install openssh-client -y
CMD /opt/robo3t/bin/robo3t
+84 -75
View File
@@ -1,39 +1,55 @@
About Robo 3T
===============
[Robo 3T](http://www.robomongo.org) (formerly Robomongo *) is a shell-centric cross-platform MongoDB management tool. Unlike most other MongoDB admin UI tools, Robo 3T embeds the actual `mongo` shell in a tabbed interface with access to a shell command line as well as GUI interaction.
Starting from version 1.1, Robo 3T embeds the **MongoDB 3.4** shell.
The latest stable release **Robo 3T 1.4** embeds **MongoDB 4.2** shell.
Starting from version 0.9, Robo 3T is compatibile with MongoDB 3.x (including SCRAM-SHA-1 auth and support for WiredTiger storage engine). Robo 3T 0.9 embeds the **MongoDB 3.2** shell.
Blog: http://blog.robomongo.org/robo-3t-1-4/
Download: https://robomongo.org/download
All Releases: https://github.com/Studio3T/robomongo/releases
Watch: [Robo 3T Youtube channel](https://www.youtube.com/channel/UCM_7WAseRWeeiBikExppstA)
Follow: https://twitter.com/Robomongo
Robo 3T 0.8.x embeds the **MongoDB 2.4.0** shell.
**Embedded MongoDB shell history:**
Robo 3T 1.4 -> MongoDB 4.2
Robo 3T 1.3 -> MongoDB 4.0
Robo 3T 1.1 -> MongoDB 3.4
Robo 3T 0.9 -> MongoDB 3.2
Robo 3T 0.8.x -> MongoDB 2.4.0
\* [Robomongo has been acquired by 3T](https://studio3t.com/press/3t-software-labs-acquires-robomongo-the-most-widely-used-mongodb-tool/)
What's new in latest Robo 3T 1.2?
What's new in latest Robo 3T 1.4?
====================================
Fixes:
- Aggregate query results are not pagaeble [#1058](https://github.com/Studio3T/robomongo/issues/1058)
- Big double numbers are showing incorrectly [#1447](https://github.com/Studio3T/robomongo/issues/1447)
- Editing a document from a projection causes data loss (override) [#881](https://github.com/Studio3T/robomongo/issues/881)
- SSH: Resources temporarily unavailable. Error when starting up SSH session [#1189](https://github.com/Studio3T/robomongo/issues/1189#issuecomment-353279070)
- robo3t 1.1 failed to start on Ubuntu 17.04 [#1385](https://github.com/Studio3T/robomongo/issues/1385)
- Robo 3T is not opening on MacOS High Sierra [#1412](https://github.com/Studio3T/robomongo/issues/1412#issuecomment-353276002)
- Cannot load list of indexes [#1454](https://github.com/Studio3T/robomongo/issues/1454)
- Robo 3T is not buildable on latest MacOS High Sierra
Improvements
- Qt version upgraded from Qt 5.7.0 to Qt 5.9.3
- Auto switch to HTTP from HTTPS if the program crashes due to HTTPS related operations
- Improvements for Robo 3T is crashing constantly on High Sierra [#1412](https://github.com/Studio3T/robomongo/issues/1412#issuecomment-353276002)
- PR: Improved query time formatting (#1358) [#1455](https://github.com/Studio3T/robomongo/issues/1455)
New Features:
- Mongo shell 4.2 upgrade
- Support for Ubuntu 20.04, macOS Big Sur and macOS 10.15 (Catalina)
- SSH: ECDSA and Ed25519 keys support on Windows & macOS (issues #1719, #1530, #1590)
- Manually specify visible databases (issues #1696, #1368, #389)
- New Welcome Tab - embeds Chromium using QtWebEngine (Windows, macOS only)
- Import keys from old version: autoExpand, lineNumbers, debugMode and shellTimeoutSec
Improvements:
- Qt Upgrade (v5.12.8 - Apr/2020, Windows & macOS only)
- OpenSSL upgrade (v1.1.1f - Mar/2020, Windows & macOS only)
- libssh2 upgrade (v1.9.0 - Jun/2019, Windows & macOS only)
- Database explorer section has smaller default width (#1556)
- Remember database explorer section size
Blog: http://blog.robomongo.org/robo-3t-1-2/
Download: https://robomongo.org/download
Watch: [Robo 3T Youtube channel](https://www.youtube.com/channel/UCM_7WAseRWeeiBikExppstA)
Follow: https://twitter.com/Robomongo
Fixes:
- Fix previously broken IPv6 support from command line: robo3t --ipv6
- Fix crash when paging used in tabbed result window (#1661)
- Fix broken paging in DocumentDB (#1694)
- Authentication database option isn't used properly (#1696)
- Add/Edit index ops fixed (re-written) (#1692)
- Crash when expanding admin users (#1728)
- Unable to run query after shell timeout reached (#1529)
- Fix broken F2, F3, F4 shortcuts for tabbed result view
- One time re-order limit per new connections window to prevent data loss (macOS, #1790)
- Fix crash when new shell tab executed in server unreachable case
Supported Platforms
===============
@@ -41,62 +57,33 @@ Supported Platforms
Note: This sections is for Robo 3T and it directly depends on what MongoDB suppports
(See: https://docs.mongodb.com/manual/administration/production-notes/#prod-notes-supported-platforms)
| MongoDB Versions |
| :-------------------- |
| 3.4 |
| 3.2 |
| 3.0 |
| 2.6 |
| MongoDB Cloud Platforms|
| :------------ |
| MongoDB Atlas |
| Compose |
| mLab |
| ObjectRocket |
| ScaleGrid |
| Amazon EC2 |
| MongoDB Versions | MongoDB Cloud Platforms |
| :-------------------- | :-------------------- |
| 4.2 | Mongo Atlas |
| 4.0 |
| 3.6 |
| Windows | Mac | Linux |
|:---------------------- | :--------------------------------| :---------------------------|
| Windows 64-bit 10 | Mac OS X 10.13 (High Sierra) | Linux Ubuntu 17.10 64-bit* |
Windows 64-bit 8.1 | Mac OS X 10.12 (Sierra) | Linux Ubuntu 16.04 64-bit* |
| Windows 64-bit 7 | Mac OS X 10.11 (El Capitan) | Linux CentOS 7 64-bit* ** |
| | | Linux CentOS 6 64-bit* ** |
| Windows 64-bit 10 | Mac OS X 11 (Big Sur) | Linux Ubuntu 20.04 64-bit |
Windows 64-bit 8.1 | Mac OS X 10.15 (Catalina) | Linux Ubuntu 18.04 64-bit |
| Windows 64-bit 7 | Mac OS X 10.14 (Mojave) | |
\* Latest stable build
\** Support for CentOS temporarily dropped starting from version 1.1
Download
========
You can download tested install packages for OS X, Windows, and Linux from our site: [www.robomongo.org](http://www.robomongo.org).
The latest stable release is currently [**Robo 3T 1.2**](http://blog.robomongo.org/robo-3t-1-2/).
Support
=======
Robo 3T is an open source project driven by volunteers. We'll try to get to your questions as soon as we can, but please be patient :).
You can:
- [Create a new issue in the Github issue queue](https://github.com/paralect/robomongo/issues)
- [Join developer discussion on Gitter](https://gitter.im/paralect/robomongo)
Contribute!
===========
### Suggest Features
New feature suggestions or UI improvements are always welcome.
[Create a new feature request on github](https://github.com/paralect/robomongo/issues/new)
This project is powered by open source volunteers, so we have a limited amount of development resource to address all requests. We will certainly make best efforts to progress (particularly for those with strong community upvotes).
### Code Contributions
See all docs here: https://github.com/Studio3T/robomongo/wiki
**Some important docs:**
- [Build Diagram](https://github.com/Studio3T/robomongo/wiki/Robo-3T-Schematics:-Build,-Class-and-UI-Diagrams#1-build-diagram)
- [Static Code Analysis](https://github.com/Studio3T/robomongo/wiki/Static-Code-Analysis)
- [Robo 3T Feature Specisification](https://github.com/Studio3T/robomongo/wiki/Feature-Spec)
- [Debugging](https://github.com/Studio3T/robomongo/blob/master/docs/Debug.md)
- [Schematics](https://github.com/Studio3T/robomongo/tree/master/schematics)
Code contributions are always welcome! Just try to follow our pre-commit checks and coding style:
- [Robo 3T Code Quality](https://github.com/paralect/robomongo/wiki/Robomongo-Code-Quality)
- [Robo 3T C++11/14 Transition Guide](https://github.com/Studio3T/robomongo/wiki/Robomongo-Cplusplus-11,-14-Transition-Guide)
@@ -111,19 +98,41 @@ A usual naming approach for feature branches is `issue-###`. Include the issue n
For example:
```#248: updated QScintilla to 2.4.8 for retina display support".```
### Design
There are some cosmetic issues we could use help with (designing images or UI). They are marked in the issue queue with a [`Cosmetic`](https://github.com/paralect/robomongo/labels/cosmetic) label. If you see an open issue that you'd like to contribute to, please feel free to volunteer by commenting on it.
### Testing
There are a number of issues we could use help with reproducing. They are marked in the issue queue with a [`Needs Repro`](https://github.com/paralect/robomongo/labels/needs%20repro) label. If you see an open issue that doesn't appear to be reproducible yet, please feel free to test and comment with your findings.
- [Unit-Tests](https://github.com/Studio3T/robomongo/wiki/Unit-Tests)
- [Manual Tests](wiki/Tests)
- See all docs here: https://github.com/Studio3T/robomongo/wiki
### Suggest Features
New feature suggestions or UI improvements are always welcome.
[Create a new feature request on github](https://github.com/paralect/robomongo/issues/new)
This project is powered by open source volunteers, so we have a limited amount of development resource to address all requests. We will certainly make best efforts to progress (particularly for those with strong community upvotes).
Download
========
You can download tested installer packages for macOS, Windows, and Linux from our site: [www.robomongo.org](http://www.robomongo.org).
Support
=======
Robo 3T is an open source project driven by volunteers. We'll try to get to your questions as soon as we can, but please be patient :).
You can:
- [Create a new issue in the Github issue queue](https://github.com/paralect/robomongo/issues)
- [Join developer discussion on Gitter](https://gitter.im/paralect/robomongo)
License
=======
Copyright 2014-2018 [3T Software Labs Ltd](https://studio3t.com/). All rights reserved.
Copyright 2014-2021 [3T Software Labs Ltd](https://studio3t.com/). All rights reserved.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 3 as
+11
View File
@@ -3,6 +3,8 @@ Bash fronted for CMake
If you want to use this scripts, you need to set single environment variable:
E.g.:
export ROBOMONGO_CMAKE_PREFIX_PATH="/path/to/qt-5/5.5/gcc_64;/path/to/robomongo-shell"
Build Robomongo:
@@ -14,7 +16,16 @@ Install Robomongo:
$ bin/install
Run Robomongo:
$ bin/run
Pack Robomongo:
$ bin/pack
More:
- [Build Robo 3T - Mac OS X and Linux](https://github.com/paralect/robomongo/blob/master/docs/BuildRobo3TOnMacAndLinux.md)
- [Build Robo 3T - Windows](https://github.com/paralect/robomongo/blob/master/docs/BuildRobo3TOnWindows.md)
- [Unit Tests](wiki/Unit-Tests)
- [Static Code Analysis](wiki/Static-Code-Analysis)
+2 -2
View File
@@ -2,7 +2,7 @@
BIN_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # Get directory of this file
PROJECT_DIR=$(dirname $BIN_DIR) # Get root directory of project
source $BIN_DIR/common/setup $1
source $BIN_DIR/common/setup $1 # $1: release or debug
cd $BUILD_DIR
cmake --build . "${@:2}" -- -j8
cmake --build . "${@:2}" -- -j8
@@ -4,4 +4,4 @@ BIN_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # Get director
PROJECT_DIR=$(dirname $BIN_DIR) # Get root directory of project
source $BIN_DIR/build || exit $?
source $BIN_DIR/run_tests $1
source $BIN_DIR/run-tests $1
@@ -11,5 +11,5 @@ call "%BIN_DIR%\build.bat" %*
if %ERRORLEVEL% neq 0 (exit /b 1)
rem Run tests
call "%BIN_DIR%\run_tests.bat" %*
call "%BIN_DIR%\run-tests.bat" %*
if %ERRORLEVEL% neq 0 (exit /b 1)
+5
View File
@@ -13,3 +13,8 @@ if %ERRORLEVEL% neq 0 (exit /b 1)
rem Run build
cd "%BUILD_DIR%"
cmake --build . --config %BUILD_TYPE%
rem Install debug *.dll files
if "%BUILD_TYPE%" == "Debug" (
call "%BIN_DIR%\install-debug-dlls.bat" %*
)
+10
View File
@@ -0,0 +1,10 @@
bugprone-*
cert-*
clang-analyzer-*
cppcoreguidelines-*
concurrency-*
hicpp-*
llvm-*
misc-*
performance-*
readability-*
+4
View File
@@ -0,0 +1,4 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<EnableClangTidyCodeAnalysis>true</EnableClangTidyCodeAnalysis>
<ClangTidyChecks></ClangTidyChecks>
</PropertyGroup>
+1 -20
View File
@@ -27,23 +27,4 @@ PACK_PREFIX=$BUILD_DIR/package
PREFIX_PATH=$ROBOMONGO_CMAKE_PREFIX_PATH
mkdir -p $BUILD_DIR
if [ "$(uname -s)" == "Darwin" ]; then
# On Mac OS we specify minimal OS version that we support.
#
# The following environment variable will set "-mmacosx-version-min=10.6" option
# for compiler. From documentation to GCC or Clang:
#
# -mmacosx-version-min=version
#
# The earliest version of MacOS X that this executable will run on is
# version. Typical values of version include 10.1, 10.2, and 10.3.9.
#
# This value can also be set with the MACOSX_DEPLOYMENT_TARGET environment
# variable. If both the command-line option is specified and the
# environment variable is set, the command-line option will take precedence.
#
export MACOSX_DEPLOYMENT_TARGET=10.9
fi
mkdir -p $BUILD_DIR
+3 -2
View File
@@ -2,7 +2,8 @@
BIN_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # Get directory of this file
PROJECT_DIR=$(dirname $BIN_DIR) # Get root directory of project
source $BIN_DIR/common/setup $1
source $BIN_DIR/common/setup $1 # $1: release or debug
cd $BUILD_DIR
cmake -D "CMAKE_PREFIX_PATH=$PREFIX_PATH" -D "CMAKE_BUILD_TYPE=$BUILD_TYPE" -D "CMAKE_INSTALL_PREFIX=$INSTALL_PREFIX" "${@:2}" $PROJECT_DIR
# $BUILD_TYPE: Release or Debug
cmake -D "CMAKE_PREFIX_PATH=$PREFIX_PATH" -D "CMAKE_BUILD_TYPE=$BUILD_TYPE" -D "CMAKE_INSTALL_PREFIX=$INSTALL_PREFIX" "${@:2}" $PROJECT_DIR
+7 -1
View File
@@ -11,5 +11,11 @@ call "%BIN_DIR%\common\setup.bat" %*
if %ERRORLEVEL% neq 0 (exit /b 1)
rem Run CMake configuration step
rem BUILD_TYPE: Release or Debug
cd "%BUILD_DIR%"
cmake -G "Visual Studio 14 2015 Win64" -D "CMAKE_PREFIX_PATH=%PREFIX_PATH%" -D "CMAKE_BUILD_TYPE=%BUILD_TYPE%" -D "CMAKE_INSTALL_PREFIX=%INSTALL_PREFIX%" %PROJECT_DIR%
cmake -G "Visual Studio 15 2017 Win64" -D "CMAKE_PREFIX_PATH=%PREFIX_PATH%" -D "CMAKE_BUILD_TYPE=%BUILD_TYPE%" -D "CMAKE_INSTALL_PREFIX=%INSTALL_PREFIX%" %PROJECT_DIR%
@REM echo ___________________________________________________________________
@REM rem Enable Clang Tidy for Visual Studio 2019 IDE ...
@REM set ROBO_PROJ_FILE=%BUILD_DIR%/src/robomongo/robomongo.vcxproj
@REM python %BIN_DIR%\enable-visual-studio-clang-tidy.py %ROBO_PROJ_FILE% %BIN_DIR%
+44
View File
@@ -0,0 +1,44 @@
import sys
from lxml import etree
print('\nEnabling Clang Tidy for Visual Studio 2019')
robo_proj_xml = sys.argv[1]
clang_tidy_xml = sys.argv[2] + '/clang-tidy.xml'
clang_checks_txt = sys.argv[2] + '/clang-checks.txt'
print(sys.argv[0] + ":\nProcessing: " + sys.argv[1])
## Read clang checks
clang_checks = None
with open(clang_checks_txt, "r") as file:
clang_checks = file.read().replace('\n', ',')
##
tree = etree.parse(robo_proj_xml)
ns = {'ns':'http://schemas.microsoft.com/developer/msbuild/2003'}
if(tree.find('//ns:EnableClangTidyCodeAnalysis', namespaces=ns) is not None):
tree.find('//ns:ClangTidyChecks', namespaces=ns).text = clang_checks
tree.write(robo_proj_xml)
print('Finished')
sys.exit()
## Append clang_tidy_xml - Todo: refactor using etree
with open(robo_proj_xml, "r") as in_file:
buf = in_file.readlines()
with open(clang_tidy_xml, "r") as in_file:
clang_tidy_xml_buf = in_file.read()
appended = False
with open(robo_proj_xml, "w") as out_file:
for line in buf:
if "</ItemGroup>" in line and appended == False:
line = line + clang_tidy_xml_buf
appended = True
out_file.write(line)
## Add clang checks
tree = etree.parse(robo_proj_xml)
tree.find('//ns:ClangTidyChecks', namespaces=ns).text = clang_checks
tree.write(robo_proj_xml)
print('Finished')
+54
View File
@@ -0,0 +1,54 @@
@echo off
setlocal enableextensions enabledelayedexpansion
rem // This script installs debug *.dll files
rem -------------------------------------------
set INSTALL_DIR=%BUILD_DIR%\src\robomongo\Debug\
if not exist %INSTALL_DIR%*.dll (
echo ----------------------------------------
echo Installing debug *.dll files ...
echo INSTALL_DIR: %INSTALL_DIR%
echo ----------------------------------------
)
rem // Find OpenSSL and Qt paths
for %%i in (%ROBOMONGO_CMAKE_PREFIX_PATH%) do (
set xx=%%i
if not "!xx!"=="!xx:ssl=!" ( set OPENSSL_DIR=!xx! )
if not "!xx!"=="!xx:qt=!" ( set Qt_DIR=!xx! )
)
set OPENSSL_DIR=%OPENSSL_DIR: =%
set Qt_DIR=%Qt_DIR: =%
rem // Copy dll files
for /d %%a in (
"%VS140COMNTOOLS%\..\..\VC\redist\debug_nonredist\x64\Microsoft.VC140.DebugCRT\msvcp140d.dll"
"%VS140COMNTOOLS%\..\..\VC\redist\debug_nonredist\x64\Microsoft.VC140.DebugCRT\vcruntime140d.dll"
"%OPENSSL_DIR%\libssl-1_1-x64.dll"
"%OPENSSL_DIR%\libcrypto-1_1-x64.dll"
"%Qt_DIR%\bin\Qt5Cored.dll"
"%Qt_DIR%\bin\Qt5Guid.dll"
"%Qt_DIR%\bin\Qt5Networkd.dll"
"%Qt_DIR%\bin\Qt5Widgetsd.dll"
"%Qt_DIR%\bin\Qt5Positioningd.dll"
"%Qt_DIR%\bin\Qt5Qmld.dll"
"%Qt_DIR%\bin\Qt5Quickd.dll"
"%Qt_DIR%\bin\Qt5QuickWidgetsd.dll"
"%Qt_DIR%\bin\Qt5WebChanneld.dll"
"%Qt_DIR%\bin\Qt5WebEngineCored.dll"
"%Qt_DIR%\bin\Qt5WebEngineWidgetsd.dll"
"%Qt_DIR%\bin\Qt5PrintSupportd.dll"
) do (
if not exist !INSTALL_DIR!%%~NXa (
xcopy %%a !INSTALL_DIR! /d /y
)
)
if not exist %INSTALL_DIR%\imageformats\qgifd.dll (
xcopy /s "%Qt_DIR%\plugins\imageformats" %INSTALL_DIR%\imageformats\ /d /y
)
if not exist %INSTALL_DIR%\platforms\qminimald.dll (
xcopy /s "%Qt_DIR%\plugins\platforms" %INSTALL_DIR%\platforms\ /d /y
)
+6
View File
@@ -0,0 +1,6 @@
@echo off
setlocal enableextensions enabledelayedexpansion
call "clean.bat" %*
call "configure.bat" %*
call "build.bat" %*
+6 -4
View File
@@ -4,9 +4,11 @@ BIN_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # Get director
PROJECT_DIR=$(dirname $BIN_DIR) # Get root directory of project
source $BIN_DIR/common/setup $1
echo "Note: ./install must be executed before this script."
if [ "$(uname -s)" == "Darwin" ]; then
# On Mac OS we should run executable from bundle
"$BUILD_DIR/src/robomongo/Robo 3T.app/Contents/MacOS/Robo 3T"
echo "Starting $BUILD_DIR/install/Robo 3T.app/Contents/MacOS/Robo 3T"
"$BUILD_DIR/install/Robo 3T.app/Contents/MacOS/Robo 3T"
else
"$BUILD_DIR/src/robomongo/robo3t"
fi
echo "Starting $BUILD_DIR/install/bin/robo3t"
"$BUILD_DIR/install/bin/robo3t"
fi
+33
View File
@@ -0,0 +1,33 @@
#!/usr/bin/env bash
### Common Setup
BIN_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # Get directory of this file
PROJECT_DIR=$(dirname $BIN_DIR) # Get root directory of project
source $BIN_DIR/common/setup $1 # $1: release or debug
### Setup
CLANG_TIDY_BUILD_DIR=$PROJECT_DIR/build/clang-tidy-$BUILD_TYPE
rm -rf $CLANG_TIDY_BUILD_DIR
mkdir -p $CLANG_TIDY_BUILD_DIR && cd $CLANG_TIDY_BUILD_DIR
### Configure cmake
# Info: $BUILD_TYPE == Release or Debug
cmake -D "CMAKE_EXPORT_COMPILE_COMMANDS=ON" -D "CMAKE_PREFIX_PATH=$PREFIX_PATH" -D "CMAKE_BUILD_TYPE=$BUILD_TYPE" -D "CMAKE_INSTALL_PREFIX=$INSTALL_PREFIX" "${@:2}" $PROJECT_DIR
echo -e "\n------------------------------------------------"
echo "clang-tidy configured. Mode: $BUILD_TYPE"
echo -e "------------------------------------------------\n"
### Run clang-tidy
FILE_OR_PATH=/opt/robo/src/robomongo/ # or MainWindow.cpp
CHECKS=clang-analyzer-*,readability-implicit-bool-conversion
# All Checks: https://clang.llvm.org/extra/clang-tidy/checks/list.html
# e.g. $BIN_DIR/run-clang-tidy.py -checks=clang-analyzer-*,readability-implicit-bool-conversion /opt/robo/src/robomongo/
$BIN_DIR/run-clang-tidy.py -checks=$CHECKS $FILE_OR_PATH
echo -e "\n------------------------------------------------"
echo "clang-tidy finished"
echo "Mode : $BUILD_TYPE"
echo "CLANG_TIDY_BUILD_DIR: $CLANG_TIDY_BUILD_DIR"
echo "Command executed : $BIN_DIR/run-clang-tidy.py -checks=$CHECKS $FILE_OR_PATH"
echo -e "------------------------------------------------\n"
+326
View File
@@ -0,0 +1,326 @@
#!/usr/bin/env python
#
#===- run-clang-tidy.py - Parallel clang-tidy runner ---------*- python -*--===#
#
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#
#===------------------------------------------------------------------------===#
# FIXME: Integrate with clang-tidy-diff.py
"""
Parallel clang-tidy runner
==========================
Runs clang-tidy over all files in a compilation database. Requires clang-tidy
and clang-apply-replacements in $PATH.
Example invocations.
- Run clang-tidy on all files in the current working directory with a default
set of checks and show warnings in the cpp files and all project headers.
run-clang-tidy.py $PWD
- Fix all header guards.
run-clang-tidy.py -fix -checks=-*,llvm-header-guard
- Fix all header guards included from clang-tidy and header guards
for clang-tidy headers.
run-clang-tidy.py -fix -checks=-*,llvm-header-guard extra/clang-tidy \
-header-filter=extra/clang-tidy
Compilation database setup:
http://clang.llvm.org/docs/HowToSetupToolingForLLVM.html
"""
from __future__ import print_function
import argparse
import glob
import json
import multiprocessing
import os
import re
import shutil
import subprocess
import sys
import tempfile
import threading
import traceback
try:
import yaml
except ImportError:
yaml = None
is_py2 = sys.version[0] == '2'
if is_py2:
import Queue as queue
else:
import queue as queue
def find_compilation_database(path):
"""Adjusts the directory until a compilation database is found."""
result = './'
while not os.path.isfile(os.path.join(result, path)):
if os.path.realpath(result) == '/':
print('Error: could not find compilation database.')
sys.exit(1)
result += '../'
return os.path.realpath(result)
def make_absolute(f, directory):
if os.path.isabs(f):
return f
return os.path.normpath(os.path.join(directory, f))
def get_tidy_invocation(f, clang_tidy_binary, checks, tmpdir, build_path,
header_filter, extra_arg, extra_arg_before, quiet,
config):
"""Gets a command line for clang-tidy."""
start = [clang_tidy_binary]
if header_filter is not None:
start.append('-header-filter=' + header_filter)
if checks:
start.append('-checks=' + checks)
if tmpdir is not None:
start.append('-export-fixes')
# Get a temporary file. We immediately close the handle so clang-tidy can
# overwrite it.
(handle, name) = tempfile.mkstemp(suffix='.yaml', dir=tmpdir)
os.close(handle)
start.append(name)
for arg in extra_arg:
start.append('-extra-arg=%s' % arg)
for arg in extra_arg_before:
start.append('-extra-arg-before=%s' % arg)
start.append('-p=' + build_path)
if quiet:
start.append('-quiet')
if config:
start.append('-config=' + config)
start.append(f)
return start
def merge_replacement_files(tmpdir, mergefile):
"""Merge all replacement files in a directory into a single file"""
# The fixes suggested by clang-tidy >= 4.0.0 are given under
# the top level key 'Diagnostics' in the output yaml files
mergekey="Diagnostics"
merged=[]
for replacefile in glob.iglob(os.path.join(tmpdir, '*.yaml')):
content = yaml.safe_load(open(replacefile, 'r'))
if not content:
continue # Skip empty files.
merged.extend(content.get(mergekey, []))
if merged:
# MainSourceFile: The key is required by the definition inside
# include/clang/Tooling/ReplacementsYaml.h, but the value
# is actually never used inside clang-apply-replacements,
# so we set it to '' here.
output = { 'MainSourceFile': '', mergekey: merged }
with open(mergefile, 'w') as out:
yaml.safe_dump(output, out)
else:
# Empty the file:
open(mergefile, 'w').close()
def check_clang_apply_replacements_binary(args):
"""Checks if invoking supplied clang-apply-replacements binary works."""
try:
subprocess.check_call([args.clang_apply_replacements_binary, '--version'])
except:
print('Unable to run clang-apply-replacements. Is clang-apply-replacements '
'binary correctly specified?', file=sys.stderr)
traceback.print_exc()
sys.exit(1)
def apply_fixes(args, tmpdir):
"""Calls clang-apply-fixes on a given directory."""
invocation = [args.clang_apply_replacements_binary]
if args.format:
invocation.append('-format')
if args.style:
invocation.append('-style=' + args.style)
invocation.append(tmpdir)
subprocess.call(invocation)
def run_tidy(args, tmpdir, build_path, queue, lock, failed_files):
"""Takes filenames out of queue and runs clang-tidy on them."""
while True:
name = queue.get()
invocation = get_tidy_invocation(name, args.clang_tidy_binary, args.checks,
tmpdir, build_path, args.header_filter,
args.extra_arg, args.extra_arg_before,
args.quiet, args.config)
proc = subprocess.Popen(invocation, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
output, err = proc.communicate()
if proc.returncode != 0:
failed_files.append(name)
with lock:
sys.stdout.write(' '.join(invocation) + '\n' + output.decode('utf-8'))
if len(err) > 0:
sys.stdout.flush()
sys.stderr.write(err.decode('utf-8'))
queue.task_done()
def main():
parser = argparse.ArgumentParser(description='Runs clang-tidy over all files '
'in a compilation database. Requires '
'clang-tidy and clang-apply-replacements in '
'$PATH.')
parser.add_argument('-clang-tidy-binary', metavar='PATH',
default='clang-tidy',
help='path to clang-tidy binary')
parser.add_argument('-clang-apply-replacements-binary', metavar='PATH',
default='clang-apply-replacements',
help='path to clang-apply-replacements binary')
parser.add_argument('-checks', default=None,
help='checks filter, when not specified, use clang-tidy '
'default')
parser.add_argument('-config', default=None,
help='Specifies a configuration in YAML/JSON format: '
' -config="{Checks: \'*\', '
' CheckOptions: [{key: x, '
' value: y}]}" '
'When the value is empty, clang-tidy will '
'attempt to find a file named .clang-tidy for '
'each source file in its parent directories.')
parser.add_argument('-header-filter', default=None,
help='regular expression matching the names of the '
'headers to output diagnostics from. Diagnostics from '
'the main file of each translation unit are always '
'displayed.')
if yaml:
parser.add_argument('-export-fixes', metavar='filename', dest='export_fixes',
help='Create a yaml file to store suggested fixes in, '
'which can be applied with clang-apply-replacements.')
parser.add_argument('-j', type=int, default=0,
help='number of tidy instances to be run in parallel.')
parser.add_argument('files', nargs='*', default=['.*'],
help='files to be processed (regex on path)')
parser.add_argument('-fix', action='store_true', help='apply fix-its')
parser.add_argument('-format', action='store_true', help='Reformat code '
'after applying fixes')
parser.add_argument('-style', default='file', help='The style of reformat '
'code after applying fixes')
parser.add_argument('-p', dest='build_path',
help='Path used to read a compile command database.')
parser.add_argument('-extra-arg', dest='extra_arg',
action='append', default=[],
help='Additional argument to append to the compiler '
'command line.')
parser.add_argument('-extra-arg-before', dest='extra_arg_before',
action='append', default=[],
help='Additional argument to prepend to the compiler '
'command line.')
parser.add_argument('-quiet', action='store_true',
help='Run clang-tidy in quiet mode')
args = parser.parse_args()
db_path = 'compile_commands.json'
if args.build_path is not None:
build_path = args.build_path
else:
# Find our database
build_path = find_compilation_database(db_path)
try:
invocation = [args.clang_tidy_binary, '-list-checks']
invocation.append('-p=' + build_path)
if args.checks:
invocation.append('-checks=' + args.checks)
invocation.append('-')
if args.quiet:
# Even with -quiet we still want to check if we can call clang-tidy.
with open(os.devnull, 'w') as dev_null:
subprocess.check_call(invocation, stdout=dev_null)
else:
subprocess.check_call(invocation)
except:
print("Unable to run clang-tidy.", file=sys.stderr)
sys.exit(1)
# Load the database and extract all files.
database = json.load(open(os.path.join(build_path, db_path)))
files = [make_absolute(entry['file'], entry['directory'])
for entry in database]
max_task = args.j
if max_task == 0:
max_task = multiprocessing.cpu_count()
tmpdir = None
if args.fix or (yaml and args.export_fixes):
check_clang_apply_replacements_binary(args)
tmpdir = tempfile.mkdtemp()
# Build up a big regexy filter from all command line arguments.
file_name_re = re.compile('|'.join(args.files))
return_code = 0
try:
# Spin up a bunch of tidy-launching threads.
task_queue = queue.Queue(max_task)
# List of files with a non-zero return code.
failed_files = []
lock = threading.Lock()
for _ in range(max_task):
t = threading.Thread(target=run_tidy,
args=(args, tmpdir, build_path, task_queue, lock, failed_files))
t.daemon = True
t.start()
# Fill the queue with files.
for name in files:
if file_name_re.search(name):
task_queue.put(name)
# Wait for all threads to be done.
task_queue.join()
if len(failed_files):
return_code = 1
except KeyboardInterrupt:
# This is a sad hack. Unfortunately subprocess goes
# bonkers with ctrl-c and we start forking merrily.
print('\nCtrl-C detected, goodbye.')
if tmpdir:
shutil.rmtree(tmpdir)
os.kill(0, 9)
if yaml and args.export_fixes:
print('Writing fixes to ' + args.export_fixes + ' ...')
try:
merge_replacement_files(tmpdir, args.export_fixes)
except:
print('Error exporting fixes.\n', file=sys.stderr)
traceback.print_exc()
return_code=1
if args.fix:
print('Applying fixes ...')
try:
apply_fixes(args, tmpdir)
except:
print('Error applying fixes.\n', file=sys.stderr)
traceback.print_exc()
return_code=1
if tmpdir:
shutil.rmtree(tmpdir)
sys.exit(return_code)
if __name__ == '__main__':
main()
+22
View File
@@ -0,0 +1,22 @@
@echo off
setlocal enableextensions enabledelayedexpansion
set CPP_VER=c++17
set FILE_OR_DIR=..\src\robomongo\
set PARAM_1=%1
if not "%PARAM_1%" == "" (
set FILE_OR_DIR=%PARAM_1%
)
rem Run analysis
echo.
echo ---------------------- Running cppcheck ----------------------
echo.
call cppcheck %FILE_OR_DIR% --enable=all --std=%CPP_VER%
echo.
echo ---------------------- End of cppcheck ----------------------
echo.
echo ---------------------- Info ----------------------
call cppcheck --version
echo Command called: cppcheck %FILE_OR_DIR% --enable=all --std=%CPP_VER%
+17
View File
@@ -0,0 +1,17 @@
#!/usr/bin/env bash
BIN_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # Get directory of this file
PROJECT_DIR=$(dirname $BIN_DIR) # Get root directory of project
source $BIN_DIR/common/setup $1 # $1: release or debug
mkdir -p ../scan-build && cd ../scan-build
# $BUILD_TYPE: Release or Debug
# Hint: Use "--use-analyzer /usr/local/opt/llvm/bin/clang++" after "-v"
scan-build -v cmake -D "CMAKE_PREFIX_PATH=$PREFIX_PATH" -D "CMAKE_BUILD_TYPE=$BUILD_TYPE" -D "CMAKE_INSTALL_PREFIX=$INSTALL_PREFIX" "${@:2}" $PROJECT_DIR
echo -e "\n------------------------------------------------"
echo "Configured with scan-build in $BUILD_TYPE mode"
echo -e "------------------------------------------------\n"
scan-build cmake --build . "${@:2}" -- -j8
echo -e "\n------------------------------------------------"
echo "Built with scan-build in $BUILD_TYPE mode"
echo -e "------------------------------------------------\n"
+4 -2
View File
@@ -5,14 +5,16 @@ PROJECT_DIR=$(dirname $BIN_DIR) # Get root dir
source $BIN_DIR/common/setup $1
echo
echo "******************* Running unit tests for $BUILD_TYPE mode *******************"
echo "******************* Running unit tests in $BUILD_TYPE mode *******************"
echo
if [ "$(uname -s)" == "Darwin" ]; then
EXE="$BUILD_DIR/src/robomongo-unit-tests/robo_unit_tests.app/Contents/MacOS/robo_unit_tests"
EXE="$BUILD_DIR/src/robomongo-unit-tests/robo_unit_tests"
echo "Running file: $EXE"
"$EXE"
else # Linux
echo "Error: Currently unit testing is disabled for Linux due to MongoDB linking problem"
exit 0
EXE="$BUILD_DIR/src/robomongo-unit-tests/robo_unit_tests"
echo "Running file: $EXE"
"$EXE"
+20
View File
@@ -0,0 +1,20 @@
@echo off
setlocal enableextensions enabledelayedexpansion
rem Path to bin and project folder
set BIN_DIR_WITH_BACKSLASH=%~dp0%
set BIN_DIR=%BIN_DIR_WITH_BACKSLASH:~0,-1%
set PROJECT_DIR=%BIN_DIR%\..
rem Run common setup code
call "%BIN_DIR%\common\setup.bat" %*
if %ERRORLEVEL% neq 0 (exit /b 1)
rem Run tests
echo.
echo ******************* Running unit tests *******************
echo Mode: %BUILD_TYPE%
set TEST_EXE_DIR=%PROJECT_DIR%\\build\%BUILD_TYPE%\src\robomongo-unit-tests\%BUILD_TYPE%
echo Run : %TEST_EXE_DIR%\robo_unit_tests.exe
echo.
call "%TEST_EXE_DIR%\robo_unit_tests.exe" %*
+29
View File
@@ -0,0 +1,29 @@
@echo off
setlocal enableextensions enabledelayedexpansion
rem Path to bin and project folder
set BIN_DIR_WITH_BACKSLASH=%~dp0%
set BIN_DIR=%BIN_DIR_WITH_BACKSLASH:~0,-1%
set PROJECT_DIR=%BIN_DIR%\..
rem Run common setup code
call "%BIN_DIR%\common\setup.bat" %*
if %ERRORLEVEL% neq 0 (exit /b 1)
rem Run Visual Studio with RunCodeAnalysis
cd "%BUILD_DIR%"
set RULE_SET="/p:CodeAnalysisRuleSet=NativeRecommendedRules.ruleset"
set OUT_FILE=vs-code-analysis-%BUILD_TYPE%.txt
echo ------------- Running Visual Studio with RunCodeAnalysis -------------
echo Result will be written into file "%OUT_FILE%" in the end.
echo ...
cmake --build . --config %BUILD_TYPE% -- "/p:RunCodeAnalysis=true" %RULE_SET% > %BIN_DIR%\%OUT_FILE%
rem Rules: C:\Program Files (x86)\Microsoft Visual Studio 14.0\Team Tools\Static Analysis Tools\Rule Sets
rem https://docs.microsoft.com/en-us/visualstudio/code-quality/rule-set-reference?view=vs-2019
echo ------------- End of RunCodeAnalysis -------------
echo.
echo ------------- Info -------------
echo Mode : %BUILD_TYPE%
echo RULE_SET: %RULE_SET% (see the script comments for more info)
-15
View File
@@ -1,15 +0,0 @@
@echo off
setlocal enableextensions enabledelayedexpansion
rem Path to bin and project folder
set BIN_DIR_WITH_BACKSLASH=%~dp0%
set BIN_DIR=%BIN_DIR_WITH_BACKSLASH:~0,-1%
set PROJECT_DIR=%BIN_DIR%\..
rem Run tests
echo.
echo ******************* Running unit tests for Release mode *******************
echo ** Note: Only Release mode is supported on Windows
echo.
echo "Running file: \build\Release\src\robomongo-unit-tests\Release\robo_unit_tests.exe"
call "%PROJECT_DIR%\\build\Release\src\robomongo-unit-tests\Release\robo_unit_tests.exe" %*
+42
View File
@@ -0,0 +1,42 @@
import os
from os.path import join
###
def force_warning_level_3(file):
with open(file, "r") as in_file:
buf = in_file.readlines()
push = '#pragma warning(push, 3)\n'
pop = '#pragma warning(pop)\n'
last_line_has_mongo = False
with open(file, "w") as out_file:
for line in buf:
if line.startswith(('#include <mongo', '#include "mongo')):
if last_line_has_mongo:
pass # line = line + pop
else:
line = push + line
last_line_has_mongo = True
else:
if last_line_has_mongo:
line = pop + line
last_line_has_mongo = False
out_file.write(line)
### main
root_dir = 'E:\\robo\\src\\robomongo\\'
# root_dir = 'E:\\robo\\src\\robomongo\\shell\\bson\\' # for testing
print('Processing all source files in root & sub directories...')
print('Root Dir:', root_dir)
print('---------------------------------------------------------')
for path, subdirs, files in os.walk(root_dir):
for name in files:
if name.endswith(('.h', '.cpp')):
file = os.path.join(path, name)
print(file)
force_warning_level_3(file)
+34 -15
View File
@@ -41,38 +41,46 @@ set(MongoDB_DEFINITIONS
BOOST_THREAD_DONT_PROVIDE_INTERRUPTIONS
BOOST_THREAD_HAS_BUG
MONGO_CONFIG_HAVE_HEADER_UNISTD_H
# Suppress "warning C4996: std::allocator..." from third_party\abseil-cpp-master
_SILENCE_CXX17_OLD_ALLOCATOR_MEMBERS_DEPRECATION_WARNING
# Suppress "warning C4996: std::iterator..." from third_party\mozjs-60
_SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING
)
# Set common compiler include directories
set(MOZJS_VER mozjs-60)
set(MongoDB_INCLUDE_DIRS
${MongoDB_DIR}/src
${MongoDB_DIR}/src/third_party/boost-1.60.0
${MongoDB_DIR}/src/third_party/mozjs-45/include
${MongoDB_DIR}/src/third_party/mozjs-45/mongo_sources
${MongoDB_DIR}/src/third_party/pcre-8.41
${MongoDB_DIR}/src
${MongoDB_DIR}/src/third_party/abseil-cpp-master/abseil-cpp
${MongoDB_DIR}/src/third_party/boost-1.70.0
${MongoDB_DIR}/src/third_party/fmt/dist/include
${MongoDB_DIR}/src/third_party/${MOZJS_VER}/include
${MongoDB_DIR}/src/third_party/${MOZJS_VER}/mongo_sources
${MongoDB_DIR}/src/third_party/pcre-8.42
${MongoDB_DIR}/src/third_party/SafeInt
${MongoDB_BUILD_DIR}
)
if(SYSTEM_LINUX)
set(MongoDB_OBJECT_LIST_PLATFORM_PART linux)
list(APPEND MongoDB_INCLUDE_DIRS
${MongoDB_DIR}/src/third_party/mozjs-45/platform/x86_64/linux/include)
${MongoDB_DIR}/src/third_party/${MOZJS_VER}/platform/x86_64/linux/include)
elseif(SYSTEM_WINDOWS)
set(MongoDB_OBJECT_LIST_PLATFORM_PART windows)
list(APPEND MongoDB_INCLUDE_DIRS
${MongoDB_DIR}/src/third_party/mozjs-45/platform/x86_64/windows/include)
${MongoDB_DIR}/src/third_party/${MOZJS_VER}/platform/x86_64/windows/include)
elseif(SYSTEM_MACOSX)
set(MongoDB_OBJECT_LIST_PLATFORM_PART macosx)
list(APPEND MongoDB_INCLUDE_DIRS
${MongoDB_DIR}/src/third_party/mozjs-45/platform/x86_64/macOS/include)
${MongoDB_DIR}/src/third_party/${MOZJS_VER}/platform/x86_64/macOS/include)
elseif(SYSTEM_FREEBSD)
set(MongoDB_OBJECT_LIST_PLATFORM_PART freebsd)
list(APPEND MongoDB_INCLUDE_DIRS
${MongoDB_DIR}/src/third_party/mozjs-45/platform/x86_64/freebsd/include)
${MongoDB_DIR}/src/third_party/${MOZJS_VER}/platform/x86_64/freebsd/include)
elseif(SYSTEM_OPENBSD)
set(MongoDB_OBJECT_LIST_PLATFORM_PART openbsd)
list(APPEND MongoDB_INCLUDE_DIRS
${MongoDB_DIR}/src/third_party/mozjs-45/platform/x86_64/openbsd/include)
${MongoDB_DIR}/src/third_party/${MOZJS_VER}/platform/x86_64/openbsd/include)
endif()
# Read list of object files
@@ -86,17 +94,28 @@ string(STRIP "${MongoDB_RELATIVE_LIBS}" MongoDB_RELATIVE_LIBS)
# Convert string to list
string(REPLACE " " ";" MongoDB_RELATIVE_LIBS ${MongoDB_RELATIVE_LIBS})
# todo: Find a better solution
# Robo 1.4: Added as workaround fix for build error:
# fatal error LNK1170: line in command file contains 131071 or more characters
# Happens when the path of robo-shell is a long string (e.g. "E:/user/code/robomongo-shell")
set(MongoDB_OBJECTS_DIR_ENV $ENV{MongoDB_OBJECTS})
if(MongoDB_OBJECTS_DIR_ENV)
set(MongoDB_OBJECTS_DIR ${MongoDB_OBJECTS_DIR_ENV})
else()
set(MongoDB_OBJECTS_DIR ${MongoDB_DIR})
endif()
# Convert to absolute path
foreach(lib ${MongoDB_RELATIVE_LIBS})
list(APPEND MongoDB_LIBS ${MongoDB_DIR}/${lib})
list(APPEND MongoDB_LIBS ${MongoDB_OBJECTS_DIR}/${lib})
endforeach()
if(SYSTEM_WINDOWS)
list(APPEND MongoDB_LIBS $ENV{WindowsSdkDir}/Lib/$ENV{WindowsSDKLibVersion}/um/x64/Crypt32.Lib)
list(APPEND MongoDB_LIBS $ENV{WindowsSdkDir}/Lib/$ENV{WindowsSDKLibVersion}/um/x64/Secur32.Lib)
list(APPEND MongoDB_LIBS $ENV{WindowsSdkDir}/Lib/$ENV{WindowsSDKLibVersion}/um/x64/Dnsapi.lib)
list(APPEND MongoDB_LIBS Crypt32.lib Secur32.lib Dnsapi.lib winhttp.lib)
elseif(SYSTEM_MACOSX)
list(APPEND MongoDB_LIBS -lcurl)
elseif(SYSTEM_LINUX)
list(APPEND MongoDB_LIBS /lib/x86_64-linux-gnu/libresolv.so.2)
list(APPEND MongoDB_LIBS -lresolv -lcurl)
endif()
# Get MongoDB repository recent tag
+22 -38
View File
@@ -14,27 +14,14 @@
# Try to find OpenSSL directory (uses CMAKE_PREFIX_PATH locations)
#-------------------------------------------
if(SYSTEM_WINDOWS)
find_path(
OpenSSL_DIR inc32/openssl/ssl.h
DOC "Path to OpenSSL (github.com/openssl/openssl) root directory"
)
else()
find_path(
OpenSSL_DIR include/openssl/ssl.h
DOC "Path to OpenSSL (github.com/openssl/openssl) root directory"
)
endif()
find_path(
OpenSSL_DIR include/openssl/ssl.h
DOC "Path to OpenSSL (github.com/openssl/openssl) root directory"
)
# Find OpenSSL version
#-------------------------------------------
if(SYSTEM_WINDOWS)
set (OPENSSL_INCLUDE_DIR "${OpenSSL_DIR}/inc32")
else()
set (OPENSSL_INCLUDE_DIR "${OpenSSL_DIR}/include")
endif()
set (OPENSSL_INCLUDE_DIR "${OpenSSL_DIR}/include")
function(from_hex HEX DEC)
string(TOUPPER "${HEX}" HEX)
@@ -113,33 +100,30 @@ add_library(ssl SHARED IMPORTED)
# Add imported target for crypto (libeay32)
add_library(crypto SHARED IMPORTED)
# todo: refactor
if(SYSTEM_WINDOWS)
set_target_properties(ssl PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${OpenSSL_DIR}/inc32"
IMPORTED_IMPLIB "${OpenSSL_DIR}/out32dll/ssleay32.lib"
)
set_target_properties(crypto PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${OpenSSL_DIR}/inc32"
IMPORTED_IMPLIB "${OpenSSL_DIR}/out32dll/libeay32.lib"
)
elseif(SYSTEM_MACOSX)
set_target_properties(ssl PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${OpenSSL_DIR}/include"
IMPORTED_LOCATION "${OpenSSL_DIR}/libssl.dylib"
IMPORTED_IMPLIB "${OpenSSL_DIR}/libssl.lib"
)
set_target_properties(crypto PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${OpenSSL_DIR}/include"
IMPORTED_LOCATION "${OpenSSL_DIR}/libcrypto.dylib"
)
elseif(SYSTEM_LINUX)
set_target_properties(ssl PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${OpenSSL_DIR}/include"
IMPORTED_LOCATION "${OpenSSL_DIR}/libssl.so"
)
set_target_properties(crypto PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${OpenSSL_DIR}/include"
IMPORTED_LOCATION "${OpenSSL_DIR}/libcrypto.so"
IMPORTED_IMPLIB "${OpenSSL_DIR}/libcrypto.lib"
)
else()
if(SYSTEM_MACOSX)
SET(EXT "dylib")
elseif(SYSTEM_LINUX)
SET(EXT "so")
endif()
set_target_properties(ssl PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${OpenSSL_DIR}/include"
IMPORTED_LOCATION "${OpenSSL_DIR}/libssl.${EXT}"
)
set_target_properties(crypto PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${OpenSSL_DIR}/include"
IMPORTED_LOCATION "${OpenSSL_DIR}/libcrypto.${EXT}"
)
endif()
# End of file
+47 -18
View File
@@ -1,34 +1,63 @@
# Set MONGO_BUILD_FOLDER
set(MONGO_BUILD_FOLDER "build/opt") # Release
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set(MONGO_BUILD_FOLDER "build/debug")
endif()
# Show configuration summary and build tip
message("")
message(" _______________[ Robo 3T configuration summary ]________________")
message("| ")
message("|-- Dependencies:")
message("| ")
message("| Qt5 Core: ${Qt5Core_VERSION} ${Qt5Core_DIR}")
message("| Qt5 Gui: ${Qt5Gui_VERSION} ${Qt5Gui_DIR}")
message("| Qt5 Widgets: ${Qt5Widgets_VERSION} ${Qt5Widgets_DIR}")
message("| Qt5 PrintSupport: ${Qt5Widgets_VERSION} ${Qt5PrintSupport_DIR}")
message("| Qt5 Network: ${Qt5Network_VERSION} ${Qt5Network_DIR}")
message("| Qt5 Xml: ${Qt5Xml_VERSION} ${Qt5Xml_DIR}")
message("| MongoDB: ${MongoDB_VERSION} ${MongoDB_BUILD_DIR}")
message("| Qt5 Core: ${Qt5Core_VERSION} ${Qt5Core_DIR}")
message("| Qt5 Gui: ${Qt5Gui_VERSION} ${Qt5Gui_DIR}")
message("| Qt5 Widgets: ${Qt5Widgets_VERSION} ${Qt5Widgets_DIR}")
message("| Qt5 PrintSupport: ${Qt5Widgets_VERSION} ${Qt5PrintSupport_DIR}")
message("| Qt5 Network: ${Qt5Network_VERSION} ${Qt5Network_DIR}")
message("| Qt5 Xml: ${Qt5Xml_VERSION} ${Qt5Xml_DIR}")
if(NOT SYSTEM_LINUX)
message("| Qt5 WebEng*Widgets: ${Qt5WebEngineWidgets_VERSION} ${Qt5WebEngineWidgets_DIR}")
endif()
message("| MongoDB: ${MongoDB_VERSION} ${MongoDB_DIR}")
message("| MongoDB Objects: ${MongoDB_VERSION} ${MongoDB_OBJECTS_DIR}/${MONGO_BUILD_FOLDER}")
message("| OpenSSL: ${OPENSSL_VERSION} ${OpenSSL_DIR}")
message("| Googe Test: ${GOOGLE_TEST_VERSION} ${CMAKE_SOURCE_DIR}/${GOOGLE_TEST_DIR}")
message("| libssh2: ${LIBSSH2_VERSION} ${LIBSSH2_DIR}")
message("| QJson: ${QJSON_VERSION} ${QJSON_DIR}")
message("| QScintilla: ${QSCINTILLA_VERSION} ${QSCINTILLA_DIR}")
message("| Google Test: ${GOOGLE_TEST_VERSION} ${GOOGLE_TEST_DIR}")
message("| ESPRIMA: ${ESPRIMA_VERSION} ${ESPRIMA_DIR}")
message("|")
message("|-- Summary:")
message("|")
message("| System: ${CMAKE_SYSTEM_NAME}")
message("| Version: ${PROJECT_VERSION}")
message("| System: ${CMAKE_SYSTEM_NAME}")
if (SYSTEM_MACOSX)
message("| Target SDK: ${CMAKE_OSX_DEPLOYMENT_TARGET}")
message("| Target SDK: ${CMAKE_OSX_DEPLOYMENT_TARGET}")
endif()
message("| Build type: ${CMAKE_BUILD_TYPE}")
message("| Install path: ${CMAKE_INSTALL_PREFIX}")
message("| Build type: ${CMAKE_BUILD_TYPE}")
message("| Commit: ${BUILD_NUMBER}")
message("| Install path: ${CMAKE_INSTALL_PREFIX}")
message("|")
message("|-- Building and installing:")
message("|-- Build, Run and Install:")
message("| ")
message("| Now you can build Robo 3T with the following command:")
message("| $ cmake --build .")
message("| $ bin/build")
message("| $ bin/run")
message("| $ bin/install")
message("|")
message("| And install it to ${CMAKE_INSTALL_PREFIX}:")
message("| $ cmake --build . --target install")
message("|-- Run Unit Tests:")
message("| ")
message("| $ bin/build-and-run-tests")
message("| $ bin/run-tests")
message("|")
message("|-- Run Static Code Analysis:")
message("|")
if (SYSTEM_WINDOWS)
message("| $ bin/run-cppcheck <FILE_PATH OR DIR> (Default: /src/robomongo/)")
message("| $ bin/run-vs-code-analysis")
else()
message("| $ bin/run-clang-tidy")
message("| $ bin/run-scan-build")
endif()
message("|__________________________________________________________________")
message("")
message("")
+32 -8
View File
@@ -28,6 +28,7 @@ elseif(SYSTEM_MACOSX)
set(contents_path ${bundle_name}/Contents)
set(bin_dir ${contents_path}/MacOS)
set(styles_dir ${contents_path}/MacOS/styles)
set(lib_dir ${contents_path}/Frameworks)
set(resources_dir ${contents_path}/Resources)
set(license_dir ${resources_dir})
@@ -37,8 +38,9 @@ elseif(SYSTEM_MACOSX)
set(qt_conf_plugins "PlugIns/Qt")
elseif(SYSTEM_WINDOWS)
set(bin_dir .)
set(styles_dir ${bin_dir}/styles)
set(lib_dir .)
set(resources_dir .)
set(resources_dir ./resources)
set(license_dir .)
set(qt_plugins_dir ${lib_dir})
@@ -60,14 +62,14 @@ install(
if(SYSTEM_WINDOWS)
install(
FILES
"${OpenSSL_DIR}/out32dll/ssleay32.dll"
"${OpenSSL_DIR}/out32dll/libeay32.dll"
"${OpenSSL_DIR}/libssl-1_1-x64.dll"
"${OpenSSL_DIR}/libcrypto-1_1-x64.dll"
DESTINATION ${bin_dir})
elseif(SYSTEM_MACOSX)
install(
FILES
"${OpenSSL_DIR}/libssl.1.0.0.dylib"
"${OpenSSL_DIR}/libcrypto.1.0.0.dylib"
"${OpenSSL_DIR}/libssl.1.1.dylib"
"${OpenSSL_DIR}/libcrypto.1.1.dylib"
DESTINATION ${lib_dir}/lib)
elseif(SYSTEM_LINUX)
install(
@@ -95,20 +97,27 @@ install(
DESTINATION ${license_dir})
# Install common dependencies
install_qt_lib(Core Gui Widgets PrintSupport Network Xml)
SET(QT_LIBS Core Gui Widgets PrintSupport Network Xml)
if(NOT SYSTEM_LINUX)
SET(QT_LIBS ${QT_LIBS} WebEngineWidgets WebEngineCore Quick
QuickWidgets WebChannel Qml Positioning)
endif()
install_qt_lib(${QT_LIBS})
install_qt_plugins(QGifPlugin QICOPlugin)
install_icu_libs()
set(QT_STYLES_DIR ${Qt5Core_DIR}/../../../plugins/styles/)
set(QT_BIN_DIR ${Qt5Core_DIR}/../../../bin/)
set(QT_RESOURCES_DIR ${Qt5Core_DIR}/../../../resources/)
if(SYSTEM_LINUX)
install_qt_lib(XcbQpa DBus)
install_qt_plugins(
QXcbIntegrationPlugin)
# Install newer versions of libstdc++ to support C++11
install(
FILES
"/usr/lib/x86_64-linux-gnu/libstdc++.so.6"
"/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.22"
"/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.28"
DESTINATION ${lib_dir})
elseif(SYSTEM_MACOSX)
install_qt_lib(MacExtras DBus)
@@ -121,12 +130,27 @@ elseif(SYSTEM_MACOSX)
install(
FILES "${CMAKE_SOURCE_DIR}/install/macosx/robomongo.icns"
DESTINATION "${resources_dir}")
# Install styles
install(FILES "${QT_STYLES_DIR}/libqmacstyle.dylib" DESTINATION ${styles_dir})
elseif(SYSTEM_WINDOWS)
install_qt_plugins(
QWindowsIntegrationPlugin
QMinimalIntegrationPlugin
QOffscreenIntegrationPlugin)
# Qt WebEngine dependencies
install(DIRECTORY ${QT_RESOURCES_DIR} DESTINATION ${resources_dir})
install(FILES
"${QT_BIN_DIR}/libEGL.dll"
"${QT_BIN_DIR}/libGLESv2.dll"
"${QT_BIN_DIR}/opengl32sw.dll"
"${QT_BIN_DIR}/QtWebEngineProcess.exe"
DESTINATION ${bin_dir})
# Install Styles
install(FILES "${QT_STYLES_DIR}/qwindowsvistastyle.dll" DESTINATION ${styles_dir})
# Install runtime libraries:
# msvcp120.dll
# msvcr120.dll
+1
View File
@@ -28,6 +28,7 @@ function(install_qt_lib)
install(
DIRECTORY ${qt_lib_dir}/${module_name}.framework
DESTINATION ${lib_dir}
USE_SOURCE_PERMISSIONS
PATTERN "*_debug" EXCLUDE # Exclude debug libraries
PATTERN "Headers" EXCLUDE) # Exclude Headers folders
endif()
+8
View File
@@ -1,3 +1,11 @@
See these docs for the latest info about this topic:
-------------
- [Build Robo 3T - Mac OS X and Linux](https://github.com/paralect/robomongo/blob/master/docs/BuildRobo3TOnMacAndLinux.md)
- [Build Robo 3T - Windows](https://github.com/paralect/robomongo/blob/master/docs/BuildRobo3TOnWindows.md)
------------------------------------
What is this?
-------------
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
View File
-4
View File
@@ -1,4 +0,0 @@
DbgHelp.lib Iphlpapi.lib Psapi.lib advapi32.lib bcrypt.lib crypt32.lib
dnsapi.lib kernel32.lib shell32.lib pdh.lib version.lib winmm.lib ws2_32.lib
secur32.lib winmm.lib
/PDB:build\debug\mongo\mongo.pdb /DEBUG
-3
View File
@@ -1,3 +0,0 @@
DbgHelp.lib Iphlpapi.lib Psapi.lib advapi32.lib bcrypt.lib crypt32.lib dnsapi.lib
kernel32.lib shell32.lib pdh.lib version.lib winmm.lib ws2_32.lib secur32.lib winmm.lib
/PDB:build\opt\mongo\mongo.pdb /DEBUG
+18
View File
@@ -0,0 +1,18 @@
version: "3.9"
services:
robo3t:
image: robo3t
build:
context: .
dockerfile: ./Dockerfile
network: host
network_mode: host
environment:
- DISPLAY=${DISPLAY}
volumes:
- /tmp/.X11-unix:/tmp/.X11-unix
- $HOME/.3T:/root/.3T
- $HOME/.config/.3T:/root/.config/.3T
- $HOME/.ssh/id_rsa:/root/.ssh/id_rsa
- $HOME/.ssh/config:/root/.ssh/config
- $HOME/.ssh/known_hosts:/root/.ssh/known_hosts
+110 -56
View File
@@ -1,84 +1,138 @@
Building Robo 3T (Mac OS X and Linux)
Building Robo 3T (macOS and Linux)
==================
A. Prerequisites
-------------
1. Modern Compiler
A modern and complete C++11 compiler. One of the following is required:
1. Modern Compiler
A modern and complete C++17 compiler:
```
GCC 5.3.0
Clang 3.4 (or Apple XCode 5.1.1 Clang) or newer
GCC 8.0 or newer
Clang 7 (or Apple XCode 10 Clang) or newer
On Linux and macOS, the libcurl library and header is required. macOS includes libcurl.
Fedora/RHEL - dnf install libcurl-devel
Ubuntu/Debian - apt-get install libcurl-dev
Python 3.7
```
2. Install CMake (3.2 or later)
3. Install [Scons](http://scons.org/tag/releases.html) (2.5 or later)
For details see: https://github.com/mongodb/mongo/wiki/Build-Mongodb-From-Source
2. Install CMake (3.10.0 or later)
Example:
```
sudo apt-get install build-essential
// or
wget http://www.cmake.org/files/v3.10/cmake-3.10.0.tar.gz
tar xf cmake-3.10.0.tar.gz
cd cmake-3.10.0
./configure // macos: env CC=gcc ./bootstrap
make
sudo make install
(sudo make uninstall)
```
3. Install [Scons](http://scons.org/tag/releases.html) (3.1.2 or later)
```
cd scons-**
python setup.py install
```
4. Install Qt 5.9.3
4. Install Qt
macOS: Qt 5.12.8
Linux: Qt 5.9.3
```sh
Example installation for MAC OSX and Ubuntu:
Go to http://download.qt.io/archive/qt/5.9/5.9.3/
Example installation for macOS and Ubuntu:
Go to http://download.qt.io/archive/qt/5.x/5.x.y/
Download, run and install
qt-opensource-mac-x64-clang-5.9.3.dmg (for MAC OSX)
qt-opensource-linux-x64-5.9.0.run (for Linux)
qt-opensource-mac-x64-clang-5.x.y.dmg (for macOS)
qt-opensource-linux-x64-5.x.y.run (for Linux)
After successful installation you should have
/path/to/qt-5.9.3/5.7/clang_64 (for MAC OSX)
/path/to/qt-5.9.3/5.7/gcc_64 (for Linux)
/path/to/qt-5.x.y/5.x/clang_64 (for macOS)
/path/to/qt-5.x.y/5.x/gcc_64 (for Linux)
More information for installing on Ubuntu:
https://wiki.qt.io/Install_Qt_5_on_Ubuntu
```
5. Download and Build OpenSSL (1.0.2o) - (explained below in section B)
5. Download and Build OpenSSL - (explained below in section B)
B. Building Robo 3T and Dependencies
-------------
Ref: https://wiki.openssl.org/index.php/Compilation_and_Installation#OS_X
#### Step 1. Build OpenSSL (1.0.2o)
#### 1. Build OpenSSL
Steps to build OpenSSL on MAC:
(Todo: Can we find pre-built OpenSSL? To check => https://wiki.openssl.org/index.php/Binaries)
```sh
Download openssl-1.0.2o (https://www.openssl.org/source/old/1.0.2/)
tar -xvzf openssl-1.0.2o.tar.gz
cd openssl-1.0.2o
./Configure darwin64-x86_64-cc shared --openssldir="@rpath"
make (or sudo make)
mkdir lib
cp libssl*.dylib libcrypto*.dylib lib/
```
Helper Commands
```sh
// to start fresh build
make clean
Version 1.1.1f (Mar/2020) on macOS
Version 1.0.2o (Mar/2018) on Linux
**macOS:**
```sh
wget https://www.openssl.org/source/old/1.1.1/openssl-1.1.1f.tar.gz
tar -xf openssl-1.1.1f.tar.gz
cd /opt/openssl-1.1.1f
(make clean)
./Configure darwin64-x86_64-cc shared no-ssl2 no-ssl3 no-comp -mmacosx-version-min=xy.zt
// Notes:
// 1. Change -mmacosx-version same as CMAKE_OSX_DEPLOYMENT_TARGET in
// https://github.com/Studio3T/robomongo/blob/master/CMakeLists.txt
// 2. With openssl version 1.1.1, configure command with rpath stopped working
// Last working configure command with rpath was:
// ./Configure darwin64-x86_64-cc shared --openssldir="@rpath"
make (or sudo make)
// Verify libssl.dylib and libcrypto.dylib files are created
ll lib*.dylib
// Due to broken './Configure' command with rpath above, these extra steps are also required:
install_name_tool -id "@rpath/lib/libssl.1.1.dylib" libssl.1.1.dylib
install_name_tool -change /usr/local/lib/libcrypto.1.1.dylib @rpath/lib/libcrypto.1.1.dylib libssl.1.1.dylib
install_name_tool -id "@rpath/lib/libcrypto.1.1.dylib" libcrypto.1.1.dylib
// Finally, we should have this output using otool:
otool -L libssl.1.1.dylib
libssl.dylib:
@rpath/lib/libssl.1.1.dylib (compatibility version 1.1.0, current version 1.1.0)
@rpath/lib/libcrypto.1.1.dylib (compatibility version 1.1.0, current version 1.1.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1281.100.1)
otool -L libcrypto.1.1.dylib
libcrypto.dylib:
@rpath/lib/libcrypto.1.1.dylib (compatibility version 1.1.0, current version 1.1.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1281.100.1)
// For robo-unit-test dependency:
mkdir lib/
cp lib*.dylib/lib/
```
Steps to build OpenSSL on Linux:
**Linux:**
```sh
Download openssl-1.0.x (ftp://ftp.openssl.org/source/old/1.0.x/openssl-1.0.x.tar.gz)
tar -xvzf openssl-1.0.x.tar.gz
cd /home/<user>/Downloads/openssl-1.0.x
wget https://www.openssl.org/source/old/1.0.2/openssl-1.0.2o.tar.gz
tar -xf openssl-1.0.2o.tar.gz
cd /opt/openssl-1.0.2o
(make clean)
./config shared
make
mkdir lib
cp libssl* libcrypto* lib/
// Verify libssl.so and libcrypto.so are created
```
#### Step 2. Build Robo 3T Shell (fork of MongoDB)
#### 2. Build Robo 3T Shell (fork of MongoDB)
Clone Robo 3T Shell and checkout to `roboshell-v4.0.4` branch:
Clone Robo 3T Shell and make sure you are on latest branch:
```sh
$ git clone https://github.com/paralect/robomongo-shell.git
$ cd robomongo-shell
$ git branch // make sure it is "roboshell-v4.0.4"
$ git branch // "roboshell-v4.2"
```
Set special environment variable `ROBOMONGO_CMAKE_PREFIX_PATH` to point to a set of
@@ -90,16 +144,26 @@ directories:
Separate directories by semicolon `;` (not colon):
// MAC OSX example:
$ export ROBOMONGO_CMAKE_PREFIX_PATH="/path/to/qt-5.x.x/5.x/clang_64;/path/to/robomongo-shell;/path/to/openssl-1.0.xx"
// macOS example:
export ROBOMONGO_CMAKE_PREFIX_PATH="/path/to/qt-5.x.y/5.x/clang_64;/opt/robo-shell;/opt/openssl-x.y.z"
// Ubuntu example:
$ export ROBOMONGO_CMAKE_PREFIX_PATH="/home/<user>/Qt5.x.x/5.x.x/gcc_64/;/home/<user>/robomongo-shell;/home/<user>/Downloads/openssl-1.0.xx"
export ROBOMONGO_CMAKE_PREFIX_PATH="/home/<user>/Qt5.x.y/5.x.y/gcc_64/;/opt/<user>/robo-shell;/opt/openssl-x.y.z"
Install pip requirements
```
// macOS / Linux assuming python = python 2.7
pip install --user -r etc/pip/dev-requirements.txt
// macOS / Linux
pip3 install --user -r etc/pip/compile-requirements.txt
pip3 install --user -r etc/pip/dev-requirements.txt
```
```
// For ubuntu, the followings might be needed
sudo aptitude install libcurl-dev
sudo pip3 install Typing
sudo pip3 install Cheetah
```
Build Robo 3T Shell (in release mode by default):
@@ -108,16 +172,6 @@ Build Robo 3T Shell (in release mode by default):
$ bin/build
```
Known Issues & Solutions about building:
```
// macOS / Linux assuming python = python 2.7
pip install --user -r etc/pip/dev-requirements.txt
pip install typing
Also see:
https://github.com/mongodb/mongo/wiki/Build-Mongodb-From-Source
```
Build Robo 3T Shell in debug mode:
```sh
@@ -136,7 +190,7 @@ Clean build files for debug mode:
For more information refer to [Building Robo 3T Shell](BuildRobo3TShell.md)
#### Step 3. Build Robo 3T
#### 3. Build Robo 3T
Download Robo 3T:
@@ -178,7 +232,7 @@ Create package for your OS in `build/release/package` folder:
**Important Notes**
- For macOS builds, it might be needed to patch QScintilla with `QScintilla-2.9.3-xcode8.patch` found at robomongo repository's root.
- For Ubuntu 16.04 builds, it has been reported that Robo 3T /bin/configure step might fail and installing mesa-common-dev package solves it. Details: https://github.com/paralect/robomongo/issues/1268
- For Ubuntu 16.04 builds, it has been reported that Robo 3T /bin/configure step might fail and installing `mesa-common-dev` package solves it. Details: https://github.com/paralect/robomongo/issues/1268
- For Centos builds, Robo 3T /bin/configure step might fail due to error: `failed to find gl/gl.h`. In this case, the following packages must be installed:
+67 -41
View File
@@ -26,23 +26,23 @@ A. Prerequisites
$ eval `ssh-agent` # starts ssh agent
$ ssh-add ~/.ssh/mykey # add your key (which can be in any folder)
#### 1. Visual Studio 2015 (i.e. MSVC14) Update 2 or newer
#### 1. Visual Studio 2017 version 15.9 or newer (complete C++17 compiler)
We use Visual Studio 2015 Update 3, and recommend to use this version to save
We use Visual Studio 2017 version 15.9.22, and recommend to use this version to save
time for Qt compilation. Currently prebuilt binaries for Qt are available
from official Qt site. But you can use any newer version and compile Qt library
yourself.
#### 2. ActivePython 2.7
#### 2. ActivePython 3.7.4
Download ActivePython from http://www.activestate.com/activepython/downloads
Download MSI x64 version. Use default settings in installation wizard.
This installer will add path to `python.exe` to your `PATH` variable.
#### 3. SCons 2.3.5 or newer
#### 3. SCons 3.1.2 or newer
We use SCons 2.5.0.
We use SCons 3.1.2
Download Scons from http://scons.org/tag/releases.html
@@ -55,56 +55,53 @@ We use SCons 2.5.0.
This command will make `scons` command accessible from Command Prompt
#### 4. CMake
We use CMake 3.6.0-rc3
We use CMake 3.10.0
Download CMake from https://cmake.org/download
Use installer package, it will allow you to configure your PATH variable and `cmake`
command will be available from Command Prompt. For this set "Add CMake to the system
PATH for current user" in the installer wizard page.
#### 5. Qt 5.9.3
#### 5. Qt 5.12.8
Download and install Qt from http://download.qt.io/archive/qt
Run the installer and select only 'msvc2015 64-bit'
Run the installer and select only 'msvc2017 64-bit'
#### 6. OpenSSL (1.0.2o)
Download openssl from (https://www.openssl.org/source/old/1.0.2/)
#### 6. OpenSSL (1.1.1f)
Download openssl from https://www.openssl.org/source/old/1.1.1/openssl-1.1.1f.tar.gz
B. Building Robo 3T and Dependencies
-------------
-------------
#### 1. Build OpenSSL
Steps to build OpenSSL on windows:
```sh
(Todo: Can we find pre-built OpenSSL? To check => https://wiki.openssl.org/index.php/Binaries)
Steps to build OpenSSL on windows:
- Ensure you have perl installed on your machine (e.g. ActiveState or Strawberry), and available on your %PATH%
- Ensure you have NASM installed on your machine, and available on your %PATH%
```sh
Open Visual Studio tool x64 Cross Tools Command prompt
cd to the directory where you have openssl sources cd c:\myPath\openssl
perl Configure VC-WIN64A
ms\do_win64a
nmake -f ms\ntdll.mak
```
**Check Point:**
After successful build, newly created sub directory out32dll should contain dynamic lib files libeay32.lib (and libeay32.dll) and ssleay32.lib (and ssleay32.dll); and associated include files will be in newly created folder "inc32".
Helper Commands:
```sh
// clean to start fresh build
nmake -f ms\ntdll.mak clean
```
(nmake clean)
nmake
// Verify these files are created:
libcrypto-1_1x64.dll, libssl-1_1-x64.dll (with all the build additionals such as .pdb .lik or static .lib)
```
Refer to OpenSSL documentation for more information:
https://wiki.openssl.org/index.php/Compilation_and_Installation#W64
https://wiki.openssl.org/index.php/Compilation_and_Installation#OpenSSL_1.1.0
#### 2. Build Robo 3T Shell (fork of MongoDB)
Clone Robo 3T Shell and checkout to roboshell-v4.0.4 branch:
Clone Robo 3T Shell and make sure to be at `roboshell-v4.2` branch:
```sh
$ git clone https://github.com/paralect/robomongo-shell.git
$ cd robomongo-shell
$ git branch // roboshell-v4.0.4
$ git branch // roboshell-v4.2
```
Set environment variable `ROBOMONGO_CMAKE_PREFIX_PATH`, required by Robo 3T-Shell and Robo 3T build scripts, needs to be set according to the following directories:
@@ -113,12 +110,36 @@ Set environment variable `ROBOMONGO_CMAKE_PREFIX_PATH`, required by Robo 3T-Shel
2. Location of Robo 3T Shell
3. Location of OpenSSL
**Important:**
Make sure to move all your repos (robo, openssl, robo-shell etc..) into root directory of your drives (e.g. e:\robo-shell) and keep short repo names (e.g. robo-shell instead of robomongo-shell) otherwise you might end up with this error `If you see fatal error LNK1170: line in command file contains 131071 or more characters`
Separate directories by semicolon `;` (not colon). You can do this in Command Prompt:
> setx ROBOMONGO_CMAKE_PREFIX_PATH "d:\Qt\Qt5.9.3\5.9.3\msvc2015_64;d:\path-to\robomongo-shell;c:\path-to\openssl-1.0.2o"
> setx ROBOMONGO_CMAKE_PREFIX_PATH "e:\Qt\Qt5.9.3\5.9.3\msvc2015_64;e:\robo-shell;e:\openssl-x.y.z"
Open '**a new**' VS2017 x64 Native Tools Command Prompt and navigate to `robomongo-shell` folder.
Open '**a new**' VS2015 x64 Native Tools Command Prompt and navigate to `robomongo-shell` folder.
**Note:**
Run
`pip3 install --user -r ../etc/pip/dev-requirements.txt`
If you have this type of errors:
```
// 1st error
ImportError: No module named typing
// Solution:
pip install Typing
pip install Cheetah
// 2nd error: shell: cheetah module not found
// Solution:
copy C:\Users\<user>\AppData\Roaming\Python\Python27\site-packages
to C:\Python27\Lib\site-packages
```
Build shell in release mode:
@@ -150,7 +171,7 @@ Clone Robo 3T:
$ git clone https://github.com/paralect/robomongo.git
```
Open VS2015 x64 Native Tools Command Prompt and navigate to `robomongo` folder.
Open VS2017 x64 Native Tools Command Prompt and navigate to `robomongo` folder.
Run configuration step:
@@ -159,15 +180,20 @@ Run configuration step:
And finally, build Robo 3T:
> bin\build
```
// Scons error on Windows: cheetah module not found
copy C:\Users\<user>\AppData\Roaming\Python\Python27\site-packages
to C:\Python27\Lib\site-packages
// Also
pip install Typing
pip install Cheetah
```
```
// If you see fatal error LNK1170: line in command file contains 131071 or more characters
Solution-1:
1. Move all your repos (robo, openssl, robo-shell etc..) into root directory of your drives.
2. Use short names e.g. robo-shell instead of robomongo-shell.
3. Update ROBOMONGO_CMAKE_PREFIX_PATH env. variable and try a fresh (clean) build.
Solution-2:
1. Create environment variable MongoDB_OBJECTS, set a short path e.g. "C:/"
2. Open a new VS2017 x64 Native Tools Command Prompt and build Robo 3T Shell
3. Robo 3T Shell build script will copy the object files into MongoDB_OBJECTS directory
4. Build Robo 3T again (clean build might be needed)
```
**Run Robo 3T**
+181
View File
@@ -0,0 +1,181 @@
Runtime Dependencies
====================
This information is for maintainers. If you want to just use Robomongo - download
prebuild packages for your platform.
Runtime dependencies that are not privided by platforms but required by Robomongo are:
1. Qt libraries
2. Qt plugins
Diagnostic of dependencies
--------------------------
### Windows
GUI: http://dependencywalker.com/
### Linux
#### a. View dependencies of executable or shared library:
$ ldd robomongo
$ readelf -d robomongo
#### b. View dependency tree of executable or shared library:
$ lddtree robomongo
$ ldd -v robomongo
#### c. View RPATH or RUNPATH records of executable or shared library:
$ objdump -x bin/robomongo | grep "RPATH\|RUNPATH"
$ readelf -d bin/robomongo | grep RPATH
For Robomongo binary it should be `$ORIGIN/../lib`
#### d. Enable extensive logging for run-time shared library search
$ export LD_DEBUG=files
$ bin/robomongo
Source:
http://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html
#### e. Modify RPATH using `chrpath` and the dynamic linker and RPATH using paths `patchelf`
$ patchelf --set-rpath '$ORIGIN/../lib' robo
More: https://nixos.org/patchelf.html
$ chrpath -r "/somepath/lib/" robomongo
More:
https://linux.die.net/man/1/chrpath
http://www.programering.com/a/MTOwcDNwATU.html // examples
#### f. Show symbols of shared lib file
Error:
```
/opt/robo-shell/src/mongo/util/net/ssl_manager_openssl.cpp:667:
undefined reference to `SSL_library_init'
```
How to debug:
```
openssl-1.1.1f: nm -gD libssl.so | grep SSL_library_init
// not found, since SSL_library_init() is deprecated in 1.1.1
openssl-1.0.2o: nm -gD libssl.so | grep SSL_library_init
0000000000055520 T SSL_library_init
```
#### g. Update path of a dependency of an executable
```
ldd exec_file | grep libcurlpp
libcurlpp.so.1 => not found
patchelf --replace-needed libcurlpp.so.1 /foo/bar/libcurlpp.so.1 exec_file
```
Another example (libcrypto.so.1.1 => not found):
```
cd /opt/openssl-1.1.1f
ldd libssl.so
linux-vdso.so.1 => (0x00007ffcaf911000)
libcrypto.so.1.1 => not found
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fd4087b4000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fd4083ea000)
/lib64/ld-linux-x86-64.so.2 (0x00007fd408c65000)
sudo cp libcrypto.so.1.1 /lib/x86_64-linux-gnu/
ldd libssl.so
linux-vdso.so.1 => (0x00007fff0f5d8000)
libcrypto.so.1.0.0 => /lib/x86_64-linux-gnu/libcrypto.so.1.1 (0x00007fd3dcc1e000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fd3dc854000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fd3dc650000)
/lib64/ld-linux-x86-64.so.2 (0x00007fd3dd2d6000)
```
### Mac OS X
#### a. Show dependencies of executable or shared library:
Show dependencies of executable or shared library:
$ otool -L robomongo
View LC_RPATH records of executable or shared library:
$ otool -l robomongo | grep -C2 RPATH
(option `-C2` asks grep to output 2 context lines before and after the match)
For Robomongo binary it should be `$executable_path/../Frameworks`
More about `otool -l`
```
$ otool -l /opt/robo/build/release/src/robomongo/Robo\ 3T.app/Contents/MacOS/Robo\ 3T
....
Load command 23
cmd LC_LOAD_DYLIB
cmdsize 56
name @rpath/lib/libssl.1.1.dylib (offset 24)
time stamp 2 Thu Jan 1 03:00:02 1970
current version 1.1.0
compatibility version 1.1.0
Load command 24
cmd LC_LOAD_DYLIB
cmdsize 56
name @rpath/lib/libcrypto.1.1.dylib (offset 24)
time stamp 2 Thu Jan 1 03:00:02 1970
current version 1.1.0
compatibility version 1.1.0
....
Load command 27
cmd LC_RPATH
cmdsize 48
path /opt/Qt5.9.3/5.9.3/clang_64/lib (offset 12)
Load command 28
cmd LC_RPATH
cmdsize 32
path /opt/openssl-1.1.1f (offset 12)
```
#### b. Edit dependencies of executable or shared library:
```
// Before
otool -L libssl.dylib
libssl.dylib:
/usr/local/lib/libssl.1.1.dylib (compatibility version 1.1.0, current version 1.1.0)
/usr/local/lib/libcrypto.1.1.dylib (compatibility version 1.1.0, current version 1.1.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1281.100.1)
// Edit
install_name_tool -id "@rpath/lib/libssl.1.1.dylib" libssl.dylib
install_name_tool -change /usr/local/lib/libcrypto.1.1.dylib @rpath/lib/libcrypto.1.1.dylib libssl.dylib
// After
otool -L libssl.dylib
libssl.dylib:
@rpath/lib/libssl.1.1.dylib (compatibility version 1.1.0, current version 1.1.0)
@rpath/lib/libcrypto.1.1.dylib (compatibility version 1.1.0, current version 1.1.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1281.100.1)
```
Diagnostic of Qt plugins
------------------------
Run Robomongo in the following way to see how plugins are resolved:
$ QT_DEBUG_PLUGINS=1 ./robomongo
-76
View File
@@ -1,76 +0,0 @@
Runtime Dependencies
====================
This information is for maintainers. If you want to just use Robomongo - download
prebuild packages for your platform.
Runtime dependencies that are not privided by platforms but required by Robomongo are:
1. Qt libraries
2. Qt plugins
Diagnostic of dependencies
--------------------------
### Linux
a. View dependencies of executable or shared library:
$ ldd robomongo
$ readelf -d robomongo
b. View dependency tree of executable or shared library:
$ lddtree robomongo
$ ldd -v robomongo
c. View RPATH or RUNPATH records of executable or shared library:
$ objdump -x bin/robomongo | grep "RPATH\|RUNPATH"
$ readelf -d bin/robomongo | grep RPATH
For Robomongo binary it should be `$ORIGIN/../lib`
d. Enable extensive logging for run-time shared library search
$ export LD_DEBUG=files
$ bin/robomongo
Source:
http://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html
e. Modify RPATH using `chrpath` and the dynamic linker and RPATH using paths `patchelf`
$ patchelf --set-rpath '$ORIGIN/../lib' robo
More: https://nixos.org/patchelf.html
$ chrpath -r "/somepath/lib/" robomongo
More:
https://linux.die.net/man/1/chrpath
http://www.programering.com/a/MTOwcDNwATU.html // examples
### Mac OS X
Show dependencies of executable or shared library:
$ otool -L robomongo
View LC_RPATH records of executable or shared library:
$ otool -l robomongo | grep -C2 RPATH
(option `-C2` asks grep to output 2 context lines before and after the match)
For Robomongo binary it should be `$executable_path/../Frameworks`
Diagnostic of Qt plugins
------------------------
Run Robomongo in the following way to see how plugins are resolved:
$ QT_DEBUG_PLUGINS=1 ./robomongo
+2
View File
@@ -36,5 +36,7 @@
<string>${MACOSX_BUNDLE_COPYRIGHT}</string>
<key>NSHighResolutionCapable</key>
<string>True</string>
<key>NSRequiresAquaSystemAppearance</key>
<true/>
</dict>
</plist>
-11
View File
@@ -1,11 +0,0 @@
This is a logbook for notes about migration to MongoDB 3.2
DocumentTextEditor.cpp
----------------------
Commented error reporting.
Logger.cpp
----------
Commented Logger::print().
Binary file not shown.

After

Width:  |  Height:  |  Size: 468 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 361 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 99 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 262 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 302 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

+110 -51
View File
@@ -1,64 +1,123 @@
#
# Unit Testing using Google Test (currently disabled)
enable_testing()
include_directories(${gtest_SOURCE_DIR}/include ${gtest_SOURCE_DIR})
#########################################
### Unit Testing with Google Test ###
#########################################
set(ROBO_SRC_DIR ${CMAKE_HOME_DIRECTORY}/src/robomongo)
if(SYSTEM_LINUX)
set(SOURCES_TEST
${ROBO_SRC_DIR}/utils/string_operations_test.cpp
# todo
# ${CMAKE_HOME_DIRECTORY}/src/robomongo/core/HexUtils_test.cpp
)
else()
set(SOURCES_TEST
${ROBO_SRC_DIR}/utils/string_operations_test.cpp
${ROBO_SRC_DIR}/core/HexUtils_test.cpp
)
### --- Important Note
if (SYSTEM_LINUX)
message("\n *Note: Currently unit testing is disabled for Linux "
"due to MongoDB linking problems")
return()
endif()
### --- Enable and setup gtest
enable_testing()
include_directories(${gtest_SOURCE_DIR}/include ${gtest_SOURCE_DIR})
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
### --- Setup test source files
# New test & source file pairs MUST have the following format:
# Test file: /path/Foo_test.cpp
# Source file: /path/Foo.cpp or /path/Foo.h
set(ROBO_SRC_DIR ${CMAKE_HOME_DIRECTORY}/src/robomongo)
set(SOURCES_TEST
${ROBO_SRC_DIR}/utils/RoboCrypt_test.cpp
${ROBO_SRC_DIR}/utils/StringOperations_test.cpp
${ROBO_SRC_DIR}/core/HexUtils_test.cpp
)
### --- Setup robo_unit_tests exec. & link ROBO_OBJ_FILES
add_executable(robo_unit_tests ${SOURCES_TEST})
add_dependencies(robo_unit_tests robomongo)
target_include_directories(robo_unit_tests PRIVATE ${CMAKE_HOME_DIRECTORY}/src)
get_target_property(ROBO_SOURCES robomongo SOURCES)
list(FILTER ROBO_SOURCES INCLUDE REGEX "cpp")
list(FILTER ROBO_SOURCES EXCLUDE REGEX "main.cpp")
if(SYSTEM_WINDOWS)
set(OBJ_DIR
${CMAKE_SOURCE_DIR}/build/${CMAKE_BUILD_TYPE}/src/robomongo/robomongo.dir/${CMAKE_BUILD_TYPE}/
)
target_link_libraries(robo_unit_tests
gtest gtest_main mongodb
# todo: Find better solution instead of this manual adding files
${OBJ_DIR}/string_operations.obj
${OBJ_DIR}/HexUtils.obj
)
elseif(SYSTEM_MACOSX)
set(OBJ_DIR ${CMAKE_BINARY_DIR}/src/robomongo/robomongo.dir/${CMAKE_BUILD_TYPE}/)
set(ROBO_OBJ_FILES "${ROBO_OBJ_FILES}${OBJ_DIR}mocs_compilation.obj;")
set(ROBO_OBJ_FILES "${ROBO_OBJ_FILES}${OBJ_DIR}qrc_gui.obj;")
set(ROBO_OBJ_FILES "${ROBO_OBJ_FILES}${OBJ_DIR}qrc_robo.obj;")
foreach(SRC_FILE ${ROBO_SOURCES})
get_filename_component(FILENAME ${SRC_FILE} NAME)
string(REPLACE ".cpp" ".obj" FILENAME ${FILENAME})
set(ROBO_OBJ_FILES "${ROBO_OBJ_FILES}${OBJ_DIR}${FILENAME};")
endforeach()
elseif(SYSTEM_MACOSX)
set(OBJ_DIR ${CMAKE_BINARY_DIR}/src/robomongo/CMakeFiles/robomongo.dir/)
set(ROBO_OBJ_FILES "${ROBO_OBJ_FILES}${OBJ_DIR}/robomongo_autogen/mocs_compilation.cpp.o;")
set(ROBO_OBJ_FILES "${ROBO_OBJ_FILES}${OBJ_DIR}/robomongo_autogen/YHP5W5E6RA/qrc_gui.cpp.o;")
set(ROBO_OBJ_FILES "${ROBO_OBJ_FILES}${OBJ_DIR}/robomongo_autogen/3YJK5W5UP7/qrc_robo.cpp.o;")
foreach(SRC_FILE ${ROBO_SOURCES})
string(REPLACE ".cpp" ".cpp.o" OBJ_FILE ${SRC_FILE})
set(ROBO_OBJ_FILES "${ROBO_OBJ_FILES}${OBJ_DIR}${OBJ_FILE};")
endforeach()
find_library(SECURITY NAMES Security)
find_library(CORE_FOUNDATION NAMES CoreFoundation)
set(SSL_LIBRARIES ${SECURITY} ${CORE_FOUNDATION})
set(OBJ_DIR
${CMAKE_SOURCE_DIR}/build/${CMAKE_BUILD_TYPE}/src/robomongo/CMakeFiles/robomongo.dir/
)
target_link_libraries(robo_unit_tests
gtest gtest_main mongodb ${SSL_LIBRARIES} -lresolv
${OBJ_DIR}/utils/string_operations.cpp.o
${OBJ_DIR}/core/HexUtils.cpp.o
)
elseif(SYSTEM_LINUX)
set(CMAKE_BUILD_TYPE_L ${CMAKE_BUILD_TYPE})
string(TOLOWER ${CMAKE_BUILD_TYPE_L} CMAKE_BUILD_TYPE_L)
set(OBJ_DIR
${CMAKE_SOURCE_DIR}/build/${CMAKE_BUILD_TYPE_L}/src/robomongo/CMakeFiles/robomongo.dir
)
# todo: Getting openssl link errors when mongodb lib is linked
target_link_libraries(robo_unit_tests
gtest gtest_main #ssl crypto #mongodb
${OBJ_DIR}/utils/string_operations.cpp.o
# ${OBJ_DIR}/core/HexUtils.cpp.o
)
target_link_libraries(robo_unit_tests ${SSL_LIBRARIES} -lresolv)
# elseif(SYSTEM_LINUX)
# set(OBJ_DIR ${CMAKE_BINARY_DIR}/src/robomongo/CMakeFiles/robomongo.dir/)
# message("--- OBJ_DIR: " ${OBJ_DIR})
# set(ROBO_OBJ_FILES "${ROBO_OBJ_FILES}${OBJ_DIR}/robomongo_automoc.cpp.o;")
# set(ROBO_OBJ_FILES "${ROBO_OBJ_FILES}${OBJ_DIR}/robomongo_automoc.dir/gui/resources/qrc_gui.cpp.o;")
# set(ROBO_OBJ_FILES "${ROBO_OBJ_FILES}${OBJ_DIR}/robomongo_automoc.dir/resources/qrc_robo.cpp.o;")
# foreach(SRC_FILE ${ROBO_SOURCES})
# string(REPLACE ".cpp" ".cpp.o" OBJ_FILE ${SRC_FILE})
# set(ROBO_OBJ_FILES "${ROBO_OBJ_FILES}${OBJ_DIR}${OBJ_FILE};")
# endforeach()
endif()
target_include_directories(robo_unit_tests
PRIVATE
${CMAKE_HOME_DIRECTORY}/src)
# Disable WebEngineWidgets for Linux
SET(WebEngineWidgets "Qt5::WebEngineWidgets")
if(SYSTEM_LINUX)
SET(WebEngineWidgets)
endif()
target_link_libraries(robo_unit_tests
gtest
gtest_main
Qt5::Widgets
Qt5::Network
Qt5::Xml
${WebEngineWidgets}
qjson
qscintilla
mongodb
ssh
Threads::Threads
${ROBO_OBJ_FILES}
)
### --- Install DLLs for Windows
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set(D "d")
endif()
if(SYSTEM_WINDOWS)
get_target_property(target_path Qt5::Core LOCATION)
get_filename_component(qt_bin_dir ${target_path} DIRECTORY)
set(QT_BIN_FILES "${QT_BIN_FILES}" ${qt_bin_dir}/Qt5Core${D}${CMAKE_SHARED_LIBRARY_SUFFIX};)
set(QT_BIN_FILES "${QT_BIN_FILES}" ${qt_bin_dir}/Qt5Gui${D}${CMAKE_SHARED_LIBRARY_SUFFIX};)
set(QT_BIN_FILES "${QT_BIN_FILES}" ${qt_bin_dir}/Qt5Network${D}${CMAKE_SHARED_LIBRARY_SUFFIX};)
set(QT_BIN_FILES "${QT_BIN_FILES}" ${qt_bin_dir}/Qt5PrintSupport${D}${CMAKE_SHARED_LIBRARY_SUFFIX};)
set(QT_BIN_FILES "${QT_BIN_FILES}" ${qt_bin_dir}/Qt5Widgets${D}${CMAKE_SHARED_LIBRARY_SUFFIX};)
set(QT_BIN_FILES "${QT_BIN_FILES}" ${qt_bin_dir}/Qt5Xml${D}${CMAKE_SHARED_LIBRARY_SUFFIX};)
set(QT_BIN_FILES "${QT_BIN_FILES}" ${qt_bin_dir}/Qt5Positioning${D}${CMAKE_SHARED_LIBRARY_SUFFIX};)
set(QT_BIN_FILES "${QT_BIN_FILES}" ${qt_bin_dir}/Qt5Qml${D}${CMAKE_SHARED_LIBRARY_SUFFIX};)
set(QT_BIN_FILES "${QT_BIN_FILES}" ${qt_bin_dir}/Qt5Quick${D}${CMAKE_SHARED_LIBRARY_SUFFIX};)
set(QT_BIN_FILES "${QT_BIN_FILES}" ${qt_bin_dir}/Qt5QuickWidgets${D}${CMAKE_SHARED_LIBRARY_SUFFIX};)
set(QT_BIN_FILES "${QT_BIN_FILES}" ${qt_bin_dir}/Qt5WebChannel${D}${CMAKE_SHARED_LIBRARY_SUFFIX};)
set(QT_BIN_FILES "${QT_BIN_FILES}" ${qt_bin_dir}/Qt5WebEngineCore${D}${CMAKE_SHARED_LIBRARY_SUFFIX};)
set(QT_BIN_FILES "${QT_BIN_FILES}" ${qt_bin_dir}/Qt5WebEngineWidgets${D}${CMAKE_SHARED_LIBRARY_SUFFIX};)
set(QT_BIN_FILES "${QT_BIN_FILES}" ${qt_bin_dir}/Qt5PrintSupport${D}${CMAKE_SHARED_LIBRARY_SUFFIX};)
get_target_property(TESTS_BIN_DIR robo_unit_tests BINARY_DIR)
file(COPY ${QT_BIN_FILES} DESTINATION ${TESTS_BIN_DIR}/${CMAKE_BUILD_TYPE})
file(COPY
${OpenSSL_DIR}/libssl-1_1-x64.dll
${OpenSSL_DIR}/libcrypto-1_1-x64.dll
DESTINATION ${TESTS_BIN_DIR}/${CMAKE_BUILD_TYPE})
endif()
+14
View File
@@ -0,0 +1,14 @@
This is just a placeholder for `cmake`.
Test source files are located in the same directory alongside the tested file in `robomongo/src/robomongo/` dir and sub-dirs.
e.g.
```
...
RoboCrypt.cpp
RoboCrypt_test.cpp
...
StringOperations.cpp
StringOperations_test.cpp
...
```
+56 -19
View File
@@ -10,7 +10,6 @@ set(CMAKE_AUTOUIC ON)
#set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${sanitize}")
set(SOURCES
# Isolated Scope #1
core/utils/QtUtils.cpp
core/utils/StdUtils.cpp
@@ -28,14 +27,11 @@ set(SOURCES
core/EventBus.cpp
core/KeyboardManager.cpp
core/domain/MongoNamespace.cpp
core/domain/MongoUser.cpp
core/domain/MongoUser.cpp
core/domain/MongoFunction.cpp
core/domain/MongoUtils.cpp
core/domain/MongoCollection.cpp
core/domain/MongoCollectionInfo.cpp
core/domain/MongoQueryInfo.cpp
core/domain/MongoShellResult.cpp
core/domain/CursorPosition.cpp
core/domain/ScriptInfo.cpp
core/events/MongoEventsInfo.cpp
@@ -56,8 +52,10 @@ set(SOURCES
core/mongodb/ReplicaSet.cpp
core/settings/SettingsManager.cpp
core/AppRegistry.cpp
utils/string_operations.cpp
utils/StringOperations.cpp
utils/common.cpp
utils/SimpleCrypt.cpp
utils/RoboCrypt.cpp
# Isolated Scope #3
gui/GuiRegistry.cpp
@@ -79,7 +77,6 @@ set(SOURCES
# Isolated scope #4
gui/dialogs/PreferencesDialog.cpp
gui/dialogs/ConnectionsDialog.cpp
gui/dialogs/CreateConnectionDialog.cpp
gui/dialogs/ExportDialog.cpp
gui/dialogs/ChangeShellTimeoutDialog.cpp
@@ -87,11 +84,13 @@ set(SOURCES
gui/editors/PlainJavaScriptEditor.cpp
gui/editors/JSLexer.cpp
gui/editors/FindFrame.cpp
gui/widgets/explorer/EditIndexDialog.cpp
gui/widgets/explorer/AddEditIndexDialog.cpp
gui/widgets/workarea/ScriptWidget.cpp
# Isolated scope #6
gui/widgets/explorer/ExplorerCollectionTreeItem.cpp
gui/widgets/explorer/ExplorerCollectionIndexesDir.cpp
gui/widgets/explorer/ExplorerCollectionIndexItem.cpp
gui/widgets/explorer/ExplorerTreeItem.cpp
gui/widgets/explorer/ExplorerReplicaSetFolderItem.cpp
gui/widgets/explorer/ExplorerReplicaSetTreeItem.cpp
@@ -145,11 +144,18 @@ set(SOURCES
# Robomongo target
add_executable(robomongo MACOSX_BUNDLE WIN32 app/main.cpp ${SOURCES})
# Disable WebEngineWidgets for Linux
SET(WebEngineWidgets "Qt5::WebEngineWidgets")
if(SYSTEM_LINUX)
SET(WebEngineWidgets)
endif()
target_link_libraries(robomongo
PRIVATE
Qt5::Widgets
Qt5::Network
Qt5::Xml
${WebEngineWidgets}
qjson
qscintilla
mongodb
@@ -171,6 +177,26 @@ target_include_directories(robomongo
PRIVATE
${CMAKE_HOME_DIRECTORY}/src)
# Get build number
find_package(Git)
if(GIT_FOUND)
execute_process(
COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
OUTPUT_VARIABLE BUILD_NUMBER
OUTPUT_STRIP_TRAILING_WHITESPACE
)
else(GIT_FOUND)
MESSAGE( FATAL_ERROR "Unable to find Git" )
set(BUILD_NUMBER 0)
endif(GIT_FOUND)
if(BUILD_NUMBER STREQUAL "")
MESSAGE( FATAL_ERROR "Failed to get BUILD_NUMBER" )
endif()
set(BUILD_NUMBER ${BUILD_NUMBER} CACHE INTERNAL "")
target_compile_definitions(robomongo
PRIVATE
BUILDING_ROBO
@@ -184,8 +210,16 @@ target_compile_definitions(robomongo
PROJECT_GITHUB_ISSUES="${PROJECT_GITHUB_ISSUES}"
PROJECT_VERSION="${PROJECT_VERSION}"
PROJECT_VERSION_SHORT="${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}"
PROJECT_QT_VERSION="${Qt5Core_VERSION}"
PROJECT_NAME_LOWERCASE="${PROJECT_NAME_LOWERCASE}")
BUILD_NUMBER="${BUILD_NUMBER}"
PROJECT_NAME_LOWERCASE="${PROJECT_NAME_LOWERCASE}"
PROJECT_QT_VERSION="${Qt5Core_VERSION}"
MongoDB_VERSION="${MongoDB_VERSION}"
OPENSSL_VERSION="${OPENSSL_VERSION}"
LIBSSH2_VERSION="${LIBSSH2_VERSION}"
QJSON_VERSION="${QJSON_VERSION}"
GOOGLE_TEST_VERSION="${GOOGLE_TEST_VERSION}"
ESPRIMA_VERSION="${ESPRIMA_VERSION}"
)
if(SYSTEM_WINDOWS)
# Create Windows Resource file
@@ -196,31 +230,34 @@ if(SYSTEM_WINDOWS)
unset(windows_icon)
# Add additional source file to "robomongo" target
target_sources(robomongo
PRIVATE
"${CMAKE_BINARY_DIR}/winres.rc")
target_sources(robomongo PRIVATE "${CMAKE_BINARY_DIR}/winres.rc")
# Rename output name for Windows
set_target_properties(robomongo PROPERTIES
OUTPUT_NAME "robo3t")
set_target_properties(robomongo PROPERTIES OUTPUT_NAME "robo3t")
# Suppress "warning C4477: 'sprintf'..." from robomongo\shell\db\ptimeutil.cpp
# Suppress "warning C4291: ...no matching operator delete found" from third_party\mozjs-60
set_target_properties(robomongo PROPERTIES COMPILE_FLAGS "/wd4477 /wd4291")
# Start debug program with console
set_target_properties(robomongo PROPERTIES LINK_FLAGS_DEBUG "/SUBSYSTEM:CONSOLE")
# Seems that we do not need to do this with recent versions of Qt
target_link_libraries(robomongo
PRIVATE
Qt5::WinMain)
target_link_libraries(robomongo PRIVATE Qt5::WinMain)
elseif(SYSTEM_MACOSX)
string(TIMESTAMP CURRENT_YEAR "%Y")
set_target_properties(robomongo PROPERTIES
INSTALL_RPATH "@executable_path/../Frameworks"
OUTPUT_NAME "Robo 3T"
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_SOURCE_DIR}/install/macosx/Info.plist.in"
MACOSX_BUNDLE_BUNDLE_NAME "Robo 3T"
MACOSX_BUNDLE_GUI_IDENTIFIER "com.3tsoftwarelabs.robo3t"
MACOSX_BUNDLE_INFO_STRING "Robo 3T ${PROJECT_VERSION}. Copyright 3T Software Labs Ltd, 2014 - 2017"
MACOSX_BUNDLE_INFO_STRING "Robo 3T ${PROJECT_VERSION}. Copyright 3T Software Labs Ltd, 2014 - ${CURRENT_YEAR}"
MACOSX_BUNDLE_SHORT_VERSION "${PROJECT_VERSION}"
MACOSX_BUNDLE_LONG_VERSION "${PROJECT_VERSION}"
MACOSX_BUNDLE_BUNDLE_VERSION "${PROJECT_VERSION}"
MACOSX_BUNDLE_COPYRIGHT "Copyright 3T Software Labs Ltd, 2014 - 2017"
MACOSX_BUNDLE_COPYRIGHT "Copyright 3T Software Labs Ltd, 2014 - ${CURRENT_YEAR}"
MACOSX_BUNDLE_ICON_FILE "robomongo")
elseif(SYSTEM_LINUX)
+22 -26
View File
@@ -16,11 +16,12 @@
#include "robomongo/core/AppRegistry.h"
#include "robomongo/core/settings/SettingsManager.h"
#include "robomongo/core/utils/Logger.h"
#include "robomongo/gui/MainWindow.h"
#include "robomongo/gui/AppStyle.h"
#include "robomongo/gui/dialogs/EulaDialog.h"
#include "robomongo/ssh/ssh.h"
#include "robomongo/utils/RoboCrypt.h"
int main(int argc, char *argv[], char** envp)
{
@@ -44,13 +45,15 @@ int main(int argc, char *argv[], char** envp)
// Initialization routine for MongoDB shell
mongo::runGlobalInitializersOrDie(argc, argv, envp);
mongo::setGlobalServiceContext(mongo::ServiceContext::make());
// Mongo-Todo: This should use a TransportLayerManager or TransportLayerFactory
// Todo from mongo repo: This should use a TransportLayerManager or TransportLayerFactory
auto serviceContext = mongo::getGlobalServiceContext();
mongo::transport::TransportLayerASIO::Options opts;
// When true, it breaks connection to localhost, github #1757
opts.enableIPv6 = mongo::shellGlobalParams.enableIPv6;
opts.mode = mongo::transport::TransportLayerASIO::Options::kEgress;
serviceContext->setTransportLayer(
std::make_unique<mongo::transport::TransportLayerASIO>(opts, nullptr));
std::make_unique<mongo::transport::TransportLayerASIO>(opts, nullptr)
);
auto tlPtr = serviceContext->getTransportLayer();
uassertStatusOK(tlPtr->setup());
uassertStatusOK(tlPtr->start());
@@ -70,47 +73,40 @@ int main(int argc, char *argv[], char** envp)
#ifdef Q_OS_MAC
app.setAttribute(Qt::AA_UseHighDpiPixmaps);
#endif
auto const& settingsManager = Robomongo::AppRegistry::instance().settingsManager();
// Disable HTTPS and do not show EULA form if program exited abnormally
bool showEulaDialogForm = true;
if (!settingsManager->programExitedNormally()) {
showEulaDialogForm = false;
settingsManager->setUseHttps(false);
settingsManager->save();
}
if (!settingsManager->useHttps())
showEulaDialogForm = false;
// EULA License Agreement
if (!settingsManager->acceptedEulaVersions().contains(PROJECT_VERSION)) {
Robomongo::EulaDialog eulaDialog(showEulaDialogForm);
settingsManager->setProgramExitedNormally(false);
settingsManager->save();
auto const& settings { Robomongo::AppRegistry::instance().settingsManager() };
if (!settings->acceptedEulaVersions().contains(PROJECT_VERSION)) {
bool const showFormPage { settings->programExitedNormally() && !settings->disableHttpsFeatures() };
Robomongo::EulaDialog eulaDialog(showFormPage);
settings->setProgramExitedNormally(false);
settings->save();
int const result = eulaDialog.exec();
settingsManager->setProgramExitedNormally(true);
settingsManager->save();
settings->setProgramExitedNormally(true);
settings->save();
if (QDialog::Rejected == result) {
rbm_ssh_cleanup();
return 1;
}
// EULA accepted
settingsManager->addAcceptedEulaVersion(PROJECT_VERSION);
settingsManager->save();
settings->addAcceptedEulaVersion(PROJECT_VERSION);
settings->save();
}
// Init GUI style
Robomongo::AppStyleUtils::initStyle();
// To be set true at normal program exit
settingsManager->setProgramExitedNormally(false);
settingsManager->save();
settings->setProgramExitedNormally(false);
settings->save();
// Application main window
Robomongo::MainWindow mainWindow;
mainWindow.show();
for(auto const& msgAndSeverity : Robomongo::RoboCrypt::roboCryptLogs())
Robomongo::LOG_MSG(msgAndSeverity.first, msgAndSeverity.second);
int rc = app.exec();
rbm_ssh_cleanup();
return rc;
+1
View File
@@ -31,6 +31,7 @@ namespace Robomongo
class MongoDocument;
typedef boost::shared_ptr<MongoDocument> MongoDocumentPtr;
// todo: Use enum class
enum ConnectionType {
// This type of connection is shown in Explorer and also opens SSH tunnel for secondary
// connections (if needed)
+15 -17
View File
@@ -13,11 +13,11 @@
namespace
{
struct RemoveIfReciver : public std::unary_function<const Robomongo::EventBus::SubscribersType&, bool>
struct RemoveIfReciver
{
RemoveIfReciver(QObject *receiver) : _receiver(receiver) {}
bool operator()(const Robomongo::EventBus::SubscribersType& item) const {
bool operator()(const Robomongo::EventBus::EventTypeAndSubscriber& item) const {
if (item.second->receiver == _receiver) {
delete item.second;
return true;
@@ -28,13 +28,13 @@ namespace
QObject *_receiver;
};
struct FindIfReciver : public std::unary_function<const Robomongo::EventBus::SubscribersType&, bool>
struct FindIfReciver
{
FindIfReciver(QThread *thread) : _thread(thread) {}
bool operator()(const Robomongo::EventBus::DispatchersType &item) const {
if (item.first == _thread) {
bool operator()(const Robomongo::EventBus::ThreadAndDispatcher &item) const {
if (item.first == _thread)
return true;
}
return false;
}
QThread *_thread;
@@ -50,19 +50,16 @@ namespace Robomongo
EventBus::~EventBus()
{
for (DispatchersContainerType::iterator it = _dispatchersByThread.begin(); it != _dispatchersByThread.end(); ++it) {
DispatchersType item = *it;
delete item.second;
}
for (auto const& dispatchersByThread : _dispatchersByThread)
delete dispatchersByThread.second;
}
void EventBus::publish(Event *event)
{
QMutexLocker lock(&_lock);
QList<QObject*> theReceivers;
EventBusDispatcher *dis = NULL;
for (SubscribersContainerType::iterator it = _subscribersByEventType.begin(); it != _subscribersByEventType.end(); ++it ) {
SubscribersType item = *it;
EventBusDispatcher *dis = nullptr;
for (auto const& item : _subscribersByEventType) {
if (event->type() == item.first) {
EventBusSubscriber *subscriber = item.second;
if (!subscriber->sender || subscriber->sender == event->sender()) {
@@ -118,7 +115,7 @@ namespace Robomongo
VERIFY(connect(receiver, SIGNAL(destroyed(QObject*)), this, SLOT(unsubscibe(QObject*))));
// add subscriber
_subscribersByEventType.push_back(SubscribersType(type, new EventBusSubscriber(dis, receiver, sender)));
_subscribersByEventType.push_back(EventTypeAndSubscriber(type, new EventBusSubscriber(dis, receiver, sender)));
}
void EventBus::unsubscibe(QObject *receiver)
@@ -134,8 +131,9 @@ namespace Robomongo
*/
EventBusDispatcher *EventBus::dispatcher(QThread *thread)
{
DispatchersContainerType::iterator disIt = std::find_if(
_dispatchersByThread.begin(), _dispatchersByThread.end(), FindIfReciver(thread));
auto const& disIt = std::find_if(
_dispatchersByThread.begin(), _dispatchersByThread.end(), FindIfReciver(thread)
);
if (disIt != _dispatchersByThread.end()) {
return (*disIt).second;
@@ -143,7 +141,7 @@ namespace Robomongo
else {
EventBusDispatcher *dis = new EventBusDispatcher();
dis->moveToThread(thread);
_dispatchersByThread.push_back(DispatchersType(thread, dis));
_dispatchersByThread.push_back(ThreadAndDispatcher(thread, dis));
return dis;
}
}
+5 -6
View File
@@ -21,10 +21,9 @@ namespace Robomongo
Q_OBJECT
public:
typedef std::pair<QEvent::Type, EventBusSubscriber *> SubscribersType;
typedef std::vector<SubscribersType > SubscribersContainerType;
typedef std::pair<QThread *, EventBusDispatcher *> DispatchersType;
typedef std::vector<DispatchersType> DispatchersContainerType;
typedef std::pair<QEvent::Type, EventBusSubscriber *> EventTypeAndSubscriber;
typedef std::pair<QThread *, EventBusDispatcher *> ThreadAndDispatcher;
EventBus();
~EventBus();
@@ -65,7 +64,7 @@ namespace Robomongo
private:
QMutex _lock;
SubscribersContainerType _subscribersByEventType;
DispatchersContainerType _dispatchersByThread;
std::vector<EventTypeAndSubscriber> _subscribersByEventType;
std::vector<ThreadAndDispatcher> _dispatchersByThread;
};
}
+1 -1
View File
@@ -1,6 +1,6 @@
#include "robomongo/core/EventError.h"
#include "robomongo/utils/string_operations.h"
#include "robomongo/utils/StringOperations.h"
namespace Robomongo
{
+109 -94
View File
@@ -1,6 +1,8 @@
#include "robomongo/core/domain/App.h"
#include <QHash>
#include <QInputDialog>
#include <QMessageBox>
#include "robomongo/core/domain/MongoServer.h"
#include "robomongo/core/domain/MongoShell.h"
@@ -35,6 +37,9 @@ namespace Robomongo
}
}
App::~App()
{}
App::App(EventBus *const bus) : QObject(),
_bus(bus), _lastServerHandle(0) {
_bus->subscribe(this, EstablishSshConnectionResponse::Type);
@@ -42,17 +47,75 @@ namespace Robomongo
_bus->subscribe(this, LogEvent::Type);
}
App::~App()
std::unique_ptr<MongoServer>
App::continueOpenServer(int serverHandle, ConnectionSettings* connSettings,
ConnectionType type, int localport)
{
std::for_each(_shells.begin(), _shells.end(), stdutils::default_delete<MongoShell*>());
std::for_each(_servers.begin(), _servers.end(), stdutils::default_delete<MongoServer*>());
ConnectionSettings* connSettingsClone = connSettings->clone();
// Modify connection settings when SSH tunnel is used
if ((type == ConnectionPrimary || type == ConnectionTest)
&& !connSettingsClone->isReplicaSet()
&& connSettingsClone->sshSettings()->enabled()
) {
connSettingsClone->setServerHost("127.0.0.1");
connSettingsClone->setServerPort(localport);
}
auto server { std::make_unique<MongoServer>(serverHandle, connSettingsClone, type) };
server->runWorkerThread();
auto replicaSetStr = QString::fromStdString(connSettings->connectionName()) + " [Replica Set]";
replicaSetStr = (connSettings->replicaSetSettings()->members().size() > 0)
? replicaSetStr + QString::fromStdString(connSettings->replicaSetSettings()->members()[0])
: replicaSetStr + "";
QString serverAddress = connSettings->isReplicaSet()
? replicaSetStr
: QString::fromStdString(connSettings->getFullAddress());
LOG_MSG(QString("Connecting to %1...").arg(serverAddress), mongo::logger::LogSeverity::Info());
server->tryConnect();
return server;
}
bool App::openServer(ConnectionSettings *connection, ConnectionType type) {
/**
* Creates and opens new server connection.
* @param connection: ConnectionSettings, that will be owned by MongoServer.
* @param visible: should this server be visible in UI (explorer) or not.
*/
std::unique_ptr<MongoServer>
App::openServerInternal(ConnectionSettings* connSettings, ConnectionType type)
{
++_lastServerHandle;
if (type == ConnectionPrimary)
_bus->publish(new ConnectingEvent(this));
// When connection is SECONDARY or SSH not enabled or replica set,
// then continue without SSH Tunnel
if (type == ConnectionSecondary || !connSettings->sshSettings()->enabled()
|| connSettings->isReplicaSet()
) {
return continueOpenServer(_lastServerHandle, connSettings, type);
}
// Open SSH channel and only after that open connection
LOG_MSG(QString("Creating SSH tunnel to %1:%2...")
.arg(QtUtils::toQString(connSettings->sshSettings()->host()))
.arg(connSettings->sshSettings()->port()), mongo::logger::LogSeverity::Info());
ConnectionSettings* settingsCopy = connSettings->clone();
SshTunnelWorker* sshWorker = new SshTunnelWorker(settingsCopy);
_bus->send(sshWorker, new EstablishSshConnectionRequest(this, _lastServerHandle, sshWorker, settingsCopy, type));
return nullptr;
}
bool App::openServer(ConnectionSettings *connection, ConnectionType type)
{
SshSettings *ssh = connection->sshSettings();
if (ssh->enabled() && ssh->askPassword() &&
if (!connection->isReplicaSet() && ssh->enabled() && ssh->askPassword() &&
(type == ConnectionPrimary || type == ConnectionTest)) {
bool ok = false;
@@ -97,46 +160,18 @@ namespace Robomongo
}
}
openServerInternal(connection, type);
_servers.push_back(move(openServerInternal(connection, type)));
return true;
}
/**
* Creates and opens new server connection.
* @param connection: ConnectionSettings, that will be owned by MongoServer.
* @param visible: should this server be visible in UI (explorer) or not.
*/
MongoServer *App::openServerInternal(ConnectionSettings* connSettings, ConnectionType type) {
++_lastServerHandle;
if (type == ConnectionPrimary)
_bus->publish(new ConnectingEvent(this));
// When connection is SECONDARY or do not have
// ssh settings enabled, continue without SSH Tunnel
if (type == ConnectionSecondary || !connSettings->sshSettings()->enabled()) {
return continueOpenServer(_lastServerHandle, connSettings, type);
}
// Open SSH channel and only after that open connection
LOG_MSG(QString("Creating SSH tunnel to %1:%2...")
.arg(QtUtils::toQString(connSettings->sshSettings()->host()))
.arg(connSettings->sshSettings()->port()), mongo::logger::LogSeverity::Info());
ConnectionSettings* settingsCopy = connSettings->clone();
SshTunnelWorker* sshWorker = new SshTunnelWorker(settingsCopy);
_bus->send(sshWorker, new EstablishSshConnectionRequest(this, _lastServerHandle, sshWorker, settingsCopy, type));
return NULL;
}
/**
* @brief Closes MongoServer connection and frees all resources, owned
* by MongoServer. Finally, specified MongoServer will also be deleted.
*/
void App::closeServer(MongoServer *server)
{
_servers.erase(std::remove_if(_servers.begin(), _servers.end(), stdutils::RemoveIfFound<MongoServer*>(server)),
_servers.end());
_servers.erase(std::remove_if(_servers.begin(), _servers.end(),
[&](auto const& el) { return el.get() == server; }), _servers.end());
}
void App::openShell(MongoCollection *collection, const QString &filePathToSave)
@@ -145,20 +180,23 @@ namespace Robomongo
auto const& dbname = collection->database()->name();
connection->setDefaultDatabase(dbname);
QString const& script = detail::buildCollectionQuery(collection->name(), "find({})");
openShell(collection->database()->server(), connection, ScriptInfo(script, true, dbname, CursorPosition(0, -2),
QtUtils::toQString(dbname), filePathToSave));
openShell(collection->database()->server(), connection,
ScriptInfo(script, true, dbname, CursorPosition(0, -2), QtUtils::toQString(dbname), filePathToSave)
);
}
void App::openShell(MongoServer *server, const QString &script, const std::string &dbName,
bool execute, const QString &shellName,
const CursorPosition &cursorPosition, const QString &filePathToSave)
bool execute, const QString &shellName,
const CursorPosition &cursorPosition, const QString &filePathToSave)
{
ConnectionSettings *connection = server->connectionRecord();
if (!dbName.empty())
connection->setDefaultDatabase(dbName);
openShell(server, connection, ScriptInfo(script, execute, dbName, cursorPosition, shellName, filePathToSave));
openShell(server, connection,
ScriptInfo(script, execute, dbName, cursorPosition, shellName, filePathToSave)
);
}
void App::openShell(MongoDatabase *database, const QString &script,
@@ -173,16 +211,17 @@ namespace Robomongo
void App::openShell(MongoServer* server, ConnectionSettings* connection, const ScriptInfo &scriptInfo)
{
MongoServer *serverClone = openServerInternal(connection, ConnectionSecondary);
auto serverClone{ openServerInternal(connection, ConnectionSecondary) };
if (!serverClone || !server)
return;
MongoShell *shell = new MongoShell(serverClone, scriptInfo);
auto shell{ std::make_unique<MongoShell>(serverClone.get(), scriptInfo) };
_servers.push_back(move(serverClone));
// Connection between explorer's server and tab's MongoShells
_bus->subscribe(server, ReplicaSetRefreshed::Type, shell);
_shells.push_back(shell);
_bus->publish(new OpeningShellEvent(this, shell));
_bus->subscribe(server, ReplicaSetRefreshed::Type, shell.get());
_bus->publish(new OpeningShellEvent(this, shell.get()));
shell->execute();
_shells.push_back(move(shell));
return;
}
@@ -192,45 +231,16 @@ namespace Robomongo
*/
void App::closeShell(MongoShell *shell)
{
auto const itr = std::find_if(_shells.begin(), _shells.end(),
[&](auto const& el) { return el.get() == shell; }
);
// Do nothing, if this shell not owned by this App.
MongoShellsContainerType::iterator it = std::find_if(_shells.begin(), _shells.end(), std::bind1st(std::equal_to<MongoShell *>(), shell));
if (it == _shells.end())
if (itr == _shells.end())
return;
_shells.erase(it);
closeServer(shell->server());
delete shell;
}
MongoServer *App::continueOpenServer(int serverHandle, ConnectionSettings* connSettings, ConnectionType type,
int localport)
{
ConnectionSettings* connSettingsClone = connSettings->clone();
// Modify connection settings when SSH tunnel is used
if ((type == ConnectionPrimary || type == ConnectionTest)
&& connSettingsClone->sshSettings()->enabled()) {
connSettingsClone->setServerHost("127.0.0.1");
connSettingsClone->setServerPort(localport);
}
MongoServer *server = new MongoServer(serverHandle, connSettingsClone, type);
_servers.push_back(server);
server->runWorkerThread();
auto replicaSetStr = QString::fromStdString(connSettings->connectionName()) + " [Replica Set]";
replicaSetStr = (connSettings->replicaSetSettings()->members().size() > 0)
? replicaSetStr + QString::fromStdString(connSettings->replicaSetSettings()->members()[0])
: replicaSetStr + "";
QString serverAddress = connSettings->isReplicaSet()
? replicaSetStr
: QString::fromStdString(connSettings->getFullAddress());
LOG_MSG(QString("Connecting to %1...").arg(serverAddress), mongo::logger::LogSeverity::Info());
server->tryConnect();
return server;
_shells.erase(itr);
}
void App::handle(EstablishSshConnectionResponse *event) {
@@ -243,26 +253,31 @@ namespace Robomongo
LOG_MSG(QString("SSH tunnel created successfully"), mongo::logger::LogSeverity::Info());
continueOpenServer(event->serverHandle, event->settings, event->connectionType, event->localport);
_servers.push_back(move(
continueOpenServer(event->serverHandle, event->settings, event->connectionType, event->localport)
));
_bus->send(event->worker, new ListenSshConnectionRequest(this, event->serverHandle, event->connectionType));
}
void App::handle(LogEvent *event) {
if (event->level == LogEvent::RBM_ERROR) {
LOG_MSG(event->message, mongo::logger::LogSeverity::Error());
} else if (event->level == LogEvent::RBM_WARN) {
LOG_MSG(event->message, mongo::logger::LogSeverity::Warning());
} else if (event->level == LogEvent::RBM_INFO) {
LOG_MSG(event->message, mongo::logger::LogSeverity::Info());
} else if (event->level == LogEvent::RBM_DEBUG) {
LOG_MSG(event->message, mongo::logger::LogSeverity::Log());
}
LOG_MSG(event->message, event->mongoLogSeverity());
if (!event->informUser)
return;
QMessageBox(
event->qMessageBoxIcon(),
QString::fromStdString(event->severity()),
QtUtils::toQString(event->severity() + ": " + event->message)
).exec();
}
void App::handle(ListenSshConnectionResponse *event) {
if (event->isError()) {
_bus->publish(new ConnectionFailedEvent(this, event->serverHandle, event->connectionType, event->error().errorMessage(),
ConnectionFailedEvent::SshChannel));
_bus->publish(
new ConnectionFailedEvent(this, event->serverHandle, event->connectionType,
event->error().errorMessage(), ConnectionFailedEvent::SshChannel)
);
return;
}
@@ -288,7 +303,7 @@ namespace Robomongo
s << std::endl << "Enter your PEM key passphrase (will never be stored):";
QString userInput = QInputDialog::getText(NULL, tr("SSL Authentication"),
QString userInput = QInputDialog::getText(NULL, tr("TLS Authentication"),
QtUtils::toQString(s.str()),
QLineEdit::Password, "", &ok);
+14 -12
View File
@@ -38,8 +38,6 @@ namespace Robomongo
Q_OBJECT
public:
typedef std::vector<MongoServer*> MongoServersContainerType;
typedef std::vector<MongoShell*> MongoShellsContainerType;
App(EventBus *const bus);
~App();
@@ -63,19 +61,20 @@ namespace Robomongo
void openShell(MongoCollection *collection, const QString &filePathToSave = QString());
void openShell(MongoServer *server, const QString &script, const std::string &dbName = std::string(),
bool execute = true, const QString &shellName = QString(),
const CursorPosition &cursorPosition = CursorPosition(), const QString &file = QString());
bool execute = true, const QString &shellName = QString(),
const CursorPosition &cursorPosition = CursorPosition(), const QString &file = QString());
void openShell(MongoDatabase *database, const QString &script,
bool execute = true, const QString &shellName = QString(),
const CursorPosition &cursorPosition = CursorPosition(), const QString &filePathToSave = QString());
bool execute = true, const QString &shellName = QString(),
const CursorPosition &cursorPosition = CursorPosition(),
const QString &filePathToSave = QString());
/**
* @brief Open new shell using explorer's MongoServer (ExplorerServerTreeItem's _server)
*/
void openShell(MongoServer* server, ConnectionSettings* connSettings, const ScriptInfo &scriptInfo);
MongoServersContainerType getServers() const { return _servers; };
auto const& getServers() const { return _servers; };
/**
* @brief Closes MongoShell and frees all resources, owned by specified MongoShell.
@@ -83,7 +82,8 @@ namespace Robomongo
*/
void closeShell(MongoShell *shell);
void fireConnectionFailedEvent(int serverHandle, ConnectionType type, std::string errormsg, ConnectionFailedEvent::Reason reason);
void fireConnectionFailedEvent(int serverHandle, ConnectionType type, std::string errormsg,
ConnectionFailedEvent::Reason reason);
int getLastServerHandle() const { return _lastServerHandle; };
@@ -93,8 +93,10 @@ namespace Robomongo
void handle(LogEvent *event);
private:
MongoServer *openServerInternal(ConnectionSettings* connSettings, ConnectionType type);
MongoServer *continueOpenServer(int serverHandle, ConnectionSettings* connSettings, ConnectionType type, int localport = 0);
std::unique_ptr<MongoServer> openServerInternal(ConnectionSettings* connSettings, ConnectionType type);
std::unique_ptr<MongoServer>
continueOpenServer(int serverHandle, ConnectionSettings* connSettings, ConnectionType type, int localport = 0);
/**
* @brief Create prompt dialog to enter SSL PEM key passphrase and save passphrase into SSL settings
@@ -106,12 +108,12 @@ namespace Robomongo
/**
* MongoServers, owned by this App.
*/
MongoServersContainerType _servers;
std::vector<std::unique_ptr<MongoServer>> _servers;
/**
* MongoShells, owned by this App.
*/
MongoShellsContainerType _shells;
std::vector<std::unique_ptr<MongoShell>> _shells;
EventBus *const _bus;
@@ -1,6 +1,6 @@
#include "MongoCollectionInfo.h"
#include "robomongo/core/utils/BsonUtils.h"
#include <mongo/client/dbclientinterface.h>
#include <mongo/client/dbclient_base.h>
namespace Robomongo
{
+1 -5
View File
@@ -109,11 +109,7 @@ namespace Robomongo
void MongoDatabase::handle(LoadCollectionNamesResponse *event)
{
if (event->isError()) {
if (_server->connectionRecord()->isReplicaSet()) // replica set
handleIfReplicaSetUnreachable(event);
else // single server
_bus->publish(new MongoDatabaseCollectionListLoadedEvent(this, event->error()));
_bus->publish(new MongoDatabaseCollectionListLoadedEvent(this, event->error()));
genericEventErrorHandler(event, "Failed to refresh 'Collections'.", _bus, this);
return;
}
+1 -1
View File
@@ -1,6 +1,6 @@
#include "robomongo/core/domain/MongoDocument.h"
#include <mongo/client/dbclientinterface.h>
#include <mongo/client/dbclient_base.h>
#include "robomongo/core/settings/SettingsManager.h"
#include "robomongo/core/AppRegistry.h"
#include "robomongo/core/utils/BsonUtils.h"
+1 -1
View File
@@ -1,6 +1,6 @@
#include "robomongo/core/domain/MongoFunction.h"
#include "robomongo/core/utils/BsonUtils.h"
#include <mongo/client/dbclientinterface.h>
#include <mongo/client/dbclient_base.h>
namespace Robomongo
{
+1 -1
View File
@@ -1,6 +1,6 @@
#include "robomongo/core/domain/MongoQueryInfo.h"
#include <mongo/client/dbclientinterface.h>
#include <mongo/client/dbclient_base.h>
namespace Robomongo
{
+7 -7
View File
@@ -15,7 +15,7 @@
#include "robomongo/core/utils/QtUtils.h"
#include "robomongo/gui/MainWindow.h"
#include "robomongo/utils/common.h"
#include "robomongo/utils/string_operations.h"
#include "robomongo/utils/StringOperations.h"
#include <QApplication>
@@ -247,10 +247,8 @@ namespace Robomongo {
clearDatabases();
for (auto const& dbname : event->databaseNames) {
MongoDatabase *db = new MongoDatabase(this, dbname);
addDatabase(db);
}
for (auto const& dbname : event->databaseNames)
addDatabase(new MongoDatabase(this, dbname));
_bus->publish(new DatabaseListLoadedEvent(this, _databases));
LOG_MSG("Database list refreshed. Connection: " + _connSettings->connectionName(),
@@ -464,7 +462,7 @@ namespace Robomongo {
auto reason = ConnectionFailedEvent::SslConnection;
ss.clear();
ss << "Cannot connect to the MongoDB at " << connectionRecord()->getFullAddress()
<< ".\n\nError:\n" << "SSL connection failure: " << event->error().errorMessage();
<< ".\n\nError:\n" << "TLS connection failure: " << event->error().errorMessage();
_app->fireConnectionFailedEvent(_handle, _connectionType, ss.str(), reason);
}
else
@@ -496,7 +494,9 @@ namespace Robomongo {
if ((mainWindow = qobject_cast<MainWindow*>(wid)))
break;
}
mainWindow->hideQueryWidgetProgressBar();
if(mainWindow)
mainWindow->hideQueryWidgetProgressBar();
}
} // namespace Robomongo
+44 -29
View File
@@ -12,6 +12,8 @@
namespace Robomongo
{
auto const& eventBus = []() { return AppRegistry::instance().bus(); };
MongoShell::MongoShell(MongoServer *server, ScriptInfo scriptInfo) :
QObject(),
_scriptInfo(scriptInfo),
@@ -21,10 +23,9 @@ namespace Robomongo
void MongoShell::open(const std::string &script, const std::string &dbName)
{
auto const& bus = AppRegistry::instance().bus();
bus->publish(new ScriptExecutingEvent(this));
eventBus()->publish(new ScriptExecutingEvent(this));
_scriptInfo.setScript(QtUtils::toQString(script));
bus->send(_server->worker(), new ExecuteScriptRequest(this, query(), dbName));
eventBus()->send(_server->worker(), new ExecuteScriptRequest(this, query(), dbName));
LOG_MSG(_scriptInfo.script(), mongo::logger::LogSeverity::Info());
}
@@ -33,14 +34,15 @@ namespace Robomongo
return QtUtils::toStdString(_scriptInfo.script());
}
void MongoShell::execute(const std::string &script /* = "" */, const std::string &dbName /* = "" */)
void MongoShell::execute(const std::string &script /* = "" */,
const std::string &dbName /* = "" */)
{
if (!_scriptInfo.execute())
return;
std::string const finalScript = script.empty() ? query() : script;
AppRegistry::instance().bus()->publish(new ScriptExecutingEvent(this));
AppRegistry::instance().bus()->send(_server->worker(),
eventBus()->publish(new ScriptExecutingEvent(this));
eventBus()->send(_server->worker(),
new ExecuteScriptRequest(this, finalScript, dbName, _aggrInfo));
if (!_scriptInfo.script().isEmpty())
LOG_MSG(_scriptInfo.script(), mongo::logger::LogSeverity::Info());
@@ -48,15 +50,20 @@ namespace Robomongo
void MongoShell::query(int resultIndex, const MongoQueryInfo &info)
{
AppRegistry::instance().bus()->send(_server->worker(), new ExecuteQueryRequest(this, resultIndex, info));
eventBus()->send(_server->worker(), new ExecuteQueryRequest(this, resultIndex, info));
}
void MongoShell::autocomplete(const std::string &prefix)
{
AutocompletionMode autocompletionMode = AppRegistry::instance().settingsManager()->autocompletionMode();
AutocompletionMode autocompletionMode {
AppRegistry::instance().settingsManager()->autocompletionMode()
};
if (autocompletionMode == AutocompleteNone)
return;
AppRegistry::instance().bus()->send(_server->worker(), new AutocompleteRequest(this, prefix, autocompletionMode));
eventBus()->send(_server->worker(),
new AutocompleteRequest(this, prefix, autocompletionMode)
);
}
void MongoShell::stop()
@@ -83,42 +90,50 @@ namespace Robomongo
void MongoShell::handle(ExecuteQueryResponse *event)
{
if (event->isError()) {
AppRegistry::instance().bus()->publish(new DocumentListLoadedEvent(this, event->error()));
eventBus()->publish(new DocumentListLoadedEvent(this, event->error()));
return;
}
AppRegistry::instance().bus()->publish(new DocumentListLoadedEvent(this, event->resultIndex, event->queryInfo, query(), event->documents));
eventBus()->publish(
new DocumentListLoadedEvent(this,
event->resultIndex, event->queryInfo, query(), event->documents)
);
}
void MongoShell::handle(ExecuteScriptResponse *event)
{
if (event->isError()) {
if (_server->connectionRecord()->isReplicaSet()) {
AppRegistry::instance().bus()->publish(
new ReplicaSetRefreshed(this, event->error(), event->error().replicaSetInfo()));
AppRegistry::instance().bus()->publish(
new ScriptExecutedEvent(this, event->error(), event->timeoutReached()));
return;
}
else { // single server
AppRegistry::instance().bus()->publish(
new ScriptExecutedEvent(this, event->error(), event->timeoutReached()));
return;
}
if (!event->isError()) {
eventBus()->publish(
new ScriptExecutedEvent(this, event->result, event->empty, event->timeoutReached())
);
return;
}
AppRegistry::instance().bus()->publish(new ScriptExecutedEvent(this, event->result, event->empty,
event->timeoutReached()));
if (_server->connectionRecord()->isReplicaSet()) {
eventBus()->publish(
new ReplicaSetRefreshed(this, event->error(), event->error().replicaSetInfo())
);
eventBus()->publish(
new ScriptExecutedEvent(this, event->error(), event->timeoutReached())
);
return;
}
else { // single server
eventBus()->publish(
new ScriptExecutedEvent(this, event->error(), event->timeoutReached())
);
return;
}
}
void MongoShell::handle(AutocompleteResponse *event)
{
if (event->isError()) {
AppRegistry::instance().bus()->publish(new AutocompleteResponse(this, event->error()));
eventBus()->publish(new AutocompleteResponse(this, event->error()));
return;
}
AppRegistry::instance().bus()->publish(new AutocompleteResponse(this, event->list, event->prefix));
eventBus()->publish(new AutocompleteResponse(this, event->list, event->prefix));
}
}
+1 -1
View File
@@ -27,7 +27,7 @@ namespace Robomongo
std::string dbname() const { return _scriptInfo.dbname(); }
const CursorPosition &cursor() const { return _scriptInfo.cursor(); }
void setScript(const QString &script) { return _scriptInfo.setScript(script); }
void setScriptExecutable(bool execute) { return _scriptInfo.setExecutable(execute); }
void setScriptExecutable(bool execute) { _scriptInfo.setExecutable(execute); }
void setAggrInfo(AggrInfo const& aggrInfo) { _aggrInfo = aggrInfo; }
QString filePath() const { return _scriptInfo.filePath(); }
@@ -1,28 +0,0 @@
#include "robomongo/core/domain/MongoShellResult.h"
namespace Robomongo
{
MongoShellResult::MongoShellResult(const std::string &type, const std::string &response,
const MongoDocumentPtrContainerType &documents,
const MongoQueryInfo &queryInfo, qint64 elapsedms,
AggrInfo aggrInfo /*= AggrInfo()*/) :
_type(type),
_response(response),
_documents(documents),
_queryInfo(queryInfo),
_elapsedms(elapsedms),
_aggrInfo(aggrInfo)
{ }
MongoShellExecResult::MongoShellExecResult(const std::vector<MongoShellResult> &results,
const std::string &currentServer, bool isCurrentServerValid,
const std::string &currentDatabase, bool isCurrentDatabaseValid,
bool timeoutReached /* = false */) :
_results(results),
_currentServer(currentServer),
_currentDatabase(currentDatabase),
_isCurrentServerValid(isCurrentServerValid),
_isCurrentDatabaseValid(isCurrentDatabaseValid),
_timeoutReached(timeoutReached)
{ }
}
+38 -11
View File
@@ -5,40 +5,67 @@
namespace Robomongo
{
/* -------------- MongoShellResult Class --------- */
class MongoShellResult
{
public:
typedef std::vector<MongoDocumentPtr> MongoDocumentPtrContainerType;
MongoShellResult(const std::string &type, const std::string &response,
const MongoDocumentPtrContainerType &documents,
const MongoQueryInfo &queryInfo, qint64 elapsedms,
AggrInfo aggrInfo = AggrInfo());
MongoShellResult(
const std::string &type, const std::string &response,
const std::vector<MongoDocumentPtr> &documents,
const MongoQueryInfo &queryInfo, const std::string &statement,
qint64 elapsedms, AggrInfo aggrInfo = AggrInfo()) :
_type(type),
_response(response),
_documents(documents),
_queryInfo(queryInfo),
_statement(statement),
_elapsedms(elapsedms),
_aggrInfo(aggrInfo)
{ }
std::string response() const { return _response; }
std::string type() const { return _type; }
MongoDocumentPtrContainerType documents() const { return _documents; }
std::vector<MongoDocumentPtr> documents() const { return _documents; }
MongoQueryInfo queryInfo() const { return _queryInfo; }
std::string statement() const { return _statement; }
std::string statementShort() const {
std::size_t const LEN = _statement.size() < 10 ? _statement.size() : 10;
std::string statementShort { _statement, 0, LEN };
statementShort.append((_statement.size() > 10) ? ".." : "");
return statementShort;
}
qint64 elapsedMs() const { return _elapsedms; }
AggrInfo const& aggrInfo() const { return _aggrInfo; }
private:
std::string _type;
std::string _response;
MongoDocumentPtrContainerType _documents;
std::vector<MongoDocumentPtr> _documents;
MongoQueryInfo _queryInfo;
std::string const _statement;
qint64 _elapsedms;
AggrInfo _aggrInfo = AggrInfo();
};
/* -------------- MongoShellExecResult Class --------- */
class MongoShellExecResult
{
public:
MongoShellExecResult() { }
MongoShellExecResult(const std::vector<MongoShellResult> &results,
const std::string &currentServer, bool isCurrentServerValid,
const std::string &currentDatabase, bool isCurrentDatabaseValid,
bool timeoutReached = false);
MongoShellExecResult(
const std::vector<MongoShellResult> &results,
const std::string &currentServer, bool isCurrentServerValid,
const std::string &currentDatabase, bool isCurrentDatabaseValid,
bool timeoutReached = false) :
_results(results),
_currentServer(currentServer),
_currentDatabase(currentDatabase),
_isCurrentServerValid(isCurrentServerValid),
_isCurrentDatabaseValid(isCurrentDatabaseValid),
_timeoutReached(timeoutReached)
{ }
MongoShellExecResult(bool error, std::string const& errorMsg = "", bool timeoutReached = false) :
_error(error), _errorMessage(errorMsg), _timeoutReached(timeoutReached) { }
-20
View File
@@ -1,20 +0,0 @@
#include "robomongo/core/domain/MongoUser.h"
#include <mongo/client/dbclientinterface.h>
#include "robomongo/core/utils/BsonUtils.h"
namespace Robomongo
{
const float MongoUser::minimumSupportedVersion = 2.4f;
MongoUser::MongoUser(const float version, const mongo::BSONObj &obj) :
_version(version), _readOnly(false)
{
// _id = obj.getField("_id"); // todo
_name = BsonUtils::getField<mongo::String>(obj, "user");
}
MongoUser::MongoUser(const float version) :
_version(version), _readOnly(false), _role() {}
}
+16 -16
View File
@@ -2,30 +2,31 @@
#include <mongo/bson/bsonobj.h>
#include <mongo/bson/bsonelement.h>
#include "robomongo/core/utils/BsonUtils.h"
namespace Robomongo
{
class MongoUser
{
public:
typedef std::vector<std::string> RoleType;
/**
* @brief Creates user from "system.users" document
*/
explicit MongoUser(const float version, const mongo::BSONObj &obj);
typedef std::vector<std::string> RolesVector;
/**
* @brief Creates new user with empty attributes
*/
MongoUser(const float version);
explicit MongoUser(const float version, const mongo::BSONObj &obj) :
_version(version), _readOnly(false),
_name(BsonUtils::getField<mongo::String>(obj, "user"))
{};
// Creates new user with empty attributes
MongoUser(const float version) :
_version(version), _readOnly(false), _roles() {}
std::string id() const { return _id; }
std::string name() const { return _name; }
std::string password() const { return _password; }
RoleType role() const { return _role; }
std::vector<std::string> roles() const { return _roles; }
void setName(const std::string &name) { _name = name; }
void setPassword(const std::string &pwd) { _password = pwd; }
void setRole(const RoleType &role) { _role = role; }
void setRoles(const std::vector<std::string> &roles) { _roles = roles; }
std::string userSource() const { return _userSource; }
void setUserSource(const std::string &source) { _userSource = source; }
@@ -33,14 +34,13 @@ namespace Robomongo
void setReadOnly(bool readonly) { _readOnly = readonly; }
float version() const { return _version; }
static const float minimumSupportedVersion;
static constexpr float minimumSupportedVersion = 2.4f;
private:
float _version;
std::string _name;
bool _readOnly;
RoleType _role;
RolesVector _roles;
std::string _password;
std::string _id;
std::string _userSource;
};
}
}
+34 -39
View File
@@ -24,12 +24,14 @@
#include <mongo/shell/shell_utils.h>
#include <mongo/base/string_data.h>
#include <mongo/client/dbclientinterface.h>
#include <mongo/client/dbclient_base.h>
#include <pcrecpp.h>
#include "robomongo/core/events/MongoEvents.h"
#include "robomongo/core/settings/ConnectionSettings.h"
#include "robomongo/core/settings/CredentialSettings.h"
#include "robomongo/core/domain/MongoDocument.h"
#include "robomongo/core/utils/Logger.h"
#include "robomongo/core/utils/QtUtils.h"
namespace
@@ -91,8 +93,7 @@ namespace Robomongo
<< _connection->primaryCredential()->userPassword() << "')";
{
mongo::shell_utils::_dbConnect = ss.str();
mongo::shell_utils::_dbAuth = "(function() { \nDB.prototype._defaultGssapiServiceName = \"mongodb\";\n}())";
mongo::shell_utils::dbConnect = ss.str();
// v0.9
// mongo::isShell = true;
@@ -125,6 +126,10 @@ namespace Robomongo
std::string esprima = loadFile(":/robomongo/scripts/esprima.js", true);
_scope->exec(esprima, "(esprima)", false, true, true);
// UUID helpers
std::string uuidhelpers = loadFile(":/robomongo/scripts/uuidhelpers.js", true);
_scope->exec(uuidhelpers, "(uuidhelpers)", false, true, true);
// Enable verbose shell reporting
_scope->exec("_verboseShell = true;", "(verboseShell)", false, false, false);
@@ -194,17 +199,14 @@ namespace Robomongo
std::string error;
bool result = statementize(stdstr, statements, error);
if (!result && statements.size() == 0) {
if (!result && statements.size() == 0)
statements.push_back("print(__robomongoResult.error)");
}
std::vector<MongoShellResult> results;
use(dbName);
for (std::vector<std::string>::const_iterator it = statements.begin(); it != statements.end(); ++it)
{
std::string statement = *it;
for (auto const& statement : statements) {
// clear global objects
__objects.clear();
__type = "";
@@ -365,7 +367,6 @@ namespace Robomongo
;
_scope->exec(script, "(getresultinfo)", false, false, false);
bool const isQuery = _scope->getBoolean("__robomongoQuery");
bool const isAggregate = _scope->getBoolean("__robomongoIsAggregate");
@@ -384,9 +385,9 @@ namespace Robomongo
bool special = _scope->getBoolean("__robomongoSpecial");
MongoQueryInfo info = MongoQueryInfo(CollectionInfo(serverAddress, dbName, collectionName),
query, fields, limit, skip, batchSize, options, special);
return MongoShellResult(type, output, objects, info, elapsedms);
MongoQueryInfo const info{ CollectionInfo(serverAddress, dbName, collectionName),
query, fields, limit, skip, batchSize, options, special };
return MongoShellResult(type, output, objects, info, statement, elapsedms);
}
else if (isAggregate) {
std::string const serverAddress = getString("__robomongoServerAddress");
@@ -403,10 +404,9 @@ namespace Robomongo
int const resultIndex = aggrInfo.isValid ? aggrInfo.resultIndex : -1;
AggrInfo const newAggrInfo { collectionName, skip, batchSize, origPipeline, options, resultIndex };
return MongoShellResult(type, output, objects, MongoQueryInfo(), elapsedms, newAggrInfo);
return MongoShellResult(type, output, objects, MongoQueryInfo(), statement, elapsedms, newAggrInfo);
}
return MongoShellResult(type, output, objects, MongoQueryInfo(), elapsedms);
return MongoShellResult(type, output, objects, MongoQueryInfo(), statement, elapsedms);
}
MongoShellExecResult ScriptEngine::prepareExecResult(const std::vector<MongoShellResult> &results,
@@ -440,12 +440,12 @@ namespace Robomongo
return _scope->getString(fieldName);
}
bool ScriptEngine::statementize(const std::string &script, std::vector<std::string> &outList, std::string &outError)
bool ScriptEngine::statementize(
const std::string &script, std::vector<std::string> &outVec, std::string &outError)
{
QString qScript = QtUtils::toQString(script);
_scope->setString("__robomongoEsprima", script.c_str());
mongo::StringData data(
mongo::StringData const data {
"var __robomongoResult = {};"
"try {"
"__robomongoResult.result = esprima.parse(__robomongoEsprima, { range: true, loc : true });"
@@ -453,36 +453,31 @@ namespace Robomongo
"__robomongoResult.error = e.name + ': ' + e.message;"
"}"
"__robomongoResult;"
);
};
bool res2 = _scope->exec(data, "(esprima2)", false, true, false);
mongo::BSONObj obj = _scope->getObject("__lastres__");
if(!_scope->exec(data, "(esprima2)", false, true, false)) {
sendLog(this, LogEvent::RBM_ERROR, "ScriptEngine: Scope failed. Resetting scope.");
_scope->reset();
sendLog(this, LogEvent::RBM_INFO, "ScriptEngine: Scope reset complete.");
_scope->exec(data, "(esprima2)", false, true, false);
}
mongo::BSONObj const obj = _scope->getObject("__lastres__");
if (obj.hasField("error")) {
outError = obj.getField("error");
return false;
}
mongo::BSONObj result = obj.getField("result").Obj();
std::vector<mongo::BSONElement> v = result.getField("body").Array();
for (std::vector<mongo::BSONElement>::iterator it = v.begin(); it != v.end(); ++it)
for (auto const& bsonElem : obj.getField("result").Obj().getField("body").Array())
{
mongo::BSONObj item = (*it).Obj();
mongo::BSONObj loc = item.getField("loc").Obj();
mongo::BSONObj start = loc.getField("start").Obj();
mongo::BSONObj end = loc.getField("end").Obj();
mongo::BSONObj const item = bsonElem.Obj();
std::vector<mongo::BSONElement> const range = item.getField("range").Array();
auto const from = static_cast<int>(range.at(0).number());
auto const till = static_cast<int>(range.at(1).number());
int startLine = start.getIntField("line");
int startColumn = start.getIntField("column");
int endLine = end.getIntField("line");
int endColumn = end.getIntField("column");
std::vector<mongo::BSONElement> range = item.getField("range").Array();
int from = (int) range.at(0).number();
int till = (int) range.at(1).number();
std::string statement = QtUtils::toStdString(qScript.mid(from, till - from));
outList.push_back(statement);
QString const qScript = QtUtils::toQString(script);
std::string statement = qScript.mid(from, till - from).toStdString();
outVec.push_back(statement);
}
return true;
+8 -5
View File
@@ -1,5 +1,6 @@
#pragma once
#include <QObject>
#include <QMutex>
#include <mongo/scripting/engine.h>
//#include <third_party/js-1.7/jsparse.h>
@@ -11,8 +12,9 @@ namespace Robomongo
{
class ConnectionSettings;
class ScriptEngine
class ScriptEngine : public QObject
{
Q_OBJECT
public:
ScriptEngine(ConnectionSettings *connection, int timeoutSec);
@@ -41,16 +43,17 @@ namespace Robomongo
const std::vector<MongoDocumentPtr> &objects, qint64 elapsedms,
const std::string &statement, AggrInfo aggrInfo = AggrInfo());
MongoShellExecResult prepareExecResult(const std::vector<MongoShellResult> &results,
bool timeoutReached = false);
MongoShellExecResult prepareExecResult(
const std::vector<MongoShellResult> &results, bool timeoutReached = false);
std::string loadFile(const QString &path, bool throwOnError);
std::string getString(const char *fieldName);
bool statementize(const std::string &script, std::vector<std::string> &outList, std::string &outError);
bool statementize(
const std::string &script, std::vector<std::string> &outVec, std::string &outError);
int _timeoutSec;
mongo::ScriptEngine *_engine;
std::unique_ptr<mongo::Scope> _scope;
std::unique_ptr<mongo::Scope> _scope; // MozJSProxyScope
bool _failedScope = false;
QMutex _mutex;
bool _initialized;
+3 -3
View File
@@ -17,10 +17,10 @@ namespace Robomongo
R_REGISTER_EVENT(LoadUsersRequest)
R_REGISTER_EVENT(LoadCollectionIndexesRequest)
R_REGISTER_EVENT(LoadCollectionIndexesResponse)
R_REGISTER_EVENT(EnsureIndexRequest)
R_REGISTER_EVENT(AddEditIndexRequest)
R_REGISTER_EVENT(AddEditIndexResponse)
R_REGISTER_EVENT(DropCollectionIndexRequest)
R_REGISTER_EVENT(DeleteCollectionIndexResponse)
R_REGISTER_EVENT(EditIndexRequest)
R_REGISTER_EVENT(DropCollectionIndexResponse)
R_REGISTER_EVENT(LoadUsersResponse)
R_REGISTER_EVENT(LoadFunctionsRequest)
R_REGISTER_EVENT(LoadFunctionsResponse)
+79 -40
View File
@@ -1,9 +1,10 @@
#pragma once
#include <QMessageBox>
#include <QString>
#include <QStringList>
#include <QEvent>
#include <mongo/client/dbclientinterface.h>
#include <mongo/client/dbclient_base.h>
#include "robomongo/core/domain/MongoShellResult.h"
#include "robomongo/core/domain/CursorPosition.h"
@@ -224,58 +225,80 @@ namespace Robomongo
{
R_EVENT
public:
LoadCollectionIndexesResponse(QObject *sender, const std::vector<EnsureIndexInfo> &indexes) :
LoadCollectionIndexesResponse(QObject *sender, const std::vector<IndexInfo> &indexes) :
Event(sender), _indexes(indexes) {}
LoadCollectionIndexesResponse(QObject *sender, const EventError &error) :
Event(sender, error) {}
std::vector<EnsureIndexInfo> indexes() const { return _indexes; }
std::vector<IndexInfo> indexes() const { return _indexes; }
private:
std::vector<EnsureIndexInfo> _indexes;
std::vector<IndexInfo> _indexes;
};
class EnsureIndexRequest : public Event
class AddEditIndexRequest : public Event
{
R_EVENT
EnsureIndexRequest(QObject *sender, const EnsureIndexInfo &oldInfo, const EnsureIndexInfo &newInfo) : Robomongo::Event(sender), oldInfo_(oldInfo), newInfo_(newInfo) {}
const EnsureIndexInfo &oldInfo() const
AddEditIndexRequest(QObject *sender, const IndexInfo &oldInfo, const IndexInfo &newInfo)
: Robomongo::Event(sender), oldInfo_(oldInfo), newInfo_(newInfo) {}
const IndexInfo &oldInfo() const
{
return oldInfo_;
}
const EnsureIndexInfo &newInfo() const
const IndexInfo &newInfo() const
{
return newInfo_;
}
private:
const EnsureIndexInfo oldInfo_;
const EnsureIndexInfo newInfo_;
const IndexInfo oldInfo_;
const IndexInfo newInfo_;
};
struct AddEditIndexResponse : public Event
{
R_EVENT
AddEditIndexResponse(QObject *sender, const IndexInfo &oldIndex, const IndexInfo &newIndex)
: Event(sender), oldIndex_(oldIndex), newIndex_(newIndex)
{}
AddEditIndexResponse(QObject *sender, const EventError &error,
const IndexInfo &oldIndex, const IndexInfo &newIndex)
: Event(sender, error), oldIndex_(oldIndex), newIndex_(newIndex)
{}
const IndexInfo oldIndex_;
const IndexInfo newIndex_;
};
class DropCollectionIndexRequest : public Event
{
R_EVENT
public:
DropCollectionIndexRequest(QObject *sender, const MongoCollectionInfo &collection, const std::string &name) :
Event(sender),
_collection(collection),
_name(name) {}
DropCollectionIndexRequest(QObject *sender, const MongoCollectionInfo &collection,
const std::string &index)
: Event(sender), _collection(collection), _index(index)
{}
MongoCollectionInfo collection() const { return _collection; }
std::string name() const { return _name; }
std::string index() const { return _index; }
private:
const MongoCollectionInfo _collection;
std::string _name;
std::string _index; // todo: rename to index
};
class DeleteCollectionIndexResponse: public Event
class DropCollectionIndexResponse: public Event
{
R_EVENT
public:
DeleteCollectionIndexResponse(QObject *sender, const MongoCollectionInfo &collection, const std::string &index) :
Event(sender), _collection(collection), _index(index) {}
DropCollectionIndexResponse(QObject *sender, const MongoCollectionInfo &collection,
const std::string &index)
: Event(sender), _collection(collection), _index(index)
{}
DeleteCollectionIndexResponse(QObject *sender, const EventError &error) :
Event(sender, error) {}
DropCollectionIndexResponse(QObject *sender, const EventError &error,
const std::string &index)
: Event(sender, error), _index(index)
{}
MongoCollectionInfo collection() const { return _collection; }
std::string index() const { return _index; }
@@ -284,21 +307,6 @@ namespace Robomongo
std::string _index;
};
class EditIndexRequest : public Event
{
R_EVENT
public:
EditIndexRequest(QObject *sender, const MongoCollectionInfo &collection, const std::string &oldIndex, const std::string &newIndex) :
Event(sender), _collection(collection), _oldIndex(oldIndex), _newIndex(newIndex) {}
MongoCollectionInfo collection() const { return _collection; }
std::string oldIndex() const { return _oldIndex; }
std::string newIndex() const { return _newIndex; }
private:
const MongoCollectionInfo _collection;
std::string _oldIndex;
std::string _newIndex;
};
/**
* @brief Load Users
*/
@@ -1247,13 +1255,44 @@ namespace Robomongo
RBM_DEBUG = 100 // log as much as possible
};
LogEvent(QObject *sender, const std::string& message, LogLevel level) :
Event(sender),
message(message),
level(level) {}
LogEvent(QObject *sender, const std::string& message, LogLevel level,
bool const informUser = false)
: Event(sender), message(message), level(level), informUser(informUser)
{}
std::string severity() const {
switch (level) {
case RBM_ERROR : return "Error";
case RBM_WARN : return "Warning";
case RBM_INFO : return "Info";
case RBM_DEBUG : return "Debug";
default: return "Undefined";
}
}
QMessageBox::Icon qMessageBoxIcon() const {
switch (level) {
case RBM_ERROR: return QMessageBox::Icon::Critical;
case RBM_WARN: return QMessageBox::Icon::Warning;
case RBM_INFO: return QMessageBox::Icon::Information;
case RBM_DEBUG: return QMessageBox::Icon::Information;
default: return QMessageBox::Icon::Information;
}
}
mongo::logger::LogSeverity mongoLogSeverity() const {
switch (level) {
case RBM_ERROR: return mongo::logger::LogSeverity::Error();
case RBM_WARN: return mongo::logger::LogSeverity::Warning();
case RBM_INFO: return mongo::logger::LogSeverity::Info();
case RBM_DEBUG: return mongo::logger::LogSeverity::Log();
default: return mongo::logger::LogSeverity::Info();
}
}
std::string message;
LogLevel level;
bool const informUser = false;
};
class StopScriptRequest : public Event
@@ -2,15 +2,15 @@
namespace Robomongo
{
EnsureIndexInfo::EnsureIndexInfo(const MongoCollectionInfo &collection, const std::string &name, const std::string &request,
bool isUnique, bool isBackGround, bool isDropDuplicates, bool isSparce, int expireAfter,
IndexInfo::IndexInfo(
const MongoCollectionInfo &collection, const std::string &name, const std::string &keys,
bool isUnique, bool isBackGround, bool isSparce, int expireAfter,
const std::string &defaultLanguage, const std::string &languageOverride, const std::string &textWeights) :
_name(name),
_collection(collection),
_request(request),
_keys(keys),
_unique(isUnique),
_backGround(isBackGround),
_dropDups(isDropDuplicates),
_sparse(isSparce),
_ttl(expireAfter),
_defaultLanguage(defaultLanguage),
+3 -5
View File
@@ -4,15 +4,14 @@
namespace Robomongo
{
struct EnsureIndexInfo
struct IndexInfo
{
EnsureIndexInfo(
IndexInfo(
const MongoCollectionInfo &collection,
const std::string &name = std::string(),
const std::string &request = std::string(),
bool isUnique = false,
bool isBackGround = false,
bool isDropDuplicates = false,
bool isSparce = false,
int expireAfter = -1,
const std::string &defaultLanguage = std::string(),
@@ -21,10 +20,9 @@ namespace Robomongo
MongoCollectionInfo _collection;
std::string _name;
std::string _request;
std::string _keys;
bool _unique;
bool _backGround;
bool _dropDups;
bool _sparse;
int _ttl;
std::string _defaultLanguage;
+103 -114
View File
@@ -8,20 +8,19 @@
namespace
{
Robomongo::EnsureIndexInfo makeEnsureIndexInfoFromBsonObj(
Robomongo::IndexInfo makeIndexInfoFromBsonObj(
const Robomongo::MongoCollectionInfo &collection,
const mongo::BSONObj &obj)
{
using namespace Robomongo::BsonUtils;
Robomongo::EnsureIndexInfo info(collection);
Robomongo::IndexInfo info(collection);
info._name = obj.getStringField("name");
mongo::BSONObj keyObj = obj.getObjectField("key");
if (keyObj.isValid())
info._request = jsonString(keyObj, mongo::TenGen, 1, Robomongo::DefaultEncoding, Robomongo::Utc);
info._keys = jsonString(keyObj, mongo::TenGen, 1, Robomongo::DefaultEncoding, Robomongo::Utc);
info._unique = obj.getBoolField("unique");
info._backGround = obj.getBoolField("background");
info._dropDups = obj.getBoolField("dropDups");
info._sparse = obj.getBoolField("sparse");
info._ttl = obj.getIntField("expireAfterSeconds");
info._defaultLanguage = obj.getStringField("default_language");
@@ -99,7 +98,7 @@ namespace Robomongo
if (errStr.empty())
errStr = "Failed to get error message.";
throw std::runtime_error(errStr/*, 0*/);
throw std::runtime_error(errStr);
}
std::vector<MongoUser> users;
@@ -116,7 +115,7 @@ namespace Robomongo
cmd.append("pwd", user.password());
mongo::BSONArrayBuilder roles;
auto const& rolesStrs = user.role();
auto const& rolesStrs = user.roles();
for (auto const& roleStr : rolesStrs) {
mongo::BSONObjBuilder role;
role.append("role", roleStr).append("db", user.userSource());
@@ -130,7 +129,7 @@ namespace Robomongo
if (errStr.empty())
errStr = "Failed to get error message.";
throw std::runtime_error(errStr/*, 0*/);
throw std::runtime_error(errStr);
}
}
@@ -149,16 +148,16 @@ namespace Robomongo
}
}
std::vector<MongoFunction> MongoClient::getFunctions(const std::string &dbName)
std::vector<MongoFunction> MongoClient::getFunctions(const std::string &dbName) const
{
MongoNamespace ns(dbName, "system.js");
std::vector<MongoFunction> functions;
std::unique_ptr<mongo::DBClientCursor> cursor(_dbclient->query(ns.toString(), mongo::Query().sort("_id")));
std::unique_ptr<mongo::DBClientCursor> cursor(
_dbclient->query(mongo::NamespaceString(dbName, "system.js"), mongo::Query().sort("_id")));
// Cursor may be NULL, it means we have connectivity problem
if (!cursor)
throw std::runtime_error("Network error while attempting to load list of functions."/*, 0*/);
throw std::runtime_error("Network error while attempting to load list of functions.");
while (cursor->more()) {
mongo::BSONObj bsonObj = cursor->next();
@@ -172,87 +171,77 @@ namespace Robomongo
return functions;
}
std::vector<EnsureIndexInfo> MongoClient::getIndexes(const MongoCollectionInfo &collection) const
std::vector<IndexInfo> MongoClient::getIndexes(const MongoCollectionInfo &collection) const
{
std::vector<EnsureIndexInfo> result;
std::vector<IndexInfo> result;
std::list<mongo::BSONObj> indexes = _dbclient->getIndexSpecs(collection.ns().toString());
for (std::list<mongo::BSONObj>::iterator it = indexes.begin(); it != indexes.end(); ++it) {
mongo::BSONObj bsonObj = *it;
result.push_back(makeEnsureIndexInfoFromBsonObj(collection, bsonObj));
result.push_back(makeIndexInfoFromBsonObj(collection, bsonObj));
}
return result;
}
void MongoClient::ensureIndex(const EnsureIndexInfo &oldInfo, const EnsureIndexInfo &newInfo) const
void MongoClient::addEditIndex(const IndexInfo &oldInfo, const IndexInfo &newInfo) const
{
std::string ns = newInfo._collection.ns().toString();
bool const editIndex = !oldInfo._name.empty();
// v0.9
// mongo::BSONObj keys = mongo::Robomongo::fromjson(newInfo._request);
mongo::BSONObj keys = mongo::Robomongo::fromjson(newInfo._request);
mongo::BSONObjBuilder toSave;
bool cache = true;
int version = -1;
toSave.append( "ns" , ns );
toSave.append( "key" , keys );
std::string cacheKey(ns);
cacheKey += "--";
if ( newInfo._name != "" ) {
toSave.append( "name" , newInfo._name );
cacheKey += newInfo._name;
}
else {
std::string nn = _dbclient->genIndexName(keys);
toSave.append( "name" , nn );
cacheKey += nn;
}
if (version >= 0)
toSave.append("v", version);
if (oldInfo._unique != newInfo._unique)
toSave.appendBool("unique", newInfo._unique);
if (oldInfo._backGround != newInfo._backGround)
toSave.appendBool("background", newInfo._backGround);
if (oldInfo._dropDups != newInfo._dropDups)
toSave.appendBool("dropDups", newInfo._dropDups);
if (oldInfo._sparse != newInfo._sparse)
toSave.appendBool("sparse", newInfo._sparse);
if (oldInfo._defaultLanguage != newInfo._defaultLanguage)
toSave.append("default_language", newInfo._defaultLanguage);
if (oldInfo._languageOverride != newInfo._languageOverride)
toSave.append("language_override", newInfo._languageOverride);
if (oldInfo._textWeights != newInfo._textWeights)
toSave.append("weights", newInfo._textWeights);
/* if ( _seenIndexes.count( cacheKey ) )
return 0;
if ( cache )
_seenIndexes.insert( cacheKey );*/
if (oldInfo._ttl != newInfo._ttl)
toSave.append("expireAfterSeconds", newInfo._ttl);
MongoNamespace namesp(newInfo._collection.ns().databaseName(), "system.indexes");
mongo::BSONObj obj = toSave.obj();
if (!oldInfo._name.empty())
// 1.Step: Drop Index (if this is an Edit Index action).
// MongoDB docs: To modify an existing index, you need to drop and recreate the index.
std::string const ns = newInfo._collection.ns().toString();
if (editIndex)
_dbclient->dropIndex(ns, oldInfo._name);
_dbclient->insert(namesp.toString().c_str(), obj);
// 2.Step: Add/Edit Index
auto const createIndexSpec = [](IndexInfo const& indexInfo) {
mongo::IndexSpec indexSpec;
indexSpec.name(indexInfo._name);
indexSpec.addKeys(mongo::Robomongo::fromjson(indexInfo._keys));
mongo::BSONObjBuilder optionsBuilder;
auto const addIfTrue = [&](auto const& keyValuePair) {
if (keyValuePair.second)
optionsBuilder.appendBool(keyValuePair.first, true);
};
addIfTrue(std::pair{ "unique", indexInfo._unique });
addIfTrue(std::pair{ "background", indexInfo._backGround });
addIfTrue(std::pair{ "sparse", indexInfo._sparse });
if (!indexInfo._defaultLanguage.empty())
optionsBuilder.append("default_language", indexInfo._defaultLanguage);
if (!indexInfo._languageOverride.empty())
optionsBuilder.append("language_override", indexInfo._languageOverride);
if (!mongo::Robomongo::fromjson(indexInfo._textWeights).isEmpty())
optionsBuilder.append("weights", mongo::Robomongo::fromjson(indexInfo._textWeights));
if (indexInfo._ttl > 0)
optionsBuilder.append("expireAfterSeconds", indexInfo._ttl);
indexSpec.addOptions(optionsBuilder.obj());
return indexSpec;
};
try {
_dbclient->createIndex(ns, createIndexSpec(newInfo));
}
catch (std::exception const& /*ex*/) { // Logging of "ex" is done in upper scope
if (editIndex) {
// If we are here, index that is being edited, must have already been dropped and
// creation of new index failed. So, we try to at least recover the dropped (old) index
_dbclient->createIndex(ns, createIndexSpec(oldInfo));
}
throw;
}
std::string const errorStr = _dbclient->getLastError();
if (!errorStr.empty())
throw std::runtime_error(errorStr);
}
void MongoClient::renameIndexFromCollection(const MongoCollectionInfo &collection, const std::string &oldIndexName, const std::string &newIndexName) const
@@ -330,7 +319,7 @@ namespace Robomongo
_dbclient->update(ns.toString(), query, obj, true, false);
std::string errorStr = _dbclient->getLastError();
if (!errorStr.empty())
throw std::runtime_error(errorStr/*, 0*/);
throw std::runtime_error(errorStr);
} else { // update function name (remove & insert)
_dbclient->insert(ns.toString(), obj);
std::string errorStr = _dbclient->getLastError();
@@ -344,7 +333,7 @@ namespace Robomongo
_dbclient->remove(ns.toString(), query, true);
}
else {
throw std::runtime_error(errorStr/*, 0*/);
throw std::runtime_error(errorStr);
}
}
}
@@ -362,7 +351,7 @@ namespace Robomongo
_dbclient->remove(ns.toString(), query, true);
std::string errorStr = _dbclient->getLastError();
if (!errorStr.empty())
throw std::runtime_error(errorStr/*, 0*/);
throw std::runtime_error(errorStr);
}
void MongoClient::createDatabase(const std::string &dbName)
@@ -376,7 +365,7 @@ namespace Robomongo
// If <dbName>.temp already exists, stop.
if (_dbclient->exists(ns.toString()))
throw std::runtime_error(dbName + ".temp already exists."/*, 0*/);
throw std::runtime_error(dbName + ".temp already exists.");
// Building { _id : "temp" } document
mongo::BSONObjBuilder builder;
@@ -387,7 +376,7 @@ namespace Robomongo
_dbclient->insert(ns.toString(), obj);
std::string errorStr = _dbclient->getLastError();
if (!errorStr.empty())
throw std::runtime_error(errorStr/*, 0*/);
throw std::runtime_error(errorStr);
// Drop temp collection
_dbclient->dropCollection(ns.toString());
@@ -401,7 +390,7 @@ namespace Robomongo
if (errStr.empty())
errStr = "Failed to get error message.";
throw std::runtime_error(errStr/*, 0*/);
throw std::runtime_error(errStr);
}
}
@@ -433,11 +422,11 @@ namespace Robomongo
if (errStr.empty())
errStr = "Failed to get error message.";
throw std::runtime_error(errStr/*, 0*/);
throw std::runtime_error(errStr);
}
}
else {
throw std::runtime_error("Collection with same name already exists."/*, 0*/);
throw std::runtime_error("Collection with same name already exists.");
}
}
@@ -457,14 +446,13 @@ namespace Robomongo
if (errStr.empty())
errStr = "Failed to get error message.";
throw std::runtime_error(errStr/*, 0*/);
throw std::runtime_error(errStr);
}
}
void MongoClient::duplicateCollection(const MongoNamespace &ns, const std::string &newCollectionName)
{
MongoNamespace sourceCollection(ns);
MongoNamespace newCollection(ns.databaseName(), newCollectionName);
MongoNamespace const newCollection(ns.databaseName(), newCollectionName);
if (!_dbclient->exists(newCollection.toString())) {
mongo::BSONObj result;
@@ -476,18 +464,20 @@ namespace Robomongo
if (errStr.empty())
errStr = "Failed to get error message.";
throw std::runtime_error(errStr/*, 0*/);
throw std::runtime_error(errStr);
}
}
else {
throw std::runtime_error("Collection with same name already exists."/*, 0*/);
throw std::runtime_error("Collection with same name already exists.");
}
std::unique_ptr<mongo::DBClientCursor> cursor(_dbclient->query(sourceCollection.toString(), mongo::Query()));
std::unique_ptr<mongo::DBClientCursor> cursor {
_dbclient->query(mongo::NamespaceString(ns.databaseName(), ns.collectionName()), mongo::Query())
};
// Cursor may be NULL, it means we have connectivity problem
if (!cursor)
throw std::runtime_error("Network error while attempting to run query"/*, 0*/);
throw std::runtime_error("Network error while attempting to run query");
while (cursor->more()) {
mongo::BSONObj bsonObj = cursor->next();
@@ -501,11 +491,14 @@ namespace Robomongo
if (!_dbclient->exists(to.toString()))
_dbclient->createCollection(to.toString());
std::unique_ptr<mongo::DBClientCursor> cursor(fromServ->query(from.toString(), mongo::Query()));
std::unique_ptr<mongo::DBClientCursor> cursor{fromServ->query(
mongo::NamespaceString(from.databaseName(), from.collectionName()),
mongo::Query())
};
// Cursor may be NULL, it means we have connectivity problem
if (!cursor)
throw std::runtime_error("Network error while attempting to run query"/*, 0*/);
throw std::runtime_error("Network error while attempting to run query");
while (cursor->more()) {
mongo::BSONObj bsonObj = cursor->next();
@@ -522,22 +515,21 @@ namespace Robomongo
if (errStr.empty())
errStr = "Failed to get error message.";
throw std::runtime_error(errStr/*, 0*/);
throw std::runtime_error(errStr);
}
}
else {
throw std::runtime_error("Collection does not exist."/*, 0*/);
throw std::runtime_error("Collection does not exist.");
}
}
void MongoClient::insertDocument(const mongo::BSONObj &obj, const MongoNamespace &ns, bool const replicaSetConnectionWithAuth)
void MongoClient::insertDocument(const mongo::BSONObj &obj, const MongoNamespace &ns)
{
_dbclient->insert(ns.toString(), obj);
if (!replicaSetConnectionWithAuth)
checkLastErrorAndThrow(ns.databaseName());
checkLastErrorAndThrow(ns.databaseName());
}
void MongoClient::saveDocument(const mongo::BSONObj &obj, const MongoNamespace &ns, bool const replicaSetConnectionWithAuth)
void MongoClient::saveDocument(const mongo::BSONObj &obj, const MongoNamespace &ns)
{
mongo::BSONElement id = obj.getField("_id");
mongo::BSONObjBuilder builder;
@@ -546,16 +538,13 @@ namespace Robomongo
mongo::Query query(bsonQuery);
_dbclient->update(ns.toString(), query, obj, true, false);
if(!replicaSetConnectionWithAuth)
checkLastErrorAndThrow(ns.databaseName());
checkLastErrorAndThrow(ns.databaseName());
}
void MongoClient::removeDocuments(const MongoNamespace &ns, mongo::Query query, bool const replicaSetConnectionWithAuth,
bool justOne /*= true*/)
void MongoClient::removeDocuments(const MongoNamespace &ns, mongo::Query query, bool justOne /*= true*/)
{
_dbclient->remove(ns.toString(), query, justOne);
if (!replicaSetConnectionWithAuth)
checkLastErrorAndThrow(ns.databaseName());
_dbclient->remove(ns.toString(), query, justOne);
checkLastErrorAndThrow(ns.databaseName());
}
std::vector<MongoDocumentPtr> MongoClient::query(const MongoQueryInfo &info)
@@ -570,12 +559,14 @@ namespace Robomongo
return docs;
std::unique_ptr<mongo::DBClientCursor> cursor = _dbclient->query(
ns.toString(), info._query, info._limit, info._skip,
info._fields.nFields() ? &info._fields : 0, info._options, info._batchSize);
mongo::NamespaceString(ns.databaseName(), ns.collectionName()),
info._query, info._limit, info._skip, info._fields.nFields() ? &info._fields : 0,
info._options, info._batchSize
);
// DBClientBase::query may return nullptr
if (!cursor)
throw std::runtime_error("Network error while attempting to run query"/*, 0*/);
throw std::runtime_error("Network error while attempting to run query");
while (cursor->more()) {
mongo::BSONObj bsonObj = cursor->next();
@@ -625,9 +616,7 @@ namespace Robomongo
void MongoClient::checkLastErrorAndThrow(const std::string &db)
{
std::string lastError = _dbclient->getLastError(db);
// Nothing to do when there is no error
std::string const lastError = _dbclient->getLastError(db);
if (lastError.empty())
return;
+7 -7
View File
@@ -1,6 +1,6 @@
#pragma once
#include <mongo/client/dbclientinterface.h>
#include <mongo/client/dbclient_base.h>
#include <mongo/bson/bsonobj.h>
#include "robomongo/core/Core.h"
@@ -26,10 +26,10 @@ namespace Robomongo
void createUser(const std::string &dbName, const MongoUser &user);
void dropUser(const std::string &dbName, const std::string &user);
std::vector<MongoFunction> getFunctions(const std::string &dbName);
std::vector<EnsureIndexInfo> getIndexes(const MongoCollectionInfo &collection) const;
std::vector<MongoFunction> getFunctions(const std::string &dbName) const;
std::vector<IndexInfo> getIndexes(const MongoCollectionInfo &collection) const;
void dropIndexFromCollection(const MongoCollectionInfo &collection, const std::string &indexName) const;
void ensureIndex(const EnsureIndexInfo &oldInfo, const EnsureIndexInfo &newInfo) const;
void addEditIndex(const IndexInfo &oldInfo, const IndexInfo &newInfo) const;
void renameIndexFromCollection(const MongoCollectionInfo &collection, const std::string &oldIndexName,
const std::string &newIndexName) const;
@@ -47,9 +47,9 @@ namespace Robomongo
void dropCollection(const MongoNamespace &ns);
void copyCollectionToDiffServer(mongo::DBClientBase *const, const MongoNamespace &from, const MongoNamespace &to);
void insertDocument(const mongo::BSONObj &obj, const MongoNamespace &ns, bool const replicaSetConnectionWithAuth);
void saveDocument(const mongo::BSONObj &obj, const MongoNamespace &ns, bool const replicaSetConnectionWithAuth);
void removeDocuments(const MongoNamespace &ns, mongo::Query query, bool const replicaSetConnectionWithAuth, bool justOne = true);
void insertDocument(const mongo::BSONObj &obj, const MongoNamespace &ns);
void saveDocument(const mongo::BSONObj &obj, const MongoNamespace &ns);
void removeDocuments(const MongoNamespace &ns, mongo::Query query, bool justOne = true);
std::vector<MongoDocumentPtr> query(const MongoQueryInfo &info);
MongoCollectionInfo runCollStatsCommand(const std::string &ns);
File diff suppressed because it is too large Load Diff
+12 -30
View File
@@ -23,15 +23,9 @@ namespace Robomongo
{
Q_OBJECT
public:
enum { pingTimeMs = 60 * 1000 };
typedef std::vector<std::string> DatabasesContainerType;
using DBClientReplicaSet = std::unique_ptr<mongo::DBClientReplicaSet>;
using DBClientConnection = std::unique_ptr<mongo::DBClientConnection>;
public:
explicit MongoWorker(ConnectionSettings *connection, bool isLoadMongoRcJs, int batchSize,
int mongoTimeoutSec, int shellTimeoutSec, QObject *parent = NULL);
double mongoTimeoutSec, int shellTimeoutSec, QObject *parent = nullptr);
~MongoWorker();
void interrupt();
@@ -80,20 +74,15 @@ namespace Robomongo
void handle(LoadCollectionIndexesRequest *event);
/**
* @brief Load indexes in collection
* @brief Add/edit indexes in collection
*/
void handle(EnsureIndexRequest *event);
void handle(AddEditIndexRequest *event);
/**
* @brief delete index from collection
*/
void handle(DropCollectionIndexRequest *event);
/**
* @brief Edit index
*/
void handle(EditIndexRequest *event);
/**
* @brief Load list of all JS functions
*/
@@ -118,6 +107,7 @@ namespace Robomongo
* @brief Execute javascript
*/
void handle(ExecuteScriptRequest *event);
void retry(ExecuteScriptRequest *event);
void handle(StopScriptRequest *event);
void handle(AutocompleteRequest *event);
@@ -127,9 +117,9 @@ namespace Robomongo
void handle(CreateCollectionRequest *event);
void handle(DropCollectionRequest *event);
void handle(RenameCollectionRequest *event);
void handle(DuplicateCollectionRequest *event);
void handle(CopyCollectionToDiffServerRequest *event);
void handle(DuplicateCollectionRequest *event);
void handle(CopyCollectionToDiffServerRequest *event); // todo: unused? remove
void handle(CreateUserRequest *event);
void handle(DropUserRequest *event);
@@ -148,7 +138,7 @@ namespace Robomongo
*/
void send(Event *event);
DatabasesContainerType getDatabaseNamesSafe();
std::vector<std::string> getDatabaseNamesSafe(EstablishConnectionRequest* event = nullptr);
std::string getAuthBase() const;
// Returns a pair of DBClientBase* connection and error string
@@ -173,15 +163,8 @@ namespace Robomongo
/**
*@brief Update Replica Set related parameters/settings.
* Warning: Using parameter 'refresh' as false might return incorrect cached values for status
* of secondary members.
* @param refresh : If true it will be deep scan of replica set status which
* might take quite some time. If false, it will be quick scan
* which might return incorrect cached values for status of secondary members.
* Use false only to achieve quick first connection, in all other cases true
* should be used.
*/
ReplicaSet getReplicaSetInfo(bool refresh = true) const;
ReplicaSet getReplicaSetInfo() const;
std::string connectAndGetReplicaSetName() const;
@@ -200,12 +183,11 @@ namespace Robomongo
std::unique_ptr<ScriptEngine> _scriptEngine;
bool _isAdmin;
const bool _isLoadMongoRcJs;
const int _batchSize;
int _timerId;
int _dbAutocompleteCacheTimerId;
int _mongoTimeoutSec;
double _mongoTimeoutSec;
int _shellTimeoutSec;
QAtomicInteger<int> _isQuiting;
@@ -222,4 +204,4 @@ namespace Robomongo
std::unordered_set<std::string> _createdDbs;
};
}
}
+5 -2
View File
@@ -16,8 +16,11 @@ namespace Robomongo
ReplicaSet() {};
std::string const setName;
mongo::HostAndPort const primary;
std::vector<std::pair<std::string, bool>> const membersAndHealths; // pair: {HostNameAndPort, Health}
mongo::HostAndPort const primary;
std::string const errorStr;
// pair: {HostNameAndPort, Health}
std::vector<std::pair<std::string, bool>> const membersAndHealths;
// todo: make first element of pair type HostnameAndPort
};
}
@@ -169,9 +169,8 @@ namespace Robomongo
map.insert("serverPort", serverPort());
map.insert("defaultDatabase", QtUtils::toQString(defaultDatabase()));
map.insert("isReplicaSet", isReplicaSet());
if (isReplicaSet()) {
if (isReplicaSet())
map.insert("replicaSet", _replicaSetSettings->toVariant());
}
#ifdef MONGO_SSL
SSLInfo infl = _info.sslInfo();
@@ -179,12 +178,10 @@ namespace Robomongo
map.insert("sslPemKeyFile", QtUtils::toQString(infl._sslPEMKeyFile));
#endif
QVariantList list;
for (QList<CredentialSettings *>::const_iterator it = _credentials.begin(); it != _credentials.end(); ++it) {
CredentialSettings *credential = *it;
list.append(credential->toVariant());
}
for (auto const& cred : _credentials)
list.append(cred->toVariant());
map.insert("credentials", list);
map.insert("ssh", _sshSettings->toVariant());
map.insert("ssl", _sslSettings->toVariant());
map.insert("uuid", _uuid);
@@ -4,7 +4,7 @@
#include <QVariant>
#include <QVariantMap>
#include <mongo/client/dbclientinterface.h>
#include <mongo/client/dbclient_base.h>
#include <mongo/client/mongo_uri.h>
#include <mongo/util/net/hostandport.h>
@@ -1,6 +1,7 @@
#include "robomongo/core/settings/CredentialSettings.h"
#include "robomongo/core/utils/QtUtils.h"
#include "robomongo/utils/RoboCrypt.h"
namespace Robomongo
{
@@ -9,17 +10,25 @@ namespace Robomongo
_userPassword(),
_databaseName(),
_mechanism(),
_enabled(false)
_enabled(false),
_useManuallyVisibleDbs(false),
_manuallyVisibleDbs()
{
}
CredentialSettings::CredentialSettings(const QVariantMap &map) :
_userName(QtUtils::toStdString(map.value("userName").toString())),
_userPassword(QtUtils::toStdString(map.value("userPassword").toString())),
_databaseName(QtUtils::toStdString(map.value("databaseName").toString())),
_mechanism(QtUtils::toStdString(map.value("mechanism").toString())),
_useManuallyVisibleDbs(map.value("useManuallyVisibleDbs").toBool()),
_manuallyVisibleDbs(QtUtils::toStdString(map.value("manuallyVisibleDbs").toString())),
_enabled(map.value("enabled").toBool())
{
// From version Robo 1.3 "userPasswordEncrypted" is used instead of "userPassword" in config. file
if(map.contains("userPassword")) // Robo 1.2 and below
_userPassword = map.value("userPassword").toString().toStdString();
else if(map.contains("userPasswordEncrypted")) // From Robo 1.3
_userPassword = RoboCrypt::decrypt(map.value("userPasswordEncrypted").toString().toStdString());
}
/**
@@ -35,10 +44,13 @@ namespace Robomongo
{
QVariantMap map;
map.insert("userName", QtUtils::toQString(userName()));
map.insert("userPassword", QtUtils::toQString(userPassword()));
map.insert("userPasswordEncrypted", userPassword().empty() ? "" :
QtUtils::toQString(RoboCrypt::encrypt(userPassword())));
map.insert("databaseName", QtUtils::toQString(databaseName()));
map.insert("mechanism", QtUtils::toQString(mechanism()));
map.insert("useManuallyVisibleDbs", _useManuallyVisibleDbs);
map.insert("manuallyVisibleDbs", QtUtils::toQString(_manuallyVisibleDbs));
map.insert("enabled", enabled());
return map;
}
}
}
@@ -53,11 +53,19 @@ namespace Robomongo
bool enabled() const { return _enabled; }
void setEnabled(bool enabled) { _enabled = enabled; }
bool useManuallyVisibleDbs() const { return _useManuallyVisibleDbs; }
void setUseManuallyVisibleDbs(bool enabled) { _useManuallyVisibleDbs = enabled; }
std::string manuallyVisibleDbs() const { return _manuallyVisibleDbs; }
void setManuallyVisibleDbs(std::string const& dbs) { _manuallyVisibleDbs = dbs; }
private:
std::string _userName;
std::string _userPassword;
std::string _userPassword; // clear text password (decrypted)
std::string _databaseName;
std::string _mechanism; // authentication mechanism (SCRAM-SHA-1, SCRAM-SHA-256 or MONGODB-CR)
std::string _mechanism; // authentication mechanism (SCRAM-SHA-1, SCRAM-SHA-256 or MONGODB-CR)
bool _useManuallyVisibleDbs;
std::string _manuallyVisibleDbs;
/**
* @brief Flag, indecating whether we should use this
+75 -112
View File
@@ -21,14 +21,23 @@
#include "robomongo/gui/AppStyle.h"
#include "robomongo/utils/common.h"
#include "robomongo/utils/qzip/qzipreader_p.h"
#include "robomongo/utils/RoboCrypt.h"
namespace Robomongo
{
// 3T config files
auto const Studio3T_PropertiesDat = QString("%1/.3T/studio-3t/properties.dat").arg(QDir::homePath());
auto const DataMongodb_PropertiesDat = QString("%1/.3T/data-man-mongodb/properties.dat").arg(QDir::homePath());
auto const MongoChefPro_PropertiesDat = QString("%1/.3T/mongochef-pro/properties.dat").arg(QDir::homePath());
auto const MongoChefEnt_PropertiesDat = QString("%1/.3T/mongochef-enterprise/properties.dat").arg(QDir::homePath());
auto const Studio3T_PropertiesDat {
QString("%1/.3T/studio-3t/properties.dat").arg(QDir::homePath())
};
auto const DataMongodb_PropertiesDat {
QString("%1/.3T/data-man-mongodb/properties.dat").arg(QDir::homePath())
};
auto const MongoChefPro_PropertiesDat {
QString("%1/.3T/mongochef-pro/properties.dat").arg(QDir::homePath())
};
auto const MongoChefEnt_PropertiesDat {
QString("%1/.3T/mongochef-enterprise/properties.dat").arg(QDir::homePath())
};
const std::vector<std::pair<QString, QString>> S_3T_ZipFile_And_ConfigFile_List
{
@@ -49,39 +58,41 @@ namespace Robomongo
*/
const QString SchemaVersion = "2.0";
const auto CONFIG_FILE_0_8_5 {
QString("%1/.config/robomongo/robomongo.json").arg(QDir::homePath())
};
const auto CONFIG_FILE_1_0_RC1 {
QString("%1/.config/robomongo/1.0/robomongo.json").arg(QDir::homePath())
};
const auto CONFIG_FILE_1_1_0_BETA {
QString("%1/.3T/robomongo/1.1.0-Beta/robomongo.json").arg(QDir::homePath())
};
/**
* @brief Robomongo config. files of old versions
*/
const auto CONFIG_FILE_0_8_5 = QString("%1/.config/robomongo/robomongo.json").arg(QDir::homePath());
const auto CONFIG_FILE_0_9 = QString("%1/.config/robomongo/0.9/robomongo.json").arg(QDir::homePath());
const auto CONFIG_FILE_1_0_RC1 = QString("%1/.config/robomongo/1.0/robomongo.json").arg(QDir::homePath());
// Change of path due to re-branding to 3T
const auto CONFIG_FILE_1_0_0 = QString("%1/.3T/robomongo/1.0.0/robomongo.json").arg(QDir::homePath());
const auto CONFIG_FILE_1_1_0_BETA = QString("%1/.3T/robomongo/1.1.0-Beta/robomongo.json").arg(QDir::homePath());
const auto CONFIG_FILE_1_1_1 = QString("%1/.3T/robo-3t/1.1.1/robo3t.json").arg(QDir::homePath());
const auto CONFIG_FILE_1_2_0_BETA = QString("%1/.3T/robo-3t/1.2.0/robo3t.json").arg(QDir::homePath());
const auto CONFIG_FILE_1_2_1 = QString("%1/.3T/robo-3t/1.2.1/robo3t.json").arg(QDir::homePath());
// Important Note: In order to import connections from the latest version found, config. file path of an
// old version must be defined (i.e. CONFIG_FILE_1_0_0 seen above) and placed into the
// vector initializer list below in order.
// Important: In order to import connections from a version, config. file path must
// be defined and placed into the vector initializer list below in order.
std::vector<QString> const SettingsManager::_configFilesOfOldVersions
{
CONFIG_FILE_1_2_1,
CONFIG_FILE_1_2_0_BETA,
CONFIG_FILE_1_1_1,
CONFIG_FILE_1_1_0_BETA,
CONFIG_FILE_1_0_0,
CONFIG_FILE_1_0_RC1,
CONFIG_FILE_0_9,
CONFIG_FILE_0_8_5,
QString("%1/.3T/robo-3t/1.4.3/robo3t.json").arg(QDir::homePath()), // CONFIG_FILE_1_4_3
QString("%1/.3T/robo-3t/1.4.2/robo3t.json").arg(QDir::homePath()), // CONFIG_FILE_1_4_2
QString("%1/.3T/robo-3t/1.4.1/robo3t.json").arg(QDir::homePath()), // CONFIG_FILE_1_4_1
QString("%1/.3T/robo-3t/1.4.0/robo3t.json").arg(QDir::homePath()), // CONFIG_FILE_1_4_0
QString("%1/.3T/robo-3t/1.3.1/robo3t.json").arg(QDir::homePath()), // CONFIG_FILE_1_3_1
QString("%1/.3T/robo-3t/1.3.0/robo3t.json").arg(QDir::homePath()), // CONFIG_FILE_1_3_0_BETA
QString("%1/.3T/robo-3t/1.2.1/robo3t.json").arg(QDir::homePath()), // CONFIG_FILE_1_2_1
QString("%1/.3T/robo-3t/1.2.0/robo3t.json").arg(QDir::homePath()), // CONFIG_FILE_1_2_0_BETA
QString("%1/.3T/robo-3t/1.1.1/robo3t.json").arg(QDir::homePath()), // CONFIG_FILE_1_1_1
CONFIG_FILE_1_1_0_BETA, // CONFIG_FILE_1_1_0_BETA
QString("%1/.3T/robomongo/1.0.0/robomongo.json").arg(QDir::homePath()), // CONFIG_FILE_1_0_0
CONFIG_FILE_1_0_RC1, // CONFIG_FILE_1_0_RC1
QString("%1/.config/robomongo/0.9/robomongo.json").arg(QDir::homePath()), // CONFIG_FILE_0_9
CONFIG_FILE_0_8_5 // CONFIG_FILE_0_8_5
};
std::vector<ConnectionSettings*> SettingsManager::_connections;
// Temporarily disabling Recent Connections feature
// std::vector<RecentConnection> SettingsManager::_recentConnections;
/**
* Creates SettingsManager for config file in default location
* ~/.config/robomongo/robomongo.json
@@ -101,8 +112,12 @@ namespace Robomongo
_textFontPointSize(-1),
_mongoTimeoutSec(10),
_shellTimeoutSec(15),
_imported(false)
_imported(false)
{
if (!QDir().mkpath(ConfigDir))
LOG_MSG("ERROR: Could not create settings path: " + ConfigDir, mongo::logger::LogSeverity::Error());
RoboCrypt::initKey();
if (!load()) { // if load fails (probably due to non-existing config. file or directory)
save(); // create empty settings file
load(); // try loading again for the purpose of import from previous Robomongo versions
@@ -146,12 +161,7 @@ namespace Robomongo
*/
bool SettingsManager::save()
{
QVariantMap map = convertToMap();
if (!QDir().mkpath(ConfigDir)) {
LOG_MSG("ERROR: Could not create settings path: " + ConfigDir, mongo::logger::LogSeverity::Error());
return false;
}
QVariantMap const& map = convertToMap();
QFile f(ConfigFilePath);
if (!f.open(QIODevice::WriteOnly | QIODevice::Truncate)) {
@@ -214,7 +224,10 @@ namespace Robomongo
_programExitedNormally = map.contains("programExitedNormally") ?
map.value("programExitedNormally").toBool() : true;
_useHttps = map.contains("useHttps") ? map.value("useHttps").toBool() : true;
_disableHttpsFeatures = map.contains("disableHttpsFeatures") ?
map.value("disableHttpsFeatures").toBool() : false;
_debugMode = map.contains("debugMode") ? map.value("debugMode").toBool() : false;
// 4. Load TimeZone
int timeZone = map.value("timeZone").toInt();
@@ -280,16 +293,6 @@ namespace Robomongo
addConnection(connSettings);
}
/* Temporarily disabling Recent Connections feature
// Load recent connections
_recentConnections.clear();
QVariantList const& rlist = map.value("recentConnections").toList();
for (auto const& rconn : rlist) {
_recentConnections.push_back(RecentConnection(rconn.toMap().value("uuid").toString(),
rconn.toMap().value("name").toString().toStdString()));
}
*/
_toolbars = map.value("toolbars").toMap();
ToolbarSettingsContainerType::const_iterator it = _toolbars.find("connect");
if (_toolbars.end() == it)
@@ -314,7 +317,7 @@ namespace Robomongo
_cacheData = map.value("cacheData").toMap();
// Load connection settings from previous versions of Robomongo
importConnections();
importFromOldVersion();
}
/**
@@ -380,19 +383,6 @@ namespace Robomongo
list.append(conn->toVariant().toMap());
map.insert("connections", list);
/* Temporarily disabling Recent Connections feature
// 13. Save recent connections
QVariantList recentConnsList;
QVariantMap recentConnMap;
for (auto const& rconn : _recentConnections) {
recentConnMap.insert("uuid", rconn.uuid);
recentConnMap.insert("name", QString::fromStdString(rconn.name));
recentConnsList.append(recentConnMap);
}
map.insert("recentConnections", recentConnsList);
*/
map.insert("autoExec", _autoExec);
map.insert("minimizeToTray", _minimizeToTray);
map.insert("toolbars", _toolbars);
@@ -400,8 +390,9 @@ namespace Robomongo
map.insert("anonymousID", _anonymousID);
map.insert("cacheData", _cacheData);
map.insert("programExitedNormally", _programExitedNormally);
map.insert("useHttps", _useHttps);
map.insert("disableHttpsFeatures", _disableHttpsFeatures);
map.insert("debugMode", _debugMode);
return map;
}
@@ -495,34 +486,6 @@ namespace Robomongo
}
}
/* Temporarily disabling Recent Connections feature
void SettingsManager::addRecentConnection(ConnectionSettings *connection)
{
_recentConnections.push_back(RecentConnection(connection->uuid(), connection->connectionName()));
}
void SettingsManager::deleteRecentConnection(ConnectionSettings *conn)
{
for (int i = 0; i < _recentConnections.size(); ++i) {
if (_recentConnections[i].uuid == conn->uuid())
_recentConnections.erase(_recentConnections.begin() + i);
}
}
void SettingsManager::setRecentConnections(std::vector<ConnectionSettings const*> const& recentConns)
{
_recentConnections.clear();
for(auto rconn : recentConns)
_recentConnections.push_back(RecentConnection(rconn->uuid(), rconn->connectionName()));
}
void SettingsManager::clearRecentConnections()
{
_recentConnections.clear();
}
*/
ConnectionSettings* SettingsManager::getConnectionSettingsByUuid(QString const& uuid) const
{
for (auto const connSettings : _connections){
@@ -563,17 +526,16 @@ namespace Robomongo
_toolbars[toolbarName] = visible;
}
void SettingsManager::importConnections()
void SettingsManager::importFromOldVersion()
{
// Do not import if already imported
if (_imported)
return;
// Find and import 'only' from the latest version to current version
// Import only from the latest version
for (auto const& configFile : _configFilesOfOldVersions) {
if (QFile::exists(configFile)) {
importConnectionsFromOldVersion(configFile);
setImported(true); // Mark as imported
importFromFile(configFile);
setImported(true);
return;
}
}
@@ -619,7 +581,7 @@ namespace Robomongo
ssh->setPrivateKeyFile(QtUtils::toStdString(vconn.value("sshPrivateKey").toString()));
ssh->setPassphrase(QtUtils::toStdString(vconn.value("sshPassphrase").toString()));
int auth = vconn.value("sshAuthMethod").toInt();
int const auth = vconn.value("sshAuthMethod").toInt();
ssh->setEnabled(auth == 1 || auth == 2);
ssh->setAuthMethod(auth == 2 ? "publickey" : "password");
}
@@ -637,10 +599,12 @@ namespace Robomongo
QVariantMap vcred = (*itcred).toMap();
auto cred = new CredentialSettings();
cred->setUserName(QtUtils::toStdString(vcred.value("userName").toString()));
cred->setUserPassword(QtUtils::toStdString(vcred.value("userPassword").toString()));
cred->setDatabaseName(QtUtils::toStdString(vcred.value("databaseName").toString()));
cred->setUserName(vcred.value("userName").toString().toStdString());
cred->setUserPassword(vcred.value("userPassword").toString().toStdString());
cred->setDatabaseName(vcred.value("databaseName").toString().toStdString());
cred->setMechanism("MONGODB-CR");
cred->setUseManuallyVisibleDbs(vcred.value("useManuallyVisibleDbs").toBool());
cred->setManuallyVisibleDbs(vcred.value("manuallyVisibleDbs").toString().toStdString());
cred->setEnabled(vcred.value("enabled").toBool());
conn->addCredential(cred);
@@ -686,7 +650,7 @@ namespace Robomongo
return true;
}
bool SettingsManager::importConnectionsFromOldVersion(QString const& oldConfigFilePath)
bool SettingsManager::importFromFile(QString const& oldConfigFilePath)
{
if (oldConfigFilePath == CONFIG_FILE_0_8_5) {
importConnectionsFrom_0_8_5();
@@ -706,14 +670,18 @@ namespace Robomongo
if (!ok)
return false;
QVariantList const& vconns = vmap.value("connections").toList();
for (auto const& vcon : vconns)
{
//// Import keys
_autoExpand = vmap.value("autoExpand").toBool();
_lineNumbers = vmap.value("lineNumbers").toBool();
_debugMode = vmap.value("debugMode").toBool();
_shellTimeoutSec = vmap.value("shellTimeoutSec").toInt();
//// Import connections
for (auto const& vcon : vmap.value("connections").toList()) {
QVariantMap const& vconn = vcon.toMap();
auto connSettings = new ConnectionSettings(false);
connSettings->fromVariant(vconn);
connSettings->setImported(true);
addConnection(connSettings);
}
@@ -721,14 +689,9 @@ namespace Robomongo
}
int SettingsManager::importedConnectionsCount() {
int count = 0;
for (std::vector<ConnectionSettings*>::const_iterator it = _connections.begin(); it != _connections.end(); ++it) {
ConnectionSettings *conn = *it;
if (conn->imported())
++count;
}
return count;
return (std::count_if(_connections.cbegin(), _connections.cend(),
[](auto conn) { return conn->imported(); }
));
}
QString extractAnonymousIDFromZip(QString const& zipFile, QString const& propfile)
+7 -40
View File
@@ -24,24 +24,6 @@ namespace Robomongo
// Current config file directory
auto const ConfigDir = QString("%1/.3T/robo-3t/%2/").arg(QDir::homePath())
.arg(PROJECT_VERSION);
/* Temporarily disabling Recent Connections feature
struct RecentConnection
{
RecentConnection(QString const& uuid, std::string const& name)
: uuid(uuid), name(name) {}
// Not directly used but required by std::vector<T>::erase()
RecentConnection& operator=(const RecentConnection& other)
{
uuid = other.uuid;
name = other.name;
return *this;
}
QString uuid;
std::string name;
};
*/
/* ----------------------------- SettingsManager ------------------------------ */
@@ -95,15 +77,6 @@ namespace Robomongo
*/
void removeConnection(ConnectionSettings *connection);
/**
* @brief Functions of Recent Connections feature
*/
/* Temporarily disabling Recent Connections feature
static void addRecentConnection(ConnectionSettings *connection);
static void deleteRecentConnection(ConnectionSettings *connection);
static void setRecentConnections(std::vector<ConnectionSettings const*> const& recentConns);
static void clearRecentConnections();
*/
/**
* @brief Finds and returns original (non-clone) connection settings which is
@@ -123,9 +96,6 @@ namespace Robomongo
*/
ConnectionSettingsContainerType connections() const { return _connections; }
// Temporarily disabling Recent Connections feature
// std::vector<RecentConnection>& recentConnections() const { return _recentConnections; }
ToolbarSettingsContainerType toolbars() const { return _toolbars; }
void setUuidEncoding(UUIDEncoding encoding) { _uuidEncoding = encoding; }
@@ -198,8 +168,9 @@ namespace Robomongo
void setProgramExitedNormally(bool value) { _programExitedNormally = value; }
bool programExitedNormally() const { return _programExitedNormally; }
bool useHttps() const { return _useHttps; }
void setUseHttps(bool status) { _useHttps = status; }
// Designed to be set only by human users
bool disableHttpsFeatures() const { return _disableHttpsFeatures; }
bool debugMode() const { return _debugMode; }
/**
* Returns number of imported connections
@@ -225,10 +196,10 @@ namespace Robomongo
/**
* Load connection settings from previous versions of Robomongo
*/
void importConnections();
void importFromOldVersion();
// Imports connections from oldConfigFilePath into current config file
static bool importConnectionsFromOldVersion(QString const& oldConfigFilePath);
bool importFromFile(QString const& oldConfigFilePath);
static bool importConnectionsFrom_0_8_5();
@@ -248,7 +219,8 @@ namespace Robomongo
bool _lineNumbers;
bool _disableConnectionShortcuts;
bool _programExitedNormally = true;
bool _useHttps = true;
bool _disableHttpsFeatures = false;
bool _debugMode = false;
QSet<QString> _acceptedEulaVersions;
QSet<QString> _dbVersionsConnected;
int _batchSize;
@@ -278,11 +250,6 @@ namespace Robomongo
*/
static std::vector<ConnectionSettings*> _connections;
/* Temporarily disabling Recent Connections feature
// List of recent connections that are shown on Welcome Tab
static std::vector<RecentConnection> _recentConnections;
*/
ToolbarSettingsContainerType _toolbars;
// List of config. file absolute paths of old versions
+19 -4
View File
@@ -1,6 +1,7 @@
#include "robomongo/core/settings/SshSettings.h"
#include "robomongo/core/utils/QtUtils.h"
#include "robomongo/utils/RoboCrypt.h"
namespace Robomongo
{
@@ -23,10 +24,12 @@ namespace Robomongo
map.insert("host", QtUtils::toQString(host()));
map.insert("port", port());
map.insert("userName", QtUtils::toQString(userName()));
map.insert("userPassword", QtUtils::toQString(userPassword()));
map.insert("userPasswordEncrypted", userPassword().empty() ? "" :
QtUtils::toQString(RoboCrypt::encrypt(userPassword())));
map.insert("privateKeyFile", QtUtils::toQString(privateKeyFile()));
map.insert("publicKeyFile", QtUtils::toQString(publicKeyFile()));
map.insert("passphrase", QtUtils::toQString(passphrase()));
map.insert("passphraseEncrypted", passphrase().empty() ? "" :
QtUtils::toQString(RoboCrypt::encrypt(passphrase())));
map.insert("method", QtUtils::toQString(authMethod()));
map.insert("enabled", enabled());
map.insert("askPassword", askPassword());
@@ -37,10 +40,22 @@ namespace Robomongo
setHost(QtUtils::toStdString(map.value("host").toString()));
setPort(map.value("port").toInt());
setUserName(QtUtils::toStdString(map.value("userName").toString()));
setUserPassword(QtUtils::toStdString(map.value("userPassword").toString()));
// From version Robo 1.3 "userPasswordEncrypted" is used instead of "userPassword" in config. file
if (map.contains("userPassword")) // Robo 1.2 and below
setUserPassword((map.value("userPassword").toString().toStdString()));
else if (map.contains("userPasswordEncrypted")) // From Robo 1.3
setUserPassword(RoboCrypt::decrypt((map.value("userPasswordEncrypted").toString().toStdString())));
setPrivateKeyFile(QtUtils::toStdString(map.value("privateKeyFile").toString()));
setPublicKeyFile(QtUtils::toStdString(map.value("publicKeyFile").toString()));
setPassphrase(QtUtils::toStdString(map.value("passphrase").toString()));
// From version Robo 1.3 "passphraseEncrypted" is used instead of "passphrase" in config. file
if (map.contains("passphrase")) // Robo 1.2 and below
setPassphrase((map.value("passphrase").toString().toStdString()));
else if (map.contains("passphraseEncrypted")) // From Robo 1.3
setPassphrase(RoboCrypt::decrypt((map.value("passphraseEncrypted").toString().toStdString())));
setAuthMethod(QtUtils::toStdString(map.value("method").toString()));
setEnabled(map.value("enabled").toBool());
setAskPassword(map.value("askPassword").toBool());
+2 -2
View File
@@ -70,10 +70,10 @@ namespace Robomongo
std::string _host; // domain or IPv4/v6
int _port;
std::string _userName;
std::string _userPassword;
std::string _userPassword; // clear text password (decrypted)
std::string _privateKeyFile;
std::string _publicKeyFile;
std::string _passphrase;
std::string _passphrase; // clear text passphrase (decrypted)
std::string _authMethod; // "password" or "publickey"
// Should we ask user about password or passphrase
+10 -2
View File
@@ -1,6 +1,7 @@
#include "robomongo/core/settings/SslSettings.h"
#include "robomongo/core/utils/QtUtils.h"
#include "robomongo/utils/RoboCrypt.h"
namespace Robomongo
{
@@ -23,7 +24,8 @@ namespace Robomongo
map.insert("caFile", QtUtils::toQString(caFile()));
map.insert("usePemFile", usePemFile());
map.insert("pemKeyFile", QtUtils::toQString(pemKeyFile()));
map.insert("pemPassPhrase", QtUtils::toQString(pemPassPhrase()));
map.insert("pemPassPhraseEncrypted", pemPassPhrase().empty() ? "" :
QtUtils::toQString(RoboCrypt::encrypt(pemPassPhrase())));
map.insert("useAdvancedOptions", useAdvancedOptions());
map.insert("crlFile", QtUtils::toQString(crlFile()));
map.insert("allowInvalidHostnames", allowInvalidHostnames());
@@ -39,7 +41,13 @@ namespace Robomongo
setCaFile(QtUtils::toStdString(map.value("caFile").toString()));
setUsePemFile(map.value("usePemFile").toBool());
setPemKeyFile(QtUtils::toStdString(map.value("pemKeyFile").toString()));
setPemPassPhrase(QtUtils::toStdString(map.value("pemPassPhrase").toString()));
// From version Robo 1.3 "pemPassPhraseEncrypted" is used instead of "pemPassPhrase" in config. file
if (map.contains("pemPassPhrase")) // Robo 1.2 and below
setPemPassPhrase((map.value("pemPassPhrase").toString().toStdString()));
else if (map.contains("pemPassPhraseEncrypted")) // From Robo 1.3
setPemPassPhrase(RoboCrypt::decrypt((map.value("pemPassPhraseEncrypted").toString().toStdString())));
setUseAdvancedOptions(map.value("useAdvancedOptions").toBool());
setCrlFile(QtUtils::toStdString(map.value("crlFile").toString()));
setAllowInvalidHostnames(map.value("allowInvalidHostnames").toBool());
+7 -6
View File
@@ -1,9 +1,9 @@
#include "robomongo/core/utils/BsonUtils.h"
#include <mongo/client/dbclientinterface.h>
#include <mongo/client/dbclient_base.h>
//#include <mongo/bson/bsonobjiterator.h>
#include "mongo/util/base64.h"
#include "mongo/util/stringutils.h"
#include "mongo/util/str.h"
#include "robomongo/core/utils/Logger.h"
#include "robomongo/core/utils/QtUtils.h"
@@ -122,7 +122,7 @@ namespace Robomongo
std::stringstream s;
if ( includeFieldNames && !isArray)
s << '"' << escape( elem.fieldName() ) << "\" : ";
s << '"' << mongo::str::escape(elem.fieldName()) << "\" : ";
switch ( t ) {
case Undefined:
@@ -130,7 +130,8 @@ namespace Robomongo
break;
case mongo::String:
case Symbol:
s << '"' << escape( std::string(elem.valuestr(), elem.valuestrsize()-1) ) << '"';
s << '"' << mongo::str::escape(std::string(elem.valuestr(), elem.valuestrsize() - 1))
<< '"';
break;
case NumberLong:
s << "NumberLong(" << elem._numberLong() << ")";
@@ -301,11 +302,11 @@ namespace Robomongo
}
case RegEx:
if ( format == Strict ) {
s << "{ \"$regex\" : \"" << escape( elem.regex() );
s << "{ \"$regex\" : \"" << mongo::str::escape(elem.regex());
s << "\", \"$options\" : \"" << elem.regexFlags() << "\" }";
}
else {
s << "/" << escape( elem.regex() , true ) << "/";
s << "/" << mongo::str::escape(elem.regex(), true) << "/";
// FIXME Worry about alpha order?
for ( const char *f = elem.regexFlags(); *f; ++f ) {
switch ( *f ) {

Some files were not shown because too many files have changed in this diff Show More