Compare commits

...

1157 Commits

Author SHA1 Message Date
csoler
8fcc52b304
Merge pull request #2904 from defnax/fix-macos-v2
Fixed some frames to use StyledPanel to get styles on system theme
2025-01-19 17:41:39 +01:00
csoler
5f3f1c9c43
Merge pull request #2905 from defnax/fonts-fix-v2
remove font sizes from the ui files
2025-01-19 17:40:20 +01:00
defnax
e835385000 restore back changes 2025-01-18 16:06:03 +01:00
csoler
e44a216873
Merge pull request #2903 from csoler/v0.6-FT-001
removed unencrypted FT
2025-01-12 14:14:21 +01:00
csoler
4b5dd51681
Merge pull request #2911 from csoler/v0.6-RNP-submodule
added non-backward compatible flag change for v0.7 about sha1 certs
2025-01-12 14:12:36 +01:00
csoler
e18bb74a5e added non-backward compatible flag change for v0.7 about sha1 certs 2025-01-10 22:47:46 +01:00
csoler
b2d05d7d8e
Merge pull request #2907 from dbear496/a-few-fixes
a few small fixes
2025-01-06 20:32:20 +01:00
David Bears
2c53c02319
omit newline after single link 2025-01-04 13:48:00 -05:00
David Bears
99053597a9
allow voting on own identities 2025-01-03 15:03:31 -05:00
defnax
e5f2ef2335 remove font sizes from the ui files 2025-01-03 19:10:45 +01:00
David Bears
0759359e06
Fix JSON API token removal 2025-01-02 22:38:46 -05:00
David Bears
2ca36f5957
Fix port settings for manual I2P 2025-01-02 22:27:43 -05:00
defnax
89ceba2f92 Fixed some frames to use StyledPanel to get styles on system theme
* update mac os section
2025-01-02 23:36:43 +01:00
csoler
41bb83054c removed unencrypted FT 2025-01-01 20:17:49 +01:00
csoler
f9ca8934db
Merge pull request #2902 from defnax/ui-fix-v16
Fixed some frames to get compatible for system style
2024-12-30 22:19:38 +01:00
defnax
01617da863 Fixed some frames to get compatible for system style
* Fixed some frames to get compatible for system style
* update macos package script
2024-12-30 21:36:04 +01:00
csoler
8d96bb920d
Merge pull request #2900 from csoler/v0.6-BugFixing_40
fixed bug causing own identity to not disappear when deleted
2024-12-30 14:15:57 +01:00
thunder2
b502dd71e2 Windows build: Fixed makefile for external libraries 2024-12-28 14:01:45 +01:00
csoler
359305c24f
Merge pull request #2888 from defnax/People-improve
Improve People View
2024-12-27 20:11:51 +01:00
csoler
ca2f8c5bed
Merge pull request #2901 from thunder2/fix_missing_premods
Added missing calls to preMods in RsFriendListModel::setDisplayStatus…
2024-12-27 19:59:09 +01:00
thunder2
ccd1cfbde6 Added missing calls to preMods in RsFriendListModel::setDisplayStatusString and RsFriendListModel::setDisplayStatusIcon 2024-12-27 15:03:36 +01:00
thunder2
32a43b1892 Windows build: Updated cmake to 3.31.3 2024-12-27 14:43:26 +01:00
thunder2
6cde715e66 Windows build: Updated MSYS2 installer to 20241208 2024-12-27 14:35:23 +01:00
thunder2
6825c7e925 Updated librnp submodule 2024-12-27 14:35:10 +01:00
csoler
433ab6514d fixed bug causing own identity to not disappear when deleted 2024-12-26 21:14:49 +01:00
csoler
142049a61e updated master branch to latest commit in libretroshare submodule 2024-12-26 18:42:18 +01:00
csoler
8cc2cf8cd2
Merge pull request #2894 from csoler/v0.6-RNP-submodule
V0.6 rnp submodule
2024-12-26 16:15:56 +01:00
csoler
cbd9dfc86a
Merge pull request #35 from thunder2/rnp
Fixed Windows build with librnp
2024-12-25 16:17:55 +01:00
csoler
675b430833
Merge pull request #2887 from thunder2/fix_msgs
Use all mails for the calculation of counts in MessagesDialog::update…
2024-12-25 14:56:53 +01:00
csoler
b17cb811d6
Merge pull request #2891 from fkobi/patch-1
Improve desktop icon
2024-12-25 14:44:27 +01:00
csoler
d6d2f09673 updated submodule url to comply with RS standard 2024-12-19 22:25:27 +01:00
thunder2
d79ce90c68 Fixed Windows build with librnp 2024-12-19 00:32:26 +01:00
csoler
38e82adaea
Merge pull request #2893 from fkobi/patch-2
Mention "desktop" instead of "GNOME"
2024-12-08 17:24:05 +01:00
csoler
5d7b235941 added back key certification with RNP 2024-12-07 16:37:37 +01:00
fkobi
8e94a99a53
Mention "desktop" instead of "GNOME" 2024-11-30 15:14:41 +00:00
csoler
6a77d6b7bc fixed retroshare.pri 2024-11-26 22:19:02 +01:00
csoler
e6f1878f1f Merge remote-tracking branch 'upstream/master' into v0.6-RNP-submodule 2024-11-26 20:46:19 +01:00
fkobi
9a7c94314c
Improve desktop icon
- add missing categories
- sort according to 
  https://specifications.freedesktop.org/menu-spec/latest/additional-category-registry.html
2024-11-25 19:58:52 +00:00
csoler
5c9bf3bf7c added commands to make rnp a submodule 2024-11-20 22:20:28 +01:00
defnax
d8d2243b9e Improve People View 2024-11-16 16:48:30 +01:00
thunder2
00241d6252 Use all mails for the calculation of counts in MessagesDialog::updateMessageSummaryList, not just the current selected box 2024-11-16 15:48:32 +01:00
csoler
3248a06134 updated master branch to latest version of submodules 2024-11-16 15:02:48 +01:00
csoler
ae1bd27ad1
Merge pull request #2885 from defnax/People-improve
Improved People view
2024-11-02 14:40:30 +01:00
defnax
9fefbb3b13 Improved People view
* Improved People View
* Update translations
2024-11-01 16:00:28 +01:00
csoler
ed0105f44c switched rs_usernp into rs_useopenpgpsdk 2024-10-22 19:25:11 +02:00
csoler
126ce6607e changed flag name to remove it from v07 changes list 2024-10-09 21:31:42 +02:00
csoler
e20a4c4e60 changed retroshare.pri to add V07_NON_BACKWARD_COMPATIBLE_CHANGE_005 by default 2024-09-18 21:15:44 +02:00
csoler
e888e89437
Merge pull request #2879 from zapek/fix-image-jpeg-uri-mimetype
Fix image data URI
2024-09-02 09:41:52 +02:00
David Gerber
bb4b8f0bc5
Fix image data URI
Make JPEG images use the image/jpeg mimetype instead of the wrong image/png one.
2024-09-01 22:51:22 +02:00
csoler
a9c87225e2 disabled certificate signature when using librnp 2024-08-19 18:53:25 +02:00
csoler
37261761dd fixed compilation 2024-08-11 23:32:11 +02:00
csoler
3361727a37 added switch to compile with rnp or openpgp-sdk 2024-08-11 16:43:20 +02:00
csoler
d222cfe8e0 added compilation flag for RNP 2024-07-26 11:10:52 +02:00
csoler
64f4d84e74
Merge pull request #2862 from defnax/statusicons-settings
Added optional display status icon from friendslist context menu
2024-07-07 20:10:52 +02:00
defnax
b90e75e912
Merge pull request #215 from thunder2/pr/2862
Pr/2862
2024-07-03 15:38:35 +02:00
thunder2
d72e46cfda Update NewFriendList on avatar and status change 2024-07-03 14:58:03 +02:00
thunder2
874748e7da Use avatar for profile in RsFriendListModel of best node 2024-07-03 14:58:03 +02:00
defnax
b5b2e77a7e set default idle color which has better contrast 2024-07-02 23:52:31 +02:00
defnax
afc4096740
Merge pull request #214 from thunder2/pr/2862
Pr/2862
2024-07-02 08:29:37 +02:00
thunder2
2c3b0a1c44 Fixed show best status icon for profile 2024-07-01 23:26:43 +02:00
thunder2
c8975bb2e9 Optimized avatar loading in RsFriendListModel 2024-07-01 16:48:52 +02:00
defnax
19d613edcc fix naming 2024-06-25 19:09:03 +02:00
defnax
56b6b0cb5a Added optional display status icon from friendslist context menu 2024-06-24 23:36:45 +02:00
csoler
3461da7c3a
Merge pull request #2860 from defnax/fixstatuscolors
Fixed status colors
2024-06-19 21:02:40 +02:00
defnax
332939c3f5 Fixed status colors 2024-06-17 22:07:18 +02:00
csoler
2fb9b3eb46
Merge pull request #2858 from csoler/v0.6-Collection
fixed bug showing peers offline when status service is remotely disabled
2024-06-13 21:38:01 +02:00
csoler
794ec3576c using statusRole instead of onlineRole to decide on node string 2024-06-13 11:08:28 +02:00
csoler
1b4886715d fixed usage of statusRole in FriendListModel 2024-06-09 21:25:43 +02:00
csoler
7dfd6de15f fixed bug showing peers offline when status service is remotely disabled 2024-06-07 11:26:35 +02:00
thunder2
a60f3f44f7 FeedReader: Don't add items as new item when pubDate less than storage time 2024-04-16 19:25:26 +02:00
thunder2
83b433a2e2 Revert changes in libbitdht of "Merge pull request #2852 from thunder2/fix_rscollection" 2024-04-04 00:58:34 +02:00
csoler
55c414b400
Merge pull request #2852 from thunder2/fix_rscollection
Renamed RsCollectionErrorCode::NO_ERROR to COLLECTION_NO_ERROR b…
2024-04-04 00:48:28 +02:00
thunder2
5a24fad354 Renamed RsCollectionErrorCode::NO_ERROR to COLLECTION_NO_ERROR because of double define of NO_ERROR in winerror.h 2024-04-03 22:20:33 +02:00
csoler
16d6d4d597 updated master to all submodules 2024-04-02 17:55:11 +02:00
csoler
d92404d047
Merge pull request #2846 from csoler/v0.6-Collection
Attempt at making RsCollection faster to use (Needs #144)
2024-04-01 18:32:39 +02:00
csoler
0b75abaa04 minor fixes to rscollection PR 2024-04-01 18:25:49 +02:00
csoler
3f9d49921d fixed bug asking for overwriting a non existant file 2024-03-30 18:37:20 +01:00
csoler
0551f4f819 fixed compilation after removal of RsCollection::downloadFiles 2024-03-28 22:14:46 +01:00
csoler
8366cbca59 removed dead code, and added check for incorrect file names when saving 2024-03-28 21:26:09 +01:00
csoler
20f4b51bb7 fixed conflicts with upstream/master 2024-03-26 21:07:57 +01:00
csoler
a02d2e63e2 fixed updating save filename, removal of files/dirs, and cleaning before save 2024-03-20 21:00:42 +01:00
csoler
2ebd7617fc added proper remove for files/dirs 2024-03-19 23:22:46 +01:00
csoler
5aa80f2f68 updated master of Retroshare/ to master of libretroshare 2024-03-18 22:52:46 +01:00
csoler
c7fe3059a5
Merge pull request #2849 from defnax/exportfriendslistv2
Added export Friendslist to Profile Page
2024-03-16 20:37:46 +01:00
defnax
5f748b3131 renaming button text 2024-03-16 20:23:28 +01:00
defnax
21c2312952 Added export Friendslist to Profile Page 2024-03-15 20:10:20 +01:00
csoler
a36f7221e7 added new folder capability in collection 2024-03-14 22:44:49 +01:00
csoler
27f0962654 fixed download from RsCollection dialog 2024-03-14 22:12:57 +01:00
csoler
094c80e046 disable save button when files are being hashed 2024-03-13 22:28:39 +01:00
csoler
0697116289 added green color for files being hashed 2024-03-13 22:20:21 +01:00
csoler
7ef81a37ff added auto-update of files being hashed 2024-03-12 21:39:05 +01:00
csoler
5e3434396c fixed a few bugs in counting and model parenting 2024-03-11 13:37:09 +01:00
csoler
c1a6b8fe12 added some debug info in RsCollectionModel 2024-03-10 23:41:10 +01:00
csoler
9ba4ac6362 fixed a few bugs in file counting 2024-03-09 18:31:01 +01:00
csoler
67ff37a0d4 using vectors instead of maps for mCollectionModel data. 2024-03-09 00:03:16 +01:00
csoler
f375912bc5 added checkable items in RsCollectionModel 2024-03-07 22:15:12 +01:00
csoler
80a5705aea
Merge pull request #2844 from csoler/v0.6-Params2
Cleaned up command line parameter handling (to be used with #143)
2024-03-04 23:33:50 +01:00
csoler
c0d222dedf more cleaning in PR 2844 2024-03-04 23:32:50 +01:00
csoler
2a5698c9d3 removed dead code 2024-03-04 23:22:03 +01:00
csoler
be96f417b3 fixed update of tree when changed 2024-03-04 23:00:25 +01:00
csoler
398db7dfe8
Merge pull request #34 from defnax/fixmacos
Fix for macos
2024-03-04 09:34:27 +01:00
csoler
e106959fbd fixed creating new collection 2024-03-01 23:00:17 +01:00
csoler
31c390aa27 simplified usage of RsCollectionDialog in shared files (removed duplicate functionality) 2024-02-29 22:07:52 +01:00
csoler
2ed72a146b fixed basic functionality of RsCollectionModel 2024-02-28 21:56:38 +01:00
defnax
790c169c02 Fix for macos 2024-02-28 19:47:01 +01:00
csoler
885eb640dc starting fixing RsCollection with the new model 2024-02-27 22:10:49 +01:00
csoler
eae4fe86aa added RsCollectionModel to RsCollectionDialog (unfiished) 2024-02-26 22:10:32 +01:00
csoler
a163f716b0
Merge pull request #2841 from defnax/update-trans
update translation
2024-02-25 21:34:23 +01:00
csoler
f425f2fa23
Merge pull request #2842 from defnax/macos_linedit
(macOS)Fixed iconsize issue with fontmetrics on macos
2024-02-25 21:33:29 +01:00
csoler
b0b3d51571
Merge pull request #2845 from defnax/update-invite-icon
update invite icon
2024-02-25 21:32:49 +01:00
csoler
eb0ef1e39b implemented RsCollectionModel 2024-02-25 17:58:51 +01:00
csoler
97309f2f9f started implementing RsCollectionModel 2024-02-24 21:49:50 +01:00
csoler
5bc071b03c fixed compilation 2024-02-24 20:27:18 +01:00
csoler
5071656209 started adapting RsCollectionDialog to the new API of RsCollection 2024-02-24 17:44:13 +01:00
csoler
206da93d99 fixed a few compilation errors in RsCollection handling 2024-02-24 15:55:21 +01:00
csoler
258fe58547 switch RsCollection to using RsfileTree as a base structure instead of a QDomDocument (not compiling yet) 2024-02-23 21:10:13 +01:00
csoler
eccfc7ba71 fixed handling of incoming rscollection files 2024-02-16 13:28:55 +01:00
csoler
142a8e2503 fixed proper handling of language parameter at startup 2024-02-16 10:33:41 +01:00
defnax
91ed9ed894 update readme 2024-02-13 19:04:38 +01:00
defnax
f4f51e53eb update invite icon 2024-02-13 18:46:30 +01:00
csoler
9210e52aae fixed compilation in parameter handling 2024-02-13 16:24:32 +01:00
csoler
c5aface2cb additional step in rewriting commandline parameter handling 2024-02-11 22:16:50 +01:00
csoler
4f56c7dd2f use argstream::usage() in the help message box 2024-02-04 18:26:47 +01:00
defnax
8db6076ce1 update translation 2024-02-04 16:10:35 +01:00
defnax
ae24db1da0 Fixed iconsize issue with fontmetrics on macos 2024-02-03 23:26:25 +01:00
defnax
b7414c078a update translation 2024-02-03 22:37:04 +01:00
csoler
8564a22bef
Merge pull request #2831 from defnax/downloadupload-treefixes
Improved Sharedfiles treesize and font fix for macos
2024-02-02 13:04:22 +01:00
csoler
9437bce60a
Merge pull request #2836 from defnax/chatlobby.fix
Removed "chat rooms" string from tree item
2024-02-01 21:17:46 +01:00
csoler
ed13a2f47f
Merge pull request #2838 from defnax/update-trans
update translations
2024-02-01 20:32:57 +01:00
defnax
388120956d update translations 2024-01-30 23:15:23 +01:00
defnax
e4da288b25
removed "chat rooms" string from tree item 2024-01-29 21:53:09 +01:00
defnax
a523d654ef Improved Sharedfiles treesize and font fix for macos 2024-01-16 14:54:04 +01:00
csoler
dc5131567f
Merge pull request #2830 from defnax/downloadupload-treefixes
Improved downloads and uploads tree display
2024-01-15 21:56:24 +01:00
defnax
3063e74e59 Improved downloads and uploads tree display 2024-01-15 21:43:09 +01:00
csoler
d9f7e96c68 updated master branch to sync with submodules 2024-01-14 16:26:07 +01:00
csoler
0c03e93a47
Merge pull request #2810 from defnax/macos-guide
[macOS] Fixes and Guide updates
2024-01-03 18:02:50 +01:00
defnax
020e9e5927
Enabled delete CFBundleGetInfoString, to update Version string 2024-01-02 15:30:32 +01:00
defnax
d3513ffed0
Merge branch 'RetroShare:master' into macos-guide 2024-01-02 14:58:07 +01:00
defnax
15f2ea4e29 Added to fix from Dock Icon to Show/Hide for macOS platform 2024-01-02 12:58:11 +01:00
csoler
91dd22d8d3
Merge pull request #2819 from thunder2/fix-chatlobby-traymenu
Fixed memory leak when using tray menu of chat lobby and removed doub…
2024-01-01 18:54:22 +01:00
thunder2
f00e8ba18e Fixed memory leak when using tray menu of chat lobby and removed double connect of signals 2024-01-01 15:58:44 +01:00
csoler
73f1da20f0
Merge pull request #2812 from defnax/fix-cmake-macos
[macOS] fix cmake compile on macos to find include and libs path
2024-01-01 15:41:21 +01:00
csoler
24f13a4b88
Merge pull request #2814 from defnax/comments-tree
Added show author for comments tree
2024-01-01 15:40:22 +01:00
csoler
249ff6e8c5
Merge pull request #2816 from defnax/changed-tray-notifyicon-broadcastchat
changed broadcast chat notify icon
2024-01-01 15:38:42 +01:00
csoler
aac9425626
Merge pull request #2820 from defnax/macos-fix
{macOS} Fix for macos alternative chat room notify
2024-01-01 15:36:40 +01:00
defnax
4982e4b664
Fix for macos alternative chat room notify 2023-12-30 16:01:43 +01:00
csoler
267ffc99af
Merge pull request #2765 from PYRET1C/new_token_service
[WIP] Added the new token service in this file
2023-12-30 15:23:25 +01:00
defnax
75ef4dceb5 Added close window shortcut 2023-12-30 00:15:28 +01:00
defnax
79977a0c37 Fixed minimize on macOS with CTRL + M shortcut 2023-12-29 21:34:54 +01:00
defnax
3615ebf05e
Added retroshare-service compile with cmake to guide 2023-12-27 22:50:22 +01:00
csoler
0caf8e79db
Merge pull request #2817 from vladpirlog/fix/friendlistmodel-index-bug
Add row count check in the RsFriendListModel::index method
2023-12-27 20:01:48 +01:00
Vlad Pirlog
b5d40f7964
Add row count check in the RsFriendListModel::index method
Fix bug occurring after login where the app would crash unexpectedly.
Turns out there was an index out of bounds exception occurring in
the RsFriendListModel::index method.
2023-12-27 12:41:25 +02:00
defnax
17407f7ea3
removed not needed dependency libmicrohttp 2023-12-26 17:53:53 +01:00
defnax
5c9c7e8cf6
changed broadcast chat notify icon 2023-12-26 15:54:40 +01:00
defnax
d1393acfa6
Added show author for comments tree 2023-12-26 12:35:29 +01:00
defnax
c0f9f14455
Update GxsCommentTreeWidget.h 2023-12-26 12:30:56 +01:00
defnax
4af12b14e1
Set fusion style for macos 2023-12-24 22:01:03 +01:00
defnax
d395be256b
fix cmake compile on macos to find include and libs path 2023-12-24 18:56:43 +01:00
defnax
eb4a5a4e4d
Fix show messages on macos 2023-12-24 14:54:05 +01:00
defnax
1374d4520f
Merge branch 'RetroShare:master' into macos-guide 2023-12-24 14:51:58 +01:00
csoler
081782c97c
Merge pull request #2806 from defnax/macos-fixes
Added logo for retroshare-service on macOS
2023-12-23 18:02:43 +01:00
defnax
0ec569216b
Added cmake install to the guide 2023-12-23 09:23:53 +01:00
defnax
48510e3818
Added Feedreader include path for libxml2 2023-12-20 12:30:42 -08:00
defnax
50c6b4a8aa
Added needed feedreader depencies 2023-12-20 21:12:18 +01:00
defnax
419d3895be Added a dock menu for macOS 2023-12-19 18:58:16 +01:00
csoler
883d9f9b52
Merge pull request #2801 from csoler/v0.6-BugFixing_30
removed some debug output
2023-12-18 20:48:07 +01:00
defnax
6f982a20ba
Added logo for retroshare-service on macOS 2023-12-18 13:09:11 +01:00
defnax
6fb53d823e
Added icon for retroshare-service for the macOS platform #2802 2023-12-18 13:07:36 +01:00
PYRET1C
351855a5bd Merge branch 'new_token_service' of https://github.com/PYRET1C/RetroShare into new_token_service 2023-12-15 00:05:48 +05:30
PYRET1C
b9e7bb5457 added the new token service in more funcitons and resolved the crash on posting a pulse 2023-12-15 00:05:41 +05:30
Tushar Garg
74e0692f69
Merge branch 'RetroShare:master' into new_token_service 2023-12-15 00:03:01 +05:30
csoler
852ddb96d8
Merge pull request #2763 from defnax/wirecroppicture
[Wire] Fix to hide picture browse button on republish & like view
2023-12-11 22:05:12 +01:00
csoler
7decd2b7b0 removed some debug output 2023-12-11 21:51:17 +01:00
csoler
d27616f28b
Merge pull request #2797 from defnax/improve-macosdoc
Improved macos guide
2023-12-08 21:33:08 +01:00
defnax
e00e94e87f
fix for line 2023-12-05 12:46:06 +01:00
defnax
493f89643c
Update MacOS_X_InstallGuide.md 2023-12-05 11:49:19 +01:00
defnax
ec35e74400
fix last commit 2023-12-01 22:31:01 +01:00
defnax
6fffb322ae
Improved makeOSXPackage.sh file
* Added to ship sounds dir
* Added CFBundleVersion & CFBundleShortVersionString string
* Added to get Git head string for package naming
2023-12-01 22:26:44 +01:00
defnax
31552b1119
Update MacOS_X_InstallGuide.md 2023-11-29 15:32:16 +01:00
defnax
5ee6f6a2e8
Update XCode part 2023-11-29 12:36:23 +01:00
Gioacchino Mazzurco
463a25a048
Update OBS submodule 2023-11-28 22:47:59 +01:00
Gioacchino Mazzurco
67762c1eb0
More attempts at fixing GitlabCI
See https://forum.gitlab.com/t/docker-dind-stops-working-after-12-1-0-update/28664/11
2023-11-27 02:08:21 +01:00
Gioacchino Mazzurco
3f40837b1c
Fix GitlabCI and improve CMake support
Do not use mirrors which may be out of sync
2023-11-27 00:06:12 +01:00
Gioacchino Mazzurco
678357ab2a
Update libretroshare submodule 2023-11-26 22:53:35 +01:00
Gioacchino Mazzurco
ea943369a0
Update libretroshare submodule 2023-11-26 21:56:37 +01:00
csoler
a1fdce2e58
Merge pull request #2795 from thunder2/fix-git-describe
Changed automatic version numbering with "git describe" to split the …
2023-11-26 18:21:38 +01:00
defnax
331cc2e374
added new improved macos package file 2023-11-26 18:09:56 +01:00
defnax
9ae8c7a196
Improved masos compile guide 2023-11-26 18:07:06 +01:00
Gioacchino Mazzurco
c0e564517e
Add script to ease tag cleanup for every developers 2023-11-26 09:52:25 +01:00
Gioacchino Mazzurco
e0873687a2
Update submodules and gitignore 2023-11-26 09:30:52 +01:00
thunder2
441ba17b53 Changed automatic version numbering with "git describe" to split the third part into mini version (leading numbers) and extra version (string after the numbers) 2023-11-26 00:19:59 +01:00
csoler
951be8f9a1 updated to latest commits in submodules 2023-11-25 17:25:16 +01:00
Gioacchino Mazzurco
737eecad9e
retroshare-service CMake fix icons install path 2023-11-20 11:29:13 +01:00
csoler
95ad01c4db
Merge pull request #2790 from defnax/Ui-fixes
UI fixes
2023-11-19 17:25:25 +01:00
csoler
8d243b964f
Merge pull request #2787 from defnax/master-2
Fixed led labels
2023-11-19 17:21:44 +01:00
csoler
6c22125980
Merge pull request #2788 from csoler/v0.6-BugFixing_30
attempt to fix bug in closing GxsChannelComment feed item
2023-11-19 17:21:14 +01:00
csoler
45c701c8e8 removed debug output 2023-11-19 17:16:48 +01:00
csoler
929c04edd5 fixing channel comment feed item crash 2023-11-18 23:46:32 +01:00
defnax
69a84c94a2
Cosmetic layout fixes 2023-11-17 17:10:18 +01:00
csoler
6555cc5792 attempt to fix bug in closing GxsChannelComment feed item 2023-11-17 14:10:14 +01:00
defnax
902f278a19
Fixed led labels 2023-11-15 20:42:56 +01:00
Gioacchino Mazzurco
533e711d47
Merge branch 'master' of github.com:RetroShare/RetroShare 2023-11-15 09:37:47 +01:00
csoler
0e48422d1f updated retroshare to latest libretroshare 2023-11-12 12:07:56 +01:00
csoler
470a104418 updated Retroshare to the latest submodule commits 2023-11-12 11:23:54 +01:00
csoler
746bac8325
Merge pull request #2786 from csoler/v0.6-BugFixing_30
cleaning up debug info
2023-11-12 11:20:28 +01:00
csoler
9db3208f72 improved colored output on login 2023-11-11 23:51:14 +01:00
csoler
48da2d195a removed some debug output 2023-11-11 23:51:13 +01:00
thunder2
2c8e7d2a51 Updated OpenSSL to 1.1.1w in Windows native build 2023-11-10 22:36:24 +01:00
thunder2
bc125a75bf Fixed download of msys2 during Windows build 2023-11-10 22:36:23 +01:00
csoler
b30b575955
Merge pull request #2783 from csoler/v0.6-BugFixing_30
cleaning up webui/jsonapi interaction code
2023-11-07 22:10:39 +01:00
csoler
97fe92d1e7 updated master branch of Retroshare/ to latest commits in master branches of OBS and libretroshare 2023-11-07 14:05:39 +01:00
thunder2
eb7e2ec8e6 Enabled ANSI color support in Windows console for retroshare-service 2023-11-06 23:04:48 +01:00
thunder2
cd81d69357 Removed not needed files of tor from Windows installer 2023-11-06 23:04:33 +01:00
thunder2
befc473624 Fixed download of tor in Windows native build 2023-11-06 23:04:09 +01:00
csoler
a64fda1fb8 improved user commandline webui startup user experience 2023-11-05 16:10:42 +01:00
csoler
53313670f5 cleaning up webui/jsonapi interaction code 2023-11-04 23:41:49 +01:00
csoler
adf5a41a77
Merge pull request #2782 from csoler/v0.6-BugFixing_30
fixed colored output
2023-11-03 17:54:02 +01:00
csoler
62513a0d23 made initialization of webui as early as possible to avoir the need to restart jsonapi 2023-11-01 22:08:51 +01:00
csoler
fb78591baf fixed colored output 2023-11-01 15:52:02 +01:00
csoler
999fc143bf
Merge pull request #2780 from defnax/service-text-coloring
update output colors
2023-11-01 14:04:22 +01:00
csoler
9f0134f32d
Merge pull request #2781 from csoler/v0.6-BugFixing_30
GUI fixes
2023-11-01 13:56:02 +01:00
defnax
c502b0df06 coloring hidden outputs 2023-10-30 22:43:17 +01:00
csoler
b02acfae4b fixed missing event handler registration 2023-10-29 21:06:09 +01:00
csoler
ab61149cb1 fixed missing event handler registration 2023-10-29 21:05:02 +01:00
csoler
55651e73d9 made ConnectFriendWizard to accept retroshare links 2023-10-29 20:47:00 +01:00
defnax
ab7deede57 clean the color code from the text 2023-10-29 18:24:25 +01:00
csoler
315fb77d63 fixed forum and chnanel group feed items reacting to changes to the channel/forum group 2023-10-28 21:03:21 +02:00
defnax
36282e750d update output colors 2023-10-26 18:31:37 +02:00
csoler
c52e84d709
Merge pull request #2778 from defnax/service-text-coloring
Added colors for the service output
2023-10-25 23:09:45 +02:00
defnax
9f89ac42e7 Fix spacing 2023-10-25 12:13:15 +02:00
defnax
8814cbd9f2 color improvements for accounts display 2023-10-25 11:54:51 +02:00
defnax
168f36bc21 Added colors for the output 2023-10-24 22:44:40 +02:00
csoler
71a096f817
Merge pull request #2777 from csoler/v0.6-BugFixing_30
fixed non working expand button in forum feed
2023-10-21 14:48:31 +02:00
csoler
d26f7db319 fixed non working expand button in forum feed 2023-10-21 14:35:47 +02:00
Gioacchino Mazzurco
98c27fcf6d
Update libretroshare submodule 2023-10-18 18:57:11 +02:00
Gioacchino Mazzurco
d84b981e9a
Update libsam3 submodule 2023-10-18 18:56:04 +02:00
Gioacchino Mazzurco
e67abc36af
Update OBS submodule 2023-10-18 12:23:32 +02:00
Gioacchino Mazzurco
9b7149f16e
Update OBS submodule 2023-10-18 11:44:58 +02:00
Gioacchino Mazzurco
eab5c4bf4c
Updated gui build script according to new friendserver naming 2023-10-18 10:36:19 +02:00
Gioacchino Mazzurco
9d406ba26f
Fix inconsistence in friendserver QMake build option naming 2023-10-18 10:34:17 +02:00
Gioacchino Mazzurco
ededce7bd6
Merge branch 'master' of github.com:RetroShare/RetroShare 2023-10-13 18:56:00 +02:00
Gioacchino Mazzurco
e9d4cacac5
Attempt to fix udp-discovery-cpp submodule ref 2023-10-13 18:55:01 +02:00
csoler
5db6eb0359 updated retroshare base dir to latest version of libretroshare 2023-10-12 21:03:00 +02:00
csoler
7eb08c8706
Merge pull request #2776 from csoler/v0.6-BugFixing_30
Small Bug Fixing
2023-10-12 20:21:36 +02:00
csoler
d8bca5c56d removed some debug output 2023-10-12 20:18:53 +02:00
csoler
d83709d519 fixed implicit type warning 2023-10-12 20:18:36 +02:00
csoler
7a873c3b53 fixed compilation on ubuntu 18.04 2023-10-12 20:18:21 +02:00
csoler
606baf6f3e updated webui, libbitdht and libretroshare to latest submodule commit 2023-10-08 23:49:16 +02:00
csoler
6d105680d6
Merge pull request #2775 from csoler/v0.6-BugFixing_30
Bug fixing
2023-09-27 19:33:59 +02:00
csoler
96ae492bad
Merge pull request #2774 from csoler/v0.6-BugFixing_31
Quick bug fix in friend list.
2023-09-27 19:33:23 +02:00
csoler
712c7e5fb1 Merge remote-tracking branch 'upstream/master' into v0.6-BugFixing_30 2023-09-24 19:50:41 +02:00
csoler
a99f686fd1 restricted SPAM/STAR/TAGS to inbox, and made msg summary list refer to current box only 2023-09-23 17:53:12 +02:00
csoler
41069a0fa5 added missing removal of event handler in jsonapi and webui settings 2023-09-23 17:31:24 +02:00
csoler
7c90a2365c
Merge pull request #2772 from csoler/v0.6-BugFixing_30
Improved JsonApi / WebUI interaction
2023-09-22 22:55:41 +02:00
csoler
034bddf1ef made registered services list non editable 2023-09-22 22:50:45 +02:00
csoler
4cb36a5b69
Merge pull request #2769 from defnax/thumbnailfixchannelpost
Fix transparency for channel post thumbnails
2023-09-19 15:19:21 +02:00
csoler
11c07cd7c3 moved endResetModel() call to the endof internal data update in RsFriendListModel 2023-09-19 15:10:29 +02:00
csoler
0e0430a222 added more debug info to comment tree widget 2023-09-19 15:08:52 +02:00
csoler
b606b26dd3 fixed double allocation of webui page 2023-09-15 20:15:29 +02:00
csoler
5251427cbf improved webui and jsonapi config pages 2023-09-12 22:28:54 +02:00
csoler
5e62af44e5 fixed compilation 2023-09-12 13:50:43 +02:00
csoler
7e9a5a4244
Merge pull request #2352 from RetroPooh/keyring1
keyring - fix removing accepted keys; allow multi-select
2023-09-12 09:44:16 +02:00
csoler
c1bf4fb27f
Merge branch 'master' into keyring1 2023-09-12 09:43:13 +02:00
csoler
c877a6e5c8 improved login of on/off and parameter display in webui/jsonapi config pages 2023-09-11 22:55:42 +02:00
defnax
d5088caac6 fix second part for transparency check 2023-09-11 21:54:54 +02:00
csoler
d83f0125f3 improved UI of webUI and JsonAPI and interaction between these two (unfinished) 2023-09-10 17:49:51 +02:00
thunder2
d0b4bfdaa1 Fixed Linux compile of FeedReader plugin 2023-09-10 15:25:13 +02:00
csoler
c90fab0136 added help for JSON API page 2023-09-08 20:48:54 +02:00
defnax
43afcf3f98 Fix to use RGBA32 2023-09-05 21:10:38 +02:00
csoler
313bbaaae2
Merge pull request #2771 from csoler/v0.6-BugFixing_30
fixed bug in ModelIndex creation in channel post view, and implemented arrow key navigation
2023-09-05 16:51:14 +02:00
csoler
8a20ab33b4 fixed bug in ModelIndex creation in channel post view, and implemented arrow key navigation 2023-09-04 21:58:45 +02:00
csoler
f8a38aa821
Merge pull request #2770 from csoler/v0.6-BugFixing_30
V0.6 bug fixing 30
2023-09-01 09:08:36 +02:00
csoler
0ed32eb597 removed export menu entry (duplicates functionality, and wasnt connected anyway) 2023-08-31 23:27:18 +02:00
csoler
013786a7b7 disabled external port+address on auto-tor mode 2023-08-31 23:18:24 +02:00
csoler
d80951cd53 added missing comment 2023-08-31 23:18:06 +02:00
defnax
1efed9d436 Fix transparency for channel post thumbnails 2023-08-29 14:28:18 +02:00
csoler
17562e727e
Merge pull request #2764 from csoler/v0.6-BugFixing_30
Bug fixing
2023-08-27 16:28:22 +02:00
PYRET1C
5433e85323 added the new token service in this file 2023-08-20 18:19:05 +05:30
csoler
811b3b3658 fixed bug not showing icons/text button on loading 2023-08-18 13:21:28 +02:00
defnax
1b8bee4262 Removed hardcorded stylesheet from PulseReplySeperator
* Fixed some dark style issues
2023-08-15 23:12:54 +02:00
defnax
3a07a268ca Added to store last used group filter 2023-08-15 21:57:42 +02:00
csoler
fd9f31987d attempt at fixing crash with gtk2 style when the proper environment variable is not set 2023-08-15 21:14:32 +02:00
csoler
eeacb4500d removed some debug output 2023-08-15 21:13:53 +02:00
csoler
e8872c6780
Merge pull request #2761 from csoler/v0.6-BugFixing_30
bug fixing
2023-08-15 19:42:46 +02:00
defnax
4a20e1b4d2 Fix to hide picture browse button on republish & like view
* Fix to hide picture browse button on republish & like view
2023-08-14 21:27:46 +02:00
csoler
685cc29415
Merge pull request #2758 from defnax/wirecroppicture
[Wire] Added crop picture feature for wire background picture
2023-08-11 09:52:18 +02:00
csoler
f6bcfb549a made delete button and delete menu item call the same functions, so as to make the actions identical 2023-08-10 23:41:51 +02:00
csoler
234a510d6f fixed possible crash in channel feed item being deleted during async loading 2023-08-10 23:28:03 +02:00
csoler
e5b111c8bb
Merge pull request #2760 from csoler/v0.6-BugFixing_30
added "copy http link" action to board posts when applicable
2023-08-07 14:48:34 +02:00
csoler
a81caa3ac1 added comment about latest changes 2023-08-06 23:18:12 +02:00
csoler
a382d58b68 fixed icon in To column of Sent box 2023-08-06 23:12:06 +02:00
csoler
3fa0b8f6d4 fixed tooltip for popularity and items in boards 2023-08-04 13:57:34 +02:00
csoler
e54322521e fixed popularity and items at friends in Board details dialog 2023-08-04 13:52:27 +02:00
csoler
46e8db7d6d fixing crash when deleting forum feed items while loading 2023-08-03 20:22:30 +02:00
csoler
5ca3b15188 added "copy http link" action to board posts when possible 2023-08-03 18:41:31 +02:00
csoler
39ae560885
Merge pull request #2759 from csoler/v0.6-BugFixing_30
GUI bug fixing
2023-07-31 20:03:40 +02:00
csoler
24dd71d15f fixed open file / preview file in TransfersDialog 2023-07-30 20:51:51 +02:00
csoler
583431852c fixed copy comment in channels/post/comment (and GXS comments in general) 2023-07-30 18:47:56 +02:00
csoler
4867d396fe
Merge pull request #2757 from csoler/v0.6-BugFixing_30
bug fixing in UI
2023-07-25 23:21:16 +02:00
defnax
311ac03790 Update wire-notify.svg 2023-07-25 20:33:09 +02:00
csoler
ade297f257 attempt at fixing unread msg count to display before GXS service tab is displayed 2023-07-24 23:45:12 +02:00
defnax
74049d1b22 Added crop picture feature for wire background picture
* Added crop picture feature for wire background picture
* Fix smooth transformation for pixmaps
* Added stylesheet for label_masthead
* Edit profile on profile page feature
* New svg icons for wire
2023-07-24 23:19:17 +02:00
csoler
1512819200 fixed compilation on arch 2023-07-24 18:35:21 +02:00
csoler
7a4558a3da added missing change in previous commit 2023-07-24 18:35:05 +02:00
csoler
5c52509e27
Merge pull request #2754 from csoler/v0.6-BugFixing_30
Various bug fixes
2023-07-19 20:35:11 +02:00
csoler
10feb45bce fixed Board posts links copy on right-click 2023-07-18 20:03:46 +02:00
csoler
030bc46d26 fixed sorting of TO column in Sent mails 2023-07-18 15:15:21 +02:00
thunder2
13ff7f4e65 Fixed Linux compile of TheWire 2023-07-18 14:34:08 +02:00
csoler
7a3c9f7efe
Merge pull request #2746 from PYRET1C/edit_account
This commit gives the edit account feature in the wire.
2023-07-17 09:40:30 +02:00
PYRET1C
cbe4fca9ae just making the actual path to relative path. 2023-07-15 19:36:48 +05:30
csoler
584dd64308
Merge pull request #2749 from csoler/v0.6-BugFixing_30
Bug fixing in channels post files
2023-07-04 22:16:00 +02:00
PYRET1C
59c6eabad9 Revert "Changes to the .pro file for the newly made files."
This reverts commit 3cc077ff381dbf64687ed2d3abf04d0d29921675.

This commit adds the new files to the .pro file.
2023-07-02 12:48:38 +05:30
PYRET1C
680c1942df Revert "Changes to the .pro file for the newly made files."
This reverts commit 3cc077ff381dbf64687ed2d3abf04d0d29921675.

bad commit
2023-07-02 11:29:02 +05:30
PYRET1C
3cc077ff38 Changes to the .pro file for the newly made files. 2023-07-02 10:42:40 +05:30
csoler
b4d6a7b4e4 fixed sorting of files in channels/post/files 2023-07-01 23:18:51 +02:00
csoler
d95518d17e fixed DL output path in DL list 2023-07-01 18:06:12 +02:00
csoler
fe8c81e84a fixed open file / open dir in channel/post/files 2023-07-01 00:00:46 +02:00
csoler
df68d03953 fixed item not switching to "Open/Play" when DL is finished in channel/post/files 2023-06-30 17:24:55 +02:00
csoler
bb533eefc8
Merge pull request #2747 from csoler/v0.6-BugFixing_30
2 important fixes
2023-06-29 14:23:36 +02:00
csoler
a782122742 fixed copy file link in channel post files 2023-06-28 21:48:07 +02:00
PYRET1C
ae855098cf This commit gives the edit account feature in the wire. 2023-06-27 22:16:37 +05:30
csoler
afba23882e stop GxsGroupFrameDialog from stealing the focus on summary update 2023-06-27 14:00:04 +02:00
csoler
463383e25c auto-switch to progressive instead of random when the user doesnt want random FT strategy. Added more info about this. 2023-06-26 21:07:48 +02:00
csoler
a75133d554
Merge pull request #2745 from csoler/v0.6-BugFixing_30
removed question before sending invite, since the request is not in auto mode
2023-06-24 20:49:22 +02:00
csoler
c278239f97 added warning about random FT strategy on windows 2023-06-20 21:57:51 +02:00
csoler
438489fb01 removed question before sending invite, since the request is not in auto mode 2023-06-20 21:27:41 +02:00
csoler
7fb0fb49f1
Merge pull request #2743 from csoler/v0.6-BugFixing_30
fixed uninitialized memory read in FileDetail struct causing weird dates in search dialog
2023-06-13 11:12:39 +02:00
csoler
9bbc832906 added missing initialization of "trust friends with banned files" checkbox 2023-06-04 21:30:26 +02:00
csoler
e8187dbeab moved FileDetail structure in SearchDialog where it belongs 2023-06-04 17:59:17 +02:00
csoler
2a1991fe85 Merge remote-tracking branch 'upstream/master' into v0.6-BugFixing_30 2023-06-04 16:48:42 +02:00
csoler
0c9b086bd1 added missing handle to modify mTrustFriendNodesWithBannedFiles 2023-06-04 15:12:23 +02:00
csoler
3185829219
Merge pull request #2742 from csoler/v0.6-ChannelsGUI_03
fixed sorting of files->status in channels all files list
2023-06-03 23:52:56 +02:00
csoler
3f8e8805a2 fixed uninitialized memory read in FileDetail struct causing weird dates in search dialog 2023-06-03 23:51:31 +02:00
csoler
0f41d8bf46 fixed sorting of files->status in channels all files list 2023-06-01 20:30:19 +02:00
thunder2
ad9d566767 FeedReader: Added processing of enclosure in RSS feed 2023-05-28 13:47:13 +02:00
thunder2
f9ca6cd3e1 FeedReader: Show error when some post could not be created 2023-05-28 13:47:12 +02:00
thunder2
8422d3fc8c Added copy and save of image to AspectRatioPixmapLabel 2023-05-28 13:47:12 +02:00
csoler
e829292eaf
Merge pull request #2741 from thunder2/fix_x86
Fixed x86 build
2023-05-28 11:03:33 +02:00
thunder2
d642fde9d5 Fixed x86 build 2023-05-28 00:55:23 +02:00
csoler
c579f0b0d1
Merge pull request #2738 from csoler/v0.6-FriendServer3
improved debug outpug of friendserver code
2023-05-27 14:34:18 +02:00
csoler
266f84759e
Merge pull request #2727 from PYRET1C/browse_image
[WIP] This is the gui part of the commit where the wire feed is refreshed
2023-05-27 14:33:23 +02:00
PYRET1C
852ec16c6a Removed extra refresh function calls and break statements. 2023-05-26 22:20:05 +05:30
csoler
238c6eda9f improved debug outpug of friendserver code 2023-05-25 21:35:12 +02:00
csoler
578cafe1e2
Merge pull request #2735 from ppetr/master
Fix misplaced `fsitem.h` in HEADERS and add build artifacts to `.gitignore`
2023-05-25 10:34:26 +02:00
csoler
9a23e3acdf
Merge pull request #2737 from thunder2/post-title-clickable
Make post title in board clickable after change to ElidedLabel
2023-05-23 13:54:04 +02:00
csoler
6ca9529027
Merge pull request #2736 from defnax/wirefixes11
Fix loading group tree settings
2023-05-23 13:52:40 +02:00
csoler
1d0c05fa93
Merge pull request #2734 from csoler/v0.6-Channels-002
Fixing Channel posts counting
2023-05-22 23:46:26 +02:00
PYRET1C
87282618a4 Changed the follow status changed to new wire 2023-05-23 00:27:30 +05:30
thunder2
e46f1c285c Make post title in board clickable after change to ElidedLabel 2023-05-22 07:51:40 +02:00
csoler
f667daba98 made rsGxsForum provide posts in a hierarchy, to ease the display from JSON API clients, and fixed the unread posts counting 2023-05-20 22:05:37 +02:00
defnax
fc1f1caa03 Fix loading group tree settings 2023-05-20 16:46:58 +02:00
PYRET1C
d3233dbc03 Revert "name changes"
This reverts commit b40e5e34bc491d31cf08ba27aebda45fbbd4a3ab.

bad commit
2023-05-19 17:06:10 +05:30
PYRET1C
b40e5e34bc name changes
name changes
2023-05-19 17:00:50 +05:30
csoler
c970e94221 moved update of comment count to libretroshare 2023-05-17 17:18:47 +02:00
Petr
44e04ea0c1 Advance submodule retroshare-webui to its latest master version
As mentioned in https://github.com/RetroShare/RetroShare/issues/2732#issuecomment-1549228796.
2023-05-16 10:47:54 +02:00
Petr
93f010b8ab
Merge branch 'RetroShare:master' into master 2023-05-15 22:15:23 +02:00
Petr
b9e4bac510 Add various build artifacts to .gitignore 2023-05-15 22:14:07 +02:00
Petr
1ea18a583f Remove fsitem.h from the list of headers
It is now a part of libretroshare.
2023-05-15 22:07:30 +02:00
csoler
e25d8e50fc changed naming of posts to items, since it counts votes and comments as well 2023-05-15 21:57:09 +02:00
csoler
6775a64ed5 factored the collection of latest channel post versions and added a proper counting for new/unread posts 2023-05-15 21:54:27 +02:00
csoler
c95a0edd60
Merge pull request #2730 from defnax/wirefixes11
Fixed margins to remove wasting spaces [wire]
2023-05-15 11:14:38 +02:00
csoler
d70e343cb2
Merge pull request #2731 from csoler/v0.6-BugFixing_29
added missing updateIcon() in messageUserNotify
2023-05-15 11:13:53 +02:00
csoler
712ea96f24
Merge pull request #2733 from ppetr/master
Update the tracked `libretroshare` submodule.
2023-05-15 11:13:16 +02:00
Petr
01506127c5 Re-enable creation of AppVeyor artifacts to provide nightly builds
Fixes #2651.

They were disabled in 05116b8311b708fa24f696142548cddd2dc48ef7 in 2019.
But since then in 2021 the retention [policy] has changed and artifacts
are now kept only for 1 month (for free accounts).

[policy]: https://www.appveyor.com/blog/2021/03/30/artifacts-retention-policy-update/
2023-05-15 10:33:54 +02:00
Petr
65b1a5bce2 Update the tracked libretroshare submodule.
Fixes #2732.
2023-05-14 22:06:44 +02:00
defnax
f54be58088 Use ElidedLabel on PeerItem to not stretch the widget
* Use ElidedLabel on PeerItem to not stretch the widget
2023-05-12 20:41:27 +02:00
PYRET1C
726c42852c This commit removed the refresh button and edited some events for the retro share wire. 2023-05-09 23:18:34 +05:30
csoler
9c6bfc7847 added missing updateIcon() in messageUserNotify 2023-05-09 10:33:34 +02:00
thunder2
67dd1999a5 Windows Build: Added update of MSYS2 to prepare script 2023-05-08 14:48:00 +02:00
thunder2
e1934fd9b0 Added missing include stdint.h to Histogram.h 2023-05-08 08:00:55 +02:00
defnax
77d275c7f0 Fixed margins to remove wasting spaces
Fixed margins to remove wasting spaces
Fixed to hide desc groupbox instead of only desc text,
2023-05-07 20:22:24 +02:00
csoler
782944727c
Merge pull request #2724 from csoler/v0.6-BugFixing_29
fixed keeping new zoom size when resizing the channel post window
2023-05-07 17:10:13 +02:00
csoler
082603917c fixed crash in setting posted items as read 2023-05-07 17:09:00 +02:00
csoler
2f2495455f Merge remote-tracking branch 'upstream/master' into v0.6-BugFixing_29 2023-05-07 17:07:59 +02:00
thunder2
40adcd2db1 Windows Build Environment: Added missing target "error" to git-log.bat 2023-05-06 21:50:47 +02:00
thunder2
180b7d3703 FeedReader: Added process of response code 403 and added user agent 2023-05-06 20:36:08 +02:00
thunder2
ff183ee98b FeedReader: Reduced the height of the dialog for creating a feed 2023-05-06 20:36:08 +02:00
thunder2
af562cb4ca FeedReader: Added shrink of images for board post 2023-05-06 20:36:08 +02:00
thunder2
e25c148c27 FeedReader: Changed save type for IndicateConfigChanged in service to SAVE_NOW 2023-05-06 20:36:07 +02:00
thunder2
b14fecfc2a FeedReader: Message of a local feed can be added as forum and board message 2023-05-06 20:36:07 +02:00
thunder2
bcb4e52768 Added methods to set title, notes and link on PostedCreatePostDialog from outside 2023-05-06 20:36:06 +02:00
thunder2
63390fddee FeedReader: Renamed enum RsFeedAddResult to RsFeedResult 2023-05-06 20:36:06 +02:00
thunder2
186976e209 FeedReader: The feed can be moved with drag and drop to a folder 2023-05-06 20:36:05 +02:00
thunder2
571f709b50 FeedReader: The feed can be used as source for board 2023-05-06 20:36:05 +02:00
thunder2
ecffb3cb7f FeedReader: Fixed download of favicon 2023-05-06 20:36:04 +02:00
thunder2
7070a6cad6 FeedReader: Fixed compile of FeedReader plugin 2023-05-06 20:36:04 +02:00
csoler
a3eae71f0b
Merge pull request #2728 from csoler/v0.6-Turtle-001
Simple change to make SearchDialog use RsEvents to catch turtle search results
2023-05-06 18:09:38 +02:00
Tushar Garg
9c950affcf
Merge branch 'RetroShare:master' into browse_image 2023-05-05 16:08:01 +05:30
csoler
93d7589a94 removed unused notifyQt calls to notify turtleSearch results 2023-05-04 22:30:41 +02:00
csoler
beed6a08c8 made SearchDialog to use RsEvents in order to catch turtle search results 2023-05-04 22:30:06 +02:00
PYRET1C
dbddf7166f This is the gui part of the commit where the wire feed is refreshed if there is any event published. 2023-05-02 23:50:37 +05:30
csoler
ea346b5d2a fixed keeping new zoom size when resizing the channel post window 2023-04-27 22:46:07 +02:00
csoler
0bd4cdae19
Merge pull request #2717 from defnax/ui-fixesv2
Fixed to get resizable people page
2023-04-26 11:05:58 +02:00
csoler
669982bc5b
Merge pull request #2718 from defnax/wirefixes10
Picture attachments improved [Wire]
2023-04-26 10:21:35 +02:00
csoler
e69f788f85
Merge pull request #2723 from csoler/v0.6-BugFixing_29
removed double saving of distant chat permissions (GUI + libretroshar…
2023-04-26 10:20:25 +02:00
csoler
a04ab8664f removed double saving of distant chat permissions (GUI + libretroshare) leading to inconsistencies 2023-04-25 21:26:26 +02:00
csoler
242b5229d1
Merge pull request #2721 from csoler/v0.6-BugFixing_28
removed multiple references to temporary passed accross threads, caus…
2023-04-25 11:34:19 +02:00
csoler
35e08e3b66 fixed keeping post sizes when selelecting unread posts 2023-04-25 11:33:37 +02:00
csoler
0ff4426d72 removed multiple references to temporary passed accross threads, causing random crashes 2023-04-23 22:47:33 +02:00
defnax
f06506ec54 Corrected checkbox text 2023-04-23 19:31:30 +02:00
csoler
e1e95a1562
Merge pull request #2719 from csoler/v0.6-BugFixing_28
fixed layout update problem when switching channels
2023-04-23 13:15:01 +02:00
csoler
2ab012261b fixed wrong column size when first showing the channel posts tab 2023-04-22 22:50:53 +02:00
csoler
3e35ce4ddd improved the logic to make the channel layout update faster 2023-04-22 18:16:04 +02:00
csoler
9d956f6126 fixed layout update problem when switching channels 2023-04-22 16:19:04 +02:00
csoler
7d70ecdd65
Merge pull request #2716 from csoler/v0.6-BugFixing_28
fixed right-click menu on board posts
2023-04-22 15:04:59 +02:00
csoler
2cb8736804 fixed update of forum when marking msg as read/unread with children 2023-04-22 15:02:32 +02:00
defnax
a71d6e2430 Picture attachments improved
* Added a remove button to clear pictures
* Improved picture attachments
2023-04-20 23:26:57 +02:00
defnax
7858db9b2c Use ElidedLabel for post name Label 2023-04-20 19:48:13 +02:00
defnax
d04c28cffc Fixed to get reizable people page
* Fixed to get resizable people page
* Moved text for auto ban as tooltip, keep short text for the checkbox
* Removed empty wasting spacer from Boards bar
2023-04-20 19:00:51 +02:00
csoler
6476cfa4e0
Merge pull request #2711 from defnax/copyimage-clipboard
update paste image icon
2023-04-19 20:56:34 +02:00
csoler
1ebff07067
Merge pull request #2715 from thunder2/imageutil
Moved RSTextBrowser::checkImage to ImageUtil for use in MimeTextEdit
2023-04-19 20:46:37 +02:00
csoler
83a5d472d4
Merge pull request #2714 from defnax/fix-boards-posteditem
Use ElidedLabel for title in PostedItem
2023-04-19 20:45:10 +02:00
csoler
690c869444
Merge pull request #2713 from thunder2/boards_elidedlabel
Use ElidedLabel for title in BoardsPostDisplayWidget
2023-04-19 20:44:40 +02:00
csoler
4a69380848 fixed right-click menu on board posts 2023-04-19 20:43:12 +02:00
thunder2
7b28bf5256 Moved RSTextBrowser::checkImage to ImageUtil for use in MimeTextEdit 2023-04-19 01:12:22 +02:00
defnax
c250b229ed Added ElidedLabel for title in PostedItem 2023-04-18 20:10:52 +02:00
thunder2
1400d91ef6 Use ElidedLabel for title in BoardsPostDisplayWidget 2023-04-18 14:15:59 +02:00
defnax
bf7c2f7b10 update paste image 2023-04-17 22:35:10 +02:00
csoler
44bb2c0f05
Merge pull request #2710 from defnax/copyimage-clipboard
Added copy image to clipboard feature
2023-04-17 22:16:39 +02:00
defnax
3004505832 Added copy image to clipboard feature 2023-04-17 21:01:57 +02:00
csoler
8dfa772782
Merge pull request #2706 from thunder2/SaveImage
Moved QAction for saving an image from customContextMenu of GxsForumT…
2023-04-17 19:56:17 +02:00
csoler
a61c32d84c
Merge pull request #2705 from defnax/boardspasteicon
Added paste icon for paste button - boards
2023-04-17 19:48:19 +02:00
csoler
b64e4d5645
Merge pull request #2708 from thunder2/CreateGxsForumMsg
Removed include of ui_CreateGxsForumMsg.h from CreateGxsForumMsg.h
2023-04-17 13:59:00 +02:00
csoler
7911622d17
Merge pull request #2703 from defnax/wireaccountbox
Display on account selection box the headShot image
2023-04-17 13:55:34 +02:00
csoler
09d293909a
Merge pull request #2709 from thunder2/PostedCreatePostDialog
Removed unnecessary include in PostedCreatePostDialog.h
2023-04-17 13:51:49 +02:00
csoler
66b2d7c81c
Merge pull request #2685 from csoler/v0.6-Channels-001
Improvement of channel version sync (Needs PR #80)
2023-04-16 23:36:22 +02:00
thunder2
4802de9e52 Removed include of ui_CreateGxsForumMsg.h from CreateGxsForumMsg.h 2023-04-16 16:29:47 +02:00
thunder2
09dd588e7f Removed unnecessary include in PostedCreatePostDialog.h 2023-04-16 16:27:39 +02:00
thunder2
dceda36f6e Moved QAction for saving an image from customContextMenu of GxsForumThreadWidget and ChatWidget to RSTextBrowser 2023-04-15 22:21:34 +02:00
defnax
cd14b2e9bb Added paste icon for boards 2023-04-15 19:30:00 +02:00
defnax
bf0ae5e1ee Dsplay on account selection box the headshot image 2023-04-14 23:19:47 +02:00
csoler
02ad585c2c
Merge pull request #2701 from PYRET1C/browse_image
This PR adds a browse button for the wire for image addition functionality.
2023-04-14 14:18:23 +02:00
PYRET1C
b543281bb3 this commit changed the QFileDialog::getOpenFileName to misc::getOpenFileName 2023-04-14 17:24:37 +05:30
PYRET1C
df8e6b9f96 Revert "this commit changed the QFileDialog::getOpenFileName to misc::getOpenFileName"
This reverts commit 5fae434f03d5e4eccb0abbf0573e40006cac9a00.
2023-04-14 17:21:45 +05:30
PYRET1C
5fae434f03 this commit changed the QFileDialog::getOpenFileName to misc::getOpenFileName 2023-04-14 17:19:32 +05:30
csoler
1ff68e097c
Merge pull request #2696 from defnax/toastersettings
moved popup settings for toasters
2023-04-14 09:50:57 +02:00
csoler
29c66b91e1
Merge pull request #2700 from defnax/pastepicture-boards
Added paste picture from clipboard feature for picture posts
2023-04-14 09:13:09 +02:00
csoler
a7b2091bb8 added a waiting cursor when loading a channel 2023-04-13 21:51:37 +02:00
csoler
e786669dc2
Merge pull request #2702 from csoler/v0.6-BugFixing_28
fixed crash due to calling a method in board item after deletion
2023-04-13 21:35:40 +02:00
csoler
3c583f6724 fixed crash due to calling a method in board item after deletion 2023-04-12 23:11:45 +02:00
PYRET1C
f06fa656b8 This commit added a browse button the wire for image addition functionality. 2023-04-12 22:32:17 +05:30
defnax
6590a17eb6 Added paste picture from clipboard feature for picture posts 2023-04-11 21:59:00 +02:00
thunder2
c90ea518c5 FeedReader: Fixed embedding of images with https 2023-04-10 21:17:49 +02:00
csoler
2baec2baab
Merge pull request #2699 from PYRET1C/autodownload_size
Autodownload size
2023-04-10 16:43:36 +02:00
Tushar Garg
fe92431cb6 This is the UI part of the auto download adjustable size feature. 2023-04-10 07:06:59 +05:30
Tushar Garg
19de7c627b Merge branch 'Auto_download' 2023-04-09 22:12:04 +05:30
Tushar Garg
23dd7270f9 Revert "Merge remote-tracking branch 'upstream/master'"
This reverts commit c390af58449d96f2178d5b4c3de03277e455225c, reversing
changes made to 1553508776059b465e5f4863ef2f30511b4b5b7b.

bad commit needs to be reverted
2023-04-09 22:07:35 +05:30
Tushar Garg
2fe8bcc8fd Revert "Merge remote-tracking branch 'upstream/master'"
This reverts commit c390af58449d96f2178d5b4c3de03277e455225c, reversing
changes made to 1553508776059b465e5f4863ef2f30511b4b5b7b.

bad commit needs to be reverted
2023-04-09 22:03:45 +05:30
Tushar Garg
b3f55c5b51 Revert "Revert "Adeed a new spin box in the gui to track the variable which stores the maximum size limit allowed for autodownload in channels.""
This reverts commit e89ad86da05b5636303e24bd9d3f3944e592bd2c.

revert the reverted commits
2023-04-09 18:48:15 +05:30
Tushar Garg
e89ad86da0 Revert "Adeed a new spin box in the gui to track the variable which stores the maximum size limit allowed for autodownload in channels."
This reverts commit 7dabc1ff9b896943cc8df76aa5e99abdb5368a40.

Forgot to open a new branch
2023-04-09 18:34:08 +05:30
Tushar Garg
c390af5844 Merge remote-tracking branch 'upstream/master' 2023-04-09 18:21:59 +05:30
Tushar Garg
7dabc1ff9b Adeed a new spin box in the gui to track the variable which stores the maximum size limit allowed for autodownload in channels.
This spin box was linked to the variable from the p3gxschannel.h file. This spin box has 8GB as it's default value.
2023-04-09 18:10:16 +05:30
csoler
7299ace57a re-enabled channel debug output 2023-04-08 18:04:22 +02:00
csoler
1553508776
Merge pull request #2697 from thunder2/webui
Changed path of webui submodule to relative path
2023-04-08 17:42:05 +02:00
thunder2
05c3f1f6e9 Changed path of webui submodule to relative path 2023-04-07 19:14:05 +02:00
defnax
22a9cf4236 moved popup settings for toasters 2023-04-07 16:23:46 +02:00
csoler
2723022a7e Merge remote-tracking branch 'upstream/master' into v0.6-Channels-001 2023-04-04 16:26:14 +02:00
csoler
e7ff1b15b7
Merge pull request #2694 from csoler/v0.6-BugFixing_27
fixed bug preventing completed files removal to clear the files counter
2023-04-03 22:09:32 +02:00
csoler
783a0a586f fixed bug preventing completed files removal to clear the files counter 2023-04-03 22:06:42 +02:00
thunder2
b124222d87 Windows build environment:
- Fixed download of Tor binaries
- Fixed download of doxygen
- Updated MSYS2 installer
- Changed build of WebUI
2023-04-02 13:19:59 +02:00
Tushar Garg
4f1bdbca70 commiting changes 2023-04-02 15:22:36 +05:30
csoler
71f87cf839 Merge branch 'v0.6-Channels-001' of github.com:csoler/RetroShare into v0.6-Channels-001 2023-03-31 16:17:08 +02:00
csoler
c81bdd9932 fixed merge 2023-03-31 16:16:13 +02:00
csoler
cccc6d4251
Merge branch 'master' into v0.6-Channels-001 2023-03-31 16:07:10 +02:00
csoler
8475a7424d
Merge pull request #2681 from csoler/v0.6-BugFixing_20
Attempt at not reloading full channel data at every change (needs PR #81)
2023-03-30 10:33:38 +02:00
csoler
cc93a6da1a using orange color for unread comment bubble in channel post widget, and fixed the color update when new comment arrives 2023-03-29 20:46:41 +02:00
csoler
48c959c858 fixed bug in setting msg as read 2023-03-27 21:27:07 +02:00
csoler
eb018b2fd0
Merge pull request #2691 from defnax/toaster-fix
Fixed Toasters
2023-03-27 21:15:38 +02:00
csoler
09e66cbde4 code cleaning/disabled debug output 2023-03-26 23:03:09 +02:00
csoler
e63ff4d7db made setAllMsgAsRead faster in channels, avoiding to reload all posts 2023-03-26 22:49:08 +02:00
defnax
5f54db577c Fixed Toasters
Fixed Online, Download Complete, Mail & FR Toaster
2023-03-26 20:00:13 +02:00
csoler
191d7ac96e improved debug output 2023-03-26 16:29:12 +02:00
csoler
3316d75630 fixed bug accessing a potentially deleted object of the parent thread 2023-03-26 16:29:00 +02:00
csoler
16137f60ff
Merge pull request #2690 from PYRET1C/Download_sound_bug
Download sound bug
2023-03-25 22:35:58 +01:00
Tushar Garg
e8354aa3d3 Just added a empty line in the header file section. 2023-03-26 02:18:03 +05:30
Tushar Garg
43d8432dcc This commit fixed the Download_Complete sound not working when a download is completed. 2023-03-26 02:12:49 +05:30
csoler
e4910cf8fd fixed update of comment/unread comment count when a new version of a msg arrives 2023-03-24 13:48:48 +01:00
csoler
dec1d3068b fixed 2 bugs in post display 2023-03-23 22:07:28 +01:00
csoler
141ee0b7e0 fixed bug in updating filtered posts 2023-03-23 21:13:38 +01:00
csoler
aba0ffa581 finished the system to perform lighter updates of channels 2023-03-23 17:04:22 +01:00
csoler
a37ee4673f half-implemented the system to perform lighter updates of channels 2023-03-22 09:08:27 +01:00
csoler
548ef00960 enabled channel post model debug 2023-03-21 21:08:30 +01:00
csoler
8f9d99a232
Merge branch 'master' into v0.6-BugFixing_20 2023-03-21 21:06:58 +01:00
csoler
7bf4213011
Merge pull request #2689 from csoler/v0.6-WebUI-001
added RSNewWebUI as a submodule so as to help packaging
2023-03-15 17:46:09 +01:00
csoler
7314de8a80 added RSNewWebUI as a submodule so as to help packaging 2023-03-12 21:00:33 +01:00
csoler
3b9886a747 fixed channel mode debug output 2023-03-12 17:43:09 +01:00
csoler
d9c9363b05
Merge pull request #2687 from csoler/v0.6-BugFixing_26
fixed filtering of messages in Mail
2023-03-10 16:17:21 +01:00
csoler
9eb2096a71 fixed filtering of messages in Mail 2023-03-08 20:44:47 +01:00
csoler
04d10d7fd3 quick bug fix for crash in server page 2023-03-07 09:28:16 +01:00
csoler
9aa0619992
Merge pull request #2678 from defnax/fixupdatetree
Fixed update groupbox counting for members in circle creator
2023-03-04 17:21:12 +01:00
csoler
266a4252de
Merge pull request #2679 from jolavillette/AddJpegExtensionForStickers
Allow .jpeg files as stickers
2023-03-04 17:19:41 +01:00
csoler
0f7e9ef3d1
Merge pull request #2680 from defnax/fixwirepictures
Fixed picture show
2023-03-04 17:18:52 +01:00
csoler
b3dba19b72
Merge pull request #2655 from RetroPooh/tor-status-fix
tor status fix for unconfigured, add update on settings change; fix i2p out led status
2023-03-04 17:18:02 +01:00
csoler
36de6d34b5 switch from createPost() to createPostV2() in channels 2023-03-03 00:08:33 +01:00
csoler
97265dddab updated algorithm for sorting channel posts with debug info and collection of all post versions 2023-03-02 22:55:58 +01:00
csoler
9d575ddca1 implemented new algorithm for sorting channel posts 2023-03-02 09:46:16 +01:00
csoler
01c63a6d41
Merge pull request #2684 from csoler/v0.6-BugFixing_25
fixed crash when canceling DL from channel files list
2023-02-18 20:48:07 +01:00
csoler
456d742cd1 only show unread and grid view buttons when posts tab is selected 2023-02-18 20:31:25 +01:00
csoler
5069a1a10e fixed filtering of files in channels 2023-02-18 17:01:29 +01:00
csoler
f6c584183b fixed crash when canceling DL from channel files list 2023-02-17 23:56:35 +01:00
csoler
43fd84e777 attempt at not reloading full channel data at every change 2023-02-09 23:32:19 +01:00
csoler
c06da99757 attempt at not reloading full channel data at every change 2023-02-09 23:27:43 +01:00
defnax
dcc4242ae6 Fixed picture show 2023-02-01 22:53:18 +01:00
jolavillette
ec97bb975e Allow .jpeg files as stickers 2023-02-01 21:45:22 +01:00
defnax
7c8e80e89b Fixed update groupbox counting for members 2023-01-31 21:40:15 +01:00
csoler
9442d87644
Merge pull request #2676 from csoler/v0.6-BugFixing_20
re-created PR 2382 (#Phenom) to match new layout based on submodules
2023-01-29 20:56:32 +01:00
csoler
a9c512c1f0 re-created PR 2382 (#Phenom) to match new layout based on submodules 2023-01-29 20:53:25 +01:00
csoler
3c17e34ed6
Merge pull request #2675 from csoler/v0.6-BugFixing_20
GUI improvements/fixes
2023-01-29 17:50:34 +01:00
csoler
30c2ff4b5e fixed bug introduced by last commit 2023-01-29 14:13:13 +01:00
csoler
7a49099952 added sorting of selected items on top in moderator selection list of forum edit dialog 2023-01-28 21:10:45 +01:00
csoler
95e9d76af9 fixed forum moderators not selected in edit dialog 2023-01-28 16:47:36 +01:00
csoler
641281048f added force recheck of possibly modified files when the button is used 2023-01-28 16:29:36 +01:00
csoler
2842af3a6e
Merge pull request #2672 from defnax/fixesv2
Changed Moderators list to use with a Label, less space is used then …
2023-01-28 14:18:36 +01:00
csoler
3dca053fb5
Merge pull request #2670 from csoler/v0.6-BugFixing_20
fixed advanced search not using browsable/distant/own files
2023-01-28 14:16:06 +01:00
csoler
25ea4f746c
Merge pull request #2673 from defnax/fixesv3
Stylesheet fix
2023-01-28 14:15:05 +01:00
csoler
7082372446
Merge pull request #2674 from defnax/fixesv4
Added to show on New Board/New Channel feed last updated time
2023-01-28 14:13:22 +01:00
defnax
c518fd0e42 Added to show on New Board/New Channel feed last updated time
Added to show on New Board/New Channel feed last updated time
2023-01-28 13:48:26 +01:00
defnax
1915187374 Stylesheet fix 2023-01-28 13:45:18 +01:00
defnax
943a6cdd4d Changed Moderators list to use with a Label, less space is used then before
Changed Moderators list to use with a QLabel, less space is used then before
2023-01-28 13:43:23 +01:00
csoler
38725628b0 fixed advanced search not using browsable/distant/own files 2023-01-23 20:23:18 +01:00
csoler
a0de2e76db
Merge pull request #2669 from csoler/v0.6-ImprovedGUI2
switched all image outputs to jpeg format instead of png
2023-01-19 09:52:26 +01:00
csoler
e2d9238ded
Merge pull request #2666 from csoler/v0.6-BugFixing_20
Bug Fixing
2023-01-19 09:49:43 +01:00
csoler
d833ed185a added comments 2023-01-17 22:37:32 +01:00
csoler
ffe76f03a2 fixed comparisions, accounting for multiple inversions in the code 2023-01-17 22:33:07 +01:00
csoler
b87e450207 invert lower/greater conditions to be consistent with how comparisons are performed in rsexpr.h 2023-01-17 21:52:27 +01:00
csoler
6a28727e76 fixed date search 2023-01-17 20:00:55 +01:00
csoler
41317b6fe3 Merge remote-tracking branch 'upstream/master' into v0.6-BugFixing_20 2023-01-17 18:49:56 +01:00
csoler
e60ee730b4 fixed bug in quality of html-embedded images 2023-01-16 22:23:58 +01:00
csoler
7aacfb9aef added auto-choose of image format when transparency is present 2023-01-16 22:11:44 +01:00
csoler
de1b8f08d2 added auto-chose of image format if there is no transparency 2023-01-16 21:24:16 +01:00
csoler
516e4f7c12 added parameter to specify format to optimizeImageSize() 2023-01-16 21:11:18 +01:00
csoler
31bdd6c226 keep PNG for avatars 2023-01-16 20:16:44 +01:00
csoler
0a8f4b1b6e switched all image outputs to jpeg format instead of png 2023-01-16 19:53:20 +01:00
csoler
03e244a7af added handling of weak parameters certificate rejection case 2023-01-15 15:19:46 +01:00
csoler
737a753c2c fixed bug in range search 2023-01-08 18:41:17 +01:00
csoler
54cffac521 simplified logic of interval calculation for exact size search 2023-01-08 10:44:32 +01:00
csoler
fa071a1c50 improved expression widget so as to convert size Equal searches into a proper range 2023-01-07 15:08:10 +01:00
csoler
f65a761c9d
Merge pull request #2663 from csoler/v0.6-BugFixing_20
Bug fixing
2023-01-04 21:36:47 +01:00
csoler
e60fead024
Merge pull request #2665 from AskOldIch/master
Added new association with "new" extensions
2023-01-04 21:35:42 +01:00
AskOldIch
2cf95b410d
Added icons association with extensions
- .webm -- basically is full video container (video+audio)
- .weba -- is only audio stream
- .webp -- is a picture
2023-01-03 16:57:42 +00:00
AskOldIch
c1b7105321
Added extensions to SearchDialog
- .webm -- basically is full video container (video+audio)
- .weba -- is only audio stream
- .webp -- is a picture
2023-01-03 16:54:03 +00:00
AskOldIch
cae7797b55
Added "previewable" for .webm and .weba extension
- .webm -- basically is full video container (video+audio)

- .weba -- is only audio stream
2023-01-03 16:47:15 +00:00
csoler
1447306d65 not erasing clipboard when no links are selected 2022-12-28 21:15:27 +01:00
csoler
96a2f18571 fixed preserving order of links copied from search dialog results 2022-12-28 21:02:05 +01:00
csoler
0ce6b5f375 attempt to fix the display of new msgs and icon in GXS toolbar items at start 2022-12-27 23:01:26 +01:00
csoler
5d3737f9b4
Merge pull request #2662 from csoler/v0.6-BugFixing_20
Bug fixing
2022-12-25 17:35:30 +01:00
csoler
09c040e3f0
Merge pull request #2661 from defnax/featuretoexpandv2
[Messages] Feature to expand To field V2
2022-12-24 15:55:53 +01:00
csoler
74dbef06be fixed default page in preferences->network 2022-12-24 10:29:50 +01:00
csoler
c0024e3487 hide/disable unnecessary Tor widgets in auto-tor mode and show outgoing I2P widgets 2022-12-24 10:29:08 +01:00
defnax
d3d672dc0d Added feature to expand To field
* Added feature to expand To field
* Fixed TreeVersion
2022-12-20 21:51:21 +01:00
Gioacchino Mazzurco
12ef7240e9
Update bitdht submodule after bdboot.txt path fix 2022-12-12 18:06:54 -03:00
Gioacchino Mazzurco
e2eb0d27a2
Update submodules 2022-12-12 16:08:56 -03:00
csoler
97390d3f44
Merge pull request #2658 from csoler/v0.6-BugFixing_20
Full rework on Mail system
2022-12-12 13:55:05 +01:00
csoler
992d5c30d3 fixed deletion of outgoing messages 2022-12-07 18:30:03 +01:00
csoler
bc0bef07de new attempt to fix limited sidebar width in mail composer 2022-12-06 16:19:26 +01:00
csoler
1bcbbf1248 fixed bold/boxsize in Mails 2022-12-06 15:47:02 +01:00
csoler
ad584e0fff removed max size in friend selection widget of Msg composer 2022-12-06 15:25:16 +01:00
csoler
93746f5075 fixed removing/displaying message tags in tags menu 2022-12-04 21:18:41 +01:00
csoler
7b78b87c65 fixed coumn visibility depending on box 2022-12-04 18:46:19 +01:00
csoler
a7570b70eb fixed proper setting of "from" field when heterogeneous destinations are used 2022-12-03 23:45:31 +01:00
csoler
8185dba0d8 fixed bug causing wrong "from" field in sent messages 2022-12-03 15:59:05 +01:00
csoler
6327ccf6ae using explicit column resize since Qt4 is not supported anymore 2022-12-03 14:06:21 +01:00
csoler
0528bf4b50 fixed quick view filters, loading of drafts (from previous format), uniqueness of message Ids 2022-12-01 21:02:10 +01:00
Gioacchino Mazzurco
83e3dc708b
Use non-EOL ubuntu base image for GitlabCI 2022-12-01 13:36:36 -03:00
csoler
006f4c53be removed mMsgTagIds since tags are not in RsMailStorageItem struct 2022-11-30 15:25:38 +01:00
csoler
0db41deb9f fixed bugs in Mail display 2022-11-28 17:08:02 +01:00
csoler
7b0d501c1e fixed trick for own Ids in GxsIdTreeWidgetItem 2022-11-27 20:37:05 +01:00
csoler
6a2886da40 fixed some UI bugs in Mail 2022-11-27 18:36:42 +01:00
csoler
ea4df6306b fixed multiple glitches in Mail UI 2022-11-25 15:15:19 +01:00
csoler
2d024c0d6f made GxsIdChooser to auto update when identities are added/created/modified 2022-11-23 21:48:09 +01:00
csoler
302e87e476 fixing some UI errors in Mail 2022-11-23 21:18:11 +01:00
csoler
8bcb531cd3 fixed a few glitches in Mail GUI 2022-11-22 23:08:42 +01:00
csoler
3ac97b24a8 saving current work on big pass over Mail 2022-11-21 14:18:25 +01:00
RetroPooh
0b5cddb299 tor status fix for unconfigured, add update on settings change;
fix i2p out led status
2022-11-18 23:07:38 +03:00
csoler
ba4982f2ca changed Mail interface to use the generic MsgAddress type instead of the GxsId/RsPeerId combination 2022-11-15 11:03:23 +01:00
csoler
3155e0bb60
Merge pull request #2646 from csoler/v0.6-BugFixing_20
Bug fixing
2022-11-12 22:02:03 +01:00
csoler
4e0bd19182 fixed uninitialized memory read in ConnectFriendWizard 2022-11-10 19:48:45 +01:00
csoler
3e4fed59bc
Merge pull request #2645 from csoler/v0.6-TorControl3
added some documentation to the friend server
2022-11-09 19:55:16 +01:00
csoler
03a576589e allow user to supply his own Tor executable 2022-11-07 21:10:55 +01:00
csoler
d6aa58d52c added some documentation to the friend server 2022-11-05 20:17:55 +01:00
csoler
f22671dda9
Merge pull request #2643 from csoler/v0.6-TorControl3
V0.6 tor control3
2022-11-04 22:44:33 +01:00
csoler
f7c22af995 improved debug output 2022-11-02 21:03:20 +01:00
csoler
486aa83680 added parameter to supply user defined tor executable path 2022-11-02 21:00:24 +01:00
csoler
1474dfdd66
Merge pull request #2640 from csoler/v0.6-TorControl3
added control over received peers from FS
2022-10-28 14:05:10 +02:00
csoler
666f01452b added auto-test of saved onion address for FS 2022-10-28 11:41:41 +02:00
csoler
4d386e9cf1 added online status for FS 2022-10-25 14:19:57 +02:00
csoler
24ad687c7f added control over received peers from FS 2022-10-25 09:37:42 +02:00
csoler
b7d3042bd9
Merge pull request #2638 from csoler/v0.6-TorControl3
Added more info to display in GUI part or FS
2022-10-20 20:18:31 +02:00
csoler
5847b08766 added display of friend status in FS 2022-10-19 17:24:58 +02:00
csoler
9009326970
Merge pull request #2637 from defnax/fixbwgraph
fix storing graph style
2022-10-14 09:28:58 +02:00
defnax
2702edab30 fix storing graph style 2022-10-13 23:10:24 +02:00
csoler
efa00b2802 changed the underlying logic of FS to allow UI to get information about ongoing connections 2022-10-13 16:24:14 +02:00
csoler
0eda08f881
Merge pull request #2636 from csoler/v0.6-TorControl3
fixed compilation on windows
2022-10-06 20:30:19 +02:00
csoler
f3ee68411d added missing documentation in BinInterface::readdata(), and fixed bug in FdBinInterface not implementing readdata() correctly 2022-10-06 14:26:53 +02:00
csoler
d307b46c15 added async testing of friend server 2022-10-03 23:06:08 +02:00
csoler
6c4e918b36 fixed compilation on windows 2022-10-03 18:35:52 +02:00
csoler
c3c12a1a47
Merge pull request #2634 from csoler/v0.6-TorControl3
fixed bug in friendserver randomly dropping some incoming packets
2022-09-28 09:28:29 +02:00
csoler
87be1e353e fixed bug in friendserver randomly dropping some incoming packets 2022-09-27 23:56:17 +02:00
csoler
2c67817581 fixed font problem introduced in last commit 2022-08-21 12:18:01 +02:00
csoler
430bed95de
Merge pull request #2631 from csoler/v0.6-FileTransfer
using actual limits for max TR/s in the GUI
2022-08-19 18:38:51 +02:00
csoler
c167fb8448 using actual limits for max TR/s in the GUI 2022-08-19 18:36:11 +02:00
csoler
8595425e0b
Merge pull request #2629 from csoler/v0.6-TokenSystem
continue cleaning the old token system
2022-08-16 22:32:13 +02:00
csoler
b4d2904adf fixed two bugs in Create/Edit circle dialog, causing crashes 2022-08-16 22:12:37 +02:00
csoler
b784b6a3e8 Merge remote-tracking branch 'upstream/master' into v0.6-TokenSystem 2022-08-16 21:47:39 +02:00
csoler
ad7ae6905c
Merge pull request #2630 from thunder2/fix-crash-forummsgitem
Fixed crash when closing forum message item in activity stream with s…
2022-08-05 22:10:24 +02:00
thunder2
807232ffa5 Fixed crash when closing forum message item in activity stream with set as read and remove 2022-08-05 19:02:48 +02:00
csoler
82f981c9db continue cleanign the old token system 2022-08-04 19:10:47 +02:00
csoler
bc03a9b019
Merge pull request #2627 from csoler/v0.6-TokenSystem
added "Loading..." message when loading posts in channels
2022-07-18 14:51:42 +02:00
csoler
43fb720a98 fixed update of Forum msg creation window 2022-07-18 14:49:58 +02:00
csoler
bbe2fdc5df Merge remote-tracking branch 'upstream/master' into v0.6-TokenSystem 2022-07-18 10:12:10 +02:00
csoler
d143355a09 added "Loading..." message when loading posts in channels 2022-07-13 16:00:47 +02:00
thunder2
4cba9815f8 Added Doxygen to Windows MinGW build 2022-07-12 21:09:16 +02:00
csoler
c280d030aa
Merge pull request #2623 from csoler/v0.6-TokenSystem
V0.6 token system
2022-07-12 15:19:33 +02:00
csoler
a1c33bf172 removed unused include 2022-07-11 23:15:09 +02:00
csoler
0488293a1f removed more token queue system from forums and comments 2022-07-10 21:34:24 +02:00
csoler
ac4b9b2971 removed token system from GxsCommentDialog 2022-07-09 22:33:42 +02:00
csoler
1089d1470e update posts list after vote 2022-07-09 15:49:33 +02:00
thunder2
e0c3f27469 Fixed generating changelog in Windows MinGW build 2022-07-08 22:02:20 +02:00
csoler
73279db2c5 removed tokens from boards and added missing blocking API calls 2022-07-06 17:13:34 +02:00
csoler
cdc650540b removed token queue from CreateCircleDialog 2022-07-04 17:25:11 +02:00
csoler
54fd77822d fixed blocking API for votes 2022-06-30 14:43:04 +02:00
thunder2
f4f799ec58 Windows MinGW build:
- Upgraded MSYS2
- Upgraded OpenSSL-1.1.1p
- Added build of WebUI
2022-06-23 01:40:47 +02:00
csoler
cf61cb3780 fixed bug introduced by last commit 2022-06-22 21:07:29 +02:00
csoler
299ad1b1e1 removed TokenQueue in CommentsTreeWidget for the display of comments 2022-06-22 19:07:35 +02:00
csoler
819dc173e0 removed TokenQueue from GxsMessageFrameWidget 2022-06-22 15:43:57 +02:00
csoler
6411d5507f fixed compilation 2022-06-22 15:36:27 +02:00
csoler
fd3a434e71 removed token queue traces left in IdEdit and IdDetail dialogs 2022-06-22 15:15:48 +02:00
csoler
1ced2ff7f9 cleaned CirclesDialog.cpp 2022-06-22 15:15:09 +02:00
csoler
8ab9adacef removed token queue from circles 2022-06-22 15:13:07 +02:00
csoler
52dffddf64
Merge pull request #2619 from chelovechishko/chat_amusement
gui: chat: add auto shrink chattextedit
2022-05-11 21:23:48 +02:00
csoler
1056be1899
Merge pull request #2609 from defnax/removeavatarbtn
Added remove Avatar button
2022-05-11 21:06:18 +02:00
csoler
83b7c21f5f
Merge pull request #2618 from csoler/v0.6-BugFixing_19
fixed copy RS link in search dialog when clicking on a file with multiple names
2022-05-11 20:42:45 +02:00
chelovechishko
ca0a441f3b gui: file: add power to change font size for displayed shared files
Added one more settings group "File".
2022-05-09 00:27:50 +09:00
chelovechishko
ed0ea3aa01 gui: chat: add power to vote distant participant
If identity got deleted, then banned one should start
this distant conversation, if i am not mistaken.
2022-05-08 20:38:35 +09:00
chelovechishko
c6c6e11bec gui: chat: add auto shrink chattextedit
To shrink text edit form when it is convenient for browsing text browser.
It just shrink/unshrink the edit here and there when switching between chat rooms.

P.S. user should not resize chattextedit when it's shrinked
P.P.S. okey, there is no "unshrink" maybe, but hope it's not big deal
2022-05-03 19:26:45 +09:00
csoler
a61bd0a378 fixed copy RS link in search dialog when clicking on a file with different names 2022-05-01 21:53:00 +02:00
csoler
56b6196fb2
Merge pull request #2613 from csoler/v0.6-TorControl3
fixed bug causing hidden nodes to crash at start
2022-04-16 18:57:48 +02:00
csoler
20335cf134 fixed bug causing hidden nodes to crash at start 2022-04-16 18:45:38 +02:00
Gioacchino Mazzurco
de87938e6e
Update libretroshare submodule 2022-04-13 12:01:01 +02:00
G10h4ck
7521253ea8
Merge pull request #2612 from PhenomRetroShare/Fix_MacOS_Build
Fix MacOS build
2022-04-10 12:47:02 +02:00
defnax
52d1e505ad Added remove Avatar button
* Added remove Avatar button
2022-04-05 16:39:28 +02:00
csoler
958fac8e3c
Merge pull request #2606 from csoler/v0.6-ForumsGUI
turned drop menu for forum display type into a tool button group
2022-04-03 21:51:31 +02:00
csoler
1085592449 turned drop menu for forum display type into a tool button group 2022-04-02 16:53:29 +02:00
RETROSHARE Phenom
36d3f1899e Fix MacOS build
Need to use:
CONFIG+=rs_macos11.1 CONFIG+=no_rs_sam3 CONFIG+=no_rs_sam3_libsam3
CONFIG+=c++14
2022-04-02 14:30:18 +02:00
csoler
7532efd5fc
Merge pull request #2602 from csoler/v0.6-cmake
added cmake list for files in GUI
2022-03-30 17:52:12 +02:00
csoler
2cff9c8eb2 fixed compilation 2022-03-30 17:06:49 +02:00
csoler
a2580c9224
Merge pull request #2601 from defnax/fixclassicstylesheet
Fixed missed changes for classic stylesheet
2022-03-30 15:22:53 +02:00
csoler
606f02c69d
Merge pull request #2604 from csoler/v0.6-BugFixing_17
improved display in GxsGroupDialog
2022-03-30 15:19:19 +02:00
csoler
065e6946c7 improved display in GxsGroupDialog 2022-03-29 22:02:56 +02:00
Gioacchino Mazzurco
2b4e571332
Update submodule 2022-03-29 09:17:04 +02:00
csoler
b95d016c03
Merge pull request #2603 from PhenomRetroShare/Fix_ElidedLabelWhenNotDefinedFontSize
Fix ElidedLabel when Font size is not defined.
2022-03-28 20:55:04 +02:00
Phenom
3540b1ae38 Fix ElidedLabel when Font size is not defined. 2022-03-28 19:05:07 +02:00
Gioacchino Mazzurco
28017566f1
Update submodule 2022-03-28 17:28:13 +02:00
Gioacchino Mazzurco
d9e94298e6
Update libretroshare submodule 2022-03-28 12:18:18 +02:00
Gioacchino Mazzurco
07710f6a6c
Update submodules after MacOS build fix 2022-03-28 12:03:22 +02:00
Gioacchino Mazzurco
6be9bb579b
Fix CMake build from source tarball
Set maximum tested version to C++17
Detect companion libraries from CMakeLists.txt not .git
2022-03-28 12:01:55 +02:00
csoler
b3e6d96f3b attempt to add samv3 to compilaiton 2022-03-27 21:45:27 +02:00
csoler
0cc813d093 fixed naming of columns that colided because of common names 2022-03-27 19:35:23 +02:00
csoler
dc32b10ed6 added needed flags for GXS 2022-03-27 19:34:09 +02:00
csoler
8daa4dbf21 fixed include 2022-03-26 20:55:38 +01:00
csoler
dd653e5462 moved to cpp files some column defines that otherwise collapsed in .h files 2022-03-26 20:55:10 +01:00
csoler
a0ac041582 fixed compilatin 2022-03-25 23:35:12 +01:00
csoler
bf1b3ed69a fixed some bugs 2022-03-25 22:05:28 +01:00
csoler
40336c2337 added root cmake file in retroshare-gui 2022-03-25 18:39:14 +01:00
csoler
094e54d122 added cmake list for files in GUI 2022-03-25 16:23:09 +01:00
csoler
574e67e7d5 updated to latest git submodules commit 2022-03-25 10:28:08 +01:00
defnax
bc85c5255e Fixed missed changes for classic stylesheet 2022-03-21 21:06:49 +01:00
csoler
000d019947
Merge pull request #2598 from defnax/classicqssfix
Improved classic stylesheet
2022-03-20 23:37:02 +01:00
csoler
e6ec177445
Merge pull request #2599 from defnax/filetypeicons
changed file type icons
2022-03-20 23:09:11 +01:00
defnax
962124f18d Update picture.svg 2022-03-18 22:13:23 +01:00
defnax
f8470068cf changed file type icons 2022-03-18 19:04:26 +01:00
defnax
327a254e7c Improved classic stylesheet
* Use light blue for selection colors
2022-03-16 18:56:09 +01:00
csoler
af9fee0419
Merge pull request #2596 from defnax/iconfixes
Fixed missed icons
2022-03-12 20:26:06 +01:00
defnax
ae0f294c4b Fixed missed icons 2022-03-10 21:35:59 +01:00
csoler
016f38829d
Merge pull request #2593 from csoler/v0.6-FriendServer2
added list of already received peers from FS so that we do not request them again
2022-03-09 21:35:42 +01:00
csoler
bb2aee2b3c
Merge pull request #2595 from csoler/v0.6-BugFixing_17
fixed certificate pasting bug
2022-03-09 21:34:59 +01:00
csoler
97829de0ba fixed certificate pasting bug 2022-03-09 21:32:26 +01:00
csoler
6ca3d64511 added list of already received peers from FS so that we do not request them again 2022-03-08 21:28:42 +01:00
G10h4ck
f5ee9c92c8
Merge pull request #2591 from sehraf/pr_fix_94bd0994
RetroShare-gui: Rename DATA_DIR to RS_DATA_DIR to be consistent
2022-03-01 17:49:05 +01:00
sehraf
daa8eaea9e
RetroShare-gui: Rename DATA_DIR to RS_DATA_DIR to be consistent
fixes 94bd09940722d1e4ca5dc8ab09488fd149f96aa5
2022-03-01 17:40:23 +01:00
csoler
3cfbb3e6d6
Merge pull request #2583 from defnax/cleanupoldiconsandnewsvg
removed & clean up old icons, replaced some by svg
2022-02-27 20:08:07 +01:00
defnax
a6deaa2a27 Added back icons 2022-02-27 14:30:59 +01:00
Gioacchino Mazzurco
d757af5c56
CMake refinements 2022-02-25 21:31:51 +01:00
Gioacchino Mazzurco
fcaba0e65f
Quieter CMake option for GitlabCI
Avoid GtilabCI suppressing log with:
Job's log exceeded limit of 4194304 bytes.
Job execution will continue but no more output will be collected.
2022-02-25 18:26:42 +01:00
defnax
701b2e4ca1
Merge branch 'RetroShare:master' into cleanupoldiconsandnewsvg 2022-02-25 18:05:41 +01:00
Gioacchino Mazzurco
52aba1be18
Update continuous integration 2022-02-25 16:57:07 +01:00
Gioacchino Mazzurco
b87d554c2a
Update submodules libretroshare libbithdht 2022-02-25 15:08:48 +01:00
Gioacchino Mazzurco
d0c4d1ade2
retroshare-service CMake and WebUI support
Fix retroshare-service webui terminal password checking
Install WebUI along with retroshare-service
2022-02-25 13:35:55 +01:00
csoler
1ddba795d4
Merge pull request #2587 from csoler/v0.6-BugFixing_16
Bug fixing in PostedItem
2022-02-23 23:28:31 +01:00
defnax
f3d2b4f2d0 Fixed missed icon 2022-02-23 14:01:28 +01:00
defnax
a073c09644 Fixed to remove icons 2022-02-23 13:50:51 +01:00
csoler
c0cac9ec2d fixed Boards item in feeds to display a constant-aspect-ratio picture using ZoomableLabel 2022-02-22 21:46:05 +01:00
csoler
3dfcb58ae1
Merge pull request #2582 from csoler/v0.6-FriendServer2
Improving the logic of certificate handling UI
2022-02-16 00:22:12 +01:00
csoler
42fa8d4b3c fixed adding external IPs and DNS in old cert format 2022-02-15 22:04:54 +01:00
thunder2
93c1cafdc4 Updated external libraries for Windows MinGW build
- zlib 1.2.11
- bzip2 1.0.8
- miniupnpc 2.2.3
- openssl 1.1.1m
- speexdsp 1.2.0
- libxml2 2.9.12
- libxslt 1.1.34
- curl 7.81.0
- sqlcipher 4.5.0
- libmicrohttpd 0.9.75
- ffmpeg 4.4
- xapian 1.4.19
2022-02-15 20:51:49 +01:00
defnax
6177b4dcdc removed unused old icons 2022-02-15 20:40:11 +01:00
csoler
53d43324db fixed hide some options with old certificate format 2022-02-14 21:51:30 +01:00
csoler
b9a4cdcd50 fixed up using invite flags to populate certificate comments 2022-02-13 22:38:32 +01:00
csoler
2428ebf6c3 removed re-parsing of certificate 2022-02-12 18:32:36 +01:00
defnax
aa5e40828e removed old icon 2022-02-12 12:22:52 +01:00
defnax
235ef6f509 removed old icons & cleanup 2022-02-12 11:49:50 +01:00
defnax
dc0cddae7e removed clean up old icons, replaced some by svg 2022-02-12 00:07:23 +01:00
csoler
24d5fc9eca show info that is parsed from the cert that was generated 2022-02-11 22:17:13 +01:00
csoler
6fcb3e8972 added entries to control what we add in the certificate 2022-02-11 16:20:52 +01:00
csoler
33800e9cb9 removed/hid the certificate and ID from settings since it duplicates functionality of HomePage with different options 2022-02-11 15:23:14 +01:00
csoler
c3c171125d improved the logic of certificate handling in UI 2022-02-11 15:10:28 +01:00
csoler
8105bfcbc8
Merge pull request #2579 from csoler/v0.6-FriendServer2
Improvements on friend server
2022-02-09 22:20:34 +01:00
csoler
5270459a5c Merge remote-tracking branch 'upstream/master' into v0.6-FriendServer2 2022-02-09 22:19:08 +01:00
csoler
e86e0ac05a merged 2022-02-09 22:16:02 +01:00
csoler
36ec036a43
Merge pull request #2568 from PhenomRetroShare/Fix_LibRetroShare_HEAD
Fix to follow libretroshare master
2022-02-09 22:01:16 +01:00
csoler
c7e8136ab5
Merge pull request #2578 from defnax/forumsfontmetricstreefix
Fix default font metrics for forums tree
2022-02-09 21:57:34 +01:00
csoler
fc89ba0fb7 fixed calling onion address testing only when editing is done, and updating of DNS in certificate 2022-02-09 15:40:01 +01:00
csoler
a1502c2742 added missing spacer 2022-02-09 13:55:59 +01:00
thunder2
ba7f072144 Fixed clean of Windows MinGW build 2022-02-07 17:27:42 +01:00
G10h4ck
5fdeeb788a
Merge pull request #2580 from zapek/master
Display the name of short invites properly
2022-02-05 18:41:48 +01:00
Phenom
2aee2f0085 Fix to follow libretroshare master 2022-02-05 18:25:19 +01:00
David Gerber
4a133f903c
Merge pull request #1 from zapek/display-shortinvite-name
Display the name of short invites properly
2022-02-05 18:18:36 +01:00
David Gerber
63ee463086
Display the name of short invites properly
Instead of [Unknown], since the name is actually in the short invite.
2022-02-05 18:12:04 +01:00
csoler
fe1b00dfc7 Merge remote-tracking branch 'upstream/master' into v0.6-FriendServer2 2022-02-04 21:27:10 +01:00
csoler
e2cda9fded improved UI for FS 2022-02-04 15:12:13 +01:00
csoler
58e3c04801 disable friend server on non tor node 2022-02-04 14:49:39 +01:00
thunder2
f125539d79 Added new parameter for Windows MinGW build
- Service
- Friend Server
- embedded Friend Server
2022-02-02 18:11:00 +01:00
defnax
fa9bc09cec changed default tree font color to black for light/builtin style 2022-02-01 20:38:14 +01:00
defnax
631b9b5f7a Fix default font metrics for forums tree 2022-02-01 20:01:38 +01:00
G10h4ck
ef456b2ef7
Merge pull request #2576 from hunbernd/fix/msys2-2
Some enhancements for the msys2 build scripts
2022-02-01 12:53:35 +01:00
csoler
d7eac8f5e4
Merge pull request #2573 from defnax/messagestreefontsfix
Added to fix font metrics for messages tree
2022-01-31 21:10:19 +01:00
csoler
37c781aa9f
Merge pull request #2575 from csoler/v0.6-FriendServer2
Fixing FriendServer
2022-01-31 21:06:25 +01:00
hunbernd
1de12129da Friendserver support 2022-01-31 16:30:55 +01:00
csoler
af0bea49c5 fixed using of rs_socket_error() 2022-01-31 15:32:04 +01:00
hunbernd
a3f6d516e7 Fix webui compilation
Copy files, instead of using the symlink.
2022-01-31 01:05:32 +01:00
hunbernd
00f82602d2 Added support for other msys2 environments 2022-01-31 00:16:15 +01:00
defnax
8b5c4bc7c5 fixed the notification icon 2022-01-28 20:56:06 +01:00
defnax
dadf59ac04 Added to fix font metrics for messages tree 2022-01-27 22:09:47 +01:00
csoler
cb50bed0fc
Merge pull request #2567 from defnax/Sharedfilestreefix
Fix default fonts & font metrics for Shared Files Tree
2022-01-23 14:50:05 +01:00
csoler
79d1575f71
Merge pull request #2555 from PhenomRetroShare/Add_GeneralFontSizeFactor
Add General Font Size Factor
2022-01-23 14:32:36 +01:00
csoler
3e86d760e9
Merge pull request #2558 from defnax/webpstickers
Add webp support for stickers load
2022-01-22 16:40:42 +01:00
defnax
57cee64966 Fix default fonts & font metrics for Shared Files Tree 2022-01-21 11:35:08 +01:00
csoler
f03862b984
Merge pull request #2560 from csoler/v0.6-FriendServer2
V0.6 friend server2
2022-01-17 23:39:38 +01:00
csoler
e7b822d1cb fixed bug in friend server auto wash 2022-01-17 23:01:07 +01:00
csoler
eefbd8a710 fixed initing of profile passphrase for friend server manager 2022-01-16 21:17:10 +01:00
csoler
763eeffe25 Merge remote-tracking branch 'upstream/master' into v0.6-FriendServer2 2022-01-16 18:32:43 +01:00
csoler
365682d771 added PGP-encryption to server communication to avoid data harvesting 2022-01-16 15:50:21 +01:00
Phenom
9e4903c9b8 Add General Font Size Factor 2022-01-16 13:21:49 +01:00
csoler
2548ef29fb
Merge pull request #2552 from csoler/v0.6-FriendServer2
added a msg in console when FS is ready
2022-01-16 11:49:34 +01:00
csoler
4a54587500 fixed testing of onion server 2022-01-15 22:03:27 +01:00
csoler
5ab19eb564 added testing system for distant Tor server 2022-01-15 21:53:07 +01:00
defnax
b9f389c8bb added webp support for stickers load 2022-01-15 21:44:54 +01:00
csoler
c310a177c6
Merge pull request #2554 from thunder2/friendserver
Fixed Windows compile of FriendServer
2022-01-15 20:31:22 +01:00
thunder2
36f14c8024 Removed unnecessary CFLAGS for Windows compile 2022-01-15 18:42:21 +01:00
thunder2
69b96e2c1b Fixed linking of FriendServer with MSYS2 on Windows 2022-01-15 18:39:36 +01:00
thunder2
ebfe4282d3 Fixed Windows compile of FriendServer 2022-01-15 13:25:17 +01:00
csoler
24b2d8a2cf added a msg in console when FS is ready 2022-01-13 21:06:56 +01:00
Gioacchino Mazzurco
10f2e483b7
Update submodules and README 2022-01-11 12:49:18 +01:00
Gioacchino Mazzurco
cfb210ef60
Added istructions on how to get the submodules 2022-01-10 21:59:39 +01:00
Gioacchino Mazzurco
48fcf70578
Split libretroshare BitDHT and OpenPGP-SDK into submodules 2022-01-10 21:37:03 +01:00
csoler
b847caa11b
Merge pull request #2495 from csoler/v0.6-FriendServer
V0.6 friend server
2022-01-10 20:14:58 +01:00
csoler
9bce625c1a fixed compilation 2022-01-10 18:24:46 +01:00
csoler
69f6adb6b4 added ifdef and option to enable/disable embeded friend server 2022-01-10 17:48:33 +01:00
G10h4ck
bbff7c73c0
Merge pull request #2551 from G10h4ck/cmake_build
More work to ship libretroshare as standalone lib
2022-01-10 15:53:24 +01:00
G10h4ck
6f813efddf
Merge branch 'master' into cmake_build 2022-01-10 15:46:57 +01:00
Gioacchino Mazzurco
c0e10ee2fa
More work to ship libretroshare as standalone lib
Improved CMake support
Initial work on packaging libretroshare as an Android library AAR
Deal properly with Android API level which miss largefile support
  instead of relying on build system trickery
2022-01-10 15:40:22 +01:00
csoler
3bd9188a33 fixed FriendServer client to use Tor proxy 2022-01-09 17:46:51 +01:00
csoler
e7eb606a4a fixed proxy init 2022-01-09 17:06:10 +01:00
csoler
2456dbb2a0 detached proxy negociation code from pqisslproxy so as to use it in FriendServer as well 2022-01-09 15:22:47 +01:00
csoler
b10b1df6df
Merge pull request #2543 from thunder2/warnings2
Removed compiler warnings in libretroshare
2022-01-08 17:54:11 +01:00
csoler
068aa7b7ec
Merge pull request #2545 from thunder2/warnings
Moved compiler flags for warnings to retroshare.pri
2022-01-08 17:53:06 +01:00
csoler
f581d71017
Merge pull request #2546 from thunder2/qt
Remove linking of Qt from libretroshare
2022-01-08 17:51:53 +01:00
csoler
dab101116b
Merge pull request #2547 from thunder2/warnings-plugins
Removed unused parameter from plugins
2022-01-08 17:51:32 +01:00
csoler
2f7271473c
Merge pull request #2548 from csoler/v0.6-BugFixing_14
fixed bug caused in RsNxsPullItem
2022-01-08 17:51:06 +01:00
csoler
aa904a3528 fixed bug caused by RsNxsPullItem not deriving from RsNxsItem and uniformized the code 2022-01-04 19:28:58 +01:00
thunder2
77dd76a108 Fixed compile with enabled RS_WEBUI 2022-01-04 03:03:53 +01:00
thunder2
af430c14a9 Removed unused parameter 2022-01-04 00:39:13 +01:00
thunder2
c0e3e9b4e4 Moved compiler flags for warnings to retroshare.pri 2022-01-04 00:33:04 +01:00
thunder2
e8ff76f21d Remove linking of Qt from libretroshare 2022-01-04 00:27:39 +01:00
csoler
3aaf1cd4d0
Merge pull request #2534 from defnax/fixcolors
Fixed Darkstyle textcolors for group category & private key
2022-01-03 21:06:19 +01:00
csoler
fd5a008be7
Merge pull request #2542 from thunder2/warnings1
Removed compiler warnings in libretroshare
2022-01-03 20:03:41 +01:00
csoler
094551b093
Merge pull request #2541 from thunder2/warnings
Removed compiler warnings in retroshare-gui
2022-01-03 19:47:38 +01:00
thunder2
3c1b2be421 Removed unused parameter warning 2022-01-03 13:59:31 +01:00
thunder2
b88be35668 Fixed unused function warning 2022-01-03 12:28:10 +01:00
thunder2
cd36ce80a8 Fixed redefined warning for Windows build 2022-01-03 12:22:10 +01:00
thunder2
7aa8b548c1 Removed pragma for Windows build 2022-01-03 12:19:30 +01:00
thunder2
2650a949ea Fixed "enum not handled in switch (-Wswitch)" warning 2022-01-03 12:18:05 +01:00
thunder2
fb836489d7 Fixed unused function warning 2022-01-03 12:10:01 +01:00
thunder2
3ad6f6710b Fixed unused variable warning 2022-01-03 12:10:00 +01:00
thunder2
af9cd44bd4 Fixed "variable set but not used (-Wunused-but-set-variable) warning 2022-01-03 12:01:32 +01:00
thunder2
b350070d9d Fixed "forbids converting a string constant (-Wwrite-strings)" warning 2022-01-03 01:31:37 +01:00
thunder2
98f7b815f7 Removed unnecessary define WIN32_LEAN_AND_MEAN 2022-01-03 01:03:22 +01:00
thunder2
126500aac7 Fixed duplicate name warning in ui 2022-01-03 01:03:21 +01:00
thunder2
864269b0cf Fixed "statement may fall through (-Wimplicit-fallthrough)" warning 2022-01-03 01:03:20 +01:00
thunder2
6f3d897156 Fixed "initialized after (-Wreorder)" warning 2022-01-03 01:03:19 +01:00
thunder2
088d6f63f0 Fixed unused function warning 2022-01-03 01:03:18 +01:00
thunder2
3dfe4e1288 Fixed unused variable warning 2022-01-03 01:03:16 +01:00
csoler
896762b948 made friend server to use tor hidden service to listen to connections 2022-01-02 20:41:47 +01:00
thunder2
c13e2ca341 Fixed compile error 2022-01-02 20:19:02 +01:00
csoler
7367fb3e46 fixed merge with upstream/master 2022-01-02 16:17:53 +01:00
csoler
caf64cd000
Merge pull request #2437 from csoler/v0.6-TorControl
V0.6 tor control
2022-01-02 09:55:31 +01:00
csoler
a352fd7dcd Merge remote-tracking branch 'upstream/master' into v0.6-TorControl 2021-12-31 17:57:36 +01:00
csoler
730102ccb7
Merge pull request #2539 from thunder2/msg
Msg
2021-12-31 17:57:04 +01:00
thunder2
3eb910a25f Removed old RsNotify code (NOTIFY_LIST_MESSAGE_TAGS) from message service 2021-12-31 02:13:57 +01:00
thunder2
f59ede23e1 Removed old RsNotify code (NOTIFY_LIST_MESSAGELIST) from message service 2021-12-31 01:38:13 +01:00
csoler
281076d6b7 fixed a few errors in TorManager event handling 2021-12-30 22:14:34 +01:00
thunder2
ae0c993b6b Save and restore current index of mail list 2021-12-30 21:34:48 +01:00
thunder2
8f21c158c6 Don't add own sent mail to activity page as incoming mail 2021-12-30 21:34:37 +01:00
csoler
1e8e489cd1 Merge branch 'v0.6-TorControl' of github.com:csoler/RetroShare into v0.6-TorControl 2021-12-30 19:51:53 +01:00
csoler
fb1e0bc81c using random port to link Tor to local node and check that the port is available 2021-12-30 19:51:20 +01:00
thunder2
5d9ce662e9 Added update of message model when messages changed 2021-12-30 13:53:10 +01:00
thunder2
c01f98feb9 Added unregisterEventsHandler to destructor of MessagesDialog 2021-12-30 13:13:38 +01:00
csoler
35e20222e4
Merge pull request #33 from thunder2/pr/2437-shutdown
Pr/2437 shutdown
2021-12-29 23:11:12 +01:00
csoler
9c499ec069
Merge pull request #32 from thunder2/pr/2437
Pr/2437
2021-12-29 23:08:29 +01:00
csoler
478fc5e8f9
Merge pull request #2536 from PhenomRetroShare/Fix_RSElidedItemDelegateUseSpacing
Fix RSElidedItemDelegate to use spacing in size hint.
2021-12-29 22:30:40 +01:00
csoler
836653d9cd
Merge pull request #2537 from defnax/wirewikiifixes
Fixing wire layout spacing
2021-12-29 22:11:00 +01:00
thunder2
460dbdcdc8 Added shutdown of tor management threads 2021-12-29 17:56:55 +01:00
thunder2
72eb21bbca Use shutdownSync instead of shutdown in TorManager::run to stop tor 2021-12-29 17:56:54 +01:00
thunder2
0ffb31be85 Added missing initialization and check of members in VOIPConfigPanel to fix crash at shutdown with enabled plugin VOIP 2021-12-29 17:07:15 +01:00
thunder2
72e52b998c Added check of shouldStop in RsThreadedTcpSocket::run 2021-12-29 16:41:46 +01:00
thunder2
02afc9062f Added delete of TorManagerPrivate in destructor of TorManager 2021-12-29 16:39:37 +01:00
thunder2
97f7e0f936 Added delete of TorControl in destructor of TorManagerPrivate 2021-12-29 16:14:48 +01:00
thunder2
8d3046d157 Removed global variable "Tor::TorControl *torControl" 2021-12-29 16:08:20 +01:00
thunder2
1fafaeb909 Added delete of member TorControlSocket in destructor of TorControl 2021-12-29 16:00:02 +01:00
thunder2
e096f2feb1 Added unregisterEventsHandler to destructor of TorControlDialog 2021-12-29 15:32:28 +01:00
csoler
efe2ec03ff fixed a few bugs that may cause the bootstrap process to hang 2021-12-28 18:29:33 +01:00
csoler
a37802ca96
Merge pull request #31 from thunder2/pr/2437
Pr/2437
2021-12-28 09:48:18 +01:00
thunder2
17bce57185 Added compare of Windows like directory separator to rsdir.cc 2021-12-28 01:28:07 +01:00
thunder2
ffc42db3aa Added flag for CreateProcess to hide the terminal window of Tor on Windows 2021-12-27 16:38:29 +01:00
defnax
153a5bddcf Fixing wire layout spacing
* Fixing wire layout spacing
* Added splitter for wiki group
2021-12-26 16:17:36 +01:00
Phenom
222cb38ce7 Fix RSElidedItemDelegate to use spacing in size hint. 2021-12-25 19:22:32 +01:00
defnax
f6c05caf02 Fixed Darkstyle textcolors for group category & private key 2021-12-23 20:09:01 +01:00
csoler
f14573bf4e
Merge pull request #30 from thunder2/pr-2437-fixes
Pr 2437 fixes
2021-12-23 11:49:28 +01:00
thunder2
5dfbdc0869 Fixed start and stop of tor process on Windows 2021-12-22 22:29:20 +01:00
thunder2
753250b4e8 Added os specific RsFileUtil::rs_getline 2021-12-22 22:29:19 +01:00
thunder2
38b4c50635 Changed RsFdBinInterface to use recv/send for sockets and read/write for file descriptors on Windows 2021-12-22 22:29:19 +01:00
thunder2
057e872eca Added missing initializations of members in constructor of TorControl 2021-12-22 22:29:18 +01:00
thunder2
085e102ce1 Added RsFileUtil for os specific file functions
Added RsFileUtil::set_fd_nonblock to set a file descriptor to non blocking
2021-12-22 22:29:17 +01:00
thunder2
5b8ac7e49b Added missing fclose to TorProcess::tryReadControlPort 2021-12-22 22:29:17 +01:00
thunder2
15d56f01ac Added missing include to string in PendingOperation.h 2021-12-22 22:29:16 +01:00
thunder2
8d020e7395 Changed ifdef Q_OS_WIN to WINDOWS_SYS 2021-12-22 22:29:15 +01:00
thunder2
59d11b71ce Changed uint to ByteArray::size_type in StrUtil.cpp 2021-12-22 22:29:14 +01:00
csoler
49d8a851c5 moved faulty line causing early deletion of this at the end of the function 2021-12-22 22:26:47 +01:00
csoler
8af6ca9fb7 fixed a few errors reported by valgrind 2021-12-22 14:03:29 +01:00
csoler
f6892066bc fixed compilation on win$ 2021-12-20 16:10:52 +01:00
csoler
4a76fddaa9 fixed conflicts with upstream/master 2021-12-19 21:10:15 +01:00
csoler
5fe39248f8 fixed compilation on windows 2021-12-19 20:22:04 +01:00
csoler
9684b2ed94 code cleaning 2021-12-19 18:40:44 +01:00
csoler
37d4e4f3df attempt to fix compilation on windows 2021-12-19 17:44:23 +01:00
csoler
6048a9a011 attempt to fix compilation on windows 2021-12-19 16:52:43 +01:00
csoler
40b965cab1 improved display of tor process completion 2021-12-18 21:30:58 +01:00
csoler
b700c451d4
Merge pull request #2496 from PhenomRetroShare/Fix_AskForPasswordNotInGUIThread
Fix NotifyQt::askForPassword QInputDialog is not created in GUI Thread.
2021-12-18 20:46:19 +01:00
Phenom
e137c17039 Fix NotifyQt::askForPassword QInputDialog is not created in GUI Thread. 2021-12-18 18:22:30 +01:00
csoler
7e6156566a fixed display of tor bootstrap status 2021-12-18 18:14:49 +01:00
csoler
f352235ccd fixed a few bugs 2021-12-18 16:45:53 +01:00
G10h4ck
bc76b10792
Merge pull request #2527 from G10h4ck/cmake_build
Integrate python3 JSON API generator into libretroshare
2021-12-18 15:31:17 +01:00
G10h4ck
b971148931
Merge pull request #2450 from csoler/v0.6-PGPHandler
V0.6 pgp handler
2021-12-18 15:30:14 +01:00
csoler
bdbcadc43c fixed Tor icon to stay red 2021-12-17 22:26:32 +01:00
csoler
3121a61910 more bug fixing 2021-12-17 22:17:26 +01:00
csoler
af4c948024 fixed some bugs in TorControl 2021-12-17 16:54:44 +01:00
csoler
d3a36f216f
Merge pull request #2521 from defnax/classicstyle
added classic stylesheet
2021-12-16 23:22:47 +01:00
csoler
d9368507a9 fixed a few bugs in torcontrol socket methods 2021-12-15 22:15:52 +01:00
csoler
a86cca3d0f
Merge pull request #2520 from PhenomRetroShare/Fix_PostedCreatePostDialog
Fix PostedCreatePostDialog when reject show double message.
2021-12-13 21:35:27 +01:00
csoler
999f25b6ad
Merge pull request #2526 from defnax/pushbuttonfix2
Added spacing for the QPushButton
2021-12-13 21:23:57 +01:00
csoler
808f4e120c
Merge pull request #2524 from defnax/boardsfixesv2
Fixed fonts size for boards title
2021-12-13 21:23:32 +01:00
csoler
56e17f077e fixed merge with upstream/master 2021-12-13 21:01:06 +01:00
csoler
7455013fc2 fixed std::cerr => RsErr() 2021-12-13 20:58:53 +01:00
csoler
24e862ae25 moved event loop in TorManager to the TorManager class 2021-12-13 20:28:07 +01:00
Gioacchino Mazzurco
e62b847234
Integrate python3 JSON API generator into libretroshare
Add more options to CMake:
  Support for JSON API
  Support for forum deep index

Fix bitdht CMake project name
General CMake files improvements
2021-12-13 18:46:56 +01:00
defnax
b5d1febac4 Added spacing for the QPushButton 2021-12-12 19:01:29 +01:00
defnax
fddb88010e Fixed fonts size for boards title
* Fixed fonts size for boards title
* Fixed vertical spacer to not stretch the height of the Subscribe Button
2021-12-11 11:37:02 +01:00
csoler
1c576411fb fixed control port reading 2021-12-10 18:01:21 +01:00
csoler
1571446a2e debugged pipe system with tor executable 2021-12-10 16:29:10 +01:00
csoler
7c77cfd603 fixed a few bugs in new TorManager 2021-12-09 22:19:00 +01:00
csoler
a757419d65 fixed compilation 2021-12-09 21:04:49 +01:00
G10h4ck
5be7869304
Merge pull request #2522 from G10h4ck/cmake_build
Add support to build via CMake
2021-12-09 17:50:30 +01:00
Gioacchino Mazzurco
6a92b99da3
Initial CMake support for libretroshare
libretroshare (not all build options yet) and it's dependencies can now
  be built using CMake instead of qmake.
Even Qt itself deprecated qmake, which is not developed anymore, as
  build system and it was making many things much more difficult
  and requiring an enormous amount of black magic to support a wide
  range of platforms.
libretroshare can now easly be build as static or shared library with
  simple commands and a maintaniable build system:
```
cmake \
	-D RS_LIBRETROSHARE_STATIC=OFF -D RS_LIBRETROSHARE_SHARED=ON \
	-S $YOUR_RS_SOURCE_DIR/libretroshare/ -B .
make
```
2021-12-09 13:04:06 +01:00
Gioacchino Mazzurco
94bd099407
Rename DATA_DIR macro to less polluting RS_DATA_DIR 2021-12-09 12:56:48 +01:00
G10h4ck
e55fa2b9d5
Merge pull request #2517 from G10h4ck/android_without_qt
Run on Android without Qt
2021-12-08 13:35:03 +01:00
csoler
e0812dce83 added back read attempt for control port 2021-12-07 21:20:19 +01:00
defnax
0afe305ca1 added classic stylesheet 2021-12-07 19:11:37 +01:00
csoler
b323a1635e fixed compilation. Qt is completely gone 2021-12-06 22:33:50 +01:00
csoler
7dc5c90d63 finished removing latest Qt bits 2021-12-06 22:08:56 +01:00
Phenom
a904a5d41a Fix PostedCreatePostDialog when reject show double message.
And stacked widget if current index is changed in ui file.
2021-12-06 16:05:43 +01:00
csoler
e75d312724 removed lots of signals/slots 2021-12-05 22:14:19 +01:00
csoler
bb37e2692b removed more QString, QHostAddress, QFile, QDir,... 2021-12-05 00:02:12 +01:00
csoler
20a4e00544
Merge pull request #2519 from defnax/boardsfixes
Fixed to display the right index for Image Page
2021-12-04 12:55:25 +01:00
defnax
777d0d9848 Fixed to display the right index for Image Page
* Fixed to display the right index for Image Page
* Fixed to disable share button when Identity is banned.
2021-12-04 12:12:29 +01:00
csoler
b03802fa1b turned TorProcess into a non-Qt object, using built-in popen3 system 2021-12-02 23:15:06 +01:00
csoler
d7afbea1dd progress in using ByteArray+std::string 2021-12-01 23:05:16 +01:00
Gioacchino Mazzurco
72caa2aa68
Android Dockerfiles better apt options 2021-12-01 16:30:28 +01:00
Gioacchino Mazzurco
475d8ffc11
Android Docker attempt to shrink image
Do not install apt recommended packages
Show upgraded packages on Android Gitlab CI Dockerfile
2021-12-01 08:32:09 +01:00
Gioacchino Mazzurco
a1a8bf1408
Android Dockerfile do updates 2021-12-01 08:26:34 +01:00
csoler
b5a7655f29
Merge pull request #2515 from PhenomRetroShare/Fix_PostedItemRedraw
Fix BoardPostDisplayWidget when editor redraw.
2021-11-30 23:57:35 +01:00
Phenom
3217cd4df0 Fix BoardPostDisplayWidget when editor redraw. 2021-11-30 23:38:21 +01:00
Gioacchino Mazzurco
7231d94ea4
Fix variable name in Android Dockerfile documentation 2021-11-30 17:00:33 +01:00
Gioacchino Mazzurco
2095dae95d
Fix build with older Java < 7 2021-11-30 17:00:02 +01:00
Gioacchino Mazzurco
856ce2ffb1
Do not depend on Qt at all on Android
Do the necessary modifications to not depend on Qt to run on Android
  both in libretroshare and in retroshare-service
2021-11-30 11:55:15 +01:00
csoler
6a4cdcc471 continue on switching QString and QByteArray 2021-11-29 22:59:46 +01:00
csoler
e4fcf26ea8
Merge pull request #2500 from PhenomRetroShare/Add_ConnectFriendWizard_Imp
Add ConnectFriendWizard improvement.
2021-11-29 21:29:50 +01:00
csoler
2c52ff852f
Merge pull request #2516 from PhenomRetroShare/Fix_UnusedSkins
Remove unused skins.
2021-11-29 17:48:26 +01:00
Phenom
92da1881e7 Remove unused skins. 2021-11-29 15:39:42 +01:00
G10h4ck
941ec42502
Merge pull request #2513 from G10h4ck/forum_deep_search_wildcard
Forum deep search support wildcard* search
2021-11-26 17:23:09 +01:00
G10h4ck
8c52535860
Merge pull request #2508 from G10h4ck/android_ifaddrs
libretroshare Android Qt network dependency optional
2021-11-26 17:22:51 +01:00
csoler
e4ce32bef8 switching QString to std::string and QByteArray to ByteArray. Unfinished yet. 2021-11-25 23:28:01 +01:00
csoler
3845dc1ea7 added new files 2021-11-22 20:06:01 +01:00
G10h4ck
cf56059a6d
Merge pull request #2510 from PhenomRetroShare/Fix_QSplitter_TitleBar_StyleSheet
Fix QSplitter and TitleBar StyleSheet.
2021-11-20 16:26:18 +01:00
csoler
0a5f3328df changed names SocketBioInterface->RsFdBinInterface and TcpSocket->RsTcpSocket (more consistent). Moved them to pqi/ 2021-11-16 22:19:27 +01:00
Gioacchino Mazzurco
1e9a26893c
Forum deep search support wildcard* search
Xapian have support for wildcard search
  wild* matches wild, wildcard, wildcat, wilderness
  but it need to be enabled by passing a specific flag to the query
  parser, this is very useful for forum search so enable it in addition
  to default Xapian search capabilities
2021-11-16 10:52:18 +01:00
csoler
a5b1f2d976 created independent tcpsocket class to be used also in TorManager 2021-11-14 23:31:40 +01:00
G10h4ck
fe0561b3fe
Merge pull request #2377 from G10h4ck/gxs_fast_pull_request
Implement pull request mechanism in RsGxsNetService
2021-11-12 21:36:06 +01:00
Phenom
1146a0bf27 Fix QSplitter and TitleBar StyleSheet. 2021-11-12 20:04:43 +01:00
Gioacchino Mazzurco
cd5dad6a75
Rename GXS pullFromPeers to pullFromPeers
According to what discussed with Cyril
2021-11-12 19:11:02 +01:00
Gioacchino Mazzurco
ebbd8cf938
Forums expose API to request syncronization 2021-11-12 18:46:36 +01:00
Gioacchino Mazzurco
fc404bd5d8
RsGxsNetService trigger pulling on group subscribe 2021-11-12 18:43:52 +01:00
Gioacchino Mazzurco
6295e91304
Request pull from peers when GXS message is created 2021-11-12 18:43:52 +01:00
Gioacchino Mazzurco
b42323013e
Fix includes in rsnxs.h 2021-11-12 18:43:49 +01:00
Gioacchino Mazzurco
a7f1e94cea
Request pull from peers when GXS group is created 2021-11-12 18:42:55 +01:00
Gioacchino Mazzurco
a374f1dc6b
Implement RsNxsSerialiser::create_item for RsNxsPullRequestItem 2021-11-12 18:41:18 +01:00
Gioacchino Mazzurco
e4f25a558d
Implement pull request mechanism in RsGxsNetService
This could be used to request the online peers to pull updates from us
  ASAP, as an exaple when a group is created a pull request can be
  emitted too so the online peers pull the groups from us ASAP instead
  of waiting for the usual 60 seconds. A mechanism like this is
  especially useful on mobile phones where the internet connection is
  usually turned on only in a few moments (as an example while the user
  is interacting with the app).
Cleanup a few old corners in the code keeping retro-compatibility and
  make the code more welcoming to new developers.
Put a bunch of dead code under #ifdef.
2021-11-12 18:41:10 +01:00
Gioacchino Mazzurco
11f17fef40
libretroshare Android Qt network dependency optional
One of the reason libretroshare dependend on Qt on Android
  and in particular in networking module is the lack of
  `getifaddrs` with API level < 24, we included Android
  Gingerbread internal implementation so this dependency can be avoided
  at compile time.
The code depending on Qt has been placed under `#if` and can be enabled
  at compile time by appending `DEFINES+=LIBRETROSHARE_ANDROID_IFADDRS_QT`
  to `qmake` command line.
2021-11-12 16:02:53 +01:00
csoler
4d06ab2b4a Merge remote-tracking branch 'upstream/master' into v0.6-TorControl 2021-11-11 18:28:02 +01:00
csoler
bef780e0c7 merged with upstream/master 2021-11-11 17:50:11 +01:00
csoler
5e50f23423 improved checking of short invite / pgp key in friend server. Added a key parsing method in PGPKeyManagement 2021-11-10 23:36:23 +01:00
defnax
53dfa67d78
Merge pull request #2505 from defnax/default-stylesheetfix
Default stylesheetfix
2021-11-10 20:52:13 +01:00
defnax
a60a36582c Fixed layout spacing 2021-11-10 19:18:06 +01:00
defnax
fd93167111 Added stylesheet for the titleBarFrame 2021-11-10 19:11:58 +01:00
defnax
556322a015
Merge pull request #2504 from defnax/default-stylesheetfix
fixed stylesheets for the default.qss
2021-11-10 12:08:22 +01:00
Gioacchino Mazzurco
ff68faf34a
Gitlab CI Android improve configurability
Enable passing RS_SERVICE_QMAKE_EXTRA_OPTS from environement so it can
  be set from project settings according to project and forks needs
2021-11-10 10:52:18 +01:00
defnax
dc40927958 fixed stylesheets for the default.qss 2021-11-09 22:28:28 +01:00
csoler
1d2b91a675
Merge pull request #2502 from PhenomRetroShare/Fix_rsGetHostByNameSpecDNS
Fix rsGetHostByNameSpecDNS by closing socket.
2021-11-08 11:21:46 +01:00
Phenom
4cc0b9f492 Fix rsGetHostByNameSpecDNS by closing socket. 2021-11-08 10:20:44 +01:00
csoler
0cf889d556 fixed a few bugs in peer management 2021-11-07 22:39:24 +01:00
csoler
25ddbe099d fixed two-ways communication between client and server 2021-11-07 15:16:24 +01:00
csoler
aff7912f41 avoid sending packet slicing probes to the serializer in pqistreamer 2021-11-07 15:16:07 +01:00
thunder2
88d70e2edc Removed built-in stylesheets from Windows packages 2021-11-07 01:59:31 +01:00
csoler
5a55800f31 added sorting of peers (part 2/2) 2021-11-06 17:49:31 +01:00
Phenom
a072b151f5 Add ConnectFriendWizard improvement.
Add cert details in friendCertCleanLabel tooltip.
Use qss for background color of friendCertCleanLabel.
Add Known IP in final view.
2021-11-06 14:10:17 +01:00
Gioacchino Mazzurco
e8b97405b9
Fix android build due missing include 2021-11-06 11:35:28 +01:00
G10h4ck
bfbb2a5ae6
Merge pull request #1874 from PhenomRetroShare/Add_ExtIPFinderUsingDNS
Add ability to retrieve External IP using Specific DNS server.
2021-11-06 04:08:41 +01:00
thunder2
0e5cb56c19 Fixed Windows build with new stylesheets 2021-11-06 01:02:23 +01:00
Phenom
91a35f4a21 Change some code according G10h4ck remarks. 2021-11-06 00:32:36 +01:00
Phenom
7755f85c4c Move DNS stuff to single new file rsdnsutils.cc. 2021-11-05 22:48:41 +01:00
Phenom
81d2ddd7c7 Enable IPv6 DNS ExtIpFinder
Now empty node with only IPv6 can connect to other.
2021-11-05 22:48:41 +01:00
Phenom
a09db6717b Add ability to retrieve External IP using DNS server.
IPV6 compatible.
2021-11-05 22:48:41 +01:00
thunder2
56d34a8a2c Undo fix for linking of plugins for Windows MSYS2 compile 2021-11-05 21:23:48 +01:00
csoler
af6dee088c first part of peer sorting in friend server 2021-11-05 16:52:00 +01:00
Gioacchino Mazzurco
fa48b03fac
mark single argument RsStackMutex costructor explicit 2021-11-05 15:31:08 +01:00
Gioacchino Mazzurco
7ae314440f
Fix GitlabCI repository url and improve Android dockerfiles 2021-11-05 15:29:53 +01:00
Gioacchino Mazzurco
a9fe1ba6de
Make DirStub serialization consistent on all architectures
Thanks elRepo.io developers to detect and report this bug with detail
https://gitlab.com/elRepo.io/elRepo.io-android/-/issues/52
2021-11-05 12:02:56 +01:00
csoler
b805cce58d
Merge pull request #2404 from PhenomRetroShare/StyleSheet_Rewrite
StyleSheet Rewrite
2021-11-04 23:57:26 +01:00
Phenom
d7981f3811 StyleSheet Rewrite
Use QDarkStyle to make Standard_Dark.qss and Standard_Light.qss
Use Widget name to stylize them.
2021-11-04 21:21:54 +01:00
csoler
62655779e5 use recv(...,MSG_DONTWAIT), since read() may return multiple times the same data apparently 2021-11-04 20:52:38 +01:00
Gioacchino Mazzurco
16ca0dc52c
RsThread fix warning and cleanup
Avoid compiler warning due to virtual method being called in destructor
  at this point the empty default version would be called without damage
  but making the compiler concernig about the semantic being different
  from the one the programmer meant.
Delete old superseeded function and do not depend on it on RsThread.
2021-11-04 19:17:57 +01:00
G10h4ck
9b2504d407
Merge pull request #2499 from PhenomRetroShare/Fix_RsThread
Fix RsThread when nothing to do and run finish before start.
2021-11-04 18:47:12 +01:00
csoler
01da2fbe9e added debug output and fixed one bug in pqistreamer 2021-11-04 14:24:19 +01:00
Gioacchino Mazzurco
53f2891b78
Improve JSON API DirDetails handle type test 2021-11-04 13:29:32 +01:00
Gioacchino Mazzurco
d6c4a086f3
Add test for JSON API DirDetails handle type 2021-11-04 11:58:42 +01:00
thunder2
433f6f763d Fixed linking of plugins for Windows compile 2021-11-03 18:38:46 +01:00
Phenom
5e9bc9c2b8 Fix RsThread when nothing to do and run finish before start. 2021-11-03 17:14:11 +01:00
thunder2
a9a7b556d5 Upgrade MSYS2 for Windows build 2021-11-03 16:23:35 +01:00
csoler
0191072326 added response system from friend server 2021-11-01 22:01:59 +01:00
thunder2
7be575045b Fixed git update of submodule supportlibs/libsam3 for MinGW compile 2021-11-01 18:45:10 +01:00
csoler
6b6d556e98 added nonce system for safe peer removal 2021-11-01 16:14:13 +01:00
csoler
b7c7c4c3f5 moved static/parsing of radix parts of short invites into RsCertificate (more code should be moved static there) and fixed adding incoming keys to friend server 2021-11-01 10:47:07 +01:00
csoler
5da31592f2 send/recv PGP public key and short invite 2021-11-01 09:16:41 +01:00
csoler
e058b3a35f fixed memory error 2021-10-31 18:00:43 +01:00
csoler
a69f9dc09b fixed two-ways communication between RS and friend server 2021-10-31 16:46:06 +01:00
csoler
42b4a821bd fixed basic incoming communication at server side 2021-10-31 12:02:09 +01:00
csoler
f0b23b84f1 added missing override in pqithreadstreamer 2021-10-31 12:01:44 +01:00
csoler
d659f768b5 fixed debug output in pqistreamer 2021-10-31 12:01:07 +01:00
csoler
ffa28000e3 added basic communication between FriendServer and its clients 2021-10-30 15:50:28 +02:00
csoler
d948086b5e added logic to stop/start FriendServer from GUI 2021-10-29 21:44:30 +02:00
csoler
7821b29893 fixed additional GPG->Pgp names 2021-10-29 20:29:18 +02:00
csoler
7672ffa0ec fixed casing of PGP into Pgp 2021-10-29 19:05:54 +02:00
csoler
fdac22f49c renamed remaining *GPG* names into *PGP* 2021-10-29 19:02:09 +02:00
csoler
5e37bd42e4 renamed isGPGAccepted into isPGPAccepted 2021-10-29 18:57:58 +02:00
csoler
b328c3a493 renamed AuthGPG into AuthPGP 2021-10-29 18:51:40 +02:00
G10h4ck
dc1d5de0db
Merge pull request #2301 from G10h4ck/forums_deep_indexing
Implement deep indexing and search for forums
2021-10-28 11:17:51 +02:00
G10h4ck
954e5969fc
Merge pull request #2372 from altcoinpirate/master
Disable animation in file transfer tree view widgets
2021-10-28 10:17:56 +02:00
Gioacchino Mazzurco
62810d32e1
deep_search: fix compilation with old Xapian versions 2021-10-28 09:53:55 +02:00
Gioacchino Mazzurco
0b58740174
Properly avoid private forum leak in deep search
mGroupFlags & GXS_SERV::FLAG_PRIVACY_PUBLIC is always true for forums
  even if they are circle restricted, use circle flags to check if it
  is really public
2021-10-28 09:53:55 +02:00
Gioacchino Mazzurco
2196505d19
RsGxsForumsDistantSearchEvent fix event type 2021-10-28 09:53:54 +02:00
Gioacchino Mazzurco
bf8ddf498e
Fix Android compilation 2021-10-28 09:53:54 +02:00
Gioacchino Mazzurco
dcb2bee8cc
Epurate this branch from channels deep search changes 2021-10-28 09:53:54 +02:00
Gioacchino Mazzurco
9c38eed648
Implement deep indexing and search for forums
RsGxsNetTunnelService::receiveSearchRequest handle no results case
  properly
RsNxsObserver::handleDistantSearchRequest improve method behaviour
  documentation
RsTurtleClientService Improve documentation
2021-10-28 09:53:48 +02:00
Gioacchino Mazzurco
1b551d809f
First working prototype of GXS service search
Channels are now able to take advantage of the new deep search
  goodies

Rebase on top of master 2021/10/19
2021-10-28 09:51:29 +02:00
Gioacchino Mazzurco
ab349a8157
Use unannotated pointer as per Cyril taste 2021-10-28 09:51:29 +02:00
Gioacchino Mazzurco
cef43fe048
Notify one deletion per event as Cyril suggested 2021-10-28 09:51:29 +02:00
Gioacchino Mazzurco
045069c3e6
Implement proper GXS message deletion notification
GxsForums propagate message deletion notification as RsEvent
2021-10-28 09:51:29 +02:00
G10h4ck
b920263947
Merge pull request #2442 from G10h4ck/notify_hashing_file_completed
Emit an event when a shared file hashing complete
2021-10-28 09:24:45 +02:00
Gioacchino Mazzurco
8089542e74
Updated OBS submodule 2021-10-27 11:47:53 +02:00
Gioacchino Mazzurco
b659643748
Attempt to fix non sam3 builds 2021-10-25 15:50:19 +02:00
Gioacchino Mazzurco
b8e27d6bc0
Document sam3 build options, fix Android CI 2021-10-25 14:35:32 +02:00
csoler
dbb6a7471e fixed compilation (fix by sehraf) 2021-10-24 22:26:10 +02:00
csoler
3ddf3d0853
Merge pull request #2132 from sehraf/pr_add_i2p_sam3
Replace I2P BOB with SAMv3
2021-10-24 20:39:22 +02:00
csoler
19e42663a0 fixed compilation 2021-10-24 20:01:19 +02:00
csoler
b731cf34ee moved part of the code to libretroshare/src/friend_server 2021-10-24 17:41:23 +02:00
csoler
c589561396 made sockets non blocking 2021-10-20 23:06:38 +02:00
csoler
8939896abf added missing comment in pqi_base 2021-10-20 23:06:25 +02:00
csoler
c77b9d1e1f added embedded test for FS 2021-10-20 21:14:08 +02:00
csoler
8e4a9e6a38 implemented multiple clients in Friend Server 2021-10-19 23:24:50 +02:00
Gioacchino Mazzurco
34593d1b6f
Emit an event when a shared file hashing complete
Properly notify when a shared file has been hashed
Deprecate event with arbitrary data packed in std::string
2021-10-19 18:23:55 +02:00
G10h4ck
58016fff65
Merge pull request #2444 from G10h4ck/single_file_share_plus_cleanup
Single file share plus cleanup
2021-10-19 15:45:32 +02:00
csoler
21ea281df4 added empty rsFriendServer struct and basic UI functionality 2021-10-13 22:50:09 +02:00
csoler
3f6503dfc3 added friend server control UI 2021-10-12 22:29:36 +02:00
csoler
5bfa77a0fe implemented item serialisation and high level handlign in FS 2021-10-11 23:40:22 +02:00
csoler
85bb831f47 using pqistreamer to deserialize data from FsNetwork 2021-10-09 15:06:06 +02:00
csoler
d97ad8099c added base network layer for friend server. Not working yet. 2021-10-09 01:08:23 +02:00
csoler
d9c91ea41d
Merge pull request #2451 from csoler/v0.6-TorNode
V0.6 tor node
2021-10-06 19:36:49 +02:00
csoler
0deb83a5b9
Merge pull request #2479 from csoler/v0.6-BugFixing_13
[WIP] Fixing a few bugs.
2021-10-06 19:35:57 +02:00
csoler
c5d0c6a6e6
Merge pull request #2485 from hunbernd/fix/groups
Friend group fixes
2021-10-04 09:51:40 +02:00
hunbernd
a432b94351 Fix remove friend from group
Fix missing update after creating a new group
2021-10-03 21:55:08 +02:00
Gioacchino Mazzurco
75aaf134d2
CI: fix phash install prefix in base dockerfile 2021-09-30 13:11:48 +02:00
csoler
9a440e077e automatically close ongoing uploads when we stop sharing an extra file 2021-09-21 20:47:25 +02:00
csoler
2bd3fbf977 made Options tab in Profiles Details window be disabled when the profile is not a friend 2021-09-19 20:05:19 +02:00
csoler
a2a55b06ce
Merge pull request #2474 from csoler/v0.6-BugFixing_13
added missing internal change of webUI directory
2021-09-08 21:08:16 +02:00
csoler
099113805e added missing internal change of webUI directory 2021-09-08 09:03:46 +02:00
csoler
0ca399ebf5
Merge pull request #2467 from csoler/v0.6-BugFixing_13
V0.6 bug fixing 13
2021-09-06 10:08:23 +02:00
csoler
0564fa6f2a
Merge pull request #2473 from defnax/fix-to-not-allow-empty-names
Fix to not allow empty profile names on profile creation
2021-09-06 10:07:41 +02:00
csoler
e9d5da330e
Merge pull request #2472 from hunbernd/fix/friendlistmodel-crash
Fixes crash after: (EE) asked to create an invalidated profile that a…
2021-09-06 10:06:40 +02:00
defnax
154148d77f Fix to not allow empty profile names on profile creation 2021-09-05 19:43:07 +02:00
hunbernd
e6d3ee978b Fixes crash after: (EE) asked to create an invalidated profile that already exists
createInvalidatedProfile returned with iterator.end() in some cases.
updateInternalData dereferenced the result without checking it first.
It overindexed an array, read some memory trash, then wrote it into an another array.
2021-09-05 18:11:58 +02:00
G10h4ck
6db102c2be
Merge pull request #2470 from G10h4ck/jsonapi_gxs_timers
Add JSON API to get/set GXS timers
2021-09-03 17:49:38 +02:00
Gioacchino Mazzurco
2ed1500724
Improve debuggability of failed CI
Separate ubuntu build and testing stages
2021-09-03 17:47:56 +02:00
Gioacchino Mazzurco
19915a8eb4
Fix broken line endings 2021-09-03 14:56:45 +02:00
Gioacchino Mazzurco
a18d6aaa1e
Add JSON API to get/set storage and sync GXS time 2021-09-03 14:55:03 +02:00
Gioacchino Mazzurco
8452e30afc
CI and Android toolchain improvements 2021-09-03 12:48:44 +02:00
Gioacchino Mazzurco
900ea5508d
Updated OBS submodule 2021-09-02 17:44:57 +02:00
Gioacchino Mazzurco
d51d96116f
Disable Travis CI Linux to save scarce credits
Fix Travis CI badge URL
2021-09-02 12:07:04 +02:00
Gioacchino Mazzurco
f5f0ddc1ad
Updated Travis CI URL 2021-09-02 11:13:41 +02:00
Gioacchino Mazzurco
af035478b9
Attempt to avoid timeout in Travis CI macOS 2021-09-02 09:08:01 +02:00
G10h4ck
9b1568a1ca
Merge pull request #2466 from G10h4ck/android_CI
Android: modernize toolchain, provide Dockerfile and setup GitlabCI
2021-09-01 21:56:52 +02:00
Gioacchino Mazzurco
e384613809
Android: provide Dockerfile and use it for GitalbCI
Add support for installing Android SDK NDK directly into
  prepare-toolchain-clang.sh
Modernize prepare-toolchain-clang.sh
Add support to install Qt based on installer 4.X to prepare-toolchain-clang.sh
Setub GtlabCI to build android APK based on the produced Docker image
2021-08-31 10:03:40 +02:00
csoler
e22c5c9702 added bool return value to denyLobbyInvite() and marked overriding methods in p3msgs accordingly 2021-08-29 21:15:52 +02:00
csoler
448b00f95a Merge remote-tracking branch 'upstream/master' 2021-08-29 20:16:47 +02:00
csoler
5e851b4efd trying to fix compilation on windows 2021-08-28 21:46:02 +02:00
csoler
f5f608dbec trying to fix compilation on windows 2021-08-28 21:39:12 +02:00
csoler
6d56f3289b
Merge pull request #2460 from hunbernd/fix/imgembedlocalfiles
Filter html img tags that points to local files
2021-08-26 17:30:37 +02:00
hunbernd
de3ad227bd Filter html img tags that points to local files 2021-08-23 01:16:36 +02:00
csoler
563fc14532
Merge pull request #2459 from hunbernd/fix/partialfiles
Fix: additional / when combining file paths
2021-08-22 21:30:01 +02:00
csoler
5c560837ba fixed unwanted display of DHT information in connect disalog for Tor nodes and Tor friends 2021-08-15 15:38:16 +02:00
csoler
3de68bf5e5 Merge remote-tracking branch 'upstream/master' into v0.6-TorControl 2021-08-15 15:07:58 +02:00
csoler
8b586412c2 Merge remote-tracking branch 'upstream/master' into v0.6-PGPHandler 2021-08-15 10:09:45 +02:00
csoler
020ef61297 fixed compilation 2021-08-15 09:41:30 +02:00
csoler
b084b20280 removed getAuthGPG and replaced AuthGPG with a class with static members 2021-08-14 14:56:28 +02:00
csoler
b8f4e64393 initial split of PHPHandler into two classes 2021-08-11 16:02:02 +02:00
csoler
4db6ac92e7 initial split of PHPHandler into two classes 2021-08-11 16:01:45 +02:00
Gioacchino Mazzurco
8bed99cc9f
Fix compilation with C++17 2021-08-06 12:15:34 +02:00
howdy-partner
3cfab3ace0 fix smiley bug 2021-07-31 13:32:17 +02:00
thunder2
282f4f18a3 Removed library opencv from Windows build environment 2021-07-19 21:08:41 +02:00
thunder2
6cf60f1add Removed not needed libraries in VOIP.pro for Windows build 2021-07-19 21:07:52 +02:00
Gioacchino Mazzurco
e850e00a82
Optimization, cleanup, compiler warning fix
Chores I have made while working on single file share
2021-07-19 16:40:13 +02:00
Gioacchino Mazzurco
817a961013
Improve RsDirUtil::lastWriteTime error reporting 2021-07-18 22:41:14 +02:00
Gioacchino Mazzurco
9970f9d22f
Avoid leaking single shared file path in search results
Single shared files are a bit special and contain the full path in the
  name because they are not shared as part of a directory, epurate the
  path component from matching process and from search result
2021-07-18 21:16:46 +02:00
Gioacchino Mazzurco
e1580868dc
Avoid leaking non browsable shared single files to friends 2021-07-18 21:16:46 +02:00
Gioacchino Mazzurco
fc198d4e6d
libretroshare: add share single files (no dir, no extra)
Add capability to libretroshare to share single files without sharing
  the whole folder containing it, this is expecially useful in Android
  where files are organized in a peculiar way that render classic way of
  sharing folder almost unusable. Using extra files which was already
  implemented doesn't solve this use case as extra files are limited in
  time and dosn't support search and sharing permissions.
RetroShare GUI works fine if a single file is added as shared dir via
  JSON API, but probably would need tweaking some flags in file picker
  to give the ability to the user.
2021-07-18 21:16:45 +02:00
csoler
1f10be1c90
Merge pull request #2439 from csoler/v0.6-BugFixing_12
fixed errors in libretroshare.pro
2021-07-15 17:18:36 +02:00
csoler
0c98b7f178
Merge pull request #2438 from csoler/v0.6-rsHistory
[WIP] Documenting rsHistory.h to bring history to JSON api
2021-07-04 23:39:26 +02:00
csoler
abf481b0a1 removal of slignal/slots 2021-07-04 18:27:12 +02:00
csoler
b6156bff00 fixed compilation for appveyor 2021-07-04 14:06:37 +02:00
csoler
4e4427f0bd fixed errors in libretroshare.pro 2021-07-03 22:01:07 +02:00
csoler
8505544294 removed signals in HiddenService class 2021-07-03 21:54:44 +02:00
csoler
4833a8fdc4 added json api description for the rest of RsHistory 2021-07-03 20:48:47 +02:00
csoler
0dd1d7703e
Merge pull request #2421 from csoler/v0.6-plugins-VOIP
Switched video capture to QCamera and removed opencv dependency
2021-07-03 00:36:36 +02:00
csoler
875084ff52
Merge pull request #2432 from G10h4ck/rsidentity_json_fixup
Avoid JSON operations on RsGxsIdGroup::mPgpIdSign
2021-07-03 00:35:49 +02:00
csoler
d6ccd75a7f started documenting rsHistory.h to bring history to JSON api 2021-07-03 00:31:09 +02:00
csoler
a43a158750 added back missing files 2021-07-03 00:13:01 +02:00
csoler
ae79261cbc fixed bootstrapping of Tor in retroshare-service 2021-07-02 00:11:10 +02:00
csoler
da86da29ff attempt at fixing tor bootstrap. Not working yet 2021-06-29 00:23:32 +02:00
csoler
139b22b41a added rstor.h file 2021-06-27 18:14:22 +02:00
csoler
a23ad41b11 fixed event handling in Tor bootstrap process 2021-06-26 23:13:17 +02:00
csoler
607c1896e5 progress in event handling in RsTor 2021-06-26 18:52:48 +02:00
csoler
43e8ed3d98 fixed compilation 2021-06-26 17:12:17 +02:00
csoler
f13b0cbe9f keeping Qt internally for a while and making RsTor Qt-free 2021-06-25 21:46:00 +02:00
csoler
9a6257e3c5
Merge pull request #2429 from howdy-partner/smiley-fix
fix smiley bug
2021-06-24 20:35:55 +02:00
Gioacchino Mazzurco
7bf4da0691
Avoid JSON operations on RsGxsIdGroup::mPgpIdSign
The field is actually a raw memory chunk even if declared as an
  std::string as result the produced JSON is broken and JSON API clients
  cannot parse the output of methods like rsIdentity/getIdentitiesInfo
A proper fix would be refactoring the whole code to use a proper raw
  memory buffer for that field but given there is no usage for a raw PGP
  signature on a client app as RetroShare library already verify it internally
  workaround the issue by just ignoring that field in JSON serial operations.
2021-06-22 08:24:11 +02:00
csoler
d7fb3d8bf4 moved TorControl files into libretroshare. Not compiling yet. 2021-06-19 15:34:46 +02:00
csoler
20c0032ca8
Merge pull request #2430 from G10h4ck/extra_file_optimization
Files extra list optimization and cleanup
2021-06-14 13:07:19 +02:00
Gioacchino Mazzurco
476180dc14
Files extra list optimization and cleanup
Improve performances and fix compiler warnings
2021-06-14 11:53:27 +02:00
howdy-partner
0db2f3a53e fix smiley bug 2021-06-10 00:41:42 +03:00
csoler
90bc88089c fixed up bandwidth display when no video is selected 2021-05-27 21:45:56 +02:00
csoler
b78f7f11de added the possiblity to choose which camera to use 2021-05-27 21:21:26 +02:00
csoler
d1a166df55
Merge pull request #2419 from csoler/v0.6-BugFixing_10
fixed deadlock caused by wrong order in mutex lock
2021-05-26 11:41:57 +02:00
csoler
7b5be347bf refactored the UI of VOIP config panel and added list of available devices (not used yet) 2021-05-15 21:37:11 +02:00
csoler
d3f75234a7 moved abSpeech audio bar to main panel 2021-05-12 23:24:57 +02:00
csoler
d7ecd775eb made camera/audio only active when config panel is shown 2021-05-12 23:05:15 +02:00
csoler
c4fbd3a4f5 renamed AudioInputConfig into VOIPConfigPanel 2021-05-12 21:44:25 +02:00
csoler
0de9c877b8 switched video capture to QCamera and removed opencv dependency 2021-05-12 09:40:42 +02:00
G10h4ck
4b34c73cf8
Merge pull request #2416 from howdy-partner/libupnp-detection-fix
Fix qmake library path on 64 bits linux
2021-05-07 17:36:19 +02:00
csoler
8539dd503a fixed deadlock caused by wrong order in mutex lock 2021-05-04 19:49:47 +02:00
howdy-partner
fe53ee4842 Fix libupnp autodetection for qmake 2021-04-25 23:38:00 +03:00
sehraf
b4be02c57b
rebase on 0.6.6 2021-04-09 16:15:40 +02:00
csoler
12e556c204
Merge pull request #2403 from csoler/v0.6-BugFixing_10
fixing VOIP compilaiton on ubuntu 20.04
2021-04-04 14:44:49 +02:00
csoler
d1e44adb3e Merge remote-tracking branch 'upstream/master' into v0.6-BugFixing_10 2021-04-04 14:41:58 +02:00
csoler
b2f9ac5b71 fixed VOIP compilation on ubuntu 20.04 2021-04-04 14:40:15 +02:00
defnax
c71b99c902
Merge pull request #2402 from defnax/macos
Update MacOS_X_InstallGuide.md
2021-04-03 14:19:04 +02:00
defnax
7702ad69f3 Update MacOS_X_InstallGuide.md 2021-04-03 11:24:49 +02:00
defnax
4fe3c955a3 Update MacOS_X_InstallGuide.md 2021-04-02 23:00:10 +02:00
defnax
a847541c1b
Merge pull request #2401 from defnax/macos
update macOs compile instruction
2021-04-02 14:59:20 +02:00
defnax
bba3051a54 Update MacOS_X_InstallGuide.md 2021-04-02 12:45:19 +02:00
defnax
729f36c792 Update MacOS_X_InstallGuide.md 2021-04-02 12:29:21 +02:00
defnax
0683bd2717 Update MacOS_X_InstallGuide.md 2021-04-02 12:02:01 +02:00
csoler
cd61ec8635 move initialization of UI at the top in NewsFeed 2021-03-31 22:31:00 +02:00
csoler
3f50f6f2d6
Merge pull request #2385 from RetroShare/v0.6.6-Official-Release
Recent fixes to V0.6.6 official release
2021-03-31 15:40:44 +02:00
csoler
fd5766a5fb added the possibility to clear the avatar when editing 2021-03-31 15:35:50 +02:00
csoler
5274a060e5 fixed use of no avatar instead of default avatar image when creating a new ID 2021-03-31 15:35:37 +02:00
csoler
9617ee5135 added the possibility to clear the avatar when editing 2021-03-29 22:25:03 +02:00
defnax
9a500dc62f Update MacOS_X_InstallGuide.md 2021-03-29 18:22:32 +02:00
csoler
b4a3d67486 fixed use of no avatar instead of default avatar image when creating a new ID 2021-03-28 13:26:49 +02:00
csoler
fae6314374
Merge pull request #2398 from hunbernd/fix/avatartooltip
Fix avatar tooltip
2021-03-28 11:11:31 +02:00
hunbernd
4d6aa8ab5b Raise avatar size to better match the amount of text 2021-03-27 23:32:47 +01:00
hunbernd
f90692f8f2 Fixed avatar tooltip 2021-03-27 23:17:52 +01:00
defnax
1ed1842a1b
Merge pull request #2397 from defnax/macos
Update MacOS_X_InstallGuide.md
2021-03-27 15:04:36 +01:00
defnax
bfc0456730 Update MacOS_X_InstallGuide.md 2021-03-27 13:42:47 +01:00
defnax
3c45bb5553
Merge pull request #2396 from defnax/macos
Added to ship gui and chat styles for macOS
2021-03-26 23:58:51 +01:00
defnax
dca887ab9e Added OBJECTS_DIR for macOS section 2021-03-26 23:03:58 +01:00
defnax
43eeca57b9 Added to ship gui and chat styles for macOS 2021-03-26 21:22:48 +01:00
defnax
e7a87d89eb
Merge pull request #2395 from defnax/macos
Update MacOS_X_InstallGuide.md
2021-03-26 21:18:13 +01:00
csoler
e22e1c1a8b
Merge pull request #2393 from hunbernd/fix/WebUI-binary-files
Fix: WebUI truncating binary files
2021-03-26 20:15:33 +01:00
defnax
a7c2ec43a3 Update MacOS_X_InstallGuide.md 2021-03-26 17:36:01 +01:00
defnax
ad568aa786
Merge pull request #2394 from defnax/macos
Update MacOS_X_InstallGuide.md
2021-03-26 15:33:12 +01:00
defnax
f17d2eb4df Update MacOS_X_InstallGuide.md 2021-03-26 12:49:08 +01:00
defnax
a783ffac75 Update MacOS_X_InstallGuide.md 2021-03-26 12:06:10 +01:00
hunbernd
bb6841370f Fix: WebUI truncating binary files.
Fixes font files not loading properly in the webui problem.
2021-03-25 18:20:11 +01:00
Gioacchino Mazzurco
2064d7c6ff
Update OBS submodule 2021-03-24 17:48:19 +01:00
Gioacchino Mazzurco
67c607cb32
Fix Android compilation 2021-03-23 23:16:31 +01:00
defnax
914a2eca55
Merge pull request #2391 from defnax/macos
removed the old macos instructions
2021-03-23 13:55:34 +01:00
defnax
505a963212 removed the old macos instructions 2021-03-22 19:11:23 +01:00
csoler
a6573826b2
Merge pull request #2386 from rottencandy/event-api-cors
Include CORS headers in response for rsEvents/registerEventsHandler
2021-03-20 13:49:28 +01:00
Mohammed Saud
bf41f8ad92 add CORS headers to rsEvents/registerEventsHandler 2021-03-19 23:10:43 +05:30
csoler
2f793b3de1
Merge pull request #2381 from PhenomRetroShare/Fix_BroadcastHistoryRestore
Fix Name in Broadcast history restore.
2021-03-18 23:04:16 +01:00
csoler
7559b06c6b
Merge pull request #2376 from PhenomRetroShare/Fix_RemoveBadRS_ERRInFriendListModel
Fix Remove bad RS_ERR in FriendListModel
2021-03-18 23:02:15 +01:00
thunder2
5b1b0cadf9 Moved tor binaries into subfolder "tor" for Windows build 2021-03-16 21:43:26 +01:00
sehraf
feaea75847
fixup rebase 2021-03-16 21:15:32 +01:00
sehraf
911cbeb61a
fix key generation and cleanup 2021-03-16 21:15:31 +01:00
sehraf
27fa8a35b0
fix key generation and cleanup 2021-03-16 21:15:31 +01:00
sehraf
5418483934
fixed wrong size check 2021-03-16 21:15:31 +01:00
sehraf
aef993de55
reduce log 2021-03-16 21:15:31 +01:00
sehraf
8a2efe3e58
use libsam3 git submodule 2021-03-16 21:15:31 +01:00
sehraf
9c71177d3b
add workaround for i2p/libsam3#15 2021-03-16 21:15:31 +01:00
sehraf
59fa96eb5f
remove own copy of libsam3 2021-03-16 21:15:31 +01:00
sehraf
719adaae9b
update i2psam3 2021-03-16 21:15:31 +01:00
sehraf
36e238951f
update p3i2psam 2021-03-16 21:15:31 +01:00
sehraf
1fa16aa6eb
SAM3: fix double free 2021-03-16 21:15:31 +01:00
sehraf
c869b9757f
drop BOB code 2021-03-16 21:15:31 +01:00
sehraf
47a4b726a3
update libsam3 2021-03-16 21:15:31 +01:00
sehraf
25cb152a7e
make pqissl notice bad file descriptor 2021-03-16 21:15:31 +01:00
sehraf
e4336a8a41
GUI: remove i2p proxy port, there is none with SAM 2021-03-16 21:15:30 +01:00
sehraf
eb0aa340e3
remove i2psam (library) support 2021-03-16 21:15:30 +01:00
sehraf
10189ba4d0
add i2psam3 2021-03-16 21:15:30 +01:00
sehraf
42bc295d1a
add i2psam3 2021-03-16 21:15:30 +01:00
sehraf
76f0678820
add fork of libsam3
add funtion to get i2p certificate crypto algo names
2021-03-16 21:15:26 +01:00
Phenom
017f2886b3 Fix Name in Broadcast history restore. 2021-03-16 11:00:18 +01:00
defnax
130d846e47
Merge pull request #2379 from defnax/travis-attempt-fix
attempt to fix travis
2021-03-14 12:22:12 +01:00
defnax
c8ab9e0bd5 attempt to fix 2021-03-14 00:47:57 +01:00
Phenom
8ef464e21e Fix Remove bad RS_ERR in FriendListModel 2021-03-13 13:05:07 +01:00
altcoinpirate
85bfb48890
Disable animation in ft transfers dialog tree view widget 2021-03-10 01:19:45 +00:00
altcoinpirate
73355d09e3
Disable animation in file transfer shared files tree view widget 2021-03-10 01:16:50 +00:00
altcoinpirate
50ed20236f
Disable animation in file transfer search dialog tree view widget 2021-03-10 01:13:15 +00:00
RetroPooh
47d89a6959 keyring - make accepted keys removing correct; allow multi-select 2021-02-22 21:43:42 +03:00
hunbernd
a7cda5167d Fix: additional / when combining file paths 2020-10-23 22:28:35 +02:00
2265 changed files with 88273 additions and 389336 deletions

22
.gitignore vendored
View File

@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: (C) 2004-2019 Retroshare Team <contact@retroshare.cc>
# SPDX-FileCopyrightText: (C) 2004-2022 Retroshare Team <contact@retroshare.cc>
# SPDX-License-Identifier: CC0-1.0
*.o
@ -15,3 +15,23 @@ Thumbs.db
*.pro.user
.kdev4
*.kdev4
.qmake.stash
!supportlibs/libsam3/Makefile
# QtCreator cruft
*CMakeLists.txt.user*
# Build artifacts
/jsonapi-generator/src/jsonapi-generator
/jsonapi-generator/src/jsonapi-generator-doxygen-final.conf
/jsonapi-generator/src/jsonapi-includes.inl
/jsonapi-generator/src/jsonapi-wrappers.inl
/jsonapi-generator/src/xml/
/retroshare-friendserver/src/retroshare-friendserver
/retroshare-gui/src/include/
/retroshare-gui/src/retroshare
/retroshare-gui/src/temp/
/retroshare-service/src/retroshare-service
/*.tar.?z

View File

@ -1,32 +1,50 @@
image: docker:stable
image: docker:latest
services:
- docker:stable-dind
- docker:dind
stages:
- build
- test
workflow:
rules:
- if: $CI_MERGE_REQUEST_ID
- if: $CI_COMMIT_BRANCH
build-and-test:
variables:
UBUNTU_TESTING_IMAGE_TAG: "$CI_REGISTRY_IMAGE/gitlabci_outputs/ubuntu_testing:$CI_COMMIT_SHA"
build-ubuntu-test-image:
stage: build
script:
- >
if [ -n "$CI_MERGE_REQUEST_ID" ]; then
REPO_ARGS="--build-arg REPO_URL=$CI_MERGE_REQUEST_SOURCE_PROJECT_URL" ;
REPO_ARGS="$REPO_ARGS --build-arg REPO_BRANCH=$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME" ;
else
REPO_ARGS="--build-arg REPO_URL=$CI_REPOSITORY_URL" ;
REPO_ARGS="$REPO_ARGS --build-arg REPO_BRANCH=$CI_COMMIT_BRANCH" ;
fi ;
export REPO_ARGS ;
echo REPO_ARGS=$REPO_ARGS ;
- docker --version
- >
docker login "$CI_REGISTRY"
--username "$CI_REGISTRY_USER"
--password "$CI_REGISTRY_PASSWORD"
- mkdir Dockercontext
- >
docker build -t retroshare:testing $REPO_ARGS
docker build
-t $UBUNTU_TESTING_IMAGE_TAG
$($CI_PROJECT_DIR/build_scripts/GitlabCI/getRepoArgs.sh)
--file $CI_PROJECT_DIR/build_scripts/GitlabCI/gitlabCI.Dockerfile
Dockercontext
- docker push $UBUNTU_TESTING_IMAGE_TAG
- echo UBUNTU_TESTING_IMAGE_TAG=$UBUNTU_TESTING_IMAGE_TAG
test-ubuntu:
stage: test
script:
- docker --version
- >
docker login "$CI_REGISTRY"
--username "$CI_REGISTRY_USER"
--password "$CI_REGISTRY_PASSWORD"
- echo UBUNTU_TESTING_IMAGE_TAG=$UBUNTU_TESTING_IMAGE_TAG
- docker pull $UBUNTU_TESTING_IMAGE_TAG
- >
docker run --name retroshare --detach --tty retroshare:testing
docker run --name retroshare --detach --tty $UBUNTU_TESTING_IMAGE_TAG
retroshare-service --jsonApiPort 9092
- apk add jq
- >

27
.gitmodules vendored
View File

@ -10,7 +10,32 @@
[submodule "supportlibs/udp-discovery-cpp"]
path = supportlibs/udp-discovery-cpp
url = https://github.com/truvorskameikin/udp-discovery-cpp.git
branch = develop
branch = master
# develop branch was removed we were using it at commit f3a3103a6c52e5707629e8d0a7e279a7758fe845
[submodule "supportlibs/rapidjson"]
path = supportlibs/rapidjson
url = https://github.com/Tencent/rapidjson.git
[submodule "supportlibs/libsam3"]
path = supportlibs/libsam3
url = https://github.com/i2p/libsam3.git
[submodule "supportlibs/jni.hpp"]
path = supportlibs/jni.hpp
url = https://github.com/RetroShare/jni.hpp.git
[submodule "openpgpsdk"]
path = openpgpsdk
url = ../OpenPGP-SDK
branch = master
[submodule "libbitdht"]
path = libbitdht
url = ../BitDHT
branch = master
[submodule "libretroshare"]
path = libretroshare
url = https://github.com/RetroShare/libretroshare.git
branch = master
[submodule "retroshare-webui"]
path = retroshare-webui
url = https://github.com/RetroShare/RSNewWebUI.git
[submodule "supportlibs/librnp"]
path = supportlibs/librnp
url = https://github.com/rnpgp/rnp.git

View File

@ -8,12 +8,12 @@ language: cpp
matrix:
include:
- os: linux
dist: bionic
sudo: required
compiler: gcc
# - os: linux
# dist: bionic
# sudo: required
# compiler: gcc
- os: osx
osx_image: xcode10.1
osx_image: xcode10.2
compiler: clang
sudo: false
@ -68,11 +68,11 @@ before_script:
fi
script:
- if [ "${COVERITY_SCAN_BRANCH}" != 1 ]; then make -j4; fi
- if [ "${COVERITY_SCAN_BRANCH}" != 1 ]; then travis_wait 30 make -j$(nproc); fi
after_success:
- if [ $TRAVIS_OS_NAME == osx ]; then build_scripts/OSX/travis_makeOSXPackage.sh ; fi
- if [ $TRAVIS_OS_NAME == linux ] && [ "${COVERITY_SCAN_BRANCH}" != 1 ]; then make -j2; fi
# - if [ $TRAVIS_OS_NAME == linux ] && [ "${COVERITY_SCAN_BRANCH}" != 1 ]; then make -j2; fi
# branches:

View File

@ -10,10 +10,21 @@ RetroShare provides file sharing, chat, messages, forums, channels and more.
.Build Status
|===============================================================================
|GNU/Linux (via Gitlab CI) | image:https://gitlab.com/RetroShare/RetroShare/badges/master/pipeline.svg[link="https://gitlab.com/RetroShare/RetroShare/-/commits/master",title="pipeline status"]
|GNU/Linux, macOS, (via Travis CI) | image:https://travis-ci.org/RetroShare/RetroShare.svg?branch=master[link="https://travis-ci.org/RetroShare/RetroShare"]
|Windows (via AppVeyor) | image:https://ci.appveyor.com/api/projects/status/github/RetroShare/RetroShare?svg=true[link="https://ci.appveyor.com/project/RetroShare58622/retroshare"]
|macOS, (via Travis CI) | image:https://app.travis-ci.com/RetroShare/RetroShare.svg?branch=master[link="https://app.travis-ci.com/github/RetroShare/RetroShare"]
|libretroshare GNU/Linux, Android (via Gitlab CI) | image:https://gitlab.com/RetroShare/libretroshare/badges/master/pipeline.svg[link="https://gitlab.com/RetroShare/libretroshare/-/commits/master",title="pipeline status"]
|===============================================================================
== Get the source
Clone this repository, enter the directory and then get the submodules with the
following command
[source,bash]
--------
git submodule update --init --remote --force libbitdht/ libretroshare/ openpgpsdk/
--------
== Compilation

View File

@ -25,9 +25,6 @@ CONFIG += c++14
TEMPLATE = subdirs
SUBDIRS += openpgpsdk
openpgpsdk.file = openpgpsdk/src/openpgpsdk.pro
rs_jsonapi:isEmpty(JSONAPI_GENERATOR_EXE) {
SUBDIRS += jsonapi-generator
jsonapi-generator.file = jsonapi-generator/src/jsonapi-generator.pro
@ -36,7 +33,7 @@ rs_jsonapi:isEmpty(JSONAPI_GENERATOR_EXE) {
SUBDIRS += libbitdht
libbitdht.file = libbitdht/src/libbitdht.pro
libretroshare.depends += openpgpsdk libbitdht
libretroshare.depends += libbitdht
SUBDIRS += libretroshare
libretroshare.file = libretroshare/src/libretroshare.pro
@ -55,6 +52,12 @@ retroshare_service {
retroshare_service.target = retroshare_service
}
retroshare_friendserver {
SUBDIRS += retroshare_friendserver
retroshare_friendserver.file = retroshare-friendserver/src/retroshare-friendserver.pro
retroshare_friendserver.depends = libretroshare
retroshare_friendserver.target = retroshare_friendserver
}
retroshare_plugins {
SUBDIRS += plugins
plugins.file = plugins/plugins.pro
@ -62,6 +65,13 @@ retroshare_plugins {
plugins.target = plugins
}
rs_webui {
SUBDIRS += retroshare-webui
retroshare-webui.file = retroshare-webui/webui.pro
retroshare-webui.target = rs_webui
retroshare-webui.depends = retroshare_gui
}
wikipoos {
SUBDIRS += pegmarkdown
pegmarkdown.file = supportlibs/pegmarkdown/pegmarkdown.pro

View File

@ -258,10 +258,10 @@ after_build:
# artifacts configuration #
#---------------------------------#
#artifacts:
# - path: '**\*.exe'
# - path: filelist.txt
# - path: $(RS_DEPLOY)
artifacts:
- path: '**\*.exe'
- path: filelist.txt
- path: $(RS_DEPLOY)
#
# # pushing a single file

View File

@ -1,399 +0,0 @@
= RetroShare development on Android
// SPDX-FileCopyrightText: RetroShare Team <contact@retroshare.cc>
// SPDX-License-Identifier: CC-BY-SA-4.0
Compiling an application for Android is not as easy as one would imagine,
expecially one like RetroShare that has a big codebase and is not well
documented. This document is aimed to empower the reader so she can hopefully
succed or at least have a significant help in compiling her own RetroShare APK
installable on Android.
== Preparing The Environement
First of all setup your Qt for Android development environement following the
guide on the link:http://doc.qt.io/qt-5/androidgs.html[Qt for android web site].
At this point you should have Android SDK, Android NDK, and Qt for Android
working fine, and you should be capable of executing on an Android emulator or
on your Android phone Qt for Android examples.
But RetroShare is not as simple to compile as those examples. The good news is
that Android NDK ships all the necessary to build a custom toolchain that is
suitable to build RetroShare.
In order to build the toolchain with needed libraries RetroShare provides the
+android-prepare-toolchain.sh+ script; before you execute it you should define
some variables the script cannot determine in an easy and reliable manner by
itself in your terminal.
[source,bash]
-------------------------------------------------------------------------------
## The path where Android NDK is installed in your system
export ANDROID_NDK_PATH="/opt/android-ndk/"
## The path where your fresh compiled toolchain will be installed, make sure
## the parent exists
export NATIVE_LIBS_TOOLCHAIN_PATH="${HOME}/Builds/android-toolchains/retroshare-android/"
## The CPU architecture of the Android device you want to target
export ANDROID_NDK_ARCH="arm"
## The Android API level the Android device you want to target
export ANDROID_PLATFORM_VER="16"
## The number of core that yout host CPU have (just to speed up compilation) set
## it to 1 if unsure
export HOST_NUM_CPU=1
./android-prepare-toolchain.sh
-------------------------------------------------------------------------------
== Preparing Qt Creator
Now that your environement is set up you should configure Qt Creator for Android
following the
link:http://doc.qt.io/qtcreator/creator-developing-android.html[official guide].
At the end of this step your Qt Creator should recognize the Android compiler
and the Qt for Android kit.
Your Kit is now ready to use. Now you can open RetroShare as a Qt Creator
project and in the Projects left menu add the newly created kit if not already
present, so you can select it on the build type selection button down on the
left.
Now you need to set properly a few options like `JSONAPI_GENERATOR_EXE` and
disable some of RetroShare modules like `retroshare-gui` that are not available
on Android so you will have to go to
_Qt Creator left pane -> Projects -> Build and Run -> Android SOMESTUFF kit ->
Build Steps -> qmake -> Additional arguments_ +
and add the following configurations (change `Your_Path` according to your
deployment)
[source,makefile]
-------------------------------------------------------------------------------
CONFIG+=retroshare_service CONFIG+=rs_jsonapi CONFIG+=rs_deep_search
RS_UPNP_LIB=miniupnpc
JSONAPI_GENERATOR_EXE=Your_Path/jsonapi-generator/src/jsonapi-generator
NATIVE_LIBS_TOOLCHAIN_PATH=Your_Path/retroshare-android-16-arm/
CONFIG+=no_retroshare_gui CONFIG+=no_rs_service_webui_terminal_password
CONFIG+=no_rs_service_terminal_login
-------------------------------------------------------------------------------
TIP: Some versions of QtCreator try to find the Android SDK in
`/opt/android/sdk`. A workaround to this is to make a symbolic link there
pointing to your SDK installation path, like
+mkdir -p /opt/android/sdk && ln -s /home/user/android-sdk-linux
/opt/android/sdk+
== Quircks
=== Protected Apps
On some Android devices like +Huawei ALE-L21+ background applications are
killed when screen is turned off unless they are in the _protected app_ list.
At moment seems apps developers don't have a way to have the application
_protected_ by default, unless the phone vendor decide the app is _popular_ so
the user have to enable _protection_ for RetroShare manually on those mobile
phones. +
{empty} +
To enable enable _protection_: +Android menu -> Settings -> Privacy & security
-> Protected apps -> RetroShare+ +
{empty} +
Other devices may offer similar _features_ please report them.
=== APK signature mismatch
If you try to install a RetroShare APK that comes from a different source
(eg: if you try to upgrade from F-Droid when you originally installed an APK
build by yourself) Android will prevent that from happening. In that case the
only solution is to uninstall the app and then install the new APK but if you do
it also the application data and your precious cryptographic keys, friend list
etc. will be lost forever.
To avoid that you can attempt to manually backup and then restore from the
command-line (`adb backup` seems not working either) to change the app source
without erasing the appliation data.
CAUTION: Following steps require root access on your Android device
.Backup RetroShare Android application data
[source,bash]
--------------------------------------------------------------------------------
export ORIG_DIR="/data/data/org.retroshare.android.qml_app"
export BACKUP_DIR="org.retroshare.android.qml_app.backup"
adb root
adb shell am force-stop org.retroshare.android.qml_app
sleep 1s
mkdir ${BACKUP_DIR}
# Avoid adb pull failing
adb shell rm ${ORIG_DIR}/files/.retroshare/libresapi.sock
adb pull ${ORIG_DIR}/files/ ${BACKUP_DIR}/files/
--------------------------------------------------------------------------------
After this you should be able to uninstall the old APK with your preferred
method, as example from the command-line.
.Uninstall RetroShare Android from the command-line
[source,bash]
--------------------------------------------------------------------------------
adb uninstall org.retroshare.android.qml_app
--------------------------------------------------------------------------------
Now you can install a different signature APK and then restore the application
data with the following commands.
[source,bash]
--------------------------------------------------------------------------------
export ORIG_DIR="/data/data/org.retroshare.android.qml_app"
export BACKUP_DIR="org.retroshare.android.qml_app.backup"
adb root
## Launch the app to make sure the parent directory exists and has proper owner
adb shell monkey -p org.retroshare.android.qml_app -c android.intent.category.LAUNCHER 1
sleep 1s
adb shell am force-stop org.retroshare.android.qml_app
sleep 1s
APP_OWNER="$(adb shell busybox ls -lnd ${ORIG_DIR} | awk '{print $3":"$4}')"
adb shell rm -rf ${ORIG_DIR}/files
adb push ${BACKUP_DIR}/files/ ${ORIG_DIR}/files/
adb shell busybox chown -R ${APP_OWNER} ${ORIG_DIR}/files/
--------------------------------------------------------------------------------
Opening RetroShare android app now should show your old profile.
== Debugging with GDB
If building RetroShare Android package seems tricky, setting up a functional
debugging environement for it feels like black magic. This section is meant to
help you doing it with less headache and hopefully in a reproducible way.
Unfortunately at the time of the last update to this guide, Qt build system
strips debugging symbols from the package and from the buildroot also if you
compile with debugging enabled. Fiddling with `qmake` configurations and
variables like `CONFIG+=debug`, `CONFIG+=force_debug_info` or `QMAKE_STRIP`
either as commandline arguments or inside retroshare `.pro` and `.pri` files is
uneffective. IMHO Qt should handle this on itself so it is probably worth
reporting a bug to them. So to workaround this problem you need to fiddle a bit
with the Android NDK. In my case I always keep +Debug+ or +Release+ suffix in
my build directory name depending on what kind of build it is, so I use this
information and modify `llvm-strip` in a way that it will strip only if stripped
file path doesn't contain +Debug+.
.Modify llvm-strip inside Android NDK
--------------------------------------------------------------------------------
## Set ANDROID_NDK_PATH to your Android NDK installation path
export ANDROID_NDK_PATH="/opt/android-ndk/"
## Define a convenience variable with llvm-strip path
export ANDROID_NDK_LLVM_STRIP="${ANDROID_NDK_PATH}/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip"
## If not existing yer create a backup of the original llvm-strip
[ -f "${ANDROID_NDK_LLVM_STRIP}.back" ] ||
cp "${ANDROID_NDK_LLVM_STRIP}" "${ANDROID_NDK_LLVM_STRIP}.back"
## Create a new llvm-strip that does nothing if the argument path contains Debug
cat > "${ANDROID_NDK_LLVM_STRIP}" << LLVMSTRIPTRICK
#!/bin/bash
echo "\${2}" | grep -q Debug ||
"${ANDROID_NDK_LLVM_STRIP}.back" --strip-all "\${2}"
LLVMSTRIPTRICK
## Eventually you can revert back simply by running
# `mv "${ANDROID_NDK_LLVM_STRIP}.back" "${ANDROID_NDK_LLVM_STRIP}"`
--------------------------------------------------------------------------------
To attach to the `retroshare-service` running on Android you need also to pull a
debugging sysroot out of your device first, RetroShare sources provides an
helper script to do that.
.Prepare debugging sysroot with helper script
[source,bash]
--------------------------------------------------------------------------------
## Set RetroShare source path
export RS_SOURCE_DIR="${HOME}/Development/rs-develop"
## Optionally set your device ID first available will be used, you can run
## `adb devices` to list available devices.
#export ANDROID_SERIAL="YT013PSPGK"
## Optionally set a path where to save the debugging sysroot otherwise default
## is used.
#export DEBUG_SYSROOT="${HOME}/Builds/debug_sysroot/${ANDROID_SERIAL}/"
## Run the helper script
${RS_SOURCE_DIR}/build_scripts/Android/pull_sysroot.sh
--------------------------------------------------------------------------------
.Prepare Android NDK GDB configurations
[source,bash]
--------------------------------------------------------------------------------
## Optionally set Qt version variable consistently with your installation
export QT_VERSION="5.12.7"
## Optionally set Qt architecture variable consistently with Android device
export QT_ARCH="arm64_v8a"
## Optionally set Qt path variable consistently with your installation
export QT_DIR="/opt/Qt-${QT_VERSION}/${QT_VERSION}/"
## Optionally set RetroShare buildroot path
export RS_BUILD_DIR="${HOME}/Builds/RetroShare-Android_for_${QT_ARCH}_Clang_Qt_${QT_VERSION//./_}_android_${QT_ARCH}-Debug/"
## Optionally set gdb config file path
export GDB_CONFIGS_FILE="${HOME}/Builds/gdb_configs_${QT_ARCH}"
## Generate Android NDK GDB configuration
${RS_SOURCE_DIR}/build_scripts/Android/generate_gdb_init_commands.sh
--------------------------------------------------------------------------------
You will need to run the following steps everytime you want to debug
`retroshare-service` on Android.
Make sure `retroshare-service` is running on your connected Android device.
.Run GDB server on your Android device from your host console
[source,bash]
--------------------------------------------------------------------------------
${RS_SOURCE_DIR}/build_scripts/Android/start_gdbserver.sh
--------------------------------------------------------------------------------
.Run Android NDK GDB on your workstation and attach
[source,bash]
--------------------------------------------------------------------------------
## Start NDK gdb
${ANDROID_NDK_PATH}/prebuilt/linux-x86_64/bin/gdb
## Instruct GDB how and where to find debugging symbols
(gdb) source $GDB_CONFIGS_FILE
## Connect to the gdbserver running on the phone
(gdb) target remote 127.0.01:5039
## Have fun debugging
(gdb)
--------------------------------------------------------------------------------
== Debugging with Qt Creator
WARNING: As of the last update to this guide, debugging retroshare-service
running on Android via Qt creator doesn't wrok even with all the trickery
explained in this section, you better learn how to debug with GDB reading
carefully previous section.
Qt Creator actually support debugging only for the foreground activity, so to
debug what's happening in the core extra trickery is needed.
- Run the App in Debug mode from QtCreator "Start Debugging" button
- Enable QtCreator debugger console view Menu->Window->Debugger Log
- Run +show solib-search-path+ in the QtCreator GDB console
- Take note of the output you get in the right pane of the console
- Thanks https://stackoverflow.com/a/31164313 for the idea
TIP: QtCreator GDB console seems a bit buggy and easly trigger timeout
message when a command is run, in that case attempt to run the command while the
debugging is paused or at breakpoint, or with other similar tricks.
CAUTION: Following steps require root access on your Android device
Now on your phone yuo need to authorize root access to applications, then once
you plug your sacrifical Android phone run this commands
.Run gdbserver as root on Android phone
[source,bash]
--------------------------------------------------------------------------------
## Open a shell from your workstation on the connected Android phone
adb shell
## take the note of the phone IP address
ip address show
## Gain root permissions on the shell
su
## Attach with gdbserver and listen on one TCP port
gdbserver :4567 --attach $(pgrep org.retroshare.android.qml_app:rs)
--------------------------------------------------------------------------------
.Prepare and run Android NDK GDB on your workstation
[source,bash]
--------------------------------------------------------------------------------
## Setup some convenience variables
NDK_GDB="${ANDROID_NDK_PATH}/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gdb"
RS_BUILD_PATH="${HOME}/Builds/RetroShare-Android_for_armeabi_v7a_GCC_4_9_Qt_5_9_2_android_armv7-Debug/"
## Start Android NDK GDB of your phone architecture passing the executable
$NDK_GDB $RS_BUILD_PATH/retroshare-android-service/src/libretroshare-android-service.so
## Instruct GDB how and where to find debugging symbols
(gdb) set auto-solib-add on
(gdb) set solib-search-path THE:BIG:LIST:OF:DIRECTORIES:YOU:TAKE:NOTE:BEFORE
## Connect to the gdbserver running on the phone
(gdb) target remote $PHONE_IP:4567
## Have fun debugging
(gdb)
--------------------------------------------------------------------------------
TIP: Some time WiFi power saving on Android mess with the GDB connection,
to prevent that from appening open another +adb shell+ and live +ping+ toward
your work-station running
== Embedding into other Android packages
As showed by https://elrepo.io/[elRepo.io] developers it is possible and quite
easy to embed `retroshare-service` into other Android packages see description
https://gitlab.com/elRepo.io/elRepo.io-android/-/blob/master/README.adoc
And implementation details
https://gitlab.com/elRepo.io/elRepo.io-android/-/blob/master/android/app/build.gradle
== Furter Readings
- link:http://doc.qt.io/qt-5/android-support.html[]
- link:https://developer.android.com/ndk/guides/libs.html[]
- link:retroshare://forum?name=Compiling%20nogui%20for%20android&id=8fd22bd8f99754461e7ba1ca8a727995&msgid=4e0f92330600bba9cf978f384f4b7b2f2ca64eff[]
- link:retroshare://file?name=Android%20Native%20Development%20Kit%20Cookbook.pdf&size=29214468&hash=0123361c1b14366ce36118e82b90faf7c7b1b136[]
- link:https://groups.google.com/forum/#!topic/android-developers/srATPaL0aRU[]
- link:https://stackoverflow.com/questions/31638986/protected-apps-setting-on-huawei-phones-and-how-to-handle-it[]
- link:https://tthtlc.wordpress.com/2012/09/19/how-to-do-remote-debugging-via-gdbserver-running-inside-the-android-phone/[]
- link:https://source.android.com/devices/tech/debug/[]
- link:https://source.android.com/devices/tech/debug/gdb[]
- link:https://fw4spl-org.github.io/fw4spl-blog/2015/07/27/Native-debugging-on-Android-with-QtCreator.html[]
- link:https://fragglet.livejournal.com/19646.html[]
- link:https://github.com/android-ndk/ndk/issues/773[How to build without using standalone toolchain?]
== License
Copyright (C) 2016-2020 Gioacchino Mazzurco <gio@eigenlab.org> +
Copyright (C) 2020 Asociación Civil Altermundi <info@altermundi.net> +
This work is licensed under a Creative Commons Attribution-Share Alike 4.0 International License.
image::https://i.creativecommons.org/l/by-sa/4.0/88x31.png[Creative Commons License, link=http://creativecommons.org/licenses/by-sa/4.0/]

View File

@ -1,85 +0,0 @@
#!/bin/bash
# Script to prepare Android NDK GDB configurations to debug retroshare-service
#
# Copyright (C) 2020 Gioacchino Mazzurco <gio@eigenlab.org>
# Copyright (C) 2020 Asociación Civil Altermundi <info@altermundi.net>
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published by the
# Free Software Foundation, version 3.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License along
# with this program. If not, see <https://www.gnu.org/licenses/>
## Define default value for variable, take two arguments, $1 variable name,
## $2 default variable value, if the variable is not already define define it
## with default value.
function define_default_value()
{
VAR_NAME="${1}"
DEFAULT_VALUE="${2}"
[ -z "${!VAR_NAME}" ] && export ${VAR_NAME}="${DEFAULT_VALUE}"
}
define_default_value QT_VERSION "5.12.4"
define_default_value QT_ARCH "arm64_v8a"
define_default_value QT_DIR "/opt/Qt-${QT_VERSION}/${QT_VERSION}/"
define_default_value ANDROID_SERIAL "$(adb devices | head -n 2 | tail -n 1 | awk '{print $1}')"
define_default_value RS_BUILD_DIR "${HOME}/Builds/RetroShare-Android_for_${QT_ARCH}_Clang_Qt_${QT_VERSION//./_}_android_${QT_ARCH}-Debug/"
define_default_value RS_SOURCE_DIR "${HOME}/Development/rs-develop/"
define_default_value DEBUG_SYSROOT "${HOME}/Builds/debug_sysroot/${ANDROID_SERIAL}/"
define_default_value GDB_CONFIGS_FILE "${HOME}/Builds/gdb_configs_${QT_ARCH}"
scanDir()
{
find "$1" -type d -not -path '*/\.git/*' | tr '\n' ':' >> $GDB_CONFIGS_FILE
}
putSeparator()
{
echo >> $GDB_CONFIGS_FILE
echo >> $GDB_CONFIGS_FILE
}
echo "set sysroot ${DEBUG_SYSROOT}" > $GDB_CONFIGS_FILE
putSeparator
echo "set auto-solib-add on" >> $GDB_CONFIGS_FILE
echo -n "set solib-search-path " >> $GDB_CONFIGS_FILE
scanDir "${RS_BUILD_DIR}"
scanDir "${DEBUG_SYSROOT}"
scanDir "${QT_DIR}/android_${QT_ARCH}/lib/"
scanDir "${QT_DIR}/android_${QT_ARCH}/plugins/"
scanDir "${QT_DIR}/android_${QT_ARCH}/qml/"
putSeparator
echo -n "directory " >> $GDB_CONFIGS_FILE
scanDir ${RS_SOURCE_DIR}/jsonapi-generator/src
scanDir ${RS_SOURCE_DIR}/libbitdht/src
scanDir ${RS_SOURCE_DIR}/openpgpsdk/src
scanDir ${RS_SOURCE_DIR}/libretroshare/src
scanDir ${RS_SOURCE_DIR}/retroshare-service/src
scanDir ${RS_SOURCE_DIR}/supportlibs/rapidjson/include/
scanDir ${RS_SOURCE_DIR}/supportlibs/restbed/source/
scanDir ${RS_SOURCE_DIR}/supportlibs/udp-discovery-cpp/
scanDir ${RS_SOURCE_DIR}/supportlibs/restbed/dependency/asio/asio/include/
scanDir ${RS_SOURCE_DIR}/supportlibs/restbed/dependency/catch/include/
putSeparator
## see https://stackoverflow.com/questions/28972367/gdb-backtrace-without-stopping
echo "catch signal SIGSEGV" >> $GDB_CONFIGS_FILE
echo "commands
bt
continue
end" >> $GDB_CONFIGS_FILE
putSeparator
echo GDB_CONFIGS_FILE=$GDB_CONFIGS_FILE

View File

@ -1,549 +0,0 @@
#!/bin/bash
# Script to prepare RetroShare Android package building toolchain
#
# Copyright (C) 2016-2020 Gioacchino Mazzurco <gio@eigenlab.org>
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published by the
# Free Software Foundation, version 3.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License along
# with this program. If not, see <https://www.gnu.org/licenses/>
#
# SPDX-FileCopyrightText: Retroshare Team <contact@retroshare.cc>
# SPDX-License-Identifier: AGPL-3.0-only
## Define default value for variable, take two arguments, $1 variable name,
## $2 default variable value, if the variable is not already define define it
## with default value.
function define_default_value()
{
VAR_NAME="${1}"
DEFAULT_VALUE="${2}"
[ -z "${!VAR_NAME}" ] && export ${VAR_NAME}="${DEFAULT_VALUE}" || true
}
## You are supposed to provide the following variables according to your system setup
define_default_value ANDROID_NDK_PATH "/opt/android-ndk/"
define_default_value ANDROID_NDK_ARCH "arm"
define_default_value ANDROID_PLATFORM_VER "16"
define_default_value NATIVE_LIBS_TOOLCHAIN_PATH "${HOME}/Builds/android-toolchains/retroshare-android-${ANDROID_PLATFORM_VER}-${ANDROID_NDK_ARCH}/"
define_default_value HOST_NUM_CPU $(nproc)
define_default_value BZIP2_SOURCE_VERSION "1.0.6"
define_default_value BZIP2_SOURCE_SHA256 a2848f34fcd5d6cf47def00461fcb528a0484d8edef8208d6d2e2909dc61d9cd
define_default_value OPENSSL_SOURCE_VERSION "1.1.1c"
define_default_value OPENSSL_SOURCE_SHA256 f6fb3079ad15076154eda9413fed42877d668e7069d9b87396d0804fdb3f4c90
define_default_value SQLITE_SOURCE_YEAR "2018"
define_default_value SQLITE_SOURCE_VERSION "3250200"
define_default_value SQLITE_SOURCE_SHA256 da9a1484423d524d3ac793af518cdf870c8255d209e369bd6a193e9f9d0e3181
define_default_value SQLCIPHER_SOURCE_VERSION "4.2.0"
define_default_value SQLCIPHER_SOURCE_SHA256 105c1b813f848da038c03647a8bfc9d42fb46865e6aaf4edfd46ff3b18cdccfc
define_default_value LIBUPNP_SOURCE_VERSION "1.8.4"
define_default_value LIBUPNP_SOURCE_SHA256 976c3e4555604cdd8391ed2f359c08c9dead3b6bf131c24ce78e64d6669af2ed
define_default_value INSTALL_QT_ANDROID "false"
define_default_value QT_VERSION "5.12.0"
define_default_value QT_ANDROID_INSTALLER_SHA256 a214084e2295c9a9f8727e8a0131c37255bf724bfc69e80f7012ba3abeb1f763
define_default_value RESTBED_SOURCE_VERSION f74f9329dac82e662c1d570b7cd72c192b729eb4
define_default_value UDP_DISCOVERY_CPP_SOURCE "https://github.com/truvorskameikin/udp-discovery-cpp.git"
define_default_value UDP_DISCOVERY_CPP_VERSION "develop"
define_default_value XAPIAN_SOURCE_VERSION "1.4.7"
define_default_value XAPIAN_SOURCE_SHA256 13f08a0b649c7afa804fa0e85678d693fd6069dd394c9b9e7d41973d74a3b5d3
define_default_value RAPIDJSON_SOURCE_VERSION "1.1.0"
define_default_value RAPIDJSON_SOURCE_SHA256 bf7ced29704a1e696fbccf2a2b4ea068e7774fa37f6d7dd4039d0787f8bed98e
define_default_value MINIUPNPC_SOURCE_VERSION "2.1.20190625"
define_default_value MINIUPNPC_SOURCE_SHA256 8723f5d7fd7970de23635547700878cd29a5c2bb708b5e5475b2d1d2510317fb
## $1 filename, $2 sha256 hash
function check_sha256()
{
echo ${2} "${1}" | sha256sum -c &> /dev/null
}
## $1 filename, $2 sha256 hash, $3 url
function verified_download()
{
FILENAME="$1"
SHA256="$2"
URL="$3"
check_sha256 "${FILENAME}" "${SHA256}" ||
{
rm -rf "${FILENAME}"
wget -O "${FILENAME}" "$URL" ||
{
echo "Failed downloading ${FILENAME} from $URL"
exit 1
}
check_sha256 "${FILENAME}" "${SHA256}" ||
{
echo "SHA256 mismatch for ${FILENAME} from ${URL} expected sha256 ${SHA256} got $(sha256sum ${FILENAME} | awk '{print $1}')"
exit 1
}
}
}
cArch=""
eABI=""
case "${ANDROID_NDK_ARCH}" in
"arm")
cArch="${ANDROID_NDK_ARCH}"
eABI="eabi"
;;
"arm64")
cArch="aarch64"
eABI=""
;;
"x86")
cArch="i686"
eABI=""
;;
esac
export SYSROOT="${NATIVE_LIBS_TOOLCHAIN_PATH}/sysroot/"
export PREFIX="${SYSROOT}/usr/"
export CC="${NATIVE_LIBS_TOOLCHAIN_PATH}/bin/${cArch}-linux-android${eABI}-clang"
export CXX="${NATIVE_LIBS_TOOLCHAIN_PATH}/bin/${cArch}-linux-android${eABI}-clang++"
export AR="${NATIVE_LIBS_TOOLCHAIN_PATH}/bin/${cArch}-linux-android${eABI}-ar"
export RANLIB="${NATIVE_LIBS_TOOLCHAIN_PATH}/bin/${cArch}-linux-android${eABI}-ranlib"
## More information available at https://android.googlesource.com/platform/ndk/+/ics-mr0/docs/STANDALONE-TOOLCHAIN.html
build_toolchain()
{
echo "build_toolchain()
################################################################################
################################################################################
################################################################################
"
rm -rf ${NATIVE_LIBS_TOOLCHAIN_PATH}
${ANDROID_NDK_PATH}/build/tools/make_standalone_toolchain.py --verbose \
--arch ${ANDROID_NDK_ARCH} --install-dir ${NATIVE_LIBS_TOOLCHAIN_PATH} \
--api ${ANDROID_PLATFORM_VER}
find "${PREFIX}/include/" -not -type d > "${NATIVE_LIBS_TOOLCHAIN_PATH}/deletefiles"
}
## This avoid <cmath> include errors due to -isystem and -I ordering issue
delete_copied_includes()
{
echo "delete_copied_includes()
################################################################################
################################################################################
################################################################################
"
cat "${NATIVE_LIBS_TOOLCHAIN_PATH}/deletefiles" | while read delFile ; do
rm "$delFile"
done
}
## More information available at https://gitlab.com/relan/provisioners/merge_requests/1 and http://stackoverflow.com/a/34032216
install_qt_android()
{
echo "install_qt_android()
################################################################################
################################################################################
################################################################################
"
QT_VERSION_CODE=$(echo $QT_VERSION | tr -d .)
QT_INSTALL_PATH=${NATIVE_LIBS_TOOLCHAIN_PATH}/Qt
QT_INSTALLER="qt-unified-linux-x64-3.0.2-online.run"
verified_download $QT_INSTALLER $QT_ANDROID_INSTALLER_SHA256 \
http://master.qt.io/archive/online_installers/3.0/${QT_INSTALLER}
chmod a+x ${QT_INSTALLER}
QT_INSTALLER_SCRIPT="qt_installer_script.js"
cat << EOF > "${QT_INSTALLER_SCRIPT}"
function Controller() {
installer.autoRejectMessageBoxes();
installer.installationFinished.connect(function() {
gui.clickButton(buttons.NextButton);
});
var welcomePage = gui.pageWidgetByObjectName("WelcomePage");
welcomePage.completeChanged.connect(function() {
if (gui.currentPageWidget().objectName == welcomePage.objectName)
gui.clickButton(buttons.NextButton);
});
}
Controller.prototype.WelcomePageCallback = function() {
gui.clickButton(buttons.NextButton);
}
Controller.prototype.CredentialsPageCallback = function() {
gui.clickButton(buttons.NextButton);
}
Controller.prototype.IntroductionPageCallback = function() {
gui.clickButton(buttons.NextButton);
}
Controller.prototype.TargetDirectoryPageCallback = function() {
gui.currentPageWidget().TargetDirectoryLineEdit.setText("$QT_INSTALL_PATH");
gui.clickButton(buttons.NextButton);
}
Controller.prototype.ComponentSelectionPageCallback = function() {
var widget = gui.currentPageWidget();
// You can get these component names by running the installer with the
// --verbose flag. It will then print out a resource tree.
widget.deselectComponent("qt.tools.qtcreator");
widget.deselectComponent("qt.tools.doc");
widget.deselectComponent("qt.tools.examples");
widget.selectComponent("qt.$QT_VERSION_CODE.android_armv7");
gui.clickButton(buttons.NextButton);
}
Controller.prototype.LicenseAgreementPageCallback = function() {
gui.currentPageWidget().AcceptLicenseRadioButton.setChecked(true);
gui.clickButton(buttons.NextButton);
}
Controller.prototype.StartMenuDirectoryPageCallback = function() {
gui.clickButton(buttons.NextButton);
}
Controller.prototype.ReadyForInstallationPageCallback = function() {
gui.clickButton(buttons.NextButton);
}
Controller.prototype.FinishedPageCallback = function() {
var checkBoxForm = gui.currentPageWidget().LaunchQtCreatorCheckBoxForm;
if (checkBoxForm && checkBoxForm.launchQtCreatorCheckBox)
checkBoxForm.launchQtCreatorCheckBox.checked = false;
gui.clickButton(buttons.FinishButton);
}
EOF
QT_QPA_PLATFORM=minimal ./${QT_INSTALLER} --script ${QT_INSTALLER_SCRIPT}
}
## More information available at retroshare://file?name=Android%20Native%20Development%20Kit%20Cookbook.pdf&size=29214468&hash=0123361c1b14366ce36118e82b90faf7c7b1b136
build_bzlib()
{
echo "build_bzlib()
################################################################################
################################################################################
################################################################################
"
B_dir="bzip2-${BZIP2_SOURCE_VERSION}"
rm -rf $B_dir
verified_download $B_dir.tar.gz $BZIP2_SOURCE_SHA256 \
http://distfiles.gentoo.org/distfiles/bzip2-${BZIP2_SOURCE_VERSION}.tar.gz
tar -xf $B_dir.tar.gz
cd $B_dir
sed -i "/^CC=.*/d" Makefile
sed -i "/^AR=.*/d" Makefile
sed -i "/^RANLIB=.*/d" Makefile
sed -i "/^LDFLAGS=.*/d" Makefile
sed -i "s/^all: libbz2.a bzip2 bzip2recover test/all: libbz2.a bzip2 bzip2recover/" Makefile
make -j${HOST_NUM_CPU}
make install PREFIX=${PREFIX}
# sed -i "/^CC=.*/d" Makefile-libbz2_so
# make -f Makefile-libbz2_so -j${HOST_NUM_CPU}
# cp libbz2.so.1.0.6 ${SYSROOT}/usr/lib/libbz2.so
cd ..
}
## More information available at http://doc.qt.io/qt-5/opensslsupport.html
build_openssl()
{
echo "build_openssl()
################################################################################
################################################################################
################################################################################
"
B_dir="openssl-${OPENSSL_SOURCE_VERSION}"
rm -rf $B_dir
verified_download $B_dir.tar.gz $OPENSSL_SOURCE_SHA256 \
https://www.openssl.org/source/$B_dir.tar.gz
tar -xf $B_dir.tar.gz
cd $B_dir
## We link openssl statically to avoid android silently sneaking in his own
## version of libssl.so (we noticed this because it had some missing symbol
## that made RS crash), the crash in some android version is only one of the
## possible problems the fact that android insert his own binary libssl.so pose
## non neglegible security concerns.
oBits="32"
[[ ${ANDROID_NDK_ARCH} =~ .*64.* ]] && oBits=64
ANDROID_NDK="${ANDROID_NDK_PATH}" PATH="${SYSROOT}/bin/:${PATH}" \
./Configure linux-generic${oBits} -fPIC --prefix="${PREFIX}" \
--openssldir="${SYSROOT}/etc/ssl"
# sed -i 's/LIBNAME=$$i LIBVERSION=$(SHLIB_MAJOR).$(SHLIB_MINOR) \\/LIBNAME=$$i \\/g' Makefile
# sed -i '/LIBCOMPATVERSIONS=";$(SHLIB_VERSION_HISTORY)" \\/d' Makefile
make -j${HOST_NUM_CPU}
make install
rm -f ${PREFIX}/lib/libssl.so*
rm -f ${PREFIX}/lib/libcrypto.so*
cd ..
}
build_sqlite()
{
echo "build_sqlite()
################################################################################
################################################################################
################################################################################
"
B_dir="sqlite-autoconf-${SQLITE_SOURCE_VERSION}"
rm -rf $B_dir
verified_download $B_dir.tar.gz $SQLITE_SOURCE_SHA256 \
https://www.sqlite.org/${SQLITE_SOURCE_YEAR}/$B_dir.tar.gz
tar -xf $B_dir.tar.gz
cd $B_dir
./configure --with-pic --prefix="${PREFIX}" --host=${cArch}-linux
make -j${HOST_NUM_CPU}
make install
rm -f ${PREFIX}/lib/libsqlite3.so*
# ${CC} -shared -o libsqlite3.so -fPIC sqlite3.o -ldl
# cp libsqlite3.so "${SYSROOT}/usr/lib"
cd ..
}
build_sqlcipher()
{
echo "build_sqlcipher()
################################################################################
################################################################################
################################################################################
"
B_dir="sqlcipher-${SQLCIPHER_SOURCE_VERSION}"
rm -rf $B_dir
T_file="${B_dir}.tar.gz"
verified_download $T_file $SQLCIPHER_SOURCE_SHA256 \
https://github.com/sqlcipher/sqlcipher/archive/v${SQLCIPHER_SOURCE_VERSION}.tar.gz
tar -xf $T_file
cd $B_dir
case "${ANDROID_NDK_ARCH}" in
"arm64")
# SQLCipher config.sub is outdated and doesn't recognize newer architectures
rm config.sub
autoreconf --verbose --install --force
automake --add-missing --copy --force-missing
;;
esac
./configure --with-pic --build=$(sh ./config.guess) \
--host=${cArch}-linux \
--prefix="${PREFIX}" --with-sysroot="${SYSROOT}" \
--enable-tempstore=yes \
--disable-tcl --disable-shared \
CFLAGS="-DSQLITE_HAS_CODEC" LDFLAGS="${PREFIX}/lib/libcrypto.a"
make -j${HOST_NUM_CPU}
make install
cd ..
}
build_libupnp()
{
echo "build_libupnp()
################################################################################
################################################################################
################################################################################
"
B_dir="pupnp-release-${LIBUPNP_SOURCE_VERSION}"
B_ext=".tar.gz"
B_file="${B_dir}${B_ext}"
rm -rf $B_dir
verified_download $B_file $LIBUPNP_SOURCE_SHA256 \
https://github.com/mrjimenez/pupnp/archive/release-${LIBUPNP_SOURCE_VERSION}${B_ext}
tar -xf $B_file
cd $B_dir
./bootstrap
## liupnp must be configured as static library because if not the linker will
## look for libthreadutils.so.6 at runtime that cannot be packaged on android
## as it supports only libname.so format for libraries, thus resulting in a
## crash at startup.
./configure --with-pic --enable-static --disable-shared --disable-samples \
--disable-largefile \
--prefix="${PREFIX}" --host=${cArch}-linux
make -j${HOST_NUM_CPU}
make install
cd ..
}
build_rapidjson()
{
echo "build_rapidjson()
################################################################################
################################################################################
################################################################################
"
B_dir="rapidjson-${RAPIDJSON_SOURCE_VERSION}"
D_file="${B_dir}.tar.gz"
verified_download $D_file $RAPIDJSON_SOURCE_SHA256 \
https://github.com/Tencent/rapidjson/archive/v${RAPIDJSON_SOURCE_VERSION}.tar.gz
tar -xf $D_file
cp -r "${B_dir}/include/rapidjson/" "${PREFIX}/include/rapidjson"
}
build_restbed()
{
echo "build_restbed()
################################################################################
################################################################################
################################################################################
"
[ -d restbed ] || git clone --depth=2000 https://github.com/Corvusoft/restbed.git
cd restbed
# git fetch --tags
# git checkout tags/${RESTBED_SOURCE_VERSION}
git checkout ${RESTBED_SOURCE_VERSION}
git submodule update --init dependency/asio
git submodule update --init dependency/catch
git submodule update --init dependency/kashmir
cd ..
rm -rf restbed-build; mkdir restbed-build ; cd restbed-build
cmake \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON BUILD_TESTS=OFF \
-DBUILD_SSL=OFF -DCMAKE_INSTALL_PREFIX="${PREFIX}" -B. -H../restbed
make -j${HOST_NUM_CPU}
make install
cp "${PREFIX}/library/librestbed.a" "${PREFIX}/lib/"
cd ..
}
build_udp-discovery-cpp()
{
echo "build_udp-discovery-cpp()
################################################################################
################################################################################
################################################################################
"
S_dir="udp-discovery-cpp"
[ -d $S_dir ] || git clone $UDP_DISCOVERY_CPP_SOURCE $S_dir
cd $S_dir
git checkout $UDP_DISCOVERY_CPP_VERSION
cd ..
B_dir="udp-discovery-cpp-build"
rm -rf ${B_dir}; mkdir ${B_dir}; cd ${B_dir}
cmake \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-DCMAKE_INSTALL_PREFIX="${PREFIX}" -B. -H../udp-discovery-cpp
make -j${HOST_NUM_CPU}
cp libudp-discovery.a "${PREFIX}/lib/"
cp ../$S_dir/*.hpp "${PREFIX}/include/"
cd ..
}
build_xapian()
{
echo "build_xapian()
################################################################################
################################################################################
################################################################################
"
B_dir="xapian-core-${XAPIAN_SOURCE_VERSION}"
D_file="$B_dir.tar.xz"
verified_download $D_file $XAPIAN_SOURCE_SHA256 \
https://oligarchy.co.uk/xapian/${XAPIAN_SOURCE_VERSION}/$D_file
rm -rf $B_dir
tar -xf $D_file
cd $B_dir
B_endiannes_detection_failure_workaround="ac_cv_c_bigendian=no"
B_large_file=""
[ "${ANDROID_PLATFORM_VER}" -lt "24" ] && B_large_file="--disable-largefile"
./configure ${B_endiannes_detection_failure_workaround} ${B_large_file} \
--with-pic \
--disable-backend-inmemory --disable-backend-remote \
--disable--backend-chert --enable-backend-glass \
--host=${cArch}-linux --enable-static --disable-shared \
--prefix="${PREFIX}" --with-sysroot="${SYSROOT}"
make -j${HOST_NUM_CPU}
make install
}
build_miniupnpc()
{
echo "build_miniupnpc()
################################################################################
################################################################################
################################################################################
"
S_dir="miniupnpc-${MINIUPNPC_SOURCE_VERSION}"
B_dir="miniupnpc-${MINIUPNPC_SOURCE_VERSION}-build"
D_file="$S_dir.tar.gz"
verified_download $D_file $MINIUPNPC_SOURCE_SHA256 \
http://miniupnp.free.fr/files/${D_file}
rm -rf $S_dir $B_dir
tar -xf $D_file
mkdir $B_dir
cd $B_dir
cmake \
-DUPNPC_BUILD_STATIC=TRUE \
-DUPNPC_BUILD_SHARED=FALSE \
-DUPNPC_BUILD_TESTS=FALSE \
-DUPNPC_BUILD_SAMPLE=FALSE \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-DCMAKE_INSTALL_PREFIX="${PREFIX}" -B. -S../$S_dir
make -j${HOST_NUM_CPU}
make install
}
build_toolchain
[ "${INSTALL_QT_ANDROID}X" != "trueX" ] || install_qt_android
build_bzlib
build_openssl
build_sqlite
build_sqlcipher
build_libupnp
build_rapidjson
build_restbed
build_udp-discovery-cpp
build_xapian
build_miniupnpc
delete_copied_includes
echo NATIVE_LIBS_TOOLCHAIN_PATH=${NATIVE_LIBS_TOOLCHAIN_PATH}

View File

@ -1,90 +0,0 @@
#!/bin/bash
# Script to pull debugging sysroot from Android devices
#
# Copyright (C) 2020 Gioacchino Mazzurco <gio@eigenlab.org>
# Copyright (C) 2020 Asociación Civil Altermundi <info@altermundi.net>
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published by the
# Free Software Foundation, version 3.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License along
# with this program. If not, see <https://www.gnu.org/licenses/>
<<"ASCIIDOC"
Pull files from Android device to prepare a debugging sysroot
Inspired by:
https://fw4spl-org.github.io/fw4spl-blog/2015/07/27/Native-debugging-on-Android-with-QtCreator.html
The goal is to have a local copy of the sysroot of the connected device.
For that we use the command `adb pull <remote_dir_or_file> <local_dir_or_file>`
We will get a copy of:
- `/system/lib/`
- `/vendor/lib/`
- `libc.so`
- `libcutils.so`
As well as the binaries `linker` and `app_process`
IMPORTANT:
from one device to another, the remote file `app_process` can be a binary file
or a symlink to a binary file - which is NOT ok for us.
That's so we will try to pull every known possible variants of `app_process`,
e.g. `app_process32` or `app_process_init`
ASCIIDOC
## Define default value for variable, take two arguments, $1 variable name,
## $2 default variable value, if the variable is not already define define it
## with default value.
function define_default_value()
{
VAR_NAME="${1}"
DEFAULT_VALUE="${2}"
[ -z "${!VAR_NAME}" ] && export ${VAR_NAME}="${DEFAULT_VALUE}"
}
define_default_value ANDROID_SERIAL "$(adb devices | head -n 2 | tail -n 1 | awk '{print $1}')"
define_default_value DEBUG_SYSROOT "${HOME}/Builds/debug_sysroot/${ANDROID_SERIAL}/"
rm -rf "${DEBUG_SYSROOT}"
for mDir in "/system/lib/" "/vendor/lib/"; do
mkdir -p "${DEBUG_SYSROOT}/${mDir}"
# adb pull doesn't behave like rsync dirA/ dirB/ so avoid nesting the
# directory by deleting last one before copying
rmdir "${DEBUG_SYSROOT}/${mDir}"
adb pull "${mDir}" "${DEBUG_SYSROOT}/${mDir}"
done
# Retrieve the specific binaries - some of these adb commands will fail, since
# some files may not exist, but that's ok.
mkdir -p "${DEBUG_SYSROOT}/system/bin/"
for mBin in "/system/bin/linker" "/system/bin/app_process" \
"/system/bin/app_process_init" "/system/bin/app_process32" \
"/system/bin/app_process64" ; do
adb pull "${mBin}" "${DEBUG_SYSROOT}/${mBin}"
done
# Verify which variants of the specific binaries could be pulled
echo
echo "Found the following specific binaries:"
echo
ls -1 "${DEBUG_SYSROOT}/system/bin/"*
ls -1 "${DEBUG_SYSROOT}/system/lib/libc.so"*
ls -1 "${DEBUG_SYSROOT}/system/lib/libcutils.so"*
echo
echo DEBUG_SYSROOT="${DEBUG_SYSROOT}"

View File

@ -1,116 +0,0 @@
#!/bin/bash
# Script to start gdbserver on Android device and attach to retroshare-service
#
# Copyright (C) 2020 Gioacchino Mazzurco <gio@eigenlab.org>
# Copyright (C) 2020 Asociación Civil Altermundi <info@altermundi.net>
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published by the
# Free Software Foundation, version 3.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License along
# with this program. If not, see <https://www.gnu.org/licenses/>
<<"ASCIIDOC"
Start gdbserver on Android device and attach it to the retroshare service
process
Inspired by:
https://fw4spl-org.github.io/fw4spl-blog/2015/07/27/Native-debugging-on-Android-with-QtCreator.html
ASCIIDOC
## Define default value for variable, take two arguments, $1 variable name,
## $2 default variable value, if the variable is not already define define it
## with default value.
function define_default_value()
{
VAR_NAME="${1}"
DEFAULT_VALUE="${2}"
[ -z "${!VAR_NAME}" ] && export ${VAR_NAME}="${DEFAULT_VALUE}" || true
}
define_default_value ANDROID_APK_PACKAGE "org.retroshare.service"
define_default_value ANDROID_PROCESS_NAME "org.retroshare.service:rs"
define_default_value ANDROID_INSTALL_PATH ""
define_default_value LIB_GDB_SERVER_PATH ""
define_default_value ANDROID_SERIAL "$(adb devices | head -n 2 | tail -n 1 | awk '{print $1}')"
define_default_value GDB_SERVER_PORT 5039
adb_ushell()
{
adb shell run-as ${ANDROID_APK_PACKAGE} $@
}
[ -z "${ANDROID_INSTALL_PATH}" ] &&
{
ANDROID_INSTALL_PATH="$(adb_ushell pm path "${ANDROID_APK_PACKAGE}")"
ANDROID_INSTALL_PATH="$(dirname ${ANDROID_INSTALL_PATH#"package:"})"
[ -z "${ANDROID_INSTALL_PATH}" ] &&
cat <<EOF
Cannot find install path for ${ANDROID_APK_PACKAGE} make sure it is installed,
or manually specify ANDROID_INSTALL_PATH
EOF
}
## If not passed as environement variable try to determine gdbserver path
## shipped withing APK
[ -z "${LIB_GDB_SERVER_PATH}" ] &&
{
for mUsualPath in \
"${ANDROID_INSTALL_PATH}/lib/libgdbserver.so" \
"${ANDROID_INSTALL_PATH}/lib/arm64/libgdbserver.so"
do
adb_ushell ls "${mUsualPath}" &&
export LIB_GDB_SERVER_PATH="${mUsualPath}" && break
done
}
[ -z "${LIB_GDB_SERVER_PATH}" ] &&
{
cat <<EOF
libgdbserver.so not found in any of the usual path attempting to look for it
with find, it will take a little more time. Take note of the discovered path and
define LIB_GDB_SERVER_PATH on your commandline at next run to avoid waiting
again.
EOF
tFile="$(mktemp)"
adb_ushell find ${ANDROID_INSTALL_PATH} -type f -name 'libgdbserver.so' | \
tee "${tFile}"
LIB_GDB_SERVER_PATH="$(head -n 1 "${tFile}")"
rm "${tFile}"
}
[ -z "${LIB_GDB_SERVER_PATH}" ] &&
{
echo "Cannot find libgdbserver.so, are you sure your package ships it?"
exit -1
}
mPid="$(adb_ushell ps | grep ${ANDROID_PROCESS_NAME} | awk '{print $2}')"
[ -z "${mPid}" ] &&
{
echo "Failed ${ANDROID_PROCESS_NAME} PID retrival are you sure it is running?"
exit -2
}
## Establish port forwarding so we can connect to gdbserver with gdb
adb forward tcp:${GDB_SERVER_PORT} tcp:${GDB_SERVER_PORT}
((adb_ushell ${LIB_GDB_SERVER_PATH} 127.0.0.1:${GDB_SERVER_PORT} --attach ${mPid})&)

View File

@ -0,0 +1,48 @@
ARG ANDROID_NDK_ARCH=arm
FROM registry.gitlab.com/retroshare/retroshare:android_${ANDROID_NDK_ARCH}_base
ENV APT_UNAT="--assume-yes --quiet"
RUN apt-get update $APT_UNAT && apt-get upgrade $APT_UNAT --show-upgraded
ARG REPO_URL=https://gitlab.com/RetroShare/RetroShare.git
ARG REPO_BRANCH=master
WORKDIR /RetroShare
RUN git remote add testing $REPO_URL && \
git fetch --tags testing $REPO_BRANCH && \
git reset --hard testing/$REPO_BRANCH && \
git --no-pager log --max-count 1
RUN rm -rf /jsonapi-generator-build ; mkdir /jsonapi-generator-build
WORKDIR /jsonapi-generator-build/
RUN qmake ../RetroShare/jsonapi-generator/src/ \
CONFIG+=no_retroshare_plugins \
CONFIG+=no_retroshare_service CONFIG+=no_retroshare_gui \
CONFIG+=rs_jsonapi CONFIG+=no_rs_sam3_libsam3 && \
make -j$(nproc)
RUN rm -rf /retroshare-service-android-build ; mkdir /retroshare-service-android-build
WORKDIR /retroshare-service-android-build
# ARG declared before FROM get wiped after it, so we need declaring it again
ARG ANDROID_NDK_ARCH=arm
ARG RS_SERVICE_QMAKE_EXTRA_OPTS
RUN $($PREPARE_TOOLCHAIN get_qt_dir | head -n 1)/bin/qmake ../RetroShare \
-spec android-clang \
CONFIG+=retroshare_service CONFIG+=rs_jsonapi \
RS_UPNP_LIB=miniupnpc \
JSONAPI_GENERATOR_EXE=/jsonapi-generator-build/jsonapi-generator \
NATIVE_LIBS_TOOLCHAIN_PATH=$NATIVE_LIBS_TOOLCHAIN_PATH \
CONFIG+=no_retroshare_gui CONFIG+=no_rs_service_webui_terminal_password \
CONFIG+=no_rs_service_terminal_login \
CONFIG+=no_rs_sam3 CONFIG+=no_rs_sam3_libsam3 \
$RS_SERVICE_QMAKE_EXTRA_OPTS
RUN make -j$(nproc)
RUN make install INSTALL_ROOT=/retroshare-service-android-build/android-build/
ARG ANDROID_PLATFORM_VER=16
RUN $($PREPARE_TOOLCHAIN get_qt_dir | head -n 1)/bin/androiddeployqt \
--input retroshare-service/src/android-libretroshare-service.so-deployment-settings.json \
--output android-build --android-platform android-$ANDROID_PLATFORM_VER \
--jdk $JAVA_HOME --gradle

View File

@ -2,42 +2,61 @@
## force cloning a new
## To prepare an image suitable as base for Gitlab CI use
# docker build -t "${CI_REGISTRY_IMAGE}:base" --build-arg KEEP_SOURCE=true --build-arg REPO_DEPTH="" -f base.Dockerfile .
## Now you need to tag it so you can later push it
# docker tag ${ID_OF_THE_CREATED_IMAGE} registry.gitlab.com/retroshare/${CI_REGISTRY_IMAGE}:base
# export CI_REGISTRY_IMAGE="registry.gitlab.com/retroshare/retroshare:base"
# docker build -t "${CI_REGISTRY_IMAGE}" -f base.Dockerfile .
## To push it to gitlab CI registry you need first to login and the to push
# docker login registry.gitlab.com
# docker push registry.gitlab.com/retroshare/${CI_REGISTRY_IMAGE}:base
# docker push "${CI_REGISTRY_IMAGE}"
## To run the container
# docker run -it -p 127.0.0.1:9092:9092 "${CI_REGISTRY_IMAGE}:base" retroshare-service --jsonApiPort 9092 --jsonApiBindAddress 0.0.0.0
# docker run -it -p 127.0.0.1:9092:9092 "${CI_REGISTRY_IMAGE}" retroshare-service --jsonApiPort 9092 --jsonApiBindAddress 0.0.0.0
FROM ubuntu
FROM ubuntu:22.04
ARG CACHEBUST=0
RUN \
apt-get update -y && apt-get upgrade -y && \
apt-get install -y build-essential libssl-dev libbz2-dev libsqlite3-dev \
libsqlcipher-dev libupnp-dev pkg-config libz-dev \
qt5-default libxapian-dev qttools5-dev doxygen rapidjson-dev \
git cmake curl
ENV DEBIAN_FRONTEND=noninteractive
ENV APT_UNAT="--assume-yes --quiet"
RUN apt-get update $APT_UNAT && \
apt-get upgrade --show-upgraded $APT_UNAT && \
apt-get clean $APT_UNAT && \
apt-get install --no-install-recommends $APT_UNAT \
bash build-essential cimg-dev libssl-dev libbz2-dev \
libminiupnpc-dev \
libsqlite3-dev libsqlcipher-dev \
pkg-config libz-dev \
libxapian-dev doxygen rapidjson-dev \
git cmake curl python3
## Avoid git cloning spuriously failing with
# server certificate verification failed. CAfile: none CRLfile: none
RUN apt-get install --no-install-recommends $APT_UNAT --reinstall \
ca-certificates
RUN git clone --depth 1 https://github.com/aetilius/pHash.git && \
rm -rf pHash-build && mkdir pHash-build && cd pHash-build && \
cmake -B. -H../pHash -DCMAKE_INSTALL_PREFIX=/usr && \
make -j$(nproc) && make install && cd .. && \
rm -rf pHash-build pHash
ARG FRESHCLONE=0
ARG REPO_URL=https://gitlab.com/RetroShare/RetroShare.git
ARG REPO_URL=https://github.com/RetroShare/RetroShare.git
ARG REPO_BRANCH=master
ARG REPO_DEPTH="--depth 2000"
ARG KEEP_SOURCE=false
RUN apt-get update -y && apt-get upgrade -y
RUN git clone $REPO_DEPTH $REPO_URL -b $REPO_BRANCH && cd RetroShare && \
git fetch --tags && cd ..
RUN git clone $REPO_DEPTH $REPO_URL -b $REPO_BRANCH && \
cd RetroShare && \
git fetch --tags && \
git submodule update --init \
libbitdht/ libretroshare/ openpgpsdk/ retroshare-webui/ \
supportlibs/restbed/ && \
cd supportlibs/restbed/ && \
git submodule update --init \
dependency/asio/ dependency/kashmir/ && \
cd ../../../
RUN \
mkdir RetroShare-build && cd RetroShare-build && \
qmake ../RetroShare \
CONFIG+=no_retroshare_plugins CONFIG+=ipv6 \
CONFIG+=retroshare_service CONFIG+=no_retroshare_gui \
CONFIG+=rs_jsonapi CONFIG+=rs_deep_search && \
(make -j$(nproc) || make -j$(nproc) || make) && make install && \
cd .. && rm -rf RetroShare-build && ($KEEP_SOURCE || rm -rf RetroShare)
cmake -B. -S../RetroShare/retroshare-service \
-DRS_FORUM_DEEP_INDEX=ON -DRS_JSON_API=ON -DRS_WEBUI=ON && \
make -j$(nproc) && make install && \
cd .. && rm -rf RetroShare-build

View File

@ -0,0 +1,9 @@
#!/bin/sh
[ -n "$CI_MERGE_REQUEST_ID" ] &&
echo \
--build-arg REPO_URL="$CI_MERGE_REQUEST_SOURCE_PROJECT_URL" \
--build-arg REPO_BRANCH="$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME" ||
echo \
--build-arg REPO_URL="$CI_REPOSITORY_URL" \
--build-arg REPO_BRANCH="$CI_COMMIT_BRANCH"

View File

@ -2,17 +2,19 @@ FROM registry.gitlab.com/retroshare/retroshare:base
RUN apt-get update -y && apt-get upgrade -y
ARG REPO_URL=https://gitlab.com/RetroShare/RetroShare.git
ARG REPO_URL=https://github.com/RetroShare/RetroShare.git
ARG REPO_BRANCH=master
RUN \
cd RetroShare && git remote add testing $REPO_URL && \
git fetch --tags testing $REPO_BRANCH && \
git reset --hard testing/$REPO_BRANCH && \
git submodule update --init \
libbitdht/ libretroshare/ openpgpsdk/ retroshare-webui/ && \
git --no-pager log --max-count 1
RUN \
mkdir RetroShare-build && cd RetroShare-build && \
qmake ../RetroShare CONFIG+=no_retroshare_gui \
CONFIG+=retroshare_service \
CONFIG+=rs_jsonapi CONFIG+=rs_deep_search && \
(make -j$(nproc) || make -j$(nproc) || make) && make install && \
cmake -B. -S../RetroShare/retroshare-service \
-DRS_FORUM_DEEP_INDEX=ON -DRS_JSON_API=ON -DRS_WEBUI=ON \
-DRS_WARN_DEPRECATED=OFF -DRS_WARN_LESS=ON && \
make -j$(nproc) && make install && \
cd .. && rm -rf RetroShare-build

@ -1 +1 @@
Subproject commit b0d7ae39fe9d9192848bbf7b8902d2188da895c9
Subproject commit 0a3997cc1355b2c848161dca015b7e2df039707b

View File

@ -1,60 +0,0 @@
Hi there,
I heard about RetroShare recently (on Slashdot) and really like the goal of the program; it's something I've been wanting for a long time now. I'm a software developer so I figured I could help contribute to the project. I started by getting a build up and running on my mac, which was non-trivial as it looks like the Mac build hasn't been maintained (or maybe it's just targetting older OS X version?). Anyway, I have instructions and patches to get a build going on OS X 10.6, if you want to put them up on the wiki or something. The steps I used boiled down to running the following commands in a directory that also contains the retroshare-mac-build.patch file, which I posted at https://staktrace.com/pub/retroshare-mac-build.patch (you can also see the changes at https://github.com/staktrace/retroshare/commit/51f554f909086f4baca7be215d5edacab744dea4)
sudo port selfupdate
sudo port install qt4-mac
sudo port install wget
wget ftp://ftp.gnupg.org/gcrypt/libgpg-error/libgpg-error-1.10.tar.bz2
tar xjf libgpg-error-1.10.tar.bz2
rm libgpg-error-1.10.tar.bz2
pushd libgpg-error-1.10
./configure --prefix=$PWD/build --enable-static=yes --enable-shared=no
make
make install
popd
wget ftp://ftp.gnupg.org/gcrypt/gpgme/gpgme-1.3.1.tar.bz2
tar xjf gpgme-1.3.1.tar.bz2
rm gpgme-1.3.1.tar.bz2
pushd gpgme-1.3.1
./configure --prefix=$PWD/build --enable-static=yes --enable-shared=no --with-gpg-error-prefix=$PWD/../libgpg-error-1.10/build
make
make install
popd
wget http://miniupnp.free.fr/files/download.php?file=miniupnpc-1.3.tar.gz
tar xzf miniupnpc-1.3.tar.gz
rm miniupnpc-1.3.tar.gz
pushd miniupnpc-1.3
make upnpc-static
popd
git clone https://github.com/kigeia/retroshare
pushd retroshare
git apply ../retroshare-mac-build.patch
popd
pushd retroshare/libbitdht/src
qmake
make
popd
pushd retroshare/libretroshare/src
qmake
make
popd
pushd retroshare/retroshare-gui/src
qmake
make
popd
At the end there is a RetroShare.App in the retroshare/retroshare-gui/ folder which seems to work as expected.
Now that I've gotten it building and working, I'd like to start working on adding features. One that I would like to see is taking advantage of the RetroShare platform to enable F2F games. A while back I wrote a P2P collaborative crossword solver app in Java; porting that to work as a RetroShare plugin would probably be a good start for me. I looked briefly at the existing plugins in the source tree but haven't yet had time to peruse the rsplugin.h API in detail; if you have any tips or pointers before I dive in, please do let me know. I'll probably start work on it in a couple of days and progress might be a little slow because I'm also fairly busy with other things right now.
Cheers,
kats

View File

@ -8,35 +8,44 @@ Use default options. And add Qt Script support.
Add to the PATH environment variable by editing your *~/.profile* file.
export PATH="/users/$USER/Qt/5.5/clang_64/bin:$PATH"
export PATH="/users/$USER/Qt/5.14.1/clang_64/bin:$PATH"
Depends on which version of Qt you use.
## ***Choose if you use MacPort or HomeBrew***
## Get RetroShare
### MacPort Installation
In Qt Creator Projects -> New -> Import Project -> Git Clone -> Choose
Add Repository and Continoue
Install MacPort and XCode following this guide: [MacPort and XCode](http://guide.macports.org/#installing.xcode)
Repository: https://github.com/RetroShare/RetroShare.git
Start XCode to get it updated and to able C compiler to create executables.
via Terminal:
#### Install libraries
cd <your development directory>
git clone https://github.com/RetroShare/RetroShare.git retroshare
$sudo port -v selfupdate
$sudo port install openssl
$sudo port install miniupnpc
$sudo port install libmicrohttpd
For VOIP Plugin:
via GitHub Desktop: [GitHub Desktop Download](https://central.github.com/deployments/desktop/desktop/latest/darwin)
$sudo port install speex-devel
$sudo port install opencv
In GitHub Desktop -> Clone Repository -> URL
Get Your OSX SDK if missing: [MacOSX-SDKs](https://github.com/phracker/MacOSX-SDKs)
Add Repository URL: https://github.com/RetroShare/RetroShare.git and Clone
### HOMEBREW Installation
## ***Get XCode & MacOSX SDK***
Install HomeBrew following this guide: [HomeBrew](http://brew.sh/)
Install XCode following this guide: [XCode](http://guide.macports.org/#installing.xcode)
To identify the correct version of Xcode to install, you need to know which OS you are running. Go to the [x] menu -> "About This Mac" and read the macOS version number.
If you are running the macOS Catalina >= 10.15, you can install Xcode directly from App Store using the instructions below.
You can find older versions of Xcode at [Apple Developer Downloads](https://developer.apple.com/downloads/). Find the appropriate .xip file for your macOS version
To install from App Store:
Select [x] menu - > "App Store…".
Search for Xcode. Download and install.
Once Xcode has installed, you must drag the XCode icon into your Applications folder. After you have done this, open Xcode from the Applications folder by double-clicking on the icon and then follow the remaining instructions below.
Install XCode command line developer tools:
@ -44,11 +53,41 @@ Install XCode command line developer tools:
Start XCode to get it updated and to able C compiler to create executables.
Get Your MacOSX SDK if missing: [MacOSX-SDKs](https://github.com/phracker/MacOSX-SDKs)
## ***Choose if you use MacPort or HomeBrew***
### MacPort Installation
Install MacPort following this guide: [MacPort](http://guide.macports.org/#installing.xcode)
#### Install libraries
$brew install openssl
$brew install miniupnpc
$brew install libmicrohttpd
$ sudo port -v selfupdate
$ sudo port install openssl
$ sudo port install miniupnpc
For VOIP Plugin:
$ sudo port install speex-devel
$ sudo port install opencv
$ sudo port install ffmpeg
### HOMEBREW Installation
Install HomeBrew following this guide: [HomeBrew](http://brew.sh/)
#### Install libraries
$ brew install openssl
$ brew install miniupnpc
$ brew install rapidjson
$ brew install sqlcipher
#### Install CMake
$ brew install cmake
If you have error in linking, run this:
@ -56,37 +95,130 @@ If you have error in linking, run this:
For VOIP Plugin:
$brew install speex
$brew install speexdsp
$brew install homebrew/science/opencv
$brew install ffmpeg
$ brew install speex
$ brew install speexdsp
$ brew install opencv
$ brew install ffmpeg
Get Your OSX SDK if missing: [MacOSX-SDKs](https://github.com/phracker/MacOSX-SDKs)
For FeedReader Plugin:
$ brew install libxslt
$ brew install libxml2
## Last Settings
In QtCreator Option Git select "Pull" with "Rebase"
In QtCreator Projects -> Manage Kits > Version Control > Git:
## Compil missing libraries
### SQLCipher
cd <your development directory>
git clone https://github.com/sqlcipher/sqlcipher.git
cd sqlcipher
./configure --disable-shared --disable-tcl --enable-static --enable-tempstore=yes CFLAGS="-DSQLITE_HAS_CODEC -I/opt/local/include" LDFLAGS="-lcrypto"
make
sudo make install
select "Pull with rebase"
NOTE, might be necessary to *chmod 000 /usr/local/ssl* temporarily during *./configure* if
homebrew uses newer, non-stock ssl dependencies found there. Configure might get confused.
In QtCreator Projects -> Build -> Build Settings -> Build Environment -> Add this path:
You can now compile RS into Qt Creator or with terminal
/usr/local/bin
cd <your development directory>
git clone https://github.com/RetroShare/RetroShare.git retroshare
cd retroshare
qmake; make
In QtCreator Projects -> Build -> Build Settings -> Build Steps -> Add Additional arguments:
"CONFIG+=rs_autologin" "CONFIG+=rs_use_native_dialogs"
## Set your Mac OS SDK version
Edit retroshare.pri and set your installed sdk version example for 11.1 -> rs_macos11.1 (line 135:)
macx:CONFIG *= rs_macos11.1
rs_macos10.8:CONFIG -= rs_macos11.1
rs_macos10.9:CONFIG -= rs_macos11.1
rs_macos10.10:CONFIG -= rs_macos11.1
rs_macos10.12:CONFIG -= rs_macos11.1
rs_macos10.13:CONFIG -= rs_macos11.1
rs_macos10.14:CONFIG -= rs_macos11.1
rs_macos10.15:CONFIG -= rs_macos11.1
## Link Include & Libraries
When required edit your retroshare.pri macx-* section, check if the Include and Lib path are correct (macx-* section)
INCLUDEPATH += "/usr/local/opt/openssl/include"
QMAKE_LIBDIR += "/usr/local/opt/openssl/lib"
QMAKE_LIBDIR += "/usr/local/opt/sqlcipher/lib"
QMAKE_LIBDIR += "/usr/local/opt/miniupnpc/lib"
alternative via Terminal
$ qmake
INCLUDEPATH+="/usr/local/opt/openssl/include" \
QMAKE_LIBDIR+="/usr/local/opt/openssl/lib" \
QMAKE_LIBDIR+="/usr/local/opt/sqlcipher/lib" \
QMAKE_LIBDIR+="/usr/local/opt/miniupnpc/lib" \
CONFIG+=rs_autologin \
CONFIG+=rs_use_native_dialogs \
CONFIG+=release \
..
For FeedReader Plugin:
INCLUDEPATH += "/usr/local/opt/libxml2/include/libxml2"
With plugins:
$ qmake \
INCLUDEPATH+="/usr/local/opt/openssl/include" QMAKE_LIBDIR+="/usr/local/opt/openssl/lib" \
QMAKE_LIBDIR+="/usr/local/opt/sqlcipher/lib" \
QMAKE_LIBDIR+="/usr/local/opt/miniupnpc/lib" \
INCLUDEPATH+="/usr/local/opt/opencv/include/opencv4" QMAKE_LIBDIR+="/usr/local/opt/opencv/lib" \
INCLUDEPATH+="/usr/local/opt/speex/include" QMAKE_LIBDIR+="/usr/local/opt/speex/lib/" \
INCLUDEPATH+="/usr/local/opt/speexdsp/include" QMAKE_LIBDIR+="/usr/local/opt/speexdsp/lib/" \
INCLUDEPATH+="/usr/local/opt/libxslt/include" QMAKE_LIBDIR+="/usr/local/opt/libxslt/lib" \
QMAKE_LIBDIR+="/usr/local/opt/ffmpeg/lib" \
LIBS+=-lopencv_videoio \
CONFIG+=retroshare_plugins \
CONFIG+=rs_autologin \
CONFIG+=rs_use_native_dialogs \
CONFIG+=release \
..
## Compile RetroShare
You can now compile RetroShare into Qt Creator or with Terminal
$ cd /path/to/retroshare
$ qmake ..
$ make
You can change Target and SDK in *./retroshare.pri:82* changing value of QMAKE_MACOSX_DEPLOYMENT_TARGET and QMAKE_MAC_SDK
You can find compiled application on *./retroshare/retroshare-gui/src/retroshare.app*
You can find the compiled application at *./retroshare/retroshare-gui/src/retroshare.app*
## Issues
If you have issues with openssl (Undefined symbols for architecture x86_64) try to add to *~/.profile* file this or via Terminal
export PATH="/usr/local/opt/openssl/bin:$PATH"
export LDFLAGS="-L/usr/local/opt/openssl/lib"
export CPPFLAGS="-I/usr/local/opt/openssl/include"
export PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig"
For Qt Creator -> QtCreator Projects -> Build -> Build Settings -> Build Steps -> Add Additional arguments:
LDFLAGS="-L/usr/local/opt/openssl/lib"
CPPFLAGS="-I/usr/local/opt/openssl/include"
## Copy Plugins
$ cp \
./plugins/FeedReader/lib/libFeedReader.dylib \
./plugins/VOIP/lib/libVOIP.dylib \
./plugins/RetroChess/lib/libRetroChess.dylib \
./retroshare-gui/src/RetroShare.app/Contents/Resources/
### Compile Retroshare-Service & Webui with CMake
before you can compile overwrite the file "asio/include/asio/detail/config.hpp" here is a fix for macos [
asio fix](https://github.com/chriskohlhoff/asio/commit/68df16d560c68944809bb2947360fe8035e9ae0a)
$ cd retroshare-service
$ mkdir build-dir
$ cd build-dir
$ cmake -DRS_WEBUI=ON -DCMAKE_BUILD_TYPE=Release ..
$ make

View File

@ -1,66 +0,0 @@
Mac OSX Build Instructions.
-------------------------------------------
There are several complications with building Retroshare under OSX.
1) Support Libraries must be built and installed seperately.
2) Universal and OSX 10.5 support is a little tricky, mainly due to the support libraries.
Additional Libraries
---------------------
* GnuPG Package, that comes with Retroshare OSX install image. (GnuPG-1.4.9.dmg)
GPG Development libraries
* libassuan (I'm using 2.0.1)
* libgpg-error (I'm using 1.9)
* libgpgme (I'm using 1.3.0)
These libraries use standard UNIX installation systems: AUTOCONF/AUTOMAKE (configure, make, etc)
Unfortunately, this makes it difficult and a little manual to compile Universal and 10.5 libraries.
UPNPC (for OSX and windows)
* miniupnpc (I'm using 1.0)
You will also need to install
* XCode (available on the Apple Install CDs)
* Qt4 (from trolltech.com)
First Compilation...
--------------------
The First challenge is to build Retroshare on your Mac. For this first compilation,
we only build for your specific machine, and not attempt a Generic / 10.5 / Univeral build.
1) Install / Compile all the packages listed above.
be sure to use a configure command like this where applicable to only create a static library.
./configure --enable-static=yes --enable-shared=no CFLAGS="-arch i386" CPPFLAGS="-arch i386"
2) Check out the Retroshare SVN.
3) compile libbitdht:
cd libbitdht/src
qmake
This recreates a xcodeproj file for compilation using XCode.
Open with Xcode, and build.
4) compile libretroshare: same way.
5) compile retroshare-gui: same way.
Creating Retroshare OSX Distribution Packages.
-----------------------------------------------
TODO, once I've got feedback on First Compilation!

View File

@ -0,0 +1,51 @@
#!/bin/sh
APP="RetroShare"
RSVERSION="0.6.7a"
QTVERSION="Qt-5.15.11"
# Install the 7z to create dmg archives.
#brew list p7zip || brew install p7zip
# Package your app
echo "Packaging retroshare..."
#cd ${project_dir}/build/macOS/clang/x86_64/release/
cd retroshare-gui/src/
# Remove build directories that you don't want to deploy
rm -rf moc
rm -rf obj
rm -rf qrc
# This sets the CFBundleVersion & CFBundleShortVersionString string
/usr/libexec/PlistBuddy -c "Delete :CFBundleGetInfoString" retroshare.app/Contents/Info.plist
/usr/libexec/PlistBuddy -c "Add :CFBundleVersion string $RSVERSION" retroshare.app/Contents/Info.plist
/usr/libexec/PlistBuddy -c "Add :CFBundleShortVersionString string $RSVERSION" retroshare.app/Contents/Info.plist
/usr/libexec/PlistBuddy -c "Delete :NSRequiresAquaSystemAppearance" retroshare.app/Contents/Info.plist
# This automatically creates retroshare.dmg
echo "Creating dmg archive..."
macdeployqt retroshare.app -dmg
DATE=`date +"%m-%d-%Y"`
MACVERSION=`sw_vers -productVersion`
#RSVERSION=`git describe --abbrev=0 --tags`
GITHEAD=`git rev-parse --short HEAD`
mv $APP.dmg "$APP-$RSVERSION-$GITHEAD-$DATE-MacOS-$MACVERSION-$QTVERSION.dmg"
# You can use the appdmg command line app to create your dmg file if
# you want to use a custom background and icon arrangement. I'm still
# working on this for my apps, myself. If you want to do this, you'll
# remove the -dmg option above.
# appdmg json-path YourApp_${TRAVIS_TAG}.dmg
# Copy other project files
cp "../../libbitdht/src/bitdht/bdboot.txt" "retroshare.app/Contents/Resources/"
cp "../../plugins/FeedReader/lib/libFeedReader.dylib" "retroshare.app/Contents/Resources/"
cp -R "sounds" "retroshare.app/Contents/Resources/sounds"
# cp "${project_dir}/README.md" "README.md"
# cp "${project_dir}/LICENSE" "LICENSE"
# cp "${project_dir}/Qt License" "Qt License"

View File

@ -1,94 +0,0 @@
commit 51f554f909086f4baca7be215d5edacab744dea4
Author: Kartikaya Gupta <kats@calvin.staktrace.com>
Date: Wed Mar 7 23:30:48 2012 -0500
Modifications needed to get build working on Mac OS X 10.6
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..3e90033
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,6 @@
+*.o
+Makefile
+libbitdht/src/lib/
+libretroshare/src/lib/
+retroshare-gui/src/RetroShare.app/
+retroshare-gui/src/temp/
diff --git a/libretroshare/src/libretroshare.pro b/libretroshare/src/libretroshare.pro
index 6f35e01..267cc91 100644
--- a/libretroshare/src/libretroshare.pro
+++ b/libretroshare/src/libretroshare.pro
@@ -312,7 +312,7 @@ mac {
OBJECTS_DIR = temp/obj
MOC_DIR = temp/moc
#DEFINES = WINDOWS_SYS WIN32 STATICLIB MINGW
- #DEFINES *= MINIUPNPC_VERSION=13
+ DEFINES *= MINIUPNPC_VERSION=13
DESTDIR = lib
#miniupnp implementation files
@@ -326,12 +326,11 @@ mac {
# Beautiful Hack to fix 64bit file access.
QMAKE_CXXFLAGS *= -Dfseeko64=fseeko -Dftello64=ftello -Dfopen64=fopen -Dvstatfs64=vstatfs
- UPNPC_DIR = ../../../miniupnpc-1.0
- GPG_ERROR_DIR = ../../../../libgpg-error-1.7
- GPGME_DIR = ../../../../gpgme-1.1.8
+ UPNPC_DIR = ../../../miniupnpc-1.3
+ GPG_ERROR_DIR = ../../../libgpg-error-1.10
+ GPGME_DIR = ../../../gpgme-1.3.1
- INCLUDEPATH += . $${UPNPC_DIR}
- #INCLUDEPATH += . $${UPNPC_DIR} $${GPGME_DIR}/src $${GPG_ERROR_DIR}/src
+ INCLUDEPATH += . $${UPNPC_DIR} $${GPGME_DIR}/src $${GPG_ERROR_DIR}/src
}
################################# FreeBSD ##########################################
diff --git a/libretroshare/src/pqi/sslfns.cc b/libretroshare/src/pqi/sslfns.cc
index 2588cb8..305433f 100644
--- a/libretroshare/src/pqi/sslfns.cc
+++ b/libretroshare/src/pqi/sslfns.cc
@@ -586,8 +586,8 @@ X509 *loadX509FromDER(const uint8_t *ptr, uint32_t len)
X509 *tmp = NULL;
#ifdef __APPLE__
// This depends on which version you are compiling for... OSX10.5 doesn't have consts (old OpenSSL!)
- unsigned char **certptr = (unsigned char **) &ptr;
- //const unsigned char **certptr = (const unsigned char **) &ptr;
+ //unsigned char **certptr = (unsigned char **) &ptr;
+ const unsigned char **certptr = (const unsigned char **) &ptr;
#else
const unsigned char **certptr = (const unsigned char **) &ptr;
#endif
diff --git a/retroshare-gui/src/RetroShare.pro b/retroshare-gui/src/RetroShare.pro
index adcb5a0..ffbf669 100644
--- a/retroshare-gui/src/RetroShare.pro
+++ b/retroshare-gui/src/RetroShare.pro
@@ -140,19 +140,21 @@ win32 {
macx {
# ENABLE THIS OPTION FOR Univeral Binary BUILD.
- CONFIG += ppc x86
- QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.4
+ # CONFIG += ppc x86
+ QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.6
CONFIG += version_detail_bash_script
LIBS += ../../libretroshare/src/lib/libretroshare.a
- LIBS += -lssl -lcrypto -lz -lgpgme -lgpg-error -lassuan
- LIBS += ../../../miniupnpc-1.0/libminiupnpc.a
+ LIBS += ../../../libgpg-error-1.10/build/lib/libgpg-error.a
+ LIBS += ../../../gpgme-1.3.1/build/lib/libgpgme.a
+ LIBS += ../../../miniupnpc-1.3/libminiupnpc.a
+ LIBS += -lssl -lcrypto -lz -lassuan
LIBS += -framework CoreFoundation
LIBS += -framework Security
# LIBS += -framework CoreServices
- INCLUDEPATH += .
+ INCLUDEPATH += . ../../../gpgme-1.3.1/src
#DEFINES* = MAC_IDLE # for idle feature
CONFIG -= uitools

View File

@ -18,6 +18,8 @@ if errorlevel 1 goto error_env
if not "%ParamNoupdate%"=="1" (
:: Install needed things
%EnvMSYS2Cmd% "pacman --noconfirm --needed -S make git mingw-w64-%RsMSYS2Architecture%-toolchain mingw-w64-%RsMSYS2Architecture%-qt5 mingw-w64-%RsMSYS2Architecture%-miniupnpc mingw-w64-%RsMSYS2Architecture%-sqlcipher mingw-w64-%RsMSYS2Architecture%-cmake mingw-w64-%RsMSYS2Architecture%-rapidjson"
:: rnp
%EnvMSYS2Cmd% "pacman --noconfirm --needed -S mingw-w64-%RsMSYS2Architecture%-json-c mingw-w64-%RsMSYS2Architecture%-libbotan"
:: Webui
if "%ParamWebui%"=="1" %EnvMSYS2Cmd% "pacman --noconfirm --needed -S mingw-w64-%RsMSYS2Architecture%-doxygen"
@ -32,6 +34,16 @@ if not "%ParamNoupdate%"=="1" (
if "%ParamIndexing%"=="1" %EnvMSYS2Cmd% "pacman --noconfirm --needed -S mingw-w64-%RsMSYS2Architecture%-xapian-core mingw-w64-%RsMSYS2Architecture%-libvorbis mingw-w64-%RsMSYS2Architecture%-flac mingw-w64-%RsMSYS2Architecture%-taglib"
)
:: Fix webui compilation (TODO: remove when whole RS switched to cmake)
if "%ParamWebui%"=="1" (
pushd "%SourcePath%"
copy "%SourcePath%\libretroshare\src\jsonapi\jsonapi-generator-doxygen.conf" "%SourcePath%\jsonapi-generator\src\jsonapi-generator-doxygen.conf" %Quite%
copy "%SourcePath%\libretroshare\src\jsonapi\async-method-wrapper-template.cpp.tmpl" "%SourcePath%\jsonapi-generator\src\async-method-wrapper-template.cpp.tmpl" %Quite%
copy "%SourcePath%\libretroshare\src\jsonapi\method-wrapper-template.cpp.tmpl" "%SourcePath%\jsonapi-generator\src\method-wrapper-template.cpp.tmpl" %Quite%
git update-index --assume-unchanged "jsonapi-generator\src\jsonapi-generator-doxygen.conf" "jsonapi-generator\src\async-method-wrapper-template.cpp.tmpl" "jsonapi-generator\src\method-wrapper-template.cpp.tmpl"
popd
)
:: Initialize environment
call "%~dp0env.bat" %*
if errorlevel 2 exit /B 2
@ -66,6 +78,7 @@ echo %RS_QMAKE_CONFIG% > buildinfo.txt
echo %RsBuildConfig% >> buildinfo.txt
echo %RsArchitecture% >> buildinfo.txt
echo Qt %QtVersion% >> buildinfo.txt
echo %RsToolchain% >> buildinfo.txt
echo %RsCompiler% >> buildinfo.txt
call "%ToolsPath%\msys2-path.bat" "%SourcePath%" MSYS2SourcePath
@ -86,11 +99,6 @@ title Build - %SourceName%-%RsBuildConfig% [make]
%EnvMSYS2Cmd% "make -j %CoreCount%"
if errorlevel 1 goto error
:: Webui
if "%ParamWebui%"=="1" (
call "%~dp0..\tools\webui.bat"
)
:error
popd

View File

@ -1,6 +1,4 @@
:: Process commandline parameter
set Param32=0
set Param64=0
set ParamRelease=0
set ParamDebug=0
set ParamAutologin=0
@ -9,17 +7,40 @@ set ParamTor=0
set ParamWebui=0
set ParamClang=0
set ParamIndexing=0
set ParamFriendserver=0
set ParamNoupdate=0
set CoreCount=%NUMBER_OF_PROCESSORS%
set RS_QMAKE_CONFIG=
set RsToolchain=
set tcc=0
:parameter_loop
if "%~1" NEQ "" (
for /f "tokens=1,2 delims==" %%a in ("%~1") do (
if "%%~a"=="32" (
set Param32=1
set RsToolchain=mingw32
set /A tcc=tcc+1
) else if "%%~a"=="64" (
set Param64=1
set RsToolchain=mingw64
set /A tcc=tcc+1
) else if "%%~a"=="mingw32" (
set RsToolchain=mingw32
set /A tcc=tcc+1
) else if "%%~a"=="mingw64" (
set RsToolchain=mingw64
set /A tcc=tcc+1
) else if "%%~a"=="ucrt64" (
set RsToolchain=ucrt64
set /A tcc=tcc+1
) else if "%%~a"=="clang64" (
set RsToolchain=clang64
set /A tcc=tcc+1
) else if "%%~a"=="clang32" (
set RsToolchain=clang32
set /A tcc=tcc+1
) else if "%%~a"=="clangarm64" (
set RsToolchain=clangarm64
set /A tcc=tcc+1
) else if "%%~a"=="release" (
set ParamRelease=1
) else if "%%~a"=="debug" (
@ -38,6 +59,8 @@ if "%~1" NEQ "" (
set ParamClang=1
) else if "%%~a"=="indexing" (
set ParamIndexing=1
) else if "%%~a"=="friendserver" (
set ParamFriendserver=1
) else if "%%~a"=="noupdate" (
set ParamNoupdate=1
) else if "%%~a"=="CONFIG+" (
@ -52,22 +75,37 @@ if "%~1" NEQ "" (
goto parameter_loop
)
if "%Param32%"=="1" (
if "%Param64%"=="1" (
echo.
echo 32-bit or 64-bit?
goto :usage
)
set RsBit=32
set RsArchitecture=x86
set RsMSYS2Architecture=i686
if %tcc% NEQ 1 (
echo Multiple or no toolchain specified
goto :usage
)
if "%Param64%"=="1" (
set RsBit=64
if "%RsToolchain%"=="mingw32" (
set RsArchitecture=x86
set RsMSYS2Architecture=i686
set MSYSTEM=MINGW32
) else if "%RsToolchain%"=="mingw64" (
set RsArchitecture=x64
set RsMSYS2Architecture=x86_64
set MSYSTEM=MINGW64
) else if "%RsToolchain%"=="ucrt64" (
set RsArchitecture=x64
set RsMSYS2Architecture=ucrt-x86_64
set MSYSTEM=UCRT64
) else if "%RsToolchain%"=="clang64" (
set RsArchitecture=x64
set RsMSYS2Architecture=clang-x86_64
set MSYSTEM=CLANG64
set ParamClang=1
) else if "%RsToolchain%"=="clang32" (
set RsArchitecture=x86
set RsMSYS2Architecture=clang-i686
set MSYSTEM=CLANG32
set ParamClang=1
) else if "%RsToolchain%"=="clangarm64" (
set RsArchitecture=arm64
set RsMSYS2Architecture=clang-aarch64
set MSYSTEM=CLANGARM64
)
if "%ParamClang%"=="1" (
@ -76,8 +114,6 @@ if "%ParamClang%"=="1" (
set RsCompiler=GCC
)
if "%RsBit%"=="" goto :usage
if "%ParamRelease%"=="1" (
if "%ParamDebug%"=="1" (
echo.
@ -104,14 +140,21 @@ if "%ParamIndexing%"=="1" (
set RS_QMAKE_CONFIG=%RS_QMAKE_CONFIG% "CONFIG+=rs_deep_channels_index" "CONFIG+=rs_deep_files_index" "CONFIG+=rs_deep_files_index_ogg" "CONFIG+=rs_deep_files_index_flac" "CONFIG+=rs_deep_files_index_taglib"
)
if "%ParamFriendserver%"=="1" (
set RS_QMAKE_CONFIG=%RS_QMAKE_CONFIG% "CONFIG+=rs_efs"
)
exit /B 0
:usage
echo.
echo Usage: 32^|64 release^|debug [autologin plugins webui singlethread clang indexing noupdate] ["CONFIG+=..."]
echo Usage: 32^|64^|other release^|debug [autologin plugins webui singlethread clang indexing friendserver noupdate] ["CONFIG+=..."]
echo.
echo Mandatory parameter
echo 32^|64 32-bit or 64-bit Version
echo 32^|64 32-bit or 64-bit version (same as mingw32 or mingw64)
echo Or you can specify any other toolchain supported by msys2:
echo mingw32^|mingw64^|clang32^|clang64^|ucrt64^|clangarm64
echo More info: https://www.msys2.org/docs/environments
echo release^|debug Build release or debug version
echo.
echo Optional parameter (need clean when changed)
@ -121,6 +164,7 @@ echo webui Enable JsonAPI and pack webui files
echo singlethread Use only 1 thread for building
echo clang Use clang compiler instead of GCC
echo indexing Build with deep channel and file indexing support
echo friendserver Enable friendserver support
echo noupdate Skip updating the libraries
echo "CONFIG+=..." Enable some extra features, you can find the almost complete list in retroshare.pri
echo.

View File

@ -2,8 +2,6 @@ call "%~dp0env-base.bat" %*
if errorlevel 2 exit /B 2
if errorlevel 1 goto error_env
set MSYSTEM=MINGW%RsBit%
set BuildPath=%EnvRootPath%\builds
set DeployPath=%EnvRootPath%\deploy
@ -14,13 +12,13 @@ if not exist "%DeployPath%" mkdir "%DeployPath%"
call "%ToolsPath%\get-qt-version.bat" QtVersion
if "%QtVersion%"=="" %cecho% error "Cannot get Qt version." & exit /B 1
set RsMinGWPath=%EnvMSYS2BasePath%\mingw%RsBit%
set RsMinGWPath=%EnvMSYS2BasePath%\%RsToolchain%
set RsBuildPath=%BuildPath%\Qt-%QtVersion%-%RsArchitecture%-%RsCompiler%-%RsBuildConfig%
set RsDeployPath=%DeployPath%\Qt-%QtVersion%%RsType%-%RsArchitecture%-%RsCompiler%-%RsBuildConfig%
set RsBuildPath=%BuildPath%\Qt-%QtVersion%-%RsToolchain%-%RsCompiler%-%RsBuildConfig%
set RsDeployPath=%DeployPath%\Qt-%QtVersion%%RsType%-%RsToolchain%-%RsCompiler%-%RsBuildConfig%
set RsPackPath=%DeployPath%
set RsArchiveAdd=
set RsWebuiPath=%RootPath%\%SourceName%-webui
set RsWebuiBuildPath=%RsBuildPath%\retroshare-webui\webui
if not exist "%~dp0env-mod.bat" goto no_mod
call "%~dp0env-mod.bat"

View File

@ -105,6 +105,10 @@ copy "%RsBuildPath%\retroshare-nogui\src\%RsBuildConfig%\retroshare*-nogui.exe"
copy "%RsBuildPath%\retroshare-service\src\%RsBuildConfig%\retroshare*-service.exe" "%RsDeployPath%" %Quite%
copy "%RsBuildPath%\supportlibs\cmark\build\src\libcmark.dll" "%RsDeployPath%" %Quite%
if exist "%RsBuildPath%\libretroshare\src\lib\retroshare.dll" copy "%RsBuildPath%\libretroshare\src\lib\retroshare.dll" "%RsDeployPath%" %Quite%
if exist "%RsBuildPath%\supportlibs\librnp\Build\src\lib\librnp.dll" copy "%RsBuildPath%\supportlibs\librnp\Build\src\lib\librnp.dll" "%RsDeployPath%" %Quite%
if exist "%RsBuildPath%\retroshare-friendserver\src\%RsBuildConfig%\retroshare-friendserver.exe" (
copy "%RsBuildPath%\retroshare-friendserver\src\%RsBuildConfig%\retroshare-friendserver.exe" "%RsDeployPath%" %Quite%
)
echo copy extensions
for /D %%D in ("%RsBuildPath%\plugins\*") do (
@ -132,8 +136,14 @@ del /Q "%RsDeployPath%\imageformats\*d?.dll" %Quite%
if "%ParamTor%"=="1" (
echo copy tor
copy "%RsMinGWPath%\bin\tor.exe" "%RsDeployPath%" %Quite%
copy "%RsMinGWPath%\bin\tor-gencert.exe" "%RsDeployPath%" %Quite%
if not exist "%RsDeployPath%\tor" mkdir "%RsDeployPath%\tor"
copy "%RsMinGWPath%\bin\tor.exe" "%RsDeployPath%\tor" %Quite%
copy "%RsMinGWPath%\bin\tor-gencert.exe" "%RsDeployPath%\tor" %Quite%
echo copy tor dependencies
for /R "%RsDeployPath%\tor" %%D in (*.exe) do (
call :copy_dependencies "%%D" "%RsDeployPath%\tor"
)
)
echo copy dependencies
@ -141,8 +151,10 @@ for /R "%RsDeployPath%" %%D in (*.dll, *.exe) do (
call :copy_dependencies "%%D" "%RsDeployPath%"
)
echo copy qss
xcopy /S "%SourcePath%\retroshare-gui\src\qss" "%RsDeployPath%\qss" %Quite%
if exist "%SourcePath%\retroshare-gui\src\qss" (
echo copy qss
xcopy /S "%SourcePath%\retroshare-gui\src\qss" "%RsDeployPath%\qss" %Quite%
)
echo copy stylesheets
xcopy /S "%SourcePath%\retroshare-gui\src\gui\qss\chat" "%RsDeployPath%\stylesheets" %Quite%
@ -176,12 +188,12 @@ echo copy buildinfo.txt
copy "%RsBuildPath%\buildinfo.txt" "%RsDeployPath%" %Quite%
if "%ParamWebui%"=="1" (
if exist "%RsWebuiPath%\webui" (
if exist "%RsWebuiBuildPath%" (
echo copy webui
mkdir "%RsDeployPath%\webui"
xcopy /S "%RsWebuiPath%\webui" "%RsDeployPath%\webui" %Quite%
xcopy /S "%RsWebuiBuildPath%" "%RsDeployPath%\webui" %Quite%
) else (
%cecho% error "Webui is enabled, but no webui data found at %RsWebuiPath%\webui"
%cecho% error "Webui is enabled, but no webui data found at %RsWebuiBuildPath%"
goto error
)
)

View File

@ -16,7 +16,13 @@ if "%~1"=="clean" (
goto exit
)
if exist "%EnvMSYS2Path%\msys%MSYS2Base%\usr\bin\pacman.exe" (
set MSYS2Version=20241208
set MSYS2Install=msys2-base-x86_64-%MSYS2Version%.sfx.exe
set MSYS2Url=https://github.com/msys2/msys2-installer/releases/download/%MSYS2Version:~0,4%-%MSYS2Version:~4,2%-%MSYS2Version:~6,2%/%MSYS2Install%
set MSYS2UnpackPath=%EnvMSYS2Path%\msys64
if exist "%MSYS2UnpackPath%\usr\bin\pacman.exe" (
if "%~1"=="reinstall" (
choice /M "Found existing MSYS2 version. Do you want to proceed?"
if !ERRORLEVEL!==2 goto exit
@ -25,28 +31,26 @@ if exist "%EnvMSYS2Path%\msys%MSYS2Base%\usr\bin\pacman.exe" (
)
)
set MSYS2Install=msys2-base-%MSYS2Architecture%-20200720.tar.xz
set MSYS2Url=http://sourceforge.net/projects/msys2/files/Base/%MSYS2Architecture%/%MSYS2Install%/download
if exist "%MSYS2UnpackPath%" (
%cecho% info "Remove previous MSYS2 version"
call "%ToolsPath%\remove-dir.bat" "%MSYS2UnpackPath%"
)
%cecho% info "Remove previous MSYS2 version"
call "%ToolsPath%\remove-dir.bat" "%EnvMSYS2Path%"
%cecho% info "Download installation files"
%cecho% info "Download MSYS2 installation files"
if not exist "%EnvDownloadPath%\%MSYS2Install%" call "%ToolsPath%\download-file.bat" "%MSYS2Url%" "%EnvDownloadPath%\%MSYS2Install%"
if not exist "%EnvDownloadPath%\%MSYS2Install%" %cecho% error "Cannot download MSYS" & goto error
%cecho% info "Unpack MSYS2"
"%EnvSevenZipExe%" x -so "%EnvDownloadPath%\%MSYS2Install%" | "%EnvSevenZipExe%" x -y -si -ttar -o"%EnvMSYS2Path%"
"%EnvDownloadPath%\%MSYS2Install%" -y -o"%EnvMSYS2Path%"
set MSYS2SH=%EnvMSYS2Path%\msys%MSYS2Base%\usr\bin\sh
set MSYS2SH=%MSYS2UnpackPath%\usr\bin\sh
%cecho% info "Initialize MSYS2"
"%MSYS2SH%" -lc "pacman -Sy"
"%MSYS2SH%" -lc "pacman --noconfirm --needed -S bash pacman pacman-mirrors msys2-runtime"
"%MSYS2SH%" -lc "yes | pacman --noconfirm -Syuu msys2-keyring"
"%MSYS2SH%" -lc "pacman --noconfirm -Sy"
"%MSYS2SH%" -lc "pacman --noconfirm -Su"
call "%EnvMSYS2Path%\msys%MSYS2Base%\autorebase.bat"
call "%EnvRootPath%\update-msys2.bat"
call "%EnvRootPath%\update-msys2.bat"
call "%MSYS2UnpackPath%\autorebase.bat"
:exit
endlocal

View File

@ -34,7 +34,7 @@ if not exist "%EnvToolsPath%\cecho.exe" (
if not exist "%EnvDownloadPath%\%cCEhoInstall%" echo Cannot download cecho installation& goto error
echo Unpack cecho
"%EnvSevenZipExe%" x -o"%EnvTempPath%" "%EnvDownloadPath%\%CEchoInstall%"
"%EnvSevenZipExe%" x -o"%EnvTempPath%" "%EnvDownloadPath%\%CEchoInstall%" -y -bso0
copy "%EnvTempPath%\cecho.exe" "%EnvToolsPath%"
call "%ToolsPath%\remove-dir.bat" "%EnvTempPath%"

View File

@ -2,18 +2,13 @@
setlocal
if exist "%~dp0msys2\msys32" call :update 32
if exist "%~dp0msys2\msys64" call :update 64
if not exist "%~dp0msys2\msys64" goto :EOF
goto :EOF
set MSYS2SH=%~dp0msys2\msys64\usr\bin\sh
:update
set MSYSSH=%~dp0msys2\msys%~1\usr\bin\sh
echo Update MSYS2
"%MSYS2SH%" -lc "yes | pacman --noconfirm -Syuu msys2-keyring"
"%MSYS2SH%" -lc "pacman --noconfirm -Su"
echo Update MSYS2 %~1
"%MSYSSH%" -lc "pacman -Sy"
"%MSYSSH%" -lc "pacman --noconfirm -Su"
:exit
endlocal
goto :EOF

View File

@ -218,7 +218,7 @@ Section $(Section_Data) Section_Data
; Stylesheets
SetOutPath "$INSTDIR\qss"
File /r "${DEPLOYDIR}\qss\*.*"
File /nonfatal /r "${DEPLOYDIR}\qss\*.*"
SectionEnd
;Section $(Section_Link) Section_Link

View File

@ -1,22 +0,0 @@
setlocal
echo.
echo === webui
echo.
title Build webui
if not exist "%RsWebuiPath%" (
echo Checking out webui source into %RsWebuiPath%
if not "%ParamNoupdate%"=="1" (
%EnvMSYS2Cmd% "pacman --noconfirm --needed -S git"
)
git clone https://github.com/RetroShare/RSNewWebUI.git "%RsWebuiPath%"
) else (
echo Webui source found at %RsWebuiPath%
)
pushd "%RsWebuiPath%\webui-src\make-src"
%EnvMSYS2Cmd% "sh build.sh"
popd
endlocal

View File

@ -1,25 +1,30 @@
ZLIB_VERSION=1.2.3
BZIP2_VERSION=1.0.6
MINIUPNPC_VERSION=2.0
OPENSSL_VERSION=1.1.1h
ZLIB_VERSION=1.2.11
BZIP2_VERSION=1.0.8
MINIUPNPC_VERSION=2.2.3
OPENSSL_VERSION=1.1.1w
SPEEX_VERSION=1.2.0
SPEEXDSP_VERSION=1.2rc3
OPENCV_VERSION=4.5.0
LIBXML2_VERSION=2.9.7
LIBXSLT_VERSION=1.1.32
CURL_VERSION=7.58.0
SPEEXDSP_VERSION=1.2.0
LIBXML2_VERSION=2.9.12
LIBXSLT_VERSION=1.1.34
CURL_VERSION=7.81.0
TCL_VERSION=8.6.10
SQLCIPHER_VERSION=4.4.0
LIBMICROHTTPD_VERSION=0.9.59
FFMPEG_VERSION=3.4
SQLCIPHER_VERSION=4.5.0
LIBMICROHTTPD_VERSION=0.9.75
FFMPEG_VERSION=4.4
RAPIDJSON_VERSION=1.1.0
XAPIAN_VERSION=1.4.7
XAPIAN_VERSION=1.4.19
#RNP_VERSION=0.17.1
# libaries for rnp
JSON_C_VERSION=0.18
BOTAN_VERSION=2.19.5
DOWNLOAD_PATH?=download
BUILD_PATH=build
LIBS_PATH?=libs
all: dirs zlib bzip2 miniupnpc openssl speex speexdsp opencv libxml2 libxslt curl sqlcipher libmicrohttpd ffmpeg rapidjson xapian copylibs
all: dirs zlib bzip2 miniupnpc openssl speex speexdsp libxml2 libxslt curl sqlcipher libmicrohttpd ffmpeg rapidjson xapian jsonc botan copylibs
#rnp
download: \
$(DOWNLOAD_PATH)/zlib-$(ZLIB_VERSION).tar.gz \
@ -28,7 +33,6 @@ download: \
$(DOWNLOAD_PATH)/openssl-$(OPENSSL_VERSION).tar.gz \
$(DOWNLOAD_PATH)/speex-$(SPEEX_VERSION).tar.gz \
$(DOWNLOAD_PATH)/speexdsp-$(SPEEXDSP_VERSION).tar.gz \
$(DOWNLOAD_PATH)/opencv-$(OPENCV_VERSION).tar.gz \
$(DOWNLOAD_PATH)/libxml2-$(LIBXML2_VERSION).tar.gz \
$(DOWNLOAD_PATH)/libxslt-$(LIBXSLT_VERSION).tar.gz \
$(DOWNLOAD_PATH)/curl-$(CURL_VERSION).tar.gz \
@ -58,8 +62,7 @@ $(BUILD_PATH)/zlib-$(ZLIB_VERSION): $(DOWNLOAD_PATH)/zlib-$(ZLIB_VERSION).tar.gz
rm -r -f $(BUILD_PATH)/zlib-*
tar xvf $(DOWNLOAD_PATH)/zlib-$(ZLIB_VERSION).tar.gz
# build
cd zlib-$(ZLIB_VERSION) && ./configure
#cd zlib-$(ZLIB_VERSION) && make install prefix="`pwd`/../$(BUILD_PATH)"
cd zlib-$(ZLIB_VERSION) && make -f win32/Makefile.gcc libz.a
cd zlib-$(ZLIB_VERSION) && make
# copy files
mkdir -p $(BUILD_PATH)/zlib-$(ZLIB_VERSION).tmp/include
@ -74,7 +77,7 @@ $(BUILD_PATH)/zlib-$(ZLIB_VERSION): $(DOWNLOAD_PATH)/zlib-$(ZLIB_VERSION).tar.gz
bzip2: $(BUILD_PATH)/bzip2-$(BZIP2_VERSION)
$(DOWNLOAD_PATH)/bzip2-$(BZIP2_VERSION).tar.gz:
wget https://sourceforge.net/projects/bzip2/files/bzip2-$(BZIP2_VERSION).tar.gz/download -O $(DOWNLOAD_PATH)/bzip2-$(BZIP2_VERSION).tar.gz
wget https://www.sourceware.org/pub/bzip2/bzip2-$(BZIP2_VERSION).tar.gz -O $(DOWNLOAD_PATH)/bzip2-$(BZIP2_VERSION).tar.gz
$(BUILD_PATH)/bzip2-$(BZIP2_VERSION): $(DOWNLOAD_PATH)/bzip2-$(BZIP2_VERSION).tar.gz
# prepare
@ -102,10 +105,10 @@ $(BUILD_PATH)/miniupnpc-$(MINIUPNPC_VERSION): $(DOWNLOAD_PATH)/miniupnpc-$(MINIU
rm -r -f $(BUILD_PATH)/miniupnpc-*
tar xvf $(DOWNLOAD_PATH)/miniupnpc-$(MINIUPNPC_VERSION).tar.gz
# build
cd miniupnpc-$(MINIUPNPC_VERSION) && export CC=gcc && export PATH=.:$$PATH && make -f Makefile.mingw init libminiupnpc.a miniupnpc.dll
cd miniupnpc-$(MINIUPNPC_VERSION) && export CC=gcc && export PATH=.:$$PATH && make -f Makefile.mingw libminiupnpc.a miniupnpc.dll
# copy files
mkdir -p $(BUILD_PATH)/miniupnpc-$(MINIUPNPC_VERSION).tmp/include/miniupnpc
cp miniupnpc-$(MINIUPNPC_VERSION)/*.h $(BUILD_PATH)/miniupnpc-$(MINIUPNPC_VERSION).tmp/include/miniupnpc/
cp miniupnpc-$(MINIUPNPC_VERSION)/include/*.h $(BUILD_PATH)/miniupnpc-$(MINIUPNPC_VERSION).tmp/include/miniupnpc/
mkdir -p $(BUILD_PATH)/miniupnpc-$(MINIUPNPC_VERSION).tmp/lib
cp miniupnpc-$(MINIUPNPC_VERSION)/miniupnpc.lib $(BUILD_PATH)/miniupnpc-$(MINIUPNPC_VERSION).tmp/lib/
mkdir -p $(BUILD_PATH)/miniupnpc-$(MINIUPNPC_VERSION).tmp/bin
@ -187,31 +190,6 @@ $(BUILD_PATH)/speexdsp-$(SPEEXDSP_VERSION): $(DOWNLOAD_PATH)/speexdsp-$(SPEEXDSP
rm -r -f speexdsp-$(SPEEXDSP_VERSION)
mv $(BUILD_PATH)/speexdsp-$(SPEEXDSP_VERSION).tmp $(BUILD_PATH)/speexdsp-$(SPEEXDSP_VERSION)
opencv: $(BUILD_PATH)/opencv-$(OPENCV_VERSION)
$(DOWNLOAD_PATH)/opencv-$(OPENCV_VERSION).tar.gz:
wget --no-check-certificate https://github.com/opencv/opencv/archive/$(OPENCV_VERSION).tar.gz -O $(DOWNLOAD_PATH)/opencv-$(OPENCV_VERSION).tar.gz
$(BUILD_PATH)/opencv-$(OPENCV_VERSION): $(DOWNLOAD_PATH)/opencv-$(OPENCV_VERSION).tar.gz
# prepare
rm -r -f $(BUILD_PATH)/opencv-*
tar xvf $(DOWNLOAD_PATH)/opencv-$(OPENCV_VERSION).tar.gz
# Remove version numbers from libraries. Is there a switch?
sed -i -e's/\(ocv_update(OPENCV_DLLVERSION \).*$$/\1"")/' opencv-$(OPENCV_VERSION)/CMakeLists.txt
# build
mkdir -p opencv-$(OPENCV_VERSION)/build
#cd opencv-$(OPENCV_VERSION)/build && cmake .. -G"MSYS Makefiles" -DCMAKE_BUILD_TYPE=Release -DBUILD_PERF_TESTS=OFF -DBUILD_TESTS=OFF -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX="`pwd`/../../build"
cd opencv-$(OPENCV_VERSION)/build && cmake .. -G"MSYS Makefiles" -DCMAKE_BUILD_TYPE=Release -DBUILD_PERF_TESTS=OFF -DBUILD_TESTS=OFF -DBUILD_SHARED_LIBS=OFF -DENABLE_CXX11=ON -DCMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS} -DSTRSAFE_NO_DEPRECATE" -DCMAKE_INSTALL_PREFIX="`pwd`/install"
cd opencv-$(OPENCV_VERSION)/build && make install
# copy files
mkdir -p $(BUILD_PATH)/opencv-$(OPENCV_VERSION).tmp/include
cp -r opencv-$(OPENCV_VERSION)/build/install/include/* $(BUILD_PATH)/opencv-$(OPENCV_VERSION).tmp/include/
mkdir -p $(BUILD_PATH)/opencv-$(OPENCV_VERSION).tmp/lib/opencv
cp -r opencv-$(OPENCV_VERSION)/build/install/x64/mingw/staticlib/* $(BUILD_PATH)/opencv-$(OPENCV_VERSION).tmp/lib/opencv/
# cleanup
rm -r -f opencv-$(OPENCV_VERSION)
mv $(BUILD_PATH)/opencv-$(OPENCV_VERSION).tmp $(BUILD_PATH)/opencv-$(OPENCV_VERSION)
libxml2: $(BUILD_PATH)/libxml2-$(LIBXML2_VERSION)
$(DOWNLOAD_PATH)/libxml2-$(LIBXML2_VERSION).tar.gz:
@ -341,7 +319,7 @@ $(BUILD_PATH)/ffmpeg-$(FFMPEG_VERSION): $(DOWNLOAD_PATH)/ffmpeg-$(FFMPEG_VERSION
rm -r -f $(BUILD_PATH)/ffmpeg-*
tar xvf $(DOWNLOAD_PATH)/ffmpeg-$(FFMPEG_VERSION).tar.gz
# build
cd ffmpeg-$(FFMPEG_VERSION) && ./configure --disable-shared --enable-static --disable-programs --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-ffserver --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-yasm --disable-everything --enable-encoder=mpeg4 --enable-decoder=mpeg4 --prefix="`pwd`/../$(BUILD_PATH)/ffmpeg-$(FFMPEG_VERSION).tmp"
cd ffmpeg-$(FFMPEG_VERSION) && ./configure --disable-shared --enable-static --disable-programs --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-yasm --disable-everything --enable-encoder=mpeg4 --enable-decoder=mpeg4 --prefix="`pwd`/../$(BUILD_PATH)/ffmpeg-$(FFMPEG_VERSION).tmp"
cd ffmpeg-$(FFMPEG_VERSION) && make install
# cleanup
rm -r -f ffmpeg-$(FFMPEG_VERSION)
@ -391,6 +369,57 @@ $(BUILD_PATH)/xapian-core-$(XAPIAN_VERSION): $(DOWNLOAD_PATH)/xapian-core-$(XAPI
rm -r -f xapian-core-$(XAPIAN_VERSION)
mv $(BUILD_PATH)/xapian-core-$(XAPIAN_VERSION).tmp $(BUILD_PATH)/xapian-core-$(XAPIAN_VERSION)
jsonc: $(BUILD_PATH)/json-c-$(JSON_C_VERSION)
$(BUILD_PATH)/json-c-$(JSON_C_VERSION):
# prepare
rm -r -f $(BUILD_PATH)/json-c-*
[ -d "json-c-$(JSON_C_VERSION)" ] || git clone https://github.com/json-c/json-c.git --depth=1 --branch json-c-$(JSON_C_VERSION) "json-c-$(JSON_C_VERSION)"
# build
mkdir -p json-c-$(JSON_C_VERSION)/build
cd json-c-$(JSON_C_VERSION)/build && cmake .. -G"MSYS Makefiles" -Wno-dev -DCMAKE_BUILD_TYPE="release" -DBUILD_SHARED_LIBS=off -DBUILD_STATIC_LIBS=on -DBUILD_TESTING=off -DCMAKE_CXX_FLAGS="-D__MINGW_USE_VC2005_COMPAT" -DCMAKE_INSTALL_PREFIX="`pwd`/install" -DCMAKE_INSTALL_PREFIX="`pwd`/../../$(BUILD_PATH)/json-c-$(JSON_C_VERSION).tmp"
cd json-c-$(JSON_C_VERSION)/build && make install
# cleanup
rm -r -f json-c-$(JSON_C_VERSION)
mv $(BUILD_PATH)/json-c-$(JSON_C_VERSION).tmp $(BUILD_PATH)/json-c-$(JSON_C_VERSION)
botan: $(BUILD_PATH)/botan-$(BOTAN_VERSION)
$(BUILD_PATH)/botan-$(BOTAN_VERSION):
# prepare
pacman --needed --noconfirm -S python3
rm -r -f $(BUILD_PATH)/botan-*
[ -d "botan-$(BOTAN_VERSION)" ] || git clone https://github.com/randombit/botan.git --depth=1 --branch $(BOTAN_VERSION) "botan-$(BOTAN_VERSION)"
# build
if [ $(MSYSTEM) = "MINGW32" ] ; then cd botan-$(BOTAN_VERSION) && ./configure.py --os=mingw --cpu=x86_32 --disable-shared-library --enable-static-library --extra-cxxflags="-D__MINGW_USE_VC2005_COMPAT" --prefix="`pwd`/../$(BUILD_PATH)/botan-$(BOTAN_VERSION).tmp" ; fi
if [ $(MSYSTEM) = "MINGW64" ] ; then cd botan-$(BOTAN_VERSION) && ./configure.py --os=mingw --cpu=x86_64 --disable-shared-library --enable-static-library --prefix="`pwd`/../$(BUILD_PATH)/botan-$(BOTAN_VERSION).tmp" ; fi
cd botan-$(BOTAN_VERSION) && make install
# cleanup
rm -r -f botan-$(BOTAN_VERSION)
mv $(BUILD_PATH)/botan-$(BOTAN_VERSION).tmp $(BUILD_PATH)/botan-$(BOTAN_VERSION)
rnp: $(BUILD_PATH)/rnp-$(RNP_VERSION)
$(BUILD_PATH)/rnp-$(RNP_VERSION):
# prepare
rm -r -f $(BUILD_PATH)/rnp-*
[ -d "rnp-$(RNP_VERSION)" ] || git clone https://github.com/rnpgp/rnp.git --depth=1 --branch v$(RNP_VERSION) --recurse-submodules --shallow-submodules "rnp-$(RNP_VERSION)"
# build
mkdir -p rnp-$(RNP_VERSION)/build
cd rnp-$(RNP_VERSION)/build && cmake .. -G"MSYS Makefiles" -Wno-dev -DCMAKE_INSTALL_PREFIX="`pwd`/install" -DBUILD_SHARED_LIBS=yes -DBUILD_TESTING=off -DCMAKE_CXX_FLAGS="-D__MINGW_USE_VC2005_COMPAT -D__STDC_FORMAT_MACROS" -DBZIP2_INCLUDE_DIR="`pwd`/../../$(BUILD_PATH)/bzip2-$(BZIP2_VERSION)/include" -DBZIP2_LIBRARY_RELEASE="`pwd`/../../$(BUILD_PATH)/bzip2-$(BZIP2_VERSION)/lib/libbz2.a" -DBZIP2_LIBRARIES="`pwd`/../../$(BUILD_PATH)/bzip2-$(BZIP2_VERSION)/lib/libbz2.a" -DZLIB_INCLUDE_DIR="`pwd`/../../$(BUILD_PATH)/zlib-$(ZLIB_VERSION)/include" -DZLIB_LIBRARY="`pwd`/../../$(BUILD_PATH)/zlib-$(ZLIB_VERSION)/lib/libz.a" -DJSON-C_INCLUDE_DIR="`pwd`/../../$(BUILD_PATH)/json-c-$(JSON_C_VERSION)/include/json-c" -DJSON-C_LIBRARY="`pwd`/../../$(BUILD_PATH)/json-c-$(JSON_C_VERSION)/lib/libjson-c.a" -DBOTAN_INCLUDE_DIR="`pwd`/../../$(BUILD_PATH)/botan-$(BOTAN_VERSION)/include/botan-`echo $(BOTAN_VERSION) | cut -c1-1`" -DBOTAN_LIBRARY="`pwd`/../../$(BUILD_PATH)/botan-$(BOTAN_VERSION)/lib/libbotan-`echo $(BOTAN_VERSION) | cut -c1-1`.a"
cmake --build rnp-$(RNP_VERSION)/build
# copy files
mkdir -p $(BUILD_PATH)/rnp-$(RNP_VERSION).tmp/include/rnp
cp -r rnp-$(RNP_VERSION)/include/rnp/* $(BUILD_PATH)/rnp-$(RNP_VERSION).tmp/include/rnp/
cp -r rnp-$(RNP_VERSION)/build/src/lib/rnp/* $(BUILD_PATH)/rnp-$(RNP_VERSION).tmp/include/rnp/
mkdir -p $(BUILD_PATH)/rnp-$(RNP_VERSION).tmp/lib
cp -r rnp-$(RNP_VERSION)/build/src/lib/librnp.dll.a $(BUILD_PATH)/rnp-$(RNP_VERSION).tmp/lib/
mkdir -p $(BUILD_PATH)/rnp-$(RNP_VERSION).tmp/bin
cp -r rnp-$(RNP_VERSION)/build/src/lib/librnp.dll $(BUILD_PATH)/rnp-$(RNP_VERSION).tmp/bin/
# cleanup
rm -r -f rnp-$(RNP_VERSION)
mv $(BUILD_PATH)/rnp-$(RNP_VERSION).tmp $(BUILD_PATH)/rnp-$(RNP_VERSION)
copylibs:
rm -r -f $(LIBS_PATH) ; \
mkdir -p $(LIBS_PATH) ; \

View File

@ -13,11 +13,11 @@ call "%~dp0build-libs\build-libs.bat"
if errorlevel 1 %cecho% error "Failed to build libraries." & exit /B %ERRORLEVEL%
%cecho% info "Build %SourceName%"
call "%~dp0build\build.bat" release autologin jsonapi plugins nativedialogs
call "%~dp0build\build.bat" release autologin webui plugins nativedialogs service
if errorlevel 1 %cecho% error "Failed to build %SourceName%." & exit /B %ERRORLEVEL%
%cecho% info "Pack %SourceName%"
call "%~dp0build\pack.bat" release plugins
call "%~dp0build\pack.bat" release webui plugins service
if errorlevel 1 %cecho% error "Failed to pack %SourceName%." & exit /B %ERRORLEVEL%
%cecho% info "Build installer"

View File

@ -9,7 +9,7 @@ call "%EnvPath%\env.bat"
if errorlevel 1 goto error_env
:: Initialize environment
call "%~dp0env.bat" release
call "%~dp0env.bat" installer release
if errorlevel 2 exit /B 2
if errorlevel 1 goto error_env
@ -40,6 +40,7 @@ set NSIS_PARAM=%NSIS_PARAM% /DARCHITECTURE="%GCCArchitecture%"
set NSIS_PARAM=%NSIS_PARAM% /DDATE="%RsDate%"
if exist "%EnvTorPath%\Tor\tor.exe" set NSIS_PARAM=%NSIS_PARAM% /DTORDIR="%EnvTorPath%\Tor"
if exist "%RsWebuiBuildPath%" set NSIS_PARAM=%NSIS_PARAM% /DWEBUIDIR="%RsWebuiBuildPath%"
:: Get compiled version
call "%ToolsPath%\get-rs-version.bat" "%RsBuildPath%\retroshare-gui\src\%RsBuildConfig%\retroshare.exe" RsVersion

View File

@ -9,7 +9,7 @@ call "%EnvPath%\env.bat"
if errorlevel 1 goto error_env
:: Initialize environment
call "%~dp0env.bat" %*
call "%~dp0env.bat" build %*
if errorlevel 2 exit /B 2
if errorlevel 1 goto error_env
@ -49,11 +49,15 @@ echo.
title Build - %SourceName%-%RsBuildConfig% [qmake]
set RS_QMAKE_CONFIG=%RsBuildConfig% no_rs_cppwarning
set RS_QMAKE_CONFIG=%RsBuildConfig%
if "%ParamAutologin%"=="1" set RS_QMAKE_CONFIG=%RS_QMAKE_CONFIG% rs_autologin
if "%ParamJsonApi%"=="1" set RS_QMAKE_CONFIG=%RS_QMAKE_CONFIG% rs_jsonapi
if "%ParamWebui%"=="1" set RS_QMAKE_CONFIG=%RS_QMAKE_CONFIG% rs_webui
if "%ParamPlugins%"=="1" set RS_QMAKE_CONFIG=%RS_QMAKE_CONFIG% retroshare_plugins
if "%ParamUseNativeDialogs%"=="1" set RS_QMAKE_CONFIG=%RS_QMAKE_CONFIG% rs_use_native_dialogs
if "%ParamService%" NEQ "1" set RS_QMAKE_CONFIG=%RS_QMAKE_CONFIG% no_retroshare_service
if "%ParamFriendServer%" NEQ "1" set RS_QMAKE_CONFIG=%RS_QMAKE_CONFIG% no_retroshare_friendserver
if "%ParamEmbeddedFriendServer%"=="1" set RS_QMAKE_CONFIG=%RS_QMAKE_CONFIG% rs_efs
qmake "%SourcePath%\RetroShare.pro" -r -spec win32-g++ "CONFIG+=%RS_QMAKE_CONFIG%" "EXTERNAL_LIB_DIR=%BuildLibsPath%\libs"
if errorlevel 1 goto error

View File

@ -8,7 +8,7 @@ if errorlevel 1 goto error_env
call "%EnvPath%\env.bat"
if errorlevel 1 goto error_env
call "%~dp0env.bat" %*
call "%~dp0env.bat" clean %*
if errorlevel 2 exit /B 2
if errorlevel 1 goto error_env

View File

@ -4,11 +4,18 @@ set ParamDebug=0
set ParamAutologin=0
set ParamPlugins=0
set ParamJsonApi=0
set ParamWebui=0
set ParamService=0
set ParamFriendServer=0
set ParamEmbeddedFriendServer=0
set ParamUseNativeDialogs=0
set ParamTor=0
set NonInteractive=0
set CoreCount=%NUMBER_OF_PROCESSORS%
set Module=%~1
shift /1
:parameter_loop
if "%~1" NEQ "" (
for /f "tokens=1,2 delims==" %%a in ("%~1") do (
@ -20,6 +27,15 @@ if "%~1" NEQ "" (
set ParamAutologin=1
) else if "%%~a"=="jsonapi" (
set ParamJsonApi=1
) else if "%%~a"=="webui" (
set ParamJsonApi=1
set ParamWebui=1
) else if "%%~a"=="service" (
set ParamService=1
) else if "%%~a"=="friendserver" (
set ParamFriendServer=1
) else if "%%~a"=="embedded-friendserver" (
set ParamEmbeddedFriendServer=1
) else if "%%~a"=="plugins" (
set ParamPlugins=1
) else if "%%~a"=="tor" (
@ -32,7 +48,7 @@ if "%~1" NEQ "" (
set ParamUseNativeDialogs=1
) else (
echo.
echo Unknown parameter %1
echo Unknown parameter %1 for %Module%
goto :usage
)
)
@ -89,6 +105,7 @@ set RsBuildPath=%BuildPath%\Qt-%QtVersion%-%GCCArchitecture%-%RsBuildConfig%
set RsDeployPath=%DeployPath%\Qt-%QtVersion%-%GCCArchitecture%%RsType%-%RsBuildConfig%
set RsPackPath=%DeployPath%
set RsArchiveAdd=
set RsWebuiBuildPath=%RsBuildPath%\retroshare-webui\webui
if not exist "%~dp0env-mod.bat" goto no_mod
call "%~dp0env-mod.bat"
@ -102,21 +119,33 @@ echo.
echo Usage: release^|debug [^<optional parameters^>]
echo.
echo Mandatory parameter
echo release^|debug Build release or debug version
echo release^|debug Build release or debug version
echo.
echo Optional parameter (need clean when changed)
echo autologin Build with autologin
echo jsonapi Build with jsonapi
echo plugins Build plugins
echo nativedialogs Build with native dialogs
echo.
echo Optional parameter
echo singlethread Use only 1 thread for building
echo.
echo Parameter for pack
echo tor Pack tor version
echo.
echo Parameter for git-log
echo non-interactive Non-interactive mode
if "%Module%"=="build" (
echo Optional parameter ^(need clean when changed^)
echo autologin Build with autologin
echo jsonapi Build with jsonapi
echo webui Build with jsonapi and webui
echo service Build service
echo friendserver Build Friend Server
echo embedded-friendserver Build with embedded Friend Server
echo plugins Build plugins
echo nativedialogs Build with native dialogs
echo.
echo Optional parameter
echo singlethread Use only 1 thread for building
)
if "%Module%"=="pack" (
echo Optional parameter
echo webui Pack webui
echo service Pack service
echo friendserver Pack Friend Server ^(needs Tor^)
echo tor Pack Tor version
echo plugins Pack plugins
)
if "%Module%"=="git-log" (
echo Optional parameter
echo non-interactive Non-interactive mode
)
echo.
exit /B 2

View File

@ -8,7 +8,7 @@ if errorlevel 1 goto error_env
call "%EnvPath%\env.bat"
if errorlevel 1 goto error_env
call "%~dp0env.bat" %*
call "%~dp0env.bat" git-log %*
if errorlevel 2 exit /B 2
if errorlevel 1 goto error_env
@ -88,6 +88,10 @@ echo %RsRef%>"%RsLastRefFile%"
exit /B %ERRORLEVEL%
:error
%cecho% error "\n%~n0 failed\n"
exit /B 1
:error_env
echo Failed to initialize environment.
endlocal

View File

@ -11,7 +11,7 @@ call "%EnvPath%\env.bat"
if errorlevel 1 goto error_env
:: Initialize environment
call "%~dp0env.bat" %*
call "%~dp0env.bat" pack %*
if errorlevel 2 exit /B 2
if errorlevel 1 goto error_env
@ -95,8 +95,23 @@ copy nul "%RsDeployPath%\portable" %Quite%
echo copy binaries
copy "%RsBuildPath%\retroshare-gui\src\%RsBuildConfig%\retroshare*.exe" "%RsDeployPath%" %Quite%
copy "%RsBuildPath%\retroshare-service\src\%RsBuildConfig%\retroshare*-service.exe" "%RsDeployPath%" %Quite%
if exist "%RsBuildPath%\libretroshare\src\lib\retroshare.dll" copy "%RsBuildPath%\libretroshare\src\lib\retroshare.dll" "%RsDeployPath%" %Quite%
if exist "%RsBuildPath%\supportlibs\librnp\Build\src\lib\librnp.dll" copy "%RsBuildPath%\supportlibs\librnp\Build\src\lib\librnp.dll" "%RsDeployPath%" %Quite%
if "%ParamService%"=="1" (
copy "%RsBuildPath%\retroshare-service\src\%RsBuildConfig%\retroshare*-service.exe" "%RsDeployPath%" %Quite%
if errorlevel 1 %cecho% error "Service not found"& goto error
)
if "%ParamFriendServer%"=="1" (
if "%ParamTor%"=="1" (
copy "%RsBuildPath%\retroshare-friendserver\src\%RsBuildConfig%\retroshare-friendserver.exe" "%RsDeployPath%" %Quite%
if errorlevel 1 %cecho% error "Friend Server not found"& goto error
) else (
%cecho% error "Friend Server needs Tor"
goto error
)
)
echo copy extensions
if "%ParamPlugins%"=="1" (
@ -132,8 +147,10 @@ if exist "%QtPath%\..\plugins\styles\qwindowsvistastyle.dll" (
copy "%QtPath%\..\plugins\imageformats\*.dll" "%RsDeployPath%\imageformats" %Quite%
del /Q "%RsDeployPath%\imageformats\*d?.dll" %Quite%
echo copy qss
xcopy /S "%SourcePath%\retroshare-gui\src\qss" "%RsDeployPath%\qss" %Quite%
if exist "%SourcePath%\retroshare-gui\src\qss" (
echo copy qss
xcopy /S "%SourcePath%\retroshare-gui\src\qss" "%RsDeployPath%\qss" %Quite%
)
echo copy stylesheets
xcopy /S "%SourcePath%\retroshare-gui\src\gui\qss\chat" "%RsDeployPath%\stylesheets" %Quite%
@ -165,15 +182,17 @@ copy "%SourcePath%\libbitdht\src\bitdht\bdboot.txt" "%RsDeployPath%" %Quite%
echo copy changelog.txt
copy "%RsBuildPath%\changelog.txt" "%RsDeployPath%" %Quite%
if exist "%SourcePath%\libresapi\src\webui" (
if defined ParamWebui (
echo copy webui
mkdir "%RsDeployPath%\webui"
xcopy /S "%SourcePath%\libresapi\src\webui" "%RsDeployPath%\webui" %Quite%
xcopy /S "%RsWebuiBuildPath%" "%RsDeployPath%\webui" %Quite%
if errorlevel 1 %cecho% error "WebUi not found"& goto error
)
if "%ParamTor%"=="1" (
echo copy tor
echo n | copy /-y "%EnvTorPath%\Tor\*.*" "%RsDeployPath%" %Quite%
if not exist "%RsDeployPath%\tor" mkdir "%RsDeployPath%\tor"
echo n | copy /-y "%EnvTorPath%\Tor\*.*" "%RsDeployPath%\tor" %Quite%
)
rem pack files

View File

@ -5,7 +5,6 @@
call "%~dp0env.bat"
if errorlevel 1 goto error_env
rem openssl x86 doesn't compile with mingw64 x64
:: Get gcc versions
call "%ToolsPath%\get-gcc-version.bat" GCCVersion GCCArchitecture
if "%GCCVersion%"=="" %cecho% error "Cannot get gcc version." & exit /B 1
@ -23,11 +22,12 @@ if "%GCCArchitecture%"=="x64" (
)
set EnvMSYS2Path=%EnvRootPath%\msys2
set EnvMSYS2BasePath=%EnvMSYS2Path%\msys64
call "%~dp0tools\prepare-msys2.bat" %1
if errorlevel 1 exit /B %ERRORLEVEL%
set EnvMSYS2SH=%EnvMSYS2Path%\msys%MSYS2Base%\usr\bin\sh.exe
set EnvMSYS2SH=%EnvMSYS2BasePath%\usr\bin\sh.exe
if not exist "%EnvMSYS2SH%" if errorlevel 1 goto error_env
set EnvMSYS2Cmd="%EnvMSYS2SH%" -lc

View File

@ -28,6 +28,9 @@ if errorlevel 1 exit /B %ERRORLEVEL%
set PATH=%EnvToolsPath%\MinGit\cmd;%EnvToolsPath%\cmake\bin;%PATH%
set HOME=%EnvToolsPath%\MinGit\home
:: Add Doxygen to PATH
set PATH=%EnvToolsPath%\doxygen;%PATH%
exit /B 0
:error_env

View File

@ -16,7 +16,15 @@ if "%~1"=="clean" (
goto exit
)
if exist "%EnvMSYS2Path%\msys%MSYS2Base%\usr\bin\pacman.exe" (
set MSYS2Version=20241208
set MSYS2Install=msys2-base-x86_64-%MSYS2Version%.sfx.exe
set MSYS2Url=https://github.com/msys2/msys2-installer/releases/download/%MSYS2Version:~0,4%-%MSYS2Version:~4,2%-%MSYS2Version:~6,2%/%MSYS2Install%
set MSYS2UnpackPath=%EnvMSYS2Path%\msys64
set CMakeInstall=cmake-3.31.3-windows-i386.zip
set CMakeUrl=https://github.com/Kitware/CMake/releases/download/v3.31.3/%CMakeInstall%
if exist "%MSYS2UnpackPath%\usr\bin\pacman.exe" (
if "%~1"=="reinstall" (
choice /M "Found existing MSYS2 version. Do you want to proceed?"
if !ERRORLEVEL!==2 goto exit
@ -25,18 +33,12 @@ if exist "%EnvMSYS2Path%\msys%MSYS2Base%\usr\bin\pacman.exe" (
)
)
set MSYS2Install=msys2-base-%MSYS2Architecture%-20190524.tar.xz
set MSYS2Url=http://sourceforge.net/projects/msys2/files/Base/%MSYS2Architecture%/%MSYS2Install%/download
set CMakeInstall=cmake-3.19.0-win32-x86.zip
set CMakeUrl=https://github.com/Kitware/CMake/releases/download/v3.19.0/%CMakeInstall%
set CMakeUnpackPath=%EnvMSYS2Path%\msys%MSYS2Base%
if exist "%EnvMSYS2Path%\msys%MSYS2Base%" (
if exist "%MSYS2UnpackPath%" (
%cecho% info "Remove previous MSYS2 version"
call "%ToolsPath%\remove-dir.bat" "%EnvMSYS2Path%\msys%MSYS2Base%"
call "%ToolsPath%\remove-dir.bat" "%MSYS2UnpackPath%"
)
%cecho% info "Download installation files"
%cecho% info "Download MSYS2 installation files"
if not exist "%EnvDownloadPath%\%MSYS2Install%" call "%ToolsPath%\download-file.bat" "%MSYS2Url%" "%EnvDownloadPath%\%MSYS2Install%"
if not exist "%EnvDownloadPath%\%MSYS2Install%" %cecho% error "Cannot download MSYS" & goto error
@ -44,37 +46,32 @@ if not exist "%EnvDownloadPath%\%CMakeInstall%" call "%ToolsPath%\download-file.
if not exist "%EnvDownloadPath%\%CMakeInstall%" %cecho% error "Cannot download CMake" & goto error
%cecho% info "Unpack MSYS2"
"%EnvSevenZipExe%" x -so "%EnvDownloadPath%\%MSYS2Install%" | "%EnvSevenZipExe%" x -y -si -ttar -o"%EnvMSYS2Path%"
"%EnvDownloadPath%\%MSYS2Install%" -y -o"%EnvMSYS2Path%"
%cecho% info "Unpack CMake"
"%EnvSevenZipExe%" x -o"%CMakeUnpackPath%" "%EnvDownloadPath%\%CMakeInstall%"
"%EnvSevenZipExe%" x -o"%MSYS2UnpackPath%" "%EnvDownloadPath%\%CMakeInstall%" -y -bso0
%cecho% info "Install CMake"
set CMakeVersion=
for /D %%F in (%CMakeUnpackPath%\cmake*) do set CMakeVersion=%%~nxF
for /D %%F in (%MSYS2UnpackPath%\cmake*) do set CMakeVersion=%%~nxF
if "%CMakeVersion%"=="" %cecho% error "CMake version not found." & goto :exit
%cecho% info "Found CMake version %CMakeVersion%"
set FoundProfile=
for /f "tokens=3" %%F in ('find /c /i "%CMakeVersion%" "%EnvMSYS2Path%\msys%MSYS2Base%\etc\profile"') do set FoundProfile=%%F
for /f "tokens=3" %%F in ('find /c /i "%CMakeVersion%" "%MSYS2UnpackPath%\etc\profile"') do set FoundProfile=%%F
if "%FoundProfile%"=="0" (
echo export PATH="${PATH}:/%CMakeVersion%/bin">>"%EnvMSYS2Path%\msys%MSYS2Base%\etc\profile"
echo export PATH="${PATH}:/%CMakeVersion%/bin">>"%MSYS2UnpackPath%\etc\profile"
)
set MSYS2SH=%EnvMSYS2Path%\msys%MSYS2Base%\usr\bin\sh
%cecho% info "Update keyring"
"%MSYS2SH%" -lc "curl -O http://repo.msys2.org/msys/x86_64/msys2-keyring-r21.b39fb11-1-any.pkg.tar.xz"
"%MSYS2SH%" -lc "pacman --noconfirm -U msys2-keyring-r21.b39fb11-1-any.pkg.tar.xz"
set MSYS2SH=%MSYS2UnpackPath%\usr\bin\sh
%cecho% info "Initialize MSYS2"
"%MSYS2SH%" -lc "pacman -Sy"
"%MSYS2SH%" -lc "pacman --noconfirm --needed -S bash pacman pacman-mirrors msys2-runtime"
"%MSYS2SH%" -lc "yes | pacman --noconfirm -Syuu msys2-keyring"
"%MSYS2SH%" -lc "pacman --noconfirm -Sy"
"%MSYS2SH%" -lc "pacman --noconfirm -Su"
call "%EnvMSYS2Path%\msys%MSYS2Base%\autorebase.bat"
call "%EnvRootPath%\update-msys2.bat"
call "%EnvRootPath%\update-msys2.bat"
call "%MSYS2UnpackPath%\autorebase.bat"
:exit
endlocal

View File

@ -16,9 +16,12 @@ set NSISInstallPath=%EnvToolsPath%\NSIS
set MinGitInstall=MinGit-2.28.0-32-bit.zip
set MinGitUrl=https://github.com/git-for-windows/git/releases/download/v2.28.0.windows.1/%MinGitInstall%
set MinGitInstallPath=%EnvToolsPath%\MinGit
set CMakeVersion=cmake-3.19.0-win32-x86
set DoxygenInstall=doxygen-1.9.6.windows.x64.bin.zip
set DoxygenUrl=https://github.com/doxygen/doxygen/releases/download/Release_1_9_6/%DoxygenInstall%
set DoxygenInstallPath=%EnvToolsPath%\doxygen
set CMakeVersion=cmake-3.31.3-windows-i386
set CMakeInstall=%CMakeVersion%.zip
set CMakeUrl=https://github.com/Kitware/CMake/releases/download/v3.19.0/%CMakeInstall%
set CMakeUrl=https://github.com/Kitware/CMake/releases/download/v3.31.3/%CMakeInstall%
set CMakeInstallPath=%EnvToolsPath%\cmake
set TorProjectUrl=https://www.torproject.org
set TorDownloadIndexUrl=%TorProjectUrl%/download/tor
@ -50,7 +53,7 @@ if not exist "%EnvToolsPath%\cecho.exe" (
if not exist "%EnvDownloadPath%\%cCEhoInstall%" echo Cannot download cecho installation& goto error
echo Unpack cecho
"%EnvSevenZipExe%" x -o"%EnvTempPath%" "%EnvDownloadPath%\%CEchoInstall%"
"%EnvSevenZipExe%" x -o"%EnvTempPath%" "%EnvDownloadPath%\%CEchoInstall%" -y -bso0
copy "%EnvTempPath%\cecho.exe" "%EnvToolsPath%"
call "%ToolsPath%\remove-dir.bat" "%EnvTempPath%"
@ -66,7 +69,7 @@ if not exist "%EnvToolsPath%\depends.exe" (
if not exist "%EnvDownloadPath%\%DependsInstall%" %cecho% error "Cannot download Dependendy Walker installation" & goto error
%cecho% info "Unpack Dependency Walker"
"%EnvSevenZipExe%" x -o"%EnvTempPath%" "%EnvDownloadPath%\%DependsInstall%"
"%EnvSevenZipExe%" x -o"%EnvTempPath%" "%EnvDownloadPath%\%DependsInstall%" -y -bso0
copy "%EnvTempPath%\*" "%EnvToolsPath%"
call "%ToolsPath%\remove-dir.bat" "%EnvTempPath%"
@ -82,7 +85,7 @@ if not exist "%EnvToolsPath%\cut.exe" (
if not exist "%EnvDownloadPath%\%UnixToolsInstall%" %cecho% error "Cannot download Unix Tools installation" & goto error
%cecho% info "Unpack Unix Tools"
"%EnvSevenZipExe%" x -o"%EnvTempPath%" "%EnvDownloadPath%\%UnixToolsInstall%"
"%EnvSevenZipExe%" x -o"%EnvTempPath%" "%EnvDownloadPath%\%UnixToolsInstall%" -y -bso0
copy "%EnvTempPath%\cut.exe" "%EnvToolsPath%"
call "%ToolsPath%\remove-dir.bat" "%EnvTempPath%"
@ -98,7 +101,7 @@ if not exist "%EnvToolsPath%\sed.exe" (
if not exist "%EnvDownloadPath%\%UnixToolsInstall%" %cecho% error "Cannot download Unix Tools installation" & goto error
%cecho% info "Unpack Unix Tools"
"%EnvSevenZipExe%" x -o"%EnvTempPath%" "%EnvDownloadPath%\%UnixToolsInstall%"
"%EnvSevenZipExe%" x -o"%EnvTempPath%" "%EnvDownloadPath%\%UnixToolsInstall%" -y -bso0
copy "%EnvTempPath%\sed.exe" "%EnvToolsPath%"
call "%ToolsPath%\remove-dir.bat" "%EnvTempPath%"
@ -118,7 +121,7 @@ if not exist "%NSISInstallPath%\nsis.exe" (
if not exist "%EnvDownloadPath%\%NSISInstall%" %cecho% error "Cannot download NSIS installation" & goto error
%cecho% info "Unpack NSIS"
"%EnvSevenZipExe%" x -o"%EnvTempPath%" "%EnvDownloadPath%\%NSISInstall%"
"%EnvSevenZipExe%" x -o"%EnvTempPath%" "%EnvDownloadPath%\%NSISInstall%" -y -bso0
if not exist "%NSISInstallPath%" mkdir "%NSISInstallPath%"
xcopy /s "%EnvTempPath%" "%NSISInstallPath%"
@ -132,7 +135,20 @@ if not exist "%MinGitInstallPath%\cmd\git.exe" (
if not exist "%EnvDownloadPath%\%MinGitInstall%" %cecho% error "Cannot download MinGit installation" & goto error
%cecho% info "Unpack MinGit"
"%EnvSevenZipExe%" x -o"%MinGitInstallPath%" "%EnvDownloadPath%\%MinGitInstall%"
"%EnvSevenZipExe%" x -o"%MinGitInstallPath%" "%EnvDownloadPath%\%MinGitInstall%" -y -bso0
)
if not exist "%EnvDownloadPath%\%DoxygenInstall%" call "%ToolsPath%\remove-dir.bat" "%DoxygenInstallPath%"
if not exist "%DoxygenInstallPath%\doxygen.exe" (
if exist "%DoxygenInstallPath%" call "%ToolsPath%\remove-dir.bat" "%DoxygenInstallPath%"
%cecho% info "Download Doxygen installation"
if not exist "%EnvDownloadPath%\%DoxygenInstall%" call "%ToolsPath%\download-file.bat" "%DoxygenUrl%" "%EnvDownloadPath%\%DoxygenInstall%"
if not exist "%EnvDownloadPath%\%DoxygenInstall%" %cecho% error "Cannot download doxygen installation" & goto error
%cecho% info "Unpack Doxygen"
"%EnvSevenZipExe%" x -o"%DoxygenInstallPath%" "%EnvDownloadPath%\%DoxygenInstall%" -y -bso0
)
if not exist "%EnvDownloadPath%\%CMakeInstall%" call "%ToolsPath%\remove-dir.bat" "%CMakeInstallPath%"
@ -147,7 +163,7 @@ if not exist "%CMakeInstallPath%\bin\cmake.exe" (
if not exist "%EnvDownloadPath%\%CMakeInstall%" %cecho% error "Cannot download CMake installation" & goto error
%cecho% info "Unpack CMake"
"%EnvSevenZipExe%" x -o"%EnvTempPath%" "%EnvDownloadPath%\%CMakeInstall%"
"%EnvSevenZipExe%" x -o"%EnvTempPath%" "%EnvDownloadPath%\%CMakeInstall%" -y -bso0
move "%EnvTempPath%\%CMakeVersion%" "%CMakeInstallPath%"
@ -160,7 +176,7 @@ mkdir "%EnvTempPath%"
call "%ToolsPath%\download-file.bat" "%TorDownloadIndexUrl%" "%EnvTempPath%\index.html"
if not exist "%EnvTempPath%\index.html" %cecho% error "Cannot download Tor installation" & goto error
for /F "tokens=1,2 delims= " %%A in ('%EnvSedExe% -r -n -e"s/.*href=\"^(.*^)^(tor-win32.*\.zip^)\".*/\2 \1\2/p" "%EnvTempPath%\index.html"') do set TorInstall=%%A& set TorDownloadUrl=%TorProjectUrl%%%B
for /F "tokens=1,2 delims= " %%A in ('%EnvSedExe% -r -n -e"s/.*href=\"^(.*^)^(tor-.*windows-i686.*\.tar\.gz^)\".*/\2 \1\2/p" "%EnvTempPath%\index.html"') do set TorInstall=%%A& set TorDownloadUrl=%%B
call "%ToolsPath%\remove-dir.bat" "%EnvTempPath%"
if "%TorInstall%"=="" %cecho% error "Cannot download Tor installation" & goto error
if "%TorDownloadUrl%"=="" %cecho% error "Cannot download Tor installation" & goto error
@ -173,7 +189,7 @@ if not exist "%EnvTorPath%\Tor\tor.exe" (
if not exist "%EnvDownloadPath%\%TorInstall%" %cecho% error "Cannot download Tor installation" & goto error
%cecho% info "Unpack Tor"
"%EnvSevenZipExe%" x -o"%EnvTorPath%" "%EnvDownloadPath%\%TorInstall%"
"%EnvSevenZipExe%" x -so "%EnvDownloadPath%\%TorInstall%" | "%EnvSevenZipExe%" x -si -ttar -o"%EnvTorPath%" -y -bso0
)
:exit

View File

@ -2,18 +2,13 @@
setlocal
if exist "%~dp0msys2\msys32" call :update 32
if exist "%~dp0msys2\msys64" call :update 64
if not exist "%~dp0msys2\msys64" goto :EOF
goto :EOF
set MSYS2SH=%~dp0msys2\msys64\usr\bin\sh
:update
set MSYSSH=%~dp0msys2\msys%~1\usr\bin\sh
echo Update MSYS2
"%MSYS2SH%" -lc "yes | pacman --noconfirm -Syuu msys2-keyring"
"%MSYS2SH%" -lc "pacman --noconfirm -Su"
echo Update MSYS2 %~1
"%MSYSSH%" -lc "pacman -Sy"
"%MSYSSH%" -lc "pacman --noconfirm -Su"
:exit
endlocal
goto :EOF

View File

@ -2,6 +2,12 @@
!insertmacro LANG_STRING Section_Main_Desc "Instal·la ${APPNAME} i els components necessaris."
!insertmacro LANG_STRING Section_Tor "Tor"
!insertmacro LANG_STRING Section_Tor_Desc "Installs Tor."
!insertmacro LANG_STRING Section_WebUI "WebUI"
!insertmacro LANG_STRING Section_WebUI_Desc "Installs WebUI."
!insertmacro LANG_STRING Section_Service "Service"
!insertmacro LANG_STRING Section_Service_Desc "Installs Service."
!insertmacro LANG_STRING Section_FriendServer "Friend Server"
!insertmacro LANG_STRING Section_FriendServer_Desc "Installs Friend Server."
!insertmacro LANG_STRING Section_Data "Pells"
!insertmacro LANG_STRING Section_Data_Desc "Instal·la pells."
!insertmacro LANG_STRING Section_Shortcuts "Icones d'accés directe"

View File

@ -2,6 +2,12 @@
!insertmacro LANG_STRING Section_Main_Desc "Installiert ${APPNAME} und die benötigten Komponenten."
!insertmacro LANG_STRING Section_Tor "Tor"
!insertmacro LANG_STRING Section_Tor_Desc "Installiert Tor."
!insertmacro LANG_STRING Section_WebUI "WebUI"
!insertmacro LANG_STRING Section_WebUI_Desc "Installiert WebUI."
!insertmacro LANG_STRING Section_Service "Service"
!insertmacro LANG_STRING Section_Service_Desc "Installiert Service."
!insertmacro LANG_STRING Section_FriendServer "Friend Server"
!insertmacro LANG_STRING Section_FriendServer_Desc "Installiert Friend Server."
!insertmacro LANG_STRING Section_Data "Skins"
!insertmacro LANG_STRING Section_Data_Desc "Skins installieren."
!insertmacro LANG_STRING Section_Shortcuts "Verknüpfungssymbole"

View File

@ -2,6 +2,12 @@
!insertmacro LANG_STRING Section_Main_Desc "Installs ${APPNAME} and required components."
!insertmacro LANG_STRING Section_Tor "Tor"
!insertmacro LANG_STRING Section_Tor_Desc "Installs Tor."
!insertmacro LANG_STRING Section_WebUI "WebUI"
!insertmacro LANG_STRING Section_WebUI_Desc "Installs WebUI."
!insertmacro LANG_STRING Section_Service "Service"
!insertmacro LANG_STRING Section_Service_Desc "Installs Service."
!insertmacro LANG_STRING Section_FriendServer "Friend Server"
!insertmacro LANG_STRING Section_FriendServer_Desc "Installs Friend Server."
!insertmacro LANG_STRING Section_Data "Skins"
!insertmacro LANG_STRING Section_Data_Desc "Installs skins."
!insertmacro LANG_STRING Section_Shortcuts "Shortcut icons"

View File

@ -2,6 +2,12 @@
!insertmacro LANG_STRING Section_Main_Desc "Instala ${APPNAME} y los componentes requeridos."
!insertmacro LANG_STRING Section_Tor "Tor"
!insertmacro LANG_STRING Section_Tor_Desc "Installs Tor."
!insertmacro LANG_STRING Section_WebUI "WebUI"
!insertmacro LANG_STRING Section_WebUI_Desc "Installs WebUI."
!insertmacro LANG_STRING Section_Service "Service"
!insertmacro LANG_STRING Section_Service_Desc "Installs Service."
!insertmacro LANG_STRING Section_FriendServer "Friend Server"
!insertmacro LANG_STRING Section_FriendServer_Desc "Installs Friend Server."
!insertmacro LANG_STRING Section_Data "Coberturas (skins)"
!insertmacro LANG_STRING Section_Data_Desc "Instalar coberturas"
!insertmacro LANG_STRING Section_Shortcuts "Iconos de accesos directos"

View File

@ -2,6 +2,12 @@
!insertmacro LANG_STRING Section_Main_Desc "Installe ${APPNAME} et les composants requis."
!insertmacro LANG_STRING Section_Tor "Tor"
!insertmacro LANG_STRING Section_Tor_Desc "Installs Tor."
!insertmacro LANG_STRING Section_WebUI "WebUI"
!insertmacro LANG_STRING Section_WebUI_Desc "Installs WebUI."
!insertmacro LANG_STRING Section_Service "Service"
!insertmacro LANG_STRING Section_Service_Desc "Installs Service."
!insertmacro LANG_STRING Section_FriendServer "Friend Server"
!insertmacro LANG_STRING Section_FriendServer_Desc "Installs Friend Server."
!insertmacro LANG_STRING Section_Data "Habillages"
!insertmacro LANG_STRING Section_Data_Desc "Installe des habillages."
!insertmacro LANG_STRING Section_Shortcuts "Icônes de raccourci"

View File

@ -2,6 +2,12 @@
!insertmacro LANG_STRING Section_Main_Desc "Instaluje ${APPNAME} oraz wymagane komponenty."
!insertmacro LANG_STRING Section_Tor "Tor"
!insertmacro LANG_STRING Section_Tor_Desc "Installs Tor."
!insertmacro LANG_STRING Section_WebUI "WebUI"
!insertmacro LANG_STRING Section_WebUI_Desc "Installs WebUI."
!insertmacro LANG_STRING Section_Service "Service"
!insertmacro LANG_STRING Section_Service_Desc "Installs Service."
!insertmacro LANG_STRING Section_FriendServer "Friend Server"
!insertmacro LANG_STRING Section_FriendServer_Desc "Installs Friend Server."
!insertmacro LANG_STRING Section_Data "Skórki"
!insertmacro LANG_STRING Section_Data_Desc "Instaluje skórki."
!insertmacro LANG_STRING Section_Shortcuts "Ikony skrótów"

View File

@ -2,6 +2,12 @@
!insertmacro LANG_STRING Section_Main_Desc "Установка ${APPNAME} и необходимых компонентов."
!insertmacro LANG_STRING Section_Tor "Tor"
!insertmacro LANG_STRING Section_Tor_Desc "Installs Tor."
!insertmacro LANG_STRING Section_WebUI "WebUI"
!insertmacro LANG_STRING Section_WebUI_Desc "Installs WebUI."
!insertmacro LANG_STRING Section_Service "Service"
!insertmacro LANG_STRING Section_Service_Desc "Installs Service."
!insertmacro LANG_STRING Section_FriendServer "Friend Server"
!insertmacro LANG_STRING Section_FriendServer_Desc "Installs Friend Server."
!insertmacro LANG_STRING Section_Data "Оболочки"
!insertmacro LANG_STRING Section_Data_Desc "Установка оболочек."
!insertmacro LANG_STRING Section_Shortcuts "Ярлыки"

View File

@ -2,6 +2,12 @@
!insertmacro LANG_STRING Section_Main_Desc "${APPNAME} ve gerekli bileşenleri kurar."
!insertmacro LANG_STRING Section_Tor "Tor"
!insertmacro LANG_STRING Section_Tor_Desc "Installs Tor."
!insertmacro LANG_STRING Section_WebUI "WebUI"
!insertmacro LANG_STRING Section_WebUI_Desc "Installs WebUI."
!insertmacro LANG_STRING Section_Service "Service"
!insertmacro LANG_STRING Section_Service_Desc "Installs Service."
!insertmacro LANG_STRING Section_FriendServer "Friend Server"
!insertmacro LANG_STRING Section_FriendServer_Desc "Installs Friend Server."
!insertmacro LANG_STRING Section_Data "Temalar"
!insertmacro LANG_STRING Section_Data_Desc "Tema yükleyin."
!insertmacro LANG_STRING Section_Shortcuts "Kısayol simgeleri"

View File

@ -22,6 +22,48 @@
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Section_WebUI</name>
<message>
<source>WebUI</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Section_WebUI_Desc</name>
<message>
<source>Installs WebUI.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Section_Service</name>
<message>
<source>Service</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Section_Service_Desc</name>
<message>
<source>Installs Service.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Section_FriendServer</name>
<message>
<source>Friend Server</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Section_FriendServer_Desc</name>
<message>
<source>Installs Friend Server.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Section_Data</name>
<message>

View File

@ -2,6 +2,12 @@
!insertmacro LANG_STRING Section_Main_Desc "Installs ${APPNAME} and required components."
!insertmacro LANG_STRING Section_Tor "Tor"
!insertmacro LANG_STRING Section_Tor_Desc "Installs Tor."
!insertmacro LANG_STRING Section_WebUI "WebUI"
!insertmacro LANG_STRING Section_WebUI_Desc "Installs WebUI."
!insertmacro LANG_STRING Section_Service "Service"
!insertmacro LANG_STRING Section_Service_Desc "Installs Service."
!insertmacro LANG_STRING Section_FriendServer "Friend Server"
!insertmacro LANG_STRING Section_FriendServer_Desc "Installs Friend Server."
!insertmacro LANG_STRING Section_Data "皮肤"
!insertmacro LANG_STRING Section_Data_Desc "安装皮肤"
!insertmacro LANG_STRING Section_Shortcuts "快捷方式图标"

View File

@ -60,6 +60,9 @@
!define /date DATE "%Y%m%d"
!endif
# Service
${!defineifexist} SERVICE_EXISTS "${RELEASEDIR}\retroshare-service\src\release\retroshare-service.exe"
# Tor
!ifdef TORDIR
${!defineifexist} TOR_EXISTS "${TORDIR}\tor.exe"
@ -68,6 +71,20 @@ ${!defineifexist} TOR_EXISTS "${TORDIR}\tor.exe"
!endif
!endif
# WebUI
!ifdef WEBUIDIR
${!defineifexist} WEBUI_EXISTS "${WEBUIDIR}\index.html"
!ifndef WEBUI_EXISTS
!error "WebUI files not found"
!endif
!endif
# Friend Server
!ifdef TOR_EXISTS
# Add Friend Server with Tor only
#${!defineifexist} FRIENDSERVER_EXISTS "${RELEASEDIR}\retroshare-friendserver\src\release\retroshare-friendserver.exe"
!endif
# Application name and version
!define APPNAME "RetroShare"
!define APPNAMEANDVERSION "${APPNAME} ${VERSION}"
@ -193,7 +210,6 @@ Section $(Section_Main) Section_Main
; Main binaries
SetOutPath "$INSTDIR"
File "${RELEASEDIR}\retroshare-gui\src\release\retroshare.exe"
File "${RELEASEDIR}\retroshare-service\src\release\retroshare-service.exe"
File /nonfatal "${RELEASEDIR}\libretroshare\src\lib\retroshare.dll"
; Qt binaries
@ -231,6 +247,7 @@ Section $(Section_Main) Section_Main
; External binaries
File "${EXTERNAL_LIB_DIR}\bin\miniupnpc.dll"
File "${RELEASEDIR}\supportlibs\librnp\Build\src\lib\librnp.dll"
!if ${ARCHITECTURE} == "x86"
File "${EXTERNAL_LIB_DIR}\bin\libcrypto-1_1.dll"
File "${EXTERNAL_LIB_DIR}\bin\libssl-1_1.dll"
@ -282,11 +299,35 @@ Section $(Section_Main) Section_Main
File /r "${SOURCEDIR}\retroshare-gui\src\license\*.*"
SectionEnd
# Service
!ifdef SERVICE_EXISTS
Section /o $(Section_Service) Section_Service
SetOutPath "$INSTDIR"
File "${RELEASEDIR}\retroshare-service\src\release\retroshare-service.exe"
SectionEnd
!endif
# Friend Server
!ifdef FRIENDSERVER_EXISTS
Section /o $(Section_FriendServer) Section_FriendServer
SetOutPath "$INSTDIR"
File "${RELEASEDIR}\retroshare-friendserver\src\release\retroshare-friendserver.exe"
SectionEnd
!endif
# Tor
!ifdef TOR_EXISTS
Section /o $(Section_Tor) Section_Tor
SetOutPath "$INSTDIR"
File /r "${TORDIR}\*"
SetOutPath "$INSTDIR\tor"
File "${TORDIR}\*"
SectionEnd
!endif
# WebUI
!ifdef WEBUI_EXISTS
Section /o $(Section_WebUI) Section_WebUI
SetOutPath "$INSTDIR\webui"
File /r "${WEBUIDIR}\*"
SectionEnd
!endif
@ -334,7 +375,7 @@ Section $(Section_Data) Section_Data
; Stylesheets
SetOutPath "$INSTDIR\qss"
File /r "${SOURCEDIR}\retroshare-gui\src\qss\*.*"
File /nonfatal /r "${SOURCEDIR}\retroshare-gui\src\qss\*.*"
SectionEnd
;Section $(Section_Link) Section_Link
@ -355,6 +396,22 @@ Section $(Section_StartMenu) Section_StartMenu
CreateDirectory "$SMPROGRAMS\${APPNAME}"
CreateShortCut "$SMPROGRAMS\${APPNAME}\$(Link_Uninstall).lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
CreateShortCut "$SMPROGRAMS\${APPNAME}\${APPNAME}.lnk" "$INSTDIR\retroshare.exe" "" "$INSTDIR\retroshare.exe" 0
!ifdef SERVICE_EXISTS
SectionGetFlags ${Section_Service} $0
IntOp $0 $0 & ${SF_SELECTED}
${If} $0 == ${SF_SELECTED}
CreateShortCut "$SMPROGRAMS\${APPNAME}\${APPNAME} Service.lnk" "$INSTDIR\retroshare-service.exe" "" "$INSTDIR\retroshare-service.exe" 0
${EndIf}
!endif
!ifdef FRIENDSERVER_EXISTS
SectionGetFlags ${Section_FriendServer} $0
IntOp $0 $0 & ${SF_SELECTED}
${If} $0 == ${SF_SELECTED}
CreateShortCut "$SMPROGRAMS\${APPNAME}\${APPNAME} Friend Server.lnk" "$INSTDIR\retroshare-friendserver.exe" "" "$INSTDIR\retroshare-friendserver.exe" 0
${EndIf}
!endif
SectionEnd
Section $(Section_Desktop) Section_Desktop
@ -407,6 +464,9 @@ SectionEnd
; !insertmacro MUI_DESCRIPTION_TEXT ${Section_Link} $(Section_Link_Desc)
!insertmacro MUI_DESCRIPTION_TEXT ${Section_AutoStart} $(Section_AutoStart_Desc)
!insertmacro MUI_DESCRIPTION_TEXT ${Section_Tor} $(Section_Tor_Desc)
!insertmacro MUI_DESCRIPTION_TEXT ${Section_WebUI} $(Section_WebUI_Desc)
!insertmacro MUI_DESCRIPTION_TEXT ${Section_Service} $(Section_Service_Desc)
!insertmacro MUI_DESCRIPTION_TEXT ${Section_FriendServer} $(Section_FriendServer_Desc)
!insertmacro MUI_FUNCTION_DESCRIPTION_END
# Uninstall
@ -461,6 +521,26 @@ Function .onInit
!insertmacro MUI_LANGDLL_DISPLAY
FunctionEnd
!ifdef FRIENDSERVER_EXISTS
Function .onSelChange
SectionGetFlags ${Section_FriendServer} $0
IntOp $0 $0 & ${SF_SELECTED}
${If} $0 == ${SF_SELECTED}
# Activate Tor and set readonly
SectionGetFlags ${Section_Tor} $1
IntOp $1 $1 | ${SF_SELECTED}
IntOp $1 $1 | ${SF_RO}
SectionSetFlags ${Section_Tor} $1
${Else}
# Remove readonly from Tor
SectionGetFlags ${Section_Tor} $1
IntOp $2 ${SF_RO} ~
IntOp $1 $1 & $2
SectionSetFlags ${Section_Tor} $1
${EndIf}
FunctionEnd
!endif
# Installation mode
Function RequireAdmin

View File

@ -18,6 +18,8 @@ copy nul %logfile% > nul
pushd %~1
set Percent=%%
set last=HEAD
for /f %%t in ('git tag --sort=-taggerdate --merged ^| findstr v') do (
echo generating changelog for !last!..%%t
@ -30,7 +32,7 @@ for /f %%t in ('git tag --sort=-taggerdate --merged ^| findstr v') do (
rem echo !last! ---^> %%t >> %logfile%
echo ----------------------------------------------- >> %logfile%
echo. >> %logfile%
git log %%t..!last! --no-merges "--pretty=format:%%h %%ai %%<(10,trunc)%%an %%s" >> %logfile%
git log %%t..!last! --no-merges "--pretty=format:!Percent!h !Percent!ai !Percent!<(10,trunc)!Percent!an !Percent!s" >> %logfile%
echo. >> %logfile%
echo. >> %logfile%
set last=%%t

View File

@ -0,0 +1,20 @@
#!/bin/bash
function git_del_tag()
{
mTag=$1
for mRemote in $(git remote); do
echo "Attempting tag $mTag removal from remote $mRemote"
GIT_TERMINAL_PROMPT=0 git push $mRemote :$mTag || true
done
git tag --delete $mTag
}
for mModule in . build_scripts/OBS/ libbitdht/ libretroshare/ openpgpsdk/ retroshare-webui/ ; do
pushd $mModule
git_del_tag v0.6.7a
git tag --list | grep untagged | while read mTag; do git_del_tag $mTag ; done
popd
done

View File

@ -7,5 +7,5 @@ Exec=/usr/bin/retroshare %U
Icon=/usr/share/pixmaps/retroshare.xpm
Terminal=false
Type=Application
Categories=Application;Network;P2P;Feed;Chat;InstantMessaging
Categories=Application;Network;Email;InstantMessaging;Chat;Feed;FileTransfer;P2P
MimeType=x-scheme-handler/retroshare;

View File

@ -1,447 +1,10 @@
// SPDX-FileCopyrightText: (C) 2004-2019 Retroshare Team <contact@retroshare.cc>
// SPDX-FileCopyrightText: (C) 2021 Retroshare Team <contact@retroshare.cc>
// SPDX-License-Identifier: CC0-1.0
RetroShare JSON API
===================
= Moved
:Cxx: C&#43;&#43;
JSON API generator is now part of `libretroshare` look under `src/jsonapi/`
directory in `libretroshare` repository.
== How to use RetroShare JSON API
Look for methods marked with +@jsonapi+ doxygen custom command into
+libretroshare/src/retroshare+. The method path is composed by service instance
pointer name like +rsGxsChannels+ for +RsGxsChannels+, and the method name like
+createGroup+ and pass the input paramethers as a JSON object.
.Service instance pointer in rsgxschannels.h
[source,cpp]
--------------------------------------------------------------------------------
/**
* Pointer to global instance of RsGxsChannels service implementation
* @jsonapi{development}
*/
extern RsGxsChannels* rsGxsChannels;
--------------------------------------------------------------------------------
.Method declaration in rsgxschannels.h
[source,cpp]
--------------------------------------------------------------------------------
/**
* @brief Request channel creation.
* The action is performed asyncronously, so it could fail in a subsequent
* phase even after returning true.
* @jsonapi{development}
* @param[out] token Storage for RsTokenService token to track request
* status.
* @param[in] group Channel data (name, description...)
* @return false on error, true otherwise
*/
virtual bool createGroup(uint32_t& token, RsGxsChannelGroup& group) = 0;
--------------------------------------------------------------------------------
.paramethers.json
[source,json]
--------------------------------------------------------------------------------
{
"group":{
"mMeta":{
"mGroupName":"JSON test group",
"mGroupFlags":4,
"mSignFlags":520
},
"mDescription":"JSON test group description"
},
"caller_data":"Here can go any kind of JSON data (even objects) that the caller want to get back together with the response"
}
--------------------------------------------------------------------------------
.Calling the JSON API with curl on the terminal
[source,bash]
--------------------------------------------------------------------------------
curl -u $API_USER --data @paramethers.json http://127.0.0.1:9092/rsGxsChannels/createGroup
--------------------------------------------------------------------------------
.JSON API call result
[source,json]
--------------------------------------------------------------------------------
{
"caller_data": "Here can go any kind of JSON data (even objects) that the caller want to get back together with the response",
"retval": true,
"token": 3
}
--------------------------------------------------------------------------------
Even if it is less efficient because of URL encoding HTTP +GET+ method is
supported too, so in cases where the client cannot use +POST+ she can still use
+GET+ taking care of encoding the JSON data. With +curl+ this can be done at
least in two different ways.
.Calling the JSON API with GET method with curl on the terminal
[source,bash]
--------------------------------------------------------------------------------
curl -u $API_USER --get --data-urlencode jsonData@paramethers.json \
http://127.0.0.1:9092/rsGxsChannels/createGroup
--------------------------------------------------------------------------------
Letting +curl+ do the encoding is much more elegant but it is semantically
equivalent to the following.
.Calling the JSON API with GET method and pre-encoded data with curl on the terminal
--------------------------------------------------------------------------------
curl -u $API_USER http://127.0.0.1:9092/rsGxsChannels/createGroup?jsonData=%7B%0A%20%20%20%20%22group%22%3A%7B%0A%20%20%20%20%20%20%20%20%22mMeta%22%3A%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%22mGroupName%22%3A%22JSON%20test%20group%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%22mGroupFlags%22%3A4%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%22mSignFlags%22%3A520%0A%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%22mDescription%22%3A%22JSON%20test%20group%20description%22%0A%20%20%20%20%7D%2C%0A%20%20%20%20%22caller_data%22%3A%22Here%20can%20go%20any%20kind%20of%20JSON%20data%20%28even%20objects%29%20that%20the%20caller%20want%20to%20get%20back%20together%20with%20the%20response%22%0A%7D
--------------------------------------------------------------------------------
Note that using +GET+ method +?jsonData=+ and then the JSON data URL encoded are
added after the path in the HTTP request.
== JSON API authentication
Most of JSON API methods require authentication as they give access to
RetroShare user data, and we don't want any application running on the system
eventually by other users be able to access private data indiscriminately.
JSON API support HTTP Basic as authentication scheme, this is enough as JSON API
server is intented for usage on the same system (127.0.0.1) not over an
untrusted network.
If you need to use JSON API over an untrusted network consider using a reverse
proxy with HTTPS such as NGINX in front of JSON API server.
If RetroShare login has been effectuated through the JSON API you can use your
location SSLID as username and your PGP password as credential for the JSON API,
but we suggests you use specific meaningful and human readable credentials for
each JSON API client so the human user can have better control over which client
can access the JSON API.
.NewToken.json
[source,json]
--------------------------------------------------------------------------------
{
"token": "myNewUser:myNewPassword"
}
--------------------------------------------------------------------------------
.An authenticated client can authorize new tokens like this
--------------------------------------------------------------------------------
curl -u $API_USER --data @NewToken.json http://127.0.0.1:9092/jsonApiServer/authorizeToken
--------------------------------------------------------------------------------
.An unauthenticated JSON API client can request access with
--------------------------------------------------------------------------------
curl --data @NewToken.json http://127.0.0.1:9092/jsonApiServer/requestNewTokenAutorization
--------------------------------------------------------------------------------
When an unauthenticated client request his token to be authorized, JSON API
server will try to ask confirmation to the human user if possible through
+mNewAccessRequestCallback+, if it is not possible or the user didn't authorized
the token +false+ is returned.
== Offer new RetroShare services through JSON API
To offer a retroshare service through the JSON API, first of all one need find
the global pointer to the service instance and document it in doxygen syntax,
plus marking with the custom doxygen command +@jsonapi{RS_VERSION}+ where
+RS_VERSION+ is the retroshare version in which this service became available
with the current semantic (major changes to the service semantic, changes the
meaning of the service itself, so the version should be updated in the
documentation in that case).
.Service instance pointer in rsgxschannels.h
[source,cpp]
--------------------------------------------------------------------------------
/**
* Pointer to global instance of RsGxsChannels service implementation
* @jsonapi{development}
*/
extern RsGxsChannels* rsGxsChannels;
--------------------------------------------------------------------------------
Once the service instance itself is known to the JSON API you need to document
in doxygen syntax and mark with the custom doxygen command
+@jsonapi{RS_VERSION}+ the methods of the service that you want to make
available through JSON API.
.Offering RsGxsChannels::getChannelDownloadDirectory in rsgxschannels.h
[source,cpp]
--------------------------------------------------------------------------------
/**
* Get download directory for the given channel
* @jsonapi{development}
* @param[in] channelId id of the channel
* @param[out] directory reference to string where to store the path
* @return false on error, true otherwise
*/
virtual bool getChannelDownloadDirectory( const RsGxsGroupId& channelId,
std::string& directory ) = 0;
--------------------------------------------------------------------------------
For each paramether you must specify if it is used as input +@param[in]+ as
output +@param[out]+ or both +@param[inout]+. Paramethers and return value
types must be of a type supported by +RsTypeSerializer+ which already support
most basic types (+bool+, +std::string+...), +RsSerializable+ and containers of
them like +std::vector<std::string>+. Paramethers passed by value and by
reference of those types are both supported, while passing by pointer is not
supported. If your paramether or return +class+/+struct+ type is not supported
yet by +RsTypeSerializer+ most convenient approach is to make it derive from
+RsSerializable+ and implement +serial_process+ method like I did with
+RsGxsChannelGroup+.
.Deriving RsGxsChannelGroup from RsSerializable in rsgxschannels.h
[source,cpp]
--------------------------------------------------------------------------------
struct RsGxsChannelGroup : RsSerializable
{
RsGroupMetaData mMeta;
std::string mDescription;
RsGxsImage mImage;
bool mAutoDownload;
/// @see RsSerializable
virtual void serial_process( RsGenericSerializer::SerializeJob j,
RsGenericSerializer::SerializeContext& ctx )
{
RS_SERIAL_PROCESS(mMeta);
RS_SERIAL_PROCESS(mDescription);
RS_SERIAL_PROCESS(mImage);
RS_SERIAL_PROCESS(mAutoDownload);
}
};
--------------------------------------------------------------------------------
You can do the same recursively for any member of your +struct+ that is not yet
supported by +RsTypeSerializer+.
Some Retroshare {Cxx} API functions are asyncronous, historically RetroShare
didn't follow a policy on how to expose asyncronous API so differents services
and some times even differents method of the same service follow differents
asyncronous patterns, thus making automatic generation of JSON API wrappers for
those methods impractical. Instead of dealing with all those differents patterns
I have chosed to support only one new pattern taking advantage of modern {Cxx}11
and restbed features. On the {Cxx}11 side lambdas and +std::function+s are used,
on the restbed side Server Side Events are used to send asyncronous results.
Lets see an example so it will be much esier to understand.
.RsGxsChannels::turtleSearchRequest asyncronous API
[source,cpp]
--------------------------------------------------------------------------------
/**
* @brief Request remote channels search
* @jsonapi{development}
* @param[in] matchString string to look for in the search
* @param multiCallback function that will be called each time a search
* result is received
* @param[in] maxWait maximum wait time in seconds for search results
* @return false on error, true otherwise
*/
virtual bool turtleSearchRequest(
const std::string& matchString,
const std::function<void (const RsGxsGroupSummary& result)>& multiCallback,
std::time_t maxWait = 300 ) = 0;
--------------------------------------------------------------------------------
+RsGxsChannels::turtleSearchRequest(...)+ is an asyncronous method because it
send a channel search request on turtle network and then everytime a result is
received from the network +multiCallback+ is called and the result is passed as
parameter. To be supported by the automatic JSON API wrappers generator an
asyncronous method need a parameter of type +std::function<void (...)>+ called
+callback+ if the callback will be called only once or +multiCallback+ if the
callback is expected to be called more then once like in this case.
A second mandatory parameter is +maxWait+ of type +std::time_t+ it indicates the
maximum amount of time in seconds for which the caller is willing to wait for
results, in case the timeout is reached the callback will not be called anymore.
[IMPORTANT]
================================================================================
+callback+ and +multiCallback+ parameters documentation must *not* specify
+[in]+, +[out]+, +[inout]+, in Doxygen documentation as this would fool the
automatic wrapper generator, and ultimately break the compilation.
================================================================================
.RsFiles::turtleSearchRequest asyncronous JSON API usage example
[source,bash]
--------------------------------------------------------------------------------
$ cat turtle_search.json
{
"matchString":"linux"
}
$ curl --data @turtle_search.json http://127.0.0.1:9092/rsFiles/turtleSearchRequest
data: {"retval":true}
data: {"results":[{"size":157631,"hash":"69709b4d01025584a8def5cd78ebbd1a3cf3fd05","name":"kill_bill_linux_1024x768.jpg"},{"size":192560,"hash":"000000000000000000009a93e5be8486c496f46c","name":"coffee_box_linux2.jpg"},{"size":455087,"hash":"9a93e5be8486c496f46c00000000000000000000","name":"Linux.png"},{"size":182004,"hash":"e8845280912ebf3779e400000000000000000000","name":"Linux_2_6.png"}]}
data: {"results":[{"size":668,"hash":"e8845280912ebf3779e400000000000000000000","name":"linux.png"},{"size":70,"hash":"e8845280912ebf3779e400000000000000000000","name":"kali-linux-2016.2-amd64.txt.sha1sum"},{"size":3076767744,"hash":"e8845280912ebf3779e400000000000000000000","name":"kali-linux-2016.2-amd64.iso"},{"size":2780872,"hash":"e8845280912ebf3779e400000000000000000000","name":"openwrt-ar71xx-generic-vmlinux.bin"},{"size":917504,"hash":"e8845280912ebf3779e400000000000000000000","name":"openwrt-ar71xx-generic-vmlinux.lzma"},{"size":2278404096,"hash":"e8845280912ebf3779e400000000000000000000","name":"gentoo-linux-livedvd-amd64-multilib-20160704.iso"},{"size":151770333,"hash":"e8845280912ebf3779e400000000000000000000","name":"flashtool-0.9.23.0-linux.tar.7z"},{"size":2847372,"hash":"e8845280912ebf3779e400000000000000000000","name":"openwrt-ar71xx-generic-vmlinux.elf"},{"size":1310720,"hash":"e8845280912ebf3779e400000000000000000000","name":"openwrt-ar71xx-generic-vmlinux.gz"},{"size":987809,"hash":"e8845280912ebf3779e400000000000000000000","name":"openwrt-ar71xx-generic-vmlinux-lzma.elf"}]}
--------------------------------------------------------------------------------
By default JSON API methods requires client authentication and their wrappers
are automatically generated by +json-api-generator+.
In some cases methods need do be accessible without authentication such as
+rsLoginHelper/getLocations+ so in the doxygen documentaion they have the custom
command +@jsonapi{RS_VERSION,unauthenticated}+.
Other methods such as +/rsControl/rsGlobalShutDown+ need special care so they
are marked with the custom doxygen command +@jsonapi{RS_VERSION,manualwrapper}+
and their wrappers are not automatically generated but written manually into
+JsonApiServer::JsonApiServer(...)+.
== Quirks
=== 64 bits integers handling
While JSON doesn't have problems representing 64 bits integers JavaScript, Dart
and other languages are not capable to handle those numbers natively.
To overcome this limitation JSON API output 64 bit integers as an object with
two keys, one as proper integer and one as string representation.
.JSON API 64 bit integer output example
[source,json]
--------------------------------------------------------------------------------
"lobby_id": { "xint64": 6215642878098695544, "xstr64": "6215642878098695544" }
--------------------------------------------------------------------------------
So from languages that have proper 64bit integers support like Python or C++ one
better read from `xint64` which is represented as a JSON integer, from languages
where there is no proper 64bit integers support like JavaScript one can read from
`xstr64` which is represented as JSON string (note that the first is not wrapped
in "" while the latter is).
When one input a 64bit integer into the JSON API it first try to parse it as if
it was sent the old way for retrocompatibility.
.JSON API 64 bit integer deprecated format input example
[source,json]
--------------------------------------------------------------------------------
"lobby_id":6215642878098695544
--------------------------------------------------------------------------------
This way is *DEPRECATED* and may disappear in the future, it is TEMPORALLY kept
only for retrocompatibiliy with old clients.
If retrocompatible parsing attempt fail then it try to parse with the new way
with proper JSON integer format.
.JSON API 64 bit integer new proper integer format input example
[source,json]
--------------------------------------------------------------------------------
lobby_id": { "xint64": 6215642878098695544 }
--------------------------------------------------------------------------------
If this fails then it try to parse with the new way with JSON string format.
.JSON API 64 bit integer new string format input example
[source,json]
--------------------------------------------------------------------------------
"lobby_id": { "xstr64": "6215642878098695544" }
--------------------------------------------------------------------------------
[WARNING]
================================================================================
Clients written in languages without proper 64bit integers support must
use *ONLY* the string format otherwise they will send approximated values and
get unexpected results from the JSON API, because parsing will success but the
value will not be exactly the one you believe you sent.
================================================================================
== A bit of history
=== First writings about this
The previous attempt of exposing a RetroShare JSON API is called +libresapi+ and
unfortunatley it requires a bunch of boilerplate code when we want to expose
something present in the {Cxx} API in the JSON API.
As an example here you can see the libresapi that exposes part of the retroshare
chat {Cxx} API and lot of boilerplate code just to convert {Cxx} objects to JSON
https://github.com/RetroShare/RetroShare/blob/v0.6.4/libresapi/src/api/ChatHandler.cpp#L44
To avoid the {Cxx} to JSON and back conversion boilerplate code I have worked out
an extension to our {Cxx} serialization code so it is capable to serialize and
deserialize to JSON you can see it in this pull request
https://github.com/RetroShare/RetroShare/pull/1155
So first step toward having a good API is to take advantage of the fact that RS
is now capable of converting C++ objects from and to JSON.
The current API is accessible via HTTP and unix socket, there is no
authentication in both of them, so anyone having access to the HTTP server or to
the unix socket can access the API without extra restrictions.
Expecially for the HTTP API this is a big risk because also if the http server
listen on 127.0.0.1 every application on the machine (even rogue javascript
running on your web browser) can access that and for example on android it is
not safe at all (because of that I implemented the unix socket access so at
least in android API was reasonably safe) because of this.
A second step to improve the API would be to implement some kind of API
authentication mechanism (it would be nice that the mechanism is handled at API
level and not at transport level so we can use it for any API trasport not just
HTTP for example)
The HTTP server used by libresapi is libmicrohttpd server that is very minimal,
it doesn't provide HTTPS nor modern HTTP goodies, like server notifications,
websockets etc. because the lack of support we have a token polling mechanism in
libresapi to avoid polling for every thing but it is still ugly, so if we can
completely get rid of polling in the API that would be really nice.
I have done a crawl to look for a replacement and briefly looked at
- https://www.gnu.org/software/libmicrohttpd/
- http://wolkykim.github.io/libasyncd/
- https://github.com/corvusoft/restbed
- https://code.facebook.com/posts/1503205539947302/introducing-proxygen-facebook-s-c-http-framework/
- https://github.com/cmouse/yahttp
taking in account a few metrics like modern HTTP goodies support, license,
platform support, external dependencies and documentation it seemed to me that
restbed is the more appropriate.
Another source of boilerplate code into libresapi is the mapping between JSON
API requests and C++ API methods as an example you can look at this
https://github.com/RetroShare/RetroShare/blob/v0.6.4/libresapi/src/api/ChatHandler.cpp#L158
and this
https://github.com/RetroShare/RetroShare/blob/v0.6.4/libresapi/src/api/ApiServer.cpp#L253
The abstract logic of this thing is, when libreasapi get a request like
+/chat/initiate_distant_chat+ then call
+ChatHandler::handleInitiateDistantChatConnexion+ which in turn is just a
wrapper of +RsMsgs::initiateDistantChatConnexion+ all this process is basically
implemented as boilerplate code and would be unnecessary in a smarter design of
the API because almost all the information needed is already present in the
C++ API +libretroshare/src/retroshare+.
So a third step to improve the JSON API would be to remove this source of
boilerplate code by automatizing the mapping between C++ and JSON API call.
This may result a little tricky as language parsing or other adevanced things
may be required.
Hope this dive is useful for you +
Cheers +
G10h4ck
=== Second writings about this
I have been investigating a bit more about:
[verse, G10h4ck]
________________________________________________________________________________
So a third step to improve the JSON API would be to remove this source of
boilerplate code by automatizing the mapping between C++ and JSON API call
________________________________________________________________________________
After spending some hours investigating this topic the most reasonable approach
seems to:
1. Properly document headers in +libretroshare/src/retroshare/+ in doxygen syntax
specifying wihich params are input and/or output (doxygen sysntax for this is
+@param[in/out/inout]+) this will be the API documentation too.
2. At compile time use doxygen to generate XML description of the headers and use
the XML to generate the JSON api server stub.
http://www.stack.nl/~dimitri/doxygen/manual/customize.html#xmlgenerator
3. Enjoy
This directory and all it's content is kept as is only for retro-compatibility
with the old, deprecated `qmake` build system.

View File

@ -1,80 +0,0 @@
/*******************************************************************************
* RetroShare JSON API *
* *
* Copyright (C) 2018-2019 Gioacchino Mazzurco <gio@eigenlab.org> *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Affero General Public License version 3 as *
* published by the Free Software Foundation. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Affero General Public License for more details. *
* *
* You should have received a copy of the GNU Affero General Public License *
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
* *
*******************************************************************************/
registerHandler( "$%apiPath%$",
[this](const std::shared_ptr<rb::Session> session)
{
const std::multimap<std::string, std::string> headers
{
{ "Connection", "keep-alive" },
{ "Content-Type", "text/event-stream" }
};
session->yield(rb::OK, headers);
size_t reqSize = session->get_request()->get_header("Content-Length", 0);
session->fetch( reqSize, [this](
const std::shared_ptr<rb::Session> session,
const rb::Bytes& body )
{
INITIALIZE_API_CALL_JSON_CONTEXT;
if( !checkRsServicePtrReady(
$%instanceName%$, "$%instanceName%$", cAns, session ) )
return;
$%paramsDeclaration%$
$%inputParamsDeserialization%$
const std::weak_ptr<rb::Service> weakService(mService);
const std::weak_ptr<rb::Session> weakSession(session);
$%callbackName%$ = [weakService, weakSession]($%callbackParams%$)
{
auto session = weakSession.lock();
if(!session || session->is_closed()) return;
auto lService = weakService.lock();
if(!lService || lService->is_down()) return;
$%callbackParamsSerialization%$
std::stringstream sStream;
sStream << "data: " << compactJSON << ctx.mJson << "\n\n";
const std::string message = sStream.str();
lService->schedule( [weakSession, message]()
{
auto session = weakSession.lock();
if(!session || session->is_closed()) return;
session->yield(message);
$%sessionEarlyClose%$
} );
};
$%functionCall%$
$%outputParamsSerialization%$
// return them to the API caller
std::stringstream message;
message << "data: " << compactJSON << cAns.mJson << "\n\n";
session->yield(message.str());
$%sessionDelayedClose%$
} );
}, $%requiresAuth%$ );

View File

@ -0,0 +1 @@
../../libretroshare/src/jsonapi/async-method-wrapper-template.cpp.tmpl

View File

@ -1,230 +0,0 @@
DOXYFILE_ENCODING = UTF-8
PROJECT_NAME = "libretroshare"
ALIASES += jsonapi{1}="\xmlonly<jsonapi minversion=\"\1\"/>\endxmlonly"
ALIASES += jsonapi{2}="\xmlonly<jsonapi minversion=\"\1\" access=\"\2\"/>\endxmlonly"
# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the
# documentation from any documented member that it re-implements.
# The default value is: YES.
INHERIT_DOCS = YES
# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments
# according to the Markdown format, which allows for more readable
# documentation. See http://daringfireball.net/projects/markdown/ for details.
# The output of markdown processing is further processed by doxygen, so you can
# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in
# case of backward compatibilities issues.
# The default value is: YES.
MARKDOWN_SUPPORT = YES
# When enabled doxygen tries to link words that correspond to documented
# classes, or namespaces to their corresponding documentation. Such a link can
# be prevented in individual cases by putting a % sign in front of the word or
# globally by setting AUTOLINK_SUPPORT to NO.
# The default value is: YES.
AUTOLINK_SUPPORT = YES
# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in
# documentation are documented, even if no documentation was available. Private
# class members and static file members will be hidden unless the
# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES.
# Note: This will also disable the warnings about undocumented members that are
# normally produced when WARNINGS is set to YES.
# The default value is: NO.
EXTRACT_ALL = YES
# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all
# undocumented members inside documented classes or files. If set to NO these
# members will be included in the various overviews, but no documentation
# section is generated. This option has no effect if EXTRACT_ALL is enabled.
# The default value is: NO.
HIDE_UNDOC_MEMBERS = NO
# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all
# undocumented classes that are normally visible in the class hierarchy. If set
# to NO, these classes will be included in the various overviews. This option
# has no effect if EXTRACT_ALL is enabled.
# The default value is: NO.
HIDE_UNDOC_CLASSES = NO
#---------------------------------------------------------------------------
# Configuration options related to the input files
#---------------------------------------------------------------------------
# The INPUT tag is used to specify the files and/or directories that contain
# documented source files. You may enter file names like myfile.cpp or
# directories like /usr/src/myproject. Separate the files or directories with
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
# Note: If this tag is empty the current directory is searched.
#INPUT =
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
# libiconv (or the iconv built into libc) for the transcoding. See the libiconv
# documentation (see: https://www.gnu.org/software/libiconv/) for the list of
# possible encodings.
# The default value is: UTF-8.
INPUT_ENCODING = UTF-8
# If the value of the INPUT tag contains directories, you can use the
# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and
# *.h) to filter out the source-files in the directories.
#
# Note that for custom extensions or not directly supported extensions you also
# need to set EXTENSION_MAPPING for the extension otherwise the files are not
# read by doxygen.
#
# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp,
# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h,
# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc,
# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f95, *.f03, *.f08,
# *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf and *.qsf.
FILE_PATTERNS = *.c \
*.cc \
*.cxx \
*.cpp \
*.c++ \
*.java \
*.ii \
*.ixx \
*.ipp \
*.i++ \
*.inl \
*.idl \
*.ddl \
*.odl \
*.h \
*.hh \
*.hxx \
*.hpp \
*.h++ \
*.cs \
*.d \
*.php \
*.php4 \
*.php5 \
*.phtml \
*.inc \
*.m \
*.markdown \
*.md \
*.mm \
*.dox \
*.py \
*.pyw \
*.f90 \
*.f95 \
*.f03 \
*.f08 \
*.f \
*.for \
*.tcl \
*.vhd \
*.vhdl \
*.ucf \
*.qsf
# The RECURSIVE tag can be used to specify whether or not subdirectories should
# be searched for input files as well.
# The default value is: NO.
RECURSIVE = YES
# The EXCLUDE tag can be used to specify files and/or directories that should be
# excluded from the INPUT source files. This way you can easily exclude a
# subdirectory from a directory tree whose root is specified with the INPUT tag.
#
# Note that relative paths are relative to the directory from which doxygen is
# run.
EXCLUDE =
# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
# directories that are symbolic links (a Unix file system feature) are excluded
# from the input.
# The default value is: NO.
EXCLUDE_SYMLINKS = NO
# If the value of the INPUT tag contains directories, you can use the
# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
# certain files from those directories.
#
# Note that the wildcards are matched against the file with absolute path, so to
# exclude all test directories for example use the pattern */test/*
EXCLUDE_PATTERNS =
# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
# (namespaces, classes, functions, etc.) that should be excluded from the
# output. The symbol name can be a fully qualified name, a word, or if the
# wildcard * is used, a substring. Examples: ANamespace, AClass,
# AClass::ANamespace, ANamespace::*Test
#
# Note that the wildcards are matched against the file with absolute path, so to
# exclude all test directories use the pattern */test/*
EXCLUDE_SYMBOLS =
#---------------------------------------------------------------------------
# Configuration options related to the HTML output
#---------------------------------------------------------------------------
# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output
# The default value is: YES.
GENERATE_HTML = NO
# If the GENERATE_LATEX tag is set to YES, doxygen will generate LaTeX output.
# The default value is: YES.
GENERATE_LATEX = NO
# If the GENERATE_XML tag is set to YES, doxygen will generate an XML file that
# captures the structure of the code including all documentation.
# The default value is: NO.
GENERATE_XML = YES
#---------------------------------------------------------------------------
# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
# If the ENABLE_PREPROCESSING tag is set to YES, doxygen will evaluate all
# C-preprocessor directives found in the sources and include files.
# The default value is: YES.
ENABLE_PREPROCESSING = YES
# If the MACRO_EXPANSION tag is set to YES, doxygen will expand all macro names
# in the source code. If set to NO, only conditional compilation will be
# performed. Macro expansion can be done in a controlled way by setting
# EXPAND_ONLY_PREDEF to YES.
# The default value is: NO.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
MACRO_EXPANSION = NO
# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES then
# the macro expansion is limited to the macros specified with the PREDEFINED and
# EXPAND_AS_DEFINED tags.
# The default value is: NO.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
EXPAND_ONLY_PREDEF = NO

View File

@ -0,0 +1 @@
../../libretroshare/src/jsonapi/jsonapi-generator-doxygen.conf

View File

@ -1,50 +0,0 @@
/*******************************************************************************
* RetroShare JSON API *
* *
* Copyright (C) 2018-2019 Gioacchino Mazzurco <gio@eigenlab.org> *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Affero General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Affero General Public License for more details. *
* *
* You should have received a copy of the GNU Affero General Public License *
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
* *
*******************************************************************************/
registerHandler( "$%apiPath%$",
[](const std::shared_ptr<rb::Session> session)
{
size_t reqSize = session->get_request()->get_header("Content-Length", 0);
session->fetch( reqSize, [](
const std::shared_ptr<rb::Session> session,
const rb::Bytes& body )
{
INITIALIZE_API_CALL_JSON_CONTEXT;
if( !checkRsServicePtrReady(
$%instanceName%$, "$%instanceName%$", cAns, session ) )
return;
$%paramsDeclaration%$
// deserialize input parameters from JSON
$%inputParamsDeserialization%$
// call retroshare C++ API
$%functionCall%$
// serialize out parameters and return value to JSON
$%outputParamsSerialization%$
// return them to the API caller
DEFAULT_API_CALL_JSON_RETURN(rb::OK);
} );
}, $%requiresAuth%$ );

View File

@ -0,0 +1 @@
../../libretroshare/src/jsonapi/method-wrapper-template.cpp.tmpl

1
libbitdht Submodule

@ -0,0 +1 @@
Subproject commit 2ddc86fb575a61170f4c06a00152e3e7dc74c8f4

View File

@ -1,25 +0,0 @@
# SPDX-FileCopyrightText: (C) 2004-2019 Retroshare Team <contact@retroshare.cc>
# SPDX-License-Identifier: CC0-1.0
What's in the Package
---------------------------------------------------------------
bitdht - base BitDHT Code.
util - generic utils for networking and threading.
udp - UDP interfacing code.
lib - Where the library is created.
tests - basic unit tests.
example - example code of how to use libbitdht.
libbitdht.pro - build script for Qt's qmake.
README.txt - this file.
HOWTO libbitdht.
----------------------------------------------
This version is build using Qt's qmake system.
1) Install Qt's qmake system: libqt-dev
2) type ./qmake
3) type ./make
4) check out the example and tests to learn how to interface with libbitdht.

View File

@ -1,133 +0,0 @@
/*******************************************************************************
* bitdht/bdaccount.cc *
* *
* BitDHT: An Flexible DHT library. *
* *
* Copyright 2011 by Robert Fernie <bitdht@lunamutt.com> *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Affero General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Affero General Public License for more details. *
* *
* You should have received a copy of the GNU Affero General Public License *
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
* *
*******************************************************************************/
#include "bitdht/bdaccount.h"
#include <string.h>
#include <stdlib.h>
#include <iostream>
#include <iomanip>
#define LPF_FACTOR (0.90)
bdAccount::bdAccount()
:mNoStats(BDACCOUNT_NUM_ENTRIES),
mCountersOut(BDACCOUNT_NUM_ENTRIES), mCountersRecv(BDACCOUNT_NUM_ENTRIES),
mLpfOut(BDACCOUNT_NUM_ENTRIES), mLpfRecv(BDACCOUNT_NUM_ENTRIES),
mLabel(BDACCOUNT_NUM_ENTRIES)
{
mLabel[BDACCOUNT_MSG_OUTOFDATEPING] = "OUTOFDATEPING ";
mLabel[BDACCOUNT_MSG_PING] = "PING ";
mLabel[BDACCOUNT_MSG_PONG] = "PONG ";
mLabel[BDACCOUNT_MSG_QUERYNODE] = "QUERYNODE ";
mLabel[BDACCOUNT_MSG_QUERYHASH] = "QUERYHASH ";
mLabel[BDACCOUNT_MSG_REPLYFINDNODE] = "REPLYFINDNODE ";
mLabel[BDACCOUNT_MSG_REPLYQUERYHASH] = "REPLYQUERYHASH ";
mLabel[BDACCOUNT_MSG_POSTHASH] = "POSTHASH ";
mLabel[BDACCOUNT_MSG_REPLYPOSTHASH] = "REPLYPOSTHASH ";
mLabel[BDACCOUNT_MSG_CONNECTREQUEST] = "CONNECTREQUEST ";
mLabel[BDACCOUNT_MSG_CONNECTREPLY] = "CONNECTREPLY ";
mLabel[BDACCOUNT_MSG_CONNECTSTART] = "CONNECTSTART ";
mLabel[BDACCOUNT_MSG_CONNECTACK] = "CONNECTACK ";
resetStats();
}
void bdAccount::incCounter(uint32_t idx, bool out)
{
if ((signed) idx > mNoStats-1)
{
std::cerr << "bdAccount::incCounter() Invalid Index";
std::cerr << std::endl;
}
if (out)
{
mCountersOut[idx]++;
}
else
{
mCountersRecv[idx]++;
}
return;
}
void bdAccount::doStats()
{
int i;
for(i = 0; i < mNoStats; i++)
{
mLpfOut[i] *= (LPF_FACTOR) ;
mLpfOut[i] += (1.0 - LPF_FACTOR) * mCountersOut[i];
mLpfRecv[i] *= (LPF_FACTOR) ;
mLpfRecv[i] += (1.0 - LPF_FACTOR) * mCountersRecv[i];
}
resetCounters();
}
void bdAccount::printStats(std::ostream &out)
{
int i;
out << " Send Recv: ";
out << std::endl;
for(i = 0; i < mNoStats; i++)
{
out << "Send" << mLabel[i] << " : " << std::setw(10) << mLpfOut[i];
out << " ";
out << "Recv" << mLabel[i] << " : " << std::setw(10) << mLpfRecv[i];
out << std::endl;
}
}
void bdAccount::resetCounters()
{
int i;
for(i = 0; i < mNoStats; i++)
{
mCountersOut[i] = 0;
mCountersRecv[i] = 0;
}
}
void bdAccount::resetStats()
{
int i;
for(i = 0; i < mNoStats; i++)
{
mLpfOut[i] = 0;
mLpfRecv[i] = 0;
}
resetCounters();
}

View File

@ -1,76 +0,0 @@
#ifndef BITDHT_ACCOUNT_H
#define BITDHT_ACCOUNT_H
/*******************************************************************************
* bitdht/bdaccount.h *
* *
* BitDHT: An Flexible DHT library. *
* *
* Copyright 2011 by Robert Fernie <bitdht@lunamutt.com> *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Affero General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Affero General Public License for more details. *
* *
* You should have received a copy of the GNU Affero General Public License *
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
* *
*******************************************************************************/
#include <vector>
#include <string>
#include <inttypes.h>
#define BDACCOUNT_MSG_OUTOFDATEPING 0
#define BDACCOUNT_MSG_PING 1
#define BDACCOUNT_MSG_PONG 2
#define BDACCOUNT_MSG_QUERYNODE 3
#define BDACCOUNT_MSG_QUERYHASH 4
#define BDACCOUNT_MSG_REPLYFINDNODE 5
#define BDACCOUNT_MSG_REPLYQUERYHASH 6
#define BDACCOUNT_MSG_POSTHASH 7
#define BDACCOUNT_MSG_REPLYPOSTHASH 8
#define BDACCOUNT_MSG_CONNECTREQUEST 9
#define BDACCOUNT_MSG_CONNECTREPLY 10
#define BDACCOUNT_MSG_CONNECTSTART 11
#define BDACCOUNT_MSG_CONNECTACK 12
#define BDACCOUNT_NUM_ENTRIES 13
class bdAccount
{
public:
bdAccount();
void incCounter(uint32_t idx, bool out);
void doStats();
void printStats(std::ostream &out);
void resetCounters();
void resetStats();
private:
int mNoStats;
std::vector<double> mCountersOut;
std::vector<double> mCountersRecv;
std::vector<double> mLpfOut;
std::vector<double> mLpfRecv;
std::vector<std::string> mLabel;
// Statistics.
};
#endif // BITDHT_ACCOUNT_H

View File

@ -1,267 +0,0 @@
1.162.168.21 8956
2.6.224.136 17320
5.116.142.222 13755
5.189.185.57 6968
5.202.101.3 4000
5.227.124.122 1024
5.227.124.122 20600
5.227.124.122 64196
5.39.94.218 6991
5.79.102.9 6881
5.89.120.163 2457
14.117.182.22 1091
14.8.109.32 17160
23.115.236.180 42375
24.153.98.173 1024
24.38.199.13 10583
27.150.87.242 1123
27.151.179.38 51413
27.152.212.182 1424
31.24.186.40 16143
31.36.78.93 30020
31.44.90.218 51413
37.120.213.132 19525
37.14.113.18 3815
37.146.76.158 51413
37.187.105.230 5169
37.232.184.93 6881
37.46.150.58 51413
39.111.152.200 17527
39.154.68.57 28007
42.200.116.4 18578
42.3.188.207 19771
45.176.111.21 1434
45.32.43.51 49091
45.76.218.165 52911
45.77.214.200 44350
46.172.86.23 46039
46.223.161.46 23693
46.237.96.68 16536
46.52.174.214 24012
46.7.227.47 27644
46.7.9.41 21374
49.64.73.215 51413
49.74.50.28 60893
49.75.73.147 51413
49.79.26.15 51413
49.83.226.50 20864
49.83.241.222 51413
52.9.197.152 6881
58.209.188.12 20994
59.149.118.196 51413
59.2.250.243 57099
59.6.53.18 57437
60.104.89.4 51413
60.124.114.239 16925
60.178.44.27 1050
60.99.229.14 20617
61.223.34.21 17881
61.227.127.222 22223
61.239.28.169 18873
62.210.82.193 51413
64.191.5.92 56891
65.92.141.96 58361
67.215.246.10 6881
68.151.213.83 20047
69.40.178.254 50793
71.34.2.150 8053
72.95.247.56 12956
73.157.77.166 5477
74.109.243.24 7250
74.140.153.59 24757
74.72.13.99 9613
76.29.106.98 41447
77.202.207.190 33034
77.21.64.116 22222
77.245.14.94 9910
78.131.78.35 51238
78.158.1.15 7433
78.231.125.98 12162
78.242.250.55 55946
79.164.245.5 49001
80.147.23.201 32746
80.200.171.90 16294
80.99.222.34 51414
81.171.17.30 42254
82.221.103.244 6881
82.235.78.193 44097
82.244.32.78 43518
82.64.181.170 38240
82.64.249.25 51413
82.64.44.119 51413
82.65.164.218 15726
82.65.68.9 51413
82.77.146.109 53713
83.46.92.34 50000
84.195.46.218 54600
84.40.106.115 12046
85.149.0.42 21045
86.121.194.1 51413
86.98.50.30 21455
87.123.166.45 4145
87.169.199.211 10496
88.7.217.202 31348
88.99.25.154 38051
89.135.26.33 51413
89.17.134.184 10327
89.245.86.20 32417
89.253.118.133 8621
90.101.94.104 20780
90.151.95.110 2199
90.219.241.30 51413
90.219.8.170 11916
91.121.136.132 59001
91.123.72.241 49001
91.142.65.40 51413
91.173.208.204 16300
91.211.245.40 7369
91.92.194.144 1031
91.98.96.76 5385
92.244.238.115 3115
92.97.68.210 58000
93.100.182.236 32249
93.11.175.113 22948
93.115.202.240 64493
93.152.132.9 12332
94.154.81.100 12345
94.222.188.14 29299
95.211.117.105 62086
95.219.143.102 10360
95.222.119.133 43087
95.42.138.33 16550
96.39.191.231 52000
99.192.24.198 52552
103.226.250.79 3521
103.82.242.163 8083
104.156.238.118 34731
104.237.149.26 64879
107.155.5.39 6881
109.129.202.63 11076
109.148.168.121 21651
109.24.244.111 33334
110.81.114.66 24732
111.175.84.3 6881
111.216.9.68 13493
113.105.18.227 16001
113.194.69.53 53858
113.219.200.7 12935
113.252.78.238 23474
113.68.239.87 6396
113.69.96.171 51443
114.188.193.161 22555
114.231.190.193 51413
114.232.201.253 30350
114.32.153.245 26233
114.32.1.94 7788
114.38.137.40 24062
114.75.44.238 6881
115.133.66.181 9460
115.205.157.105 51413
116.1.193.182 51413
117.247.200.35 5353
117.60.240.145 35709
117.60.62.8 51413
117.93.101.232 51413
118.123.245.182 5060
119.177.21.161 27048
119.64.245.112 56265
121.171.118.184 11566
121.178.169.67 49259
121.234.117.237 15398
122.116.102.22 14054
123.202.146.112 23118
123.217.135.139 7830
128.68.229.32 51413
134.209.114.242 8000
139.28.218.4 34826
142.113.115.71 26453
148.251.68.55 50000
148.70.53.219 2551
150.117.108.250 21902
150.117.44.190 25052
151.224.15.227 51413
157.157.157.41 51413
161.97.102.243 51902
162.208.6.211 51413
167.179.83.227 60220
168.70.68.30 18325
169.0.60.179 64494
171.5.165.129 6881
172.104.76.77 60542
172.104.93.28 35617
172.98.144.81 19186
173.176.138.246 9545
173.199.70.134 39045
173.212.205.73 51432
173.212.219.143 6881
174.89.174.228 51413
175.197.1.120 52574
176.9.8.143 58250
178.118.86.145 51413
178.162.139.87 10029
178.32.220.92 6881
178.67.121.182 49001
182.138.217.58 6881
182.138.90.72 50288
182.139.213.160 39587
183.131.239.178 57835
183.22.252.15 21568
185.126.33.59 50024
185.156.175.187 1025
185.157.221.247 25401
185.252.60.243 49001
185.45.195.156 28074
185.45.195.181 28185
185.45.195.190 28136
185.61.148.114 64879
188.133.192.123 19967
188.235.1.208 7890
188.240.208.187 51413
192.181.103.63 19627
192.241.151.29 6881
193.242.205.145 49001
193.77.153.124 59835
194.176.114.54 51413
194.35.233.206 20124
195.154.172.169 36097
195.154.172.169 38340
195.154.172.169 48043
195.154.172.169 48799
195.154.179.2 22794
195.154.179.2 41210
195.154.179.2 42687
195.154.179.2 49156
195.154.179.2 50385
195.154.179.2 50944
195.154.181.225 37558
195.191.246.240 1026
196.191.92.25 22937
197.157.219.137 22629
197.61.66.105 24612
198.13.48.70 37360
199.254.238.193 15374
200.63.107.82 13323
201.241.63.68 38705
203.130.242.178 28280
203.213.61.76 50559
207.154.222.13 51111
210.195.211.60 49771
210.6.145.50 15207
212.102.42.202 7611
212.129.19.188 27096
212.129.19.188 29812
212.129.19.188 50117
212.129.19.188 51965
212.129.33.59 6881
212.32.231.67 51413
212.86.51.7 65148
213.136.79.7 11910
218.161.100.192 51413
218.219.199.148 18753
220.189.94.56 13279
222.211.148.83 8080
222.77.110.143 46016
223.116.81.154 10655
223.16.153.107 51413
223.26.31.77 21440
223.65.101.235 25159

View File

@ -1,55 +0,0 @@
#!/bin/bash
<<LICENSE
Copyright (C) 2020 Gioacchino Mazzurco <gio@eigenlab.org>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
LICENSE
<<README
Generate a clean DHT bootstrap node list.
Feeds on previously known nodes from standard input and a few well known
mainline DHT bootstrap nodes. Prints only nodes that appears to be active to a
quick nmap check. Make sure your internet connection is working well before
using this.
Example usage:
--------------------------------
cat bdboot.txt | bdboot_generate.sh | tee /tmp/bdboot_generated.txt
cat /tmp/bdboot_generated.txt | sort -u > bdboot.txt
--------------------------------
README
function check_dht_host()
{
mHost="$1"
mPort="$2"
sudo nmap -oG - -sU -p $mPort $mHost | grep open | \
awk '{print $2" "$5}' | awk -F/ '{print $1}'
}
cat | while read line; do
hostIP="$(echo $line | awk '{print $1}')"
hostPort="$(echo $line | awk '{print $2}')"
check_dht_host $hostIP $hostPort
done
check_dht_host router.utorrent.com 6881
check_dht_host router.bittorrent.com 6881
check_dht_host dht.libtorrent.org 25401
check_dht_host dht.transmissionbt.com 6881

File diff suppressed because it is too large Load Diff

View File

@ -1,314 +0,0 @@
/*******************************************************************************
* bitdht/bdconnection.h *
* *
* BitDHT: An Flexible DHT library. *
* *
* Copyright 2011 by Robert Fernie <bitdht@lunamutt.com> *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Affero General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Affero General Public License for more details. *
* *
* You should have received a copy of the GNU Affero General Public License *
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
* *
*******************************************************************************/
#ifndef BITDHT_CONNECTION_H
#define BITDHT_CONNECTION_H
#include "bitdht/bdiface.h"
class bdQueryManager;
class bdNodePublisher;
/************************************************************************************************************
************************************** ProxyTuple + Connection State ****************************************
************************************************************************************************************/
#define BITDHT_CONNREQUEST_READY 1
#define BITDHT_CONNREQUEST_PAUSED 2
#define BITDHT_CONNREQUEST_INPROGRESS 3
#define BITDHT_CONNREQUEST_EXTCONNECT 4
#define BITDHT_CONNREQUEST_DONE 5
#define BITDHT_CONNREQUEST_TIMEOUT_CONNECT 300 // MAKE THIS LARGE - SHOULD NEVER HAPPEN.
#define BITDHT_CONNREQUEST_TIMEOUT_INPROGRESS 30
#define BITDHT_CONNREQUEST_MAX_AGE 60
#define BITDHT_CONNECTION_WAITING_AUTH 1
#define BITDHT_CONNECTION_WAITING_REPLY 2
#define BITDHT_CONNECTION_WAITING_START 3
#define BITDHT_CONNECTION_WAITING_ACK 4
#define BITDHT_CONNECTION_COMPLETED 5
#define BD_CONNECTION_START_RETRY_PERIOD 3 // Should only take a couple of seconds to get reply.
#define BD_CONNECTION_START_MAX_RETRY 3
#define BD_CONNECTION_MAX_TIMEOUT 20 /* should be quick */
class bdProxyTuple
{
public:
bdProxyTuple() { return; }
bdProxyTuple(bdNodeId *s, bdNodeId *p, bdNodeId *d)
:srcId(*s), proxyId(*p), destId(*d) { return; }
bdNodeId srcId;
bdNodeId proxyId;
bdNodeId destId;
};
std::ostream &operator<<(std::ostream &out, const bdProxyTuple &t);
int operator<(const bdProxyTuple &a, const bdProxyTuple &b);
int operator==(const bdProxyTuple &a, const bdProxyTuple &b);
class bdConnection
{
public:
bdConnection();
/** Functions to tweak the connection status */
// User initialised Connection.
int ConnectionSetup(bdId *proxyId, bdId *srcConnAddr, bdId *destConnAddr, int mode, int delay);
int ConnectionSetupDirect(bdId *destId, bdId *srcConnAddr);
// Initialise a new Connection. (receiving a Connection Request)
int ConnectionRequestDirect(bdId *id, bdId *srcConnAddr, bdId *destConnAddr);
int ConnectionRequestProxy(bdId *id, bdId *srcConnAddr, bdNodeId *ownId, bdId *destConnAddr, int mode, int delay);
int ConnectionRequestEnd(bdId *id, bdId *srcConnAddr, bdId *destConnAddr, int mode);
// Setup Finishing Stage, (receiving a Connection Reply).
int upgradeProxyConnectionToFinish(bdId *id, bdId *srcConnAddr, bdId *destConnAddr, int mode, int delay, int status);
int AuthoriseDirectConnection(bdId *srcId, bdId *proxyId, bdId *destId, int mode, int loc);
int AuthoriseProxyConnection(bdId *srcId, bdId *proxyId, bdId *destId, int mode, int loc, int bandwidth);
int AuthoriseEndConnection(bdId *srcId, bdId *proxyId, bdId *destId, int mode, int loc, int delay);
int CompleteConnection(bdId *id, bdId *srcConnAddr, bdId *destConnAddr, int bandwidth, int delay);
int checkForDefaultConnectAddress();
/* Connection State, and TimeStamp of Update */
int mState;
time_t mLastEvent;
/* Addresses of Start/Proxy/End Nodes */
bdId mSrcId;
bdId mDestId;
bdId mProxyId;
/* Where we are in the connection,
* and what connection mode.
*/
int mPoint;
int mMode;
/* must have ip:ports of connection ends (if proxied) */
bdId mSrcConnAddr;
bdId mDestConnAddr;
int mBandwidth;
int mMaxDelay;
time_t mConnectionStartTS;
/* START/ACK Finishing ****/
time_t mLastStart; /* timer for retries */
int mRetryCount; /* retry counter */
bool mSrcAck;
bool mDestAck;
// Completion TS.
time_t mCompletedTS;
};
#define BD_PI_SRC_UNKNOWN 0
#define BD_PI_SRC_QUERYRESULT 1
#define BD_PI_SRC_QUERYPROXY 2
#define BD_PI_SRC_NODESPACE_FRIEND 3
#define BD_PI_SRC_NODESPACE_SERVER 4
#define BD_PI_SRC_NODESPACE_ENGINEVERSION 5
#define BD_PI_SRC_ADDGOODPROXY 6
class bdProxyId
{
public:
bdProxyId(const bdId &in_id, uint32_t in_srctype, uint32_t in_errcode)
:id(in_id), srcType(in_srctype), errcode(in_errcode) { return; }
bdProxyId() :srcType(BD_PI_SRC_UNKNOWN), errcode(0) { return; }
std::string proxySrcType() const;
bdId id;
uint32_t srcType;
uint32_t errcode;
};
class bdConnectionRequest
{
public:
bdConnectionRequest() : mMode(0), mState(0), mStateTS(0), mPauseTS(0), mErrCode(0), mDelay(0), mRequestTS(0), mRecycled(0), mCurrentSrcType(0)
{
bdsockaddr_clear(&mLocalAddr);
}
public:
int setupDirectConnection(struct sockaddr_in *laddr, bdNodeId *target);
int setupProxyConnection(struct sockaddr_in *laddr, bdNodeId *target, uint32_t mode, uint32_t delay);
int addGoodProxy(const bdId *srcId);
int checkGoodProxyPeer(const bdId *Id);
bdNodeId mTarget;
struct sockaddr_in mLocalAddr;
int mMode;
int mState;
time_t mStateTS;
time_t mPauseTS;
uint32_t mErrCode;
int mDelay;
time_t mRequestTS; // reference Time for mDelay.
std::list<bdProxyId> mGoodProxies;
std::list<bdId> mPotentialProxies;
//std::list<bdId> mGoodProxies;
int mRecycled;
bdId mCurrentAttempt;
uint32_t mCurrentSrcType;
std::list<bdProxyId> mPeersTried;
//std::list<bdId> mPeersTried;
};
std::ostream &operator<<(std::ostream &out, const bdConnectionRequest &req);
std::ostream &operator<<(std::ostream &out, const bdConnection &conn);
/*********
* The Connection Management Class.
* this encapsulates all of the functionality..
* except for a couple of message in/outs + callback.
*/
class bdConnectManager
{
public:
bdConnectManager(bdNodeId *ownid, bdSpace *space, bdQueryManager *qmgr, bdDhtFunctions *fns, bdNodePublisher *pub);
/* connection functions */
void requestConnection(bdNodeId *id, uint32_t modes);
void allowConnection(bdNodeId *id, uint32_t modes);
/* high level */
void shutdownConnections();
void printConnections();
/* Connections: Configuration */
void defaultConnectionOptions();
virtual void setConnectionOptions(uint32_t allowedModes, uint32_t flags);
/* Connections: Initiation */
int requestConnection(struct sockaddr_in *laddr, bdNodeId *target, uint32_t mode, uint32_t delay, uint32_t start);
int requestConnection_direct(struct sockaddr_in *laddr, bdNodeId *target);
int requestConnection_proxy(struct sockaddr_in *laddr, bdNodeId *target, uint32_t mode, uint32_t delay);
int killConnectionRequest(struct sockaddr_in *laddr, bdNodeId *target, uint32_t mode);
int checkExistingConnectionAttempt(bdNodeId *target);
void addPotentialConnectionProxy(const bdId *srcId, const bdId *target);
void updatePotentialConnectionProxy(const bdId *id, uint32_t mode);
int checkPeerForFlag(const bdId *id, uint32_t with_flag);
int tickConnections();
void iterateConnectionRequests();
int startConnectionAttempt(bdConnectionRequest *req);
// internal Callback -> normally continues to callbackConnect().
void callbackConnectRequest(bdId *srcId, bdId *proxyId, bdId *destId,
int mode, int point, int param, int cbtype, int errcode);
/* Connections: Outgoing */
int startConnectionAttempt(bdId *proxyId, bdId *srcConnAddr, bdId *destConnAddr, int mode, int delay);
void AuthConnectionOk(bdId *srcId, bdId *proxyId, bdId *destId, int mode, int loc, int bandwidth, int delay);
void AuthConnectionNo(bdId *srcId, bdId *proxyId, bdId *destId, int mode, int loc, int errcode);
void iterateConnections();
/* Connections: Utility State */
bdConnection *findExistingConnection(bdNodeId *srcId, bdNodeId *proxyId, bdNodeId *destId);
bdConnection *newConnection(bdNodeId *srcId, bdNodeId *proxyId, bdNodeId *destId);
int cleanConnection(bdNodeId *srcId, bdNodeId *proxyId, bdNodeId *destId);
int determinePosition(bdNodeId *sender, bdNodeId *src, bdNodeId *dest);
int determineProxyId(bdNodeId *sender, bdNodeId *src, bdNodeId *dest, bdNodeId *proxyId);
bdConnection *findSimilarConnection(bdNodeId *srcId, bdNodeId *destId);
bdConnection *findExistingConnectionBySender(bdId *sender, bdId *src, bdId *dest);
bdConnection *newConnectionBySender(bdId *sender, bdId *src, bdId *dest);
int cleanConnectionBySender(bdId *sender, bdId *src, bdId *dest);
// Overloaded Generalised Connection Callback.
virtual void callbackConnect(bdId *srcId, bdId *proxyId, bdId *destId,
int mode, int point, int param, int cbtype, int errcode);
/* Connections: */
int recvedConnectionRequest(bdId *id, bdId *srcConnAddr, bdId *destConnAddr, int mode, int delay);
int recvedConnectionReply(bdId *id, bdId *srcConnAddr, bdId *destConnAddr, int mode, int delay, int status);
int recvedConnectionStart(bdId *id, bdId *srcConnAddr, bdId *destConnAddr, int mode, int delayOrBandwidth);
int recvedConnectionAck(bdId *id, bdId *srcConnAddr, bdId *destConnAddr, int mode);
/* setup Relay Mode */
void setRelayMode(uint32_t mode);
private:
std::map<bdProxyTuple, bdConnection> mConnections;
std::map<bdNodeId, bdConnectionRequest> mConnectionRequests;
uint32_t mConfigAllowedModes;
bool mConfigAutoProxy;
uint32_t mRelayMode;
/****************************** Connection Code (in bdconnection.cc) ****************************/
private:
bdNodeId mOwnId;
bdSpace *mNodeSpace;
bdQueryManager *mQueryMgr;
bdDhtFunctions *mFns;
bdNodePublisher *mPub;
};
#endif // BITDHT_CONNECTION_H

View File

@ -1,318 +0,0 @@
/*******************************************************************************
* bitdht/bdfilter.cc *
* *
* BitDHT: An Flexible DHT library. *
* *
* Copyright 2010 by Robert Fernie <bitdht@lunamutt.com> *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Affero General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Affero General Public License for more details. *
* *
* You should have received a copy of the GNU Affero General Public License *
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
* *
*******************************************************************************/
#include "bitdht/bdfilter.h"
#include "bitdht/bdmanager.h"
#include "util/bdfile.h"
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <iostream>
#include <time.h>
/**
* #define DEBUG_FILTER 1
**/
#define BDFILTER_ENTRY_DROP_PERIOD (7 * 24 * 3600)
bdFilter::bdFilter(const std::string &fname, const bdNodeId *ownid, uint32_t filterFlags, bdDhtFunctions *fns, bdNodeManager *manager)
{
/* */
mOwnId = *ownid;
mFns = fns;
mFilename = fname ;
loadBannedIpFile() ;
mFilterFlags = filterFlags;
mNodeManager = manager;
}
void bdFilter::writeBannedIpFile()
{
std::string filetmp = mFilename + ".tmp" ;
FILE *fd = fopen(filetmp.c_str(), "w");
if (!fd)
{
std::cerr << "(EE) bdFilter::writeBannedIpFile() FAILED to Open File " << mFilename << std::endl;
return;
}
for( std::map<uint32_t,bdFilteredPeer>::iterator it=mFiltered.begin();it!=mFiltered.end();++it)
{
fprintf(fd, "%s %u %lu %lu\n", bdnet_inet_ntoa(it->second.mAddr.sin_addr).c_str(), it->second.mFilterFlags, it->second.mFilterTS, it->second.mLastSeen) ;
#ifdef DEBUG_FILTER
fprintf(stderr, "Storing Peer Address: %s \n", bdnet_inet_ntoa(it->second.mAddr.sin_addr).c_str()) ;
#endif
}
fclose(fd);
if(!bdFile::renameFile(filetmp,mFilename))
std::cerr << "Could not rename file !!" << std::endl;
#ifdef DEBUG_FILTER
else
std::cerr << "Successfully renamed file " << filetmp << " to " << mFilename << std::endl;
#endif
}
void bdFilter::loadBannedIpFile()
{
char line[10240];
char addr_str[10240];
struct sockaddr_in addr;
memset(&addr, 0, sizeof(struct sockaddr_in));
addr.sin_family = PF_INET;
FILE *fd = fopen(mFilename.c_str(),"r") ;
if(fd == NULL)
{
std::cerr << "(EE) Cannot load filter file " << mFilename << std::endl;
return ;
}
while(line == fgets(line, 10240, fd))
{
uint32_t filter_flags ;
unsigned long long int filter_ts ;
unsigned long long int last_seen ;
if (4 == sscanf(line, "%s %u %llu %llu", addr_str, &filter_flags,&filter_ts,&last_seen))
{
if (bdnet_inet_aton(addr_str, &(addr.sin_addr)))
{
addr.sin_port = 0;
bdFilteredPeer peer;
peer.mAddr = addr;
peer.mFilterTS = filter_ts;
peer.mLastSeen = last_seen;
peer.mFilterFlags = filter_flags;
mFiltered[addr.sin_addr.s_addr] = peer ;
#ifdef DEBUG_FILTER
std::cerr << "Loaded filtered IP: " << std::string(addr_str) << " last seen: " << last_seen << ", TS=" << filter_ts << std::endl;
#endif
}
}
}
fclose(fd);
}
//bool bdFilter::filtered(std::list<bdFilteredPeer> &answer)
//{
// answer = mFiltered;
// return (answer.size() > 0);
//}
bool bdFilter::filteredIPs(std::list<struct sockaddr_in> &answer)
{
std::map<uint32_t,bdFilteredPeer>::iterator it;
for(it = mFiltered.begin(); it != mFiltered.end(); it++)
{
answer.push_back(it->second.mAddr);
}
return (answer.size() > 0);
}
int bdFilter::checkPeer(const bdId *id, uint32_t mode)
{
bool add = false;
uint32_t flags = 0;
if ((mFilterFlags & BITDHT_FILTER_REASON_OWNID) &&
isOwnIdWithoutBitDhtFlags(id, mode))
{
add = true;
flags |= BITDHT_FILTER_REASON_OWNID;
}
if (add)
{
bool isNew = addPeerToFilter(id->addr, flags);
if (isNew)
{
return 1;
}
}
return 0;
}
int bdFilter::addPeerToFilter(const struct sockaddr_in& addr, uint32_t flags)
{
std::map<uint32_t,bdFilteredPeer>::iterator it = mFiltered.find(addr.sin_addr.s_addr) ;
if(it != mFiltered.end())
{
it->second.mLastSeen = time(NULL);
it->second.mFilterFlags |= flags;
}
else
{
time_t now = time(NULL);
bdFilteredPeer fp;
fp.mAddr = addr;
fp.mAddr.sin_port = 0;
fp.mFilterFlags = flags;
fp.mFilterTS = now;
fp.mLastSeen = now;
uint32_t saddr = addr.sin_addr.s_addr;
mFiltered[saddr] = fp;
std::cerr << "Adding New Banned Ip Address: " << bdnet_inet_ntoa(addr.sin_addr);
std::cerr << std::endl;
}
writeBannedIpFile() ;
return true;
}
// void bdFilter::loadFilteredPeers(const std::list<bdFilteredPeer>& peers)
// {
// for(std::list<bdFilteredPeer>::iterator it = peers.begin(); it != peers.end();++it)
// {
// #ifdef DEBUG_FILTER
// std::cerr << "Loading filtered peer " << inet_ntoa(it->mAddr.sin_addr) << " Flags: " << it->mFilterFlags << " FilterTS: "
// << now - it->mFilterTS << " LastSeen: " << now - it->mLastSeen << std::endl;
// #endif
// uint32_t saddr = it->mAddr.sin_addr.s_addr;
// mFiltered[saddr] = *it ;
// }
// }
void bdFilter::getFilteredPeers(std::list<bdFilteredPeer>& peers)
{
for(std::map<uint32_t,bdFilteredPeer>::iterator it = mFiltered.begin(); it != mFiltered.end();++it)
peers.push_back(it->second) ;
}
/* fast check if the addr is in the structure */
int bdFilter::addrOkay(struct sockaddr_in *addr)
{
// first check upper layer
bool isAvailable, isBanned;
mNodeManager->doIsBannedCallback(addr, &isAvailable, &isBanned);
if(isAvailable) {
#ifdef DEBUG_FILTER
std::cerr << "bdFilter::addrOkay addr: " << inet_ntoa(addr->sin_addr) << " result from upper layer: " << (isBanned ? "banned" : "ok") << std::endl;
#endif
return !isBanned;
} else {
// fallback to own ban list
std::map<uint32_t,bdFilteredPeer>::const_iterator it = mFiltered.find(addr->sin_addr.s_addr);
if (it == mFiltered.end())
return 1; // Address is Okay
}
#ifdef DEBUG_FILTER
std::cerr << "Detected Packet From Banned Ip Address: " << inet_ntoa(addr->sin_addr);
std::cerr << std::endl;
#endif
return 0;
}
bool bdFilter::isOwnIdWithoutBitDhtFlags(const bdId *id, uint32_t peerFlags)
{
if (peerFlags & BITDHT_PEER_STATUS_RECV_PONG)
{
if (peerFlags & BITDHT_PEER_STATUS_DHT_ENGINE)
{
/* okay! */
return false;
}
/* now check distance */
bdMetric dist;
mFns->bdDistance(&mOwnId, &(id->id), &dist);
int bucket = mFns->bdBucketDistance(&dist);
/* if they match us... kill it */
if (bucket == 0)
{
return true;
}
}
return false;
}
/* periodically we want to cleanup the filter....
* if we haven't had an IP address reported as filtered for several hours.
* remove it from the list.
*/
bool bdFilter::cleanupFilter()
{
#ifdef DEBUG_FILTER
std::cerr << "bdFilter: Checking current filter List:" << std::endl;
#endif
time_t now = time(NULL);
time_t dropTime = now - BDFILTER_ENTRY_DROP_PERIOD;
for(std::map<uint32_t,bdFilteredPeer>::iterator it = mFiltered.begin(); it != mFiltered.end();)
{
#ifdef DEBUG_FILTER
std::cerr << "\t" << bdnet_inet_ntoa(it->second.mAddr.sin_addr);
std::cerr << " Flags: " << it->second.mFilterFlags;
std::cerr << " FilterTS: " << now - it->second.mFilterTS;
std::cerr << " LastSeen: " << now - it->second.mLastSeen;
#endif
if (it->second.mLastSeen < dropTime)
{
/* remove from filter */
#ifdef DEBUG_FILTER
std::cerr << " OLD DROPPING" << std::endl;
#endif
std::map<uint32_t,bdFilteredPeer>::iterator tmp(it) ;
++tmp ;
mFiltered.erase(it);
it = tmp ;
}
else
{
#ifdef DEBUG_FILTER
std::cerr << " OK" << std::endl;
#endif
it++;
}
}
return true;
}

View File

@ -1,84 +0,0 @@
/*******************************************************************************
* bitdht/bdfilter.h *
* *
* BitDHT: An Flexible DHT library. *
* *
* Copyright 2010 by Robert Fernie <bitdht@lunamutt.com> *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Affero General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Affero General Public License for more details. *
* *
* You should have received a copy of the GNU Affero General Public License *
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
* *
*******************************************************************************/
#ifndef BITDHT_FILTER_H
#define BITDHT_FILTER_H
#include "bitdht/bdiface.h"
#include <set>
/* Query result flags are in bdiface.h */
#define BITDHT_FILTER_REASON_OWNID 0x0001
class bdFilteredPeer
{
public:
struct sockaddr_in mAddr;
uint32_t mFilterFlags; /* reasons why we are filtering */
time_t mFilterTS;
time_t mLastSeen;
};
class bdNodeManager;
class bdFilter
{
public:
bdFilter(const std::string& fname, const bdNodeId *ownid, uint32_t filterFlags, bdDhtFunctions *fns, bdNodeManager *manager);
// get the answer.
//bool filtered(std::list<bdFilteredPeer> &answer);
bool filteredIPs(std::list<struct sockaddr_in> &answer);
//void loadFilteredPeers(const std::list<bdFilteredPeer>& peers) ;
void getFilteredPeers(std::list<bdFilteredPeer> &peers);
int checkPeer(const bdId *id, uint32_t peerFlags);
int addrOkay(struct sockaddr_in *addr);
int addPeerToFilter(const struct sockaddr_in &addr, uint32_t flags);
bool cleanupFilter();
void loadBannedIpFile() ;
void writeBannedIpFile() ;
private:
bool isOwnIdWithoutBitDhtFlags(const bdId *id, uint32_t peerFlags);
// searching for
bdNodeId mOwnId;
uint32_t mFilterFlags;
std::map<uint32_t,bdFilteredPeer> mFiltered;
bdDhtFunctions *mFns;
std::string mFilename ;
// have access to the manager for isBanned callback
bdNodeManager* mNodeManager;
};
#endif

View File

@ -1,243 +0,0 @@
/*******************************************************************************
* bitdht/bdfriendlist.cc *
* *
* BitDHT: An Flexible DHT library. *
* *
* Copyright 2010 by Robert Fernie <bitdht@lunamutt.com> *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Affero General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Affero General Public License for more details. *
* *
* You should have received a copy of the GNU Affero General Public License *
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
* *
*******************************************************************************/
#include "bitdht/bdfriendlist.h"
#include "bitdht/bdstddht.h"
#include "bitdht/bdpeer.h"
#include <iostream>
/*****
* #define DEBUG_FRIENDLIST 1
****/
bdFriendEntry::bdFriendEntry()
{
mFlags = 0;
mLastSeen = 0;
}
bool bdFriendEntry::addrKnown(struct sockaddr_in *addr)
{
if (mFlags & BD_FRIEND_ENTRY_ADDR_OK)
{
if (mFlags & BD_FRIEND_ENTRY_ONLINE)
{
*addr = mPeerId.addr;
return true;
}
if (time(NULL) - mLastSeen < BD_FRIEND_ENTRY_TIMEOUT)
{
*addr = mPeerId.addr;
return true;
}
}
return false;
}
uint32_t bdFriendEntry::getPeerFlags()
{
return mFlags & BD_FRIEND_ENTRY_MASK_KNOWN;
}
bdFriendList::bdFriendList(const bdNodeId *ownId)
{
bdId tmpId;
tmpId.id = *ownId;
updatePeer(&tmpId, BD_FRIEND_ENTRY_SELF);
}
/******
* Simple logic: timestamp is set with address.
* if ONLINE, then address will be dropped as soon as OFFLINE.
* if ADDR_OK, then address will be dropped after XX seconds.
*
* ONLINE - will be used with friends.
* ADDR_OK - will potentially be used for friends of friends (but not for now).
*****/
/* catch-all interface function */
bool bdFriendList::updatePeer(const bdId *id, uint32_t flags)
{
#ifdef DEBUG_FRIENDLIST
std::cerr << "bdFriendList::updatePeer() Peer(";
bdStdPrintId(std::cerr, id);
std::cerr << ") Flags: " << flags;
std::cerr << std::endl;
#endif
std::map<bdNodeId, bdFriendEntry>::iterator it;
it = mPeers.find(id->id);
if (it == mPeers.end())
{
bdFriendEntry entry;
entry.mPeerId.id = id->id;
entry.mFlags = 0;
entry.mLastSeen = 0;
mPeers[id->id] = entry;
it = mPeers.find(id->id);
}
/* update all */
it->second.mFlags = flags;
if (it->second.mFlags & (BD_FRIEND_ENTRY_ADDR_OK | BD_FRIEND_ENTRY_ONLINE))
{
it->second.mFlags |= BD_FRIEND_ENTRY_ADDR_OK;
it->second.mPeerId.addr = id->addr;
it->second.mLastSeen = time(NULL);
}
return true;
}
bool bdFriendList::removePeer(const bdNodeId *id)
{
/* see if it exists... */
std::map<bdNodeId, bdFriendEntry>::iterator it;
it = mPeers.find(*id);
if (it == mPeers.end())
{
#ifdef DEBUG_FRIENDLIST
std::cerr << "bdFriendList::removeFriend() Peer(";
bdStdPrintNodeId(std::cerr, id);
std::cerr << ") is unknown!";
std::cerr << std::endl;
#endif
return false;
}
mPeers.erase(*id);
return true;
}
bool bdFriendList::findPeerEntry(const bdNodeId *id, bdFriendEntry &entry)
{
/* see if it exists... */
std::map<bdNodeId, bdFriendEntry>::iterator it;
it = mPeers.find(*id);
if (it == mPeers.end())
{
#ifdef DEBUG_FRIENDLIST
std::cerr << "bdFriendList::getPeerEntry() Peer(";
bdStdPrintNodeId(std::cerr, id);
std::cerr << ") is unknown!";
std::cerr << std::endl;
#endif
return false;
}
entry = it->second;
return true;
}
bool bdFriendList::findPeersWithFlags(uint32_t flags, std::list<bdNodeId> &peerList)
{
#ifdef DEBUG_FRIENDLIST
std::cerr << "bdFriendList::findPeersWithFlags(" << flags << ")";
std::cerr << std::endl;
#endif
/* see if it exists... */
std::map<bdNodeId, bdFriendEntry>::iterator it;
for(it = mPeers.begin(); it != mPeers.end(); it++)
{
/* if they have ALL of the flags we specified */
if ((it->second.getPeerFlags() & flags) == flags)
{
#ifdef DEBUG_FRIENDLIST
std::cerr << "bdFriendList::findPeersWithFlags() Found: ";
bdStdPrintNodeId(std::cerr, id);
std::cerr << std::endl;
#endif
peerList.push_back(it->second.mPeerId.id);
}
}
return (peerList.size() > 0);
}
bool bdFriendList::print(std::ostream &out)
{
time_t now = time(NULL);
out << "bdFriendList::print()";
out << std::endl;
std::map<bdNodeId, bdFriendEntry>::iterator it;
for(it = mPeers.begin(); it != mPeers.end(); it++)
{
bdStdPrintId(out, &(it->second.mPeerId));
out << " Flags: " << it->second.mFlags;
out << " Seen: " << now - it->second.mLastSeen;
out << std::endl;
}
return true;
}
bdPeerQueue::bdPeerQueue()
{
return;
}
bool bdPeerQueue::queuePeer(const bdId *id, uint32_t flags)
{
bdFriendEntry entry;
entry.mPeerId = *id;
entry.mFlags = flags;
entry.mLastSeen = time(NULL);
mPeerQueue.push_back(entry);
return true;
}
bool bdPeerQueue::popPeer(bdId *id, uint32_t &flags)
{
if (mPeerQueue.size() > 0)
{
bdFriendEntry entry = mPeerQueue.front();
mPeerQueue.pop_front();
*id = entry.mPeerId;
flags = entry.mFlags;
return true;
}
return false;
}

View File

@ -1,101 +0,0 @@
/*******************************************************************************
* bitdht/bdfriendlist.h *
* *
* BitDHT: An Flexible DHT library. *
* *
* Copyright 2010 by Robert Fernie <bitdht@lunamutt.com> *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Affero General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Affero General Public License for more details. *
* *
* You should have received a copy of the GNU Affero General Public License *
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
* *
*******************************************************************************/
#ifndef BITDHT_FRIEND_LIST_H
#define BITDHT_FRIEND_LIST_H
/*
* This class maintains a list of current friends and friends-of-friends.
* It should also be updated when a peer's address has been identified.
*
* It is used for selecting preferential peers for DHT Connections.
* and for detecting bad peers that are duplicating real RS peers.
*
*/
#include "bitdht/bdiface.h"
#include <set>
#define BD_FRIEND_ENTRY_TIMEOUT 10
//#define BD_FRIEND_ENTRY_ONLINE 0x0001
//#define BD_FRIEND_ENTRY_ADDR_OK 0x0002
//#define BD_FRIEND_ENTRY_WHITELIST BITDHT_PEER_STATUS_DHT_WHITELIST
//#define BD_FRIEND_ENTRY_FOF BITDHT_PEER_STATUS_DHT_FOF
//#define BD_FRIEND_ENTRY_FRIEND BITDHT_PEER_STATUS_DHT_FRIEND
//#define BD_FRIEND_ENTRY_RELAY_SERVER BITDHT_PEER_STATUS_DHT_RELAY_SERVER
//#define BD_FRIEND_ENTRY_SELF BITDHT_PEER_STATUS_DHT_SELF
//#define BD_FRIEND_ENTRY_MASK_KNOWN BITDHT_PEER_STATUS_MASK_KNOWN
class bdFriendEntry
{
public:
bdFriendEntry();
bool addrKnown(struct sockaddr_in *addr);
uint32_t getPeerFlags();
bdId mPeerId;
uint32_t mFlags;
time_t mLastSeen;
};
class bdFriendList
{
public:
bdFriendList(const bdNodeId *ownid);
bool updatePeer(const bdId *id, uint32_t flags);
bool removePeer(const bdNodeId *id);
bool findPeerEntry(const bdNodeId *id, bdFriendEntry &entry);
bool findPeersWithFlags(uint32_t flags, std::list<bdNodeId> &peerList);
bool print(std::ostream &out);
private:
std::map<bdNodeId, bdFriendEntry> mPeers;
};
class bdPeerQueue
{
public:
bdPeerQueue();
bool queuePeer(const bdId *id, uint32_t flags);
bool popPeer(bdId *id, uint32_t &flags);
private:
std::list<bdFriendEntry> mPeerQueue;
};
#endif

View File

@ -1,283 +0,0 @@
/*******************************************************************************
* bitdht/bdhash.cc *
* *
* BitDHT: An Flexible DHT library. *
* *
* Copyright 2010 by Robert Fernie <bitdht@lunamutt.com> *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Affero General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Affero General Public License for more details. *
* *
* You should have received a copy of the GNU Affero General Public License *
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
* *
*******************************************************************************/
#include "bitdht/bdhash.h"
#include "bitdht/bdstddht.h"
#include <iostream>
bdHashEntry::bdHashEntry(std::string value, std::string secret, time_t lifetime, time_t store)
:mValue(value), mStoreTS(store), mSecret(secret), mLifetime(lifetime)
{
return;
}
/**************************** class bdHashSet ********************************/
bdHashSet::bdHashSet(bdNodeId *id)
:mId(*id)
{
return;
}
int bdHashSet::search(std::string key, uint32_t maxAge, std::list<bdHashEntry> &entries)
{
std::multimap<std::string, bdHashEntry>::iterator sit, eit, it;
sit = mEntries.lower_bound(key);
eit = mEntries.upper_bound(key);
time_t now = time(NULL);
for(it = sit; it != eit; it++)
{
time_t age = now - it->second.mStoreTS;
if (age < (int32_t) maxAge)
{
entries.push_back(it->second);
}
}
return (0 < entries.size());
}
/***
* With modification.
* If there is no secret -> it cannot be deleted (must timeout), but can be extended.
* If there is a secret -> must include it to modify.
*
* Therefore if identical entry without secret comes along - what do I do?
* -> create duplicate?
*/
int bdHashSet::modify(std::string key, bdHashEntry *entry, uint32_t modFlags)
{
std::multimap<std::string, bdHashEntry>::iterator sit, eit, it;
sit = mEntries.lower_bound(key);
eit = mEntries.upper_bound(key);
time_t now = time(NULL);
bool updated = false;
for(it = sit; it != eit; it++)
{
/* check it all */
if (it->second.mValue == entry->mValue)
{
bool noSecret = (it->second.mSecret == "");
bool sameSecret = (it->second.mSecret == entry->mSecret);
bool update = false;
if (noSecret && sameSecret)
{
/* only allowed to increase lifetime */
if (modFlags == BITDHT_HASH_ENTRY_ADD)
{
time_t existKillTime = it->second.mLifetime + it->second.mStoreTS;
time_t newKillTime = entry->mLifetime + now;
if (newKillTime > existKillTime)
{
update = true;
}
}
}
else if (sameSecret)
{
if (modFlags == BITDHT_HASH_ENTRY_ADD)
{
update = true;
}
else if (modFlags == BITDHT_HASH_ENTRY_DELETE)
{
/* do it here */
mEntries.erase(it);
return 1;
}
}
if (update)
{
it->second.mStoreTS = now;
it->second.mLifetime = entry->mLifetime;
updated = true;
}
}
}
if ((!updated) && (modFlags == BITDHT_HASH_ENTRY_ADD))
{
/* create a new entry */
bdHashEntry newEntry(entry->mValue, entry->mSecret, entry->mLifetime, now);
mEntries.insert(std::pair<std::string, bdHashEntry>(key, newEntry));
updated = true;
}
return updated;
}
int bdHashSet::printHashSet(std::ostream &out)
{
time_t now = time(NULL);
std::multimap<std::string, bdHashEntry>::iterator it;
out << "Hash: ";
bdStdPrintNodeId(out, &mId); // Allowing "Std" as we dont need dht functions everywhere.
out << std::endl;
for(it = mEntries.begin(); it != mEntries.end();it++)
{
time_t age = now - it->second.mStoreTS;
out << "\tK:" << bdStdConvertToPrintable(it->first);
out << " V:" << bdStdConvertToPrintable(it->second.mValue);
out << " A:" << age << " L:" << it->second.mLifetime;
out << " S:" << bdStdConvertToPrintable(it->second.mSecret);
out << std::endl;
}
return 1;
}
int bdHashSet::cleanupHashSet(uint32_t maxAge)
{
time_t now = time(NULL);
/* this is nasty... but don't know how to effectively remove from multimaps
* * Must do full repeat for each removal.
*/
std::multimap<std::string, bdHashEntry>::iterator it;
for(it = mEntries.begin(); it != mEntries.end();)
{
time_t age = now - it->second.mStoreTS;
if ((age > (int32_t) maxAge) || (age > it->second.mLifetime))
{
mEntries.erase(it);
it = mEntries.begin();
}
else
{
it++;
}
}
return 1;
}
/******************************* class bdHashSpace ***************************/
bdHashSpace::bdHashSpace()
{
return;
}
/* accessors */
int bdHashSpace::search(bdNodeId *id, std::string key, uint32_t maxAge, std::list<bdHashEntry> &entries)
{
std::map<bdNodeId, bdHashSet>::iterator it;
it = mHashTable.find(*id);
if (it == mHashTable.end())
{
/* no entry */
return 1;
}
return it->second.search(key, maxAge, entries);
}
int bdHashSpace::modify(bdNodeId *id, std::string key, bdHashEntry *entry, uint32_t modFlags)
{
std::map<bdNodeId, bdHashSet>::iterator it;
it = mHashTable.find(*id);
if (it == mHashTable.end())
{
if (modFlags == BITDHT_HASH_ENTRY_DELETE)
{
/* done already */
return 1;
}
//mHashTable[*id] = bdHashSet(id);
mHashTable.insert(std::pair<bdNodeId, bdHashSet>(*id, bdHashSet(id)));
it = mHashTable.find(*id);
}
return it->second.modify(key, entry, modFlags);
}
int bdHashSpace::printHashSpace(std::ostream &out)
{
std::map<bdNodeId, bdHashSet>::iterator it;
out << "bdHashSpace::printHashSpace()" << std::endl;
out << "--------------------------------------------" << std::endl;
for(it = mHashTable.begin(); it != mHashTable.end(); it++)
{
it->second.printHashSet(out);
}
out << "--------------------------------------------" << std::endl;
return 1;
}
int bdHashSpace::cleanHashSpace(bdNodeId *min, bdNodeId *max, time_t maxAge)
{
std::map<bdNodeId, bdHashSet>::iterator it;
std::list<bdNodeId> eraseList;
std::list<bdNodeId>::iterator eit;
for(it = mHashTable.begin(); it != mHashTable.end(); it++)
{
if ((it->first < *min) ||
(*max < it->first))
{
/* schedule for erasure */
eraseList.push_back(it->first);
}
else
{
/* clean up Hash Set */
it->second.cleanupHashSet(maxAge);
}
}
/* cleanup */
while(eraseList.size() > 0)
{
bdNodeId &eId = eraseList.front();
it = mHashTable.find(eId);
if (it != mHashTable.end())
{
mHashTable.erase(it);
}
}
return 1;
}
int bdHashSpace::clear()
{
mHashTable.clear();
return 1;
}

View File

@ -1,85 +0,0 @@
/*******************************************************************************
* bitdht/bdhash.h *
* *
* BitDHT: An Flexible DHT library. *
* *
* Copyright 2010 by Robert Fernie <bitdht@lunamutt.com> *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Affero General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Affero General Public License for more details. *
* *
* You should have received a copy of the GNU Affero General Public License *
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
* *
*******************************************************************************/
#ifndef BITDHT_HASH_SPACE_H
#define BITDHT_HASH_SPACE_H
#include "bitdht/bdpeer.h"
#include <list>
#include <string>
#include <map>
#define BITDHT_HASH_ENTRY_ADD 1
#define BITDHT_HASH_ENTRY_DELETE 2
class bdHashEntry
{
public:
bdHashEntry(std::string value, std::string secret, time_t lifetime, time_t store);
std::string mValue;
time_t mStoreTS;
/* These are nice features that OpenDHT had */
std::string mSecret;
time_t mLifetime;
};
class bdHashSet
{
public:
bdHashSet(bdNodeId *id);
int search(std::string key, uint32_t maxAge, std::list<bdHashEntry> &entries);
int modify(std::string key, bdHashEntry *entry, uint32_t modFlags);
int printHashSet(std::ostream &out);
int cleanupHashSet(uint32_t maxAge);
bdNodeId mId;
std::multimap<std::string, bdHashEntry> mEntries;
};
class bdHashSpace
{
public:
bdHashSpace();
/* accessors */
int search(bdNodeId *id, std::string key, uint32_t maxAge, std::list<bdHashEntry> &entries);
int modify(bdNodeId *id, std::string key, bdHashEntry *entry, uint32_t modFlags);
int printHashSpace(std::ostream&);
int cleanHashSpace(bdNodeId *min, bdNodeId *max, time_t maxAge);
int clear();
private:
std::map<bdNodeId, bdHashSet> mHashTable;
};
#endif

View File

@ -1,647 +0,0 @@
/*******************************************************************************
* bitdht/bdhistory.cc *
* *
* BitDHT: An Flexible DHT library. *
* *
* Copyright 2010 by Robert Fernie <bitdht@lunamutt.com> *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Affero General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Affero General Public License for more details. *
* *
* You should have received a copy of the GNU Affero General Public License *
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
* *
*******************************************************************************/
#include "bitdht/bdhistory.h"
#include "bitdht/bdstddht.h"
#include "bitdht/bdmsgs.h"
#include <set>
#define MIN_RESEND_PERIOD 60
bdMsgHistoryList::bdMsgHistoryList()
:mPeerVersion("Unknown")
{
return;
}
void bdMsgHistoryList::addMsg(time_t ts, uint32_t msgType, bool incoming, const bdNodeId *aboutId)
{
// std::cerr << "bdMsgHistoryList::addMsg()";
// std::cerr << std::endl;
bdMsgHistoryItem msg(msgType, incoming, aboutId);
msgHistory.insert(std::make_pair(ts, msg));
}
void bdMsgHistoryList::setPeerType(time_t /* ts */, std::string version)
{
mPeerVersion = version;
}
int bdMsgHistoryList::msgCount(time_t start_ts, time_t end_ts)
{
std::multimap<time_t, bdMsgHistoryItem>::iterator sit, eit, it;
sit = msgHistory.lower_bound(start_ts);
eit = msgHistory.upper_bound(end_ts);
int count = 0;
for (it = sit; it != eit; it++, count++) ; // empty loop.
return count;
}
bool bdMsgHistoryList::msgClear(time_t before)
{
if (before == 0)
{
msgHistory.clear();
return true;
}
// Delete the old stuff in the list.
while((msgHistory.begin() != msgHistory.end()) && (msgHistory.begin()->first < before))
{
msgHistory.erase(msgHistory.begin());
}
// return true if empty.
if (msgHistory.begin() == msgHistory.end())
{
return true;
}
return false;
}
void bdMsgHistoryList::msgClear()
{
msgHistory.clear();
}
void bdMsgHistoryList::clearHistory()
{
msgClear();
}
void bdMsgHistoryList::printHistory(std::ostream &out, int mode, time_t start_ts, time_t end_ts)
{
//out << "AGE: MSGS => incoming, <= outgoing" << std::endl;
std::multimap<time_t, bdMsgHistoryItem>::iterator sit, eit, it;
sit = msgHistory.lower_bound(start_ts);
eit = msgHistory.upper_bound(end_ts);
time_t curr_ts = 0;
bool time_changed = false;
bool first_line = true;
for(it = sit; it != eit; it++)
{
time_changed = false;
if (curr_ts != it->first)
{
curr_ts = it->first;
time_changed = true;
}
switch(mode)
{
default:
{
/* print one line per ts */
if (time_changed)
{
if (!first_line)
{
/* finish existing line */
out << " " << std::endl;
}
else
{
first_line = false;
}
out << "\tTS: " << time(NULL) - curr_ts << " ";
}
std::string name;
bitdht_msgtype(it->second.msgType, name);
if (it->second.incoming)
{
out << "( =I> ";
}
else
{
out << "( <O= ";
}
out << name << " ";
if ((it->second.aboutId.data[0] == 0)
&& (it->second.aboutId.data[3] == 0)
&& (it->second.aboutId.data[3] == 0)
&& (it->second.aboutId.data[3] == 0))
{
/* don't print anything */
}
else
{
bdStdPrintNodeId(out, &(it->second.aboutId));
}
out << " )";
}
break;
} // end of switch.
}
/* finish up last line */
if (!first_line)
{
out << " " << std::endl;
}
}
bool bdMsgHistoryList::canSend()
{
std::cerr << "bdMsgHistoryList::canSend()";
std::multimap<time_t, bdMsgHistoryItem>::reverse_iterator rit;
rit = msgHistory.rbegin();
if (rit != msgHistory.rend())
{
time_t now = time(NULL);
if (now - rit->first > MIN_RESEND_PERIOD)
{
std::cerr << " OVER RESEND_PERIOD... true";
std::cerr << std::endl;
return true;
}
}
if (msgHistory.size() % 2 == 0)
{
std::cerr << " SIZE: " << msgHistory.size() << " % 2 = 0 ... true";
std::cerr << std::endl;
return true;
}
std::cerr << " false";
std::cerr << std::endl;
return false;
}
bool bdMsgHistoryList::validPeer()
{
std::cerr << "bdMsgHistoryList::validPeer()";
std::multimap<time_t, bdMsgHistoryItem>::iterator it;
for(it = msgHistory.begin(); it != msgHistory.end(); it++)
{
if (it->second.incoming)
{
std::cerr << " Incoming Msg... so validPeer";
std::cerr << std::endl;
return true;
}
}
std::cerr << " false";
std::cerr << std::endl;
return false;
}
#define MAX_PING_PER_MINUTE 2
#define MAX_QUERY_PER_MINUTE 2
bool bdMsgHistoryList::analysePeer()
{
/* analyse and print out details of the peers messages */
bool flagged = false;
//out << "AGE: MSGS => incoming, <= outgoing" << std::endl;
std::multimap<time_t, bdMsgHistoryItem>::iterator sit, eit, it;
sit = msgHistory.begin();
eit = msgHistory.end();
if (sit == eit)
{
// nothing here.
return false;
}
time_t start_ts = sit->first;
time_t end_ts = msgHistory.rbegin()->first; // must exist.
// don't divide by zero.
if (end_ts - start_ts < 60)
{
end_ts = start_ts + 60;
}
/* what do we want to analyse? */
/* if we have sent / recved too many queries or pings */
int in_ping = 0;
int out_ping = 0;
int in_query = 0;
int out_query = 0;
int in_other = 0;
int out_other = 0;
for(it = sit; it != eit; it++)
{
if (it->second.incoming)
{
switch(it->second.msgType)
{
case BITDHT_MSG_TYPE_PING:
in_ping++;
break;
case BITDHT_MSG_TYPE_FIND_NODE:
in_query++;
break;
default:
in_other++;
break;
}
}
else
{
switch(it->second.msgType)
{
case BITDHT_MSG_TYPE_PING:
out_ping++;
break;
case BITDHT_MSG_TYPE_FIND_NODE:
out_query++;
break;
default:
out_other++;
break;
}
}
}
float in_ping_per_min = in_ping * 60.0 / (end_ts - start_ts);
float out_ping_per_min = out_ping * 60.0 / (end_ts - start_ts);
float in_query_per_min = in_query * 60.0 / (end_ts - start_ts);
float out_query_per_min = out_query * 60.0 / (end_ts - start_ts);
if ((in_ping_per_min > MAX_PING_PER_MINUTE) ||
(out_ping_per_min > MAX_PING_PER_MINUTE) ||
(in_query_per_min > MAX_PING_PER_MINUTE) ||
(out_query_per_min > MAX_PING_PER_MINUTE))
{
flagged = true;
}
if (flagged)
{
/* print header */
std::ostream &out = std::cerr;
out << "BdHistoryAnalysis has flagged peer: ";
bdStdPrintId(out, &mId);
out << std::endl;
out << "PeerType: " << mPeerVersion;
out << std::endl;
out << "Ping In Per Min : " << in_ping_per_min << std::endl;
out << "Ping Out Per Min : " << out_ping_per_min << std::endl;
out << "Query In Per Min : " << in_query_per_min << std::endl;
out << "Query Out Per Min: " << out_query_per_min << std::endl;
out << "Message History: ";
out << std::endl;
printHistory(out, 0, 0, time(NULL));
}
return true;
}
bdHistory::bdHistory(time_t store_period)
:mStorePeriod(store_period) { return; }
void bdHistory::addMsg(const bdId *id, bdToken * /*transId*/, uint32_t msgType, bool incoming, const bdNodeId *aboutId)
{
//std::cerr << "bdHistory::addMsg() ";
//bdStdPrintId(std::cerr, id);
//std::cerr << std::endl;
time_t now = time(NULL);
std::map<bdId, bdMsgHistoryList>::iterator it;
bdMsgHistoryList &histRef = mHistory[*id]; /* will instaniate empty */
histRef.mId = *id;
histRef.addMsg(now, msgType, incoming, aboutId);
/* add to mMsgTimeline */
mMsgTimeline.insert(std::make_pair(now, MsgRegister(id, msgType, incoming, aboutId)));
}
void bdHistory::setPeerType(const bdId *id, std::string version)
{
std::map<bdId, bdMsgHistoryList>::iterator it;
bdMsgHistoryList &histRef = mHistory[*id]; /* will instaniate empty */
histRef.setPeerType(time(NULL), version);
}
void bdHistory::printMsgs()
{
/* print and clear msgs */
std::ostream &out = std::cerr;
std::cerr << "bdHistory::printMsgs()";
std::cerr << std::endl;
std::map<bdId, bdMsgHistoryList> ::iterator it;
for(it = mHistory.begin(); it != mHistory.end(); it++)
{
if (it->second.msgCount(0, time(NULL))) // all msg count.
{
/* print header */
out << "Msgs for ";
bdStdPrintId(out, &(it->first));
out << " v:" << it->second.mPeerVersion;
out << std::endl;
it->second.printHistory(out, 0, 0, time(NULL));
}
}
out << "Msg Timeline:";
time_t now = time(NULL);
std::multimap<time_t, MsgRegister>::iterator hit;
for(hit = mMsgTimeline.begin(); hit != mMsgTimeline.end(); hit++)
{
out << now - hit->first << " ";
bdStdPrintId(out, &(hit->second.id));
if (hit->second.incoming)
{
out << " =I> ";
}
else
{
out << " <O= ";
}
std::string name;
if (bitdht_msgtype(hit->second.msgType, name))
{
out << name;
}
else
{
out << "UNKNOWN MSG";
}
out << std::endl;
}
}
void bdHistory::cleanupOldMsgs()
{
std::cerr << "bdHistory::cleanupOldMsgs()";
std::cerr << std::endl;
if (mStorePeriod == 0)
{
return; // no cleanup
}
std::set<bdId> to_cleanup;
std::set<bdId>::iterator cit;
time_t before = time(NULL) - mStorePeriod;
// Delete the old stuff in the list.
while((mMsgTimeline.begin() != mMsgTimeline.end()) && (mMsgTimeline.begin()->first < before))
{
std::multimap<time_t, MsgRegister>::iterator it = mMsgTimeline.begin();
to_cleanup.insert(it->second.id);
mMsgTimeline.erase(it);
}
// remove old msgs, delete entry if its empty.
std::map<bdId, bdMsgHistoryList>::iterator hit;
for(cit = to_cleanup.begin(); cit != to_cleanup.end(); cit++)
{
hit = mHistory.find(*cit);
if (hit != mHistory.end())
{
if (hit->second.msgClear(before))
{
// don't erase actual entry (so we remember peer type).
//mHistory.erase(hit);
}
}
}
}
void bdHistory::clearHistory()
{
// Switched to a alternative clear, so we don't drop peers, and remember their type.
//mHistory.clear();
std::map<bdId, bdMsgHistoryList> ::iterator it;
for(it = mHistory.begin(); it != mHistory.end(); it++)
{
it->second.clearHistory();
}
}
bool bdHistory::canSend(const bdId *id)
{
std::map<bdId, bdMsgHistoryList> ::iterator it;
it = mHistory.find(*id);
if (it != mHistory.end())
{
return (it->second.canSend());
}
/* if not found - then can send */
return true;
}
bool bdHistory::validPeer(const bdId *id)
{
std::map<bdId, bdMsgHistoryList> ::iterator it;
it = mHistory.find(*id);
if (it != mHistory.end())
{
return (it->second.validPeer());
}
/* if not found - then can send */
return false;
}
bool bdHistory::analysePeers()
{
std::map<bdId, bdMsgHistoryList> ::iterator it;
for(it = mHistory.begin(); it != mHistory.end(); it++)
{
it->second.analysePeer();
}
return true;
}
/* Temp data class. */
class TypeStats
{
public:
TypeStats() :nodes(0) { return; }
std::map<uint32_t, uint32_t> incoming, outgoing;
int nodes;
void printStats(std::ostream &out, const TypeStats *refStats)
{
std::map<uint32_t, uint32_t>::iterator it;
std::map<uint32_t, uint32_t>::const_iterator rit;
out << " Nodes: " << nodes;
if (refStats)
{
out << " (" << 100.0 * nodes / (float) refStats->nodes << " %)";
}
out << std::endl;
out << " Incoming Msgs";
out << std::endl;
for(it = incoming.begin(); it != incoming.end(); it++)
{
uint32_t count = 0;
if (refStats)
{
rit = refStats->incoming.find(it->first);
if (rit != refStats->incoming.end())
{
count = rit->second;
}
}
printStatsLine(out, it->first, it->second, count);
}
out << " Outgoing Msgs";
out << std::endl;
for(it = outgoing.begin(); it != outgoing.end(); it++)
{
uint32_t count = 0;
if (refStats)
{
rit = refStats->outgoing.find(it->first);
if (rit != refStats->outgoing.end())
{
count = rit->second;
}
}
printStatsLine(out, it->first, it->second, count);
}
}
void printStatsLine(std::ostream &out, uint32_t msgType, uint32_t count, uint32_t global)
{
std::string name;
bitdht_msgtype(msgType, name);
out << "\t" << name << " " << count;
if (global != 0)
{
out << " (" << 100.0 * count / (float) global << " %)";
}
out << std::endl;
}
}; /* end of TypeStats */
bool bdHistory::peerTypeAnalysis()
{
std::map<std::string, TypeStats> mTypeStats;
TypeStats globalStats;
std::map<bdId, bdMsgHistoryList> ::iterator it;
for(it = mHistory.begin(); it != mHistory.end(); it++)
{
if (it->second.msgHistory.empty())
{
continue;
}
std::string version = it->second.mPeerVersion;
// group be first two bytes.
version = it->second.mPeerVersion.substr(0,2);
TypeStats &stats = mTypeStats[version];
stats.nodes++;
globalStats.nodes++;
std::multimap<time_t, bdMsgHistoryItem>::iterator lit;
for (lit = it->second.msgHistory.begin(); lit != it->second.msgHistory.end(); lit++)
{
if (lit->second.incoming)
{
stats.incoming[lit->second.msgType]++;
globalStats.incoming[lit->second.msgType]++;
}
else
{
stats.outgoing[lit->second.msgType]++;
globalStats.outgoing[lit->second.msgType]++;
}
}
}
std::map<std::string, TypeStats>::iterator tit;
for(tit = mTypeStats.begin(); tit != mTypeStats.end(); tit++)
{
std::cerr << "Stats for Peer Type: " << tit->first;
std::cerr << std::endl;
tit->second.printStats(std::cerr, &globalStats);
}
std::cerr << "Global Stats: ";
std::cerr << std::endl;
globalStats.printStats(std::cerr, NULL);
return true;
}

View File

@ -1,147 +0,0 @@
/*******************************************************************************
* bitdht/bdhistory.h *
* *
* BitDHT: An Flexible DHT library. *
* *
* Copyright 2010 by Robert Fernie <bitdht@lunamutt.com> *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Affero General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Affero General Public License for more details. *
* *
* You should have received a copy of the GNU Affero General Public License *
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
* *
*******************************************************************************/
#ifndef BITDHT_HISTORY_H
#define BITDHT_HISTORY_H
#include "bitdht/bdpeer.h"
#include "bitdht/bdobj.h"
#include "bitdht/bdstddht.h"
#include <map>
#define MSG_TYPE_DIRECTION_MASK 0x000f0000
#define MSG_DIRECTION_INCOMING 0x00010000
#define MSG_DIRECTION_OUTGOING 0x00020000
/**** DEBUGGING HISTORY ****/
class MsgRegister
{
public:
MsgRegister() { return; }
MsgRegister(const bdId *inId, uint32_t inMsgType, bool inIncoming, const bdNodeId *inAboutId)
:id(*inId), msgType(inMsgType), incoming(inIncoming)
{
if (inAboutId)
{
aboutId = *inAboutId;
}
else
{
bdStdZeroNodeId(&aboutId);
}
return;
}
bdId id;
uint32_t msgType;
bool incoming;
bdNodeId aboutId; // filled in for queries.
};
class bdMsgHistoryItem
{
public:
bdMsgHistoryItem()
:msgType(0), incoming(false)
{
bdStdZeroNodeId(&aboutId);
return;
}
bdMsgHistoryItem(uint32_t inMsgType, bool inIncoming, const bdNodeId *inAboutId)
:msgType(inMsgType), incoming(inIncoming)
{
if (inAboutId)
{
aboutId = *inAboutId;
}
else
{
bdStdZeroNodeId(&aboutId);
}
return;
}
uint32_t msgType;
bool incoming;
bdNodeId aboutId; // filled in for queries.
};
class bdMsgHistoryList
{
public:
bdMsgHistoryList();
void addMsg(time_t ts, uint32_t msgType, bool incoming, const bdNodeId *aboutId);
void setPeerType(time_t ts, std::string version);
int msgCount(time_t start_ts, time_t end_ts);
bool msgClear(time_t before); // 0 => clear all.
void msgClear();
void printHistory(std::ostream &out, int mode, time_t start_ts, time_t end_ts);
bool analysePeer();
void clearHistory();
bool canSend();
bool validPeer();
std::multimap<time_t, bdMsgHistoryItem> msgHistory;
std::string mPeerVersion;
bdId mId;
};
class bdHistory
{
public:
bdHistory(time_t store_period);
void addMsg(const bdId *id, bdToken *transId, uint32_t msgType, bool incoming, const bdNodeId *aboutId);
void setPeerType(const bdId *id, std::string version);
void printMsgs();
void cleanupOldMsgs();
void clearHistory();
bool analysePeers();
bool peerTypeAnalysis();
bool canSend(const bdId *id);
bool validPeer(const bdId *id);
/* recent history */
//std::list<bdId> lastMsgs;
std::map<bdId, bdMsgHistoryList> mHistory;
std::multimap<time_t, MsgRegister> mMsgTimeline;
int mStorePeriod;
};
#endif

View File

@ -1,413 +0,0 @@
/*******************************************************************************
* bitdht/bdiface.h *
* *
* BitDHT: An Flexible DHT library. *
* *
* Copyright 2010 by Robert Fernie <bitdht@lunamutt.com> *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Affero General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Affero General Public License for more details. *
* *
* You should have received a copy of the GNU Affero General Public License *
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
* *
*******************************************************************************/
#ifndef BIT_DHT_INTERFACE_H
#define BIT_DHT_INTERFACE_H
#include <iosfwd>
#include <map>
#include <string>
#include <list>
#include <inttypes.h>
#include "util/bdnet.h"
/*
* Functions and Classes required for Interfacing with the BitDht.
* This should be the sole header file required to talk to Dht.
* ... though setting it up will require including udpbitdht.h as well.
*
*/
#define BITDHT_KEY_LEN 20
#define BITDHT_KEY_INTLEN 5
#define BITDHT_KEY_BITLEN 160
#define BITDHT_MAX_PKTSIZE 1024
#define BITDHT_TTL 64
#define BITDHT_SEARCH_ONE_SHOT 1
#define BITDHT_SEARCH_REPEATING 2
class bdNodeId
{
public:
unsigned char data[BITDHT_KEY_LEN];
};
class bdMetric: public bdNodeId {};
class bdId
{
public:
bdId();
bdId(bdNodeId in_id, struct sockaddr_in in_addr);
struct sockaddr_in addr;
bdNodeId id;
};
#define BITDHT_LIKELY_SAME_NO 0x00000000
#define BITDHT_LIKELY_SAME_YES 0x00000001
#define BITDHT_LIKELY_SAME_PORT_CHANGED 0x00000002
#define BITDHT_LIKELY_SAME_LOC_CHANGED 0x00000004
#define BITDHT_LIKELY_SAME_IDENTICAL 0x00000008
class bdDhtFunctions
{
public:
// bdDhtFunctions();
/* setup variables */
virtual uint16_t bdNumBuckets() = 0;
virtual uint16_t bdNodesPerBucket() = 0; /* used for bdspace */
virtual uint16_t bdNumQueryNodes() = 0; /* used for queries */
virtual uint16_t bdBucketBitSize() = 0;
virtual int bdDistance(const bdNodeId *n1, const bdNodeId *n2, bdMetric *metric) = 0;
virtual int bdBucketDistance(const bdNodeId *n1, const bdNodeId *n2) = 0;
virtual int bdBucketDistance(const bdMetric *metric) = 0;
virtual bool bdSimilarId(const bdId *id1, const bdId *id2) = 0;
virtual bool bdUpdateSimilarId(bdId *dest, const bdId *src) = 0;
virtual void bdRandomMidId(const bdNodeId *target, const bdNodeId *other, bdNodeId *mid) = 0;
virtual void bdPrintId(std::ostream &out, const bdId *a) = 0;
virtual void bdPrintNodeId(std::ostream &out, const bdNodeId *a) = 0;
};
// DHT MODES
#define BITDHT_MODE_TRAFFIC_MASK 0x00000f00
#define BITDHT_MODE_RELAYSERVER_MASK 0x0000f000
// These are not ORd - only one can apply.
#define BITDHT_MODE_TRAFFIC_HIGH 0x00000100
#define BITDHT_MODE_TRAFFIC_MED 0x00000200
#define BITDHT_MODE_TRAFFIC_LOW 0x00000300
#define BITDHT_MODE_TRAFFIC_TRICKLE 0x00000400
#define BITDHT_MODE_TRAFFIC_DEFAULT BITDHT_MODE_TRAFFIC_LOW
// These are not ORd - only one can apply.
#define BITDHT_MODE_RELAYSERVERS_IGNORED 0x00001000
#define BITDHT_MODE_RELAYSERVERS_FLAGGED 0x00002000
#define BITDHT_MODE_RELAYSERVERS_ONLY 0x00003000
#define BITDHT_MODE_RELAYSERVERS_SERVER 0x00004000
/* NODE OPTIONS */
#define BITDHT_OPTIONS_MAINTAIN_UNSTABLE_PORT 0x00000001
#define BITDHT_OPTIONS_ENABLE_RELAYS 0x00000002
/* peer flags
* order is important!
* higher bits = more priority.
* BITDHT_PEER_STATUS_RECVPING
* BITDHT_PEER_STATUS_RECVPONG
* BITDHT_PEER_STATUS_RECVNODES
* BITDHT_PEER_STATUS_RECVHASHES
* BITDHT_PEER_STATUS_DHT_ENGINE (dbXXxx)
* BITDHT_PEER_STATUS_DHT_APPL (XXRSxx)
* BITDHT_PEER_STATUS_DHT_VERSION (XXxx50)
*
*/
#define BITDHT_PEER_STATUS_MASK_RECVD 0x000000ff
#define BITDHT_PEER_STATUS_MASK_DHT 0x0000ff00
#define BITDHT_PEER_STATUS_MASK_KNOWN 0x00ff0000
#define BITDHT_PEER_STATUS_RECV_PING 0x00000001
#define BITDHT_PEER_STATUS_RECV_PONG 0x00000002
#define BITDHT_PEER_STATUS_RECV_NODES 0x00000004
#define BITDHT_PEER_STATUS_RECV_HASHES 0x00000008
#define BITDHT_PEER_STATUS_RECV_CONNECT_MSG 0x00000010
#define BITDHT_PEER_STATUS_DHT_ENGINE 0x00000100
#define BITDHT_PEER_STATUS_DHT_ENGINE_VERSION 0x00000200
#define BITDHT_PEER_STATUS_DHT_APPL 0x00000400
#define BITDHT_PEER_STATUS_DHT_APPL_VERSION 0x00000800
#define BITDHT_PEER_STATUS_DHT_WHITELIST 0x00010000
#define BITDHT_PEER_STATUS_DHT_FOF 0x00020000
#define BITDHT_PEER_STATUS_DHT_FRIEND 0x00040000
#define BITDHT_PEER_STATUS_DHT_RELAY_SERVER 0x00080000 // (Flag must be enabled)
#define BITDHT_PEER_STATUS_DHT_SELF 0x00100000
// EXTRA FLAGS are our internal thoughts about the peer.
#define BITDHT_PEER_EXFLAG_MASK_BASIC 0x000000ff
#define BITDHT_PEER_EXFLAG_UNSTABLE 0x00000001 // Port changes.
#define BITDHT_PEER_EXFLAG_ATTACHED 0x00000002 // We will ping in heavily. (if unstable)
#define BITDHT_PEER_EXFLAG_BADPEER 0x00000004 // For testing, we flag rather than discard.
#define BITDHT_CONNECT_MODE_DIRECT 0x00000001
#define BITDHT_CONNECT_MODE_PROXY 0x00000002
#define BITDHT_CONNECT_MODE_RELAY 0x00000004
#define BITDHT_CONNECT_OPTION_AUTOPROXY 0x00000001
// STATUS CODES. == 0 is okay, != 0 is error.
#define BITDHT_CONNECT_ANSWER_OKAY 0x00000000
#define BITDHT_CONNECT_ERROR_NONE (BITDHT_CONNECT_ANSWER_OKAY)
#define BITDHT_CONNECT_ERROR_MASK_TYPE 0x0000ffff
#define BITDHT_CONNECT_ERROR_MASK_SOURCE 0x00ff0000
#define BITDHT_CONNECT_ERROR_MASK_CRMOVE 0xff000000
#define BITDHT_CONNECT_ERROR_SOURCE_START 0x00010000
#define BITDHT_CONNECT_ERROR_SOURCE_MID 0x00020000
#define BITDHT_CONNECT_ERROR_SOURCE_END 0x00040000
#define BITDHT_CONNECT_ERROR_SOURCE_OTHER 0x00080000
#define BITDHT_CONNECT_ERROR_CRMOVE_FATAL 0x01000000
#define BITDHT_CONNECT_ERROR_CRMOVE_NOMOREIDS 0x02000000
#define BITDHT_CONNECT_ERROR_CRMOVE_NEXTID 0x04000000
#define BITDHT_CONNECT_ERROR_CRMOVE_PAUSED 0x08000000
// ERROR CODES.
#define BITDHT_CONNECT_ERROR_GENERIC 0x00000001
#define BITDHT_CONNECT_ERROR_PROTOCOL 0x00000002
#define BITDHT_CONNECT_ERROR_TIMEOUT 0x00000003
#define BITDHT_CONNECT_ERROR_TEMPUNAVAIL 0x00000004 // Haven't got ext address yet.
#define BITDHT_CONNECT_ERROR_NOADDRESS 0x00000005 // Can't find the peer in tables.
#define BITDHT_CONNECT_ERROR_UNREACHABLE 0x00000006 // Symmetric NAT
#define BITDHT_CONNECT_ERROR_UNSUPPORTED 0x00000007
#define BITDHT_CONNECT_ERROR_OVERLOADED 0x00000008
#define BITDHT_CONNECT_ERROR_AUTH_DENIED 0x00000009
#define BITDHT_CONNECT_ERROR_DUPLICATE 0x0000000a
// These are slightly special ones used for CB_REQUEST
#define BITDHT_CONNECT_ERROR_TOOMANYRETRY 0x0000000b
#define BITDHT_CONNECT_ERROR_OUTOFPROXY 0x0000000c
#define BITDHT_CONNECT_ERROR_USER 0x0000000d
/*************/
// FRIEND_ENTRY_FLAGS... used by updateKnownPeers().
#define BD_FRIEND_ENTRY_ONLINE 0x0001
#define BD_FRIEND_ENTRY_ADDR_OK 0x0002
#define BD_FRIEND_ENTRY_WHITELIST BITDHT_PEER_STATUS_DHT_WHITELIST
#define BD_FRIEND_ENTRY_FOF BITDHT_PEER_STATUS_DHT_FOF
#define BD_FRIEND_ENTRY_FRIEND BITDHT_PEER_STATUS_DHT_FRIEND
#define BD_FRIEND_ENTRY_RELAY_SERVER BITDHT_PEER_STATUS_DHT_RELAY_SERVER
#define BD_FRIEND_ENTRY_SELF BITDHT_PEER_STATUS_DHT_SELF
#define BD_FRIEND_ENTRY_MASK_KNOWN BITDHT_PEER_STATUS_MASK_KNOWN
/* Definitions of bdSpace Peer and Bucket are publically available,
* so we can expose the bucket entries for the gui.
*/
class bdPeer
{
public:
bdPeer():mPeerFlags(0), mLastSendTime(0), mLastRecvTime(0), mFoundTime(0), mExtraFlags(0) { return; }
bdId mPeerId;
uint32_t mPeerFlags;
time_t mLastSendTime;
time_t mLastRecvTime;
time_t mFoundTime; /* time stamp that peer was found */
uint32_t mExtraFlags;
};
class bdBucket
{
public:
bdBucket();
/* list so we can queue properly */
std::list<bdPeer> entries;
};
class bdQueryStatus
{
public:
uint32_t mStatus;
uint32_t mQFlags;
std::list<bdId> mResults;
};
class bdQuerySummary
{
public:
bdNodeId mId;
bdMetric mLimit;
uint32_t mState;
time_t mQueryTS;
uint32_t mQueryFlags;
int32_t mSearchTime;
int32_t mQueryIdlePeerRetryPeriod; // seconds between retries.
// closest peers
std::multimap<bdMetric, bdPeer> mClosest;
std::multimap<bdMetric, bdPeer> mPotentialPeers;
std::list<bdPeer> mProxiesUnknown;
std::list<bdPeer> mProxiesFlagged;
};
/* Status options */
#define BITDHT_QUERY_READY 1
#define BITDHT_QUERY_QUERYING 2
#define BITDHT_QUERY_FAILURE 3
#define BITDHT_QUERY_FOUND_CLOSEST 4
#define BITDHT_QUERY_PEER_UNREACHABLE 5
#define BITDHT_QUERY_SUCCESS 6
/* Query Flags */
#define BITDHT_QFLAGS_NONE 0x0000
#define BITDHT_QFLAGS_DISGUISE 0x0001 // Don't search directly for target.
#define BITDHT_QFLAGS_DO_IDLE 0x0002
#define BITDHT_QFLAGS_INTERNAL 0x0004 // runs through startup. (limited callback)
#define BITDHT_QFLAGS_UPDATES 0x0008 // Do regular updates.
/* Connect Callback Flags */
#define BITDHT_CONNECT_CB_AUTH 1
#define BITDHT_CONNECT_CB_PENDING 2
#define BITDHT_CONNECT_CB_START 3
#define BITDHT_CONNECT_CB_PROXY 4
#define BITDHT_CONNECT_CB_FAILED 5
#define BITDHT_CONNECT_CB_REQUEST 6
#define BD_PROXY_CONNECTION_UNKNOWN_POINT 0
#define BD_PROXY_CONNECTION_START_POINT 1
#define BD_PROXY_CONNECTION_MID_POINT 2
#define BD_PROXY_CONNECTION_END_POINT 3
#define BITDHT_INFO_CB_TYPE_BADPEER 1
/* Relay Modes */
#define BITDHT_RELAYS_OFF 0
#define BITDHT_RELAYS_ON 1
#define BITDHT_RELAYS_ONLY 2
#define BITDHT_RELAYS_SERVER 3
class BitDhtCallback
{
public:
// ~BitDhtCallback();
// dummy cos not needed for standard dht behaviour;
virtual int dhtNodeCallback(const bdId * /*id*/, uint32_t /*peerflags*/) { return 0; }
// must be implemented.
virtual int dhtPeerCallback(const bdId *id, uint32_t status) = 0;
virtual int dhtValueCallback(const bdNodeId *id, std::string key, uint32_t status) = 0;
// connection callback. Not required for basic behaviour, but forced for initial development.
virtual int dhtConnectCallback(const bdId *srcId, const bdId *proxyId, const bdId *destId,
uint32_t mode, uint32_t point, uint32_t param, uint32_t cbtype, uint32_t errcode) = 0; /* { return 0; } */
// Generic Info callback - initially will be used to provide bad peers.
virtual int dhtInfoCallback(const bdId *id, uint32_t type, uint32_t flags, std::string info) = 0;
// ask upper layer whether an IP is banned or not
// must not be implemented
// when set it will be used instead of the own ban list
// return code is used to express availability/absence
virtual int dhtIsBannedCallback(const sockaddr_in */*addr*/, bool */*isBanned*/) { return 0;}
};
class BitDhtInterface
{
public:
/* bad peer notification */
virtual void addBadPeer(const struct sockaddr_in &addr, uint32_t source, uint32_t reason, uint32_t age) = 0;
/* Friend Tracking */
virtual void updateKnownPeer(const bdId *id, uint32_t type, uint32_t flags) = 0;
/***** Request Lookup (DHT Peer & Keyword) *****/
virtual void addFindNode(bdNodeId *id, uint32_t mode) = 0;
virtual void removeFindNode(bdNodeId *id) = 0;
virtual void findDhtValue(bdNodeId *id, std::string key, uint32_t mode) = 0;
/***** Connections Requests *****/
virtual bool ConnectionRequest(struct sockaddr_in *laddr, bdNodeId *target, uint32_t mode, uint32_t delay, uint32_t start) = 0;
virtual void ConnectionAuth(bdId *srcId, bdId *proxyId, bdId *destId, uint32_t mode, uint32_t loc,
uint32_t bandwidth, uint32_t delay, uint32_t answer) = 0;
virtual void ConnectionOptions(uint32_t allowedModes, uint32_t flags) = 0;
virtual bool setAttachMode(bool on) = 0;
/***** Add / Remove Callback Clients *****/
virtual void addCallback(BitDhtCallback *cb) = 0;
virtual void removeCallback(BitDhtCallback *cb) = 0;
/***** Get Results Details *****/
virtual int getDhtPeerAddress(const bdNodeId *id, struct sockaddr_in &from) = 0;
virtual int getDhtValue(const bdNodeId *id, std::string key, std::string &value) = 0;
virtual int getDhtBucket(const int idx, bdBucket &bucket) = 0;
virtual int getDhtQueries(std::map<bdNodeId, bdQueryStatus> &queries) = 0;
virtual int getDhtQueryStatus(const bdNodeId *id, bdQuerySummary &query) = 0;
/* stats and Dht state */
virtual int startDht() = 0;
virtual int stopDht() = 0;
virtual int stateDht() = 0; /* STOPPED, STARTING, ACTIVE, FAILED */
virtual uint32_t statsNetworkSize() = 0;
virtual uint32_t statsBDVersionSize() = 0; /* same version as us! */
virtual uint32_t setDhtMode(uint32_t dhtFlags) = 0;
};
// general helper functions for decoding error messages.
std::string decodeConnectionError(uint32_t errcode);
std::string decodeConnectionErrorCRMove(uint32_t errcode);
std::string decodeConnectionErrorSource(uint32_t errcode);
std::string decodeConnectionErrorType(uint32_t errcode);
#endif

File diff suppressed because it is too large Load Diff

View File

@ -1,209 +0,0 @@
/*******************************************************************************
* bitdht/bdmanager.h *
* *
* BitDHT: An Flexible DHT library. *
* *
* Copyright 2010 by Robert Fernie <bitdht@lunamutt.com> *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Affero General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Affero General Public License for more details. *
* *
* You should have received a copy of the GNU Affero General Public License *
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
* *
*******************************************************************************/
#ifndef BITDHT_MANAGER_H
#define BITDHT_MANAGER_H
/*******
* Node Manager.
******/
/******************************************
* 1) Maintains a list of ids to search for.
* 2) Sets up initial search for own node.
* 3) Checks on status of queries.
* 4) Callback on successful searches.
*
* This is pretty specific to RS requirements.
****/
#define BITDHT_PS_MASK_ACTIONS (0x000000ff)
#define BITDHT_PS_MASK_STATE (0x0000ff00)
#define BITDHT_PS_ACTION_SEARCHING (0x00000001)
#define BITDHT_PS_ACTION_WAITING (0x00000002)
#define BITDHT_PS_ACTION_PINGING (0x00000004)
#define BITDHT_PS_STATE_UNKNOWN (0x00000100)
#define BITDHT_PS_STATE_OFFLINE (0x00000200)
#define BITDHT_PS_STATE_ONLINE (0x00000400)
#define BITDHT_PS_STATE_CONNECTED (0x00000800)
#include "bitdht/bdiface.h"
#include "bitdht/bdnode.h"
#include "util/bdbloom.h"
class bdQueryPeer
{
public:
bdId mId;
uint32_t mStatus;
uint32_t mQFlags;
//time_t mLastQuery;
//time_t mLastFound;
struct sockaddr_in mDhtAddr;
time_t mCallbackTS; // for UPDATES flag.
};
#define BITDHT_MGR_STATE_OFF 0
#define BITDHT_MGR_STATE_STARTUP 1
#define BITDHT_MGR_STATE_FINDSELF 2
#define BITDHT_MGR_STATE_ACTIVE 3
#define BITDHT_MGR_STATE_REFRESH 4
#define BITDHT_MGR_STATE_QUIET 5
#define BITDHT_MGR_STATE_FAILED 6
#define MAX_STARTUP_TIME 10
#define MAX_REFRESH_TIME 10
#define BITDHT_MGR_QUERY_FAILURE 1
#define BITDHT_MGR_QUERY_PEER_OFFLINE 2
#define BITDHT_MGR_QUERY_PEER_UNREACHABLE 3
#define BITDHT_MGR_QUERY_PEER_ONLINE 4
/*** NB: Nothing in here is protected by mutexes
* must be done at a higher level!
***/
class bdNodeManager: public bdNode, public BitDhtInterface
{
public:
bdNodeManager(bdNodeId *id, std::string dhtVersion, std::string bootfile, std::string bootfilebak, const std::string &filterfile, bdDhtFunctions *fns);
void iteration();
/***** Functions to Call down to bdNodeManager ****/
/* Friend Tracking */
virtual void addBadPeer(const struct sockaddr_in &addr, uint32_t source, uint32_t reason, uint32_t age);
virtual void updateKnownPeer(const bdId *id, uint32_t type, uint32_t flags);
/* Request DHT Peer Lookup */
/* Request Keyword Lookup */
virtual void addFindNode(bdNodeId *id, uint32_t mode);
virtual void removeFindNode(bdNodeId *id);
virtual void findDhtValue(bdNodeId *id, std::string key, uint32_t mode);
/***** Add / Remove Callback Clients *****/
virtual void addCallback(BitDhtCallback *cb);
virtual void removeCallback(BitDhtCallback *cb);
/***** Get Results Details *****/
virtual int getDhtPeerAddress(const bdNodeId *id, struct sockaddr_in &from);
virtual int getDhtValue(const bdNodeId *id, std::string key, std::string &value);
virtual int getDhtBucket(const int idx, bdBucket &bucket);
virtual int getDhtQueries(std::map<bdNodeId, bdQueryStatus> &queries);
virtual int getDhtQueryStatus(const bdNodeId *id, bdQuerySummary &query);
/***** Connection Interface ****/
virtual bool ConnectionRequest(struct sockaddr_in *laddr, bdNodeId *target, uint32_t mode, uint32_t delay, uint32_t start);
virtual void ConnectionAuth(bdId *srcId, bdId *proxyId, bdId *destId,
uint32_t mode, uint32_t loc, uint32_t bandwidth, uint32_t delay, uint32_t answer);
virtual void ConnectionOptions(uint32_t allowedModes, uint32_t flags);
virtual bool setAttachMode(bool on);
/* stats and Dht state */
virtual int startDht();
virtual int stopDht();
virtual int stateDht(); /* STOPPED, STARTING, ACTIVE, FAILED */
virtual uint32_t statsNetworkSize();
virtual uint32_t statsBDVersionSize(); /* same version as us! */
virtual uint32_t setDhtMode(uint32_t dhtFlags);
/******************* Internals *************************/
// Overloaded from bdnode for external node callback.
virtual void addPeer(const bdId *id, uint32_t peerflags);
// Overloaded from bdnode for external node callback.
virtual void callbackConnect(bdId *srcId, bdId *proxyId, bdId *destId,
int mode, int point, int param, int cbtype, int errcode);
int isBitDhtPacket(char *data, int size, struct sockaddr_in &from);
// this function is used by bdFilter (must be public!)
void doIsBannedCallback(const sockaddr_in *addr, bool *isAvailable, bool* isBanned);
private:
void doNodeCallback(const bdId *id, uint32_t peerflags);
void doPeerCallback(const bdId *id, uint32_t status);
void doValueCallback(const bdNodeId *id, std::string key, uint32_t status);
void doInfoCallback(const bdId *id, uint32_t type, uint32_t flags, std::string info);
int status();
int checkStatus();
int checkPingStatus();
int checkBadPeerStatus();
int SearchOutOfDate();
void startQueries();
int QueryRandomLocalNet();
void SearchForLocalNet();
std::map<bdNodeId, bdQueryPeer> mActivePeers;
std::list<BitDhtCallback *> mCallbacks;
uint32_t mMode;
time_t mModeTS;
time_t mStartTS;
time_t mSearchTS;
bool mSearchingDone;
bdDhtFunctions *mDhtFns;
uint32_t mNetworkSize;
uint32_t mBdNetworkSize;
bdBloom mBloomFilter;
bool mLocalNetEnhancements;
/* future node functions */
//addPeerPing(foundId);
//clearPing(it->first);
//PingStatus(it->first);
};
class bdDebugCallback: public BitDhtCallback
{
public:
~bdDebugCallback();
virtual int dhtPeerCallback(const bdId *id, uint32_t status);
virtual int dhtValueCallback(const bdNodeId *id, std::string key, uint32_t status);
virtual int dhtConnectCallback(const bdId *srcId, const bdId *proxyId, const bdId *destId,
uint32_t mode, uint32_t point, uint32_t param, uint32_t cbtype, uint32_t errcode);
virtual int dhtInfoCallback(const bdId *id, uint32_t type, uint32_t flags, std::string info);
};
#endif

File diff suppressed because it is too large Load Diff

View File

@ -1,127 +0,0 @@
/*******************************************************************************
* bitdht/bdmsgs.h *
* *
* BitDHT: An Flexible DHT library. *
* *
* Copyright 2010 by Robert Fernie <bitdht@lunamutt.com> *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Affero General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Affero General Public License for more details. *
* *
* You should have received a copy of the GNU Affero General Public License *
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
* *
*******************************************************************************/
#ifndef BITDHT_MSGS_H
#define BITDHT_MSGS_H
#include <stdio.h>
#include <inttypes.h>
#include <list>
#include "bitdht/bencode.h"
#include "bitdht/bdobj.h"
#include "bitdht/bdpeer.h"
#define BITDHT_MSG_TYPE_UNKNOWN 0
#define BITDHT_MSG_TYPE_PING 1
#define BITDHT_MSG_TYPE_PONG 2
#define BITDHT_MSG_TYPE_FIND_NODE 3
#define BITDHT_MSG_TYPE_REPLY_NODE 4
#define BITDHT_MSG_TYPE_GET_HASH 5
#define BITDHT_MSG_TYPE_REPLY_HASH 6
#define BITDHT_MSG_TYPE_REPLY_NEAR 7
#define BITDHT_MSG_TYPE_POST_HASH 8
#define BITDHT_MSG_TYPE_REPLY_POST 9
// THESE ARE EXTENSIONS
#define BITDHT_MSG_TYPE_CONNECT 20
// CONNECTIONS.
#define BITDHT_MSG_TYPE_CONNECT_REQUEST 101
#define BITDHT_MSG_TYPE_CONNECT_REPLY 102
#define BITDHT_MSG_TYPE_CONNECT_START 103
#define BITDHT_MSG_TYPE_CONNECT_ACK 104
// FANCY HASHES.
#define BITDHT_COMPACTNODEID_LEN 26
#define BITDHT_COMPACTPEERID_LEN 6
#define BE_Y_UNKNOWN 0
#define BE_Y_R 1
#define BE_Y_Q 2
/****** Known BD Version Strings ******/
#define BITDHT_VID_RS1 1
#define BITDHT_VID_UT 2
int bitdht_create_ping_msg(bdToken *tid, bdNodeId *id, bdToken *vid, char *msg, int avail);
int bitdht_response_ping_msg(bdToken *tid, bdNodeId *id, bdToken *vid, char *msg, int avail);
int bitdht_find_node_msg(bdToken *tid, bdNodeId *id, bdNodeId *target, bool localnet, char *msg, int avail);
int bitdht_resp_node_msg(bdToken *tid, bdNodeId *id, std::list<bdId> &nodes,
char *msg, int avail);
int bitdht_get_peers_msg(bdToken *tid, bdNodeId *id, bdNodeId *info_hash,
char *msg, int avail);
int bitdht_peers_reply_hash_msg(bdToken *tid, bdNodeId *id,
bdToken *token, std::list<std::string> &values,
char *msg, int avail);
int bitdht_peers_reply_closest_msg(bdToken *tid, bdNodeId *id,
bdToken *token, std::list<bdId> &nodes,
char *msg, int avail);
int bitdht_announce_peers_msg(bdToken *tid, bdNodeId *id, bdNodeId *info_hash,
uint32_t port, bdToken *token, char *msg, int avail);
int bitdht_reply_announce_msg(bdToken *tid, bdNodeId *id,
char *msg, int avail);
// Extensions.
int bitdht_connect_genmsg(bdToken *tid, bdNodeId *id, int msgtype, bdId *src, bdId *dest, int mode, int param, int status, char *msg, int avail);
//int response_peers_message()
//int response_closestnodes_message()
be_node *beMsgGetDictNode(be_node *node, const char *key);
int beMsgMatchString(be_node *n, const char *str, int len);
uint32_t beMsgGetY(be_node *n);
uint32_t beMsgType(be_node *n);
bool bitdht_msgtype(uint32_t msg_type, std::string &name);
uint32_t convertBdVersionToVID(bdVersion *version);
be_node *makeCompactPeerIds(std::list<std::string> &values);
be_node *makeCompactNodeIdString(std::list<bdId> &nodes);
int beMsgGetToken(be_node *n, bdToken &token);
int beMsgGetNodeId(be_node *n, bdNodeId &nodeId);
int beMsgGetBdId(be_node *n, bdId &id);
int beMsgGetListBdIds(be_node *n, std::list<bdId> &nodes);
int beMsgGetListStrings(be_node *n, std::list<std::string> &values);
int beMsgGetUInt32(be_node *n, uint32_t *port);
/* Low Level conversion functions */
int decodeCompactPeerId(struct sockaddr_in *addr, char *enc, int len);
std::string encodeCompactPeerId(struct sockaddr_in *addr);
int decodeCompactNodeId(bdId *id, char *enc, int len);
std::string encodeCompactNodeId(bdId *id);
#endif

File diff suppressed because it is too large Load Diff

View File

@ -1,284 +0,0 @@
/*******************************************************************************
* bitdht/bdnode.h *
* *
* BitDHT: An Flexible DHT library. *
* *
* Copyright 2010 by Robert Fernie <bitdht@lunamutt.com> *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Affero General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Affero General Public License for more details. *
* *
* You should have received a copy of the GNU Affero General Public License *
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
* *
*******************************************************************************/
#ifndef BITDHT_NODE_H
#define BITDHT_NODE_H
#include "bitdht/bdpeer.h"
#include "bitdht/bdquery.h"
#include "bitdht/bdstore.h"
#include "bitdht/bdobj.h"
#include "bitdht/bdhash.h"
#include "bitdht/bdhistory.h"
#include "bitdht/bdfilter.h"
#include "bitdht/bdconnection.h"
#include "bitdht/bdaccount.h"
#include "bitdht/bdfriendlist.h"
class bdFilter;
#define BD_QUERY_NEIGHBOURS 1
#define BD_QUERY_LOCALNET 2
#define BD_QUERY_HASH 3
/**********************************
* Running a node....
*
* run().
* loops through and checks out of date peers.
* handles searches.
* prints out dht Table.
*
The node handles the i/o traffic from peers.
It
ping, return
peers, return
hash store, return
hash get, return
respond queue.
query queue.
input -> call into recvFunction()
output -> call back to Udp().
*********/
class bdFilteredPeer ;
class bdNodeManager;
class bdNodeNetMsg
{
public:
bdNodeNetMsg(char *data, int size, struct sockaddr_in *addr);
~bdNodeNetMsg();
void print(std::ostream &out);
char *data;
int mSize;
struct sockaddr_in addr;
};
class bdNodePublisher
{
public:
/* simplified outgoing msg functions (for the managers) */
virtual void send_ping(bdId *id) = 0; /* message out */
virtual void send_query(bdId *id, bdNodeId *targetNodeId, bool localnet) = 0; /* message out */
virtual void send_connect_msg(bdId *id, int msgtype,
bdId *srcAddr, bdId *destAddr, int mode, int param, int status) = 0;
// internal Callback -> normally continues to callbackConnect().
virtual void callbackConnect(bdId *srcId, bdId *proxyId, bdId *destId,
int mode, int point, int param, int cbtype, int errcode) = 0;
};
class bdNode: public bdNodePublisher
{
public:
bdNode(bdNodeId *id, std::string dhtVersion, const std::string& bootfile, const std::string& bootfilebak, const std::string& filterfile,
bdDhtFunctions *fns, bdNodeManager* manager);
void init(); /* sets up the self referential classes (mQueryMgr & mConnMgr) */
void setNodeOptions(uint32_t optFlags);
uint32_t setNodeDhtMode(uint32_t dhtFlags);
/* startup / shutdown node */
void restartNode();
void shutdownNode();
void getOwnId(bdNodeId *id);
// virtual so manager can do callback.
// peer flags defined in bdiface.h
virtual void addPeer(const bdId *id, uint32_t peerflags);
void printState();
void checkPotentialPeer(bdId *id, bdId *src);
void addPotentialPeer(bdId *id, bdId *src);
void iterationOff();
void iteration();
void processRemoteQuery();
void updateStore();
bool addressBanned(const sockaddr_in &raddr) ;
bool getFilteredPeers(std::list<bdFilteredPeer> &peers);
//void loadFilteredPeers(const std::list<bdFilteredPeer> &peers);
/* simplified outgoing msg functions (for the managers) */
virtual void send_ping(bdId *id); /* message out */
virtual void send_query(bdId *id, bdNodeId *targetNodeId, bool localnet); /* message out */
virtual void send_connect_msg(bdId *id, int msgtype,
bdId *srcAddr, bdId *destAddr, int mode, int param, int status);
// This is implemented in bdManager.
// virtual void callbackConnect(bdId *srcId, bdId *proxyId, bdId *destId,
// int mode, int point, int param, int cbtype, int errcode);
/* interaction with outside world (Accessed by controller to deliver us msgs) */
int outgoingMsg(struct sockaddr_in *addr, char *msg, int *len);
void incomingMsg(struct sockaddr_in *addr, char *msg, int len);
// For Relay Mode switching.
void dropRelayServers();
void pingRelayServers();
// Below is internal Management of incoming / outgoing messages.
private:
/* internal interaction with network */
void sendPkt(char *msg, int len, struct sockaddr_in addr);
void recvPkt(char *msg, int len, struct sockaddr_in addr);
/* output functions (send msg) */
void msgout_ping(bdId *id, bdToken *transId);
void msgout_pong(bdId *id, bdToken *transId);
void msgout_find_node(bdId *id, bdToken *transId, bdNodeId *query, bool localnet);
void msgout_reply_find_node(bdId *id, bdToken *transId,
std::list<bdId> &peers);
void msgout_get_hash(bdId *id, bdToken *transId, bdNodeId *info_hash);
void msgout_reply_hash(bdId *id, bdToken *transId,
bdToken *token, std::list<std::string> &values);
void msgout_reply_nearest(bdId *id, bdToken *transId,
bdToken *token, std::list<bdId> &peers);
void msgout_post_hash(bdId *id, bdToken *transId, bdNodeId *info_hash,
uint32_t port, bdToken *token);
void msgout_reply_post(bdId *id, bdToken *transId);
/* input functions (once mesg is parsed) */
uint32_t parseVersion(bdToken *versionId);
void msgin_ping(bdId *id, bdToken *token, bdToken *versionId);
void msgin_pong(bdId *id, bdToken *transId, bdToken *versionId);
void msgin_find_node(bdId *id, bdToken *transId, bdNodeId *query, bool localnet);
void msgin_reply_find_node(bdId *id, bdToken *transId,
std::list<bdId> &entries);
void msgin_get_hash(bdId *id, bdToken *transId, bdNodeId *nodeid);
void msgin_reply_hash(bdId *id, bdToken *transId,
bdToken *token, std::list<std::string> &values);
void msgin_reply_nearest(bdId *id, bdToken *transId,
bdToken *token, std::list<bdId> &nodes);
void msgin_post_hash(bdId *id, bdToken *transId,
bdNodeId *info_hash, uint32_t port, bdToken *token);
void msgin_reply_post(bdId *id, bdToken *transId);
void msgout_connect_genmsg(bdId *id, bdToken *transId, int msgtype,
bdId *srcAddr, bdId *destAddr, int mode, int param, int status);
void msgin_connect_genmsg(bdId *id, bdToken *transId, int msgtype,
bdId *srcAddr, bdId *destAddr, int mode, int param, int status);
/* token handling */
void genNewToken(bdToken *token);
int queueQuery(bdId *id, bdNodeId *query, bdToken *transId, uint32_t query_type);
/* transId handling */
void genNewTransId(bdToken *token);
void registerOutgoingMsg(bdId *id, bdToken *transId, uint32_t msgType, bdNodeId *aboutId);
uint32_t registerIncomingMsg(bdId *id, bdToken *transId, uint32_t msgType, bdNodeId *aboutId);
void cleanupTransIdRegister();
void doStats();
/********** Variables **********/
private:
/**** Some Variables are Protected to allow inherited classes to use *****/
protected:
bdSpace mNodeSpace;
bdFilter mFilterPeers;
bdQueryManager *mQueryMgr;
bdConnectManager *mConnMgr;
bdNodeId mOwnId;
bdId mLikelyOwnId; // Try to workout own id address.
std::string mDhtVersion;
bdAccount mAccount;
bdStore mStore;
bdDhtFunctions *mFns;
bdHashSpace mHashSpace;
bdFriendList mFriendList;
bdPeerQueue mBadPeerQueue;
bdHistory mHistory; /* for understanding the DHT */
bdQueryHistory mQueryHistory; /* for determining old peers */
private:
uint32_t mNodeOptionFlags;
uint32_t mNodeDhtMode;
uint32_t mMaxAllowedMsgs;
uint32_t mRelayMode;
std::list<bdRemoteQuery> mRemoteQueries;
std::list<bdId> mPotentialPeers;
std::list<bdNodeNetMsg *> mOutgoingMsgs;
std::list<bdNodeNetMsg *> mIncomingMsgs;
};
#endif // BITDHT_NODE_H

View File

@ -1,48 +0,0 @@
/*******************************************************************************
* bitdht/bdobj.cc *
* *
* BitDHT: An Flexible DHT library. *
* *
* Copyright 2010 by Robert Fernie <bitdht@lunamutt.com> *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Affero General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Affero General Public License for more details. *
* *
* You should have received a copy of the GNU Affero General Public License *
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
* *
*******************************************************************************/
#include "bitdht/bdobj.h"
void bdPrintTransId(std::ostream &out, bdToken *transId)
{
//out << transId->data;
bdPrintToken(out, transId);
return;
}
void bdPrintToken(std::ostream &out, bdToken *token)
{
for(unsigned int i = 0; i < token->len; i++)
{
out << std::hex << (uint32_t) token->data[i];
}
out << std::dec;
}
void bdPrintCompactPeerId(std::ostream &out, std::string /*cpi*/ )
{
out << "DummyCompactPeerId";
}

View File

@ -1,59 +0,0 @@
/*******************************************************************************
* bitdht/bdobj.h *
* *
* BitDHT: An Flexible DHT library. *
* *
* Copyright 2010 by Robert Fernie <bitdht@lunamutt.com> *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Affero General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Affero General Public License for more details. *
* *
* You should have received a copy of the GNU Affero General Public License *
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
* *
*******************************************************************************/
#ifndef BITDHT_OBJECTS_H
#define BITDHT_OBJECTS_H
#define BITDHT_TOKEN_MAX_LEN 20
#include <iostream>
#include <inttypes.h>
class bdToken
{
public:
bdToken() :len(0) { return; }
uint32_t len;
unsigned char data[BITDHT_TOKEN_MAX_LEN];
};
class bdCompactIds
{
public:
bdCompactIds() :len(0) { return; }
uint32_t len;
unsigned char data[BITDHT_TOKEN_MAX_LEN];
};
class bdVersion
{
public:
bdVersion() :len(0) { return; }
uint32_t len;
unsigned char data[BITDHT_TOKEN_MAX_LEN];
};
void bdPrintTransId(std::ostream &out, bdToken *transId);
void bdPrintToken(std::ostream &out, bdToken *transId);
void bdPrintCompactPeerId(std::ostream &out, std::string cpi);
#endif

File diff suppressed because it is too large Load Diff

View File

@ -1,212 +0,0 @@
/*******************************************************************************
* bitdht/bdpeer.h *
* *
* BitDHT: An Flexible DHT library. *
* *
* Copyright 2010 by Robert Fernie <bitdht@lunamutt.com> *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Affero General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Affero General Public License for more details. *
* *
* You should have received a copy of the GNU Affero General Public License *
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
* *
*******************************************************************************/
#ifndef BITDHT_PEER_H
#define BITDHT_PEER_H
#include "bitdht/bdiface.h"
#include <time.h>
/*******
* These type of parameters are now DHT Function dependent
*
#define BITDHT_BUCKET_SIZE 20
#define BITDHT_BUCKET_SIZE_BITS 5
#define BITDHT_N_BUCKETS BITDHT_KEY_BITLEN
*
*
***/
/***
* DEFINED in bdiface.h
* #define BITDHT_KEY_LEN 20
* #define BITDHT_KEY_INTLEN 5
* #define BITDHT_KEY_BITLEN 160
***/
#define BITDHT_ULLONG_BITS 64
#define BITDHT_MAX_RESPONSE_PERIOD (15)
#define BITDHT_MAX_SEND_PERIOD 300 // 5 minutes.
#define BITDHT_MAX_RECV_PERIOD (BITDHT_MAX_SEND_PERIOD + BITDHT_MAX_RESPONSE_PERIOD) // didn't respond to a ping.
// Properly out of date.
#define BITDHT_DISCARD_PERIOD (2 * BITDHT_MAX_SEND_PERIOD + BITDHT_MAX_RESPONSE_PERIOD) // didn't respond to two pings.
// Must have a FLAG by this time. (Make it really quick - so we through away the rubbish).
#include <list>
#include <string>
#include <map>
#include <vector>
/****
* DEFINED in bdiface.h
*
* class bdNodeId
* {
* public:
* unsigned char data[BITDHT_KEY_LEN];
* };
****/
/****
* DEFINED in bdiface.h
*
class bdMetric: public bdNodeId {};
class bdId
{
public:
bdId();
bdId(bdNodeId in_id, struct sockaddr_in in_addr);
struct sockaddr_in addr;
bdNodeId id;
};
*
*********/
//void bdRandomNodeId(bdNodeId *id);
// Only Functions that are common for all Dhts.
// zero, basic comparisons..
void bdZeroNodeId(bdNodeId *id);
//void bdRandomId(bdId *id);
//int bdDistance(const bdNodeId *a, const bdNodeId *b, bdMetric *r);
//int bdBucketDistance(const bdMetric *m);
//int bdBucketDistance(const bdNodeId *a, const bdNodeId *b);
//int operator<(const bdMetric &a, const bdMetric &b);
//int operator<(const struct sockaddr_in &a, const struct sockaddr_in &b);
int operator<(const bdNodeId &a, const bdNodeId &b);
int operator<(const bdId &a, const bdId &b);
int operator==(const bdNodeId &a, const bdNodeId &b);
int operator==(const bdId &a, const bdId &b);
//void bdRandomMidId(const bdNodeId *target, const bdNodeId *other, bdNodeId *mid);
//void bdPrintId(std::ostream &out, const bdId *a);
//void bdPrintNodeId(std::ostream &out, const bdNodeId *a);
//std::string bdConvertToPrintable(std::string input);
/****
* DEFINED in bdiface.h
*
class bdPeer
{
public:
bdId mPeerId;
uint32_t mPeerFlags;
time_t mLastSendTime;
time_t mLastRecvTime;
time_t mFoundTime; // time stamp that peer was found
};
class bdBucket
{
public:
bdBucket();
// list so we can queue properly
std::list<bdPeer> entries;
};
*
*
*****/
class bdSpace
{
public:
bdSpace(bdNodeId *ownId, bdDhtFunctions *fns);
int clear();
int setAttachedFlag(uint32_t withflags, int count);
/* accessors */
int find_nearest_nodes(const bdNodeId *id, int number,
std::multimap<bdMetric, bdId> &nearest);
int find_nearest_nodes_with_flags(const bdNodeId *id, int number,
std::list<bdId> excluding,
std::multimap<bdMetric, bdId> &nearest, uint32_t with_flag);
int find_node(const bdNodeId *id, int number,
std::list<bdId> &matchIds, uint32_t with_flag);
int find_exactnode(const bdId *id, bdPeer &peer);
// switched to more efficient single sweep.
//int out_of_date_peer(bdId &id); // side-effect updates, send flag on peer.
int scanOutOfDatePeers(std::list<bdId> &peerIds);
int updateAttachedPeers();
int add_peer(const bdId *id, uint32_t mode);
int printDHT();
int getDhtBucket(const int idx, bdBucket &bucket);
uint32_t calcNetworkSize();
uint32_t calcNetworkSizeWithFlag(uint32_t withFlag);
uint32_t calcNetworkSizeWithFlag_old(uint32_t withFlag);
uint32_t calcSpaceSize();
uint32_t calcSpaceSizeWithFlag(uint32_t withFlag);
/* special function to enable DHT localisation (i.e find peers from own network) */
bool findRandomPeerWithFlag(bdId &id, uint32_t withFlag);
/* strip out flags - to switch in/out of relay mode */
int clean_node_flags(uint32_t flags);
/* to add later */
int updateOwnId(bdNodeId *newOwnId);
/* flag peer */
bool flagpeer(const bdId *id, uint32_t flags, uint32_t ex_flags);
private:
std::vector<bdBucket> buckets;
bdNodeId mOwnId;
bdDhtFunctions *mFns;
uint32_t mAttachedFlags;
uint32_t mAttachedCount;
time_t mAttachTS;
};
#endif

File diff suppressed because it is too large Load Diff

View File

@ -1,157 +0,0 @@
/*******************************************************************************
* bitdht/bdquery.h *
* *
* BitDHT: An Flexible DHT library. *
* *
* Copyright 2010 by Robert Fernie <bitdht@lunamutt.com> *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Affero General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Affero General Public License for more details. *
* *
* You should have received a copy of the GNU Affero General Public License *
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
* *
*******************************************************************************/
#ifndef BITDHT_QUERY_H
#define BITDHT_QUERY_H
#include "bitdht/bdiface.h"
#include "bitdht/bdpeer.h"
#include "bitdht/bdobj.h"
/* Query result flags are in bdiface.h */
#define BITDHT_MIN_QUERY_AGE 10
#define BITDHT_MAX_QUERY_AGE 300 /* Query Should take <1 minute, so 5 minutes sounds reasonable */
class bdQuery
{
public:
bdQuery(const bdNodeId *id, std::list<bdId> &startList, uint32_t queryFlags,
bdDhtFunctions *fns);
// get the answer.
bool result(std::list<bdId> &answer);
bool proxies(std::list<bdId> &answer);
bool potentialProxies(std::list<bdId> &answer);
// returning results get passed to all queries.
//void addNode(const bdId *id, int mode);
int nextQuery(bdId &id, bdNodeId &targetId);
int addPeer(const bdId *id, uint32_t mode);
int addPotentialPeer(const bdId *id, const bdId *src, uint32_t srcmode);
int printQuery();
// searching for
bdNodeId mId;
bdMetric mLimit;
uint32_t mState;
time_t mQueryTS;
uint32_t mQueryFlags;
int32_t mSearchTime;
int32_t mQueryIdlePeerRetryPeriod; // seconds between retries.
//private:
// Closest Handling Fns.
int addClosestPeer(const bdId *id, uint32_t mode);
// Potential Handling Fns.
int worthyPotentialPeer(const bdId *id);
int updatePotentialPeer(const bdId *id, uint32_t mode, uint32_t addType);
int trimPotentialPeers_FixedLength();
int trimPotentialPeers_toClosest();
int removeOldPotentialPeers();
// Proxy Handling Fns.
int addProxy(const bdId *id, const bdId *src, uint32_t srcmode);
int updateProxy(const bdId *id, uint32_t mode);
int updateProxyList(const bdId *id, uint32_t mode, std::list<bdPeer> &searchProxyList);
int trimProxies();
// closest peers.
std::multimap<bdMetric, bdPeer> mClosest;
std::multimap<bdMetric, bdPeer> mPotentialPeers;
time_t mPotPeerCleanTS; // periodic cleanup of PotentialPeers.
uint32_t mRequiredPeerFlags;
std::list<bdPeer> mProxiesUnknown;
std::list<bdPeer> mProxiesFlagged;
int mClosestListSize;
bdDhtFunctions *mFns;
};
#if 0
class bdQueryStatus
{
public:
uint32_t mStatus;
uint32_t mQFlags;
std::list<bdId> mResults;
};
#endif
/* this is just a container class.
* we locally seach for this, once then discard.
*/
class bdRemoteQuery
{
public:
bdRemoteQuery(bdId *id, bdNodeId *query, bdToken *transId, uint32_t query_type);
bdId mId;
bdNodeId mQuery;
bdToken mTransId;
uint32_t mQueryType;
time_t mQueryTS;
};
class bdQueryHistoryList
{
public:
bdQueryHistoryList();
bool addIncomingQuery(time_t recvd, const bdNodeId *aboutId); // calcs and returns mBadPeer
bool cleanupMsgs(time_t before); // returns true if empty.
bool mBadPeer;
std::multimap<time_t, bdNodeId> mList;
};
class bdQueryHistory
{
public:
bdQueryHistory();
bool addIncomingQuery(time_t recvd, const bdId *id, const bdNodeId *aboutId);
void printMsgs();
void cleanupOldMsgs();
bool isBadPeer(const bdId *id);
int mStorePeriod;
std::map<bdId, bdQueryHistoryList> mHistory;
};
#endif

View File

@ -1,379 +0,0 @@
/*******************************************************************************
* bitdht/bdquerymgr.cc *
* *
* BitDHT: An Flexible DHT library. *
* *
* Copyright 2011 by Robert Fernie <bitdht@lunamutt.com> *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Affero General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Affero General Public License for more details. *
* *
* You should have received a copy of the GNU Affero General Public License *
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
* *
*******************************************************************************/
#include "bitdht/bdquerymgr.h"
#include "bitdht/bdnode.h"
#include <stdio.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <iomanip>
#define BITDHT_QUERY_START_PEERS 10
#define BITDHT_QUERY_NEIGHBOUR_PEERS 8
#define BITDHT_MAX_REMOTE_QUERY_AGE 10
/****
* #define DEBUG_NODE_MULTIPEER 1
* #define DEBUG_NODE_MSGS 1
* #define DEBUG_NODE_ACTIONS 1
* #define DEBUG_NODE_MSGIN 1
* #define DEBUG_NODE_MSGOUT 1
***/
//#define DEBUG_NODE_MSGS 1
bdQueryManager::bdQueryManager(bdSpace *space, bdDhtFunctions *fns, bdNodePublisher *pub)
:mNodeSpace(space), mFns(fns), mPub(pub)
{
}
/***** Startup / Shutdown ******/
void bdQueryManager::shutdownQueries()
{
/* clear the queries */
std::list<bdQuery *>::iterator it;
for(it = mLocalQueries.begin(); it != mLocalQueries.end();it++)
{
delete (*it);
}
mLocalQueries.clear();
}
void bdQueryManager::printQueries()
{
std::cerr << "bdQueryManager::printQueries()";
std::cerr << std::endl;
int i = 0;
std::list<bdQuery *>::iterator it;
for(it = mLocalQueries.begin(); it != mLocalQueries.end(); it++, i++)
{
fprintf(stderr, "Query #%d:\n", i);
(*it)->printQuery();
fprintf(stderr, "\n");
}
}
int bdQueryManager::iterateQueries(int maxQueries)
{
#ifdef DEBUG_NODE_MULTIPEER
std::cerr << "bdQueryManager::iterateQueries() of Peer: ";
mFns->bdPrintNodeId(std::cerr, &mOwnId);
std::cerr << std::endl;
#endif
/* allow each query to send up to one query... until maxMsgs has been reached */
int numQueries = mLocalQueries.size();
int sentQueries = 0;
int i = 0;
bdId id;
bdNodeId targetNodeId;
while((i < numQueries) && (sentQueries < maxQueries))
{
bdQuery *query = mLocalQueries.front();
mLocalQueries.pop_front();
mLocalQueries.push_back(query);
/* go through the possible queries */
if (query->nextQuery(id, targetNodeId))
{
#ifdef DEBUG_NODE_MSGS
std::cerr << "bdQueryManager::iteration() send_query(";
mFns->bdPrintId(std::cerr, &id);
std::cerr << ",";
mFns->bdPrintNodeId(std::cerr, &targetNodeId);
std::cerr << ")";
std::cerr << std::endl;
#endif
mPub->send_query(&id, &targetNodeId, false);
sentQueries++;
}
i++;
}
#ifdef DEBUG_NODE_ACTIONS
std::cerr << "bdQueryManager::iteration() maxMsgs: " << maxMsgs << " sentPings: " << sentPings;
std::cerr << " / " << allowedPings;
std::cerr << " sentQueries: " << sentQueries;
std::cerr << " / " << numQueries;
std::cerr << std::endl;
#endif
//printQueries();
return sentQueries;
}
bool bdQueryManager::checkPotentialPeer(bdId *id, bdId *src)
{
bool isWorthyPeer = false;
/* also push to queries */
std::list<bdQuery *>::iterator it;
for(it = mLocalQueries.begin(); it != mLocalQueries.end(); it++)
{
if ((*it)->addPotentialPeer(id, src, 0))
{
isWorthyPeer = true;
}
}
if (!isWorthyPeer)
{
isWorthyPeer = checkWorthyPeerSources(src);
}
return isWorthyPeer;
}
void bdQueryManager::addPeer(const bdId *id, uint32_t peerflags)
{
#ifdef DEBUG_NODE_ACTIONS
fprintf(stderr, "bdQueryManager::addPeer(");
mFns->bdPrintId(std::cerr, id);
fprintf(stderr, ")\n");
#endif
/* iterate through queries */
std::list<bdQuery *>::iterator it;
for(it = mLocalQueries.begin(); it != mLocalQueries.end(); it++)
{
(*it)->addPeer(id, peerflags);
}
}
/************************************ Query Details *************************/
void bdQueryManager::addQuery(const bdNodeId *id, uint32_t qflags)
{
std::list<bdId> startList;
std::multimap<bdMetric, bdId> nearest;
std::multimap<bdMetric, bdId>::iterator it;
mNodeSpace->find_nearest_nodes(id, BITDHT_QUERY_START_PEERS, nearest);
#ifdef DEBUG_NODE_ACTIONS
fprintf(stderr, "bdQueryManager::addQuery(");
mFns->bdPrintNodeId(std::cerr, id);
fprintf(stderr, ")\n");
#endif
for(it = nearest.begin(); it != nearest.end(); it++)
{
startList.push_back(it->second);
}
bdQuery *query = new bdQuery(id, startList, qflags, mFns);
mLocalQueries.push_back(query);
}
void bdQueryManager::clearQuery(const bdNodeId *rmId)
{
std::list<bdQuery *>::iterator it;
for(it = mLocalQueries.begin(); it != mLocalQueries.end();)
{
if ((*it)->mId == *rmId)
{
bdQuery *query = (*it);
it = mLocalQueries.erase(it);
delete query;
}
else
{
it++;
}
}
}
void bdQueryManager::QueryStatus(std::map<bdNodeId, bdQueryStatus> &statusMap)
{
std::list<bdQuery *>::iterator it;
for(it = mLocalQueries.begin(); it != mLocalQueries.end(); it++)
{
bdQueryStatus status;
status.mStatus = (*it)->mState;
status.mQFlags = (*it)->mQueryFlags;
(*it)->result(status.mResults);
statusMap[(*it)->mId] = status;
}
}
int bdQueryManager::QuerySummary(const bdNodeId *id, bdQuerySummary &query)
{
std::list<bdQuery *>::iterator it;
for(it = mLocalQueries.begin(); it != mLocalQueries.end(); it++)
{
if ((*it)->mId == *id)
{
query.mId = (*it)->mId;
query.mLimit = (*it)->mLimit;
query.mState = (*it)->mState;
query.mQueryTS = (*it)->mQueryTS;
query.mQueryFlags = (*it)->mQueryFlags;
query.mSearchTime = (*it)->mSearchTime;
query.mClosest = (*it)->mClosest;
query.mPotentialPeers = (*it)->mPotentialPeers;
query.mProxiesUnknown = (*it)->mProxiesUnknown;
query.mProxiesFlagged = (*it)->mProxiesFlagged;
query.mQueryIdlePeerRetryPeriod = (*it)->mQueryIdlePeerRetryPeriod;
return 1;
}
}
return 0;
}
/* Extract Results from Peer Queries */
#define BDQRYMGR_RESULTS 1
#define BDQRYMGR_PROXIES 2
#define BDQRYMGR_POTPROXIES 3
int bdQueryManager::getResults(bdNodeId *target, std::list<bdId> &answer, int querytype)
{
/* grab any peers from any existing query */
int results = 0;
std::list<bdQuery *>::iterator qit;
for(qit = mLocalQueries.begin(); qit != mLocalQueries.end(); qit++)
{
if (!((*qit)->mId == (*target)))
{
continue;
}
#ifdef DEBUG_NODE_CONNECTION
std::cerr << "bdQueryManager::getResults() Found Matching Query";
std::cerr << std::endl;
#endif
switch(querytype)
{
default:
case BDQRYMGR_RESULTS:
results = (*qit)->result(answer);
break;
case BDQRYMGR_PROXIES:
results = (*qit)->proxies(answer);
break;
case BDQRYMGR_POTPROXIES:
results = (*qit)->potentialProxies(answer);
break;
}
/* will only be one matching query.. so end loop */
return results;
}
return 0;
}
int bdQueryManager::result(bdNodeId *target, std::list<bdId> &answer)
{
return getResults(target, answer, BDQRYMGR_RESULTS);
}
int bdQueryManager::proxies(bdNodeId *target, std::list<bdId> &answer)
{
return getResults(target, answer, BDQRYMGR_PROXIES);
}
int bdQueryManager::potentialProxies(bdNodeId *target, std::list<bdId> &answer)
{
return getResults(target, answer, BDQRYMGR_POTPROXIES);
}
/************ WORTHY PEERS **********/
#define MAX_WORTHY_PEER_AGE 15
void bdQueryManager::addWorthyPeerSource(bdId *src)
{
time_t now = time(NULL);
bdPeer peer;
peer.mPeerId = *src;
peer.mFoundTime = now;
#ifdef DEBUG_NODE_ACTIONS
std::cerr << "bdQueryManager::addWorthyPeerSource(";
mFns->bdPrintId(std::cerr, src);
std::cerr << ")" << std::endl;
#endif
mWorthyPeerSources.push_back(peer);
}
bool bdQueryManager::checkWorthyPeerSources(bdId *src)
{
if (!src)
return false;
time_t now = time(NULL);
std::list<bdPeer>::iterator it;
for(it = mWorthyPeerSources.begin(); it != mWorthyPeerSources.end(); )
{
if (now - it->mFoundTime > MAX_WORTHY_PEER_AGE)
{
#ifdef DEBUG_NODE_ACTIONS
std::cerr << "bdQueryManager::checkWorthyPeerSource() Discard old Source: ";
mFns->bdPrintId(std::cerr, &(it->mPeerId));
std::cerr << std::endl;
#endif
it = mWorthyPeerSources.erase(it);
}
else
{
if (it->mPeerId == *src)
{
#ifdef DEBUG_NODE_ACTIONS
std::cerr << "bdQueryManager::checkWorthyPeerSource(";
mFns->bdPrintId(std::cerr, src);
std::cerr << ") = true" << std::endl;
#endif
return true;
}
it++;
}
}
return false;
}

View File

@ -1,73 +0,0 @@
/*******************************************************************************
* bitdht/bdquerymgr.h *
* *
* BitDHT: An Flexible DHT library. *
* *
* Copyright 2011 by Robert Fernie <bitdht@lunamutt.com> *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Affero General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Affero General Public License for more details. *
* *
* You should have received a copy of the GNU Affero General Public License *
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
* *
*******************************************************************************/
#ifndef BITDHT_QUERY_MANAGER_H
#define BITDHT_QUERY_MANAGER_H
#include "bitdht/bdquery.h"
class bdNodePublisher;
class bdQueryManager
{
public:
bdQueryManager(bdSpace *space, bdDhtFunctions *fns, bdNodePublisher *pub);
void shutdownQueries();
void printQueries();
int iterateQueries(int maxqueries);
bool checkPotentialPeer(bdId *id, bdId *src);
void addPeer(const bdId *id, uint32_t peerflags);
void addQuery(const bdNodeId *id, uint32_t qflags);
void clearQuery(const bdNodeId *id);
void QueryStatus(std::map<bdNodeId, bdQueryStatus> &statusMap);
int QuerySummary(const bdNodeId *id, bdQuerySummary &query);
int result(bdNodeId *target, std::list<bdId> &answer);
int proxies(bdNodeId *target, std::list<bdId> &answer);
int potentialProxies(bdNodeId *target, std::list<bdId> &answer);
// extra "Worthy Peers" we will want to ping.
void addWorthyPeerSource(bdId *src);
bool checkWorthyPeerSources(bdId *src);
private:
int getResults(bdNodeId *target, std::list<bdId> &answer, int querytype);
/* NB: No Mutex Protection... Single threaded, Mutex at higher level!
*/
bdSpace *mNodeSpace;
bdDhtFunctions *mFns;
bdNodePublisher *mPub;
std::list<bdQuery *> mLocalQueries;
std::list<bdPeer> mWorthyPeerSources;
};
#endif // BITDHT_QUERY_MANAGER_H

View File

@ -1,347 +0,0 @@
/*******************************************************************************
* bitdht/bdstddht.cc *
* *
* BitDHT: An Flexible DHT library. *
* *
* Copyright 2011 by Robert Fernie <bitdht@lunamutt.com> *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Affero General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Affero General Public License for more details. *
* *
* You should have received a copy of the GNU Affero General Public License *
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
* *
*******************************************************************************/
#include "bitdht/bdstddht.h"
#include "bitdht/bdpeer.h"
#include "util/bdrandom.h"
#include "util/bdstring.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <limits.h>
#include <iostream>
#include <iomanip>
/**
* #define BITDHT_DEBUG 1
**/
void bdStdRandomId(bdId *id)
{
bdStdRandomNodeId(&(id->id));
id->addr.sin_addr.s_addr = bdRandom::random_u32();
id->addr.sin_port = (bdRandom::random_u32() % USHRT_MAX);
return;
}
void bdStdRandomNodeId(bdNodeId *id)
{
uint32_t *a_data = (uint32_t *) id->data;
for(int i = 0; i < BITDHT_KEY_INTLEN; i++)
{
a_data[i] = bdRandom::random_u32();
}
return;
}
void bdStdZeroNodeId(bdNodeId *id)
{
uint32_t *a_data = (uint32_t *) id->data;
for(int i = 0; i < BITDHT_KEY_INTLEN; i++)
{
a_data[i] = 0;
}
return;
}
// Ignore differences in port....
// must be careful which one we accept after this.
// can could end-up with the wrong port.
// However this only matters with firewalled peers anyway.
// So not too serious.
bool bdStdSimilarId(const bdId *n1, const bdId *n2)
{
if (n1->id == n2->id)
{
if (n1->addr.sin_addr.s_addr == n2->addr.sin_addr.s_addr)
{
return true;
}
}
return false;
}
bool bdStdUpdateSimilarId(bdId *dest, const bdId *src)
{
/* only difference that's currently allowed */
if (dest->addr.sin_port == src->addr.sin_port)
{
/* no update required */
return false;
}
dest->addr.sin_port = src->addr.sin_port;
return true;
}
/* fills in bdNodeId r, with XOR of a and b */
int bdStdDistance(const bdNodeId *a, const bdNodeId *b, bdMetric *r)
{
uint8_t *a_data = (uint8_t *) a->data;
uint8_t *b_data = (uint8_t *) b->data;
uint8_t *ans = (uint8_t *) r->data;
for(int i = 0; i < BITDHT_KEY_LEN; i++)
{
*(ans++) = *(a_data++) ^ *(b_data++);
}
return 1;
}
void bdStdRandomMidId(const bdNodeId *target, const bdNodeId *other, bdNodeId *midId)
{
bdMetric dist;
/* get distance between a & c */
bdStdDistance(target, other, &dist);
/* generate Random Id */
bdStdRandomNodeId(midId);
/* zero bits of Random Id until under 1/2 of distance
* done in bytes for ease... matches one extra byte than distance = 0
* -> hence wierd order of operations
*/
//bool done = false;
for(int i = 0; i < BITDHT_KEY_LEN; i++)
{
midId->data[i] = target->data[i];
if (dist.data[i] != 0)
break;
}
}
int bdStdLoadNodeId(bdNodeId *id, std::string input)
{
uint8_t *a_data = (uint8_t *) id->data;
uint32_t reqlen = BITDHT_KEY_LEN * 2;
if (input.size() < reqlen)
{
return 0;
}
for(int i = 0; i < BITDHT_KEY_LEN; i++)
{
char ch1 = input[2 * i];
char ch2 = input[2 * i + 1];
uint8_t value1 = 0;
uint8_t value2 = 0;
/* do char1 */
if (ch1 >= '0' && ch1 <= '9')
value1 = (ch1 - '0');
else if (ch1 >= 'A' && ch1 <= 'F')
value1 = (ch1 - 'A' + 10);
else if (ch1 >= 'a' && ch1 <= 'f')
value1 = (ch1 - 'a' + 10);
/* do char2 */
if (ch2 >= '0' && ch2 <= '9')
value2 = (ch2 - '0');
else if (ch2 >= 'A' && ch2 <= 'F')
value2 = (ch2 - 'A' + 10);
else if (ch2 >= 'a' && ch2 <= 'f')
value2 = (ch2 - 'a' + 10);
a_data[i] = (value1 << 4) + value2;
}
return 1;
}
std::string bdStdConvertToPrintable(std::string input)
{
std::string out;
for(uint32_t i = 0; i < input.length(); i++)
{
/* sensible chars */
if ((input[i] > 31) && (input[i] < 127))
{
out += input[i];
}
else
{
bd_sprintf_append(out, "[0x%x]", (uint32_t) input[i]);
}
}
return out;
}
void bdStdPrintNodeId(std::ostream &out, const bdNodeId *a)
{
std::string s;
bdStdPrintNodeId(s, a, true);
out << s;
}
void bdStdPrintNodeId(std::string &out, const bdNodeId *a, bool append)
{
if (!append)
{
out.clear();
}
for(int i = 0; i < BITDHT_KEY_LEN; i++)
{
bd_sprintf_append(out, "%02x", (uint32_t) (a->data)[i]);
}
}
void bdStdPrintId(std::ostream &out, const bdId *a)
{
std::string s;
bdStdPrintId(s, a, false);
out << s;
}
void bdStdPrintId(std::string &out, const bdId *a, bool append)
{
bdStdPrintNodeId(out, &(a->id), append);
bd_sprintf_append(out, " ip:%s:%u", bdnet_inet_ntoa(a->addr.sin_addr).c_str(), ntohs(a->addr.sin_port));
}
/* returns 0-160 depending on bucket */
int bdStdBucketDistance(const bdNodeId *a, const bdNodeId *b)
{
bdMetric m;
bdStdDistance(a, b, &m);
return bdStdBucketDistance(&m);
}
/* returns 0-160 depending on bucket */
int bdStdBucketDistance(const bdMetric *m)
{
for(int i = 0; i < BITDHT_KEY_BITLEN; i++)
{
int bit = BITDHT_KEY_BITLEN - i - 1;
int byte = i / 8;
int bbit = 7 - (i % 8);
unsigned char comp = (1 << bbit);
#ifdef BITDHT_DEBUG
fprintf(stderr, "bdStdBucketDistance: bit:%d byte:%d bbit:%d comp:%x, data:%x\n", bit, byte, bbit, comp, m->data[byte]);
#endif
if (comp & m->data[byte])
{
return bit;
}
}
return 0;
}
bdStdDht::bdStdDht()
{
return;
}
/* setup variables */
uint16_t bdStdDht::bdNumBuckets()
{
return BITDHT_STANDARD_N_BUCKETS;
}
uint16_t bdStdDht::bdNodesPerBucket() /* used for bdspace */
{
return BITDHT_STANDARD_BUCKET_SIZE;
}
uint16_t bdStdDht::bdNumQueryNodes() /* used for queries */
{
return BITDHT_STANDARD_BUCKET_SIZE;
}
uint16_t bdStdDht::bdBucketBitSize()
{
return BITDHT_STANDARD_BUCKET_SIZE_BITS;
}
int bdStdDht::bdDistance(const bdNodeId *n1, const bdNodeId *n2, class bdMetric *metric)
{
return bdStdDistance(n1, n2, metric);
}
int bdStdDht::bdBucketDistance(const bdNodeId *n1, const bdNodeId *n2)
{
return bdStdBucketDistance(n1, n2);
}
int bdStdDht::bdBucketDistance(const bdMetric *metric)
{
return bdStdBucketDistance(metric);
}
bool bdStdDht::bdSimilarId(const bdId *id1, const bdId *id2)
{
return bdStdSimilarId(id1, id2);
}
bool bdStdDht::bdUpdateSimilarId(bdId *dest, const bdId *src)
{
return bdStdUpdateSimilarId(dest, src);
}
void bdStdDht::bdRandomMidId(const bdNodeId *target, const bdNodeId *other, bdNodeId *mid)
{
return bdStdRandomMidId(target, other, mid);
}
void bdStdDht::bdPrintId(std::ostream &out, const bdId *a)
{
return bdStdPrintId(out, a);
}
void bdStdDht::bdPrintNodeId(std::ostream &out, const bdNodeId *a)
{
return bdStdPrintNodeId(out, a);
}
/**************************/
bdModDht::bdModDht()
:mNodesPerBucket(BITDHT_STANDARD_BUCKET_SIZE)
{
return;
}
void bdModDht::setNodesPerBucket(uint16_t nodesPerBucket)
{
mNodesPerBucket = nodesPerBucket;
return;
}
uint16_t bdModDht::bdNodesPerBucket() /* used for bdspace */
{
return mNodesPerBucket;
}

View File

@ -1,100 +0,0 @@
/*******************************************************************************
* bitdht/bdstddht.h *
* *
* BitDHT: An Flexible DHT library. *
* *
* Copyright 2011 by Robert Fernie <bitdht@lunamutt.com> *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Affero General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Affero General Public License for more details. *
* *
* You should have received a copy of the GNU Affero General Public License *
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
* *
*******************************************************************************/
#ifndef BITDHT_STANDARD_DHT_H
#define BITDHT_STANDARD_DHT_H
#include "bitdht/bdiface.h"
#define BITDHT_STANDARD_BUCKET_SIZE 10 // 20 too many per query?
#define BITDHT_STANDARD_BUCKET_SIZE_BITS 5
#define BITDHT_STANDARD_N_BUCKETS BITDHT_KEY_BITLEN
#include <list>
#include <string>
#include <map>
#include <vector>
void bdStdRandomNodeId(bdNodeId *id);
void bdStdZeroNodeId(bdNodeId *id);
void bdStdRandomId(bdId *id);
int bdStdDistance(const bdNodeId *a, const bdNodeId *b, bdMetric *r);
int bdStdBucketDistance(const bdMetric *m);
int bdStdBucketDistance(const bdNodeId *a, const bdNodeId *b);
void bdStdRandomMidId(const bdNodeId *target, const bdNodeId *other, bdNodeId *mid);
int bdStdLoadNodeId(bdNodeId *id, std::string input);
void bdStdPrintId(std::ostream &out, const bdId *a);
void bdStdPrintId(std::string &out, const bdId *a, bool append);
void bdStdPrintNodeId(std::ostream &out, const bdNodeId *a);
void bdStdPrintNodeId(std::string &out, const bdNodeId *a, bool append);
std::string bdStdConvertToPrintable(std::string input);
//uint32_t bdStdSimilarNode(const bdId*, const bdId*);
class bdStdDht: public bdDhtFunctions
{
public:
bdStdDht();
/* setup variables */
virtual uint16_t bdNumBuckets();
virtual uint16_t bdNodesPerBucket(); /* used for bdspace */
virtual uint16_t bdNumQueryNodes(); /* used for queries */
virtual uint16_t bdBucketBitSize();
virtual int bdDistance(const bdNodeId *n1, const bdNodeId *n2, bdMetric *metric);
virtual int bdBucketDistance(const bdNodeId *n1, const bdNodeId *n2);
virtual int bdBucketDistance(const bdMetric *metric);
virtual bool bdSimilarId(const bdId *id1, const bdId *id2);
virtual bool bdUpdateSimilarId(bdId *dest, const bdId *src); /* returns true if update was necessary */
virtual void bdRandomMidId(const bdNodeId *target, const bdNodeId *other, bdNodeId *mid);
virtual void bdPrintId(std::ostream &out, const bdId *a);
virtual void bdPrintNodeId(std::ostream &out, const bdNodeId *a);
};
class bdModDht: public bdStdDht
{
public:
bdModDht();
virtual void setNodesPerBucket(uint16_t nodesPerBucket);
virtual uint16_t bdNodesPerBucket(); /* used for bdspace */
private:
uint16_t mNodesPerBucket;
};
#endif

View File

@ -1,269 +0,0 @@
/*******************************************************************************
* bitdht/bdstore.cc *
* *
* BitDHT: An Flexible DHT library. *
* *
* Copyright 2011 by Robert Fernie <bitdht@lunamutt.com> *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Affero General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Affero General Public License for more details. *
* *
* You should have received a copy of the GNU Affero General Public License *
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
* *
*******************************************************************************/
#include "bitdht/bdstore.h"
#include "util/bdnet.h"
#include "util/bdfile.h"
#include <stdio.h>
#include <iostream>
//#define DEBUG_STORE 1
bdStore::bdStore(std::string file, std::string backupfile, bdDhtFunctions *fns)
:mFns(fns)
{
#ifdef DEBUG_STORE
std::cerr << "bdStore::bdStore(" << file << ")";
std::cerr << std::endl;
#endif
/* read data from file */
mStoreFile = file;
mStoreFileBak = backupfile;
reloadFromStore();
}
int bdStore::clear()
{
mIndex = 0;
store.clear();
return 1;
}
int bdStore::reloadFromStore()
{
int result = reloadFromStore(mStoreFile);
if( result != 0 && store.size() > 0){
return result;
} else if(mStoreFileBak != "") { //Nothing loaded, try the backup file
return reloadFromStore(mStoreFileBak);
} else {
return 0;
}
}
int bdStore::reloadFromStore(std::string file)
{
clear();
FILE *fd = fopen(file.c_str(), "r");
if (!fd)
{
fprintf(stderr, "Failed to Open File: %s ... No Peers\n", file.c_str());
return 0;
}
char line[10240];
char addr_str[10240];
struct sockaddr_in addr;
addr.sin_family = PF_INET;
unsigned short port;
while(line == fgets(line, 10240, fd))
{
if (2 == sscanf(line, "%s %hd", addr_str, &port))
{
if (bdnet_inet_aton(addr_str, &(addr.sin_addr)))
{
addr.sin_port = htons(port);
bdPeer peer;
bdZeroNodeId(&(peer.mPeerId.id));
peer.mPeerId.addr = addr;
peer.mLastSendTime = 0;
peer.mLastRecvTime = 0;
store.push_back(peer);
#ifdef DEBUG_STORE
fprintf(stderr, "Read: %s %d\n", inet_ntoa(addr.sin_addr), ntohs(addr.sin_port));
#endif
}
}
}
fclose(fd);
#ifdef DEBUG_STORE
fprintf(stderr, "Read %ld Peers\n", (long) store.size());
#endif
return 1;
}
// This is a very ugly function!
int bdStore::getPeer(bdPeer *peer)
{
#ifdef DEBUG_STORE
fprintf(stderr, "bdStore::getPeer() %ld Peers left\n", (long) store.size());
#endif
std::list<bdPeer>::iterator it;
int i = 0;
for(it = store.begin(); (it != store.end()) && (i < mIndex); it++, i++) ; /* empty loop */
if (it != store.end())
{
*peer = *it;
mIndex++;
return 1;
}
return 0;
}
int bdStore::filterIpList(const std::list<struct sockaddr_in> &filteredIPs)
{
// Nasty O(n^2) iteration over 500 entries!!!.
// hope its not used to often.
std::list<struct sockaddr_in>::const_iterator it;
for(it = filteredIPs.begin(); it != filteredIPs.end(); it++)
{
std::list<bdPeer>::iterator sit;
for(sit = store.begin(); sit != store.end();)
{
if (it->sin_addr.s_addr == sit->mPeerId.addr.sin_addr.s_addr)
{
std::cerr << "bdStore::filterIpList() Found Bad entry in Store. Erasing!";
std::cerr << std::endl;
sit = store.erase(sit);
}
else
{
sit++;
}
}
}
return 1;
}
#define MAX_ENTRIES 500
/* maintain a sorted list */
void bdStore::addStore(bdPeer *peer)
{
#ifdef DEBUG_STORE
std::cerr << "bdStore::addStore() ";
mFns->bdPrintId(std::cerr, &(peer->mPeerId));
std::cerr << std::endl;
#endif
/* remove old entry */
std::list<bdPeer>::iterator it;
for(it = store.begin(); it != store.end(); )
{
if ((it->mPeerId.addr.sin_addr.s_addr == peer->mPeerId.addr.sin_addr.s_addr) &&
(it->mPeerId.addr.sin_port == peer->mPeerId.addr.sin_port))
{
#ifdef DEBUG_STORE
std::cerr << "bdStore::addStore() Removed Existing Entry: ";
mFns->bdPrintId(std::cerr, &(it->mPeerId));
std::cerr << std::endl;
#endif
it = store.erase(it);
}
else
{
it++;
}
}
#ifdef DEBUG_STORE
std::cerr << "bdStore::addStore() Push_back";
std::cerr << std::endl;
#endif
store.push_back(*peer);
while(store.size() > MAX_ENTRIES)
{
#ifdef DEBUG_STORE
std::cerr << "bdStore::addStore() pop_front()";
std::cerr << std::endl;
#endif
store.pop_front();
}
}
void bdStore::writeStore(std::string file)
{
/* write out store */
#ifdef DEBUG_STORE
fprintf(stderr, "bdStore::writeStore(%s) = %d entries\n", file.c_str(), store.size());
#endif
if (store.size() < 0.9 * MAX_ENTRIES)
{
/* don't save yet! */
#ifdef DEBUG_STORE
fprintf(stderr, "bdStore::writeStore() Delaying until more entries\n");
#endif
return;
}
std::string filetmp = file + ".tmp" ;
FILE *fd = fopen(filetmp.c_str(), "w");
if (!fd)
{
#ifdef DEBUG_STORE
#endif
fprintf(stderr, "bdStore::writeStore() FAILED to Open File\n");
return;
}
std::list<bdPeer>::iterator it;
for(it = store.begin(); it != store.end(); it++)
{
fprintf(fd, "%s %d\n", bdnet_inet_ntoa(it->mPeerId.addr.sin_addr).c_str(), ntohs(it->mPeerId.addr.sin_port));
#ifdef DEBUG_STORE
fprintf(stderr, "Storing Peer Address: %s %d\n", inet_ntoa(it->mPeerId.addr.sin_addr), ntohs(it->mPeerId.addr.sin_port));
#endif
}
fclose(fd);
if(!bdFile::renameFile(filetmp,file))
std::cerr << "Could not rename file !!" << std::endl;
#ifdef DEBUG_STORE
else
std::cerr << "Successfully renamed file " << filetmp << " to " << file << std::endl;
#endif
}
void bdStore::writeStore()
{
#if 0
if (mStoreFile == "")
{
return;
}
#endif
return writeStore(mStoreFile);
}

View File

@ -1,54 +0,0 @@
/*******************************************************************************
* bitdht/bdstore.h *
* *
* BitDHT: An Flexible DHT library. *
* *
* Copyright 2011 by Robert Fernie <bitdht@lunamutt.com> *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Affero General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Affero General Public License for more details. *
* *
* You should have received a copy of the GNU Affero General Public License *
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
* *
*******************************************************************************/
#ifndef BITDHT_STORE_H
#define BITDHT_STORE_H
#include <string>
#include "bitdht/bdiface.h"
#include "bitdht/bdpeer.h"
class bdStore
{
public:
bdStore(std::string file, std::string backupfile, bdDhtFunctions *fns);
int reloadFromStore(); /* for restarts */
int reloadFromStore(std::string file);
int filterIpList(const std::list<struct sockaddr_in> &filteredIPs);
int clear();
int getPeer(bdPeer *peer);
void addStore(bdPeer *peer);
void writeStore(std::string file);
void writeStore();
protected:
std::string mStoreFile;
std::string mStoreFileBak;
std::list<bdPeer> store;
int mIndex;
bdDhtFunctions *mFns;
};
#endif

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