diff --git a/.gitignore b/.gitignore index ecf9f7099..2b880085b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: (C) 2004-2019 Retroshare Team +# SPDX-License-Identifier: CC0-1.0 + *.o *.sw? *.so diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 000000000..d620b3719 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,53 @@ +image: docker:stable + +services: + - docker:stable-dind + +workflow: + rules: + - if: $CI_MERGE_REQUEST_ID + - if: $CI_COMMIT_BRANCH + +build-and-test: + 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 ; + - mkdir Dockercontext + - > + docker build -t retroshare:testing $REPO_ARGS + --file $CI_PROJECT_DIR/build_scripts/GitlabCI/gitlabCI.Dockerfile + Dockercontext + - > + docker run --name retroshare --detach --tty retroshare:testing + retroshare-service --jsonApiPort 9092 + - apk add jq + - > + docker exec retroshare + curl --verbose http://127.0.0.1:9092/rsJsonApi/version | jq + - > + docker exec retroshare + curl --verbose http://127.0.0.1:9092/rsLoginHelper/getLocations | jq + - > + docker exec retroshare + curl --verbose --data + '{ "location":{ "mLocationName":"Test 1", "mPgpName":"Test2" }, + "password":"Test 3", "caller_data":"Test 5" }' + http://127.0.0.1:9092/rsLoginHelper/createLocation | jq + - > + docker exec retroshare + curl --verbose http://127.0.0.1:9092/rsLoginHelper/getLocations | jq + - > + docker exec retroshare + curl --verbose http://127.0.0.1:9092/rsLoginHelper/isLoggedIn | jq + - > + docker exec retroshare + curl --verbose http://127.0.0.1:9092/rsMsgs/getChatLobbyList | jq + - docker container stop retroshare diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 000000000..c35876fc6 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,16 @@ +[submodule "supportlibs/restbed"] + path = supportlibs/restbed + url = https://github.com/Corvusoft/restbed.git +[submodule "cmark"] + path = supportlibs/cmark + url = https://github.com/commonmark/cmark.git +[submodule "build_scripts/OBS"] + path = build_scripts/OBS + url = https://github.com/RetroShare/OBS.git +[submodule "supportlibs/udp-discovery-cpp"] + path = supportlibs/udp-discovery-cpp + url = https://github.com/truvorskameikin/udp-discovery-cpp.git + branch = develop +[submodule "supportlibs/rapidjson"] + path = supportlibs/rapidjson + url = https://github.com/Tencent/rapidjson.git diff --git a/.reuse/dep5 b/.reuse/dep5 new file mode 100644 index 000000000..44a4ca005 --- /dev/null +++ b/.reuse/dep5 @@ -0,0 +1,43 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: RetroShare +Upstream-Contact: RetroShare Team + +Files: * +Copyright: 2004-2019, Retroshare Team +License: AGPL-3.0-only + +Files: libbitdht/* +Copyright: 2004-2019, Retroshare Team +License: LGPL-3.0-or-later + +Files: openpgpsdk/* +Copyright: 2005-2008, Ben Laurie + 2005-2008, Rachel Willmer + 2008-2019, Retroshare Team +License: Apache-2.0 + +Files: libretroshare/* +Copyright: 2004-2019, Retroshare Team +License: LGPL-3.0-or-later + +Files: libretroshare/src/deep_search/* +Copyright: 2018-2019, Gioacchino Mazzurco +License: AGPL-3.0-only + +Files: jsonapi-generator/* + libretroshare/src/jsonapi/* +Copyright: 2018-2019, Gioacchino Mazzurco +License: AGPL-3.0-or-later + +Files: retroshare-gui/* +Copyright: 2004-2019, Retroshare Team +License: GPL-3.0-or-later + +Files: retroshare-gui/src/TorControl/ +Copyright: 2014, John Brooks +License: BSD-3-Clause + +Files: retroshare-gui/src/gui/common/PictureFlow.* + retroshare-gui/src/qss/qdarkstyle.qss +Copyright: 2013, Jeff Weinstein +License: MIT diff --git a/.travis.yml b/.travis.yml index dc003da6d..cfe2eac21 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,40 +1,41 @@ +# SPDX-FileCopyrightText: (C) 2004-2019 Retroshare Team +# SPDX-License-Identifier: CC0-1.0 + +git: + depth: 2000 + language: cpp matrix: include: - os: linux - dist: trusty + dist: bionic sudo: required compiler: gcc - os: osx - osx_image: xcode6.2 + osx_image: xcode10.1 compiler: clang sudo: false before_install: - if [ $TRAVIS_OS_NAME == linux ]; then sudo apt-get update; fi - - if [ $TRAVIS_OS_NAME == linux ]; then sudo apt-get install -y build-essential checkinstall cmake libavutil-dev libavcodec-dev libavformat-dev libbz2-dev libcurl4-openssl-dev libcv-dev libopencv-highgui-dev libhighgui-dev libgnome-keyring-dev libgstreamer-plugins-base0.10-dev libgstreamer0.10-dev libjasper-dev libjpeg-dev libmicrohttpd-dev libopencv-dev libprotobuf-dev libqt4-dev libspeex-dev libspeexdsp-dev libsqlite3-dev libssl-dev libswscale-dev libtbb-dev libtiff4-dev libupnp-dev libv4l-dev libxine-dev libxslt1-dev libxss-dev pkg-config protobuf-compiler python-dev qtmobility-dev gdb ; fi - - -# - if [ $TRAVIS_OS_NAME == osx ]; then xcode-select --install ; fi + - > + if [ $TRAVIS_OS_NAME == linux ]; then + sudo apt-get install -y + build-essential libssl-dev libsqlcipher-dev libbz2-dev libsqlite3-dev + libupnp-dev pkg-config qt5-default libxss-dev qtmultimedia5-dev + libqt5x11extras5-dev libqt5designer5 libxapian-dev qttools5-dev + rapidjson-dev ; + fi - if [ $TRAVIS_OS_NAME == osx ]; then brew update ; fi -# - if [ $TRAVIS_OS_NAME == osx ]; then brew install qt55 openssl miniupnpc libmicrohttpd speex homebrew/science/opencv ffmpeg sqlcipher ; fi - - if [ $TRAVIS_OS_NAME == osx ]; then brew install qt55 openssl miniupnpc libmicrohttpd speex speexdsp ffmpeg sqlcipher ; fi - - if [ $TRAVIS_OS_NAME == osx ]; then brew link --force qt55 ; fi -#Fix for opencv and numpy already installed by system - - if [ $TRAVIS_OS_NAME == osx ]; then rm '/usr/local/bin/f2py'; fi - - if [ $TRAVIS_OS_NAME == osx ]; then rm -r '/usr/local/lib/python2.7/site-packages/numpy'; fi - - if [ $TRAVIS_OS_NAME == osx ]; then brew install homebrew/science/opencv; fi - -# FIX: Now openssl is not linked in /usr/local/include and lib - - if [ $TRAVIS_OS_NAME == osx ]; then ln -s /usr/local/opt/openssl/include/* /usr/local/include/; fi - - if [ $TRAVIS_OS_NAME == osx ]; then ln -s /usr/local/opt/openssl/lib/*.a /usr/local/lib/; fi - - if [ $TRAVIS_OS_NAME == osx ]; then ln -s /usr/local/opt/openssl/lib/*.dylib /usr/local/lib/; fi - -# - if [ $TRAVIS_OS_NAME == linux ]; then sudo apt-get update && sudo apt-get install -y llvm-3.4 llvm-3.4-dev; fi -# - rvm use $RVM --install --binary --fuzzy -# - gem update --system -# - gem --version + - if [ $TRAVIS_OS_NAME == osx ]; then brew install qt5; fi + - if [ $TRAVIS_OS_NAME == osx ]; then brew link --force qt5 ; fi + - > + if [ $TRAVIS_OS_NAME == osx ]; then + brew install openssl miniupnpc rapidjson sqlcipher; + fi + - if [ $TRAVIS_OS_NAME == osx ]; then brew install p7zip; fi + - if [ $TRAVIS_OS_NAME == osx ]; then npm install -g appdmg; fi env: global: @@ -48,40 +49,52 @@ addons: name: "RetroShare/RetroShare" description: "RetroShare Build submitted via Travis CI" build_command_prepend: "qmake CONFIG+=no_sqlcipher; make clean" - build_command: "make -j 4" + build_command: "make -j4" branch_pattern: coverity_scan before_script: - - qmake QMAKE_CC=$CC QMAKE_CXX=$CXX CONFIG+=no_sqlcipher CONFIG+=tests + - env + - if [ $TRAVIS_OS_NAME == linux ]; then qmake; fi + - > + if [ $TRAVIS_OS_NAME == osx ]; then + qmake CONFIG+=rs_macos10.14 CONFIG+=c++14 + INCLUDEPATH+=$(find /usr/local/Cellar/miniupnpc/*/include | head -n 1) + QMAKE_LIBDIR+=$(find /usr/local/Cellar/miniupnpc/*/lib/ | head -n 1) + INCLUDEPATH+=$(find /usr/local/Cellar/openssl*/*/include/ | head -n 1) + QMAKE_LIBDIR+=$(find /usr/local/Cellar/openssl*/*/lib/ | head -n 1) + INCLUDEPATH+=$(find /usr/local/Cellar/rapidjson/*/include | head -n 1) + INCLUDEPATH+=$(find /usr/local/Cellar/sqlcipher/*/include | head -n 1) + QMAKE_LIBDIR+=$(find /usr/local/Cellar/sqlcipher/*/lib | head -n 1); + fi script: - - if [ $TRAVIS_OS_NAME == linux ] && [ "${COVERITY_SCAN_BRANCH}" != 1 ]; then make && tests/unittests/unittests >/dev/null 2>&1 ; fi - - if [ $TRAVIS_OS_NAME == osx ] && [ "${COVERITY_SCAN_BRANCH}" != 1 ]; then make -j 4 ; fi + - if [ "${COVERITY_SCAN_BRANCH}" != 1 ]; then make -j4; 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 -#after_success: -# - if [ $TRAVIS_BRANCH == $TRAVIS_TAG ]; then rake deploy; fi - -#branches: -# only: -# - master -# - travis +# branches: +# only: +# - v0.6-MacOS-Travis-Deploy2 notifications: email: false irc: - channels: - - "chat.freenode.net#retroshare" - template: - - "%{repository}/%{branch} (%{commit} - %{author}): %{build_url}: %{message}" - - "Message: %{commit_message}" - - "Commit details: %{compare_url}" -# webhooks: -# urls: -# - https://webhooks.gitter.im/e/9502afd22ca6c8e85fb3 -# on_success: change -# on_failure: always -# on_start: always + channels: + - "chat.freenode.net#retroshare" + template: + - "%{repository}/%{branch} (%{commit} - %{author}): %{build_url}: %{message}" + - "Message: %{commit_message}" + - "Commit details: %{compare_url}" -#env: -# - RVM=2.0.0 LANG="en_US.UTF-8" +deploy: + provider: releases + api_key: + secure: auwuhxelaMriNaXzT8I03xrh1s+STicNyNToOWFCAYKxkWWQ4WeaCO6kRDmQrejhizMUILGU+s4FrWTEhDsviftGAF86EgzxxbSBfsHHAP4t2C0pcXX8/WxEoh1IrUs7iGCIpl7O2cvWqGidc20ROeptSEd1uQgkHnn14D9A2YmXf8g52PzqivKkb6HKfkVTPdmNJkMBT5eDtEw6DIk+DvnvRo6b6uanvVAKS9CBwXOdA3rLzaD9bz0LrdL9X1CNoTkGROyez0Lsc4zTr70id2Xfp1MMmJAV6hgQy+iwE37wRyrxJf3dkh5SUAAMUC9Xnvh/iBKNQKdQGhj2WGcV7GZV9k6u9DA1w2H0kcrwt9KHUXdhEQ67yr6Boa9ZFwdDb5VIOtC6iHAoDZXharHhiuxi0K/bCtwNAajrMjBCm9mWhEKvtoxUUYxAJajhJkkO3ERaOU3zHE+06esDzGozd2YOEH8a74HhYy4xvhR05Yj00hAWLS2kIaUITiqmBf6Yuh5XwH7KCDcapxF59ROWqyicdwtbfWpvN8IvFuGKyxYuEfoT8WxZ4lZpo4Q9CrTB7gedJYJxYNfZE/okWoFBb4cpPI94PHo3DZPR7lVyQ60RNyeR0nOeqf8NW8cBT1G4jw3u1LEyAdyvup+54aALw0DCVyoDojSXB8s+AlQG2JE= + file: retroshare-gui/src/retroshare.dmg + skip_cleanup: true + on: + repo: retroshare/RetroShare + branch: v0.6-OSX-Deploy diff --git a/COPYING b/COPYING new file mode 120000 index 000000000..d87028b7c --- /dev/null +++ b/COPYING @@ -0,0 +1 @@ +.reuse/dep5 \ No newline at end of file diff --git a/LICENSE.txt b/LICENSE.txt deleted file mode 100644 index 23cb79033..000000000 --- a/LICENSE.txt +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - {description} - Copyright (C) {year} {fullname} - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - {signature of Ty Coon}, 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/LICENSES/AGPL-3.0-only.txt b/LICENSES/AGPL-3.0-only.txt new file mode 100644 index 000000000..e37e32e4e --- /dev/null +++ b/LICENSES/AGPL-3.0-only.txt @@ -0,0 +1,613 @@ +GNU AFFERO GENERAL PUBLIC LICENSE + +Version 3, 19 November 2007 + +Copyright (C) 2007 Free Software Foundation, Inc. + +Everyone is permitted to copy and distribute verbatim copies of this license +document, but changing it is not allowed. + +Preamble + +The GNU Affero General Public License is a free, copyleft license for software +and other kinds of works, specifically designed to ensure cooperation with +the community in the case of network server software. + +The licenses for most software and other practical works are designed to take +away your freedom to share and change the works. By contrast, our General +Public Licenses are intended to guarantee your freedom to share and change +all versions of a program--to make sure it remains free software for all its +users. + +When we speak of free software, we are referring to freedom, not price. Our +General Public Licenses are designed to make sure that you have the freedom +to distribute copies of free software (and charge for them if you wish), that +you receive source code or can get it if you want it, that you can change +the software or use pieces of it in new free programs, and that you know you +can do these things. + +Developers that use our General Public Licenses protect your rights with two +steps: (1) assert copyright on the software, and (2) offer you this License +which gives you legal permission to copy, distribute and/or modify the software. + +A secondary benefit of defending all users' freedom is that improvements made +in alternate versions of the program, if they receive widespread use, become +available for other developers to incorporate. Many developers of free software +are heartened and encouraged by the resulting cooperation. However, in the +case of software used on network servers, this result may fail to come about. +The GNU General Public License permits making a modified version and letting +the public access it on a server without ever releasing its source code to +the public. + +The GNU Affero General Public License is designed specifically to ensure that, +in such cases, the modified source code becomes available to the community. +It requires the operator of a network server to provide the source code of +the modified version running there to the users of that server. Therefore, +public use of a modified version, on a publicly accessible server, gives the +public access to the source code of the modified version. + +An older license, called the Affero General Public License and published by +Affero, was designed to accomplish similar goals. This is a different license, +not a version of the Affero GPL, but Affero has released a new version of +the Affero GPL which permits relicensing under this license. + +The precise terms and conditions for copying, distribution and modification +follow. + +TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU Affero General Public License. + +"Copyright" also means copyright-like laws that apply to other kinds of works, +such as semiconductor masks. + +"The Program" refers to any copyrightable work licensed under this License. +Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals +or organizations. + +To "modify" a work means to copy from or adapt all or part of the work in +a fashion requiring copyright permission, other than the making of an exact +copy. The resulting work is called a "modified version" of the earlier work +or a work "based on" the earlier work. + +A "covered work" means either the unmodified Program or a work based on the +Program. + +To "propagate" a work means to do anything with it that, without permission, +would make you directly or secondarily liable for infringement under applicable +copyright law, except executing it on a computer or modifying a private copy. +Propagation includes copying, distribution (with or without modification), +making available to the public, and in some countries other activities as +well. + +To "convey" a work means any kind of propagation that enables other parties +to make or receive copies. Mere interaction with a user through a computer +network, with no transfer of a copy, is not conveying. + +An interactive user interface displays "Appropriate Legal Notices" to the +extent that it includes a convenient and prominently visible feature that +(1) displays an appropriate copyright notice, and (2) tells the user that +there is no warranty for the work (except to the extent that warranties are +provided), that licensees may convey the work under this License, and how +to view a copy of this License. If the interface presents a list of user commands +or options, such as a menu, a prominent item in the list meets this criterion. + + 1. Source Code. + +The "source code" for a work means the preferred form of the work for making +modifications to it. "Object code" means any non-source form of a work. + +A "Standard Interface" means an interface that either is an official standard +defined by a recognized standards body, or, in the case of interfaces specified +for a particular programming language, one that is widely used among developers +working in that language. + +The "System Libraries" of an executable work include anything, other than +the work as a whole, that (a) is included in the normal form of packaging +a Major Component, but which is not part of that Major Component, and (b) +serves only to enable use of the work with that Major Component, or to implement +a Standard Interface for which an implementation is available to the public +in source code form. A "Major Component", in this context, means a major essential +component (kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to produce +the work, or an object code interpreter used to run it. + +The "Corresponding Source" for a work in object code form means all the source +code needed to generate, install, and (for an executable work) run the object +code and to modify the work, including scripts to control those activities. +However, it does not include the work's System Libraries, or general-purpose +tools or generally available free programs which are used unmodified in performing +those activities but which are not part of the work. For example, Corresponding +Source includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically linked +subprograms that the work is specifically designed to require, such as by +intimate data communication or control flow between those + + subprograms and other parts of the work. + +The Corresponding Source need not include anything that users can regenerate +automatically from other parts of the Corresponding Source. + + The Corresponding Source for a work in source code form is that same work. + + 2. Basic Permissions. + +All rights granted under this License are granted for the term of copyright +on the Program, and are irrevocable provided the stated conditions are met. +This License explicitly affirms your unlimited permission to run the unmodified +Program. The output from running a covered work is covered by this License +only if the output, given its content, constitutes a covered work. This License +acknowledges your rights of fair use or other equivalent, as provided by copyright +law. + +You may make, run and propagate covered works that you do not convey, without +conditions so long as your license otherwise remains in force. You may convey +covered works to others for the sole purpose of having them make modifications +exclusively for you, or provide you with facilities for running those works, +provided that you comply with the terms of this License in conveying all material +for which you do not control copyright. Those thus making or running the covered +works for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of your copyrighted +material outside their relationship with you. + +Conveying under any other circumstances is permitted solely under the conditions +stated below. Sublicensing is not allowed; section 10 makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + +No covered work shall be deemed part of an effective technological measure +under any applicable law fulfilling obligations under article 11 of the WIPO +copyright treaty adopted on 20 December 1996, or similar laws prohibiting +or restricting circumvention of such measures. + +When you convey a covered work, you waive any legal power to forbid circumvention +of technological measures to the extent such circumvention is effected by +exercising rights under this License with respect to the covered work, and +you disclaim any intention to limit operation or modification of the work +as a means of enforcing, against the work's users, your or third parties' +legal rights to forbid circumvention of technological measures. + + 4. Conveying Verbatim Copies. + +You may convey verbatim copies of the Program's source code as you receive +it, in any medium, provided that you conspicuously and appropriately publish +on each copy an appropriate copyright notice; keep intact all notices stating +that this License and any non-permissive terms added in accord with section +7 apply to the code; keep intact all notices of the absence of any warranty; +and give all recipients a copy of this License along with the Program. + +You may charge any price or no price for each copy that you convey, and you +may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + +You may convey a work based on the Program, or the modifications to produce +it from the Program, in the form of source code under the terms of section +4, provided that you also meet all of these conditions: + +a) The work must carry prominent notices stating that you modified it, and +giving a relevant date. + +b) The work must carry prominent notices stating that it is released under +this License and any conditions added under section 7. This requirement modifies +the requirement in section 4 to "keep intact all notices". + +c) You must license the entire work, as a whole, under this License to anyone +who comes into possession of a copy. This License will therefore apply, along +with any applicable section 7 additional terms, to the whole of the work, +and all its parts, regardless of how they are packaged. This License gives +no permission to license the work in any other way, but it does not invalidate +such permission if you have separately received it. + +d) If the work has interactive user interfaces, each must display Appropriate +Legal Notices; however, if the Program has interactive interfaces that do +not display Appropriate Legal Notices, your work need not make them do so. + +A compilation of a covered work with other separate and independent works, +which are not by their nature extensions of the covered work, and which are +not combined with it such as to form a larger program, in or on a volume of +a storage or distribution medium, is called an "aggregate" if the compilation +and its resulting copyright are not used to limit the access or legal rights +of the compilation's users beyond what the individual works permit. Inclusion +of a covered work in an aggregate does not cause this License to apply to +the other parts of the aggregate. + + 6. Conveying Non-Source Forms. + +You may convey a covered work in object code form under the terms of sections +4 and 5, provided that you also convey the machine-readable Corresponding +Source under the terms of this License, in one of these ways: + +a) Convey the object code in, or embodied in, a physical product (including +a physical distribution medium), accompanied by the Corresponding Source fixed +on a durable physical medium customarily used for software interchange. + +b) Convey the object code in, or embodied in, a physical product (including +a physical distribution medium), accompanied by a written offer, valid for +at least three years and valid for as long as you offer spare parts or customer +support for that product model, to give anyone who possesses the object code +either (1) a copy of the Corresponding Source for all the software in the +product that is covered by this License, on a durable physical medium customarily +used for software interchange, for a price no more than your reasonable cost +of physically performing this conveying of source, or (2) access to copy the +Corresponding Source from a network server at no charge. + +c) Convey individual copies of the object code with a copy of the written +offer to provide the Corresponding Source. This alternative is allowed only +occasionally and noncommercially, and only if you received the object code +with such an offer, in accord with subsection 6b. + +d) Convey the object code by offering access from a designated place (gratis +or for a charge), and offer equivalent access to the Corresponding Source +in the same way through the same place at no further charge. You need not +require recipients to copy the Corresponding Source along with the object +code. If the place to copy the object code is a network server, the Corresponding +Source may be on a different server (operated by you or a third party) that +supports equivalent copying facilities, provided you maintain clear directions +next to the object code saying where to find the Corresponding Source. Regardless +of what server hosts the Corresponding Source, you remain obligated to ensure +that it is available for as long as needed to satisfy these requirements. + +e) Convey the object code using peer-to-peer transmission, provided you inform +other peers where the object code and Corresponding Source of the work are +being offered to the general public at no charge under subsection 6d. + +A separable portion of the object code, whose source code is excluded from +the Corresponding Source as a System Library, need not be included in conveying +the object code work. + +A "User Product" is either (1) a "consumer product", which means any tangible +personal property which is normally used for personal, family, or household +purposes, or (2) anything designed or sold for incorporation into a dwelling. +In determining whether a product is a consumer product, doubtful cases shall +be resolved in favor of coverage. For a particular product received by a particular +user, "normally used" refers to a typical or common use of that class of product, +regardless of the status of the particular user or of the way in which the +particular user actually uses, or expects or is expected to use, the product. +A product is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent the +only significant mode of use of the product. + +"Installation Information" for a User Product means any methods, procedures, +authorization keys, or other information required to install and execute modified +versions of a covered work in that User Product from a modified version of +its Corresponding Source. The information must suffice to ensure that the +continued functioning of the modified object code is in no case prevented +or interfered with solely because modification has been made. + +If you convey an object code work under this section in, or with, or specifically +for use in, a User Product, and the conveying occurs as part of a transaction +in which the right of possession and use of the User Product is transferred +to the recipient in perpetuity or for a fixed term (regardless of how the +transaction is characterized), the Corresponding Source conveyed under this +section must be accompanied by the Installation Information. But this requirement +does not apply if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has been installed +in ROM). + +The requirement to provide Installation Information does not include a requirement +to continue to provide support service, warranty, or updates for a work that +has been modified or installed by the recipient, or for the User Product in +which it has been modified or installed. Access to a network may be denied +when the modification itself materially and adversely affects the operation +of the network or violates the rules and protocols for communication across +the network. + +Corresponding Source conveyed, and Installation Information provided, in accord +with this section must be in a format that is publicly documented (and with +an implementation available to the public in source code form), and must require +no special password or key for unpacking, reading or copying. + + 7. Additional Terms. + +"Additional permissions" are terms that supplement the terms of this License +by making exceptions from one or more of its conditions. Additional permissions +that are applicable to the entire Program shall be treated as though they +were included in this License, to the extent that they are valid under applicable +law. If additional permissions apply only to part of the Program, that part +may be used separately under those permissions, but the entire Program remains +governed by this License without regard to the additional permissions. + +When you convey a copy of a covered work, you may at your option remove any +additional permissions from that copy, or from any part of it. (Additional +permissions may be written to require their own removal in certain cases when +you modify the work.) You may place additional permissions on material, added +by you to a covered work, for which you have or can give appropriate copyright +permission. + +Notwithstanding any other provision of this License, for material you add +to a covered work, you may (if authorized by the copyright holders of that +material) supplement the terms of this License with terms: + +a) Disclaiming warranty or limiting liability differently from the terms of +sections 15 and 16 of this License; or + +b) Requiring preservation of specified reasonable legal notices or author +attributions in that material or in the Appropriate Legal Notices displayed +by works containing it; or + +c) Prohibiting misrepresentation of the origin of that material, or requiring +that modified versions of such material be marked in reasonable ways as different +from the original version; or + +d) Limiting the use for publicity purposes of names of licensors or authors +of the material; or + +e) Declining to grant rights under trademark law for use of some trade names, +trademarks, or service marks; or + +f) Requiring indemnification of licensors and authors of that material by +anyone who conveys the material (or modified versions of it) with contractual +assumptions of liability to the recipient, for any liability that these contractual +assumptions directly impose on those licensors and authors. + +All other non-permissive additional terms are considered "further restrictions" +within the meaning of section 10. If the Program as you received it, or any +part of it, contains a notice stating that it is governed by this License +along with a term that is a further restriction, you may remove that term. +If a license document contains a further restriction but permits relicensing +or conveying under this License, you may add to a covered work material governed +by the terms of that license document, provided that the further restriction +does not survive such relicensing or conveying. + +If you add terms to a covered work in accord with this section, you must place, +in the relevant source files, a statement of the additional terms that apply +to those files, or a notice indicating where to find the applicable terms. + +Additional terms, permissive or non-permissive, may be stated in the form +of a separately written license, or stated as exceptions; the above requirements +apply either way. + + 8. Termination. + +You may not propagate or modify a covered work except as expressly provided +under this License. Any attempt otherwise to propagate or modify it is void, +and will automatically terminate your rights under this License (including +any patent licenses granted under the third paragraph of section 11). + +However, if you cease all violation of this License, then your license from +a particular copyright holder is reinstated (a) provisionally, unless and +until the copyright holder explicitly and finally terminates your license, +and (b) permanently, if the copyright holder fails to notify you of the violation +by some reasonable means prior to 60 days after the cessation. + +Moreover, your license from a particular copyright holder is reinstated permanently +if the copyright holder notifies you of the violation by some reasonable means, +this is the first time you have received notice of violation of this License +(for any work) from that copyright holder, and you cure the violation prior +to 30 days after your receipt of the notice. + +Termination of your rights under this section does not terminate the licenses +of parties who have received copies or rights from you under this License. +If your rights have been terminated and not permanently reinstated, you do +not qualify to receive new licenses for the same material under section 10. + + 9. Acceptance Not Required for Having Copies. + +You are not required to accept this License in order to receive or run a copy +of the Program. Ancillary propagation of a covered work occurring solely as +a consequence of using peer-to-peer transmission to receive a copy likewise +does not require acceptance. However, nothing other than this License grants +you permission to propagate or modify any covered work. These actions infringe +copyright if you do not accept this License. Therefore, by modifying or propagating +a covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + +Each time you convey a covered work, the recipient automatically receives +a license from the original licensors, to run, modify and propagate that work, +subject to this License. You are not responsible for enforcing compliance +by third parties with this License. + +An "entity transaction" is a transaction transferring control of an organization, +or substantially all assets of one, or subdividing an organization, or merging +organizations. If propagation of a covered work results from an entity transaction, +each party to that transaction who receives a copy of the work also receives +whatever licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the Corresponding +Source of the work from the predecessor in interest, if the predecessor has +it or can get it with reasonable efforts. + +You may not impose any further restrictions on the exercise of the rights +granted or affirmed under this License. For example, you may not impose a +license fee, royalty, or other charge for exercise of rights granted under +this License, and you may not initiate litigation (including a cross-claim +or counterclaim in a lawsuit) alleging that any patent claim is infringed +by making, using, selling, offering for sale, or importing the Program or +any portion of it. + + 11. Patents. + +A "contributor" is a copyright holder who authorizes use under this License +of the Program or a work on which the Program is based. The work thus licensed +is called the contributor's "contributor version". + +A contributor's "essential patent claims" are all patent claims owned or controlled +by the contributor, whether already acquired or hereafter acquired, that would +be infringed by some manner, permitted by this License, of making, using, +or selling its contributor version, but do not include claims that would be +infringed only as a consequence of further modification of the contributor +version. For purposes of this definition, "control" includes the right to +grant patent sublicenses in a manner consistent with the requirements of this +License. + +Each contributor grants you a non-exclusive, worldwide, royalty-free patent +license under the contributor's essential patent claims, to make, use, sell, +offer for sale, import and otherwise run, modify and propagate the contents +of its contributor version. + +In the following three paragraphs, a "patent license" is any express agreement +or commitment, however denominated, not to enforce a patent (such as an express +permission to practice a patent or covenant not to s ue for patent infringement). +To "grant" such a patent license to a party means to make such an agreement +or commitment not to enforce a patent against the party. + +If you convey a covered work, knowingly relying on a patent license, and the +Corresponding Source of the work is not available for anyone to copy, free +of charge and under the terms of this License, through a publicly available +network server or other readily accessible means, then you must either (1) +cause the Corresponding Source to be so available, or (2) arrange to deprive +yourself of the benefit of the patent license for this particular work, or +(3) arrange, in a manner consistent with the requirements of this License, +to extend the patent + +license to downstream recipients. "Knowingly relying" means you have actual +knowledge that, but for the patent license, your conveying the covered work +in a country, or your recipient's use of the covered work in a country, would +infringe one or more identifiable patents in that country that you have reason +to believe are valid. + +If, pursuant to or in connection with a single transaction or arrangement, +you convey, or propagate by procuring conveyance of, a covered work, and grant +a patent license to some of the parties receiving the covered work authorizing +them to use, propagate, modify or convey a specific copy of the covered work, +then the patent license you grant is automatically extended to all recipients +of the covered work and works based on it. + +A patent license is "discriminatory" if it does not include within the scope +of its coverage, prohibits the exercise of, or is conditioned on the non-exercise +of one or more of the rights that are specifically granted under this License. +You may not convey a covered work if you are a party to an arrangement with +a third party that is in the business of distributing software, under which +you make payment to the third party based on the extent of your activity of +conveying the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory patent +license (a) in connection with copies of the covered work conveyed by you +(or copies made from those copies), or (b) primarily for and in connection +with specific products or compilations that contain the covered work, unless +you entered into that arrangement, or that patent license was granted, prior +to 28 March 2007. + +Nothing in this License shall be construed as excluding or limiting any implied +license or other defenses to infringement that may otherwise be available +to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + +If conditions are imposed on you (whether by court order, agreement or otherwise) +that contradict the conditions of this License, they do not excuse you from +the conditions of this License. If you cannot convey a covered work so as +to satisfy simultaneously your obligations under this License and any other +pertinent obligations, then as a consequence you may + +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey the +Program, the only way you could satisfy both those terms and this License +would be to refrain entirely from conveying the Program. + + 13. Remote Network Interaction; Use with the GNU General Public License. + +Notwithstanding any other provision of this License, if you modify the Program, +your modified version must prominently offer all users interacting with it +remotely through a computer network (if your version supports such interaction) +an opportunity to receive the Corresponding Source of your version by providing +access to the Corresponding Source from a network server at no charge, through +some standard or customary means of facilitating copying of software. This +Corresponding Source shall include the Corresponding Source for any work covered +by version 3 of the GNU General Public License that is incorporated pursuant +to the following paragraph. + +Notwithstanding any other provision of this License, you have permission to +link or combine any covered work with a work licensed under version 3 of the +GNU General Public License into a single combined work, and to convey the +resulting work. The terms of this License will continue to apply to the part +which is the covered work, but the work with which it is combined will remain +governed by version 3 of the GNU General Public License. + + 14. Revised Versions of this License. + +The Free Software Foundation may publish revised and/or new versions of the +GNU Affero General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to address +new problems or concerns. + +Each version is given a distinguishing version number. If the Program specifies +that a certain numbered version of the GNU Affero General Public License "or +any later version" applies to it, you have the option of following the terms +and conditions either of that numbered version or of any later version published +by the Free Software Foundation. If the Program does not specify a version +number of the GNU Affero General Public License, you may choose any version +ever published by the Free Software Foundation. + +If the Program specifies that a proxy can decide which future versions of +the GNU Affero General Public License can be used, that proxy's public statement +of acceptance of a version permanently authorizes you to choose that version +for the Program. + +Later license versions may give you additional or different permissions. However, +no additional obligations are imposed on any author or copyright holder as +a result of your choosing to follow a later version. + + 15. Disclaimer of Warranty. + +THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE +LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER +EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM +PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR +CORRECTION. + + 16. Limitation of Liability. + +IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL +ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM +AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, +INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO +USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED +INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE +PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER +PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + +If the disclaimer of warranty and limitation of liability provided above cannot +be given local legal effect according to their terms, reviewing courts shall +apply local law that most closely approximates an absolute waiver of all civil +liability in connection with the Program, unless a warranty or assumption +of liability accompanies a copy of the Program in return for a fee. END OF +TERMS AND CONDITIONS + +How to Apply These Terms to Your New Programs + +If you develop a new program, and you want it to be of the greatest possible +use to the public, the best way to achieve this is to make it free software +which everyone can redistribute and change under these terms. + +To do so, attach the following notices to the program. It is safest to attach +them to the start of each source file to most effectively state the exclusion +of warranty; and each file should have at least the "copyright" line and a +pointer to where the full notice is found. + + + +Copyright (C) + +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 . + +Also add information on how to contact you by electronic and paper mail. + +If your software can interact with users remotely through a computer network, +you should also make sure that it provides a way for users to get its source. +For example, if your program is a web application, its interface could display +a "Source" link that leads users to an archive of the code. There are many +ways you could offer source, and different solutions will be better for different +programs; see section 13 for the specific requirements. + +You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. For +more information on this, and how to apply and follow the GNU AGPL, see . diff --git a/LICENSES/AGPL-3.0-or-later.txt b/LICENSES/AGPL-3.0-or-later.txt new file mode 100644 index 000000000..e37e32e4e --- /dev/null +++ b/LICENSES/AGPL-3.0-or-later.txt @@ -0,0 +1,613 @@ +GNU AFFERO GENERAL PUBLIC LICENSE + +Version 3, 19 November 2007 + +Copyright (C) 2007 Free Software Foundation, Inc. + +Everyone is permitted to copy and distribute verbatim copies of this license +document, but changing it is not allowed. + +Preamble + +The GNU Affero General Public License is a free, copyleft license for software +and other kinds of works, specifically designed to ensure cooperation with +the community in the case of network server software. + +The licenses for most software and other practical works are designed to take +away your freedom to share and change the works. By contrast, our General +Public Licenses are intended to guarantee your freedom to share and change +all versions of a program--to make sure it remains free software for all its +users. + +When we speak of free software, we are referring to freedom, not price. Our +General Public Licenses are designed to make sure that you have the freedom +to distribute copies of free software (and charge for them if you wish), that +you receive source code or can get it if you want it, that you can change +the software or use pieces of it in new free programs, and that you know you +can do these things. + +Developers that use our General Public Licenses protect your rights with two +steps: (1) assert copyright on the software, and (2) offer you this License +which gives you legal permission to copy, distribute and/or modify the software. + +A secondary benefit of defending all users' freedom is that improvements made +in alternate versions of the program, if they receive widespread use, become +available for other developers to incorporate. Many developers of free software +are heartened and encouraged by the resulting cooperation. However, in the +case of software used on network servers, this result may fail to come about. +The GNU General Public License permits making a modified version and letting +the public access it on a server without ever releasing its source code to +the public. + +The GNU Affero General Public License is designed specifically to ensure that, +in such cases, the modified source code becomes available to the community. +It requires the operator of a network server to provide the source code of +the modified version running there to the users of that server. Therefore, +public use of a modified version, on a publicly accessible server, gives the +public access to the source code of the modified version. + +An older license, called the Affero General Public License and published by +Affero, was designed to accomplish similar goals. This is a different license, +not a version of the Affero GPL, but Affero has released a new version of +the Affero GPL which permits relicensing under this license. + +The precise terms and conditions for copying, distribution and modification +follow. + +TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU Affero General Public License. + +"Copyright" also means copyright-like laws that apply to other kinds of works, +such as semiconductor masks. + +"The Program" refers to any copyrightable work licensed under this License. +Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals +or organizations. + +To "modify" a work means to copy from or adapt all or part of the work in +a fashion requiring copyright permission, other than the making of an exact +copy. The resulting work is called a "modified version" of the earlier work +or a work "based on" the earlier work. + +A "covered work" means either the unmodified Program or a work based on the +Program. + +To "propagate" a work means to do anything with it that, without permission, +would make you directly or secondarily liable for infringement under applicable +copyright law, except executing it on a computer or modifying a private copy. +Propagation includes copying, distribution (with or without modification), +making available to the public, and in some countries other activities as +well. + +To "convey" a work means any kind of propagation that enables other parties +to make or receive copies. Mere interaction with a user through a computer +network, with no transfer of a copy, is not conveying. + +An interactive user interface displays "Appropriate Legal Notices" to the +extent that it includes a convenient and prominently visible feature that +(1) displays an appropriate copyright notice, and (2) tells the user that +there is no warranty for the work (except to the extent that warranties are +provided), that licensees may convey the work under this License, and how +to view a copy of this License. If the interface presents a list of user commands +or options, such as a menu, a prominent item in the list meets this criterion. + + 1. Source Code. + +The "source code" for a work means the preferred form of the work for making +modifications to it. "Object code" means any non-source form of a work. + +A "Standard Interface" means an interface that either is an official standard +defined by a recognized standards body, or, in the case of interfaces specified +for a particular programming language, one that is widely used among developers +working in that language. + +The "System Libraries" of an executable work include anything, other than +the work as a whole, that (a) is included in the normal form of packaging +a Major Component, but which is not part of that Major Component, and (b) +serves only to enable use of the work with that Major Component, or to implement +a Standard Interface for which an implementation is available to the public +in source code form. A "Major Component", in this context, means a major essential +component (kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to produce +the work, or an object code interpreter used to run it. + +The "Corresponding Source" for a work in object code form means all the source +code needed to generate, install, and (for an executable work) run the object +code and to modify the work, including scripts to control those activities. +However, it does not include the work's System Libraries, or general-purpose +tools or generally available free programs which are used unmodified in performing +those activities but which are not part of the work. For example, Corresponding +Source includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically linked +subprograms that the work is specifically designed to require, such as by +intimate data communication or control flow between those + + subprograms and other parts of the work. + +The Corresponding Source need not include anything that users can regenerate +automatically from other parts of the Corresponding Source. + + The Corresponding Source for a work in source code form is that same work. + + 2. Basic Permissions. + +All rights granted under this License are granted for the term of copyright +on the Program, and are irrevocable provided the stated conditions are met. +This License explicitly affirms your unlimited permission to run the unmodified +Program. The output from running a covered work is covered by this License +only if the output, given its content, constitutes a covered work. This License +acknowledges your rights of fair use or other equivalent, as provided by copyright +law. + +You may make, run and propagate covered works that you do not convey, without +conditions so long as your license otherwise remains in force. You may convey +covered works to others for the sole purpose of having them make modifications +exclusively for you, or provide you with facilities for running those works, +provided that you comply with the terms of this License in conveying all material +for which you do not control copyright. Those thus making or running the covered +works for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of your copyrighted +material outside their relationship with you. + +Conveying under any other circumstances is permitted solely under the conditions +stated below. Sublicensing is not allowed; section 10 makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + +No covered work shall be deemed part of an effective technological measure +under any applicable law fulfilling obligations under article 11 of the WIPO +copyright treaty adopted on 20 December 1996, or similar laws prohibiting +or restricting circumvention of such measures. + +When you convey a covered work, you waive any legal power to forbid circumvention +of technological measures to the extent such circumvention is effected by +exercising rights under this License with respect to the covered work, and +you disclaim any intention to limit operation or modification of the work +as a means of enforcing, against the work's users, your or third parties' +legal rights to forbid circumvention of technological measures. + + 4. Conveying Verbatim Copies. + +You may convey verbatim copies of the Program's source code as you receive +it, in any medium, provided that you conspicuously and appropriately publish +on each copy an appropriate copyright notice; keep intact all notices stating +that this License and any non-permissive terms added in accord with section +7 apply to the code; keep intact all notices of the absence of any warranty; +and give all recipients a copy of this License along with the Program. + +You may charge any price or no price for each copy that you convey, and you +may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + +You may convey a work based on the Program, or the modifications to produce +it from the Program, in the form of source code under the terms of section +4, provided that you also meet all of these conditions: + +a) The work must carry prominent notices stating that you modified it, and +giving a relevant date. + +b) The work must carry prominent notices stating that it is released under +this License and any conditions added under section 7. This requirement modifies +the requirement in section 4 to "keep intact all notices". + +c) You must license the entire work, as a whole, under this License to anyone +who comes into possession of a copy. This License will therefore apply, along +with any applicable section 7 additional terms, to the whole of the work, +and all its parts, regardless of how they are packaged. This License gives +no permission to license the work in any other way, but it does not invalidate +such permission if you have separately received it. + +d) If the work has interactive user interfaces, each must display Appropriate +Legal Notices; however, if the Program has interactive interfaces that do +not display Appropriate Legal Notices, your work need not make them do so. + +A compilation of a covered work with other separate and independent works, +which are not by their nature extensions of the covered work, and which are +not combined with it such as to form a larger program, in or on a volume of +a storage or distribution medium, is called an "aggregate" if the compilation +and its resulting copyright are not used to limit the access or legal rights +of the compilation's users beyond what the individual works permit. Inclusion +of a covered work in an aggregate does not cause this License to apply to +the other parts of the aggregate. + + 6. Conveying Non-Source Forms. + +You may convey a covered work in object code form under the terms of sections +4 and 5, provided that you also convey the machine-readable Corresponding +Source under the terms of this License, in one of these ways: + +a) Convey the object code in, or embodied in, a physical product (including +a physical distribution medium), accompanied by the Corresponding Source fixed +on a durable physical medium customarily used for software interchange. + +b) Convey the object code in, or embodied in, a physical product (including +a physical distribution medium), accompanied by a written offer, valid for +at least three years and valid for as long as you offer spare parts or customer +support for that product model, to give anyone who possesses the object code +either (1) a copy of the Corresponding Source for all the software in the +product that is covered by this License, on a durable physical medium customarily +used for software interchange, for a price no more than your reasonable cost +of physically performing this conveying of source, or (2) access to copy the +Corresponding Source from a network server at no charge. + +c) Convey individual copies of the object code with a copy of the written +offer to provide the Corresponding Source. This alternative is allowed only +occasionally and noncommercially, and only if you received the object code +with such an offer, in accord with subsection 6b. + +d) Convey the object code by offering access from a designated place (gratis +or for a charge), and offer equivalent access to the Corresponding Source +in the same way through the same place at no further charge. You need not +require recipients to copy the Corresponding Source along with the object +code. If the place to copy the object code is a network server, the Corresponding +Source may be on a different server (operated by you or a third party) that +supports equivalent copying facilities, provided you maintain clear directions +next to the object code saying where to find the Corresponding Source. Regardless +of what server hosts the Corresponding Source, you remain obligated to ensure +that it is available for as long as needed to satisfy these requirements. + +e) Convey the object code using peer-to-peer transmission, provided you inform +other peers where the object code and Corresponding Source of the work are +being offered to the general public at no charge under subsection 6d. + +A separable portion of the object code, whose source code is excluded from +the Corresponding Source as a System Library, need not be included in conveying +the object code work. + +A "User Product" is either (1) a "consumer product", which means any tangible +personal property which is normally used for personal, family, or household +purposes, or (2) anything designed or sold for incorporation into a dwelling. +In determining whether a product is a consumer product, doubtful cases shall +be resolved in favor of coverage. For a particular product received by a particular +user, "normally used" refers to a typical or common use of that class of product, +regardless of the status of the particular user or of the way in which the +particular user actually uses, or expects or is expected to use, the product. +A product is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent the +only significant mode of use of the product. + +"Installation Information" for a User Product means any methods, procedures, +authorization keys, or other information required to install and execute modified +versions of a covered work in that User Product from a modified version of +its Corresponding Source. The information must suffice to ensure that the +continued functioning of the modified object code is in no case prevented +or interfered with solely because modification has been made. + +If you convey an object code work under this section in, or with, or specifically +for use in, a User Product, and the conveying occurs as part of a transaction +in which the right of possession and use of the User Product is transferred +to the recipient in perpetuity or for a fixed term (regardless of how the +transaction is characterized), the Corresponding Source conveyed under this +section must be accompanied by the Installation Information. But this requirement +does not apply if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has been installed +in ROM). + +The requirement to provide Installation Information does not include a requirement +to continue to provide support service, warranty, or updates for a work that +has been modified or installed by the recipient, or for the User Product in +which it has been modified or installed. Access to a network may be denied +when the modification itself materially and adversely affects the operation +of the network or violates the rules and protocols for communication across +the network. + +Corresponding Source conveyed, and Installation Information provided, in accord +with this section must be in a format that is publicly documented (and with +an implementation available to the public in source code form), and must require +no special password or key for unpacking, reading or copying. + + 7. Additional Terms. + +"Additional permissions" are terms that supplement the terms of this License +by making exceptions from one or more of its conditions. Additional permissions +that are applicable to the entire Program shall be treated as though they +were included in this License, to the extent that they are valid under applicable +law. If additional permissions apply only to part of the Program, that part +may be used separately under those permissions, but the entire Program remains +governed by this License without regard to the additional permissions. + +When you convey a copy of a covered work, you may at your option remove any +additional permissions from that copy, or from any part of it. (Additional +permissions may be written to require their own removal in certain cases when +you modify the work.) You may place additional permissions on material, added +by you to a covered work, for which you have or can give appropriate copyright +permission. + +Notwithstanding any other provision of this License, for material you add +to a covered work, you may (if authorized by the copyright holders of that +material) supplement the terms of this License with terms: + +a) Disclaiming warranty or limiting liability differently from the terms of +sections 15 and 16 of this License; or + +b) Requiring preservation of specified reasonable legal notices or author +attributions in that material or in the Appropriate Legal Notices displayed +by works containing it; or + +c) Prohibiting misrepresentation of the origin of that material, or requiring +that modified versions of such material be marked in reasonable ways as different +from the original version; or + +d) Limiting the use for publicity purposes of names of licensors or authors +of the material; or + +e) Declining to grant rights under trademark law for use of some trade names, +trademarks, or service marks; or + +f) Requiring indemnification of licensors and authors of that material by +anyone who conveys the material (or modified versions of it) with contractual +assumptions of liability to the recipient, for any liability that these contractual +assumptions directly impose on those licensors and authors. + +All other non-permissive additional terms are considered "further restrictions" +within the meaning of section 10. If the Program as you received it, or any +part of it, contains a notice stating that it is governed by this License +along with a term that is a further restriction, you may remove that term. +If a license document contains a further restriction but permits relicensing +or conveying under this License, you may add to a covered work material governed +by the terms of that license document, provided that the further restriction +does not survive such relicensing or conveying. + +If you add terms to a covered work in accord with this section, you must place, +in the relevant source files, a statement of the additional terms that apply +to those files, or a notice indicating where to find the applicable terms. + +Additional terms, permissive or non-permissive, may be stated in the form +of a separately written license, or stated as exceptions; the above requirements +apply either way. + + 8. Termination. + +You may not propagate or modify a covered work except as expressly provided +under this License. Any attempt otherwise to propagate or modify it is void, +and will automatically terminate your rights under this License (including +any patent licenses granted under the third paragraph of section 11). + +However, if you cease all violation of this License, then your license from +a particular copyright holder is reinstated (a) provisionally, unless and +until the copyright holder explicitly and finally terminates your license, +and (b) permanently, if the copyright holder fails to notify you of the violation +by some reasonable means prior to 60 days after the cessation. + +Moreover, your license from a particular copyright holder is reinstated permanently +if the copyright holder notifies you of the violation by some reasonable means, +this is the first time you have received notice of violation of this License +(for any work) from that copyright holder, and you cure the violation prior +to 30 days after your receipt of the notice. + +Termination of your rights under this section does not terminate the licenses +of parties who have received copies or rights from you under this License. +If your rights have been terminated and not permanently reinstated, you do +not qualify to receive new licenses for the same material under section 10. + + 9. Acceptance Not Required for Having Copies. + +You are not required to accept this License in order to receive or run a copy +of the Program. Ancillary propagation of a covered work occurring solely as +a consequence of using peer-to-peer transmission to receive a copy likewise +does not require acceptance. However, nothing other than this License grants +you permission to propagate or modify any covered work. These actions infringe +copyright if you do not accept this License. Therefore, by modifying or propagating +a covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + +Each time you convey a covered work, the recipient automatically receives +a license from the original licensors, to run, modify and propagate that work, +subject to this License. You are not responsible for enforcing compliance +by third parties with this License. + +An "entity transaction" is a transaction transferring control of an organization, +or substantially all assets of one, or subdividing an organization, or merging +organizations. If propagation of a covered work results from an entity transaction, +each party to that transaction who receives a copy of the work also receives +whatever licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the Corresponding +Source of the work from the predecessor in interest, if the predecessor has +it or can get it with reasonable efforts. + +You may not impose any further restrictions on the exercise of the rights +granted or affirmed under this License. For example, you may not impose a +license fee, royalty, or other charge for exercise of rights granted under +this License, and you may not initiate litigation (including a cross-claim +or counterclaim in a lawsuit) alleging that any patent claim is infringed +by making, using, selling, offering for sale, or importing the Program or +any portion of it. + + 11. Patents. + +A "contributor" is a copyright holder who authorizes use under this License +of the Program or a work on which the Program is based. The work thus licensed +is called the contributor's "contributor version". + +A contributor's "essential patent claims" are all patent claims owned or controlled +by the contributor, whether already acquired or hereafter acquired, that would +be infringed by some manner, permitted by this License, of making, using, +or selling its contributor version, but do not include claims that would be +infringed only as a consequence of further modification of the contributor +version. For purposes of this definition, "control" includes the right to +grant patent sublicenses in a manner consistent with the requirements of this +License. + +Each contributor grants you a non-exclusive, worldwide, royalty-free patent +license under the contributor's essential patent claims, to make, use, sell, +offer for sale, import and otherwise run, modify and propagate the contents +of its contributor version. + +In the following three paragraphs, a "patent license" is any express agreement +or commitment, however denominated, not to enforce a patent (such as an express +permission to practice a patent or covenant not to s ue for patent infringement). +To "grant" such a patent license to a party means to make such an agreement +or commitment not to enforce a patent against the party. + +If you convey a covered work, knowingly relying on a patent license, and the +Corresponding Source of the work is not available for anyone to copy, free +of charge and under the terms of this License, through a publicly available +network server or other readily accessible means, then you must either (1) +cause the Corresponding Source to be so available, or (2) arrange to deprive +yourself of the benefit of the patent license for this particular work, or +(3) arrange, in a manner consistent with the requirements of this License, +to extend the patent + +license to downstream recipients. "Knowingly relying" means you have actual +knowledge that, but for the patent license, your conveying the covered work +in a country, or your recipient's use of the covered work in a country, would +infringe one or more identifiable patents in that country that you have reason +to believe are valid. + +If, pursuant to or in connection with a single transaction or arrangement, +you convey, or propagate by procuring conveyance of, a covered work, and grant +a patent license to some of the parties receiving the covered work authorizing +them to use, propagate, modify or convey a specific copy of the covered work, +then the patent license you grant is automatically extended to all recipients +of the covered work and works based on it. + +A patent license is "discriminatory" if it does not include within the scope +of its coverage, prohibits the exercise of, or is conditioned on the non-exercise +of one or more of the rights that are specifically granted under this License. +You may not convey a covered work if you are a party to an arrangement with +a third party that is in the business of distributing software, under which +you make payment to the third party based on the extent of your activity of +conveying the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory patent +license (a) in connection with copies of the covered work conveyed by you +(or copies made from those copies), or (b) primarily for and in connection +with specific products or compilations that contain the covered work, unless +you entered into that arrangement, or that patent license was granted, prior +to 28 March 2007. + +Nothing in this License shall be construed as excluding or limiting any implied +license or other defenses to infringement that may otherwise be available +to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + +If conditions are imposed on you (whether by court order, agreement or otherwise) +that contradict the conditions of this License, they do not excuse you from +the conditions of this License. If you cannot convey a covered work so as +to satisfy simultaneously your obligations under this License and any other +pertinent obligations, then as a consequence you may + +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey the +Program, the only way you could satisfy both those terms and this License +would be to refrain entirely from conveying the Program. + + 13. Remote Network Interaction; Use with the GNU General Public License. + +Notwithstanding any other provision of this License, if you modify the Program, +your modified version must prominently offer all users interacting with it +remotely through a computer network (if your version supports such interaction) +an opportunity to receive the Corresponding Source of your version by providing +access to the Corresponding Source from a network server at no charge, through +some standard or customary means of facilitating copying of software. This +Corresponding Source shall include the Corresponding Source for any work covered +by version 3 of the GNU General Public License that is incorporated pursuant +to the following paragraph. + +Notwithstanding any other provision of this License, you have permission to +link or combine any covered work with a work licensed under version 3 of the +GNU General Public License into a single combined work, and to convey the +resulting work. The terms of this License will continue to apply to the part +which is the covered work, but the work with which it is combined will remain +governed by version 3 of the GNU General Public License. + + 14. Revised Versions of this License. + +The Free Software Foundation may publish revised and/or new versions of the +GNU Affero General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to address +new problems or concerns. + +Each version is given a distinguishing version number. If the Program specifies +that a certain numbered version of the GNU Affero General Public License "or +any later version" applies to it, you have the option of following the terms +and conditions either of that numbered version or of any later version published +by the Free Software Foundation. If the Program does not specify a version +number of the GNU Affero General Public License, you may choose any version +ever published by the Free Software Foundation. + +If the Program specifies that a proxy can decide which future versions of +the GNU Affero General Public License can be used, that proxy's public statement +of acceptance of a version permanently authorizes you to choose that version +for the Program. + +Later license versions may give you additional or different permissions. However, +no additional obligations are imposed on any author or copyright holder as +a result of your choosing to follow a later version. + + 15. Disclaimer of Warranty. + +THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE +LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER +EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM +PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR +CORRECTION. + + 16. Limitation of Liability. + +IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL +ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM +AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, +INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO +USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED +INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE +PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER +PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + +If the disclaimer of warranty and limitation of liability provided above cannot +be given local legal effect according to their terms, reviewing courts shall +apply local law that most closely approximates an absolute waiver of all civil +liability in connection with the Program, unless a warranty or assumption +of liability accompanies a copy of the Program in return for a fee. END OF +TERMS AND CONDITIONS + +How to Apply These Terms to Your New Programs + +If you develop a new program, and you want it to be of the greatest possible +use to the public, the best way to achieve this is to make it free software +which everyone can redistribute and change under these terms. + +To do so, attach the following notices to the program. It is safest to attach +them to the start of each source file to most effectively state the exclusion +of warranty; and each file should have at least the "copyright" line and a +pointer to where the full notice is found. + + + +Copyright (C) + +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 . + +Also add information on how to contact you by electronic and paper mail. + +If your software can interact with users remotely through a computer network, +you should also make sure that it provides a way for users to get its source. +For example, if your program is a web application, its interface could display +a "Source" link that leads users to an archive of the code. There are many +ways you could offer source, and different solutions will be better for different +programs; see section 13 for the specific requirements. + +You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. For +more information on this, and how to apply and follow the GNU AGPL, see . diff --git a/LICENSES/Apache-2.0.txt b/LICENSES/Apache-2.0.txt new file mode 100644 index 000000000..4ed90b952 --- /dev/null +++ b/LICENSES/Apache-2.0.txt @@ -0,0 +1,208 @@ +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, +AND DISTRIBUTION + + 1. Definitions. + + + +"License" shall mean the terms and conditions for use, reproduction, and distribution +as defined by Sections 1 through 9 of this document. + + + +"Licensor" shall mean the copyright owner or entity authorized by the copyright +owner that is granting the License. + + + +"Legal Entity" shall mean the union of the acting entity and all other entities +that control, are controlled by, or are under common control with that entity. +For the purposes of this definition, "control" means (i) the power, direct +or indirect, to cause the direction or management of such entity, whether +by contract or otherwise, or (ii) ownership of fifty percent (50%) or more +of the outstanding shares, or (iii) beneficial ownership of such entity. + + + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions +granted by this License. + + + +"Source" form shall mean the preferred form for making modifications, including +but not limited to software source code, documentation source, and configuration +files. + + + +"Object" form shall mean any form resulting from mechanical transformation +or translation of a Source form, including but not limited to compiled object +code, generated documentation, and conversions to other media types. + + + +"Work" shall mean the work of authorship, whether in Source or Object form, +made available under the License, as indicated by a copyright notice that +is included in or attached to the work (an example is provided in the Appendix +below). + + + +"Derivative Works" shall mean any work, whether in Source or Object form, +that is based on (or derived from) the Work and for which the editorial revisions, +annotations, elaborations, or other modifications represent, as a whole, an +original work of authorship. For the purposes of this License, Derivative +Works shall not include works that remain separable from, or merely link (or +bind by name) to the interfaces of, the Work and Derivative Works thereof. + + + +"Contribution" shall mean any work of authorship, including the original version +of the Work and any modifications or additions to that Work or Derivative +Works thereof, that is intentionally submitted to Licensor for inclusion in +the Work by the copyright owner or by an individual or Legal Entity authorized +to submit on behalf of the copyright owner. For the purposes of this definition, +"submitted" means any form of electronic, verbal, or written communication +sent to the Licensor or its representatives, including but not limited to +communication on electronic mailing lists, source code control systems, and +issue tracking systems that are managed by, or on behalf of, the Licensor +for the purpose of discussing and improving the Work, but excluding communication +that is conspicuously marked or otherwise designated in writing by the copyright +owner as "Not a Contribution." + + + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf +of whom a Contribution has been received by Licensor and subsequently incorporated +within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of this +License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, +no-charge, royalty-free, irrevocable copyright license to reproduce, prepare +Derivative Works of, publicly display, publicly perform, sublicense, and distribute +the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of this License, +each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, +no-charge, royalty-free, irrevocable (except as stated in this section) patent +license to make, have made, use, offer to sell, sell, import, and otherwise +transfer the Work, where such license applies only to those patent claims +licensable by such Contributor that are necessarily infringed by their Contribution(s) +alone or by combination of their Contribution(s) with the Work to which such +Contribution(s) was submitted. If You institute patent litigation against +any entity (including a cross-claim or counterclaim in a lawsuit) alleging +that the Work or a Contribution incorporated within the Work constitutes direct +or contributory patent infringement, then any patent licenses granted to You +under this License for that Work shall terminate as of the date such litigation +is filed. + +4. Redistribution. You may reproduce and distribute copies of the Work or +Derivative Works thereof in any medium, with or without modifications, and +in Source or Object form, provided that You meet the following conditions: + +(a) You must give any other recipients of the Work or Derivative Works a copy +of this License; and + +(b) You must cause any modified files to carry prominent notices stating that +You changed the files; and + +(c) You must retain, in the Source form of any Derivative Works that You distribute, +all copyright, patent, trademark, and attribution notices from the Source +form of the Work, excluding those notices that do not pertain to any part +of the Derivative Works; and + +(d) If the Work includes a "NOTICE" text file as part of its distribution, +then any Derivative Works that You distribute must include a readable copy +of the attribution notices contained within such NOTICE file, excluding those +notices that do not pertain to any part of the Derivative Works, in at least +one of the following places: within a NOTICE text file distributed as part +of the Derivative Works; within the Source form or documentation, if provided +along with the Derivative Works; or, within a display generated by the Derivative +Works, if and wherever such third-party notices normally appear. The contents +of the NOTICE file are for informational purposes only and do not modify the +License. You may add Your own attribution notices within Derivative Works +that You distribute, alongside or as an addendum to the NOTICE text from the +Work, provided that such additional attribution notices cannot be construed +as modifying the License. + +You may add Your own copyright statement to Your modifications and may provide +additional or different license terms and conditions for use, reproduction, +or distribution of Your modifications, or for any such Derivative Works as +a whole, provided Your use, reproduction, and distribution of the Work otherwise +complies with the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, any +Contribution intentionally submitted for inclusion in the Work by You to the +Licensor shall be under the terms and conditions of this License, without +any additional terms or conditions. Notwithstanding the above, nothing herein +shall supersede or modify the terms of any separate license agreement you +may have executed with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade names, +trademarks, service marks, or product names of the Licensor, except as required +for reasonable and customary use in describing the origin of the Work and +reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or agreed to +in writing, Licensor provides the Work (and each Contributor provides its +Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied, including, without limitation, any warranties +or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR +A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness +of using or redistributing the Work and assume any risks associated with Your +exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, whether +in tort (including negligence), contract, or otherwise, unless required by +applicable law (such as deliberate and grossly negligent acts) or agreed to +in writing, shall any Contributor be liable to You for damages, including +any direct, indirect, special, incidental, or consequential damages of any +character arising as a result of this License or out of the use or inability +to use the Work (including but not limited to damages for loss of goodwill, +work stoppage, computer failure or malfunction, or any and all other commercial +damages or losses), even if such Contributor has been advised of the possibility +of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing the Work +or Derivative Works thereof, You may choose to offer, and charge a fee for, +acceptance of support, warranty, indemnity, or other liability obligations +and/or rights consistent with this License. However, in accepting such obligations, +You may act only on Your own behalf and on Your sole responsibility, not on +behalf of any other Contributor, and only if You agree to indemnify, defend, +and hold each Contributor harmless for any liability incurred by, or claims +asserted against, such Contributor by reason of your accepting any such warranty +or additional liability. END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + +To apply the Apache License to your work, attach the following boilerplate +notice, with the fields enclosed by brackets "[]" replaced with your own identifying +information. (Don't include the brackets!) The text should be enclosed in +the appropriate comment syntax for the file format. We also recommend that +a file or class name and description of purpose be included on the same "printed +page" as the copyright notice for easier identification within third-party +archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); + +you may not use this file except in compliance with the License. + +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software + +distributed under the License is distributed on an "AS IS" BASIS, + +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + +See the License for the specific language governing permissions and + +limitations under the License. diff --git a/LICENSES/CC-BY-SA-4.0.txt b/LICENSES/CC-BY-SA-4.0.txt new file mode 100644 index 000000000..f50cdd32a --- /dev/null +++ b/LICENSES/CC-BY-SA-4.0.txt @@ -0,0 +1,350 @@ +Creative Commons Attribution-ShareAlike 4.0 International Creative Commons +Corporation ("Creative Commons") is not a law firm and does not provide legal +services or legal advice. Distribution of Creative Commons public licenses +does not create a lawyer-client or other relationship. Creative Commons makes +its licenses and related information available on an "as-is" basis. Creative +Commons gives no warranties regarding its licenses, any material licensed +under their terms and conditions, or any related information. Creative Commons +disclaims all liability for damages resulting from their use to the fullest +extent possible. + +Using Creative Commons Public Licenses + +Creative Commons public licenses provide a standard set of terms and conditions +that creators and other rights holders may use to share original works of +authorship and other material subject to copyright and certain other rights +specified in the public license below. The following considerations are for +informational purposes only, are not exhaustive, and do not form part of our +licenses. + +Considerations for licensors: Our public licenses are intended for use by +those authorized to give the public permission to use material in ways otherwise +restricted by copyright and certain other rights. Our licenses are irrevocable. +Licensors should read and understand the terms and conditions of the license +they choose before applying it. Licensors should also secure all rights necessary +before applying our licenses so that the public can reuse the material as +expected. Licensors should clearly mark any material not subject to the license. +This includes other CC-licensed material, or material used under an exception +or limitation to copyright. More considerations for licensors : wiki.creativecommons.org/Considerations_for_licensors + +Considerations for the public: By using one of our public licenses, a licensor +grants the public permission to use the licensed material under specified +terms and conditions. If the licensor's permission is not necessary for any +reason–for example, because of any applicable exception or limitation to copyright–then +that use is not regulated by the license. Our licenses grant only permissions +under copyright and certain other rights that a licensor has authority to +grant. Use of the licensed material may still be restricted for other reasons, +including because others have copyright or other rights in the material. A +licensor may make special requests, such as asking that all changes be marked +or described. + +Although not required by our licenses, you are encouraged to respect those +requests where reasonable. More considerations for the public : wiki.creativecommons.org/Considerations_for_licensees + +Creative Commons Attribution-ShareAlike 4.0 International Public License + +By exercising the Licensed Rights (defined below), You accept and agree to +be bound by the terms and conditions of this Creative Commons Attribution-ShareAlike +4.0 International Public License ("Public License"). To the extent this Public +License may be interpreted as a contract, You are granted the Licensed Rights +in consideration of Your acceptance of these terms and conditions, and the +Licensor grants You such rights in consideration of benefits the Licensor +receives from making the Licensed Material available under these terms and +conditions. + +Section 1 – Definitions. + +a. Adapted Material means material subject to Copyright and Similar Rights +that is derived from or based upon the Licensed Material and in which the +Licensed Material is translated, altered, arranged, transformed, or otherwise +modified in a manner requiring permission under the Copyright and Similar +Rights held by the Licensor. For purposes of this Public License, where the +Licensed Material is a musical work, performance, or sound recording, Adapted +Material is always produced where the Licensed Material is synched in timed +relation with a moving image. + +b. Adapter's License means the license You apply to Your Copyright and Similar +Rights in Your contributions to Adapted Material in accordance with the terms +and conditions of this Public License. + +c. BY-SA Compatible License means a license listed at creativecommons.org/compatiblelicenses, +approved by Creative Commons as essentially the equivalent of this Public +License. + +d. Copyright and Similar Rights means copyright and/or similar rights closely +related to copyright including, without limitation, performance, broadcast, +sound recording, and Sui Generis Database Rights, without regard to how the +rights are labeled or categorized. For purposes of this Public License, the +rights specified in Section 2(b)(1)-(2) are not Copyright and Similar Rights. + +e. Effective Technological Measures means those measures that, in the absence +of proper authority, may not be circumvented under laws fulfilling obligations +under Article 11 of the WIPO Copyright Treaty adopted on December 20, 1996, +and/or similar international agreements. + +f. Exceptions and Limitations means fair use, fair dealing, and/or any other +exception or limitation to Copyright and Similar Rights that applies to Your +use of the Licensed Material. + +g. License Elements means the license attributes listed in the name of a Creative +Commons Public License. The License Elements of this Public License are Attribution +and ShareAlike. + +h. Licensed Material means the artistic or literary work, database, or other +material to which the Licensor applied this Public License. + +i. Licensed Rights means the rights granted to You subject to the terms and +conditions of this Public License, which are limited to all Copyright and +Similar Rights that apply to Your use of the Licensed Material and that the +Licensor has authority to license. + +j. Licensor means the individual(s) or entity(ies) granting rights under this +Public License. + +k. Share means to provide material to the public by any means or process that +requires permission under the Licensed Rights, such as reproduction, public +display, public performance, distribution, dissemination, communication, or +importation, and to make material available to the public including in ways +that members of the public may access the material from a place and at a time +individually chosen by them. + +l. Sui Generis Database Rights means rights other than copyright resulting +from Directive 96/9/EC of the European Parliament and of the Council of 11 +March 1996 on the legal protection of databases, as amended and/or succeeded, +as well as other essentially equivalent rights anywhere in the world. + +m. You means the individual or entity exercising the Licensed Rights under +this Public License. Your has a corresponding meaning. + +Section 2 – Scope. + + a. License grant. + +1. Subject to the terms and conditions of this Public License, the Licensor +hereby grants You a worldwide, royalty-free, non-sublicensable, non-exclusive, +irrevocable license to exercise the Licensed Rights in the Licensed Material +to: + + A. reproduce and Share the Licensed Material, in whole or in part; and + + B. produce, reproduce, and Share Adapted Material. + +2. Exceptions and Limitations. For the avoidance of doubt, where Exceptions +and Limitations apply to Your use, this Public License does not apply, and +You do not need to comply with its terms and conditions. + + 3. Term. The term of this Public License is specified in Section 6(a). + +4. Media and formats; technical modifications allowed. The Licensor authorizes +You to exercise the Licensed Rights in all media and formats whether now known +or hereafter created, and to make technical modifications necessary to do +so. The Licensor waives and/or agrees not to assert any right or authority +to forbid You from making technical modifications necessary to exercise the +Licensed Rights, including technical modifications necessary to circumvent +Effective Technological Measures. For purposes of this Public License, simply +making modifications authorized by this Section 2(a)(4) never produces Adapted +Material. + + 5. Downstream recipients. + +A. Offer from the Licensor – Licensed Material. Every recipient of the Licensed +Material automatically receives an offer from the Licensor to exercise the +Licensed Rights under the terms and conditions of this Public License. + +B. Additional offer from the Licensor – Adapted Material. Every recipient +of Adapted Material from You automatically receives an offer from the Licensor +to exercise the Licensed Rights in the Adapted Material under the conditions +of the Adapter's License You apply. + +C. No downstream restrictions. You may not offer or impose any additional +or different terms or conditions on, or apply any Effective Technological +Measures to, the Licensed Material if doing so restricts exercise of the Licensed +Rights by any recipient of the Licensed Material. + +6. No endorsement. Nothing in this Public License constitutes or may be construed +as permission to assert or imply that You are, or that Your use of the Licensed +Material is, connected with, or sponsored, endorsed, or granted official status +by, the Licensor or others designated to receive attribution as provided in +Section 3(a)(1)(A)(i). + + b. Other rights. + +1. Moral rights, such as the right of integrity, are not licensed under this +Public License, nor are publicity, privacy, and/or other similar personality +rights; however, to the extent possible, the Licensor waives and/or agrees +not to assert any such rights held by the Licensor to the limited extent necessary +to allow You to exercise the Licensed Rights, but not otherwise. + +2. Patent and trademark rights are not licensed under this Public License. + +3. To the extent possible, the Licensor waives any right to collect royalties +from You for the exercise of the Licensed Rights, whether directly or through +a collecting society under any voluntary or waivable statutory or compulsory +licensing scheme. In all other cases the Licensor expressly reserves any right +to collect such royalties. + +Section 3 – License Conditions. + +Your exercise of the Licensed Rights is expressly made subject to the following +conditions. + + a. Attribution. + +1. If You Share the Licensed Material (including in modified form), You must: + +A. retain the following if it is supplied by the Licensor with the Licensed +Material: + +i. identification of the creator(s) of the Licensed Material and any others +designated to receive attribution, in any reasonable manner requested by the +Licensor (including by pseudonym if designated); + + ii. a copyright notice; + + iii. a notice that refers to this Public License; + + iv. a notice that refers to the disclaimer of warranties; + +v. a URI or hyperlink to the Licensed Material to the extent reasonably practicable; + +B. indicate if You modified the Licensed Material and retain an indication +of any previous modifications; and + +C. indicate the Licensed Material is licensed under this Public License, and +include the text of, or the URI or hyperlink to, this Public License. + +2. You may satisfy the conditions in Section 3(a)(1) in any reasonable manner +based on the medium, means, and context in which You Share the Licensed Material. +For example, it may be reasonable to satisfy the conditions by providing a +URI or hyperlink to a resource that includes the required information. + +3. If requested by the Licensor, You must remove any of the information required +by Section 3(a)(1)(A) to the extent reasonably practicable. + +b. ShareAlike.In addition to the conditions in Section 3(a), if You Share +Adapted Material You produce, the following conditions also apply. + +1. The Adapter's License You apply must be a Creative Commons license with +the same License Elements, this version or later, or a BY-SA Compatible License. + +2. You must include the text of, or the URI or hyperlink to, the Adapter's +License You apply. You may satisfy this condition in any reasonable manner +based on the medium, means, and context in which You Share Adapted Material. + +3. You may not offer or impose any additional or different terms or conditions +on, or apply any Effective Technological Measures to, Adapted Material that +restrict exercise of the rights granted under the Adapter's License You apply. + +Section 4 – Sui Generis Database Rights. + +Where the Licensed Rights include Sui Generis Database Rights that apply to +Your use of the Licensed Material: + +a. for the avoidance of doubt, Section 2(a)(1) grants You the right to extract, +reuse, reproduce, and Share all or a substantial portion of the contents of +the database; + +b. if You include all or a substantial portion of the database contents in +a database in which You have Sui Generis Database Rights, then the database +in which You have Sui Generis Database Rights (but not its individual contents) +is Adapted Material, including for purposes of Section 3(b); and + +c. You must comply with the conditions in Section 3(a) if You Share all or +a substantial portion of the contents of the database. + +For the avoidance of doubt, this Section 4 supplements and does not replace +Your obligations under this Public License where the Licensed Rights include +other Copyright and Similar Rights. + +Section 5 – Disclaimer of Warranties and Limitation of Liability. + +a. Unless otherwise separately undertaken by the Licensor, to the extent possible, +the Licensor offers the Licensed Material as-is and as-available, and makes +no representations or warranties of any kind concerning the Licensed Material, +whether express, implied, statutory, or other. This includes, without limitation, +warranties of title, merchantability, fitness for a particular purpose, non-infringement, +absence of latent or other defects, accuracy, or the presence or absence of +errors, whether or not known or discoverable. Where disclaimers of warranties +are not allowed in full or in part, this disclaimer may not apply to You. + +b. To the extent possible, in no event will the Licensor be liable to You +on any legal theory (including, without limitation, negligence) or otherwise +for any direct, special, indirect, incidental, consequential, punitive, exemplary, +or other losses, costs, expenses, or damages arising out of this Public License +or use of the Licensed Material, even if the Licensor has been advised of +the possibility of such losses, costs, expenses, or damages. Where a limitation +of liability is not allowed in full or in part, this limitation may not apply +to You. + +c. The disclaimer of warranties and limitation of liability provided above +shall be interpreted in a manner that, to the extent possible, most closely +approximates an absolute disclaimer and waiver of all liability. + +Section 6 – Term and Termination. + +a. This Public License applies for the term of the Copyright and Similar Rights +licensed here. However, if You fail to comply with this Public License, then +Your rights under this Public License terminate automatically. + +b. Where Your right to use the Licensed Material has terminated under Section +6(a), it reinstates: + +1. automatically as of the date the violation is cured, provided it is cured +within 30 days of Your discovery of the violation; or + + 2. upon express reinstatement by the Licensor. + +c. For the avoidance of doubt, this Section 6(b) does not affect any right +the Licensor may have to seek remedies for Your violations of this Public +License. + +d. For the avoidance of doubt, the Licensor may also offer the Licensed Material +under separate terms or conditions or stop distributing the Licensed Material +at any time; however, doing so will not terminate this Public License. + + e. Sections 1, 5, 6, 7, and 8 survive termination of this Public License. + +Section 7 – Other Terms and Conditions. + +a. The Licensor shall not be bound by any additional or different terms or +conditions communicated by You unless expressly agreed. + +b. Any arrangements, understandings, or agreements regarding the Licensed +Material not stated herein are separate from and independent of the terms +and conditions of this Public License. + +Section 8 – Interpretation. + +a. For the avoidance of doubt, this Public License does not, and shall not +be interpreted to, reduce, limit, restrict, or impose conditions on any use +of the Licensed Material that could lawfully be made without permission under +this Public License. + +b. To the extent possible, if any provision of this Public License is deemed +unenforceable, it shall be automatically reformed to the minimum extent necessary +to make it enforceable. If the provision cannot be reformed, it shall be severed +from this Public License without affecting the enforceability of the remaining +terms and conditions. + +c. No term or condition of this Public License will be waived and no failure +to comply consented to unless expressly agreed to by the Licensor. + +d. Nothing in this Public License constitutes or may be interpreted as a limitation +upon, or waiver of, any privileges and immunities that apply to the Licensor +or You, including from the legal processes of any jurisdiction or authority. + +Creative Commons is not a party to its public licenses. Notwithstanding, Creative +Commons may elect to apply one of its public licenses to material it publishes +and in those instances will be considered the "Licensor." The text of the +Creative Commons public licenses is dedicated to the public domain under the +CC0 Public Domain Dedication. Except for the limited purpose of indicating +that material is shared under a Creative Commons public license or as otherwise +permitted by the Creative Commons policies published at creativecommons.org/policies, +Creative Commons does not authorize the use of the trademark "Creative Commons" +or any other trademark or logo of Creative Commons without its prior written +consent including, without limitation, in connection with any unauthorized +modifications to any of its public licenses or any other arrangements, understandings, +or agreements concerning use of licensed material. For the avoidance of doubt, +this paragraph does not form part of the public licenses. + +Creative Commons may be contacted at creativecommons.org. diff --git a/LICENSES/CC0-1.0.txt b/LICENSES/CC0-1.0.txt new file mode 100644 index 000000000..a343ccd43 --- /dev/null +++ b/LICENSES/CC0-1.0.txt @@ -0,0 +1,119 @@ +Creative Commons Legal Code + +CC0 1.0 Universal CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES +NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE +AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION +ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE USE +OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED HEREUNDER, AND DISCLAIMS +LIABILITY FOR DAMAGES RESULTING FROM THE USE OF THIS DOCUMENT OR THE INFORMATION +OR WORKS PROVIDED HEREUNDER. + +Statement of Purpose + +The laws of most jurisdictions throughout the world automatically confer exclusive +Copyright and Related Rights (defined below) upon the creator and subsequent +owner(s) (each and all, an "owner") of an original work of authorship and/or +a database (each, a "Work"). + +Certain owners wish to permanently relinquish those rights to a Work for the +purpose of contributing to a commons of creative, cultural and scientific +works ("Commons") that the public can reliably and without fear of later claims +of infringement build upon, modify, incorporate in other works, reuse and +redistribute as freely as possible in any form whatsoever and for any purposes, +including without limitation commercial purposes. These owners may contribute +to the Commons to promote the ideal of a free culture and the further production +of creative, cultural and scientific works, or to gain reputation or greater +distribution for their Work in part through the use and efforts of others. + +For these and/or other purposes and motivations, and without any expectation +of additional consideration or compensation, the person associating CC0 with +a Work (the "Affirmer"), to the extent that he or she is an owner of Copyright +and Related Rights in the Work, voluntarily elects to apply CC0 to the Work +and publicly distribute the Work under its terms, with knowledge of his or +her Copyright and Related Rights in the Work and the meaning and intended +legal effect of CC0 on those rights. + +1. Copyright and Related Rights. A Work made available under CC0 may be protected +by copyright and related or neighboring rights ("Copyright and Related Rights"). +Copyright and Related Rights include, but are not limited to, the following: + +i. the right to reproduce, adapt, distribute, perform, display, communicate, +and translate a Work; + + ii. moral rights retained by the original author(s) and/or performer(s); + +iii. publicity and privacy rights pertaining to a person's image or likeness +depicted in a Work; + +iv. rights protecting against unfair competition in regards to a Work, subject +to the limitations in paragraph 4(a), below; + +v. rights protecting the extraction, dissemination, use and reuse of data +in a Work; + +vi. database rights (such as those arising under Directive 96/9/EC of the +European Parliament and of the Council of 11 March 1996 on the legal protection +of databases, and under any national implementation thereof, including any +amended or successor version of such directive); and + +vii. other similar, equivalent or corresponding rights throughout the world +based on applicable law or treaty, and any national implementations thereof. + +2. Waiver. To the greatest extent permitted by, but not in contravention of, +applicable law, Affirmer hereby overtly, fully, permanently, irrevocably and +unconditionally waives, abandons, and surrenders all of Affirmer's Copyright +and Related Rights and associated claims and causes of action, whether now +known or unknown (including existing as well as future claims and causes of +action), in the Work (i) in all territories worldwide, (ii) for the maximum +duration provided by applicable law or treaty (including future time extensions), +(iii) in any current or future medium and for any number of copies, and (iv) +for any purpose whatsoever, including without limitation commercial, advertising +or promotional purposes (the "Waiver"). Affirmer makes the Waiver for the +benefit of each member of the public at large and to the detriment of Affirmer's +heirs and successors, fully intending that such Waiver shall not be subject +to revocation, rescission, cancellation, termination, or any other legal or +equitable action to disrupt the quiet enjoyment of the Work by the public +as contemplated by Affirmer's express Statement of Purpose. + +3. Public License Fallback. Should any part of the Waiver for any reason be +judged legally invalid or ineffective under applicable law, then the Waiver +shall be preserved to the maximum extent permitted taking into account Affirmer's +express Statement of Purpose. In addition, to the extent the Waiver is so +judged Affirmer hereby grants to each affected person a royalty-free, non +transferable, non sublicensable, non exclusive, irrevocable and unconditional +license to exercise Affirmer's Copyright and Related Rights in the Work (i) +in all territories worldwide, (ii) for the maximum duration provided by applicable +law or treaty (including future time extensions), (iii) in any current or +future medium and for any number of copies, and (iv) for any purpose whatsoever, +including without limitation commercial, advertising or promotional purposes +(the "License"). The License shall be deemed effective as of the date CC0 +was applied by Affirmer to the Work. Should any part of the License for any +reason be judged legally invalid or ineffective under applicable law, such +partial invalidity or ineffectiveness shall not invalidate the remainder of +the License, and in such case Affirmer hereby affirms that he or she will +not (i) exercise any of his or her remaining Copyright and Related Rights +in the Work or (ii) assert any associated claims and causes of action with +respect to the Work, in either case contrary to Affirmer's express Statement +of Purpose. + + 4. Limitations and Disclaimers. + +a. No trademark or patent rights held by Affirmer are waived, abandoned, surrendered, +licensed or otherwise affected by this document. + +b. Affirmer offers the Work as-is and makes no representations or warranties +of any kind concerning the Work, express, implied, statutory or otherwise, +including without limitation warranties of title, merchantability, fitness +for a particular purpose, non infringement, or the absence of latent or other +defects, accuracy, or the present or absence of errors, whether or not discoverable, +all to the greatest extent permissible under applicable law. + +c. Affirmer disclaims responsibility for clearing rights of other persons +that may apply to the Work or any use thereof, including without limitation +any person's Copyright and Related Rights in the Work. Further, Affirmer disclaims +responsibility for obtaining any necessary consents, permissions or other +rights required for any use of the Work. + +d. Affirmer understands and acknowledges that Creative Commons is not a party +to this document and has no duty or obligation with respect to this CC0 or +use of the Work. diff --git a/LICENSES/GPL-3.0-or-later.txt b/LICENSES/GPL-3.0-or-later.txt new file mode 100644 index 000000000..e142a525b --- /dev/null +++ b/LICENSES/GPL-3.0-or-later.txt @@ -0,0 +1,625 @@ +GNU GENERAL PUBLIC LICENSE + +Version 3, 29 June 2007 + +Copyright © 2007 Free Software Foundation, Inc. + +Everyone is permitted to copy and distribute verbatim copies of this license +document, but changing it is not allowed. + +Preamble + +The GNU General Public License is a free, copyleft license for software and +other kinds of works. + +The licenses for most software and other practical works are designed to take +away your freedom to share and change the works. By contrast, the GNU General +Public License is intended to guarantee your freedom to share and change all +versions of a program--to make sure it remains free software for all its users. +We, the Free Software Foundation, use the GNU General Public License for most +of our software; it applies also to any other work released this way by its +authors. You can apply it to your programs, too. + +When we speak of free software, we are referring to freedom, not price. Our +General Public Licenses are designed to make sure that you have the freedom +to distribute copies of free software (and charge for them if you wish), that +you receive source code or can get it if you want it, that you can change +the software or use pieces of it in new free programs, and that you know you +can do these things. + +To protect your rights, we need to prevent others from denying you these rights +or asking you to surrender the rights. Therefore, you have certain responsibilities +if you distribute copies of the software, or if you modify it: responsibilities +to respect the freedom of others. + +For example, if you distribute copies of such a program, whether gratis or +for a fee, you must pass on to the recipients the same freedoms that you received. +You must make sure that they, too, receive or can get the source code. And +you must show them these terms so they know their rights. + +Developers that use the GNU GPL protect your rights with two steps: (1) assert +copyright on the software, and (2) offer you this License giving you legal +permission to copy, distribute and/or modify it. + +For the developers' and authors' protection, the GPL clearly explains that +there is no warranty for this free software. For both users' and authors' +sake, the GPL requires that modified versions be marked as changed, so that +their problems will not be attributed erroneously to authors of previous versions. + +Some devices are designed to deny users access to install or run modified +versions of the software inside them, although the manufacturer can do so. +This is fundamentally incompatible with the aim of protecting users' freedom +to change the software. The systematic pattern of such abuse occurs in the +area of products for individuals to use, which is precisely where it is most +unacceptable. Therefore, we have designed this version of the GPL to prohibit +the practice for those products. If such problems arise substantially in other +domains, we stand ready to extend this provision to those domains in future +versions of the GPL, as needed to protect the freedom of users. + +Finally, every program is threatened constantly by software patents. States +should not allow patents to restrict development and use of software on general-purpose +computers, but in those that do, we wish to avoid the special danger that +patents applied to a free program could make it effectively proprietary. To +prevent this, the GPL assures that patents cannot be used to render the program +non-free. + +The precise terms and conditions for copying, distribution and modification +follow. + +TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + +"Copyright" also means copyright-like laws that apply to other kinds of works, +such as semiconductor masks. + +"The Program" refers to any copyrightable work licensed under this License. +Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals +or organizations. + +To "modify" a work means to copy from or adapt all or part of the work in +a fashion requiring copyright permission, other than the making of an exact +copy. The resulting work is called a "modified version" of the earlier work +or a work "based on" the earlier work. + +A "covered work" means either the unmodified Program or a work based on the +Program. + +To "propagate" a work means to do anything with it that, without permission, +would make you directly or secondarily liable for infringement under applicable +copyright law, except executing it on a computer or modifying a private copy. +Propagation includes copying, distribution (with or without modification), +making available to the public, and in some countries other activities as +well. + +To "convey" a work means any kind of propagation that enables other parties +to make or receive copies. Mere interaction with a user through a computer +network, with no transfer of a copy, is not conveying. + +An interactive user interface displays "Appropriate Legal Notices" to the +extent that it includes a convenient and prominently visible feature that +(1) displays an appropriate copyright notice, and (2) tells the user that +there is no warranty for the work (except to the extent that warranties are +provided), that licensees may convey the work under this License, and how +to view a copy of this License. If the interface presents a list of user commands +or options, such as a menu, a prominent item in the list meets this criterion. + + 1. Source Code. + +The "source code" for a work means the preferred form of the work for making +modifications to it. "Object code" means any non-source form of a work. + +A "Standard Interface" means an interface that either is an official standard +defined by a recognized standards body, or, in the case of interfaces specified +for a particular programming language, one that is widely used among developers +working in that language. + +The "System Libraries" of an executable work include anything, other than +the work as a whole, that (a) is included in the normal form of packaging +a Major Component, but which is not part of that Major Component, and (b) +serves only to enable use of the work with that Major Component, or to implement +a Standard Interface for which an implementation is available to the public +in source code form. A "Major Component", in this context, means a major essential +component (kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to produce +the work, or an object code interpreter used to run it. + +The "Corresponding Source" for a work in object code form means all the source +code needed to generate, install, and (for an executable work) run the object +code and to modify the work, including scripts to control those activities. +However, it does not include the work's System Libraries, or general-purpose +tools or generally available free programs which are used unmodified in performing +those activities but which are not part of the work. For example, Corresponding +Source includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically linked +subprograms that the work is specifically designed to require, such as by +intimate data communication or control flow between those subprograms and +other parts of the work. + +The Corresponding Source need not include anything that users can regenerate +automatically from other parts of the Corresponding Source. + + The Corresponding Source for a work in source code form is that same work. + + 2. Basic Permissions. + +All rights granted under this License are granted for the term of copyright +on the Program, and are irrevocable provided the stated conditions are met. +This License explicitly affirms your unlimited permission to run the unmodified +Program. The output from running a covered work is covered by this License +only if the output, given its content, constitutes a covered work. This License +acknowledges your rights of fair use or other equivalent, as provided by copyright +law. + +You may make, run and propagate covered works that you do not convey, without +conditions so long as your license otherwise remains in force. You may convey +covered works to others for the sole purpose of having them make modifications +exclusively for you, or provide you with facilities for running those works, +provided that you comply with the terms of this License in conveying all material +for which you do not control copyright. Those thus making or running the covered +works for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of your copyrighted +material outside their relationship with you. + +Conveying under any other circumstances is permitted solely under the conditions +stated below. Sublicensing is not allowed; section 10 makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + +No covered work shall be deemed part of an effective technological measure +under any applicable law fulfilling obligations under article 11 of the WIPO +copyright treaty adopted on 20 December 1996, or similar laws prohibiting +or restricting circumvention of such measures. + +When you convey a covered work, you waive any legal power to forbid circumvention +of technological measures to the extent such circumvention is effected by +exercising rights under this License with respect to the covered work, and +you disclaim any intention to limit operation or modification of the work +as a means of enforcing, against the work's users, your or third parties' +legal rights to forbid circumvention of technological measures. + + 4. Conveying Verbatim Copies. + +You may convey verbatim copies of the Program's source code as you receive +it, in any medium, provided that you conspicuously and appropriately publish +on each copy an appropriate copyright notice; keep intact all notices stating +that this License and any non-permissive terms added in accord with section +7 apply to the code; keep intact all notices of the absence of any warranty; +and give all recipients a copy of this License along with the Program. + +You may charge any price or no price for each copy that you convey, and you +may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + +You may convey a work based on the Program, or the modifications to produce +it from the Program, in the form of source code under the terms of section +4, provided that you also meet all of these conditions: + +a) The work must carry prominent notices stating that you modified it, and +giving a relevant date. + +b) The work must carry prominent notices stating that it is released under +this License and any conditions added under section 7. This requirement modifies +the requirement in section 4 to "keep intact all notices". + +c) You must license the entire work, as a whole, under this License to anyone +who comes into possession of a copy. This License will therefore apply, along +with any applicable section 7 additional terms, to the whole of the work, +and all its parts, regardless of how they are packaged. This License gives +no permission to license the work in any other way, but it does not invalidate +such permission if you have separately received it. + +d) If the work has interactive user interfaces, each must display Appropriate +Legal Notices; however, if the Program has interactive interfaces that do +not display Appropriate Legal Notices, your work need not make them do so. + +A compilation of a covered work with other separate and independent works, +which are not by their nature extensions of the covered work, and which are +not combined with it such as to form a larger program, in or on a volume of +a storage or distribution medium, is called an "aggregate" if the compilation +and its resulting copyright are not used to limit the access or legal rights +of the compilation's users beyond what the individual works permit. Inclusion +of a covered work in an aggregate does not cause this License to apply to +the other parts of the aggregate. + + 6. Conveying Non-Source Forms. + +You may convey a covered work in object code form under the terms of sections +4 and 5, provided that you also convey the machine-readable Corresponding +Source under the terms of this License, in one of these ways: + +a) Convey the object code in, or embodied in, a physical product (including +a physical distribution medium), accompanied by the Corresponding Source fixed +on a durable physical medium customarily used for software interchange. + +b) Convey the object code in, or embodied in, a physical product (including +a physical distribution medium), accompanied by a written offer, valid for +at least three years and valid for as long as you offer spare parts or customer +support for that product model, to give anyone who possesses the object code +either (1) a copy of the Corresponding Source for all the software in the +product that is covered by this License, on a durable physical medium customarily +used for software interchange, for a price no more than your reasonable cost +of physically performing this conveying of source, or (2) access to copy the +Corresponding Source from a network server at no charge. + +c) Convey individual copies of the object code with a copy of the written +offer to provide the Corresponding Source. This alternative is allowed only +occasionally and noncommercially, and only if you received the object code +with such an offer, in accord with subsection 6b. + +d) Convey the object code by offering access from a designated place (gratis +or for a charge), and offer equivalent access to the Corresponding Source +in the same way through the same place at no further charge. You need not +require recipients to copy the Corresponding Source along with the object +code. If the place to copy the object code is a network server, the Corresponding +Source may be on a different server (operated by you or a third party) that +supports equivalent copying facilities, provided you maintain clear directions +next to the object code saying where to find the Corresponding Source. Regardless +of what server hosts the Corresponding Source, you remain obligated to ensure +that it is available for as long as needed to satisfy these requirements. + +e) Convey the object code using peer-to-peer transmission, provided you inform +other peers where the object code and Corresponding Source of the work are +being offered to the general public at no charge under subsection 6d. + +A separable portion of the object code, whose source code is excluded from +the Corresponding Source as a System Library, need not be included in conveying +the object code work. + +A "User Product" is either (1) a "consumer product", which means any tangible +personal property which is normally used for personal, family, or household +purposes, or (2) anything designed or sold for incorporation into a dwelling. +In determining whether a product is a consumer product, doubtful cases shall +be resolved in favor of coverage. For a particular product received by a particular +user, "normally used" refers to a typical or common use of that class of product, +regardless of the status of the particular user or of the way in which the +particular user actually uses, or expects or is expected to use, the product. +A product is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent the +only significant mode of use of the product. + +"Installation Information" for a User Product means any methods, procedures, +authorization keys, or other information required to install and execute modified +versions of a covered work in that User Product from a modified version of +its Corresponding Source. The information must suffice to ensure that the +continued functioning of the modified object code is in no case prevented +or interfered with solely because modification has been made. + +If you convey an object code work under this section in, or with, or specifically +for use in, a User Product, and the conveying occurs as part of a transaction +in which the right of possession and use of the User Product is transferred +to the recipient in perpetuity or for a fixed term (regardless of how the +transaction is characterized), the Corresponding Source conveyed under this +section must be accompanied by the Installation Information. But this requirement +does not apply if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has been installed +in ROM). + +The requirement to provide Installation Information does not include a requirement +to continue to provide support service, warranty, or updates for a work that +has been modified or installed by the recipient, or for the User Product in +which it has been modified or installed. Access to a network may be denied +when the modification itself materially and adversely affects the operation +of the network or violates the rules and protocols for communication across +the network. + +Corresponding Source conveyed, and Installation Information provided, in accord +with this section must be in a format that is publicly documented (and with +an implementation available to the public in source code form), and must require +no special password or key for unpacking, reading or copying. + + 7. Additional Terms. + +"Additional permissions" are terms that supplement the terms of this License +by making exceptions from one or more of its conditions. Additional permissions +that are applicable to the entire Program shall be treated as though they +were included in this License, to the extent that they are valid under applicable +law. If additional permissions apply only to part of the Program, that part +may be used separately under those permissions, but the entire Program remains +governed by this License without regard to the additional permissions. + +When you convey a copy of a covered work, you may at your option remove any +additional permissions from that copy, or from any part of it. (Additional +permissions may be written to require their own removal in certain cases when +you modify the work.) You may place additional permissions on material, added +by you to a covered work, for which you have or can give appropriate copyright +permission. + +Notwithstanding any other provision of this License, for material you add +to a covered work, you may (if authorized by the copyright holders of that +material) supplement the terms of this License with terms: + +a) Disclaiming warranty or limiting liability differently from the terms of +sections 15 and 16 of this License; or + +b) Requiring preservation of specified reasonable legal notices or author +attributions in that material or in the Appropriate Legal Notices displayed +by works containing it; or + +c) Prohibiting misrepresentation of the origin of that material, or requiring +that modified versions of such material be marked in reasonable ways as different +from the original version; or + +d) Limiting the use for publicity purposes of names of licensors or authors +of the material; or + +e) Declining to grant rights under trademark law for use of some trade names, +trademarks, or service marks; or + +f) Requiring indemnification of licensors and authors of that material by +anyone who conveys the material (or modified versions of it) with contractual +assumptions of liability to the recipient, for any liability that these contractual +assumptions directly impose on those licensors and authors. + +All other non-permissive additional terms are considered "further restrictions" +within the meaning of section 10. If the Program as you received it, or any +part of it, contains a notice stating that it is governed by this License +along with a term that is a further restriction, you may remove that term. +If a license document contains a further restriction but permits relicensing +or conveying under this License, you may add to a covered work material governed +by the terms of that license document, provided that the further restriction +does not survive such relicensing or conveying. + +If you add terms to a covered work in accord with this section, you must place, +in the relevant source files, a statement of the additional terms that apply +to those files, or a notice indicating where to find the applicable terms. + +Additional terms, permissive or non-permissive, may be stated in the form +of a separately written license, or stated as exceptions; the above requirements +apply either way. + + 8. Termination. + +You may not propagate or modify a covered work except as expressly provided +under this License. Any attempt otherwise to propagate or modify it is void, +and will automatically terminate your rights under this License (including +any patent licenses granted under the third paragraph of section 11). + +However, if you cease all violation of this License, then your license from +a particular copyright holder is reinstated (a) provisionally, unless and +until the copyright holder explicitly and finally terminates your license, +and (b) permanently, if the copyright holder fails to notify you of the violation +by some reasonable means prior to 60 days after the cessation. + +Moreover, your license from a particular copyright holder is reinstated permanently +if the copyright holder notifies you of the violation by some reasonable means, +this is the first time you have received notice of violation of this License +(for any work) from that copyright holder, and you cure the violation prior +to 30 days after your receipt of the notice. + +Termination of your rights under this section does not terminate the licenses +of parties who have received copies or rights from you under this License. +If your rights have been terminated and not permanently reinstated, you do +not qualify to receive new licenses for the same material under section 10. + + 9. Acceptance Not Required for Having Copies. + +You are not required to accept this License in order to receive or run a copy +of the Program. Ancillary propagation of a covered work occurring solely as +a consequence of using peer-to-peer transmission to receive a copy likewise +does not require acceptance. However, nothing other than this License grants +you permission to propagate or modify any covered work. These actions infringe +copyright if you do not accept this License. Therefore, by modifying or propagating +a covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + +Each time you convey a covered work, the recipient automatically receives +a license from the original licensors, to run, modify and propagate that work, +subject to this License. You are not responsible for enforcing compliance +by third parties with this License. + +An "entity transaction" is a transaction transferring control of an organization, +or substantially all assets of one, or subdividing an organization, or merging +organizations. If propagation of a covered work results from an entity transaction, +each party to that transaction who receives a copy of the work also receives +whatever licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the Corresponding +Source of the work from the predecessor in interest, if the predecessor has +it or can get it with reasonable efforts. + +You may not impose any further restrictions on the exercise of the rights +granted or affirmed under this License. For example, you may not impose a +license fee, royalty, or other charge for exercise of rights granted under +this License, and you may not initiate litigation (including a cross-claim +or counterclaim in a lawsuit) alleging that any patent claim is infringed +by making, using, selling, offering for sale, or importing the Program or +any portion of it. + + 11. Patents. + +A "contributor" is a copyright holder who authorizes use under this License +of the Program or a work on which the Program is based. The work thus licensed +is called the contributor's "contributor version". + +A contributor's "essential patent claims" are all patent claims owned or controlled +by the contributor, whether already acquired or hereafter acquired, that would +be infringed by some manner, permitted by this License, of making, using, +or selling its contributor version, but do not include claims that would be +infringed only as a consequence of further modification of the contributor +version. For purposes of this definition, "control" includes the right to +grant patent sublicenses in a manner consistent with the requirements of this +License. + +Each contributor grants you a non-exclusive, worldwide, royalty-free patent +license under the contributor's essential patent claims, to make, use, sell, +offer for sale, import and otherwise run, modify and propagate the contents +of its contributor version. + +In the following three paragraphs, a "patent license" is any express agreement +or commitment, however denominated, not to enforce a patent (such as an express +permission to practice a patent or covenant not to sue for patent infringement). +To "grant" such a patent license to a party means to make such an agreement +or commitment not to enforce a patent against the party. + +If you convey a covered work, knowingly relying on a patent license, and the +Corresponding Source of the work is not available for anyone to copy, free +of charge and under the terms of this License, through a publicly available +network server or other readily accessible means, then you must either (1) +cause the Corresponding Source to be so available, or (2) arrange to deprive +yourself of the benefit of the patent license for this particular work, or +(3) arrange, in a manner consistent with the requirements of this License, +to extend the patent license to downstream recipients. "Knowingly relying" +means you have actual knowledge that, but for the patent license, your conveying +the covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that country +that you have reason to believe are valid. + +If, pursuant to or in connection with a single transaction or arrangement, +you convey, or propagate by procuring conveyance of, a covered work, and grant +a patent license to some of the parties receiving the covered work authorizing +them to use, propagate, modify or convey a specific copy of the covered work, +then the patent license you grant is automatically extended to all recipients +of the covered work and works based on it. + +A patent license is "discriminatory" if it does not include within the scope +of its coverage, prohibits the exercise of, or is conditioned on the non-exercise +of one or more of the rights that are specifically granted under this License. +You may not convey a covered work if you are a party to an arrangement with +a third party that is in the business of distributing software, under which +you make payment to the third party based on the extent of your activity of +conveying the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory patent +license (a) in connection with copies of the covered work conveyed by you +(or copies made from those copies), or (b) primarily for and in connection +with specific products or compilations that contain the covered work, unless +you entered into that arrangement, or that patent license was granted, prior +to 28 March 2007. + +Nothing in this License shall be construed as excluding or limiting any implied +license or other defenses to infringement that may otherwise be available +to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + +If conditions are imposed on you (whether by court order, agreement or otherwise) +that contradict the conditions of this License, they do not excuse you from +the conditions of this License. If you cannot convey a covered work so as +to satisfy simultaneously your obligations under this License and any other +pertinent obligations, then as a consequence you may not convey it at all. +For example, if you agree to terms that obligate you to collect a royalty +for further conveying from those to whom you convey the Program, the only +way you could satisfy both those terms and this License would be to refrain +entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + +Notwithstanding any other provision of this License, you have permission to +link or combine any covered work with a work licensed under version 3 of the +GNU Affero General Public License into a single combined work, and to convey +the resulting work. The terms of this License will continue to apply to the +part which is the covered work, but the special requirements of the GNU Affero +General Public License, section 13, concerning interaction through a network +will apply to the combination as such. + + 14. Revised Versions of this License. + +The Free Software Foundation may publish revised and/or new versions of the +GNU General Public License from time to time. Such new versions will be similar +in spirit to the present version, but may differ in detail to address new +problems or concerns. + +Each version is given a distinguishing version number. If the Program specifies +that a certain numbered version of the GNU General Public License "or any +later version" applies to it, you have the option of following the terms and +conditions either of that numbered version or of any later version published +by the Free Software Foundation. If the Program does not specify a version +number of the GNU General Public License, you may choose any version ever +published by the Free Software Foundation. + +If the Program specifies that a proxy can decide which future versions of +the GNU General Public License can be used, that proxy's public statement +of acceptance of a version permanently authorizes you to choose that version +for the Program. + +Later license versions may give you additional or different permissions. However, +no additional obligations are imposed on any author or copyright holder as +a result of your choosing to follow a later version. + + 15. Disclaimer of Warranty. + +THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE +LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER +EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM +PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR +CORRECTION. + + 16. Limitation of Liability. + +IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL +ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM +AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, +INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO +USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED +INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE +PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER +PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + +If the disclaimer of warranty and limitation of liability provided above cannot +be given local legal effect according to their terms, reviewing courts shall +apply local law that most closely approximates an absolute waiver of all civil +liability in connection with the Program, unless a warranty or assumption +of liability accompanies a copy of the Program in return for a fee. END OF +TERMS AND CONDITIONS + +How to Apply These Terms to Your New Programs + +If you develop a new program, and you want it to be of the greatest possible +use to the public, the best way to achieve this is to make it free software +which everyone can redistribute and change under these terms. + +To do so, attach the following notices to the program. It is safest to attach +them to the start of each source file to most effectively state the exclusion +of warranty; and each file should have at least the "copyright" line and a +pointer to where the full notice is found. + + + +Copyright (C) + +This program is free software: you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free Software +Foundation, either version 3 of the License, or (at your option) any later +version. + +This program is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along with +this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + +If the program does terminal interaction, make it output a short notice like +this when it starts in an interactive mode: + + Copyright (C) + +This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + +This is free software, and you are welcome to redistribute it under certain +conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands might +be different; for a GUI interface, you would use an "about box". + +You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. For +more information on this, and how to apply and follow the GNU GPL, see . + +The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General Public +License instead of this License. But first, please read . diff --git a/LICENSES/LGPL-3.0-or-later.txt b/LICENSES/LGPL-3.0-or-later.txt new file mode 100644 index 000000000..bd405afbe --- /dev/null +++ b/LICENSES/LGPL-3.0-or-later.txt @@ -0,0 +1,163 @@ +GNU LESSER GENERAL PUBLIC LICENSE + +Version 3, 29 June 2007 + +Copyright (C) 2007 Free Software Foundation, Inc. + +Everyone is permitted to copy and distribute verbatim copies of this license +document, but changing it is not allowed. + +This version of the GNU Lesser General Public License incorporates the terms +and conditions of version 3 of the GNU General Public License, supplemented +by the additional permissions listed below. + + 0. Additional Definitions. + + + +As used herein, "this License" refers to version 3 of the GNU Lesser General +Public License, and the "GNU GPL" refers to version 3 of the GNU General Public +License. + + + +"The Library" refers to a covered work governed by this License, other than +an Application or a Combined Work as defined below. + + + +An "Application" is any work that makes use of an interface provided by the +Library, but which is not otherwise based on the Library. Defining a subclass +of a class defined by the Library is deemed a mode of using an interface provided +by the Library. + + + +A "Combined Work" is a work produced by combining or linking an Application +with the Library. The particular version of the Library with which the Combined +Work was made is also called the "Linked Version". + + + +The "Minimal Corresponding Source" for a Combined Work means the Corresponding +Source for the Combined Work, excluding any source code for portions of the +Combined Work that, considered in isolation, are based on the Application, +and not on the Linked Version. + + + +The "Corresponding Application Code" for a Combined Work means the object +code and/or source code for the Application, including any data and utility +programs needed for reproducing the Combined Work from the Application, but +excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + +You may convey a covered work under sections 3 and 4 of this License without +being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + +If you modify a copy of the Library, and, in your modifications, a facility +refers to a function or data to be supplied by an Application that uses the +facility (other than as an argument passed when the facility is invoked), +then you may convey a copy of the modified version: + +a) under this License, provided that you make a good faith effort to ensure +that, in the event an Application does not supply the function or data, the +facility still operates, and performs whatever part of its purpose remains +meaningful, or + +b) under the GNU GPL, with none of the additional permissions of this License +applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + +The object code form of an Application may incorporate material from a header +file that is part of the Library. You may convey such object code under terms +of your choice, provided that, if the incorporated material is not limited +to numerical parameters, data structure layouts and accessors, or small macros, +inline functions and templates (ten or fewer lines in length), you do both +of the following: + +a) Give prominent notice with each copy of the object code that the Library +is used in it and that the Library and its use are covered by this License. + +b) Accompany the object code with a copy of the GNU GPL and this license document. + + 4. Combined Works. + +You may convey a Combined Work under terms of your choice that, taken together, +effectively do not restrict modification of the portions of the Library contained +in the Combined Work and reverse engineering for debugging such modifications, +if you also do each of the following: + +a) Give prominent notice with each copy of the Combined Work that the Library +is used in it and that the Library and its use are covered by this License. + +b) Accompany the Combined Work with a copy of the GNU GPL and this license +document. + +c) For a Combined Work that displays copyright notices during execution, include +the copyright notice for the Library among these notices, as well as a reference +directing the user to the copies of the GNU GPL and this license document. + + d) Do one of the following: + +0) Convey the Minimal Corresponding Source under the terms of this License, +and the Corresponding Application Code in a form suitable for, and under terms +that permit, the user to recombine or relink the Application with a modified +version of the Linked Version to produce a modified Combined Work, in the +manner specified by section 6 of the GNU GPL for conveying Corresponding Source. + +1) Use a suitable shared library mechanism for linking with the Library. A +suitable mechanism is one that (a) uses at run time a copy of the Library +already present on the user's computer system, and (b) will operate properly +with a modified version of the Library that is interface-compatible with the +Linked Version. + +e) Provide Installation Information, but only if you would otherwise be required +to provide such information under section 6 of the GNU GPL, and only to the +extent that such information is necessary to install and execute a modified +version of the Combined Work produced by recombining or relinking the Application +with a modified version of the Linked Version. (If you use option 4d0, the +Installation Information must accompany the Minimal Corresponding Source and +Corresponding Application Code. If you use option 4d1, you must provide the +Installation Information in the manner specified by section 6 of the GNU GPL +for conveying Corresponding Source.) + + 5. Combined Libraries. + +You may place library facilities that are a work based on the Library side +by side in a single library together with other library facilities that are +not Applications and are not covered by this License, and convey such a combined +library under terms of your choice, if you do both of the following: + +a) Accompany the combined library with a copy of the same work based on the +Library, uncombined with any other library facilities, conveyed under the +terms of this License. + +b) Give prominent notice with the combined library that part of it is a work +based on the Library, and explaining where to find the accompanying uncombined +form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + +The Free Software Foundation may publish revised and/or new versions of the +GNU Lesser General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to address +new problems or concerns. + +Each version is given a distinguishing version number. If the Library as you +received it specifies that a certain numbered version of the GNU Lesser General +Public License "or any later version" applies to it, you have the option of +following the terms and conditions either of that published version or of +any later version published by the Free Software Foundation. If the Library +as you received it does not specify a version number of the GNU Lesser General +Public License, you may choose any version of the GNU Lesser General Public +License ever published by the Free Software Foundation. + +If the Library as you received it specifies that a proxy can decide whether +future versions of the GNU Lesser General Public License shall apply, that +proxy's public statement of acceptance of any version is permanent authorization +for you to choose that version for the Library. diff --git a/LICENSES/MIT.txt b/LICENSES/MIT.txt new file mode 100644 index 000000000..204b93da4 --- /dev/null +++ b/LICENSES/MIT.txt @@ -0,0 +1,19 @@ +MIT License Copyright (c) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice (including the next +paragraph) shall be included in all copies or substantial portions of the +Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS +OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF +OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README-Android.asciidoc b/README-Android.asciidoc deleted file mode 100644 index 085d50ade..000000000 --- a/README-Android.asciidoc +++ /dev/null @@ -1,119 +0,0 @@ -Compile Retroshare for Android -============================== - -== Introduction - -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 package -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 library 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 NDK_TOOLCHAIN_PATH="/home/$(whoami)/Development/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="19" - -## 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. - -As we use a custom toolchain one more step is needed + - -_Qt Creator left pane -> Projects -> Build and Run -> Android SOMESTUFF kit -> -Build Environement -> Add - -Variable: +NATIVE_LIBS_TOOLCHAIN_PATH+ -Value: +Same value as NDK_TOOLCHAIN_PATH in Preparing The Environement step+ - -Some of RetroShare modules like +retroshare-gui+ and +WebUI+ are not available -on Android so to be able to compile RetroShare without errors 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 - -[source,makefile] -------------------------------------------------------------------------------- -CONFIG+=no_retroshare_gui CONFIG+=no_retroshare_nogui CONFIG+=no_retroshare_plugins CONFIG+=retroshare_android_service CONFIG+=libresapilocalserver CONFIG+=no_libresapihttpserver CONFIG+=retroshare_qml_app -------------------------------------------------------------------------------- - -WARNING: SQLCipher is not supported yet on RetroShare for Android. This poses a -major security concern, we are working to fix this ASAP. - -WARNING: 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 - -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. - - -== 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[] diff --git a/README.asciidoc b/README.asciidoc new file mode 100644 index 000000000..734c3d083 --- /dev/null +++ b/README.asciidoc @@ -0,0 +1,56 @@ +// SPDX-FileCopyrightText: Retroshare Team +// SPDX-License-Identifier: CC-BY-SA-4.0 + += RetroShare + +RetroShare is a decentralized, private, secure, cross-platform, communication +toolkit. +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"] +|=============================================================================== + + +== Compilation + +Short of comprehensive and updated documentation on how to build RetroShare +(for the many supported platforms it runs on), scripts and recipes are provided +in the aim of creating packages for the supported platforms (and more) +in the `build_scripts` directory of this repository. + +Those packaging receipts together with the continuous integration files +`.travis.yml` and `appveyor.yml` are a good source of knowledge on how to +compile RetroShare on different platforms. + + +== Using RetroShare on a headless computer with web UI + +WARNING: This section is outdated need to be adapted to the new web UI + +The web UI needs to be enabled as a parameter option to the retroshare-service: + +[source,bash] +-------- +./retroshare-nogui --webinterface 9090 --docroot /usr/share/retroshare/webui/ +-------- + +The web UI is only accessible on localhost:9090. It is advised to keep it that way so that your RS +cannot be controlled using an untrusted connection. + +To access your web UI from a distance, just open a SSH tunnel to it: + +[source,bash] +-------- +distant_machine:~/ > ssh rs_host -L 9090:localhost:9090 -N +-------- + +"rs_host" is the machine running `retroshare-nogui`. Then on the distant machine, access your web UI on + + + http://localhost:9090 + +(This can also be done from the RetroShare GUI.) diff --git a/README.md b/README.md deleted file mode 100644 index 8902b43b8..000000000 --- a/README.md +++ /dev/null @@ -1,151 +0,0 @@ -RetroShare -============================== -RetroShare is a decentralized, private and secure commmunication and sharing platform. RetroShare provides filesharing, chat, messages, forums and channels. - -Build Status ------------- - -| Platform | Build Status | -| :------------- | :------------- | -| GNU/Linux, MacOS, (via travis-ci) | [![Build Status](https://travis-ci.org/RetroShare/RetroShare.svg?branch=master)](https://travis-ci.org/RetroShare/RetroShare) | -| Windows, `MSys2` (via appveyor) | [![Build status](https://ci.appveyor.com/api/projects/status/fu7q0ye6pge53579?svg=true)](https://ci.appveyor.com/project/PhenomRetroShare/retroshare-59qxh) | - -Compilation on Windows ----------------------------- -Follow this file : [WindowsMSys2_InstallGuide.md](https://github.com/RetroShare/RetroShare/blob/master/WindowsMSys2_InstallGuide.md) - -Compilation on MacOSX ----------------------------- -Follow this file : [MacOS_X_InstallGuide](https://github.com/RetroShare/RetroShare/blob/master/MacOS_X_InstallGuide.md) - -Compilation for Android ---------------------------- -Follow this file : [README-Android](https://github.com/RetroShare/RetroShare/blob/master/README-Android.asciidoc) - -Compilation on Linux ----------------------------- - -1. Install package dependencies: - * Debian/Ubuntu - ```bash - sudo apt-get install libglib2.0-dev libupnp-dev qt4-dev-tools \ - libqt4-dev libssl-dev libxss-dev libgnome-keyring-dev libbz2-dev \ - libqt4-opengl-dev libqtmultimediakit1 qtmobility-dev libsqlcipher-dev \ - libspeex-dev libspeexdsp-dev libxslt1-dev libcurl4-openssl-dev \ - libopencv-dev tcl8.5 libmicrohttpd-dev - ``` - * openSUSE - ```bash - sudo zypper install gcc-c++ libqt4-devel libgnome-keyring-devel \ - glib2-devel speex-devel libssh-devel protobuf-devel libcurl-devel \ - libxml2-devel libxslt-devel sqlcipher-devel libmicrohttpd-devel \ - opencv-devel speexdsp-devel libupnp-devel libavcodec-devel - ``` - * Arch Linux - ```bash - pacman -S base-devel libgnome-keyring libmicrohttpd libupnp libxslt \ - libxss opencv qt4 speex speexdsp sqlcipher - ``` - -2. Checkout the source code - ```bash - mkdir ~/retroshare - cd ~/retroshare - git clone https://github.com/RetroShare/RetroShare.git trunk - ``` - -3. Compile - ```bash - cd trunk - qmake CONFIG+=debug - make - ``` - -4. Install - ```bash - sudo make install - ``` - - The executables produced will be: - - /usr/bin/retroshare - /usr/bin/retroshare-nogui - -5. Uninstall: - ```bash - sudo make uninstall - ``` - -Compile only retroshare-nogui ------------------------------ -If you want to run RetroShare on a server and don’t need the gui and plugins, -you can run the following commands to only compile/install the nogui version: - -```bash -qmake -make retroshare-nogui -sudo make retroshare-nogui-install_subtargets -``` - -For packagers -------------- -Packagers can use PREFIX and LIB\_DIR to customize the installation paths: -```bash -qmake PREFIX=/usr LIB_DIR=/usr/lib64 "CONFIG-=debug" "CONFIG+=release" -make -make INSTALL_ROOT=${PKGDIR} install -``` - -If libsqlcipher is not available as a package ---------------------------------------------- - -You need to place sqlcipher so that the hierarchy is: - - retroshare - | - +--- trunk - | - +--- lib - | - +---- sqlcipher -```bash -mkdir lib -cd lib -git clone git://github.com/sqlcipher/sqlcipher.git -cd sqlcipher -./configure --enable-tempstore=yes CFLAGS="-DSQLITE_HAS_CODEC" LDFLAGS="-lcrypto" -make -cd .. -``` - -Using retroshare-nogui & webUI ------------------------------- - -The webUI needs to be enabled as a parameter option in retroshare-nogui: - -```bash -./retroshare-nogui --webinterface 9090 --docroot /usr/share/retroshare/webui/ -``` - -The webUI is only accessible on localhost:9090. It is advised to keep it that way so that your RS -cannot be controlled using an untrusted connection. - -To access your web UI from a distance, just open a SSH tunnel on it: - -```bash -distant_machine:~/ > ssh rs_host -L 9090:localhost:9090 -N -``` - -"rs_host" is the machine running retroshare-nogui. Then on the distant machine, access your webUI on - - - http://localhost:9090 - -That also works with a retroshare GUI of course. - -Compile and run tests ---------------------- - - qmake CONFIG+=tests - make - tests/unittests/unittests diff --git a/RetroShare.pro b/RetroShare.pro index 833173029..dc590dd17 100644 --- a/RetroShare.pro +++ b/RetroShare.pro @@ -1,59 +1,58 @@ +# RetroShare main qmake build script +# +# Copyright (C) 2004-2019, Retroshare Team +# Copyright (C) 2016-2019, Gioacchino Mazzurco +# +# This program is free software: you can redistribute it and/or modify it under +# the terms of the GNU Lesser 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 Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License along +# with this program. If not, see . +# +# SPDX-FileCopyrightText: Retroshare Team +# SPDX-License-Identifier: LGPL-3.0-or-later + +CONFIG += c++14 + !include("retroshare.pri"): error("Could not include file retroshare.pri") TEMPLATE = subdirs -#CONFIG += tests 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 + libretroshare.depends += jsonapi-generator +} + SUBDIRS += libbitdht libbitdht.file = libbitdht/src/libbitdht.pro +libretroshare.depends += openpgpsdk libbitdht SUBDIRS += libretroshare libretroshare.file = libretroshare/src/libretroshare.pro -libretroshare.depends = openpgpsdk libbitdht - -SUBDIRS += libresapi -libresapi.file = libresapi/src/libresapi.pro -libresapi.depends = libretroshare retroshare_gui { SUBDIRS += retroshare_gui retroshare_gui.file = retroshare-gui/src/retroshare-gui.pro - retroshare_gui.depends = libretroshare libresapi retroshare_gui.target = retroshare_gui + retroshare_gui.depends = libretroshare } -retroshare_nogui { - SUBDIRS += retroshare_nogui - retroshare_nogui.file = retroshare-nogui/src/retroshare-nogui.pro - retroshare_nogui.depends = libretroshare libresapi - retroshare_nogui.target = retroshare_nogui -} - -retroshare_android_service { - SUBDIRS += retroshare_android_service - retroshare_android_service.file = retroshare-android-service/src/retroshare-android-service.pro - retroshare_android_service.depends = libresapi - retroshare_android_service.target = retroshare_android_service -} - -retroshare_android_notify_service { - SUBDIRS += retroshare_android_notify_service - retroshare_android_notify_service.file = retroshare-android-notify-service/src/retroshare-android-notify-service.pro - retroshare_android_notify_service.depends = retroshare_android_service - retroshare_android_notify_service.target = retroshare_android_notify_service -} - -retroshare_qml_app { - SUBDIRS += retroshare_qml_app - retroshare_qml_app.file = retroshare-qml-app/src/retroshare-qml-app.pro - retroshare_qml_app.depends = retroshare_android_service - retroshare_qml_app.target = retroshare_qml_app - - android-g++ { - retroshare_qml_app.depends += retroshare_android_notify_service - } +retroshare_service { + SUBDIRS += retroshare_service + retroshare_service.file = retroshare-service/src/retroshare-service.pro + retroshare_service.depends = libretroshare + retroshare_service.target = retroshare_service } retroshare_plugins { diff --git a/Start_RetroShare-Gui_Debug.bat b/Start_RetroShare-Gui_Debug.bat deleted file mode 100755 index 38680ccef..000000000 --- a/Start_RetroShare-Gui_Debug.bat +++ /dev/null @@ -1,11 +0,0 @@ -set QTDIR=C:\Qt\5.5\mingw492_32 -set LIBS=..\libs -set RSPATH=.\retroshare-gui\src\debug - -set PATH=%QTDIR%\bin;%LIBS%\bin;%PATH% - -If not exist %RSPATH%\retroshare.exe ( - build-all-mingw32make.bat -) - -%RSPATH%\retroshare.exe diff --git a/TODO.circles.txt b/TODO.circles.txt deleted file mode 100644 index 4e70dccc9..000000000 --- a/TODO.circles.txt +++ /dev/null @@ -1,47 +0,0 @@ -Legend: - [X]: done, [ ]: pending, [-]: Cancelled, [/]: ongoing - -GUI - [X] disable edit circles or make it work - [X] make GUI update when creating a circle - [ ] handle the display of encrypted forums/channels/etc when we do not have the keys - [ ] disable posting to circles for which we do not have the rights - [ ] warn about creating a circle without one of your ids in it - [X] group "show details" should be made up to date for restrinction options - [ ] allow to share circles publish rights - [X] allow non admin to see circles details but not edit - - [ ] update TS of groups linked to a modified circle, so as to cause updates when a new member is addded to the group - [X] forums GUI should show correct restriction options for restricted forums - [X] changing a circle's name should update the GUI - [ ] make sure we cannot post in forums using IDs that are not in the circle - [ ] make sure unauthorised ids are rejected when validating posts from a circle restricted group - [ ] add GUI for local circles in circle GUI - [ ] share publish rights between circles - [ ] clean GUI (hide IDs) - - -Tests - [X] create a safe testing environment: 2 peers with no other contacts, 2 IDs each, and some forums - [X] test #001: transactions should encrypt and decrypt ok on both sides - [X] test #002: peers inside a circles should see the data - [X] test #003: peers outside of a circles shouldn't see the data - [-] test #004: peers subscribed to encrypted circles shouldn't keep asking for the data if they cannot decrypt - [X] test #005: peers can be added/removed from circles, and the circles update between friends - [ ] test #006: peers subscribed to encrypted circles who recently got added to the circle should get the data - [ ] test #007: peers outside a circle shouldn't be able to post (or posts shouldn't propagate) - -Backend - [X] add debug output later RS_NXS_DEBUG_7 in rsgxsnetservice.cc for the crypto layer - -Bugs - [X] Peers cannot be removed from a circle - [X] Context menu should not allow to edit non admin circles - [X] Editing circles make them subscribed, even non admin ones. - [X] Disable autosync for circles (in rsinit.cc) - [-] Add explicit circle sync request for all grps restricted to a circle (same as IDs) - [X] when a peer receives a circle, there is no way to view its details, only the id is available - [X] if a peer has circles available in "Circles (others)"... if you click on - "Create Circle" on the gui, then all circles are automatically subscribed - - diff --git a/TODO.txt b/TODO.txt deleted file mode 100644 index b130f80d8..000000000 --- a/TODO.txt +++ /dev/null @@ -1,135 +0,0 @@ -Legend: - E: easy. Just GUI stuff, no algorithmics involved. That does not mean it's easy to come up with. - M: medium, either because it's a big task, or because it needs to understand a lot of code. - H: hard. Needs digging deep into libretroshare, possibly involving some crypto. - - [ ] pending - [/] half-done, someone's on it - [-] cancelled - [?] needs discussion. Not sure we need this. - [X] done - -PS: no tabs in this file,thx ;-) - ----------------------------------------- TODO for RC --------------------------------------------- - - E [ ] Implement creation of a default (signed) gxs id in startup wizard. Needs to show to the user a proper separation between nodes (network layer) and GXS ids (service layer). - E [ ] add tooltips in in permission matrix when hovering over the top most button/service name explain what the service does and the dependencies - E [ ] finish pass of GXS network service - ------------------------------------------ TODO list ---------------------------------------------- - -GUI - E [X] add a "Contact" list to help selecting peers in People/FriendChooser/messages/etc. - E [ ] fix posted GUI. Needs to be more handy and more appealing. - E [ ] add RS links for GXS identities, so that they can be transferred easily between nodes in forums, etc - E [ ] enable people dialog - M [ ] Personal Page (Profile Page for GXS ID Users,view latest Posts, public forum/channels,posted posts, comments in all areas, Reputation Infos, Popularity and more) - E [ ] fix RSButtonOnText::eventFilter, and fix all places where RSButtonOnText gets deleted - E [ ] find all places where the deprecated(in Qt5) Q_WS_WIN and other Q_WS* macros are used, and replace with something else - E [ ] Make RS fully compatible with High DPI screens. - M [ ] improve comments in channels. Comments should be more available, more visible, and easier to handle. - E [ ] make GRouter statistics less CPU greedy - M [ ] Merge the various help systems. there's 3 of them now. Lots of duplicate code, etc. - M [ ] New and consistent icon set (Purplehaze420 said he would provide a consistent set of icons. Is that still alive?) - M [ ] add in options->Network a way to select which network interface is used to talk (choice between "auto" or selected from a list) - M [?] add a RS link for encrypted messages (encrypt for multiple GXS ids at once). Messages will appear as a link when encrypted and - be automatically decrypted when a suitable GXS id is available for it. Could be a way to securely post something in a public place. - -File transfer (all 3 tasks are related) - E [ ] Add a limit of the total number of files simultaneously asked to the same peer using direct transfer. - H [ ] implement a new file list management, with new info such as access time,total upload, popularity, etc - H [ ] implement a new file list sharing service based on auto-sync system - M [ ] get rid of the old cache system (remove CacheStrapper, CacheSource,etc) - M [ ] implement end-to-end encryption using chacha20 and H(F), requesting file on H(H(F)). Make this optional and backward compatible. - -DHT - H [-] improve DHT lookups to find masquerading peers using fake peers. First experiments (by cyril) do not prove very efficient. - -GXS - M [X] create a tunnel service from distant chat code to make it (1) more generic (2) resistant to packet loss. - M [X] optimise GXS sync BW. For the moment too much is sent between nodes. - H [/] add the ability to use anonymous identities into circles. Needs new distribution model using items encrypted for multiple GXS keys. - H [ ] use different and incompatible classes for public and private keys in GxsSecurity - -VOIP - H [ ] use proper video encoding. What we have now is decent for video, but sound should be prioritized. Experiments - with QtAV seem to work nicely. Finish and integrate! - M [ ] Deactivate Voip Buttons, when Friend has no Voip plugin enabled. - M [ ] Implement Voice for Video Chat - M [ ] Improve Voice and Video Quality - M [ ] Video Quality/Resolution Settings (High, Medium, Low) HD, HQ, SD ) - M [ ] Video Device: WebCam(s) or Desktop Selection - M [ ] Audio Input Device Selection (Microphone) - M [ ] Audio Output Device Selection (Speaker) - M [ ] Video Snapshots https://support.skype.com/en/faq/FA1222/what-is-video-snapshot - M [ ] Voice Messaging (record and send a voice message) - M [ ] Video Messages (send a video greeting to multiple friends/coworkers/developers at once.) - M [ ] Add Call status (when im on the phone changes my status with phone icon) - H [ ] Audio Conference - H [ ] Video Conference - -Messages - H [X] make the mail system re-send failed emails notified by the global router. This is hard because it needs a proper management of duplicate messages - E [X] add flags to allow distant messaging from contact list only / everyone / noone / only signed ids. - M [ ] add Signature feature to messages - M [ ] add vacation responser for messages (automatic replies) - -Chat - E [X] add flags to allow distant chat from contact list only / everyone / noone / only signed ids. - -Libretroshare - E [X] groups small packets in pqistreamer::handleoutgoing_locked(), and see if that removes some padding overhead - E [ ] make sure at least one location is kept when removing old locations as it avoids lots of connection problems. - M [ ] improve serialisation system. Lots of serialisation tasks (header, verifications, serialiser=>template, can be factored) - M [ ] separate chat stuff from rsmsgs.h into rschat.h - M [ ] crash at shutdown due to memory management already cleared while new objects keep being requested. - - #0 0x0000000000da52eb in RsMemoryManagement:¿mallObject:¿mallObject() () - #1 0x0000000000da3694 in RsItem::RsItem(unsigned int) () - #2 0x0000000000dcb365 in RsRawItem::RsRawItem (this=0x0, t=33559555, size=38) at ./serialiser/rsserial.h - #3 0x0000000000fc1643 in RsServiceSerialiser::deserialise(void*, unsigned int*) () - #4 0x0000000000da4451 in RsSerialiser::deserialise(void*, unsigned int*) () - #5 0x0000000000fb5b4b in pqistreamer::handleincoming_locked() () - #6 0x0000000000fb4b3e in pqistreamer::tick_recv(unsigned int) () - #7 0x0000000000fb744a in pqithreadstreamer::data_tick() () - #8 0x0000000000e19b27 in RsTickingThread::runloop (this=0x7fffb004e7e8) at util/rsthreads.cc:196 - #9 0x0000000000e19748 in RsThread::rsthread_init (p=0x7fffb004e7e8) at util/rsthreads.cc:63 - #10 0x00007ffff4006f6b in start_thread () from /lib64/libpthread.so.0 - #11 0x00007ffff351c7ed in clone () from /lib64/libc.so.6 - -Channels - E [ ] allow to set a download directory per channel - M [ ] Thumbnail View for Channels - M [ ] Count commments on Comments Button - M [ ] Notify Channel comments/replies - -Posted - E [ ] Show an info page for unsubscribed posted threads (same as forums) - E [ ] Make the GUI of Posted more sexy: more compact items, remove unecessary text, use consistent icons,... - -Forums - E [ ] do we keep "Getting Started" ? the look needs to be improved. Any help doing this is welcome! - E [ ] some widgets in the GUI do not follow the system style => GUI looks bad on these systems - -Bugs - E [ ] find the bug that shows some peers online in Network although they are not. - M [X] Selecting different options in messages composer -> contact list then come back, - shows disappearing / re-appearing people. What causes this??? - -Sounds - E [ ] add default sounds for Friend go online, New Chat Message, Message arrived, Download complete - M [ ] make sure sound is working for users on linux. We also need a "test sound" button in config->sound. - -Packaging - E [ ] Sound files should be part of the install package at least on ubuntu (put them in /usr/share) - -List of pending non backward compatible changes -=============================================== - - * RsGxsGrpMetaData::deserialis should use a proper TLV_STR_TYPE_NAME instead of 0 for - mGroupName and mMsgName, in rsgxsdata.cc - * p3IdService::service_CreateGroup() should convert the mPgpSign member to radix64!! For now - it is hard-coded in binary in a string. - - diff --git a/WindowsMSys2_InstallGuide.md b/WindowsMSys2_InstallGuide.md deleted file mode 100644 index 06bfba022..000000000 --- a/WindowsMSys2_InstallGuide.md +++ /dev/null @@ -1,88 +0,0 @@ -##Compilation on Windows - -###Qt Installation - -Install Qt via: [Qt Download](http://www.qt.io/download/) - -Use default options. -Add to the PATH environment variable - - ;C:\Qt\5.5\mingw492_32\bin;C:\Qt\Tools\mingw492_32\bin;C:\Qt\Tools\mingw492_32\opt\bin - -Depends on wich version of Qt you use. -Change build-all-mingw32make.bat with these values too if you don't use MSys2. - -###MSYS2 INSTALLATION - -Choose your MSYS2 installer here: [MSYS2](http://msys2.github.io/) - -Follow install procedure. -Don't forget to sync & Update pacman. - - pacman --needed -Sy bash pacman pacman-mirrors msys2-runtime - -Restart console - - pacman -Su - -Install all default programms - - pacman -S base-devel git mercurial cvs wget p7zip gcc perl ruby python2 - -Choose only w64-i686 if you want only compilation in 32b architecture. - - pacman -S mingw-w64-i686-toolchain mingw-w64-x86_64-toolchain - -###Install other binutils: - pacman -S mingw-w64-i686-miniupnpc mingw-w64-x86_64-miniupnpc - pacman -S mingw-w64-i686-sqlite3 mingw-w64-x86_64-sqlite3 - pacman -S mingw-w64-i686-speex mingw-w64-x86_64-speex - pacman -S mingw-w64-i686-speexdsp mingw-w64-x86_64-speexdsp - pacman -S mingw-w64-i686-opencv mingw-w64-x86_64-opencv - pacman -S mingw-w64-i686-ffmpeg mingw-w64-x86_64-ffmpeg - pacman -S mingw-w64-i686-libmicrohttpd mingw-w64-x86_64-libmicrohttpd - pacman -S mingw-w64-i686-libxslt mingw-w64-x86_64-libxslt - -Add MSYS2 to PATH environment variable depends your windows - - ;C:\msys64\mingw32\bin - ;C:\msys32\mingw32\bin - - -###Git Installation - -Install Git Gui or other client: [Git Scm](https://git-scm.com/download/win) - -Create a new directory named: - - C:\Development\GIT - -Right-click on it and choose: *Git Bash Here* - -Paste this text on git console: -git clone https://github.com/RetroShare/RetroShare.git - - -###Last Settings - - -In QtCreator Option Git add its path: *C:\Program Files\Git\bin* -and select "Pull" with "Rebase" - - -Open an MSys2 32|64 shell -Move to build_scripts: - - cd /c/Development/GIT/RetroShare/msys2_build_libs/ - -###Compile missing library - make - -You can now compile RS into Qt Creator - -For using, and debugging Plugins, you can use [Symlinker](http://amd989.github.io/Symlinker/) to link -the files in - - \build-RetroShare-Desktop_Qt_X_Y_Z_MinGW_32bit-Debug\plugins\PluginName\debug\*.dll -to -*%appdata%\RetroShare\extensions6* diff --git a/android-prepare-toolchain.sh b/android-prepare-toolchain.sh deleted file mode 100755 index a0e37a054..000000000 --- a/android-prepare-toolchain.sh +++ /dev/null @@ -1,152 +0,0 @@ -#!/bin/bash - -## You are supposed to provide the following variables according to your system setup -[ -z ${ANDROID_NDK_PATH+x} ] && export ANDROID_NDK_PATH="/opt/android-ndk/" -[ -z ${ANDROID_NDK_ARCH+x} ] && export ANDROID_NDK_ARCH="arm" -[ -z ${ANDROID_NDK_ABI_VER+x} ] && export ANDROID_NDK_ABI_VER="4.9" -[ -z ${ANDROID_PLATFORM_VER+x} ] && export ANDROID_PLATFORM_VER="18" -[ -z ${NDK_TOOLCHAIN_PATH+x} ] && export NDK_TOOLCHAIN_PATH="/home/$(whoami)/Development/android-toolchains/retroshare-android-${ANDROID_PLATFORM_VER}-${ANDROID_NDK_ARCH}-abi${ANDROID_NDK_ABI_VER}/" -[ -z ${HOST_NUM_CPU+x} ] && export HOST_NUM_CPU=4 - -runDir="$(pwd)" - -## You should not edit the following variables -if [ "${ANDROID_NDK_ARCH}" == "x86" ]; then - cArch="i686" - eABI="" -else - cArch="${ANDROID_NDK_ARCH}" - eABI="eabi" -fi -export SYSROOT="${NDK_TOOLCHAIN_PATH}/sysroot" -export PREFIX="${SYSROOT}" -export CC="${NDK_TOOLCHAIN_PATH}/bin/${cArch}-linux-android${eABI}-gcc" -export CXX="${NDK_TOOLCHAIN_PATH}/bin/${cArch}-linux-android${eABI}-g++" -export AR="${NDK_TOOLCHAIN_PATH}/bin/${cArch}-linux-android${eABI}-ar" -export RANLIB="${NDK_TOOLCHAIN_PATH}/bin/${cArch}-linux-android${eABI}-ranlib" -export ANDROID_DEV="${ANDROID_NDK_PATH}/platforms/android-${ANDROID_PLATFORM_VER}/arch-${ANDROID_NDK_ARCH}/usr" - - -## More information available at https://android.googlesource.com/platform/ndk/+/ics-mr0/docs/STANDALONE-TOOLCHAIN.html -build_toolchain() -{ - rm -rf ${NDK_TOOLCHAIN_PATH} - [ "${ANDROID_NDK_ARCH}" == "x86" ] && toolchainName="${ANDROID_NDK_ARCH}-${ANDROID_NDK_ABI_VER}" || toolchainName="${ANDROID_NDK_ARCH}-linux-androideabi-${ANDROID_NDK_ABI_VER}" - ${ANDROID_NDK_PATH}/build/tools/make-standalone-toolchain.sh --ndk-dir=${ANDROID_NDK_PATH} --arch=${ANDROID_NDK_ARCH} --install-dir=${NDK_TOOLCHAIN_PATH} --platform=android-${ANDROID_PLATFORM_VER} --toolchain=${toolchainName} --verbose -} - -## More information available at retroshare://file?name=Android%20Native%20Development%20Kit%20Cookbook.pdf&size=29214468&hash=0123361c1b14366ce36118e82b90faf7c7b1b136 -build_bzlib() -{ - B_dir="bzip2-1.0.6" - rm -rf $B_dir - [ -f $B_dir.tar.gz ] || wget http://www.bzip.org/1.0.6/bzip2-1.0.6.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=${SYSROOT}/usr -# 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() -{ - B_dir="openssl-1.0.2h" - rm -rf $B_dir - [ -f $B_dir.tar.gz ] || wget https://www.openssl.org/source/$B_dir.tar.gz - tar -xf $B_dir.tar.gz - cd $B_dir - if [ "${ANDROID_NDK_ARCH}" == "arm" ]; then - oArch="armv7" - else - oArch="${ANDROID_NDK_ARCH}" - fi -# ANDROID_NDK_ROOT="${ANDROID_NDK_PATH}" ./Configure android-${oArch} shared --prefix="${SYSROOT}/usr" --openssldir="${SYSROOT}/etc/ssl" -## 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. - ANDROID_NDK_ROOT="${ANDROID_NDK_PATH}" ./Configure android-${oArch} --prefix="${SYSROOT}/usr" --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 -# cp *.so "${SYSROOT}/usr/lib" - cd .. -} - -build_sqlite() -{ - B_dir="sqlite-autoconf-3130000" - [ -f $B_dir.tar.gz ] || wget https://www.sqlite.org/2016/$B_dir.tar.gz - tar -xf $B_dir.tar.gz - cd $B_dir - ./configure --prefix="${SYSROOT}/usr" --host=${ANDROID_NDK_ARCH}-linux - make -j${HOST_NUM_CPU} - make install - rm -f ${SYSROOT}/usr/lib/libsqlite3.so* - ${CC} -shared -o libsqlite3.so -fPIC sqlite3.o -ldl - cp libsqlite3.so "${SYSROOT}/usr/lib" - cd .. -} - -build_sqlcipher() -{ - echo "sqlcipher not supported yet on android" - return 0 - - cd sqlcipher - ./configure --enable-tempstore=yes CFLAGS="-DSQLITE_HAS_CODEC" LDFLAGS="${SYSROOT}/usr/lib/libcrypto.a" - make -j${HOST_NUM_CPU} - make install - cd .. -} - -build_libupnp() -{ - B_dir="libupnp-1.6.20" - rm -rf $B_dir - [ -f $B_dir.tar.bz2 ] || wget https://sourceforge.net/projects/pupnp/files/pupnp/libUPnP%201.6.20/$B_dir.tar.bz2 - tar -xf $B_dir.tar.bz2 - cd $B_dir -## 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 --enable-static --disable-shared --disable-samples --prefix="${SYSROOT}/usr" --host=${ANDROID_NDK_ARCH}-linux - make -j${HOST_NUM_CPU} - make install - cd .. -} - -build_libmicrohttpd() -{ - echo "libmicrohttpd not supported yet on android" - return 0 - - B_dir="libmicrohttpd-0.9.50" - rm -rf $B_dir - [ -f $B_dir.tar.gz ] || wget ftp://ftp.gnu.org/gnu/libmicrohttpd/$B_dir.tar.gz - tar -xf $B_dir.tar.gz - cd $B_dir - ./configure --prefix="${SYSROOT}/usr" --host=${ANDROID_NDK_ARCH}-linux - #make -e ? - make -j${HOST_NUM_CPU} - make install - cd .. -} - -build_toolchain -build_bzlib -build_openssl -build_sqlite -build_libupnp diff --git a/appveyor.yml b/appveyor.yml index 352df8915..cd706d02c 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: (C) 2004-2019 Retroshare Team +# SPDX-License-Identifier: CC0-1.0 + # Notes: # - Minimal appveyor.yml file is an empty file. All sections are optional. # - Indent each level of configuration with 2 spaces. Do not use tabs! @@ -12,7 +15,8 @@ #---------------------------------# # version format -version: RetroShare 0.6.0.{build}-{branch} +version: RetroShare-git-{branch}-{build} +image: Visual Studio 2019 # you can use {branch} name in version format too # version: 1.0.{build}-{branch} @@ -52,29 +56,28 @@ on_finish: #- ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) # clone directory -clone_folder: c:\projects\RetroShare +clone_folder: C:\projects\RetroShare # fetch repository as zip archive #shallow_clone: true # default is "false" # set clone depth -clone_depth: 1 # clone entire repository history if not defined +clone_depth: 2000 # clone entire repository history if not defined environment: global: - #Qt: https://www.appveyor.com/docs/installed-software#qt - QTDIR: C:\Qt\5.4\mingw491_32 +## Qt: https://www.appveyor.com/docs/installed-software#qt +# QTDIR: C:\Qt\5.10.1\mingw53_32 MSYS2_ARCH: i686 TARGET: i686_32-pc-msys + MINGW_PREFIX: C:\msys64\mingw32 + RS_DEPLOY: RetroShare_deploy # build cache to preserve files/folders between builds -cache: - - c:\projects\libs -# - packages -> **\packages.config # preserve "packages" directory in the root of build folder but will reset it if packages.config is modified -# - projectA\libs -# - node_modules # local npm modules -# - %APPDATA%\npm-cache # npm cache +#cache: +# Disabled because it's bigger then supported by appveyor free plan +# - C:\msys64\var\cache\pacman\pkg # scripts that run after cloning repository #install: @@ -86,26 +89,19 @@ cache: # - cmd: echo This is batch again # - cmd: set MY_VAR=12345 install: + # We cannot get OBS submodule as it use illegal folder name for windows. + #- git submodule update --init # Configuring MSys2 - set PATH=C:\msys64\usr\bin;%PATH% - set PATH=C:\msys64\mingw32\bin;%PATH% + - > + pacman --noconfirm -Sy + mingw-w64-i686-qt5 mingw-w64-i686-miniupnpc mingw-w64-i686-rapidjson + mingw-w64-i686-sqlcipher mingw-w64-i686-xapian-core mingw-w64-i686-cmark + #- set PATH=C:\msys64\mingw32\qt5-static\bin\;%PATH% + # Configuring Qt - - set PATH=%QTDIR%\bin;C:\Qt\Tools\mingw491_32\bin;%PATH% - # Install all default programms - #- C:\msys64\usr\bin\bash -lc "pacman --noconfirm -Sy base-devel git mercurial cvs wget p7zip gcc perl ruby python2" #Already installed - - C:\msys64\usr\bin\bash -lc "pacman --noconfirm -Sy openssl-devel" - # Install toolchain - #- C:\msys64\usr\bin\bash -lc "pacman --noconfirm -S mingw-w64-i686-toolchain mingw-w64-x86_64-toolchain" #Already installed - # Install other binutils - - C:\msys64\usr\bin\bash -lc "pacman --noconfirm -S mingw-w64-i686-curl mingw-w64-x86_64-curl" - - C:\msys64\usr\bin\bash -lc "pacman --noconfirm -S mingw-w64-i686-miniupnpc mingw-w64-x86_64-miniupnpc" - - C:\msys64\usr\bin\bash -lc "pacman --noconfirm -S mingw-w64-i686-sqlite3 mingw-w64-x86_64-sqlite3" - - C:\msys64\usr\bin\bash -lc "pacman --noconfirm -S mingw-w64-i686-speex mingw-w64-x86_64-speex" - - C:\msys64\usr\bin\bash -lc "pacman --noconfirm -S mingw-w64-i686-speexdsp mingw-w64-x86_64-speexdsp" - - C:\msys64\usr\bin\bash -lc "pacman --noconfirm -S mingw-w64-i686-opencv mingw-w64-x86_64-opencv" - - C:\msys64\usr\bin\bash -lc "pacman --noconfirm -S mingw-w64-i686-ffmpeg mingw-w64-x86_64-ffmpeg" - - C:\msys64\usr\bin\bash -lc "pacman --noconfirm -S mingw-w64-i686-libmicrohttpd mingw-w64-x86_64-libmicrohttpd" - - C:\msys64\usr\bin\bash -lc "pacman --noconfirm -S mingw-w64-i686-libxslt mingw-w64-x86_64-libxslt" +# - set PATH=%QTDIR%\bin;C:\Qt\Tools\mingw491_32\bin;%PATH% # Hack for new MSys2 - copy C:\msys64\mingw32\i686-w64-mingw32\bin\ar.exe C:\msys64\mingw32\bin\i686-w64-mingw32-ar.exe @@ -114,10 +110,15 @@ install: - copy C:\msys64\mingw64\x86_64-w64-mingw32\bin\ar.exe C:\msys64\mingw64\bin\x86_64-w64-mingw32-ar.exe - copy C:\msys64\mingw64\x86_64-w64-mingw32\bin\ranlib.exe C:\msys64\mingw64\bin\x86_64-w64-mingw32-ranlib.exe - copy C:\msys64\mingw64\bin\windres.exe C:\msys64\mingw64\bin\x86_64-w64-mingw32-windres.exe - # Build missing Libs - - C:\msys64\mingw32.exe -lc "cd /c/projects/RetroShare/msys2_build_libs/ && make" - # Clone RetroShare - #- git clone -q --branch={branch} https://github.com/RetroShare/RetroShare.git C:\projects\RetroShare + + # Work-around linker looking for Qt dll in wrong place + - copy C:\msys64\mingw32\bin\Qt5PrintSupport.dll C:\msys64\mingw32\lib\Qt5PrintSupport.dll + - copy C:\msys64\mingw32\bin\Qt5Widgets.dll C:\msys64\mingw32\lib\Qt5Widgets.dll + - copy C:\msys64\mingw32\bin\Qt5Multimedia.dll C:\msys64\mingw32\lib\Qt5Multimedia.dll + - copy C:\msys64\mingw32\bin\Qt5Gui.dll C:\msys64\mingw32\lib\Qt5Gui.dll + - copy C:\msys64\mingw32\bin\Qt5Network.dll C:\msys64\mingw32\lib\Qt5Network.dll + - copy C:\msys64\mingw32\bin\Qt5Xml.dll C:\msys64\mingw32\lib\Qt5Xml.dll + - copy C:\msys64\mingw32\bin\Qt5Core.dll C:\msys64\mingw32\lib\Qt5Core.dll #---------------------------------# @@ -142,18 +143,113 @@ configuration: Release # scripts to run before build before_build: + - cd C:\projects\RetroShare + - git submodule update --init + - cd C:\projects\ + - mkdir RetroShare-build + - cd RetroShare-build +# - find C:\ > filelist.txt # scripts to run *after* solution is built and *before* automatic packaging occurs (web apps, NuGet packages, Azure Cloud Services) before_package: -# scripts to run after build -after_build: - # to run your custom scripts instead of automatic MSBuild build_script: - - cd C:\projects\RetroShare - - qmake - - make + - env + - qmake ../RetroShare -spec win32-g++ "CONFIG+=debug" + - mingw32-make -j3 + +# scripts to run after build +after_build: + - find . + + - mkdir %RS_DEPLOY% + - copy retroshare-gui\src\debug\retroshare.exe %RS_DEPLOY%\ + - copy retroshare-service\src\debug\retroshare-service.exe %RS_DEPLOY%\ +# - copy retroshare-service\src\retroshare-service.exe %RS_DEPLOY%\ +# - copy retroshare-gui\src\retroshare.exe %RS_DEPLOY%\ + +## In Debug build winedeplyqt forget the non debug Qt libs + - copy C:\msys64\mingw32\bin\Qt5Svg.dll %RS_DEPLOY%\ + - copy C:\msys64\mingw32\bin\Qt5Core.dll %RS_DEPLOY%\ + - copy C:\msys64\mingw32\bin\Qt5Multimedia.dll %RS_DEPLOY%\ + - copy C:\msys64\mingw32\bin\Qt5Widgets.dll %RS_DEPLOY%\ + - copy C:\msys64\mingw32\bin\Qt5Xml.dll %RS_DEPLOY%\ + - copy C:\msys64\mingw32\bin\Qt5PrintSupport.dll %RS_DEPLOY%\ + - copy C:\msys64\mingw32\bin\Qt5Gui.dll %RS_DEPLOY%\ + - copy C:\msys64\mingw32\bin\Qt5Network.dll %RS_DEPLOY%\ + + - mkdir %RS_DEPLOY%\playlistformats\ + - copy C:\msys64\mingw32\share\qt5\plugins\playlistformats\qtmultimedia_m3u.dll %RS_DEPLOY%\playlistformats + + - mkdir %RS_DEPLOY%\printsupport\ + - copy C:\msys64\mingw32\share\qt5\plugins\printsupport\windowsprintersupport.dll %RS_DEPLOY%\printsupport\ + + - mkdir %RS_DEPLOY%\iconengines\ + - copy C:\msys64\mingw32\share\qt5\plugins\iconengines\qsvgicon.dll %RS_DEPLOY%\iconengines\ + + - mkdir %RS_DEPLOY%\bearer\ + - copy C:\msys64\mingw32\share\qt5\plugins\bearer\qgenericbearer.dll %RS_DEPLOY%\bearer\ + + - mkdir %RS_DEPLOY%\mediaservice\ + - copy C:\msys64\mingw32\share\qt5\plugins\mediaservice\qtmedia_audioengine.dll %RS_DEPLOY%\mediaservice\ + - copy C:\msys64\mingw32\share\qt5\plugins\mediaservice\dsengine.dll %RS_DEPLOY%\mediaservice\ + + - mkdir %RS_DEPLOY%\styles\ + - copy C:\msys64\mingw32\share\qt5\plugins\styles\qwindowsvistastyle.dll %RS_DEPLOY%\styles\ + + - mkdir %RS_DEPLOY%\imageformats\ + - copy C:\msys64\mingw32\share\qt5\plugins\imageformats\qwebp.dll %RS_DEPLOY%\imageformats\ + - copy C:\msys64\mingw32\share\qt5\plugins\imageformats\qicns.dll %RS_DEPLOY%\imageformats\ + - copy C:\msys64\mingw32\share\qt5\plugins\imageformats\qjpeg.dll %RS_DEPLOY%\imageformats\ + - copy C:\msys64\mingw32\share\qt5\plugins\imageformats\qtiff.dll %RS_DEPLOY%\imageformats\ + - copy C:\msys64\mingw32\share\qt5\plugins\imageformats\qtga.dll %RS_DEPLOY%\imageformats\ + - copy C:\msys64\mingw32\share\qt5\plugins\imageformats\qjp2.dll %RS_DEPLOY%\imageformats\ + - copy C:\msys64\mingw32\share\qt5\plugins\imageformats\qico.dll %RS_DEPLOY%\imageformats\ + - copy C:\msys64\mingw32\share\qt5\plugins\imageformats\qwbmp.dll %RS_DEPLOY%\imageformats\ + - copy C:\msys64\mingw32\share\qt5\plugins\imageformats\qicns.dll %RS_DEPLOY%\imageformats\ + - copy C:\msys64\mingw32\share\qt5\plugins\imageformats\qgif.dll %RS_DEPLOY%\imageformats\ + - copy C:\msys64\mingw32\share\qt5\plugins\imageformats\qsvg.dll %RS_DEPLOY%\imageformats\ + + - mkdir %RS_DEPLOY%\platforms\ + - copy C:\msys64\mingw32\share\qt5\plugins\platforms\qwindows.dll %RS_DEPLOY%\platforms\ + + - mkdir %RS_DEPLOY%\audio\ + - copy C:\msys64\mingw32\share\qt5\plugins\audio\qtaudio_windows.dll %RS_DEPLOY%\audio\ + + - windeployqt %RS_DEPLOY%\retroshare.exe + + - copy C:\msys64\mingw32\bin\libbz2*.dll %RS_DEPLOY%\ + #- copy C:\msys64\mingw32\bin\libeay32.dll %RS_DEPLOY%\ + - copy C:\OpenSSL-Win32\libeay32.dll %RS_DEPLOY%\ + - copy C:\msys64\mingw32\bin\libminiupnpc.dll %RS_DEPLOY%\ + - copy C:\msys64\mingw32\bin\libsqlcipher*.dll %RS_DEPLOY%\ + - copy C:\msys64\mingw32\bin\libsqlite3*.dll %RS_DEPLOY%\ + #- copy C:\msys64\mingw32\bin\ssleay32.dll %RS_DEPLOY%\ + - copy C:\OpenSSL-Win32\ssleay32.dll %RS_DEPLOY%\ + - copy C:\msys64\mingw32\bin\zlib*.dll %RS_DEPLOY%\ + - copy C:\msys64\mingw32\bin\libgcc_s_dw2*.dll %RS_DEPLOY%\ + - copy C:\msys64\mingw32\bin\libstdc*.dll %RS_DEPLOY%\ + - copy C:\msys64\mingw32\bin\libwinpthread*.dll %RS_DEPLOY%\ + - copy C:\msys64\mingw32\bin\libicu*.dll %RS_DEPLOY%\ + - copy C:\msys64\mingw32\bin\libpcre*.dll %RS_DEPLOY%\ + - copy C:\msys64\mingw32\bin\libharfbuzz*.dll %RS_DEPLOY%\ + - copy C:\msys64\mingw32\bin\libpng*.dll %RS_DEPLOY%\ + - copy C:\msys64\mingw32\bin\libfreetype*.dll %RS_DEPLOY%\ + - copy C:\msys64\mingw32\bin\libglib*.dll %RS_DEPLOY%\ + - copy C:\msys64\mingw32\bin\libgraphite2.dll %RS_DEPLOY%\ + - copy C:\msys64\mingw32\bin\libintl*.dll %RS_DEPLOY%\ + - copy C:\msys64\mingw32\bin\libiconv*.dll %RS_DEPLOY%\ + - copy C:\msys64\mingw32\bin\libjasper*.dll %RS_DEPLOY%\ + - copy C:\msys64\mingw32\bin\libjpeg*.dll %RS_DEPLOY%\ + - copy C:\msys64\mingw32\bin\libtiff*.dll %RS_DEPLOY%\ + - copy C:\msys64\mingw32\bin\libwebp*.dll %RS_DEPLOY%\ + - copy C:\msys64\mingw32\bin\libwebpdemux*.dll %RS_DEPLOY%\ + - copy C:\msys64\mingw32\bin\liblzma*.dll %RS_DEPLOY%\ + +## Needed for cmark + - copy C:\msys64\mingw32\bin\libcmark*.dll %RS_DEPLOY%\ + - copy C:\msys64\mingw32\bin\libdouble-conversion*.dll %RS_DEPLOY%\ # to disable automatic builds #build: off @@ -163,6 +259,10 @@ build_script: #---------------------------------# #artifacts: +# - path: '**\*.exe' +# - path: filelist.txt +# - path: $(RS_DEPLOY) + # # # pushing a single file # - path: test.zip diff --git a/build-all-mingw32make.bat b/build-all-mingw32make.bat deleted file mode 100755 index 49eebe687..000000000 --- a/build-all-mingw32make.bat +++ /dev/null @@ -1,217 +0,0 @@ -set QTDIR=C:\Qt\5.5\mingw492_32\ -set MINGW=C:\Qt\Tools\mingw492_32 - -set PATH=%QTDIR%\bin;%MINGW%\bin;%PATH% -set DEBUG=1 - -@echo off -rem emptying used variables in case the script was aborted and tempfile -set pack= -set clean= -set errorlevel= -if exist tmp.txt del tmp.txt - - -:loop1 -if %1x == x ( - rem if not exist tmp.txt echo debug >>tmp.txt - goto :end1 -) -if /i %1==clean ( - set clean=clean - shift - goto :loop1 -) -if /i %1==pack ( - set pack=pack - shift - goto :loop1 -) -echo.%1>>tmp.txt -shift -goto :loop1 - -:end1 -if %clean%x==cleanx ( - if not exist tmp.txt echo %clean% >>tmp.txt -) - -if not exist tmp.txt ( - if not %pack%x==packx ( - echo debug >>tmp.txt - set clean=clean - ) -) - -for /f %%a in (tmp.txt) do ( -if ECHO==1 @echo on - - - - -rem TODO: Remove these lines -rem GOTO :retroshare-gui - - - - -:libbitdht -rem ################################### -rem ### libbitdht ##################### -rem ################################### -cd libbitdht\src - -if not %clean%x==x mingw32-make clean - -qmake libbitdht.pro -CALL :TEST_ERROR - -mingw32-make %%a -CALL :TEST_ERROR -echo ################################### -echo ### libbitdht done ################ -echo ################################### -cd ..\.. - -:openpgpsdk -rem ################################### -rem ### openpgpsdk #################### -rem ################################### -cd openpgpsdk\src - -if not %clean%x==x mingw32-make clean - -qmake openpgpsdk.pro -CALL :TEST_ERROR - -mingw32-make -CALL :TEST_ERROR -echo ################################### -echo ### openpgpsdk done ############### -echo ################################### -cd ..\.. - -:libresapi -rem ################################### -rem ### libresapi ##################### -rem ################################### -cd libresapi\src - -if not %clean%x==x mingw32-make clean - -qmake libresapi.pro -CALL :TEST_ERROR - -mingw32-make %%a -CALL :TEST_ERROR -echo ################################### -echo ### libresapi done ################ -echo ################################### -cd ..\.. - -:libretroshare -rem ################################### -rem ### libretroshare ################# -rem ################################### -cd libretroshare\src - -if not %clean%x==x mingw32-make clean - -qmake libretroshare.pro "CONFIG+=version_detail_bash_script" -CALL :TEST_ERROR - -mingw32-make %%a -CALL :TEST_ERROR -echo ################################### -echo ### libretroshare done ############ -echo ################################### -cd ..\.. - -:pegmarkdown -rem ################################### -rem ### pegmarkdown ################### -rem ################################### -cd supportlibs\pegmarkdown - -if not %clean%x==x mingw32-make clean - -qmake pegmarkdown.pro -CALL :TEST_ERROR - -mingw32-make %%a -CALL :TEST_ERROR -echo ################################### -echo ### pegmarkdown done ############## -echo ################################### -cd ..\.. - -:retroshare-nogui -rem ################################### -rem ### retroshare-nogui ############## -rem ################################### -cd retroshare-nogui\src - -if not %clean%x==x mingw32-make clean - -qmake retroshare-nogui.pro -CALL :TEST_ERROR - -mingw32-make %%a -CALL :TEST_ERROR -echo ################################### -echo ### retroshare-nogui done ######### -echo ################################### -cd ..\.. - -:retroshare-gui -rem ################################### -rem ### retroshare-gui ################ -rem ################################### -cd retroshare-gui\src - -if not %clean%x==x mingw32-make clean - -rem qmake -r -spec ..\mkspecs\win32-g++ "CONFIG+=version_detail_bash_script" retroshare-gui.pro -qmake retroshare-gui.pro "CONFIG+=version_detail_bash_script" -CALL :TEST_ERROR - -mingw32-make %%a -CALL :TEST_ERROR -echo ################################### -echo ### retroshare-gui done ########### -echo ################################### - -cd ..\.. -@echo off -) - - -@echo off -if %pack%x==packx call packaging.bat -rem ################################### -rem ### clean up ###################### -rem ################################### -set clean= -del tmp.txt -set pack= -pause - -rem ################################### -rem ### END ########################### -rem ################################### -GOTO :EOF - - -:TEST_ERROR -@echo off -if errorlevel 1 ( - pause - set clean= - del tmp.txt - set pack= - EXIT -) -if ECHO==1 @echo on -EXIT /B - -:EOF \ No newline at end of file diff --git a/build_scripts/Android/README.asciidoc b/build_scripts/Android/README.asciidoc new file mode 100644 index 000000000..3f978cfd1 --- /dev/null +++ b/build_scripts/Android/README.asciidoc @@ -0,0 +1,399 @@ += RetroShare development on Android + +// SPDX-FileCopyrightText: RetroShare Team +// 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 + +Copyright (C) 2020 Asociación Civil Altermundi + + +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/] diff --git a/build_scripts/Android/generate_gdb_init_commands.sh b/build_scripts/Android/generate_gdb_init_commands.sh new file mode 100755 index 000000000..3a9883950 --- /dev/null +++ b/build_scripts/Android/generate_gdb_init_commands.sh @@ -0,0 +1,85 @@ +#!/bin/bash + +# Script to prepare Android NDK GDB configurations to debug retroshare-service +# +# Copyright (C) 2020 Gioacchino Mazzurco +# Copyright (C) 2020 Asociación Civil Altermundi +# +# 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 + + +## 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 diff --git a/build_scripts/Android/prepare-toolchain-clang.sh b/build_scripts/Android/prepare-toolchain-clang.sh new file mode 100755 index 000000000..2c64a5186 --- /dev/null +++ b/build_scripts/Android/prepare-toolchain-clang.sh @@ -0,0 +1,549 @@ +#!/bin/bash + +# Script to prepare RetroShare Android package building toolchain +# +# Copyright (C) 2016-2020 Gioacchino Mazzurco +# +# 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 +# +# SPDX-FileCopyrightText: Retroshare Team +# 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}" +} + +## 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 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} diff --git a/build_scripts/Android/pull_sysroot.sh b/build_scripts/Android/pull_sysroot.sh new file mode 100755 index 000000000..d474610e4 --- /dev/null +++ b/build_scripts/Android/pull_sysroot.sh @@ -0,0 +1,90 @@ +#!/bin/bash + +# Script to pull debugging sysroot from Android devices +# +# Copyright (C) 2020 Gioacchino Mazzurco +# Copyright (C) 2020 Asociación Civil Altermundi +# +# 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 + +<<"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 ` + +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}" diff --git a/build_scripts/Android/start_gdbserver.sh b/build_scripts/Android/start_gdbserver.sh new file mode 100755 index 000000000..af25e3be1 --- /dev/null +++ b/build_scripts/Android/start_gdbserver.sh @@ -0,0 +1,116 @@ +#!/bin/bash + +# Script to start gdbserver on Android device and attach to retroshare-service +# +# Copyright (C) 2020 Gioacchino Mazzurco +# Copyright (C) 2020 Asociación Civil Altermundi +# +# 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 + +<<"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}" +} + +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 </dev/null 2>&1 || ( echo wget missing && exit 1 ) +which grep >/dev/null 2>&1 || ( echo grep missing && exit 1 ) +which sed >/dev/null 2>&1 || ( echo sed missing && exit 1 ) +which cut >/dev/null 2>&1 || ( echo cut missing && exit 1 ) + +# If the yaml file doesn't exist locally, get it from GitHub +if [ ! -f "${!#}" ] ; then + YAMLFILE=/tmp/_recipe.yml + rm -f "$YAMLFILE" + wget -q "https://github.com/probonopd/AppImages/raw/master/recipes/meta/${!#}.yml" -O "$YAMLFILE" +else + YAMLFILE=$(readlink -f "${!#}") +fi + +# Lightweight bash-only dpkg-scanpackages replacement +scanpackages() { + for deb in *.deb ; do + dpkg -I $deb | sed 's/^ *//g' | grep -i -E '(package|version|installed-size|architecture|depends|priority):' + echo "Filename: $(readlink -f $deb)" + echo "MD5sum: $(md5sum -b $deb | cut -d' ' -f1)" + echo "SHA1: $(sha1sum -b $deb | cut -d' ' -f1)" + echo "SHA256: $(sha256sum -b $deb | cut -d' ' -f1)" + echo + done +} + +# Function to parse yaml +# https://gist.github.com/epiloque/8cf512c6d64641bde388 +# based on https://gist.github.com/pkuczynski/8665367 +parse_yaml() { + local prefix=$2 + local s + local w + local fs + s='[[:space:]]*' + w='[a-zA-Z0-9_]*' + fs="$(echo @|tr @ '\034')" + sed -ne "s|^\($s\)\($w\)$s:$s\"\(.*\)\"$s\$|\1$fs\2$fs\3|p" \ + -e "s|^\($s\)\($w\)$s[:-]$s\(.*\)$s\$|\1$fs\2$fs\3|p" "$1" | + awk -F"$fs" '{ + indent = length($1)/2; + vname[indent] = $2; + for (i in vname) {if (i > indent) {delete vname[i]}} + if (length($3) > 0) { + vn=""; for (i=0; i/dev/null || true + generate_status + + # Some packages depend on packages which we do not want to bundle, + # in addition to the global excludes defined in excludedeblist. + # Use + # ingredients: + # exclude: + # - packagename + if [ ! -z "${_ingredients_exclude[0]}" ] ; then + for PACKAGE in "${_ingredients_exclude[@]}" ; do + printf "Package: $PACKAGE\nStatus: install ok installed\nArchitecture: all\nVersion: 9:999.999.999\n\n" >> status + done + fi + + # Some packages depend on an exact version of a dependency to be installed. + # Use + # ingredients: + # pretend: + # - packagename version_to_be_pretended + if [ ! -z "${_ingredients_pretend[0]}" ] ; then + for PRETEND in "${_ingredients_pretend[@]}" ; do + P_PKG=$(echo "$PRETEND" | cut -d " " -f 1) + P_VER=$(echo "$PRETEND" | cut -d " " -f 2) + cat status | tr '\n' '@' | sed -e 's|@@|\n\n|g' | sed -e 's|Package: '"$P_PKG"'@Status: install ok installed@Architecture: all@Version: 9:999.999.999|Package: '"$P_PKG"'@Status: install ok installed@Architecture: all@Version: '"$P_VER"'|g' | sed -e 's|@|\n|g' > status.temp + mv status.temp status + done + fi + + if [ -e sources.list ] ; then + rm sources.list + fi + for SOURCE in "${_ingredients_sources[@]}" ; do + echo "${SOURCE}" >> sources.list + done + for PPA in "${_ingredients_ppas[@]}" ; do + echo "deb http://ppa.launchpad.net/${PPA}/ubuntu ${_ingredients_dist} main" >> sources.list + done + # Use libcurl-slim to reduce AppImage size, thanks darealshinji + # Not really compiled on xenial but CentOS 6, https://github.com/AppImage/AppImages/issues/187 + echo "deb http://ppa.launchpad.net/djcj/libcurl-slim/ubuntu xenial main" >> sources.list +fi + +if [ ! -z "${_ingredients_script[0]}" ] ; then + # Execute extra steps defined in recipe + shell_execute $YAMLFILE _ingredients_script +fi + +if [ ! -z "${_ingredients_dist}" ] ; then + # Some projects provide raw .deb files without a repository + # hence we create our own local repository as part of + # the AppImage creation process in order to "install" + # the package using apt-get as normal + if [ ! -z "${_ingredients_debs[0]}" ] ; then + for DEB in "${_ingredients_debs[@]}" ; do + if [ ! -f $(basename "$DEB") ] ; then + wget -c $DEB + fi + done + fi + scanpackages | gzip -9c > Packages.gz + echo "deb file:$(readlink -e $PWD) ./" >> sources.list + + INSTALL=$LOWERAPP + if [ ! -z "${_ingredients_package}" ] ; then + INSTALL="${_ingredients_package}" + fi + if [ ! -z "${_ingredients_packages}" ] ; then + INSTALL="" + fi + + # If packages are specifically listed, only install these, not a package with the name of the app + if [ ! -z "${_ingredients_packages[0]}" ] ; then + INSTALL=${_ingredients_packages[@]} + fi + + apt-get $OPTIONS update || true + URLS=$(apt-get $OPTIONS -y install --print-uris $INSTALL | cut -d "'" -f 2 | grep -e "^http") + if which aria2c &>/dev/null; then + dltool=aria2c + else + dltool=wget + fi + + $dltool -c -i- <<<"$URLS" +fi + +mkdir -p ./$APP.AppDir/ +cd ./$APP.AppDir/ + +mkdir -p usr/bin usr/lib +find ../*.deb -exec dpkg -x {} . \; || true + +# Try to copy icons to standard locations where appimaged can pick them up +mkdir -p usr/share/icons/hicolor/{22x22,24x24,32x32,48x48,64x64,128x128,256x256,512x512}/apps/ +find . -path *icons* -path *22* -name "*$LOWERAPP*" -exec cp {} usr/share/icons/hicolor/22x22/apps/ \; || true +find . -path *icons* -path *24* -name "*$LOWERAPP*" -exec cp {} usr/share/icons/hicolor/24x24/apps/ \; || true +find . -path *icons* -path *32* -name "*$LOWERAPP*" -exec cp {} usr/share/icons/hicolor/32x32/apps/ \; || true +find . -path *icons* -path *48* -name "*$LOWERAPP*" -exec cp {} usr/share/icons/hicolor/48x48/apps/ \; || true +find . -path *icons* -path *64* -name "*$LOWERAPP*" -exec cp {} usr/share/icons/hicolor/64x64/apps/ \; || true +find . -path *icons* -path *128* -name "*$LOWERAPP*" -exec cp {} usr/share/icons/hicolor/128x128/apps/ \; || true +find . -path *icons* -path *256* -name "*$LOWERAPP*" -exec cp {} usr/share/icons/hicolor/256x256/apps/ \; || true +find . -path *icons* -path *512* -name "*$LOWERAPP*" -exec cp {} usr/share/icons/hicolor/512x512/apps/ \; || true + +get_icon + +if [ -z "${_union}" ] ; then + get_apprun +else +cat > AppRun <<\EOF +#!/bin/sh +HERE="$(dirname "$(readlink -f "${0}")")" +export UNION_PRELOAD="${HERE}" +export LD_PRELOAD="${HERE}/libunionpreload.so" +export PATH="${HERE}"/usr/bin/:"${HERE}"/usr/sbin/:"${HERE}"/usr/games/:"${HERE}"/bin/:"${HERE}"/sbin/:"${PATH}" +export LD_LIBRARY_PATH="${HERE}"/usr/lib/:"${HERE}"/usr/lib/i386-linux-gnu/:"${HERE}"/usr/lib/x86_64-linux-gnu/:"${HERE}"/usr/lib32/:"${HERE}"/usr/lib64/:"${HERE}"/lib/:"${HERE}"/lib/i386-linux-gnu/:"${HERE}"/lib/x86_64-linux-gnu/:"${HERE}"/lib32/:"${HERE}"/lib64/:"${LD_LIBRARY_PATH}" +export PYTHONPATH="${HERE}"/usr/share/pyshared/:"${PYTHONPATH}" +export PYTHONHOME="${HERE}"/usr/ +export XDG_DATA_DIRS="${HERE}"/usr/share/:"${XDG_DATA_DIRS}" +export PERLLIB="${HERE}"/usr/share/perl5/:"${HERE}"/usr/lib/perl5/:"${PERLLIB}" +export GSETTINGS_SCHEMA_DIR="${HERE}"/usr/share/glib-2.0/schemas/:"${GSETTINGS_SCHEMA_DIR}" +export QT_PLUGIN_PATH="${HERE}"/usr/lib/qt4/plugins/:"${HERE}"/usr/lib/i386-linux-gnu/qt4/plugins/:"${HERE}"/usr/lib/x86_64-linux-gnu/qt4/plugins/:"${HERE}"/usr/lib32/qt4/plugins/:"${HERE}"/usr/lib64/qt4/plugins/:"${HERE}"/usr/lib/qt5/plugins/:"${HERE}"/usr/lib/i386-linux-gnu/qt5/plugins/:"${HERE}"/usr/lib/x86_64-linux-gnu/qt5/plugins/:"${HERE}"/usr/lib32/qt5/plugins/:"${HERE}"/usr/lib64/qt5/plugins/:"${QT_PLUGIN_PATH}" +EXEC=$(grep -e '^Exec=.*' "${HERE}"/*.desktop | head -n 1 | cut -d "=" -f 2- | sed -e 's|%.||g') +exec ${EXEC} $@ +EOF +chmod a+x AppRun +fi + +get_desktop + +# Prevent Qt from loading plugins from the system +unset QTPATH +QTPATH=$(find usr/lib -type d -name qt4 -or -name qt5 | sed -e 's|usr/|../|g') +if [ ! -z $QTPATH ] ; then +cat > usr/bin/qt.conf < temp \; + # Remove all absolute paths + sed -i -E 's|target=\"\/(.*\/)([a-z0-9].*?)>|target=\"\2>|g' temp + SONAMES=$(cat temp | cut -d '"' -f 4 | grep ".so") + for SONAME in $SONAMES; do + find . -name "$SONAME" -exec mv {} usr/lib \; + done + rm temp + PATH_OF_THE_EXE="usr/lib/mono/exe" + mkdir -p "PATH_OF_THE_EXE" + # Force all dll files into PATH_OF_THE_EXE (or MONO_PATH which we would have to set) + find . -name "*.dll" -and -not -name "mscorlib.dll" -exec mv {} "$PATH_OF_THE_EXE" \; + # Edit all config files in place to remove absolute paths + find . -name "*.dll.config" -exec sed -i -E 's|target=\"\/(.*\/)([a-z0-9].*?)>|target=\"\2>|g' {} \; + # Force all config files into the PATH_OF_THE_EXE (or MONO_PATH which we would have to set) + find . -name "*.dll.config" -exec mv {} "$PATH_OF_THE_EXE" \; + # Remove gac, we are not using it since it is convoluted + rm -rf usr/lib/mono/gac/ +fi + +if [ -d "./usr/lib/x86_64-linux-gnu/gstreamer-1.0/" ] ; then + mv ./usr/lib/x86_64-linux-gnu/gstreamer-1.0/* ./usr/lib/x86_64-linux-gnu/ + rm -r ./usr/lib/x86_64-linux-gnu/gstreamer-1.0 +fi + +if [ -d "./usr/lib/x86_64-linux-gnu/pulseaudio/" ] ; then + mv ./usr/lib/x86_64-linux-gnu/pulseaudio/* ./usr/lib/x86_64-linux-gnu/ + rm -r ./usr/lib/x86_64-linux-gnu/pulseaudio +fi + +# Execute extra steps defined in recipe +if [ ! -z "${_script}" ] ; then + shell_execute $YAMLFILE _script +fi + +DESKTOP=$(find . -name '*.desktop' | sort | head -n 1) + +# desktop-file-validate complains about missing trailing semicolons for some +# keys although the format definition says that they are optional +fix_desktop "$DESKTOP" + +# Some non-distribution provided applications have an absolute +# path in the Exec= line which we remove for relocateability +if [ -z "$DESKTOP" ] ; then + echo "desktop file not found, aborting" + exit 1 +else + desktop-file-validate "$DESKTOP" || exit 1 + ORIG=$(grep -o "^Exec=.*$" "${DESKTOP}" | head -n 1| cut -d " " -f 1) + REPL=$(basename $(grep -o "^Exec=.*$" "${DESKTOP}" | head -n 1 | cut -d " " -f 1 | sed -e 's|Exec=||g')) + sed -i -e 's|'"${ORIG}"'|Exec='"${REPL}"'|g' "${DESKTOP}" +fi + +# Compile GLib schemas if the subdirectory is present in the AppImage +# AppRun has to export GSETTINGS_SCHEMA_DIR for this to work +if [ -d usr/share/glib-2.0/schemas/ ] ; then + ( cd usr/share/glib-2.0/schemas/ ; glib-compile-schemas . ) +fi + +if [ -f ../VERSION ] ; then + VERSION=$(cat ../VERSION) +else + get_version || true +fi + +# patch_usr +# Patching only the executable files seems not to be enough for some apps +if [ ! -z "${_binpatch}" ] ; then + find usr/ -type f -exec sed -i -e 's|/usr|././|g' {} \; + find usr/ -type f -exec sed -i -e 's@././/bin/env@/usr/bin/env@g' {} \; +fi + +# Don't suffer from NIH; use LD_PRELOAD to override calls to /usr paths +if [ ! -z "${_union}" ] ; then + mkdir -p usr/src/ + wget -q "https://raw.githubusercontent.com/mikix/deb2snap/master/src/preload.c" -O - | \ + sed -e 's|SNAPPY|UNION|g' | sed -e 's|SNAPP|UNION|g' | sed -e 's|SNAP|UNION|g' | \ + sed -e 's|snappy|union|g' > usr/src/libunionpreload.c + gcc -shared -fPIC usr/src/libunionpreload.c -o libunionpreload.so -ldl -DUNION_LIBNAME=\"libunionpreload.so\" + strip libunionpreload.so +fi + +delete_blacklisted + +if [ "$ENABLE_DI" = "yes" ] ; then + get_desktopintegration $LOWERAPP +fi + +# Fix desktop files that have file endings for icons +sed -i -e 's|\.png||g' *.desktop || true +sed -i -e 's|\.svg||g' *.desktop || true +sed -i -e 's|\.svgz||g' *.desktop || true +sed -i -e 's|\.xpm||g' *.desktop || true + +# Setting PYTHONHOME instead +# Fix Python imports, +# https://github.com/probonopd/AppImages/issues/172 +# SITECUSTOMIZEFILES=$(find . -name "sitecustomize.py") +# for SITECUSTOMIZEFILE in $SITECUSTOMIZEFILES ; do +# rm $SITECUSTOMIZEFILE # Remove symlinks, replace by files +# cat > $SITECUSTOMIZEFILE <<\EOF +# import sys,os +# if sys.version_info[0] < 3: +# prefix = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(sys.path[0])))) +# sys.path = [ prefix+s for s in sys.path if not s.startswith(prefix) ] +# EOF +# done + +# Execute extra steps defined in recipe +if [ ! -z "${_post}" ] ; then + shell_execute $YAMLFILE _post +fi + +# Go out of AppImage +cd .. + +generate_type2_appimage +ls -lh ../out/*.AppImage diff --git a/build_scripts/AppImage/clean.sh b/build_scripts/AppImage/clean.sh new file mode 100755 index 000000000..68bbee1a2 --- /dev/null +++ b/build_scripts/AppImage/clean.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +rm -rf ./out +rm *~ +rm -rf ./retroshare + diff --git a/build_scripts/AppImage/makeAppImage.sh b/build_scripts/AppImage/makeAppImage.sh new file mode 100755 index 000000000..23f651d4a --- /dev/null +++ b/build_scripts/AppImage/makeAppImage.sh @@ -0,0 +1,3 @@ +#!/bin/sh +./Recipe retroshare.yml + diff --git a/build_scripts/AppImage/makeAppImage_retrotor.sh b/build_scripts/AppImage/makeAppImage_retrotor.sh new file mode 100755 index 000000000..5e128fd5c --- /dev/null +++ b/build_scripts/AppImage/makeAppImage_retrotor.sh @@ -0,0 +1,3 @@ +#!/bin/sh +./Recipe retrotor.yml + diff --git a/build_scripts/AppImage/retroshare.yml b/build_scripts/AppImage/retroshare.yml new file mode 100644 index 000000000..ced4d9808 --- /dev/null +++ b/build_scripts/AppImage/retroshare.yml @@ -0,0 +1,18 @@ +app: retroshare +union: true + +ingredients: + dist: trusty + sources: + - deb http://archive.ubuntu.com/ubuntu trusty main restricted universe multiverse + - deb http://archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse + ppas: + - retroshare/unstable + packages: + - libqt4-svg + - retroshare + +script: + - rm -rf usr/share/glib-2.0/schemas/ + - sed -i -e 's|/usr/share/pixmaps/||g' retroshare.desktop + - sed -i -e 's|/usr/bin/||g' retroshare.desktop diff --git a/build_scripts/AppImage/retrotor.yml b/build_scripts/AppImage/retrotor.yml new file mode 100644 index 000000000..e7eba009a --- /dev/null +++ b/build_scripts/AppImage/retrotor.yml @@ -0,0 +1,20 @@ +app: retroshare +union: true + +ingredients: + dist: trusty + sources: + - deb http://archive.ubuntu.com/ubuntu trusty main restricted universe multiverse + - deb http://archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse + - deb http://deb.torproject.org/torproject.org/ trusty main + ppas: + - retroshare/testing + packages: + - libqt5svg5 + - tor + - retrotor + +script: + - rm -rf usr/share/glib-2.0/schemas/ + - sed -i -e 's|/usr/share/pixmaps/||g' retroshare.desktop + - sed -i -e 's|/usr/bin/||g' retroshare.desktop diff --git a/build_scripts/Debian+Ubuntu/changelog b/build_scripts/Debian+Ubuntu/changelog index 3500c7cd3..d4693fde8 100644 --- a/build_scripts/Debian+Ubuntu/changelog +++ b/build_scripts/Debian+Ubuntu/changelog @@ -1,4 +1,1395 @@ -retroshare (0.6.3-1.XXXXXX~YYYYYY) YYYYYY; urgency=low +retroshare (ZZZZZZ-1.XXXXXX~YYYYYY) YYYYYY; urgency=low + + fd1e7074c csoler Sun, 16 Dec 2018 14:35:30 +0100 Merge pull request #1432 from RetroShare/v0.6.5 + 9ce573c3f csoler Sun, 16 Dec 2018 14:34:14 +0100 Merge pull request #1415 from csoler/v0.6.5-ForumModel2 + 60112e838 csoler Fri, 14 Dec 2018 22:14:59 +0100 added two missing virtual desctructors in GXS interface structures + 117c19b10 csoler Fri, 14 Dec 2018 22:09:02 +0100 fixed a few problems in jumping to next unread post + 348f88b6e csoler Thu, 13 Dec 2018 21:02:32 +0100 partially fixed async navigate action in forums + 6ceb8c69c csoler Thu, 13 Dec 2018 19:57:03 +0100 Merge pull request #1428 from defnax/master + a95a235e0 defnax Wed, 12 Dec 2018 22:37:29 +0100 Update emotes.acs + 7113eb7bf Gioacc Wed, 12 Dec 2018 21:35:31 +0100 GxsChannels optimizable API + 39b7bc818 csoler Wed, 12 Dec 2018 21:31:54 +0100 added more debug info to figure out why some posts are not displayed + a114856b7 csoler Wed, 12 Dec 2018 11:33:38 +0100 changed code to create msg data map using MsgMeta instead of full Msg and added the handles to request MsgMeta data in forums + 8f9c9295b csoler Tue, 11 Dec 2018 22:06:45 +0100 added proper timeout of 5 secs to all forum async-ed interactions + b38c63564 csoler Mon, 10 Dec 2018 22:51:09 +0100 restored display of forum summary when browsing forums + 1dda7c5b3 csoler Sun, 9 Dec 2018 23:25:59 +0100 removed mUpdating variable which was used for a safety test that is not relevant anymore and caused problems + 34f51fff9 csoler Sun, 9 Dec 2018 23:18:50 +0100 made next unread post arrow also work when no post is selected + 983ac7dda csoler Sun, 9 Dec 2018 21:22:18 +0100 improved icons in forums and removed - button because it is not useful + 27264cea0 csoler Sun, 9 Dec 2018 17:35:31 +0100 fixed icons and buttons in forums + a6ed2b26e csoler Sun, 9 Dec 2018 16:34:43 +0100 fixed author name placement and icon size when loading ID data in forums + d7b5c9766 csoler Sun, 9 Dec 2018 13:54:30 +0100 fixed missing filterAcceptsRow() in forum proxy model + d5928ca84 csoler Sat, 8 Dec 2018 22:19:39 +0100 fixed message loading bug due to currentIndex() not being ready when insertMessage() is called + 459c04a23 csoler Sat, 8 Dec 2018 22:01:05 +0100 re-enabled debug output + 7c248dc03 csoler Sat, 8 Dec 2018 21:43:14 +0100 attempt to fix pb on 32bits systems + a0b6962be csoler Fri, 7 Dec 2018 22:09:55 +0100 fixed bug in read/unread with children menu items + 42aab5596 csoler Fri, 7 Dec 2018 21:45:15 +0100 fixed changing of read status using button in forum model + 1163d00ae csoler Thu, 6 Dec 2018 23:49:14 +0100 small check to avoid re-loading already loaded msg + 49ea15449 csoler Thu, 6 Dec 2018 23:18:56 +0100 fixed restoring of current item + 5b8a64b67 csoler Thu, 6 Dec 2018 23:04:53 +0100 fixed a number of bugs in the update/display of forum model + bdf9bd5c5 Gioacc Thu, 6 Dec 2018 20:49:51 +0100 JSON API fix OPTION method handling for authenticated methods + db0a22a22 Gioacc Thu, 6 Dec 2018 20:46:44 +0100 JSON API for /rsFiles/FileClearCompleted + 600a3d8e1 csoler Wed, 5 Dec 2018 20:28:58 +0100 fixed saving/restoring of expanded items in forum model + 11b4981bd csoler Tue, 4 Dec 2018 23:36:07 +0100 keep current selection when updating a forum. Still need to keep the expand/collapse property + 6fae40d41 csoler Tue, 4 Dec 2018 23:10:24 +0100 trying new notification system using begin/end remove/insert rows to avoid crash + b63544e85 csoler Tue, 4 Dec 2018 22:14:54 +0100 suppressed 2 uninitialized memory read in ForumModel + fb962c4b5 csoler Tue, 4 Dec 2018 09:36:06 +0100 attempt to fix crash when threads collide in forum model + ec0bb5347 csoler Mon, 3 Dec 2018 21:56:11 +0100 added missing emit of layoutAboutToBeChanged() in forum model + 442360007 csoler Mon, 3 Dec 2018 21:28:00 +0100 update posts when navigating with arrows + 55022432e csoler Mon, 3 Dec 2018 17:30:46 +0100 added proper update of threads when new msg is poste or received + 49dc9bcae csoler Sun, 2 Dec 2018 22:49:16 +0100 increated timeout limit for retrieving forums + 60e559561 csoler Sun, 2 Dec 2018 22:41:48 +0100 fixed bug in post pinning + 24896bc59 csoler Sun, 2 Dec 2018 16:49:14 +0100 further cleaning of ForumModel code + 8736380bf csoler Sun, 2 Dec 2018 16:45:16 +0100 added license, removed debug info + 73c06006d csoler Sun, 2 Dec 2018 16:39:33 +0100 removed old code + 91321725e csoler Sun, 2 Dec 2018 16:34:43 +0100 added sorting based on most recent TS from children + 37f721f30 csoler Sun, 2 Dec 2018 16:07:28 +0100 added reset to avoid crash when switching from flat to tree views + 1fced4a1c csoler Sun, 2 Dec 2018 12:02:25 +0100 added flat mode to ForumModel + 917695e83 csoler Sat, 1 Dec 2018 23:14:08 +0100 fixed filtering of messages in new forum Model + a51eba1db csoler Sat, 1 Dec 2018 16:09:35 +0100 added filtering mechanism in ForumModel + b7b9f335f csoler Fri, 30 Nov 2018 18:01:51 +0100 fixed fonts for unread msgs in Forum Model + f56e932fb csoler Fri, 30 Nov 2018 17:24:43 +0100 fixed sorting problem in new model due to missing call to sortRole() + dce660357 csoler Thu, 29 Nov 2018 22:15:12 +0100 fixed Travis compilation + c07851090 csoler Thu, 29 Nov 2018 18:34:47 +0100 removed line that breaks compilation + 66ad7b650 csoler Thu, 29 Nov 2018 18:33:25 +0100 added missing virtual destructor in RsGrpMetaData and RsMsgMetaData + 09ffffe88 csoler Thu, 29 Nov 2018 00:01:35 +0100 removed some more old code from forum thread widget + 9c840baf2 csoler Wed, 28 Nov 2018 23:50:38 +0100 added missing signal causing crach in new model when changing forums + ccdfc3cbf csoler Tue, 27 Nov 2018 22:24:18 +0100 cleaned up removed code in Forum Model + ed68d720a csoler Tue, 27 Nov 2018 20:43:09 +0100 fixed post versionning + 23302ea46 csoler Tue, 27 Nov 2018 19:21:49 +0100 partly resurrected post versions + 032f1307f G10h4c Tue, 27 Nov 2018 18:55:40 +0100 Merge pull request #1416 from pedro-nonfree/patch-1 + 561db0025 csoler Tue, 27 Nov 2018 15:15:54 +0100 resurrected sorting for pinned posts using a proxy model + 02c6a92f4 csoler Tue, 27 Nov 2018 10:13:03 +0100 fixed resizing+CPU bug due to inconsistent return in eventFilter() + c0e87dbb3 csoler Tue, 27 Nov 2018 09:37:34 +0100 attempt at fixing column resize + bac6eb05b csoler Tue, 27 Nov 2018 08:16:59 +0100 Merge pull request #1420 from pedro-nonfree/rename-friend-to-trusted-node-statusbar + d3d3148c8 pedrol Tue, 27 Nov 2018 03:18:19 +0100 substitute friend to trusted node in statusbar + 73e285805 csoler Mon, 26 Nov 2018 23:07:05 +0100 simplified comment in GxsIdDetails and hid columns in new ForumModel + b179cb579 csoler Mon, 26 Nov 2018 22:48:47 +0100 fixed next/prev item and next unread selection + 3a76f2515 csoler Mon, 26 Nov 2018 22:07:10 +0100 resurrected prev/next buttons + 581e892d9 csoler Mon, 26 Nov 2018 21:18:28 +0100 create an index iterator in ForumModel + 6bb8e3ffd csoler Sun, 25 Nov 2018 22:07:59 +0100 saving work for next unread msg in forum model + 65f2d2665 csoler Sun, 25 Nov 2018 21:12:26 +0100 fixed author tooltip in ForumModel + 114a11af7 csoler Sun, 25 Nov 2018 17:44:56 +0100 fixed bug in read status update in new ForumModel + dc913e37c csoler Sun, 25 Nov 2018 17:40:48 +0100 fixed update of threads in new model + 419bd2157 csoler Sun, 25 Nov 2018 17:11:08 +0100 factored all methods that apply to msg data using pointer to member function trick + 0b0e58bd3 csoler Sat, 24 Nov 2018 22:25:23 +0100 fixed bug in coloring of read/unread property + 738401585 csoler Sat, 24 Nov 2018 22:06:34 +0100 fixed update of QTreeView when something changes in Forum model using dataChanged() signal + 6f83bb520 csoler Sat, 24 Nov 2018 20:50:09 +0100 fixed mark as read/unread and display of read status in forum model + 9cec56f1e csoler Sat, 24 Nov 2018 17:57:19 +0100 added info for read/unread status and resurrected context menu in new forum model + c2686d1a9 csoler Sat, 24 Nov 2018 16:11:40 +0100 fixed display of author in new ForumModel + 52a5aeb1f csoler Fri, 23 Nov 2018 23:17:12 +0100 added item delegate for author in new model + 28b83117e pedrol Fri, 23 Nov 2018 14:45:16 +0100 remove unnecessary warning + 543a7f280 csoler Thu, 22 Nov 2018 22:52:27 +0100 fixed display of current post in new Forum Model + 20b8bca80 csoler Thu, 22 Nov 2018 22:07:58 +0100 worked on display of posts and selection in new forum model + 81d23fa60 Gioacc Thu, 22 Nov 2018 21:56:55 +0100 JSON API to collect extra entropy + abec811d3 Gioacc Thu, 22 Nov 2018 16:41:19 +0100 Forum API add missing subscribe method + 3edd1dd0d csoler Thu, 22 Nov 2018 11:24:05 +0100 fixed missing case entries in ForumModel + 59220b5c8 csoler Thu, 22 Nov 2018 10:44:06 +0100 fixed layout of internal data in ForumModel + b28a76e35 csoler Thu, 22 Nov 2018 09:47:58 +0100 fixed update of posts list in new ForumModel + e01de33e1 csoler Thu, 22 Nov 2018 09:28:07 +0100 fixed compilation in new ForumModel + d3565c2ee csoler Wed, 21 Nov 2018 23:18:08 +0100 implemented update of posts for new model. Unfinished yet. + 2066248b3 csoler Tue, 20 Nov 2018 23:28:07 +0100 started updating ForumFillThread to new model + d8f9559b0 csoler Mon, 19 Nov 2018 23:33:19 +0100 fixed memory corruption bug in GxsForumModel + dbeb97c0e csoler Mon, 19 Nov 2018 21:45:42 +0100 fixed bug in sizeHintRole() + a532b68b8 csoler Sun, 18 Nov 2018 21:36:13 +0100 improvements of the Forum Model + 9d49ca0e4 csoler Sat, 17 Nov 2018 22:36:07 +0100 initial attempt at creating an ItemModel for forums + a802e494f csoler Tue, 20 Nov 2018 21:45:45 +0100 Merge pull request #1401 from G10h4ck/forum_api + 8c8ce53e4 csoler Tue, 20 Nov 2018 21:44:40 +0100 Merge pull request #1385 from G10h4ck/safer_api + f8c25fd96 csoler Mon, 19 Nov 2018 22:13:55 +0100 fixed bug in TransfersDialog model got sizeHintRole() + 2b58e3f46 Gioacc Sat, 17 Nov 2018 17:19:13 +0100 RsGxsChannels local search support + 1d7f0d6ef csoler Sat, 17 Nov 2018 14:14:53 +0100 Merge pull request #1409 from csoler/v0.6.5-DebianPackaging + 8075eec28 csoler Sat, 17 Nov 2018 14:10:08 +0100 fixed licenses in PhotoShare, Posted, profile, people and Network + f670a18b1 Gioacc Fri, 16 Nov 2018 19:09:37 +0100 Break too long line in retroshare.pri + e311b2887 Gioacc Fri, 16 Nov 2018 17:50:34 +0100 Complete channel API with comment and vote creation + ba58eba34 Gioacc Fri, 16 Nov 2018 17:03:25 +0100 Complete API for forums + ac2dacf51 csoler Thu, 15 Nov 2018 21:49:12 +0100 fixed licenses in gxsforums, gxschannels, im_history, msgs + 05bb002c7 csoler Wed, 14 Nov 2018 21:14:40 +0100 fixed licenses in gxs/ + eb1909e8b csoler Wed, 14 Nov 2018 20:54:37 +0100 fixed licenses in FileTransfer + 9512228b0 csoler Wed, 14 Nov 2018 20:21:47 +0100 Merge pull request #1408 from csoler/v0.6.5-BugFix + 6d0949372 csoler Wed, 14 Nov 2018 20:20:27 +0100 fixed overloading names for functions that are not supposed to be overloading in turtleClientService and ftServer + a506c80d8 csoler Tue, 13 Nov 2018 22:02:26 +0100 fixed licenses in elastic+feeds + 630609c11 csoler Sun, 11 Nov 2018 20:42:48 +0100 fixed retroshare.project email in licenses + c4ae4c21b csoler Sun, 11 Nov 2018 20:41:06 +0100 fixed licenses in gui/common/ + b57aacb6b csoler Sun, 11 Nov 2018 16:57:05 +0100 partially added/fixed licenses in gui/common + 529f60a86 csoler Sun, 11 Nov 2018 14:28:47 +0100 Merge pull request #1407 from RetroShare/v0.6.5 + fd3cf4a29 csoler Sun, 11 Nov 2018 14:27:41 +0100 Merge pull request #1406 from csoler/v0.6.5-DebianPackaging + b8d2d9cad Gioacc Mon, 5 Nov 2018 00:19:45 +0100 Print stack trace on crash + e95b8e4c5 csoler Sun, 11 Nov 2018 12:11:54 +0100 fixed license in retroshare-nogui + d242b4299 csoler Sun, 11 Nov 2018 12:00:30 +0100 improved Debian copyright file and packaging script + cdcc796af csoler Sun, 11 Nov 2018 11:59:55 +0100 fixed licenses in plugins/VOIP + 7bc91e3ac csoler Sun, 11 Nov 2018 11:21:34 +0100 moved qmake files in openpgpsdk to Apache-2.0 + 1d548586f csoler Sun, 11 Nov 2018 11:20:56 +0100 improved debian copyright file + 752337cbd csoler Sun, 11 Nov 2018 10:54:39 +0100 updated licensing in libretroshare and Debian packaging script + ca3694acc csoler Sat, 10 Nov 2018 23:03:44 +0100 re-licensed upnputil with permission from the author + 9c3d5acd8 csoler Sat, 10 Nov 2018 17:40:34 +0100 fixed license in libretroshare + ddca91b0c csoler Sat, 10 Nov 2018 17:40:13 +0100 moved some files to unfinished and deleted soem unused files + 602bc36ee csoler Sat, 10 Nov 2018 14:45:05 +0100 fixed missing licenses in libretroshare + 98bf2922c csoler Sat, 10 Nov 2018 14:44:45 +0100 removed old/unused files + b53e75ae8 csoler Sat, 10 Nov 2018 14:14:05 +0100 removed old/unreferenced gxs source files. Moved unfinished ideas for wire+acadb to unfinished/ + 5f86ac1e3 csoler Thu, 8 Nov 2018 23:34:42 +0100 updated licenses in gui/Circles. partly changed licenses in gui/common. + c80022f9c csoler Sun, 4 Nov 2018 21:17:22 +0100 fixed licenses in tests/ + 15b3c4814 csoler Sun, 4 Nov 2018 20:38:39 +0100 finished licenses in VOIP. Files re-licensed with authorization + 53ec7467d csoler Sun, 4 Nov 2018 16:19:17 +0100 fixed licenses in VOIP. Permission pending for some files + 456845fc8 csoler Sun, 4 Nov 2018 15:48:33 +0100 fixed licenses in FeedReader + 1e1e81704 csoler Sun, 4 Nov 2018 14:33:55 +0100 added license headers for librssimulator + 4dce4002f hunber Sun, 28 Oct 2018 22:25:26 +0100 Removed outdated instructions from readme + 41d942c14 hunber Sun, 28 Oct 2018 22:16:01 +0100 Updated links in readme + 7742e0ca3 hunber Sun, 28 Oct 2018 22:15:07 +0100 Removed version.html + 3e3adf733 hunber Sun, 28 Oct 2018 21:34:45 +0100 Removed some old build scripts + ca80161bf csoler Sun, 22 Jul 2018 00:02:06 +0200 fixed wrongly removed line + cd9a2db4e csoler Fri, 20 Jul 2018 19:48:29 +0200 fixed license in retroshare-gui/src/chat/ and main files + d3e690b0d G10h4c Sat, 10 Nov 2018 20:36:37 +0100 Merge pull request #1403 from G10h4ck/gui_dht_fixes + 54df09c4b sehraf Thu, 8 Nov 2018 18:13:20 +0100 add missing DEFINE, fix small bugs + 8b8ad3bce Gioacc Sat, 10 Nov 2018 16:30:35 +0100 Forum API for creation and posting + 1d110600f Gioacc Sat, 10 Nov 2018 16:29:39 +0100 Minor cleanups in GxsChannels + 72dd98516 Gioacc Sat, 10 Nov 2018 16:28:15 +0100 Deprecate TLV items, to avoid temptation to use them in new code + f84824271 Gioacc Sat, 10 Nov 2018 16:24:47 +0100 Implement ostream operator<< for RsSerializable + e449ffba0 Gioacc Fri, 9 Nov 2018 22:24:49 +0100 Better include in RsGxsChannels + 90bacf12b Gioacc Fri, 9 Nov 2018 21:24:31 +0100 RsGxsDataAccess filtered getters do not return all messages if none matches + 2ed6904d0 Gioacc Fri, 2 Nov 2018 00:53:32 +0100 gxschannels better debugging message + f6b22d25d Gioacc Thu, 1 Nov 2018 23:44:44 +0100 Fix typo in documentation + 7aaf29c3d Gioacc Thu, 1 Nov 2018 15:27:46 +0100 Fix compilation with Qt older then 5.7 + 367c5182c Gioacc Thu, 1 Nov 2018 14:51:57 +0100 Fix compilation with Qt older then 5.10 + ea86fe261 Gioacc Thu, 1 Nov 2018 07:04:01 +0100 Safer RsGxsChannel API + 8fd22c8fd Gioacc Mon, 29 Oct 2018 05:50:11 +0100 Safer rsGxsChannel API + 5e6970b64 Gioacc Fri, 9 Nov 2018 11:17:26 +0100 Merge branch 'v0.6.5' + 60b424eb6 G10h4c Fri, 9 Nov 2018 11:10:30 +0100 Merge pull request #1389 from G10h4ck/jsonapi + 5e6e9e03e G10h4c Fri, 9 Nov 2018 11:09:56 +0100 Merge pull request #1390 from G10h4ck/jsonapi + c073cc425 G10h4c Fri, 9 Nov 2018 11:09:21 +0100 Merge pull request #1397 from G10h4ck/htofix_rsGetHostByName_v0.6.5 + 18f4dbb9f csoler Thu, 8 Nov 2018 20:59:07 +0100 Merge pull request #1400 from sehraf/pr_small-DHT-fixes + a1f33e09e csoler Thu, 8 Nov 2018 20:53:34 +0100 Merge pull request #1398 from G10h4ck/htofix_rsGetHostByName_v0.6.5 + 2ebca7159 sehraf Thu, 8 Nov 2018 18:13:20 +0100 add missing DEFINE, fix small bugs + c4cbcf78f Gioacc Thu, 8 Nov 2018 13:14:29 +0100 Fix DNS resolution for hostnames that has also AAAA record + dfe7ebaa0 csoler Wed, 7 Nov 2018 23:11:52 +0100 fixed non working pause/cancel button in webUI + 07f63c82e csoler Wed, 7 Nov 2018 21:45:44 +0100 fixed typo causing FT to show blank for transfer completion in webUI + e9da9a555 csoler Wed, 7 Nov 2018 21:42:38 +0100 fixed typo causing FT to show NaN for transfer progress in webUI + d74f7bb61 csoler Tue, 6 Nov 2018 23:29:31 +0100 Merge pull request #1395 from RetroShare/v0.6.5 + cfb194a8e csoler Tue, 6 Nov 2018 23:28:54 +0100 Merge pull request #1392 from G10h4ck/hotfix_udp_crash + 09f92642d csoler Tue, 6 Nov 2018 20:55:10 +0100 removed memory leak in gxsnettunnel + f976e1c52 csoler Tue, 6 Nov 2018 20:38:35 +0100 removed memory leak in handlign of old chat lobby items + a3c81e163 Gioacc Tue, 6 Nov 2018 13:02:56 +0100 Fix compilation for ubuntu 18.04 LTS + d00d0816f Gioacc Mon, 5 Nov 2018 22:54:22 +0100 Use only BIO_METHOD pointer in openssl >= 1.1.0 + 18e02c9f4 Gioacc Mon, 5 Nov 2018 22:23:40 +0100 TOU avoid forging BIO_METHOD in openssl >= 1.1.0 + b54305d50 sehraf Mon, 5 Nov 2018 12:55:51 +0100 rename config option + 66dff9bf0 sehraf Mon, 5 Nov 2018 11:00:32 +0100 Add a build-time switch to set whether GXS distributes all available data or only sends data withint the configured sync period. + fb7cfcaa1 csoler Mon, 5 Nov 2018 18:53:31 +0100 Merge pull request #1394 from sehraf/pr_gxsSync + 81cad2ab0 Gioacc Mon, 5 Nov 2018 10:57:07 +0100 Fix missing include + 927403415 sehraf Mon, 5 Nov 2018 12:55:51 +0100 rename config option + 67cd2a140 sehraf Mon, 5 Nov 2018 11:00:32 +0100 Add a build-time switch to set whether GXS distributes all available data or only sends data withint the configured sync period. + 1ef987661 Gioacc Mon, 5 Nov 2018 00:20:33 +0100 Merge branch 'stacktrace_on_crash' into hotfix_udp_crash + c0ca1a5aa Gioacc Mon, 5 Nov 2018 00:19:45 +0100 Print stack trace on crash + 7d6fba7e8 Gioacc Sun, 4 Nov 2018 00:04:22 +0100 Attempt to fix crash in pqissludp + 56b31a0e2 csoler Sat, 3 Nov 2018 20:48:11 +0100 Merge pull request #1391 from RetroShare/v0.6.5 + d711e09b6 csoler Sat, 3 Nov 2018 20:24:24 +0100 fixed bug causing IdChooser to reset the current id + dccd40f77 csoler Fri, 2 Nov 2018 22:09:18 +0100 Merge pull request #1384 from hunbernd/fix/oldstuff + 1f8ecc024 csoler Fri, 2 Nov 2018 20:30:30 +0100 Merge pull request #1378 from csoler/v0.6-ImprovedGUI + 38a81047a csoler Fri, 2 Nov 2018 20:28:31 +0100 Merge pull request #1388 from RetroShare/v0.6.5 + af86b29f2 csoler Fri, 2 Nov 2018 20:26:49 +0100 moved initialization to initializer list in HomePage + eca4f8adf Gioacc Thu, 1 Nov 2018 23:26:42 +0100 JSON API to check if PGP id is friend + 4aedfddb9 csoler Thu, 1 Nov 2018 22:10:17 +0100 fixed bug in GRouter failing to set proper service ID in return receipts + 33b39a8be csoler Thu, 1 Nov 2018 22:05:22 +0100 removed uninitialized memory read in determination of own IP + cb5d24756 csoler Thu, 1 Nov 2018 21:45:59 +0100 removed unnecessry debug output from pqissl + eb078d462 csoler Thu, 1 Nov 2018 21:42:07 +0100 added more info to deserialization warning in rsrecogn + 9a2bbe339 csoler Thu, 1 Nov 2018 21:40:56 +0100 fixed uninitialized memory read due to not checking the result of beMsgGetNodeId() in bitdht + 84aedb8ac csoler Thu, 1 Nov 2018 20:28:09 +0100 removed uninitialized memory read in updateOwnCert() + f80b815b2 hunber Sun, 28 Oct 2018 22:25:26 +0100 Removed outdated instructions from readme + 74fcb5435 hunber Sun, 28 Oct 2018 22:16:01 +0100 Updated links in readme + d5d3830b6 hunber Sun, 28 Oct 2018 22:15:07 +0100 Removed version.html + 3ca13e141 hunber Sun, 28 Oct 2018 21:34:45 +0100 Removed some old build scripts + 3c6dd1af1 csoler Sun, 28 Oct 2018 17:45:21 +0100 removed unnecessary saving of config in p3turtle + 20391371c csoler Sun, 28 Oct 2018 17:29:35 +0100 fixed bug causing some GXS sync tunnels to remain unused and prevent new tunnels to be created + b603b9b4c G10h4c Sat, 27 Oct 2018 19:46:43 +0200 Merge pull request #1381 from G10h4ck/conservative_ext_port + e5805e904 Gioacc Wed, 24 Oct 2018 05:32:21 +0200 Avoid external port being reset without necessity + 966cd27cd G10h4c Wed, 24 Oct 2018 01:53:52 +0200 Merge pull request #1372 from PhenomRetroShare/Fix_Warnings + 89082f342 Phenom Sun, 14 Oct 2018 16:22:30 +0200 Fix warnings in RetroShareLink + 358f27be0 Phenom Sat, 13 Oct 2018 15:50:14 +0200 Fix warnings in MessagePage.cpp + a30e2c340 Phenom Mon, 8 Oct 2018 19:27:48 +0200 Fix Warnings in MouseEventFilter.cpp + da6778934 Phenom Mon, 8 Oct 2018 18:56:17 +0200 Fix Warnings in rsloginhandler.cc + be1f2f7a3 G10h4c Mon, 22 Oct 2018 00:29:55 +0200 Merge pull request #1379 from G10h4ck/jsonapi + e746b5b4a Gioacc Mon, 22 Oct 2018 00:24:02 +0200 JSON API unauthenticated access to /rsAccounts/getCurrentAccountId + 6543d713e Gioacc Sun, 21 Oct 2018 17:12:13 +0200 JSON API import/export PGP key to file + 7a1375ff6 Gioacc Sat, 20 Oct 2018 21:13:10 +0200 rsPeers add few JSON API calls + 7d21e74b2 csoler Sat, 20 Oct 2018 17:48:36 +0200 added explicit options to including IP history and removed iP history from RS Links as it leaks information without users consent + 259264897 csoler Sat, 20 Oct 2018 17:34:57 +0200 changed lobby for "chat rooms" in settings + d97551aa3 csoler Sat, 20 Oct 2018 17:31:52 +0200 added option to not include external IPs in preferences->node->certificate + 395cf57ec csoler Sat, 20 Oct 2018 14:48:11 +0200 merged upstream/master + cfe95a57a csoler Sat, 20 Oct 2018 14:47:37 +0200 Merge pull request #1377 from G10h4ck/jsonapi + 9e632ce99 csoler Sat, 20 Oct 2018 14:42:58 +0200 Merge pull request #1375 from csoler/v0.6-GxsFix2 + ff92b36aa csoler Sat, 20 Oct 2018 14:14:44 +0200 Merge pull request #7 from G10h4ck/csoler-v0.6-GxsFix2 + 2d497d730 Gioacc Sat, 20 Oct 2018 14:07:39 +0200 Fix compilation with deep search and rm dead code + aca29e3ea Gioacc Sat, 20 Oct 2018 13:51:11 +0200 Merge branch 'v0.6-GxsFix2' of https://github.com/csoler/RetroShare into csoler-v0.6-GxsFix2 + b5dbdcb60 csoler Sat, 20 Oct 2018 13:51:01 +0200 fixed compilation of web UI files on linux + 5699d81ae Gioacc Sat, 20 Oct 2018 13:39:13 +0200 GXS deep search notify results also of known groups + abcd68741 csoler Fri, 19 Oct 2018 22:05:29 +0200 Merge pull request #1374 from csoler/v0.6-ImprovedGUI + 450ed27b1 G10h4c Fri, 19 Oct 2018 16:36:11 +0200 Merge pull request #1376 from G10h4ck/jsonapi + 9e2c4ce49 Gioacc Fri, 19 Oct 2018 15:10:15 +0200 JSON API authorize token in createLocation + 945775e9f Gioacc Thu, 18 Oct 2018 04:21:23 +0200 Fix deep search compiling on 32bit time_t targets + 9b4c48c54 csoler Tue, 16 Oct 2018 22:40:27 +0200 created a connexion between token and meta data of created posts and grps + 21a92d69b csoler Tue, 16 Oct 2018 20:51:10 +0200 merged upstream/master + 2bb24075c Gioacc Tue, 16 Oct 2018 16:19:23 +0200 Print warning also when serializing negative rstime_t + 03cdd6c7b G10h4c Tue, 16 Oct 2018 16:06:09 +0200 Merge pull request #1363 from G10h4ck/jsonapi + 37c515bcb csoler Mon, 15 Oct 2018 20:57:21 +0200 patch from sss to fix deadlocks on forum fill thread. To be tested + 617ed25a1 thunde Sat, 13 Oct 2018 13:19:22 +0200 Modified Windows Build Environment - Removed commandline switch "version" - Added MinGit for determining version information during compile process - Added sigcheck to determine version of the executable + c7563f1ef thunde Sun, 14 Oct 2018 15:23:54 +0200 Fixed Windows compile with MSYS2 + 6e1de5b5e thunde Fri, 12 Oct 2018 13:52:19 +0200 Fixed Windows compile with MinGW + fae02741d csoler Sun, 14 Oct 2018 15:00:09 +0200 Merge pull request #1370 from sehraf/pr_remove-debug-output + bbf855fef csoler Sat, 13 Oct 2018 23:00:29 +0200 Merge pull request #1371 from csoler/v0.6-BugFixing + 74022a5e1 csoler Sat, 13 Oct 2018 22:59:26 +0200 fixed bug in recent commit that broke turtle generic search + 15b729b35 Gioacc Fri, 12 Oct 2018 22:28:44 +0200 Fix crash in p3Peers::loadCertificateFromString + 9c90b32de csoler Fri, 12 Oct 2018 22:19:07 +0200 fixed dangerous memcpy in RsTurtleGenericSearchResultItem::clone() function + e6febe029 sehraf Fri, 12 Oct 2018 18:20:55 +0200 remove debug output + fc14300b0 Gioacc Wed, 10 Oct 2018 23:43:01 +0200 Re-add ftServer::requestDirDetails implementation + b3d73ba6a Gioacc Wed, 10 Oct 2018 23:32:32 +0200 Suppress aliasing warning in DirDetails and DirStub + 047ae7f72 G10h4c Wed, 10 Oct 2018 22:23:28 +0200 Merge branch 'master' into jsonapi + 18eee374f csoler Wed, 10 Oct 2018 22:04:32 +0200 Merge pull request #1361 from sehraf/pr_jsonfy-rsMsg + 09b109d52 csoler Wed, 10 Oct 2018 22:03:51 +0200 Merge pull request #1364 from G10h4ck/safer_time + a47eec14e Gioacc Wed, 10 Oct 2018 21:54:50 +0200 Print a warning if deserialized rstime_t is negative + 321fc8a8d Gioacc Wed, 10 Oct 2018 06:40:56 +0200 Implement mostly decent JSON API for channels and post creation + c05c37635 Gioacc Tue, 9 Oct 2018 22:58:17 +0200 Expose /rsFiles/requestDirDetails via JSON API + 2139090f5 Gioacc Tue, 9 Oct 2018 22:43:15 +0200 Fix bug in JSON t_RsFlags32 deserialization + 205743e0f Gioacc Tue, 9 Oct 2018 18:14:23 +0200 retroshare-service add missing doxygen dependency on OBS + 74129f670 Gioacc Tue, 9 Oct 2018 18:06:21 +0200 jsonwrappersincl target always fails if doxygen fail + 7798e5012 Gioacc Tue, 9 Oct 2018 01:09:25 +0200 Expose JSON API for ForceDirectoryCheck + 406822b5e Gioacc Tue, 9 Oct 2018 00:55:32 +0200 Expose JSON API for file filtering + 2556af692 Gioacc Mon, 8 Oct 2018 23:56:05 +0200 Add OBS packaging recipes for retroshare-service + a89c29030 Gioacc Mon, 8 Oct 2018 11:56:47 +0200 Add missing rstime include in jsonapi + b8af13f0b G10h4c Sun, 7 Oct 2018 22:29:42 +0200 Merge pull request #3 from hunbernd/fix/win64 + b7d5944b9 hunber Sun, 7 Oct 2018 21:53:16 +0200 Fix building error about losing precision on Win x64 + 6db23267c Gioacc Sun, 7 Oct 2018 14:34:28 +0200 retroshare-gui fix windows compilation error due to time_t usage + 72d836437 Gioacc Sun, 7 Oct 2018 14:03:27 +0200 libresapi fix compile error on windows due to time_t usage + ddf316454 Gioacc Sun, 7 Oct 2018 13:41:04 +0200 Fix ctime(&rstime_t) error on windows + 77d938bf5 Gioacc Sun, 7 Oct 2018 13:07:22 +0200 Remove _USE_32BIT_TIME_T windows define + 329050a9c Gioacc Sun, 7 Oct 2018 01:34:05 +0200 Use safer rstime_t instead of time_t + 137bd9cd6 sehraf Sat, 6 Oct 2018 23:50:29 +0200 jsonapi: fix nested std types + f5158b3a9 Gioacc Tue, 25 Sep 2018 22:33:35 +0200 Allow CORS in JsonApiServer + 8f17270a2 Gioacc Sat, 6 Oct 2018 18:49:17 +0200 Fix type in .pri breaking non-cross-compiling + 586cff2ad csoler Sat, 6 Oct 2018 18:33:13 +0200 Merge pull request #1362 from csoler/v0.6-ImprovedGUI + 045691855 csoler Sat, 6 Oct 2018 18:31:33 +0200 Merge pull request #1356 from PhenomRetroShare/Fix_Warnings + 47df24b82 Gioacc Sat, 6 Oct 2018 02:49:13 +0200 Fix compilation due to .pro copy/paste error + c6ca3c566 Gioacc Sat, 6 Oct 2018 02:46:09 +0200 Fix compilation due to RsPeers::GetRetroshareInvite + 41aa675a9 G10h4c Sat, 6 Oct 2018 02:41:35 +0200 Avoid travis breakage due to outdated qt55 depend + 2b3570903 Gioacc Sat, 6 Oct 2018 01:23:08 +0200 retroshare-service deep search support for Android + b28512b88 Gioacc Fri, 5 Oct 2018 22:29:49 +0200 retroshare-service now build and runs fine on android (even older ones) + ec8e8ebaf csoler Fri, 5 Oct 2018 21:38:36 +0200 fixed merging with upstream/master + dbd52c0c9 csoler Fri, 5 Oct 2018 17:01:54 +0200 fixed bug in previous commit + 4de049820 csoler Fri, 5 Oct 2018 16:54:36 +0200 fixed bad signature checking code for config files + 1d8bb4481 Gioacc Fri, 5 Oct 2018 01:55:18 +0200 Fix warnings + 341a68ce0 Gioacc Fri, 5 Oct 2018 01:23:17 +0200 rstypeserializer fix uninitialized variable usage + 0f01f110a Gioacc Thu, 4 Oct 2018 23:37:39 +0200 jsonapi-generator fix param initialization on Android + 321d2e84b Gioacc Thu, 4 Oct 2018 23:36:01 +0200 gxschannel expose blocking create post and channels API + 6dabb81dc sehraf Thu, 4 Oct 2018 23:25:23 +0200 rsMsg: unify parameter name + 500eb7f51 sehraf Thu, 4 Oct 2018 23:24:06 +0200 jsonapi: add rsMsg tagging functions + 897c8e0a8 sehraf Thu, 4 Oct 2018 21:26:03 +0200 jsonapi: more rsMsg functions + 70678ad50 sehraf Thu, 4 Oct 2018 22:42:34 +0200 jsonapi: fix std::map + 150af40e0 sehraf Wed, 3 Oct 2018 21:52:54 +0200 jsonapi: convert and add getMessageCount + 285158db5 sehraf Wed, 3 Oct 2018 21:34:55 +0200 jsonapi: access messages (mail) + 184fac95a Gioacc Thu, 4 Oct 2018 22:12:23 +0200 Fix deep_search enable/disable at build time + c6d020355 csoler Thu, 4 Oct 2018 19:22:49 +0200 added debug output to see which config files are loaded/saved + fb21e427b csoler Thu, 4 Oct 2018 19:14:21 +0200 removed saving of GxsTrans configuration in class destructor, causing lock up when quitting RS + 7c986b926 Gioacc Thu, 4 Oct 2018 19:14:16 +0200 Remove overloaded GetRetroshareInvite method + 6c4d1c34e csoler Thu, 4 Oct 2018 18:49:27 +0200 fixed removal of "share on channel"/"share on forum" menu entries in own files + 7cc15c703 Gioacc Wed, 3 Oct 2018 19:05:02 +0200 Fix forward declarations class struct missmatch + e6e5700ed Gioacc Wed, 3 Oct 2018 19:04:02 +0200 Fix warning caused by clang defining _GNUC_ + f26a0c793 Gioacc Wed, 3 Oct 2018 18:17:29 +0200 jsonapi-generator Fix warning that cause errors on mageia + 8f3f2cd7c Gioacc Wed, 3 Oct 2018 15:53:18 +0200 retroshare-service improve building process + 9c493453c csoler Wed, 3 Oct 2018 15:28:37 +0200 Merge pull request #1358 from csoler/v0.6-ImprovedGUI + 81fc3b792 csoler Wed, 3 Oct 2018 15:25:53 +0200 select GxsIds as default list to chose msg destination from + 64f1d7867 csoler Wed, 3 Oct 2018 15:07:50 +0200 Merge pull request #1357 from csoler/v0.6-ImprovedGUI + 83a987936 csoler Wed, 3 Oct 2018 15:02:37 +0200 when replying to a msg, always select an ID to author the msg that was in the destination list + d401fdfb4 Phenom Sun, 30 Sep 2018 14:31:53 +0200 Fix Gcc Warning: + 6ef72f551 Phenom Wed, 14 Feb 2018 19:24:24 +0100 Fix Gcc Warning in authssl.cc + 1839d23df Phenom Thu, 15 Feb 2018 16:51:35 +0100 Fix Gcc Warning hashstream.h + 79a8b2183 csoler Sun, 30 Sep 2018 13:31:26 +0200 Merge pull request #1353 from csoler/v0.6-FileLists + 3d0ad54f1 csoler Sat, 29 Sep 2018 20:33:32 +0200 Merge pull request #1352 from PhenomRetroShare/Fix_Warnings + 0ef47e25c csoler Sat, 29 Sep 2018 20:30:31 +0200 Merge pull request #1355 from Josep-San/GUI_Upload_Header_Context-Menu + 443dbdfbe csoler Sat, 29 Sep 2018 19:04:23 +0200 fixed small bug breaking display of flat mode in files + 0078501db Gioacc Sat, 29 Sep 2018 00:15:10 +0200 Initial work on a RetroShare cross-platform service + 4578b4403 Josep- Fri, 28 Sep 2018 15:38:39 +0200 Added context menu for Upload list headers to hide/show columns. + 752275f81 csoler Thu, 27 Sep 2018 22:14:00 +0200 fixed various display bugs in extra file list + 54ec49dc0 csoler Thu, 27 Sep 2018 21:56:41 +0200 make extra shared file list appear only when non empty + e1698429d csoler Thu, 27 Sep 2018 21:46:00 +0200 fixed display of size + 2610f62e4 csoler Thu, 27 Sep 2018 21:42:21 +0200 fixed display of temporary shared file text + c77a28c17 csoler Thu, 27 Sep 2018 21:20:06 +0200 added proper notification when removing an extra file + 7ab7c7db9 csoler Thu, 27 Sep 2018 16:53:08 +0200 added possibility to remove extra shared file + 138384636 csoler Thu, 27 Sep 2018 13:42:49 +0200 added extra list view in own files. + a6e3273ec Phenom Wed, 26 Sep 2018 18:02:04 +0200 Fix qmake double use_libretroshare.pri + aec68c226 Phenom Wed, 26 Sep 2018 17:55:58 +0200 Fix qmake double using retroshare.pri + 590edb72f Phenom Wed, 26 Sep 2018 17:44:32 +0200 Fix qmake warnings: + f420bb464 Phenom Wed, 26 Sep 2018 17:36:33 +0200 Fix qmake warnings: + 359e11433 Gioacc Tue, 25 Sep 2018 20:09:06 +0200 jsonapi-generator add missing include + f09bef2ac G10h4c Tue, 25 Sep 2018 18:10:16 +0200 Merge pull request #1349 from G10h4ck/jsonapi + 95e0fd338 Gioacc Tue, 25 Sep 2018 17:15:06 +0200 JsonApiServer::isAuthTokenValid avoid timing attack + 1e32c1db0 csoler Mon, 24 Sep 2018 21:03:01 +0200 Merge pull request #1346 from csoler/v0.6-ImprovedGUI + 57577472f csoler Mon, 24 Sep 2018 20:55:27 +0200 added tooltip to show identity ID in distant chat dialog + 5eda5a5bc csoler Mon, 24 Sep 2018 20:26:36 +0200 changed "lobby" into "chat room" in chat room info panel + ccabf82e6 Gioacc Fri, 21 Sep 2018 01:58:38 +0200 retroshare-gui now handle JsonApiServer too + d26912ebd G10h4c Fri, 21 Sep 2018 12:26:50 +0200 Merge pull request #1350 from zapek/jsonapi_windows_fix + 1c7f02655 Gioacc Fri, 21 Sep 2018 01:40:26 +0200 Fix crash at startup if jsonapi not enabled + bf9816619 Gioacc Fri, 21 Sep 2018 01:39:48 +0200 RsServer fix crash on stop if shutdown callback not set + dc926d30c zapek Thu, 20 Sep 2018 23:29:36 +0200 links with wsock32 only if the jsonapi is built + 458a8b087 zapek Thu, 20 Sep 2018 22:24:05 +0200 fixed JSONAPI build for Windows + 5a63030d7 G10h4c Thu, 20 Sep 2018 12:39:02 +0200 Merge pull request #1348 from zapek/windows_compilation_fix + 8f88a9290 zapek Thu, 20 Sep 2018 10:48:46 +0200 added some comments to explain the issue + add97dede Gioacc Wed, 19 Sep 2018 22:02:07 +0200 p3face include jsonapi.h only if enabled + eb77f921e Gioacc Wed, 19 Sep 2018 21:28:26 +0200 Implement JSON API HTTP Basic authentication + ab80999ca zapek Wed, 19 Sep 2018 15:51:09 +0200 fixed compilation on Windows/MSYS2 + 9a09e209e csoler Tue, 18 Sep 2018 22:02:18 +0200 added context menu entry to only show current IPs instead of all known IPs + 3c61190b4 csoler Tue, 18 Sep 2018 21:20:55 +0200 fixed context menu in Home->cert + f2514d13e csoler Mon, 17 Sep 2018 23:03:11 +0200 added tooltip for certificates in Home + ac9350d37 G10h4c Sat, 15 Sep 2018 22:23:35 +0200 Merge pull request #1339 from sehraf/pr_remove-add-peer-open-code + 43bc80de8 Gioacc Sat, 15 Sep 2018 21:53:46 +0200 JSON API export version extra too + cd03953b1 Gioacc Sat, 15 Sep 2018 21:07:03 +0200 Provide meaningful devault value in rsversion.h + 4f4e2d2bb Gioacc Sat, 15 Sep 2018 20:57:28 +0200 More robust automatic version determination + dde9acb40 G10h4c Sat, 15 Sep 2018 19:44:25 +0200 Merge pull request #1343 from hunbernd/fix/deprecatedversinioningscript + 05537d89c hunber Sat, 15 Sep 2018 18:21:02 +0200 Added warning instead of running the version_detail script + eece958aa G10h4c Sat, 15 Sep 2018 17:59:09 +0200 Merge pull request #1340 from sehraf/pr_remove-obsolete-version-scripts + 0917dc253 csoler Sat, 15 Sep 2018 14:42:17 +0200 Merge pull request #1342 from sehraf/pr_add-TLSv1.3 + 0b6644cd5 sehraf Sat, 15 Sep 2018 14:38:57 +0200 get rid of unused variables + 1e85b05f0 sehraf Sat, 15 Sep 2018 14:30:23 +0200 get rid of cipher_version variable. use plain output from openssl + 3c19a3929 csoler Fri, 14 Sep 2018 22:15:31 +0200 Merge pull request #1338 from sehraf/pr_add-TLSv1.3 + 928958690 sehraf Fri, 14 Sep 2018 17:05:57 +0200 remove unused variable + 1faaf91eb sehraf Fri, 14 Sep 2018 17:01:52 +0200 G10h4ck said that there are obsolete since #1336 and should not be used anymore. + dd36f8103 sehraf Fri, 14 Sep 2018 16:58:18 +0200 @G10h4ck reimplemented the code to add a peer with location and IPs in acceptInvite(). Remove the redundant code and use the new function for importFriendlist(). + 7ce2bef37 sehraf Fri, 14 Sep 2018 16:27:50 +0200 add support for displaying TLSv1.3 + 7784660d6 G10h4c Fri, 14 Sep 2018 13:25:42 +0200 Merge pull request #1337 from G10h4ck/jsonapi + d1804b480 G10h4c Fri, 14 Sep 2018 13:24:14 +0200 Merge pull request #1336 from G10h4ck/rs_version + d676ba393 Gioacc Thu, 13 Sep 2018 01:46:55 +0200 retroshare-nogui print message if JSON API is active + 148e46346 Gioacc Wed, 12 Sep 2018 23:40:34 +0200 JSON API accessible via HTTP GET method + 3d476f689 Gioacc Wed, 12 Sep 2018 20:06:52 +0200 Travis CI increase clone depth to get some tag for git describe + 4a43c254f Gioacc Wed, 12 Sep 2018 11:32:10 +0200 appveyor increase clone depth to get some tag for git describe + 828ff0f30 Gioacc Wed, 12 Sep 2018 01:22:24 +0200 Fix some compilation error on Windows + 1694e37c5 Gioacc Wed, 12 Sep 2018 01:06:36 +0200 More fixes to JSON API + 524576596 Gioacc Wed, 12 Sep 2018 00:35:42 +0200 JSON API expose retroshare version + 92f90178c Gioacc Wed, 12 Sep 2018 00:33:29 +0200 RS version is now parametrizable at compile time + 5495f43c5 Gioacc Wed, 12 Sep 2018 00:31:16 +0200 Fix RsServiceControl::getServiceItemNames doc + b13826387 csoler Tue, 11 Sep 2018 15:17:33 +0200 Merge pull request #1323 from csoler/v0.6-ForumAdmin + c17b821ea csoler Mon, 10 Sep 2018 20:39:29 +0200 Merge pull request #1334 from csoler/v0.6-GxsFix + 428c2670f csoler Mon, 10 Sep 2018 20:29:48 +0200 fixed sorting for posts with children using a more appropriate flag for pinned posts + 2b80c23f6 csoler Mon, 10 Sep 2018 20:03:47 +0200 fixed according to comments on PR 1334 + cb83abf93 G10h4c Mon, 10 Sep 2018 00:29:07 +0200 Merge pull request #1335 from sehraf/pr_jsonfy + 247c36827 sehraf Sun, 9 Sep 2018 22:21:18 +0200 incorporated requested changes + 59a76a941 csoler Sun, 9 Sep 2018 21:22:08 +0200 fixed checking of signature for own ids when loading in cache + 06fdaa403 csoler Sun, 9 Sep 2018 09:55:34 +0200 fixed sorting of pinned posts in "Lastest post in thread" mode + ae6a5c74d sehraf Sat, 8 Sep 2018 16:46:28 +0200 add rsPeer groups to jsonapi + 5a961179f sehraf Sat, 8 Sep 2018 09:48:27 +0200 unify parameter names + 31b0f67e9 sehraf Sat, 8 Sep 2018 09:47:45 +0200 jsonfy RsServiceControl + 9306d8ccc sehraf Sat, 8 Sep 2018 08:58:42 +0200 drop deprecated function + f34d02138 sehraf Sat, 8 Sep 2018 08:57:07 +0200 make rs use the new function + ae14a01d5 sehraf Fri, 7 Sep 2018 14:19:06 +0200 add json support to getWaitingDiscCount + be5040011 sehraf Fri, 7 Sep 2018 14:17:44 +0200 jsonfy rsDisc + fb8e49ee6 sehraf Fri, 7 Sep 2018 12:58:30 +0200 jsonjy rsConfig + 76d16f61e csoler Thu, 6 Sep 2018 22:14:17 +0200 fixed crash when no item to unban is actually selected in Banned files list + ce5778cb8 csoler Thu, 6 Sep 2018 21:23:21 +0200 Merge pull request #1332 from sehraf/pr_tiny-fix + 3402f7d9b csoler Thu, 6 Sep 2018 21:15:25 +0200 auto send of own signed GXS ids to friends in discovery + 39c07f4ef sehraf Wed, 5 Sep 2018 15:46:59 +0200 make p3GxsTrans a class + fe5e83125 csoler Thu, 6 Sep 2018 11:46:52 +0200 Merge pull request #1333 from csoler/v0.6-ImprovedGUI + e01cf95dd csoler Thu, 6 Sep 2018 11:46:04 +0200 fixed display of 1 chunk transfers + 59b375477 csoler Thu, 6 Sep 2018 10:47:05 +0200 fixed new position of pinned post, and forbid pinning up non top level posts + 59887124a csoler Thu, 6 Sep 2018 10:17:50 +0200 fixed transmission of pinned posts when a forum is edited + b17d2a3ac csoler Thu, 6 Sep 2018 08:39:30 +0200 Merge pull request #1331 from G10h4ck/jsonapi + ddc1f462d Gioacc Thu, 6 Sep 2018 02:05:29 +0200 retroshare-android-service better debug message + 2c8aa5a1f Gioacc Thu, 6 Sep 2018 02:04:48 +0200 RsAccounts::getCurrentAccountId is now static + 4a309b827 csoler Wed, 5 Sep 2018 21:00:34 +0200 fixed compilation with libressl2.7 (patch from sss, modified) + aa03cc00d Gioacc Wed, 5 Sep 2018 12:55:32 +0200 Temporarily disable qmake step on Travis CI OS X + 72d220b2c Gioacc Wed, 5 Sep 2018 00:18:07 +0200 Merge branch 'master' into jsonapi + 7787f9d62 Gioacc Wed, 5 Sep 2018 00:17:21 +0200 Merge branch 'master' into jsonapi + a194e4cf5 Gioacc Wed, 5 Sep 2018 00:08:56 +0200 Make JSON API server bind address configurable + 703d70962 csoler Tue, 4 Sep 2018 20:53:30 +0200 updated ubuntu changelog + 1392c7c6f csoler Tue, 4 Sep 2018 20:21:42 +0200 prevent editing of pinned posts + d856566c6 csoler Mon, 3 Sep 2018 22:02:32 +0200 added comment in the post sorting code + 69c6860d8 csoler Mon, 3 Sep 2018 21:58:31 +0200 removed debug output + 37b53033d csoler Mon, 3 Sep 2018 21:55:26 +0200 fixed sorting with pinned posts + 68e130a1f Gioacc Mon, 3 Sep 2018 15:12:23 +0200 Temporarily disable Travis CI Mac OS X build + 59535eac8 csoler Sun, 2 Sep 2018 17:07:40 +0200 added a flag for moderating messages to help removign them when the author is not a moderator anymore + e7d721b3d csoler Sat, 1 Sep 2018 18:40:28 +0200 ensure pinned posts always stay grouped together + 4acbf775a Gioacc Sat, 1 Sep 2018 16:16:15 +0200 retroshare-android-service can be built without libresapi + 7f7431355 Gioacc Sat, 1 Sep 2018 15:54:11 +0200 JSON API close restbed session before shutting down + 7a37c11e4 Gioacc Sat, 1 Sep 2018 15:29:09 +0200 Prevent crash calling uninitialized service via JSON API + cc6f0b1f0 Gioacc Thu, 30 Aug 2018 21:41:15 +0200 Expose RsPeers JSON API + a8ddec03f Gioacc Thu, 30 Aug 2018 19:06:20 +0200 Expose more login related JSON API + a9b1a15b4 Gioacc Thu, 30 Aug 2018 19:02:50 +0200 jsonapi-generator handle multiple services per file + 5c2f714ad csoler Thu, 30 Aug 2018 14:50:16 +0200 merged with upstream/master + 380ebf2a5 csoler Thu, 30 Aug 2018 14:07:14 +0200 added UI to pin up posts + e5f65e950 csoler Thu, 30 Aug 2018 11:48:37 +0200 added login to pin up posts + e12c17c6f csoler Thu, 30 Aug 2018 11:08:49 +0200 added show of moderators in forum details + 4c076b60a csoler Thu, 30 Aug 2018 10:54:52 +0200 added proper initializing of existing moderators + + -- Retroshare Dev Team Thu, 18 Dec 2018 22:00:00 +0100 + +retroshare (0.6.4-1.20180904.703d7096~bionic) bionic; urgency=low + + 910aea7 csoler Wed, 29 Aug 2018 22:10:58 +0200 Merge pull request #1325 from csoler/v0.6-ContentFiltering + 65304a3 csoler Tue, 28 Aug 2018 23:57:16 +0200 added last relay (a.k.a which direct friend) of search results in sources column + c9b30f5 csoler Tue, 28 Aug 2018 23:42:24 +0200 fixed merged with upstream/master + b09eb57 csoler Tue, 28 Aug 2018 23:16:35 +0200 fixed small bug in deletion of banned file + 2be556c G10h4ck Tue, 28 Aug 2018 19:55:36 +0200 Merge pull request #1318 from zapek/msys2_build_fix + c294971 csoler Tue, 28 Aug 2018 19:11:08 +0200 Merge pull request #1289 from G10h4ck/jsonapi + dd55dde Gioacch Tue, 28 Aug 2018 15:20:41 +0200 Add more consistency checks to serialization code + 3094146 Gioacch Tue, 28 Aug 2018 14:35:29 +0200 RsLoginHelper::attemptLogin clear cached passphrase after usage + 4bc6919 Gioacch Tue, 28 Aug 2018 14:19:41 +0200 Friendly android-service build error if wrong compile options + 75e882b Gioacch Tue, 28 Aug 2018 14:12:09 +0200 Make NotifyClient class again + 40c2a8e Gioacch Tue, 28 Aug 2018 14:05:02 +0200 Improve JSON API documentation following Cyril suggestion + 5f18d26 csoler Mon, 27 Aug 2018 23:36:07 +0200 removed unused member depth from search results to avoid confusion while ensureing backward compatibility is kept + fd25f83 csoler Mon, 27 Aug 2018 10:56:29 +0200 Merge pull request #1329 from sehraf/pr_small-fixes + 1dfe644 Gioacch Sun, 26 Aug 2018 11:39:26 +0200 Improve documentation + 4530691 Gioacch Sat, 25 Aug 2018 23:31:16 +0200 Update Appveyod build badge + 8fd903a Gioacch Sat, 25 Aug 2018 22:25:36 +0200 Improve JSON API documentation + e878ba9 Gioacch Sat, 25 Aug 2018 22:24:49 +0200 Add support for default parameters value in jsonapi-generator + 2fab33d csoler Sat, 25 Aug 2018 20:52:06 +0200 fixed a few bugs in ban file list management + b5eabf7 csoler Sat, 25 Aug 2018 20:18:54 +0200 improved banned files UI and fixed deadlock + 85c3332 Gioacch Sat, 25 Aug 2018 19:13:34 +0200 Add JSON API support to retroshare-nogui + c14d898 csoler Sat, 25 Aug 2018 18:44:29 +0200 added some debug info to file control system and fixes a problem with sending TS + f5d306c Gioacch Sat, 25 Aug 2018 18:39:32 +0200 Made JSON API port configurable from retroshare-gui + b2bbd66 G10h4ck Sat, 25 Aug 2018 18:35:52 +0200 Merge pull request #1328 from csoler/v0.6-FT + 41f7235 G10h4ck Sat, 25 Aug 2018 18:05:56 +0200 Merge pull request #2 from sehraf/pr_improve_json + c50405c Gioacch Sat, 25 Aug 2018 17:58:04 +0200 Expose /rsFiles/turtleSearchRequest via JSON API + 9557a52 sehraf Sat, 25 Aug 2018 17:54:34 +0200 remove unnecessary locking, print log entries also to stdout + fe22465 sehraf Sat, 25 Aug 2018 17:53:30 +0200 fix proxy indicators not being updated + c754435 sehraf Sat, 25 Aug 2018 17:10:01 +0200 fix deserialisation and improve PRINT job + a8b2532 Gioacch Sat, 25 Aug 2018 17:04:42 +0200 Fix warning #pragma once used in main file + 588295e sehraf Sat, 25 Aug 2018 16:52:46 +0200 make RsGroupInfo serializable + 4d03b90 sehraf Sat, 25 Aug 2018 16:51:49 +0200 convert values properly to string + 31f0a42 Gioacch Sat, 25 Aug 2018 16:14:42 +0200 Merge branch 'csoler/v0.6-FT' into jsonapi + b98246e Gioacch Sat, 25 Aug 2018 00:19:26 +0200 Fix location creation via JSON API + 8eebe53 csoler Fri, 24 Aug 2018 16:12:05 +0200 moved UI notification for turtle FT search results into ftServer, in order to allow easier libresAPI calls + afb9299 Gioacch Fri, 24 Aug 2018 00:31:25 +0200 Enable JSON conversion for RsGxsImage via MemBlockProxy + afeb408 Gioacch Thu, 23 Aug 2018 22:38:21 +0200 Expose more RsFiles via JSON API + 4d30d4f Gioacch Thu, 23 Aug 2018 15:47:01 +0200 Avoid cloning huge unused restbed openssl dependency + 18feb23 Gioacch Thu, 23 Aug 2018 14:20:24 +0200 Suggest shallow submodules for jsonapi dependencies + 3b72f91 Gioacch Thu, 23 Aug 2018 01:39:26 +0200 Improve API + 3055897 csoler Wed, 22 Aug 2018 21:57:56 +0200 added filter in p3turtle against banned hashes in tunnel requests and search results + ab6a5c0 Gioacch Wed, 22 Aug 2018 17:22:27 +0200 RsLoginHelper::createLocation expose capability of creating hidden locations + 8f7bacb Gioacch Wed, 22 Aug 2018 17:00:22 +0200 Remove #pragma once in .cc file + 396fe49 Gioacch Wed, 22 Aug 2018 16:59:42 +0200 Merge branch 'master' into jsonapi + 3654646 csoler Tue, 21 Aug 2018 11:20:02 +0200 added load/save of banned files and handling of banned files information from friends + 0b176a0 csoler Mon, 20 Aug 2018 23:30:05 +0200 added sending of banned file info + e5e5660 csoler Sun, 19 Aug 2018 21:11:17 +0200 added logic to compute ban list from friend nodes and own opinions + af75566 csoler Sun, 19 Aug 2018 15:52:35 +0200 added option whether to trust friend nodes for banned files + a2804a7 csoler Sun, 19 Aug 2018 15:09:43 +0200 added context menu and removal feature for banned files + fe8c2c4 Gioacc Thu, 16 Aug 2018 23:51:35 +0200 Merge branch 'jsonapi' of github.com:G10h4ck/RetroShare into jsonapi + 4b6f751 Gioacch Thu, 16 Aug 2018 23:34:29 +0200 Implement JSON API generation for async API calls + a7ee854 csoler Thu, 16 Aug 2018 23:18:29 +0200 added fill routine for banned files list + e17c4d0 csoler Thu, 16 Aug 2018 22:22:47 +0200 added a dialog to edit banned files + 50e03a5 csoler Thu, 16 Aug 2018 18:49:36 +0200 basic infrastructure for banning unwanted file content + b7f5d42 Gioacch Thu, 16 Aug 2018 14:26:41 +0200 RsGxsNetService::receiveTurtleSearchResults fix deadlock + 7bdc61e thunder Thu, 14 Jun 2018 14:22:23 +0200 Added Windows build environment with MSYS2 + 1eed404 thunder Sun, 17 Jun 2018 17:51:58 +0200 Optimized Windows build environment + 93ab975 csoler Mon, 6 Aug 2018 22:59:37 +0200 reverted commit 5925aa06fed41e770630811dd4d5d021882b7ae7 by request from Phenom + 51bcb81 G10h4ck Fri, 3 Aug 2018 22:09:02 +0200 Merge pull request #1316 from zapek/master + 0b821a4 zapek Fri, 3 Aug 2018 21:29:00 +0200 changed to use CONFIG+=rs_autologin for the windows build instructions instead of setting defines + 146f920 zapek Fri, 3 Aug 2018 21:21:53 +0200 changed win32-x to appveyor + 2848359 zapek Fri, 3 Aug 2018 20:09:32 +0200 fixed webui files generation under MSYS2 + 8088550 zapek Fri, 3 Aug 2018 19:33:09 +0200 removed the note about the build possibly failing while generating the webui files because I have a fix that I will commit next + 4a961a8 csoler Fri, 3 Aug 2018 18:32:59 +0200 Merge pull request #1310 from PhenomRetroShare/Fix_DisableCMarkButton + fabd181 csoler Fri, 3 Aug 2018 17:40:16 +0200 Merge pull request #1315 from PhenomRetroShare/Fix_AppVeyorCompil + ce39f4d zapek Fri, 3 Aug 2018 15:15:17 +0200 added a working procedure to compile on Windows using MSYS2 + cc51298 csoler Thu, 2 Aug 2018 14:13:14 +0200 fixed warning about badly overloaded function in rsexpr.h + f21d35b Phenom Thu, 2 Aug 2018 00:39:45 +0200 Fix AppVeyor Compilation + 985be35 csoler Wed, 1 Aug 2018 23:04:20 +0200 fixed compilation with RS_AUTO_LOGIN + 77d5dfe csoler Wed, 1 Aug 2018 20:48:55 +0200 Merge pull request #1311 from sehraf/pr_improve_service_id + 97194fd sehraf Wed, 1 Aug 2018 20:30:28 +0200 Add wrapper function to convert uint16_t service IDs to internal unsigned int. Use it when looking up service names. + 50867d2 csoler Wed, 1 Aug 2018 20:31:48 +0200 fixed clicking on external url in MessageWidget + 5f66a45 Phenom Wed, 1 Aug 2018 18:40:40 +0200 Disable CMark Button on ChatWidget if not defined. + 0d4eafd csoler Tue, 31 Jul 2018 18:08:24 +0200 fixed compilation on ubuntu with xapian + c948517 csoler Tue, 31 Jul 2018 14:18:24 +0200 Merge pull request #1306 from csoler/v0.6-TorOnly + ecd4521 csoler Tue, 31 Jul 2018 14:13:01 +0200 disallow empty file when loading shared file list in order to avoid malloc of size 0 + 1297d2e csoler Mon, 30 Jul 2018 10:47:36 +0200 fixed double calls to pthread_exit() (one being implicit after return from main thread method) -- patch from sss + d7c7e35 csoler Fri, 27 Jul 2018 15:15:04 +0200 fixed compilation on MacOS + cc1a05d csoler Fri, 27 Jul 2018 12:33:06 +0200 fixed certificate creation in TorAuto mode + 22bc40e csoler Thu, 26 Jul 2018 19:25:30 +0200 udated GenCertDialog with new layout + 74ec558 csoler Thu, 26 Jul 2018 09:39:26 +0200 reworked GenCertDialog with node type on top level + 62b9a74 csoler Wed, 25 Jul 2018 15:31:18 +0200 fixed running with TorControl in new mode + d1a375c csoler Wed, 25 Jul 2018 11:37:40 +0200 removed RETROTOR #ifdef and started using RsAccounts::isTorAuto() instead. Unfinished yet. + 56422a9 G10h4ck Wed, 25 Jul 2018 00:35:32 +0200 Merge pull request #1 from sehraf/jsonapi + d2a62b0 Gioacch Wed, 25 Jul 2018 00:27:39 +0200 Fix deep search returning 0 results + b4dd89d Gioacch Wed, 25 Jul 2018 00:27:39 +0200 Fix deep search returning 0 results + 0f75890 csoler Tue, 24 Jul 2018 23:47:32 +0200 started cleaning the mess with rsAccounts: only exposed useful functionality of rsAccount beyond a static class and removed all references to rsAccounts in the code + 7af5075 sehraf Tue, 24 Jul 2018 20:59:04 +0200 fix jsonapi.h + f6ca7b2 csoler Mon, 23 Jul 2018 17:20:57 +0200 disabled compilation of cmark until it gets fixed + a21c272 csoler Mon, 23 Jul 2018 17:20:13 +0200 disabled compilation of cmark until it gets fixed + e6acb52 sehraf Thu, 28 Jun 2018 20:32:53 +0200 add simple chat support + 7128a04 thunder Mon, 23 Jul 2018 21:54:07 +0200 Added Xapian to Windows build environment + b85359d thunder Tue, 24 Jul 2018 14:24:50 +0200 Added missing include to TurtleRouterDialog.cpp + e2bb3ae csoler Mon, 23 Jul 2018 17:20:57 +0200 disabled compilation of cmark until it gets fixed + 3272ee0 csoler Mon, 23 Jul 2018 17:20:13 +0200 disabled compilation of cmark until it gets fixed + 1bc5180 Gioacch Fri, 29 Jun 2018 16:03:09 +0200 Experiment of notification via NotifyClient + JSON API + 130007b Gioacch Mon, 23 Jul 2018 13:44:01 +0200 Merge branch 'master' into jsonapi + fbc4e42 G10h4ck Mon, 23 Jul 2018 11:48:55 +0200 Merge pull request #1292 from G10h4ck/deep_search + e8c9ba5 Gioacch Mon, 23 Jul 2018 11:18:32 +0200 Improve code quality after Cyril review + 08cf225 csoler Mon, 23 Jul 2018 09:44:29 +0200 Merge pull request #1301 from PhenomRetroShare/Fix_RemoveSearchLineInFriendSelectionWidget + 6f8c2f6 Gioacch Sun, 22 Jul 2018 23:39:06 +0200 Fix compilation if deep_search is disabled + 99f3527 G10h4ck Sun, 22 Jul 2018 23:03:37 +0200 Merge pull request #999 from PhenomRetroShare/Add_CMark + 51c2521 Gioacch Sun, 22 Jul 2018 22:47:30 +0200 Fix compiling with old GCC + d9aa372 Gioacch Sun, 22 Jul 2018 21:45:43 +0200 Revert "DROP before merge. Reduce INTEGRITY_CHECK_PERIOD" + f97dc8a Gioacch Sun, 22 Jul 2018 21:33:40 +0200 Properly plug deep search in GXS search + d03ee1c Phenom Sat, 19 Aug 2017 19:18:58 +0200 Add CommonMark in ChatLobbyDialog + 82c9084 csoler Sun, 22 Jul 2018 00:22:51 +0200 Merge pull request #1303 from csoler/v0.6-GXS-DistSync3-TurtleSearch + 2ab12a2 csoler Sun, 22 Jul 2018 00:21:45 +0200 fixed deadlock due to turtle calling addVirtualPeer for client services inside a mutex protected zone (breaks mutex order service > turtle) + 6982ae6 Gioacch Sat, 21 Jul 2018 13:20:50 +0200 Improve retrocompatibility with older xapian + ff166b2 Gioacch Sat, 21 Jul 2018 12:57:05 +0200 Merge branch 'master' into deep_search + 8149ef9 Gioacch Sat, 21 Jul 2018 01:17:28 +0200 Install xapian dependency in Continuos Integration + e72ef24 csoler Fri, 20 Jul 2018 19:16:58 +0200 Merge pull request #1298 from csoler/v0.6-DebianPackaging + 3fc9ff3 Gioacch Fri, 20 Jul 2018 15:29:37 +0200 WIP Plug deep search into GXS search + a31b06a Gioacch Fri, 20 Jul 2018 13:15:11 +0200 Merge branch 'master' into deep_search + d4fce07 csoler Thu, 19 Jul 2018 23:46:31 +0200 changed lrand48 to RSRandom for cross-plateform compatibility, in rsgxsnettunnel.cc + 2bab688 csoler Thu, 19 Jul 2018 23:22:24 +0200 fixed merge with upstream/master + b8062f2 csoler Thu, 19 Jul 2018 22:59:43 +0200 Merge pull request #1294 from csoler/v0.6-GXS-DistSync3-TurtleSearch + dac885e csoler Wed, 18 Jul 2018 21:22:38 +0200 made randomBias initilized with true random bytes at start + 9b0a4b9 csoler Wed, 18 Jul 2018 21:20:51 +0200 removed extra call to loadConfiguration() + 61087d2 G10h4ck Wed, 18 Jul 2018 19:04:47 +0200 Merge pull request #1302 from sehraf/pr_use_system_rapidjson + b9436fb csoler Tue, 17 Jul 2018 10:08:39 +0200 fixed leading zeroes problem in title bar + 55e99ef sehraf Mon, 16 Jul 2018 23:22:04 +0200 add auto detection of installed rapidjson + a52c94d csoler Sun, 15 Jul 2018 19:15:05 +0200 improved display of encryption master key + 1de3149 csoler Sun, 15 Jul 2018 19:09:12 +0200 fixed up display of GXS net tunnel info + 01d4825 csoler Sun, 15 Jul 2018 18:31:22 +0200 Merge pull request #1300 from PhenomRetroShare/Fix_ChangeLobbyToRoomInCreateLobbyDialog + aaea97d Phenom Sun, 15 Jul 2018 16:53:52 +0200 Remove unneeded Search: text in FriendSelectionWidget.ui + 8208416 Phenom Sun, 15 Jul 2018 16:37:33 +0200 Change Lobby text to Room in CreateLobbyDialog. + cca986a csoler Sun, 15 Jul 2018 15:07:24 +0200 added more info to tunnel display + 34e924f csoler Sun, 15 Jul 2018 14:40:50 +0200 added visualisation for GXS net tunnels (unfinished) + fd45d44 csoler Sun, 15 Jul 2018 11:14:58 +0200 added interface to get statistics about GxsNetTunnel + 80f4907 csoler Tue, 10 Jul 2018 11:20:43 +0200 Merge pull request #1227 from RetroPooh/openlocal + 4b6fd5d G10h4ck Mon, 9 Jul 2018 10:55:07 +0200 Merge pull request #1296 from chelovechishko/namespaces + 6848a58 csoler Sun, 8 Jul 2018 21:17:48 +0200 merged upstream/master + 0bc7774 csoler Sun, 8 Jul 2018 16:59:52 +0200 Merge pull request #1278 from sehraf/pr_improve-nogui-password-entry + 93aa544 csoler Sun, 8 Jul 2018 16:58:56 +0200 Merge pull request #1293 from chelovechishko/chalod + b3dddea chelove chish ko Fri, 6 Jul 2018 23:55:12 +0900 add missing namespaces + 0c45217 csoler Thu, 5 Jul 2018 17:41:30 +0200 merged upstream/master + 98f8e4d csoler Thu, 5 Jul 2018 17:40:06 +0200 added per-item type limit for turtle search results + 4a64ea5 csoler Thu, 5 Jul 2018 14:00:04 +0200 added optional use of dist sync in GroupFrameDialog + 0cc87c9 csoler Thu, 5 Jul 2018 12:20:22 +0200 fixed bug causing search data result to not be forwarded correctly (missing request id) + 0e37de3 csoler Thu, 5 Jul 2018 11:43:55 +0200 made retrieval of group data manual instead of automatic + 59c51a2 csoler Thu, 5 Jul 2018 10:16:48 +0200 removed debug switch to allow display of existing distant group search results + 47e760a csoler Thu, 5 Jul 2018 10:11:12 +0200 added a few missing mutexes in prevent searches to be shown when already known + 2067b10 csoler Wed, 4 Jul 2018 23:54:26 +0200 fixed missing code in passing turtle group data result to client service + 8ad4547 csoler Wed, 4 Jul 2018 21:42:09 +0200 added group data request when search items are selected + 74075fd chelove Wed, 4 Jul 2018 23:18:21 +0900 gui: do not show the quote section of context menu in chat if + b3fb7ab chelove Wed, 4 Jul 2018 22:46:01 +0900 gui: reduce size of icons in chat for font.height lesser than 26 + d3e5b76 Gioacch Wed, 4 Jul 2018 12:08:50 +0200 DeepSearch index channels posts too + 77c3eae chelove Wed, 4 Jul 2018 00:34:45 +0900 gui: check for show "is typing" before time call + b950e12 chelove Wed, 4 Jul 2018 00:19:36 +0900 gui: disable quote option if no text is selected in chat + 5925aa0 chelove Mon, 2 Jul 2018 21:22:22 +0900 gui: anchor not only first word of nickname, if any + 32014ea Gioacch Tue, 12 Jun 2018 14:12:08 +0200 Use proper path for DeepSearch xapian DB + 5a41b3c Gioacch Mon, 11 Jun 2018 13:03:01 +0200 Index only public channels + 0f63283 Gioacch Sun, 10 Jun 2018 19:04:11 +0200 Add search capability to DeepSearch + c15ae86 Gioacch Sun, 10 Jun 2018 11:00:38 +0200 deep_search: use service serializer not serial_process + c0e92dd Gioacch Sat, 9 Jun 2018 18:06:14 +0200 WIP Index GXS channels with xapian + ce61174 Gioacch Sat, 9 Jun 2018 18:02:52 +0200 DROP before merge. Reduce INTEGRITY_CHECK_PERIOD + 39c88ea G10h4ck Mon, 2 Jul 2018 17:16:21 +0200 Merge pull request #1291 from G10h4ck/extra_locators_merge + 4eb060e chelove Mon, 2 Jul 2018 17:41:26 +0900 gui: do not attempt to create context menu if idlist is empty + 418c42b Gioacch Mon, 2 Jul 2018 13:50:02 +0200 Extra locators in cert invite made optional + 1dd7077 Gioacch Mon, 2 Jul 2018 12:22:23 +0200 Merge branch 'master' into extra_locators_merge + 1b2b311 csoler Mon, 2 Jul 2018 10:21:38 +0200 fixed previous commit caused by an apparent bug in qtcreator when updating code + e6db04e csoler Mon, 2 Jul 2018 09:45:17 +0200 cancelled previous commit, because it sort of breaks the update of forum lists. + abc5b84 csoler Mon, 2 Jul 2018 09:36:21 +0200 added queuedConnection type in fillDisplay() between RsGxsBroadcastWidget and RsGxsBroadCastBase. + 80a43fe csoler Sat, 30 Jun 2018 21:52:25 +0200 added secure retrieval of distant groups + 1c63cec Gioacch Fri, 29 Jun 2018 16:02:07 +0200 Expose some RsFiles method trought JSON API + 102558a Gioacch Fri, 29 Jun 2018 00:13:07 +0200 Merge fixes to serialization from master branch + 5ffd7a2 csoler Thu, 28 Jun 2018 21:05:34 +0200 Merge pull request #1290 from sehraf/pr_fix_json_uint64 + f7625e3 sehraf Thu, 28 Jun 2018 20:25:10 +0200 fix json uint64 + d511b66 Gioacch Thu, 28 Jun 2018 15:04:06 +0200 Extend JSON API to shutdown retroshare gracefully + 0ff80ba Gioacch Thu, 28 Jun 2018 12:06:43 +0200 Extend JSON API with reasonable way to create location + db06c32 csoler Thu, 28 Jun 2018 10:01:57 +0200 turned turtle encryption routine into a generic authenticated encryption method in librs::crypto + 4637fba Gioacch Wed, 27 Jun 2018 08:52:03 +0200 Add login JSON API + a6edf47 csoler Tue, 26 Jun 2018 22:25:06 +0200 removed debug/experimental channel search from files tab + 00dfa0f csoler Tue, 26 Jun 2018 22:20:02 +0200 added fallback for GXS GroupMessage UI to look into cached distant group data + d14a455 Gioacch Tue, 26 Jun 2018 22:01:17 +0200 jsonapi-generator fix support for void methods + cb11ad9 Gioacch Tue, 26 Jun 2018 15:19:25 +0200 Merge branch 'master' into jsonapi + 502459a Gioacch Tue, 26 Jun 2018 15:12:16 +0200 Cleanup rapidjson inclusion + 15f3912 Gioacch Tue, 26 Jun 2018 13:20:24 +0200 Complete GxsChannels JSON API with blocking methods + a5d1a15 csoler Mon, 25 Jun 2018 23:08:10 +0200 remove channel/posted/forum info when no group is selected + d731b66 Gioacch Mon, 25 Jun 2018 10:44:39 +0200 Expose tokenservice methods trough GxsIfaceHelper + 2f4b9b3 Gioacch Sun, 24 Jun 2018 23:24:52 +0200 Convert to RsTokenService::GxsRequestStatus + 08b436e csoler Sun, 24 Jun 2018 23:15:22 +0200 added display of searched groups + b4d2ce8 Gioacch Sun, 24 Jun 2018 18:56:48 +0200 RsTokenService use enum for request status + ec95b6d Gioacch Sun, 24 Jun 2018 18:03:26 +0200 Remove unused misleading GXS request status + e351d72 csoler Sun, 24 Jun 2018 16:55:38 +0200 added retrieval of search results in UI + 7ad337c Gioacch Sat, 23 Jun 2018 17:13:38 +0200 Implement automatic JSON API generation + 6ccc765 csoler Sat, 23 Jun 2018 22:25:36 +0200 added code to notify GxsBroadcast system with new distant search results + 5b96668 csoler Fri, 22 Jun 2018 23:38:31 +0200 fixed merge with upstream + 2f159ef csoler Fri, 22 Jun 2018 22:06:59 +0200 Merge pull request #1288 from csoler/v0.6-GxsFix + a7f1adc csoler Thu, 21 Jun 2018 18:55:29 +0200 added comment + cadc697 csoler Thu, 21 Jun 2018 17:27:15 +0200 removed reload of currently selected identity during full reload of Id list in People as it caused some blinking + 84699db csoler Thu, 21 Jun 2018 15:46:59 +0200 changed std::vector into std::set in notification system, hence removing lots of std::find(std::vector::begin(),std::vector::end(),T), causing quadratic costs in multiple places. + 3981bc8 csoler Thu, 21 Jun 2018 13:48:57 +0200 extended notification system to add distant search result notification + 5cb48c2 csoler Thu, 21 Jun 2018 09:26:03 +0200 renamed a few constants of GXS notify system into more consistent values + c79ceba csoler Wed, 20 Jun 2018 23:26:37 +0200 added remove buttons for ongoing search entries + 91fd38d csoler Wed, 20 Jun 2018 22:30:44 +0200 started GUI part for distant network search of groups + 9090205 G10h4c Tue, 19 Jun 2018 11:53:07 +0200 Merge pull request #1284 from G10h4ck/improve_build + 5aadb4c csoler Mon, 18 Jun 2018 22:46:37 +0200 Merge pull request #1285 from csoler/v0.6-GxsFix + 6139632 csoler Mon, 18 Jun 2018 22:37:31 +0200 changed back RsGxsUpdateBroadCast.cpp to dos line ending + 2e7398a csoler Mon, 18 Jun 2018 22:35:22 +0200 removed debug info + 79e676e csoler Mon, 18 Jun 2018 22:27:05 +0200 fixed re-load of GXS groups (forums/channels) when the read flag is changed + c67084b csoler Sun, 17 Jun 2018 21:23:16 +0200 fixed mutex problem in turtle-GXS search + 84194b6 csoler Sat, 16 Jun 2018 22:39:35 +0200 sereral fixes to GXS distant search + 7a135c5 csoler Wed, 13 Jun 2018 22:46:27 +0200 added quick and dirty turtle search for channels in Files search tab + be1e127 csoler Mon, 11 Jun 2018 22:00:03 +0200 added test search functions in rsgxsnetservice + 3c678f2 Gioacch Mon, 11 Jun 2018 16:05:25 +0200 Fix windows build if MINGW_PREFIX is defined + 8a901e6 Gioacch Mon, 11 Jun 2018 14:29:07 +0200 Improve appveyor CI + 1f76108 Gioacch Mon, 11 Jun 2018 14:21:28 +0200 Remove some cruft from build files + 6fb459c csoler Sun, 10 Jun 2018 22:34:17 +0200 added logic for GXS search in RsGxsNetTunnel and Gxs client net service + 6805875 Gioacch Sun, 10 Jun 2018 15:10:13 +0200 Finally get rid of the annoying MASQUARADING typo + 6010104 Gioacch Sat, 9 Jun 2018 18:10:22 +0200 Merge commit '9886840b79d617a32764ad52ef4747f5fd999250' + 9886840 Gioacch Sat, 9 Jun 2018 17:59:11 +0200 Provide proper constructor for SerializeContext + 1825b26 Gioacch Sat, 9 Jun 2018 17:21:59 +0200 ChunkMap::reAskPendingChunk fix unused parameter warning + 5d237c8 Gioacch Sat, 9 Jun 2018 17:08:13 +0200 Improve libresapi qmake files + 5953e7b thunder Thu, 31 May 2018 19:19:41 +0200 Windows build environment - Added "-spec win32-g++" to build.bat - Added "--no-check-certificate" to download-file.bat - Fixed build installer + 4eda277 thunder Thu, 31 May 2018 17:59:55 +0200 Added missing declare of metatype + 8edb1f7 csoler Fri, 8 Jun 2018 14:32:25 +0200 fixed problem causing infinite loop of net reset in p3NetMgr + f3b0f7a G10h4ck Thu, 7 Jun 2018 17:53:42 +0200 Merge pull request #1280 from G10h4ck/channels_apiv2_improvements + e5c7248 G10h4ck Thu, 7 Jun 2018 17:53:26 +0200 Merge pull request #1281 from G10h4ck/filesharing_apiv2_improvements + 508951d Gioacch Thu, 7 Jun 2018 15:00:11 +0200 Improve channels JSON API v2 + e81b81d Gioacch Thu, 7 Jun 2018 14:59:00 +0200 libresapi improve qmake optional builds + 3eff851 Gioacch Thu, 7 Jun 2018 14:57:31 +0200 Improve deprecation of RS_TOKREQ_ANSTYPE_* + d7b366d Gioacch Thu, 7 Jun 2018 14:54:58 +0200 RS-gui Solve unused parameter warning + 7caf06b csoler Wed, 6 Jun 2018 23:15:29 +0200 added structures for generic turtle search and access functions in Gxs objects + 9a64f80 sehraf Sun, 3 Jun 2018 17:11:11 +0200 handle backspace when entering password + b5c1b82 csoler Sat, 2 Jun 2018 18:12:27 +0200 added classes for both group data and group summary results in turtle search + 6bb1d3c csoler Fri, 1 Jun 2018 22:35:06 +0200 updated ubuntu changelog + + -- Retroshare Dev Team Thu, 04 Sep 2018 22:00:00 +0100 + +retroshare (0.6.4-1.20180601.6bb1d3c5~bionic) bionic; urgency=low + + f663600 csoler Fri, 1 Jun 2018 22:27:59 +0200 fixed makeSourcePackage.sh + 9b16e33 csoler Fri, 11 May 2018 20:53:29 +0200 removed conflicts to retroshare06 in debian control file + 57dde55 csoler Sat, 26 May 2018 11:23:33 +0200 Merge pull request #1269 from PhenomRetroShare/Add_NeverAskMeForExternalLinkActivated + 33fe823 csoler Sat, 26 May 2018 11:22:47 +0200 Merge pull request #1271 from sehraf/pr_compile-fix-unused-services + 65beb2c csoler Sat, 26 May 2018 11:09:41 +0200 Merge pull request #1275 from sehraf/pr_fix-IDdialog-chat-link + d8b3fc0 csoler Sat, 26 May 2018 11:08:46 +0200 Merge pull request #1274 from PhenomRetroShare/Fix_AppVeyorCompil + f53e5e8 sehraf Fri, 25 May 2018 23:59:02 +0200 Fix displayed chat link name in id dialog before (decimal): Message in chat room 5327517029776505601 after (proper id): Message in chat room LFD6E08C33A98C658 + 428b331 sehraf Fri, 25 May 2018 23:12:35 +0200 fix for Qt 5.11 + 7c77e93 Phenom Fri, 25 May 2018 17:32:36 +0200 Fix AppVeyor Compilation + de65cb6 csoler Tue, 22 May 2018 23:59:26 +0200 Merge pull request #1272 from G10h4ck/net_little_fixes + 1ad1fdc Gioacc Tue, 22 May 2018 19:17:37 +0200 p3NetMgrIMPL::checkNetAddress() notify if port change + 0bf02e2 Gioacc Tue, 22 May 2018 19:14:25 +0200 pqissludp::Initiate_Connection() check remote_addr to be IPv4 before use + 0c19a56 sehraf Mon, 21 May 2018 14:55:10 +0200 compile fix gxsphoto + 92b21d7 sehraf Mon, 21 May 2018 14:26:46 +0200 compile fix wikipoos + 8f107cc Phenom Sat, 19 May 2018 16:37:29 +0200 Add Never Ask Me For External Link Activated + 186617f Gioacc Thu, 17 May 2018 16:43:14 +0200 Fix missing include + 28981b6 csoler Wed, 16 May 2018 13:37:02 +0200 Merge pull request #1251 from PhenomRetroShare/Fix_Cppcheck(duplInheritedMember)InRsItem + d11f88c csoler Wed, 16 May 2018 13:33:25 +0200 Merge pull request #1252 from PhenomRetroShare/Fix_Cppcheck(duplInheritedMember)InbdNode + 2145911 csoler Wed, 16 May 2018 13:30:56 +0200 Merge pull request #1262 from PhenomRetroShare/Fix_PartialDirCheck + e232000 csoler Wed, 16 May 2018 13:28:23 +0200 Merge pull request #1266 from csoler/v0.6-FT + 3f88e3e csoler Wed, 16 May 2018 13:24:52 +0200 added check to avoid hashing files that are currently being modified + 8451550 csoler Wed, 16 May 2018 11:40:39 +0200 added missing licence to file_tree.h + 291c86e csoler Wed, 16 May 2018 11:17:22 +0200 Merge pull request #1265 from csoler/v0.6-GxsFix + 4661329 csoler Wed, 16 May 2018 11:15:18 +0200 fixed bug causing new forums and identities to not show up immediately + 9f37b63 G10h4c Wed, 16 May 2018 10:49:28 +0200 Merge pull request #1264 from G10h4ck/channel_json_api_v2 + 181d99e Gioacc Wed, 16 May 2018 10:38:47 +0200 Give proper error message if Qt version is too old + f12cd57 Phenom Sat, 12 May 2018 14:31:17 +0200 Fix Partial Dir Check + 57cff61 csoler Fri, 11 May 2018 20:28:53 +0200 fixed merge + ecbd115 csoler Fri, 11 May 2018 20:24:24 +0200 added missing include path for libretroshare/src in libresapi + fe5ea9e csoler Fri, 11 May 2018 17:37:15 +0200 additional fixes to debian packaging files + 2173aab csoler Fri, 11 May 2018 17:02:58 +0200 fixed rules file again + 84a02cb csoler Fri, 11 May 2018 16:39:49 +0200 added missing targets in rules file + 4b6304e csoler Fri, 11 May 2018 16:33:19 +0200 few fixes according to lintian complaints + c2492fe csoler Thu, 10 May 2018 23:10:16 +0200 fixed a few lintian errors in debian/control + 9f5409b csoler Thu, 10 May 2018 22:04:11 +0200 fixed email to match mentors login + 45fdbb4 csoler Thu, 10 May 2018 22:03:39 +0200 fixed email to match mentors login + b4ada80 csoler Wed, 9 May 2018 13:54:40 +0200 removed > 3.4.1 in debian/control, because pbuilder would not build + e81c82e csoler Wed, 9 May 2018 13:37:25 +0200 added notes file for debian release + 4d287d6 csoler Wed, 9 May 2018 13:27:16 +0200 fixed weird mistake in grouter which causes an issue only in gcc > 8 + 889c277 csoler Wed, 9 May 2018 10:15:32 +0200 fixed packaging script for debian release + f406d9a csoler Wed, 9 May 2018 10:15:02 +0200 updated debian/control to be the control file for stretch. Updated copyright notice + 186ff0f csoler Wed, 9 May 2018 10:12:34 +0200 created proper debian changelog using dch and updated project url + 6d67936 csoler Tue, 8 May 2018 15:34:44 +0200 Merge pull request #1253 from PhenomRetroShare/Add_LastPostColInGroupTreeWidget + 2ebacf3 Phenom Tue, 8 May 2018 12:08:08 +0200 Add Last Post Column in GroupTreeWidget. + 4d748bd Phenom Mon, 7 May 2018 18:05:07 +0200 Fix CppCheck duplInheritedMember warning in bdNode + f39fd06 Phenom Mon, 7 May 2018 17:29:11 +0200 Fix CppCheck duplInheritedMember warning in RsItem + 1352631 thunde Mon, 7 May 2018 06:42:52 +0200 Updated Windows build environment + 38ac234 thunde Mon, 7 May 2018 07:30:29 +0200 Fixed Windows compile with pre-compiled libraries Added new variable EXTERNAL_LIB_DIR to specify path of external libraries + d9a75a9 thunde Sun, 29 Apr 2018 20:40:05 +0200 Added RapidJSON to Windows build environment + 5b607ad csoler Sun, 6 May 2018 23:53:45 +0200 Merge pull request #1245 from PhenomRetroShare/AddContextMenuForGxsIdInTextChatBrowser + a6821f4 csoler Sun, 6 May 2018 23:02:18 +0200 Merge pull request #1249 from sehraf/pr_libsecret + c20436e csoler Sun, 6 May 2018 22:59:20 +0200 Merge pull request #1250 from PhenomRetroShare/Fix_CppCheckerWarningInFtController + d8dc2a8 csoler Sun, 6 May 2018 22:57:57 +0200 Merge pull request #1246 from PhenomRetroShare/Add_GxsIdInRestoredChatMsg + dca33da Phenom Sun, 6 May 2018 18:53:29 +0200 Fix CppCheck in ftcontroller.cc + c89e36a sehraf Fri, 4 May 2018 20:52:31 +0200 add auto selection of libsecret with fallback to libgnome-keyring + 1129bcb sehraf Fri, 4 May 2018 20:47:41 +0200 Add support for libsecret + 10badf5 sehraf Fri, 4 May 2018 20:43:40 +0200 fix retroshare-nogui.pro autologin + 676c070 csoler Thu, 3 May 2018 15:55:21 +0200 extended the rapid_json trick to plugins + 5f12b60 csoler Thu, 3 May 2018 15:22:39 +0200 added -lgnome-keyring to unix LIBS when rs_autologin is set + bfe8e40 csoler Thu, 3 May 2018 15:22:03 +0200 updated ubuntu changelog + 98f0052 Phenom Thu, 3 May 2018 15:04:22 +0200 Add GxsId in Restored Chat Message. + ecba4c2 Phenom Wed, 2 May 2018 20:31:52 +0200 Add Context Menu for GxsId in lobby textBrowser. + 91ed367 csoler Thu, 3 May 2018 13:45:44 +0200 added packaging for ubuntu bionic + 56e8134 cyril soler Thu, 3 May 2018 11:32:24 +0200 removed sqlite3 lib from ld when using sqlcipher. + 1366f61 csoler Wed, 2 May 2018 23:51:46 +0200 Merge pull request #1241 from RetroPooh/chatimgattprev1 + 8e111c2 csoler Wed, 2 May 2018 22:46:27 +0200 added rapidjson-1.1.0 code hard-coded in the source directory to allow everyone to compile without the need to tweak too much. When v1.1.0 is mainstream (espcially on ubuntu) we can revert back to an external dependency + 48c4b4c G10h4c Sat, 28 Apr 2018 09:34:14 +0200 Merge pull request #1242 from beardog108/master + ccede9d G10h4c Sat, 28 Apr 2018 09:33:14 +0200 Merge pull request #1243 from sehraf/pr_fix-make-install + 10daf3b sehraf Sat, 28 Apr 2018 09:06:10 +0200 Fix 'make install' + 82a00c2 KevinF Fri, 27 Apr 2018 15:34:43 -0500 added rapidjson to package installation command on Debian/OpenSUSE/Arch + be75e89 Gioacc Fri, 27 Apr 2018 20:55:38 +0200 Fix compialtion after merge + f3ae61b Gioacc Fri, 27 Apr 2018 18:17:09 +0200 Merge branch 'json_experiments' + + -- Retroshare Dev Team Thu, 03 May 2018 12:00:00 +0100 + +retroshare (0.6.4-1.20180503.676c0701~xenial) xenial; urgency=low + + 2dc69cb RetroP Fri, 27 Apr 2018 16:50:00 +0300 embed preview for images on file attach in chat + c199199 Gioacc Sun, 8 Apr 2018 12:37:41 +0200 pqissl silence extra debug message + 8245d74 csoler Sat, 7 Apr 2018 14:33:58 +0200 Merge pull request #1230 from csoler/master + 2782494 csoler Sat, 7 Apr 2018 14:29:23 +0200 removed debug info + e2b0e27 csoler Sat, 7 Apr 2018 00:56:07 +0200 fixed costly polling in RsGenExchange + cc091cc Gioacc Sat, 7 Apr 2018 12:48:01 +0200 Fixed hidden nodes listening failure + 73c6dee csoler Tue, 27 Mar 2018 20:54:31 +0200 Merge pull request #1191 from G10h4ck/IPv6-v3 + 4be73b7 csoler Sat, 24 Mar 2018 10:18:37 +0100 Merge pull request #1216 from beardog108/security + 599c3d4 Kevin Fri, 23 Mar 2018 23:00:27 -0500 fixed clickjacking attack with x-frame-options + 24d1f5d csoler Sat, 17 Mar 2018 18:40:32 +0100 Merge pull request #1190 from PhenomRetroShare/Add_ShowEmptySubMenuRemoteTree + 09de680 csoler Sat, 17 Mar 2018 18:30:21 +0100 Merge pull request #1210 from PhenomRetroShare/Add_BackgroundInProgressBarText + 1432104 csoler Sat, 17 Mar 2018 18:25:47 +0100 Merge pull request #1214 from csoler/v0.6-FT + e1482dd Phenom Sat, 17 Mar 2018 00:00:05 +0100 Add Rounded and Gradient Background to xprogressbar text. + 7da73b3 Phenom Mon, 5 Mar 2018 20:31:39 +0100 Add differents views depends ProgressBar width + 311b190 Phenom Sun, 4 Mar 2018 20:06:33 +0100 Add Background to xprogressbar text for more readability. + e1ad21c csoler Thu, 15 Mar 2018 13:11:19 +0100 fixed wrong file count in RsCollectionDialog when downloading files + b3653d1 csoler Thu, 15 Mar 2018 11:32:55 +0100 enabled aggressive re-request of pending slices at end of transfer, thus fixing the long delay to finish files with mixed fast/slow sources + 6e8305a csoler Wed, 14 Mar 2018 20:56:30 +0100 Merge pull request #1211 from PhenomRetroShare/Fix_AvatarStatusOverlay + c7549a2 csoler Wed, 14 Mar 2018 20:49:42 +0100 Merge pull request #1208 from PhenomRetroShare/Fix_ChangeChatTextColorWhenChangeStyle + 11cfa7b csoler Wed, 14 Mar 2018 20:34:52 +0100 Merge pull request #1209 from PhenomRetroShare/Add_DescriptionGxsGroupToolTip + 3fc6314 csoler Wed, 14 Mar 2018 20:33:34 +0100 Merge pull request #1206 from PhenomRetroShare/Fix_AboutIcon + 0e6d27a csoler Tue, 13 Mar 2018 20:25:38 +0100 fixed bug in FT causing transfer lines to only update when the mouse moves over the widget + 91634ba thunde Thu, 8 Mar 2018 17:45:24 +0100 Added build of Retrotor to Windows build environment + e9b49e1 Gioacc Mon, 12 Mar 2018 17:06:01 +0100 Update Android quirks documentation + ce56a20 Gioacc Mon, 12 Mar 2018 16:22:42 +0100 Added sources verification in android toolchain + e7078b5 Gioacc Mon, 12 Mar 2018 14:27:59 +0100 Update Android documentation + 514b31e Gioacc Sun, 11 Mar 2018 20:46:07 +0100 Add Qt installation in android preparation script + 6f30aa2 Gioacc Sun, 11 Mar 2018 20:45:40 +0100 Merge branch 'master' of git://github.com/RetroShare/RetroShare + 13b18e3 csoler Sat, 10 Mar 2018 16:05:52 +0100 added missing decoration icon on transfer sources + 4dd2776 Gioacc Sat, 10 Mar 2018 13:15:53 +0100 Remove android JNI .class from source + 2b300eb Gioacc Sat, 10 Mar 2018 00:44:24 +0100 Update version in Android Manifest + f5a3b26 Gioacc Fri, 9 Mar 2018 20:26:29 +0100 More omogeneous variable naming in android build tools + c92b860 thunde Sun, 4 Mar 2018 20:08:15 +0100 Windows build environment: - Updated external libraries - Added compile of plugins to build.bat - Added copy of Qt style DLL to pack.bat and Windows Installer - Removed "CONFIG=console" for release build + 8b42873 Phenom Sun, 4 Mar 2018 22:45:11 +0100 Fix Friend Avatar status overlay no depends size scale. + 6877589 Phenom Sun, 4 Mar 2018 18:19:18 +0100 Add description in GroupTreeWidget tooltip. + 51cc94b Phenom Sun, 4 Mar 2018 17:31:40 +0100 Fix ChatWidget current text edit color when changing appearance style. + 4e6f2ae Phenom Sun, 4 Mar 2018 14:31:16 +0100 Fix Icon for About page. + a89ab8f Phenom Sat, 24 Feb 2018 14:07:32 +0100 Add ShowEmpty sub menu in Tree Remote SharedFilesDialog. + + -- Retroshare Dev Team Thu, 03 May 2018 12:00:00 +0100 + +retroshare (0.6.4-1.20180313.0e6d27ad~xenial) xenial; urgency=low + + 919417a csoler Sat, 3 Mar 2018 19:04:54 +0100 make sure tor executable from config path can be reached + b587ac8 csoler Sat, 3 Mar 2018 16:06:49 +0100 Merge pull request #1192 from PhenomRetroShare/Add_WarningMaxFlatViewFile + 9bcff07 csoler Sat, 3 Mar 2018 15:58:11 +0100 Merge pull request #1203 from PhenomRetroShare/Fix_SharedFileDialogShowColumn + ead2aea csoler Sat, 3 Mar 2018 15:56:51 +0100 Merge pull request #1204 from csoler/v0.6-FT + dcb3f79 csoler Sat, 3 Mar 2018 15:55:52 +0100 removed some debug info in RSLink + 1a1dc64 csoler Sat, 3 Mar 2018 15:49:45 +0100 fixed transfers list bug causing ghost entries to appear + 58d418d Phenom Sat, 3 Mar 2018 12:08:21 +0100 Fix SharedFilesDialog show old hidden column. + ab45a97 Phenom Sat, 3 Mar 2018 12:05:13 +0100 Revert "Fix SharedFilesDialog show old hidden column." + 57f87a6 csoler Fri, 2 Mar 2018 22:58:50 +0100 Merge pull request #1201 from csoler/v0.6-SecurityFixes + 9386bb9 csoler Fri, 2 Mar 2018 22:57:14 +0100 tried to fix FT list bug. + 952ff03 csoler Fri, 2 Mar 2018 21:28:09 +0100 Merge pull request #1200 from csoler/v0.6-SecurityFixes + e88eebf csoler Fri, 2 Mar 2018 21:26:38 +0100 attempt to fix wrong number of rows in DL list + f2a737e csoler Fri, 2 Mar 2018 18:13:09 +0100 fixed font size compilation error + ca402c2 csoler Fri, 2 Mar 2018 18:05:11 +0100 fixed column sizing in FT dialog + efa5827 csoler Fri, 2 Mar 2018 18:01:56 +0100 fixed missing peer availability maps in FT dialog + e5edea3 csoler Thu, 1 Mar 2018 14:10:30 +0100 removed precise and zesty which are obsolete + 3d7be85 csoler Thu, 1 Mar 2018 11:46:47 +0100 Merge pull request #1199 from csoler/v0.6-SecurityFixes + 026951f csoler Thu, 1 Mar 2018 11:45:54 +0100 added consistency check in getGroupMeta so that ADMIN/PUBLISH flags always correspond to what the key set reflects + 028a246 csoler Thu, 1 Mar 2018 09:44:59 +0100 Merge pull request #1197 from csoler/v0.6-SecurityFixes + ac64d2a csoler Thu, 1 Mar 2018 09:42:47 +0100 Merge pull request #1195 from PhenomRetroShare/Fix_NoTrIconInChatWidget + 0651f4a csoler Thu, 1 Mar 2018 09:42:06 +0100 Merge pull request #1198 from G10h4ck/master + 0c8b3ed Gioacc Wed, 28 Feb 2018 23:32:13 +0100 Set default Mac OS X version only if macx + 5d58943 csoler Wed, 28 Feb 2018 23:18:50 +0100 forced notification of type RECEIVE when creating a new group so that the GxsIFaceHelper updates the group list + 29ab0e9 csoler Wed, 28 Feb 2018 22:40:04 +0100 fixed bug that would erase private publish key when a group update is received + 165b241 csoler Tue, 27 Feb 2018 23:19:27 +0100 made add of publish key a meta group change, to force reload the list of groups + 3bc5b45 csoler Tue, 27 Feb 2018 22:42:48 +0100 added a FeedItem to warn when publish permissions are received for a channel + aad9397 csoler Mon, 26 Feb 2018 23:37:19 +0100 fixed memory leak in p3GxsTunnel + 23c389c Phenom Mon, 26 Feb 2018 23:29:06 +0100 Remove non translatable text ChatWidget.ui + dd9f67a csoler Sun, 25 Feb 2018 17:52:49 +0100 fixed version number problem + 3e700ab csoler Sun, 25 Feb 2018 16:12:46 +0100 Merge pull request #1194 from G10h4ck/fixAndroidCompilation + 9f0421c csoler Sun, 25 Feb 2018 14:39:29 +0100 attempt to fix large size in ConnectFriendDialog.ui + f9896a0 csoler Sun, 25 Feb 2018 11:46:18 +0100 updated ppa_upload.sh to 0.6.4 + 5c029c5 csoler Sun, 25 Feb 2018 11:43:30 +0100 fixed typo in changelog + 31ab87c csoler Fri, 23 Feb 2018 14:06:49 +0100 added rs plugins into rules for ubuntu packaging + 681f543 csoler Sat, 24 Feb 2018 22:04:26 +0100 Merge pull request #1183 from csoler/v0.6.4 + 05613a2 csoler Sat, 24 Feb 2018 21:58:58 +0100 Merge pull request #1193 from csoler/v0.6-SecurityFixes + 39e70ed csoler Sat, 24 Feb 2018 21:51:18 +0100 ignore unknown ptags in certificates instead of causing an error, for future backward compatibility + 062e00d csoler Sat, 24 Feb 2018 18:05:26 +0100 Merge pull request #1189 from csoler/v0.6-SecurityFixes + 13441ff csoler Fri, 23 Feb 2018 15:13:13 +0100 removed debug info in rsgenexchange.cc + 49b321d csoler Fri, 23 Feb 2018 14:39:08 +0100 fixed the text in invitation system + d8e950c csoler Fri, 23 Feb 2018 14:28:22 +0100 removed debug output from rsdataservice + 5a4d0f5 csoler Fri, 23 Feb 2018 14:26:23 +0100 made the invite system non automatic, because it was confusing and could generate unwanted emails + fa84d1c csoler Fri, 23 Feb 2018 14:01:43 +0100 Merge pull request #1185 from G10h4ck/disablePluginByDefault + ff7633f csoler Fri, 23 Feb 2018 14:00:39 +0100 Merge pull request #1184 from G10h4ck/linkLocalFallback + 8d5cd8a Gioacc Thu, 22 Feb 2018 15:38:20 +0100 Increase size of list of ip shared via discovery2 + 9dd1aef Gioacc Fri, 23 Feb 2018 01:05:35 +0100 Discovery do not distribute addresses to hidden nodes + e7facc1 Gioacc Fri, 23 Feb 2018 01:05:04 +0100 Prevent discovery to share local addresses if hidden + 4fa6bdc Gioacc Wed, 21 Feb 2018 17:38:31 +0100 Improve discovery + 385f44b csoler Thu, 22 Feb 2018 23:03:48 +0100 Merge pull request #1188 from PhenomRetroShare/Fix_SharedFileDialogShowColumn + c141eae Phenom Thu, 22 Feb 2018 18:54:14 +0100 Fix SharedFilesDialog show old hidden column. + 2044a2c Gioacc Wed, 21 Feb 2018 04:24:12 +0100 Use retrocompatible iterators + 4dfeab2 csoler Tue, 20 Feb 2018 23:30:52 +0100 Merge pull request #1187 from csoler/master + 73d11e1 Phenom Thu, 15 Feb 2018 19:04:55 +0100 Fix Gcc Warning in nxsmsgsync_test.cc + 737a2b4 Phenom Thu, 15 Feb 2018 18:57:16 +0100 Fix Gcc Warning in nxstesthub.cc + cfcdec4 Phenom Thu, 15 Feb 2018 18:44:03 +0100 Fix Gcc Warning in support.h + aadb9ac Phenom Fri, 8 Dec 2017 19:47:00 +0100 Fix Gcc Warning in NetworkDialog.cpp + e3d8d86 csoler Tue, 20 Feb 2018 23:03:33 +0100 updated translation files + 4d7997b csoler Tue, 20 Feb 2018 21:08:09 +0100 Merge pull request #1186 from csoler/v0.6-FT + a1b378e csoler Tue, 20 Feb 2018 21:07:02 +0100 fixed ghost rows in TransfersDialog + c897962 csoler Tue, 20 Feb 2018 20:26:33 +0100 merged + 11d607e csoler Tue, 20 Feb 2018 20:19:10 +0100 Merge pull request #1179 from PhenomRetroShare/Add_ChangeAddIconForChannelForum + 35b54bb csoler Tue, 20 Feb 2018 20:18:31 +0100 Merge pull request #1180 from PhenomRetroShare/Add_ClearGxsGroupFrameWhenNoSelection + fec2b2e csoler Tue, 20 Feb 2018 19:20:02 +0100 Merge pull request #1182 from PhenomRetroShare/Add_SplitFileNbSize + b2217fc Gioacc Tue, 20 Feb 2018 15:56:16 +0100 Build plugin only if requested + 0c99975 Gioacc Mon, 19 Feb 2018 23:23:15 +0100 Use link local address only if necessary + 5667763 csoler Mon, 19 Feb 2018 21:49:06 +0100 switched version to 0.6.4 + 798ad15 Phenom Mon, 19 Feb 2018 20:13:38 +0100 Split Number of Files and Size in RemoteDirModel. + afc43d0 G10h4c Mon, 19 Feb 2018 15:33:28 +0100 Merge pull request #1181 from Kcchouette/patch-1 + 8492a40 Kcchou Mon, 19 Feb 2018 15:17:59 +0100 Update markdown to be visible on github + 71e1a46 Phenom Sun, 18 Feb 2018 23:12:59 +0100 Clear GxsGroupFrame When No Selection + 8710761 Phenom Sun, 18 Feb 2018 19:15:01 +0100 Change Add Channel/Forum post by Add.png + 51f5d19 csoler Sun, 18 Feb 2018 18:00:24 +0100 merged uptream/master + 2bc0629 csoler Sun, 18 Feb 2018 17:59:00 +0100 Merge pull request #1178 from PhenomRetroShare/Fix_BugsInRsCollectionDialog + 2511934 csoler Sun, 18 Feb 2018 17:58:06 +0100 Merge pull request #1177 from csoler/v0.6-FT + 7a84492 csoler Sun, 18 Feb 2018 17:57:42 +0100 Merge pull request #1176 from csoler/v0.6-SecurityFixes + 7cda064 csoler Sun, 18 Feb 2018 17:56:51 +0100 merged uptream/master + 931fdd0 Phenom Sun, 18 Feb 2018 17:30:01 +0100 Fix bug in processSettings in RsCollectionDialog.cpp + d87061d Phenom Sun, 18 Feb 2018 09:18:44 +0100 Fix bug when adding new items when hashing in RsCollectionDialog + 6d0945f Phenom Sun, 18 Feb 2018 08:53:31 +0100 Fix bug when removing root item in RsCollectionDialog + 6fe1413 csoler Sat, 17 Feb 2018 23:37:25 +0100 added limiter in number of responses forwarded back by turtle search, which should avoid bursts of bandwidth for popular requests + 8708dd9 csoler Sat, 17 Feb 2018 12:04:13 +0100 fixed bug due to wrong service ID in serializer + d57f933 csoler Fri, 16 Feb 2018 23:51:43 +0100 added load/save of known channels to avoid re-displaying it in the NewsFeed after then have been deleted. + 252626f csoler Fri, 16 Feb 2018 23:24:01 +0100 added load/save of known forums to avoid re-displaying it in the NewsFeed after then have been deleted. + 63ddccd csoler Fri, 16 Feb 2018 13:22:19 +0100 Merge pull request #1175 from PhenomRetroShare/Fix_NewChatInvite + 83b6205 Phenom Fri, 16 Feb 2018 10:22:59 +0100 Fix New Chat Invite + 5e34467 csoler Thu, 15 Feb 2018 00:06:13 +0100 Merge pull request #1174 from csoler/v0.6-SecurityFixes + 47f9a49 csoler Thu, 15 Feb 2018 00:02:08 +0100 improved cost of reseting search in SharedFileDialog by saving hidden indexes list + 9c60ff7 csoler Wed, 14 Feb 2018 22:10:11 +0100 Merge pull request #1172 from csoler/v0.6-SecurityFixes + 72124bb csoler Wed, 14 Feb 2018 22:08:07 +0100 hide advanced mode option since it is not used anywhere in the software + ede51ab csoler Wed, 14 Feb 2018 22:02:20 +0100 Merge pull request #1171 from csoler/v0.6-SecurityFixes + cf33221 csoler Wed, 14 Feb 2018 22:00:46 +0100 removed dead code in previous commit + ddb2c45 csoler Wed, 14 Feb 2018 21:56:12 +0100 disable and hide signature checkbox when key is already signed in ConnectWizard + 42b8ecc csoler Wed, 14 Feb 2018 21:48:56 +0100 prevent RS from making friends with your own location + 558bb9f csoler Mon, 12 Feb 2018 23:17:29 +0100 fixed retro-tor build on master branch + 3f9c72e csoler Mon, 12 Feb 2018 22:42:22 +0100 Merge pull request #1170 from csoler/v0.6-FT + d8b193c csoler Mon, 12 Feb 2018 22:40:15 +0100 fixed merge with master + 01cc232 csoler Mon, 12 Feb 2018 22:39:11 +0100 fixed appearing false line in Transfers + 8afa127 csoler Mon, 12 Feb 2018 20:30:01 +0100 fixed crash in RsCollection creation + 0491e43 csoler Sun, 11 Feb 2018 21:28:43 +0100 Merge pull request #1169 from csoler/v0.6-FT + 7a2d874 csoler Sun, 11 Feb 2018 20:49:45 +0100 Merge pull request #1153 from csoler/v0.6-TorOnly + a2eb145 csoler Sun, 11 Feb 2018 20:40:38 +0100 fixed option in .pri for retrotor configuration + 5f106c4 csoler Sat, 10 Feb 2018 15:42:24 +0100 fixed compilation on ubuntu precise + 4beadfe csoler Sat, 10 Feb 2018 14:28:15 +0100 updated changelog + fc3beca csoler Fri, 9 Feb 2018 23:02:27 +0100 fixed performance issue (patch from sss) + faf4517 csoler Thu, 8 Feb 2018 15:26:21 +0100 proper error handlign when Tor is not available + 644fce8 csoler Thu, 8 Feb 2018 11:14:12 +0100 fixed download menu from Messages + + -- Retroshare Dev Team Sun, 25 Feb 2018 12:00:00 +0100 + +retroshare (0.6.3-1.20180210~4beadfe4) xenial; urgency=low + + 9352a7c csoler Thu, 8 Feb 2018 10:34:46 +0100 Merge pull request #1168 from PhenomRetroShare/Add_ConnFilterInFriendSel + bf8bd4b Phenom Wed, 7 Feb 2018 19:00:08 +0100 Add Only Connected in FriendSelectionWidget. + 7bb8eb0 csoler Wed, 7 Feb 2018 16:06:54 +0100 Merge pull request #1166 from PhenomRetroShare/Add_ChatRoomRSLink + 02b61b2 csoler Wed, 7 Feb 2018 15:58:12 +0100 Merge pull request #1164 from aral/patch-1 + a496e6f Phenom Sun, 4 Feb 2018 17:51:26 +0100 Add Chat Room RSLink + ed88b34 Aral B Sun, 4 Feb 2018 10:37:45 +0100 Fix typo in Mac install guide + b662e66 Gioacc Fri, 2 Feb 2018 00:20:14 +0100 Qml app fix disappearing sidebar buttons + 6c85075 csoler Thu, 1 Feb 2018 21:35:54 +0100 lobby->room in Identities dialog + 36e20db Gioacc Thu, 1 Feb 2018 21:26:36 +0100 Fix some glitches in qml app menu + 6e093c7 Gioacc Thu, 1 Feb 2018 14:59:08 +0100 Qml token manager removed unuseful debug message + 2d00532 Gioacc Thu, 1 Feb 2018 14:42:46 +0100 Qml app fix sidebar buttons hiding behaviour + 1c698bf Gioacc Thu, 1 Feb 2018 14:31:07 +0100 Qml App add option to control DHT behaviour + 9a9fcca Gioacc Thu, 1 Feb 2018 14:22:33 +0100 Qml App token manager offer unregister token API + 1e3d2c2 csoler Tue, 30 Jan 2018 20:55:01 +0100 Merge pull request #1160 from G10h4ck/android_service_cleaning + 6f91b93 Gioacc Tue, 30 Jan 2018 20:07:51 +0100 Add some sanity check in libresapiclient + 4d60850 Gioacc Tue, 30 Jan 2018 18:25:04 +0100 More cleanup of .pro files + 0012586 Gioacc Tue, 30 Jan 2018 18:24:03 +0100 Add support for SQLCipher on Android + ebfe50f Gioacc Tue, 30 Jan 2018 18:11:31 +0100 Make .pro files compiler agnostic on Android + da2fc01 Gioacc Tue, 30 Jan 2018 18:04:24 +0100 Cleanup a bit libresapi.pro + 180a5b1 Gioacc Tue, 30 Jan 2018 18:02:55 +0100 Remove unnecessary dependencies in android-notify-service + feae9f5 Gioacc Tue, 30 Jan 2018 00:36:19 +0100 Fix some compiler warnings + fc5ed14 Gioacc Mon, 29 Jan 2018 22:44:04 +0100 Android toolchain builder libraries update + fa71ed2 Gioacc Mon, 29 Jan 2018 13:26:43 +0100 Install bdboot.txt in Android + 2d8493f Gioacc Mon, 29 Jan 2018 10:56:12 +0100 Add link on how help confused gdb to give stacktrace + efe78f5 csoler Sun, 28 Jan 2018 21:54:56 +0100 slight optimization to showEvent() and save/restore visible items in file lists + d598a01 Gioacc Sun, 28 Jan 2018 11:38:14 +0100 ApiLocalListener do some sanity check on listen + 5a63ce8 Gioacc Sun, 28 Jan 2018 11:36:51 +0100 Android service avoid shouldexit timer using all CPU available + 3e5ed6a Gioacc Fri, 26 Jan 2018 00:18:31 +0100 Update Androig gdb debug instructions + c39b3e5 Gioacc Thu, 25 Jan 2018 16:20:25 +0100 Better debug messages for Android app + ac9a843 Gioacc Thu, 25 Jan 2018 15:50:12 +0100 Gracefully handle signals in retroshare-android-service + 8c21bfc Gioacc Thu, 25 Jan 2018 15:18:12 +0100 Avoid crash on stop in ApiServerLocal + c1d8d6a Gioacc Thu, 25 Jan 2018 15:14:09 +0100 Properly run Qt event loop + d80a806 csoler Thu, 25 Jan 2018 09:37:31 +0100 Merge pull request #1159 from csoler/v0.6-FileLists + 11eef05 csoler Wed, 24 Jan 2018 22:02:49 +0100 fixed bug causing hidden/expanded items to be reset by show() event in SharedFilesDialog + 1fbd9d1 csoler Wed, 24 Jan 2018 21:26:35 +0100 fixed hiding of top level items when searching + f139685 csoler Wed, 24 Jan 2018 21:14:26 +0100 added a fair limit to search in FL in order to avoid crazy costs + d93e259 csoler Wed, 24 Jan 2018 00:26:22 +0100 fixed expanding/collapsing of items on search + 1ee353c csoler Tue, 23 Jan 2018 22:18:35 +0100 improved efficiency of search in tree visualization mode. Re-enabled the search for testing purpose. + 725abad csoler Tue, 23 Jan 2018 22:18:02 +0100 fixed a bug in filterItems that caused searched files to generate an error in the console + 9b286c4 Gioacc Tue, 23 Jan 2018 11:13:03 +0100 add to README that DHT is not working on android + 000bbbd Gioacc Tue, 23 Jan 2018 10:33:00 +0100 Add link to Android debugging documentation + 7afa19e csoler Sun, 21 Jan 2018 22:23:08 +0100 removed search from tree view in file lists, until I find some way to do it more efficiently + 7448ff4 csoler Sun, 21 Jan 2018 19:07:37 +0100 re-enabled search in file lists tree view + d21a5e5 csoler Sat, 20 Jan 2018 19:25:52 +0100 Merge pull request #1157 from PhenomRetroShare/Fix_IconCacheInFilesDefs + f74ee5c Phenom Sat, 20 Jan 2018 17:21:37 +0100 Move File Icon Cache in FilesDefs + 7652821 Phenom Sat, 20 Jan 2018 17:18:50 +0100 Revert "patch from sss to cache TransfersDialog QIcons" + 4c626e0 csoler Mon, 15 Jan 2018 23:17:09 +0100 Merge pull request #1152 from csoler/v0.6-SecurityFixes + 841fee6 csoler Mon, 15 Jan 2018 23:13:42 +0100 fixed possible crash due to accessing deleted memory in database cache access + 7cac367 csoler Sun, 14 Jan 2018 22:39:50 +0100 removed warnign about bad service string when the service string is actually empty + 388b2c2 csoler Fri, 12 Jan 2018 22:47:42 +0100 patch from sss to cache TransfersDialog QIcons + 783e918 csoler Fri, 12 Jan 2018 22:19:52 +0100 Merge pull request #1151 from csoler/v0.6-SecurityFixes + bbd8afe csoler Thu, 11 Jan 2018 18:14:20 +0100 Merge pull request #1150 from chelovechishko/unfocus_chat_text_edit + 173336e csoler Thu, 11 Jan 2018 18:12:22 +0100 Merge pull request #1148 from chelovechishko/qdarkstyle_fix + b4ff14c csoler Thu, 11 Jan 2018 18:06:48 +0100 Merge pull request #1144 from PhenomRetroShare/Fix_DisableYesButtonOnInvite + bb9dcbb Phenom Fri, 5 Jan 2018 14:45:29 +0100 Disable Yes button on chat room invitation if no Id selected. + add9c1e chelov Wed, 10 Jan 2018 20:53:43 +0900 chatwidget: do not set focus to edit when it is not necessary + 4eea5a8 csoler Wed, 10 Jan 2018 00:10:08 +0100 removed consts in GrpMetaCache pointers, and made it possible to always re=use cache entries, possibly updating them + 553ab93 csoler Tue, 9 Jan 2018 22:18:01 +0100 Merge pull request #1149 from csoler/v0.6-SecurityFixes + 506190a csoler Tue, 9 Jan 2018 22:11:11 +0100 fixed bug causing failure of flag actions on groups + ed81b4c csoler Tue, 9 Jan 2018 21:49:15 +0100 removed delete causing read of deleted memory + 51c7942 csoler Mon, 8 Jan 2018 19:08:10 +0100 Merge pull request #1146 from csoler/v0.6-SecurityFixes + e261d45 chelov Mon, 8 Jan 2018 16:16:10 +0900 gui: fix networkdialog colors once more in qdarkstyle.qss + f8f61cc chelov Mon, 8 Jan 2018 16:02:40 +0900 gui: fix colors for idtree of people in qdarkstyle.qss + 884bbb4 chelov Mon, 8 Jan 2018 15:58:04 +0900 gui: make friendlist more readable in some places in qdarkstyle.qss + 622316a chelov Mon, 8 Jan 2018 15:49:05 +0900 gui: improve readability of sharemanager for qdarkstyle.qss + 5e57cb4 csoler Sun, 7 Jan 2018 23:02:22 +0100 fixed gxs unit tests + 85b94d7 csoler Sun, 7 Jan 2018 22:36:49 +0100 fixed test compilation + 89c538d csoler Sun, 7 Jan 2018 22:36:38 +0100 fixed double deletion problem causing crashes + b42b8e3 csoler Sun, 7 Jan 2018 21:41:41 +0100 moved memory ownership of RsGxsGrpMetaData down into RsGxsDataAccess. Avoids many copy-constructors of RsTlvSecurityKey. Will probably spare a lot of CPU on windows + c3e300e Gioacc Sat, 6 Jan 2018 22:53:26 +0100 Merge pull request #1140 from Emotyco/libresapi_small_corrections + 67fc6a3 Konrad Sat, 6 Jan 2018 19:29:56 +0100 Fixed in Libresapi: Double declaration of StateToken in FileSharingHandler + 575a416 Konrad Sat, 6 Jan 2018 19:09:44 +0100 Changed in Libresapi: Used Doxigen style comments + d53993c Konrad Sat, 6 Jan 2018 18:39:47 +0100 Changed in Libresapi: Pointer to RsNotify object into reference + 57f41d9 csoler Fri, 5 Jan 2018 21:27:18 +0100 Merge pull request #1145 from PhenomRetroShare/Fix_ClearPersonDetailIfNoSelection + 4026040 Konrad Fri, 5 Jan 2018 20:44:48 +0100 Libresapi: Extended ChatInfo class to contain own identity used in chat + 4f902bb Phenom Fri, 5 Jan 2018 17:48:18 +0100 Clear Person Detail when no selection + 0078b9c csoler Wed, 3 Jan 2018 20:33:25 +0100 Merge pull request #1143 from csoler/v0.6-SecurityFixes + 98d1d08 csoler Wed, 3 Jan 2018 20:32:37 +0100 removed extra links from chat widget, since normal links can be used now to DL through encrypted tunnels + ee81eef csoler Wed, 3 Jan 2018 18:42:04 +0100 Merge pull request #1142 from csoler/v0.6-SecurityFixes + ab60f49 csoler Wed, 3 Jan 2018 18:37:43 +0100 prevent sending/receiving of IP addresses to/at hidden nodes + 0a92710 csoler Wed, 3 Jan 2018 15:03:23 +0100 Merge pull request #1141 from csoler/v0.6-SecurityFixes + 0f6006d csoler Wed, 3 Jan 2018 15:01:04 +0100 prevent subscribing to a signed chat room without a signed identity + eea0c64 csoler Wed, 3 Jan 2018 14:05:13 +0100 require signed identity to respond to a signed chat room invite. Avoids "god mode" bug. + 96e7507 Konrad Mon, 1 Jan 2018 23:38:07 +0100 Added in Libresapi: Short comment to FileSharingHandler + 9bb6adc Konrad Mon, 1 Jan 2018 23:27:46 +0100 Added in Libresapi: Missing mutex locking in TransfersHandler + 6a61e0a Konrad Mon, 1 Jan 2018 23:20:26 +0100 Changed in Libresapi: Locking mutex using macro instead of RsStackMutex object creation + 74a56f6 Konrad Fri, 29 Dec 2017 16:07:39 +0100 Changed in Libresapi: Closing distant connection (chat) requires now ChatId that is used in other functions, instead of DistantCharPeerId + 4b25684 Konrad Fri, 29 Dec 2017 16:03:45 +0100 Added in Libresapi: Functions to get and set default identity for lobby + b24d772 Konrad Wed, 27 Dec 2017 22:38:04 +0100 Added in Libresapi: Getting node name in PeersHandler + 2db25d4 Konrad Wed, 27 Dec 2017 22:37:14 +0100 Added in Libresapi: StateToken refreshing to TransferHandler + 53118e5 Konrad Wed, 27 Dec 2017 22:35:51 +0100 Added in Libresapi: Missing bracket in ChatHandler + 92df847 Konrad Wed, 27 Dec 2017 22:33:23 +0100 Added in Libresapi: StateTokens to FileSharingHandler + 55385d7 Konrad Wed, 27 Dec 2017 22:31:17 +0100 Added in Libresapi: Marking particular message as read + 49cacc4 csoler Sun, 24 Dec 2017 12:04:15 +0100 fixed compilation on ubuntu precise + 122f6af csoler Sun, 24 Dec 2017 11:06:03 +0100 fixed compilation on ubuntu precise + 72d64c7 csoler Sun, 24 Dec 2017 10:36:08 +0100 updated changelog + + -- Retroshare Dev Team Sat, 10 Feb 2018 14:00:00 +0100 + +retroshare (0.6.3-1.20171224.72d64c7d~artful) precise; urgency=low + + c2d5579 csoler Thu, 21 Dec 2017 17:06:32 +0100 storage of chat room icons in local variables to avoid re-reading them from qrc everytime (patch from sss) + acd8355 Gioacc Wed, 20 Dec 2017 18:24:28 +0100 Add some documentation on how to debug retroshare on android + c0d8333 csoler Mon, 18 Dec 2017 16:10:52 +0100 Merge pull request #1136 from csoler/v0.6-FT + ed0e280 csoler Mon, 18 Dec 2017 16:01:27 +0100 Merge pull request #1135 from PhenomRetroShare/Fix_DontSetMacOsTargetIfNotMacOs + 4950ffb Phenom Fri, 15 Dec 2017 10:01:30 +0100 Don't Set Target and SDK if not MacOS + 0895b3d csoler Sun, 17 Dec 2017 13:55:50 +0100 Merge pull request #1134 from PhenomRetroShare/Fix_TravisCI_MacOS_Compil + 3007fec csoler Sat, 16 Dec 2017 17:46:44 +0100 fixed colors in keyring with new ModelIndex based view (patch from sss) + 99e35b1 csoler Sat, 16 Dec 2017 15:04:16 +0100 rename file in partials into real name before moving it; check for destination directory before moving file + a3acd58 Phenom Fri, 8 Dec 2017 19:00:34 +0100 Fix TravisCI on MacOS compilation. + acbcba8 csoler Thu, 7 Dec 2017 17:20:27 +0100 attempt to fix icon sizes in identity dialog + d2c8ba1 csoler Mon, 4 Dec 2017 16:33:45 +0100 Merge pull request #1117 from chelovechishko/qdarkstyle_fix + 22292fc csoler Mon, 4 Dec 2017 16:32:37 +0100 Merge pull request #1118 from RetroPooh/net_settings_antifreeze + 621ed71 csoler Mon, 4 Dec 2017 16:31:48 +0100 Merge pull request #1120 from sehraf/pr_fixForumDownloadAll + 0503f42 csoler Mon, 4 Dec 2017 16:30:29 +0100 Merge pull request #1119 from RetroPooh/chan-fix-cyr + 49b4057 sehraf Sat, 2 Dec 2017 15:00:24 +0100 fix 'download all' button for forum. Now all file links are opened in one collection dialog instead of each link in one separate dialog. + 98d2772 chelov Sat, 2 Dec 2017 17:10:15 +0900 gui: make forums_dialog slightly more readable sometimes + 8ec69df RetroP Wed, 29 Nov 2017 19:23:52 +0300 fix cyrillic text sent wrong in channel post + a88c2ef RetroP Wed, 29 Nov 2017 17:17:49 +0300 fix freezes in network settings + b99a1a5 defnax Tue, 28 Nov 2017 19:36:39 +0100 fixed the emote file for unshown emotes on gui + d1cdba8 Chelov Mon, 27 Nov 2017 14:48:14 +0900 gui: fix probably mistake with names in qdarkstyle.qss + 8c34a50 Chelov Mon, 27 Nov 2017 11:16:37 +0900 gui: fix default color of some text in friends list in qdarkstyle.qss + d566a2a Chelov Mon, 27 Nov 2017 10:54:19 +0900 gui: fix keyring background color in qdarkstyle.qss + c05dd30 Chelov Mon, 27 Nov 2017 10:40:24 +0900 gui: fix doubled semicolons in qdarkstyle.qss + 63b3acb csoler Thu, 23 Nov 2017 21:27:03 +0100 Merge pull request #1113 from csoler/v0.6-SSL110Fix + 1faa274 csoler Wed, 22 Nov 2017 23:46:57 +0100 simplified memory management in certificate signature verification code + 669f2ba csoler Wed, 22 Nov 2017 22:56:40 +0100 fixed a few bugs in signature verification code accross versions + c8c90ab csoler Wed, 22 Nov 2017 20:31:49 +0100 Merge pull request #1115 from PhenomRetroShare/Add_CopyComment + f6d69e0 csoler Wed, 22 Nov 2017 00:02:11 +0100 ensured maximum backward compatibility for crypto changes that will occur in future v0.7 + 6d4c942 Gioacc Tue, 21 Nov 2017 13:28:24 +0100 Removed unnecessary executable flag on some files + 49d2366 csoler Tue, 21 Nov 2017 09:29:52 +0100 fixed windows compilation + ea241f6 csoler Tue, 21 Nov 2017 09:27:21 +0100 restored plugins removed by previous commit + d905144 csoler Mon, 20 Nov 2017 23:18:53 +0100 Merge pull request #1114 from PhenomRetroShare/Fix_DisableReplyToSystemMessage + d1d66bb csoler Mon, 20 Nov 2017 23:17:16 +0100 Merge pull request #1079 from csoler/v0.6-Keyring + e2c1661 csoler Mon, 20 Nov 2017 22:44:34 +0100 fixed compilation with v0.7 defines + cd51afb csoler Mon, 20 Nov 2017 22:26:14 +0100 fixed small bug in signature and compilation + 9367aa0 csoler Sun, 19 Nov 2017 20:15:36 +0100 changed #ifs into #ifdefs because it us more robust, and moved the definition of variables to retroshare.pri + ef1a613 csoler Sun, 19 Nov 2017 19:57:38 +0100 added proper debug output for signature verification + 863e625 csoler Sun, 19 Nov 2017 19:34:54 +0100 centralized the defines into a single file + e72bd9f csoler Sun, 19 Nov 2017 18:38:46 +0100 fixed bug causing certificate rejection + b4fdd4e csoler Sun, 19 Nov 2017 18:21:56 +0100 added two additional non packward compatible changes for future version 0.7, and improvements of verifications of certificate signatures + 46a6bdc Phenom Sat, 18 Nov 2017 19:48:38 +0100 Add Copy action for Gxs Comments. + 71efb9f Phenom Sat, 18 Nov 2017 18:49:42 +0100 Disable ReplyTo if System Message. + 7472f78 csoler Wed, 15 Nov 2017 23:24:43 +0100 added sha256 calculation functions, and non backward compatible SSL Id computation code to active later (0.7) + ce14219 csoler Tue, 14 Nov 2017 21:39:46 +0100 merged with upstream/master + 9f8f0e9 csoler Tue, 14 Nov 2017 21:36:04 +0100 fixed column names in keyring + ba7cf49 csoler Tue, 14 Nov 2017 20:53:24 +0100 Merge pull request #1037 from RetroPooh/searchspy + 556f93c csoler Tue, 14 Nov 2017 20:51:25 +0100 Merge pull request #1108 from RetroPooh/smallfixes2 + 2f6517a csoler Tue, 14 Nov 2017 20:50:57 +0100 Merge pull request #1112 from RetroPooh/coll_name_as_dir + fdced92 csoler Tue, 14 Nov 2017 20:41:48 +0100 Merge pull request #1111 from RetroPooh/searstr + 1f207ba RetroP Tue, 14 Nov 2017 19:52:48 +0300 create collection dialog filename as dir name + 919d650 RetroP Tue, 14 Nov 2017 16:09:05 +0300 in search strings change comma to space for better look + 9aa6dd3 Pooh Tue, 14 Nov 2017 14:34:22 +0300 Update rsturtleitem.h + 8368a76 csoler Mon, 13 Nov 2017 23:38:25 +0100 Merge pull request #1110 from csoler/v0.6-FT + 5fab053 csoler Mon, 13 Nov 2017 23:37:53 +0100 added toStdString() method to search strings so as to display what is searched + 7304c48 csoler Mon, 13 Nov 2017 22:32:30 +0100 Merge pull request #1109 from csoler/v0.6-Links2 + 5d6225a RetroP Tue, 14 Nov 2017 00:14:16 +0300 sort by time, nicer look + 1669cd4 csoler Mon, 13 Nov 2017 22:08:05 +0100 use "download..." menu with RsCollectionDialog with multiple files and directories + f369ac1 RetroP Mon, 13 Nov 2017 19:05:16 +0300 fix mail fields stretching with CC BCC + 45c8e9e csoler Mon, 13 Nov 2017 11:01:48 +0100 Merge pull request #1107 from csoler/v0.6-Links2 + 5997c10 csoler Sun, 12 Nov 2017 22:46:29 +0100 fixed bug causing RsCollection to fail on remote files. Now using RsCollectionDialog when downloading directories from friend shared files + c0951b3 csoler Sun, 12 Nov 2017 21:33:21 +0100 Merge pull request #1040 from RetroPooh/searchmultinames2 + 240d3a6 csoler Sat, 11 Nov 2017 16:33:30 +0100 Merge pull request #1104 from RetroPooh/linkaddrtooltips + cb77243 csoler Sat, 11 Nov 2017 16:31:33 +0100 Merge pull request #1105 from RetroPooh/smallfixes1 + 9b66e7e RetroP Fri, 10 Nov 2017 18:32:18 +0300 fix non-latin peer name display in bw stats + 792f7ff RetroP Fri, 10 Nov 2017 18:31:41 +0300 fix status led icons for distant chat + df244fd RetroP Fri, 10 Nov 2017 16:01:11 +0300 add tooltips with address to urls + 7feb630 csoler Wed, 8 Nov 2017 20:11:26 +0100 Merge pull request #1102 from csoler/v0.6-Links2 + 6a8bc8b csoler Wed, 8 Nov 2017 18:11:46 +0100 use of RsCollectionDialog for processing single file links. Only "extra" links still require the older processing system because RsCollections cannot have sources for each entry + + -- Retroshare Dev Team Thu, 24 Dec 2017 10:00:00 +0100 + +retroshare (0.6.3-1.20171107.c67143d4~wily) wily; urgency=low + + 68b35f3 Phenom Tue, 15 Aug 2017 19:45:26 +0200 Fix CppCheck in notifytxt.cc + 0b8d684 Phenom Tue, 15 Aug 2017 19:11:32 +0200 Fix CppCheck in framecatcher.cpp + deb6693 Phenom Tue, 15 Aug 2017 19:00:17 +0200 Fix CppCheck in idle.cpp + 589e61f Phenom Sun, 13 Aug 2017 20:44:34 +0200 Fix CppCheck in rsettings.cpp + 5554f4a Phenom Sun, 13 Aug 2017 19:47:16 +0200 Fix CppCheck in MimeTextEdit.h + 8438d70 Phenom Sun, 13 Aug 2017 18:47:36 +0200 Fix CppCheck in GroupTreeWidget.h + f82ec64 Phenom Fri, 28 Jul 2017 09:38:24 +0200 Fix CppCheck in rsrttitems.h + 7e47be5 Phenom Thu, 27 Jul 2017 20:41:17 +0200 Fix CppCheck rsitem.h + 4780713 Phenom Thu, 27 Jul 2017 20:27:02 +0200 Fix CppCheck in rsgxsrecognitems.h + 732898a Phenom Thu, 27 Jul 2017 20:29:03 +0200 Fix CppCheck in rsgxsupdateitems.h + 942eba3 Phenom Thu, 27 Jul 2017 19:33:31 +0200 Fix CppCheck in rsconfigitems.h + a1fb8f7 Phenom Thu, 27 Jul 2017 16:56:10 +0200 Fix CppCheck in rswire.h + a248ee7 Phenom Thu, 27 Jul 2017 16:54:56 +0200 Fix CppCheck in rsservicecontrol.h + 1c862de Phenom Thu, 27 Jul 2017 12:56:12 +0200 Fix CppCheck in rsposted.h + ba75294 Phenom Thu, 27 Jul 2017 12:53:47 +0200 Fix CppChecker in rsidentity.h + fee7d45 Phenom Wed, 26 Jul 2017 11:43:11 +0200 Fix CppCheck in rsgxsforums.h + 10c46ee Phenom Thu, 27 Jul 2017 12:54:57 +0200 Fix CppChecker in rsphoto.h + dd4ed2a Phenom Wed, 26 Jul 2017 11:39:54 +0200 Fix CppCheck in rsgxschannels.h + 6219b31 Phenom Wed, 26 Jul 2017 10:52:40 +0200 Fix CppCheck in pqiqos.h + 87947b1 Phenom Wed, 26 Jul 2017 10:35:57 +0200 Fix CppCheck in pqiindic.h + 225058a csoler Sun, 5 Nov 2017 19:37:03 +0100 Merge pull request #1100 from hunbernd/feature/image-embed3 + 5d03ceb hunber Sun, 5 Nov 2017 18:58:07 +0100 Fixed resize bug + 2046249 Phenom Wed, 26 Jul 2017 10:33:55 +0200 Fix CppCheck in pqihandler.cc + b77d027 Phenom Wed, 26 Jul 2017 10:30:33 +0200 Fix CppCheck in p3linkmgr.cc + 73e1ddc Phenom Wed, 26 Jul 2017 10:29:17 +0200 Fix CppCheck in pqi_base.h + 50a9d8a Phenom Fri, 21 Jul 2017 19:08:38 +0200 Fix CppCheck in p3servicecontrol + d21b41f Phenom Fri, 21 Jul 2017 19:02:34 +0200 Fix CppCheck in p3netmgr.cc + 6a0fd11 Phenom Fri, 21 Jul 2017 18:59:59 +0200 Fix CppCheck in p3historymgr.cc + bd56035 Phenom Fri, 21 Jul 2017 18:42:42 +0200 Fix CppCheck in p3cfgmgr.h + 0a82ff0 Phenom Fri, 21 Jul 2017 18:40:43 +0200 Fix CppCheck in authssl.cc + 4fc7787 Phenom Fri, 21 Jul 2017 18:12:59 +0200 Fix CppCheck in authgpg + cd040f6 Phenom Fri, 21 Jul 2017 18:09:54 +0200 Fix CppCheck in pluginmanager.h + 60d4762 Phenom Fri, 21 Jul 2017 18:03:35 +0200 Fix CppCheck in rscertificate.h + f91756a Phenom Fri, 21 Jul 2017 17:57:15 +0200 Fix CppCheck in pgphandler.h + aeb7b33 csoler Sun, 5 Nov 2017 17:00:26 +0100 Merge pull request #1099 from csoler/v0.6-PRTest + 722d98e Phenom Fri, 21 Jul 2017 17:30:26 +0200 Fix CppCheck in rsgxstunnelitems.h + 4ed663a Phenom Fri, 21 Jul 2017 17:23:02 +0200 Fix CppCheck in p3gxstunnel.h + 242cc9d Phenom Fri, 21 Jul 2017 17:22:16 +0200 Fix CppCheck in p3gxstransitems.h + 3702cf2 Phenom Fri, 21 Jul 2017 17:20:11 +0200 Fix CppCheck in p3gxstrans.h + 77c1ab4 Phenom Fri, 21 Jul 2017 16:31:17 +0200 Fix CppCheck in rsgxsdataaccess.h + 718c09e Phenom Fri, 21 Jul 2017 16:29:49 +0200 Fix CppCheck in rsgixs.h + eb7655c Phenom Fri, 21 Jul 2017 16:18:09 +0200 Fix CppCheck in rsgenexchange.cc + 344bc27 Phenom Fri, 21 Jul 2017 15:55:40 +0200 Fix CppCheck in gxstokenqueue.h + f81c6ae Phenom Fri, 21 Jul 2017 15:54:29 +0200 Fix CppCheck in p3grouter + 1072194 Phenom Fri, 21 Jul 2017 14:01:20 +0200 Fix CppCheck in grouteritems.h + 10233ef Phenom Fri, 21 Jul 2017 13:53:44 +0200 Fix CppCheck in groutertypes.h + 5dbefc5 csoler Sun, 5 Nov 2017 16:36:49 +0100 Merge pull request #1098 from csoler/v0.6-PRTest + a622194 Phenom Fri, 21 Jul 2017 13:46:38 +0200 Fix CppCheck in ftturtlefiletransferitem.h + edfd2ad Phenom Fri, 21 Jul 2017 13:36:10 +0200 Fix CppCheck in fttransfermodule + c8548b2 Phenom Fri, 21 Jul 2017 13:33:11 +0200 Fix CppCheck in ftserver.cc + 51ed032 Phenom Fri, 21 Jul 2017 13:13:48 +0200 Fix CppCheck ftfilecreator.cc + 6893449 Phenom Fri, 21 Jul 2017 13:00:03 +0200 Fix CppCheck in ftchunkmap.h + f8d4d6c Phenom Fri, 21 Jul 2017 12:57:17 +0200 Fix CppCheck in p3filelists.h + 0d5b1ed Phenom Fri, 21 Jul 2017 12:47:04 +0200 Fix CppCheck in rsfilelistitems.h + 0e014d6 Phenom Fri, 21 Jul 2017 12:43:06 +0200 Fix CppCheck in p3filelists.cc + d9965ac Phenom Fri, 21 Jul 2017 12:39:05 +0200 Fix CppCheck in hash_cache.h + f18a842 Phenom Fri, 21 Jul 2017 12:27:45 +0200 Fix CppCheck in directory_storage.h and directory_storage.cc + 1456bdd Phenom Fri, 21 Jul 2017 12:18:42 +0200 Fix CppCheck in dir_hierarchy.h and dir_hierarchy.cc + b426941 csoler Sun, 5 Nov 2017 13:57:31 +0100 Merge pull request #1086 from PhenomRetroShare/Fix_SpeedQueuePositionSorting + 8a4c1bd csoler Sun, 5 Nov 2017 13:56:39 +0100 Merge pull request #1097 from PhenomRetroShare/Add_MoveFixedColorToQss + f27d312 Phenom Sat, 4 Nov 2017 23:37:02 +0100 Move some Fixed Color to Qss files + 8072d24 Phenom Sat, 4 Nov 2017 13:57:55 +0100 Use macro for priority values instead of constants. + c5c406b Phenom Sun, 29 Oct 2017 16:45:45 +0100 Fix Speed/Queue Position column sorting + 37f6e7e csoler Fri, 3 Nov 2017 23:49:30 +0100 Merge pull request #1064 from PhenomRetroShare/Fix_OpModeRestore + 1bcebb8 defnax Fri, 3 Nov 2017 13:26:51 +0100 attempt to fix + fc26ebc defnax Fri, 3 Nov 2017 13:04:38 +0100 Fixed one Emojione icon + eb6bc79 defnax Fri, 3 Nov 2017 03:02:40 +0100 reorder the main people emoticons + 48bd151 csoler Thu, 2 Nov 2017 23:16:30 +0100 removed useless root item in RsCollection dialog + 2d18335 csoler Thu, 2 Nov 2017 22:52:30 +0100 added tool button to choose DL directory in rscollection dialog + 6381608 csoler Thu, 2 Nov 2017 22:46:53 +0100 remove filename field in RsCollectionDialog when downloading a collection of links + aa4c209 csoler Thu, 2 Nov 2017 22:20:43 +0100 fixed formula to compute score based on up/dn votes in comments + 42c720f csoler Wed, 1 Nov 2017 20:36:57 +0100 Merge pull request #1082 from RetroPooh/forumoptsimagescb + 1a01181 csoler Wed, 1 Nov 2017 20:35:29 +0100 Merge pull request #1063 from PhenomRetroShare/Fix_BlankPageWhenClearLobbyInWebInterface + d8c4f88 csoler Wed, 1 Nov 2017 20:34:35 +0100 Merge pull request #1094 from PhenomRetroShare/Add_HideFileLabelInChannelPost + 2d8e9d5 csoler Wed, 1 Nov 2017 20:33:54 +0100 Merge pull request #1090 from csoler/v0.6-DHT + a9c4362 csoler Wed, 1 Nov 2017 20:31:49 +0100 removed debug info. Added explaination about the new method + fe5dd00 Gioacc Wed, 1 Nov 2017 14:34:01 +0100 Add context to debug message + 346d5c1 Gioacc Wed, 1 Nov 2017 14:13:04 +0100 Merge pull request #1087 from Emotyco/libresapilocal_debug + f409e8e defnax Wed, 1 Nov 2017 00:24:03 +0100 Update to Emojione 3.0 + a4eedf7 Phenom Mon, 30 Oct 2017 18:35:56 +0100 Hide zero File Label (size) in channel post. + 69278e6 csoler Mon, 30 Oct 2017 11:07:36 +0100 only print non empty buckets + 9f9c34c csoler Mon, 30 Oct 2017 10:58:48 +0100 tried to improve DHT size estimation code + b77e895 csoler Sun, 29 Oct 2017 21:31:10 +0100 Merge pull request #1084 from csoler/v0.6-Links2 + 337980e csoler Sun, 29 Oct 2017 21:28:12 +0100 Merge pull request #1088 from csoler/v0.6-FileLists + 3bb694f csoler Sun, 29 Oct 2017 21:24:34 +0100 added display of hashing speed. Changed hashing buffer size to 10MB to improve performance + 9ad635a csoler Sun, 29 Oct 2017 20:33:56 +0100 added post into forum menu entry in SharedFilesDialog + c41f6a2 Konrad Sun, 29 Oct 2017 19:40:37 +0100 Added: Debug output in Android app of callback functions + 0c97d5b csoler Fri, 27 Oct 2017 22:03:42 +0200 added sorting of channels to push to, and auto-fill of channel subject + 2e9f520 csoler Thu, 26 Oct 2017 19:41:13 +0200 fixed compilation + 299d0b6 csoler Thu, 26 Oct 2017 19:40:12 +0200 added missing test for subscribed channels in share-on-channel menu + 0c3fc05 Gioacc Thu, 26 Oct 2017 08:18:30 +0200 Merge pull request #1066 from Emotyco/libresapi_filesharing + 54d49f1 RetroP Thu, 26 Oct 2017 00:05:45 +0300 friendlist - hide id column by default + f8fca19 RetroP Wed, 25 Oct 2017 23:07:34 +0300 removed wrong tooltip for hidden node in options + 5296641 RetroP Wed, 25 Oct 2017 20:50:34 +0300 fix saving of forum options checkbox for load images + 0931779 csoler Wed, 25 Oct 2017 18:51:16 +0200 Merge pull request #1081 from Artistic-Cabbage/close-fd-after-blacklist + 3975999 Arthur Wed, 25 Oct 2017 17:42:09 +0200 Add missing close after blacklisted connection attempt. + 1c2d17b csoler Tue, 24 Oct 2017 18:47:34 +0200 Merge pull request #1077 from hunbernd/feature/image-embed3 + cd5eb5c hunber Tue, 24 Oct 2017 18:23:22 +0200 Got rid of QMath + 06f489e csoler Mon, 23 Oct 2017 22:14:06 +0200 Merge pull request #1065 from csoler/v0.6-Links2 + 603ea7e csoler Mon, 23 Oct 2017 22:12:52 +0200 removed debug info from RsCollection + f4fae15 csoler Mon, 23 Oct 2017 21:15:40 +0200 Merge pull request #1078 from RetroPooh/addfr-cb + ead8cb2 csoler Mon, 23 Oct 2017 21:13:56 +0200 Merge pull request #1076 from RetroPooh/chatsearchbut + 7af436d csoler Mon, 23 Oct 2017 21:12:26 +0200 Merge pull request #1075 from Kcchouette/patch-1 + e441cae csoler Mon, 23 Oct 2017 21:11:08 +0200 Merge pull request #1074 from RetroPooh/sett-nodiscocb + b275039 csoler Mon, 23 Oct 2017 21:09:54 +0200 Merge pull request #1073 from RetroPooh/hid1 + 1d7d53a csoler Mon, 23 Oct 2017 21:07:23 +0200 Merge pull request #1070 from RetroPooh/posted-descr + e2bbbad RetroP Mon, 23 Oct 2017 20:01:35 +0300 fix checkboxes state for already accepted/signed keys on add friend dialog + 64481de hunber Mon, 23 Oct 2017 17:04:20 +0200 Set the proper size limits + b968974 RetroP Mon, 23 Oct 2017 17:51:39 +0300 fix chat search button position + f434e65 hunber Sun, 11 Jun 2017 00:31:20 +0200 Use binary search to find the right file size + c17a8e7 hunber Sat, 10 Jun 2017 01:43:02 +0200 Optimalizations + af48173 hunber Fri, 9 Jun 2017 23:29:39 +0200 Convert image into 4 bit color table format + 9af2730 hunber Thu, 8 Jun 2017 23:00:33 +0200 Downscale image automatically + e24febf Kcchou Mon, 23 Oct 2017 14:52:10 +0200 Fix some markdown checkbox + 4a1ddcc RetroP Mon, 23 Oct 2017 12:24:56 +0300 removed show discovery checkbox from network options, it is in appearance now + 4594c1a Pooh Mon, 23 Oct 2017 11:51:22 +0300 Update MainWindow.cpp + 1cc6506 Pooh Mon, 23 Oct 2017 11:49:05 +0300 Update ServerPage.cpp + a0f6a74 Pooh Mon, 23 Oct 2017 11:46:39 +0300 Merge branch 'master' into hid1 + 78037a6 RetroP Mon, 23 Oct 2017 11:42:03 +0300 disable nat/dht indicators for hidden mode, hide irrelevant network options elements + 0359795 csoler Sun, 22 Oct 2017 20:08:22 +0200 fixed regression preventing context menu to open in destination directory for RsCollection + 01c82c3 csoler Sun, 22 Oct 2017 20:02:27 +0200 Merge pull request #1072 from hunbernd/fix/html-in-forum-title + a81956c csoler Sun, 22 Oct 2017 20:01:49 +0200 Merge pull request #1071 from hunbernd/fix/crash-at-startup-removed-buttons + 0c39b5c hunber Sun, 22 Oct 2017 19:44:14 +0200 Fix bug causing RS to crash at startup when some icons were removed from toolbar For example: disabled plugins + 4e16042 hunber Sun, 22 Oct 2017 19:11:52 +0200 Part of the forum title is not displayed when it is enclosed in < > + 723016e RetroP Sun, 22 Oct 2017 19:39:44 +0300 fix descriptions display in Posted + 6a0ccc4 csoler Sun, 22 Oct 2017 18:28:36 +0200 added means to select download directory in RsCollectionDialog + ee2120a csoler Sun, 22 Oct 2017 17:36:19 +0200 fixed bug causing FileTree links to open empty + f503510 csoler Sun, 22 Oct 2017 16:00:08 +0200 Merge pull request #1069 from RetroPooh/postbuttonlabels + 34eb971 csoler Sun, 22 Oct 2017 15:57:24 +0200 Merge pull request #1068 from RetroPooh/winsize + 9cc09d6 csoler Sun, 22 Oct 2017 15:55:48 +0200 Merge pull request #1067 from PhenomRetroShare/Fix_SecurityIpItemIsSame + 749a34d RetroP Sun, 22 Oct 2017 15:55:08 +0300 add text labels to post buttons in forums and channels; fix version selector placement + b48916c RetroP Sun, 22 Oct 2017 13:49:38 +0300 add windows size/pos saving + ef13e03 Phenom Sun, 22 Oct 2017 11:52:00 +0200 Fix SecurityIpItem isSame + b6aeacb csoler Sat, 21 Oct 2017 23:48:27 +0200 fixed share on channel code + 770add8 csoler Sat, 21 Oct 2017 21:23:40 +0200 added code to share a file/dir on channel + edffbc3 csoler Sat, 21 Oct 2017 18:09:26 +0200 fixed bug in removing top dirs when creating file hierarhies + cbcf402 csoler Sat, 21 Oct 2017 17:42:17 +0200 setup proper title in RsCollectionEditor when in download mode + 2cfa866 csoler Sat, 21 Oct 2017 17:35:06 +0200 merge of trees and single files before paste in DL queue so that all use the CollectionEditor + fe516c6 csoler Sat, 21 Oct 2017 16:16:23 +0200 fixed pasting of FileTree links in download queue + 6581fa0 csoler Sat, 21 Oct 2017 15:44:45 +0200 code cleaning + b6f102c Gioacc Sat, 21 Oct 2017 13:00:36 +0200 Fix TokenManager.qml JSON API request + fca10c2 Konrad Fri, 20 Oct 2017 21:24:52 +0200 Removed in libresapi unused code that caused compilation error + ef52e09 Konrad Fri, 20 Oct 2017 20:57:37 +0200 Added in Libresapi: Handlers to interact with shared files + 0ebe885 Konrad Fri, 20 Oct 2017 20:55:56 +0200 Added in Libresapi: Handler to get uploading files + 2293b60 Konrad Fri, 20 Oct 2017 20:49:59 +0200 Added in Libresapi: Handler to get search result + 0fbcf01 csoler Thu, 19 Oct 2017 22:20:23 +0200 code cleaning. Removed comments at end of conditional + 74d5069 csoler Thu, 19 Oct 2017 22:14:04 +0200 renamed RsCollectionEditor into RsCollection. Added download of FileTree links + 32be006 csoler Thu, 19 Oct 2017 10:19:56 +0200 various improvements to collection links + 9206dac csoler Wed, 18 Oct 2017 23:20:19 +0200 fixed up collection link display + e1d5014 csoler Wed, 18 Oct 2017 22:32:15 +0200 added copy links from file hierarchy + f98edd4 csoler Wed, 18 Oct 2017 00:04:04 +0200 added FileTree class to implement a compact representation of file hierarchies + 847c1b2 csoler Sun, 15 Oct 2017 21:10:29 +0200 renamed RsCollectionFile into RsCollectionEditor + 68763f5 csoler Sun, 15 Oct 2017 20:52:21 +0200 added links machinery to handle file hierarchies + e63217e Phenom Tue, 17 Oct 2017 15:39:25 +0200 Fix OpMode Restore + 130e3d6 Phenom Tue, 17 Oct 2017 14:57:09 +0200 Fix Blank Page When Clear Lobby in Web Interface + 034d88c Gioacc Mon, 16 Oct 2017 20:07:52 +0200 Fix android compilation with newer Qt + ebf99a4 csoler Sat, 14 Oct 2017 18:10:55 +0200 removed vivid in defautl ubuntu distr list + f161aa8 csoler Sat, 14 Oct 2017 14:57:20 +0200 updated changelog + + -- Retroshare Dev Team Thu, 07 Nov 2017 22:00:00 +0100 + +retroshare (0.6.3-1.20171014.1f624042~trusty) trusty; urgency=low + + d61a5cd csoler Mon, 2 Oct 2017 22:23:26 +0200 attempt at fixing the re-hash bug. Now only using canonicalized filenames in hash cache + 22942dc csoler Sun, 1 Oct 2017 20:20:26 +0200 fixed bug causing suffix/prefix lists to contain an empty string + bc05aaa csoler Sat, 30 Sep 2017 18:58:31 +0200 switched tokenQueue speed to 10 calls/sec, thus improving loading speeds. Still need to test for CPU load + 65977c0 csoler Sat, 30 Sep 2017 18:29:29 +0200 Merge pull request #1054 from PhenomRetroShare/Fix_GccWarningd + 06ebaa5 csoler Sat, 30 Sep 2017 18:28:24 +0200 Merge pull request #1055 from felisucoibi/master + 06063c5 felisu Sat, 30 Sep 2017 11:34:18 +0200 removed extra space + b84c898 felisu Sat, 30 Sep 2017 00:29:07 +0200 Removed ... from text + ef6fd38 felisu Thu, 28 Sep 2017 22:42:30 +0200 Changed prefixes and sifixes for startign with and ending with to be understandable. + 7f851f6 Phenom Thu, 28 Sep 2017 19:24:26 +0200 Fix Gcc Warning in p3banlist + e66c0d1 csoler Wed, 27 Sep 2017 22:26:14 +0200 removed updateTotals() method. Replaced it with costless on-the-fly update of totals + a00d2c9 csoler Tue, 26 Sep 2017 21:12:17 +0200 changed lobby to char room in chat system msgs + 8eae374 csoler Mon, 25 Sep 2017 22:14:34 +0200 Merge pull request #1053 from csoler/v0.6-FT + 0d9b6e7 csoler Mon, 25 Sep 2017 22:09:35 +0200 fixd broken layout + cbeefda csoler Mon, 25 Sep 2017 21:35:59 +0200 Merge pull request #744 from RetroPooh/tunnel-names + f98f16f Pooh Mon, 25 Sep 2017 22:31:49 +0300 Update TransfersDialog.cpp + 5970ff2 csoler Mon, 25 Sep 2017 21:14:30 +0200 Merge pull request #1052 from csoler/v0.6-FT + 40cda11 csoler Mon, 25 Sep 2017 21:05:42 +0200 removed delay when calling forceUpdate() on directories + b969f31 csoler Mon, 25 Sep 2017 20:59:32 +0200 Merge pull request #1050 from csoler/v0.6-FT + d8cb3fe csoler Mon, 25 Sep 2017 20:56:35 +0200 fixed not rehashing files that already exist in a different directory pointed by a symlink + 72dc1c7 Pooh Mon, 25 Sep 2017 21:50:12 +0300 Update TransfersDialog.cpp + c47e6f6 Pooh Mon, 25 Sep 2017 21:43:41 +0300 Merge branch 'master' into tunnel-names + 4766a89 csoler Sun, 24 Sep 2017 23:51:47 +0200 added an additional hard limit to directory depth, just in case + f497905 csoler Sun, 24 Sep 2017 23:43:52 +0200 fixed limitation of directory depth when indexing files + abd7e25 csoler Sun, 24 Sep 2017 18:14:45 +0200 added checks for mMaxShareDepth and mIgnoreDuplicates + 2a99df4 csoler Sun, 24 Sep 2017 17:53:06 +0200 added UI and parameters for two new options in shared files: max share depth and ignore duplicates + 932eb49 csoler Sat, 23 Sep 2017 13:49:53 +0200 Merge pull request #1049 from Steve-V/minor-spelling-fix + 82c9c95 Steve- Fri, 22 Sep 2017 19:58:13 -0500 spelling fix ommitted -> omitted + 73cbf6c csoler Thu, 21 Sep 2017 23:47:11 +0200 Merge pull request #1047 from csoler/v0.6-FT + a2ccf97 csoler Wed, 20 Sep 2017 22:57:32 +0200 removed the 4M files limit on 64bits systems + 308f8ca defnax Tue, 19 Sep 2017 18:34:58 +0200 update qrc file + 58ccf0b csoler Mon, 18 Sep 2017 22:50:35 +0200 Merge pull request #1045 from csoler/v0.6-FT + bc2c9d5 csoler Mon, 18 Sep 2017 22:49:51 +0200 adding pending transfers 100 at a time instead of 1 at a time when loading + 52ca6d0 defnax Mon, 18 Sep 2017 20:49:40 +0200 Added Crystall Ball to emote file + bf7d346 csoler Sun, 17 Sep 2017 20:27:44 +0200 Merge pull request #1043 from csoler/v0.6-FT + e21dec4 csoler Sun, 17 Sep 2017 20:26:46 +0200 Merge pull request #1038 from PhenomRetroShare/Add_UploadUserColumn + d8f621e csoler Sun, 17 Sep 2017 20:14:45 +0200 make forceDirectoryCheck() to desactivate the pause, in case it was left activated + + -- Retroshare Dev Team Sat, 14 Oct 2017 15:00:00 +0100 + +retroshare (0.6.3-1.20170917.c2f321d7~trusty) trusty; urgency=low + + 46d26bf csoler Tue, 12 Sep 2017 21:05:59 +0200 updated ubuntu packagign script + f3c627d csoler Sat, 16 Sep 2017 22:13:53 +0200 Merge pull request #1042 from csoler/v0.6-FT + 8189d66 csoler Sat, 16 Sep 2017 22:13:15 +0200 fixed bug causing anon FT to not resume when restarting RS when the server enforces encryption + 195127f Gioacc Fri, 15 Sep 2017 16:23:38 +0200 Merge pull request #965 from PhenomRetroShare/Fix_GccWarning + 6ad2306 Gioacc Fri, 15 Sep 2017 16:19:48 +0200 Merge pull request #1039 from PhenomRetroShare/Fix_WinCompil + f416686 Phenom Fri, 15 Sep 2017 15:04:43 +0200 Fix Windows Build + 62eefa4 Gioacc Fri, 15 Sep 2017 09:33:01 +0200 Remove cruft from PeersHandler::handleGetInactiveUsers + 341c94e Gioacc Fri, 15 Sep 2017 09:03:50 +0200 PeersHandler::handleRemoveNode only remove location + 7888ec6 Gioacc Fri, 15 Sep 2017 08:56:54 +0200 Remove extra cruft + 016cafd Gioacc Fri, 15 Sep 2017 08:25:30 +0200 Merge branch 'master' of https://github.com/myfingerhurt/RetroShare into myfingerhurt-webui-PR1014 + 331cdd0 csoler Thu, 14 Sep 2017 22:10:25 +0200 Merge pull request #1031 from PhenomRetroShare/Fix_UninitializedStatusInPeersHandler + d5eac2c csoler Thu, 14 Sep 2017 22:06:01 +0200 Merge pull request #1033 from PhenomRetroShare/Add_UploadExpColAll + d7dae0e csoler Thu, 14 Sep 2017 22:02:39 +0200 Merge pull request #1034 from csoler/v0.6-FT + 1d231e6 csoler Thu, 14 Sep 2017 22:01:52 +0200 fixed bug causing file lists to not refresh/show until a friend makes a change + 5511a0b csoler Thu, 14 Sep 2017 21:28:34 +0200 added tooltip for file ignore list + dff0d50 Phenom Thu, 14 Sep 2017 19:22:37 +0200 Add Expand/Collapse All in Upload List + a0ebddb Phenom Fri, 28 Jul 2017 20:00:29 +0200 Fic Gcc warnings: + 4b1161d csoler Tue, 12 Sep 2017 21:03:44 +0200 updated changelog + 762d025 csoler Tue, 12 Sep 2017 17:40:54 +0200 Merge pull request #1027 from PhenomRetroShare/Fix_UninitializedPeerMaxRates + 8884a32 Phenom Mon, 11 Sep 2017 20:18:06 +0200 Fix Uninitilized Peer Max Rates. + 66bf188 csoler Mon, 11 Sep 2017 22:20:27 +0200 Merge pull request #1029 from PhenomRetroShare/Fix_UninitValueInLocalDirUpd + cf90867 Phenom Mon, 11 Sep 2017 21:50:08 +0200 Fix unitialized value in LocalDirectoryUpdater. + 3b7809a csoler Mon, 11 Sep 2017 20:49:11 +0200 Merge pull request #1028 from csoler/v0.6-FT + 551ef63 csoler Mon, 11 Sep 2017 19:36:06 +0200 added default ignore list on linux + c5f91e3 csoler Mon, 11 Sep 2017 19:05:19 +0200 Merge pull request #1026 from csoler/v0.6-FT + 0ca0b72 csoler Mon, 11 Sep 2017 19:02:07 +0200 moved file ignore test to a more appropriate place + eff5c5d csoler Sun, 10 Sep 2017 22:07:36 +0200 added pause to file hashing + ea25d4b csoler Sun, 10 Sep 2017 20:22:17 +0200 improved update of ignore list + 884b3a6 csoler Sun, 10 Sep 2017 19:58:57 +0200 added infrastructure to add a ignore list in shared files + b3e1597 csoler Sat, 9 Sep 2017 18:34:25 +0200 Merge pull request #1025 from Ppjet6/master + c85664e Maxime Sat, 9 Sep 2017 13:54:30 +0100 Typo in GenCertDialog + 1e2a227 csoler Sat, 9 Sep 2017 14:48:35 +0200 Merge pull request #1023 from Ppjet6/master + 1bc9ef6 csoler Sat, 9 Sep 2017 14:48:02 +0200 Merge pull request #1022 from PhenomRetroShare/Fix_MoveSharedFilesDialog + 64d0290 Maxime Sat, 9 Sep 2017 03:47:38 +0100 Typo in GenCertDialog + 4336a4a Phenom Thu, 7 Sep 2017 19:37:53 +0200 Move SharedFilesDialog to /gui/FileTransfer/ + 54ee650 csoler Thu, 7 Sep 2017 18:54:04 +0200 Merge pull request #1021 from PhenomRetroShare/Fix_ProgressSorting + d81f9a3 Phenom Thu, 7 Sep 2017 18:09:21 +0200 Fix File Transfert Progress Sorting. + 1dc6bef csoler Thu, 7 Sep 2017 18:08:34 +0200 Merge pull request #1019 from PhenomRetroShare/Add_GroupedUpLoadItem + 3b4e84c Phenom Wed, 6 Sep 2017 19:57:33 +0200 Regroup Upload Items by file in TransfersDialog. + f9102e5 csoler Tue, 5 Sep 2017 20:59:16 +0200 Merge pull request #1001 from PhenomRetroShare/Add_OnlyHiddenNodeCF + 9ceba80 csoler Tue, 5 Sep 2017 20:46:33 +0200 Merge pull request #1015 from PhenomRetroShare/Fix_TravisCI_MacOS + 671b418 csoler Tue, 5 Sep 2017 20:46:05 +0200 Merge pull request #1008 from PhenomRetroShare/Add_FilterInDownloadList + 32888f0 Phenom Tue, 5 Sep 2017 16:18:47 +0200 Fix Travis CI build for MacOS + bc6ea65 csoler Mon, 4 Sep 2017 16:52:59 +0200 Merge pull request #1000 from PhenomRetroShare/Fix_RemovePngPng + c6ffe07 csoler Mon, 4 Sep 2017 16:48:17 +0200 Merge pull request #1009 from csoler/v0.6-FT + 160ab7b csoler Sun, 3 Sep 2017 23:32:48 +0200 added missing code for remote search by hash, fixing the bug of direct sources not added + 8d14603 csoler Sun, 3 Sep 2017 22:52:31 +0200 fixed bug preventing search by hash to be called on own files + 063783a csoler Sun, 3 Sep 2017 14:59:14 +0200 Merge pull request #1004 from digitigrafo/master + a73ea43 Phenom Sat, 2 Sep 2017 17:57:04 +0200 Add a filter to DownLoad list + e1e1fb4 cri Thu, 24 Aug 2017 15:31:17 +0200 revert build orange skin + 4fc91be cri Thu, 24 Aug 2017 15:08:29 +0200 rwd style + d845a3e cri Thu, 24 Aug 2017 14:32:22 +0200 orange css skin >48em + ea4495f cri Wed, 23 Aug 2017 11:16:26 +0200 added new orange skin + 7f8386f csoler Sun, 20 Aug 2017 21:17:19 +0200 Merge pull request #998 from myfingerhurt/master + 5d59d56 Phenom Sun, 20 Aug 2017 13:17:28 +0200 Add Only Hidden Node configure flag + cb7cfb4 Phenom Sat, 19 Aug 2017 23:55:39 +0200 Remove *.png.png duplicated Files + 130099f ben Fri, 18 Aug 2017 16:27:30 +0900 add new keys for WebUI api peers handling, distinguishable hidden node and clear node when examining certificate + 32f43b9 Gioacc Fri, 18 Aug 2017 01:37:39 +0200 Merge branch 'GSoC2017-evaluation-final' + 106f03d csoler Wed, 16 Aug 2017 22:26:48 +0200 Merge pull request #993 from PhenomRetroShare/Fix_OpenMessageForAllFile + 526d8e7 csoler Wed, 16 Aug 2017 22:26:13 +0200 Merge pull request #990 from PhenomRetroShare/Fix_RelaySettingLayoutMargin + 06158a9 csoler Wed, 16 Aug 2017 22:25:41 +0200 Merge pull request #992 from PhenomRetroShare/Fix_MailFromText + 291bddb csoler Wed, 16 Aug 2017 22:24:17 +0200 Merge pull request #995 from PhenomRetroShare/Fix_AppVeyor + 2a0b9ee csoler Wed, 16 Aug 2017 22:23:15 +0200 Merge pull request #991 from PhenomRetroShare/Fix_TravisMacCompil + 79f09f1 Angela Wed, 16 Aug 2017 14:09:38 +0200 Merge branch 'qml_app_ui_improvements' into GSoC2017-evaluation-final + 18f7733 Angela Wed, 16 Aug 2017 14:09:26 +0200 Merge branch 'qml_app_face_generator' into GSoC2017-evaluation-final + 73a6fee Phenom Sun, 13 Aug 2017 14:34:28 +0200 Fix AppVeyor build by disabling SQLCipher + a87c31f Angela Sun, 13 Aug 2017 13:04:54 +0200 Fix canvas face displaced down + 5a1a84f Angela Sun, 13 Aug 2017 13:02:49 +0200 Refactor use better variable names + 16856ca csoler Sat, 12 Aug 2017 22:32:46 +0200 fixed yml script for AppImage + 041447b Phenom Sat, 12 Aug 2017 15:10:07 +0200 Add "No to All" for RSLink Open message. + 6b2bc7d Phenom Sat, 12 Aug 2017 13:40:28 +0200 Fix From text in Mail + 5a1c316 Phenom Sat, 12 Aug 2017 11:49:33 +0200 Fix Travis MacOs Compilation + 55bb105 Phenom Sat, 12 Aug 2017 11:21:14 +0200 Fix Relay Setting Layout Margin + 03d6751 csoler Fri, 11 Aug 2017 19:33:23 +0200 fixed branching problem in makeSOurcePackage.sh + c3460c3 csoler Fri, 11 Aug 2017 19:27:49 +0200 merged previsous revisions + b8a556a csoler Fri, 11 Aug 2017 19:00:15 +0200 added qt-svg as a dependency + c331f66 csoler Fri, 11 Aug 2017 11:07:59 +0200 added appImage generation system + 545bcde csoler Thu, 10 Aug 2017 10:36:30 +0200 added info for building/packaging on debian stretch + 3ae85db thunde Sun, 6 Aug 2017 14:10:23 +0200 Fixed version number in rsversion.in + 529eabe Gioacc Sun, 6 Aug 2017 11:47:57 +0200 Merge pull request #986 from ngleb/fix-cpp-comment + b686771 Gleb N Sun, 6 Aug 2017 14:27:26 +0700 fix C++ comment to avoid compilation error + 52dbd91 thunde Wed, 2 Aug 2017 10:18:58 +0200 Removed Windows specific hack to get commandline arguments. + ee86768 thunde Sat, 5 Aug 2017 14:19:49 +0200 Fixed name of executable for autostart in Windows Installer + 3e25d96 csoler Fri, 4 Aug 2017 21:38:44 +0200 fixed unix -> linux-* target in .pri, as qt4 doesnt seem to recognise unix + 27ee9ca csoler Thu, 3 Aug 2017 22:55:27 +0200 Merge pull request #982 from csoler/v0.6.3 + 11832e3 csoler Thu, 3 Aug 2017 22:51:40 +0200 updated version number + 4e02c5f csoler Thu, 3 Aug 2017 21:29:52 +0200 Merge pull request #979 from PhenomRetroShare/Fix_LobbyAutoSubscribe + 4b820a0 csoler Thu, 3 Aug 2017 21:08:54 +0200 Merge pull request #981 from csoler/v0.6.3 + 84b32f0 csoler Thu, 3 Aug 2017 20:09:48 +0200 removed newline that comes with debug info + c0f28f5 Angela Thu, 3 Aug 2017 18:31:05 +0200 Set transparent background color + 785bd65 Angela Thu, 3 Aug 2017 18:20:14 +0200 Add shadow to the toolbar + 9f52ffb Angela Thu, 3 Aug 2017 17:29:18 +0200 Increase toolbar size + c790a5b Angela Thu, 3 Aug 2017 16:48:47 +0200 Merge branch 'qml_app_ui_improvements' into GSoC2017-evaluation-II + 83f8860 Angela Thu, 3 Aug 2017 16:48:37 +0200 Merge branch 'qml_app_emoji_font' into GSoC2017-evaluation-II + d70293c Angela Thu, 3 Aug 2017 16:48:27 +0200 Merge branch 'qml_app_notify_unread' into GSoC2017-evaluation-II + 54c8e26 Angela Wed, 2 Aug 2017 18:09:40 +0200 Set emoji font declaration global for all app + 0a5b350 Angela Wed, 2 Aug 2017 17:34:29 +0200 Set RS emoji font as default if no emoji native font is detected + 1cdb3db Angela Wed, 2 Aug 2017 16:51:29 +0200 Add OpenSansEmoji font + beed9be Angela Wed, 2 Aug 2017 15:16:15 +0200 Set bigger row height + e6a3b35 Angela Wed, 2 Aug 2017 12:46:58 +0200 Set image PreserveAspectFit + bf3a230 Angela Wed, 2 Aug 2017 12:34:19 +0200 Fix partially bug: incomplete toDataURL + 6190efe Angela Tue, 1 Aug 2017 16:59:15 +0200 Improve code + 27bedf8 Phenom Tue, 1 Aug 2017 10:15:42 +0200 Fix Lobby auto-subscribe. + 7d5f601 csoler Mon, 31 Jul 2017 19:22:15 +0200 Merge pull request #978 from G10h4ck/cxx11_comp + 541b1ea Gioacc Mon, 31 Jul 2017 18:26:51 +0200 Introduce C++11 compatibility macro for gcc < 4.6 + e39b310 Angela Mon, 31 Jul 2017 17:42:45 +0200 Open chat when click notification of one chat new message + c86b7c7 Angela Mon, 31 Jul 2017 16:52:03 +0200 Open contacts view on click unread notification + 93d778a Angela Mon, 31 Jul 2017 16:11:21 +0200 Show info from message sender when is in only one conversation + c6f562b Angela Mon, 31 Jul 2017 15:34:29 +0200 Fix reset text area with a preedit text message + a041584 csoler Mon, 31 Jul 2017 01:10:35 +0200 Merge pull request #976 from csoler/v0.6.3 + 7ad0ec1 csoler Mon, 31 Jul 2017 01:10:01 +0200 reduced size of GenCertDialog window (guess) and fixed username + 0636142 csoler Sun, 30 Jul 2017 21:29:37 +0200 Merge pull request #973 from PhenomRetroShare/Fix_DontShowAnonIconWhenImageDisabled + 2588068 csoler Sun, 30 Jul 2017 21:29:14 +0200 Merge pull request #953 from PhenomRetroShare/Fix_NewWindowForPassword + 39436f3 csoler Sun, 30 Jul 2017 18:45:56 +0200 Merge pull request #974 from PhenomRetroShare/Fix_WebUI_SettingSaving + c2a3e46 Phenom Sun, 30 Jul 2017 18:29:03 +0200 Fix WebUI Setting Saving. + eb75946 Phenom Sun, 30 Jul 2017 15:30:56 +0200 Fix Don't show Anonymous Icon when Images are disabled in ChatWidget + a2f8b5e csoler Sun, 30 Jul 2017 14:42:28 +0200 Merge pull request #972 from csoler/v0.6.3 + c5fc8f8 csoler Sun, 30 Jul 2017 14:40:53 +0200 replaced images in homepage with the logo without flares + cd6c9cf csoler Sun, 30 Jul 2017 14:38:17 +0200 simplified text on homepage + e82b6fc csoler Sun, 30 Jul 2017 14:31:52 +0200 improved GenCertDialog with small indicator text, and hide location by default + 5dc25e3 Phenom Wed, 19 Jul 2017 19:39:21 +0200 Fix Ask Password in new window if wrong in StartDialog. + b387f15 csoler Sun, 30 Jul 2017 10:36:44 +0200 fixed compilation on qt5 + f5c4561 csoler Sat, 29 Jul 2017 23:41:45 +0200 Merge pull request #968 from csoler/v0.6.3 + 2e1bd2d csoler Sat, 29 Jul 2017 23:39:48 +0200 improved text on cert creation button + 09faa60 csoler Sat, 29 Jul 2017 23:16:47 +0200 Merge pull request #967 from csoler/v0.6.3 + e8415c4 csoler Sat, 29 Jul 2017 23:12:56 +0200 made RS not to ask for plugin confirmation on first load + 345f24e csoler Sat, 29 Jul 2017 22:37:14 +0200 fixed clearing of PGP passphrase after creation of default identity + 6f7e656 csoler Sat, 29 Jul 2017 21:48:12 +0200 Defautl GXS nickname was built from location. Changed it to use profile name + + -- Retroshare Dev Team Tue, 12 Sep 2017 22:00:00 +0100 + +retroshare (0.6.3-1.20170811.03d67515~trusty) trusty; urgency=low a16220e csoler Sat, 29 Jul 2017 20:24:13 +0200 switched to RC2 d10dbf1 csoler Sat, 29 Jul 2017 20:20:53 +0200 Merge pull request #966 from csoler/v0.6.3 diff --git a/build_scripts/Debian+Ubuntu/clean.sh b/build_scripts/Debian+Ubuntu/clean.sh index 4f3ce57f0..cb71980e0 100755 --- a/build_scripts/Debian+Ubuntu/clean.sh +++ b/build_scripts/Debian+Ubuntu/clean.sh @@ -1,11 +1,11 @@ #!/bin/sh rm -f ./libssh-0.5.4.tar.gz.* -rm -f ./retroshare_0.6.3-1.*_source.build -rm -f ./retroshare_0.6.3-1.*_source.changes -rm -f ./retroshare_0.6.3-1.*.tar.gz -rm -f ./retroshare_0.6.3-1.*.diff.gz -rm -f ./retroshare_0.6.3-1.*.dsc +rm -f ./retroshare_0.?.?-1.*_source.build +rm -f ./retroshare_0.?.?-1.*_source.changes +rm -f ./retroshare_0.?.?-1.*.tar.gz +rm -f ./retroshare_0.?.?-1.*.diff.gz +rm -f ./retroshare_0.?.?-1.*.dsc rm -f *.upload rm -f *~ diff --git a/build_scripts/Debian+Ubuntu/control.artful b/build_scripts/Debian+Ubuntu/control.artful new file mode 100644 index 000000000..ebdbf661d --- /dev/null +++ b/build_scripts/Debian+Ubuntu/control.artful @@ -0,0 +1,46 @@ +Source: retroshare +Section: devel +Priority: standard +Maintainer: Cyril Soler +Build-Depends: debhelper (>= 7), git, libglib2.0-dev, libupnp-dev, libssl-dev, libxss-dev, libgnome-keyring-dev, libbz2-dev, libspeex-dev, libspeexdsp-dev, libxslt1-dev, cmake, libcurl4-openssl-dev, libopencv-dev, tcl8.6, libsqlcipher-dev, libmicrohttpd-dev, libavcodec-dev, qtmultimedia5-dev, qttools5-dev, libqt5x11extras5-dev, qt5-default +Standards-Version: 3.9.6 +Homepage: http://retroshare.sourceforge.net + +Package: retroshare-voip-plugin +Architecture: any +Conflicts: retroshare06-voip-plugin +Depends: ${shlibs:Depends}, ${misc:Depends}, retroshare, libspeex1, libspeexdsp1, libqt5multimedia5 +Description: RetroShare VOIP plugin + This package provides a plugin for RetroShare, a secured Friend-to-Friend communication + plateform. The plugin adds voice-over-IP functionality to the private chat window. Both + friends chatting together need the plugin installed to be able to talk together. + +Package: retroshare-feedreader-plugin +Architecture: any +Conflicts: retroshare06-feedreader-plugin +Depends: ${shlibs:Depends}, ${misc:Depends}, retroshare +Description: RetroShare FeedReader plugin + This package provides a plugin for RetroShare, a secured Friend-to-Friend communication + plateform. The plugin adds a RSS feed reader tab to retroshare. + +Package: retroshare-nogui +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, gnome-keyring +Conflicts: retroshare,retroshare06-nogui +Description: Secure communication with friends + This is the command-line client for RetroShare network. This client + can be contacted and talked-to using SSL. Clients exist for portable + devices running e.g. Android. + +Package: retroshare +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, gnome-keyring +Conflicts: retroshare-nogui,retroshare06 +Description: Secure communication with friends + RetroShare is a Open Source cross-platform, private and secure decentralised + commmunication platform. It lets you to securely chat and share files with your + friends and family, using a web-of-trust to authenticate peers and OpenSSL to + encrypt all communication. RetroShare provides filesharing, chat, messages, + forums and channels. + + diff --git a/build_scripts/Debian+Ubuntu/control.bionic b/build_scripts/Debian+Ubuntu/control.bionic new file mode 100644 index 000000000..ebdbf661d --- /dev/null +++ b/build_scripts/Debian+Ubuntu/control.bionic @@ -0,0 +1,46 @@ +Source: retroshare +Section: devel +Priority: standard +Maintainer: Cyril Soler +Build-Depends: debhelper (>= 7), git, libglib2.0-dev, libupnp-dev, libssl-dev, libxss-dev, libgnome-keyring-dev, libbz2-dev, libspeex-dev, libspeexdsp-dev, libxslt1-dev, cmake, libcurl4-openssl-dev, libopencv-dev, tcl8.6, libsqlcipher-dev, libmicrohttpd-dev, libavcodec-dev, qtmultimedia5-dev, qttools5-dev, libqt5x11extras5-dev, qt5-default +Standards-Version: 3.9.6 +Homepage: http://retroshare.sourceforge.net + +Package: retroshare-voip-plugin +Architecture: any +Conflicts: retroshare06-voip-plugin +Depends: ${shlibs:Depends}, ${misc:Depends}, retroshare, libspeex1, libspeexdsp1, libqt5multimedia5 +Description: RetroShare VOIP plugin + This package provides a plugin for RetroShare, a secured Friend-to-Friend communication + plateform. The plugin adds voice-over-IP functionality to the private chat window. Both + friends chatting together need the plugin installed to be able to talk together. + +Package: retroshare-feedreader-plugin +Architecture: any +Conflicts: retroshare06-feedreader-plugin +Depends: ${shlibs:Depends}, ${misc:Depends}, retroshare +Description: RetroShare FeedReader plugin + This package provides a plugin for RetroShare, a secured Friend-to-Friend communication + plateform. The plugin adds a RSS feed reader tab to retroshare. + +Package: retroshare-nogui +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, gnome-keyring +Conflicts: retroshare,retroshare06-nogui +Description: Secure communication with friends + This is the command-line client for RetroShare network. This client + can be contacted and talked-to using SSL. Clients exist for portable + devices running e.g. Android. + +Package: retroshare +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, gnome-keyring +Conflicts: retroshare-nogui,retroshare06 +Description: Secure communication with friends + RetroShare is a Open Source cross-platform, private and secure decentralised + commmunication platform. It lets you to securely chat and share files with your + friends and family, using a web-of-trust to authenticate peers and OpenSSL to + encrypt all communication. RetroShare provides filesharing, chat, messages, + forums and channels. + + diff --git a/build_scripts/Debian+Ubuntu/control.stretch b/build_scripts/Debian+Ubuntu/control.stretch index 5170395a9..f5bbc9fc0 100644 --- a/build_scripts/Debian+Ubuntu/control.stretch +++ b/build_scripts/Debian+Ubuntu/control.stretch @@ -2,7 +2,7 @@ Source: retroshare Section: devel Priority: standard Maintainer: Cyril Soler -Build-Depends: debhelper (>= 7), libglib2.0-dev, libupnp-dev, libssl-dev, libxss-dev, libgnome-keyring-dev, libbz2-dev, libspeex-dev, libspeexdsp-dev, libxslt1-dev, cmake, libcurl4-openssl-dev, libopencv-dev, tcl8.6, libsqlcipher-dev (>= 3.4.0), libmicrohttpd-dev, libavcodec-dev, qtmultimedia5-dev, qttools5-dev, libqt5x11extras5-dev, qt5-default +Build-Depends: debhelper (>= 7), libglib2.0-dev, libupnp-dev, libssl-dev, libxss-dev, libgnome-keyring-dev, libbz2-dev, libspeex-dev, libspeexdsp-dev, libxslt1-dev, cmake, libcurl4-openssl-dev, libopencv-dev, tcl8.6, libsqlcipher-dev (>= 3.4.1), libmicrohttpd-dev, libavcodec-dev, qtmultimedia5-dev, qttools5-dev, libqt5x11extras5-dev, qt5-default Standards-Version: 3.9.6 Homepage: http://retroshare.sourceforge.net diff --git a/build_scripts/Debian+Ubuntu/control.trusty_retrotor b/build_scripts/Debian+Ubuntu/control.trusty_retrotor new file mode 100644 index 000000000..5de94658f --- /dev/null +++ b/build_scripts/Debian+Ubuntu/control.trusty_retrotor @@ -0,0 +1,20 @@ +Source: retroshare +Section: devel +Priority: standard +Maintainer: Cyril Soler +Build-Depends: debhelper (>= 7), libglib2.0-dev, libupnp-dev, libssl-dev, libxss-dev, libgnome-keyring-dev, libbz2-dev, libspeex-dev, libspeexdsp-dev, libxslt1-dev, cmake, libcurl4-openssl-dev, libopencv-dev, tcl8.6, libsqlcipher-dev, libmicrohttpd-dev, libavcodec-dev, qtmultimedia5-dev, qttools5-dev, libqt5x11extras5-dev, qt5-default +Standards-Version: 3.9.6 +Homepage: http://retroshare.net + +Package: retrotor +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, gnome-keyring, tor (>= 0.2.6) +Conflicts: retroshare-nogui,retroshare06,retroshare +Description: Secure communication with friends + RetroShare is a Open Source cross-platform, private and secure decentralised + commmunication platform. It lets you to securely chat and share files with your + friends and family, using a web-of-trust to authenticate peers and OpenSSL to + encrypt all communication. RetroShare provides filesharing, chat, messages, + forums and channels. + + diff --git a/build_scripts/Debian+Ubuntu/control.xenial b/build_scripts/Debian+Ubuntu/control.xenial index 80b452523..ebdbf661d 100644 --- a/build_scripts/Debian+Ubuntu/control.xenial +++ b/build_scripts/Debian+Ubuntu/control.xenial @@ -2,7 +2,7 @@ Source: retroshare Section: devel Priority: standard Maintainer: Cyril Soler -Build-Depends: debhelper (>= 7), libglib2.0-dev, libupnp-dev, libssl-dev, libxss-dev, libgnome-keyring-dev, libbz2-dev, libspeex-dev, libspeexdsp-dev, libxslt1-dev, cmake, libcurl4-openssl-dev, libopencv-dev, tcl8.6, libsqlcipher-dev, libmicrohttpd-dev, libavcodec-dev, qtmultimedia5-dev, qttools5-dev, libqt5x11extras5-dev, qt5-default +Build-Depends: debhelper (>= 7), git, libglib2.0-dev, libupnp-dev, libssl-dev, libxss-dev, libgnome-keyring-dev, libbz2-dev, libspeex-dev, libspeexdsp-dev, libxslt1-dev, cmake, libcurl4-openssl-dev, libopencv-dev, tcl8.6, libsqlcipher-dev, libmicrohttpd-dev, libavcodec-dev, qtmultimedia5-dev, qttools5-dev, libqt5x11extras5-dev, qt5-default Standards-Version: 3.9.6 Homepage: http://retroshare.sourceforge.net diff --git a/build_scripts/Debian+Ubuntu/control.xenial_retrotor b/build_scripts/Debian+Ubuntu/control.xenial_retrotor new file mode 100644 index 000000000..4db7a123c --- /dev/null +++ b/build_scripts/Debian+Ubuntu/control.xenial_retrotor @@ -0,0 +1,20 @@ +Source: retroshare +Section: devel +Priority: standard +Maintainer: Cyril Soler +Build-Depends: debhelper (>= 7), libglib2.0-dev, libupnp-dev, libssl-dev, libxss-dev, libgnome-keyring-dev, libbz2-dev, libspeex-dev, libspeexdsp-dev, libxslt1-dev, cmake, libcurl4-openssl-dev, libopencv-dev, tcl8.6, libsqlcipher-dev, libmicrohttpd-dev, libavcodec-dev, qtmultimedia5-dev, qttools5-dev, libqt5x11extras5-dev, qt5-default +Standards-Version: 3.9.6 +Homepage: http://retroshare.sourceforge.net + +Package: retrotor +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, gnome-keyring, tor (>= 0.2.6) +Conflicts: retroshare-nogui,retroshare06,retroshare +Description: Secure communication with friends + RetroShare is a Open Source cross-platform, private and secure decentralised + commmunication platform. It lets you to securely chat and share files with your + friends and family, using a web-of-trust to authenticate peers and OpenSSL to + encrypt all communication. RetroShare provides filesharing, chat, messages, + forums and channels. + + diff --git a/build_scripts/Debian+Ubuntu/debian/changelog b/build_scripts/Debian+Ubuntu/debian/changelog new file mode 100644 index 000000000..5d7671fc3 --- /dev/null +++ b/build_scripts/Debian+Ubuntu/debian/changelog @@ -0,0 +1,5 @@ +retroshare (0.6.4) UNRELEASED; urgency=medium + + * Initial release for Debian. (Closes: #659069) + + -- Cyril Soler Wed, 09 May 2018 10:11:31 +0200 diff --git a/build_scripts/Debian+Ubuntu/debian/compat b/build_scripts/Debian+Ubuntu/debian/compat index 7f8f011eb..f599e28b8 100644 --- a/build_scripts/Debian+Ubuntu/debian/compat +++ b/build_scripts/Debian+Ubuntu/debian/compat @@ -1 +1 @@ -7 +10 diff --git a/build_scripts/Debian+Ubuntu/debian/control b/build_scripts/Debian+Ubuntu/debian/control index 3d1aaec9d..dda8d05e0 100644 --- a/build_scripts/Debian+Ubuntu/debian/control +++ b/build_scripts/Debian+Ubuntu/debian/control @@ -1,46 +1,41 @@ Source: retroshare Section: devel -Priority: standard +Priority: optional Maintainer: Cyril Soler -Build-Depends: debhelper (>= 7), libglib2.0-dev, libupnp-dev, qt4-dev-tools, libqt4-dev, libssl-dev, libxss-dev, libgnome-keyring-dev, libbz2-dev, libqt4-opengl-dev, libqtmultimediakit1, qtmobility-dev, libspeex-dev, libspeexdsp-dev, libxslt1-dev, cmake, libcurl4-openssl-dev, libopencv-dev, tcl8.5, libsqlcipher-dev, libmicrohttpd-dev, libavcodec-dev -Standards-Version: 3.9.3 +Build-Depends: debhelper (>= 9), git, libglib2.0-dev, libupnp-dev, libssl-dev, libxss-dev, libgnome-keyring-dev, libbz2-dev, libspeex-dev, libspeexdsp-dev, libxslt1-dev, cmake, libcurl4-openssl-dev, libopencv-dev, tcl8.6, libsqlcipher-dev, libmicrohttpd-dev, libavcodec-dev, qtmultimedia5-dev, qttools5-dev, libqt5x11extras5-dev, qtbase5-dev, qt5-qmake, qtbase5-dev-tools +Standards-Version: 4.1.4 Homepage: http://retroshare.sourceforge.net Package: retroshare-voip-plugin Architecture: any -Conflicts: retroshare06-voip-plugin -Depends: ${shlibs:Depends}, ${misc:Depends}, retroshare, libspeex1, libspeexdsp1, libqtmultimediakit1 +Conflicts: +Depends: ${shlibs:Depends}, ${misc:Depends}, retroshare, libspeex1, libspeexdsp1, libqt5multimedia5 Description: RetroShare VOIP plugin - This package provides a plugin for RetroShare, a secured Friend-to-Friend communication + This package provides a plugin for RetroShare, a secured Friend-to-Friend communication plateform. The plugin adds voice-over-IP functionality to the private chat window. Both friends chatting together need the plugin installed to be able to talk together. Package: retroshare-feedreader-plugin Architecture: any -Conflicts: retroshare06-feedreader-plugin +Conflicts: Depends: ${shlibs:Depends}, ${misc:Depends}, retroshare Description: RetroShare FeedReader plugin - This package provides a plugin for RetroShare, a secured Friend-to-Friend communication - plateform. The plugin adds a RSS feed reader tab to retroshare. + Plugin for Retroshare, adding a RSS feed reader tab to retroshare. Package: retroshare-nogui Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, gnome-keyring -Conflicts: retroshare,retroshare06-nogui -Description: Secure communication with friends - This is the command-line client for RetroShare network. This client - can be contacted and talked-to using SSL. Clients exist for portable - devices running e.g. Android. +Conflicts: retroshare +Description: headless version of Retroshare + Headless version of the Retroshare platform. Package: retroshare Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, gnome-keyring -Conflicts: retroshare-nogui,retroshare06 +Conflicts: retroshare-nogui Description: Secure communication with friends - RetroShare is a Open Source cross-platform, private and secure decentralised - commmunication platform. It lets you to securely chat and share files with your - friends and family, using a web-of-trust to authenticate peers and OpenSSL to - encrypt all communication. RetroShare provides filesharing, chat, messages, - forums and channels. + RetroShare is a Open Source, private and secure decentralised + commmunication platform. It creates mesh of computers linked with TLS connections, + on top of which it provides file transfer, asynchronous email, forums, channels and chat. diff --git a/build_scripts/Debian+Ubuntu/debian/copyright b/build_scripts/Debian+Ubuntu/debian/copyright deleted file mode 100644 index 84b7e4a7f..000000000 --- a/build_scripts/Debian+Ubuntu/debian/copyright +++ /dev/null @@ -1,44 +0,0 @@ -This package was debianized by: - - Cyril Soler on Sat, 06 Feb 2010 07:15:46 +0100 - -It was downloaded from: - - - -Upstream Author(s): - - - - -Copyright: - - - - -License: - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This package is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -On Debian systems, the complete text of the GNU General -Public License version 3 can be found in `/usr/share/common-licenses/GPL-3'. - -The Debian packaging is: - - Copyright (C) 2010 Cyril Soler - -and is licensed under the GPL version 3, see above. - -# Please also look if there are files or directories which have a -# different copyright/license attached and list them here. diff --git a/build_scripts/Debian+Ubuntu/debian/copyright b/build_scripts/Debian+Ubuntu/debian/copyright new file mode 120000 index 000000000..f5498e1c0 --- /dev/null +++ b/build_scripts/Debian+Ubuntu/debian/copyright @@ -0,0 +1 @@ +../../../.reuse/dep5 \ No newline at end of file diff --git a/build_scripts/Debian+Ubuntu/debian/retrotor.install b/build_scripts/Debian+Ubuntu/debian/retrotor.install new file mode 100644 index 000000000..2a81067cd --- /dev/null +++ b/build_scripts/Debian+Ubuntu/debian/retrotor.install @@ -0,0 +1,5 @@ +debian/tmp/usr/bin/retroshare +debian/tmp/usr/share/applications/retroshare.desktop +debian/tmp/usr/share/icons/hicolor/* +debian/tmp/usr/share/pixmaps/retroshare.xpm +debian/tmp/usr/share/retroshare/* diff --git a/build_scripts/Debian+Ubuntu/debian/rules b/build_scripts/Debian+Ubuntu/debian/rules index a5cc9dd9a..ececec026 100755 --- a/build_scripts/Debian+Ubuntu/debian/rules +++ b/build_scripts/Debian+Ubuntu/debian/rules @@ -3,35 +3,35 @@ configure: configure-stamp configure-stamp: dh_testdir - cd src && qmake "CONFIG-=debug" "CONFIG+=release" "CONFIG+=rs_autologin" PREFIX=/usr LIB_DIR=/usr/lib RetroShare.pro + cd src && qmake "RS_MAJOR_VERSION=0" "RS_MINOR_VERSION=6" "RS_MINI_VERSION=4" "RS_EXTRA_VERSION=XXXXXX" "CONFIG-=debug" "CONFIG+=release" "CONFIG+=rs_autologin" "CONFIG+=retroshare_plugins" PREFIX=/usr LIB_DIR=/usr/lib RetroShare.pro touch $@ -build: build-stamp +build: build-arch build-indep + build-stamp: configure-stamp dh_testdir - # Add here commands to compile the package. - # cd libssh-0.6.4 && mkdir -p build && cd build && cmake -DWITH_STATIC_LIB=ON .. && make - # cd sqlcipher && ./configure --disable-shared --enable-static --enable-tempstore=yes CFLAGS="-DSQLITE_HAS_CODEC" LDFLAGS="-lcrypto" && make - # mkdir lib - # cp -r libssh-0.6.4 lib/ - #cp -r sqlcipher lib/ - #cd src/rsctrl/src && make cd src && $(MAKE) touch $@ +build-indep: build-stamp + +build-arch: build-stamp + clean: dh_testdir dh_testroot rm -f configure-stamp build-stamp # Add here commands to clean up after the build process. [ ! -f src/Makefile ] || (cd src && $(MAKE) distclean) + dh_prep dh_clean install: build dh_testdir dh_testroot - dh_clean -k + dh_prep + dh_clean #dh_installdirs cd src && $(MAKE) INSTALL_ROOT=$(CURDIR)/debian/tmp install diff --git a/build_scripts/Debian+Ubuntu/debian/source/format b/build_scripts/Debian+Ubuntu/debian/source/format new file mode 100644 index 000000000..d3827e75a --- /dev/null +++ b/build_scripts/Debian+Ubuntu/debian/source/format @@ -0,0 +1 @@ +1.0 diff --git a/build_scripts/Debian+Ubuntu/debian_release_howto.txt b/build_scripts/Debian+Ubuntu/debian_release_howto.txt new file mode 100644 index 000000000..db9f8d9bf --- /dev/null +++ b/build_scripts/Debian+Ubuntu/debian_release_howto.txt @@ -0,0 +1,49 @@ +Creation of a new Debian changelog: + + dch --create --package retroshare --newversion 0.6.4-1 + + Note: dch reads email in $DEBMAIL or $USER@$HOSTNAME, so it should be made correct in debian/changlog + If the email does not match the email in mentors, the package will be rejected. + +dget command to retrieve source package: + + dget -u https://launchpad.net/~retroshare/+archive/ubuntu/stable/+files/retroshare_0.6.4-1.20180313.0e6d27ad~xenial.dsc + + (-u means don't check PGP signature) + +When ready: + * updload the package in a place that can be used to dget the package on mentors.debian.net. + + dput mentors retroshare_0.6.4-1_source.changes + +Checking with lintian: + lintian -EI --pedantic --profile debian retroshare_0.6.4-1_source.changes + echo -e 'display-info=y\ndisplay-experimental=y\npedantic=y\ncolor=auto' > ~/.config/lintian/lintianrc + + Also apply lintian to binaries + * fix overlinking in voip plugin + +Turn the RFP bug into ITP + you have to send an e-mail to control@bugs.debian.org and use the "retitle" command + [05/13/2018] successfully retitled. The mail *body* (instead of subject) needs to contain the command in a single line. + +Todo + x make a sid binary package. + * test in sid using pbuilder chroot system (pbuilder login) + x upload to mentors + x request for sponsorship + * + +Getting help: + https://webchat.oftc.net/ + +Bug creation/report + reportbug -B debian + +Re-do debian/rules according to + https://sources.debian.org/src/sleepyhead/1.0.0-beta-2+dfsg-5/debian/rules/ + the proper way to use qtchooser in d/rules is exporting QT_SELECT in d/rules, see https://pkg-kde.alioth.debian.org/packagingqtbasedstuff.html + disable autologin + +Put the package on salsa: + salsa.debian.org diff --git a/build_scripts/Debian+Ubuntu/how_to_build_for_stretch.txt b/build_scripts/Debian+Ubuntu/how_to_build_for_stretch.txt new file mode 100644 index 000000000..9b3df4452 --- /dev/null +++ b/build_scripts/Debian+Ubuntu/how_to_build_for_stretch.txt @@ -0,0 +1,36 @@ +Aug 09, 2017 +============ + +Building packages for debian stretch requires an extra dependency of libsqlcipher0-3.4.1, which is not shipped mainstream with Debian. +As a consequence, the package needs to be added to pbuilder before it's creating the .deb + +0 - create the .dsc for debian stretch using the RS packaging script + + > ./makeSourcePackage.sh -distribution stretch + + This should produce the file retroshare_0.6.3-1.20170806.3ae85dbc~stretch.dsc + +1 - add /home/csoler/pbuilder/stretch_result as an extra deb repository for pbuilder: + + > cat ~/.pbuilderrc + HOOKDIR="/var/cache/pbuilder/hook.d" + BINDMOUNTS="/home/csoler/pbuilder/stretch_result" + + > cat /var/cache/pbuilder/hook.d/D70results + cd /home/csoler/pbuilder/stretch_result + /usr/bin/dpkg-scanpackages . /dev/null > /home/csoler/pbuilder/stretch_result/Packages + /usr/bin/apt-get update + +2 - make sure that the directory /home/csoler/pbuilder/stretch-result/ contains the packages needed: + + > ls -l ~/pbuilder/stretch_result/ + total 1344 + -rw-r--r-- libsqlcipher0_3.4.1-1_amd64.deb + -rw-r--r-- libsqlcipher-dev_3.4.1-1_amd64.deb + +3 - build the package using additional arguments to pbuilder-dist: + + > pbuilder-dist stretch build --override-config --othermirror "deb [trusted=yes] file:///home/csoler/pbuilder/stretch_result ./" retroshare_0.6.3-1.20170806.3ae85dbc~stretch.dsc + +Sources: + * http://blog.anthonywong.net/2014/10/26/how-to-include-local-packages-for-pbuilder/ diff --git a/build_scripts/Debian+Ubuntu/makeSourcePackage.sh b/build_scripts/Debian+Ubuntu/makeSourcePackage.sh index a5e9e81e1..de99bcb67 100755 --- a/build_scripts/Debian+Ubuntu/makeSourcePackage.sh +++ b/build_scripts/Debian+Ubuntu/makeSourcePackage.sh @@ -1,13 +1,23 @@ #!/bin/sh ###################### PARAMETERS #################### -version="0.6.3" gitpath="https://github.com/RetroShare/RetroShare.git" -workdir=retroshare-${version} branch="master" -#bubba3="Y" # comment out to compile for bubba3 +#branch="v0.6.4-official_release" +#bubba3="Y" # comment out to compile for bubba3 ###################################################### +RS_MAJOR_VERSION=0 +RS_MINOR_VERSION=6 +RS_BUILD_NUMBER=4 + +# echo "RS_MAJOR_VERSION="${RS_MAJOR_VERSION} +# echo "RS_MINOR_VERSION="${RS_MINOR_VERSION} +# echo "RS_BUILD_NUMBER="${RS_BUILD_NUMBER} + +version_number="${RS_MAJOR_VERSION}"'.'"${RS_MINOR_VERSION}"'.'"${RS_BUILD_NUMBER}" +workdir=retroshare-${version_number} + echo This script is going to build the debian source package for RetroShare, from the Git repository. if test -d "${workdir}" ; then @@ -23,9 +33,10 @@ gpgkey="0932399B" date=`git log --pretty=format:"%ai" | head -1 | cut -d\ -f1 | sed -e s/-//g` time=`git log --pretty=format:"%aD" | head -1 | cut -d\ -f5 | sed -e s/://g` -hhsh=`git log --pretty=format:"%H" | head -1 | cut -c1-8` +hhsh=`git log --pretty=format:"%H" | head -1 | cut -c1-8` rev=${date}.${hhsh} +useretrotor="false" while [ ${#} -gt 0 ]; do case ${1} in @@ -33,6 +44,9 @@ while [ ${#} -gt 0 ]; do rev=${1} shift ;; + "-retrotor") shift + useretrotor="true" + ;; "-distribution") shift dist=${1} shift @@ -53,26 +67,45 @@ while [ ${#} -gt 0 ]; do esac done +if test "${useretrotor}" = "true"; then + if ! test "${dist}" = "trusty"; then + echo ERROR: retro-tor can only be packaged for trusty for now. + exit 1; + fi + #gitpath="https://github.com/csoler/RetroShare.git" + #branch="v0.6-TorOnly" +fi + if test "${dist}" = "" ; then - dist="precise trusty vivid xenial yakkety zesty" + dist="trusty xenial artful bionic" fi echo Attempting to get revision number... ccount=`git rev-list --count --all` ccount=`expr $ccount + 8613 - 8267` -echo " "Using PGP key id : ${gpgkey} -echo " "Using distributions: ${dist} -echo " "Commit count : ${ccount} -echo " "Date : ${date} -echo " "Time : ${time} -echo " "Hash : ${hhsh} -echo " "Using branch : ${branch} -echo " "Using revision : ${rev} +gitrev=`git describe | cut -d- -f2-3` + +echo " Workdir :"${workdir} +echo " Version :"${version_number} +echo " Using revision :"${rev} +echo " Git Revision :"${gitrev} +echo " Commit count :"${ccount} +echo " Hash :"${hhsh} +echo " Date :"${date} +echo " Time :"${time} +echo " Using branch :"${branch} +echo " Using distributions:"${dist} +echo " Using PGP key id :"${gpgkey} + +if test ${useretrotor} = "true"; then + echo " "Specific flags : retrotor +fi echo Done. -version="${version}"."${rev}" -echo Got version number ${version}. +version="${version_number}"."${rev}" +echo Got version number ${version} +echo echo Please check that the changelog is up to date. echo Hit ENTER if this is correct. Otherwise hit Ctrl+C read tmp @@ -82,12 +115,18 @@ echo Extracting base archive... mkdir -p ${workdir}/src echo Checking out latest snapshot... cd ${workdir}/src -git clone --depth 1 https://github.com/RetroShare/RetroShare.git --single-branch --branch $branch . +git clone --depth 1 ${gitpath} --single-branch --branch $branch . + +# if ! test "$hhsh" = "" ; then +# echo Checking out revision $hhsh +# git checkout $hhsh +# fi + cd - if ! test -d ${workdir}/src/libretroshare/; then - echo Git clone failed. - exit + echo Git clone failed. + exit fi cp -r debian ${workdir}/debian @@ -95,6 +134,12 @@ cp -r debian ${workdir}/debian # VOIP tweak cp ${workdir}/src/retroshare-gui/src/gui/chat/PopupChatDialog.ui ${workdir}/src/plugins/VOIP/gui/PopupChatDialog.ui +# remove unised qml code, only needed on Android + +rm -rf ${workdir}/src/retroshare-qml-app/ +rm -rf ${workdir}/src/build_scripts/ +rm ${workdir}/debian/*~ + # Cloning sqlcipher # git clone https://github.com/sqlcipher/sqlcipher.git @@ -102,7 +147,7 @@ cd ${workdir} echo Setting version numbers... # setup version numbers -sed -e "s%RS_REVISION_NUMBER.*%RS_REVISION_NUMBER 0x${hhsh}%" src/libretroshare/src/retroshare/rsversion.in > src/libretroshare/src/retroshare/rsversion.h +#sed -e "s%RS_REVISION_NUMBER.*%RS_REVISION_NUMBER 0x${hhsh}%" src/libretroshare/src/retroshare/rsversion.in > src/libretroshare/src/retroshare/rsversion.h # Various cleaning echo Cleaning... @@ -111,30 +156,28 @@ echo Cleaning... echo Calling debuild... for i in ${dist}; do - echo copying changelog for ${i} - sed -e s/XXXXXX/"${rev}"/g -e s/YYYYYY/"${i}"/g ../changelog > debian/changelog - if test "${i}" = "lucid" ; then - cp ../control.ubuntu_lucid debian/control - elif test "${i}" = "zesty" ; then - cp ../control.zesty debian/control - elif test "${i}" = "squeeze" ; then - cp ../control.squeeze_bubba3 debian/control - elif test "${i}" = "precise" ; then - cp ../control.precise debian/control - elif test "${i}" = "xenial" ; then - cp ../control.xenial debian/control - elif test "${i}" = "yakkety" ; then - cp ../control.yakkety debian/control - elif test "${i}" = "stretch" ; then - cp ../control.${i} debian/control - elif test "${i}" = "jessie" ; then - cp ../control.${i} debian/control - else + if ! test "${i}" = "debian"; then + echo copying changelog for ${i} + sed -e s/XXXXXX/"${rev}"/g -e s/YYYYYY/"${i}"/g -e s/ZZZZZZ/"${version_number}"/g ../changelog > debian/changelog + sed -e s/XXXXXX/"-${gitrev}"/g debian/rules > debian_rules_tmp + cp debian_rules_tmp debian/rules + + if test ${useretrotor} = "true"; then + cp ../rules.retrotor debian/rules + cp ../control.trusty_retrotor debian/control + elif test -f ../control."${i}" ; then + echo \/\!\\ Using specific control file for distribution "${i}" + cp ../control."${i}" debian/control + else + echo Using standard control file control."${i}" for distribution "${i}" cp ../debian/control debian/control + fi + else + echo creating official debian release. Using built-in changelog and control files fi - debuild -S -k${gpgkey} + debuild -S -k${gpgkey} --lintian-opts +pedantic -EviIL done cd - diff --git a/build_scripts/Debian+Ubuntu/ppa_upload.sh b/build_scripts/Debian+Ubuntu/ppa_upload.sh index b39a0d845..ff0cbc086 100644 --- a/build_scripts/Debian+Ubuntu/ppa_upload.sh +++ b/build_scripts/Debian+Ubuntu/ppa_upload.sh @@ -1,4 +1,4 @@ #!/bin/sh -for i in `ls retroshare_0.6.3-1.*.changes` ; do +for i in `ls retroshare_0.6.4-1.*.changes` ; do dput ppa:retroshare/unstable $i done diff --git a/build_scripts/Debian+Ubuntu/rules.retrotor b/build_scripts/Debian+Ubuntu/rules.retrotor new file mode 100755 index 000000000..06655ef88 --- /dev/null +++ b/build_scripts/Debian+Ubuntu/rules.retrotor @@ -0,0 +1,61 @@ +#!/usr/bin/make -f + +configure: configure-stamp +configure-stamp: + dh_testdir + cd src && qmake "CONFIG-=debug" "CONFIG+=release retrotor" "CONFIG+=rs_autologin" PREFIX=/usr LIB_DIR=/usr/lib RetroShare.pro + touch $@ + + +build: build-stamp +build-stamp: configure-stamp + dh_testdir + # Add here commands to compile the package. + # cd libssh-0.6.4 && mkdir -p build && cd build && cmake -DWITH_STATIC_LIB=ON .. && make + # cd sqlcipher && ./configure --disable-shared --enable-static --enable-tempstore=yes CFLAGS="-DSQLITE_HAS_CODEC" LDFLAGS="-lcrypto" && make + # mkdir lib + # cp -r libssh-0.6.4 lib/ + #cp -r sqlcipher lib/ + #cd src/rsctrl/src && make + cd src && $(MAKE) + touch $@ + +clean: + dh_testdir + dh_testroot + rm -f configure-stamp build-stamp + # Add here commands to clean up after the build process. + [ ! -f src/Makefile ] || (cd src && $(MAKE) distclean) + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + #dh_installdirs + cd src && $(MAKE) INSTALL_ROOT=$(CURDIR)/debian/tmp install + +# Build architecture-independent files here. +binary-indep: build install +# We have nothing to do by default. + +# Build architecture-dependent files here. +binary-arch: build install + dh_testdir + dh_testroot + dh_install --list-missing + #dh_installdocs + #dh_installexamples + #dh_installman + dh_link + dh_strip + dh_compress + dh_fixperms + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install configure diff --git a/build_scripts/Debian/clean.sh b/build_scripts/Debian/clean.sh new file mode 100755 index 000000000..8750b8f46 --- /dev/null +++ b/build_scripts/Debian/clean.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +rm -f ./retroshare_0.?.?-1_source.build +rm -f ./retroshare_0.?.?-1_source.changes +rm -f ./retroshare_0.?.?-1.tar.gz +rm -f ./retroshare_0.?.?-1.diff.gz +rm -f ./retroshare_0.?.?-1.dsc + +rm -f *~ +find . -name "*~" -exec rm {} \; + diff --git a/build_scripts/Debian/debian/README.Debian b/build_scripts/Debian/debian/README.Debian new file mode 100644 index 000000000..1d60d62a6 --- /dev/null +++ b/build_scripts/Debian/debian/README.Debian @@ -0,0 +1,6 @@ +retroshare for Debian +--------------------- + + + + -- Cyril Soler Sat, 06 Feb 2010 07:15:46 +0100 diff --git a/build_scripts/Debian/debian/changelog b/build_scripts/Debian/debian/changelog new file mode 100644 index 000000000..a071e3a3d --- /dev/null +++ b/build_scripts/Debian/debian/changelog @@ -0,0 +1,5 @@ +retroshare (0.6.5-1) UNRELEASED; urgency=medium + + * Initial release for Debian. (Closes: #659069) + + -- Cyril Soler Wed, 09 May 2018 10:11:31 +0200 diff --git a/build_scripts/Debian/debian/compat b/build_scripts/Debian/debian/compat new file mode 100644 index 000000000..f599e28b8 --- /dev/null +++ b/build_scripts/Debian/debian/compat @@ -0,0 +1 @@ +10 diff --git a/build_scripts/Debian/debian/control b/build_scripts/Debian/debian/control new file mode 100644 index 000000000..67bd67637 --- /dev/null +++ b/build_scripts/Debian/debian/control @@ -0,0 +1,39 @@ +Source: retroshare +Section: devel +Priority: optional +Maintainer: Cyril Soler +Build-Depends: debhelper (>= 10), libglib2.0-dev, libupnp-dev, libssl-dev, libxss-dev, libgnome-keyring-dev, libbz2-dev, libspeex-dev, libspeexdsp-dev, libxslt1-dev, cmake, libcurl4-openssl-dev, libopencv-dev, tcl8.6, libsqlcipher-dev, libmicrohttpd-dev, libavcodec-dev, qtmultimedia5-dev, qttools5-dev, libqt5x11extras5-dev, qtbase5-dev, qt5-qmake, qtbase5-dev-tools +Standards-Version: 4.1.4 +Homepage: http://retroshare.sourceforge.net + +# Package: retroshare-voip-plugin +# Architecture: any +# Depends: ${shlibs:Depends}, ${misc:Depends}, retroshare, libspeex1, libspeexdsp1, libqt5multimedia5 +# Description: VOIP plugin for the Retroshare communication platform +# This package provides a plugin for RetroShare, a secured Friend-to-Friend +# communication plateform. The plugin adds voice-over-IP functionality to the +# private chat window. Both friends chatting together need the plugin installed +# to be able to talk together. +# +# Package: retroshare-feedreader-plugin +# Architecture: any +# Depends: ${shlibs:Depends}, ${misc:Depends}, retroshare +# Description: FeedReader plugin for the Retroshare communication platform +# Plugin for Retroshare, adding a RSS feed reader tab to retroshare. + +Package: retroshare-nogui +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, gnome-keyring +Conflicts: retroshare +Description: headless version of Retroshare software + Headless version of the Retroshare platform. + +Package: retroshare +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, gnome-keyring +Conflicts: retroshare-nogui +Description: Secure communication with friends + RetroShare is a Open Source, private and secure decentralised + commmunication platform. It creates mesh of computers linked with TLS + connections, on top of which it provides file transfer, asynchronous email, + forums, channels and chat. diff --git a/build_scripts/Debian/debian/copyright b/build_scripts/Debian/debian/copyright new file mode 120000 index 000000000..f5498e1c0 --- /dev/null +++ b/build_scripts/Debian/debian/copyright @@ -0,0 +1 @@ +../../../.reuse/dep5 \ No newline at end of file diff --git a/build_scripts/Debian/debian/docs b/build_scripts/Debian/debian/docs new file mode 100644 index 000000000..e69de29bb diff --git a/build_scripts/Debian/debian/retroshare-feedreader-plugin.install b/build_scripts/Debian/debian/retroshare-feedreader-plugin.install new file mode 100644 index 000000000..5fc9c6571 --- /dev/null +++ b/build_scripts/Debian/debian/retroshare-feedreader-plugin.install @@ -0,0 +1 @@ +debian/tmp/usr/lib/retroshare/extensions6/libFeedReader.so* diff --git a/build_scripts/Debian/debian/retroshare-nogui.install b/build_scripts/Debian/debian/retroshare-nogui.install new file mode 100644 index 000000000..5fb7e3c8d --- /dev/null +++ b/build_scripts/Debian/debian/retroshare-nogui.install @@ -0,0 +1,3 @@ +debian/tmp/usr/bin/retroshare-nogui +debian/tmp/usr/share/retroshare/bdboot.txt +debian/tmp/usr/share/retroshare/webui/* diff --git a/build_scripts/Debian/debian/retroshare-voip-plugin.install b/build_scripts/Debian/debian/retroshare-voip-plugin.install new file mode 100644 index 000000000..48f8bdbab --- /dev/null +++ b/build_scripts/Debian/debian/retroshare-voip-plugin.install @@ -0,0 +1 @@ +debian/tmp/usr/lib/retroshare/extensions6/libVOIP.so* diff --git a/build_scripts/Debian/debian/retroshare.install b/build_scripts/Debian/debian/retroshare.install new file mode 100644 index 000000000..e8bfb8315 --- /dev/null +++ b/build_scripts/Debian/debian/retroshare.install @@ -0,0 +1,6 @@ +debian/tmp/usr/bin/retroshare +debian/tmp/usr/bin/retroshare-nogui +debian/tmp/usr/share/applications/retroshare.desktop +debian/tmp/usr/share/icons/hicolor/* +debian/tmp/usr/share/pixmaps/retroshare.xpm +debian/tmp/usr/share/retroshare/* diff --git a/build_scripts/Debian/debian/retrotor.install b/build_scripts/Debian/debian/retrotor.install new file mode 100644 index 000000000..2a81067cd --- /dev/null +++ b/build_scripts/Debian/debian/retrotor.install @@ -0,0 +1,5 @@ +debian/tmp/usr/bin/retroshare +debian/tmp/usr/share/applications/retroshare.desktop +debian/tmp/usr/share/icons/hicolor/* +debian/tmp/usr/share/pixmaps/retroshare.xpm +debian/tmp/usr/share/retroshare/* diff --git a/build_scripts/Debian/debian/rules b/build_scripts/Debian/debian/rules new file mode 100755 index 000000000..28e804a5f --- /dev/null +++ b/build_scripts/Debian/debian/rules @@ -0,0 +1,24 @@ +#!/usr/bin/make -f + +export DH_VERBOSE = 1 + +DPKG_EXPORT_BUILDFLAGS = 1 + +# skip *-dbgsym packages +DEB_BUILD_OPTIONS=noddebs + +include /usr/share/dpkg/default.mk + +#export DEB_BUILD_MAINT_PTIONS = hardening=+all +export QT_SELECT = qt5 + +MY_BUILDDIR = _build + +%: + dh $@ --buildsystem=qmake --builddirectory=$(MY_BUILDDIR) + +# Override dh_auto_configure in order to call qmake on the parent dir. We call mkdir here because of #800738. + +override_dh_auto_configure: + @mkdir -p $(MY_BUILDDIR) + dh_auto_configure -- CONFIG="unix release retroshare_plugins rs_autologin" PREFIX=/usr LIB_DIR=/usr/lib ../src diff --git a/build_scripts/Debian/debian/source/format b/build_scripts/Debian/debian/source/format new file mode 100644 index 000000000..d3827e75a --- /dev/null +++ b/build_scripts/Debian/debian/source/format @@ -0,0 +1 @@ +1.0 diff --git a/build_scripts/Debian/debian_release_howto.txt b/build_scripts/Debian/debian_release_howto.txt new file mode 100644 index 000000000..444eeda76 --- /dev/null +++ b/build_scripts/Debian/debian_release_howto.txt @@ -0,0 +1,151 @@ +Creation of a new Debian changelog: + + dch --create --package retroshare --newversion 0.6.4-1 + + Note: dch reads email in $DEBMAIL or $USER@$HOSTNAME, so it should be made correct in debian/changlog + If the email does not match the email in mentors, the package will be rejected. + +dget command to retrieve source package: + + dget -u https://launchpad.net/~retroshare/+archive/ubuntu/stable/+files/retroshare_0.6.4-1.20180313.0e6d27ad~xenial.dsc + + (-u means don't check PGP signature) + +When ready: + * updload the package in a place that can be used to dget the package on mentors.debian.net. + + dput mentors retroshare_0.6.4-1_source.changes + +Checking with lintian: + lintian -EI --pedantic --profile debian retroshare_0.6.4-1_source.changes + echo -e 'display-info=y\ndisplay-experimental=y\npedantic=y\ncolor=auto' > ~/.config/lintian/lintianrc + + Also apply lintian to binaries + * fix overlinking in voip plugin + +Turn the RFP bug into ITP + you have to send an e-mail to control@bugs.debian.org and use the "retitle" command + [05/13/2018] successfully retitled. The mail *body* (instead of subject) needs to contain the command in a single line. + +Todo + x make a sid binary package. + * test in sid using pbuilder chroot system (pbuilder login) + x upload to mentors + x request for sponsorship + * + +Getting help: + https://webchat.oftc.net/ + +Bug creation/report + reportbug -B debian + +Re-do debian/rules according to + https://sources.debian.org/src/sleepyhead/1.0.0-beta-2+dfsg-5/debian/rules/ + the proper way to use qtchooser in d/rules is exporting QT_SELECT in d/rules, see https://pkg-kde.alioth.debian.org/packagingqtbasedstuff.html + disable autologin + +Put the package on salsa: + salsa.debian.org + +Debian binary changes file signature: + gpg --clearsign -u 0932399B retroshare_0.6.4-1_amd64.changes + + Signature does only work when done with debsign: + debsign -k0932399B retroshare_0.6.4-1.dsc + debsign -k0932399B retroshare_0.6.4-1_source.changes + debsign -k0932399B retroshare_0.6.4-1_amd64.changes + +Uploading-to-mentors bug: + Apparently the system prevents you from uploading while a package is in the + queue. So the upload responds "403 forbidden" whene e.g. the previous + upload was cancelled by ^C. + + +Licensing issues: + Various licenses involved: + + L: re-licence to LGPLv3 + A: re-licence to AGPLv3 + D: delete + d: delete in debian package to avoid licensing problems + + Code part | Licenses | A| Authors | Comment + ------------------------------------------+------------------------+--+----------------------------------------------+------------------------------------------------- + libbitdht | GPLv3 | | drbob, csoler, Retroshare team | + bitdht/bencode.h | Public domain | | Mike Frysinger | + bitdht/bdrandom.h | GPLv2 | L| csoler | + ------------------------------------------+------------------------+--+----------------------------------------------+------------------------------------------------- + libresapi | GPLv3 | | G10H4ck, [], electron128 | Most files are unlicenced + src/api/json.h | MIT | | Jeff Weinstein (jeff.weinstein at gmail) | + src/api/webui-src/app/mithril.min.js | MIT | | Leo Horie | + libretroshare | GPLv2,GPLv3 | | csoler,drbob,Mr-alice,Chris,Thunder | Some files unversionned. + plugins/dlfcn_win32.cc | GPLv2.1 | L| Ramiro Polla | + pqi/authgpg.h | GPLv2 | L| Raghu Dev R. | .cc is authed by drbob + upnp/UPnPBase.h | GPLv2 | L| Marcelo Roberto Jimenez, aMule Team | other code in upnp/ not copyrighted. Re-licensed with permission 10/11/2018 + util/pugiconfig.h | MIT | | Arseny Kapoulkyne | [unused file!] + util/rsstring.h | GPLv2 | L| Thomas Kister | + util/rswin.h | GPLv2 | L| Thomas Kister | + util/rsversioninfo.h | [none] | | Alexandrut | + util/stacktrace.h | GPLv2 | R| Timo Bingmann, G10H4ck | + librssimulator | [None] |dA| No authors | + openpgpsdk | Apache | | Rachell Wilmer, Ben Laurie | + pegmarkdown | All right reserved | | Daniel Jalkut - Code currently unused | will be deleted when creating debian package + plugins/feedreader | GPLv2 | A| Thunder | + plugins/VOIP | | | | + AudioInputConfig.h+ | All right reserved | A| Thorvald Natvig | Permission to re-license on 04/11/2018 + AudioStats.h+ | All right reserved | A| Thorvald Natvig | + AudioWizard.h+ | All right reserved | A| Thorvald Natvig | + SpeexProcessor.h | | | Peter Zotov | + retroshare-android-notify-* | GPLv3 | | G10H4ck | + retroshare-android-service | GPLv3 | | G10H4ck | + retroshare-gui/src | | | Thunder, csoler, drbob, crypton | + control/* | GPLv2 | | Matt Edman, crypton, Justin Hiple | [Unused code] + common/ElideLabel.h | BSD | | Qt Toolkit | + common/FlowLayout.h | BSD | | Qt Toolkit | Is that really Qt code?? Qt examples can be used. + common/html.h | GPLv2 | | Matt Edman, defnax, Justin Hiple | + common/rwindow.h | GPLv2 | | Matt Edman, defnax, Justin Hiple | + common/vmessagebox.h | GPLv2 | | Matt Edman, defnax, Justin Hiple | + common/PictureFlow | unclear | | Ariya Hidayat (@kde.org) | [Unused code] + elastic/* | LGPL | | Trolltech | + FileTransfer/FTIWidget | GPLv2 | | defnax, lsn752 | + FileTransfer/xprogressb | GPLv2 | | Xesc | + help/browser.h | GPLv2 | | Matt Edman, defnax, Justin Hiple | + images/retroshare_win.rc.h | GPLv2 | | crypton | [Unused code] + msgs/textformat.h | GPLv3 | | Merdhah Momeny, Golnaz Nilieh | very simple .h. Can be re-implemented + settings/rsettings.h | GPLv2 | | Matt Edman, defnax, Justin Hiple | + statistics/BandwidthGraphW.h | GPLv2 | | Matt Edman, defnax, Justin Hiple | + statistics/dhtgraph.h | GPLv2 | | Matt Edman, defnax, Justin Hiple | + toaster/MessageToaster.h | GPLv3 | | Xesc | + toaster/DownloadToaster.h | GPLv3 | | Xesc | + About{Widget,Dialog}.h | GPLv2 | | Unipro, Russia | Very small file. + linetypes.h | GPLv2 | | Merdhah Momeny, Golnaz Nilieh | very simple .h. Can be re-implemented + mainpagestack.h | GPLv2 | | Matt Edman, crypton, Justin Hiple | + land/langagesupport.h | GPLv2 | | Matt Edman, crypton, Justin Hiple | + util/log.h | GPLv2 | | Matt Edman, crypton, Justin Hiple | + idle/idle.h | GPLv2 | | Justin Karneges | May be re-implemented + TorControl/* |* Public domaine | | John Brooks | Code from Ricochet.im + util/HandleRichText.h | GPLv2 | | Thomas Kister | + util/misc.h | GPLv2 | | defnax, Christophe Dumez | + util/printpreview.h | GPLv2 | | Trolltech example | + util/retrosharewin32.h | GPLv2 | | Matt Edman, crypton, Justin Hiple | + util/stringutil.h | GPLv2 | | Matt Edman, crypton, Justin Hiple | + rshare.h | GPLv2 | | Matt Edman, crypton, Justin Hiple | + retroshare-nogui/* | GPLv2 | | drbob | + + + Plan: move to GPLv3 with OpenSSL exception + + - Appache is compatible with GPLv3 + + Many files unversionned. + + Use a pointer to the top level licence file + + +Files after switch: + + libresapi/api/json.h MIT license Copyright (c) 2013 Jeff Weinstein (jeff.weinstein at gmail) + libretroshare/src/tcponudp/bss_tou.cc SSL Licence Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + libretroshare/src/upnp/UPnPBase.{h,cpp} GPL Licence Copyright (c) 2004-2009 Marcelo Roberto Jimenez ( phoenix@amule.org ) + diff --git a/build_scripts/Debian/makeSourcePackage.sh b/build_scripts/Debian/makeSourcePackage.sh new file mode 100755 index 000000000..73c24f25b --- /dev/null +++ b/build_scripts/Debian/makeSourcePackage.sh @@ -0,0 +1,193 @@ +#!/bin/sh + +###################### PARAMETERS #################### +gitpath="https://github.com/csoler/RetroShare.git" +#branch="master" +branch="v0.6.5-DebianPackaging" +#bubba3="Y" # comment out to compile for bubba3 +###################################################### + +RS_MAJOR_VERSION=0 +RS_MINOR_VERSION=6 +RS_BUILD_NUMBER=5 + +# echo "RS_MAJOR_VERSION="${RS_MAJOR_VERSION} +# echo "RS_MINOR_VERSION="${RS_MINOR_VERSION} +# echo "RS_BUILD_NUMBER="${RS_BUILD_NUMBER} + +version_number="${RS_MAJOR_VERSION}"'.'"${RS_MINOR_VERSION}"'.'"${RS_BUILD_NUMBER}" +workdir=retroshare-${version_number} + +echo This script is going to build the debian source package for RetroShare, from the Git repository. + +if test -d "${workdir}" ; then + echo Removing the ${workdir} directory... + rm -rf ${workdir} +fi + +# Parse options +rev="" +dist="" +# This is the key for "Cyril Soler " +gpgkey="0932399B" + +date=`git log --pretty=format:"%ai" | head -1 | cut -d\ -f1 | sed -e s/-//g` +time=`git log --pretty=format:"%aD" | head -1 | cut -d\ -f5 | sed -e s/://g` +hhsh=`git log --pretty=format:"%H" | head -1 | cut -c1-8` + +rev=${date}.${hhsh} +useretrotor="false" + +while [ ${#} -gt 0 ]; do + case ${1} in + "-rev") shift + rev=${1} + shift + ;; + "-key") shift + gpgkey=${1} + shift + ;; + "-nodl") + nodl=yes + shift + ;; + "-makeorig") + makeorig=yes + shift + ;; + "-h") shift + echo Package building script for debian/ubuntu distributions + echo Usage: + echo " "${0} '-key [PGP key id] -rev [svn revision number] -distribution [distrib name list with quotes, in (wheezy, sid, precise, saucy, etc)]' + exit 1 + ;; + "*") echo "Unknown option" + exit 1 + ;; + esac +done + +removeIrrelevantFiles() { + echo Removing irrelevant files in directory ${workdir}... + # remove unised qml code, only needed on Android + rm -rf ${workdir}/src/retroshare-qml-app/ + rm -rf ${workdir}/src/librssimulator/ + rm -rf ${workdir}/src/libretroshare/src/tests/ + rm -rf ${workdir}/src/libretroshare/src/unfinished/ + rm -rf ${workdir}/src/libretroshare/unused/ + rm -rf ${workdir}/src/retroshare-android-notify-service/ + rm -rf ${workdir}/src/retroshare-android-service/ + rm -rf ${workdir}/src/libretroshare/src/unused/ + rm -rf ${workdir}/src/supportlibs/ + rm -rf ${workdir}/src/retroshare-service/ + rm -rf ${workdir}/src/plugins/ + rm -rf ${workdir}/src/unittests/ + rm -rf ${workdir}/src/tests/ + rm -rf ${workdir}/src/build_scripts/ + rm -rf ${workdir}/src/libbitdht/src/tests/ + rm -rf ${workdir}/src/libbitdht/src/example/ + rm -rf ${workdir}/src/retroshare-gui/src/gui/WikiPoos/ + rm -rf ${workdir}/src/retroshare-gui/src/Unused/ + rm -f ${workdir}/debian/*~ + rm -f ${workdir}/debian/.*.sw? + rm -f ${workdir}/src/retroshare-gui/src/gui/qss/chat/Bubble_Compact/private/images.sh + rm -f ${workdir}/src/retroshare-gui/src/gui/qss/chat/Bubble/src/images.sh + rm -f ${workdir}/src/retroshare-gui/src/gui/qss/chat/Bubble/public/images.sh + rm -f ${workdir}/src/retroshare-gui/src/gui/qss/chat/Bubble/"history"/images.sh + rm -f ${workdir}/src/retroshare-gui/src/gui/qss/chat/Bubble/private/images.sh +} + +echo Attempting to get revision number... +ccount=`git rev-list --count --all` +ccount=`expr $ccount + 8613 - 8267` + +gitrev=`git describe | cut -d- -f2-3` + +echo " Workdir :"${workdir} +echo " Version :"${version_number} +echo " Using revision :"${rev} +echo " Git Revision :"${gitrev} +echo " Commit count :"${ccount} +echo " Hash :"${hhsh} +echo " Date :"${date} +echo " Time :"${time} +echo " Using branch :"${branch} +echo " Using PGP key id :"${gpgkey} + +if test ${useretrotor} = "true"; then + echo " "Specific flags : retrotor +fi + +echo Done. +version="${version_number}"."${rev}" +echo Got version number ${version} +echo +echo Please check that the changelog is up to date. +echo Hit ENTER if this is correct. Otherwise hit Ctrl+C +read tmp + +echo Extracting base archive... + +if ! test "${makeorig}" = "yes" ; then + if ! test -f retroshare_${version_number}.orig.tar.gz; then + echo Error: no orig file found. Please call with -makeorig option first + exit + fi +fi + +if ! test "${nodl}" = "yes"; then + mkdir -p ${workdir}/src + echo Checking out latest snapshot... + cd ${workdir}/src + git clone --depth 1 ${gitpath} --single-branch --branch $branch . + + cd - + + if ! test -d ${workdir}/src/libretroshare/; then + echo Git clone failed. + exit + fi + + cp -r debian ${workdir}/debian + + # VOIP tweak + cp ${workdir}/src/retroshare-gui/src/gui/chat/PopupChatDialog.ui ${workdir}/src/plugins/VOIP/gui/PopupChatDialog.ui + + removeIrrelevantFiles + + cd ${workdir} + echo Setting version numbers... + + # setup version numbers + # sed -e "s%RS_REVISION_NUMBER.*%RS_REVISION_NUMBER 0x${hhsh}%" src/libretroshare/src/retroshare/rsversion.in > src/libretroshare/src/retroshare/rsversion.h + + # Various cleaning + echo Cleaning... + + \rm -rf src/.git + + if test "${makeorig}" = "yes" ; then + echo making orig archive + cd - + tar zcvf retroshare_${version_number}.orig.tar.gz ${workdir} + exit + fi + + cd - +else + tar zxvf retroshare_${version_number}.orig.tar.gz + + cp -r debian/* ${workdir}/debian/ + removeIrrelevantFiles +fi + +# Cloning sqlcipher +# git clone https://github.com/sqlcipher/sqlcipher.git + +echo Calling debuild... +cd ${workdir} +debuild -S -k${gpgkey} --lintian-opts +pedantic -EviIL +cd - + +exit 0 diff --git a/build_scripts/GitlabCI/base.Dockerfile b/build_scripts/GitlabCI/base.Dockerfile new file mode 100644 index 000000000..f4cf610db --- /dev/null +++ b/build_scripts/GitlabCI/base.Dockerfile @@ -0,0 +1,43 @@ +## Add +--build-arg FRESHCLONE=$(date +%s)+ to docker build commandline to +## 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 + +## 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 + + +## 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 + +FROM ubuntu + +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 + +ARG FRESHCLONE=0 +ARG REPO_URL=https://gitlab.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 \ + 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) diff --git a/build_scripts/GitlabCI/gitlabCI.Dockerfile b/build_scripts/GitlabCI/gitlabCI.Dockerfile new file mode 100644 index 000000000..aa9c6cc87 --- /dev/null +++ b/build_scripts/GitlabCI/gitlabCI.Dockerfile @@ -0,0 +1,18 @@ +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_BRANCH=master +RUN \ + cd RetroShare && 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 \ + 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 && \ + cd .. && rm -rf RetroShare-build diff --git a/build_scripts/OBS b/build_scripts/OBS new file mode 160000 index 000000000..b0d7ae39f --- /dev/null +++ b/build_scripts/OBS @@ -0,0 +1 @@ +Subproject commit b0d7ae39fe9d9192848bbf7b8902d2188da895c9 diff --git a/MacOS_X_InstallGuide.md b/build_scripts/OSX/MacOS_X_InstallGuide.md similarity index 98% rename from MacOS_X_InstallGuide.md rename to build_scripts/OSX/MacOS_X_InstallGuide.md index 2a614c126..8ab94b605 100644 --- a/MacOS_X_InstallGuide.md +++ b/build_scripts/OSX/MacOS_X_InstallGuide.md @@ -10,7 +10,7 @@ Add to the PATH environment variable by editing your *~/.profile* file. export PATH="/users/$USER/Qt/5.5/clang_64/bin:$PATH" -Depends on wich version of Qt you use. +Depends on which version of Qt you use. ## ***Choose if you use MacPort or HomeBrew*** diff --git a/build_scripts/OSX/travis_makeOSXPackage.sh b/build_scripts/OSX/travis_makeOSXPackage.sh new file mode 100755 index 000000000..eb66c7ef3 --- /dev/null +++ b/build_scripts/OSX/travis_makeOSXPackage.sh @@ -0,0 +1,37 @@ +#!/bin/sh + +# Install the 7z to create dmg archives. +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 + +# if test "${TAG_NAME}" = "" ; then +# TAG_NAME = "no_tag" ; +# echo No specific tag used. +# fi + +# This automatically creates retroshare.dmg + +echo "Creating dmg archive..." +macdeployqt retroshare.app -dmg + +#mv retroshare.dmg "retroshare_${TAG_NAME}.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 "${project_dir}/README.md" "README.md" +# cp "${project_dir}/LICENSE" "LICENSE" +# cp "${project_dir}/Qt License" "Qt License" diff --git a/build_scripts/Windows-msys2/.gitignore b/build_scripts/Windows-msys2/.gitignore new file mode 100644 index 000000000..a7b500b79 --- /dev/null +++ b/build_scripts/Windows-msys2/.gitignore @@ -0,0 +1 @@ +/build/env-mod.bat \ No newline at end of file diff --git a/build_scripts/Windows-msys2/WindowsMSys2_InstallGuide.md b/build_scripts/Windows-msys2/WindowsMSys2_InstallGuide.md new file mode 100644 index 000000000..2105112f1 --- /dev/null +++ b/build_scripts/Windows-msys2/WindowsMSys2_InstallGuide.md @@ -0,0 +1,89 @@ +## Compilation on Windows + +The preferred build method on Windows is by using MSYS2 which is a collection +of packages providing unix-like tools to build native Windows software. + +Requirements: about 12 GB of free space + +The resulting binary is a 32-bit build of Retroshare which will also work +fine on a 64-bit system. + +**If you want to make complet solution without debugging it, prefer to use \build_scripts\Windows-msys2\build.bat** + +This batch will install and build all for you. + +You only have to clone this repository (with [git for windows](https://gitforwindows.org/)) to a local folder, then start it in a terminal. + +At the end, you'll get at ..\\*-msys2\deploy\ the Portable 7zip file. + +### MSYS2 INSTALLATION (for editing or debugging) + +Download MSYS2 from [MSYS2](http://www.msys2.org/). Get the i686 version +if you run a 32-bit Windows or the x86_64 if you run a 64-bit Windows. + +Run the installer and install MSYS2. + +At the end of the installation, it'll automatically open an MSYS shell terminal. +You can also find it on the start menu as MSYS2 MSYS. This is the shell you'll +use to install packages with pacman and do maintenance but NOT to build +RetroShare. + +First, update your MSYS2 environment to the latest version by typing: + + pacman -Syu + +Close the terminal window. + +Run MSYS2 MSYS again and finish updating with: + + pacman -Su + +Install the default programs needed to build: + + pacman -S base-devel git wget p7zip gcc perl ruby python2 doxygen cmake + +Install the 32-bit toolchain: + + pacman -S mingw-w64-i686-toolchain + +Install all needed dependencies: + + pacman -S mingw-w64-i686-miniupnpc + pacman -S mingw-w64-i686-libmicrohttpd + pacman -S mingw-w64-i686-libxslt + pacman -S mingw-w64-i686-xapian-core + pacman -S mingw-w64-i686-sqlcipher + pacman -S mingw-w64-i686-qt5 + pacman -S mingw32/mingw-w64-i686-cmake + pacman -S mingw-w64-i686-rapidjson + +If you want to use QtCreator as IDE, prefer using this one publish by MSYS2 as all build Kit are already setted. + + pacman -S mingw-w64-i686-qt-creator +*You can start it from MSYS2 terminal.* + + +We're done installing MSYS2, close the shell terminal. + +### BUILDING RETROSHARE + +Now run the MSYS2 MinGW 32-bit shell terminal (it's in the start menu). +We will use it to checkout Retroshare and build it: + + git clone https://github.com/RetroShare/RetroShare.git + +Go to the RetroShare directory and configure to your liking, for example: + + cd RetroShare + qmake -r -Wall -spec win32-g++ "CONFIG+=debug" "CONFIG+=rs_autologin" + +Now we're ready to build Retroshare. Use the '-j' option with the number of +cores you have for a faster build, for instance if you have 4 cores: + + mingw32-make -j4 + +Make sure your current Retroshare is not running. Then just run: + + retroshare-gui/src/debug/retroshare.exe + +You'll get debug output in the terminal and a running Retroshare instance. diff --git a/build_scripts/Windows-msys2/build-tor.bat b/build_scripts/Windows-msys2/build-tor.bat new file mode 100644 index 000000000..aa2b4ea06 --- /dev/null +++ b/build_scripts/Windows-msys2/build-tor.bat @@ -0,0 +1,23 @@ +@echo off + +setlocal + +:: Initialize environment +call "%~dp0env.bat" +if errorlevel 1 goto error_env +call "%EnvPath%\env.bat" +if errorlevel 1 goto error_env + +%cecho% info "Build %SourceName%" +call "%~dp0build\build.bat" 64 release tor autologin "CONFIG+=rs_use_native_dialogs" +if errorlevel 1 %cecho% error "Failed to build %SourceName%." & exit /B %ERRORLEVEL% + +%cecho% info "Pack %SourceName%" +call "%~dp0build\pack.bat" 64 release tor autologin "CONFIG+=rs_use_native_dialogs" +if errorlevel 1 %cecho% error "Failed to pack %SourceName%." & exit /B %ERRORLEVEL% + +exit /B 0 + +:error_env +echo Failed to initialize environment. +exit /B 1 diff --git a/build_scripts/Windows-msys2/build.bat b/build_scripts/Windows-msys2/build.bat new file mode 100644 index 000000000..529a1350f --- /dev/null +++ b/build_scripts/Windows-msys2/build.bat @@ -0,0 +1,23 @@ +@echo off + +setlocal + +:: Initialize environment +call "%~dp0env.bat" +if errorlevel 1 goto error_env +call "%EnvPath%\env.bat" +if errorlevel 1 goto error_env + +%cecho% info "Build %SourceName%" +call "%~dp0build\build.bat" 64 release autologin "CONFIG+=rs_use_native_dialogs" +if errorlevel 1 %cecho% error "Failed to build %SourceName%." & exit /B %ERRORLEVEL% + +%cecho% info "Pack %SourceName%" +call "%~dp0build\pack.bat" 64 release autologin "CONFIG+=rs_use_native_dialogs" +if errorlevel 1 %cecho% error "Failed to pack %SourceName%." & exit /B %ERRORLEVEL% + +exit /B 0 + +:error_env +echo Failed to initialize environment. +exit /B 1 diff --git a/build_scripts/Windows-msys2/build/build-installer.bat b/build_scripts/Windows-msys2/build/build-installer.bat new file mode 100644 index 000000000..192b2d025 --- /dev/null +++ b/build_scripts/Windows-msys2/build/build-installer.bat @@ -0,0 +1,67 @@ +@echo off + +setlocal + +:: Initialize environment +call "%~dp0..\env.bat" +if errorlevel 1 goto error_env +call "%EnvPath%\env.bat" +if errorlevel 1 goto error_env +call "%EnvPath%\env-msys2.bat" +if errorlevel 1 goto error_env + +:: Initialize environment +call "%~dp0env.bat" %* +if errorlevel 2 exit /B 2 +if errorlevel 1 goto error_env + +if not "%ParamNoupdate%"=="1" ( + :: Install NSIS + %EnvMSYS2Cmd% "pacman --noconfirm --needed -S mingw-w64-%RsMSYS2Architecture%-nsis" +) + +:: Check deployment +if not exist "%RsDeployPath%\retroshare.exe" echo Project is not deployed. Run pack.bat first! & goto error + +:: Get compiled revision +set GetRsVersion=%SourcePath%\build_scripts\Windows-msys2\tools\get-rs-version.bat +if not exist "%GetRsVersion%" ( + %cecho% error "File not found" + echo %GetRsVersion% + goto error +) + +:: Get compiled version +call "%GetRsVersion%" "%RsDeployPath%\retroshare.exe" RsVersion +if errorlevel 1 %cecho% error "Revision not found."& goto error +if "%RsVersion.Extra%"=="" %cecho% error "Extra number not found".& goto error + +:: Build defines for script +set NSIS_PARAM= + +set NSIS_PARAM=%NSIS_PARAM% /DDEPLOYDIR="%RsDeployPath%" +set NSIS_PARAM=%NSIS_PARAM% /DOUTDIR="%RsPackPath%" +set NSIS_PARAM=%NSIS_PARAM% /DINSTALLERADD="%RsArchiveAdd%" +set NSIS_PARAM=%NSIS_PARAM% /DARCHITECTURE="%RsArchitecture%" +set NSIS_PARAM=%NSIS_PARAM% /DREVISION=%RsVersion.Extra% + +set QtMainVersion=%QtVersion:~0,1% + +:: Create installer +echo %path% +rem makensis %NSIS_PARAM% "%SourcePath%\build_scripts\Windows-msys2\installer\retroshare-Qt%QtMainVersion%.nsi" +rem pushd "%SourcePath%\build_scripts\Windows-msys2\installer" +rem %EnvMSYS2Cmd% "makensis $0 retroshare-Qt%QtMainVersion%.nsi" "%NSIS_PARAM%" +rem popd +"%RsMinGWPath%\bin\makensis" %NSIS_PARAM% "%SourcePath%\build_scripts\Windows-msys2\installer\retroshare-Qt%QtMainVersion%.nsi" + +exit /B %ERRORLEVEL% + +:error +endlocal +exit /B 1 + +:error_env +echo Failed to initialize environment. +endlocal +exit /B 1 diff --git a/build_scripts/Windows-msys2/build/build-webui.bat b/build_scripts/Windows-msys2/build/build-webui.bat new file mode 100644 index 000000000..d226a9604 --- /dev/null +++ b/build_scripts/Windows-msys2/build/build-webui.bat @@ -0,0 +1,35 @@ +@echo off + +setlocal + +:: Initialize environment +call "%~dp0..\env.bat" +if errorlevel 1 goto error_env +call "%EnvPath%\env.bat" +if errorlevel 1 goto error_env +call "%EnvPath%\env-msys2.bat" +if errorlevel 1 goto error_env + +:: Initialize base environment +call "%~dp0env-base.bat" %* +if errorlevel 2 exit /B 2 +if errorlevel 1 goto error_env + +:: Initialize environment +call "%~dp0env.bat" %* +if errorlevel 2 exit /B 2 +if errorlevel 1 goto error_env + +call "%~dp0..\tools\webui.bat" + +:error + +title %COMSPEC% + +if errorlevel 1 echo.& echo Webui generation failed& echo. +exit /B %ERRORLEVEL% + +:error_env +echo Failed to initialize environment. +endlocal +exit /B 1 diff --git a/build_scripts/Windows-msys2/build/build.bat b/build_scripts/Windows-msys2/build/build.bat new file mode 100644 index 000000000..4d366f28c --- /dev/null +++ b/build_scripts/Windows-msys2/build/build.bat @@ -0,0 +1,105 @@ +@echo off + +setlocal + +:: Initialize environment +call "%~dp0..\env.bat" +if errorlevel 1 goto error_env +call "%EnvPath%\env.bat" +if errorlevel 1 goto error_env +call "%EnvPath%\env-msys2.bat" +if errorlevel 1 goto error_env + +:: Initialize base environment +call "%~dp0env-base.bat" %* +if errorlevel 2 exit /B 2 +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" + + :: Webui + if "%ParamWebui%"=="1" %EnvMSYS2Cmd% "pacman --noconfirm --needed -S mingw-w64-%RsMSYS2Architecture%-doxygen" + + :: Plugins + if "%ParamPlugins%"=="1" %EnvMSYS2Cmd% "pacman --noconfirm --needed -S mingw-w64-%RsMSYS2Architecture%-speex mingw-w64-%RsMSYS2Architecture%-speexdsp mingw-w64-%RsMSYS2Architecture%-curl mingw-w64-%RsMSYS2Architecture%-libxslt mingw-w64-%RsMSYS2Architecture%-opencv mingw-w64-%RsMSYS2Architecture%-ffmpeg" + + :: Clang + if "%ParamClang%"=="1" %EnvMSYS2Cmd% "pacman --noconfirm --needed -S mingw-w64-%RsMSYS2Architecture%-clang" + + :: Indexing + 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" +) + +:: Initialize environment +call "%~dp0env.bat" %* +if errorlevel 2 exit /B 2 +if errorlevel 1 goto error_env + +echo. +echo === Version +echo. + +title Build - %SourceName%-%RsBuildConfig% [Version] + +pushd "%SourcePath%\retroshare-gui\src\gui\images" +:: Touch resource file +copy /b retroshare_win.rc +,, +popd + +if not exist "%RsBuildPath%" mkdir "%RsBuildPath%" +pushd "%RsBuildPath%" + +echo. +echo === qmake +echo. + +title Build - %SourceName%-%RsBuildConfig% [qmake] + +set RS_QMAKE_CONFIG=%RS_QMAKE_CONFIG% "CONFIG+=%RsBuildConfig%" +if "%ParamAutologin%"=="1" set RS_QMAKE_CONFIG=%RS_QMAKE_CONFIG% "CONFIG+=rs_autologin" +if "%ParamPlugins%"=="1" set RS_QMAKE_CONFIG=%RS_QMAKE_CONFIG% "CONFIG+=retroshare_plugins" + +:: Dump the active build config into a file +echo %RS_QMAKE_CONFIG% > buildinfo.txt +echo %RsBuildConfig% >> buildinfo.txt +echo %RsArchitecture% >> buildinfo.txt +echo Qt %QtVersion% >> buildinfo.txt +echo %RsCompiler% >> buildinfo.txt + +call "%ToolsPath%\msys2-path.bat" "%SourcePath%" MSYS2SourcePath +call "%ToolsPath%\msys2-path.bat" "%EnvMSYS2Path%" MSYS2EnvMSYS2Path +if "%ParamClang%"=="1" ( + %EnvMSYS2Cmd% "qmake "%MSYS2SourcePath%/RetroShare.pro" -r -spec win32-clang-g++ %RS_QMAKE_CONFIG%" +) else ( + %EnvMSYS2Cmd% "qmake "%MSYS2SourcePath%/RetroShare.pro" -r -spec win32-g++ %RS_QMAKE_CONFIG%" +) +if errorlevel 1 goto error + +echo. +echo === make +echo. + +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 + +title %COMSPEC% + +if errorlevel 1 echo.& echo Build failed& echo. +exit /B %ERRORLEVEL% + +:error_env +echo Failed to initialize environment. +endlocal +exit /B 1 diff --git a/build_scripts/Windows-msys2/build/clean.bat b/build_scripts/Windows-msys2/build/clean.bat new file mode 100644 index 000000000..e4e835c4d --- /dev/null +++ b/build_scripts/Windows-msys2/build/clean.bat @@ -0,0 +1,25 @@ +@echo off + +setlocal + +:: Initialize environment +call "%~dp0..\env.bat" +if errorlevel 1 goto error_env +call "%EnvPath%\env.bat" +if errorlevel 1 goto error_env +call "%EnvPath%\env-msys2.bat" +if errorlevel 1 goto error_env + +call "%~dp0env.bat" %* +if errorlevel 2 exit /B 2 +if errorlevel 1 goto error_env + +if not exist "%RsBuildPath%" exit /B 0 +call "%ToolsPath%\remove-dir.bat" "%RsBuildPath%" + +exit /B %ERRORLEVEL% + +:error_env +echo Failed to initialize environment. +endlocal +exit /B 1 diff --git a/build_scripts/Windows-msys2/build/env-base.bat b/build_scripts/Windows-msys2/build/env-base.bat new file mode 100644 index 000000000..9d9fa5379 --- /dev/null +++ b/build_scripts/Windows-msys2/build/env-base.bat @@ -0,0 +1,130 @@ +:: Process commandline parameter +set Param32=0 +set Param64=0 +set ParamRelease=0 +set ParamDebug=0 +set ParamAutologin=0 +set ParamPlugins=0 +set ParamTor=0 +set ParamWebui=0 +set ParamClang=0 +set ParamIndexing=0 +set ParamNoupdate=0 +set CoreCount=%NUMBER_OF_PROCESSORS% +set RS_QMAKE_CONFIG= + +:parameter_loop +if "%~1" NEQ "" ( + for /f "tokens=1,2 delims==" %%a in ("%~1") do ( + if "%%~a"=="32" ( + set Param32=1 + ) else if "%%~a"=="64" ( + set Param64=1 + ) else if "%%~a"=="release" ( + set ParamRelease=1 + ) else if "%%~a"=="debug" ( + set ParamDebug=1 + ) else if "%%~a"=="autologin" ( + set ParamAutologin=1 + ) else if "%%~a"=="plugins" ( + set ParamPlugins=1 + ) else if "%%~a"=="tor" ( + set ParamTor=1 + ) else if "%%~a"=="webui" ( + set ParamWebui=1 + ) else if "%%~a"=="singlethread" ( + set CoreCount=1 + ) else if "%%~a"=="clang" ( + set ParamClang=1 + ) else if "%%~a"=="indexing" ( + set ParamIndexing=1 + ) else if "%%~a"=="noupdate" ( + set ParamNoupdate=1 + ) else if "%%~a"=="CONFIG+" ( + set RS_QMAKE_CONFIG=%RS_QMAKE_CONFIG% %1 + ) else ( + echo. + echo Unknown parameter %1 + goto :usage + ) + ) + shift /1 + 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 "%Param64%"=="1" ( + set RsBit=64 + set RsArchitecture=x64 + set RsMSYS2Architecture=x86_64 +) + +if "%ParamClang%"=="1" ( + set RsCompiler=Clang +) else ( + set RsCompiler=GCC +) + +if "%RsBit%"=="" goto :usage + +if "%ParamRelease%"=="1" ( + if "%ParamDebug%"=="1" ( + echo. + echo Release or Debug? + goto :usage + ) + + set RsBuildConfig=release +) else if "%ParamDebug%"=="1" ( + set RsBuildConfig=debug +) else goto :usage + +if "%ParamTor%"=="1" ( + set RsType=-tor +) else ( + set RsType= +) + +if "%ParamWebui%"=="1" ( + set RS_QMAKE_CONFIG=%RS_QMAKE_CONFIG% "CONFIG+=rs_jsonapi" "CONFIG+=rs_webui" +) + +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" +) + +exit /B 0 + +:usage +echo. +echo Usage: 32^|64 release^|debug [autologin plugins webui singlethread clang indexing noupdate] ["CONFIG+=..."] +echo. +echo Mandatory parameter +echo 32^|64 32-bit or 64-bit Version +echo release^|debug Build release or debug version +echo. +echo Optional parameter (need clean when changed) +echo autologin Build with autologin +echo plugins Build plugins +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 noupdate Skip updating the libraries +echo "CONFIG+=..." Enable some extra features, you can find the almost complete list in retroshare.pri +echo. +echo Parameter for pack +echo tor Pack tor version +echo. +exit /B 2 diff --git a/build_scripts/Windows-msys2/build/env.bat b/build_scripts/Windows-msys2/build/env.bat new file mode 100644 index 000000000..bfe2afeba --- /dev/null +++ b/build_scripts/Windows-msys2/build/env.bat @@ -0,0 +1,30 @@ +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 + +if not exist "%BuildPath%" mkdir "%BuildPath%" +if not exist "%DeployPath%" mkdir "%DeployPath%" + +:: Get Qt version +call "%ToolsPath%\get-qt-version.bat" QtVersion +if "%QtVersion%"=="" %cecho% error "Cannot get Qt version." & exit /B 1 + +set RsMinGWPath=%EnvMSYS2BasePath%\mingw%RsBit% + +set RsBuildPath=%BuildPath%\Qt-%QtVersion%-%RsArchitecture%-%RsCompiler%-%RsBuildConfig% +set RsDeployPath=%DeployPath%\Qt-%QtVersion%%RsType%-%RsArchitecture%-%RsCompiler%-%RsBuildConfig% +set RsPackPath=%DeployPath% +set RsArchiveAdd= +set RsWebuiPath=%RootPath%\%SourceName%-webui + +if not exist "%~dp0env-mod.bat" goto no_mod +call "%~dp0env-mod.bat" +if errorlevel 1 exit /B %ERRORLEVEL% +:no_mod + +exit /B 0 diff --git a/build_scripts/Windows-msys2/build/git-log.bat b/build_scripts/Windows-msys2/build/git-log.bat new file mode 100644 index 000000000..f221bc871 --- /dev/null +++ b/build_scripts/Windows-msys2/build/git-log.bat @@ -0,0 +1,43 @@ +@echo off +setlocal enabledelayedexpansion + +if "%~2"=="" ( + echo. + echo Parameter error. + echo Usage git-log sourcepath outputfile + exit /B 1 +) + +set logfile=%~2 +copy nul %logfile% > nul + +pushd %~1 + +set last=HEAD +for /f %%t in ('git tag --sort=-taggerdate --merged ^| findstr v') do ( + echo generating changelog for !last!..%%t + echo ----------------------------------------------- >> %logfile% + if !last! neq HEAD ( + git tag -n !last! >> %logfile% + ) else ( + echo HEAD >> %logfile% + ) + rem echo !last! ---^> %%t >> %logfile% + echo ----------------------------------------------- >> %logfile% + echo. >> %logfile% + git log %%t..!last! --no-merges "--pretty=format:%%h %%ai %%<(10,trunc)%%an %%s" >> %logfile% + echo. >> %logfile% + echo. >> %logfile% + set last=%%t +) + +echo generating changelog for %last% +echo ----------------------------------------------- >> %logfile% +git tag -n %last% >> %logfile% +echo ----------------------------------------------- >> %logfile% +echo. >> %logfile% +git log %last% --no-merges "--pretty=format:%%h %%ai %%<(10,trunc)%%an %%s" >> %logfile% + +popd + +endlocal enabledelayedexpansion \ No newline at end of file diff --git a/build_scripts/Windows-msys2/build/pack.bat b/build_scripts/Windows-msys2/build/pack.bat new file mode 100644 index 000000000..4c12ed7c0 --- /dev/null +++ b/build_scripts/Windows-msys2/build/pack.bat @@ -0,0 +1,228 @@ +@echo off + +setlocal + +set Quite=^>nul + +:: Initialize environment +call "%~dp0..\env.bat" +if errorlevel 1 goto error_env +call "%EnvPath%\env.bat" +if errorlevel 1 goto error_env +call "%EnvPath%\env-msys2.bat" +if errorlevel 1 goto error_env + +:: Initialize environment +call "%~dp0env.bat" %* +if errorlevel 2 exit /B 2 +if errorlevel 1 goto error_env + +if not "%ParamNoupdate%"=="1" ( + :: Install ntldd + %EnvMSYS2Cmd% "pacman --noconfirm --needed -S mingw-w64-%RsMSYS2Architecture%-ntldd-git" + + :: Install tor + if "%ParamTor%"=="1" ( + %EnvMSYS2Cmd% "pacman --noconfirm --needed -S mingw-w64-%RsMSYS2Architecture%-tor" + ) +) + +:: Remove deploy path +if exist "%RsDeployPath%" rmdir /S /Q "%RsDeployPath%" + +:: Check compilation +if not exist "%RsBuildPath%\Makefile" echo Project is not compiled.& goto error + +:: Get compiled revision +set GetRsVersion=%SourcePath%\build_scripts\Windows-msys2\tools\get-rs-version.bat +if not exist "%GetRsVersion%" ( + %cecho% error "File not found" + echo %GetRsVersion% + goto error +) + +:: Get compiled version +call "%GetRsVersion%" "%RsBuildPath%\retroshare-gui\src\%RsBuildConfig%\retroshare.exe" RsVersion +if errorlevel 1 %cecho% error "Revision not found."& goto error + +if "%RsVersion.Major%"=="" %cecho% error "Major version not found."& goto error +if "%RsVersion.Minor%"=="" %cecho% error "Minor version not found."& goto error +if "%RsVersion.Mini%"=="" %cecho% error "Mini number not found".& goto error +if "%RsVersion.Extra%"=="" %cecho% error "Extra number not found".& goto error + +set RsVersion=%RsVersion.Major%.%RsVersion.Minor%.%RsVersion.Mini% + +:: Check WMIC is available +wmic.exe alias /? >nul 2>&1 || echo WMIC is not available.&& goto error + +:: Use WMIC to retrieve date in format YYYYMMDD +set RsDate= +for /f "tokens=2 delims==" %%I in ('wmic os get localdatetime /format:list') do set RsDate=%%I +set RsDate=%RsDate:~0,4%%RsDate:~4,2%%RsDate:~6,2% + +set QtMainVersion=%QtVersion:~0,1% +set QtSharePath=%RsMinGWPath%\share\qt%QtMainVersion%\ + +rem Qt 4 = QtSvg4.dll +rem Qt 5 = Qt5Svg.dll +set QtMainVersion1= +set QtMainVersion2= +if "%QtMainVersion%"=="4" set QtMainVersion2=4 +if "%QtMainVersion%"=="5" set QtMainVersion1=5 + +if "%RsBuildConfig%" NEQ "release" ( + set Archive=%RsPackPath%\RetroShare-%RsVersion%-Windows-Portable-%RsDate%-%RsVersion.Extra%-%RsArchitecture%-msys2%RsType%%RsArchiveAdd%-%RsBuildConfig%.7z +) else ( + set Archive=%RsPackPath%\RetroShare-%RsVersion%-Windows-Portable-%RsDate%-%RsVersion.Extra%-%RsArchitecture%-msys2%RsType%%RsArchiveAdd%.7z +) + +if exist "%Archive%" del /Q "%Archive%" + +:: Create deploy path +mkdir "%RsDeployPath%" + +title Pack - %SourceName%%RsType%-%RsBuildConfig% [copy files] + +set ExtensionsFile=%SourcePath%\libretroshare\src\rsserver\rsinit.cc +set Extensions= +for /f %%e in ('type "%ExtensionsFile%" ^| sed.exe -n "s/^.*\/\(extensions[^/]*\)\/.*$/\1/p" ^| sed.exe -n "1,1p"') do set Extensions=%%e +if "%Extensions%"=="" echo Folder for extensions not found in %ExtensionsFile%& goto error + +:: Copy files +mkdir "%RsDeployPath%\Data\%Extensions%" +mkdir "%RsDeployPath%\imageformats" +mkdir "%RsDeployPath%\qss" +mkdir "%RsDeployPath%\stylesheets" +mkdir "%RsDeployPath%\sounds" +mkdir "%RsDeployPath%\translations" +mkdir "%RsDeployPath%\license" + +copy nul "%RsDeployPath%\portable" %Quite% + +echo copy binaries +copy "%RsBuildPath%\retroshare-gui\src\%RsBuildConfig%\RetroShare*.exe" "%RsDeployPath%" %Quite% +copy "%RsBuildPath%\retroshare-nogui\src\%RsBuildConfig%\retroshare*-nogui.exe" "%RsDeployPath%" %Quite% +copy "%RsBuildPath%\retroshare-service\src\%RsBuildConfig%\retroshare*-service.exe" "%RsDeployPath%" %Quite% +copy "%RsBuildPath%\supportlibs\cmark\build\src\libcmark.dll" "%RsDeployPath%" %Quite% + +echo copy extensions +for /D %%D in ("%RsBuildPath%\plugins\*") do ( + call :copy_extension "%%D" "%RsDeployPath%\Data\%Extensions%" +) + +echo copy Qt DLL's +copy "%RsMinGWPath%\bin\Qt%QtMainVersion1%Svg%QtMainVersion2%.dll" "%RsDeployPath%" %Quite% + +if "%QtMainVersion%"=="5" ( + mkdir "%RsDeployPath%\platforms" + copy "%QtSharePath%\plugins\platforms\qwindows.dll" "%RsDeployPath%\platforms" %Quite% + mkdir "%RsDeployPath%\audio" + copy "%QtSharePath%\plugins\audio\qtaudio_windows.dll" "%RsDeployPath%\audio" %Quite% +) + +if exist "%QtSharePath%\plugins\styles\qwindowsvistastyle.dll" ( + echo copy styles + mkdir "%RsDeployPath%\styles" %Quite% + copy "%QtSharePath%\plugins\styles\qwindowsvistastyle.dll" "%RsDeployPath%\styles" %Quite% +) + +copy "%QtSharePath%\plugins\imageformats\*.dll" "%RsDeployPath%\imageformats" %Quite% +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% +) + +echo copy dependencies +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% + +echo copy stylesheets +xcopy /S "%SourcePath%\retroshare-gui\src\gui\qss\chat" "%RsDeployPath%\stylesheets" %Quite% +rmdir /S /Q "%RsDeployPath%\stylesheets\compact" %Quite% +rmdir /S /Q "%RsDeployPath%\stylesheets\standard" %Quite% +rmdir /S /Q "%RsDeployPath%\stylesheets\__MACOSX__Bubble" %Quite% + +echo copy sounds +xcopy /S "%SourcePath%\retroshare-gui\src\sounds" "%RsDeployPath%\sounds" %Quite% + +echo copy license +xcopy /S "%SourcePath%\retroshare-gui\src\license" "%RsDeployPath%\license" %Quite% + +echo copy translation +copy "%SourcePath%\retroshare-gui\src\translations\qt_tr.qm" "%RsDeployPath%\translations" %Quite% +copy "%QtSharePath%\translations\qt_*.qm" "%RsDeployPath%\translations" %Quite% +if "%QtMainVersion%"=="5" ( + copy "%QtSharePath%\translations\qtbase_*.qm" "%RsDeployPath%\translations" %Quite% + copy "%QtSharePath%\translations\qtscript_*.qm" "%RsDeployPath%\translations" %Quite% + copy "%QtSharePath%\translations\qtquick1_*.qm" "%RsDeployPath%\translations" %Quite% + copy "%QtSharePath%\translations\qtmultimedia_*.qm" "%RsDeployPath%\translations" %Quite% + copy "%QtSharePath%\translations\qtxmlpatterns_*.qm" "%RsDeployPath%\translations" %Quite% +) + +echo copy bdboot.txt +copy "%SourcePath%\libbitdht\src\bitdht\bdboot.txt" "%RsDeployPath%" %Quite% + +echo generate changelog.txt +call call "%~dp0\git-log.bat" "%SourcePath%" "%RsDeployPath%\changelog.txt" + +echo copy buildinfo.txt +copy "%RsBuildPath%\buildinfo.txt" "%RsDeployPath%" %Quite% + +if "%ParamWebui%"=="1" ( + if exist "%RsWebuiPath%\webui" ( + echo copy webui + mkdir "%RsDeployPath%\webui" + xcopy /S "%RsWebuiPath%\webui" "%RsDeployPath%\webui" %Quite% + ) else ( + %cecho% error "Webui is enabled, but no webui data found at %RsWebuiPath%\webui" + goto error + ) +) + +rem pack files +title Pack - %SourceName%%RsType%-%RsBuildConfig% [pack files] + +"%EnvSevenZipExe%" a -mx=9 -t7z "%Archive%" "%RsDeployPath%\*" + +title %COMSPEC% + +call :cleanup + +endlocal +exit /B 0 + +:error +call :Cleanup +endlocal +exit /B 1 + +:cleanup +goto :EOF + +:error_env +echo Failed to initialize environment. +endlocal +exit /B 1 + +:copy_extension +if exist "%~1\%RsBuildConfig%\%~n1.dll" ( + copy "%~1\%RsBuildConfig%\%~n1.dll" %2 %Quite% +) +goto :EOF + +:copy_dependencies +for /F "usebackq" %%A in (`%ToolsPath%\depends.bat %1`) do ( + if not exist "%~2\%%A" ( + if exist "%RsMinGWPath%\bin\%%A" ( + copy "%RsMinGWPath%\bin\%%A" %2 %Quite% + ) + ) +) +goto :EOF diff --git a/build_scripts/Windows-msys2/env.bat b/build_scripts/Windows-msys2/env.bat new file mode 100644 index 000000000..863369162 --- /dev/null +++ b/build_scripts/Windows-msys2/env.bat @@ -0,0 +1,19 @@ +call :make_path SourcePath "%~dp0..\.." +call :make_path RootPath "%SourcePath%\.." +call :source_name SourceName "%SourcePath%" +set ToolsPath=%~dp0tools +set EnvPath=%~dp0env + +exit /B 0 + +:make_path +setlocal +set Var=%~1 +pushd %2 +set CD=%cd% +popd +endlocal & set %Var%=%CD% +goto :EOF + +:source_name +set %~1=%~nx2 diff --git a/build_scripts/Windows-msys2/env/env-msys2.bat b/build_scripts/Windows-msys2/env/env-msys2.bat new file mode 100644 index 000000000..0c25bad6d --- /dev/null +++ b/build_scripts/Windows-msys2/env/env-msys2.bat @@ -0,0 +1,37 @@ +:: Usage: +:: call env-msys2.bat [reinstall|clean] + +:: Initialize environment +call "%~dp0env.bat" +if errorlevel 1 goto error_env + +IF DEFINED ProgramFiles(x86) ( + :: x64 + set MSYS2Architecture=x86_64 + set MSYS2Base=64 +) else ( + :: x86 + set MSYS2Architecture=i686 + set MSYS2Base=32 +) + +set CHERE_INVOKING=1 + +set EnvMSYS2Path=%EnvRootPath%\msys2 +set EnvMSYS2BasePath=%EnvMSYS2Path%\msys%MSYS2Base% + +call "%~dp0tools\prepare-msys2.bat" %1 +if errorlevel 1 exit /B %ERRORLEVEL% + +set EnvMSYS2SH=%EnvMSYS2BasePath%\usr\bin\sh.exe +if not exist "%EnvMSYS2SH%" if errorlevel 1 goto error_env + +set EnvMSYS2Cmd="%EnvMSYS2SH%" -lc + +set PATH=%EnvMSYS2BasePath%\usr\bin;%PATH% + +exit /B 0 + +:error_env +echo Failed to initialize environment. +exit /B 1 diff --git a/build_scripts/Windows-msys2/env/env.bat b/build_scripts/Windows-msys2/env/env.bat new file mode 100644 index 000000000..1d2f9c2e4 --- /dev/null +++ b/build_scripts/Windows-msys2/env/env.bat @@ -0,0 +1,24 @@ +:: Initialize environment +call "%~dp0..\env.bat" +if errorlevel 1 goto error_env + +set EnvRootPath=%RootPath%\%SourceName%-msys2 +set EnvToolsPath=%EnvRootPath%\tools +set EnvTempPath=%EnvRootPath%\tmp +set EnvDownloadPath=%EnvRootPath%\download + +set EnvSevenZipExe=%EnvToolsPath%\7z.exe +set EnvCEchoExe=%EnvToolsPath%\cecho.exe +set cecho=call "%ToolsPath%\cecho.bat" + +:: Create folders +if not exist "%EnvRootPath%" mkdir "%EnvRootPath%" +if not exist "%EnvToolsPath%" mkdir "%EnvToolsPath%" +if not exist "%EnvDownloadPath%" mkdir "%EnvDownloadPath%" + +call "%~dp0tools\prepare-tools.bat" +exit /B %ERRORLEVEL% + +:error_env +echo Failed to initialize environment. +exit /B 1 diff --git a/build_scripts/Windows-msys2/env/tools/prepare-msys2.bat b/build_scripts/Windows-msys2/env/tools/prepare-msys2.bat new file mode 100644 index 000000000..2f85c42be --- /dev/null +++ b/build_scripts/Windows-msys2/env/tools/prepare-msys2.bat @@ -0,0 +1,57 @@ +:: Usage: +:: call prepare-msys2.bat [reinstall|clean] + +setlocal enabledelayedexpansion + +if "%EnvMSYS2Path%"=="" exit /B 1 +if "%MSYS2Architecture%"=="" exit /B 1 +if "%MSYS2Base%"=="" exit /B 1 +if not exist "%EnvRootPath%"=="" exit /B 1 + +copy "%~dp0root\update-msys2.bat" "%EnvRootPath%" >nul + +if "%~1"=="clean" ( + %cecho% info "Clean MSYS2" + call "%ToolsPath%\remove-dir.bat" "%EnvMSYS2Path%" + goto exit +) + +if exist "%EnvMSYS2Path%\msys%MSYS2Base%\usr\bin\pacman.exe" ( + if "%~1"=="reinstall" ( + choice /M "Found existing MSYS2 version. Do you want to proceed?" + if !ERRORLEVEL!==2 goto exit + ) else ( + goto exit + ) +) + +set MSYS2Install=msys2-base-%MSYS2Architecture%-20200720.tar.xz +set MSYS2Url=http://sourceforge.net/projects/msys2/files/Base/%MSYS2Architecture%/%MSYS2Install%/download + +%cecho% info "Remove previous MSYS2 version" +call "%ToolsPath%\remove-dir.bat" "%EnvMSYS2Path%" + +%cecho% info "Download 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%" + +set MSYS2SH=%EnvMSYS2Path%\msys%MSYS2Base%\usr\bin\sh + +%cecho% info "Initialize MSYS2" +"%MSYS2SH%" -lc "pacman -Sy" +"%MSYS2SH%" -lc "pacman --noconfirm --needed -S bash pacman pacman-mirrors msys2-runtime" + +call "%EnvMSYS2Path%\msys%MSYS2Base%\autorebase.bat" +call "%EnvRootPath%\update-msys2.bat" +call "%EnvRootPath%\update-msys2.bat" + +:exit +endlocal +exit /B 0 + +:error +endlocal +exit /B 1 diff --git a/build_scripts/Windows-msys2/env/tools/prepare-tools.bat b/build_scripts/Windows-msys2/env/tools/prepare-tools.bat new file mode 100644 index 000000000..c6b14a787 --- /dev/null +++ b/build_scripts/Windows-msys2/env/tools/prepare-tools.bat @@ -0,0 +1,49 @@ +setlocal + +if "%EnvRootPath%"=="" exit /B 1 + +set CEchoUrl=https://github.com/lordmulder/cecho/releases/download/2015-10-10/cecho.2015-10-10.zip +set CEchoInstall=cecho.2015-10-10.zip +set SevenZipUrl=https://sourceforge.net/projects/sevenzip/files/7-Zip/18.05/7z1805.msi/download +set SevenZipInstall=7z1805.msi + +if not exist "%EnvToolsPath%\7z.exe" ( + call "%ToolsPath%\remove-dir.bat" "%EnvTempPath%" + mkdir "%EnvTempPath%" + + echo Download 7z installation + + if not exist "%EnvDownloadPath%\%SevenZipInstall%" call "%ToolsPath%\download-file.bat" "%SevenZipUrl%" "%EnvDownloadPath%\%SevenZipInstall%" + if not exist "%EnvDownloadPath%\%SevenZipInstall%" echo Cannot download 7z installation& goto error + + echo Unpack 7z + msiexec /a "%EnvDownloadPath%\%SevenZipInstall%" /qb TARGETDIR="%EnvTempPath%" + copy "%EnvTempPath%\Files\7-Zip\7z.dll" "%EnvToolsPath%" + copy "%EnvTempPath%\Files\7-Zip\7z.exe" "%EnvToolsPath%" + + call "%ToolsPath%\remove-dir.bat" "%EnvTempPath%" +) + +if not exist "%EnvToolsPath%\cecho.exe" ( + call "%ToolsPath%\remove-dir.bat" "%EnvTempPath%" + mkdir "%EnvTempPath%" + + echo Download cecho installation + + if not exist "%EnvDownloadPath%\%CEchoInstall%" call "%ToolsPath%\download-file.bat" "%CEchoUrl%" "%EnvDownloadPath%\%CEchoInstall%" + if not exist "%EnvDownloadPath%\%cCEhoInstall%" echo Cannot download cecho installation& goto error + + echo Unpack cecho + "%EnvSevenZipExe%" x -o"%EnvTempPath%" "%EnvDownloadPath%\%CEchoInstall%" + copy "%EnvTempPath%\cecho.exe" "%EnvToolsPath%" + + call "%ToolsPath%\remove-dir.bat" "%EnvTempPath%" +) + +:exit +endlocal +exit /B 0 + +:error +endlocal +exit /B 1 diff --git a/build_scripts/Windows-msys2/env/tools/root/update-msys2.bat b/build_scripts/Windows-msys2/env/tools/root/update-msys2.bat new file mode 100644 index 000000000..3075e392b --- /dev/null +++ b/build_scripts/Windows-msys2/env/tools/root/update-msys2.bat @@ -0,0 +1,19 @@ +@echo off + +setlocal + +if exist "%~dp0msys2\msys32" call :update 32 +if exist "%~dp0msys2\msys64" call :update 64 + +goto :EOF + +:update +set MSYSSH=%~dp0msys2\msys%~1\usr\bin\sh + +echo Update MSYS2 %~1 +"%MSYSSH%" -lc "pacman -Sy" +"%MSYSSH%" -lc "pacman --noconfirm -Su" + +:exit +endlocal +goto :EOF diff --git a/build_scripts/Windows-msys2/installer/HeaderImage.bmp b/build_scripts/Windows-msys2/installer/HeaderImage.bmp new file mode 100644 index 000000000..5c55265cd Binary files /dev/null and b/build_scripts/Windows-msys2/installer/HeaderImage.bmp differ diff --git a/build_scripts/Windows-msys2/installer/HeaderImageEmpty.bmp b/build_scripts/Windows-msys2/installer/HeaderImageEmpty.bmp new file mode 100644 index 000000000..f0f0f1b32 Binary files /dev/null and b/build_scripts/Windows-msys2/installer/HeaderImageEmpty.bmp differ diff --git a/build_scripts/Windows-msys2/installer/ifexist.nsh b/build_scripts/Windows-msys2/installer/ifexist.nsh new file mode 100644 index 000000000..3f391c898 --- /dev/null +++ b/build_scripts/Windows-msys2/installer/ifexist.nsh @@ -0,0 +1,15 @@ +; See http://nsis.sourceforge.net/Check_if_a_file_exists_at_compile_time for documentation +!macro !defineifexist _VAR_NAME _FILE_NAME + !tempfile _TEMPFILE + !ifdef NSIS_WIN32_MAKENSIS + ; Windows - cmd.exe + !system 'if exist "${_FILE_NAME}" echo !define ${_VAR_NAME} > "${_TEMPFILE}"' + !else + ; Posix - sh + !system 'if [ -e "${_FILE_NAME}" ]; then echo "!define ${_VAR_NAME}" > "${_TEMPFILE}"; fi' + !endif + !include '${_TEMPFILE}' + !delfile '${_TEMPFILE}' + !undef _TEMPFILE +!macroend +!define !defineifexist "!insertmacro !defineifexist" \ No newline at end of file diff --git a/build_scripts/Windows-msys2/installer/lang/ca_ES.nsh b/build_scripts/Windows-msys2/installer/lang/ca_ES.nsh new file mode 100644 index 000000000..acb11b5a4 --- /dev/null +++ b/build_scripts/Windows-msys2/installer/lang/ca_ES.nsh @@ -0,0 +1,29 @@ +!insertmacro LANG_STRING Section_Main "${APPNAME}" +!insertmacro LANG_STRING Section_Main_Desc "Instal·la ${APPNAME} i els components necessaris." +!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" +!insertmacro LANG_STRING Section_Shortcuts_Desc "Afegir icones d'accés directe." +!insertmacro LANG_STRING Section_StartMenu "Icona del menú d'inici" +!insertmacro LANG_STRING Section_StartMenu_Desc "Afegir icona en el menú d'inici" +!insertmacro LANG_STRING Section_Desktop "Icona d'escriptori" +!insertmacro LANG_STRING Section_Desktop_Desc "Afegir icona a l'escriptori" +!insertmacro LANG_STRING Section_QuickLaunch "Icona de la barra ràpida d'accés" +!insertmacro LANG_STRING Section_QuickLaunch_Desc "Afegir icona a la barra ràpida d'accés" +!insertmacro LANG_STRING Section_Plugins "Complements opcionals" +!insertmacro LANG_STRING Section_Plugins_Desc "Components opcionals per afegir funcionalitat." +!insertmacro LANG_STRING Section_Plugin_FeedReader "LectorFonts" +!insertmacro LANG_STRING Section_Plugin_FeedReader_Desc "Instal·lar complement LectorFonts." +!insertmacro LANG_STRING Section_Plugin_LinksCloud "NúvolEnllaços" +!insertmacro LANG_STRING Section_Plugin_LinksCloud_Desc "Instal·lar complement NúvolEnllaços." +!insertmacro LANG_STRING Section_Plugin_VOIP "VeuIP" +!insertmacro LANG_STRING Section_Plugin_VOIP_Desc "Instal·lar complement VeuIP." +!insertmacro LANG_STRING Section_AutoStart "Posada en marxa automàtica" +!insertmacro LANG_STRING Section_AutoStart_Desc "Autoengegar al arrencar." +!insertmacro LANG_STRING Page_InstallMode "Mode instal·lació" +!insertmacro LANG_STRING Page_InstallMode_Desc "Escull com vols instal·lar ${APPNAME}." +!insertmacro LANG_STRING Page_InstallMode_Standard "Instal·lació e&stàndard" +!insertmacro LANG_STRING Page_InstallMode_Standard_Desc "Instal·la ${APPNAME} per la sessió d'usuari actual." +!insertmacro LANG_STRING Page_InstallMode_Portable "Instal·lació &portable." +!insertmacro LANG_STRING Page_InstallMode_Portable_Desc "En mode portable les dades de configuració s'emmagatzemen a la carpeta d'aplicació i no s'escriu informació al registre del sistema." +!insertmacro LANG_STRING Link_Uninstall "Desinstal·lar." diff --git a/build_scripts/Windows-msys2/installer/lang/de.nsh b/build_scripts/Windows-msys2/installer/lang/de.nsh new file mode 100644 index 000000000..c5323f523 --- /dev/null +++ b/build_scripts/Windows-msys2/installer/lang/de.nsh @@ -0,0 +1,29 @@ +!insertmacro LANG_STRING Section_Main "${APPNAME}" +!insertmacro LANG_STRING Section_Main_Desc "Installiert ${APPNAME} und die benötigten Komponenten." +!insertmacro LANG_STRING Section_Data "Skins" +!insertmacro LANG_STRING Section_Data_Desc "Skins installieren." +!insertmacro LANG_STRING Section_Shortcuts "Verknüpfungssymbole" +!insertmacro LANG_STRING Section_Shortcuts_Desc "Verküpfungssymbole hinzufügen." +!insertmacro LANG_STRING Section_StartMenu "Startmenüsymbol" +!insertmacro LANG_STRING Section_StartMenu_Desc "Fügt Symbol zum Startmenü hinzu." +!insertmacro LANG_STRING Section_Desktop "Desktopsymbol" +!insertmacro LANG_STRING Section_Desktop_Desc "Fügt Symbol zum Desktop hinzu." +!insertmacro LANG_STRING Section_QuickLaunch "Schnellstartsymbol" +!insertmacro LANG_STRING Section_QuickLaunch_Desc "Fügt Symbol zur Schnellstartleiste hinzu." +!insertmacro LANG_STRING Section_Plugins "Optionale Plug-ins" +!insertmacro LANG_STRING Section_Plugins_Desc "Optionale Plug-ins zum Erweitern der Funktionalität." +!insertmacro LANG_STRING Section_Plugin_FeedReader "FeedReader" +!insertmacro LANG_STRING Section_Plugin_FeedReader_Desc "Installiert das Plug-in Feedreader." +!insertmacro LANG_STRING Section_Plugin_LinksCloud "Verknüpfungswolke" +!insertmacro LANG_STRING Section_Plugin_LinksCloud_Desc "Installiert das Plug-in Verknüpfungswolke." +!insertmacro LANG_STRING Section_Plugin_VOIP "VOIP" +!insertmacro LANG_STRING Section_Plugin_VOIP_Desc "Installiert das Plug-in VOIP" +!insertmacro LANG_STRING Section_AutoStart "Automatischer Programmstart" +!insertmacro LANG_STRING Section_AutoStart_Desc "Beim Start automatisch ausführen." +!insertmacro LANG_STRING Page_InstallMode "Installationsmodus" +!insertmacro LANG_STRING Page_InstallMode_Desc "Wähle wie du ${APPNAME} installieren willst." +!insertmacro LANG_STRING Page_InstallMode_Standard "&Standardinstallation" +!insertmacro LANG_STRING Page_InstallMode_Standard_Desc "Installiere ${APPNAME} für den derzeitigen Benutzer dieses Geräts." +!insertmacro LANG_STRING Page_InstallMode_Portable "&Portable Installation" +!insertmacro LANG_STRING Page_InstallMode_Portable_Desc "Im portablen Modus werden alle Konfigurationsdaten im Verzeichnis der Anwendung gespeichert und keine Informationen in der Registry abgelegt." +!insertmacro LANG_STRING Link_Uninstall "Deinstallieren" diff --git a/build_scripts/Windows-msys2/installer/lang/en.nsh b/build_scripts/Windows-msys2/installer/lang/en.nsh new file mode 100644 index 000000000..a1bbc783c --- /dev/null +++ b/build_scripts/Windows-msys2/installer/lang/en.nsh @@ -0,0 +1,29 @@ +!insertmacro LANG_STRING Section_Main "${APPNAME}" +!insertmacro LANG_STRING Section_Main_Desc "Installs ${APPNAME} and required components." +!insertmacro LANG_STRING Section_Data "Skins" +!insertmacro LANG_STRING Section_Data_Desc "Installs skins." +!insertmacro LANG_STRING Section_Shortcuts "Shortcut icons" +!insertmacro LANG_STRING Section_Shortcuts_Desc "Adds shortcut icons." +!insertmacro LANG_STRING Section_StartMenu "Start Menu icon" +!insertmacro LANG_STRING Section_StartMenu_Desc "Adds icon to start menu." +!insertmacro LANG_STRING Section_Desktop "Desktop icon" +!insertmacro LANG_STRING Section_Desktop_Desc "Adds icon to desktop." +!insertmacro LANG_STRING Section_QuickLaunch "Quick Launch icon" +!insertmacro LANG_STRING Section_QuickLaunch_Desc "Adds icon to Quick Launch toolbar." +!insertmacro LANG_STRING Section_Plugins "Optional plugins" +!insertmacro LANG_STRING Section_Plugins_Desc "Optional plugins to extend functionality." +!insertmacro LANG_STRING Section_Plugin_FeedReader "FeedReader" +!insertmacro LANG_STRING Section_Plugin_FeedReader_Desc "Installs plugin FeedReader." +!insertmacro LANG_STRING Section_Plugin_VOIP "VOIP" +!insertmacro LANG_STRING Section_Plugin_VOIP_Desc "Installs plugin VOIP." +;!insertmacro LANG_STRING Section_Link "File Association" +;!insertmacro LANG_STRING Section_Link_Desc "Associate ${APPNAME} with .pqi file extension." +!insertmacro LANG_STRING Section_AutoStart "Auto Startup" +!insertmacro LANG_STRING Section_AutoStart_Desc "Auto-Run at startup." +!insertmacro LANG_STRING Page_InstallMode "Installation Mode" +!insertmacro LANG_STRING Page_InstallMode_Desc "Choose how you want to install ${APPNAME}." +!insertmacro LANG_STRING Page_InstallMode_Standard "&Standard installation" +!insertmacro LANG_STRING Page_InstallMode_Standard_Desc "Install ${APPNAME} for the current user of this machine." +!insertmacro LANG_STRING Page_InstallMode_Portable "&Portable installation" +!insertmacro LANG_STRING Page_InstallMode_Portable_Desc "In portable mode all configuration data is stored in the application folder and no information is written to the registry." +!insertmacro LANG_STRING Link_Uninstall "Uninstall" \ No newline at end of file diff --git a/build_scripts/Windows-msys2/installer/lang/es.nsh b/build_scripts/Windows-msys2/installer/lang/es.nsh new file mode 100644 index 000000000..68900ec62 --- /dev/null +++ b/build_scripts/Windows-msys2/installer/lang/es.nsh @@ -0,0 +1,29 @@ +!insertmacro LANG_STRING Section_Main "${APPNAME}" +!insertmacro LANG_STRING Section_Main_Desc "Instala ${APPNAME} y los componentes requeridos." +!insertmacro LANG_STRING Section_Data "Coberturas (skins)" +!insertmacro LANG_STRING Section_Data_Desc "Instalar coberturas" +!insertmacro LANG_STRING Section_Shortcuts "Iconos de accesos directos" +!insertmacro LANG_STRING Section_Shortcuts_Desc "Añade iconos de accesos directos." +!insertmacro LANG_STRING Section_StartMenu "Icono de menú de inicio" +!insertmacro LANG_STRING Section_StartMenu_Desc "Añade icono al menú de inicio." +!insertmacro LANG_STRING Section_Desktop "Icono del escritorio" +!insertmacro LANG_STRING Section_Desktop_Desc "Añade icono al escritorio" +!insertmacro LANG_STRING Section_QuickLaunch "Icono de inicio rápido" +!insertmacro LANG_STRING Section_QuickLaunch_Desc "Añade icono a la Barra de Inicio Rápido" +!insertmacro LANG_STRING Section_Plugins "Complementos opcionales" +!insertmacro LANG_STRING Section_Plugins_Desc "Complementos opcionales para expandir la funcionalidad." +!insertmacro LANG_STRING Section_Plugin_FeedReader "FeedReader" +!insertmacro LANG_STRING Section_Plugin_FeedReader_Desc "Instala el complemento FeedReader." +!insertmacro LANG_STRING Section_Plugin_LinksCloud "LinksCloud" +!insertmacro LANG_STRING Section_Plugin_LinksCloud_Desc "Instala el complemento LinksCloud." +!insertmacro LANG_STRING Section_Plugin_VOIP "VOIP" +!insertmacro LANG_STRING Section_Plugin_VOIP_Desc "Instala el complemento VOIP" +!insertmacro LANG_STRING Section_AutoStart "Auto iniciar" +!insertmacro LANG_STRING Section_AutoStart_Desc "Auto-ejecutar al incio." +!insertmacro LANG_STRING Page_InstallMode "Modo de instalación" +!insertmacro LANG_STRING Page_InstallMode_Desc "Elija cómo quiere instalar ${APPNAME}." +!insertmacro LANG_STRING Page_InstallMode_Standard "Instalación &Estándar" +!insertmacro LANG_STRING Page_InstallMode_Standard_Desc "Instalar ${APPNAME} para el usuario actual de esta máquina." +!insertmacro LANG_STRING Page_InstallMode_Portable "Instalación &Portable" +!insertmacro LANG_STRING Page_InstallMode_Portable_Desc "En modo portable, todos los datos de configuración se almacenan en la carpeta de la aplicación y no se escribe ninguna información en el registro." +!insertmacro LANG_STRING Link_Uninstall "Desinstalar" diff --git a/build_scripts/Windows-msys2/installer/lang/fr.nsh b/build_scripts/Windows-msys2/installer/lang/fr.nsh new file mode 100644 index 000000000..d4c797833 --- /dev/null +++ b/build_scripts/Windows-msys2/installer/lang/fr.nsh @@ -0,0 +1,29 @@ +!insertmacro LANG_STRING Section_Main "${APPNAME}" +!insertmacro LANG_STRING Section_Main_Desc "Installe ${APPNAME} et les composants requis." +!insertmacro LANG_STRING Section_Data "Habillages" +!insertmacro LANG_STRING Section_Data_Desc "Installe des habillages." +!insertmacro LANG_STRING Section_Shortcuts "Icônes de raccourci" +!insertmacro LANG_STRING Section_Shortcuts_Desc "Ajoute les icônes de raccourci." +!insertmacro LANG_STRING Section_StartMenu "Icône de menu démarrage" +!insertmacro LANG_STRING Section_StartMenu_Desc "Ajoute l'icône au menu démarrer." +!insertmacro LANG_STRING Section_Desktop "Icônes de bureau" +!insertmacro LANG_STRING Section_Desktop_Desc "Ajoute l'icône sur le bureau." +!insertmacro LANG_STRING Section_QuickLaunch "Icône de lancement rapide" +!insertmacro LANG_STRING Section_QuickLaunch_Desc "Ajoute une icône à la barre d'outils de lancement rapide." +!insertmacro LANG_STRING Section_Plugins "Plug-ins optionnels" +!insertmacro LANG_STRING Section_Plugins_Desc "Plug-ins optionnels destinés à étendre les fonctionnalités." +!insertmacro LANG_STRING Section_Plugin_FeedReader "FeedReader" +!insertmacro LANG_STRING Section_Plugin_FeedReader_Desc "Installe le plug-in FeedReader." +!insertmacro LANG_STRING Section_Plugin_LinksCloud "LinksCloud" +!insertmacro LANG_STRING Section_Plugin_LinksCloud_Desc "Installe le plug-in LinksCloud." +!insertmacro LANG_STRING Section_Plugin_VOIP "VOIP" +!insertmacro LANG_STRING Section_Plugin_VOIP_Desc "Installe le plug-in VOIP." +!insertmacro LANG_STRING Section_AutoStart "Démarrage automatique" +!insertmacro LANG_STRING Section_AutoStart_Desc "Démarrage automatique au démarrage." +!insertmacro LANG_STRING Page_InstallMode "Mode d'installation" +!insertmacro LANG_STRING Page_InstallMode_Desc "Choisissez comment vous voulez installer ${APPNAME}." +!insertmacro LANG_STRING Page_InstallMode_Standard "&Installation standard" +!insertmacro LANG_STRING Page_InstallMode_Standard_Desc "Installer ${APPNAME} pour l'utilisateur actuel de cette machine." +!insertmacro LANG_STRING Page_InstallMode_Portable "&Installation portable" +!insertmacro LANG_STRING Page_InstallMode_Portable_Desc "En mode portable toutes les données de configuration sont stockées dans le dossier de l'application et aucune information n'est écrite dans la base de registre." +!insertmacro LANG_STRING Link_Uninstall "Désinstaller" diff --git a/build_scripts/Windows-msys2/installer/lang/pl.nsh b/build_scripts/Windows-msys2/installer/lang/pl.nsh new file mode 100644 index 000000000..9f6d4305e --- /dev/null +++ b/build_scripts/Windows-msys2/installer/lang/pl.nsh @@ -0,0 +1,29 @@ +!insertmacro LANG_STRING Section_Main "${APPNAME}" +!insertmacro LANG_STRING Section_Main_Desc "Instaluje ${APPNAME} oraz wymagane komponenty." +!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" +!insertmacro LANG_STRING Section_Shortcuts_Desc "Dodaje skróty ikon." +!insertmacro LANG_STRING Section_StartMenu "Start Menu icon" +!insertmacro LANG_STRING Section_StartMenu_Desc "Dodaje ikonę do menu start." +!insertmacro LANG_STRING Section_Desktop "Ikona na pulpicie" +!insertmacro LANG_STRING Section_Desktop_Desc "Dodawanie ikony na pulpicie" +!insertmacro LANG_STRING Section_QuickLaunch "Ikona szybkiego uruchamiania" +!insertmacro LANG_STRING Section_QuickLaunch_Desc "Dodaje ikonę do paska Szybkiego Uruchamiania." +!insertmacro LANG_STRING Section_Plugins "Wtyczki opcjonalne" +!insertmacro LANG_STRING Section_Plugins_Desc "Wtyczki opcjonalne rozszerzające funkcjonalność." +!insertmacro LANG_STRING Section_Plugin_FeedReader "FeedReader" +!insertmacro LANG_STRING Section_Plugin_FeedReader_Desc "Instaluje wtyczki FeedReader" +!insertmacro LANG_STRING Section_Plugin_LinksCloud "LinksCloud" +!insertmacro LANG_STRING Section_Plugin_LinksCloud_Desc "Instaluje wtyczki LinksCloud." +!insertmacro LANG_STRING Section_Plugin_VOIP "VOIP" +!insertmacro LANG_STRING Section_Plugin_VOIP_Desc "Instaluje wtyczki VOIP." +!insertmacro LANG_STRING Section_AutoStart "Auto Startup" +!insertmacro LANG_STRING Section_AutoStart_Desc "Automatyczne uruchamianie przy starcie." +!insertmacro LANG_STRING Page_InstallMode "Tryb instalacji" +!insertmacro LANG_STRING Page_InstallMode_Desc "Wybierz jak chcesz zainstalować ${APPNAME}." +!insertmacro LANG_STRING Page_InstallMode_Standard "&Standardowa instalacja" +!insertmacro LANG_STRING Page_InstallMode_Standard_Desc "Zainstaluj ${APPNAME} dla bieżącego użytkownika tej maszyny." +!insertmacro LANG_STRING Page_InstallMode_Portable "&Portable installation" +!insertmacro LANG_STRING Page_InstallMode_Portable_Desc "W trybie przenośnym wszystkie dane konfiguracyjne są przechowywane w folderze aplikacji i nie są zapisywane w rejestrze." +!insertmacro LANG_STRING Link_Uninstall "Odinstaluj" diff --git a/build_scripts/Windows-msys2/installer/lang/ru.nsh b/build_scripts/Windows-msys2/installer/lang/ru.nsh new file mode 100644 index 000000000..09c578cb8 --- /dev/null +++ b/build_scripts/Windows-msys2/installer/lang/ru.nsh @@ -0,0 +1,29 @@ +!insertmacro LANG_STRING Section_Main "${APPNAME}" +!insertmacro LANG_STRING Section_Main_Desc "Установка ${APPNAME} и необходимых компонентов." +!insertmacro LANG_STRING Section_Data "Оболочки" +!insertmacro LANG_STRING Section_Data_Desc "Установка оболочек." +!insertmacro LANG_STRING Section_Shortcuts "Ярлыки" +!insertmacro LANG_STRING Section_Shortcuts_Desc "Добавление ярлыков." +!insertmacro LANG_STRING Section_StartMenu "Ярлык в меню Пуск" +!insertmacro LANG_STRING Section_StartMenu_Desc "Добавление ярлыка в меню Пуск." +!insertmacro LANG_STRING Section_Desktop "Ярлык на рабочем столе" +!insertmacro LANG_STRING Section_Desktop_Desc "Добавление ярлыка на рабочий стол." +!insertmacro LANG_STRING Section_QuickLaunch "Ярлык в панели быстрого запуска" +!insertmacro LANG_STRING Section_QuickLaunch_Desc "Добавление ярлыка на панель быстрого запуска." +!insertmacro LANG_STRING Section_Plugins "Дополнительные плагины" +!insertmacro LANG_STRING Section_Plugins_Desc "Дополнительные плагины для расширения функциональности." +!insertmacro LANG_STRING Section_Plugin_FeedReader "FeedReader – RSS-агрегатор" +!insertmacro LANG_STRING Section_Plugin_FeedReader_Desc "Установка плагина FeedReader." +!insertmacro LANG_STRING Section_Plugin_LinksCloud "LinksCloud – Облако ссылок" +!insertmacro LANG_STRING Section_Plugin_LinksCloud_Desc "Установка плагина LinksCloud." +!insertmacro LANG_STRING Section_Plugin_VOIP "VoIP" +!insertmacro LANG_STRING Section_Plugin_VOIP_Desc "Установка плагина VoIP." +!insertmacro LANG_STRING Section_AutoStart "Автозапуск" +!insertmacro LANG_STRING Section_AutoStart_Desc "Автозапуск при загрузке системы." +!insertmacro LANG_STRING Page_InstallMode "Режим установки" +!insertmacro LANG_STRING Page_InstallMode_Desc "Выберите метод установки ${APPNAME}." +!insertmacro LANG_STRING Page_InstallMode_Standard "Стандартная установка" +!insertmacro LANG_STRING Page_InstallMode_Standard_Desc "Установка ${APPNAME} для текущего пользователя компьютера." +!insertmacro LANG_STRING Page_InstallMode_Portable "Портативная установка" +!insertmacro LANG_STRING Page_InstallMode_Portable_Desc "В режиме портативной установки все конфигурационные файлы сохраняются в папку приложения и в системный реестр не записывается никакой информации." +!insertmacro LANG_STRING Link_Uninstall "Удаление программы" diff --git a/build_scripts/Windows-msys2/installer/lang/tr.nsh b/build_scripts/Windows-msys2/installer/lang/tr.nsh new file mode 100644 index 000000000..f893ac076 --- /dev/null +++ b/build_scripts/Windows-msys2/installer/lang/tr.nsh @@ -0,0 +1,29 @@ +!insertmacro LANG_STRING Section_Main "${APPNAME}" +!insertmacro LANG_STRING Section_Main_Desc "${APPNAME} ve gerekli bileşenleri kurar." +!insertmacro LANG_STRING Section_Data "Temalar" +!insertmacro LANG_STRING Section_Data_Desc "Tema yükleyin." +!insertmacro LANG_STRING Section_Shortcuts "Kısayol simgeleri" +!insertmacro LANG_STRING Section_Shortcuts_Desc "Kısayol simgesi ekleyin." +!insertmacro LANG_STRING Section_StartMenu "Başlat Menüsü simgesi" +!insertmacro LANG_STRING Section_StartMenu_Desc "Başlat menüsüne simge ekleyin." +!insertmacro LANG_STRING Section_Desktop "Masaüstü simgesi" +!insertmacro LANG_STRING Section_Desktop_Desc "Masaüstüne simge ekleyin." +!insertmacro LANG_STRING Section_QuickLaunch "Hızlı Başlat simgesi" +!insertmacro LANG_STRING Section_QuickLaunch_Desc "Hızlı Başlat araç çubuğuna simge ekleyin." +!insertmacro LANG_STRING Section_Plugins "İsteğe bağlı eklentiler" +!insertmacro LANG_STRING Section_Plugins_Desc "İşlevselliği artırmak için isteğe bağlı eklentiler." +!insertmacro LANG_STRING Section_Plugin_FeedReader "AkışOkuyucu" +!insertmacro LANG_STRING Section_Plugin_FeedReader_Desc "AkışOkuyucu eklentisini yükleyin." +!insertmacro LANG_STRING Section_Plugin_LinksCloud "BağlantıBulutu" +!insertmacro LANG_STRING Section_Plugin_LinksCloud_Desc "BağlantıBulutu eklentisini yükleyin." +!insertmacro LANG_STRING Section_Plugin_VOIP "VOIP" +!insertmacro LANG_STRING Section_Plugin_VOIP_Desc "VOIP eklentisini yükleyin." +!insertmacro LANG_STRING Section_AutoStart "Otomatik Başlat" +!insertmacro LANG_STRING Section_AutoStart_Desc "Açılışta otomatik başlatın." +!insertmacro LANG_STRING Page_InstallMode "Kurulum Yöntemi" +!insertmacro LANG_STRING Page_InstallMode_Desc "${APPNAME} kurulum şeklini seçin" +!insertmacro LANG_STRING Page_InstallMode_Standard "&Normal kurulum" +!insertmacro LANG_STRING Page_InstallMode_Standard_Desc "${APPNAME} yalnızca şimdiki kullanıcı için kurulsun." +!insertmacro LANG_STRING Page_InstallMode_Portable "&Taşınabilir kurulum" +!insertmacro LANG_STRING Page_InstallMode_Portable_Desc "Taşınabilir kipte tüm ayarlar uygulama klasörüne depolanır ve kayıt defterine hiçbir bilgi yazılmaz." +!insertmacro LANG_STRING Link_Uninstall "Kaldırın" diff --git a/build_scripts/Windows-msys2/installer/lang/ts/ca_ES.ts b/build_scripts/Windows-msys2/installer/lang/ts/ca_ES.ts new file mode 100644 index 000000000..add40b909 --- /dev/null +++ b/build_scripts/Windows-msys2/installer/lang/ts/ca_ES.ts @@ -0,0 +1,205 @@ + + + Section_Main + + ${APPNAME} + ${APPNAME} + + + + Section_Main_Desc + + Installs ${APPNAME} and required components. + Instal·la ${APPNAME} i els components necessaris. + + + + Section_Data + + Skins + Pells + + + + Section_Data_Desc + + Installs skins. + Instal·la pells. + + + + Section_Shortcuts + + Shortcut icons + Icones d'accés directe + + + + Section_Shortcuts_Desc + + Adds shortcut icons. + Afegir icones d'accés directe. + + + + Section_StartMenu + + Start Menu icon + Icona del menú d'inici + + + + Section_StartMenu_Desc + + Adds icon to start menu. + Afegir icona en el menú d'inici + + + + Section_Desktop + + Desktop icon + Icona d'escriptori + + + + Section_Desktop_Desc + + Adds icon to desktop. + Afegir icona a l'escriptori + + + + Section_QuickLaunch + + Quick Launch icon + Icona de la barra ràpida d'accés + + + + Section_QuickLaunch_Desc + + Adds icon to Quick Launch toolbar. + Afegir icona a la barra ràpida d'accés + + + + Section_Plugins + + Optional plugins + Complements opcionals + + + + Section_Plugins_Desc + + Optional plugins to extend functionality. + Components opcionals per afegir funcionalitat. + + + + Section_Plugin_FeedReader + + FeedReader + LectorFonts + + + + Section_Plugin_FeedReader_Desc + + Installs plugin FeedReader. + Instal·lar complement LectorFonts. + + + + Section_Plugin_LinksCloud + + LinksCloud + NúvolEnllaços + + + + Section_Plugin_LinksCloud_Desc + + Installs plugin LinksCloud. + Instal·lar complement NúvolEnllaços. + + + + Section_Plugin_VOIP + + VOIP + VeuIP + + + + Section_Plugin_VOIP_Desc + + Installs plugin VOIP. + Instal·lar complement VeuIP. + + + + Section_AutoStart + + Auto Startup + Posada en marxa automàtica + + + + Section_AutoStart_Desc + + Auto-Run at startup. + Autoengegar al arrencar. + + + + Page_InstallMode + + Installation Mode + Mode instal·lació + + + + Page_InstallMode_Desc + + Choose how you want to install ${APPNAME}. + Escull com vols instal·lar ${APPNAME}. + + + + Page_InstallMode_Standard + + &Standard installation + Instal·lació e&stàndard + + + + Page_InstallMode_Standard_Desc + + Install ${APPNAME} for the current user of this machine. + Instal·la ${APPNAME} per la sessió d'usuari actual. + + + + Page_InstallMode_Portable + + &Portable installation + Instal·lació &portable. + + + + Page_InstallMode_Portable_Desc + + In portable mode all configuration data is stored in the application folder and no information is written to the registry. + En mode portable les dades de configuració s'emmagatzemen a la carpeta d'aplicació i no s'escriu informació al registre del sistema. + + + + Link_Uninstall + + Uninstall + Desinstal·lar. + + + \ No newline at end of file diff --git a/build_scripts/Windows-msys2/installer/lang/ts/convert_from_ts.bat b/build_scripts/Windows-msys2/installer/lang/ts/convert_from_ts.bat new file mode 100644 index 000000000..d514256e1 --- /dev/null +++ b/build_scripts/Windows-msys2/installer/lang/ts/convert_from_ts.bat @@ -0,0 +1,27 @@ +@echo off + +:: Very simple conversion from *.ts to *.nsh using xslt + +pushd "%~dp0" + +if "%1"=="" ( + for %%F in (*.ts) do if "%%F" NEQ "en.ts" call :convert %%~nF + goto :exit +) + +call :convert %1 + +:exit +popd + +goto :EOF + +:convert +if not exist "%~1.ts" ( + echo File "%~1.ts" not found. + goto :EOF +) + +echo %~1 + +"%~dp0xsltproc.exe" --output "%~dp0..\%~1.nsh" "%~dp0convert_from_ts.xsl" "%~1.ts" diff --git a/build_scripts/Windows-msys2/installer/lang/ts/convert_from_ts.xsl b/build_scripts/Windows-msys2/installer/lang/ts/convert_from_ts.xsl new file mode 100644 index 000000000..a376fe691 --- /dev/null +++ b/build_scripts/Windows-msys2/installer/lang/ts/convert_from_ts.xsl @@ -0,0 +1,20 @@ + + + + + + + + !insertmacro LANG_STRING + + " + + + + + " + + + + \ No newline at end of file diff --git a/build_scripts/Windows-msys2/installer/lang/ts/convert_to_ts.bat b/build_scripts/Windows-msys2/installer/lang/ts/convert_to_ts.bat new file mode 100644 index 000000000..9235d6bab --- /dev/null +++ b/build_scripts/Windows-msys2/installer/lang/ts/convert_to_ts.bat @@ -0,0 +1,50 @@ +@echo off + +:: Very simple conversion from *.nsh to *.ts + +setlocal + +set Language=en +if "%1" NEQ "" set Language=%1 + +set InputFile=%~dp0..\%Language%.nsh +set OutputFile=%~dp0%Language%.ts + +if not exist "%InputFile%" ( + echo File %InputFile% not found. + goto :exit +) + +echo ^ >"%OutputFile%" +echo ^ >>"%OutputFile%" +echo ^ >>"%OutputFile%" + +for /F "tokens=1,2,3,*" %%A in (%InputFile%) do if "%%A"=="!insertmacro" call :context %%C %%D + +echo ^ >>"%OutputFile%" + +:exit +endlocal +goto :EOF + +:context + +setlocal EnableDelayedExpansion + +:: Simple replace of & to & +set Text=%2 +set Text=%Text:&=^&% +set Text=%Text:~1,-1% + +echo !Text! + +echo ^ >>"%OutputFile%" +echo ^%~1^ >>"%OutputFile%" +echo ^ >>"%OutputFile%" +echo ^!Text!^ >>"%OutputFile%" +echo ^^ >>"%OutputFile%" +echo ^ >>"%OutputFile%" +echo ^ >>"%OutputFile%" + +endlocal +goto :EOF diff --git a/build_scripts/Windows-msys2/installer/lang/ts/de.ts b/build_scripts/Windows-msys2/installer/lang/ts/de.ts new file mode 100644 index 000000000..4469c6818 --- /dev/null +++ b/build_scripts/Windows-msys2/installer/lang/ts/de.ts @@ -0,0 +1,205 @@ + + + Section_Main + + ${APPNAME} + ${APPNAME} + + + + Section_Main_Desc + + Installs ${APPNAME} and required components. + Installiert ${APPNAME} und die benötigten Komponenten. + + + + Section_Data + + Skins + Skins + + + + Section_Data_Desc + + Installs skins. + Skins installieren. + + + + Section_Shortcuts + + Shortcut icons + Verknüpfungssymbole + + + + Section_Shortcuts_Desc + + Adds shortcut icons. + Verküpfungssymbole hinzufügen. + + + + Section_StartMenu + + Start Menu icon + Startmenüsymbol + + + + Section_StartMenu_Desc + + Adds icon to start menu. + Fügt Symbol zum Startmenü hinzu. + + + + Section_Desktop + + Desktop icon + Desktopsymbol + + + + Section_Desktop_Desc + + Adds icon to desktop. + Fügt Symbol zum Desktop hinzu. + + + + Section_QuickLaunch + + Quick Launch icon + Schnellstartsymbol + + + + Section_QuickLaunch_Desc + + Adds icon to Quick Launch toolbar. + Fügt Symbol zur Schnellstartleiste hinzu. + + + + Section_Plugins + + Optional plugins + Optionale Plug-ins + + + + Section_Plugins_Desc + + Optional plugins to extend functionality. + Optionale Plug-ins zum Erweitern der Funktionalität. + + + + Section_Plugin_FeedReader + + FeedReader + FeedReader + + + + Section_Plugin_FeedReader_Desc + + Installs plugin FeedReader. + Installiert das Plug-in Feedreader. + + + + Section_Plugin_LinksCloud + + LinksCloud + Verknüpfungswolke + + + + Section_Plugin_LinksCloud_Desc + + Installs plugin LinksCloud. + Installiert das Plug-in Verknüpfungswolke. + + + + Section_Plugin_VOIP + + VOIP + VOIP + + + + Section_Plugin_VOIP_Desc + + Installs plugin VOIP. + Installiert das Plug-in VOIP + + + + Section_AutoStart + + Auto Startup + Automatischer Programmstart + + + + Section_AutoStart_Desc + + Auto-Run at startup. + Beim Start automatisch ausführen. + + + + Page_InstallMode + + Installation Mode + Installationsmodus + + + + Page_InstallMode_Desc + + Choose how you want to install ${APPNAME}. + Wähle wie du ${APPNAME} installieren willst. + + + + Page_InstallMode_Standard + + &Standard installation + &Standardinstallation + + + + Page_InstallMode_Standard_Desc + + Install ${APPNAME} for the current user of this machine. + Installiere ${APPNAME} für den derzeitigen Benutzer dieses Geräts. + + + + Page_InstallMode_Portable + + &Portable installation + &Portable Installation + + + + Page_InstallMode_Portable_Desc + + In portable mode all configuration data is stored in the application folder and no information is written to the registry. + Im portablen Modus werden alle Konfigurationsdaten im Verzeichnis der Anwendung gespeichert und keine Informationen in der Registry abgelegt. + + + + Link_Uninstall + + Uninstall + Deinstallieren + + + \ No newline at end of file diff --git a/build_scripts/Windows-msys2/installer/lang/ts/en.ts b/build_scripts/Windows-msys2/installer/lang/ts/en.ts new file mode 100644 index 000000000..800157426 --- /dev/null +++ b/build_scripts/Windows-msys2/installer/lang/ts/en.ts @@ -0,0 +1,186 @@ + + + + + Section_Main_Desc + + Installs ${APPNAME} and required components. + + + + + Section_Data + + Skins + + + + + Section_Data_Desc + + Installs skins. + + + + + Section_Shortcuts + + Shortcut icons + + + + + Section_Shortcuts_Desc + + Adds shortcut icons. + + + + + Section_StartMenu + + Start Menu icon + + + + + Section_StartMenu_Desc + + Adds icon to start menu. + + + + + Section_Desktop + + Desktop icon + + + + + Section_Desktop_Desc + + Adds icon to desktop. + + + + + Section_QuickLaunch + + Quick Launch icon + + + + + Section_QuickLaunch_Desc + + Adds icon to Quick Launch toolbar. + + + + + Section_Plugins + + Optional plugins + + + + + Section_Plugins_Desc + + Optional plugins to extend functionality. + + + + + Section_Plugin_FeedReader + + FeedReader + + + + + Section_Plugin_FeedReader_Desc + + Installs plugin FeedReader. + + + + + Section_Plugin_VOIP + + VOIP + + + + + Section_Plugin_VOIP_Desc + + Installs plugin VOIP. + + + + + Section_AutoStart + + Auto Startup + + + + + Section_AutoStart_Desc + + Auto-Run at startup. + + + + + Page_InstallMode + + Installation Mode + + + + + Page_InstallMode_Desc + + Choose how you want to install ${APPNAME}. + + + + + Page_InstallMode_Standard + + &Standard installation + + + + + Page_InstallMode_Standard_Desc + + Install ${APPNAME} for the current user of this machine. + + + + + Page_InstallMode_Portable + + &Portable installation + + + + + Page_InstallMode_Portable_Desc + + In portable mode all configuration data is stored in the application folder and no information is written to the registry. + + + + + Link_Uninstall + + Uninstall + + + + diff --git a/build_scripts/Windows-msys2/installer/lang/ts/es.ts b/build_scripts/Windows-msys2/installer/lang/ts/es.ts new file mode 100644 index 000000000..dab920294 --- /dev/null +++ b/build_scripts/Windows-msys2/installer/lang/ts/es.ts @@ -0,0 +1,205 @@ + + + Section_Main + + ${APPNAME} + ${APPNAME} + + + + Section_Main_Desc + + Installs ${APPNAME} and required components. + Instala ${APPNAME} y los componentes requeridos. + + + + Section_Data + + Skins + Coberturas (skins) + + + + Section_Data_Desc + + Installs skins. + Instalar coberturas + + + + Section_Shortcuts + + Shortcut icons + Iconos de accesos directos + + + + Section_Shortcuts_Desc + + Adds shortcut icons. + Añade iconos de accesos directos. + + + + Section_StartMenu + + Start Menu icon + Icono de menú de inicio + + + + Section_StartMenu_Desc + + Adds icon to start menu. + Añade icono al menú de inicio. + + + + Section_Desktop + + Desktop icon + Icono del escritorio + + + + Section_Desktop_Desc + + Adds icon to desktop. + Añade icono al escritorio + + + + Section_QuickLaunch + + Quick Launch icon + Icono de inicio rápido + + + + Section_QuickLaunch_Desc + + Adds icon to Quick Launch toolbar. + Añade icono a la Barra de Inicio Rápido + + + + Section_Plugins + + Optional plugins + Complementos opcionales + + + + Section_Plugins_Desc + + Optional plugins to extend functionality. + Complementos opcionales para expandir la funcionalidad. + + + + Section_Plugin_FeedReader + + FeedReader + FeedReader + + + + Section_Plugin_FeedReader_Desc + + Installs plugin FeedReader. + Instala el complemento FeedReader. + + + + Section_Plugin_LinksCloud + + LinksCloud + LinksCloud + + + + Section_Plugin_LinksCloud_Desc + + Installs plugin LinksCloud. + Instala el complemento LinksCloud. + + + + Section_Plugin_VOIP + + VOIP + VOIP + + + + Section_Plugin_VOIP_Desc + + Installs plugin VOIP. + Instala el complemento VOIP + + + + Section_AutoStart + + Auto Startup + Auto iniciar + + + + Section_AutoStart_Desc + + Auto-Run at startup. + Auto-ejecutar al incio. + + + + Page_InstallMode + + Installation Mode + Modo de instalación + + + + Page_InstallMode_Desc + + Choose how you want to install ${APPNAME}. + Elija cómo quiere instalar ${APPNAME}. + + + + Page_InstallMode_Standard + + &Standard installation + Instalación &Estándar + + + + Page_InstallMode_Standard_Desc + + Install ${APPNAME} for the current user of this machine. + Instalar ${APPNAME} para el usuario actual de esta máquina. + + + + Page_InstallMode_Portable + + &Portable installation + Instalación &Portable + + + + Page_InstallMode_Portable_Desc + + In portable mode all configuration data is stored in the application folder and no information is written to the registry. + En modo portable, todos los datos de configuración se almacenan en la carpeta de la aplicación y no se escribe ninguna información en el registro. + + + + Link_Uninstall + + Uninstall + Desinstalar + + + \ No newline at end of file diff --git a/build_scripts/Windows-msys2/installer/lang/ts/fr.ts b/build_scripts/Windows-msys2/installer/lang/ts/fr.ts new file mode 100644 index 000000000..6ba710f7d --- /dev/null +++ b/build_scripts/Windows-msys2/installer/lang/ts/fr.ts @@ -0,0 +1,205 @@ + + + Section_Main + + ${APPNAME} + ${APPNAME} + + + + Section_Main_Desc + + Installs ${APPNAME} and required components. + Installe ${APPNAME} et les composants requis. + + + + Section_Data + + Skins + Habillages + + + + Section_Data_Desc + + Installs skins. + Installe des habillages. + + + + Section_Shortcuts + + Shortcut icons + Icônes de raccourci + + + + Section_Shortcuts_Desc + + Adds shortcut icons. + Ajoute les icônes de raccourci. + + + + Section_StartMenu + + Start Menu icon + Icône de menu démarrage + + + + Section_StartMenu_Desc + + Adds icon to start menu. + Ajoute l'icône au menu démarrer. + + + + Section_Desktop + + Desktop icon + Icônes de bureau + + + + Section_Desktop_Desc + + Adds icon to desktop. + Ajoute l'icône sur le bureau. + + + + Section_QuickLaunch + + Quick Launch icon + Icône de lancement rapide + + + + Section_QuickLaunch_Desc + + Adds icon to Quick Launch toolbar. + Ajoute une icône à la barre d'outils de lancement rapide. + + + + Section_Plugins + + Optional plugins + Plug-ins optionnels + + + + Section_Plugins_Desc + + Optional plugins to extend functionality. + Plug-ins optionnels destinés à étendre les fonctionnalités. + + + + Section_Plugin_FeedReader + + FeedReader + FeedReader + + + + Section_Plugin_FeedReader_Desc + + Installs plugin FeedReader. + Installe le plug-in FeedReader. + + + + Section_Plugin_LinksCloud + + LinksCloud + LinksCloud + + + + Section_Plugin_LinksCloud_Desc + + Installs plugin LinksCloud. + Installe le plug-in LinksCloud. + + + + Section_Plugin_VOIP + + VOIP + VOIP + + + + Section_Plugin_VOIP_Desc + + Installs plugin VOIP. + Installe le plug-in VOIP. + + + + Section_AutoStart + + Auto Startup + Démarrage automatique + + + + Section_AutoStart_Desc + + Auto-Run at startup. + Démarrage automatique au démarrage. + + + + Page_InstallMode + + Installation Mode + Mode d'installation + + + + Page_InstallMode_Desc + + Choose how you want to install ${APPNAME}. + Choisissez comment vous voulez installer ${APPNAME}. + + + + Page_InstallMode_Standard + + &Standard installation + &Installation standard + + + + Page_InstallMode_Standard_Desc + + Install ${APPNAME} for the current user of this machine. + Installer ${APPNAME} pour l'utilisateur actuel de cette machine. + + + + Page_InstallMode_Portable + + &Portable installation + &Installation portable + + + + Page_InstallMode_Portable_Desc + + In portable mode all configuration data is stored in the application folder and no information is written to the registry. + En mode portable toutes les données de configuration sont stockées dans le dossier de l'application et aucune information n'est écrite dans la base de registre. + + + + Link_Uninstall + + Uninstall + Désinstaller + + + \ No newline at end of file diff --git a/build_scripts/Windows-msys2/installer/lang/ts/pl.ts b/build_scripts/Windows-msys2/installer/lang/ts/pl.ts new file mode 100644 index 000000000..deb56164f --- /dev/null +++ b/build_scripts/Windows-msys2/installer/lang/ts/pl.ts @@ -0,0 +1,205 @@ + + + Section_Main + + ${APPNAME} + ${APPNAME} + + + + Section_Main_Desc + + Installs ${APPNAME} and required components. + Instaluje ${APPNAME} oraz wymagane komponenty. + + + + Section_Data + + Skins + Skórki + + + + Section_Data_Desc + + Installs skins. + Instaluje skórki. + + + + Section_Shortcuts + + Shortcut icons + Ikony skrótów + + + + Section_Shortcuts_Desc + + Adds shortcut icons. + Dodaje skróty ikon. + + + + Section_StartMenu + + Start Menu icon + + + + + Section_StartMenu_Desc + + Adds icon to start menu. + Dodaje ikonę do menu start. + + + + Section_Desktop + + Desktop icon + Ikona na pulpicie + + + + Section_Desktop_Desc + + Adds icon to desktop. + Dodawanie ikony na pulpicie + + + + Section_QuickLaunch + + Quick Launch icon + Ikona szybkiego uruchamiania + + + + Section_QuickLaunch_Desc + + Adds icon to Quick Launch toolbar. + Dodaje ikonę do paska Szybkiego Uruchamiania. + + + + Section_Plugins + + Optional plugins + Wtyczki opcjonalne + + + + Section_Plugins_Desc + + Optional plugins to extend functionality. + Wtyczki opcjonalne rozszerzające funkcjonalność. + + + + Section_Plugin_FeedReader + + FeedReader + FeedReader + + + + Section_Plugin_FeedReader_Desc + + Installs plugin FeedReader. + Instaluje wtyczki FeedReader + + + + Section_Plugin_LinksCloud + + LinksCloud + + + + + Section_Plugin_LinksCloud_Desc + + Installs plugin LinksCloud. + Instaluje wtyczki LinksCloud. + + + + Section_Plugin_VOIP + + VOIP + VOIP + + + + Section_Plugin_VOIP_Desc + + Installs plugin VOIP. + Instaluje wtyczki VOIP. + + + + Section_AutoStart + + Auto Startup + + + + + Section_AutoStart_Desc + + Auto-Run at startup. + Automatyczne uruchamianie przy starcie. + + + + Page_InstallMode + + Installation Mode + Tryb instalacji + + + + Page_InstallMode_Desc + + Choose how you want to install ${APPNAME}. + Wybierz jak chcesz zainstalować ${APPNAME}. + + + + Page_InstallMode_Standard + + &Standard installation + &Standardowa instalacja + + + + Page_InstallMode_Standard_Desc + + Install ${APPNAME} for the current user of this machine. + Zainstaluj ${APPNAME} dla bieżącego użytkownika tej maszyny. + + + + Page_InstallMode_Portable + + &Portable installation + + + + + Page_InstallMode_Portable_Desc + + In portable mode all configuration data is stored in the application folder and no information is written to the registry. + W trybie przenośnym wszystkie dane konfiguracyjne są przechowywane w folderze aplikacji i nie są zapisywane w rejestrze. + + + + Link_Uninstall + + Uninstall + Odinstaluj + + + \ No newline at end of file diff --git a/build_scripts/Windows-msys2/installer/lang/ts/ru.ts b/build_scripts/Windows-msys2/installer/lang/ts/ru.ts new file mode 100644 index 000000000..3c29f3955 --- /dev/null +++ b/build_scripts/Windows-msys2/installer/lang/ts/ru.ts @@ -0,0 +1,205 @@ + + + Section_Main + + ${APPNAME} + ${APPNAME} + + + + Section_Main_Desc + + Installs ${APPNAME} and required components. + Установка ${APPNAME} и необходимых компонентов. + + + + Section_Data + + Skins + Оболочки + + + + Section_Data_Desc + + Installs skins. + Установка оболочек. + + + + Section_Shortcuts + + Shortcut icons + Ярлыки + + + + Section_Shortcuts_Desc + + Adds shortcut icons. + Добавление ярлыков. + + + + Section_StartMenu + + Start Menu icon + Ярлык в меню Пуск + + + + Section_StartMenu_Desc + + Adds icon to start menu. + Добавление ярлыка в меню Пуск. + + + + Section_Desktop + + Desktop icon + Ярлык на рабочем столе + + + + Section_Desktop_Desc + + Adds icon to desktop. + Добавление ярлыка на рабочий стол. + + + + Section_QuickLaunch + + Quick Launch icon + Ярлык в панели быстрого запуска + + + + Section_QuickLaunch_Desc + + Adds icon to Quick Launch toolbar. + Добавление ярлыка на панель быстрого запуска. + + + + Section_Plugins + + Optional plugins + Дополнительные плагины + + + + Section_Plugins_Desc + + Optional plugins to extend functionality. + Дополнительные плагины для расширения функциональности. + + + + Section_Plugin_FeedReader + + FeedReader + FeedReader – RSS-агрегатор + + + + Section_Plugin_FeedReader_Desc + + Installs plugin FeedReader. + Установка плагина FeedReader. + + + + Section_Plugin_LinksCloud + + LinksCloud + LinksCloud – Облако ссылок + + + + Section_Plugin_LinksCloud_Desc + + Installs plugin LinksCloud. + Установка плагина LinksCloud. + + + + Section_Plugin_VOIP + + VOIP + VoIP + + + + Section_Plugin_VOIP_Desc + + Installs plugin VOIP. + Установка плагина VoIP. + + + + Section_AutoStart + + Auto Startup + Автозапуск + + + + Section_AutoStart_Desc + + Auto-Run at startup. + Автозапуск при загрузке системы. + + + + Page_InstallMode + + Installation Mode + Режим установки + + + + Page_InstallMode_Desc + + Choose how you want to install ${APPNAME}. + Выберите метод установки ${APPNAME}. + + + + Page_InstallMode_Standard + + &Standard installation + Стандартная установка + + + + Page_InstallMode_Standard_Desc + + Install ${APPNAME} for the current user of this machine. + Установка ${APPNAME} для текущего пользователя компьютера. + + + + Page_InstallMode_Portable + + &Portable installation + Портативная установка + + + + Page_InstallMode_Portable_Desc + + In portable mode all configuration data is stored in the application folder and no information is written to the registry. + В режиме портативной установки все конфигурационные файлы сохраняются в папку приложения и в системный реестр не записывается никакой информации. + + + + Link_Uninstall + + Uninstall + Удаление программы + + + \ No newline at end of file diff --git a/build_scripts/Windows-msys2/installer/lang/ts/tr.ts b/build_scripts/Windows-msys2/installer/lang/ts/tr.ts new file mode 100644 index 000000000..d67961d59 --- /dev/null +++ b/build_scripts/Windows-msys2/installer/lang/ts/tr.ts @@ -0,0 +1,205 @@ + + + Section_Main + + ${APPNAME} + ${APPNAME} + + + + Section_Main_Desc + + Installs ${APPNAME} and required components. + ${APPNAME} ve gerekli bileşenleri kurar. + + + + Section_Data + + Skins + Temalar + + + + Section_Data_Desc + + Installs skins. + Tema yükleyin. + + + + Section_Shortcuts + + Shortcut icons + Kısayol simgeleri + + + + Section_Shortcuts_Desc + + Adds shortcut icons. + Kısayol simgesi ekleyin. + + + + Section_StartMenu + + Start Menu icon + Başlat Menüsü simgesi + + + + Section_StartMenu_Desc + + Adds icon to start menu. + Başlat menüsüne simge ekleyin. + + + + Section_Desktop + + Desktop icon + Masaüstü simgesi + + + + Section_Desktop_Desc + + Adds icon to desktop. + Masaüstüne simge ekleyin. + + + + Section_QuickLaunch + + Quick Launch icon + Hızlı Başlat simgesi + + + + Section_QuickLaunch_Desc + + Adds icon to Quick Launch toolbar. + Hızlı Başlat araç çubuğuna simge ekleyin. + + + + Section_Plugins + + Optional plugins + İsteğe bağlı eklentiler + + + + Section_Plugins_Desc + + Optional plugins to extend functionality. + İşlevselliği artırmak için isteğe bağlı eklentiler. + + + + Section_Plugin_FeedReader + + FeedReader + AkışOkuyucu + + + + Section_Plugin_FeedReader_Desc + + Installs plugin FeedReader. + AkışOkuyucu eklentisini yükleyin. + + + + Section_Plugin_LinksCloud + + LinksCloud + BağlantıBulutu + + + + Section_Plugin_LinksCloud_Desc + + Installs plugin LinksCloud. + BağlantıBulutu eklentisini yükleyin. + + + + Section_Plugin_VOIP + + VOIP + VOIP + + + + Section_Plugin_VOIP_Desc + + Installs plugin VOIP. + VOIP eklentisini yükleyin. + + + + Section_AutoStart + + Auto Startup + Otomatik Başlat + + + + Section_AutoStart_Desc + + Auto-Run at startup. + Açılışta otomatik başlatın. + + + + Page_InstallMode + + Installation Mode + Kurulum Yöntemi + + + + Page_InstallMode_Desc + + Choose how you want to install ${APPNAME}. + ${APPNAME} kurulum şeklini seçin + + + + Page_InstallMode_Standard + + &Standard installation + &Normal kurulum + + + + Page_InstallMode_Standard_Desc + + Install ${APPNAME} for the current user of this machine. + ${APPNAME} yalnızca şimdiki kullanıcı için kurulsun. + + + + Page_InstallMode_Portable + + &Portable installation + &Taşınabilir kurulum + + + + Page_InstallMode_Portable_Desc + + In portable mode all configuration data is stored in the application folder and no information is written to the registry. + Taşınabilir kipte tüm ayarlar uygulama klasörüne depolanır ve kayıt defterine hiçbir bilgi yazılmaz. + + + + Link_Uninstall + + Uninstall + Kaldırın + + + \ No newline at end of file diff --git a/build_scripts/Windows-msys2/installer/lang/ts/xsltproc.exe b/build_scripts/Windows-msys2/installer/lang/ts/xsltproc.exe new file mode 100644 index 000000000..79c250892 Binary files /dev/null and b/build_scripts/Windows-msys2/installer/lang/ts/xsltproc.exe differ diff --git a/build_scripts/Windows-msys2/installer/lang/ts/zh_CN.ts b/build_scripts/Windows-msys2/installer/lang/ts/zh_CN.ts new file mode 100644 index 000000000..30c992601 --- /dev/null +++ b/build_scripts/Windows-msys2/installer/lang/ts/zh_CN.ts @@ -0,0 +1,205 @@ + + + Section_Main + + ${APPNAME} + + + + + Section_Main_Desc + + Installs ${APPNAME} and required components. + + + + + Section_Data + + Skins + 皮肤 + + + + Section_Data_Desc + + Installs skins. + 安装皮肤 + + + + Section_Shortcuts + + Shortcut icons + 快捷方式图标 + + + + Section_Shortcuts_Desc + + Adds shortcut icons. + 添加快捷方式图标 + + + + Section_StartMenu + + Start Menu icon + 开始菜单图标 + + + + Section_StartMenu_Desc + + Adds icon to start menu. + 添加图标至开始菜单 + + + + Section_Desktop + + Desktop icon + 桌面图标 + + + + Section_Desktop_Desc + + Adds icon to desktop. + 添加图标至桌面 + + + + Section_QuickLaunch + + Quick Launch icon + 快速启动栏图标 + + + + Section_QuickLaunch_Desc + + Adds icon to Quick Launch toolbar. + 添加图标至快速启动栏 + + + + Section_Plugins + + Optional plugins + + + + + Section_Plugins_Desc + + Optional plugins to extend functionality. + + + + + Section_Plugin_FeedReader + + FeedReader + RSS订阅 + + + + Section_Plugin_FeedReader_Desc + + Installs plugin FeedReader. + 安装RSS订阅插件 + + + + Section_Plugin_LinksCloud + + LinksCloud + LinksCloud + + + + Section_Plugin_LinksCloud_Desc + + Installs plugin LinksCloud. + 安装插件LinksCloud + + + + Section_Plugin_VOIP + + VOIP + 语音 + + + + Section_Plugin_VOIP_Desc + + Installs plugin VOIP. + 安装语音插件 + + + + Section_AutoStart + + Auto Startup + + + + + Section_AutoStart_Desc + + Auto-Run at startup. + + + + + Page_InstallMode + + Installation Mode + 安装模式 + + + + Page_InstallMode_Desc + + Choose how you want to install ${APPNAME}. + + + + + Page_InstallMode_Standard + + &Standard installation + + + + + Page_InstallMode_Standard_Desc + + Install ${APPNAME} for the current user of this machine. + + + + + Page_InstallMode_Portable + + &Portable installation + + + + + Page_InstallMode_Portable_Desc + + In portable mode all configuration data is stored in the application folder and no information is written to the registry. + + + + + Link_Uninstall + + Uninstall + 卸载 + + + \ No newline at end of file diff --git a/build_scripts/Windows-msys2/installer/lang/zh_CN.nsh b/build_scripts/Windows-msys2/installer/lang/zh_CN.nsh new file mode 100644 index 000000000..1075f7a1a --- /dev/null +++ b/build_scripts/Windows-msys2/installer/lang/zh_CN.nsh @@ -0,0 +1,29 @@ +!insertmacro LANG_STRING Section_Main "${APPNAME}" +!insertmacro LANG_STRING Section_Main_Desc "Installs ${APPNAME} and required components." +!insertmacro LANG_STRING Section_Data "皮肤" +!insertmacro LANG_STRING Section_Data_Desc "安装皮肤" +!insertmacro LANG_STRING Section_Shortcuts "快捷方式图标" +!insertmacro LANG_STRING Section_Shortcuts_Desc "添加快捷方式图标" +!insertmacro LANG_STRING Section_StartMenu "开始菜单图标" +!insertmacro LANG_STRING Section_StartMenu_Desc "添加图标至开始菜单" +!insertmacro LANG_STRING Section_Desktop "桌面图标" +!insertmacro LANG_STRING Section_Desktop_Desc "添加图标至桌面" +!insertmacro LANG_STRING Section_QuickLaunch "快速启动栏图标" +!insertmacro LANG_STRING Section_QuickLaunch_Desc "添加图标至快速启动栏" +!insertmacro LANG_STRING Section_Plugins "Optional plugins" +!insertmacro LANG_STRING Section_Plugins_Desc "Optional plugins to extend functionality." +!insertmacro LANG_STRING Section_Plugin_FeedReader "RSS订阅" +!insertmacro LANG_STRING Section_Plugin_FeedReader_Desc "安装RSS订阅插件" +!insertmacro LANG_STRING Section_Plugin_LinksCloud "LinksCloud" +!insertmacro LANG_STRING Section_Plugin_LinksCloud_Desc "安装插件LinksCloud" +!insertmacro LANG_STRING Section_Plugin_VOIP "语音" +!insertmacro LANG_STRING Section_Plugin_VOIP_Desc "安装语音插件" +!insertmacro LANG_STRING Section_AutoStart "Auto Startup" +!insertmacro LANG_STRING Section_AutoStart_Desc "Auto-Run at startup." +!insertmacro LANG_STRING Page_InstallMode "安装模式" +!insertmacro LANG_STRING Page_InstallMode_Desc "Choose how you want to install ${APPNAME}." +!insertmacro LANG_STRING Page_InstallMode_Standard "&Standard installation" +!insertmacro LANG_STRING Page_InstallMode_Standard_Desc "Install ${APPNAME} for the current user of this machine." +!insertmacro LANG_STRING Page_InstallMode_Portable "&Portable installation" +!insertmacro LANG_STRING Page_InstallMode_Portable_Desc "In portable mode all configuration data is stored in the application folder and no information is written to the registry." +!insertmacro LANG_STRING Link_Uninstall "卸载" diff --git a/build_scripts/Windows/installer/retroshare-Qt4.nsi b/build_scripts/Windows-msys2/installer/retroshare-Qt5.nsi similarity index 76% rename from build_scripts/Windows/installer/retroshare-Qt4.nsi rename to build_scripts/Windows-msys2/installer/retroshare-Qt5.nsi index 0d7b9c6aa..b30300634 100644 --- a/build_scripts/Windows/installer/retroshare-Qt4.nsi +++ b/build_scripts/Windows-msys2/installer/retroshare-Qt5.nsi @@ -1,471 +1,445 @@ -; Script generated with the Venis Install Wizard & modified by defnax -; Reworked by Thunder - -# Needed defines -;!define BUILDADD "" -;!define RELEASEDIR "" -;!define QTDIR "" -;!define MINGWDIR "" - -# Optional defines -;!define OUTDIR "" - -# Check needed defines -!ifndef BUILDADD -!error "BUILDADD is not defined" -!endif - -!ifndef RELEASEDIR -!error "RELEASEDIR is not defined" -!endif -!ifndef QTDIR -!error "QTDIR is not defined" -!endif -!ifndef MINGWDIR -!error "MINGWDIR is not defined" -!endif - -# Check optional defines -!ifdef OUTDIR -!define OUTDIR_ "${OUTDIR}\" -!else -!define OUTDIR "" -!define OUTDIR_ "" -!endif - -!ifndef INSTALLERADD -!define INSTALLERADD "" -!endif - -# Source directory -!define SOURCEDIR "..\..\.." - -# Get version from executable -!GetDllVersion "${RELEASEDIR}\retroshare-gui\src\release\retroshare.exe" VERSION_ -!define VERSION ${VERSION_1}.${VERSION_2}.${VERSION_3}${BUILDADD} -;!define REVISION ${VERSION_4} - -# Get version of Qt -!GetDllVersion "${QTDIR}\bin\QtCore4.dll" QTVERSION_ -!define QTVERSION ${QTVERSION_1}.${QTVERSION_2}.${QTVERSION_3} - -# Check version -!ifndef REVISION -!error "REVISION is not defined" -!endif - -!ifndef REVISION -!error "REVISION is not defined" -!endif - -# Date -!define /date Date "%Y%m%d" - -# Application name and version -!define APPNAME "RetroShare" -!define APPNAMEANDVERSION "${APPNAME} ${VERSION}" -!define PUBLISHER "RetroShare Team" - -# Install path -!define INSTDIR_NORMAL "$ProgramFiles\${APPNAME}" -!define INSTDIR_PORTABLE "$Desktop\${APPNAME}" - -!define DATADIR_NORMAL "$APPDATA\${APPNAME}" -!define DATADIR_PORTABLE "$INSTDIR\Data" - -# Main Install settings -Name "${APPNAMEANDVERSION}" -InstallDirRegKey HKLM "Software\${APPNAME}" "" -OutFile "${OUTDIR_}RetroShare-${VERSION}-${Date}-${REVISION}-Qt-${QTVERSION}${INSTALLERADD}-setup.exe" -BrandingText "${APPNAMEANDVERSION}" -RequestExecutionlevel highest -# Use compression -SetCompressor /SOLID LZMA - -# Global variables -Var PortableMode -Var InstDirNormal -Var InstDirPortable -Var DataDir -Var StyleSheetDir - -# Modern interface settings -!include Sections.nsh -!include nsDialogs.nsh -!include "MUI.nsh" - -# Interface Settings -!define MUI_ABORTWARNING -!define MUI_HEADERIMAGE -!define MUI_HEADERIMAGE_BITMAP "${SOURCEDIR}\build_scripts\Windows\installer\HeaderImage.bmp" -;!define MUI_WELCOMEFINISHPAGE_BITMAP "...bmp" - -# MUI defines -!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\orange-install.ico" -!define MUI_FINISHPAGE_NOAUTOCLOSE -!define MUI_LICENSEPAGE_RADIOBUTTONS -!define MUI_COMPONENTSPAGE_SMALLDESC -!define MUI_FINISHPAGE_LINK "Visit the RetroShare forum for the latest news and support" -!define MUI_FINISHPAGE_LINK_LOCATION "http://retroshare.sourceforge.net/forum/" -!define MUI_FINISHPAGE_RUN "$INSTDIR\retroshare.exe" -!define MUI_FINISHPAGE_SHOWREADME $INSTDIR\changelog.txt -!define MUI_FINISHPAGE_SHOWREADME_TEXT changelog.txt -!define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED -!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\orange-uninstall.ico" -!define MUI_UNFINISHPAGE_NOAUTOCLOSE -;!define MUI_LANGDLL_REGISTRY_ROOT HKLM -;!define MUI_LANGDLL_REGISTRY_KEY ${REGKEY} -;!define MUI_LANGDLL_REGISTRY_VALUENAME InstallerLanguage - -# Defines the un-/installer logo of RetroShare -!insertmacro MUI_DEFAULT MUI_WELCOMEFINISHPAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Wizard\orange.bmp" -!insertmacro MUI_DEFAULT MUI_UNWELCOMEFINISHPAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Wizard\orange-uninstall.bmp" - -# Installer pages -!insertmacro MUI_PAGE_WELCOME -!insertmacro MUI_PAGE_LICENSE "$(myLicenseData)" -Page Custom PortableModePageCreate PortableModePageLeave -!define MUI_PAGE_CUSTOMFUNCTION_LEAVE dir_leave -!insertmacro MUI_PAGE_DIRECTORY -!insertmacro MUI_PAGE_COMPONENTS -!insertmacro MUI_PAGE_INSTFILES -!insertmacro MUI_PAGE_FINISH -!insertmacro MUI_UNPAGE_CONFIRM -!insertmacro MUI_UNPAGE_INSTFILES - -# Set languages (first is default language) -!insertmacro MUI_RESERVEFILE_LANGDLL - -# Installer languages -!define MUI_LANGDLL_ALLLANGUAGES - -# Translations -!macro LANG_LOAD LANGUAGE LANGCODE LANGID LICENCEFILE - !insertmacro MUI_LANGUAGE "${LANGUAGE}" -; !verbose off - !define LANG "${LANGUAGE}" - !include "lang\${LANGCODE}.nsh" - LangString LANGUAGEID "${LANG_${LANG}}" "1031" - LicenseLangString myLicenseData ${LANGCODE} ${LICENCEFILE} -; !verbose on - !undef LANG -!macroend - -!macro LANG_STRING NAME VALUE - LangString "${NAME}" "${LANG_${LANG}}" "${VALUE}" -!macroend - -!insertmacro LANG_LOAD "English" "en" "1033" "${SOURCEDIR}\retroshare-gui\src\license\license.txt" -!insertmacro LANG_LOAD "French" "fr" "1036" "${SOURCEDIR}\retroshare-gui\src\license\license-FR.txt" -!insertmacro LANG_LOAD "German" "de" "1031" "${SOURCEDIR}\retroshare-gui\src\license\license-GER.txt" -!insertmacro LANG_LOAD "Turkish" "tr" "1055" "${SOURCEDIR}\retroshare-gui\src\license\license-TR.txt" -!insertmacro LANG_LOAD "SimpChinese" "zh_CN" "2052" "${SOURCEDIR}\retroshare-gui\src\license\license.txt" -!insertmacro LANG_LOAD "Polish" "pl" "1045" "${SOURCEDIR}\retroshare-gui\src\license\license.txt" -!insertmacro LANG_LOAD "Spanish" "es" "1034" "${SOURCEDIR}\retroshare-gui\src\license\license.txt" -!insertmacro LANG_LOAD "Russian" "ru" "1049" "${SOURCEDIR}\retroshare-gui\src\license\license.txt" -!insertmacro LANG_LOAD "Catalan" "ca_ES" "1027" "${SOURCEDIR}\retroshare-gui\src\license\license.txt" - -LicenseData $(myLicenseData) - -# Main binaries -Section $(Section_Main) Section_Main - ;Set Section required - SectionIn RO - - ; Set Section properties - SetOverwrite on - - ; Clears previous error logs -; Delete "$INSTDIR\*.log" - - ; Main binaries - SetOutPath "$INSTDIR" - File /oname=retroshare.exe "${RELEASEDIR}\retroshare-gui\src\release\retroshare.exe" - File /oname=retroshare-nogui.exe "${RELEASEDIR}\retroshare-nogui\src\release\retroshare-nogui.exe" - - ; Qt binaries - File "${QTDIR}\bin\QtCore4.dll" - File "${QTDIR}\bin\QtGui4.dll" - File "${QTDIR}\bin\QtMultimedia4.dll" - File "${QTDIR}\bin\QtNetwork4.dll" - File "${QTDIR}\bin\QtSvg4.dll" - File "${QTDIR}\bin\QtXml4.dll" - - ; MinGW binaries - File "${MINGWDIR}\bin\libstdc++-6.dll" - File "${MINGWDIR}\bin\libgcc_s_dw2-1.dll" - File "${MINGWDIR}\bin\libwinpthread-1.dll" - - ; External binaries - File "${SOURCEDIR}\..\libs\bin\miniupnpc.dll" - File "${SOURCEDIR}\..\libs\bin\libeay32.dll" - File "${SOURCEDIR}\..\libs\bin\ssleay32.dll" - - ; Other files - File "${SOURCEDIR}\retroshare-gui\src\changelog.txt" - File "${SOURCEDIR}\libbitdht\src\bitdht\bdboot.txt" - - ; Image formats - SetOutPath "$INSTDIR\imageformats" - File /r "${QTDIR}\plugins\imageformats\qgif4.dll" - File /r "${QTDIR}\plugins\imageformats\qico4.dll" - File /r "${QTDIR}\plugins\imageformats\qjpeg4.dll" - File /r "${QTDIR}\plugins\imageformats\qmng4.dll" - File /r "${QTDIR}\plugins\imageformats\qsvg4.dll" - File /r "${QTDIR}\plugins\imageformats\qtga4.dll" - File /r "${QTDIR}\plugins\imageformats\qtiff4.dll" - - ; Sounds - SetOutPath "$INSTDIR\sounds" - File /r "${SOURCEDIR}\retroshare-gui\src\sounds\*.*" - - ; Translations - SetOutPath "$INSTDIR\translations" - File /r "${SOURCEDIR}\retroshare-gui\src\translations\*.qm" - File /r "${QTDIR}\translations\qt_*.qm" - - ; WebUI - SetOutPath "$INSTDIR\webui" - File /r "${SOURCEDIR}\libresapi\src\webui\*.*" - - ; License - SetOutPath "$INSTDIR\license" - File /r "${SOURCEDIR}\retroshare-gui\src\license\*.*" -SectionEnd - -# Plugins -SectionGroup $(Section_Plugins) Section_Plugins -Section $(Section_Plugin_FeedReader) Section_Plugin_FeedReader - SetOutPath "$DataDir\extensions6" - File "${RELEASEDIR}\plugins\FeedReader\release\FeedReader.dll" -SectionEnd - -Section $(Section_Plugin_VOIP) Section_Plugin_VOIP - SetOutPath "$DataDir\extensions6" - File "${RELEASEDIR}\plugins\VOIP\release\VOIP.dll" -SectionEnd -SectionGroupEnd - -# Data (Styles) -Section $(Section_Data) Section_Data - ; Set Section properties - SetOverwrite on - - ; Chat style - SetOutPath "$StyleSheetDir\stylesheets\Bubble" - File /r "${SOURCEDIR}\retroshare-gui\src\gui\qss\chat\Bubble\*.*" - SetOutPath "$StyleSheetDir\stylesheets\Bubble_Compact" - File /r "${SOURCEDIR}\retroshare-gui\src\gui\qss\chat\Bubble_Compact\*.*" - - ; Stylesheets - SetOutPath "$INSTDIR\qss" - File /r "${SOURCEDIR}\retroshare-gui\src\qss\*.*" -SectionEnd - -;Section $(Section_Link) Section_Link - ; Delete any existing keys - - ; Write the file association -; WriteRegStr HKCR .pqi "" retroshare -; WriteRegStr HKCR retroshare "" "PQI File" -; WriteRegBin HKCR retroshare EditFlags 00000100 -; WriteRegStr HKCR "retroshare\shell" "" open -; WriteRegStr HKCR "retroshare\shell\open\command" "" `"$INSTDIR\retroshare.exe" "%1"` -;SectionEnd - -# Shortcuts -SectionGroup $(Section_Shortcuts) Section_Shortcuts -Section $(Section_StartMenu) Section_StartMenu - SetOutPath "$INSTDIR" - 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 -SectionEnd - -Section $(Section_Desktop) Section_Desktop - CreateShortCut "$DESKTOP\${APPNAME}.lnk" "$INSTDIR\retroshare.exe" "" "$INSTDIR\retroshare.exe" 0 -SectionEnd - -Section $(Section_QuickLaunch) Section_QuickLaunch - CreateShortCut "$QUICKLAUNCH\${APPNAME}.lnk" "$INSTDIR\retroshare.exe" "" "$INSTDIR\retroshare.exe" 0 -SectionEnd -SectionGroupEnd - -Section $(Section_AutoStart) Section_AutoStart - WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Run" "RetroShare" "$INSTDIR\${APPNAME}06.exe -m" -SectionEnd - -;Section $(Section_AutoStart) Section_AutoStart -; CreateShortCut "$SMSTARTUP\${APPNAME}.lnk" "$INSTDIR\retroshare.exe" "" "$INSTDIR\retroshare.exe -m" 0 -;SectionEnd - -Section -FinishSection - ${If} $PortableMode = 0 - WriteRegStr HKLM "Software\${APPNAME}" "" "$INSTDIR" - WriteRegStr HKLM "Software\${APPNAME}" "Version" "${VERSION}" - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "DisplayName" "${APPNAME}" - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "DisplayVersion" "${VERSION}" - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "DisplayIcon" "$INSTDIR\retroshare.exe" - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "Publisher" "${PUBLISHER}" - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "NoModify" "1" - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "NoRepair" "1" - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "UninstallString" "$INSTDIR\uninstall.exe" - WriteUninstaller "$INSTDIR\uninstall.exe" - ${Else} - ; Create the file the application uses to detect portable mode - FileOpen $0 "$INSTDIR\portable" w - FileClose $0 - ${EndIf} -SectionEnd - -# Descriptions -!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN - !insertmacro MUI_DESCRIPTION_TEXT ${Section_Main} $(Section_Main_Desc) - !insertmacro MUI_DESCRIPTION_TEXT ${Section_Data} $(Section_Data_Desc) - !insertmacro MUI_DESCRIPTION_TEXT ${Section_Shortcuts} $(Section_Shortcuts_Desc) - !insertmacro MUI_DESCRIPTION_TEXT ${Section_StartMenu} $(Section_StartMenu_Desc) - !insertmacro MUI_DESCRIPTION_TEXT ${Section_Desktop} $(Section_Desktop_Desc) - !insertmacro MUI_DESCRIPTION_TEXT ${Section_QuickLaunch} $(Section_QuickLaunch_Desc) - !insertmacro MUI_DESCRIPTION_TEXT ${Section_Plugins} $(Section_Plugins_Desc) - !insertmacro MUI_DESCRIPTION_TEXT ${Section_Plugin_FeedReader} $(Section_Plugin_FeedReader_Desc) - !insertmacro MUI_DESCRIPTION_TEXT ${Section_Plugin_VOIP} $(Section_Plugin_VOIP_Desc) -; !insertmacro MUI_DESCRIPTION_TEXT ${Section_Link} $(Section_Link_Desc) - !insertmacro MUI_DESCRIPTION_TEXT ${Section_AutoStart} $(Section_AutoStart_Desc) -!insertmacro MUI_FUNCTION_DESCRIPTION_END - -# Uninstall -Section "Uninstall" - ; Remove file association registry keys -; DeleteRegKey HKCR .pqi - DeleteRegKey HKCR RetroShare - - ; Remove program/uninstall regsitry keys - DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" - DeleteRegKey HKLM SOFTWARE\${APPNAME} - - DeleteRegValue HKCU "Software\Microsoft\Windows\CurrentVersion\Run" "RetroShare" - - ; Remove shortcuts, if any - Delete "$SMPROGRAMS\${APPNAME}\*.*" - - ; Remove desktop shortcut - Delete "$DESKTOP\${APPNAME}.lnk" - - ; Remove Quicklaunch shortcut - Delete "$QUICKLAUNCH\${APPNAME}.lnk" - - ; Remove Autstart - Delete "$SMSTARTUP\${APPNAME}.lnk" - - ; Remove directories used - RMDir "$SMPROGRAMS\${APPNAME}" - RMDir /r "$INSTDIR" - - ; Don't remove the directory, otherwise - ; we lose the XPGP keys. - ; Should make this an option though... - RMDir /r "${DATADIR_NORMAL}\extensions6" - RMDir /r "${DATADIR_NORMAL}\stylesheets" -SectionEnd - -Function .onInit - StrCpy $InstDirNormal "${INSTDIR_NORMAL}" - StrCpy $InstDirPortable "${INSTDIR_PORTABLE}" - - StrCpy $PortableMode 0 - StrCpy $INSTDIR "$InstDirNormal" - StrCpy $DataDir "${DATADIR_NORMAL}" - - InitPluginsDir - Push $R1 - File /oname=$PLUGINSDIR\spltmp.bmp "${SOURCEDIR}\retroshare-gui\src\gui\images\logo\logo_splash.png" - advsplash::show 1200 1000 1000 -1 $PLUGINSDIR\spltmp - Pop $R1 - Pop $R1 - !insertmacro MUI_LANGDLL_DISPLAY -FunctionEnd - -# Installation mode - -Function RequireAdmin - UserInfo::GetAccountType - Pop $8 - ${If} $8 != "admin" - MessageBox MB_ICONSTOP "You need administrator rights to install ${APPNAME}" - SetErrorLevel 740 ;ERROR_ELEVATION_REQUIRED - Abort - ${EndIf} -FunctionEnd - -Function SetModeDestinationFromInstdir - ${If} $PortableMode = 0 - StrCpy $InstDirNormal $INSTDIR - ${Else} - StrCpy $InstDirPortable $INSTDIR - ${EndIf} -FunctionEnd - -Function PortableModePageCreate - Call SetModeDestinationFromInstdir ; If the user clicks BACK on the directory page we will remember their mode specific directory - !insertmacro MUI_HEADER_TEXT $(Page_InstallMode) $(Page_InstallMode_Desc) - nsDialogs::Create 1018 - Pop $0 - ${NSD_CreateRadioButton} 5u 25u -10u 8u $(Page_InstallMode_Standard) - Pop $1 - ${NSD_CreateLabel} 18u 40u -10u 24u $(Page_InstallMode_Standard_Desc) - Pop $0 - ${NSD_CreateRadioButton} 5u 75u -10u 8u $(Page_InstallMode_Portable) - Pop $2 - ${NSD_CreateLabel} 18u 90u -10u 24u $(Page_InstallMode_Portable_Desc) - Pop $0 - ${If} $PortableMode = 0 - SendMessage $1 ${BM_SETCHECK} ${BST_CHECKED} 0 - ${Else} - SendMessage $2 ${BM_SETCHECK} ${BST_CHECKED} 0 - ${EndIf} - nsDialogs::Show -FunctionEnd - -Function PortableModePageLeave - ${NSD_GetState} $1 $0 - ${If} $0 <> ${BST_UNCHECKED} - StrCpy $PortableMode 0 - StrCpy $INSTDIR $InstDirNormal - Call RequireAdmin - ; Enable sections - SectionSetText ${Section_Shortcuts} $(Section_Shortcuts) - SectionSetText ${Section_StartMenu} $(Section_StartMenu) - SectionSetText ${Section_Desktop} $(Section_Desktop) - SectionSetText ${Section_QuickLaunch} $(Section_QuickLaunch) - SectionSetText ${Section_AutoStart} $(Section_AutoStart) - !insertmacro SelectSection ${Section_Shortcuts} - !insertmacro SelectSection ${Section_AutoStart} - !insertmacro SelectSection ${Section_StartMenu} - !insertmacro SelectSection ${Section_Desktop} - !insertmacro SelectSection ${Section_QuickLaunch} - ${Else} - StrCpy $PortableMode 1 - StrCpy $INSTDIR $InstDirPortable - ; Disable sections - !insertmacro UnselectSection ${Section_Shortcuts} - !insertmacro UnselectSection ${Section_AutoStart} - !insertmacro UnselectSection ${Section_StartMenu} - !insertmacro UnselectSection ${Section_Desktop} - !insertmacro UnselectSection ${Section_QuickLaunch} - SectionSetText ${Section_Shortcuts} "" - SectionSetText ${Section_StartMenu} "" - SectionSetText ${Section_Desktop} "" - SectionSetText ${Section_QuickLaunch} "" - SectionSetText ${Section_AutoStart} "" - ${EndIf} -FunctionEnd - -Function dir_leave - ${If} $PortableMode = 0 - StrCpy $DataDir "${DATADIR_NORMAL}" - StrCpy $StyleSheetDir $DataDir - ${Else} - StrCpy $DataDir "${DATADIR_PORTABLE}" - StrCpy $StyleSheetDir $INSTDIR - ${EndIf} -FunctionEnd +; Script generated with the Venis Install Wizard & modified by defnax +; Reworked by Thunder +; Adapted to msys2 and 64 bit by anmo + +!include ifexist.nsh +!include x64.nsh + +# Needed defines +;!define REVISION "" +;!define DEPLOYDIR "" +;!define ARCHITECTURE "" + +# Optional defines +;!define OUTDIR "" +;!define INSTALLERADD "" + +# Check needed defines +!ifndef DEPLOYDIR +!error "DEPLOYDIR is not defined" +!endif +!ifndef ARCHITECTURE +!error "ARCHITECTURE is not defined" +!endif + +# Check optional defines +!ifdef OUTDIR +!define OUTDIR_ "${OUTDIR}\" +!else +!define OUTDIR "" +!define OUTDIR_ "" +!endif + +!ifndef INSTALLERADD +!define INSTALLERADD "" +!endif + +# Source directory +!define SOURCEDIR "..\..\.." + +# Get version from executable +!GetDllVersion "${DEPLOYDIR}\retroshare.exe" VERSION_ +!define VERSION ${VERSION_1}.${VERSION_2}.${VERSION_3} +;!define REVISION ${VERSION_4} + +# Check version +!ifndef REVISION +!error "REVISION is not defined" +!endif + +# Date +!define /date Date "%Y%m%d" + +# Detect tor +${!defineifexist} TOR_EXISTS "${DEPLOYDIR}\tor.exe" +!ifdef TOR_EXISTS +!define RSTYPE "-tor" +!else +!define RSTYPE "" +!endif + +# Application name and version +!define APPNAME "RetroShare" +!define APPNAMEANDVERSION "${APPNAME} ${VERSION}" +!define PUBLISHER "RetroShare Team" + +# Install path +!define INSTDIR_PORTABLE "$Desktop\${APPNAME}" + +!define DATADIR_NORMAL "$APPDATA\${APPNAME}" +!define DATADIR_PORTABLE "$INSTDIR\Data" + +# Main Install settings +Name "${APPNAMEANDVERSION}" +InstallDirRegKey HKLM "Software\${APPNAME}" "" +OutFile "${OUTDIR_}RetroShare-${VERSION}-${Date}-${REVISION}-${ARCHITECTURE}${RSTYPE}${INSTALLERADD}-setup.exe" +BrandingText "${APPNAMEANDVERSION}" +RequestExecutionlevel highest +# Use compression +SetCompressor /SOLID LZMA + +# Global variables +Var PortableMode +Var InstDirNormal +Var InstDirPortable +Var DataDir +Var StyleSheetDir + +# Modern interface settings +!include Sections.nsh +!include nsDialogs.nsh +!include "MUI.nsh" + +# Interface Settings +!define MUI_ABORTWARNING +!define MUI_HEADERIMAGE +!define MUI_HEADERIMAGE_BITMAP "${SOURCEDIR}\build_scripts\Windows-msys2\installer\HeaderImage.bmp" +;!define MUI_WELCOMEFINISHPAGE_BITMAP "...bmp" + +# MUI defines +!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\orange-install.ico" +!define MUI_FINISHPAGE_NOAUTOCLOSE +!define MUI_LICENSEPAGE_RADIOBUTTONS +!define MUI_COMPONENTSPAGE_SMALLDESC +!define MUI_FINISHPAGE_LINK "Visit the RetroShare forum for the latest news and support" +!define MUI_FINISHPAGE_LINK_LOCATION "http://retroshare.sourceforge.net/forum/" +!define MUI_FINISHPAGE_RUN "$INSTDIR\retroshare.exe" +!define MUI_FINISHPAGE_SHOWREADME $INSTDIR\changelog.txt +!define MUI_FINISHPAGE_SHOWREADME_TEXT changelog.txt +!define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED +!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\orange-uninstall.ico" +!define MUI_UNFINISHPAGE_NOAUTOCLOSE +;!define MUI_LANGDLL_REGISTRY_ROOT HKLM +;!define MUI_LANGDLL_REGISTRY_KEY ${REGKEY} +;!define MUI_LANGDLL_REGISTRY_VALUENAME InstallerLanguage + +# Defines the un-/installer logo of RetroShare +!insertmacro MUI_DEFAULT MUI_WELCOMEFINISHPAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Wizard\orange.bmp" +!insertmacro MUI_DEFAULT MUI_UNWELCOMEFINISHPAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Wizard\orange-uninstall.bmp" + +# Installer pages +!insertmacro MUI_PAGE_WELCOME +!insertmacro MUI_PAGE_LICENSE "$(myLicenseData)" +Page Custom PortableModePageCreate PortableModePageLeave +!define MUI_PAGE_CUSTOMFUNCTION_LEAVE dir_leave +!insertmacro MUI_PAGE_DIRECTORY +!insertmacro MUI_PAGE_COMPONENTS +!insertmacro MUI_PAGE_INSTFILES +!insertmacro MUI_PAGE_FINISH +!insertmacro MUI_UNPAGE_CONFIRM +!insertmacro MUI_UNPAGE_INSTFILES + +# Set languages (first is default language) +!insertmacro MUI_RESERVEFILE_LANGDLL + +# Installer languages +!define MUI_LANGDLL_ALLLANGUAGES + +# Translations +!macro LANG_LOAD LANGUAGE LANGCODE LANGID LICENCEFILE + !insertmacro MUI_LANGUAGE "${LANGUAGE}" +; !verbose off + !define LANG "${LANGUAGE}" + !include "lang\${LANGCODE}.nsh" + LangString LANGUAGEID "${LANG_${LANG}}" "1031" + LicenseLangString myLicenseData ${LANGCODE} ${LICENCEFILE} +; !verbose on + !undef LANG +!macroend + +!macro LANG_STRING NAME VALUE + LangString "${NAME}" "${LANG_${LANG}}" "${VALUE}" +!macroend + +!insertmacro LANG_LOAD "English" "en" "1033" "${SOURCEDIR}\retroshare-gui\src\license\license.txt" +!insertmacro LANG_LOAD "French" "fr" "1036" "${SOURCEDIR}\retroshare-gui\src\license\license-FR.txt" +!insertmacro LANG_LOAD "German" "de" "1031" "${SOURCEDIR}\retroshare-gui\src\license\license-GER.txt" +!insertmacro LANG_LOAD "Turkish" "tr" "1055" "${SOURCEDIR}\retroshare-gui\src\license\license-TR.txt" +!insertmacro LANG_LOAD "SimpChinese" "zh_CN" "2052" "${SOURCEDIR}\retroshare-gui\src\license\license.txt" +!insertmacro LANG_LOAD "Polish" "pl" "1045" "${SOURCEDIR}\retroshare-gui\src\license\license.txt" +!insertmacro LANG_LOAD "Spanish" "es" "1034" "${SOURCEDIR}\retroshare-gui\src\license\license.txt" +!insertmacro LANG_LOAD "Russian" "ru" "1049" "${SOURCEDIR}\retroshare-gui\src\license\license.txt" +!insertmacro LANG_LOAD "Catalan" "ca_ES" "1027" "${SOURCEDIR}\retroshare-gui\src\license\license.txt" + +LicenseData $(myLicenseData) + +# Main binaries +Section $(Section_Main) Section_Main + ;Set Section required + SectionIn RO + + ; Set Section properties + SetOverwrite on + + ; Clears previous error logs +; Delete "$INSTDIR\*.log" + + SetOutPath "$INSTDIR" + File /r /x Data /x stylesheets /x qss /x portable "${DEPLOYDIR}\*.*" +SectionEnd + +# Plugins +${!defineifexist} PLUGIN_FEEDREADER_EXISTS "${DEPLOYDIR}\Data\extensions6\FeedReader.dll" +${!defineifexist} PLUGIN_VOIP_EXISTS "${DEPLOYDIR}\Data\extensions6\VOIP.dll" + +!ifdef PLUGIN_FEEDREADER_EXISTS +!define /ifndef PLUGIN_EXISTS +!endif +!ifdef PLUGIN_VOIP_EXISTS +!define /ifndef PLUGIN_EXISTS +!endif + +!ifdef PLUGIN_EXISTS + SectionGroup $(Section_Plugins) Section_Plugins + !ifdef PLUGIN_FEEDREADER_EXISTS + Section $(Section_Plugin_FeedReader) Section_Plugin_FeedReader + SetOutPath "$DataDir\extensions6" + File "${DEPLOYDIR}\Data\extensions6\FeedReader.dll" + SectionEnd + !endif + + !ifdef PLUGIN_VOIP_EXISTS + Section $(Section_Plugin_VOIP) Section_Plugin_VOIP + SetOutPath "$DataDir\extensions6" + File "${DEPLOYDIR}\Data\extensions6\VOIP.dll" + SectionEnd + !endif + SectionGroupEnd +!endif + +# Data (Styles) +Section $(Section_Data) Section_Data + ; Set Section properties + SetOverwrite on + + ; Chat style + SetOutPath "$StyleSheetDir\stylesheets" + File /r "${DEPLOYDIR}\stylesheets\*.*" + + ; Stylesheets + SetOutPath "$INSTDIR\qss" + File /r "${DEPLOYDIR}\qss\*.*" +SectionEnd + +;Section $(Section_Link) Section_Link + ; Delete any existing keys + + ; Write the file association +; WriteRegStr HKCR .pqi "" retroshare +; WriteRegStr HKCR retroshare "" "PQI File" +; WriteRegBin HKCR retroshare EditFlags 00000100 +; WriteRegStr HKCR "retroshare\shell" "" open +; WriteRegStr HKCR "retroshare\shell\open\command" "" `"$INSTDIR\retroshare.exe" "%1"` +;SectionEnd + +# Shortcuts +SectionGroup $(Section_Shortcuts) Section_Shortcuts +Section $(Section_StartMenu) Section_StartMenu + SetOutPath "$INSTDIR" + 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 +SectionEnd + +Section $(Section_Desktop) Section_Desktop + CreateShortCut "$DESKTOP\${APPNAME}.lnk" "$INSTDIR\retroshare.exe" "" "$INSTDIR\retroshare.exe" 0 +SectionEnd + +Section $(Section_QuickLaunch) Section_QuickLaunch + CreateShortCut "$QUICKLAUNCH\${APPNAME}.lnk" "$INSTDIR\retroshare.exe" "" "$INSTDIR\retroshare.exe" 0 +SectionEnd +SectionGroupEnd + +Section $(Section_AutoStart) Section_AutoStart + WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Run" "RetroShare" "$INSTDIR\retroshare.exe -m" +SectionEnd + +;Section $(Section_AutoStart) Section_AutoStart +; CreateShortCut "$SMSTARTUP\${APPNAME}.lnk" "$INSTDIR\retroshare.exe" "" "$INSTDIR\retroshare.exe -m" 0 +;SectionEnd + +Section -FinishSection + ${If} $PortableMode = 0 + WriteRegStr HKLM "Software\${APPNAME}" "" "$INSTDIR" + WriteRegStr HKLM "Software\${APPNAME}" "Version" "${VERSION}" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "DisplayName" "${APPNAME}" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "DisplayVersion" "${VERSION}" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "DisplayIcon" "$INSTDIR\retroshare.exe" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "Publisher" "${PUBLISHER}" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "NoModify" "1" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "NoRepair" "1" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "UninstallString" "$INSTDIR\uninstall.exe" + WriteUninstaller "$INSTDIR\uninstall.exe" + ${Else} + ; Create the file the application uses to detect portable mode + FileOpen $0 "$INSTDIR\portable" w + FileClose $0 + ${EndIf} +SectionEnd + +# Descriptions +!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN + !insertmacro MUI_DESCRIPTION_TEXT ${Section_Main} $(Section_Main_Desc) + !insertmacro MUI_DESCRIPTION_TEXT ${Section_Data} $(Section_Data_Desc) + !insertmacro MUI_DESCRIPTION_TEXT ${Section_Shortcuts} $(Section_Shortcuts_Desc) + !insertmacro MUI_DESCRIPTION_TEXT ${Section_StartMenu} $(Section_StartMenu_Desc) + !insertmacro MUI_DESCRIPTION_TEXT ${Section_Desktop} $(Section_Desktop_Desc) + !insertmacro MUI_DESCRIPTION_TEXT ${Section_QuickLaunch} $(Section_QuickLaunch_Desc) + !insertmacro MUI_DESCRIPTION_TEXT ${Section_Plugins} $(Section_Plugins_Desc) + !insertmacro MUI_DESCRIPTION_TEXT ${Section_Plugin_FeedReader} $(Section_Plugin_FeedReader_Desc) + !insertmacro MUI_DESCRIPTION_TEXT ${Section_Plugin_VOIP} $(Section_Plugin_VOIP_Desc) +; !insertmacro MUI_DESCRIPTION_TEXT ${Section_Link} $(Section_Link_Desc) + !insertmacro MUI_DESCRIPTION_TEXT ${Section_AutoStart} $(Section_AutoStart_Desc) +!insertmacro MUI_FUNCTION_DESCRIPTION_END + +# Uninstall +Section "Uninstall" + ; Remove file association registry keys +; DeleteRegKey HKCR .pqi + DeleteRegKey HKCR RetroShare + + ; Remove program/uninstall regsitry keys + DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" + DeleteRegKey HKLM SOFTWARE\${APPNAME} + + DeleteRegValue HKCU "Software\Microsoft\Windows\CurrentVersion\Run" "RetroShare" + + ; Remove shortcuts, if any + Delete "$SMPROGRAMS\${APPNAME}\*.*" + + ; Remove desktop shortcut + Delete "$DESKTOP\${APPNAME}.lnk" + + ; Remove Quicklaunch shortcut + Delete "$QUICKLAUNCH\${APPNAME}.lnk" + + ; Remove Autstart + Delete "$SMSTARTUP\${APPNAME}.lnk" + + ; Remove directories used + RMDir "$SMPROGRAMS\${APPNAME}" + RMDir /r "$INSTDIR" + + ; Don't remove the directory, otherwise + ; we lose the XPGP keys. + ; Should make this an option though... + RMDir /r "${DATADIR_NORMAL}\extensions6" + RMDir /r "${DATADIR_NORMAL}\stylesheets" +SectionEnd + +Function .onInit +; source: https://stackoverflow.com/questions/19374453/nsis-installer-define-installer-and-system-x32-x64 + ${If} ${RunningX64} + ${If} ${ARCHITECTURE} == "x64" + StrCpy $InstDirNormal "$PROGRAMFILES64\${APPNAME}" + ${Else} + StrCpy $InstDirNormal "$PROGRAMFILES32\${APPNAME}" + ${Endif} + ${Else} + ${If} ${ARCHITECTURE} == "x64" + MessageBox MB_ICONSTOP "You cannot install the 64 bit version on a 32 bit system!" + Quit + ${Else} + StrCpy $InstDirNormal "$PROGRAMFILES\${APPNAME}" + ${Endif} + ${EndIf} + + StrCpy $InstDirPortable "${INSTDIR_PORTABLE}" + + StrCpy $PortableMode 0 + StrCpy $INSTDIR "$InstDirNormal" + StrCpy $DataDir "${DATADIR_NORMAL}" + + InitPluginsDir + Push $R1 + File /oname=$PLUGINSDIR\spltmp.bmp "${SOURCEDIR}\retroshare-gui\src\gui\images\logo\logo_splash.png" + advsplash::show 1200 1000 1000 -1 $PLUGINSDIR\spltmp + Pop $R1 + Pop $R1 + !insertmacro MUI_LANGDLL_DISPLAY +FunctionEnd + +# Installation mode + +Function RequireAdmin + UserInfo::GetAccountType + Pop $8 + ${If} $8 != "admin" + MessageBox MB_ICONSTOP "You need administrator rights to install ${APPNAME}" + SetErrorLevel 740 ;ERROR_ELEVATION_REQUIRED + Abort + ${EndIf} +FunctionEnd + +Function SetModeDestinationFromInstdir + ${If} $PortableMode = 0 + StrCpy $InstDirNormal $INSTDIR + ${Else} + StrCpy $InstDirPortable $INSTDIR + ${EndIf} +FunctionEnd + +Function PortableModePageCreate + Call SetModeDestinationFromInstdir ; If the user clicks BACK on the directory page we will remember their mode specific directory + !insertmacro MUI_HEADER_TEXT $(Page_InstallMode) $(Page_InstallMode_Desc) + nsDialogs::Create 1018 + Pop $0 + ${NSD_CreateRadioButton} 5u 25u -10u 8u $(Page_InstallMode_Standard) + Pop $1 + ${NSD_CreateLabel} 18u 40u -10u 24u $(Page_InstallMode_Standard_Desc) + Pop $0 + ${NSD_CreateRadioButton} 5u 75u -10u 8u $(Page_InstallMode_Portable) + Pop $2 + ${NSD_CreateLabel} 18u 90u -10u 24u $(Page_InstallMode_Portable_Desc) + Pop $0 + ${If} $PortableMode = 0 + SendMessage $1 ${BM_SETCHECK} ${BST_CHECKED} 0 + ${Else} + SendMessage $2 ${BM_SETCHECK} ${BST_CHECKED} 0 + ${EndIf} + nsDialogs::Show +FunctionEnd + +Function PortableModePageLeave + ${NSD_GetState} $1 $0 + ${If} $0 <> ${BST_UNCHECKED} + StrCpy $PortableMode 0 + StrCpy $INSTDIR $InstDirNormal + Call RequireAdmin + ; Enable sections + SectionSetText ${Section_Shortcuts} $(Section_Shortcuts) + SectionSetText ${Section_StartMenu} $(Section_StartMenu) + SectionSetText ${Section_Desktop} $(Section_Desktop) + SectionSetText ${Section_QuickLaunch} $(Section_QuickLaunch) + SectionSetText ${Section_AutoStart} $(Section_AutoStart) + !insertmacro SelectSection ${Section_Shortcuts} + !insertmacro SelectSection ${Section_AutoStart} + !insertmacro SelectSection ${Section_StartMenu} + !insertmacro SelectSection ${Section_Desktop} + !insertmacro SelectSection ${Section_QuickLaunch} + ${Else} + StrCpy $PortableMode 1 + StrCpy $INSTDIR $InstDirPortable + ; Disable sections + !insertmacro UnselectSection ${Section_Shortcuts} + !insertmacro UnselectSection ${Section_AutoStart} + !insertmacro UnselectSection ${Section_StartMenu} + !insertmacro UnselectSection ${Section_Desktop} + !insertmacro UnselectSection ${Section_QuickLaunch} + SectionSetText ${Section_Shortcuts} "" + SectionSetText ${Section_StartMenu} "" + SectionSetText ${Section_Desktop} "" + SectionSetText ${Section_QuickLaunch} "" + SectionSetText ${Section_AutoStart} "" + ${EndIf} +FunctionEnd + +Function dir_leave + ${If} $PortableMode = 0 + StrCpy $DataDir "${DATADIR_NORMAL}" + StrCpy $StyleSheetDir $DataDir + ${Else} + StrCpy $DataDir "${DATADIR_PORTABLE}" + StrCpy $StyleSheetDir $INSTDIR + ${EndIf} +FunctionEnd diff --git a/build_scripts/Windows-msys2/readme.md b/build_scripts/Windows-msys2/readme.md new file mode 100644 index 000000000..5582ec451 --- /dev/null +++ b/build_scripts/Windows-msys2/readme.md @@ -0,0 +1,91 @@ +# Compilation on Windows + +The preferred build method on Windows is by using MSYS2 which is a collection +of packages providing unix-like tools to build native Windows software. + +This guide contains information about how to setup your build environment in an automated way by scripts. +If you prefer to setup your environment manually, check this guide: +[WindowsMSys2_InstallGuide.md](WindowsMSys2_InstallGuide.md) + +Setting up the build environment automatically on a 32 bit OS is not possible anymore. +You can download an older 32 bit [MSYS2 installer](https://sourceforge.net/projects/msys2/files/Base/i686/msys2-base-i686-20180531.tar.xz/download) and follow the manual setup instructions. +Building 32 bit RetroShare from the 64 bit build environment is still possible. + +You have to clone this repository (with [git for windows](https://gitforwindows.org/)) to a local folder, then start it in a terminal. + + +## Automatic building + +Run the following script: + + \build_scripts\Windows-msys2\build.bat + +It will install all necessary tools to build RetrosShare, and build it with the default configuration. + +After the script is finished, you can find the resulting .7z package here: + + -msys2\deploy\ + +## Advanced building + +You can specify extra build options if you use the scripts under: + + \build_scripts\Windows-msys2\build\ + +You have to specify the build options after each command. + +Run the scripts in this order: +1. build.bat: builds RetroShare +2. pack.bat: makes a .7z archive with all the needed files to run the program +3. build-installer: makes a self extracting installer (optional) + +### Build options + +**Always delete the build artifacts folder if you enable or disable extra features after the build command: <sourcefolder>-msys2\deploy\builds** + +* Mandatory + * 32 or 64: 32 or 64 bit version + * release or debug: normally you would like to use the release option +* Extra features (optional) + * autologin: enable autologin + * plugins: build plugins + * webui: enable remoting features and pack webui files + * indexing: build with deep channel and file indexing support + * tor: include tor in the package + * "CONFIG+=..." enable other extra compile time features, you can find the almost complete list in file *<sourcefolder>\retroshare.pri* +* For fixing compile problems (optional) + * singlethread: use only 1 thread for building, slow but useful if you don't find the error message in the console + * clang: use clang compiler instead of GCC + * noupdate: skip the msys2 update step, sometimes some msys2 packages are broken, you can manually switch back to the older package, and this option will prevent updating to the broken version again + +Example: + +```batch +build.bat 64 release autologin webui "CONFIG+=rs_use_native_dialogs" "CONFIG+=rs_gui_cmark" +pack.bat 64 release autologin webui tor +build-installer.bat 64 release autologin +``` + +## Troubleshooting +* Run the command again, sometimes it works the second time, specially if it complains about *restbed* during building +* Delete the build artifacts: *<sourcefolder>-msys2\deploy\builds* +* Update msys2 manually: + 1. Open the terminal: *<sourcefolder>-msys2\msys2\msys64\msys2.exe* + 2. pacman -Sy + 3. pacman -Su + 4. Close the terminal + 5. Jump to 1. until it doesn't find more updates +* Start with a clean path environment variable, run *<sourcefolder>\build_scripts\Windows-msys2\start-clean-env.bat*, you will get a terminal with cleaned path + +### Errors during MSYS2 update +MSYS2 developers recently introduced some breaking changes. +If you get PGP related errors during updating the system from pacman, then follow [their guide](https://www.msys2.org/news/#2020-06-29-new-packagers) to resolve the problems. + +## Updating webui + +The scripts don't update the webui source code automatically once it is checked out. +You have to do it manually with your favourite git client. + +You can find the webui source code here: + + -webui diff --git a/build_scripts/Windows-msys2/start-clean-env.bat b/build_scripts/Windows-msys2/start-clean-env.bat new file mode 100644 index 000000000..1c6d46295 --- /dev/null +++ b/build_scripts/Windows-msys2/start-clean-env.bat @@ -0,0 +1,7 @@ +setlocal + +set path=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0 +cd build\ +cmd + +endlocal diff --git a/build_scripts/Windows-msys2/tools/cecho.bat b/build_scripts/Windows-msys2/tools/cecho.bat new file mode 100644 index 000000000..69c6370e9 --- /dev/null +++ b/build_scripts/Windows-msys2/tools/cecho.bat @@ -0,0 +1,6 @@ +:: Usage: +:: call cecho.bat [info|error|std] "text" + +if "%~1"=="std" echo %~2 +if "%~1"=="info" "%EnvCEchoExe%" green "%~2" +if "%~1"=="error" "%EnvCEchoExe%" red "%~2" diff --git a/build_scripts/Windows-msys2/tools/depends.bat b/build_scripts/Windows-msys2/tools/depends.bat new file mode 100644 index 000000000..a92fd3364 --- /dev/null +++ b/build_scripts/Windows-msys2/tools/depends.bat @@ -0,0 +1,22 @@ +:: Usage: +:: call depends.bat file + +if "%1"=="" ( + echo Usage: %~nx0 File + exit /B 1 +) + +setlocal +pushd %~dp1 + +%EnvMSYS2Cmd% "ntldd --recursive $0 | cut -f1 -d"=" | awk '{$1=$1};1'" %~nx1 > %~sdp0depends.tmp + +for /F %%A in (%~sdp0depends.tmp) do ( + echo %%~A +) + +if exist "%~dp0depends.tmp" del /Q "%~dp0depends.tmp" + +popd +endlocal +exit /B 0 \ No newline at end of file diff --git a/build_scripts/Windows-msys2/tools/download-file.bat b/build_scripts/Windows-msys2/tools/download-file.bat new file mode 100644 index 000000000..dbcecdcbb --- /dev/null +++ b/build_scripts/Windows-msys2/tools/download-file.bat @@ -0,0 +1,12 @@ +:: Usage: +:: call download-file.bat url file + +if "%~2"=="" ( + echo. + echo Parameter error. + exit /B 1 +) + +powershell -NoLogo -NoProfile -Command (New-Object System.Net.WebClient).DownloadFile(\""%~1\"", \""%~2\"") + +exit /B %ERRORLEVEL% diff --git a/build_scripts/Windows-msys2/tools/find-in-path.bat b/build_scripts/Windows-msys2/tools/find-in-path.bat new file mode 100644 index 000000000..0ee7407bf --- /dev/null +++ b/build_scripts/Windows-msys2/tools/find-in-path.bat @@ -0,0 +1,26 @@ +:: Usage: +:: call find-in-path.bat variable file + +setlocal + +set Var=%~1 +set File=%~2 + +if "%File%"=="" ( + echo. + echo Parameter error. + exit /B 1 +) + +set FoundPath= + +SET PathTemp="%Path:;=";"%" +FOR %%P IN (%PathTemp%) DO ( + IF EXIST "%%~P.\%File%" ( + set FoundPath=%%~P + goto :found + ) +) + +:found +endlocal & set %Var%=%FoundPath% diff --git a/build_scripts/Windows-msys2/tools/get-git-ref.bat b/build_scripts/Windows-msys2/tools/get-git-ref.bat new file mode 100644 index 000000000..f8f6efdeb --- /dev/null +++ b/build_scripts/Windows-msys2/tools/get-git-ref.bat @@ -0,0 +1,39 @@ +REM Usage: +REM call get-git-ref.bat Variable [Branch] + +setlocal + +set Variable=%~1 +if "%Variable%"=="" ( + echo. + echo Parameter error + exit /B 1 +) + +set Ref= + +:: Check git executable +set GitPath= +call "%~dp0find-in-path.bat" GitPath git.exe +if "%GitPath%"=="" ( + echo. + echo Git executable not found in PATH. + goto exit +) + +set GitParameter= +set Branch=%~2 +if "%Branch%"=="" ( + set Branch=HEAD + set GitParameter=--head +) + +for /F "tokens=1*" %%A in ('git show-ref %GitParameter% %Branch%') do ( + if "%%B"=="%Branch%" ( + set Ref=%%A + ) +) + +:exit +endlocal & set %Variable%=%Ref% +exit /B 0 diff --git a/build_scripts/Windows-msys2/tools/get-qt-version.bat b/build_scripts/Windows-msys2/tools/get-qt-version.bat new file mode 100644 index 000000000..4124770ee --- /dev/null +++ b/build_scripts/Windows-msys2/tools/get-qt-version.bat @@ -0,0 +1,27 @@ +:: Usage: +:: call get-qt-version.bat variable + +setlocal + +set Var=%~1 +if "%Var%"=="" ( + echo. + echo Parameter error. + exit /B 1 +) + +set QtVersion= + +%EnvMSYS2Cmd% "qmake -version" >"%~dp0qtversion.tmp" +for /F "tokens=1,2,3,4" %%A in (%~sdp0qtversion.tmp) do ( + if "%%A"=="Using" ( + set QtVersion=%%D + goto exit + ) +) + +:exit +if exist "%~dp0qtversion.tmp" del /Q "%~dp0qtversion.tmp" + +endlocal & set %Var%=%QtVersion% +exit /B 0 \ No newline at end of file diff --git a/build_scripts/Windows-msys2/tools/get-rs-version.bat b/build_scripts/Windows-msys2/tools/get-rs-version.bat new file mode 100644 index 000000000..cc4e53ff8 --- /dev/null +++ b/build_scripts/Windows-msys2/tools/get-rs-version.bat @@ -0,0 +1,38 @@ +:: Usage: +:: call get-rs-version.bat Executable Variable +:: +:: Variable.Major +:: Variable.Minor +:: Variable.Mini +:: Variable.Extra + +setlocal + +set Executable=%~1 +set Variable=%~2 +if "%Variable%"=="" ( + echo. + echo Parameter error. + exit /B 1 +) + +if not exist "%Executable%" ( + echo. + echo File %Executable% doesn't exist. + exit /B1 +) + +set VersionMajor= +set VersionMinor= +set VersionMini= +set VersionExtra= + +for /F "USEBACKQ tokens=1,2,3,* delims=.-" %%A in (`powershell -NoLogo -NoProfile -Command ^(Get-Item "%Executable%"^).VersionInfo.FileVersion`) do ( + set VersionMajor=%%A + set VersionMinor=%%B + set VersionMini=%%C + set VersionExtra=%%D +) + +endlocal & set %Variable%.Major=%VersionMajor%& set %Variable%.Minor=%VersionMinor%& set %Variable%.Mini=%VersionMini%& set %Variable%.Extra=%VersionExtra%& +exit /B 0 \ No newline at end of file diff --git a/build_scripts/Windows-msys2/tools/msys2-path.bat b/build_scripts/Windows-msys2/tools/msys2-path.bat new file mode 100644 index 000000000..9904417f6 --- /dev/null +++ b/build_scripts/Windows-msys2/tools/msys2-path.bat @@ -0,0 +1,20 @@ +:: Usage: +:: call msys2-path.bat path variable + +setlocal + +set WinPath=%~1 +set MSYS2Var=%~2 + +if "%MSYS2Var%"=="" ( + echo. + echo Parameter error. + exit /B 1 +) + +set MSYS2Path=/%WinPath:~0,1%/%WinPath:~3% +set MSYS2Path=%MSYS2Path:\=/% + +endlocal & set %MSYS2Var%=%MSYS2Path% + +exit /B 0 diff --git a/build_scripts/Windows-msys2/tools/remove-dir.bat b/build_scripts/Windows-msys2/tools/remove-dir.bat new file mode 100644 index 000000000..e6985f13c --- /dev/null +++ b/build_scripts/Windows-msys2/tools/remove-dir.bat @@ -0,0 +1,15 @@ +:: Usage: +:: call remove-dir.bat path + +if "%~1"=="" ( + echo. + echo Parameter error. + exit /B 1 +) + +if exist %1 ( + del /s /f /q %1 >nul + rmdir /s /q %1 +) + +exit /B 0 diff --git a/build_scripts/Windows-msys2/tools/webui.bat b/build_scripts/Windows-msys2/tools/webui.bat new file mode 100644 index 000000000..b7af01e53 --- /dev/null +++ b/build_scripts/Windows-msys2/tools/webui.bat @@ -0,0 +1,22 @@ +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 \ No newline at end of file diff --git a/build_scripts/Windows/build-libs/Makefile b/build_scripts/Windows/build-libs/Makefile old mode 100755 new mode 100644 index 11b60f77d..6a0c3b5f0 --- a/build_scripts/Windows/build-libs/Makefile +++ b/build_scripts/Windows/build-libs/Makefile @@ -1,25 +1,25 @@ ZLIB_VERSION=1.2.3 BZIP2_VERSION=1.0.6 MINIUPNPC_VERSION=2.0 -OPENSSL_VERSION=1.0.2k +OPENSSL_VERSION=1.1.1g SPEEX_VERSION=1.2.0 SPEEXDSP_VERSION=1.2rc3 -OPENCV_VERSION=3.2.0 -LIBXML2_VERSION=2.9.4 -LIBXSLT_VERSION=1.1.28 -CURL_VERSION=7.53.1 -TCL_VERSION=8.6.2 -SQLCIPHER_VERSION=2.2.1 -LIBMICROHTTPD_VERSION=0.9.52 -FFMPEG_VERSION=3.2.4 - -MAKEFILE_PATH=$(dir $(MAKEFILE_LIST)) -LIBS_PATH?=$(MAKEFILE_PATH)../../../../libs +OPENCV_VERSION=3.4.11 +LIBXML2_VERSION=2.9.7 +LIBXSLT_VERSION=1.1.32 +CURL_VERSION=7.58.0 +TCL_VERSION=8.6.10 +SQLCIPHER_VERSION=4.4.0 +LIBMICROHTTPD_VERSION=0.9.59 +FFMPEG_VERSION=3.4 +RAPIDJSON_VERSION=1.1.0 +XAPIAN_VERSION=1.4.7 DOWNLOAD_PATH?=download -COPY_ANSWER?= +BUILD_PATH=build +LIBS_PATH?=libs -all: dirs zlib bzip2 miniupnpc openssl speex speexdsp opencv libxml2 libxslt curl sqlcipher libmicrohttpd ffmpeg copylibs +all: dirs zlib bzip2 miniupnpc openssl speex speexdsp opencv libxml2 libxslt curl sqlcipher libmicrohttpd ffmpeg rapidjson xapian copylibs download: \ $(DOWNLOAD_PATH)/zlib-$(ZLIB_VERSION).tar.gz \ @@ -35,235 +35,252 @@ download: \ $(DOWNLOAD_PATH)/tcl$(TCL_VERSION)-src.tar.gz \ $(DOWNLOAD_PATH)/sqlcipher-$(SQLCIPHER_VERSION).tar.gz \ $(DOWNLOAD_PATH)/libmicrohttpd-$(LIBMICROHTTPD_VERSION).tar.gz \ - $(DOWNLOAD_PATH)/ffmpeg-$(FFMPEG_VERSION).tar.gz + $(DOWNLOAD_PATH)/ffmpeg-$(FFMPEG_VERSION).tar.gz \ + $(DOWNLOAD_PATH)/rapidjson-$(RAPIDJSON_VERSION).tar.gz \ + $(DOWNLOAD_PATH)/xapian-core-$(XAPIAN_VERSION).tar.xz clean: - rm -r -f libs + rm -r -f $(BUILD_PATH) + rm -r -f $(LIBS_PATH) dirs: mkdir -p $(DOWNLOAD_PATH) - mkdir -p libs - gcc --version | head --lines 1 | tr ' ' '\n' | tail -1 >libs/gcc-version + mkdir -p $(BUILD_PATH) + gcc --version | head --lines 1 | tr ' ' '\n' | tail -1 >$(BUILD_PATH)/gcc-version $(DOWNLOAD_PATH)/zlib-$(ZLIB_VERSION).tar.gz: wget --no-check-certificate http://sourceforge.net/projects/libpng/files/zlib/$(ZLIB_VERSION)/zlib-$(ZLIB_VERSION).tar.gz/download -O $(DOWNLOAD_PATH)/zlib-$(ZLIB_VERSION).tar.gz -zlib: libs/zlib-$(ZLIB_VERSION) +zlib: $(BUILD_PATH)/zlib-$(ZLIB_VERSION) -libs/zlib-$(ZLIB_VERSION): $(DOWNLOAD_PATH)/zlib-$(ZLIB_VERSION).tar.gz +$(BUILD_PATH)/zlib-$(ZLIB_VERSION): $(DOWNLOAD_PATH)/zlib-$(ZLIB_VERSION).tar.gz # prepare - rm -r -f libs/zlib-* + 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`/../libs" + #cd zlib-$(ZLIB_VERSION) && make install prefix="`pwd`/../$(BUILD_PATH)" cd zlib-$(ZLIB_VERSION) && make # copy files - mkdir -p libs/zlib-$(ZLIB_VERSION).tmp/include - cp zlib-$(ZLIB_VERSION)/zlib.h libs/zlib-$(ZLIB_VERSION).tmp/include/ - cp zlib-$(ZLIB_VERSION)/zconf.h libs/zlib-$(ZLIB_VERSION).tmp/include/ - mkdir -p libs/zlib-$(ZLIB_VERSION).tmp/lib - cp zlib-$(ZLIB_VERSION)/libz.a libs/zlib-$(ZLIB_VERSION).tmp/lib/ + mkdir -p $(BUILD_PATH)/zlib-$(ZLIB_VERSION).tmp/include + cp zlib-$(ZLIB_VERSION)/zlib.h $(BUILD_PATH)/zlib-$(ZLIB_VERSION).tmp/include/ + cp zlib-$(ZLIB_VERSION)/zconf.h $(BUILD_PATH)/zlib-$(ZLIB_VERSION).tmp/include/ + mkdir -p $(BUILD_PATH)/zlib-$(ZLIB_VERSION).tmp/lib + cp zlib-$(ZLIB_VERSION)/libz.a $(BUILD_PATH)/zlib-$(ZLIB_VERSION).tmp/lib/ + # cleanup rm -r -f zlib-$(ZLIB_VERSION) - mv libs/zlib-$(ZLIB_VERSION).tmp libs/zlib-$(ZLIB_VERSION) + mv $(BUILD_PATH)/zlib-$(ZLIB_VERSION).tmp $(BUILD_PATH)/zlib-$(ZLIB_VERSION) -bzip2: libs/bzip2-$(BZIP2_VERSION) +bzip2: $(BUILD_PATH)/bzip2-$(BZIP2_VERSION) $(DOWNLOAD_PATH)/bzip2-$(BZIP2_VERSION).tar.gz: - wget http://bzip.org/$(BZIP2_VERSION)/bzip2-$(BZIP2_VERSION).tar.gz -O $(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 -libs/bzip2-$(BZIP2_VERSION): $(DOWNLOAD_PATH)/bzip2-$(BZIP2_VERSION).tar.gz +$(BUILD_PATH)/bzip2-$(BZIP2_VERSION): $(DOWNLOAD_PATH)/bzip2-$(BZIP2_VERSION).tar.gz # prepare - rm -r -f libs/bzip2-* + rm -r -f $(BUILD_PATH)/bzip2-* tar xvf $(DOWNLOAD_PATH)/bzip2-$(BZIP2_VERSION).tar.gz # build - #cd bzip2-$(BZIP2_VERSION) && make install PREFIX="`pwd`/../libs" + #cd bzip2-$(BZIP2_VERSION) && make install PREFIX="`pwd`/../$(BUILD_PATH)" cd bzip2-$(BZIP2_VERSION) && make # copy files - mkdir -p libs/bzip2-$(BZIP2_VERSION).tmp/include - cp bzip2-$(BZIP2_VERSION)/bzlib.h libs/bzip2-$(BZIP2_VERSION).tmp/include/ - mkdir -p libs/bzip2-$(BZIP2_VERSION).tmp/lib - cp bzip2-$(BZIP2_VERSION)/libbz2.a libs/bzip2-$(BZIP2_VERSION).tmp/lib/ + mkdir -p $(BUILD_PATH)/bzip2-$(BZIP2_VERSION).tmp/include + cp bzip2-$(BZIP2_VERSION)/bzlib.h $(BUILD_PATH)/bzip2-$(BZIP2_VERSION).tmp/include/ + mkdir -p $(BUILD_PATH)/bzip2-$(BZIP2_VERSION).tmp/lib + cp bzip2-$(BZIP2_VERSION)/libbz2.a $(BUILD_PATH)/bzip2-$(BZIP2_VERSION).tmp/lib/ + # cleanup rm -r -f bzip2-$(BZIP2_VERSION) - mv libs/bzip2-$(BZIP2_VERSION).tmp libs/bzip2-$(BZIP2_VERSION) + mv $(BUILD_PATH)/bzip2-$(BZIP2_VERSION).tmp $(BUILD_PATH)/bzip2-$(BZIP2_VERSION) -miniupnpc: libs/miniupnpc-$(MINIUPNPC_VERSION) +miniupnpc: $(BUILD_PATH)/miniupnpc-$(MINIUPNPC_VERSION) $(DOWNLOAD_PATH)/miniupnpc-$(MINIUPNPC_VERSION).tar.gz: wget http://miniupnp.free.fr/files/download.php?file=miniupnpc-$(MINIUPNPC_VERSION).tar.gz -O $(DOWNLOAD_PATH)/miniupnpc-$(MINIUPNPC_VERSION).tar.gz -libs/miniupnpc-$(MINIUPNPC_VERSION): $(DOWNLOAD_PATH)/miniupnpc-$(MINIUPNPC_VERSION).tar.gz +$(BUILD_PATH)/miniupnpc-$(MINIUPNPC_VERSION): $(DOWNLOAD_PATH)/miniupnpc-$(MINIUPNPC_VERSION).tar.gz # prepare - rm -r -f libs/miniupnpc-* + rm -r -f $(BUILD_PATH)/miniupnpc-* tar xvf $(DOWNLOAD_PATH)/miniupnpc-$(MINIUPNPC_VERSION).tar.gz # build - cd miniupnpc-$(MINIUPNPC_VERSION) && export CC=gcc && make -f Makefile.mingw init libminiupnpc.a miniupnpc.dll + cd miniupnpc-$(MINIUPNPC_VERSION) && export CC=gcc && export PATH=.:$$PATH && make -f Makefile.mingw init libminiupnpc.a miniupnpc.dll # copy files - mkdir -p libs/miniupnpc-$(MINIUPNPC_VERSION).tmp/include/miniupnpc - cp miniupnpc-$(MINIUPNPC_VERSION)/*.h libs/miniupnpc-$(MINIUPNPC_VERSION).tmp/include/miniupnpc/ - mkdir -p libs/miniupnpc-$(MINIUPNPC_VERSION).tmp/lib - cp miniupnpc-$(MINIUPNPC_VERSION)/miniupnpc.lib libs/miniupnpc-$(MINIUPNPC_VERSION).tmp/lib/ - mkdir -p libs/miniupnpc-$(MINIUPNPC_VERSION).tmp/bin - cp miniupnpc-$(MINIUPNPC_VERSION)/miniupnpc.dll libs/miniupnpc-$(MINIUPNPC_VERSION).tmp/bin/ + mkdir -p $(BUILD_PATH)/miniupnpc-$(MINIUPNPC_VERSION).tmp/include/miniupnpc + cp miniupnpc-$(MINIUPNPC_VERSION)/*.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 + cp miniupnpc-$(MINIUPNPC_VERSION)/miniupnpc.dll $(BUILD_PATH)/miniupnpc-$(MINIUPNPC_VERSION).tmp/bin/ + # cleanup rm -r -f miniupnpc-$(MINIUPNPC_VERSION) - mv libs/miniupnpc-$(MINIUPNPC_VERSION).tmp libs/miniupnpc-$(MINIUPNPC_VERSION) + mv $(BUILD_PATH)/miniupnpc-$(MINIUPNPC_VERSION).tmp $(BUILD_PATH)/miniupnpc-$(MINIUPNPC_VERSION) -openssl: libs/openssl-$(OPENSSL_VERSION) +openssl: $(BUILD_PATH)/openssl-$(OPENSSL_VERSION) $(DOWNLOAD_PATH)/openssl-$(OPENSSL_VERSION).tar.gz: wget --no-check-certificate https://www.openssl.org/source/openssl-$(OPENSSL_VERSION).tar.gz -O $(DOWNLOAD_PATH)/openssl-$(OPENSSL_VERSION).tar.gz -libs/openssl-$(OPENSSL_VERSION): $(DOWNLOAD_PATH)/openssl-$(OPENSSL_VERSION).tar.gz +$(BUILD_PATH)/openssl-$(OPENSSL_VERSION): $(DOWNLOAD_PATH)/openssl-$(OPENSSL_VERSION).tar.gz # prepare - rm -r -f libs/openssl-* + rm -r -f $(BUILD_PATH)/openssl-* tar xvf $(DOWNLOAD_PATH)/openssl-$(OPENSSL_VERSION).tar.gz # build - #cd openssl-$(OPENSSL_VERSION) && ./config --prefix="`pwd`/../libs" + #cd openssl-$(OPENSSL_VERSION) && ./config --prefix="`pwd`/../$(BUILD_PATH)" #cd openssl-$(OPENSSL_VERSION) && make install cd openssl-$(OPENSSL_VERSION) && ./config shared cd openssl-$(OPENSSL_VERSION) && make # copy files - mkdir -p libs/openssl-$(OPENSSL_VERSION).tmp/include/openssl - cp openssl-$(OPENSSL_VERSION)/include/openssl/*.h libs/openssl-$(OPENSSL_VERSION).tmp/include/openssl/ - mkdir -p libs/openssl-$(OPENSSL_VERSION).tmp/bin - cp openssl-$(OPENSSL_VERSION)/libeay32.dll libs/openssl-$(OPENSSL_VERSION).tmp/bin/ - cp openssl-$(OPENSSL_VERSION)/ssleay32.dll libs/openssl-$(OPENSSL_VERSION).tmp/bin/ - mkdir -p libs/openssl-$(OPENSSL_VERSION).tmp/lib - cp openssl-$(OPENSSL_VERSION)/libcrypto.dll.a libs/openssl-$(OPENSSL_VERSION).tmp/lib/ - cp openssl-$(OPENSSL_VERSION)/libssl.dll.a libs/openssl-$(OPENSSL_VERSION).tmp/lib/ + mkdir -p $(BUILD_PATH)/openssl-$(OPENSSL_VERSION).tmp/include/openssl + cp openssl-$(OPENSSL_VERSION)/include/openssl/*.h $(BUILD_PATH)/openssl-$(OPENSSL_VERSION).tmp/include/openssl/ + mkdir -p $(BUILD_PATH)/openssl-$(OPENSSL_VERSION).tmp/bin + if [ $(MSYSTEM) = "MINGW32" ] ; then cp openssl-$(OPENSSL_VERSION)/libcrypto-1_1.dll $(BUILD_PATH)/openssl-$(OPENSSL_VERSION).tmp/bin/ ; fi + if [ $(MSYSTEM) = "MINGW32" ] ; then cp openssl-$(OPENSSL_VERSION)/libcrypto-1_1.dll $(BUILD_PATH)/openssl-$(OPENSSL_VERSION).tmp/bin/ ; fi + if [ $(MSYSTEM) = "MINGW32" ] ; then cp openssl-$(OPENSSL_VERSION)/libssl-1_1.dll $(BUILD_PATH)/openssl-$(OPENSSL_VERSION).tmp/bin/ ; fi + if [ $(MSYSTEM) = "MINGW64" ] ; then cp openssl-$(OPENSSL_VERSION)/libcrypto-1_1-x64.dll $(BUILD_PATH)/openssl-$(OPENSSL_VERSION).tmp/bin/ ; fi + if [ $(MSYSTEM) = "MINGW64" ] ; then cp openssl-$(OPENSSL_VERSION)/libssl-1_1-x64.dll $(BUILD_PATH)/openssl-$(OPENSSL_VERSION).tmp/bin/ ; fi + mkdir -p $(BUILD_PATH)/openssl-$(OPENSSL_VERSION).tmp/lib + cp openssl-$(OPENSSL_VERSION)/libcrypto.dll.a $(BUILD_PATH)/openssl-$(OPENSSL_VERSION).tmp/lib/ + cp openssl-$(OPENSSL_VERSION)/libssl.dll.a $(BUILD_PATH)/openssl-$(OPENSSL_VERSION).tmp/lib/ + # cleanup rm -r -f openssl-$(OPENSSL_VERSION) - mv libs/openssl-$(OPENSSL_VERSION).tmp libs/openssl-$(OPENSSL_VERSION) + mv $(BUILD_PATH)/openssl-$(OPENSSL_VERSION).tmp $(BUILD_PATH)/openssl-$(OPENSSL_VERSION) -speex: libs/speex-$(SPEEX_VERSION) +speex: $(BUILD_PATH)/speex-$(SPEEX_VERSION) $(DOWNLOAD_PATH)/speex-$(SPEEX_VERSION).tar.gz: - wget http://downloads.xiph.org/releases/speex/speex-$(SPEEX_VERSION).tar.gz -O $(DOWNLOAD_PATH)/speex-$(SPEEX_VERSION).tar.gz + wget --no-check-certificate http://downloads.xiph.org/releases/speex/speex-$(SPEEX_VERSION).tar.gz -O $(DOWNLOAD_PATH)/speex-$(SPEEX_VERSION).tar.gz -libs/speex-$(SPEEX_VERSION): $(DOWNLOAD_PATH)/speex-$(SPEEX_VERSION).tar.gz +$(BUILD_PATH)/speex-$(SPEEX_VERSION): $(DOWNLOAD_PATH)/speex-$(SPEEX_VERSION).tar.gz # prepare - rm -r -f libs/speex-* + rm -r -f $(BUILD_PATH)/speex-* tar xvf $(DOWNLOAD_PATH)/speex-$(SPEEX_VERSION).tar.gz # build cd speex-$(SPEEX_VERSION) && ./configure - #cd speex-$(SPEEX_VERSION) && make install exec_prefix="`pwd`/../libs" + #cd speex-$(SPEEX_VERSION) && make install exec_prefix="`pwd`/../$(BUILD_PATH)" cd speex-$(SPEEX_VERSION) && make # copy files - mkdir -p libs/speex-$(SPEEX_VERSION).tmp/include/speex - cp speex-$(SPEEX_VERSION)/include/speex/*.h libs/speex-$(SPEEX_VERSION).tmp/include/speex/ - mkdir -p libs/speex-$(SPEEX_VERSION).tmp/lib - cp speex-$(SPEEX_VERSION)/libspeex/.libs/libspeex.a libs/speex-$(SPEEX_VERSION).tmp/lib + mkdir -p $(BUILD_PATH)/speex-$(SPEEX_VERSION).tmp/include/speex + cp speex-$(SPEEX_VERSION)/include/speex/*.h $(BUILD_PATH)/speex-$(SPEEX_VERSION).tmp/include/speex/ + mkdir -p $(BUILD_PATH)/speex-$(SPEEX_VERSION).tmp/lib + cp speex-$(SPEEX_VERSION)/libspeex/.libs/libspeex.a $(BUILD_PATH)/speex-$(SPEEX_VERSION).tmp/lib + # cleanup rm -r -f speex-$(SPEEX_VERSION) - mv libs/speex-$(SPEEX_VERSION).tmp libs/speex-$(SPEEX_VERSION) + mv $(BUILD_PATH)/speex-$(SPEEX_VERSION).tmp $(BUILD_PATH)/speex-$(SPEEX_VERSION) -speexdsp: libs/speexdsp-$(SPEEXDSP_VERSION) +speexdsp: $(BUILD_PATH)/speexdsp-$(SPEEXDSP_VERSION) $(DOWNLOAD_PATH)/speexdsp-$(SPEEXDSP_VERSION).tar.gz: - wget http://downloads.xiph.org/releases/speex/speexdsp-$(SPEEXDSP_VERSION).tar.gz -O $(DOWNLOAD_PATH)/speexdsp-$(SPEEXDSP_VERSION).tar.gz + wget --no-check-certificate http://downloads.xiph.org/releases/speex/speexdsp-$(SPEEXDSP_VERSION).tar.gz -O $(DOWNLOAD_PATH)/speexdsp-$(SPEEXDSP_VERSION).tar.gz -libs/speexdsp-$(SPEEXDSP_VERSION): $(DOWNLOAD_PATH)/speexdsp-$(SPEEXDSP_VERSION).tar.gz +$(BUILD_PATH)/speexdsp-$(SPEEXDSP_VERSION): $(DOWNLOAD_PATH)/speexdsp-$(SPEEXDSP_VERSION).tar.gz # prepare - rm -r -f libs/speexdsp-* + rm -r -f $(BUILD_PATH)/speexdsp-* tar xvf $(DOWNLOAD_PATH)/speexdsp-$(SPEEXDSP_VERSION).tar.gz # build cd speexdsp-$(SPEEXDSP_VERSION) && ./configure cd speexdsp-$(SPEEXDSP_VERSION) && make # copy files - mkdir -p libs/speexdsp-$(SPEEXDSP_VERSION).tmp/include/speex - cp speexdsp-$(SPEEXDSP_VERSION)/include/speex/*.h libs/speexdsp-$(SPEEXDSP_VERSION).tmp/include/speex/ - mkdir -p libs/speexdsp-$(SPEEXDSP_VERSION).tmp/lib - cp speexdsp-$(SPEEXDSP_VERSION)/libspeexdsp/.libs/libspeexdsp.a libs/speexdsp-$(SPEEXDSP_VERSION).tmp/lib + mkdir -p $(BUILD_PATH)/speexdsp-$(SPEEXDSP_VERSION).tmp/include/speex + cp speexdsp-$(SPEEXDSP_VERSION)/include/speex/*.h $(BUILD_PATH)/speexdsp-$(SPEEXDSP_VERSION).tmp/include/speex/ + mkdir -p $(BUILD_PATH)/speexdsp-$(SPEEXDSP_VERSION).tmp/lib + cp speexdsp-$(SPEEXDSP_VERSION)/libspeexdsp/.libs/libspeexdsp.a $(BUILD_PATH)/speexdsp-$(SPEEXDSP_VERSION).tmp/lib + # cleanup rm -r -f speexdsp-$(SPEEXDSP_VERSION) - mv libs/speexdsp-$(SPEEXDSP_VERSION).tmp libs/speexdsp-$(SPEEXDSP_VERSION) + mv $(BUILD_PATH)/speexdsp-$(SPEEXDSP_VERSION).tmp $(BUILD_PATH)/speexdsp-$(SPEEXDSP_VERSION) -opencv: libs/opencv-$(OPENCV_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 -libs/opencv-$(OPENCV_VERSION): $(DOWNLOAD_PATH)/opencv-$(OPENCV_VERSION).tar.gz +$(BUILD_PATH)/opencv-$(OPENCV_VERSION): $(DOWNLOAD_PATH)/opencv-$(OPENCV_VERSION).tar.gz # prepare - rm -r -f libs/opencv-* + 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`/../../libs" - 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`/install" + #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 libs/opencv-$(OPENCV_VERSION).tmp/include - cp -r opencv-$(OPENCV_VERSION)/build/install/include/* libs/opencv-$(OPENCV_VERSION).tmp/include/ - mkdir -p libs/opencv-$(OPENCV_VERSION).tmp/lib/opencv - cp -r opencv-$(OPENCV_VERSION)/build/install/x86/mingw/staticlib/* libs/opencv-$(OPENCV_VERSION).tmp/lib/opencv/ + 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 libs/opencv-$(OPENCV_VERSION).tmp libs/opencv-$(OPENCV_VERSION) + mv $(BUILD_PATH)/opencv-$(OPENCV_VERSION).tmp $(BUILD_PATH)/opencv-$(OPENCV_VERSION) -libxml2: libs/libxml2-$(LIBXML2_VERSION) +libxml2: $(BUILD_PATH)/libxml2-$(LIBXML2_VERSION) $(DOWNLOAD_PATH)/libxml2-$(LIBXML2_VERSION).tar.gz: wget ftp://xmlsoft.org/libxml2/libxml2-$(LIBXML2_VERSION).tar.gz -O $(DOWNLOAD_PATH)/libxml2-$(LIBXML2_VERSION).tar.gz -libs/libxml2-$(LIBXML2_VERSION): $(DOWNLOAD_PATH)/libxml2-$(LIBXML2_VERSION).tar.gz +$(BUILD_PATH)/libxml2-$(LIBXML2_VERSION): $(DOWNLOAD_PATH)/libxml2-$(LIBXML2_VERSION).tar.gz # prepare - rm -r -f libs/libxml2-* + rm -r -f $(BUILD_PATH)/libxml2-* tar xvf $(DOWNLOAD_PATH)/libxml2-$(LIBXML2_VERSION).tar.gz # build cd libxml2-$(LIBXML2_VERSION) && ./configure --without-iconv -enable-shared=no - #cd libxml2-$(LIBXML2_VERSION) && make install exec_prefix="`pwd`/../libs" + #cd libxml2-$(LIBXML2_VERSION) && make install exec_prefix="`pwd`/../$(BUILD_PATH)" cd libxml2-$(LIBXML2_VERSION) && make # copy files - mkdir -p libs/libxml2-$(LIBXML2_VERSION).tmp/include/libxml - cp libxml2-$(LIBXML2_VERSION)/include/libxml/*.h libs/libxml2-$(LIBXML2_VERSION).tmp/include/libxml/ - mkdir -p libs/libxml2-$(LIBXML2_VERSION).tmp/lib - cp libxml2-$(LIBXML2_VERSION)/.libs/libxml2.a libs/libxml2-$(LIBXML2_VERSION).tmp/lib/ + mkdir -p $(BUILD_PATH)/libxml2-$(LIBXML2_VERSION).tmp/include/libxml + cp libxml2-$(LIBXML2_VERSION)/include/libxml/*.h $(BUILD_PATH)/libxml2-$(LIBXML2_VERSION).tmp/include/libxml/ + mkdir -p $(BUILD_PATH)/libxml2-$(LIBXML2_VERSION).tmp/lib + cp libxml2-$(LIBXML2_VERSION)/.libs/libxml2.a $(BUILD_PATH)/libxml2-$(LIBXML2_VERSION).tmp/lib/ + # cleanup #rm -r -f libxml2-$(LIBXML2_VERSION) # see libxslt - mv libs/libxml2-$(LIBXML2_VERSION).tmp libs/libxml2-$(LIBXML2_VERSION) + mv $(BUILD_PATH)/libxml2-$(LIBXML2_VERSION).tmp $(BUILD_PATH)/libxml2-$(LIBXML2_VERSION) -libxslt: libs/libxslt-$(LIBXSLT_VERSION) +libxslt: $(BUILD_PATH)/libxslt-$(LIBXSLT_VERSION) $(DOWNLOAD_PATH)/libxslt-$(LIBXSLT_VERSION).tar.gz: wget ftp://xmlsoft.org/libxml2/libxslt-$(LIBXSLT_VERSION).tar.gz -O $(DOWNLOAD_PATH)/libxslt-$(LIBXSLT_VERSION).tar.gz -libs/libxslt-$(LIBXSLT_VERSION): $(DOWNLOAD_PATH)/libxml2-$(LIBXML2_VERSION).tar.gz $(DOWNLOAD_PATH)/libxslt-$(LIBXSLT_VERSION).tar.gz +$(BUILD_PATH)/libxslt-$(LIBXSLT_VERSION): $(DOWNLOAD_PATH)/libxml2-$(LIBXML2_VERSION).tar.gz $(DOWNLOAD_PATH)/libxslt-$(LIBXSLT_VERSION).tar.gz # prepare - rm -r -f libs/libxslt-* + rm -r -f $(BUILD_PATH)/libxslt-* tar xvf $(DOWNLOAD_PATH)/libxml2-$(LIBXML2_VERSION).tar.gz tar xvf $(DOWNLOAD_PATH)/libxslt-$(LIBXSLT_VERSION).tar.gz - tar xvf $(MAKEFILE_PATH)libxslt-$(LIBXSLT_VERSION)-fix.tar.gz # build cd libxslt-$(LIBXSLT_VERSION) && ./configure --with-libxml-src=../libxml2-$(LIBXML2_VERSION) -enable-shared=no CFLAGS=-DLIBXML_STATIC cd libxslt-$(LIBXSLT_VERSION) && make # copy files - mkdir -p libs/libxslt-$(LIBXSLT_VERSION).tmp/include/libxslt - cp libxslt-$(LIBXSLT_VERSION)/libxslt/*.h libs/libxslt-$(LIBXSLT_VERSION).tmp/include/libxslt/ - mkdir -p libs/libxslt-$(LIBXSLT_VERSION).tmp/lib - cp libxslt-$(LIBXSLT_VERSION)/libxslt/.libs/libxslt.a libs/libxslt-$(LIBXSLT_VERSION).tmp/lib/ - cp libxslt-$(LIBXSLT_VERSION)/libexslt/.libs/libexslt.a libs/libxslt-$(LIBXSLT_VERSION).tmp/lib/ + mkdir -p $(BUILD_PATH)/libxslt-$(LIBXSLT_VERSION).tmp/include/libxslt + cp libxslt-$(LIBXSLT_VERSION)/libxslt/*.h $(BUILD_PATH)/libxslt-$(LIBXSLT_VERSION).tmp/include/libxslt/ + mkdir -p $(BUILD_PATH)/libxslt-$(LIBXSLT_VERSION).tmp/lib + cp libxslt-$(LIBXSLT_VERSION)/libxslt/.libs/libxslt.a $(BUILD_PATH)/libxslt-$(LIBXSLT_VERSION).tmp/lib/ + cp libxslt-$(LIBXSLT_VERSION)/libexslt/.libs/libexslt.a $(BUILD_PATH)/libxslt-$(LIBXSLT_VERSION).tmp/lib/ + # cleanup rm -r -f libxml2-$(LIBXML2_VERSION) rm -r -f libxslt-$(LIBXSLT_VERSION) - mv libs/libxslt-$(LIBXSLT_VERSION).tmp libs/libxslt-$(LIBXSLT_VERSION) + mv $(BUILD_PATH)/libxslt-$(LIBXSLT_VERSION).tmp $(BUILD_PATH)/libxslt-$(LIBXSLT_VERSION) -curl: libs/curl-$(CURL_VERSION) +curl: $(BUILD_PATH)/curl-$(CURL_VERSION) $(DOWNLOAD_PATH)/curl-$(CURL_VERSION).tar.gz: - wget --no-check-certificate http://curl.haxx.se/$(DOWNLOAD_PATH)/curl-$(CURL_VERSION).tar.gz -O $(DOWNLOAD_PATH)/curl-$(CURL_VERSION).tar.gz + wget --no-check-certificate http://curl.haxx.se/download/curl-$(CURL_VERSION).tar.gz -O $(DOWNLOAD_PATH)/curl-$(CURL_VERSION).tar.gz -libs/curl-$(CURL_VERSION): $(DOWNLOAD_PATH)/curl-$(CURL_VERSION).tar.gz +$(BUILD_PATH)/curl-$(CURL_VERSION): $(DOWNLOAD_PATH)/curl-$(CURL_VERSION).tar.gz # prepare - rm -r -f libs/curl-* + rm -r -f $(BUILD_PATH)/curl-* tar xvf $(DOWNLOAD_PATH)/curl-$(CURL_VERSION).tar.gz # build - cd curl-$(CURL_VERSION) && ./configure --disable-shared --with-ssl="`pwd`/../libs/openssl-$(OPENSSL_VERSION)" - #cd curl-$(CURL_VERSION) && make install exec_prefix="`pwd`/../libs" + cd curl-$(CURL_VERSION) && ./configure --disable-shared --with-ssl="`pwd`/../$(BUILD_PATH)/openssl-$(OPENSSL_VERSION)" + #cd curl-$(CURL_VERSION) && make install exec_prefix="`pwd`/../$(BUILD_PATH)" cd curl-$(CURL_VERSION) && make # copy files - mkdir -p libs/curl-$(CURL_VERSION).tmp/include/curl - cp curl-$(CURL_VERSION)/include/curl/*.h libs/curl-$(CURL_VERSION).tmp/include/curl/ - mkdir -p libs/curl-$(CURL_VERSION).tmp/lib - cp curl-$(CURL_VERSION)/lib/.libs/libcurl.a libs/curl-$(CURL_VERSION).tmp/lib/ + mkdir -p $(BUILD_PATH)/curl-$(CURL_VERSION).tmp/include/curl + cp curl-$(CURL_VERSION)/include/curl/*.h $(BUILD_PATH)/curl-$(CURL_VERSION).tmp/include/curl/ + mkdir -p $(BUILD_PATH)/curl-$(CURL_VERSION).tmp/lib + cp curl-$(CURL_VERSION)/lib/.libs/libcurl.a $(BUILD_PATH)/curl-$(CURL_VERSION).tmp/lib/ + # cleanup rm -r -f curl-$(CURL_VERSION) - mv libs/curl-$(CURL_VERSION).tmp libs/curl-$(CURL_VERSION) + mv $(BUILD_PATH)/curl-$(CURL_VERSION).tmp $(BUILD_PATH)/curl-$(CURL_VERSION) -sqlcipher: libs/sqlcipher-$(SQLCIPHER_VERSION) +sqlcipher: $(BUILD_PATH)/sqlcipher-$(SQLCIPHER_VERSION) $(DOWNLOAD_PATH)/tcl$(TCL_VERSION)-src.tar.gz: wget --no-check-certificate http://downloads.sourceforge.net/project/tcl/Tcl/$(TCL_VERSION)/tcl$(TCL_VERSION)-src.tar.gz -O $(DOWNLOAD_PATH)/tcl$(TCL_VERSION)-src.tar.gz @@ -271,9 +288,9 @@ $(DOWNLOAD_PATH)/tcl$(TCL_VERSION)-src.tar.gz: $(DOWNLOAD_PATH)/sqlcipher-$(SQLCIPHER_VERSION).tar.gz: wget --no-check-certificate https://github.com/sqlcipher/sqlcipher/archive/v$(SQLCIPHER_VERSION).tar.gz -O $(DOWNLOAD_PATH)/sqlcipher-$(SQLCIPHER_VERSION).tar.gz -libs/sqlcipher-$(SQLCIPHER_VERSION): $(DOWNLOAD_PATH)/tcl$(TCL_VERSION)-src.tar.gz $(DOWNLOAD_PATH)/sqlcipher-$(SQLCIPHER_VERSION).tar.gz +$(BUILD_PATH)/sqlcipher-$(SQLCIPHER_VERSION): $(DOWNLOAD_PATH)/tcl$(TCL_VERSION)-src.tar.gz $(DOWNLOAD_PATH)/sqlcipher-$(SQLCIPHER_VERSION).tar.gz # prepare - rm -r -f libs/sqlcipher-* + rm -r -f $(BUILD_PATH)/sqlcipher-* # tcl tar xvf $(DOWNLOAD_PATH)/tcl$(TCL_VERSION)-src.tar.gz mkdir -p tcl$(TCL_VERSION)/build @@ -285,59 +302,97 @@ libs/sqlcipher-$(SQLCIPHER_VERSION): $(DOWNLOAD_PATH)/tcl$(TCL_VERSION)-src.tar. mkdir -p tcl$(TCL_VERSION)/lib ln -s `pwd`/tcl$(TCL_VERSION)/library `pwd`/tcl$(TCL_VERSION)/lib/tcl8.6 # build - cd sqlcipher-$(SQLCIPHER_VERSION) && PATH=.:$$PATH:`pwd`/../tcl$(TCL_VERSION)/build && export LIBS="-L`pwd`/../libs/openssl-$(OPENSSL_VERSION)/lib -lgdi32 $$LIBS" && ./configure --disable-shared --enable-static --enable-tempstore=yes CFLAGS="-DSQLITE_HAS_CODEC -I`pwd`/../libs/openssl-$(OPENSSL_VERSION)/include -I`pwd`/../tcl$(TCL_VERSION)/generic" LDFLAGS="-L`pwd`/../libs/openssl-$(OPENSSL_VERSION)/lib -lcrypto -lgdi32" --with-tcl="`pwd`/../tcl$(TCL_VERSION)/build" && make install prefix="`pwd`/install" + cd sqlcipher-$(SQLCIPHER_VERSION) && PATH=.:$$PATH:`pwd`/../tcl$(TCL_VERSION)/build && export LIBS="-L`pwd`/../$(BUILD_PATH)/openssl-$(OPENSSL_VERSION)/lib -lgdi32 $$LIBS" && ./configure --disable-shared --enable-static --enable-tempstore=yes CFLAGS="-DSQLITE_HAS_CODEC -I`pwd`/../$(BUILD_PATH)/openssl-$(OPENSSL_VERSION)/include -I`pwd`/../tcl$(TCL_VERSION)/generic" LDFLAGS="-L`pwd`/../$(BUILD_PATH)/openssl-$(OPENSSL_VERSION)/lib -lcrypto -lgdi32" --with-tcl="`pwd`/../tcl$(TCL_VERSION)/build" && make install prefix="`pwd`/install" # copy files - mkdir -p libs/sqlcipher-$(SQLCIPHER_VERSION).tmp/include - cp -r sqlcipher-$(SQLCIPHER_VERSION)/install/include/* libs/sqlcipher-$(SQLCIPHER_VERSION).tmp/include/ - mkdir -p libs/sqlcipher-$(SQLCIPHER_VERSION).tmp/lib - cp sqlcipher-$(SQLCIPHER_VERSION)/install/lib/libsqlcipher.a libs/sqlcipher-$(SQLCIPHER_VERSION).tmp/lib/ - mkdir -p libs/sqlcipher-$(SQLCIPHER_VERSION).tmp/bin - cp sqlcipher-$(SQLCIPHER_VERSION)/install/bin/sqlcipher.exe libs/sqlcipher-$(SQLCIPHER_VERSION).tmp/bin/ + mkdir -p $(BUILD_PATH)/sqlcipher-$(SQLCIPHER_VERSION).tmp/include + cp -r sqlcipher-$(SQLCIPHER_VERSION)/install/include/* $(BUILD_PATH)/sqlcipher-$(SQLCIPHER_VERSION).tmp/include/ + mkdir -p $(BUILD_PATH)/sqlcipher-$(SQLCIPHER_VERSION).tmp/lib + cp sqlcipher-$(SQLCIPHER_VERSION)/install/lib/libsqlcipher.a $(BUILD_PATH)/sqlcipher-$(SQLCIPHER_VERSION).tmp/lib/ + mkdir -p $(BUILD_PATH)/sqlcipher-$(SQLCIPHER_VERSION).tmp/bin + cp sqlcipher-$(SQLCIPHER_VERSION)/install/bin/sqlcipher.exe $(BUILD_PATH)/sqlcipher-$(SQLCIPHER_VERSION).tmp/bin/ + # cleanup rm -r -f sqlcipher-$(SQLCIPHER_VERSION) rm -r -f tcl$(TCL_VERSION) - mv libs/sqlcipher-$(SQLCIPHER_VERSION).tmp libs/sqlcipher-$(SQLCIPHER_VERSION) + mv $(BUILD_PATH)/sqlcipher-$(SQLCIPHER_VERSION).tmp $(BUILD_PATH)/sqlcipher-$(SQLCIPHER_VERSION) -libmicrohttpd: libs/libmicrohttpd-$(LIBMICROHTTPD_VERSION) +libmicrohttpd: $(BUILD_PATH)/libmicrohttpd-$(LIBMICROHTTPD_VERSION) $(DOWNLOAD_PATH)/libmicrohttpd-$(LIBMICROHTTPD_VERSION).tar.gz: wget --no-check-certificate http://ftp.gnu.org/gnu/libmicrohttpd/libmicrohttpd-$(LIBMICROHTTPD_VERSION).tar.gz -O $(DOWNLOAD_PATH)/libmicrohttpd-$(LIBMICROHTTPD_VERSION).tar.gz -libs/libmicrohttpd-$(LIBMICROHTTPD_VERSION): $(DOWNLOAD_PATH)/libmicrohttpd-$(LIBMICROHTTPD_VERSION).tar.gz +$(BUILD_PATH)/libmicrohttpd-$(LIBMICROHTTPD_VERSION): $(DOWNLOAD_PATH)/libmicrohttpd-$(LIBMICROHTTPD_VERSION).tar.gz # prepare - rm -r -f libs/libmicrohttpd-* + rm -r -f $(BUILD_PATH)/libmicrohttpd-* tar xvf $(DOWNLOAD_PATH)/libmicrohttpd-$(LIBMICROHTTPD_VERSION).tar.gz # build - cd libmicrohttpd-$(LIBMICROHTTPD_VERSION) && ./configure --disable-shared --enable-static --prefix="`pwd`/../libs/libmicrohttpd-$(LIBMICROHTTPD_VERSION).tmp" + cd libmicrohttpd-$(LIBMICROHTTPD_VERSION) && ./configure --disable-shared --enable-static --prefix="`pwd`/../$(BUILD_PATH)/libmicrohttpd-$(LIBMICROHTTPD_VERSION).tmp" cd libmicrohttpd-$(LIBMICROHTTPD_VERSION) && make install - # copy files + # cleanup rm -r -f libmicrohttpd-$(LIBMICROHTTPD_VERSION) - mv libs/libmicrohttpd-$(LIBMICROHTTPD_VERSION).tmp libs/libmicrohttpd-$(LIBMICROHTTPD_VERSION) + mv $(BUILD_PATH)/libmicrohttpd-$(LIBMICROHTTPD_VERSION).tmp $(BUILD_PATH)/libmicrohttpd-$(LIBMICROHTTPD_VERSION) -ffmpeg: libs/ffmpeg-$(FFMPEG_VERSION) +ffmpeg: $(BUILD_PATH)/ffmpeg-$(FFMPEG_VERSION) $(DOWNLOAD_PATH)/ffmpeg-$(FFMPEG_VERSION).tar.gz: wget --no-check-certificate https://ffmpeg.org/releases/ffmpeg-$(FFMPEG_VERSION).tar.gz -O $(DOWNLOAD_PATH)/ffmpeg-$(FFMPEG_VERSION).tar.gz -libs/ffmpeg-$(FFMPEG_VERSION): $(DOWNLOAD_PATH)/ffmpeg-$(FFMPEG_VERSION).tar.gz +$(BUILD_PATH)/ffmpeg-$(FFMPEG_VERSION): $(DOWNLOAD_PATH)/ffmpeg-$(FFMPEG_VERSION).tar.gz # prepare - rm -r -f libs/ffmpeg-* + 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`/../libs/ffmpeg-$(FFMPEG_VERSION).tmp" + 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) && make install - # copy files + # cleanup rm -r -f ffmpeg-$(FFMPEG_VERSION) - mv libs/ffmpeg-$(FFMPEG_VERSION).tmp libs/ffmpeg-$(FFMPEG_VERSION) + mv $(BUILD_PATH)/ffmpeg-$(FFMPEG_VERSION).tmp $(BUILD_PATH)/ffmpeg-$(FFMPEG_VERSION) + +rapidjson: $(BUILD_PATH)/rapidjson-$(RAPIDJSON_VERSION) + +$(DOWNLOAD_PATH)/rapidjson-$(RAPIDJSON_VERSION).tar.gz: + wget --no-check-certificate https://github.com/Tencent/rapidjson/archive/v$(RAPIDJSON_VERSION).tar.gz -O $(DOWNLOAD_PATH)/rapidjson-$(RAPIDJSON_VERSION).tar.gz + +$(BUILD_PATH)/rapidjson-$(RAPIDJSON_VERSION): $(DOWNLOAD_PATH)/rapidjson-$(RAPIDJSON_VERSION).tar.gz + # prepare + rm -r -f $(BUILD_PATH)/rapidjson-* + tar xvf $(DOWNLOAD_PATH)/rapidjson-$(RAPIDJSON_VERSION).tar.gz + # build + #mkdir -p rapidjson-$(RAPIDJSON_VERSION)/build + #cd rapidjson-$(RAPIDJSON_VERSION)/build && cmake .. -G"MSYS Makefiles" + #cd rapidjson-$(RAPIDJSON_VERSION)/build && make + # copy files + mkdir -p $(BUILD_PATH)/rapidjson-$(RAPIDJSON_VERSION).tmp/include + cp -r rapidjson-$(RAPIDJSON_VERSION)/include/* $(BUILD_PATH)/rapidjson-$(RAPIDJSON_VERSION).tmp/include/ + # cleanup + rm -r -f rapidjson-$(RAPIDJSON_VERSION) + mv $(BUILD_PATH)/rapidjson-$(RAPIDJSON_VERSION).tmp $(BUILD_PATH)/rapidjson-$(RAPIDJSON_VERSION) + +xapian: $(BUILD_PATH)/xapian-core-$(XAPIAN_VERSION) + +$(DOWNLOAD_PATH)/xapian-core-$(XAPIAN_VERSION).tar.xz: + wget --no-check-certificate https://oligarchy.co.uk/xapian/$(XAPIAN_VERSION)/xapian-core-$(XAPIAN_VERSION).tar.xz -O $(DOWNLOAD_PATH)/xapian-core-$(XAPIAN_VERSION).tar.xz + +$(BUILD_PATH)/xapian-core-$(XAPIAN_VERSION): $(DOWNLOAD_PATH)/xapian-core-$(XAPIAN_VERSION).tar.xz + # prepare + rm -r -f $(BUILD_PATH)/xapian-core-* + tar xvf $(DOWNLOAD_PATH)/xapian-core-$(XAPIAN_VERSION).tar.xz + # build + #cd xapian-core-$(XAPIAN_VERSION) && ./configure --disable-shared --enable-static --prefix="`pwd`/../$(BUILD_PATH)/xapian-core-$(XAPIAN_VERSION).tmp" + #cd xapian-core-$(XAPIAN_VERSION) && make install + cd xapian-core-$(XAPIAN_VERSION) && ./configure --disable-shared --enable-static + cd xapian-core-$(XAPIAN_VERSION) && make + # copy files + mkdir -p $(BUILD_PATH)/xapian-core-$(XAPIAN_VERSION).tmp/include + cp -r xapian-core-$(XAPIAN_VERSION)/include/* $(BUILD_PATH)/xapian-core-$(XAPIAN_VERSION).tmp/include/ + rm $(BUILD_PATH)/xapian-core-$(XAPIAN_VERSION).tmp/include/Makefile* + mkdir -p $(BUILD_PATH)/xapian-core-$(XAPIAN_VERSION).tmp/lib + cp -r xapian-core-$(XAPIAN_VERSION)/.libs/libxapian.a $(BUILD_PATH)/xapian-core-$(XAPIAN_VERSION).tmp/lib/ + # cleanup + rm -r -f xapian-core-$(XAPIAN_VERSION) + mv $(BUILD_PATH)/xapian-core-$(XAPIAN_VERSION).tmp $(BUILD_PATH)/xapian-core-$(XAPIAN_VERSION) copylibs: - if [ "$(COPY_ANSWER)" = "" ] ; then \ - read -p "Do you want to copy libs to retroshare? (y|n)" answer; \ - else \ - answer=$(COPY_ANSWER) ; \ - fi ; \ - if [ "$$answer" = "y" ] ; then \ - rm -r -f $(LIBS_PATH) ; \ - mkdir -p $(LIBS_PATH) ; \ - cp ./libs/gcc-version $(LIBS_PATH) ; \ - find ./libs -mindepth 1 -maxdepth 1 -type d -not -name "*.tmp" -print -exec cp -r {}/. $(LIBS_PATH) \; ; \ - fi + rm -r -f $(LIBS_PATH) ; \ + mkdir -p $(LIBS_PATH) ; \ + cp $(BUILD_PATH)/gcc-version $(LIBS_PATH) ; \ + find $(BUILD_PATH) -mindepth 1 -maxdepth 1 -type d -not -name "*.tmp" -print -exec cp -r {}/. $(LIBS_PATH) \; ; \ diff --git a/build_scripts/Windows/build-libs/build-libs.bat b/build_scripts/Windows/build-libs/build-libs.bat index 58b400a2f..b0dc51277 100644 --- a/build_scripts/Windows/build-libs/build-libs.bat +++ b/build_scripts/Windows/build-libs/build-libs.bat @@ -1,13 +1,12 @@ :: Usage: -:: call build-libs.bat [auto-copy] [make tasks] +:: call build-libs.bat [make tasks] @echo off setlocal :: Parameter -set MakeParam="DOWNLOAD_PATH=../download" -if "%~1"=="auto-copy" set MakeParam=%MakeParam% "COPY_ANSWER=y"& shift /1 +set MakeParam="DOWNLOAD_PATH=../../download" set MakeTask= :param_loop @@ -20,22 +19,29 @@ if "%~1" NEQ "" ( :: Initialize environment call "%~dp0..\env.bat" if errorlevel 1 goto error_env -call "%EnvPath%\env-msys.bat" +call "%EnvPath%\env-msys2.bat" if errorlevel 1 goto error_env :: Check MSYS environment -if not exist "%EnvMSYSSH%" %cecho% error "Please install MSYS first." & exit /B 1 +if not exist "%EnvMSYS2SH%" %cecho% error "Please install MSYS2 first." & exit /B 1 :: Initialize environment call "%~dp0env.bat" if errorlevel 1 goto error_env -call "%ToolsPath%\msys-path.bat" "%~dp0" MSYSCurPath -call "%ToolsPath%\msys-path.bat" "%BuildLibsPath%" MSYSBuildLibsPath +call "%ToolsPath%\msys2-path.bat" "%~dp0" MSYS2CurPath +call "%ToolsPath%\msys2-path.bat" "%BuildLibsPath%" MSYS2BuildLibsPath if not exist "%BuildLibsPath%" mkdir "%BuildLibsPath%" -%EnvMSYSCmd% "cd "%MSYSBuildLibsPath%" && make -f %MSYSCurPath%/makefile %MakeParam% %MakeTask%" +set MSYSTEM=MINGW%MSYS2Base% +set MSYS2_PATH_TYPE=inherit + +%EnvMSYS2Cmd% "pacman --needed --noconfirm -S diffutils perl tar make wget mingw-w64-%MSYS2Architecture%-make" +::mingw-w64-%MSYS2Architecture%-cmake +::%EnvMSYS2Cmd% "pacman --noconfirm -Rd --nodeps mingw-w64-%MSYS2Architecture%-zlib" + +%EnvMSYS2Cmd% "cd "%MSYS2BuildLibsPath%" && make -f %MSYS2CurPath%/makefile %MakeParam% %MakeTask%" exit /B %ERRORLEVEL% diff --git a/build_scripts/Windows/build-libs/env.bat b/build_scripts/Windows/build-libs/env.bat index e340a6f88..48687e7f0 100644 --- a/build_scripts/Windows/build-libs/env.bat +++ b/build_scripts/Windows/build-libs/env.bat @@ -4,9 +4,10 @@ call "%ToolsPath%\find-in-path.bat" MinGWPath gcc.exe if "%MinGWPath%"=="" %cecho% error "Please run command in the Qt Command Prompt or add the path to MinGW bin folder to PATH variable." & exit /B 1 :: Get gcc versions -call "%ToolsPath%\get-gcc-version.bat" GCCVersion +call "%ToolsPath%\get-gcc-version.bat" GCCVersion GCCArchitecture if "%GCCVersion%"=="" %cecho% error "Cannot get gcc version." & exit /B 1 +if "%GCCArchitecture%"=="" %cecho% error "Cannot get gcc architecture." & exit /B 1 -set BuildLibsPath=%EnvRootPath%\build-libs\gcc-%GCCVersion% +set BuildLibsPath=%EnvRootPath%\build-libs\gcc-%GCCVersion%\%GCCArchitecture% exit /B 0 diff --git a/build_scripts/Windows/build-libs/libxslt-1.1.28-fix.tar.gz b/build_scripts/Windows/build-libs/libxslt-1.1.28-fix.tar.gz deleted file mode 100755 index af1bada8f..000000000 Binary files a/build_scripts/Windows/build-libs/libxslt-1.1.28-fix.tar.gz and /dev/null differ diff --git a/build_scripts/Windows/build.bat b/build_scripts/Windows/build.bat index 48b6be7bb..06e6909c6 100644 --- a/build_scripts/Windows/build.bat +++ b/build_scripts/Windows/build.bat @@ -1,31 +1,31 @@ -@echo off - -setlocal - -:: Initialize environment -call "%~dp0env.bat" -if errorlevel 1 goto error_env -call "%EnvPath%\env.bat" -if errorlevel 1 goto error_env - -%cecho% info "Build libraries" -call "%~dp0build-libs\build-libs.bat" auto-copy -if errorlevel 1 %cecho% error "Failed to build libraries." & exit /B %ERRORLEVEL% - -%cecho% info "Build %SourceName%" -call "%~dp0build\build.bat" -if errorlevel 1 %cecho% error "Failed to build %SourceName%." & exit /B %ERRORLEVEL% - -%cecho% info "Pack %SourceName%" -call "%~dp0build\pack.bat" -if errorlevel 1 %cecho% error "Failed to pack %SourceName%." & exit /B %ERRORLEVEL% - -%cecho% info "Build installer" -call "%~dp0build\build-installer.bat" -if errorlevel 1 %cecho% error "Failed to build installer." & exit /B %ERRORLEVEL% - -exit /B 0 - -:error_env -echo Failed to initialize environment. -exit /B 1 +@echo off + +setlocal + +:: Initialize environment +call "%~dp0env.bat" +if errorlevel 1 goto error_env +call "%EnvPath%\env.bat" +if errorlevel 1 goto error_env + +%cecho% info "Build libraries" +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 +if errorlevel 1 %cecho% error "Failed to build %SourceName%." & exit /B %ERRORLEVEL% + +%cecho% info "Pack %SourceName%" +call "%~dp0build\pack.bat" release +if errorlevel 1 %cecho% error "Failed to pack %SourceName%." & exit /B %ERRORLEVEL% + +%cecho% info "Build installer" +call "%~dp0build\build-installer.bat" +if errorlevel 1 %cecho% error "Failed to build installer." & exit /B %ERRORLEVEL% + +exit /B 0 + +:error_env +echo Failed to initialize environment. +exit /B 1 diff --git a/build_scripts/Windows/build/build-installer.bat b/build_scripts/Windows/build/build-installer.bat index 9d3aa837e..b34e76157 100644 --- a/build_scripts/Windows/build/build-installer.bat +++ b/build_scripts/Windows/build/build-installer.bat @@ -8,21 +8,24 @@ if errorlevel 1 goto error_env call "%EnvPath%\env.bat" if errorlevel 1 goto error_env -:: Get gcc versions -call "%ToolsPath%\get-gcc-version.bat" GCCVersion -if "%GCCVersion%"=="" echo Cannot get gcc version.& exit /B 1 +:: Initialize environment +call "%~dp0env.bat" release +if errorlevel 2 exit /B 2 +if errorlevel 1 goto error_env :: Check external libraries -if not exist "%RootPath%\libs" echo Please build external libraries first.& exit /B 1 +if not exist "%BuildLibsPath%\libs" %cecho% error "Please build external libraries first." & exit /B 1 :: Check gcc version of external libraries -if not exist "%RootPath%\libs\gcc-version" echo Cannot get gcc version of external libraries.& exit /B 1 -set /P LibsGCCVersion=<"%RootPath%\libs\gcc-version" -if "%LibsGCCVersion%" NEQ "%GCCVersion%" echo Please use correct version of external libraries. (gcc %GCCVersion% ^<^> libs %LibsGCCVersion%).& exit /B 1 +if not exist "%BuildLibsPath%\libs\gcc-version" %cecho% error "Cannot get gcc version of external libraries." & exit /B 1 +set /P LibsGCCVersion=<"%BuildLibsPath%\libs\gcc-version" +if "%LibsGCCVersion%" NEQ "%GCCVersion%" %cecho% error "Please use correct version of external libraries. (gcc %GCCVersion% ^<^> libs %LibsGCCVersion%)." & exit /B 1 -:: Initialize environment -call "%~dp0env.bat" -if errorlevel 1 goto error_env +:: Get date +call "%ToolsPath%\get-rs-date.bat" "%SourcePath%" RsDate +if errorlevel 1 %cecho% error "Could not get date."& goto error + +if "%RsDate%"=="" %cecho% error "Could not get date."& goto error :: Build defines for script set NSIS_PARAM= @@ -32,16 +35,19 @@ set NSIS_PARAM=%NSIS_PARAM% /DQTDIR="%QtPath%\.." set NSIS_PARAM=%NSIS_PARAM% /DMINGWDIR="%MinGWPath%\.." set NSIS_PARAM=%NSIS_PARAM% /DOUTDIR="%RsPackPath%" set NSIS_PARAM=%NSIS_PARAM% /DINSTALLERADD="%RsArchiveAdd%" +set NSIS_PARAM=%NSIS_PARAM% /DEXTERNAL_LIB_DIR="%BuildLibsPath%\libs" +set NSIS_PARAM=%NSIS_PARAM% /DARCHITECTURE="%GCCArchitecture%" +set NSIS_PARAM=%NSIS_PARAM% /DDATE="%RsDate%" -:: Scan version from source -set RsRevision= -set RsBuildAdd= -call "%ToolsPath%\get-rs-version.bat" RS_REVISION_STRING RsRevision -if "%RsRevision%"=="" echo Revision not found.& exit /B 1 -call "%ToolsPath%\get-rs-version.bat" RS_BUILD_NUMBER_ADD RsBuildAdd -if errorlevel 1 exit /B 1 +if exist "%EnvTorPath%\Tor\tor.exe" set NSIS_PARAM=%NSIS_PARAM% /DTORDIR="%EnvTorPath%\Tor" -set NSIS_PARAM=%NSIS_PARAM% /DREVISION=%RsRevision% /DBUILDADD=%RsBuildAdd% +:: Get compiled version +call "%ToolsPath%\get-rs-version.bat" "%RsBuildPath%\retroshare-gui\src\%RsBuildConfig%\retroshare.exe" RsVersion +if errorlevel 1 %cecho% error "Version not found."& exit /B 1 + +if "%RsVersion.Extra%"=="" %cecho% error "Extra number not found".& exit /B 1 + +set NSIS_PARAM=%NSIS_PARAM% /DREVISION=%RsVersion.Extra% set QtMainVersion=%QtVersion:~0,1% diff --git a/build_scripts/Windows/build/build.bat b/build_scripts/Windows/build/build.bat index 5367efa97..a7f02027f 100644 --- a/build_scripts/Windows/build/build.bat +++ b/build_scripts/Windows/build/build.bat @@ -8,29 +8,26 @@ if errorlevel 1 goto error_env call "%EnvPath%\env.bat" if errorlevel 1 goto error_env -:: Get gcc versions -call "%ToolsPath%\get-gcc-version.bat" GCCVersion -if "%GCCVersion%"=="" echo Cannot get gcc version.& exit /B 1 +:: Initialize environment +call "%~dp0env.bat" %* +if errorlevel 2 exit /B 2 +if errorlevel 1 goto error_env :: Check external libraries -if not exist "%RootPath%\libs" echo Please build external libraries first.& exit /B 1 +if not exist "%BuildLibsPath%\libs" %cecho% error "Please build external libraries first." & exit /B 1 :: Check gcc version of external libraries -if not exist "%RootPath%\libs\gcc-version" echo Cannot get gcc version of external libraries.& exit /B 1 -set /P LibsGCCVersion=<"%RootPath%\libs\gcc-version" -if "%LibsGCCVersion%" NEQ "%GCCVersion%" echo Please use correct version of external libraries. (gcc %GCCVersion% ^<^> libs %LibsGCCVersion%).& exit /B 1 - -:: Initialize environment -call "%~dp0env.bat" -if errorlevel 1 goto error_env +if not exist "%BuildLibsPath%\libs\gcc-version" %cecho% error "Cannot get gcc version of external libraries." & exit /B 1 +set /P LibsGCCVersion=<"%BuildLibsPath%\libs\gcc-version" +if "%LibsGCCVersion%" NEQ "%GCCVersion%" %cecho% error "Please use correct version of external libraries. (gcc %GCCVersion% ^<^> libs %LibsGCCVersion%)." & exit /B 1 :: Check git executable set GitPath= call "%ToolsPath%\find-in-path.bat" GitPath git.exe -if "%GitPath%" NEQ "" goto found_git -choice /M "Git not found in PATH. Version information cannot be calculated. Do you want to proceed?" -if %errorlevel%==2 exit /B 1 -:found_git +if "%GitPath%"=="" ( + %cecho% error "Git not found in PATH. Version information cannot be determined." + exit /B 1 +) echo. echo === Version @@ -52,7 +49,12 @@ echo. title Build - %SourceName%-%RsBuildConfig% [qmake] -qmake "%SourcePath%\RetroShare.pro" -r "CONFIG+=%RsBuildConfig% version_detail_bash_script rs_autologin" +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 "%ParamPlugins%"=="1" set RS_QMAKE_CONFIG=%RS_QMAKE_CONFIG% retroshare_plugins + +qmake "%SourcePath%\RetroShare.pro" -r -spec win32-g++ "CONFIG+=%RS_QMAKE_CONFIG%" "EXTERNAL_LIB_DIR=%BuildLibsPath%\libs" if errorlevel 1 goto error echo. @@ -61,18 +63,22 @@ echo. title Build - %SourceName%-%RsBuildConfig% [make] -if exist "%EnvJomExe%" ( - "%EnvJomExe%" -) else ( - mingw32-make -) +mingw32-make -j %CoreCount% +if errorlevel 1 goto error + +echo. +echo === Changelog +echo. + +title Build - %SourceName%-%RsBuildConfig% [changelog] +call "%ToolsPath%\generate-changelog.bat" "%SourcePath%" "%RsBuildPath%\changelog.txt" :error popd title %COMSPEC% -if errorlevel 1 echo.& echo Build failed& echo. +if errorlevel 1 %cecho% error "\nBuild failed\n" exit /B %ERRORLEVEL% :error_env diff --git a/build_scripts/Windows/build/clean.bat b/build_scripts/Windows/build/clean.bat index 0797e7681..e8d5aa7b8 100644 --- a/build_scripts/Windows/build/clean.bat +++ b/build_scripts/Windows/build/clean.bat @@ -7,7 +7,9 @@ call "%~dp0..\env.bat" if errorlevel 1 goto error_env call "%EnvPath%\env.bat" if errorlevel 1 goto error_env -call "%~dp0env.bat" + +call "%~dp0env.bat" %* +if errorlevel 2 exit /B 2 if errorlevel 1 goto error_env if not exist "%RsBuildPath%" exit /B 0 diff --git a/build_scripts/Windows/build/env.bat b/build_scripts/Windows/build/env.bat index cf25d543b..100fa32cd 100644 --- a/build_scripts/Windows/build/env.bat +++ b/build_scripts/Windows/build/env.bat @@ -1,3 +1,60 @@ +:: Process commandline parameter +set ParamRelease=0 +set ParamDebug=0 +set ParamAutologin=0 +set ParamPlugins=0 +set ParamJsonApi=0 +set ParamTor=0 +set NonInteractive=0 +set CoreCount=%NUMBER_OF_PROCESSORS% + +:parameter_loop +if "%~1" NEQ "" ( + for /f "tokens=1,2 delims==" %%a in ("%~1") do ( + if "%%~a"=="release" ( + set ParamRelease=1 + ) else if "%%~a"=="debug" ( + set ParamDebug=1 + ) else if "%%~a"=="autologin" ( + set ParamAutologin=1 + ) else if "%%~a"=="jsonapi" ( + set ParamJsonApi=1 + ) else if "%%~a"=="plugins" ( + set ParamPlugins=1 + ) else if "%%~a"=="tor" ( + set ParamTor=1 + ) else if "%%~a"=="non-interactive" ( + set NonInteractive=1 + ) else if "%%~a"=="singlethread" ( + set CoreCount=1 + ) else ( + echo. + echo Unknown parameter %1 + goto :usage + ) + ) + shift /1 + goto parameter_loop +) + +if "%ParamRelease%"=="1" ( + if "%ParamDebug%"=="1" ( + echo. + echo Release or Debug? + goto :usage + ) + + set RsBuildConfig=release +) else if "%ParamDebug%"=="1" ( + set RsBuildConfig=debug +) else goto :usage + +if "%ParamTor%"=="1" ( + set RsType=-tor +) else ( + set RsType= +) + set BuildPath=%EnvRootPath%\builds set DeployPath=%EnvRootPath%\deploy @@ -7,20 +64,26 @@ if not exist "%DeployPath%" mkdir "%DeployPath%" :: Check Qt environment set QtPath= call "%ToolsPath%\find-in-path.bat" QtPath qmake.exe -if "%QtPath%"=="" echo Please run command in the Qt Command Prompt.& exit /B 1 +if "%QtPath%"=="" %cecho% error "Please run command in the Qt Command Prompt." & exit /B 1 :: Check MinGW environment set MinGWPath= call "%ToolsPath%\find-in-path.bat" MinGWPath gcc.exe -if "%MinGWPath%"=="" echo Please run command in the Qt Command Prompt.& exit /B 1 +if "%MinGWPath%"=="" %cecho% error "Please run command in the Qt Command Prompt." & exit /B 1 :: Get Qt version call "%ToolsPath%\get-qt-version.bat" QtVersion -if "%QtVersion%"=="" echo Cannot get Qt version.& exit /B 1 +if "%QtVersion%"=="" %cecho% error "Cannot get Qt version." & exit /B 1 -set RsBuildConfig=release -set RsBuildPath=%BuildPath%\Qt-%QtVersion%-%RsBuildConfig% -set RsDeployPath=%DeployPath%\Qt-%QtVersion%-%RsBuildConfig% +:: Get gcc versions +call "%ToolsPath%\get-gcc-version.bat" GCCVersion GCCArchitecture +if "%GCCVersion%"=="" %cecho% error "Cannot get gcc version." & exit /B 1 +if "%GCCArchitecture%"=="" %cecho% error "Cannot get gcc architecture." & exit /B 1 + +set BuildLibsPath=%EnvRootPath%\build-libs\gcc-%GCCVersion%\%GCCArchitecture% + +set RsBuildPath=%BuildPath%\Qt-%QtVersion%-%GCCArchitecture%-%RsBuildConfig% +set RsDeployPath=%DeployPath%\Qt-%QtVersion%-%GCCArchitecture%%RsType%-%RsBuildConfig% set RsPackPath=%DeployPath% set RsArchiveAdd= @@ -29,4 +92,27 @@ call "%~dp0env-mod.bat" if errorlevel 1 exit /B %ERRORLEVEL% :no_mod -exit /B 0 \ No newline at end of file +exit /B 0 + +:usage +echo. +echo Usage: release^|debug [version autologin plugins] +echo. +echo Mandatory parameter +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. +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 +echo. +exit /B 2 diff --git a/build_scripts/Windows/build/git-log.bat b/build_scripts/Windows/build/git-log.bat index 8a36c7537..4d479fc3f 100644 --- a/build_scripts/Windows/build/git-log.bat +++ b/build_scripts/Windows/build/git-log.bat @@ -1,19 +1,15 @@ -:: Usage: -:: call git-log.bat [no-ask] - @echo off setlocal -set NoAsk= -if "%~1"=="no-ask" set NoAsk=1 - :: Initialize environment call "%~dp0..\env.bat" if errorlevel 1 goto error_env call "%EnvPath%\env.bat" if errorlevel 1 goto error_env -call "%~dp0env.bat" + +call "%~dp0env.bat" %* +if errorlevel 2 exit /B 2 if errorlevel 1 goto error_env :: Check git executable @@ -21,48 +17,29 @@ set GitPath= call "%ToolsPath%\find-in-path.bat" GitPath git.exe if "%GitPath%"=="" echo Git executable not found in PATH.& exit /B 1 -:: Get compiled revision -set GetRsVersion=%SourcePath%\build_scripts\Windows\tools\get-rs-version.bat -if not exist "%GetRsVersion%" ( - echo File not found - echo %GetRsVersion% - exit /B 1 -) - -call "%GetRsVersion%" RS_REVISION_STRING RsRevision -if "%RsRevision%"=="" echo Revision not found.& exit /B 1 - :: Get compiled version -call "%GetRsVersion%" RS_REVISION_STRING RsRevision -if "%RsRevision%"=="" echo Revision not found.& exit /B 1 +call "%ToolsPath%\get-rs-version.bat" "%RsBuildPath%\retroshare-gui\src\%RsBuildConfig%\retroshare.exe" RsVersion +if errorlevel 1 %cecho% error "Version not found."& goto error -call "%GetRsVersion%" RS_MAJOR_VERSION RsMajorVersion -if "%RsMajorVersion%"=="" echo Major version not found.& exit /B 1 +if "%RsVersion.Major%"=="" %cecho% error "Major version not found."& goto error +if "%RsVersion.Minor%"=="" %cecho% error "Minor version not found."& goto error +if "%RsVersion.Mini%"=="" %cecho% error "Mini number not found".& goto error +if "%RsVersion.Extra%"=="" %cecho% error "Extra number not found".& goto error -call "%GetRsVersion%" RS_MINOR_VERSION RsMinorVersion -if "%RsMinorVersion%"=="" echo Minor version not found.& exit /B 1 +set RsVersion=%RsVersion.Major%.%RsVersion.Minor%.%RsVersion.Mini% -call "%GetRsVersion%" RS_BUILD_NUMBER RsBuildNumber -if "%RsBuildNumber%"=="" echo Build number not found.& exit /B 1 +:: Get date +call "%ToolsPath%\get-rs-date.bat" "%SourcePath%" RsDate +if errorlevel 1 %cecho% error "Could not get date."& goto error -call "%GetRsVersion%" RS_BUILD_NUMBER_ADD RsBuildNumberAdd - -set RsVersion=%RsMajorVersion%.%RsMinorVersion%.%RsBuildNumber%%RsBuildNumberAdd% - -:: Check WMIC is available -wmic.exe alias /? >nul 2>&1 || echo WMIC is not available.&& exit /B 1 - -:: Use WMIC to retrieve date in format YYYYMMDD -set RsDate= -for /f "tokens=2 delims==" %%I in ('wmic os get localdatetime /format:list') do set RsDate=%%I -set RsDate=%RsDate:~0,4%%RsDate:~4,2%%RsDate:~6,2% +if "%RsDate%"=="" %cecho% error "Could not get date."& goto error :: Get last revision -set RsLastRefFile=%BuildPath%\Qt-%QtVersion%-%RsBuildConfig%-LastRef.txt +set RsLastRefFile=%BuildPath%\Qt-%QtVersion%-%GCCArchitecture%%RsType%-%RsBuildConfig%-LastRef.txt set RsLastRef= if exist "%RsLastRefFile%" set /P RsLastRef=<"%RsLastRefFile%" -if "%NoAsk%"=="1" goto no_ask_for_last_revision +if "%NonInteractive%"=="1" goto no_ask_for_last_revision if not "%RsLastRef%"=="" echo Last Revision was %RsLastRef% set /P RsLastRefInput=Last Revision: if "%RsLastRefInput%" NEQ "" set RsLastRef=%RsLastRefInput% @@ -80,15 +57,15 @@ echo. echo Creating log from %RsLastRef% echo to %RsRef% -if "%NoAsk%"=="1" goto no_confirm +if "%NonInteractive%"=="1" goto no_confirm choice /M "Do you want to proceed?" if %errorlevel%==2 exit /B 1 :no_confirm if "%RsBuildConfig%" NEQ "release" ( - set RsGitLog=%DeployPath%\RetroShare-%RsVersion%-Windows-Portable-%RsDate%-%RsRevision%-Qt-%QtVersion%%RsArchiveAdd%-%RsBuildConfig%.txt + set RsGitLog=%DeployPath%\RetroShare-%RsVersion%-Windows-Portable-%RsDate%-%RsVersion.Extra%-Qt-%QtVersion%-%GCCArchitecture%%RsType%%RsArchiveAdd%-%RsBuildConfig%.txt ) else ( - set RsGitLog=%DeployPath%\RetroShare-%RsVersion%-Windows-Portable-%RsDate%-%RsRevision%-Qt-%QtVersion%%RsArchiveAdd%.txt + set RsGitLog=%DeployPath%\RetroShare-%RsVersion%-Windows-Portable-%RsDate%-%RsVersion.Extra%-Qt-%QtVersion%-%GCCArchitecture%%RsType%%RsArchiveAdd%.txt ) title %SourceName%-%RsBuildConfig% [git log] diff --git a/build_scripts/Windows/build/pack.bat b/build_scripts/Windows/build/pack.bat index d52377d9f..ffd301965 100644 --- a/build_scripts/Windows/build/pack.bat +++ b/build_scripts/Windows/build/pack.bat @@ -10,21 +10,18 @@ if errorlevel 1 goto error_env call "%EnvPath%\env.bat" if errorlevel 1 goto error_env -:: Get gcc versions -call "%ToolsPath%\get-gcc-version.bat" GCCVersion -if "%GCCVersion%"=="" echo Cannot get gcc version.& exit /B 1 +:: Initialize environment +call "%~dp0env.bat" %* +if errorlevel 2 exit /B 2 +if errorlevel 1 goto error_env :: Check external libraries -if not exist "%RootPath%\libs" echo Please build external libraries first.& exit /B 1 +if not exist "%BuildLibsPath%\libs" %cecho% error "Please build external libraries first." & exit /B 1 :: Check gcc version of external libraries -if not exist "%RootPath%\libs\gcc-version" echo Cannot get gcc version of external libraries.& exit /B 1 -set /P LibsGCCVersion=<"%RootPath%\libs\gcc-version" -if "%LibsGCCVersion%" NEQ "%GCCVersion%" echo Please use correct version of external libraries. (gcc %GCCVersion% ^<^> libs %LibsGCCVersion%).& exit /B 1 - -:: Initialize environment -call "%~dp0env.bat" -if errorlevel 1 goto error_env +if not exist "%BuildLibsPath%\libs\gcc-version" %cecho% error "Cannot get gcc version of external libraries." & exit /B 1 +set /P LibsGCCVersion=<"%BuildLibsPath%\libs\gcc-version" +if "%LibsGCCVersion%" NEQ "%GCCVersion%" %cecho% error "Please use correct version of external libraries. (gcc %GCCVersion% ^<^> libs %LibsGCCVersion%)." & exit /B 1 :: Remove deploy path if exist "%RsDeployPath%" rmdir /S /Q "%RsDeployPath%" @@ -32,38 +29,31 @@ if exist "%RsDeployPath%" rmdir /S /Q "%RsDeployPath%" :: Check compilation if not exist "%RsBuildPath%\Makefile" echo Project is not compiled.& goto error -:: Get compiled revision -set GetRsVersion=%SourcePath%\build_scripts\Windows\tools\get-rs-version.bat -if not exist "%GetRsVersion%" ( - echo File not found - echo %GetRsVersion% - goto error -) - -call "%GetRsVersion%" RS_REVISION_STRING RsRevision -if "%RsRevision%"=="" echo Revision not found.& goto error - :: Get compiled version -call "%GetRsVersion%" RS_MAJOR_VERSION RsMajorVersion -if "%RsMajorVersion%"=="" echo Major version not found.& goto error +call "%ToolsPath%\get-rs-version.bat" "%RsBuildPath%\retroshare-gui\src\%RsBuildConfig%\retroshare.exe" RsVersion +if errorlevel 1 %cecho% error "Version not found."& goto error -call "%GetRsVersion%" RS_MINOR_VERSION RsMinorVersion -if "%RsMinorVersion%"=="" echo Minor version not found.& goto error +if "%RsVersion.Major%"=="" %cecho% error "Major version not found."& goto error +if "%RsVersion.Minor%"=="" %cecho% error "Minor version not found."& goto error +if "%RsVersion.Mini%"=="" %cecho% error "Mini number not found".& goto error +if "%RsVersion.Extra%"=="" %cecho% error "Extra number not found".& goto error -call "%GetRsVersion%" RS_BUILD_NUMBER RsBuildNumber -if "%RsBuildNumber%"=="" echo Build number not found.& goto error +set RsVersion=%RsVersion.Major%.%RsVersion.Minor%.%RsVersion.Mini% -call "%GetRsVersion%" RS_BUILD_NUMBER_ADD RsBuildNumberAdd +:: Get date +call "%ToolsPath%\get-rs-date.bat" "%SourcePath%" RsDate +if errorlevel 1 %cecho% error "Could not get date."& goto error -set RsVersion=%RsMajorVersion%.%RsMinorVersion%.%RsBuildNumber%%RsBuildNumberAdd% +if "%RsDate%"=="" %cecho% error "Could not get date."& goto error -:: Check WMIC is available -wmic.exe alias /? >nul 2>&1 || echo WMIC is not available.&& goto error - -:: Use WMIC to retrieve date in format YYYYMMDD -set RsDate= -for /f "tokens=2 delims==" %%I in ('wmic os get localdatetime /format:list') do set RsDate=%%I -set RsDate=%RsDate:~0,4%%RsDate:~4,2%%RsDate:~6,2% +rem Tor +if "%ParamTor%"=="1" ( + :: Check for tor executable + if not exist "%EnvTorPath%\Tor\tor.exe" ( + %cecho% error "Tor binary not found. Please download Tor Expert Bundle from\nhttps://www.torproject.org/download/download.html.en\nand unpack to\n%EnvTorPath:\=\\%" + goto error + ) +) set QtMainVersion=%QtVersion:~0,1% @@ -75,9 +65,9 @@ if "%QtMainVersion%"=="4" set QtMainVersion2=4 if "%QtMainVersion%"=="5" set QtMainVersion1=5 if "%RsBuildConfig%" NEQ "release" ( - set Archive=%RsPackPath%\RetroShare-%RsVersion%-Windows-Portable-%RsDate%-%RsRevision%-Qt-%QtVersion%%RsArchiveAdd%-%RsBuildConfig%.7z + set Archive=%RsPackPath%\RetroShare-%RsVersion%-Windows-Portable-%RsDate%-%RsVersion.Extra%-Qt-%QtVersion%-%GCCArchitecture%%RsType%%RsArchiveAdd%-%RsBuildConfig%.7z ) else ( - set Archive=%RsPackPath%\RetroShare-%RsVersion%-Windows-Portable-%RsDate%-%RsRevision%-Qt-%QtVersion%%RsArchiveAdd%.7z + set Archive=%RsPackPath%\RetroShare-%RsVersion%-Windows-Portable-%RsDate%-%RsVersion.Extra%-Qt-%QtVersion%-%GCCArchitecture%%RsType%%RsArchiveAdd%.7z ) if exist "%Archive%" del /Q "%Archive%" @@ -85,12 +75,12 @@ if exist "%Archive%" del /Q "%Archive%" :: Create deploy path mkdir "%RsDeployPath%" -title Pack - %SourceName%-%RsBuildConfig% [copy files] +title Pack - %SourceName%%RsType%-%RsBuildConfig% [copy files] set ExtensionsFile=%SourcePath%\libretroshare\src\rsserver\rsinit.cc set Extensions= for /f %%e in ('type "%ExtensionsFile%" ^| "%EnvSedExe%" -n "s/^.*\/\(extensions[^/]*\)\/.*$/\1/p" ^| "%EnvSedExe%" -n "1,1p"') do set Extensions=%%e -if "%Extensions%"=="" echo Folder for extensions not found in %ExtensionsFile%& goto error +if "%Extensions%"=="" %cecho% error "Folder for extensions not found in %ExtensionsFile%"& goto error :: Copy files mkdir "%RsDeployPath%\Data\%Extensions%" @@ -99,12 +89,14 @@ mkdir "%RsDeployPath%\qss" mkdir "%RsDeployPath%\stylesheets" mkdir "%RsDeployPath%\sounds" mkdir "%RsDeployPath%\translations" +mkdir "%RsDeployPath%\license" copy nul "%RsDeployPath%\portable" %Quite% echo copy binaries -copy "%RsBuildPath%\retroshare-gui\src\%RsBuildConfig%\RetroShare*.exe" "%RsDeployPath%" %Quite% -copy "%RsBuildPath%\retroshare-nogui\src\%RsBuildConfig%\retroshare*-nogui.exe" "%RsDeployPath%" %Quite% +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% echo copy extensions for /D %%D in ("%RsBuildPath%\plugins\*") do ( @@ -113,10 +105,11 @@ for /D %%D in ("%RsBuildPath%\plugins\*") do ( ) echo copy external binaries -copy "%RootPath%\libs\bin\*.dll" "%RsDeployPath%" %Quite% +copy "%BuildLibsPath%\libs\bin\*.dll" "%RsDeployPath%" %Quite% echo copy dependencies call :copy_dependencies "%RsDeployPath%\retroshare.exe" "%RsDeployPath%" +if exist "%RsDeployPath%\retroshare.dll" call :copy_dependencies "%RsDeployPath%\retroshare.dll" "%RsDeployPath%" echo copy Qt DLL's copy "%QtPath%\Qt%QtMainVersion1%Svg%QtMainVersion2%.dll" "%RsDeployPath%" %Quite% @@ -128,6 +121,12 @@ if "%QtMainVersion%"=="5" ( copy "%QtPath%\..\plugins\audio\qtaudio_windows.dll" "%RsDeployPath%\audio" %Quite% ) +if exist "%QtPath%\..\plugins\styles\qwindowsvistastyle.dll" ( + echo Copy styles + mkdir "%RsDeployPath%\styles" %Quite% + copy "%QtPath%\..\plugins\styles\qwindowsvistastyle.dll" "%RsDeployPath%\styles" %Quite% +) + copy "%QtPath%\..\plugins\imageformats\*.dll" "%RsDeployPath%\imageformats" %Quite% del /Q "%RsDeployPath%\imageformats\*d?.dll" %Quite% @@ -143,13 +142,15 @@ rmdir /S /Q "%RsDeployPath%\stylesheets\__MACOSX__Bubble" %Quite% echo copy sounds xcopy /S "%SourcePath%\retroshare-gui\src\sounds" "%RsDeployPath%\sounds" %Quite% +echo copy license +xcopy /S "%SourcePath%\retroshare-gui\src\license" "%RsDeployPath%\license" %Quite% + echo copy translation copy "%SourcePath%\retroshare-gui\src\translations\qt_tr.qm" "%RsDeployPath%\translations" %Quite% copy "%QtPath%\..\translations\qt_*.qm" "%RsDeployPath%\translations" %Quite% if "%QtMainVersion%"=="5" ( copy "%QtPath%\..\translations\qtbase_*.qm" "%RsDeployPath%\translations" %Quite% copy "%QtPath%\..\translations\qtscript_*.qm" "%RsDeployPath%\translations" %Quite% - copy "%QtPath%\..\translations\qtquick1_*.qm" "%RsDeployPath%\translations" %Quite% copy "%QtPath%\..\translations\qtmultimedia_*.qm" "%RsDeployPath%\translations" %Quite% copy "%QtPath%\..\translations\qtxmlpatterns_*.qm" "%RsDeployPath%\translations" %Quite% ) @@ -158,7 +159,7 @@ echo copy bdboot.txt copy "%SourcePath%\libbitdht\src\bitdht\bdboot.txt" "%RsDeployPath%" %Quite% echo copy changelog.txt -copy "%SourcePath%\retroshare-gui\src\changelog.txt" "%RsDeployPath%" %Quite% +copy "%RsBuildPath%\changelog.txt" "%RsDeployPath%" %Quite% if exist "%SourcePath%\libresapi\src\webui" ( echo copy webui @@ -166,8 +167,13 @@ if exist "%SourcePath%\libresapi\src\webui" ( xcopy /S "%SourcePath%\libresapi\src\webui" "%RsDeployPath%\webui" %Quite% ) +if "%ParamTor%"=="1" ( + echo copy tor + echo n | copy /-y "%EnvTorPath%\Tor\*.*" "%RsDeployPath%" %Quite% +) + rem pack files -title Pack - %SourceName%-%RsBuildConfig% [pack files] +title Pack - %SourceName%%RsType%-%RsBuildConfig% [pack files] "%EnvSevenZipExe%" a -mx=9 -t7z "%Archive%" "%RsDeployPath%\*" @@ -192,19 +198,25 @@ endlocal exit /B 1 :copy_extension -if exist "%~1\%RsBuildConfig%\%~n1.dll" ( - copy "%~1\%RsBuildConfig%\%~n1.dll" %2 %Quite% +if exist "%~1\lib\%~n1.dll" ( + copy "%~1\lib\%~n1.dll" %2 %Quite% ) goto :EOF :copy_dependencies +set CopyDependenciesCopiedSomething=0 for /F "usebackq" %%A in (`%ToolsPath%\depends.bat list %1`) do ( - if exist "%QtPath%\%%A" ( - copy "%QtPath%\%%A" %2 %Quite% - ) else ( - if exist "%MinGWPath%\%%A" ( - copy "%MinGWPath%\%%A" %2 %Quite% + if not exist "%~2\%%A" ( + if exist "%QtPath%\%%A" ( + set CopyDependenciesCopiedSomething=1 + copy "%QtPath%\%%A" %2 %Quite% + ) else ( + if exist "%MinGWPath%\%%A" ( + set CopyDependenciesCopiedSomething=1 + copy "%MinGWPath%\%%A" %2 %Quite% + ) ) ) ) +if "%CopyDependenciesCopiedSomething%"=="1" goto copy_dependencies goto :EOF diff --git a/build_scripts/Windows/compilingForWindows.txt b/build_scripts/Windows/compilingForWindows.txt deleted file mode 100644 index 963f24107..000000000 --- a/build_scripts/Windows/compilingForWindows.txt +++ /dev/null @@ -1,224 +0,0 @@ - -Compling for Windows. ------------------------------------ -For Version V0.5.0+ we are switching to GPGme libraries. -This documents a clean compilation of V0.5 for Windows. - -Tested on: WinXP July 2009. - -You will need: - * Qt4.5 Development Libraries (from TrollTech) - * MinGw/MinSys full installation (from sourceforge.net) - * Cygwin (for OpenSSL compilation / SVN / Unix Tools) - * OpenSSL standard libraries. - * GPG Windows Install (includes gpg.exe) - * MiniUpnp library - * gpgme Library. - * libgpg-error Library. - - -This compilation is a little tricky as different environments -are needed to compile different libraries. -a) Cygwin: libssl.a libcrypto.a -b) MinGW/MSYS: libgpg-error, libgpgme.a, libretroshare.a, libminiupnp.a -c) Qt/MinGW: Retroshare.exe - - -/***************** Installation of Development Tools **************/ -In this section we install: cygwin, mingw/msys and Qt4.5 - -1) Install Cygwin - a) download the installer and run. - b) be sure to select from the development packages: - * mingw - * svn - * gcc/gdb - * make - links: - http://www.cygwin.org/ - -2) install the MinGW/Msys package. - a) Download MinGW-5.1.4 installer and run. - b) Download MSYS-1.0.11 installer and run. - - links: - http://downloads.sourceforge.net/mingw/MinGW-5.1.4.exe - http://downloads.sourceforge.net/mingw/MSYS-1.0.11.exe - http://www.mingw.org/ - http://sourceforge.net/projects/mingw/files/ - -3) Install Qt4.5 LGPL Version. (Qt SDK 2009.03) - a) Download from website and run. - b) Select all options (including MinGW) - - links: - http://www.qtsoftware.com/downloads - -/***************** Installation of Development Tools **************/ -/******************* Compiling Support Libraries ******************/ - -1) Compile OpenSSL using Cygwin. - a) launch cygwin xterm - b) untar openssl source package. - c) Configure mingw - d) make. - -2) Compile gpg-error - a) Download from gpg - b) load up MinGW/MSYS Bash shell. - c) extract code. - d) configure - e) make - f) make install - - The library will end up in /local/lib - -3) Compile gpgme - a) Download from gpg - b) load up MinGW/MSYS Bash shell. - c) extract code. - d) configure - e) make - f) make install - - The library will end up in /local/lib - - -4) Compile MiniUPnP. - up to release v1.3 now. - links: - http://miniupnp.free.fr/ - http://miniupnp.free.fr/files/ - -5) Install pthreads - - links: - http://sourceware.org/pthreads-win32/ - ftp://sourceware.org/pub/pthreads-win32/pthreads-w32-2-8-0-release.exe - -/******************* Compiling Support Libraries ******************/ -/*********************** Compiling Retroshare *********************/ - -1) Setup Source Code TAR (TODO: Update for windows). - This is useful as it provides a standard structure to work against, - we will update this with the required support libraries soon. - - a) Open MSYS Bash shell, and change to this location. - c:/msys/1.0/home/XXX/retroshare - b) create a working directory under this. - 1) c:/msys/1.0/home/XXX/miniupnpc-1.3 - 2) c:/msys/1.0/home/XXX/pthreads-w32-2-8-0-release - 3) c:/msys/1.0/home/XXX/zlib-1.2.3 - 4) c:/msys/1.0/home/XXX/gpgme-1.1.8 - 5) c:/msys/1.0/home/XXX/libgpg-error-1.7 - c) Install OpenSSL to this directory (get from http://www.slproweb.com/download/Win32OpenSSL-0_9_8k.exe) - 1) c:/msys/1.0/home/XXX/OpenSSL - d) get the latest svn trunk and unzip to (get from http://retroshare.svn.sourceforge.net/viewvc/retroshare/trunk.tar.gz) . - 1) c:/msys/1.0/home/XXX/retroshare - -2) Compile libretroshare - a) change to the libretroshare directory. - 1) cd c:/msys/1.0/home/XXX/retroshare/libretroshare/src - b) modify support directory paths to point at correct locations. - 1) open scripts/config.mk and enable OS = Win # MinGw. - 2) open scripts/config-mingw.mk - 3) disable lines (line 20-29) - 4) enable lines 34-42 and 118-119 - #### Enable this section for compiling with MSYS/MINGW compile - SRC_ROOT=/home/linux - - SSL_DIR=$(SRC_ROOT)/OpenSSL - GPGME_DIR=$(SRC_ROOT)/gpgme-1.1.8 - GPG_ERROR_DIR=$(SRC_ROOT)/libgpg-error-1.7 - - ZLIB_DIR=$(SRC_ROOT)/zlib-1.2.3 - UPNPC_DIR=$(SRC_ROOT)/miniupnpc-1.0 - PTHREADS_DIR=$(SRC_ROOT)/pthreads-w32-2-8-0-release - - ### Enable this for GPGME and GPG ERROR dirs - CFLAGS += -I$(GPGME_DIR)/src - CFLAGS += -I$(GPG_ERROR_DIR)/src - 5) Edit your SRC_ROOT to your /home/xxxx dir - - - c) compile libretroshare - 1) make - -3) Copy all the required support libraries into the library directory: - c:/msys/1.0/home/XXX/lib - - This should include: - - gpg-error / gpgme libraries: - libgpg-error.a - libgpg-error.dll.a - libgpg-error.la - libgpgme.dll.a - libgpgme.la - - openssl libraries: - libcrypto.a - libssl.a - - miniupnpc / pthreads / libz - - libminiupnpc.a - miniupnpc.dll - libpthreadGCE2.a - pthreadGCE2.dll - libz.a - - extra library from cygwin. (renamed from libcrypt32.a) - libcrypt32-cygwin.a - - libretroshare - libretroshare.a - - -4) Compile GUI. - -/*********************** Compiling Retroshare *********************/ -/************************ Running Retroshare **********************/ - -1) Collect Relevant DLL's with Application. - a) make retroshare application directory. - b) copy Retroshare.exe executable into directory. - c) Copy required DLL's into that directory. - These include: - - mingw runtime: - mingwm10.dll - - gpgme/gpg-error: - libgpg-error-0.dll - libgpgme-11.dll - - other support libraries: - miniupnpc.dll - pthreadGCE2.dll - - Qt DLLs: - QtCore4.dll, - QtGui4.dll,... - etc. - - d) You should be able to run Retroshare from this directory now! - -2) Install gpg4win package... for gpg.exe - -3) Create an OpenGPG identity using gpa or Enigmail or other PGP tool. - -4) You should be able to use Retroshare on your PC now. - -/************************ Running Retroshare **********************/ -/******************************** FAQs ****************************/ -Ask and it might be answered! -/******************************** FAQs ****************************/ - -This is obviously a work in progress - -drBob. - - - - - diff --git a/build_scripts/Windows/env/env-msys.bat b/build_scripts/Windows/env/env-msys.bat deleted file mode 100644 index cc92f7495..000000000 --- a/build_scripts/Windows/env/env-msys.bat +++ /dev/null @@ -1,22 +0,0 @@ -:: Usage: -:: call env-msys.bat [reinstall|clean] - -:: Initialize environment -call "%~dp0env.bat" -if errorlevel 1 goto error_env - -set EnvMSYSPath=%EnvRootPath%\msys - -call "%~dp0tools\prepare-msys.bat" %1 -if errorlevel 1 exit /B %ERRORLEVEL% - -set EnvMSYSSH=%EnvMSYSPath%\msys\1.0\bin\sh.exe -if not exist "%EnvMSYSSH%" if errorlevel 1 goto error_env - -set EnvMSYSCmd="%EnvMSYSSH%" --login -i -c - -exit /B 0 - -:error_env -echo Failed to initialize environment. -exit /B 1 diff --git a/build_scripts/Windows/env/env-msys2.bat b/build_scripts/Windows/env/env-msys2.bat new file mode 100644 index 000000000..b99ede679 --- /dev/null +++ b/build_scripts/Windows/env/env-msys2.bat @@ -0,0 +1,39 @@ +:: Usage: +:: call env-msys2.bat [reinstall|clean] + +:: Initialize environment +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 +if "%GCCArchitecture%"=="" %cecho% error "Cannot get gcc architecture." & exit /B 1 + +rem IF DEFINED ProgramFiles(x86) ( +if "%GCCArchitecture%"=="x64" ( + :: x64 + set MSYS2Architecture=x86_64 + set MSYS2Base=64 +) else ( + :: x86 + set MSYS2Architecture=i686 + set MSYS2Base=32 +) + +set EnvMSYS2Path=%EnvRootPath%\msys2 + +call "%~dp0tools\prepare-msys2.bat" %1 +if errorlevel 1 exit /B %ERRORLEVEL% + +set EnvMSYS2SH=%EnvMSYS2Path%\msys%MSYS2Base%\usr\bin\sh.exe +if not exist "%EnvMSYS2SH%" if errorlevel 1 goto error_env + +set EnvMSYS2Cmd="%EnvMSYS2SH%" -lc + +exit /B 0 + +:error_env +echo Failed to initialize environment. +exit /B 1 diff --git a/build_scripts/Windows/env/env-qt.bat b/build_scripts/Windows/env/env-qt.bat deleted file mode 100644 index 95b633705..000000000 --- a/build_scripts/Windows/env/env-qt.bat +++ /dev/null @@ -1,23 +0,0 @@ -:: Usage: -:: call env-qt4.bat version [reinstall|clean] - -:: Initialize environment -call "%~dp0env.bat" -if errorlevel 1 goto error_env - -set EnvQtBasePath=%EnvRootPath%\qt - -:: Create folders -if not exist "%EnvQtBasePath%" mkdir "%EnvQtBasePath%" - -call "%~dp0tools\prepare-qt.bat" %1 %2 -if errorlevel 1 exit /B %ERRORLEVEL% - -if "%MinGWDir%" NEQ "" set PATH=%MinGWDir%\bin;%PATH% -if "%QtDir%" NEQ "" set PATH=%QtDir%\bin;%PATH% - -exit /B 0 - -:error_env -echo Failed to initialize environment. -exit /B 1 diff --git a/build_scripts/Windows/env/env.bat b/build_scripts/Windows/env/env.bat index a243256fc..bc95045b0 100644 --- a/build_scripts/Windows/env/env.bat +++ b/build_scripts/Windows/env/env.bat @@ -6,11 +6,9 @@ set EnvRootPath=%RootPath%\%SourceName%-env set EnvToolsPath=%EnvRootPath%\tools set EnvTempPath=%EnvRootPath%\tmp set EnvDownloadPath=%EnvRootPath%\download +set EnvTorPath=%EnvDownloadPath%\tor -::set EnvCurlExe=%EnvToolsPath%\curl.exe -set EnvWgetExe=%EnvToolsPath%\wget.exe set EnvSevenZipExe=%EnvToolsPath%\7z.exe -set EnvJomExe=%EnvToolsPath%\jom.exe set EnvSedExe=%EnvToolsPath%\sed.exe set EnvCutExe=%EnvToolsPath%\cut.exe set EnvDependsExe=%EnvToolsPath%\depends.exe @@ -24,7 +22,13 @@ if not exist "%EnvToolsPath%" mkdir "%EnvToolsPath%" if not exist "%EnvDownloadPath%" mkdir "%EnvDownloadPath%" call "%~dp0tools\prepare-tools.bat" -exit /B %ERRORLEVEL% +if errorlevel 1 exit /B %ERRORLEVEL% + +:: Add MinGit to PATH +set PATH=%EnvToolsPath%\MinGit\cmd;%EnvToolsPath%\cmake\bin;%PATH% +set HOME=%EnvToolsPath%\MinGit\home + +exit /B 0 :error_env echo Failed to initialize environment. diff --git a/build_scripts/Windows/env/tools/prepare-msys.bat b/build_scripts/Windows/env/tools/prepare-msys.bat deleted file mode 100644 index af9b9bf78..000000000 --- a/build_scripts/Windows/env/tools/prepare-msys.bat +++ /dev/null @@ -1,80 +0,0 @@ -:: Usage: -:: call prepare-msys.bat [reinstall|clean] - -setlocal enabledelayedexpansion - -if "%EnvMSYSPath%"=="" exit /B 1 -if not exist "%EnvRootPath%"=="" exit /B 1 - -copy "%~dp0root\update-msys.bat" "%EnvRootPath%" >nul - -if "%~1"=="clean" ( - %cecho% info "Clean MSYS" - call "%ToolsPath%\remove-dir.bat" "%EnvMSYSPath%" - goto exit -) - -if exist "%EnvMSYSPath%\bin\mingw-get.exe" ( - if "%~1"=="reinstall" ( - choice /M "Found existing MSYS version. Do you want to proceed?" - if !ERRORLEVEL!==2 goto exit - ) else ( - goto exit - ) -) - -set MSYSInstall=mingw-get-0.6.2-mingw32-beta-20131004-1-bin.zip -set MSYSUrl=http://sourceforge.net/projects/mingw/files/Installer/mingw-get/mingw-get-0.6.2-beta-20131004-1/%MSYSInstall%/download -set CMakeInstall=cmake-3.1.0-win32-x86.zip -set CMakeUrl=http://www.cmake.org/files/v3.1/%CMakeInstall% -set CMakeUnpackPath=%EnvMSYSPath%\msys\1.0 - -%cecho% info "Remove previous MSYS version" -call "%ToolsPath%\remove-dir.bat" "%EnvMSYSPath%" - -%cecho% info "Download installation files" -if not exist "%EnvDownloadPath%\%MSYSInstall%" call "%ToolsPath%\download-file.bat" "%MSYSUrl%" "%EnvDownloadPath%\%MSYSInstall%" -if not exist "%EnvDownloadPath%\%MSYSInstall%" %cecho% error "Cannot download MSYS" & goto error - -if not exist "%EnvDownloadPath%\%CMakeInstall%" call "%ToolsPath%\download-file.bat" "%CMakeUrl%" "%EnvDownloadPath%\%CMakeInstall%" -if not exist "%EnvDownloadPath%\%CMakeInstall%" %cecho% error "Cannot download CMake" & goto error - -%cecho% info "Unpack MSYS" -"%EnvSevenZipExe%" x -o"%EnvMSYSPath%" "%EnvDownloadPath%\%MSYSInstall%" - -%cecho% info "Install MSYS" -if not exist "%EnvMSYSPath%\var\lib\mingw-get\data\profile.xml" copy "%EnvMSYSPath%\var\lib\mingw-get\data\defaults.xml" "%EnvMSYSPath%\var\lib\mingw-get\data\profile.xml" -pushd "%EnvMSYSPath%\bin" -mingw-get.exe install mingw32-mingw-get -mingw-get.exe install msys-coreutils -mingw-get.exe install msys-base -mingw-get.exe install msys-autoconf -mingw-get.exe install msys-automake -mingw-get.exe install msys-autogen -mingw-get.exe install msys-mktemp -mingw-get.exe install msys-wget -popd - -%cecho% info "Unpack CMake" -"%EnvSevenZipExe%" x -o"%CMakeUnpackPath%" "%EnvDownloadPath%\%CMakeInstall%" - -%cecho% info "Install CMake" -set CMakeVersion= -for /D %%F in (%CMakeUnpackPath%\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%" "%EnvMSYSPath%\msys\1.0\etc\profile"') do set FoundProfile=%%F - -if "%FoundProfile%"=="0" ( - echo export PATH="${PATH}:/%CMakeVersion%/bin">>"%EnvMSYSPath%\msys\1.0\etc\profile" -) - -:exit -endlocal -exit /B 0 - -:error -endlocal -exit /B 1 diff --git a/build_scripts/Windows/env/tools/prepare-msys2.bat b/build_scripts/Windows/env/tools/prepare-msys2.bat new file mode 100644 index 000000000..80d17521f --- /dev/null +++ b/build_scripts/Windows/env/tools/prepare-msys2.bat @@ -0,0 +1,85 @@ +:: Usage: +:: call prepare-msys2.bat [reinstall|clean] + +setlocal enabledelayedexpansion + +if "%EnvMSYS2Path%"=="" exit /B 1 +if "%MSYS2Architecture%"=="" exit /B 1 +if "%MSYS2Base%"=="" exit /B 1 +if not exist "%EnvRootPath%"=="" exit /B 1 + +copy "%~dp0root\update-msys2.bat" "%EnvRootPath%" >nul + +if "%~1"=="clean" ( + %cecho% info "Clean MSYS2" + call "%ToolsPath%\remove-dir.bat" "%EnvMSYS2Path%" + goto exit +) + +if exist "%EnvMSYS2Path%\msys%MSYS2Base%\usr\bin\pacman.exe" ( + if "%~1"=="reinstall" ( + choice /M "Found existing MSYS2 version. Do you want to proceed?" + if !ERRORLEVEL!==2 goto exit + ) else ( + goto exit + ) +) + +set MSYS2Install=msys2-base-%MSYS2Architecture%-20190524.tar.xz +set MSYS2Url=http://sourceforge.net/projects/msys2/files/Base/%MSYS2Architecture%/%MSYS2Install%/download +set CMakeInstall=cmake-3.1.0-win32-x86.zip +set CMakeUrl=http://www.cmake.org/files/v3.1/%CMakeInstall% +set CMakeUnpackPath=%EnvMSYS2Path%\msys%MSYS2Base% + +if exist "%EnvMSYS2Path%\msys%MSYS2Base%" ( + %cecho% info "Remove previous MSYS2 version" + call "%ToolsPath%\remove-dir.bat" "%EnvMSYS2Path%\msys%MSYS2Base%" +) + +%cecho% info "Download 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 + +if not exist "%EnvDownloadPath%\%CMakeInstall%" call "%ToolsPath%\download-file.bat" "%CMakeUrl%" "%EnvDownloadPath%\%CMakeInstall%" +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%" + +%cecho% info "Unpack CMake" +"%EnvSevenZipExe%" x -o"%CMakeUnpackPath%" "%EnvDownloadPath%\%CMakeInstall%" + +%cecho% info "Install CMake" +set CMakeVersion= +for /D %%F in (%CMakeUnpackPath%\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 + +if "%FoundProfile%"=="0" ( + echo export PATH="${PATH}:/%CMakeVersion%/bin">>"%EnvMSYS2Path%\msys%MSYS2Base%\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" + +%cecho% info "Initialize MSYS2" +"%MSYS2SH%" -lc "pacman -Sy" +"%MSYS2SH%" -lc "pacman --noconfirm --needed -S bash pacman pacman-mirrors msys2-runtime" + +call "%EnvMSYS2Path%\msys%MSYS2Base%\autorebase.bat" +call "%EnvRootPath%\update-msys2.bat" +call "%EnvRootPath%\update-msys2.bat" + +:exit +endlocal +exit /B 0 + +:error +endlocal +exit /B 1 diff --git a/build_scripts/Windows/env/tools/prepare-qt.bat b/build_scripts/Windows/env/tools/prepare-qt.bat deleted file mode 100644 index 31c938f77..000000000 --- a/build_scripts/Windows/env/tools/prepare-qt.bat +++ /dev/null @@ -1,204 +0,0 @@ -:: Usage: -:: call prepare-qt.bat version [reinstall|clean] - -setlocal enabledelayedexpansion - -if "%EnvQtBasePath%"=="" exit /B 1 -if not exist "%EnvRootPath%"=="" exit /B 1 - -set EnvQtVersion=%~1 -if "%EnvQtVersion%"=="" ( - %cecho% error "Please specify Qt version" - goto error -) - -for /f "tokens=1,2 delims=." %%A in ("%EnvQtVersion%") do set EnvQtMainVersion=%%A& set EnvQtBaseVersion=%%A.%%B -set EnvQtPath=%EnvQtBasePath%\%EnvQtVersion% - -if "%~2"=="clean" ( - %cecho% info "Clean Qt %EnvQtVersion%" - call "%ToolsPath%\remove-dir.bat" "%EnvQtPath%" - goto exit -) - -set CheckQmakeExe= -if "%EnvQtMainVersion%"=="4" ( - set CheckQmakeExe=%EnvQtPath%\Qt\bin\qmake.exe -) else ( - if "%EnvQtMainVersion%" GEQ "5" ( - call :get_mingw_version EnvQtMinGWVersion "%EnvQtPath%\%EnvQtBaseVersion%" - if "!EnvQtMinGWVersion!" NEQ "" ( - set CheckQmakeExe=%EnvQtPath%\%EnvQtBaseVersion%\!EnvQtMinGWVersion!\bin\qmake.exe - ) - ) -) - -if "%CheckQmakeExe%" NEQ "" ( - if exist "%CheckQmakeExe%" ( - if "%~2"=="reinstall" ( - choice /M "Found existing Qt %EnvQtVersion% version. Do you want to proceed?" - if !ERRORLEVEL!==2 goto exit - ) else ( - goto exit - ) - ) -) - -set QtInstall=qt-opensource-windows-x86-mingw-%EnvQtVersion%.exe -set QtInstallWildcard=qt-opensource-windows-x86-mingw*-%EnvQtVersion%.exe -set QtUrl=http://download.qt.io/official_releases/qt/%EnvQtBaseVersion%/%EnvQtVersion% - -%cecho% info "Remove previous Qt %EnvQtVersion% version" -call "%ToolsPath%\remove-dir.bat" "%EnvQtPath%" - -%cecho% info "Download Qt installation files" -if not exist "%EnvDownloadPath%\%QtInstall%" ( - call "%ToolsPath%\download-file-wildcard.bat" "%QtUrl%" "%QtInstallWildcard%" "%EnvDownloadPath%" QtInstallDownload - if "!QtInstallDownload!"=="" %cecho% error "Cannot download Qt %EnvQtVersion%" & goto error - ren "%EnvDownloadPath%\!QtInstallDownload!" "%QtInstall%" -) -if not exist "%EnvDownloadPath%\%QtInstall%" %cecho% error "Cannot download Qt %EnvQtVersion%" & goto error - -mkdir "%EnvQtPath%" - -if "%EnvQtMainVersion%"=="4" ( - rem Qt 4 - goto install_qt4 -) -if "%EnvQtMainVersion%" GEQ "5" ( - rem Qt >= 5 - goto install_qt5 -) - -%cecho% error "Unknown Qt version %EnvQtVersion%" - -:error -endlocal & set QtDir=& set MinGWDir= -exit /B 1 - -:exit -set QtDir= -set MinGWDir= - -if "%EnvQtMainVersion%"=="4" ( - rem Qt 4 - set QtDir=%EnvQtBasePath%\%EnvQtVersion%\Qt - set MinGWDir=%EnvQtBasePath%\%EnvQtVersion%\mingw32 -) else ( - if "%EnvQtMainVersion%" GEQ "5" ( - call :get_mingw_version EnvQtToolsMinGWVersion "%EnvQtPath%\Tools" - - set QtDir=%EnvQtPath%\%EnvQtBaseVersion%\!EnvQtMinGWVersion! - set MinGWDir=%EnvQtPath%\Tools\!EnvQtToolsMinGWVersion! - ) -) - -endlocal & set QtDir=%QtDir%& set MinGWDir=%MinGWDir% -exit /B 0 - -:get_mingw_version -setlocal enabledelayedexpansion -set Variable=%~1 -set Result= - -for /D %%A in (%~2\*) do set Name=%%~nA& if "!Name:~0,5!"=="mingw" set Result=!Name! -endlocal & set %Variable%=%Result% -goto :EOF - -:replace -set InFile=%~1 -set InFileName=%~nx1 -set OutFile=%~1.tmp -set SearchText=%~2 -set ReplaceText=%~3 - -if exist "%OutFile%" del /Q "%OutFile%" - -for /f "tokens=1* delims=]" %%A in ('find /n /v ""^<%InFile%') do ( - set string=%%B - - if "!string!"=="" ( - echo.>>%OutFile% - ) else ( - set modified=!string:%SearchText%=%ReplaceText%! - echo !modified!>> %OutFile% - ) -) -del "%InFile%" -rename "%OutFile%" "%InFileName%" -goto :EOF - -:install_qt4 -set MinGWInstall=i686-4.8.2-release-posix-dwarf-rt_v3-rev3.7z -set MinGWUrl=http://sourceforge.net/projects/mingw-w64/files/Toolchains targetting Win32/Personal Builds/mingw-builds/4.8.2/threads-posix/dwarf/%MinGWInstall%/download - -%cecho% info "Download MinGW installation files" -if not exist "%EnvDownloadPath%\%MinGWInstall%" call "%ToolsPath%\download-file.bat" "%MinGWUrl%" "%EnvDownloadPath%\%MinGWInstall%" -if not exist "%EnvDownloadPath%\%MinGWInstall%" %cecho% error "Cannot download MinGW" & goto error - -%cecho% info "Unpack Qt %EnvQtVersion%" -call "%ToolsPath%\remove-dir.bat" "%EnvTempPath%" -mkdir "%EnvTempPath%" -"%EnvSevenZipExe%" x -o"%EnvTempPath%" "%EnvDownloadPath%\%QtInstall%" $_14_ -move "%EnvTempPath%\$_14_" "%EnvQtPath%\Qt" -call "%ToolsPath%\remove-dir.bat" "%EnvTempPath%" - -%cecho% info "Unpack MinGW" -"%EnvSevenZipExe%" x -o"%EnvQtPath%" "%EnvDownloadPath%\%MinGWInstall%" - -echo Prepare Qt %EnvQtVersion% -echo [Paths]>"%EnvQtPath%\Qt\bin\qt.conf" -echo Prefix=..>>"%EnvQtPath%\Qt\bin\qt.conf" - -goto exit - -:install_qt5 -set EnvQtInstallerFrameworkVersion=2.0.3 - -set QtInstallerFrameworkInstall=QtInstallerFramework-%EnvQtInstallerFrameworkVersion%-win-x86.exe -set QtInstallerFrameworkUrl=http://download.qt.io/official_releases/qt-installer-framework/%EnvQtInstallerFrameworkVersion%/QtInstallerFramework-win-x86.exe - -%cecho% info "Download QtInstallerFramework installation files" -if not exist "%EnvDownloadPath%\%QtInstallerFrameworkInstall%" call "%ToolsPath%\download-file.bat" "%QtInstallerFrameworkUrl%" "%EnvDownloadPath%\%QtInstallerFrameworkInstall%" -if not exist "%EnvDownloadPath%\%QtInstallerFrameworkInstall%" %cecho% error "Cannot download Qt Installer Framework %EnvQtInstallerFrameworkVersion%" & goto error - -%cecho% info "Unpack Qt Installer Framework" -call "%ToolsPath%\remove-dir.bat" "%EnvTempPath%" -mkdir "%EnvTempPath%" -"%EnvSevenZipExe%" x -o"%EnvTempPath%" "%EnvDownloadPath%\%QtInstallerFrameworkInstall%" bin\devtool.exe -move "%EnvTempPath%\bin\devtool.exe" "%EnvQtPath%" -call "%ToolsPath%\remove-dir.bat" "%EnvTempPath%" - -%cecho% info "Unpack Qt %EnvQtVersion%" -call "%ToolsPath%\remove-dir.bat" "%EnvTempPath%" -mkdir "%EnvTempPath%" -"%EnvQtPath%\devtool.exe" "%EnvDownloadPath%\%QtInstall%" --dump "%EnvTempPath%" - -pushd "%EnvTempPath%" -del /S *vcredist*.7z -del /S *qtcreator*.7z -del /S *1installer-changelog.7z -for /R %%F in (*.7z) do "%EnvSevenZipExe%" x -y -o"%EnvQtPath%" "%%F" -popd - -call "%ToolsPath%\remove-dir.bat" "%EnvTempPath%" - -call :get_mingw_version EnvQtMinGWVersion "%EnvQtPath%\%EnvQtBaseVersion%" - -%cecho% info "Prepare Qt %EnvQtVersion%" -echo [Paths]>"%EnvQtPath%\%EnvQtBaseVersion%\%EnvQtMinGWVersion%\bin\qt.conf" -echo Documentation=../../Docs/Qt-%EnvQtBaseVersion%>>"%EnvQtPath%\%EnvQtBaseVersion%\%EnvQtMinGWVersion%\bin\qt.conf" -echo Examples=../../Examples/Qt-%EnvQtBaseVersion%>>"%EnvQtPath%\%EnvQtBaseVersion%\%EnvQtMinGWVersion%\bin\qt.conf" -echo Prefix=..>>"%EnvQtPath%\%EnvQtBaseVersion%\%EnvQtMinGWVersion%\bin\qt.conf" - -call :replace "%EnvQtPath%\%EnvQtBaseVersion%\%EnvQtMinGWVersion%\mkspecs\qconfig.pri" "Enterprise" "OpenSource" - -for /R "%EnvQtPath%\%EnvQtBaseVersion%\%EnvQtMinGWVersion%\lib" %%A in (*.pc) do ( - call :replace "%%A" "c:/Users/qt/work/install" "%EnvQtPath:\=\\%\%EnvQtBaseVersion%\\%EnvQtMinGWVersion%" - call :replace "%%A" "c:\Users\qt\work\install" "%EnvQtPath:\=/%\%EnvQtBaseVersion%/%EnvQtMinGWVersion%" -) -for /R "%EnvQtPath%\%EnvQtBaseVersion%\%EnvQtMinGWVersion%\lib" %%A in (*.prl) do ( - call :replace "%%A" "c:/Users/qt/work/install" "%EnvQtPath:\=\\%\%EnvQtBaseVersion%\\%EnvQtMinGWVersion%" - call :replace "%%A" "c:\Users\qt\work\install" "%EnvQtPath:\=/%\%EnvQtBaseVersion%/%EnvQtMinGWVersion%" -) -goto exit diff --git a/build_scripts/Windows/env/tools/prepare-tools.bat b/build_scripts/Windows/env/tools/prepare-tools.bat index 94ad1ae8b..8b48d7c32 100644 --- a/build_scripts/Windows/env/tools/prepare-tools.bat +++ b/build_scripts/Windows/env/tools/prepare-tools.bat @@ -4,21 +4,24 @@ if "%EnvRootPath%"=="" exit /B 1 set CEchoUrl=https://github.com/lordmulder/cecho/releases/download/2015-10-10/cecho.2015-10-10.zip set CEchoInstall=cecho.2015-10-10.zip -set SevenZipUrl=http://7-zip.org/a/7z1602.msi -set SevenZipInstall=7z1602.msi -::set CurlUrl=https://bintray.com/artifact/download/vszakats/generic/curl-7.50.1-win32-mingw.7z -::set CurlInstall=curl-7.50.1-win32-mingw.7z -set WgetUrl=https://eternallybored.org/misc/wget/current/wget.exe -set WgetInstall=wget.exe -set JomUrl=http://download.qt.io/official_releases/jom/jom.zip -set JomInstall=jom.zip +set SevenZipUrl=https://sourceforge.net/projects/sevenzip/files/7-Zip/19.00/7z1900.msi/download +set SevenZipInstall=7z1900.msi set DependsUrl=http://www.dependencywalker.com/depends22_x86.zip set DependsInstall=depends22_x86.zip set UnixToolsUrl=http://unxutils.sourceforge.net/UnxUpdates.zip set UnixToolsInstall=UnxUpdates.zip -set NSISUrl=http://prdownloads.sourceforge.net/nsis/nsis-3.0-setup.exe?download -set NSISInstall=nsis-3.0-setup.exe +set NSISInstall=nsis-3.05-setup.exe +set NSISUrl=http://prdownloads.sourceforge.net/nsis/%NSISInstall%?download 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.1.0-win32-x86 +set CMakeInstall=%CMakeVersion%.zip +set CMakeUrl=http://www.cmake.org/files/v3.1/%CMakeInstall% +set CMakeInstallPath=%EnvToolsPath%\cmake +set TorProjectUrl=https://www.torproject.org +set TorDownloadIndexUrl=%TorProjectUrl%/download/tor if not exist "%EnvToolsPath%\7z.exe" ( call "%ToolsPath%\remove-dir.bat" "%EnvTempPath%" @@ -26,7 +29,7 @@ if not exist "%EnvToolsPath%\7z.exe" ( echo Download 7z installation - if not exist "%EnvDownloadPath%\%SevenZipInstall%" call "%ToolsPath%\winhttpjs.bat" %SevenZipUrl% -saveTo "%EnvDownloadPath%\%SevenZipInstall%" + if not exist "%EnvDownloadPath%\%SevenZipInstall%" call "%ToolsPath%\download-file.bat" "%SevenZipUrl%" "%EnvDownloadPath%\%SevenZipInstall%" if not exist "%EnvDownloadPath%\%SevenZipInstall%" echo Cannot download 7z installation& goto error echo Unpack 7z @@ -43,7 +46,7 @@ if not exist "%EnvToolsPath%\cecho.exe" ( echo Download cecho installation - if not exist "%EnvDownloadPath%\%CEchoInstall%" call "%ToolsPath%\winhttpjs.bat" "%CEchoUrl%" -saveTo "%EnvDownloadPath%\%CEchoInstall%" + if not exist "%EnvDownloadPath%\%CEchoInstall%" call "%ToolsPath%\download-file.bat" "%CEchoUrl%" "%EnvDownloadPath%\%CEchoInstall%" if not exist "%EnvDownloadPath%\%cCEhoInstall%" echo Cannot download cecho installation& goto error echo Unpack cecho @@ -53,55 +56,13 @@ if not exist "%EnvToolsPath%\cecho.exe" ( call "%ToolsPath%\remove-dir.bat" "%EnvTempPath%" ) -::if not exist "%EnvToolsPath%\curl.exe" ( -:: call "%ToolsPath%\remove-dir.bat" "%EnvTempPath%" -:: mkdir "%EnvTempPath%" -:: -:: echo Download Curl installation -:: -:: if not exist "%EnvDownloadPath%\%CurlInstall%" call "%ToolsPath%\winhttpjs.bat" %CurlUrl% -saveTo "%EnvDownloadPath%\%CurlInstall%" -:: if not exist "%EnvDownloadPath%\%CurlInstall%" echo Cannot download Curl installation& goto error -:: -:: echo Unpack Curl -:: "%EnvSevenZipExe%" x -o"%EnvTempPath%" "%EnvDownloadPath%\%CurlInstall%" -:: copy "%EnvTempPath%\curl-7.50.1-win32-mingw\bin\curl.exe" "%EnvToolsPath%" -:: -:: call "%ToolsPath%\remove-dir.bat" "%EnvTempPath%" -::) - -if not exist "%EnvToolsPath%\wget.exe" ( - %cecho% info "Download Wget installation" - - if not exist "%EnvDownloadPath%\%WgetInstall%" call "%ToolsPath%\winhttpjs.bat" %WgetUrl% -saveTo "%EnvDownloadPath%\%WgetInstall%" - if not exist "%EnvDownloadPath%\%WgetInstall%" %cecho% error "Cannot download Wget installation" & goto error - - %cecho% info "Copy Wget" - copy "%EnvDownloadPath%\wget.exe" "%EnvToolsPath%" -) - -if not exist "%EnvToolsPath%\jom.exe" ( - call "%ToolsPath%\remove-dir.bat" "%EnvTempPath%" - mkdir "%EnvTempPath%" - - %cecho% info "Download jom installation" - - if not exist "%EnvDownloadPath%\%JomInstall%" call "%ToolsPath%\winhttpjs.bat" %JomUrl% -saveTo "%EnvDownloadPath%\%JomInstall%" - if not exist "%EnvDownloadPath%\%JomInstall%" %cecho% error "Cannot download jom installation" & goto error - - %cecho% info "Unpack jom" - "%EnvSevenZipExe%" x -o"%EnvTempPath%" "%EnvDownloadPath%\%JomInstall%" - copy "%EnvTempPath%\jom.exe" "%EnvToolsPath%" - - call "%ToolsPath%\remove-dir.bat" "%EnvTempPath%" -) - if not exist "%EnvToolsPath%\depends.exe" ( call "%ToolsPath%\remove-dir.bat" "%EnvTempPath%" mkdir "%EnvTempPath%" %cecho% info "Download Dependency Walker installation" - if not exist "%EnvDownloadPath%\%DependsInstall%" call "%ToolsPath%\winhttpjs.bat" %DependsUrl% -saveTo "%EnvDownloadPath%\%DependsInstall%" + if not exist "%EnvDownloadPath%\%DependsInstall%" call "%ToolsPath%\download-file.bat" %DependsUrl% "%EnvDownloadPath%\%DependsInstall%" if not exist "%EnvDownloadPath%\%DependsInstall%" %cecho% error "Cannot download Dependendy Walker installation" & goto error %cecho% info "Unpack Dependency Walker" @@ -117,8 +78,8 @@ if not exist "%EnvToolsPath%\cut.exe" ( %cecho% info "Download Unix Tools installation" - if not exist "%EnvDownloadPath%\%UnixToolsInstall%" call "%ToolsPath%\winhttpjs.bat" %UnixToolsUrl% -saveTo "%EnvDownloadPath%\%UnixToolsInstall%" - if not exist "%EnvDownloadPath%\%UnixToolsInstall%" %cecho% error ""Cannot download Unix Tools installation" & goto error + if not exist "%EnvDownloadPath%\%UnixToolsInstall%" call "%ToolsPath%\download-file.bat" %UnixToolsUrl% "%EnvDownloadPath%\%UnixToolsInstall%" + 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%" @@ -133,8 +94,8 @@ if not exist "%EnvToolsPath%\sed.exe" ( %cecho% info "Download Unix Tools installation" - if not exist "%EnvDownloadPath%\%UnixToolsInstall%" call "%ToolsPath%\winhttpjs.bat" %UnixToolsUrl% -saveTo "%EnvDownloadPath%\%UnixToolsInstall%" - if not exist "%EnvDownloadPath%\%UnixToolsInstall%" %cecho% error ""Cannot download Unix Tools installation" & goto error + if not exist "%EnvDownloadPath%\%UnixToolsInstall%" call "%ToolsPath%\download-file.bat" %UnixToolsUrl% "%EnvDownloadPath%\%UnixToolsInstall%" + 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%" @@ -143,8 +104,12 @@ if not exist "%EnvToolsPath%\sed.exe" ( call "%ToolsPath%\remove-dir.bat" "%EnvTempPath%" ) -if not exist "%EnvToolsPath%\NSIS\nsis.exe" ( +if not exist "%EnvDownloadPath%\%NSISInstall%" call "%ToolsPath%\remove-dir.bat" "%NSISInstallPath%" +if not exist "%NSISInstallPath%\nsis.exe" ( call "%ToolsPath%\remove-dir.bat" "%EnvTempPath%" + + if exist "%NSISInstallPath%" call "%ToolsPath%\remove-dir.bat" "%NSISInstallPath%" + mkdir "%EnvTempPath%" %cecho% info "Download NSIS installation" @@ -160,10 +125,62 @@ if not exist "%EnvToolsPath%\NSIS\nsis.exe" ( call "%ToolsPath%\remove-dir.bat" "%EnvTempPath%" ) +if not exist "%MinGitInstallPath%\cmd\git.exe" ( + %cecho% info "Download MinGit installation" + + if not exist "%EnvDownloadPath%\%MinGitInstall%" call "%ToolsPath%\download-file.bat" "%MinGitUrl%" "%EnvDownloadPath%\%MinGitInstall%" + if not exist "%EnvDownloadPath%\%MinGitInstall%" %cecho% error "Cannot download MinGit installation" & goto error + + %cecho% info "Unpack MinGit" + "%EnvSevenZipExe%" x -o"%MinGitInstallPath%" "%EnvDownloadPath%\%MinGitInstall%" +) + +if not exist "%EnvDownloadPath%\%CMakeInstall%" call "%ToolsPath%\remove-dir.bat" "%CMakeInstallPath%" +if not exist "%CMakeInstallPath%\bin\cmake.exe" ( + %cecho% info "Download CMake installation" + + if exist "%CMakeInstallPath%" call "%ToolsPath%\remove-dir.bat" "%CMakeInstallPath%" + + mkdir "%EnvTempPath%" + + if not exist "%EnvDownloadPath%\%CMakeInstall%" call "%ToolsPath%\download-file.bat" "%CMakeUrl%" "%EnvDownloadPath%\%CMakeInstall%" + if not exist "%EnvDownloadPath%\%CMakeInstall%" %cecho% error "Cannot download CMake installation" & goto error + + %cecho% info "Unpack CMake" + "%EnvSevenZipExe%" x -o"%EnvTempPath%" "%EnvDownloadPath%\%CMakeInstall%" + + move "%EnvTempPath%\%CMakeVersion%" "%CMakeInstallPath%" + + call "%ToolsPath%\remove-dir.bat" "%EnvTempPath%" +) + +rem Tor +rem Get download link and filename from download page +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 +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 + +if not exist "%EnvDownloadPath%\%TorInstall%" call "%ToolsPath%\remove-dir.bat" "%EnvTorPath%" +if not exist "%EnvTorPath%\Tor\tor.exe" ( + %cecho% info "Download Tor installation" + + if not exist "%EnvDownloadPath%\%TorInstall%" call "%ToolsPath%\download-file.bat" "%TorDownloadUrl%" "%EnvDownloadPath%\%TorInstall%" + if not exist "%EnvDownloadPath%\%TorInstall%" %cecho% error "Cannot download Tor installation" & goto error + + %cecho% info "Unpack Tor" + "%EnvSevenZipExe%" x -o"%EnvTorPath%" "%EnvDownloadPath%\%TorInstall%" +) + :exit endlocal exit /B 0 :error +call "%ToolsPath%\remove-dir.bat" "%EnvTempPath%" endlocal exit /B 1 diff --git a/build_scripts/Windows/env/tools/root/update-msys.bat b/build_scripts/Windows/env/tools/root/update-msys.bat deleted file mode 100644 index b0a109d01..000000000 --- a/build_scripts/Windows/env/tools/root/update-msys.bat +++ /dev/null @@ -1,15 +0,0 @@ -@echo off - -setlocal - -set MSYSPath=%~dp0msys - -if not exist "%MSYSPath%\bin\mingw-get.exe" echo MSYS is not installed& exit /B 0 - -echo Update MSYS -pushd "%MSYSPath%\bin" -mingw-get.exe update -mingw-get.exe upgrade -popd - -exit /B %ERRORLEVEL% diff --git a/build_scripts/Windows/env/tools/root/update-msys2.bat b/build_scripts/Windows/env/tools/root/update-msys2.bat new file mode 100644 index 000000000..3075e392b --- /dev/null +++ b/build_scripts/Windows/env/tools/root/update-msys2.bat @@ -0,0 +1,19 @@ +@echo off + +setlocal + +if exist "%~dp0msys2\msys32" call :update 32 +if exist "%~dp0msys2\msys64" call :update 64 + +goto :EOF + +:update +set MSYSSH=%~dp0msys2\msys%~1\usr\bin\sh + +echo Update MSYS2 %~1 +"%MSYSSH%" -lc "pacman -Sy" +"%MSYSSH%" -lc "pacman --noconfirm -Su" + +:exit +endlocal +goto :EOF diff --git a/build_scripts/Windows/installer/ifexist.nsh b/build_scripts/Windows/installer/ifexist.nsh new file mode 100644 index 000000000..18786f3b3 --- /dev/null +++ b/build_scripts/Windows/installer/ifexist.nsh @@ -0,0 +1,15 @@ +; See http://nsis.sourceforge.net/Check_if_a_file_exists_at_compile_time for documentation +!macro !defineifexist _VAR_NAME _FILE_NAME + !tempfile _TEMPFILE + !ifdef NSIS_WIN32_MAKENSIS + ; Windows - cmd.exe + !system 'if exist "${_FILE_NAME}" echo !define ${_VAR_NAME} > "${_TEMPFILE}"' + !else + ; Posix - sh + !system 'if [ -e "${_FILE_NAME}" ]; then echo "!define ${_VAR_NAME}" > "${_TEMPFILE}"; fi' + !endif + !include '${_TEMPFILE}' + !delfile '${_TEMPFILE}' + !undef _TEMPFILE +!macroend +!define !defineifexist "!insertmacro !defineifexist" \ No newline at end of file diff --git a/build_scripts/Windows/installer/lang/ca_ES.nsh b/build_scripts/Windows/installer/lang/ca_ES.nsh index acb11b5a4..74f92ffe5 100644 --- a/build_scripts/Windows/installer/lang/ca_ES.nsh +++ b/build_scripts/Windows/installer/lang/ca_ES.nsh @@ -1,5 +1,7 @@ !insertmacro LANG_STRING Section_Main "${APPNAME}" !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_Data "Pells" !insertmacro LANG_STRING Section_Data_Desc "Instal·la pells." !insertmacro LANG_STRING Section_Shortcuts "Icones d'accés directe" diff --git a/build_scripts/Windows/installer/lang/de.nsh b/build_scripts/Windows/installer/lang/de.nsh index c5323f523..663e9e786 100644 --- a/build_scripts/Windows/installer/lang/de.nsh +++ b/build_scripts/Windows/installer/lang/de.nsh @@ -1,5 +1,7 @@ !insertmacro LANG_STRING Section_Main "${APPNAME}" !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_Data "Skins" !insertmacro LANG_STRING Section_Data_Desc "Skins installieren." !insertmacro LANG_STRING Section_Shortcuts "Verknüpfungssymbole" diff --git a/build_scripts/Windows/installer/lang/en.nsh b/build_scripts/Windows/installer/lang/en.nsh index b01f43baa..a709eec24 100644 --- a/build_scripts/Windows/installer/lang/en.nsh +++ b/build_scripts/Windows/installer/lang/en.nsh @@ -1,5 +1,7 @@ !insertmacro LANG_STRING Section_Main "${APPNAME}" !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_Data "Skins" !insertmacro LANG_STRING Section_Data_Desc "Installs skins." !insertmacro LANG_STRING Section_Shortcuts "Shortcut icons" diff --git a/build_scripts/Windows/installer/lang/es.nsh b/build_scripts/Windows/installer/lang/es.nsh index 68900ec62..66021c14e 100644 --- a/build_scripts/Windows/installer/lang/es.nsh +++ b/build_scripts/Windows/installer/lang/es.nsh @@ -1,5 +1,7 @@ !insertmacro LANG_STRING Section_Main "${APPNAME}" !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_Data "Coberturas (skins)" !insertmacro LANG_STRING Section_Data_Desc "Instalar coberturas" !insertmacro LANG_STRING Section_Shortcuts "Iconos de accesos directos" diff --git a/build_scripts/Windows/installer/lang/fr.nsh b/build_scripts/Windows/installer/lang/fr.nsh index d4c797833..680746da0 100644 --- a/build_scripts/Windows/installer/lang/fr.nsh +++ b/build_scripts/Windows/installer/lang/fr.nsh @@ -1,5 +1,7 @@ !insertmacro LANG_STRING Section_Main "${APPNAME}" !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_Data "Habillages" !insertmacro LANG_STRING Section_Data_Desc "Installe des habillages." !insertmacro LANG_STRING Section_Shortcuts "Icônes de raccourci" diff --git a/build_scripts/Windows/installer/lang/pl.nsh b/build_scripts/Windows/installer/lang/pl.nsh index 9f6d4305e..53fc42934 100644 --- a/build_scripts/Windows/installer/lang/pl.nsh +++ b/build_scripts/Windows/installer/lang/pl.nsh @@ -1,5 +1,7 @@ !insertmacro LANG_STRING Section_Main "${APPNAME}" !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_Data "Skórki" !insertmacro LANG_STRING Section_Data_Desc "Instaluje skórki." !insertmacro LANG_STRING Section_Shortcuts "Ikony skrótów" diff --git a/build_scripts/Windows/installer/lang/ru.nsh b/build_scripts/Windows/installer/lang/ru.nsh index 09c578cb8..b8ba2df89 100644 --- a/build_scripts/Windows/installer/lang/ru.nsh +++ b/build_scripts/Windows/installer/lang/ru.nsh @@ -1,5 +1,7 @@ !insertmacro LANG_STRING Section_Main "${APPNAME}" !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_Data "Оболочки" !insertmacro LANG_STRING Section_Data_Desc "Установка оболочек." !insertmacro LANG_STRING Section_Shortcuts "Ярлыки" diff --git a/build_scripts/Windows/installer/lang/tr.nsh b/build_scripts/Windows/installer/lang/tr.nsh index f893ac076..85abeaac2 100644 --- a/build_scripts/Windows/installer/lang/tr.nsh +++ b/build_scripts/Windows/installer/lang/tr.nsh @@ -1,5 +1,7 @@ !insertmacro LANG_STRING Section_Main "${APPNAME}" !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_Data "Temalar" !insertmacro LANG_STRING Section_Data_Desc "Tema yükleyin." !insertmacro LANG_STRING Section_Shortcuts "Kısayol simgeleri" diff --git a/build_scripts/Windows/installer/lang/ts/en.ts b/build_scripts/Windows/installer/lang/ts/en.ts index 763636d3d..e95f6939f 100644 --- a/build_scripts/Windows/installer/lang/ts/en.ts +++ b/build_scripts/Windows/installer/lang/ts/en.ts @@ -8,6 +8,20 @@ + + Section_Tor + + Tor + + + + + Section_Tor_Desc + + Installs Tor. + + + Section_Data diff --git a/build_scripts/Windows/installer/lang/zh_CN.nsh b/build_scripts/Windows/installer/lang/zh_CN.nsh index 1075f7a1a..330de33ab 100644 --- a/build_scripts/Windows/installer/lang/zh_CN.nsh +++ b/build_scripts/Windows/installer/lang/zh_CN.nsh @@ -1,5 +1,7 @@ !insertmacro LANG_STRING Section_Main "${APPNAME}" !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_Data "皮肤" !insertmacro LANG_STRING Section_Data_Desc "安装皮肤" !insertmacro LANG_STRING Section_Shortcuts "快捷方式图标" diff --git a/build_scripts/Windows/installer/retroshare-Qt5.nsi b/build_scripts/Windows/installer/retroshare-Qt5.nsi index bb2ede5b4..77334569d 100644 --- a/build_scripts/Windows/installer/retroshare-Qt5.nsi +++ b/build_scripts/Windows/installer/retroshare-Qt5.nsi @@ -1,8 +1,10 @@ ; Script generated with the Venis Install Wizard & modified by defnax ; Reworked by Thunder +!include ifexist.nsh + # Needed defines -;!define BUILDADD "" +;!define REVISION "" ;!define RELEASEDIR "" ;!define QTDIR "" ;!define MINGWDIR "" @@ -11,10 +13,6 @@ ;!define OUTDIR "" # Check needed defines -!ifndef BUILDADD -!error "BUILDADD is not defined" -!endif - !ifndef RELEASEDIR !error "RELEASEDIR is not defined" !endif @@ -24,6 +22,9 @@ !ifndef MINGWDIR !error "MINGWDIR is not defined" !endif +!ifndef ARCHITECTURE +!error "Architecture is not defined" +!endif # Check optional defines !ifdef OUTDIR @@ -42,7 +43,7 @@ # Get version from executable !GetDllVersion "${RELEASEDIR}\retroshare-gui\src\release\retroshare.exe" VERSION_ -!define VERSION ${VERSION_1}.${VERSION_2}.${VERSION_3}${BUILDADD} +!define VERSION ${VERSION_1}.${VERSION_2}.${VERSION_3} ;!define REVISION ${VERSION_4} # Get version of Qt @@ -54,12 +55,18 @@ !error "REVISION is not defined" !endif -!ifndef REVISION -!error "REVISION is not defined" +# Date +!ifndef DATE +!define /date DATE "%Y%m%d" !endif -# Date -!define /date Date "%Y%m%d" +# Tor +!ifdef TORDIR +${!defineifexist} TOR_EXISTS "${TORDIR}\tor.exe" +!ifndef TOR_EXISTS +!error "tor.exe not found" +!endif +!endif # Application name and version !define APPNAME "RetroShare" @@ -67,7 +74,12 @@ !define PUBLISHER "RetroShare Team" # Install path -!define INSTDIR_NORMAL "$ProgramFiles\${APPNAME}" +!if ${ARCHITECTURE} == "x86" + !define INSTDIR_NORMAL "$ProgramFiles32\${APPNAME}" +!endif +!if ${ARCHITECTURE} == "x64" + !define INSTDIR_NORMAL "$ProgramFiles64\${APPNAME}" +!endif !define INSTDIR_PORTABLE "$Desktop\${APPNAME}" !define DATADIR_NORMAL "$APPDATA\${APPNAME}" @@ -76,7 +88,7 @@ # Main Install settings Name "${APPNAMEANDVERSION}" InstallDirRegKey HKLM "Software\${APPNAME}" "" -OutFile "${OUTDIR_}RetroShare-${VERSION}-${Date}-${REVISION}-Qt-${QTVERSION}${INSTALLERADD}-setup.exe" +OutFile "${OUTDIR_}RetroShare-${VERSION}-${DATE}-${REVISION}-Qt-${QTVERSION}-${ARCHITECTURE}${INSTALLERADD}-setup.exe" BrandingText "${APPNAMEANDVERSION}" RequestExecutionlevel highest # Use compression @@ -110,7 +122,7 @@ Var StyleSheetDir !define MUI_FINISHPAGE_RUN "$INSTDIR\retroshare.exe" !define MUI_FINISHPAGE_SHOWREADME $INSTDIR\changelog.txt !define MUI_FINISHPAGE_SHOWREADME_TEXT changelog.txt -!define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED +;!define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED !define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\orange-uninstall.ico" !define MUI_UNFINISHPAGE_NOAUTOCLOSE ;!define MUI_LANGDLL_REGISTRY_ROOT HKLM @@ -180,8 +192,9 @@ Section $(Section_Main) Section_Main ; Main binaries SetOutPath "$INSTDIR" - File /oname=retroshare.exe "${RELEASEDIR}\retroshare-gui\src\release\retroshare.exe" - File /oname=retroshare-nogui.exe "${RELEASEDIR}\retroshare-nogui\src\release\retroshare-nogui.exe" + 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 File "${QTDIR}\bin\Qt5Core.dll" @@ -195,27 +208,46 @@ Section $(Section_Main) Section_Main ; Qt audio SetOutPath "$INSTDIR\audio" - File /r "${QTDIR}\plugins\audio\qtaudio_windows.dll" + File "${QTDIR}\plugins\audio\qtaudio_windows.dll" ; Qt platforms SetOutPath "$INSTDIR\platforms" - File /r "${QTDIR}\plugins\platforms\qwindows.dll" + File "${QTDIR}\plugins\platforms\qwindows.dll" + + ; Qt styles + SetOutPath "$INSTDIR\styles" + File /NONFATAL "${QTDIR}\plugins\styles\qwindowsvistastyle.dll" ; MinGW binaries SetOutPath "$INSTDIR" File "${MINGWDIR}\bin\libstdc++-6.dll" - File "${MINGWDIR}\bin\libgcc_s_dw2-1.dll" + !if ${ARCHITECTURE} == "x86" + File "${MINGWDIR}\bin\libgcc_s_dw2-1.dll" + !endif + !if ${ARCHITECTURE} == "x64" + File "${MINGWDIR}\bin\libgcc_s_seh-1.dll" + !endif File "${MINGWDIR}\bin\libwinpthread-1.dll" ; External binaries - File "${SOURCEDIR}\..\libs\bin\miniupnpc.dll" - File "${SOURCEDIR}\..\libs\bin\libeay32.dll" - File "${SOURCEDIR}\..\libs\bin\ssleay32.dll" + File "${EXTERNAL_LIB_DIR}\bin\miniupnpc.dll" + !if ${ARCHITECTURE} == "x86" + File "${EXTERNAL_LIB_DIR}\bin\libcrypto-1_1.dll" + File "${EXTERNAL_LIB_DIR}\bin\libssl-1_1.dll" + !endif + !if ${ARCHITECTURE} == "x64" + File "${EXTERNAL_LIB_DIR}\bin\libcrypto-1_1-x64.dll" + File "${EXTERNAL_LIB_DIR}\bin\libssl-1_1-x64.dll" + !endif ; Other files - File "${SOURCEDIR}\retroshare-gui\src\changelog.txt" + File "${RELEASEDIR}\changelog.txt" File "${SOURCEDIR}\libbitdht\src\bitdht\bdboot.txt" + ; License + SetOutPath "$INSTDIR\license" + File "${SOURCEDIR}\retroshare-gui\src\license\*.*" + ; Image formats SetOutPath "$INSTDIR\imageformats" File /r "${QTDIR}\plugins\imageformats\qgif.dll" @@ -238,31 +270,54 @@ Section $(Section_Main) Section_Main File /r "${QTDIR}\translations\qt_*.qm" File /r "${QTDIR}\translations\qtbase_*.qm" File /r "${QTDIR}\translations\qtscript_*.qm" - File /r "${QTDIR}\translations\qtquick1_*.qm" File /r "${QTDIR}\translations\qtmultimedia_*.qm" File /r "${QTDIR}\translations\qtxmlpatterns_*.qm" ; WebUI - SetOutPath "$INSTDIR\webui" - File /r "${SOURCEDIR}\libresapi\src\webui\*.*" +; SetOutPath "$INSTDIR\webui" +; File /r "${SOURCEDIR}\libresapi\src\webui\*.*" ; License SetOutPath "$INSTDIR\license" File /r "${SOURCEDIR}\retroshare-gui\src\license\*.*" SectionEnd -# Plugins -SectionGroup $(Section_Plugins) Section_Plugins -Section $(Section_Plugin_FeedReader) Section_Plugin_FeedReader - SetOutPath "$DataDir\extensions6" - File "${RELEASEDIR}\plugins\FeedReader\release\FeedReader.dll" -SectionEnd +# Tor +!ifdef TOR_EXISTS + Section /o $(Section_Tor) Section_Tor + SetOutPath "$INSTDIR" + File /r "${TORDIR}\*" + SectionEnd +!endif -Section $(Section_Plugin_VOIP) Section_Plugin_VOIP - SetOutPath "$DataDir\extensions6" - File "${RELEASEDIR}\plugins\VOIP\release\VOIP.dll" -SectionEnd -SectionGroupEnd +# Plugins +${!defineifexist} PLUGIN_FEEDREADER_EXISTS "${RELEASEDIR}\plugins\FeedReader\lib\FeedReader.dll" +${!defineifexist} PLUGIN_VOIP_EXISTS "${RELEASEDIR}\plugins\VOIP\lib\VOIP.dll" + +!ifdef PLUGIN_FEEDREADER_EXISTS +!define /ifndef PLUGIN_EXISTS +!endif +!ifdef PLUGIN_VOIP_EXISTS +!define /ifndef PLUGIN_EXISTS +!endif + +!ifdef PLUGIN_EXISTS + SectionGroup $(Section_Plugins) Section_Plugins + !ifdef PLUGIN_FEEDREADER_EXISTS + Section $(Section_Plugin_FeedReader) Section_Plugin_FeedReader + SetOutPath "$DataDir\extensions6" + File "${RELEASEDIR}\plugins\FeedReader\lib\FeedReader.dll" + SectionEnd + !endif + + !ifdef PLUGIN_VOIP_EXISTS + Section $(Section_Plugin_VOIP) Section_Plugin_VOIP + SetOutPath "$DataDir\extensions6" + File "${RELEASEDIR}\plugins\VOIP\lib\VOIP.dll" + SectionEnd + !endif + SectionGroupEnd +!endif # Data (Styles) Section $(Section_Data) Section_Data @@ -310,7 +365,7 @@ SectionEnd SectionGroupEnd Section $(Section_AutoStart) Section_AutoStart - WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Run" "RetroShare" "$INSTDIR\${APPNAME}06.exe -m" + WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Run" "RetroShare" "$INSTDIR\retroshare.exe -m" SectionEnd ;Section $(Section_AutoStart) Section_AutoStart @@ -349,6 +404,7 @@ SectionEnd !insertmacro MUI_DESCRIPTION_TEXT ${Section_Plugin_VOIP} $(Section_Plugin_VOIP_Desc) ; !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_FUNCTION_DESCRIPTION_END # Uninstall diff --git a/build_scripts/Windows/qt-cmd.bat b/build_scripts/Windows/qt-cmd.bat deleted file mode 100644 index 1e4ad475e..000000000 --- a/build_scripts/Windows/qt-cmd.bat +++ /dev/null @@ -1,27 +0,0 @@ -:: Usage: -:: call qt-cmd.bat [command] - -@echo off - -setlocal - -set QtVersion=%~1 - -:: Initialize environment -call "%~dp0env.bat" -if errorlevel 1 goto error_env -call "%EnvPath%\env-qt.bat" %QtVersion% -if errorlevel 1 goto error_env - -if "%~2"=="" ( - "%ComSpec%" -) else ( - "%ComSpec%" /c %2 %3 %4 %5 %6 %7 %8 %9 -) - -exit /B %ERRORLEVEL% - -:error_env -echo Failed to initialize environment. -endlocal -exit /B 1 diff --git a/build_scripts/Windows/tools/depends.bat b/build_scripts/Windows/tools/depends.bat index 3f1bb3d08..8238c974c 100644 --- a/build_scripts/Windows/tools/depends.bat +++ b/build_scripts/Windows/tools/depends.bat @@ -1,15 +1,15 @@ :: Usage: :: call depends.bat [list^|missing] file -setlocal - if "%2"=="" ( echo Usage: %~nx0 [list^|missing] File - goto :exit + exit /B 1 ) -if not exist "%EnvDependsExe%" echo depends.exe not found in %EnvToolsPath%.& goto exit -if not exist "%EnvCutExe%" echo cut.exe not found in %EnvToolsPath%.& goto exit +setlocal + +if not exist "%EnvDependsExe%" echo depends.exe not found in %EnvToolsPath%.& exit /B 1 +if not exist "%EnvCutExe%" echo cut.exe not found in %EnvToolsPath%.& exit /B 1 start /wait "" "%EnvDependsExe%" /c /oc:"%~dp0depends.tmp" %2 if "%1"=="missing" ( @@ -33,5 +33,5 @@ if "%1"=="list" ( if exist "%~dp0depends.tmp" del /Q "%~dp0depends.tmp" if exist "%~dp0depends1.tmp" del /Q "%~dp0depends1.tmp" -:exit endlocal +exit /B 0 \ No newline at end of file diff --git a/build_scripts/Windows/tools/download-file-wildcard.bat.bat b/build_scripts/Windows/tools/download-file-wildcard.bat.bat deleted file mode 100644 index d37943063..000000000 --- a/build_scripts/Windows/tools/download-file-wildcard.bat.bat +++ /dev/null @@ -1,46 +0,0 @@ -:: Usage: -:: call download-file-wildcard.bat url file-wildcard download-path variable - -if "%~4"=="" ( - echo. - echo Parameter error. - exit /B 1 -) - -if "%EnvTempPath%"=="" ( - echo. - echo Environment error. - exit /B 1 -) - -setlocal - -set Url=%~1 -set FileWildcard=%~2 -set DownloadPath=%~3 -set Var=%~4 -set File= - -call "%~dp0remove-dir.bat" "%EnvTempPath%" -mkdir "%EnvTempPath%" - -"%EnvWgetExe%" --recursive --continue --no-directories --no-parent -A "%FileWildcard%" --directory-prefix="%EnvTempPath%" "%Url%" - -if errorlevel 1 ( - call "%~dp0remove-dir.bat" "%EnvTempPath%" - endlocal & set %Var%= - exit /B %ERRORLEVEL% -) - -for %%A in (%EnvTempPath%\%FileWildcard%) do set File=%%~nxA -if "%File%"=="" ( - call "%~dp0remove-dir.bat" "%EnvTempPath%" - endlocal & set %Var%= - exit /B %ERRORLEVEL% -) - -move "%EnvTempPath%\%File%" "%DownloadPath%" -call "%~dp0remove-dir.bat" "%EnvTempPath%" - -endlocal & set %Var%=%File% -exit /B 0 diff --git a/build_scripts/Windows/tools/download-file.bat b/build_scripts/Windows/tools/download-file.bat index d42349ccb..dbcecdcbb 100644 --- a/build_scripts/Windows/tools/download-file.bat +++ b/build_scripts/Windows/tools/download-file.bat @@ -1,13 +1,12 @@ -:: Usage: -:: call download-file.bat url file - -if "%~2"=="" ( - echo. - echo Parameter error. - exit /B 1 -) - -::"%EnvCurlExe%" -L -k "%~1" -o "%~2" -"%EnvWgetExe%" --continue "%~1" --output-document="%~2" - -exit /B %ERRORLEVEL% +:: Usage: +:: call download-file.bat url file + +if "%~2"=="" ( + echo. + echo Parameter error. + exit /B 1 +) + +powershell -NoLogo -NoProfile -Command (New-Object System.Net.WebClient).DownloadFile(\""%~1\"", \""%~2\"") + +exit /B %ERRORLEVEL% diff --git a/build_scripts/Windows/tools/generate-changelog.bat b/build_scripts/Windows/tools/generate-changelog.bat new file mode 100644 index 000000000..c38225045 --- /dev/null +++ b/build_scripts/Windows/tools/generate-changelog.bat @@ -0,0 +1,50 @@ +@echo off +setlocal enabledelayedexpansion + +if "%~2"=="" ( + echo. + echo Parameter error. + echo Usage %~n0 sourcepath outputfile + exit /B 1 +) + +:: Check git executable +set GitPath= +call "%~dp0find-in-path.bat" GitPath git.exe +if "%GitPath%"=="" echo Git executable not found in PATH.& exit /B 1 + +set logfile=%~2 +copy nul %logfile% > nul + +pushd %~1 + +set last=HEAD +for /f %%t in ('git tag --sort=-taggerdate --merged ^| findstr v') do ( + echo generating changelog for !last!..%%t + echo ----------------------------------------------- >> %logfile% + if !last! neq HEAD ( + git tag -n !last! >> %logfile% + ) else ( + echo HEAD >> %logfile% + ) + rem echo !last! ---^> %%t >> %logfile% + echo ----------------------------------------------- >> %logfile% + echo. >> %logfile% + git log %%t..!last! --no-merges "--pretty=format:%%h %%ai %%<(10,trunc)%%an %%s" >> %logfile% + echo. >> %logfile% + echo. >> %logfile% + set last=%%t +) + +echo generating changelog for %last% +echo ----------------------------------------------- >> %logfile% +git tag -n %last% >> %logfile% +echo ----------------------------------------------- >> %logfile% +echo. >> %logfile% +git log %last% --no-merges "--pretty=format:%%h %%ai %%<(10,trunc)%%an %%s" >> %logfile% + +popd + +endlocal enabledelayedexpansion + +exit /B 0 diff --git a/build_scripts/Windows/tools/get-gcc-version.bat b/build_scripts/Windows/tools/get-gcc-version.bat index c9998376b..3977477b7 100644 --- a/build_scripts/Windows/tools/get-gcc-version.bat +++ b/build_scripts/Windows/tools/get-gcc-version.bat @@ -1,42 +1,37 @@ :: Usage: -:: call get-gcc-version.bat variable +:: call get-gcc-version.bat version architecture setlocal -set Var=%~1 -if "%Var%"=="" ( +set VarVersion=%~1 +if "%VarVersion%"=="" ( + echo. + echo Parameter error. + exit /B 1 +) + +set VarArchitecture=%~2 +if "%VarArchitecture%"=="" ( echo. echo Parameter error. exit /B 1 ) set GCCVersion= +set GCCArchitecture= +set _Architecture= call "%~dp0find-in-path.bat" GCCPath gcc.exe if "%GCCPath%"=="" ( echo. echo Cannot find gcc.exe in PATH. - goto exit + exit /B 1 ) -gcc --version >"%~dp0gccversion.tmp" -for /F "tokens=1*" %%A in (%~sdp0gccversion.tmp) do ( - if "%%A"=="gcc" ( - call :find_version %%B - goto exit - ) -) +for /F "tokens=1-8* delims= " %%A in ('gcc --version') do if "%%A"=="gcc" set _Architecture=%%B& set GCCVersion=%%G -:exit -if exist "%~dp0gccversion.tmp" del /Q "%~dp0gccversion.tmp" +if "%_Architecture:~1,4%"=="i686" set GCCArchitecture=x86 +if "%_Architecture:~1,6%"=="x86_64" set GCCArchitecture=x64 -endlocal & set %Var%=%GCCVersion% -goto :EOF - -:find_version -:loop -if "%2" NEQ "" ( - shift - goto loop -) -set GCCVersion=%1 +endlocal & set %VarVersion%=%GCCVersion%& set %VarArchitecture%=%GCCArchitecture% +exit /B 0 diff --git a/build_scripts/Windows/tools/get-git-ref.bat b/build_scripts/Windows/tools/get-git-ref.bat index f8f6efdeb..f0047e486 100644 --- a/build_scripts/Windows/tools/get-git-ref.bat +++ b/build_scripts/Windows/tools/get-git-ref.bat @@ -18,7 +18,7 @@ call "%~dp0find-in-path.bat" GitPath git.exe if "%GitPath%"=="" ( echo. echo Git executable not found in PATH. - goto exit + exit /B 1 ) set GitParameter= diff --git a/build_scripts/Windows/tools/get-qt-version.bat b/build_scripts/Windows/tools/get-qt-version.bat index c49939970..73afedcfc 100644 --- a/build_scripts/Windows/tools/get-qt-version.bat +++ b/build_scripts/Windows/tools/get-qt-version.bat @@ -16,19 +16,10 @@ call "%~dp0find-in-path.bat" QMakePath qmake.exe if "%QMakePath%"=="" ( echo. echo Cannot find qmake.exe in PATH. - goto exit + exit /B 1 ) -qmake.exe -version >"%~dp0qtversion.tmp" -for /F "tokens=1,2,3,4" %%A in (%~sdp0qtversion.tmp) do ( - if "%%A"=="Using" ( - set QtVersion=%%D - goto exit - ) -) - -:exit -if exist "%~dp0qtversion.tmp" del /Q "%~dp0qtversion.tmp" +for /F "tokens=1,2,3,4 delims= " %%A in ('qmake.exe -version') do if "%%A"=="Using" set QtVersion=%%D endlocal & set %Var%=%QtVersion% exit /B 0 \ No newline at end of file diff --git a/build_scripts/Windows/tools/get-rs-date.bat b/build_scripts/Windows/tools/get-rs-date.bat new file mode 100644 index 000000000..6fecc48f9 --- /dev/null +++ b/build_scripts/Windows/tools/get-rs-date.bat @@ -0,0 +1,32 @@ +REM Usage: +REM call get-rs-date.bat SourcePath Variable + +setlocal + +set SourcePath=%~1 +set Variable=%~2 +if "%Variable%"=="" ( + echo. + echo Parameter error + exit /B 1 +) + +:: Check git executable +set GitPath= +call "%~dp0find-in-path.bat" GitPath git.exe +if "%GitPath%"=="" ( + echo. + echo Git executable not found in PATH. + exit /B 1 +) + +set Date= + +pushd "%SourcePath%" +rem This doesn't work: git log -1 --date=format:"%Y%m%d" --format="%ad" +for /F "tokens=1,2,3* delims=-" %%A in ('git log -1 --date^=short --format^="%%ad"') do set Date=%%A%%B%%C +popd + +:exit +endlocal & set %Variable%=%Date% +exit /B 0 diff --git a/build_scripts/Windows/tools/get-rs-version.bat b/build_scripts/Windows/tools/get-rs-version.bat index c99ded405..cc4e53ff8 100644 --- a/build_scripts/Windows/tools/get-rs-version.bat +++ b/build_scripts/Windows/tools/get-rs-version.bat @@ -1,9 +1,14 @@ :: Usage: -:: call get-rs-version.bat Define Variable +:: call get-rs-version.bat Executable Variable +:: +:: Variable.Major +:: Variable.Minor +:: Variable.Mini +:: Variable.Extra setlocal -set Define=%~1 +set Executable=%~1 set Variable=%~2 if "%Variable%"=="" ( echo. @@ -11,23 +16,23 @@ if "%Variable%"=="" ( exit /B 1 ) -set Result= -set VersionFile="%~dp0..\..\..\libretroshare\src\retroshare\rsversion.h" - -if not exist "%VersionFile%" ( +if not exist "%Executable%" ( echo. - echo Version file doesn't exist. - echo %VersionFile% + echo File %Executable% doesn't exist. exit /B1 ) -for /F "usebackq tokens=1,2,3" %%A in (%VersionFile%) do ( - if "%%A"=="#define" ( - if "%%B"=="%Define%" ( - set Result=%%~C - ) - ) +set VersionMajor= +set VersionMinor= +set VersionMini= +set VersionExtra= + +for /F "USEBACKQ tokens=1,2,3,* delims=.-" %%A in (`powershell -NoLogo -NoProfile -Command ^(Get-Item "%Executable%"^).VersionInfo.FileVersion`) do ( + set VersionMajor=%%A + set VersionMinor=%%B + set VersionMini=%%C + set VersionExtra=%%D ) -endlocal & set %Variable%=%Result% +endlocal & set %Variable%.Major=%VersionMajor%& set %Variable%.Minor=%VersionMinor%& set %Variable%.Mini=%VersionMini%& set %Variable%.Extra=%VersionExtra%& exit /B 0 \ No newline at end of file diff --git a/build_scripts/Windows/tools/msys-path.bat b/build_scripts/Windows/tools/msys-path.bat deleted file mode 100644 index 3b0c5fd69..000000000 --- a/build_scripts/Windows/tools/msys-path.bat +++ /dev/null @@ -1,20 +0,0 @@ -:: Usage: -:: call msys-path.bat path variable - -setlocal - -set WinPath=%~1 -set MSYSVar=%~2 - -if "%MSYSVar%"=="" ( - echo. - echo Parameter error. - exit /B 1 -) - -set MSYSPath=/%WinPath:~0,1%/%WinPath:~3% -set MSYSPath=%MSYSPath:\=/% - -endlocal & set %MSYSVar%=%MSYSPath% - -exit /B 0 diff --git a/build_scripts/Windows/tools/msys2-path.bat b/build_scripts/Windows/tools/msys2-path.bat new file mode 100644 index 000000000..9904417f6 --- /dev/null +++ b/build_scripts/Windows/tools/msys2-path.bat @@ -0,0 +1,20 @@ +:: Usage: +:: call msys2-path.bat path variable + +setlocal + +set WinPath=%~1 +set MSYS2Var=%~2 + +if "%MSYS2Var%"=="" ( + echo. + echo Parameter error. + exit /B 1 +) + +set MSYS2Path=/%WinPath:~0,1%/%WinPath:~3% +set MSYS2Path=%MSYS2Path:\=/% + +endlocal & set %MSYS2Var%=%MSYS2Path% + +exit /B 0 diff --git a/build_scripts/Windows/tools/remove-dir.bat b/build_scripts/Windows/tools/remove-dir.bat index 2bcb14c51..e6985f13c 100644 --- a/build_scripts/Windows/tools/remove-dir.bat +++ b/build_scripts/Windows/tools/remove-dir.bat @@ -1,15 +1,15 @@ -:: Usage: -:: call remove-dir.bat path - -if "%~1"=="" ( - echo. - echo Parameter error. - exit /B 1 -) - -if exist %1 ( - del /s /f /q %1 >nul - rmdir /s /q %1 -) - -exit /B 0 +:: Usage: +:: call remove-dir.bat path + +if "%~1"=="" ( + echo. + echo Parameter error. + exit /B 1 +) + +if exist %1 ( + del /s /f /q %1 >nul + rmdir /s /q %1 +) + +exit /B 0 diff --git a/build_scripts/Windows/tools/winhttpjs.bat b/build_scripts/Windows/tools/winhttpjs.bat deleted file mode 100644 index 0c1847fac..000000000 --- a/build_scripts/Windows/tools/winhttpjs.bat +++ /dev/null @@ -1,584 +0,0 @@ -@if (@X) == (@Y) @end /* JScript comment - @echo off - - rem :: the first argument is the script name as it will be used for proper help message - cscript //E:JScript //nologo "%~f0" "%~nx0" %* - - exit /b %errorlevel% - -@if (@X)==(@Y) @end JScript comment */ - -// used resources - -// update 12.10.15 -// osvikvi(https://github.com/osvikvi) has nodited that the -password option is not set , so this is fixed - -//https://msdn.microsoft.com/en-us/library/windows/desktop/aa384058(v=vs.85).aspx -//https://msdn.microsoft.com/en-us/library/windows/desktop/aa384055(v=vs.85).aspx -//https://msdn.microsoft.com/en-us/library/windows/desktop/aa384059(v=vs.85).aspx - -// global variables and constants - - -// ---------------------------------- -// -- asynch requests not included -- -// ---------------------------------- - - -//todo - save responceStream instead of responceBody !! -//todo - set all winthttp options ->//https://msdn.microsoft.com/en-us/library/windows/desktop/aa384108(v=vs.85).aspx -//todo - log all options -//todo - improve help message . eventual verbose option - - -var ARGS = WScript.Arguments; -var scriptName = ARGS.Item(0); - -var url = ""; -var saveTo = ""; - -var user = 0; -var pass = 0; - -var proxy = 0; -var bypass = 0; -var proxy_user = 0; -var proxy_pass = 0; - -var certificate = 0; - -var force = true; - -var body = ""; - -//ActiveX objects -var WinHTTPObj = new ActiveXObject("WinHttp.WinHttpRequest.5.1"); -var FileSystemObj = new ActiveXObject("Scripting.FileSystemObject"); -var AdoDBObj = new ActiveXObject("ADODB.Stream"); - -// HttpRequest SetCredentials flags. -var proxy_settings = 0; - -// -HTTPREQUEST_SETCREDENTIALS_FOR_SERVER = 0; -HTTPREQUEST_SETCREDENTIALS_FOR_PROXY = 1; - -//timeouts and their default values -var RESOLVE_TIMEOUT = 0; -var CONNECT_TIMEOUT = 90000; -var SEND_TIMEOUT = 90000; -var RECEIVE_TIMEOUT = 90000; - -//HttpRequestMethod -var http_method = 'GET'; - -//header -var header_file = ""; - -//report -var reportfile = ""; - -//test-this: -var use_stream = false; - -//autologon policy -var autologon_policy = 1; //0,1,2 - - -//headers will be stored as multi-dimensional array -var headers = []; - -//user-agent -var ua = ""; - -//escape URL -var escape = false; - -function printHelp() { - WScript.Echo(scriptName + " - sends HTTP request and saves the request body as a file and/or a report of the sent request"); - WScript.Echo(scriptName + " url [-force yes|no] [-user username -password password] [-proxy proxyserver:port] [-bypass bypass_list]"); - WScript.Echo(" [-proxyuser proxy_username -proxypassword proxy_password] [-certificate certificateString]"); - WScript.Echo(" [-method GET|POST|PATCH|DELETE|HEAD|OPTIONS|CONNECT]"); - WScript.Echo(" [-saveTo file] - to print response to console use con"); - - WScript.Echo(" [-sendTimeout int(milliseconds)]"); - WScript.Echo(" [-resolveTimeout int(milliseconds)]"); - WScript.Echo(" [-connectTimeout int(milliseconds)]"); - WScript.Echo(" [-receiveTimeout int(milliseconds)]"); - - WScript.Echo(" [-autologonPolicy 1|2|3]"); - WScript.Echo(" [-proxySettings 1|2|3] (https://msdn.microsoft.com/en-us/library/windows/desktop/aa384059(v=vs.85).aspx)"); - - //header - WScript.Echo(" [-headers-file header_file]"); - //reportfile - WScript.Echo(" [-reportfile reportfile]"); - WScript.Echo(" [-ua user-agent]"); - WScript.Echo(" [-ua-file user-agent-file]"); - - WScript.Echo(" [-escape yes|no]"); - - WScript.Echo(" [-body body-string]"); - WScript.Echo(" [-body-file body-file]"); - - WScript.Echo("-force - decide to not or to overwrite if the local files exists"); - - WScript.Echo("proxyserver:port - the proxy server"); - WScript.Echo("bypass- bypass list"); - WScript.Echo("proxy_user , proxy_password - credentials for proxy server"); - WScript.Echo("user , password - credentials for the server"); - WScript.Echo("certificate - location of SSL certificate"); - WScript.Echo("method - what HTTP method will be used.Default is GET"); - WScript.Echo("saveTo - save the responce as binary file"); - WScript.Echo(" "); - WScript.Echo("Header file should contain key:value pairs.Lines starting with \"#\" will be ignored."); - WScript.Echo("value should NOT be enclosed with quotes"); - WScript.Echo(" "); - WScript.Echo("Examples:"); - - WScript.Echo(scriptName + " http://somelink.com/somefile.zip -saveTo c:\\somefile.zip -certificate \"LOCAL_MACHINE\\Personal\\My Middle-Tier Certificate\""); - WScript.Echo(scriptName + " http://somelink.com/something.html -method POST -certificate \"LOCAL_MACHINE\\Personal\\My Middle-Tier Certificate\" -header c:\\header_file -reportfile c:\\reportfile.txt"); - WScript.Echo(scriptName + "\"http://somelink\" -method POST -header hdrs.txt -reportfile reportfile2.txt -saveTo responsefile2 -ua \"Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36\" -body-file some.json"); - -} - -function parseArgs() { - // - if (ARGS.Length < 2) { - WScript.Echo("insufficient arguments"); - printHelp(); - WScript.Quit(43); - } - // !!! - url = ARGS.Item(1); - // !!! - if (ARGS.Length % 2 != 0) { - WScript.Echo("illegal arguments"); - printHelp(); - WScript.Quit(44); - } - - for (var i = 2; i < ARGS.Length - 1; i = i + 2) { - var arg = ARGS.Item(i).toLowerCase(); - var next = ARGS.Item(i + 1); - - - try { - switch (arg) { // the try-catch is set mainly because of the parseInts - case "-force": - if (next == "no") { - force = false; - } - break; - case "-escape": - if (next == "yes") { - escape = true; - } - break; - case "-saveto": - saveTo = next; - break; - case "-user": - case "-u": - user = next; - break; - case "-pass": - case "-password": - case "-p": - pass = next; - break; - case "-proxy": - proxy = next; - break; - case "-bypass": - bypass = next; - break; - case "-proxyuser": - case "-pu": - proxy_user = next; - break; - case "-proxypassword": - case "-pp": - proxy_pass = next; - break; - case "-ua": - ua = next; - break; - case "-ua-file": - ua = readFile(next); - break; - case "-body": - body = next; - break; - case "-usestream": - //WScript.Echo("~~"); - if (next.toLowerCase() === "yes") { - use_stream = true - }; - break; - case "-body-file": - body = readFile(next); - break; - case "-certificate": - certificate = next; - break; - case "-method": - switch (next.toLowerCase()) { - case "post": - http_method = 'POST'; - break; - case "get": - http_method = 'GET'; - break; - case "head": - http_method = 'HEAD'; - break; - case "put": - http_method = 'PUT'; - break; - case "options": - http_method = 'OPTIONS'; - break; - case "connect": - http_method = 'CONNECT'; - break; - case "patch": - http_method = 'PATCH'; - break; - case "delete": - http_method = 'DELETE'; - break; - default: - WScript.Echo("Invalid http method passed " + next); - WScript.Echo("possible values are GET,POST,DELETE,PUT,CONNECT,PATCH,HEAD,OPTIONS"); - WScript.Quit(1326); - break; - } - break; - case "-headers-file": - case "-header": - headers = readPropFile(next); - break; - case "-reportfile": - reportfile = next; - break; - //timeouts - case "-sendtimeout": - SEND_TIMEOUT = parseInt(next); - break; - case "-connecttimeout": - CONNECT_TIMEOUT = parseint(next); - break; - case "-resolvetimeout": - RESOLVE_TIMEOUT = parseInt(next); - break; - case "-receivetimeout": - RECEIVE_TIMEOUT = parseInt(next); - break; - - case "-autologonpolicy": - autologon_policy = parseInt(next); - if (autologon_policy > 2 || autologon_policy < 0) { - WScript.Echo("out of autologon policy range"); - WScript.Quit(87); - }; - break; - case "-proxysettings": - proxy_settings = parseInt(next); - if (proxy_settings > 2 || proxy_settings < 0) { - WScript.Echo("out of proxy settings range"); - WScript.Quit(87); - }; - break; - default: - WScript.Echo("Invalid command line switch: " + arg); - WScript.Quit(1405); - break; - } - } catch (err) { - WScript.Echo(err.message); - WScript.Quit(1348); - } - } -} - -stripTrailingSlash = function(path) { - while (path.substr(path.length - 1, path.length) == '\\') { - path = path.substr(0, path.length - 1); - } - return path; -} - -function existsItem(path) { - return FileSystemObj.FolderExists(path) || FileSystemObj.FileExists(path); -} - -function deleteItem(path) { - if (FileSystemObj.FileExists(path)) { - FileSystemObj.DeleteFile(path); - return true; - } else if (FileSystemObj.FolderExists(path)) { - FileSystemObj.DeleteFolder(stripTrailingSlash(path)); - return true; - } else { - return false; - } -} - -//------------------------------- -//---------------------- -//---------- -//----- -//-- -function request(url) { - - try { - - WinHTTPObj.Open(http_method, url, false); - if (proxy != 0 && bypass != 0) { - WinHTTPObj.SetProxy(proxy_settings, proxy, bypass); - } - - if (proxy != 0) { - WinHTTPObj.SetProxy(proxy_settings, proxy); - } - - if (user != 0 && pass != 0) { - WinHTTPObj.SetCredentials(user, pass, HTTPREQUEST_SETCREDENTIALS_FOR_SERVER); - } - - if (proxy_user != 0 && proxy_pass != 0) { - WinHTTPObj.SetCredentials(proxy_user, proxy_pass, HTTPREQUEST_SETCREDENTIALS_FOR_PROXY); - } - - if (certificate != 0) { - WinHTTPObj.SetClientCertificate(certificate); - } - - //set autologin policy - WinHTTPObj.SetAutoLogonPolicy(autologon_policy); - //set timeouts - WinHTTPObj.SetTimeouts(RESOLVE_TIMEOUT, CONNECT_TIMEOUT, SEND_TIMEOUT, RECEIVE_TIMEOUT); - - if (headers.length !== 0) { - WScript.Echo("Sending with headers:"); - for (var i = 0; i < headers.length; i++) { - WinHTTPObj.SetRequestHeader(headers[i][0], headers[i][1]); - WScript.Echo(headers[i][0] + ":" + headers[i][1]); - } - WScript.Echo(""); - } - - if (ua !== "") { - //user-agent option from: - //WinHttpRequestOption enumeration - // other options can be added like bellow - //https://msdn.microsoft.com/en-us/library/windows/desktop/aa384108(v=vs.85).aspx - WinHTTPObj.Option(0) = ua; - } - if (escape) { - WinHTTPObj.Option(3) = true; - } - if (trim(body) === "") { - WinHTTPObj.Send(); - } else { - WinHTTPObj.Send(body); - } - - var status = WinHTTPObj.Status - } catch (err) { - WScript.Echo(err.message); - WScript.Quit(666); - } - - //////////////////////// - // report // - //////////////////////// - - if (reportfile != "") { - - //var report_string=""; - var n = "\r\n"; - var report_string = "Status:" + n; - report_string = report_string + " " + WinHTTPObj.Status; - report_string = report_string + " " + WinHTTPObj.StatusText + n; - report_string = report_string + " " + n; - report_string = report_string + "Response:" + n; - report_string = report_string + WinHTTPObj.ResponseText + n; - report_string = report_string + " " + n; - report_string = report_string + "Headers:" + n; - report_string = report_string + WinHTTPObj.GetAllResponseHeaders() + n; - - WinHttpRequestOption_UserAgentString = 0; // Name of the user agent - WinHttpRequestOption_URL = 1; // Current URL - WinHttpRequestOption_URLCodePage = 2; // Code page - WinHttpRequestOption_EscapePercentInURL = 3; // Convert percents - // in the URL - // rest of the options can be seen and eventually added using this as reference - // https://msdn.microsoft.com/en-us/library/windows/desktop/aa384108(v=vs.85).aspx - - report_string = report_string + "URL:" + n; - report_string = report_string + WinHTTPObj.Option(WinHttpRequestOption_URL) + n; - - report_string = report_string + "URL Code Page:" + n; - report_string = report_string + WinHTTPObj.Option(WinHttpRequestOption_URLCodePage) + n; - - report_string = report_string + "User Agent:" + n; - report_string = report_string + WinHTTPObj.Option(WinHttpRequestOption_UserAgentString) + n; - - report_string = report_string + "Escapped URL:" + n; - report_string = report_string + WinHTTPObj.Option(WinHttpRequestOption_EscapePercentInURL) + n; - - prepareateFile(force, reportfile); - - WScript.Echo("Writing report to " + reportfile); - - writeFile(reportfile, report_string); - - } - - switch (status) { - case 200: - WScript.Echo("Status: 200 OK"); - break; - default: - WScript.Echo("Status: " + status); - WScript.Echo("Status was not OK. More info -> https://en.wikipedia.org/wiki/List_of_HTTP_status_codes"); - } - - //if as binary - if (saveTo.toLowerCase() === "con") { - WScript.Echo(WinHTTPObj.ResponseText); - } - if (saveTo !== "" && saveTo.toLowerCase() !== "con") { - prepareateFile(force, saveTo); - try { - - if (use_stream) { - writeBinFile(saveTo, WinHTTPObj.ResponseStream); - } else { - writeBinFile(saveTo, WinHTTPObj.ResponseBody); - } - - } catch (err) { - WScript.Echo("Failed to save the file as binary.Attempt to save it as text"); - AdoDBObj.Close(); - prepareateFile(true, saveTo); - writeFile(saveTo, WinHTTPObj.ResponseText); - } - } - WScript.Quit(status); -} - -//-- -//----- -//---------- -//---------------------- -//------------------------------- - -function prepareateFile(force, file) { - if (force && existsItem(file)) { - if (!deleteItem(file)) { - WScript.Echo("Unable to delete " + file); - WScript.Quit(8); - } - } else if (existsItem(file)) { - WScript.Echo("Item " + file + " already exist"); - WScript.Quit(9); - } -} - -function writeBinFile(fileName, data) { - AdoDBObj.Type = 1; - AdoDBObj.Open(); - AdoDBObj.Position = 0; - AdoDBObj.Write(data); - AdoDBObj.SaveToFile(fileName, 2); - AdoDBObj.Close(); -} - -function writeFile(fileName, data) { - AdoDBObj.Type = 2; - AdoDBObj.CharSet = "iso-8859-1"; - AdoDBObj.Open(); - AdoDBObj.Position = 0; - AdoDBObj.WriteText(data); - AdoDBObj.SaveToFile(fileName, 2); - AdoDBObj.Close(); -} - - -function readFile(fileName) { - //check existence - try { - if (!FileSystemObj.FileExists(fileName)) { - WScript.Echo("file " + fileName + " does not exist!"); - WScript.Quit(13); - } - if (FileSystemObj.GetFile(fileName).Size === 0) { - return ""; - } - var fileR = FileSystemObj.OpenTextFile(fileName, 1); - var content = fileR.ReadAll(); - fileR.Close(); - return content; - } catch (err) { - WScript.Echo("Error while reading file: " + fileName); - WScript.Echo(err.message); - WScript.Echo("Will return empty string"); - return ""; - } -} - -function readPropFile(fileName) { - //check existence - resultArray = []; - if (!FileSystemObj.FileExists(fileName)) { - WScript.Echo("(headers)file " + fileName + " does not exist!"); - WScript.Quit(15); - } - if (FileSystemObj.GetFile(fileName).Size === 0) { - return resultArray; - } - var fileR = FileSystemObj.OpenTextFile(fileName, 1); - var line = ""; - var k = ""; - var v = ""; - var lineN = 0; - var index = 0; - try { - WScript.Echo("parsing headers form " + fileName + " property file "); - while (!fileR.AtEndOfStream) { - line = fileR.ReadLine(); - lineN++; - index = line.indexOf(":"); - if (line.indexOf("#") === 0 || trim(line) === "") { - continue; - } - if (index === -1 || index === line.length - 1 || index === 0) { - WScript.Echo("Invalid line " + lineN); - WScript.Quit(93); - } - k = trim(line.substring(0, index)); - v = trim(line.substring(index + 1, line.length)); - resultArray.push([k, v]); - } - fileR.Close(); - return resultArray; - } catch (err) { - WScript.Echo("Error while reading headers file: " + fileName); - WScript.Echo(err.message); - WScript.Echo("Will return empty array"); - return resultArray; - } -} - -function trim(str) { - return str.replace(/^\s+/, '').replace(/\s+$/, ''); -} - -function main() { - parseArgs(); - request(url); -} -main(); diff --git a/data/retroshare.desktop b/data/retroshare.desktop index 724b86953..efc73dd6b 100644 --- a/data/retroshare.desktop +++ b/data/retroshare.desktop @@ -2,10 +2,10 @@ Encoding=UTF-8 Version=1.0 Name=RetroShare -Comment=Securely share files with your friends +Comment=Securely communicate with your friends Exec=/usr/bin/retroshare %U Icon=/usr/share/pixmaps/retroshare.xpm Terminal=false Type=Application -Categories=Application;Network; +Categories=Application;Network;P2P;Feed;Chat;InstantMessaging MimeType=x-scheme-handler/retroshare; diff --git a/data/retroshare.svg b/data/retroshare.svg new file mode 100644 index 000000000..403f4fb52 --- /dev/null +++ b/data/retroshare.svg @@ -0,0 +1,263 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/jsonapi-generator/README.adoc b/jsonapi-generator/README.adoc new file mode 100644 index 000000000..95c58ec0c --- /dev/null +++ b/jsonapi-generator/README.adoc @@ -0,0 +1,389 @@ +// SPDX-FileCopyrightText: (C) 2004-2019 Retroshare Team +// SPDX-License-Identifier: CC0-1.0 + +RetroShare JSON API +=================== + +:Cxx: C++ + +== 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+. 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& 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+ 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(...)+. + + +== 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 diff --git a/jsonapi-generator/src/async-method-wrapper-template.cpp.tmpl b/jsonapi-generator/src/async-method-wrapper-template.cpp.tmpl new file mode 100644 index 000000000..29f53ad48 --- /dev/null +++ b/jsonapi-generator/src/async-method-wrapper-template.cpp.tmpl @@ -0,0 +1,80 @@ +/******************************************************************************* + * RetroShare JSON API * + * * + * Copyright (C) 2018-2019 Gioacchino Mazzurco * + * * + * 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 . * + * * + *******************************************************************************/ + +registerHandler( "$%apiPath%$", + [this](const std::shared_ptr session) +{ + const std::multimap 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 session, + const rb::Bytes& body ) + { + INITIALIZE_API_CALL_JSON_CONTEXT; + + if( !checkRsServicePtrReady( + $%instanceName%$, "$%instanceName%$", cAns, session ) ) + return; + +$%paramsDeclaration%$ + +$%inputParamsDeserialization%$ + + const std::weak_ptr weakService(mService); + const std::weak_ptr 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%$ ); diff --git a/jsonapi-generator/src/jsonapi-generator-doxygen.conf b/jsonapi-generator/src/jsonapi-generator-doxygen.conf new file mode 100644 index 000000000..0edd1de3e --- /dev/null +++ b/jsonapi-generator/src/jsonapi-generator-doxygen.conf @@ -0,0 +1,230 @@ +DOXYFILE_ENCODING = UTF-8 +PROJECT_NAME = "libretroshare" + +ALIASES += jsonapi{1}="\xmlonly\endxmlonly" +ALIASES += jsonapi{2}="\xmlonly\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 + diff --git a/jsonapi-generator/src/jsonapi-generator.cpp b/jsonapi-generator/src/jsonapi-generator.cpp new file mode 100644 index 000000000..e56082ce6 --- /dev/null +++ b/jsonapi-generator/src/jsonapi-generator.cpp @@ -0,0 +1,422 @@ +/******************************************************************************* + * RetroShare JSON API * + * * + * Copyright (C) 2018-2019 Gioacchino Mazzurco * + * * + * 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 . * + * * + *******************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +struct MethodParam +{ + MethodParam() : + in(false), out(false), isMultiCallback(false), isSingleCallback(false){} + + QString type; + QString name; + QString defval; + bool in; + bool out; + bool isMultiCallback; + bool isSingleCallback; +}; + +int main(int argc, char *argv[]) +{ + if(argc != 3) + { + qDebug() << "Usage: jsonapi-generator SOURCE_PATH OUTPUT_PATH"; + return -EINVAL; + } + + QString sourcePath(argv[1]); + QString outputPath(argv[2]); + QString doxPrefix(outputPath+"/xml/"); + + QString wrappersDefFilePath(outputPath + "/jsonapi-wrappers.inl"); + QFile wrappersDefFile(wrappersDefFilePath); + wrappersDefFile.remove(); + if(!wrappersDefFile.open(QIODevice::WriteOnly|QIODevice::Append|QIODevice::Text)) + { + qDebug() << "Can't open: " << wrappersDefFilePath; + return -errno; + } + + QString cppApiIncludesFilePath(outputPath + "/jsonapi-includes.inl"); + QFile cppApiIncludesFile(cppApiIncludesFilePath); + cppApiIncludesFile.remove(); + if(!cppApiIncludesFile.open(QIODevice::WriteOnly|QIODevice::Append|QIODevice::Text)) + { + qDebug() << "Can't open: " << cppApiIncludesFilePath; + return -errno; + } + QSet cppApiIncludesSet; + + auto fatalError = [&]( + std::initializer_list errors, int ernum = -EINVAL ) + { + QString errorMsg; + for(const QVariant& error: errors) + errorMsg += error.toString() + " "; + errorMsg.chop(1); + QByteArray cppError(QString("#error "+errorMsg+"\n").toLocal8Bit()); + wrappersDefFile.write(cppError); + cppApiIncludesFile.write(cppError); + qDebug() << errorMsg; + return ernum; + }; + + QDirIterator it(doxPrefix, QStringList() << "*8h.xml", QDir::Files); + while(it.hasNext()) + { + QDomDocument hDoc; + QString hFilePath(it.next()); + QString parseError; int line = -1, column = -1; + QFile hFile(hFilePath); + if (!hFile.open(QIODevice::ReadOnly) || + !hDoc.setContent(&hFile, &parseError, &line, &column)) + { + qWarning() << "Error parsing:" << hFilePath + << parseError << line << column; + continue; + } + + QFileInfo headerFileInfo(hDoc.elementsByTagName("location").at(0) + .attributes().namedItem("file").nodeValue()); + QString headerRelPath = headerFileInfo.dir().dirName() + "/" + + headerFileInfo.fileName(); + + QDomNodeList sectiondefs = hDoc.elementsByTagName("memberdef"); + for(int j = 0; j < sectiondefs.size(); ++j) + { + QDomElement sectDef = sectiondefs.item(j).toElement(); + + if( sectDef.attributes().namedItem("kind").nodeValue() != "variable" + || sectDef.elementsByTagName("jsonapi").isEmpty() ) + continue; + + QString instanceName = + sectDef.elementsByTagName("name").item(0).toElement().text(); + QString typeName = + sectDef.elementsByTagName("ref").item(0).toElement().text(); + QString typeFilePath(doxPrefix); + typeFilePath += sectDef.elementsByTagName("ref").item(0) + .attributes().namedItem("refid").nodeValue(); + typeFilePath += ".xml"; + + QDomDocument typeDoc; + QFile typeFile(typeFilePath); + if ( !typeFile.open(QIODevice::ReadOnly) || + !typeDoc.setContent(&typeFile, &parseError, &line, &column) ) + { + qWarning() << "Error parsing:" << typeFilePath + << parseError << line << column; + continue; + } + + QDomNodeList members = typeDoc.elementsByTagName("member"); + for (int i = 0; i < members.size(); ++i) + { + QDomNode member = members.item(i); + QString refid(member.attributes().namedItem("refid").nodeValue()); + QString methodName(member.firstChildElement("name").toElement().text()); + bool requiresAuth = true; + QString defFilePath(doxPrefix + refid.left(refid.lastIndexOf('_')) + ".xml"); + + qDebug() << "Looking for" << typeName << methodName << "into" + << typeFilePath; + + QDomDocument defDoc; + QFile defFile(defFilePath); + if ( !defFile.open(QIODevice::ReadOnly) || + !defDoc.setContent(&defFile, &parseError, &line, &column) ) + { + qWarning() << "Error parsing:" << defFilePath + << parseError << line << column; + continue; + } + + QDomElement memberdef; + QDomNodeList memberdefs = defDoc.elementsByTagName("memberdef"); + for (int k = 0; k < memberdefs.size(); ++k) + { + QDomElement tmpMBD = memberdefs.item(k).toElement(); + QString tmpId = tmpMBD.attributes().namedItem("id").nodeValue(); + QString tmpKind = tmpMBD.attributes().namedItem("kind").nodeValue(); + QDomNodeList tmpJsonApiTagList(tmpMBD.elementsByTagName("jsonapi")); + + if( tmpJsonApiTagList.count() && tmpId == refid && + tmpKind == "function") + { + QDomElement tmpJsonApiTag = tmpJsonApiTagList.item(0).toElement(); + QString tmpAccessValue; + if(tmpJsonApiTag.hasAttribute("access")) + tmpAccessValue = tmpJsonApiTag.attributeNode("access").nodeValue(); + + requiresAuth = "unauthenticated" != tmpAccessValue; + + if("manualwrapper" != tmpAccessValue) + memberdef = tmpMBD; + + break; + } + } + + if(memberdef.isNull()) continue; + + QString apiPath("/" + instanceName + "/" + methodName); + QString retvalType = memberdef.firstChildElement("type").text(); + QMap paramsMap; + QStringList orderedParamNames; + bool hasInput = false; + bool hasOutput = false; + bool hasSingleCallback = false; + bool hasMultiCallback = false; + QString callbackName; + QString callbackParams; + + QDomNodeList params = memberdef.elementsByTagName("param"); + for (int k = 0; k < params.size(); ++k) + { + QDomElement tmpPE = params.item(k).toElement(); + MethodParam tmpParam; + QString& pName(tmpParam.name); + QString& pType(tmpParam.type); + pName = tmpPE.firstChildElement("declname").text(); + QDomElement tmpDefval = tmpPE.firstChildElement("defval"); + if(!tmpDefval.isNull()) tmpParam.defval = tmpDefval.text(); + QDomElement tmpType = tmpPE.firstChildElement("type"); + pType = tmpType.text(); + if(pType.startsWith("const ")) pType.remove(0,6); + if(pType.startsWith("std::function")) + { + if(pType.endsWith('&')) pType.chop(1); + if(pName.startsWith("multiCallback")) + { + tmpParam.isMultiCallback = true; + hasMultiCallback = true; + } + else if(pName.startsWith("callback")) + { + tmpParam.isSingleCallback = true; + hasSingleCallback = true; + } + callbackName = pName; + callbackParams = pType; + } + else + { + pType.replace(QString("&"), QString()); + pType.replace(QString(" "), QString()); + } + + paramsMap.insert(tmpParam.name, tmpParam); + orderedParamNames.push_back(tmpParam.name); + } + + QDomNodeList parameternames = memberdef.elementsByTagName("parametername"); + for (int k = 0; k < parameternames.size(); ++k) + { + QDomElement tmpPN = parameternames.item(k).toElement(); + MethodParam& tmpParam = paramsMap[tmpPN.text()]; + QString tmpD = tmpPN.attributes().namedItem("direction").nodeValue(); + if(tmpD.contains("in")) + { + tmpParam.in = true; + hasInput = true; + } + if(tmpD.contains("out")) + { + tmpParam.out = true; + hasOutput = true; + } + } + + // Params sanity check + for( const MethodParam& pm : paramsMap) + if( !(pm.isMultiCallback || pm.isSingleCallback + || pm.in || pm.out) ) + return fatalError( + { "Parameter:", pm.name, "of:", apiPath, + "declared in:", headerRelPath, + "miss doxygen parameter direction attribute!", + defFile.fileName() }); + + QString functionCall("\t\t"); + if(retvalType != "void") + { + functionCall += retvalType + " retval = "; + hasOutput = true; + } + functionCall += instanceName + "->" + methodName + "("; + functionCall += orderedParamNames.join(", ") + ");\n"; + + qDebug() << instanceName << apiPath << retvalType << typeName + << methodName; + for (const QString& pn : orderedParamNames) + { + const MethodParam& mp(paramsMap[pn]); + qDebug() << "\t" << mp.type << mp.name << mp.in << mp.out; + } + + QString inputParamsDeserialization; + if(hasInput) + { + inputParamsDeserialization += + "\t\t{\n" + "\t\t\tRsGenericSerializer::SerializeContext& ctx(cReq);\n" + "\t\t\tRsGenericSerializer::SerializeJob j(RsGenericSerializer::FROM_JSON);\n"; + } + + QString outputParamsSerialization; + if(hasOutput) + { + outputParamsSerialization += + "\t\t{\n" + "\t\t\tRsGenericSerializer::SerializeContext& ctx(cAns);\n" + "\t\t\tRsGenericSerializer::SerializeJob j(RsGenericSerializer::TO_JSON);\n"; + } + + QString paramsDeclaration; + for (const QString& pn : orderedParamNames) + { + const MethodParam& mp(paramsMap[pn]); + paramsDeclaration += "\t\t" + mp.type + " " + mp.name; + if(!mp.defval.isEmpty()) + paramsDeclaration += " = " + mp.defval; + paramsDeclaration += ";\n"; + if(mp.in) + inputParamsDeserialization += "\t\t\tRS_SERIAL_PROCESS(" + + mp.name + ");\n"; + if(mp.out) + outputParamsSerialization += "\t\t\tRS_SERIAL_PROCESS(" + + mp.name + ");\n"; + } + + if(hasInput) inputParamsDeserialization += "\t\t}\n"; + if(retvalType != "void") + outputParamsSerialization += + "\t\t\tRS_SERIAL_PROCESS(retval);\n"; + if(hasOutput) outputParamsSerialization += "\t\t}\n"; + + QString sessionEarlyClose; + if(hasSingleCallback) + sessionEarlyClose = "session->close();"; + + QString sessionDelayedClose; + if(hasMultiCallback) + sessionDelayedClose = + "RsThread::async( [=]()" + "{" + "std::this_thread::sleep_for(" + "std::chrono::seconds(maxWait+120) );" + "auto lService = weakService.lock();" + "if(!lService || lService->is_down()) return;" + "lService->schedule( [=]()" + "{" + "auto session = weakSession.lock();" + "if(session && session->is_open())" + "session->close();" + "} );" + "} );"; + + QString callbackParamsSerialization; + + if(hasSingleCallback || hasMultiCallback || + ((callbackParams.indexOf('(')+2) < callbackParams.indexOf(')'))) + { + QString& cbs(callbackParamsSerialization); + + callbackParams = callbackParams.split('(')[1]; + callbackParams = callbackParams.split(')')[0]; + + cbs += "\t\t\tRsGenericSerializer::SerializeContext ctx;\n"; + + for (QString cbPar : callbackParams.split(',')) + { + bool isConst(cbPar.startsWith("const ")); + QChar pSep(' '); + bool isRef(cbPar.contains('&')); + if(isRef) pSep = '&'; + int sepIndex = cbPar.lastIndexOf(pSep)+1; + QString cpt(cbPar.mid(0, sepIndex)); + cpt.remove(0,6); + QString cpn(cbPar.mid(sepIndex)); + + cbs += "\t\t\tRsTypeSerializer::serial_process("; + cbs += "RsGenericSerializer::TO_JSON, ctx, "; + if(isConst) + { + cbs += "const_cast<"; + cbs += cpt; + cbs += ">("; + } + cbs += cpn; + if(isConst) cbs += ")"; + cbs += ", \""; + cbs += cpn; + cbs += "\" );\n"; + } + } + + QMap substitutionsMap; + substitutionsMap.insert("paramsDeclaration", paramsDeclaration); + substitutionsMap.insert("inputParamsDeserialization", inputParamsDeserialization); + substitutionsMap.insert("outputParamsSerialization", outputParamsSerialization); + substitutionsMap.insert("instanceName", instanceName); + substitutionsMap.insert("functionCall", functionCall); + substitutionsMap.insert("apiPath", apiPath); + substitutionsMap.insert("sessionEarlyClose", sessionEarlyClose); + substitutionsMap.insert("sessionDelayedClose", sessionDelayedClose); + substitutionsMap.insert("callbackName", callbackName); + substitutionsMap.insert("callbackParams", callbackParams); + substitutionsMap.insert("callbackParamsSerialization", callbackParamsSerialization); + substitutionsMap.insert("requiresAuth", requiresAuth ? "true" : "false"); + + QString templFilePath(sourcePath); + if(hasMultiCallback || hasSingleCallback) + templFilePath.append("/async-method-wrapper-template.cpp.tmpl"); + else templFilePath.append("/method-wrapper-template.cpp.tmpl"); + + QFile templFile(templFilePath); + templFile.open(QIODevice::ReadOnly); + QString wrapperDef(templFile.readAll()); + + QMap::iterator it; + for ( it = substitutionsMap.begin(); + it != substitutionsMap.end(); ++it ) + wrapperDef.replace(QString("$%"+it.key()+"%$"), QString(it.value()), Qt::CaseSensitive); + + wrappersDefFile.write(wrapperDef.toLocal8Bit()); + + cppApiIncludesSet.insert("#include \"" + headerRelPath + "\"\n"); + } + } + } + + for(const QString& incl : cppApiIncludesSet) + cppApiIncludesFile.write(incl.toLocal8Bit()); + + return 0; +} diff --git a/jsonapi-generator/src/jsonapi-generator.pro b/jsonapi-generator/src/jsonapi-generator.pro new file mode 100644 index 000000000..1d6c45d91 --- /dev/null +++ b/jsonapi-generator/src/jsonapi-generator.pro @@ -0,0 +1,11 @@ +# SPDX-FileCopyrightText: (C) 2004-2019 Retroshare Team +# SPDX-License-Identifier: CC0-1.0 + +TARGET = jsonapi-generator + +CONFIG += qt + +QT *= core xml +QT -= gui + +SOURCES += jsonapi-generator.cpp diff --git a/jsonapi-generator/src/method-wrapper-template.cpp.tmpl b/jsonapi-generator/src/method-wrapper-template.cpp.tmpl new file mode 100644 index 000000000..a3927fba9 --- /dev/null +++ b/jsonapi-generator/src/method-wrapper-template.cpp.tmpl @@ -0,0 +1,50 @@ +/******************************************************************************* + * RetroShare JSON API * + * * + * Copyright (C) 2018-2019 Gioacchino Mazzurco * + * * + * 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 . * + * * + *******************************************************************************/ + +registerHandler( "$%apiPath%$", + [](const std::shared_ptr session) +{ + size_t reqSize = session->get_request()->get_header("Content-Length", 0); + session->fetch( reqSize, []( + const std::shared_ptr 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%$ ); + diff --git a/libbitdht/src/LICENSE.md b/libbitdht/src/LICENSE.md deleted file mode 100644 index 02a410748..000000000 --- a/libbitdht/src/LICENSE.md +++ /dev/null @@ -1,136 +0,0 @@ -# GNU LIBRARY GENERAL PUBLIC LICENSE - -Version 2, June 1991 - -Copyright (C) 1991 Free Software Foundation, Inc. -51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA -Everyone is permitted to copy and distribute verbatim copies -of this license document, but changing it is not allowed. - -[This is the first released version of the library GPL. It is - numbered 2 because it goes with version 2 of the ordinary GPL.] -Preamble - -The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. - -This license, the Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, too. - -When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. - -To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library, or if you modify it. - -For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights. - -Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. - -Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, so that any problems introduced by others will not reflect on the original authors' reputations. - -Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. - -Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. - -The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. - -Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. - -However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. - -The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, while the latter only works together with the library. - -Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. - -## TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - -0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library General Public License (also called "this License"). Each licensee is addressed as "you". - -A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. - -The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) - -"Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. - -Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. - -1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. - -You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. - -2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: - -a) The modified work must itself be a software library. -b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. -c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. -d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. -(For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. - -3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. - -Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. - -This option is useful when you wish to copy part of the code of the Library into a program that is not a library. - -4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. - -If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. - -5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. - -However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. - -When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. - -If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) - -Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. - -6. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. - -You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: - -a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) -b) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. -c) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. -d) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. -For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. - -It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. - -7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: - -a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. -b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. -8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. - -9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. - -10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. - -11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. - -This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. - -12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. - -13. The Free Software Foundation may publish revised and/or new versions of the Library General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. - -14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. - -### NO WARRANTY - -15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - -16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - -# END OF TERMS AND CONDITIONS diff --git a/libbitdht/src/README.txt b/libbitdht/src/README.txt index 8f4daabf2..a1dff67e4 100644 --- a/libbitdht/src/README.txt +++ b/libbitdht/src/README.txt @@ -1,3 +1,5 @@ +# SPDX-FileCopyrightText: (C) 2004-2019 Retroshare Team +# SPDX-License-Identifier: CC0-1.0 What's in the Package --------------------------------------------------------------- diff --git a/libbitdht/src/bitdht/bdaccount.cc b/libbitdht/src/bitdht/bdaccount.cc index 6246b0241..57de177f7 100644 --- a/libbitdht/src/bitdht/bdaccount.cc +++ b/libbitdht/src/bitdht/bdaccount.cc @@ -1,27 +1,24 @@ -/* - * bitdht/bdaccount.cc - * - * BitDHT: An Flexible DHT library. - * - * Copyright 2011 by Robert Fernie - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 3 as published by the Free Software Foundation. - * - * This library 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 - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "bitdht@lunamutt.com". - * - */ +/******************************************************************************* + * bitdht/bdaccount.cc * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2011 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include "bitdht/bdaccount.h" diff --git a/libbitdht/src/bitdht/bdaccount.h b/libbitdht/src/bitdht/bdaccount.h index 5e9b6cc61..7116e3ced 100644 --- a/libbitdht/src/bitdht/bdaccount.h +++ b/libbitdht/src/bitdht/bdaccount.h @@ -1,30 +1,27 @@ #ifndef BITDHT_ACCOUNT_H #define BITDHT_ACCOUNT_H -/* - * bitdht/bdaccount.h - * - * BitDHT: An Flexible DHT library. - * - * Copyright 2011 by Robert Fernie - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 3 as published by the Free Software Foundation. - * - * This library 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 - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "bitdht@lunamutt.com". - * - */ +/******************************************************************************* + * bitdht/bdaccount.h * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2011 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include #include diff --git a/libbitdht/src/bitdht/bdboot.txt b/libbitdht/src/bitdht/bdboot.txt index 26fa614f6..6729c6218 100644 --- a/libbitdht/src/bitdht/bdboot.txt +++ b/libbitdht/src/bitdht/bdboot.txt @@ -1,500 +1,1004 @@ -61.81.86.213 50071 -2.89.235.12 18179 -139.192.128.54 54575 -61.224.74.1 45106 -76.189.15.171 28937 -80.98.74.161 54545 -110.137.230.187 1024 -118.10.139.25 15548 -174.2.19.15 11071 -124.106.250.65 2322 -94.208.10.154 52432 -176.9.35.88 2036 -47.9.158.37 2049 -88.174.58.215 51413 -78.60.4.214 6881 -78.119.213.102 44822 -189.150.157.153 16610 -88.217.31.208 7813 -125.1.181.171 22749 -210.136.215.55 6881 -151.236.7.73 57559 -105.227.47.34 35549 -211.47.87.58 62348 -175.152.60.168 16138 -85.195.226.115 5888 -46.191.196.157 49001 -118.200.194.97 6881 -151.70.147.15 58783 -95.150.185.164 6882 -163.44.160.81 6881 -88.149.179.95 6881 -121.176.181.60 58387 -52.40.120.56 6892 -51.175.237.18 15937 -178.204.71.144 48016 -95.31.49.9 9425 -108.196.87.74 24929 -77.37.160.170 1242 -135.0.8.24 57673 -150.242.197.4 39025 -202.231.169.253 21947 -1.36.227.158 9979 -60.130.54.195 26585 -92.39.216.40 23585 -104.208.36.117 50215 -79.253.173.153 58428 -178.45.90.225 26330 -210.139.186.89 22645 -151.49.55.78 51413 -2.32.208.156 51413 -51.255.58.0 51412 -23.88.236.63 51413 -13.69.158.91 45168 -92.134.139.162 10004 -24.75.160.81 53965 -98.202.170.205 41731 -62.76.100.235 22948 -79.100.105.242 14363 -175.156.161.33 22696 101.161.11.165 40232 -134.255.216.133 46771 -195.88.15.161 7743 -59.133.235.34 12525 -105.179.0.54 12806 -175.207.170.224 51967 -174.99.71.36 53440 -109.182.250.11 24255 -126.12.199.252 27499 -176.9.62.3 29342 -158.181.69.37 6881 -153.174.200.3 48948 -122.116.3.18 26552 -5.51.197.239 6881 -93.84.33.191 55762 -78.46.147.99 51413 -101.184.93.144 51413 -85.25.218.207 6888 -37.15.161.58 51413 -84.245.120.26 51413 -37.204.196.34 42929 -92.233.185.151 51413 -212.77.130.215 51413 -41.189.37.70 28295 -128.68.14.3 17098 -124.190.99.84 9648 -91.219.237.220 4087 -90.126.31.47 50000 -109.200.44.44 50321 -79.189.118.198 6881 -118.6.183.223 22360 -24.226.116.194 8547 -69.146.24.229 34202 -62.101.135.20 1029 -82.240.4.144 16729 -157.48.187.25 50321 -24.211.171.122 10349 -78.31.66.180 5307 -94.180.0.78 23879 -74.76.197.221 29154 -88.169.1.120 59258 -73.15.30.22 44905 -123.114.190.10 6881 -151.80.42.103 51413 -80.140.156.164 37500 -71.84.138.32 52296 -95.92.232.20 51413 -81.93.207.145 20963 -218.215.67.196 39700 -115.164.89.228 16588 -80.234.86.220 60386 -31.42.125.83 46470 -220.123.202.121 50427 -176.53.233.37 28697 -88.165.34.61 41708 -104.208.36.117 53133 -95.90.215.112 37742 -78.131.13.232 55633 -37.113.129.221 36551 -52.169.220.77 37717 -73.173.111.92 63666 -223.16.73.77 22303 -211.133.97.200 10467 -122.106.249.6 6881 -136.0.2.148 51413 -5.140.20.202 11609 -78.253.242.10 59410 -61.63.158.180 48321 -79.101.160.169 1453 -42.124.217.110 7789 -174.53.251.142 38400 -114.47.108.52 24637 -61.62.186.193 8442 -87.97.253.69 50649 -62.76.100.235 41047 -23.96.202.54 54203 -91.216.66.81 36678 -96.237.181.232 7915 -178.88.8.9 49001 -92.131.55.187 40332 -149.154.157.153 56789 -124.244.71.126 23173 -106.161.218.95 24577 -111.220.54.30 12861 -186.118.170.98 41824 -128.76.148.62 27027 -171.6.243.206 19401 -94.244.35.192 51413 -93.78.138.118 50567 -79.100.51.243 18404 -85.59.159.50 49001 -46.191.226.4 28344 -178.132.253.156 51413 101.175.156.170 61680 -76.125.33.68 54526 -77.135.115.253 9050 -50.191.160.70 20789 -107.184.38.87 43033 -2.138.139.164 62284 -95.25.229.186 6889 -213.127.73.24 4985 -162.224.188.31 7565 -76.22.35.229 16612 -96.49.182.210 21859 -83.240.93.202 51413 -65.95.73.182 42970 -42.2.41.156 24462 -135.23.129.163 61896 -188.194.127.171 39980 -84.75.22.54 51413 -212.50.134.32 49382 -147.32.203.245 55093 -91.89.196.37 61799 -2.26.160.4 26398 -95.222.150.218 38337 -60.248.95.76 6881 -216.126.213.67 25513 -62.235.217.73 61835 -176.50.116.149 17994 -66.8.165.71 16020 -74.140.153.59 59286 -81.153.207.27 51413 -203.219.80.229 54622 -58.168.124.241 3750 -86.237.133.79 51413 -178.253.199.55 1367 -46.19.85.245 50321 -194.199.26.8 43287 -118.8.19.13 6881 -37.222.221.222 8621 -37.131.222.30 21517 -87.78.153.16 5011 -46.127.246.32 40085 -24.6.186.56 34502 -161.184.231.117 6882 +101.184.93.144 51413 101.186.180.208 51413 -37.49.169.66 28133 -218.252.251.52 17648 -70.48.173.172 3504 -94.23.5.218 6881 -85.64.151.207 44822 -173.164.232.205 51413 -41.246.76.233 42181 -89.27.163.34 55315 -88.24.180.250 6249 -153.179.97.18 16218 -180.129.113.209 48695 -151.21.4.28 53210 -46.191.226.4 59982 -37.204.23.144 44822 -78.149.99.103 22683 -119.51.164.126 8568 -79.160.104.5 2513 -68.59.158.23 39460 -72.176.18.24 6881 -81.23.7.233 9224 -94.30.170.21 7105 -126.57.10.151 22962 -112.186.123.102 51413 -94.236.246.217 15554 -175.160.193.44 51413 -5.198.60.36 49007 -177.239.14.15 23036 -23.102.24.179 37253 -76.103.53.99 40573 -220.239.238.43 51413 -185.34.3.150 6881 -80.98.17.100 51413 +103.197.33.53 14354 +103.27.109.109 6884 +103.50.76.50 11623 +103.51.54.19 59914 +104.208.36.117 50215 +104.208.36.117 53133 +105.104.153.96 56532 +105.179.0.54 12806 +105.227.47.34 35549 +105.236.34.74 43961 +106.161.218.95 24577 +107.184.38.87 43033 +107.185.79.233 10278 +107.9.243.80 24112 +108.160.185.132 31530 +108.196.87.74 24929 +108.242.252.38 39304 +108.254.5.66 58192 +109.11.38.68 61722 +109.124.197.42 31559 +109.130.31.27 11460 109.168.199.53 6881 -213.46.132.81 50321 -31.185.5.4 10733 -188.37.221.51 50321 -5.18.182.29 51653 +109.174.3.81 51413 +109.182.250.11 24255 +109.184.163.146 11789 +109.187.114.190 49001 +109.194.234.36 14342 +109.197.191.45 19604 +109.200.44.44 50321 +109.209.40.17 55542 +109.211.143.205 13722 +109.214.57.82 1042 +109.28.82.4 33620 109.64.128.248 50321 -86.46.36.146 10124 -194.154.216.89 50321 -213.83.135.109 50321 -213.57.219.99 50321 -31.223.216.83 50321 -37.104.125.16 50321 -64.25.21.15 37321 -85.107.174.75 50321 -62.140.137.49 3706 -85.25.237.46 6887 -92.90.21.108 49760 -85.25.218.207 6884 -85.25.237.46 6882 +109.72.144.240 41290 +109.8.154.28 19120 +110.137.230.187 1024 +111.15.147.164 16001 +111.184.247.170 19087 +111.220.54.30 12861 +111.242.54.149 15979 +111.250.149.202 25863 +112.120.144.128 60152 +112.173.11.227 63314 +112.186.123.102 51413 +112.196.147.151 16425 +112.203.171.200 25932 +112.206.13.117 41825 +112.209.16.158 19102 +112.234.202.158 16001 +113.161.204.192 6881 +113.162.247.40 3800 +113.83.226.37 51413 +114.185.184.10 23151 +114.224.40.181 51413 +114.32.184.15 25962 +114.32.211.85 30116 +114.32.76.93 51413 +114.34.239.242 22647 +114.34.46.63 6881 +114.37.154.22 16120 +114.38.14.84 16958 +114.38.21.113 7694 +114.40.109.55 7841 +114.42.47.178 9089 +114.47.108.52 24637 +114.79.138.158 60635 +115.164.89.228 16588 +115.240.98.113 51413 +1.161.107.196 31811 +116.98.141.220 44824 +1.172.161.190 17526 +118.10.139.25 15548 +118.160.199.38 51532 +118.160.199.38 51651 +118.160.199.38 59277 +118.160.199.38 60134 +118.160.199.38 61182 +118.160.199.38 63151 +118.160.199.38 63400 +118.160.199.38 63619 +118.163.92.217 6881 +118.173.219.156 12148 +118.184.27.144 6881 +118.189.195.210 51413 +118.200.194.97 6881 +118.32.175.216 49802 +118.6.183.223 22360 +118.8.19.13 6881 +119.131.41.152 1231 +119.196.44.47 51763 +119.201.103.241 62715 +119.202.178.119 45249 +119.47.150.27 51294 +119.51.164.126 8568 +119.74.54.94 6881 +119.96.130.9 12038 +120.146.228.149 6881 +120.208.30.229 16001 +121.141.14.57 30323 +121.176.181.60 58387 +121.214.57.226 51413 +121.219.232.47 65073 +121.223.47.224 41563 +121.75.175.91 10146 +122.106.249.6 6881 +122.116.3.18 26552 +122.134.166.111 7105 +122.135.89.118 25051 +122.150.64.247 17132 +122.174.156.164 15004 +122.252.197.103 32378 +123.110.104.200 29499 +123.114.190.10 6881 +123.139.45.71 16001 +123.195.214.39 20846 +123.50.62.239 9433 +124.106.250.65 2322 +124.149.151.181 33603 +124.181.64.21 24406 +124.190.99.84 9648 +124.244.71.126 23173 +124.45.37.197 21084 +125.1.181.171 22749 +125.193.100.191 21802 +126.12.199.252 27499 +126.57.10.151 22962 +126.57.182.134 16514 +128.68.106.214 36595 +128.68.14.3 17098 +128.76.148.62 27027 +129.21.122.81 32785 130.193.244.41 15090 -85.25.218.207 6886 -202.62.94.74 39272 +130.43.29.146 52526 +130.89.165.24 10110 +132.147.102.21 1024 +133.130.90.125 6883 +134.236.242.96 1024 +134.255.216.133 46771 +135.0.8.24 57673 +135.23.129.163 57581 +135.23.129.163 61896 +135.23.129.163 61982 +136.0.2.148 51413 +1.36.227.158 9979 +13.69.158.91 45168 137.97.231.32 50321 +138.199.66.212 26174 +13.89.52.33 51409 +139.192.128.54 54575 +141.105.71.92 6881 +14.133.76.62 8771 +14.162.199.2 3800 +142.161.41.171 41788 +142.163.53.182 58144 +142.59.218.136 11300 +147.32.203.245 55093 +149.154.157.153 56789 +150.242.197.4 39025 +151.21.4.28 53210 +151.229.110.52 11163 +151.236.7.73 57559 +151.237.43.164 59133 +151.25.110.226 49289 +151.49.55.78 51413 +151.62.32.183 51413 +151.70.147.15 58783 +151.80.42.103 51413 +153.174.200.3 48948 +153.179.56.36 51413 +153.179.97.18 16218 +157.48.187.25 50321 157.49.171.10 50321 -45.76.69.49 6881 -178.32.216.187 6881 -77.180.216.131 24988 +157.7.109.77 6881 +158.181.69.37 6881 +158.193.227.67 8621 +161.184.231.117 6882 +162.224.188.31 7565 +163.44.160.81 6881 +164.215.87.224 57073 +165.132.236.14 25390 +169.149.196.18 50321 +171.6.243.206 19401 +171.97.173.243 9327 172.10.50.156 51413 172.56.7.143 18972 -89.248.171.137 6881 -185.34.3.103 6881 -185.34.3.20 6881 -185.34.3.172 6881 -68.227.56.45 57278 -122.252.197.103 32378 -112.196.147.151 16425 -90.27.140.90 1347 -176.241.133.130 49001 -23.252.55.56 29633 -36.225.186.145 25184 -14.162.199.2 3800 -62.76.100.235 34251 -42.126.157.252 22033 -95.111.46.227 18466 -68.0.53.95 11464 -213.111.37.228 9858 -37.208.66.86 30260 -91.105.156.125 1025 -116.98.141.220 44824 -183.82.1.44 59818 -41.210.224.40 11953 -114.40.109.55 7841 -51.141.3.234 31256 -81.45.175.39 33652 -62.76.100.235 40077 -80.249.65.131 9800 -94.233.110.175 49001 -61.57.113.156 1028 -92.46.228.108 26675 -46.101.56.83 30264 -87.110.236.117 64810 -62.76.100.235 33748 -91.121.136.132 59001 -61.89.6.203 19474 -23.102.24.179 33961 -78.73.38.9 11423 -40.117.89.72 24427 -52.228.47.105 39376 -67.188.183.70 41082 -62.76.100.235 39415 -92.234.58.147 13285 -62.76.100.235 43085 -213.152.161.101 34261 -124.181.64.21 24406 -103.51.54.19 59914 -62.76.100.235 28212 -69.175.34.187 28566 -27.194.238.27 6881 -194.176.114.54 28436 -77.28.66.239 15514 -113.162.247.40 3800 -92.58.106.183 8621 -61.57.118.157 25147 -90.31.140.85 16185 -126.57.182.134 16514 -219.251.128.233 50506 -52.43.139.55 6992 -89.78.249.54 49001 -90.116.231.10 33026 -5.187.143.52 6889 -124.45.37.197 21084 -39.84.172.237 6881 -190.29.115.127 10006 -86.252.48.255 59566 -27.117.108.178 56753 -60.128.90.71 15510 -128.68.106.214 36595 -92.45.192.16 22222 -135.23.129.163 61982 +172.87.31.56 6884 +173.164.232.205 51413 +173.31.76.104 21757 173.68.196.23 60073 -93.84.33.191 22071 -192.253.252.34 6881 -178.150.91.123 37787 -67.197.217.74 52624 -82.211.130.137 29777 -181.168.56.109 19567 -61.178.110.205 16001 -178.48.170.64 62331 -89.110.53.186 41210 -151.237.43.164 59133 -109.187.114.190 49001 -213.136.83.168 20024 -60.138.177.136 47243 -52.40.120.56 6992 -83.9.248.251 51413 -52.43.139.55 6892 -92.156.86.247 56432 -45.32.254.211 6881 -52.49.71.160 6892 -76.66.171.131 15021 -218.173.174.50 27069 -134.236.242.96 1024 -52.57.20.58 6992 -27.130.112.202 25477 +173.73.46.92 52828 +174.100.51.253 44460 +174.101.153.252 38195 +174.117.49.59 13052 +174.119.150.115 17065 +174.2.19.15 11071 +174.48.201.143 41918 +174.53.251.142 38400 +174.71.20.57 52193 +174.99.71.36 53440 175.138.57.51 18065 -95.31.49.9 9424 -52.40.7.160 6892 -52.57.140.142 6892 +175.151.131.80 16001 +175.152.60.168 16138 +175.156.161.33 22696 +175.156.223.157 22300 +175.160.193.44 51413 +175.207.170.224 51967 +176.104.214.178 59611 +176.108.146.88 6881 +176.212.60.108 60378 +176.214.214.73 64892 +176.214.76.87 7047 +176.226.153.243 61967 +176.241.133.130 49001 +176.31.109.159 24586 +176.31.248.87 6338 +176.49.172.107 49001 +176.50.116.149 17994 +176.53.233.37 28697 +176.9.113.77 61059 +176.9.35.88 2036 +176.9.62.3 29342 +176.97.212.163 22523 +177.239.14.15 23036 +177.32.251.226 27655 +177.5.36.152 12588 +178.120.85.170 24550 +178.122.199.251 16480 +178.132.253.156 51413 +178.137.112.35 14571 +178.140.169.137 22922 +178.148.68.18 53318 +178.150.91.123 37787 +178.150.91.123 8314 +178.168.58.44 23476 +178.185.98.43 12420 +178.204.71.144 26612 +178.204.71.144 48016 +178.219.38.34 1024 +178.221.81.112 59014 +178.253.199.55 1367 +178.32.185.12 6544 +178.32.216.187 6881 +178.35.204.111 6881 +178.36.198.215 22849 +178.44.187.32 52209 +178.45.159.135 31825 +178.45.90.225 26330 +178.48.170.64 62331 +178.72.159.43 47954 +178.88.3.227 33031 +178.88.8.9 49001 +178.89.100.227 6881 +180.129.113.209 48695 +180.183.213.112 11823 +180.18.98.235 29543 +180.64.39.48 14708 +181.168.56.109 19567 +182.177.228.43 31532 +182.210.49.84 11993 +182.53.45.3 14895 +183.109.112.49 58359 +183.82.1.44 59818 +183.89.3.101 10618 +184.145.109.37 31067 +184.146.76.179 13586 +184.147.116.143 49025 +184.166.72.229 63472 +184.18.8.33 8784 +184.41.75.34 57537 +184.89.243.73 43344 +185.157.221.247 25401 +185.21.217.59 37045 +185.34.3.103 6881 +185.34.3.150 6881 +185.34.3.172 6881 +185.34.3.20 6881 +186.118.170.98 41824 +186.254.61.185 40200 +186.4.42.27 20837 +186.54.1.246 38354 +188.121.244.133 10980 +188.142.164.252 43063 +188.164.212.104 28566 +188.168.14.169 1376 +188.176.218.22 35407 +188.186.13.95 21313 +188.187.45.126 43757 +188.194.127.171 39980 +188.224.10.109 46059 +188.231.143.20 6881 +188.232.61.83 6881 +188.235.149.202 63083 +188.25.246.130 16313 +188.37.221.51 50321 +188.49.25.79 46883 +188.72.98.36 15503 +188.77.246.133 35496 +189.150.157.153 16610 +189.5.22.202 52412 +189.54.195.49 50555 +190.29.115.127 10006 +190.60.48.165 41301 +190.88.179.253 20701 +192.253.252.34 6881 +193.160.224.34 29787 +193.253.220.184 6881 +193.77.159.24 43611 +194.154.216.89 50321 +194.176.114.54 28436 +194.199.26.8 43287 +195.154.136.170 55040 +195.222.95.57 51413 +195.234.21.119 6881 +195.240.45.224 6881 +195.245.221.35 36132 +195.88.15.161 7743 +197.87.68.102 25317 +199.127.250.15 29015 +201.252.144.11 15506 +201.53.229.60 1041 +201.83.71.123 50579 +202.231.169.253 21947 +202.62.94.74 39272 +203.198.141.201 7453 +203.213.94.200 14161 +203.219.80.229 54622 +203.87.14.9 51413 +205.209.160.171 6881 +207.224.196.66 10731 +207.255.112.154 6881 +208.101.109.128 53329 +209.195.77.83 34603 +210.136.215.55 6881 +210.139.186.89 22645 +210.195.47.196 19861 +211.133.168.214 44631 +211.133.97.200 10467 +211.14.227.69 23292 +211.217.2.251 41870 +211.47.87.58 62348 +2.1.187.15 50269 +212.129.33.50 6881 +212.129.33.59 6881 +212.21.13.209 56909 +212.45.81.173 16427 +212.49.47.32 19949 +212.50.134.32 49382 +212.74.222.13 38345 +212.77.130.215 51413 +213.111.37.228 9858 +213.112.177.129 43304 +213.114.48.42 38511 +213.127.73.24 4985 +213.136.83.168 20024 +213.152.161.101 34261 +213.167.206.125 38106 +213.174.60.46 17919 +213.231.145.208 12306 +213.245.41.143 40018 +213.251.184.146 64347 +213.26.96.117 27807 +213.27.20.223 53410 +213.46.132.81 50321 +213.57.219.99 50321 +2.138.139.164 62284 +213.83.135.109 50321 +216.126.213.67 25513 +216.151.180.79 3575 +217.12.220.238 51413 +217.165.53.221 24579 +217.209.125.15 26155 +217.29.187.23 62523 +217.76.184.18 51413 +218.161.29.209 20472 +218.173.174.50 27069 +218.215.67.196 39700 +218.252.251.52 17648 +219.251.128.233 50506 +219.84.184.204 61337 +220.100.126.4 24435 +220.120.236.151 11393 +220.123.202.121 50427 +220.136.37.144 27075 +220.143.1.39 19780 +220.161.21.128 6881 +220.18.72.3 64774 +220.239.238.43 51413 +221.118.191.176 17563 +221.127.216.99 21461 +221.217.171.96 28947 +221.76.232.11 51413 +223.16.68.18 6881 +223.16.73.77 22303 +223.18.249.29 7221 +223.219.73.227 17107 +223.247.194.12 16001 +2.26.160.4 26398 +23.102.24.179 33961 +23.102.24.179 37253 +23.16.200.217 51413 +2.32.208.156 51413 +23.252.167.81 6881 +23.252.55.56 29633 +23.27.125.26 3124 +23.88.236.63 51413 +23.96.202.54 54203 +24.128.39.166 5223 +24.144.184.102 14888 +24.211.171.122 10349 +24.226.116.194 8547 +24.6.186.56 34502 +24.75.160.81 53965 +24.78.8.98 6884 +2.51.116.185 63433 +27.117.108.178 56753 +27.130.112.202 25477 +27.194.238.27 6881 +2.89.235.12 18179 +2.94.72.90 27587 +31.147.61.11 23853 +31.185.5.4 10733 +31.220.168.41 35190 +31.223.216.83 50321 +31.35.57.129 13924 +31.42.125.83 46470 +31.8.136.66 11996 +31.8.71.71 10170 +36.225.186.145 25184 +37.104.125.16 50321 +37.107.121.203 18429 +37.110.127.110 6881 +37.113.129.221 36551 +37.131.222.30 21517 +37.15.161.58 51413 +37.201.195.67 26515 +37.204.196.34 42929 +37.204.23.144 44822 +37.208.66.86 30260 +37.218.190.131 35691 +37.222.221.222 8621 +37.229.60.103 6881 +37.235.150.240 47003 +37.235.207.247 30166 +37.49.169.66 28133 +37.59.55.58 51413 +38.132.51.41 53369 +39.84.172.237 6881 +40.117.89.72 24427 +41.189.37.70 28295 +41.210.224.40 11953 +41.212.221.164 33050 +41.246.76.233 42181 +41.45.41.123 18636 +42.124.217.110 7789 +42.126.157.252 22033 +42.2.41.156 24462 +43.255.188.4 6881 +45.242.102.235 10588 +45.32.254.211 6881 +45.63.55.106 6884 +45.63.57.15 6881 +45.76.69.49 6881 +46.101.56.83 30264 +46.103.53.38 61299 +46.108.17.98 10419 +46.116.177.103 22754 +46.118.116.209 20711 +46.118.83.183 12324 +46.119.196.109 19075 +46.127.246.32 40085 +46.138.37.148 59039 +46.180.245.79 53580 +46.187.88.219 48529 +46.188.32.80 65535 +46.191.196.157 49001 +46.191.225.36 14692 +46.191.226.4 28344 +46.191.226.4 59982 +46.19.85.245 50321 +46.211.113.5 49001 +46.22.234.12 14916 +46.29.147.201 20232 +46.37.83.122 37389 +46.41.109.26 39584 +46.42.23.240 53559 +46.48.90.11 55025 +46.61.12.234 49001 +46.8.136.196 57085 +47.145.143.92 24585 +47.9.158.37 2049 +49.145.59.194 38935 +49.213.154.99 10087 +50.0.146.178 51413 +50.113.92.209 6881 +50.191.160.70 20789 +50.201.138.122 10228 +50.43.117.21 42660 +50.53.143.88 57568 +50.71.135.98 20332 +50.72.81.218 6881 +50.83.34.19 23846 +51.141.3.234 31256 +51.175.237.18 15937 +5.12.126.206 34538 +51.235.58.9 16552 +51.255.58.0 51412 +5.13.18.103 24121 +5.140.20.202 11609 +5.149.211.210 22277 +5.165.66.132 63326 +5.18.182.29 51653 +5.187.143.52 6889 +5.198.60.36 49007 +52.10.254.137 6992 +52.169.220.77 27456 +52.169.220.77 37717 +52.187.56.29 27076 +52.228.47.105 39376 +5.227.122.6 3751 +52.29.243.196 6892 52.29.58.236 6892 52.29.58.236 6992 -132.147.102.21 1024 -91.151.203.4 21833 -77.203.253.126 33334 -52.49.71.160 6992 -62.117.149.142 20425 -80.8.119.70 48082 -122.135.89.118 25051 -86.241.109.212 1024 -52.30.149.135 6992 -64.34.187.221 4926 -78.57.193.191 46040 -118.163.92.217 6881 -220.143.1.39 19780 -217.12.220.238 51413 -89.110.53.186 49787 -103.27.109.109 6884 -99.255.185.162 912 -109.11.38.68 61722 -211.14.227.69 23292 -78.224.174.190 3908 -46.103.53.38 61299 -178.204.71.144 26612 -79.251.43.82 56107 -90.79.215.246 63040 -151.229.110.52 11163 -122.134.166.111 7105 -87.191.160.44 61212 -73.19.47.61 15685 -93.188.8.35 43842 52.30.149.135 6892 -221.217.171.96 28947 -51.235.58.9 16552 -169.149.196.18 50321 -158.193.227.67 8621 -223.247.194.12 16001 -5.227.122.6 3751 -89.3.231.151 45960 -212.129.33.50 6881 -91.241.236.6 49001 -90.207.148.109 51413 -119.47.150.27 51294 -52.187.56.29 27076 -46.108.17.98 10419 -185.21.217.59 37045 -178.32.185.12 6544 -176.214.76.87 7047 -91.222.89.195 49001 -45.242.102.235 10588 -81.75.221.92 49855 -173.31.76.104 21757 -176.104.214.178 59611 -118.32.175.216 49802 -218.161.29.209 20472 -103.197.33.53 14354 -113.83.226.37 51413 -95.208.144.94 6881 -52.57.140.142 6992 -83.252.149.71 42945 -125.193.100.191 21802 -85.17.127.168 38557 -52.169.220.77 27456 -77.239.87.77 10344 -85.74.189.101 53149 -95.76.164.90 64529 -175.156.223.157 22300 -59.25.226.139 52413 -213.26.96.117 27807 -107.185.79.233 10278 -203.87.14.9 51413 -61.219.68.63 15465 -37.201.195.67 26515 -92.238.93.208 53280 -111.250.149.202 25863 -178.150.91.123 8314 -122.150.64.247 17132 -220.100.126.4 24435 -47.145.143.92 24585 -153.179.56.36 51413 -91.121.16.72 51413 -98.234.210.209 51413 -178.221.81.112 59014 -121.75.175.91 10146 -195.154.136.170 55040 -95.47.197.189 49001 -85.26.92.236 29761 -107.9.243.80 24112 -62.210.90.181 6881 -82.224.22.64 15190 -92.37.142.2 62290 -195.245.221.35 36132 -72.188.223.147 41910 -13.89.52.33 51409 -95.84.255.47 51413 -90.231.4.40 6881 -151.62.32.183 51413 -114.224.40.181 51413 -65.95.195.245 49706 -52.10.254.137 6992 -93.21.41.89 58623 -123.50.62.239 9433 -103.50.76.50 11623 -118.189.195.210 51413 -79.52.149.182 6881 -50.72.81.218 6881 -52.57.20.58 6892 -223.16.68.18 6881 -111.184.247.170 19087 -193.160.224.34 29787 -188.168.14.169 1376 -14.133.76.62 8771 -114.32.76.93 51413 -141.105.71.92 6881 -90.65.17.120 24080 -216.151.180.79 3575 -135.23.129.163 57581 -77.180.216.131 5249 -52.29.243.196 6892 -37.235.150.240 47003 -46.191.225.36 14692 +52.30.149.135 6992 +52.40.120.56 6892 +52.40.120.56 6992 +52.40.7.160 6892 +52.43.139.55 6892 +52.43.139.55 6992 52.48.137.241 6992 -81.21.216.18 22828 -178.219.38.34 1024 -43.255.188.4 6881 -221.76.232.11 51413 -49.213.154.99 10087 -105.104.153.96 56532 -93.90.227.17 49001 -71.233.72.165 39789 -118.184.27.144 6881 -58.94.255.72 25896 -118.173.219.156 12148 -38.132.51.41 53369 -205.209.160.171 6881 -45.63.55.106 6884 -157.7.109.77 6881 -172.87.31.56 6884 -23.252.167.81 6881 -45.63.57.15 6881 -220.161.21.128 6881 -133.130.90.125 6883 +52.49.71.160 6892 +52.49.71.160 6992 +52.57.140.142 6892 +52.57.140.142 6992 +52.57.20.58 6892 +52.57.20.58 6992 +5.2.58.49 49001 52.78.176.27 6881 -23.27.125.26 3124 -46.188.32.80 65535 +5.51.197.239 6881 +58.168.124.241 3750 +58.7.210.130 51413 +58.94.255.72 25896 +59.133.235.34 12525 +59.25.226.139 52413 +60.128.90.71 15510 +60.130.54.195 26585 +60.138.177.136 47243 +60.241.209.107 57588 +60.241.87.17 24478 +60.248.95.76 6881 +61.178.110.205 16001 +61.219.68.63 15465 +61.224.74.1 45106 +61.57.113.156 1028 +61.57.118.157 25147 +61.62.186.193 8442 +61.63.158.180 48321 +61.81.86.213 50071 +61.89.6.203 19474 +62.101.135.20 1029 +62.117.149.142 20425 +62.140.137.49 3706 +62.169.127.9 26665 +62.210.90.181 6881 +62.235.217.73 61835 +62.65.216.158 13414 +62.76.100.235 22948 +62.76.100.235 28212 +62.76.100.235 33748 +62.76.100.235 34251 +62.76.100.235 39415 +62.76.100.235 40077 +62.76.100.235 41047 +62.76.100.235 43085 +62.83.111.85 36398 +62.93.99.6 28010 +64.113.125.178 61127 +64.121.118.201 61270 +64.25.21.15 37321 +64.34.187.221 4926 +65.95.191.51 51413 +65.95.195.245 49706 +65.95.73.182 42970 +66.197.135.74 9870 +66.8.165.71 16020 +67.128.168.196 11524 +67.164.23.233 7119 +67.167.180.162 11451 +67.173.33.90 33134 +67.185.95.9 32173 +67.188.183.70 41082 +67.197.217.74 52624 +67.215.246.10 6881 +67.242.169.143 6886 +67.71.140.245 15582 +67.8.141.69 63990 +67.86.174.199 33605 +68.0.53.95 11464 +68.106.225.140 47417 +68.192.162.202 31159 +68.209.239.148 50375 +68.227.56.45 57278 +68.59.158.23 39460 +68.82.32.238 18307 +68.98.108.234 24290 +69.146.24.229 34202 +69.175.34.187 28566 +69.176.171.40 11254 +69.181.169.181 7313 +70.113.2.167 45645 +70.114.155.3 34892 +70.48.173.172 3504 +70.83.35.78 31982 +71.187.209.2 22274 +71.232.195.149 56530 +71.233.72.165 39789 +71.237.6.246 41304 +71.63.225.31 21053 +71.84.138.32 52296 +72.176.18.24 6881 +72.188.223.147 41910 +72.192.215.39 30028 +72.223.102.189 11614 +72.230.75.87 21095 +73.15.30.22 44905 +73.173.111.92 63666 +73.19.47.61 15685 +74.140.153.59 59286 +74.219.135.69 30239 +74.76.197.221 29154 +74.96.156.188 31749 +75.142.21.2 56117 +75.185.11.189 23993 +75.187.202.104 44822 +75.40.21.238 51413 +75.69.72.31 51413 +75.70.84.67 52856 +76.103.53.99 40573 +76.103.79.28 36151 +76.121.38.23 58982 +76.125.33.68 54526 +76.174.205.156 8605 +76.181.135.146 17016 +76.189.15.171 28937 +76.22.35.229 16612 +76.30.131.83 49366 +76.66.171.131 15021 +76.7.214.210 35875 +76.88.254.191 27137 +77.101.130.178 61762 +77.135.115.253 9050 +77.180.216.131 24988 +77.180.216.131 5249 +77.196.18.56 22750 +77.203.253.126 33334 +77.232.162.51 14257 +77.239.87.77 10344 +77.249.124.77 49187 +77.28.66.239 15514 +77.34.44.71 35691 +77.37.160.170 1242 +77.46.26.128 38127 +77.71.220.234 62357 +77.71.69.65 12087 +77.73.46.124 28966 +77.84.97.16 31837 +78.105.105.87 42127 +78.106.178.64 46183 +78.119.193.151 55227 +78.119.213.102 44822 +78.128.52.177 24574 +78.131.13.232 55633 +78.141.127.164 55618 +78.149.99.103 22683 +78.163.181.120 16519 +78.163.220.242 31758 +78.173.175.56 53453 +78.213.113.102 9182 +78.220.115.99 49482 +78.222.160.139 37995 +78.224.174.190 3908 +78.227.88.161 23191 +78.228.230.130 12577 +78.236.77.65 32026 +78.237.111.89 45254 +78.241.70.65 22014 +78.242.168.94 34153 +78.24.231.166 6881 +78.247.176.4 18105 +78.253.242.10 59410 +78.29.75.248 6881 +78.31.66.180 5307 +78.43.137.174 10409 +78.46.147.99 51413 +78.55.114.191 42839 +78.57.193.191 46040 +78.60.4.214 6881 +78.73.38.9 11423 +79.100.105.242 14363 +79.100.51.243 18404 +79.101.160.169 1453 +79.114.14.206 4602 +79.114.193.207 17966 +79.136.243.46 46486 +79.138.67.151 47942 +79.153.101.234 11154 +79.160.104.5 2513 +79.168.31.62 2622 +79.169.77.54 63189 +79.175.106.234 12684 +79.176.173.50 33043 +79.18.246.192 20356 +79.189.118.198 6881 +79.226.190.78 18189 +79.251.43.82 56107 +79.253.173.153 58428 +79.52.149.182 6881 +79.82.130.49 20757 +79.9.144.222 29037 +79.93.218.69 28681 +79.95.171.102 11092 +80.103.109.43 55260 +80.140.156.164 37500 +80.14.161.164 51789 +80.234.86.220 60386 +80.249.65.131 9800 +80.42.246.251 20502 +80.57.45.239 28239 +80.8.119.70 48082 +80.83.245.36 6993 +80.98.106.227 9773 +80.98.158.177 29436 +80.98.17.100 51413 +80.98.74.161 54545 +81.13.253.217 46370 +81.153.207.27 51413 +81.21.216.18 22828 +81.221.84.77 20214 +81.23.7.233 9224 +81.249.29.121 7812 +81.45.175.39 33652 +81.51.97.133 40039 +81.75.221.92 49855 +81.93.207.145 20963 +82.136.113.22 6881 +82.137.118.90 26474 +82.178.114.74 50836 +82.192.32.151 58864 +82.211.130.137 29777 +82.224.22.64 15190 +82.232.212.66 55826 +82.235.101.26 7816 +82.237.40.39 39052 +82.240.4.144 16729 +82.47.63.231 26035 +82.7.124.219 12334 +83.110.225.79 17257 +83.134.60.207 10267 +83.155.218.188 51413 +83.157.77.228 7812 +83.202.163.16 6881 +83.213.185.157 43235 +83.240.93.202 51413 +83.252.149.71 42945 +83.252.23.84 10699 +83.49.197.212 61627 +83.6.22.221 52512 +83.87.5.5 43317 +83.9.248.251 51413 +84.123.4.247 29043 +84.123.59.159 13963 +84.151.248.98 61500 +84.154.235.198 59678 +84.217.43.156 45620 +84.245.120.26 51413 +84.40.80.3 6890 +84.52.169.26 10838 +84.75.22.54 51413 +85.107.174.75 50321 +85.107.182.248 19486 +85.114.60.149 17582 +85.138.230.74 56197 +85.167.249.218 55649 +85.17.127.168 38557 +85.195.226.115 5888 +85.219.118.111 27483 +85.220.66.170 35131 +85.246.109.226 6890 +85.250.43.217 41490 +85.25.218.207 6884 +85.25.218.207 6886 +85.25.218.207 6888 +85.25.237.46 6882 +85.25.237.46 6887 +85.26.92.236 29761 +85.54.211.184 17283 +85.59.159.50 49001 +85.64.151.207 44822 +85.74.189.101 53149 +86.100.227.142 50497 +86.145.211.200 49330 +86.168.167.166 55451 +86.169.117.185 51938 +86.194.215.166 14316 +86.237.133.79 51413 +86.241.109.212 1024 +86.252.48.255 59566 +86.29.220.199 28527 +86.46.36.146 10124 +87.106.187.29 20277 +87.110.236.117 64810 +87.16.197.67 20787 +87.191.160.44 61212 +87.244.169.128 55807 +87.253.26.85 45934 +87.2.74.180 6783 +87.78.153.16 5011 +87.97.253.69 50649 +87.98.162.88 6881 +88.148.233.194 38081 +88.149.179.95 6881 +88.155.36.246 15856 +88.165.34.61 41708 +88.169.1.120 59258 +88.169.60.195 17108 +88.170.61.126 32761 +88.174.167.76 30032 +88.174.176.173 56969 +88.174.58.215 51413 +88.186.230.88 12048 +88.217.31.208 7813 +88.217.36.182 2924 +88.230.184.110 25432 +88.233.167.39 20620 +88.24.180.250 6249 +88.245.188.55 28097 +88.3.236.194 10926 +88.84.191.25 30536 +89.110.53.186 41210 +89.110.53.186 49787 +89.132.181.63 61498 +89.133.89.51 55846 +89.143.138.33 64606 +89.204.110.192 6881 +89.209.82.248 12425 +89.224.149.142 25365 +89.248.171.137 6881 +89.27.163.34 55315 +89.3.231.151 45960 +89.33.72.233 1398 +89.78.249.54 49001 +89.92.251.113 16946 +90.116.231.10 33026 +90.126.31.47 50000 +90.149.227.168 49241 +90.16.53.195 31338 +90.184.93.164 22828 +90.204.42.12 48402 +90.207.148.109 51413 +90.225.103.241 40066 +90.231.4.40 6881 +90.27.140.90 1347 +90.29.226.250 14329 +90.31.140.85 16185 +90.38.76.72 4699 +90.41.206.239 30502 +90.65.17.120 24080 +90.79.215.246 63040 +91.105.156.125 1025 +91.121.114.171 58846 +91.121.136.132 59001 +91.121.16.72 51413 +91.137.168.238 27616 +91.148.14.62 11206 +91.151.203.4 21833 +91.157.230.16 1885 +91.216.66.81 36678 +91.219.237.220 4087 +91.222.89.195 49001 +91.241.236.6 49001 +91.247.142.205 58199 +91.67.129.216 1210 +91.74.119.134 49246 +91.89.196.37 61799 +92.125.17.239 25548 +92.131.55.187 40332 +92.134.139.162 10004 +92.137.208.191 29253 +92.139.252.16 36535 +92.156.86.247 56432 +92.2.212.97 15078 +92.233.185.151 51413 +92.234.58.147 13285 +92.238.93.208 53280 +92.246.22.40 33576 +92.247.248.50 23666 +92.255.208.221 34798 +92.37.142.2 62290 +92.37.27.83 37375 +92.39.216.40 23585 +92.43.189.45 3140 +92.45.192.16 22222 +92.46.228.108 26675 +92.49.5.186 38678 +92.58.106.183 8621 +92.80.201.189 20026 +92.83.188.95 10477 +92.87.167.73 55624 +92.90.21.108 49760 +92.96.51.71 56237 +92.98.171.108 51413 +92.99.221.105 51405 +93.105.81.215 21000 +93.109.84.235 21443 +93.11.175.201 41027 +93.124.97.171 49001 +93.181.201.89 54631 +93.186.192.165 39020 +93.188.8.35 43842 +93.21.41.89 58623 +93.58.14.83 51413 +93.77.32.187 57408 +93.78.138.118 50567 +93.80.96.134 23683 +93.81.126.53 6881 +93.84.33.191 22071 +93.84.33.191 55762 +93.90.227.17 49001 +93.95.160.156 13118 +93.96.13.136 12181 +94.103.196.139 54378 +94.155.59.112 57833 +94.180.0.78 23879 +94.190.105.157 6881 +94.208.10.154 52432 +94.21.30.143 63448 +94.21.70.206 50541 +94.23.0.84 51582 +94.233.110.175 49001 +94.23.49.143 8000 +94.23.5.218 6881 +94.236.246.217 15554 +94.244.35.192 51413 +94.245.153.136 23040 +94.30.170.21 7105 +94.41.249.131 10613 +94.44.164.74 60966 +94.62.25.152 39020 +94.68.144.118 10009 +94.96.112.204 35187 +94.96.167.130 64130 +95.104.80.193 6881 +95.111.0.20 34295 +95.111.46.227 18466 +95.135.101.164 55829 +95.150.185.164 6882 +95.153.169.40 19697 +95.188.23.129 42927 +95.196.203.111 59402 +95.208.144.94 6881 +95.222.150.218 38337 +95.239.56.106 62200 +95.24.101.211 6881 +95.25.229.186 6889 +95.26.91.94 6881 +95.31.49.9 9424 +95.31.49.9 9425 +95.32.187.214 14778 +95.37.162.145 14476 +95.37.18.51 59118 +95.47.197.189 49001 +95.54.76.150 56930 +95.76.164.90 64529 +95.84.208.14 9372 +95.84.255.47 51413 +95.90.215.112 37742 +95.90.236.216 41463 +95.92.232.20 51413 +96.237.181.232 7915 +96.49.182.210 21859 +96.63.15.208 34651 +97.106.156.54 63552 +97.85.86.199 6890 +98.119.4.86 1024 +98.127.163.114 53062 +98.194.6.21 51413 +98.197.42.116 19866 +98.199.98.228 32970 +98.200.252.137 18502 +98.202.170.205 41731 +98.214.166.21 38072 +98.225.11.98 51769 +98.232.199.100 29721 +98.234.210.209 51413 +99.192.77.139 33333 +99.242.88.203 21704 +99.255.185.162 912 +99.59.129.46 26141 +99.60.78.40 18894 diff --git a/libbitdht/src/bitdht/bdboot_generate.sh b/libbitdht/src/bitdht/bdboot_generate.sh new file mode 100755 index 000000000..97618f0df --- /dev/null +++ b/libbitdht/src/bitdht/bdboot_generate.sh @@ -0,0 +1,55 @@ +#!/bin/bash + +< + +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 . + +LICENSE + +< 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 + diff --git a/libbitdht/src/bitdht/bdconnection.cc b/libbitdht/src/bitdht/bdconnection.cc index 90e6afa98..494e076f3 100644 --- a/libbitdht/src/bitdht/bdconnection.cc +++ b/libbitdht/src/bitdht/bdconnection.cc @@ -1,27 +1,24 @@ -/* - * bitdht/bdconnection.cc - * - * BitDHT: An Flexible DHT library. - * - * Copyright 2011 by Robert Fernie - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 3 as published by the Free Software Foundation. - * - * This library 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 - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "bitdht@lunamutt.com". - * - */ +/******************************************************************************* + * bitdht/bdconnection.cc * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2011 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include #include "bitdht/bdiface.h" diff --git a/libbitdht/src/bitdht/bdconnection.h b/libbitdht/src/bitdht/bdconnection.h index 4453a0bf0..c55d95c09 100644 --- a/libbitdht/src/bitdht/bdconnection.h +++ b/libbitdht/src/bitdht/bdconnection.h @@ -1,32 +1,28 @@ +/******************************************************************************* + * bitdht/bdconnection.h * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2011 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ + #ifndef BITDHT_CONNECTION_H #define BITDHT_CONNECTION_H -/* - * bitdht/bdconnection.h - * - * BitDHT: An Flexible DHT library. - * - * Copyright 2011 by Robert Fernie - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 3 as published by the Free Software Foundation. - * - * This library 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 - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "bitdht@lunamutt.com". - * - */ - - #include "bitdht/bdiface.h" class bdQueryManager; diff --git a/libbitdht/src/bitdht/bdfilter.cc b/libbitdht/src/bitdht/bdfilter.cc index 5be9e1178..1ba7d3aca 100644 --- a/libbitdht/src/bitdht/bdfilter.cc +++ b/libbitdht/src/bitdht/bdfilter.cc @@ -1,29 +1,24 @@ - -/* - * bitdht/bdfilter.cc - * - * BitDHT: An Flexible DHT library. - * - * Copyright 2010 by Robert Fernie - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 3 as published by the Free Software Foundation. - * - * This library 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 - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "bitdht@lunamutt.com". - * - */ - +/******************************************************************************* + * bitdht/bdfilter.cc * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2010 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include "bitdht/bdfilter.h" #include "bitdht/bdmanager.h" diff --git a/libbitdht/src/bitdht/bdfilter.h b/libbitdht/src/bitdht/bdfilter.h index 7c1d940d3..27d32a7d4 100644 --- a/libbitdht/src/bitdht/bdfilter.h +++ b/libbitdht/src/bitdht/bdfilter.h @@ -1,36 +1,28 @@ +/******************************************************************************* + * bitdht/bdfilter.h * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2010 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ + #ifndef BITDHT_FILTER_H #define BITDHT_FILTER_H -/* - * bitdht/bdfilter.h - * - * BitDHT: An Flexible DHT library. - * - * Copyright 2010 by Robert Fernie - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 3 as published by the Free Software Foundation. - * - * This library 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 - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "bitdht@lunamutt.com". - * - */ - -/* This class is used to detect bad and filter them peers - * - */ - - #include "bitdht/bdiface.h" #include diff --git a/libbitdht/src/bitdht/bdfriendlist.cc b/libbitdht/src/bitdht/bdfriendlist.cc index 3bb258c40..487f0a75c 100644 --- a/libbitdht/src/bitdht/bdfriendlist.cc +++ b/libbitdht/src/bitdht/bdfriendlist.cc @@ -1,28 +1,24 @@ - -/* - * bitdht/bdfriendlist.cc - * - * BitDHT: An Flexible DHT library. - * - * Copyright 2011 by Robert Fernie - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 3 as published by the Free Software Foundation. - * - * This library 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 - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "bitdht@lunamutt.com". - * - */ +/******************************************************************************* + * bitdht/bdfriendlist.cc * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2010 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include "bitdht/bdfriendlist.h" #include "bitdht/bdstddht.h" diff --git a/libbitdht/src/bitdht/bdfriendlist.h b/libbitdht/src/bitdht/bdfriendlist.h index 35cad86bb..a58888ed8 100644 --- a/libbitdht/src/bitdht/bdfriendlist.h +++ b/libbitdht/src/bitdht/bdfriendlist.h @@ -1,31 +1,28 @@ +/******************************************************************************* + * bitdht/bdfriendlist.h * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2010 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ + #ifndef BITDHT_FRIEND_LIST_H #define BITDHT_FRIEND_LIST_H -/* - * bitdht/bdfriendlist.h - * - * BitDHT: An Flexible DHT library. - * - * Copyright 2011 by Robert Fernie - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 3 as published by the Free Software Foundation. - * - * This library 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 - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "bitdht@lunamutt.com". - * - */ - /* * 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. diff --git a/libbitdht/src/bitdht/bdhash.cc b/libbitdht/src/bitdht/bdhash.cc index 762ca5e1b..5eabd3d95 100644 --- a/libbitdht/src/bitdht/bdhash.cc +++ b/libbitdht/src/bitdht/bdhash.cc @@ -1,28 +1,24 @@ -/* - * bitdht/bdhash.cc - * - * BitDHT: An Flexible DHT library. - * - * Copyright 2010 by Robert Fernie - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 3 as published by the Free Software Foundation. - * - * This library 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 - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "bitdht@lunamutt.com". - * - */ - +/******************************************************************************* + * bitdht/bdhash.cc * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2010 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include "bitdht/bdhash.h" #include "bitdht/bdstddht.h" diff --git a/libbitdht/src/bitdht/bdhash.h b/libbitdht/src/bitdht/bdhash.h index 10c8fd6e2..680169665 100644 --- a/libbitdht/src/bitdht/bdhash.h +++ b/libbitdht/src/bitdht/bdhash.h @@ -1,31 +1,28 @@ +/******************************************************************************* + * bitdht/bdhash.h * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2010 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ + #ifndef BITDHT_HASH_SPACE_H #define BITDHT_HASH_SPACE_H -/* - * bitdht/bdhash.h - * - * BitDHT: An Flexible DHT library. - * - * Copyright 2010 by Robert Fernie - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 3 as published by the Free Software Foundation. - * - * This library 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 - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "bitdht@lunamutt.com". - * - */ - #include "bitdht/bdpeer.h" #include diff --git a/libbitdht/src/bitdht/bdhistory.cc b/libbitdht/src/bitdht/bdhistory.cc index 434ab3333..05bb73fa0 100644 --- a/libbitdht/src/bitdht/bdhistory.cc +++ b/libbitdht/src/bitdht/bdhistory.cc @@ -1,3 +1,24 @@ +/******************************************************************************* + * bitdht/bdhistory.cc * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2010 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include "bitdht/bdhistory.h" diff --git a/libbitdht/src/bitdht/bdhistory.h b/libbitdht/src/bitdht/bdhistory.h index 656d91413..79e420d92 100644 --- a/libbitdht/src/bitdht/bdhistory.h +++ b/libbitdht/src/bitdht/bdhistory.h @@ -1,3 +1,25 @@ +/******************************************************************************* + * bitdht/bdhistory.h * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2010 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ + #ifndef BITDHT_HISTORY_H #define BITDHT_HISTORY_H diff --git a/libbitdht/src/bitdht/bdiface.h b/libbitdht/src/bitdht/bdiface.h index f6f47126c..4e571ccdb 100644 --- a/libbitdht/src/bitdht/bdiface.h +++ b/libbitdht/src/bitdht/bdiface.h @@ -1,31 +1,27 @@ +/******************************************************************************* + * bitdht/bdiface.h * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2010 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef BIT_DHT_INTERFACE_H #define BIT_DHT_INTERFACE_H -/* - * bitdht/bdiface.h - * - * BitDHT: An Flexible DHT library. - * - * Copyright 2010 by Robert Fernie - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 3 as published by the Free Software Foundation. - * - * This library 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 - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "bitdht@lunamutt.com". - * - */ - #include #include #include diff --git a/libbitdht/src/bitdht/bdmanager.cc b/libbitdht/src/bitdht/bdmanager.cc index 4fb1e4709..522b0629f 100644 --- a/libbitdht/src/bitdht/bdmanager.cc +++ b/libbitdht/src/bitdht/bdmanager.cc @@ -1,28 +1,24 @@ -/* - * bitdht/bdmanager.cc - * - * BitDHT: An Flexible DHT library. - * - * Copyright 2010 by Robert Fernie - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 3 as published by the Free Software Foundation. - * - * This library 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 - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "bitdht@lunamutt.com". - * - */ - +/******************************************************************************* + * bitdht/bdmanager.cc * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2010 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ /******* * Node Manager. @@ -72,7 +68,7 @@ bdNodeManager::bdNodeManager(bdNodeId *id, std::string dhtVersion, std::string b :bdNode(id, dhtVersion, bootfile, filterfile, fns, this) { mMode = BITDHT_MGR_STATE_OFF; - mFns = fns; + mDhtFns = fns; mModeTS = 0 ; mStartTS = 0; mSearchingDone = false; @@ -87,7 +83,7 @@ bdNodeManager::bdNodeManager(bdNodeId *id, std::string dhtVersion, std::string b #ifdef DEBUG_MGR std::cerr << "bdNodeManager::bdNodeManager() ID: "; - mFns->bdPrintNodeId(std::cerr, id); + mDhtFns->bdPrintNodeId(std::cerr, id); std::cerr << std::endl; #endif @@ -188,7 +184,7 @@ void bdNodeManager::addFindNode(bdNodeId *id, uint32_t qflags) { #ifdef DEBUG_MGR std::cerr << "bdNodeManager::addFindNode() "; - mFns->bdPrintNodeId(std::cerr, id); + mDhtFns->bdPrintNodeId(std::cerr, id); std::cerr << std::endl; #endif /* check if exists already */ @@ -257,7 +253,7 @@ void bdNodeManager::removeFindNode(bdNodeId *id) { #ifdef DEBUG_MGR std::cerr << "bdNodeManager::removeFindNode() "; - mFns->bdPrintNodeId(std::cerr, id); + mDhtFns->bdPrintNodeId(std::cerr, id); std::cerr << std::endl; #endif std::map::iterator it; @@ -525,7 +521,7 @@ int bdNodeManager::QueryRandomLocalNet() else { /* calculate mid point */ - mFns->bdRandomMidId(&mOwnId, &(id.id), &targetNodeId); + mDhtFns->bdRandomMidId(&mOwnId, &(id.id), &targetNodeId); } /* do standard find_peer message */ @@ -534,13 +530,13 @@ int bdNodeManager::QueryRandomLocalNet() #ifdef DEBUG_MGR std::cerr << "bdNodeManager::QueryRandomLocalNet() Querying : "; - mFns->bdPrintId(std::cerr, &id); + mDhtFns->bdPrintId(std::cerr, &id); std::cerr << " searching for : "; - mFns->bdPrintNodeId(std::cerr, &targetNodeId); + mDhtFns->bdPrintNodeId(std::cerr, &targetNodeId); bdMetric dist; - mFns->bdDistance(&targetNodeId, &(mOwnId), &dist); - int bucket = mFns->bdBucketDistance(&dist); + mDhtFns->bdDistance(&targetNodeId, &(mOwnId), &dist); + int bucket = mDhtFns->bdBucketDistance(&dist); std::cerr << " in Bucket: " << bucket; std::cerr << std::endl; #endif @@ -593,7 +589,7 @@ void bdNodeManager::SearchForLocalNet() { #ifdef DEBUG_MGR std::cerr << "bdNodeManager::SearchForLocalNet() Existing Internal Search: "; - mFns->bdPrintNodeId(std::cerr, &(it->first)); + mDhtFns->bdPrintNodeId(std::cerr, &(it->first)); std::cerr << std::endl; #endif @@ -630,7 +626,7 @@ void bdNodeManager::SearchForLocalNet() { #ifdef DEBUG_MGR std::cerr << "bdNodeManager::SearchForLocalNet() " << i << " Attempts to find OkNode: "; - mFns->bdPrintNodeId(std::cerr, &targetNodeId); + mDhtFns->bdPrintNodeId(std::cerr, &targetNodeId); std::cerr << std::endl; #endif } @@ -638,7 +634,7 @@ void bdNodeManager::SearchForLocalNet() { #ifdef DEBUG_MGR std::cerr << "bdNodeManager::SearchForLocalNet() Failed to Find FilterOk this time: "; - mFns->bdPrintNodeId(std::cerr, &targetNodeId); + mDhtFns->bdPrintNodeId(std::cerr, &targetNodeId); std::cerr << std::endl; #endif } @@ -649,7 +645,7 @@ void bdNodeManager::SearchForLocalNet() #ifdef DEBUG_MGR std::cerr << "bdNodeManager::SearchForLocalNet() Adding New Internal Search: "; - mFns->bdPrintNodeId(std::cerr, &(targetNodeId)); + mDhtFns->bdPrintNodeId(std::cerr, &(targetNodeId)); std::cerr << std::endl; #endif } @@ -709,7 +705,7 @@ int bdNodeManager::checkStatus() { #ifdef DEBUG_MGR std::cerr << "bdNodeManager::checkStatus() Query in Progress id: "; - mFns->bdPrintNodeId(std::cerr, &(it->first)); + mDhtFns->bdPrintNodeId(std::cerr, &(it->first)); std::cerr << std::endl; #endif } @@ -719,7 +715,7 @@ int bdNodeManager::checkStatus() { #ifdef DEBUG_MGR std::cerr << "bdNodeManager::checkStatus() Query Failed: id: "; - mFns->bdPrintNodeId(std::cerr, &(it->first)); + mDhtFns->bdPrintNodeId(std::cerr, &(it->first)); std::cerr << std::endl; #endif // BAD. @@ -733,7 +729,7 @@ int bdNodeManager::checkStatus() { #ifdef DEBUG_MGR std::cerr << "bdNodeManager::checkStatus() Found Closest: id: "; - mFns->bdPrintNodeId(std::cerr, &(it->first)); + mDhtFns->bdPrintNodeId(std::cerr, &(it->first)); std::cerr << std::endl; #endif @@ -747,7 +743,7 @@ int bdNodeManager::checkStatus() { #ifdef DEBUG_MGR std::cerr << "bdNodeManager::checkStatus() the Peer Online but Unreachable: id: "; - mFns->bdPrintNodeId(std::cerr, &(it->first)); + mDhtFns->bdPrintNodeId(std::cerr, &(it->first)); std::cerr << std::endl; #endif @@ -761,7 +757,7 @@ int bdNodeManager::checkStatus() { #ifdef DEBUG_MGR std::cerr << "bdNodeManager::checkStatus() Found Query: id: "; - mFns->bdPrintNodeId(std::cerr, &(it->first)); + mDhtFns->bdPrintNodeId(std::cerr, &(it->first)); std::cerr << std::endl; #endif //foundId = @@ -803,7 +799,7 @@ int bdNodeManager::checkStatus() doCallback = false; #ifdef DEBUG_MGR std::cerr << "bdNodeManager::checkStatus() Internal: no cb for id: "; - mFns->bdPrintNodeId(std::cerr, &(it->first)); + mDhtFns->bdPrintNodeId(std::cerr, &(it->first)); std::cerr << std::endl; #endif } @@ -1024,7 +1020,7 @@ int bdNodeManager::getDhtPeerAddress(const bdNodeId *id, struct sockaddr_in &fro { #ifdef DEBUG_MGR std::cerr << "bdNodeManager::getDhtPeerAddress() Id: "; - mFns->bdPrintNodeId(std::cerr, id); + mDhtFns->bdPrintNodeId(std::cerr, id); std::cerr << " ... ? TODO" << std::endl; #else (void) id; @@ -1034,7 +1030,7 @@ int bdNodeManager::getDhtPeerAddress(const bdNodeId *id, struct sockaddr_in &fro pit = mActivePeers.find(*id); std::cerr << "bdNodeManager::getDhtPeerAddress() Id: "; - mFns->bdPrintNodeId(std::cerr, id); + mDhtFns->bdPrintNodeId(std::cerr, id); std::cerr << std::endl; if (pit != mActivePeers.end()) @@ -1061,7 +1057,7 @@ int bdNodeManager::getDhtValue(const bdNodeId *id, std::string key, std::string { #ifdef DEBUG_MGR std::cerr << "bdNodeManager::getDhtValue() Id: "; - mFns->bdPrintNodeId(std::cerr, id); + mDhtFns->bdPrintNodeId(std::cerr, id); std::cerr << " key: " << key; std::cerr << " ... ? TODO" << std::endl; #else @@ -1144,7 +1140,7 @@ void bdNodeManager::doNodeCallback(const bdId *id, uint32_t peerflags) { #ifdef DEBUG_MGR std::cerr << "bdNodeManager::doNodeCallback() "; - mFns->bdPrintId(std::cerr, id); + mDhtFns->bdPrintId(std::cerr, id); std::cerr << "peerflags: " << peerflags; std::cerr << std::endl; #endif @@ -1163,7 +1159,7 @@ void bdNodeManager::doPeerCallback(const bdId *id, uint32_t status) #ifdef DEBUG_MGR std::cerr << "bdNodeManager::doPeerCallback()"; - mFns->bdPrintId(std::cerr, id); + mDhtFns->bdPrintId(std::cerr, id); std::cerr << "status: " << status; std::cerr << std::endl; #endif diff --git a/libbitdht/src/bitdht/bdmanager.h b/libbitdht/src/bitdht/bdmanager.h index d3ddb587f..1a6a2cebd 100644 --- a/libbitdht/src/bitdht/bdmanager.h +++ b/libbitdht/src/bitdht/bdmanager.h @@ -1,33 +1,27 @@ +/******************************************************************************* + * bitdht/bdmanager.h * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2010 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef BITDHT_MANAGER_H #define BITDHT_MANAGER_H -/* - * bitdht/bdmanager.h - * - * BitDHT: An Flexible DHT library. - * - * Copyright 2010 by Robert Fernie - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 3 as published by the Free Software Foundation. - * - * This library 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 - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "bitdht@lunamutt.com". - * - */ - - - /******* * Node Manager. ******/ @@ -184,7 +178,7 @@ void SearchForLocalNet(); time_t mSearchTS; bool mSearchingDone; - bdDhtFunctions *mFns; + bdDhtFunctions *mDhtFns; uint32_t mNetworkSize; uint32_t mBdNetworkSize; diff --git a/libbitdht/src/bitdht/bdmsgs.cc b/libbitdht/src/bitdht/bdmsgs.cc index ebaccefcc..07114dbab 100644 --- a/libbitdht/src/bitdht/bdmsgs.cc +++ b/libbitdht/src/bitdht/bdmsgs.cc @@ -1,27 +1,24 @@ -/* - * bitdht/bdmsgs.cc - * - * BitDHT: An Flexible DHT library. - * - * Copyright 2010 by Robert Fernie - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 3 as published by the Free Software Foundation. - * - * This library 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 - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "bitdht@lunamutt.com". - * - */ +/******************************************************************************* + * bitdht/bdmsgs.cc * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2010 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include #include @@ -830,9 +827,10 @@ int decodeCompactPeerId(struct sockaddr_in *addr, char *enc, int len) memset(addr, 0, sizeof(struct sockaddr_in)); - uint32_t *ip = (uint32_t *) (enc); + //uint32_t *ip = (uint32_t *) (enc); uint16_t *port = (uint16_t *) (&enc[4]); - addr->sin_addr.s_addr = (*ip); + + memcpy(& addr->sin_addr.s_addr, enc, sizeof(in_addr_t)); // aligned version of "addr->sin_addr.s_addr = (*ip); " addr->sin_port = (*port); addr->sin_family = AF_INET; diff --git a/libbitdht/src/bitdht/bdmsgs.h b/libbitdht/src/bitdht/bdmsgs.h index ea7b8a3a1..99a26d76a 100644 --- a/libbitdht/src/bitdht/bdmsgs.h +++ b/libbitdht/src/bitdht/bdmsgs.h @@ -1,32 +1,27 @@ +/******************************************************************************* + * bitdht/bdmsgs.h * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2010 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef BITDHT_MSGS_H #define BITDHT_MSGS_H -/* - * bitdht/bdmsgs.h - * - * BitDHT: An Flexible DHT library. - * - * Copyright 2010 by Robert Fernie - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 3 as published by the Free Software Foundation. - * - * This library 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 - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "bitdht@lunamutt.com". - * - */ - - #include #include #include diff --git a/libbitdht/src/bitdht/bdnode.cc b/libbitdht/src/bitdht/bdnode.cc index f7ae5e220..9adaaead9 100644 --- a/libbitdht/src/bitdht/bdnode.cc +++ b/libbitdht/src/bitdht/bdnode.cc @@ -1,27 +1,24 @@ -/* - * bitdht/bdnode.cc - * - * BitDHT: An Flexible DHT library. - * - * Copyright 2010-2011 by Robert Fernie - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 3 as published by the Free Software Foundation. - * - * This library 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 - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "bitdht@lunamutt.com". - * - */ +/******************************************************************************* + * bitdht/bdnode.cc * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2010 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include "bitdht/bdnode.h" @@ -518,7 +515,7 @@ void bdNode::checkPotentialPeer(bdId *id, bdId *src) #ifndef DISABLE_BAD_PEER_FILTER std::cerr << "bdNode::checkPotentialPeer("; mFns->bdPrintId(std::cerr, id); - std::cerr << ") MASQARADING AS KNOWN PEER - FLAGGING AS BAD"; + std::cerr << ") MASQUERADING AS KNOWN PEER - FLAGGING AS BAD"; std::cerr << std::endl; // Stores in queue for later callback and desemination around the network. @@ -603,7 +600,7 @@ void bdNode::addPeer(const bdId *id, uint32_t peerflags) std::cerr << "bdNode::addPeer("; mFns->bdPrintId(std::cerr, id); std::cerr << ", " << std::hex << peerflags << std::dec; - std::cerr << ") MASQARADING AS KNOWN PEER - FLAGGING AS BAD"; + std::cerr << ") MASQUERADING AS KNOWN PEER - FLAGGING AS BAD"; std::cerr << std::endl; @@ -1269,11 +1266,7 @@ void bdNode::recvPkt(char *msg, int len, struct sockaddr_in addr) /************************** handle id (all) ***************************/ be_node *be_id = beMsgGetDictNode(be_data, "id"); bdNodeId id; - if (be_id) - { - beMsgGetNodeId(be_id, id); - } - else + if(!be_id || !beMsgGetNodeId(be_id, id)) { #ifdef DEBUG_NODE_PARSE std::cerr << "bdNode::recvPkt() Missing Peer Id. Dropping Msg"; diff --git a/libbitdht/src/bitdht/bdnode.h b/libbitdht/src/bitdht/bdnode.h index 5acb1255b..ad1ffe2fb 100644 --- a/libbitdht/src/bitdht/bdnode.h +++ b/libbitdht/src/bitdht/bdnode.h @@ -1,32 +1,27 @@ +/******************************************************************************* + * bitdht/bdnode.h * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2010 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef BITDHT_NODE_H #define BITDHT_NODE_H -/* - * bitdht/bdnode.h - * - * BitDHT: An Flexible DHT library. - * - * Copyright 2010 by Robert Fernie - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 3 as published by the Free Software Foundation. - * - * This library 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 - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "bitdht@lunamutt.com". - * - */ - - #include "bitdht/bdpeer.h" #include "bitdht/bdquery.h" #include "bitdht/bdstore.h" diff --git a/libbitdht/src/bitdht/bdobj.cc b/libbitdht/src/bitdht/bdobj.cc index df22686cc..9832796d2 100644 --- a/libbitdht/src/bitdht/bdobj.cc +++ b/libbitdht/src/bitdht/bdobj.cc @@ -1,28 +1,24 @@ - -/* - * bitdht/bdobj.cc - * - * BitDHT: An Flexible DHT library. - * - * Copyright 2010 by Robert Fernie - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 3 as published by the Free Software Foundation. - * - * This library 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 - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "bitdht@lunamutt.com". - * - */ +/******************************************************************************* + * bitdht/bdobj.cc * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2010 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include "bitdht/bdobj.h" diff --git a/libbitdht/src/bitdht/bdobj.h b/libbitdht/src/bitdht/bdobj.h index dbc8b5385..d193c59a8 100644 --- a/libbitdht/src/bitdht/bdobj.h +++ b/libbitdht/src/bitdht/bdobj.h @@ -1,32 +1,27 @@ +/******************************************************************************* + * bitdht/bdobj.h * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2010 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef BITDHT_OBJECTS_H #define BITDHT_OBJECTS_H -/* - * bitdht/bdobj.h - * - * BitDHT: An Flexible DHT library. - * - * Copyright 2010 by Robert Fernie - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 3 as published by the Free Software Foundation. - * - * This library 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 - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "bitdht@lunamutt.com". - * - */ - - #define BITDHT_TOKEN_MAX_LEN 20 #include diff --git a/libbitdht/src/bitdht/bdpeer.cc b/libbitdht/src/bitdht/bdpeer.cc index 9630fbdad..65cfb31b5 100644 --- a/libbitdht/src/bitdht/bdpeer.cc +++ b/libbitdht/src/bitdht/bdpeer.cc @@ -1,28 +1,24 @@ -/* - * bitdht/bdpeer.cc - * - * BitDHT: An Flexible DHT library. - * - * Copyright 2010 by Robert Fernie - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 3 as published by the Free Software Foundation. - * - * This library 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 - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "bitdht@lunamutt.com". - * - */ - +/******************************************************************************* + * bitdht/bdpeer.cc * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2010 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include "bitdht/bdpeer.h" #include "util/bdnet.h" @@ -1024,6 +1020,11 @@ int bdSpace::getDhtBucket(const int idx, bdBucket &bucket) } uint32_t bdSpace::calcNetworkSize() +{ + return calcNetworkSizeWithFlag(~0u) ; +} + +uint32_t bdSpace::calcNetworkSizeWithFlag(uint32_t withFlag) { std::vector::iterator it; @@ -1031,76 +1032,66 @@ uint32_t bdSpace::calcNetworkSize() unsigned long long sum = 0; unsigned long long no_peers = 0; uint32_t count = 0; - bool doPrint = false; - bool doAvg = false; + +#ifdef BITDHT_DEBUG + std::cerr << "Estimating DHT network size. Flags=" << std::hex << withFlag << std::dec << std::endl; +#endif int i = 0; for(it = buckets.begin(); it != buckets.end(); it++, i++) { - int size = it->entries.size(); + int size = 0; + std::list::iterator lit; + for(lit = it->entries.begin(); lit != it->entries.end(); lit++) + if (withFlag & lit->mPeerFlags) + size++; + int shift = BITDHT_KEY_BITLEN - i; - bool toBig = false; if (shift > BITDHT_ULLONG_BITS - mFns->bdBucketBitSize() - 1) - { - toBig = true; - shift = BITDHT_ULLONG_BITS - mFns->bdBucketBitSize() - 1; - } + continue ; + unsigned long long no_nets = ((unsigned long long) 1 << shift); - /* use doPrint so it acts as a single switch */ - if (size && !doAvg && !doPrint) - { - doAvg = true; - } + no_peers = no_nets * size; - if (size && !doPrint) - { - doPrint = true; - } - - if (size == 0) + if(size < mFns->bdNodesPerBucket() && size > 0) { - /* reset counters - if empty slot - to discount outliers in average */ - sum = 0; - no_peers = 0; - count = 0; + sum += no_peers; + count++; } - if (!toBig) - { - no_peers = no_nets * size; - } - - if (doPrint && doAvg && !toBig) - { - if (size == mFns->bdNodesPerBucket()) - { - /* last average */ - doAvg = false; - } - if (no_peers != 0) - { - sum += no_peers; - count++; - } - } +#ifdef BITDHT_DEBUG + if(size > 0) + std::cerr << " Bucket " << shift << ": " << size << " / " << mFns->bdNodesPerBucket() << " peers. no_nets=" << no_nets << ". no_peers=" << no_peers << "." << std::endl; +#endif } uint32_t NetSize = 0; if (count != 0) - { NetSize = sum / count; - } - //std::cerr << "bdSpace::calcNetworkSize() : " << NetSize; - //std::cerr << std::endl; +#ifdef BITDHT_DEBUG + std::cerr << "Estimated net size: " << NetSize << ". Old style estimate: " << calcNetworkSizeWithFlag_old(withFlag) << std::endl; +#endif return NetSize; } -uint32_t bdSpace::calcNetworkSizeWithFlag(uint32_t withFlag) +/* (csoler) This is the old method for computing the DHT size estimate. The method is based on averaging the + * estimate given by each bucket: n 2^b where n is the bucket size and b is the number of similar bits + * in this bucket. The idea is that buckets that are not empty nor full give a estimate of the network + * size. + * + * The existing implementation of this method was not using all non empty/full buckets, in order to avoid + * outliers, but this method is also biased, and tends to give a lower value (because it skips the largest buckets) + * especially when the network is very sparse. + * + * The new implementation respects the original estimate without bias, but it still notoriously wrong. Only averaging + * the estimate over a large period of time would produce a reliable value. + */ +uint32_t bdSpace::calcNetworkSizeWithFlag_old(uint32_t withFlag) { std::vector::iterator it; @@ -1140,12 +1131,12 @@ uint32_t bdSpace::calcNetworkSizeWithFlag(uint32_t withFlag) /* use doPrint so it acts as a single switch */ if (size && !doAvg && !doPrint) - { + { doAvg = true; } if (size && !doPrint) - { + { doPrint = true; } @@ -1172,7 +1163,7 @@ uint32_t bdSpace::calcNetworkSizeWithFlag(uint32_t withFlag) if (no_peers != 0) { sum += no_peers; - count++; + count++; } } } @@ -1190,7 +1181,6 @@ uint32_t bdSpace::calcNetworkSizeWithFlag(uint32_t withFlag) return NetSize; } - uint32_t bdSpace::calcSpaceSize() { std::vector::iterator it; diff --git a/libbitdht/src/bitdht/bdpeer.h b/libbitdht/src/bitdht/bdpeer.h index 871f41121..d663a7ecd 100644 --- a/libbitdht/src/bitdht/bdpeer.h +++ b/libbitdht/src/bitdht/bdpeer.h @@ -1,31 +1,27 @@ +/******************************************************************************* + * bitdht/bdpeer.h * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2010 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef BITDHT_PEER_H #define BITDHT_PEER_H -/* - * bitdht/bdpeer.h - * - * BitDHT: An Flexible DHT library. - * - * Copyright 2010 by Robert Fernie - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 3 as published by the Free Software Foundation. - * - * This library 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 - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "bitdht@lunamutt.com". - * - */ - #include "bitdht/bdiface.h" #include @@ -184,6 +180,7 @@ 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); diff --git a/libbitdht/src/bitdht/bdquery.cc b/libbitdht/src/bitdht/bdquery.cc index e93000a84..f9b77002d 100644 --- a/libbitdht/src/bitdht/bdquery.cc +++ b/libbitdht/src/bitdht/bdquery.cc @@ -1,29 +1,24 @@ - -/* - * bitdht/bdquery.cc - * - * BitDHT: An Flexible DHT library. - * - * Copyright 2010 by Robert Fernie - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 3 as published by the Free Software Foundation. - * - * This library 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 - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "bitdht@lunamutt.com". - * - */ - +/******************************************************************************* + * bitdht/bdquery.cc * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2010 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include "bitdht/bdquery.h" #include "bitdht/bdstddht.h" diff --git a/libbitdht/src/bitdht/bdquery.h b/libbitdht/src/bitdht/bdquery.h index 2c17ae1d5..4cb08f165 100644 --- a/libbitdht/src/bitdht/bdquery.h +++ b/libbitdht/src/bitdht/bdquery.h @@ -1,32 +1,27 @@ +/******************************************************************************* + * bitdht/bdquery.h * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2010 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef BITDHT_QUERY_H #define BITDHT_QUERY_H -/* - * bitdht/bdquery.h - * - * BitDHT: An Flexible DHT library. - * - * Copyright 2010 by Robert Fernie - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 3 as published by the Free Software Foundation. - * - * This library 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 - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "bitdht@lunamutt.com". - * - */ - - #include "bitdht/bdiface.h" #include "bitdht/bdpeer.h" #include "bitdht/bdobj.h" diff --git a/libbitdht/src/bitdht/bdquerymgr.cc b/libbitdht/src/bitdht/bdquerymgr.cc index d920d1283..70f58ce90 100644 --- a/libbitdht/src/bitdht/bdquerymgr.cc +++ b/libbitdht/src/bitdht/bdquerymgr.cc @@ -1,27 +1,24 @@ -/* - * bitdht/bdnode.cc - * - * BitDHT: An Flexible DHT library. - * - * Copyright 2010 by Robert Fernie - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 3 as published by the Free Software Foundation. - * - * This library 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 - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "bitdht@lunamutt.com". - * - */ +/******************************************************************************* + * bitdht/bdquerymgr.cc * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2011 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include "bitdht/bdquerymgr.h" #include "bitdht/bdnode.h" diff --git a/libbitdht/src/bitdht/bdquerymgr.h b/libbitdht/src/bitdht/bdquerymgr.h index 042fbec41..355781244 100644 --- a/libbitdht/src/bitdht/bdquerymgr.h +++ b/libbitdht/src/bitdht/bdquerymgr.h @@ -1,32 +1,27 @@ +/******************************************************************************* + * bitdht/bdquerymgr.h * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2011 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef BITDHT_QUERY_MANAGER_H #define BITDHT_QUERY_MANAGER_H -/* - * bitdht/bdquerymgr.h - * - * BitDHT: An Flexible DHT library. - * - * Copyright 2011 by Robert Fernie - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 3 as published by the Free Software Foundation. - * - * This library 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 - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "bitdht@lunamutt.com". - * - */ - - #include "bitdht/bdquery.h" class bdNodePublisher; diff --git a/libbitdht/src/bitdht/bdstddht.cc b/libbitdht/src/bitdht/bdstddht.cc index 3faa85df2..eac5c148e 100644 --- a/libbitdht/src/bitdht/bdstddht.cc +++ b/libbitdht/src/bitdht/bdstddht.cc @@ -1,28 +1,24 @@ -/* - * bitdht/bdstddht.cc - * - * BitDHT: An Flexible DHT library. - * - * Copyright 2010 by Robert Fernie - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 3 as published by the Free Software Foundation. - * - * This library 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 - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "bitdht@lunamutt.com". - * - */ - +/******************************************************************************* + * bitdht/bdstddht.cc * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2011 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include "bitdht/bdstddht.h" #include "bitdht/bdpeer.h" diff --git a/libbitdht/src/bitdht/bdstddht.h b/libbitdht/src/bitdht/bdstddht.h index 4637cc8f2..d38c19724 100644 --- a/libbitdht/src/bitdht/bdstddht.h +++ b/libbitdht/src/bitdht/bdstddht.h @@ -1,32 +1,27 @@ +/******************************************************************************* + * bitdht/bdstddht.h * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2011 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef BITDHT_STANDARD_DHT_H #define BITDHT_STANDARD_DHT_H -/* - * bitdht/bdstddht.h - * - * BitDHT: An Flexible DHT library. - * - * Copyright 2010 by Robert Fernie - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 3 as published by the Free Software Foundation. - * - * This library 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 - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "bitdht@lunamutt.com". - * - */ - - #include "bitdht/bdiface.h" #define BITDHT_STANDARD_BUCKET_SIZE 10 // 20 too many per query? diff --git a/libbitdht/src/bitdht/bdstore.cc b/libbitdht/src/bitdht/bdstore.cc index 3465d71c6..40031abac 100644 --- a/libbitdht/src/bitdht/bdstore.cc +++ b/libbitdht/src/bitdht/bdstore.cc @@ -1,28 +1,24 @@ -/* - * bitdht/bdstore.cc - * - * BitDHT: An Flexible DHT library. - * - * Copyright 2010 by Robert Fernie - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 3 as published by the Free Software Foundation. - * - * This library 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 - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "bitdht@lunamutt.com". - * - */ - +/******************************************************************************* + * bitdht/bdstore.cc * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2011 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include "bitdht/bdstore.h" #include "util/bdnet.h" diff --git a/libbitdht/src/bitdht/bdstore.h b/libbitdht/src/bitdht/bdstore.h index 627972716..a01f5aa2c 100644 --- a/libbitdht/src/bitdht/bdstore.h +++ b/libbitdht/src/bitdht/bdstore.h @@ -1,32 +1,27 @@ +/******************************************************************************* + * bitdht/bdstore.h * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2011 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef BITDHT_STORE_H #define BITDHT_STORE_H -/* - * bitdht/bdstore.h - * - * BitDHT: An Flexible DHT library. - * - * Copyright 2010 by Robert Fernie - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 3 as published by the Free Software Foundation. - * - * This library 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 - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "bitdht@lunamutt.com". - * - */ - - #include #include "bitdht/bdiface.h" #include "bitdht/bdpeer.h" diff --git a/libbitdht/src/bitdht/bencode.c b/libbitdht/src/bitdht/bencode.c index b1f4c2eaf..a496f5bc3 100644 --- a/libbitdht/src/bitdht/bencode.c +++ b/libbitdht/src/bitdht/bencode.c @@ -1,16 +1,25 @@ -/* - * C implementation of a bencode decoder. - * This is the format defined by BitTorrent: - * http://wiki.theory.org/BitTorrentSpecification#bencoding - * - * The only external requirements are a few [standard] function calls and - * the long long type. Any sane system should provide all of these things. - * - * See the bencode.h header file for usage information. - * - * This is released into the public domain. - * Written by Mike Frysinger . - */ +/******************************************************************************* + * bitdht/bdencode.cc * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2011 by Robert Fernie * + * by Mike Frysinger * + * * + * 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 . * + * * + *******************************************************************************/ /* * This implementation isn't optimized at all as I wrote it to support diff --git a/libbitdht/src/bitdht/bencode.h b/libbitdht/src/bitdht/bencode.h index 211c96542..4e733b66f 100644 --- a/libbitdht/src/bitdht/bencode.h +++ b/libbitdht/src/bitdht/bencode.h @@ -1,14 +1,27 @@ -/* - * C implementation of a bencode decoder. - * This is the format defined by BitTorrent: - * http://wiki.theory.org/BitTorrentSpecification#bencoding - * - * The only external requirements are a few [standard] function calls and - * the long long type. Any sane system should provide all of these things. - * - * This is released into the public domain. - * Written by Mike Frysinger . - */ +/******************************************************************************* + * bitdht/bdencode.h * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2011 by Robert Fernie * + * by Mike Frysinger * + * * + * 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 . * + * * + *******************************************************************************/ +#ifndef _BENCODE_H +#define _BENCODE_H /* USAGE: * - pass the string full of the bencoded data to be_decode() @@ -16,9 +29,6 @@ * - call be_free() on the tree to release resources */ -#ifndef _BENCODE_H -#define _BENCODE_H - #ifdef __cplusplus extern "C" { #endif diff --git a/libbitdht/src/libbitdht.pro b/libbitdht/src/libbitdht.pro index 738deeab1..ab53768a5 100644 --- a/libbitdht/src/libbitdht.pro +++ b/libbitdht/src/libbitdht.pro @@ -1,3 +1,23 @@ +# RetroShare main qmake build script +# +# Copyright (C) 2004-2019, Retroshare Team +# +# This program is free software: you can redistribute it and/or modify it under +# the terms of the GNU Lesser 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 Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License along +# with this program. If not, see . +# +# SPDX-FileCopyrightText: Retroshare Team +# SPDX-License-Identifier: LGPL-3.0-or-later + !include("../../retroshare.pri"): error("Could not include file ../../retroshare.pri") TEMPLATE = lib @@ -6,23 +26,10 @@ CONFIG -= qt TARGET = bitdht DESTDIR = lib +!include("use_libbitdht.pri"):error("Including") + QMAKE_CXXFLAGS *= -Wall -DBE_DEBUG -profiling { - QMAKE_CXXFLAGS -= -fomit-frame-pointer - QMAKE_CXXFLAGS *= -pg -g -fno-omit-frame-pointer -} - -release { - # not much here yet. -} - -#CONFIG += debug -debug { - QMAKE_CXXFLAGS -= -O2 -fomit-frame-pointer - QMAKE_CXXFLAGS *= -g -fno-omit-frame-pointer -} - # treat warnings as error for better removing #QMAKE_CFLAGS += -Werror #QMAKE_CXXFLAGS += -Werror @@ -46,6 +53,12 @@ unix { INSTALLS += data_files } +android-* { + # see https://community.kde.org/Necessitas/Assets + bdboot.files=bitdht/bdboot.txt + bdboot.path=/assets/values + INSTALLS += bdboot +} #################### Cross compilation for windows under Linux #################### @@ -67,7 +80,7 @@ win32 { QMAKE_CC = $${QMAKE_CXX} OBJECTS_DIR = temp/obj MOC_DIR = temp/moc - DEFINES *= STATICLIB WIN32_LEAN_AND_MEAN _USE_32BIT_TIME_T + DEFINES *= STATICLIB WIN32_LEAN_AND_MEAN # These have been replaced by _WIN32 && __MINGW32__ #DEFINES *= WINDOWS_SYS WIN32 STATICLIB MINGW diff --git a/libbitdht/src/mingw32make.bat b/libbitdht/src/mingw32make.bat deleted file mode 100644 index 008a15473..000000000 --- a/libbitdht/src/mingw32make.bat +++ /dev/null @@ -1,13 +0,0 @@ -set QTDIR=C:\Qt\4.8.6 -set MINGW=C:\MinGW - -set PATH=%QTDIR%\bin;%MINGW%\bin;%PATH% - -mingw32-make clean - -qmake libbitdht.pro - -mingw32-make - -pause - diff --git a/libbitdht/src/udp/udpbitdht.cc b/libbitdht/src/udp/udpbitdht.cc index 39c13e182..72357c91f 100644 --- a/libbitdht/src/udp/udpbitdht.cc +++ b/libbitdht/src/udp/udpbitdht.cc @@ -1,28 +1,24 @@ -/* - * bitdht/udpbitdht.cc - * - * BitDHT: An Flexible DHT library. - * - * Copyright 2010 by Robert Fernie - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 3 as published by the Free Software Foundation. - * - * This library 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 - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "bitdht@lunamutt.com". - * - */ - +/******************************************************************************* + * bitdht/udpbitdht.cc * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2011 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include "udp/udpbitdht.h" #include "bitdht/bdpeer.h" diff --git a/libbitdht/src/udp/udpbitdht.h b/libbitdht/src/udp/udpbitdht.h index f1e167abf..5cbf0622d 100644 --- a/libbitdht/src/udp/udpbitdht.h +++ b/libbitdht/src/udp/udpbitdht.h @@ -1,32 +1,27 @@ +/******************************************************************************* + * udp/udpbitdht.h * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2011 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef UDP_BIT_DHT_CLASS_H #define UDP_BIT_DHT_CLASS_H -/* - * bitdht/udpbitdht.h - * - * BitDHT: An Flexible DHT library. - * - * Copyright 2010 by Robert Fernie - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 3 as published by the Free Software Foundation. - * - * This library 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 - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "bitdht@lunamutt.com". - * - */ - - #include #include #include diff --git a/libbitdht/src/udp/udplayer.cc b/libbitdht/src/udp/udplayer.cc index a0cc2324e..1a82c3d81 100644 --- a/libbitdht/src/udp/udplayer.cc +++ b/libbitdht/src/udp/udplayer.cc @@ -1,27 +1,24 @@ -/* - * udp/udplayer.cc - * - * BitDHT: An Flexible DHT library. - * - * Copyright 2004-2010 by Robert Fernie - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 3 as published by the Free Software Foundation. - * - * This library 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 - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "bitdht@lunamutt.com". - * - */ +/******************************************************************************* + * udp/udplayer.cc * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2004-2010 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include "udp/udplayer.h" #include "util/bdrandom.h" diff --git a/libbitdht/src/udp/udplayer.h b/libbitdht/src/udp/udplayer.h index 8f2551cb0..06e76c647 100644 --- a/libbitdht/src/udp/udplayer.h +++ b/libbitdht/src/udp/udplayer.h @@ -1,31 +1,27 @@ +/******************************************************************************* + * udp/udplayer.h * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2004-2010 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef BITDHT_UDP_LAYER_H #define BITDHT_UDP_LAYER_H -/* - * udp/udplayer.h - * - * BitDHT: An Flexible DHT library. - * - * Copyright 2004-2010 by Robert Fernie - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 3 as published by the Free Software Foundation. - * - * This library 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 - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "bitdht@lunamutt.com". - * - */ - #include "util/bdthreads.h" #include "util/bdnet.h" diff --git a/libbitdht/src/udp/udpproxylayer.h b/libbitdht/src/udp/udpproxylayer.h index 40ba10a91..939bdabf8 100644 --- a/libbitdht/src/udp/udpproxylayer.h +++ b/libbitdht/src/udp/udpproxylayer.h @@ -1,31 +1,26 @@ +/******************************************************************************* + * libbitdht/src/udp/udpproxylayer.h * + * * + * Copyright 2004 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ + #ifndef BITDHT_UDP_LAYER_H #define BITDHT_UDP_LAYER_H -/* - * udp/udplayer.h - * - * BitDHT: An Flexible DHT library. - * - * Copyright 2004-2010 by Robert Fernie - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 3 as published by the Free Software Foundation. - * - * This library 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 - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "bitdht@lunamutt.com". - * - */ - #include "util/bdthreads.h" #include "util/bdnet.h" diff --git a/libbitdht/src/udp/udpstack.cc b/libbitdht/src/udp/udpstack.cc index a66f4c6e2..fdf8eb9cf 100644 --- a/libbitdht/src/udp/udpstack.cc +++ b/libbitdht/src/udp/udpstack.cc @@ -1,27 +1,24 @@ -/* - * udp/udpstack.cc - * - * BitDHT: An Flexible DHT library. - * - * Copyright 2010 by Robert Fernie - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 3 as published by the Free Software Foundation. - * - * This library 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 - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "bitdht@lunamutt.com". - * - */ +/******************************************************************************* + * udp/udpstack.cc * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2011 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include "udp/udpstack.h" diff --git a/libbitdht/src/udp/udpstack.h b/libbitdht/src/udp/udpstack.h index 3f04f0d38..31b8ec324 100644 --- a/libbitdht/src/udp/udpstack.h +++ b/libbitdht/src/udp/udpstack.h @@ -1,32 +1,27 @@ +/******************************************************************************* + * udp/udpstack.h * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2011 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef BITDHT_UDP_STACK_RECEIVER_H #define BITDHT_UDP_STACK_RECEIVER_H -/* - * udp/udpstack.h - * - * BitDHT: An Flexible DHT library. - * - * Copyright 2010 by Robert Fernie - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 3 as published by the Free Software Foundation. - * - * This library 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 - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "bitdht@lunamutt.com". - * - */ - - #include "util/bdthreads.h" #include "util/bdnet.h" diff --git a/libbitdht/src/use_libbitdht.pri b/libbitdht/src/use_libbitdht.pri new file mode 100644 index 000000000..5758393af --- /dev/null +++ b/libbitdht/src/use_libbitdht.pri @@ -0,0 +1,25 @@ +# RetroShare main qmake build script +# +# Copyright (C) 2004-2019, Retroshare Team +# +# This program is free software: you can redistribute it and/or modify it under +# the terms of the GNU Lesser 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 Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License along +# with this program. If not, see . +# +# SPDX-FileCopyrightText: Retroshare Team +# SPDX-License-Identifier: LGPL-3.0-or-later + +DEPENDPATH *= $$system_path($$clean_path($${PWD}/../../libbitdht/src)) +INCLUDEPATH *= $$system_path($$clean_path($${PWD}/../../libbitdht/src)) +LIBS *= -L$$system_path($$clean_path($${OUT_PWD}/../../libbitdht/src/lib/)) -lbitdht + +!equals(TARGET, bitdht):PRE_TARGETDEPS *= $$system_path($$clean_path($${OUT_PWD}/../../libbitdht/src/lib/libbitdht.a)) diff --git a/libbitdht/src/util/bdbloom.cc b/libbitdht/src/util/bdbloom.cc index 016808ea4..739e2c793 100644 --- a/libbitdht/src/util/bdbloom.cc +++ b/libbitdht/src/util/bdbloom.cc @@ -1,27 +1,24 @@ -/* - * bitdht/bdbloom.cc - * - * BitDHT: An Flexible DHT library. - * - * Copyright 2011 by Robert Fernie - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 3 as published by the Free Software Foundation. - * - * This library 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 - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "bitdht@lunamutt.com". - * - */ +/******************************************************************************* + * util/bdbloom.cc * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2011 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include "util/bdbloom.h" #include "util/bdstring.h" diff --git a/libbitdht/src/util/bdbloom.h b/libbitdht/src/util/bdbloom.h index 91257514e..8ffd13f1e 100644 --- a/libbitdht/src/util/bdbloom.h +++ b/libbitdht/src/util/bdbloom.h @@ -1,32 +1,27 @@ +/******************************************************************************* + * util/bdbloom.h * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2011 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef BITDHT_BLOOM_H #define BITDHT_BLOOM_H -/* - * bitdht/bdbloom.h - * - * BitDHT: An Flexible DHT library. - * - * Copyright 2011 by Robert Fernie - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 3 as published by the Free Software Foundation. - * - * This library 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 - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "bitdht@lunamutt.com". - * - */ - - #include #include diff --git a/libbitdht/src/util/bdfile.cc b/libbitdht/src/util/bdfile.cc index 48db4a232..bcd2eb64b 100644 --- a/libbitdht/src/util/bdfile.cc +++ b/libbitdht/src/util/bdfile.cc @@ -1,3 +1,24 @@ +/******************************************************************************* + * util/bdfile.cc * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2011 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifdef WIN32 #include #endif diff --git a/libbitdht/src/util/bdfile.h b/libbitdht/src/util/bdfile.h index c3d5444d7..5228f986a 100644 --- a/libbitdht/src/util/bdfile.h +++ b/libbitdht/src/util/bdfile.h @@ -1,3 +1,24 @@ +/******************************************************************************* + * util/bdfile.h * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2011 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #pragma once #include diff --git a/libbitdht/src/util/bdnet.cc b/libbitdht/src/util/bdnet.cc index 3bccf0d65..ba8c33553 100644 --- a/libbitdht/src/util/bdnet.cc +++ b/libbitdht/src/util/bdnet.cc @@ -1,28 +1,24 @@ - -/* - * util/bdnet.cc - * - * BitDHT: An Flexible DHT library. - * - * Copyright 2010 by Robert Fernie - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 3 as published by the Free Software Foundation. - * - * This library 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 - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "bitdht@lunamutt.com". - * - */ +/******************************************************************************* + * util/bdnet.cc * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2010 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include "bdnet.h" #include "bdstring.h" @@ -289,12 +285,6 @@ int sleep(unsigned int sec) } #endif -int usleep(unsigned int usec) -{ - Sleep(usec / 1000); - return 0; -} - /********************************** WINDOWS/UNIX SPECIFIC PART ******************/ #else // UNIX diff --git a/libbitdht/src/util/bdnet.h b/libbitdht/src/util/bdnet.h index 7e3e24644..89ecfa710 100644 --- a/libbitdht/src/util/bdnet.h +++ b/libbitdht/src/util/bdnet.h @@ -1,30 +1,26 @@ +/******************************************************************************* + * util/bdnet.h * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright 2010 by Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef BITDHT_UNIVERSAL_NETWORK_HEADER #define BITDHT_UNIVERSAL_NETWORK_HEADER -/* - * - * util/bdnet.h - * - * BitDHT: An Flexible DHT library. - * - * Copyright 2004-2010 by Robert Fernie - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 3 as published by the Free Software Foundation. - * - * This library 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 - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "bitdht@lunamutt.com". - * - */ #include #include @@ -163,7 +159,6 @@ int bdnet_w2u_errno(int error); #ifndef __MINGW64_VERSION_MAJOR int sleep(unsigned int sec); #endif -int usleep(unsigned int usec); #endif // END of WINDOWS defines. /********************************** WINDOWS/UNIX SPECIFIC PART ******************/ diff --git a/libbitdht/src/util/bdrandom.cc b/libbitdht/src/util/bdrandom.cc index 6288f86b8..93a0352dd 100644 --- a/libbitdht/src/util/bdrandom.cc +++ b/libbitdht/src/util/bdrandom.cc @@ -1,3 +1,24 @@ +/******************************************************************************* + * util/bdrandom.cc * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright (C) 2010 Cyril Soler * + * * + * 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 . * + * * + *******************************************************************************/ #include #include #include diff --git a/libbitdht/src/util/bdrandom.h b/libbitdht/src/util/bdrandom.h index 95d70bf13..9ab3f22bd 100644 --- a/libbitdht/src/util/bdrandom.h +++ b/libbitdht/src/util/bdrandom.h @@ -1,39 +1,37 @@ +/******************************************************************************* + * util/bdrandom.h * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright (C) 2010 Cyril Soler * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef BITDHT_UTILS_BDRANDOM_H #define BITDHT_UTILS_BDRANDOM_H - -/**************************************************************** - * libbitdht is distributed under the following license: - * - * Copyright (C) 2010 Cyril Soler - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ - /* This Source Code is basically a direct copy of libretroshare's RsRandom. * the function names have just been renamed. drbob */ - // bdRandom contains a random number generator that is // - thread safe // - system independant // - fast // - NOT CRYPTOGRAPHICALLY SAFE -// - DO NOT USE FOR ANYTHING REQUIRING STRONG RANDOMNESS +// - DO NOT USE FOR ANYTHING REQUIRING STRONG UNPREDICTABLE RANDOMNESS // // The implementation is adapted from the Mersenne Twister page of Wikipedia. // diff --git a/libbitdht/src/util/bdstring.cc b/libbitdht/src/util/bdstring.cc index 07fd4632f..3808e0c68 100644 --- a/libbitdht/src/util/bdstring.cc +++ b/libbitdht/src/util/bdstring.cc @@ -1,23 +1,24 @@ -/**************************************************************** - * This file is distributed under the following license: - * - * Copyright (c) 2012, RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * util/bdstring.h * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright (C) 2010 Retroshare Team * + * * + * 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 . * + * * + *******************************************************************************/ #include "bdstring.h" diff --git a/libbitdht/src/util/bdstring.h b/libbitdht/src/util/bdstring.h index 9c4dc94aa..e9160c663 100644 --- a/libbitdht/src/util/bdstring.h +++ b/libbitdht/src/util/bdstring.h @@ -1,27 +1,27 @@ +/******************************************************************************* + * util/bdstring.cc * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright (C) 2010 Retroshare Team * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef BITDHT_UTILS_BDSTRING_H #define BITDHT_UTILS_BDSTRING_H -/**************************************************************** - * libbitdht is distributed under the following license: - * - * Copyright (C) 2012 RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ - #ifdef WIN32 // for proper handling of %ll #define bd_snprintf __mingw_snprintf diff --git a/libbitdht/src/util/bdthreads.cc b/libbitdht/src/util/bdthreads.cc index b52d152da..3fce7ff43 100644 --- a/libbitdht/src/util/bdthreads.cc +++ b/libbitdht/src/util/bdthreads.cc @@ -1,29 +1,24 @@ -/* - * util/bdthreads.cc - * - * BitDHT: An Flexible DHT library. - * - * Copyright 2004-2010 by Robert Fernie - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 3 as published by the Free Software Foundation. - * - * This library 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 - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "bitdht@lunamutt.com". - * - */ - - +/******************************************************************************* + * util/bdthread.cc * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright (C) 2004-2010 Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #include "bdthreads.h" #include /* for usleep() */ @@ -126,7 +121,7 @@ void bdThread::join() /* waits for the the mTid thread to stop */ mMutex.lock(); { -#if defined(_WIN32) || defined(__MINGW32__) +#if defined(_WIN32) || defined(__MINGW32__) || defined(__APPLE__) /* Its a struct in Windows compile and the member .p ist checked in the pthreads library */ #else if(mTid > 0) diff --git a/libbitdht/src/util/bdthreads.h b/libbitdht/src/util/bdthreads.h index 23350af18..34c48b1bc 100644 --- a/libbitdht/src/util/bdthreads.h +++ b/libbitdht/src/util/bdthreads.h @@ -1,32 +1,27 @@ +/******************************************************************************* + * util/bdthread.cc * + * * + * BitDHT: An Flexible DHT library. * + * * + * Copyright (C) 2004-2010 Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ #ifndef BITDHT_THREADS_H #define BITDHT_THREADS_H -/* - * util/bdthreads.h - * - * BitDHT: An Flexible DHT library. - * - * Copyright 2004-2010 by Robert Fernie - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 3 as published by the Free Software Foundation. - * - * This library 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 - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "bitdht@lunamutt.com". - * - */ - - #include #include #include diff --git a/libresapi/src/.gitignore b/libresapi/src/.gitignore deleted file mode 100644 index afe2a0b3d..000000000 --- a/libresapi/src/.gitignore +++ /dev/null @@ -1 +0,0 @@ -webui/* diff --git a/libresapi/src/README.md b/libresapi/src/README.md deleted file mode 100644 index ee8cf5671..000000000 --- a/libresapi/src/README.md +++ /dev/null @@ -1,14 +0,0 @@ -libresapi: resource_api and new webinterface -============================================ - -* ./api contains a C++ backend to control retroshare from webinterfaces or scripting -* ./webui contains compiled files for the webinterface (after build) -* ./webui-src contains HTML/CSS/JavaScript source files for the webinterface (NEW, webinterface made with mithril.js) - -Quickinfo for builders and packagers -==================================== - -* copy the files in ./webui to -* ./webui (Windows) -* /usr/share/retroshare/webui (Linux) -* other OS: see RsAccountsDetail::PathDataDirectory() diff --git a/libresapi/src/api/ApiPluginHandler.cpp b/libresapi/src/api/ApiPluginHandler.cpp deleted file mode 100644 index fe3211eac..000000000 --- a/libresapi/src/api/ApiPluginHandler.cpp +++ /dev/null @@ -1,41 +0,0 @@ -#include "ApiPluginHandler.h" - -namespace resource_api -{ - -ApiPluginHandler::ApiPluginHandler(StateTokenServer* statetokenserver, const RsPlugInInterfaces& ifaces) -{ - for(int i = 0; i < ifaces.mPluginHandler->nbPlugins(); i++) - { - RsPlugin* plugin = ifaces.mPluginHandler->plugin(i); - // if plugin is not loaded, pointer is null - if(plugin == 0) - continue; - std::string entrypoint; - ResourceRouter* child = plugin->new_resource_api_handler(ifaces, statetokenserver, entrypoint); - if(child != 0) - { - mChildren.push_back(child); - if(isNameUsed(entrypoint)) - { - std::cerr << "Cannot add plugin api entry point with name=" << entrypoint << ", becaus ethis name is already in use!" << std::endl; - } - else - { - std::cerr << "Added libresapi plugin with entrypoint " << entrypoint << std::endl; - addResourceHandler(entrypoint, child, &ResourceRouter::handleRequest); - } - } - } -} - -ApiPluginHandler::~ApiPluginHandler() -{ - for(std::vector::iterator vit = mChildren.begin(); vit != mChildren.end(); ++vit) - { - delete *vit; - } - mChildren.clear(); -} - -} // namespace resource_api diff --git a/libresapi/src/api/ApiPluginHandler.h b/libresapi/src/api/ApiPluginHandler.h deleted file mode 100644 index ad29922f6..000000000 --- a/libresapi/src/api/ApiPluginHandler.h +++ /dev/null @@ -1,20 +0,0 @@ -#pragma once - -#include "ResourceRouter.h" -#include - -namespace resource_api -{ - -// forwards all incoming requests to retroshare plugins -class ApiPluginHandler: public ResourceRouter -{ -public: - ApiPluginHandler(StateTokenServer* statetokenserver, const RsPlugInInterfaces& ifaces); - virtual ~ApiPluginHandler(); - -private: - std::vector mChildren; -}; - -} // namespace resource_api diff --git a/libresapi/src/api/ApiServer.cpp b/libresapi/src/api/ApiServer.cpp deleted file mode 100644 index d4e1c9fe5..000000000 --- a/libresapi/src/api/ApiServer.cpp +++ /dev/null @@ -1,439 +0,0 @@ -#include "ApiServer.h" - -#include -#include - -#include -#include -#include -#include -#include "json.h" - -#include -#include "JsonStream.h" -#include "StateTokenServer.h" // for the state token serialisers - -#include "ApiPluginHandler.h" -#include "ChannelsHandler.h" -#include "StatsHandler.h" - -#ifdef LIBRESAPI_QT - #include "SettingsHandler.h" -#endif - -/* -data types in json http://json.org/ -string (utf-8 unicode) -number (int and float) -object (key value pairs, key must be a string) -true -false -null - -data types in lua http://www.lua.org/pil/2.html -nil -boolean -number (double) -string (8-bit) -table (key value pairs, keys can be anything except nil) - -data types in QML http://qt-project.org/doc/qt-5/qtqml-typesystem-basictypes.html -bool -string -real/double -int -list -object types? - -QML has many more types with special meaning like date - - -C++ delivers -std::string -bool -int -(double? i don't know) -enum -bitflags -raw binary data - -objects -std::vector -std::list - -different types of ids/hashes --> convert to/from string with a generic operator --> the operator signals ok/fail to the stream - - -*/ - -/* - -data types to handle: -- bool -- string -- bitflags -- enums - -containers: -- arrays: collection of objects or values without name, usually of the same type -- objects: objects and values with names - -careful: the json lib has many asserts, so retroshare will stop if the smalles thing goes wrong --> check type of json before usage - -there are two possible implementations: -- with a virtual base class for the serialisation targets - - better documentation of the interface -- with templates - -*/ - -/* - -the general idea is: -want output in many different formats, while the retrival of the source data is always the same - -get, put - -ressource adress like -.org.retroshare.api.peers - -generic router from adress to the ressource handler object - -data formats for input and output: -- json -- lua -- QObject -- maybe just a typed c++ object - -rest inspired / resource based interface -- have resources with adresses -- requests: - - put - - get -- request has parameters -- response: - - returncode: - - ok - - not modified - - error - - data = object or list of objects - -want to have a typesafe interface at the top? -probably not, a system with generic return values is enough -this interface is for scripting languages which don't have types - -the interface at the top should look like this: -template -processRequest(const RequestMeta& req, const RequestDataFormatT& reqData, - ResponseMeta& respMeta, ResponseDataFormatT& respData); - -idea: pass all the interfaces to the retroshare core to this function, -or have this function as part of an object - -the processor then applies all members of the request and response data to the data format like this: -reqData << "member1" << member1 - << "member2" << member2 ... ; - -these operators have to be implemented for common things like boolean, int, std::string, std::vector, std::list ... -request data gets only deserialised -response data gets only serialised - -response and request meta contains things like resource address, method and additional parameters - -want generic resource caching mechanism -- on first request a request handler is created -- request handler is stored with its input data -- if a request handler for a given resource adress and parameters exists - then the request handler is asked if the result is still valid - if yes the result from the existing handler is used -- request handler gets deleted after timeout -- can have two types of resource handlers: static handlers and dynamic handlers - - static handlers don't get deleted, because they don't contain result data - - dynamic handlers contain result data, and thus get deleted after a while - -it is even possible to implement a resource-changed check at the highest level -this allows to compute everything on the server side and only send changes to the client -the different resource providers don't have to implement a resource changed check then -a top level change detector will poll them -of course this does not work with a deep resource tree with millions of nodes - -for this we have the dynamic handlers, -they are created on demand and know how to listen for changes which affect them - -*/ - -namespace resource_api{ - -// old code, only to copy and paste from -// to be removed -/* -class ChatlobbiesHandler -{ -public: - ChatlobbiesHandler(RsMsgs* msgs): mMsgs(msgs) {} - - template - void handleRequest(Request& req, InputT& reqData, Response& resp, OutputT& respData) - { - if(req.mMethod == "GET") - { - typename OutputT::Array result; - // subscribed lobbies - std::list slobbies; - mMsgs->getChatLobbyList(slobbies); - for(std::list::iterator lit = slobbies.begin(); lit != slobbies.end(); lit++) - { - typename OutputT::Object lobby; - ChatLobbyInfo& lobbyRecord = *lit; - lobby["name"] = lobbyRecord.lobby_name; - RsPeerId pid; - mMsgs->getVirtualPeerId(lobbyRecord.lobby_id, pid); - lobby["id"] = pid.toStdString(); - lobby["subscribed"] = true; - result.push_back(lobby); - } - // unsubscirbed lobbies - std::vector ulobbies; - mMsgs->getListOfNearbyChatLobbies(ulobbies); - for(std::vector::iterator vit = ulobbies.begin(); vit != ulobbies.end(); vit++) - { - typename OutputT::Object lobby; - VisibleChatLobbyRecord& lobbyRecord = *vit; - lobby["name"] = lobbyRecord.lobby_name; - RsPeerId pid; - mMsgs->getVirtualPeerId(lobbyRecord.lobby_id, pid); - lobby["id"] = pid.toStdString(); - lobby["subscribed"] = false; - result.push_back(lobby); - } - respData = result; - } - else if(req.mMethod == "PUT") - { - RsPeerId id = RsPeerId(req.mAdress.substr(1)); - - if(!id.isNull() && reqData.HasKey("msg")) - { - // for now can send only id as message - mMsgs->sendPrivateChat(id, reqData["msg"]); - } - } - } - - RsMsgs* mMsgs; -}; -*/ - -class ApiServerMainModules -{ -public: - ApiServerMainModules(ResourceRouter& router, StateTokenServer* sts, const RsPlugInInterfaces &ifaces): - mPeersHandler(sts, ifaces.mNotify, ifaces.mPeers, ifaces.mMsgs), - mIdentityHandler(sts, ifaces.mNotify, ifaces.mIdentity), - mForumHandler(ifaces.mGxsForums), - mServiceControlHandler(ifaces.mServiceControl), - mFileSearchHandler(sts, ifaces.mNotify, ifaces.mTurtle, ifaces.mFiles), - mTransfersHandler(sts, ifaces.mFiles), - mChatHandler(sts, ifaces.mNotify, ifaces.mMsgs, ifaces.mPeers, ifaces.mIdentity, &mPeersHandler), - mApiPluginHandler(sts, ifaces), - mChannelsHandler(ifaces.mGxsChannels), - mStatsHandler() -#ifdef LIBRESAPI_QT - ,mSettingsHandler(sts) -#endif - { - // the dynamic cast is to not confuse the addResourceHandler template like this: - // addResourceHandler(derived class, parent class) - // the template would then be instantiated using derived class as parameter - // and then parent class would not match the type - router.addResourceHandler("peers",dynamic_cast(&mPeersHandler), - &PeersHandler::handleRequest); - router.addResourceHandler("identity", dynamic_cast(&mIdentityHandler), - &IdentityHandler::handleRequest); - router.addResourceHandler("forums", dynamic_cast(&mForumHandler), - &ForumHandler::handleRequest); - router.addResourceHandler("servicecontrol", dynamic_cast(&mServiceControlHandler), - &ServiceControlHandler::handleRequest); - router.addResourceHandler("filesearch", dynamic_cast(&mFileSearchHandler), - &FileSearchHandler::handleRequest); - router.addResourceHandler("transfers", dynamic_cast(&mTransfersHandler), - &TransfersHandler::handleRequest); - router.addResourceHandler("chat", dynamic_cast(&mChatHandler), - &ChatHandler::handleRequest); - router.addResourceHandler("apiplugin", dynamic_cast(&mApiPluginHandler), - &ChatHandler::handleRequest); - router.addResourceHandler("channels", dynamic_cast(&mChannelsHandler), - &ChannelsHandler::handleRequest); - router.addResourceHandler("stats", dynamic_cast(&mStatsHandler), - &StatsHandler::handleRequest); -#ifdef LIBRESAPI_QT - router.addResourceHandler("settings", dynamic_cast(&mSettingsHandler), - &SettingsHandler::handleRequest); -#endif - } - - PeersHandler mPeersHandler; - IdentityHandler mIdentityHandler; - ForumHandler mForumHandler; - ServiceControlHandler mServiceControlHandler; - FileSearchHandler mFileSearchHandler; - TransfersHandler mTransfersHandler; - ChatHandler mChatHandler; - ApiPluginHandler mApiPluginHandler; - ChannelsHandler mChannelsHandler; - StatsHandler mStatsHandler; - -#ifdef LIBRESAPI_QT - SettingsHandler mSettingsHandler; -#endif -}; - -ApiServer::ApiServer(): - mMtx("ApiServer mMtx"), - mStateTokenServer(), - mLivereloadhandler(&mStateTokenServer), - mTmpBlobStore(&mStateTokenServer), - mMainModules(0) -{ - mRouter.addResourceHandler("statetokenservice", dynamic_cast(&mStateTokenServer), - &StateTokenServer::handleRequest); - mRouter.addResourceHandler("livereload", dynamic_cast(&mLivereloadhandler), - &LivereloadHandler::handleRequest); -} - -ApiServer::~ApiServer() -{ - RS_STACK_MUTEX(mMtx); // ********** LOCKED ********** - for(std::vector::iterator vit = mRequests.begin(); vit != mRequests.end(); ++vit) - delete vit->task; - mRequests.clear(); - - if(mMainModules) - delete mMainModules; -} - -void ApiServer::loadMainModules(const RsPlugInInterfaces &ifaces) -{ - RS_STACK_MUTEX(mMtx); // ********** LOCKED ********** - if(mMainModules == 0) - mMainModules = new ApiServerMainModules(mRouter, &mStateTokenServer, ifaces); -} - -std::string ApiServer::handleRequest(Request &request) -{ - resource_api::JsonStream outstream; - std::stringstream debugString; - - StreamBase& data = outstream.getStreamToMember("data"); - resource_api::Response resp(data, debugString); - - ResponseTask* task = 0; - { - RS_STACK_MUTEX(mMtx); // ********** LOCKED ********** - task = mRouter.handleRequest(request, resp); - } - - //time_t start = time(NULL); - bool morework = true; - while(task && morework) - { - { - RS_STACK_MUTEX(mMtx); // ********** LOCKED ********** - morework = task->doWork(request, resp); - } - if(morework) - usleep(10*1000); - /*if(time(NULL) > (start+5)) - { - std::cerr << "ApiServer::handleRequest() Error: task timed out" << std::endl; - resp.mDebug << "Error: task timed out." << std::endl; - resp.mReturnCode = resource_api::Response::FAIL; - break; - }*/ - } - if(task) - delete task; - - std::string returncode; - switch(resp.mReturnCode){ - case resource_api::Response::NOT_SET: - returncode = "not_set"; - break; - case resource_api::Response::OK: - returncode = "ok"; - break; - case resource_api::Response::WARNING: - returncode = "warning"; - break; - case resource_api::Response::FAIL: - returncode = "fail"; - break; - } - - // evil HACK, remove this - if(data.isRawData()) - return data.getRawData(); - - if(!resp.mCallbackName.empty()) - outstream << resource_api::makeKeyValueReference("callback_name", resp.mCallbackName); - - outstream << resource_api::makeKeyValue("debug_msg", debugString.str()); - outstream << resource_api::makeKeyValueReference("returncode", returncode); - if(!resp.mStateToken.isNull()) - outstream << resource_api::makeKeyValueReference("statetoken", resp.mStateToken); - return outstream.getJsonString(); -} - -ApiServer::RequestId ApiServer::handleRequest(Request &request, Response &response) -{ - RequestId id; - ResponseTask* task = 0; - { - RS_STACK_MUTEX(mMtx); // ********** LOCKED ********** - task = mRouter.handleRequest(request, response); - } - if(task == 0) - { - id.done = true; - return id; - } - id.done = false, - id.task = task; - id.request = &request; - id.response = &response; - { - RS_STACK_MUTEX(mMtx); // ********** LOCKED ********** - mRequests.push_back(id); - } - return id; -} - -bool ApiServer::isRequestDone(RequestId id) -{ - if(id.done) - return true; - - RS_STACK_MUTEX(mMtx); // ********** LOCKED ********** - std::vector::iterator vit = std::find(mRequests.begin(), mRequests.end(), id); - // Request id not found, maybe the id is old and was removed from the list - if(vit == mRequests.end()) - return true; - - if(id.task->doWork(*id.request, *id.response)) - return false; - - // if we reach this point, the request is in the list and done - // remove the id from the list of valid ids - // delete the ResponseTask object - - *vit = mRequests.back(); - mRequests.pop_back(); - - delete id.task; - return true; -} - -} // namespace resource_api diff --git a/libresapi/src/api/ApiServer.h b/libresapi/src/api/ApiServer.h deleted file mode 100644 index 10b4c92b0..000000000 --- a/libresapi/src/api/ApiServer.h +++ /dev/null @@ -1,110 +0,0 @@ -#pragma once - -#include - -#include "ApiTypes.h" -#include "PeersHandler.h" -#include "IdentityHandler.h" -#include "ForumHandler.h" -#include "ServiceControlHandler.h" -#include "StateTokenServer.h" -#include "FileSearchHandler.h" -#include "TransfersHandler.h" -#include "LivereloadHandler.h" -#include "TmpBlobStore.h" -#include "ChatHandler.h" - -namespace resource_api{ - -class ApiServerMainModules; - -// main entry point for all resource_api calls -// general part of the api server -// should work with any http library or a different transport protocol (e.g. SSH) - -// call chain is like this: -// HTTP server -> ApiServer -> different handlers -// or -// GUI -> ApiServer -> different handlers -// multiple clients can use the same ApiServer instance at the same time - -// ALL public methods in this class are thread safe -// this allows differen threads to send requests -class ApiServer -{ -public: - ApiServer(); - ~ApiServer(); - - class RequestId{ - public: - RequestId(): done(false), task(0), request(0), response(0){} - bool operator ==(const RequestId& r){ - const RequestId& l = *this; - return (l.done==r.done)&&(l.task==r.task)&&(l.request==r.request)&&(l.response&&r.response); - } - private: - friend class ApiServer; - bool done; // this flag will be set to true, to signal the task id is valid and the task is done - // (in case there was no ResponseTask and task was zero) - ResponseTask* task; // null when the task id is invalid or when there was no task - Request* request; - Response* response; - }; - - // process the requestgiven by request and return the response as json string - // blocks until the request was processed - std::string handleRequest(Request& request); - - // request and response must stay valid until isRequestDone returns true - // this method may do some work but it does not block - RequestId handleRequest(Request& request, Response& response); - - // ticks the request - // returns true if the request is done or the id is invalid - // this method may do some work but it does not block - bool isRequestDone(RequestId id); - - // load the main api modules - void loadMainModules(const RsPlugInInterfaces& ifaces); - - // allows to add more handlers - // make sure the livetime of the handlers is longer than the api server - template - void addResourceHandler(std::string name, T* instance, ResponseTask* (T::*callback)(Request& req, Response& resp)); - template - void addResourceHandler(std::string name, T* instance, void (T::*callback)(Request& req, Response& resp)); - - StateTokenServer* getStateTokenServer(){ return &mStateTokenServer; } - TmpBlobStore* getTmpBlobStore(){ return &mTmpBlobStore; } - -private: - RsMutex mMtx; - StateTokenServer mStateTokenServer; // goes first, as others may depend on it - // is always loaded, because it has no dependencies - LivereloadHandler mLivereloadhandler; - TmpBlobStore mTmpBlobStore; - - // only pointers here, to load/unload modules at runtime - ApiServerMainModules* mMainModules; // loaded when RS is started - - ResourceRouter mRouter; - - std::vector mRequests; -}; - -// implementations -template -void ApiServer::addResourceHandler(std::string name, T* instance, ResponseTask* (T::*callback)(Request& req, Response& resp)) -{ - RS_STACK_MUTEX(mMtx); // ********** LOCKED ********** - mRouter.addResourceHandler(name, instance, callback); -} -template -void ApiServer::addResourceHandler(std::string name, T* instance, void (T::*callback)(Request& req, Response& resp)) -{ - RS_STACK_MUTEX(mMtx); // ********** LOCKED ********** - mRouter.addResourceHandler(name, instance, callback); -} - -} diff --git a/libresapi/src/api/ApiServerLocal.cpp b/libresapi/src/api/ApiServerLocal.cpp deleted file mode 100644 index ec1812af7..000000000 --- a/libresapi/src/api/ApiServerLocal.cpp +++ /dev/null @@ -1,136 +0,0 @@ -/* - * libresapi local socket server - * Copyright (C) 2016 Gioacchino Mazzurco - * - * 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 . - */ - -#include -#include "ApiServerLocal.h" -#include "JsonStream.h" - -namespace resource_api{ - -ApiServerLocal::ApiServerLocal(ApiServer* server, const QString &listenPath, QObject *parent) : - QObject(parent), serverThread(this), - localListener(server, listenPath) // Must have no parent to be movable to other thread -{ - localListener.moveToThread(&serverThread); - serverThread.start(); -} - -ApiServerLocal::~ApiServerLocal() { serverThread.quit(); } - -ApiLocalListener::ApiLocalListener(ApiServer *server, - const QString &listenPath, - QObject *parent) : - QObject(parent), mApiServer(server), mLocalServer(this) -{ - mLocalServer.removeServer(listenPath); -#if QT_VERSION >= 0x050000 - mLocalServer.setSocketOptions(QLocalServer::UserAccessOption); -#endif - connect(&mLocalServer, SIGNAL(newConnection()), this, SLOT(handleConnection())); - mLocalServer.listen(listenPath); -} - -void ApiLocalListener::handleConnection() -{ - new ApiLocalConnectionHandler(mApiServer, - mLocalServer.nextPendingConnection(), this); -} - -ApiLocalConnectionHandler::ApiLocalConnectionHandler( - ApiServer* apiServer, QLocalSocket* sock, QObject *parent) : - QObject(parent), mApiServer(apiServer), mLocalSocket(sock), - mState(WAITING_PATH) -{ - connect(mLocalSocket, SIGNAL(disconnected()), this, SLOT(deleteLater())); - connect(sock, SIGNAL(readyRead()), this, SLOT(handlePendingRequests())); -} - -ApiLocalConnectionHandler::~ApiLocalConnectionHandler() -{ - mLocalSocket->close(); - delete mLocalSocket; -} - -void ApiLocalConnectionHandler::handlePendingRequests() -{ - switch(mState) - { - case WAITING_PATH: - { - if(mLocalSocket->canReadLine()) - { -readPath: - QString rString(mLocalSocket->readLine()); - rString = rString.simplified(); - if (!rString.isEmpty()) - { - if(rString.startsWith("PUT", Qt::CaseInsensitive)) reqMeth = resource_api::Request::PUT; - else if (rString.startsWith("DELETE", Qt::CaseInsensitive)) reqMeth = resource_api::Request::DELETE_AA; - else reqMeth = resource_api::Request::GET; - if(rString.contains(' ')) rString = rString.split(' ')[1]; - - reqPath = rString.toStdString(); - mState = WAITING_DATA; - - /* Because QLocalSocket is SOCK_STREAM some clients implementations - * like the one based on QLocalSocket feel free to send the whole - * request (PATH + DATA) in a single write(), causing readyRead() - * signal being emitted only once, in that case we should continue - * processing without waiting for readyRead() being fired again, so - * we don't break here as there may be more lines to read */ - } - else break; - } - } - case WAITING_DATA: - { - if(mLocalSocket->canReadLine()) - { - resource_api::JsonStream reqJson; - reqJson.setJsonString(std::string(mLocalSocket->readLine().constData())); - resource_api::Request req(reqJson); - req.mMethod = reqMeth; - req.setPath(reqPath); - - // Need this idiom because binary result may contains \0 - std::string&& resultString = mApiServer->handleRequest(req); - QByteArray rB(resultString.data(), resultString.length()); - - // Dirty trick to support avatars answers - if(rB.contains("\n") || !rB.startsWith("{") || !rB.endsWith("}")) - mLocalSocket->write(rB.toBase64()); - else mLocalSocket->write(rB); - mLocalSocket->write("\n\0"); - - mState = WAITING_PATH; - - /* Because QLocalSocket is SOCK_STREAM some clients implementations - * like the one based on QLocalSocket feel free to coalesce multiple - * upper level write() into a single socket write(), causing - * readyRead() signal being emitted only once, in that case we should - * keep processing without waiting for readyRead() being fired again */ - if(mLocalSocket->canReadLine()) goto readPath; - - // Now there are no more requests to process we can break - break; - } - } - } -} - -} // namespace resource_api diff --git a/libresapi/src/api/ApiServerLocal.h b/libresapi/src/api/ApiServerLocal.h deleted file mode 100644 index 1d6c87ae5..000000000 --- a/libresapi/src/api/ApiServerLocal.h +++ /dev/null @@ -1,96 +0,0 @@ -#pragma once -/* - * libresapi local socket server - * Copyright (C) 2016 Gioacchino Mazzurco - * - * 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 . - */ - -#include -#include -#include -#include -#include -#include - -#include "ApiTypes.h" -#include "ApiServer.h" - -namespace resource_api -{ - -class ApiLocalListener : public QObject -{ - Q_OBJECT - -public: - ApiLocalListener(ApiServer* server, const QString &listenPath, QObject *parent=0); - ~ApiLocalListener() { mLocalServer.close(); } - -public slots: - void handleConnection(); - -private: - ApiServer* mApiServer; - QLocalServer mLocalServer; -}; - -class ApiServerLocal : public QObject -{ - Q_OBJECT - -public: - ApiServerLocal(ApiServer* server, const QString& listenPath, QObject *parent=0); - ~ApiServerLocal(); - - const static QString& loginServerPath() - { - const static QString sockPath(RsAccounts::ConfigDirectory() - .append("/libresapi.sock").c_str()); - return sockPath; - } - - const static QString& serverPath() - { - const static QString sockPath(RsAccounts::AccountDirectory() - .append("/libresapi.sock").c_str()); - return sockPath; - } - -private: - QThread serverThread; - ApiLocalListener localListener; -}; - -class ApiLocalConnectionHandler : public QObject -{ - Q_OBJECT - -public: - ApiLocalConnectionHandler(ApiServer* apiServer, QLocalSocket* sock, QObject *parent = 0); - ~ApiLocalConnectionHandler(); - enum State {WAITING_PATH, WAITING_DATA}; - -public slots: - void handlePendingRequests(); - -private: - ApiServer* mApiServer; - QLocalSocket* mLocalSocket; - State mState; - std::string reqPath; - resource_api::Request::Method reqMeth; -}; - -} // namespace resource_api diff --git a/libresapi/src/api/ApiServerMHD.cpp b/libresapi/src/api/ApiServerMHD.cpp deleted file mode 100644 index 273010d8b..000000000 --- a/libresapi/src/api/ApiServerMHD.cpp +++ /dev/null @@ -1,669 +0,0 @@ -#include "ApiServerMHD.h" - -#include -#include -#include -#include -#include - -#include -#include "util/ContentTypes.h" - -// for filestreamer -#include - -// to determine default docroot -#include - -#include "JsonStream.h" -#include "ApiServer.h" - -#if MHD_VERSION < 0x00090000 - // very old version, probably v0.4.x on old debian/ubuntu - #define OLD_04_MHD_FIX -#endif - -// filestreamer only works if a content reader callback is allowed to return 0 -// this is allowed since libmicrohttpd revision 30402 -#if MHD_VERSION >= 0x00093101 // 0.9.31-1 - #define ENABLE_FILESTREAMER -#else - #warning libmicrohttpd is too old to support file streaming. upgrade to a newer version. -#endif - -#ifdef OLD_04_MHD_FIX -#define MHD_CONTENT_READER_END_OF_STREAM ((size_t) -1LL) -/** - * Create a response object. The response object can be extended with - * header information and then be used any number of times. - * - * @param size size of the data portion of the response - * @param fd file descriptor referring to a file on disk with the - * data; will be closed when response is destroyed; - * fd should be in 'blocking' mode - * @return NULL on error (i.e. invalid arguments, out of memory) - * @ingroup response - */ -struct MHD_Response * MHD_create_response_from_fd(size_t size, int fd) -{ - unsigned char *buf = (unsigned char *)malloc(size) ; - - if(buf == 0) - { - std::cerr << "replacement MHD_create_response_from_fd: malloc failed, size was " << size << std::endl; - close(fd); - return NULL ; - } - if(read(fd,buf,size) != size) - { - std::cerr << "replacement MHD_create_response_from_fd: READ error in file descriptor " << fd << " requested read size was " << size << std::endl; - close(fd); - free(buf) ; - return NULL ; - } - else - { - close(fd); - return MHD_create_response_from_data(size, buf,1,0) ; - } -} -#endif - -namespace resource_api{ - -std::string getDefaultDocroot() -{ - return RsAccounts::DataDirectory(false) + "/webui"; -} - -const char* API_ENTRY_PATH = "/api/v2"; -const char* FILESTREAMER_ENTRY_PATH = "/fstream/"; -const char* STATIC_FILES_ENTRY_PATH = "/static/"; -const char* UPLOAD_ENTRY_PATH = "/upload/"; - -static void secure_queue_response(MHD_Connection *connection, unsigned int status_code, struct MHD_Response* response); -static void sendMessage(MHD_Connection *connection, unsigned int status, std::string message); - -// interface for request handler classes -class MHDHandlerBase -{ -public: - virtual ~MHDHandlerBase(){} - // return MHD_NO to terminate connection - // return MHD_YES otherwise - // this function will get called by MHD until a response was queued - virtual int handleRequest( struct MHD_Connection *connection, - const char *url, const char *method, const char *version, - const char *upload_data, size_t *upload_data_size) = 0; -}; - -// handles calls to the resource_api -class MHDUploadHandler: public MHDHandlerBase -{ -public: - MHDUploadHandler(ApiServer* s): mState(BEGIN), mApiServer(s){} - virtual ~MHDUploadHandler(){} - // return MHD_NO or MHD_YES - virtual int handleRequest( struct MHD_Connection *connection, - const char */*url*/, const char *method, const char */*version*/, - const char *upload_data, size_t *upload_data_size) - { - // new request - if(mState == BEGIN) - { - if(strcmp(method, "POST") == 0) - { - mState = WAITING_DATA; - // first time there is no data, do nothing and return - return MHD_YES; - } - } - if(mState == WAITING_DATA) - { - if(upload_data && *upload_data_size) - { - mRequesString += std::string(upload_data, *upload_data_size); - *upload_data_size = 0; - return MHD_YES; - } - } - - std::vector bytes(mRequesString.begin(), mRequesString.end()); - - int id = mApiServer->getTmpBlobStore()->storeBlob(bytes); - - resource_api::JsonStream responseStream; - if(id) - responseStream << makeKeyValue("ok", true); - else - responseStream << makeKeyValue("ok", false); - - responseStream << makeKeyValueReference("id", id); - - std::string result = responseStream.getJsonString(); - - struct MHD_Response* resp = MHD_create_response_from_data(result.size(), (void*)result.data(), 0, 1); - - MHD_add_response_header(resp, "Content-Type", "application/json"); - - secure_queue_response(connection, MHD_HTTP_OK, resp); - MHD_destroy_response(resp); - return MHD_YES; - } - enum State {BEGIN, WAITING_DATA}; - State mState; - std::string mRequesString; - ApiServer* mApiServer; -}; - -// handles calls to the resource_api -class MHDApiHandler: public MHDHandlerBase -{ -public: - MHDApiHandler(ApiServer* s): mState(BEGIN), mApiServer(s){} - virtual ~MHDApiHandler(){} - // return MHD_NO or MHD_YES - virtual int handleRequest( struct MHD_Connection *connection, - const char *url, const char *method, const char */*version*/, - const char *upload_data, size_t *upload_data_size) - { - // new request - if(mState == BEGIN) - { - if(strcmp(method, "POST") == 0) - { - mState = WAITING_DATA; - // first time there is no data, do nothing and return - return MHD_YES; - } - } - if(mState == WAITING_DATA) - { - if(upload_data && *upload_data_size) - { - mRequesString += std::string(upload_data, *upload_data_size); - *upload_data_size = 0; - return MHD_YES; - } - } - - if(strstr(url, API_ENTRY_PATH) != url) - { - std::cerr << "FATAL ERROR in MHDApiHandler::handleRequest(): url does not start with api entry path, which is \"" << API_ENTRY_PATH << "\"" << std::endl; - return MHD_NO; - } - std::string path2 = (url + strlen(API_ENTRY_PATH)); - - resource_api::JsonStream instream; - instream.setJsonString(mRequesString); - resource_api::Request req(instream); - - if(strcmp(method, "GET") == 0) - { - req.mMethod = resource_api::Request::GET; - } - else if(strcmp(method, "POST") == 0) - { - req.mMethod = resource_api::Request::PUT; - } - else if(strcmp(method, "DELETE") == 0) - { - req.mMethod = resource_api::Request::DELETE_AA; - } - - req.setPath(path2); - - std::string result = mApiServer->handleRequest(req); - - struct MHD_Response* resp = MHD_create_response_from_data(result.size(), (void*)result.data(), 0, 1); - - // EVIL HACK remove - if(result[0] != '{') - MHD_add_response_header(resp, "Content-Type", "image/png"); - else - MHD_add_response_header(resp, "Content-Type", "application/json"); - - secure_queue_response(connection, MHD_HTTP_OK, resp); - MHD_destroy_response(resp); - return MHD_YES; - } - enum State {BEGIN, WAITING_DATA}; - State mState; - std::string mRequesString; - ApiServer* mApiServer; -}; - -#ifdef ENABLE_FILESTREAMER -class MHDFilestreamerHandler: public MHDHandlerBase -{ -public: - MHDFilestreamerHandler(): mSize(0){} - virtual ~MHDFilestreamerHandler(){} - - RsFileHash mHash; - uint64_t mSize; - - // return MHD_NO or MHD_YES - virtual int handleRequest( struct MHD_Connection *connection, - const char *url, const char */*method*/, const char */*version*/, - const char */*upload_data*/, size_t */*upload_data_size*/) - { - if(rsFiles == 0) - { - sendMessage(connection, MHD_HTTP_INTERNAL_SERVER_ERROR, "Error: rsFiles is null. Retroshare is probably not yet started."); - return MHD_YES; - } - std::string urls(url); - urls = urls.substr(strlen(FILESTREAMER_ENTRY_PATH)); - size_t perpos = urls.find('/'); - if(perpos == std::string::npos){ - mHash = RsFileHash(urls); - }else{ - mHash = RsFileHash(urls.substr(0, perpos)); - } - if(urls.empty() || mHash.isNull()) - { - sendMessage(connection, MHD_HTTP_NOT_FOUND, "Error: URL is not a valid file hash"); - return MHD_YES; - } - - FileInfo info; - std::list dls; - rsFiles->FileDownloads(dls); - if(!(rsFiles->alreadyHaveFile(mHash, info) || std::find(dls.begin(), dls.end(), mHash) != dls.end())) - { - sendMessage(connection, MHD_HTTP_NOT_FOUND, "Error: file not existing on local peer and not downloading. Start the download before streaming it."); - return MHD_YES; - } - mSize = info.size; - - struct MHD_Response* resp = MHD_create_response_from_callback( - mSize, 1024*1024, &contentReadercallback, this, NULL); - - // get content-type from extension - std::string ext = ""; - std::string::size_type i = info.fname.rfind('.'); - if(i != std::string::npos) - ext = info.fname.substr(i+1); - MHD_add_response_header(resp, "Content-Type", ContentTypes::cTypeFromExt(ext).c_str()); - - secure_queue_response(connection, MHD_HTTP_OK, resp); - MHD_destroy_response(resp); - return MHD_YES; - } - - static ssize_t contentReadercallback(void *cls, uint64_t pos, char *buf, size_t max) - { - MHDFilestreamerHandler* handler = (MHDFilestreamerHandler*)cls; - if(pos >= handler->mSize) - return MHD_CONTENT_READER_END_OF_STREAM; - uint32_t size_to_send = max; - if(!rsFiles->getFileData(handler->mHash, pos, size_to_send, (uint8_t*)buf)) - return 0; - return size_to_send; - } -}; -#endif // ENABLE_FILESTREAMER - -// MHD will call this for each element of the http header -static int _extract_host_header_it_cb(void *cls, - enum MHD_ValueKind kind, - const char *key, - const char *value) -{ - if(kind == MHD_HEADER_KIND) - { - // check if key is host - const char* h = "host"; - while(*key && *h) - { - if(tolower(*key) != *h) - return MHD_YES; - key++; - h++; - } - // strings have same length and content - if(*key == 0 && *h == 0) - { - *((std::string*)cls) = value; - } - } - return MHD_YES; -} - -// add security related headers and send the response on the given connection -// the reference counter is not touched -// this function is a wrapper around MHD_queue_response -// MHD_queue_response should be replaced with this function -static void secure_queue_response(MHD_Connection *connection, unsigned int status_code, struct MHD_Response* response) -{ - // TODO: protect againts handling untrusted content to the browser - // see: - // http://www.dotnetnoob.com/2012/09/security-through-http-response-headers.html - // http://www.w3.org/TR/CSP2/ - // https://code.google.com/p/doctype-mirror/wiki/ArticleContentSniffing - - // check content type - // don't server when no type or no whitelisted type is given - // TODO sending invalid mime types is as bad as not sending them TODO - /* - std::vector allowed_types; - allowed_types.push_back("text/html"); - allowed_types.push_back("application/json"); - allowed_types.push_back("image/png"); - */ - const char* type = MHD_get_response_header(response, "Content-Type"); - if(type == 0 /*|| std::find(allowed_types.begin(), allowed_types.end(), std::string(type)) == allowed_types.end()*/) - { - std::string page; - if(type == 0) - page = "

Fatal Error: no content type was set on this response. This is a bug.

"; - else - page = "

Fatal Error: this content type is not allowed. This is a bug.
Content-Type: "+std::string(type)+"

"; - struct MHD_Response* resp = MHD_create_response_from_data(page.size(), (void*)page.data(), 0, 1); - MHD_add_response_header(resp, "Content-Type", "text/html"); - MHD_queue_response(connection, MHD_HTTP_INTERNAL_SERVER_ERROR, resp); - MHD_destroy_response(resp); - } - - // tell Internet Explorer to not do content sniffing - MHD_add_response_header(response, "X-Content-Type-Options", "nosniff"); - - // Content security policy header, its a new technology and not implemented everywhere - - // get own host name as the browser sees it - std::string host; - MHD_get_connection_values(connection, MHD_HEADER_KIND, _extract_host_header_it_cb, (void*)&host); - - std::string csp; - csp += "default-src 'none';"; - csp += "script-src '"+host+STATIC_FILES_ENTRY_PATH+"';"; - csp += "font-src '"+host+STATIC_FILES_ENTRY_PATH+"';"; - csp += "img-src 'self';"; // allow images from all paths on this server - csp += "media-src 'self';"; // allow media files from all paths on this server - - MHD_add_response_header(response, "X-Content-Security-Policy", csp.c_str()); - - MHD_queue_response(connection, status_code, response); -} - -// wraps the given string in a html page and sends it as response with the given status code -static void sendMessage(MHD_Connection *connection, unsigned int status, std::string message) -{ - std::string page = "

"+message+"

"; - struct MHD_Response* resp = MHD_create_response_from_data(page.size(), (void*)page.data(), 0, 1); - MHD_add_response_header(resp, "Content-Type", "text/html"); - secure_queue_response(connection, status, resp); - MHD_destroy_response(resp); -} - -// convert all character to hex html entities -static std::string escape_html(std::string in) -{ - std::string out; - for(uint32_t i = 0; i < in.size(); i++) - { - char a = (in[i]&0xF0)>>4; - a = a < 10? a+'0': a-10+'A'; - char b = (in[i]&0x0F); - b = b < 10? b+'0': b-10+'A'; - out += std::string("&#x")+a+b+";"; - } - return out; -} - -ApiServerMHD::ApiServerMHD(ApiServer *server): - mConfigOk(false), mDaemon(0), mApiServer(server) -{ - memset(&mListenAddr, 0, sizeof(mListenAddr)); -} - -ApiServerMHD::~ApiServerMHD() -{ - stop(); -} - -bool ApiServerMHD::configure(std::string docroot, uint16_t port, std::string /*bind_address*/, bool allow_from_all) -{ - mRootDir = docroot; - // make sure the docroot dir ends with a slash - if(mRootDir.empty()) - mRootDir = "./"; - else if (mRootDir[mRootDir.size()-1] != '/' && mRootDir[mRootDir.size()-1] != '\\') - mRootDir += "/"; - - mListenAddr.sin_family = AF_INET; - mListenAddr.sin_port = htons(port); - - // untested - /* - if(!bind_address.empty()) - { - if(!inet_pton(AF_INET6, bind_address.c_str(), &mListenAddr.sin6_addr)) - { - std::cerr << "ApiServerMHD::configure() invalid bind address: \"" << bind_address << "\"" << std::endl; - return false; - } - } - else*/ if(allow_from_all) - { - mListenAddr.sin_addr.s_addr = htonl(INADDR_ANY); - std::cerr << "ApiServerMHD::configure(): will serve the webinterface to ALL IP adresses." << std::endl; - } - else - { - mListenAddr.sin_addr.s_addr = htonl(INADDR_LOOPBACK); - std::cerr << "ApiServerMHD::configure(): will serve the webinterface to LOCALHOST only." << std::endl; - } - - mConfigOk = true; - return true; -} - -bool ApiServerMHD::start() -{ - if(!mConfigOk) - { - std::cerr << "ApiServerMHD::start() ERROR: server not configured. You have to call configure() first." << std::endl; - return false; - } - if(mDaemon) - { - std::cerr << "ApiServerMHD::start() ERROR: server already started. You have to call stop() first." << std::endl; - return false; - } - mDaemon = MHD_start_daemon(MHD_USE_SELECT_INTERNALLY, 9999, // port will be overwritten by MHD_OPTION_SOCK_ADDR - &static_acceptPolicyCallback, this, - &static_accessHandlerCallback, this, - MHD_OPTION_NOTIFY_COMPLETED, &static_requestCompletedCallback, this, - MHD_OPTION_SOCK_ADDR, &mListenAddr, - MHD_OPTION_END); - if(mDaemon) - { - std::cerr << "ApiServerMHD::start() SUCCESS. Started server on port " << ntohs(mListenAddr.sin_port) << ". Serving files from \"" << mRootDir << "\" at " << STATIC_FILES_ENTRY_PATH << std::endl; - return true; - } - else - { - std::cerr << "ApiServerMHD::start() ERROR: starting the server failed. Maybe port " << ntohs(mListenAddr.sin_port) << " is already in use?" << std::endl; - return false; - } -} - -void ApiServerMHD::stop() -{ - if(mDaemon == 0) - return; - MHD_stop_daemon(mDaemon); - mDaemon = 0; -} - -int ApiServerMHD::static_acceptPolicyCallback(void *cls, const sockaddr *addr, socklen_t addrlen) -{ - return ((ApiServerMHD*)cls)->acceptPolicyCallback(addr, addrlen); -} - -int ApiServerMHD::static_accessHandlerCallback(void* cls, struct MHD_Connection * connection, - const char *url, const char *method, const char *version, - const char *upload_data, size_t *upload_data_size, - void **con_cls) -{ - return ((ApiServerMHD*)cls)->accessHandlerCallback(connection, url, method, version, - upload_data, upload_data_size, con_cls); -} - -void ApiServerMHD::static_requestCompletedCallback(void *cls, MHD_Connection* connection, - void **con_cls, MHD_RequestTerminationCode toe) -{ - ((ApiServerMHD*)cls)->requestCompletedCallback(connection, con_cls, toe); -} - - -int ApiServerMHD::acceptPolicyCallback(const sockaddr* /*addr*/, socklen_t /*addrlen*/) -{ - // accept all connetions - return MHD_YES; -} - -int ApiServerMHD::accessHandlerCallback(MHD_Connection *connection, - const char *url, const char *method, const char *version, - const char *upload_data, size_t *upload_data_size, - void **con_cls) -{ - // is this call a continuation for an existing request? - if(*con_cls) - { - return ((MHDHandlerBase*)(*con_cls))->handleRequest(connection, url, method, version, upload_data, upload_data_size); - } - - // these characters are not allowed in the url, raise an error if they occur - // reason: don't want to serve files outside the current document root - const char *double_dots = ".."; - if(strstr(url, double_dots)) - { - const char *error = "

Fatal error: found double dots (\"..\") in the url. This is not allowed

"; - struct MHD_Response* resp = MHD_create_response_from_data(strlen(error), (void*)error, 0, 1); - MHD_add_response_header(resp, "Content-Type", "text/html"); - secure_queue_response(connection, MHD_HTTP_INTERNAL_SERVER_ERROR, resp); - MHD_destroy_response(resp); - return MHD_YES; - } - - // if no path is given, redirect to index.html in static files directory - if(strlen(url) == 1 && url[0] == '/') - { - std::string location = std::string(STATIC_FILES_ENTRY_PATH) + "index.html"; - std::string errstr = "

Webinterface is at "+location+"

"; - const char *error = errstr.c_str(); - struct MHD_Response* resp = MHD_create_response_from_data(strlen(error), (void*)error, 0, 1); - MHD_add_response_header(resp, "Content-Type", "text/html"); - MHD_add_response_header(resp, "Location", location.c_str()); - secure_queue_response(connection, MHD_HTTP_FOUND, resp); - MHD_destroy_response(resp); - return MHD_YES; - } - // is it a call to the resource api? - if(strstr(url, API_ENTRY_PATH) == url) - { - // create a new handler and store it in con_cls - MHDHandlerBase* handler = new MHDApiHandler(mApiServer); - *con_cls = (void*) handler; - return handler->handleRequest(connection, url, method, version, upload_data, upload_data_size); - } - // is it a call to the filestreamer? - if(strstr(url, FILESTREAMER_ENTRY_PATH) == url) - { -#ifdef ENABLE_FILESTREAMER - // create a new handler and store it in con_cls - MHDHandlerBase* handler = new MHDFilestreamerHandler(); - *con_cls = (void*) handler; - return handler->handleRequest(connection, url, method, version, upload_data, upload_data_size); -#else - sendMessage(connection, MHD_HTTP_NOT_FOUND, "The filestreamer is not available, because this executable was compiled with a too old version of libmicrohttpd."); - return MHD_YES; -#endif - } - // is it a path to the static files? - if(strstr(url, STATIC_FILES_ENTRY_PATH) == url) - { - url = url + strlen(STATIC_FILES_ENTRY_PATH); - // else server static files - std::string filename = mRootDir + url; - // important: binary open mode (windows) - // else libmicrohttpd will replace crlf with lf and add garbage at the end of the file -#ifdef O_BINARY - int fd = open(filename.c_str(), O_RDONLY | O_BINARY); -#else - int fd = open(filename.c_str(), O_RDONLY); -#endif - if(fd == -1) - { - std::string direxists; - if(RsDirUtil::checkDirectory(mRootDir)) - direxists = "directory ""+mRootDir+"" exists"; - else - direxists = "directory ""+mRootDir+"" does not exist!"; - std::string msg = "

Error: can't open the requested file. path=""+escape_html(filename)+""

"+direxists+"

"; - sendMessage(connection, MHD_HTTP_NOT_FOUND, msg); - return MHD_YES; - } - - struct stat s; - if(fstat(fd, &s) == -1) - { - close(fd); - const char *error = "

Error: file was opened but stat failed.

"; - struct MHD_Response* resp = MHD_create_response_from_data(strlen(error), (void*)error, 0, 1); - MHD_add_response_header(resp, "Content-Type", "text/html"); - secure_queue_response(connection, MHD_HTTP_NOT_FOUND, resp); - MHD_destroy_response(resp); - return MHD_YES; - } - - // find the file extension and the content type - std::string extension; - int i = filename.size()-1; - while(i >= 0 && filename[i] != '.') - { - extension = filename[i] + extension; - i--; - }; - - struct MHD_Response* resp = MHD_create_response_from_fd(s.st_size, fd); - MHD_add_response_header(resp, "Content-Type", ContentTypes::cTypeFromExt(extension).c_str()); - secure_queue_response(connection, MHD_HTTP_OK, resp); - MHD_destroy_response(resp); - return MHD_YES; - } - - if(strstr(url, UPLOAD_ENTRY_PATH) == url) - { - // create a new handler and store it in con_cls - MHDHandlerBase* handler = new MHDUploadHandler(mApiServer); - *con_cls = (void*) handler; - return handler->handleRequest(connection, url, method, version, upload_data, upload_data_size); - } - - // if url is not a valid path, then serve a help page - sendMessage(connection, MHD_HTTP_NOT_FOUND, - "This address is invalid. Try one of the adresses below:
" - "
    " - "
  • /
    Retroshare webinterface
  • " - "
  • "+std::string(API_ENTRY_PATH)+"
    JSON over http api
  • " - "
  • "+std::string(FILESTREAMER_ENTRY_PATH)+"
    file streamer
  • " - "
  • "+std::string(STATIC_FILES_ENTRY_PATH)+"
    static files
  • " - "
" - ); - return MHD_YES; -} - -void ApiServerMHD::requestCompletedCallback(struct MHD_Connection */*connection*/, - void **con_cls, MHD_RequestTerminationCode /*toe*/) -{ - if(*con_cls) - { - delete (MHDHandlerBase*)(*con_cls); - } -} - -} // namespace resource_api diff --git a/libresapi/src/api/ApiServerMHD.h b/libresapi/src/api/ApiServerMHD.h deleted file mode 100644 index ec0897c95..000000000 --- a/libresapi/src/api/ApiServerMHD.h +++ /dev/null @@ -1,53 +0,0 @@ -#pragma once - -#include -#include -#include -#include -#include -#include - -#ifndef WINDOWS_SYS -#include -#endif - -namespace resource_api{ -class ApiServer; - -// returns the default docroot path -// (it is differen on different operating systems) -std::string getDefaultDocroot(); - -class ApiServerMHD -{ -public: - ApiServerMHD(ApiServer* server); - ~ApiServerMHD(); - /** - * @brief configure the http server - * @param docroot sets the directory from which static files should be served. default = ./ - * @param port the port to listen on. The server will listen on ipv4 and ipv6. - * @param bind_address NOT IMPLEMENTED optional, specifies an ipv6 adress to listen on. - * @param allow_from_all when true, listen on all ips. (only when bind_adress is empty) - * @return true on success - */ - bool configure(std::string docroot, uint16_t port, std::string bind_address, bool allow_from_all); - bool start(); - void stop(); - -private: - // static callbacks for libmicrohttpd, they call the members below - static int static_acceptPolicyCallback(void* cls, const struct sockaddr * addr, socklen_t addrlen); - static int static_accessHandlerCallback(void* cls, struct MHD_Connection * connection, const char *url, const char *method, const char *version, const char *upload_data, size_t *upload_data_size, void **con_cls); - static void static_requestCompletedCallback(void *cls, struct MHD_Connection* connection, void **con_cls, enum MHD_RequestTerminationCode toe); - int acceptPolicyCallback(const struct sockaddr * addr, socklen_t addrlen); - int accessHandlerCallback(struct MHD_Connection * connection, const char *url, const char *method, const char *version, const char *upload_data, size_t *upload_data_size, void **con_cls); - void requestCompletedCallback(struct MHD_Connection *connection, void **con_cls, MHD_RequestTerminationCode toe); - bool mConfigOk; - std::string mRootDir; - struct sockaddr_in mListenAddr; - MHD_Daemon* mDaemon; - ApiServer* mApiServer; -}; - -} // namespace resource_api diff --git a/libresapi/src/api/ApiTypes.h b/libresapi/src/api/ApiTypes.h deleted file mode 100644 index 6d6d5c746..000000000 --- a/libresapi/src/api/ApiTypes.h +++ /dev/null @@ -1,314 +0,0 @@ -#pragma once - -#include -#include -#include -#include -#include - -#include "util/rsdeprecate.h" - -namespace resource_api -{ -// things to clean up: -// - temporary variables when serialising rs-ids -// - always ensure proper return values -// - add help functions -// - remove unused functions or implement them -// - add operators or functions for std::set, std::list, std::vector, std::map - - -// idea: -// make a second parameter like -// ValueReference(this->member, OPTIONAL); // optional signals that it is not an error if this member is missing -// make a third parameter with a type hint: time, length, kilobytes - -// to make arrays -template -class ValueReference -{ -public: - ValueReference(T& value): value(value){} - T& value; -}; - -template -ValueReference makeValueReference(T& value); - -template -class Value -{ -public: - Value(T value): value(value){} - operator ValueReference(){ return ValueReference(value);} - T value; -}; - -template -Value makeValue(T value); - -// to make objects -template -class KeyValueReference -{ -public: - KeyValueReference(std::string key, T& value): key(key), value(value){} - //KeyValueReference(const char* key, T& value): key(key), value(value){} - std::string key; - T& value; -}; - -template -KeyValueReference makeKeyValueReference(std::string key, T& value); - -// for serialisation -// copies the supplied value -// automatically converts itself to a KeyValueReference -template -class KeyValue -{ -public: - KeyValue(std::string key, T value): key(key), value(value){} - - operator KeyValueReference(){ return KeyValueReference(key, value);} - - std::string key; - T value; -}; - -template -KeyValue makeKeyValue(std::string key, T value); - -// interface for streams -class StreamBase -{ -public: - // the stream provides operators for basic data types - // everything else should be broken down by others - // the same stream can either become an object or an array stream, or a binary data object - // a binary data object is just raw binary data without any decoration - // binary data is good to pass things like images and small files - // this depends on how this stream is used - // but once the stream is used as array, then only array operations are allowed - // same with an stream used as object - - // idea: can have filter streams which forward the calls to another stream - // to make debug protocols of other steam implementations - // idea: make a stream shich creates a hash from the input to detect changes in the data - - // make an array - virtual StreamBase& operator<<(ValueReference value) = 0; - virtual StreamBase& operator<<(ValueReference value) = 0; - virtual StreamBase& operator<<(ValueReference value) = 0; - virtual StreamBase& operator<<(ValueReference value) = 0; - // usefull if the new array member should be an array or object - // the reference should be at least valid until another method of this class gets called - virtual StreamBase& getStreamToMember() = 0; - - // make an object - virtual StreamBase& operator<<(KeyValueReference keyValue) = 0; - virtual StreamBase& operator<<(KeyValueReference keyValue) = 0; - virtual StreamBase& operator<<(KeyValueReference keyValue) = 0; - virtual StreamBase& operator<<(KeyValueReference keyValue) = 0; - // usefull if the new object member should be an array or object - // the reference should be at least valid until another method of this class gets called - virtual StreamBase& getStreamToMember(std::string name) = 0; - - // make a binay data object (not a real object, just binary data) - // idea: can use vector.swap() to allow passing larger data items without copying - virtual StreamBase& operator<<(std::vector& data) = 0; - - // return true if there are more members in this object/array - // useful for array reading - virtual bool hasMore() = 0; - - virtual bool serialise() = 0; // let external operators find out they should serialise or deserialise - // return true if no serialisation/deserialisation error occoured - virtual bool isOK() = 0; - virtual void setError() = 0; // let external operators set the failed bit - //virtual void addLogMsg(std::string msg) = 0; - virtual void addErrorMsg(std::string msg) = 0; - virtual std::string getLog() = 0; - virtual std::string getErrorLog() = 0; - - virtual bool isRawData() = 0; - virtual std::string getRawData() = 0;// HACK, remove this -}; - -// todo: -// define clear rules how a response to a request should look like -// the clients should be able to know when something failed -// then it is desired to have a minimum of debug output to track the errors down -// currently no check for successful serialisation/deserialisation is performed -// -// response metadata: -// - etag, when will this result expire -// - maybe a hint how often this etag should be checked for updates -// -// outcome of a request: -// - full ok -// - partial ok -// - resource not found, invalid address or resource not available -// - not ok, internal error -// - wrong usage, parameters or POST data is wrong, like deserialisation error -// is is hard to find the cause of the error -// maybe include a comment with additional info -// -// want to include a mime type of the resulting data? -// because some data is json, othe plain text, other unknown binary stuff - -// live-stream resources -// some resources like typing notifications are only valid for a short time - -// resource types: -// - list, either with objects or adresses of objects. -// lists need a navigation mechanism like get objects before and get objects after -// - object -// - stream -// - binary data, for example files - -// TODO: record a timestamp for each token, to allow garbage collection of very old tokens -class StateToken{ -public: - StateToken(): value(0){} - StateToken(uint32_t value): value(value){} - std::string toString(); - - uint32_t getValue() const {return value;} - bool isNull() const {return value == 0;} -private: - uint32_t value; // 0 is reserved for invalid token -}; - -class Request -{ -public: - Request(StreamBase& stream) : mStream(stream), mMethod(GET){} - - RS_DEPRECATED bool isGet(){ return mMethod == GET;} - RS_DEPRECATED bool isPut(){ return mMethod == PUT;} - RS_DEPRECATED bool isDelete(){ return mMethod == DELETE_AA;} - RS_DEPRECATED bool isExec(){ return mMethod == EXEC;} - - /** - * Path is the adress to the resource if the path has multiple parts which - * get handled by different handlers, then each handler should pop the top - * element - */ - std::stack mPath; - std::string mFullPath; - bool setPath(const std::string &reqPath) - { - std::string str; - std::string::const_reverse_iterator sit; - for( sit = reqPath.rbegin(); sit != reqPath.rend(); ++sit ) - { - // add to front because we are traveling in reverse order - if((*sit) != '/') str = *sit + str; - else if(!str.empty()) - { - mPath.push(str); - str.clear(); - } - } - if(!str.empty()) mPath.push(str); - mFullPath = reqPath; - - return true; - } - - /// Contains data for new resources - StreamBase& mStream; - - /** - * @deprecated - * Method and derivated stuff usage is deprecated as it make implementation - * more complex and less readable without advantage - */ - enum Method { GET, PUT, DELETE_AA, EXEC}; - RS_DEPRECATED Method mMethod; -}; - -// new notes on responses -// later we want to send multiple requests over the same link -// and we want to be able to send the responses in a different order than the requests -// for this we need a unique token in every request which gets returned in the response - -// response: -// message token -// status (ok, warning, fail) -// data (different for different resources) -// debugstring (a human readable error message in case something went wrong) - -class Response -{ -public: - Response(StreamBase& stream, std::ostream& debug): mReturnCode(NOT_SET), mDataStream(stream), mDebug(debug){} - - // WARNING means: a valid result is available, but an error occoured - // FAIL means: the result is not valid - enum ReturnCode{ NOT_SET, OK, WARNING, FAIL}; - ReturnCode mReturnCode; - - StateToken mStateToken; - - //Just for GUI benefit - std::string mCallbackName; - - // the result - StreamBase& mDataStream; - - // humand readable string for debug messages/logging - std::ostream& mDebug; - - inline void setOk(){mReturnCode = OK;} - inline void setWarning(std::string msg = ""){ - mReturnCode = WARNING; - if(msg != "") - mDebug << msg << std::endl;} - inline void setFail(std::string msg = ""){ - mReturnCode = FAIL; - if(msg != "") - mDebug << msg << std::endl; - } -}; - -// if a response can not be handled immediately, -// then the handler should return a ResponseTask object -// the api server will then call the doWork() method periodically -class ResponseTask -{ -public: - virtual ~ResponseTask(){} - // return true if function should get called again - // return false when finished - virtual bool doWork(Request& req, Response& resp) = 0; -}; - -// implementations - -template -ValueReference makeValueReference(T& value) -{ - return ValueReference(value); -} - -template -Value makeValue(T value) -{ - return Value(value); -} - -template -KeyValueReference makeKeyValueReference(std::string key, T& value) -{ - return KeyValueReference(key, value); -} - -template -KeyValue makeKeyValue(std::string key, T value) -{ - return KeyValue(key, value); -} - -} // namespace resource_api diff --git a/libresapi/src/api/ChannelsHandler.cpp b/libresapi/src/api/ChannelsHandler.cpp deleted file mode 100644 index 27cc02e56..000000000 --- a/libresapi/src/api/ChannelsHandler.cpp +++ /dev/null @@ -1,112 +0,0 @@ -#include "ChannelsHandler.h" - -#include -#include -#include -#include "Operators.h" - -namespace resource_api -{ - -StreamBase& operator << (StreamBase& left, RsGxsFile& file) -{ - left << makeKeyValueReference("name", file.mName) - << makeKeyValueReference("hash", file.mHash); - if(left.serialise()) - { - double size = file.mSize; - left << makeKeyValueReference("size", size); - } - else - { - double size = 0; - left << makeKeyValueReference("size", size); - file.mSize = size; - } - return left; -} - -ChannelsHandler::ChannelsHandler(RsGxsChannels *channels): - mChannels(channels) -{ - addResourceHandler("create_post", this, &ChannelsHandler::handleCreatePost); -} - -ResponseTask* ChannelsHandler::handleCreatePost(Request &req, Response &resp) -{ - RsGxsChannelPost post; - - req.mStream << makeKeyValueReference("group_id", post.mMeta.mGroupId); - req.mStream << makeKeyValueReference("subject", post.mMeta.mMsgName); - req.mStream << makeKeyValueReference("message", post.mMsg); - - StreamBase& file_array = req.mStream.getStreamToMember("files"); - while(file_array.hasMore()) - { - RsGxsFile file; - file_array.getStreamToMember() << file; - post.mFiles.push_back(file); - } - - std::string thumbnail_base64; - req.mStream << makeKeyValueReference("thumbnail_base64_png", thumbnail_base64); - - if(post.mMeta.mGroupId.isNull()) - { - resp.setFail("groupd_id is null"); - return 0; - } - if(post.mMeta.mMsgName.empty()) - { - resp.setFail("subject is empty"); - return 0; - } - if(post.mMsg.empty()) - { - resp.setFail("msg text is empty"); - return 0; - } - // empty file list is ok, but files have to be valid - for(std::list::iterator lit = post.mFiles.begin(); lit != post.mFiles.end(); ++lit) - { - if(lit->mHash.isNull()) - { - resp.setFail("at least one file hash is empty"); - return 0; - } - if(lit->mName.empty()) - { - resp.setFail("at leats one file name is empty"); - return 0; - } - if(lit->mSize == 0) - { - resp.setFail("at least one file size is empty"); - return 0; - } - } - - std::vector png_data = Radix64::decode(thumbnail_base64); - if(!png_data.empty()) - { - if(png_data.size() < 8) - { - resp.setFail("Decoded thumbnail_base64_png is smaller than 8 byte. This can't be a valid png file!"); - return 0; - } - uint8_t png_magic_number[] = {0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a}; - if(!std::equal(&png_magic_number[0],&png_magic_number[8],png_data.begin())) - { - resp.setFail("Decoded thumbnail_base64_png does not seem to be a png file. (Header is missing magic number)"); - return 0; - } - post.mThumbnail.copy(png_data.data(), png_data.size()); - } - - uint32_t token; - mChannels->createPost(token, post); - // TODO: grp creation acknowledge - return 0; -} - -} // namespace resource_api diff --git a/libresapi/src/api/ChannelsHandler.h b/libresapi/src/api/ChannelsHandler.h deleted file mode 100644 index 1d8559f52..000000000 --- a/libresapi/src/api/ChannelsHandler.h +++ /dev/null @@ -1,21 +0,0 @@ -#pragma once - -#include "ResourceRouter.h" - -class RsGxsChannels; - -namespace resource_api -{ - -class ChannelsHandler : public ResourceRouter -{ -public: - ChannelsHandler(RsGxsChannels* channels); - -private: - ResponseTask* handleCreatePost(Request& req, Response& resp); - - RsGxsChannels* mChannels; -}; - -} // namespace resource_api diff --git a/libresapi/src/api/ChatHandler.cpp b/libresapi/src/api/ChatHandler.cpp deleted file mode 100644 index f77d45797..000000000 --- a/libresapi/src/api/ChatHandler.cpp +++ /dev/null @@ -1,1351 +0,0 @@ -/* - * libresapi - * Copyright (C) 2015 electron128 - * Copyright (C) 2017 Gioacchino Mazzurco - * - * 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 . - */ - -#include "ChatHandler.h" -#include "Pagination.h" -#include "Operators.h" -#include "GxsResponseTask.h" - -#include -#include -#include - -#include -#include -#include -#include - -namespace resource_api -{ - -std::string id(const ChatHandler::Msg& m) -{ - std::stringstream ss; - ss << m.id; - return ss.str(); -} - -StreamBase& operator << (StreamBase& left, ChatHandler::Msg& m) -{ - left << makeKeyValueReference("incoming", m.incoming) - << makeKeyValueReference("was_send", m.was_send) - << makeKeyValueReference("author_id", m.author_id) - << makeKeyValueReference("author_name", m.author_name) - << makeKeyValueReference("msg", m.msg) - << makeKeyValueReference("recv_time", m.recv_time) - << makeKeyValueReference("send_time", m.send_time) - << makeKeyValueReference("id", m.id); - StreamBase& ls = left.getStreamToMember("links"); - ls.getStreamToMember(); - for(std::vector::iterator vit = m.links.begin(); vit != m.links.end(); ++vit) - { - ls.getStreamToMember() << makeKeyValueReference("first", vit->first) - << makeKeyValueReference("second", vit->second) - << makeKeyValueReference("third", vit->third); - } - return left; -} - -bool compare_lobby_id(const ChatHandler::Lobby& l1, const ChatHandler::Lobby& l2) -{ - if(l1.auto_subscribe && !l2.auto_subscribe) return true; - if(!l1.auto_subscribe && l2.auto_subscribe) return false; - if(l1.is_private && !l2.is_private) return true; - if(!l1.is_private && l2.is_private) return false; - if(l1.subscribed && !l2.subscribed) return true; - if(!l1.subscribed && l2.subscribed) return false; - return l1.id < l2.id; -} - -StreamBase& operator <<(StreamBase& left, KeyValueReference kv) -{ - if(left.serialise()) - { - std::stringstream ss; - ss << kv.value; - left << makeKeyValue(kv.key, ss.str()); - } - else - { - std::string val; - left << makeKeyValueReference(kv.key, val); - std::stringstream ss(val); - ss >> kv.value; - } - return left; -} - -StreamBase& operator << (StreamBase& left, ChatHandler::Lobby& l) -{ - ChatId chatId(l.id); - if (l.is_broadcast) - chatId = ChatId::makeBroadcastId(); - left << makeKeyValueReference("id", l.id) - << makeKeyValue("chat_id", chatId.toStdString()) - << makeKeyValueReference("name",l.name) - << makeKeyValueReference("topic", l.topic) - << makeKeyValueReference("subscribed", l.subscribed) - << makeKeyValueReference("auto_subscribe", l.auto_subscribe) - << makeKeyValueReference("is_private", l.is_private) - << makeKeyValueReference("is_broadcast", l.is_broadcast) - << makeKeyValueReference("gxs_id", l.gxs_id); - return left; -} - -StreamBase& operator << (StreamBase& left, ChatHandler::ChatInfo& info) -{ - left << makeKeyValueReference("remote_author_id", info.remote_author_id) - << makeKeyValueReference("remote_author_name", info.remote_author_name) - << makeKeyValueReference("is_broadcast", info.is_broadcast) - << makeKeyValueReference("is_distant_chat_id", info.is_distant_chat_id) - << makeKeyValueReference("is_lobby", info.is_lobby) - << makeKeyValueReference("is_peer", info.is_peer); - return left; -} - -class SendLobbyParticipantsTask: public GxsResponseTask -{ -public: - SendLobbyParticipantsTask(RsIdentity* idservice, ChatHandler::LobbyParticipantsInfo pi): - GxsResponseTask(idservice, 0), mParticipantsInfo(pi) - { - const std::map& map = mParticipantsInfo.participants; - for(std::map::const_iterator mit = map.begin(); mit != map.end(); ++mit) - { - requestGxsId(mit->first); - } - } -private: - ChatHandler::LobbyParticipantsInfo mParticipantsInfo; -protected: - virtual void gxsDoWork(Request &/*req*/, Response &resp) - { - resp.mDataStream.getStreamToMember(); - const std::map& map = mParticipantsInfo.participants; - for(std::map::const_iterator mit = map.begin(); mit != map.end(); ++mit) - { - StreamBase& stream = resp.mDataStream.getStreamToMember(); - double last_active = mit->second; - stream << makeKeyValueReference("last_active", last_active); - streamGxsId(mit->first, stream.getStreamToMember("identity")); - } - resp.mStateToken = mParticipantsInfo.state_token; - resp.setOk(); - done(); - } - -}; - -ChatHandler::ChatHandler(StateTokenServer *sts, RsNotify *notify, RsMsgs *msgs, RsPeers* peers, RsIdentity* identity, UnreadMsgNotify* unread): - mStateTokenServer(sts), mNotify(notify), mRsMsgs(msgs), mRsPeers(peers), mRsIdentity(identity), mUnreadMsgNotify(unread), mMtx("ChatHandler::mMtx") -{ - mNotify->registerNotifyClient(this); - mStateTokenServer->registerTickClient(this); - - mMsgStateToken = mStateTokenServer->getNewToken(); - mLobbiesStateToken = mStateTokenServer->getNewToken(); - mUnreadMsgsStateToken = mStateTokenServer->getNewToken(); - mInvitationsStateToken = mStateTokenServer->getNewToken(); - - addResourceHandler("*", this, &ChatHandler::handleWildcard); - addResourceHandler("lobbies", this, &ChatHandler::handleLobbies); - addResourceHandler("create_lobby", this, &ChatHandler::handleCreateLobby); - addResourceHandler("subscribe_lobby", this, &ChatHandler::handleSubscribeLobby); - addResourceHandler("unsubscribe_lobby", this, &ChatHandler::handleUnsubscribeLobby); - addResourceHandler("autosubscribe_lobby", this, &ChatHandler::handleAutoSubsribeLobby); - addResourceHandler("clear_lobby", this, &ChatHandler::handleClearLobby); - addResourceHandler("invite_to_lobby", this, &ChatHandler::handleInviteToLobby); - addResourceHandler("get_invitations_to_lobby", this, &ChatHandler::handleGetInvitationsToLobby); - addResourceHandler("answer_to_invitation", this, &ChatHandler::handleAnswerToInvitation); - addResourceHandler("lobby_participants", this, &ChatHandler::handleLobbyParticipants); - addResourceHandler("messages", this, &ChatHandler::handleMessages); - addResourceHandler("send_message", this, &ChatHandler::handleSendMessage); - addResourceHandler("mark_chat_as_read", this, &ChatHandler::handleMarkChatAsRead); - addResourceHandler("info", this, &ChatHandler::handleInfo); - addResourceHandler("receive_status", this, &ChatHandler::handleReceiveStatus); - addResourceHandler("send_status", this, &ChatHandler::handleSendStatus); - addResourceHandler("unread_msgs", this, &ChatHandler::handleUnreadMsgs); - addResourceHandler("initiate_distant_chat", this, &ChatHandler::handleInitiateDistantChatConnexion); - addResourceHandler("distant_chat_status", this, &ChatHandler::handleDistantChatStatus); - addResourceHandler("close_distant_chat", this, &ChatHandler::handleCloseDistantChatConnexion); -} - -ChatHandler::~ChatHandler() -{ - mNotify->unregisterNotifyClient(this); - mStateTokenServer->unregisterTickClient(this); -} - -void ChatHandler::notifyChatMessage(const ChatMessage &msg) -{ - RS_STACK_MUTEX(mMtx); /********** LOCKED **********/ - mRawMsgs.push_back(msg); -} - -void ChatHandler::notifyChatCleared(const ChatId &chat_id) -{ - RS_STACK_MUTEX(mMtx); /********** LOCKED **********/ - //Remove processed messages - std::list& msgs = mMsgs[chat_id]; - msgs.clear(); - //Remove unprocessed messages - for(std::list::iterator lit = mRawMsgs.begin(); lit != mRawMsgs.end();) - { - ChatMessage& msg = *lit; - if (msg.chat_id == chat_id) - { - lit = mRawMsgs.erase(lit); - } else { - ++lit; - } - } -} - -void ChatHandler::notifyChatStatus(const ChatId &chat_id, const std::string &status) -{ - RS_STACK_MUTEX(mMtx); /********** LOCKED **********/ - locked_storeTypingInfo(chat_id, status); -} - -void ChatHandler::notifyChatLobbyEvent(uint64_t lobby_id, uint32_t event_type, - const RsGxsId &nickname, const std::string& any_string) -{ - RS_STACK_MUTEX(mMtx); /********** LOCKED **********/ - if(event_type == RS_CHAT_LOBBY_EVENT_PEER_STATUS) - { - locked_storeTypingInfo(ChatId(lobby_id), any_string, nickname); - } -} - -void ChatHandler::notifyListChange(int list, int /*type*/) -{ - if(list == NOTIFY_LIST_CHAT_LOBBY_INVITATION) - { - RS_STACK_MUTEX(mMtx); /********** LOCKED **********/ - mStateTokenServer->replaceToken(mInvitationsStateToken); - } -} - -void ChatHandler::tick() -{ - RS_STACK_MUTEX(mMtx); /********** LOCKED **********/ - - // first fetch lobbies - std::vector lobbies; - std::list subscribed_ids; - mRsMsgs->getChatLobbyList(subscribed_ids); - for(std::list::iterator lit = subscribed_ids.begin(); lit != subscribed_ids.end(); ++lit) - { - ChatLobbyInfo info; - if(mRsMsgs->getChatLobbyInfo(*lit,info)) - { - Lobby l; - l.id = *lit; - l.name = info.lobby_name; - l.topic = info.lobby_topic; - l.subscribed = true; - l.auto_subscribe = info.lobby_flags & RS_CHAT_LOBBY_FLAGS_AUTO_SUBSCRIBE; - l.is_private = !(info.lobby_flags & RS_CHAT_LOBBY_FLAGS_PUBLIC); - l.is_broadcast = false; - l.gxs_id = info.gxs_id; - lobbies.push_back(l); - - // update the lobby participants list - // maybe it causes to much traffic to do this in every tick, - // because the client would get the whole list every time a message was received - // we could reduce the checking frequency - std::map::iterator mit = mLobbyParticipantsInfos.find(*lit); - if(mit == mLobbyParticipantsInfos.end()) - { - mLobbyParticipantsInfos[*lit].participants = info.gxs_ids; - mLobbyParticipantsInfos[*lit].state_token = mStateTokenServer->getNewToken(); - } - else - { - LobbyParticipantsInfo& pi = mit->second; - if(!std::equal(pi.participants.begin(), pi.participants.end(), info.gxs_ids.begin()) - || pi.participants.size() != info.gxs_ids.size()) - { - pi.participants = info.gxs_ids; - mStateTokenServer->replaceToken(pi.state_token); - } - } - } - } - - // remove participants info of old lobbies - std::vector participants_info_to_delete; - for(std::map::iterator mit = mLobbyParticipantsInfos.begin(); - mit != mLobbyParticipantsInfos.end(); ++mit) - { - if(std::find(subscribed_ids.begin(), subscribed_ids.end(), mit->first) == subscribed_ids.end()) - { - participants_info_to_delete.push_back(mit->first); - } - } - for(std::vector::iterator vit = participants_info_to_delete.begin(); vit != participants_info_to_delete.end(); ++vit) - { - LobbyParticipantsInfo& pi = mLobbyParticipantsInfos[*vit]; - mStateTokenServer->discardToken(pi.state_token); - mLobbyParticipantsInfos.erase(*vit); - } - - { - Lobby l; - l.name = "BroadCast"; - l.topic = "Retroshare broadcast chat: messages are sent to all connected friends."; - l.subscribed = true; - l.auto_subscribe = false; - l.is_private = false; - l.is_broadcast = true; - lobbies.push_back(l); - } - - std::vector unsubscribed_lobbies; - mRsMsgs->getListOfNearbyChatLobbies(unsubscribed_lobbies); - for(std::vector::iterator vit = unsubscribed_lobbies.begin(); vit != unsubscribed_lobbies.end(); ++vit) - { - const VisibleChatLobbyRecord& info = *vit; - if(std::find(subscribed_ids.begin(), subscribed_ids.end(), info.lobby_id) == subscribed_ids.end()) - { - Lobby l; - l.id = info.lobby_id; - l.name = info.lobby_name; - l.topic = info.lobby_topic; - l.subscribed = false; - l.auto_subscribe = info.lobby_flags & RS_CHAT_LOBBY_FLAGS_AUTO_SUBSCRIBE; - l.is_private = !(info.lobby_flags & RS_CHAT_LOBBY_FLAGS_PUBLIC); - l.is_broadcast = false; - l.gxs_id = RsGxsId(); - lobbies.push_back(l); - } - } - - // process new messages - bool changed = false; - bool lobby_unread_count_changed = false; - std::vector::iterator> done; - std::vector peers_changed; - - bool gxs_id_failed = false; // to prevent asking for multiple failing gxs ids in one tick, to not flush the cache - - for(std::list::iterator lit = mRawMsgs.begin(); lit != mRawMsgs.end(); ++lit) - { - ChatMessage& msg = *lit; - std::string author_id; - std::string author_name; - if(msg.chat_id.isBroadcast()) - { - author_id = msg.broadcast_peer_id.toStdString(); - author_name = mRsPeers->getPeerName(msg.broadcast_peer_id); - } - else if(msg.chat_id.isDistantChatId()) - { - DistantChatPeerInfo dcpinfo ; - - if(!rsMsgs->getDistantChatStatus(msg.chat_id.toDistantChatId(),dcpinfo)) - { - std::cerr << "(EE) cannot get info for distant chat peer " << msg.chat_id.toDistantChatId() << std::endl; - continue ; - } - - RsIdentityDetails details; - if(!gxs_id_failed && mRsIdentity->getIdDetails(msg.incoming? dcpinfo.to_id: dcpinfo.own_id, details)) - { - author_id = details.mId.toStdString(); - author_name = details.mNickname; - } - else - { - gxs_id_failed = true; - continue; - } - } - else if(msg.chat_id.isLobbyId()) - { - author_id = msg.lobby_peer_gxs_id.toStdString(); - RsIdentityDetails details; - if(!gxs_id_failed && mRsIdentity->getIdDetails(msg.lobby_peer_gxs_id, details)) - { - author_name = details.mNickname; - lobby_unread_count_changed = true; - } - else - { - gxs_id_failed = true; - continue; - } - } - else if(msg.chat_id.isPeerId()) - { - RsPeerId id; - if(msg.incoming) - id = msg.chat_id.toPeerId(); - else - id = mRsPeers->getOwnId(); - author_id = id.toStdString(); - author_name = mRsPeers->getPeerName(id); - if(std::find(peers_changed.begin(), peers_changed.end(), msg.chat_id.toPeerId()) == peers_changed.end()) - peers_changed.push_back(msg.chat_id.toPeerId()); - } - else - { - std::cerr << "Error in ChatHandler::tick(): unhandled chat_id=" << msg.chat_id.toStdString() << std::endl; - // remove from queue, so msgs with wrong ids to not pile up - done.push_back(lit); - continue; - } - - if(mChatInfo.find(msg.chat_id) == mChatInfo.end()) - { - ChatInfo info; - info.is_broadcast = msg.chat_id.isBroadcast(); - info.is_distant_chat_id = msg.chat_id.isDistantChatId(); - info.is_lobby = msg.chat_id.isLobbyId(); - info.is_peer = msg.chat_id.isPeerId(); - if(msg.chat_id.isLobbyId()) - { - for(std::vector::iterator vit = mLobbies.begin(); vit != mLobbies.end(); ++vit) - { - if(vit->id == msg.chat_id.toLobbyId()) - info.remote_author_name = vit->name; - } - } - else if(msg.chat_id.isDistantChatId()) - { - RsIdentityDetails details; - DistantChatPeerInfo dcpinfo; - - if( !gxs_id_failed && - rsMsgs->getDistantChatStatus( - msg.chat_id.toDistantChatId(), dcpinfo ) && - mRsIdentity->getIdDetails(dcpinfo.to_id, details) ) - { - info.remote_author_id = details.mId.toStdString(); - info.remote_author_name = details.mNickname; - } - else - { - gxs_id_failed = true; - continue; - } - } - else if(msg.chat_id.isPeerId()) - { - info.remote_author_id = msg.chat_id.toPeerId().toStdString(); - info.remote_author_name = mRsPeers->getPeerName(msg.chat_id.toPeerId()); - } - mChatInfo[msg.chat_id] = info; - } - - Msg m; - m.read = !msg.incoming; - m.incoming = msg.incoming; - m.was_send = msg.online; - m.author_id = author_id; - m.author_name = author_name; - - // remove html tags from chat message - // extract links form href - getPlainText(msg.msg, m.msg, m.links); - m.recv_time = msg.recvTime; - m.send_time = msg.sendTime; - - m.id = RSRandom::random_u32(); - - mMsgs[msg.chat_id].push_back(m); - done.push_back(lit); - - changed = true; - } - for(std::vector::iterator>::iterator vit = done.begin(); vit != done.end(); ++vit) - mRawMsgs.erase(*vit); - - // send changes - - if(changed) - { - mStateTokenServer->replaceToken(mMsgStateToken); - mStateTokenServer->replaceToken(mUnreadMsgsStateToken); - } - - for(std::vector::iterator vit = peers_changed.begin(); vit != peers_changed.end(); ++vit) - { - const std::list& msgs = mMsgs[ChatId(*vit)]; - uint32_t count = 0; - for(std::list::const_iterator lit = msgs.begin(); lit != msgs.end(); ++lit) - if(!lit->read) - count++; - if(mUnreadMsgNotify) - mUnreadMsgNotify->notifyUnreadMsgCountChanged(*vit, count); - } - - std::sort(lobbies.begin(), lobbies.end(), &compare_lobby_id); - if(lobby_unread_count_changed || mLobbies != lobbies) - { - mStateTokenServer->replaceToken(mLobbiesStateToken); - mLobbies = lobbies; - } -} - -static void writeUTF8 ( std::ostream & Out, unsigned int Ch ) -/* writes Ch in UTF-8 encoding to Out. Note this version only deals - with characters up to 16 bits. - From: http://www.codecodex.com/wiki/Unescape_HTML_special_characters_from_a_String*/ -{ - if (Ch >= 0x800) - { - Out.put(0xE0 | ((Ch >> 12) & 0x0F)); - Out.put(0x80 | ((Ch >> 6) & 0x3F)); - Out.put(0x80 | ((Ch ) & 0x3F)); - } - else if (Ch >= 0x80) - { - Out.put(0xC0 | ((Ch >> 6) & 0x1F)); - Out.put(0x80 | ((Ch ) & 0x3F)); - } - else - { - Out.put(Ch); - } -} - -static unsigned int stringToDecUInt ( std::string str) -{ - unsigned int out = 0; - unsigned int max = std::numeric_limits::max() / 10; - int lenght = str.length(); - for (int curs = 0; curs < lenght; ++curs) { - char c = str[curs]; - if ( (c >= '0') - && (c <= '9') - && (out < max) - ) { - out *= 10; - out += (int)( c - '0'); - } else return 0; - } - return out; -} - -void ChatHandler::getPlainText(const std::string& in, std::string &out, std::vector &links) -{ - if (in.size() == 0) - return; - - if (in[0] != '<' || in[in.size() - 1] != '>') - { - // It's a plain text message without HTML - out = in; - return; - } - bool ignore = false; - - bool keep_link = false; - std::string last_six_chars; - unsigned int tag_start_index = 0; - Triple current_link; - bool onEscapeChar = false; - unsigned int escapeCharIndexStart = -1; - - for(unsigned int i = 0; i < in.size(); ++i) - { - if(keep_link && in[i] == '"') - { - keep_link = false; - current_link.second = out.size(); - } - if(last_six_chars == "href=\"") - { - keep_link = true; - current_link.first = out.size(); - } - - // "rising edge" sets mode to ignore - if(in[i] == '<') - { - tag_start_index = i; - ignore = true; - } - if(!ignore || keep_link) - out += in[i]; - // "falling edge" resets mode to keep - if(in[i] == '>' && ignore) { - // leave ignore mode on, if it's a style tag - if (tag_start_index == 0 || tag_start_index + 6 > i || in.substr(tag_start_index, 6) != " 6) - last_six_chars = last_six_chars.substr(1); - std::string a = ""; - if( current_link.first != -1 - && last_six_chars.size() >= a.size() - && last_six_chars.substr(last_six_chars.size()-a.size()) == a) - { - // only allow these protocols - // we don't want for example javascript:alert(0) - std::string http = "http://"; - std::string https = "https://"; - std::string retroshare = "retroshare://"; - if( out.substr(current_link.first, http.size()) == http - || out.substr(current_link.first, https.size()) == https - || out.substr(current_link.first, retroshare.size()) == retroshare) - { - current_link.third = out.size(); - links.push_back(current_link); - } - current_link = Triple(); - } - std::string br = "
"; - if(last_six_chars.size() >= br.size() - && last_six_chars.substr(last_six_chars.size()-br.size()) == br) - { - out += "\n"; - } - if (in[i] == '&') { - onEscapeChar = true; - escapeCharIndexStart = out.length(); - } - if (ignore || keep_link) { - onEscapeChar = false; - escapeCharIndexStart = -1; - } - if ((in[i] == ';') && onEscapeChar) { - onEscapeChar = false; - bool escapeFound = true; - std::string escapeReplace = ""; - //Keep only escape value to replace it - std::string escapeCharValue = out.substr(escapeCharIndexStart, - out.length() - escapeCharIndexStart - 1); - if (escapeCharValue[0] == '#') { - int escapedCharUTF8 = stringToDecUInt(escapeCharValue.substr(1)); - std::ostringstream escapedSStream; - writeUTF8( escapedSStream, escapedCharUTF8); - escapeReplace = escapedSStream.str(); - } else if (escapeCharValue == "euro") { - escapeReplace = "€"; - } else if (escapeCharValue == "nbsp") { - escapeReplace = " "; - } else if (escapeCharValue == "quot") { - escapeReplace = "\""; - } else if (escapeCharValue == "amp") { - escapeReplace = "&"; - } else if (escapeCharValue == "lt") { - escapeReplace = "<"; - } else if (escapeCharValue == "gt") { - escapeReplace = ">"; - } else if (escapeCharValue == "iexcl") { - escapeReplace = "¡"; - } else if (escapeCharValue == "cent") { - escapeReplace = "¢"; - } else if (escapeCharValue == "pound") { - escapeReplace = "£"; - } else if (escapeCharValue == "curren") { - escapeReplace = "¤"; - } else if (escapeCharValue == "yen") { - escapeReplace = "¥"; - } else if (escapeCharValue == "brvbar") { - escapeReplace = "¦"; - } else if (escapeCharValue == "sect") { - escapeReplace = "§"; - } else if (escapeCharValue == "uml") { - escapeReplace = "¨"; - } else if (escapeCharValue == "copy") { - escapeReplace = "©"; - } else if (escapeCharValue == "ordf") { - escapeReplace = "ª"; - } else if (escapeCharValue == "not") { - escapeReplace = "¬"; - } else if (escapeCharValue == "shy") { - escapeReplace = " ";//? - } else if (escapeCharValue == "reg") { - escapeReplace = "®"; - } else if (escapeCharValue == "macr") { - escapeReplace = "¯"; - } else if (escapeCharValue == "deg") { - escapeReplace = "°"; - } else if (escapeCharValue == "plusmn") { - escapeReplace = "±"; - } else if (escapeCharValue == "sup2") { - escapeReplace = "²"; - } else if (escapeCharValue == "sup3") { - escapeReplace = "³"; - } else if (escapeCharValue == "acute") { - escapeReplace = "´"; - } else if (escapeCharValue == "micro") { - escapeReplace = "µ"; - } else if (escapeCharValue == "para") { - escapeReplace = "¶"; - } else if (escapeCharValue == "middot") { - escapeReplace = "·"; - } else if (escapeCharValue == "cedil") { - escapeReplace = "¸"; - } else if (escapeCharValue == "sup1") { - escapeReplace = "¹"; - } else if (escapeCharValue == "ordm") { - escapeReplace = "º"; - } else if (escapeCharValue == "raquo") { - escapeReplace = "»"; - } else if (escapeCharValue == "frac14") { - escapeReplace = "¼"; - } else if (escapeCharValue == "frac12") { - escapeReplace = "½"; - } else if (escapeCharValue == "frac34") { - escapeReplace = "¾"; - } else if (escapeCharValue == "iquest") { - escapeReplace = "¿"; - } else if (escapeCharValue == "Agrave") { - escapeReplace = "À"; - } else if (escapeCharValue == "Aacute") { - escapeReplace = "Á"; - } else if (escapeCharValue == "Acirc") { - escapeReplace = "Â"; - } else if (escapeCharValue == "Atilde") { - escapeReplace = "Ã"; - } else if (escapeCharValue == "Auml") { - escapeReplace = "Ä"; - } else if (escapeCharValue == "Aring") { - escapeReplace = "Å"; - } else if (escapeCharValue == "AElig") { - escapeReplace = "Æ"; - } else if (escapeCharValue == "Ccedil") { - escapeReplace = "Ç"; - } else if (escapeCharValue == "Egrave") { - escapeReplace = "È"; - } else if (escapeCharValue == "Eacute") { - escapeReplace = "É"; - } else if (escapeCharValue == "Ecirc") { - escapeReplace = "Ê"; - } else if (escapeCharValue == "Euml") { - escapeReplace = "Ë"; - } else if (escapeCharValue == "Igrave") { - escapeReplace = "Ì"; - } else if (escapeCharValue == "Iacute") { - escapeReplace = "Í"; - } else if (escapeCharValue == "Icirc") { - escapeReplace = "Î"; - } else if (escapeCharValue == "Iuml") { - escapeReplace = "Ï"; - } else if (escapeCharValue == "ETH") { - escapeReplace = "Ð"; - } else if (escapeCharValue == "Ntilde") { - escapeReplace = "Ñ"; - } else if (escapeCharValue == "Ograve") { - escapeReplace = "Ò"; - } else if (escapeCharValue == "Oacute") { - escapeReplace = "Ó"; - } else if (escapeCharValue == "Ocirc") { - escapeReplace = "Ô"; - } else if (escapeCharValue == "Otilde") { - escapeReplace = "Õ"; - } else if (escapeCharValue == "Ouml") { - escapeReplace = "Ö"; - } else if (escapeCharValue == "times") { - escapeReplace = "×"; - } else if (escapeCharValue == "Oslash") { - escapeReplace = "Ø"; - } else if (escapeCharValue == "Ugrave") { - escapeReplace = "Ù"; - } else if (escapeCharValue == "Uacute") { - escapeReplace = "Ú"; - } else if (escapeCharValue == "Ucirc") { - escapeReplace = "Û"; - } else if (escapeCharValue == "Uuml") { - escapeReplace = "Ü"; - } else if (escapeCharValue == "Yacute") { - escapeReplace = "Ý"; - } else if (escapeCharValue == "THORN") { - escapeReplace = "Þ"; - } else if (escapeCharValue == "szlig") { - escapeReplace = "ß"; - } else if (escapeCharValue == "agrave") { - escapeReplace = "à"; - } else if (escapeCharValue == "aacute") { - escapeReplace = "á"; - } else if (escapeCharValue == "acirc") { - escapeReplace = "â"; - } else if (escapeCharValue == "atilde") { - escapeReplace = "ã"; - } else if (escapeCharValue == "auml") { - escapeReplace = "ä"; - } else if (escapeCharValue == "aring") { - escapeReplace = "å"; - } else if (escapeCharValue == "aelig") { - escapeReplace = "æ"; - } else if (escapeCharValue == "ccedil") { - escapeReplace = "ç"; - } else if (escapeCharValue == "egrave") { - escapeReplace = "è"; - } else if (escapeCharValue == "eacute") { - escapeReplace = "é"; - } else if (escapeCharValue == "ecirc") { - escapeReplace = "ê"; - } else if (escapeCharValue == "euml") { - escapeReplace = "ë"; - } else if (escapeCharValue == "igrave") { - escapeReplace = "ì"; - } else if (escapeCharValue == "iacute") { - escapeReplace = "í"; - } else if (escapeCharValue == "icirc") { - escapeReplace = "î"; - } else if (escapeCharValue == "iuml") { - escapeReplace = "ï"; - } else if (escapeCharValue == "eth") { - escapeReplace = "ð"; - } else if (escapeCharValue == "ntilde") { - escapeReplace = "ñ"; - } else if (escapeCharValue == "ograve") { - escapeReplace = "ò"; - } else if (escapeCharValue == "oacute") { - escapeReplace = "ó"; - } else if (escapeCharValue == "ocirc") { - escapeReplace = "ô"; - } else if (escapeCharValue == "otilde") { - escapeReplace = "õ"; - } else if (escapeCharValue == "ouml") { - escapeReplace = "ö"; - } else if (escapeCharValue == "divide") { - escapeReplace = "÷"; - } else if (escapeCharValue == "oslash") { - escapeReplace = "ø"; - } else if (escapeCharValue == "ugrave") { - escapeReplace = "ù"; - } else if (escapeCharValue == "uacute") { - escapeReplace = "ú"; - } else if (escapeCharValue == "ucirc") { - escapeReplace = "û"; - } else if (escapeCharValue == "uuml") { - escapeReplace = "ü"; - } else if (escapeCharValue == "yacute") { - escapeReplace = "ý"; - } else if (escapeCharValue == "thorn") { - escapeReplace = "þ"; - } else { - escapeFound = false; - } - if (escapeFound) { - out = out.substr(0, escapeCharIndexStart-1); - out += escapeReplace; - } - } - } -} - -void ChatHandler::locked_storeTypingInfo(const ChatId &chat_id, std::string status, RsGxsId lobby_gxs_id) -{ - TypingLabelInfo& info = mTypingLabelInfo[chat_id]; - info.timestamp = time(0); - info.status = status; - mStateTokenServer->replaceToken(info.state_token); - info.author_id = lobby_gxs_id; -} - -void ChatHandler::handleWildcard(Request &/*req*/, Response &resp) -{ - RS_STACK_MUTEX(mMtx); /********** LOCKED **********/ - resp.mDataStream.getStreamToMember(); - for(std::map >::iterator mit = mMsgs.begin(); mit != mMsgs.end(); ++mit) - { - resp.mDataStream.getStreamToMember() << makeValue(mit->first.toStdString()); - } - resp.setOk(); -} - -void ChatHandler::handleLobbies(Request &/*req*/, Response &resp) -{ - tick(); - - { - RS_STACK_MUTEX(mMtx); /********** LOCKED **********/ - resp.mDataStream.getStreamToMember(); - for(std::vector::iterator vit = mLobbies.begin(); vit != mLobbies.end(); ++vit) - { - uint32_t unread_msgs = 0; - ChatId chat_id(vit->id); - std::map >::iterator mit = mMsgs.find(chat_id); - if(mit != mMsgs.end()) - { - std::list& msgs = mit->second; - for(std::list::iterator lit = msgs.begin(); lit != msgs.end(); ++lit) - if(!lit->read) - unread_msgs++; - } - resp.mDataStream.getStreamToMember() << *vit << makeKeyValueReference("unread_msg_count", unread_msgs); - } - resp.mStateToken = mLobbiesStateToken; - } - resp.setOk(); -} - -void ChatHandler::handleSubscribeLobby(Request &req, Response &resp) -{ - ChatLobbyId id = 0; - RsGxsId gxs_id; - req.mStream << makeKeyValueReference("id", id) << makeKeyValueReference("gxs_id", gxs_id); - - if(id == 0) - { - resp.setFail("Error: id must not be null"); - return; - } - if(gxs_id.isNull()) - { - resp.setFail("Error: gxs_id must not be null"); - return; - } - if(mRsMsgs->joinVisibleChatLobby(id, gxs_id)) - resp.setOk(); - else - resp.setFail("lobby join failed. (See console for more info)"); -} - -void ChatHandler::handleUnsubscribeLobby(Request &req, Response &resp) -{ - ChatLobbyId id = 0; - req.mStream << makeKeyValueReference("id", id); - mRsMsgs->unsubscribeChatLobby(id); - resp.setOk(); -} - -void ChatHandler::handleAutoSubsribeLobby(Request& req, Response& resp) -{ - ChatLobbyId chatId = 0; - bool autosubsribe; - req.mStream << makeKeyValueReference("chatid", chatId) << makeKeyValueReference("autosubsribe", autosubsribe); - mRsMsgs->setLobbyAutoSubscribe(chatId, autosubsribe); - resp.setOk(); -} - -void ChatHandler::handleClearLobby(Request &req, Response &resp) -{ - ChatLobbyId id = 0; - req.mStream << makeKeyValueReference("id", id); - if (id !=0) { - notifyChatCleared(ChatId(id)); - } else { - //Is BroadCast - notifyChatCleared(ChatId("B")); - } - resp.setOk(); -} - -void ChatHandler::handleInviteToLobby(Request& req, Response& resp) -{ - std::string chat_id; - std::string pgp_id; - req.mStream << makeKeyValueReference("chat_id", chat_id); - req.mStream << makeKeyValueReference("pgp_id", pgp_id); - - ChatId chatId(chat_id); - RsPgpId pgpId(pgp_id); - - std::list peerIds; - mRsPeers->getAssociatedSSLIds(pgpId, peerIds); - - for(std::list::iterator it = peerIds.begin(); it != peerIds.end(); it++) - mRsMsgs->invitePeerToLobby(chatId.toLobbyId(), (*it)); - - resp.setOk(); -} - -void ChatHandler::handleGetInvitationsToLobby(Request& /*req*/, Response& resp) -{ - std::list invites; - mRsMsgs->getPendingChatLobbyInvites(invites); - - resp.mDataStream.getStreamToMember(); - for(std::list::const_iterator it = invites.begin(); it != invites.end(); ++it) - { - resp.mDataStream.getStreamToMember() - << makeKeyValue("peer_id", (*it).peer_id.toStdString()) - << makeKeyValue("lobby_id", (*it).lobby_id) - << makeKeyValue("lobby_name", (*it).lobby_name) - << makeKeyValue("lobby_topic", (*it).lobby_topic); - } - - resp.mStateToken = mInvitationsStateToken; - resp.setOk(); -} - -void ChatHandler::handleAnswerToInvitation(Request& req, Response& resp) -{ - ChatLobbyId lobbyId = 0; - req.mStream << makeKeyValueReference("lobby_id", lobbyId); - - bool join; - req.mStream << makeKeyValueReference("join", join); - - std::string gxs_id; - req.mStream << makeKeyValueReference("gxs_id", gxs_id); - RsGxsId gxsId(gxs_id); - - if(join) - { - if(rsMsgs->acceptLobbyInvite(lobbyId, gxsId)) - resp.setOk(); - else - resp.setFail(); - } - else - { - rsMsgs->denyLobbyInvite(lobbyId); - resp.setOk(); - } -} - -ResponseTask* ChatHandler::handleLobbyParticipants(Request &req, Response &resp) -{ - RS_STACK_MUTEX(mMtx); /********** LOCKED **********/ - - ChatId id(req.mPath.top()); - if(!id.isLobbyId()) - { - resp.setFail("Path element \""+req.mPath.top()+"\" is not a ChatLobbyId."); - return 0; - } - std::map::const_iterator mit = mLobbyParticipantsInfos.find(id.toLobbyId()); - if(mit == mLobbyParticipantsInfos.end()) - { - resp.setFail("lobby not found"); - return 0; - } - return new SendLobbyParticipantsTask(mRsIdentity, mit->second); -} - -void ChatHandler::handleMessages(Request &req, Response &resp) -{ - /* G10h4ck: Whithout this the request processing won't happen, copied from - * ChatHandler::handleLobbies, is this a work around or is the right way of - * doing it? */ - tick(); - - { - RS_STACK_MUTEX(mMtx); /********** LOCKED **********/ - ChatId id(req.mPath.top()); - - // make response a list - resp.mDataStream.getStreamToMember(); - if(id.isNotSet()) - { - resp.setFail("\""+req.mPath.top()+"\" is not a valid chat id"); - return; - } - std::map >::iterator mit = mMsgs.find(id); - if(mit == mMsgs.end()) - { - /* set state token, even if not found yet, maybe later messages arrive - * and then the chat id will be found */ - resp.mStateToken = mMsgStateToken; - resp.setFail("chat with id=\""+req.mPath.top()+"\" not found"); - return; - } - resp.mStateToken = mMsgStateToken; - handlePaginationRequest(req, resp, mit->second); - } -} - -void ChatHandler::handleSendMessage(Request &req, Response &resp) -{ - std::string chat_id; - std::string msg; - req.mStream << makeKeyValueReference("chat_id", chat_id) - << makeKeyValueReference("msg", msg); - ChatId id(chat_id); - if(id.isNotSet()) - { - resp.setFail("chat_id is invalid"); - return; - } - if(mRsMsgs->sendChat(id, msg)) - resp.setOk(); - else - resp.setFail("failed to send message"); -} - -void ChatHandler::handleMarkChatAsRead(Request &req, Response &resp) -{ - RS_STACK_MUTEX(mMtx); /********** LOCKED **********/ - ChatId id(req.mPath.top()); - - if(id.isNotSet()) - { - resp.setFail("\""+req.mPath.top()+"\" is not a valid chat id"); - return; - } - std::map >::iterator mit = mMsgs.find(id); - if(mit == mMsgs.end()) - { - resp.setFail("chat not found. Maybe this chat does not have messages yet?"); - return; - } - std::list& msgs = mit->second; - for(std::list::iterator lit = msgs.begin(); lit != msgs.end(); ++lit) - { - lit->read = true; - } - // lobby list contains unread msgs, so update it - if(id.isLobbyId()) - mStateTokenServer->replaceToken(mLobbiesStateToken); - if(id.isPeerId() && mUnreadMsgNotify) - mUnreadMsgNotify->notifyUnreadMsgCountChanged(id.toPeerId(), 0); - - mStateTokenServer->replaceToken(mUnreadMsgsStateToken); -} - -void ChatHandler::handleInfo(Request &req, Response &resp) -{ - RS_STACK_MUTEX(mMtx); /********** LOCKED **********/ - ChatId id(req.mPath.top()); - if(id.isNotSet()) - { - resp.setFail("\""+req.mPath.top()+"\" is not a valid chat id"); - return; - } - std::map::iterator mit = mChatInfo.find(id); - if(mit == mChatInfo.end()) - { - resp.setFail("chat not found."); - return; - } - resp.mDataStream << mit->second; - resp.setOk(); -} - -class SendTypingLabelInfo: public GxsResponseTask -{ -public: - SendTypingLabelInfo(RsIdentity* identity, RsPeers* peers, ChatId id, const ChatHandler::TypingLabelInfo& info): - GxsResponseTask(identity), mState(BEGIN), mPeers(peers),mId(id), mInfo(info) {} -private: - enum State {BEGIN, WAITING_ID}; - State mState; - RsPeers* mPeers; - ChatId mId; - ChatHandler::TypingLabelInfo mInfo; -protected: - void gxsDoWork(Request& /*req*/, Response& resp) - { - if(mState == BEGIN) - { - // lobby and distant require to fetch a gxs_id - if(mId.isLobbyId()) - { - requestGxsId(mInfo.author_id); - } - else if(mId.isDistantChatId()) - { - DistantChatPeerInfo dcpinfo ; - rsMsgs->getDistantChatStatus(mId.toDistantChatId(), dcpinfo); - requestGxsId(dcpinfo.to_id); - } - mState = WAITING_ID; - } - else - { - std::string name = "BUG: case not handled in SendTypingLabelInfo"; - if(mId.isPeerId()) - { - name = mPeers->getPeerName(mId.toPeerId()); - } - else if(mId.isDistantChatId()) - { - DistantChatPeerInfo dcpinfo ; - rsMsgs->getDistantChatStatus(mId.toDistantChatId(), dcpinfo); - name = getName(dcpinfo.to_id); - } - else if(mId.isLobbyId()) - { - name = getName(mInfo.author_id); - } - else if(mId.isBroadcast()) - { - name = mPeers->getPeerName(mId.broadcast_status_peer_id); - } - uint32_t ts = mInfo.timestamp; - resp.mDataStream << makeKeyValueReference("author_name", name) - << makeKeyValueReference("timestamp", ts) - << makeKeyValueReference("status_string", mInfo.status); - resp.mStateToken = mInfo.state_token; - resp.setOk(); - done(); - } - } -}; - -ResponseTask* ChatHandler::handleReceiveStatus(Request &req, Response &resp) -{ - RS_STACK_MUTEX(mMtx); /********** LOCKED **********/ - ChatId id(req.mPath.top()); - if(id.isNotSet()) - { - resp.setFail("\""+req.mPath.top()+"\" is not a valid chat id"); - return 0; - } - std::map::iterator mit = mTypingLabelInfo.find(id); - if(mit == mTypingLabelInfo.end()) - { - locked_storeTypingInfo(id, ""); - mit = mTypingLabelInfo.find(id); - } - return new SendTypingLabelInfo(mRsIdentity, mRsPeers, id, mit->second); -} - -void ChatHandler::handleSendStatus(Request &req, Response &resp) -{ - std::string chat_id; - std::string status; - req.mStream << makeKeyValueReference("chat_id", chat_id) - << makeKeyValueReference("status", status); - ChatId id(chat_id); - if(id.isNotSet()) - { - resp.setFail("chat_id is invalid"); - return; - } - mRsMsgs->sendStatusString(id, status); - resp.setOk(); -} - -void ChatHandler::handleUnreadMsgs(Request &/*req*/, Response &resp) -{ - RS_STACK_MUTEX(mMtx); /********** LOCKED **********/ - - resp.mDataStream.getStreamToMember(); - for( std::map >::const_iterator mit = mMsgs.begin(); - mit != mMsgs.end(); ++mit ) - { - uint32_t count = 0; - for( std::list::const_iterator lit = mit->second.begin(); - lit != mit->second.end(); ++lit ) if(!lit->read) ++count; - std::map::iterator mit2 = mChatInfo.find(mit->first); - if(mit2 == mChatInfo.end()) - std::cerr << "Error in ChatHandler::handleUnreadMsgs(): ChatInfo not found. It is weird if this happens. Normally it should not happen." << std::endl; - if(count && (mit2 != mChatInfo.end())) - { - resp.mDataStream.getStreamToMember() -#warning Gioacchino Mazzurco 2017-03-24: @deprecated using "id" as key can cause problems in some JS based \ - languages like Qml @see chat_id instead - << makeKeyValue("id", mit->first.toStdString()) - << makeKeyValue("chat_id", mit->first.toStdString()) - << makeKeyValueReference("unread_count", count) - << mit2->second; - } - } - resp.mStateToken = mUnreadMsgsStateToken; - resp.setOk(); -} - -void ChatHandler::handleInitiateDistantChatConnexion(Request& req, Response& resp) -{ - std::string own_gxs_hex, remote_gxs_hex; - - req.mStream << makeKeyValueReference("own_gxs_hex", own_gxs_hex) - << makeKeyValueReference("remote_gxs_hex", remote_gxs_hex); - - RsGxsId sender_id(own_gxs_hex); - if(sender_id.isNull()) - { - resp.setFail("own_gxs_hex is invalid"); - return; - } - - RsGxsId receiver_id(remote_gxs_hex); - if(receiver_id.isNull()) - { - resp.setFail("remote_gxs_hex is invalid"); - return; - } - - DistantChatPeerId distant_chat_id; - uint32_t error_code; - - if(mRsMsgs->initiateDistantChatConnexion( receiver_id, sender_id, - distant_chat_id, error_code, - false )) resp.setOk(); - else resp.setFail("Failed to initiate distant chat"); - - ChatId chat_id(distant_chat_id); - resp.mDataStream << makeKeyValue("chat_id", chat_id.toStdString()) - << makeKeyValueReference("error_code", error_code); -} - -void ChatHandler::handleDistantChatStatus(Request& req, Response& resp) -{ - std::string distant_chat_hex; - req.mStream << makeKeyValueReference("chat_id", distant_chat_hex); - - ChatId id(distant_chat_hex); - DistantChatPeerInfo info; - if(mRsMsgs->getDistantChatStatus(id.toDistantChatId(), info)) resp.setOk(); - else resp.setFail("Failed to get status for distant chat"); - - resp.mDataStream << makeKeyValue("own_gxs_hex", info.own_id.toStdString()) - << makeKeyValue("remote_gxs_hex", info.to_id.toStdString()) - << makeKeyValue("chat_id", info.peer_id.toStdString()) - << makeKeyValue("status", info.status); -} - -void ChatHandler::handleCloseDistantChatConnexion(Request& req, Response& resp) -{ - std::string distant_chat_hex; - req.mStream << makeKeyValueReference("distant_chat_hex", distant_chat_hex); - - DistantChatPeerId chat_id(distant_chat_hex); - if (mRsMsgs->closeDistantChatConnexion(chat_id)) resp.setOk(); - else resp.setFail("Failed to close distant chat"); -} - -void ChatHandler::handleCreateLobby(Request& req, Response& resp) -{ - std::set invited_identites; - std::string lobby_name; - std::string lobby_topic; - std::string gxs_id; - - req.mStream << makeKeyValueReference("lobby_name", lobby_name); - req.mStream << makeKeyValueReference("lobby_topic", lobby_topic); - req.mStream << makeKeyValueReference("gxs_id", gxs_id); - - RsGxsId gxsId(gxs_id); - - bool lobby_public; - bool pgp_signed; - - req.mStream << makeKeyValueReference("lobby_public", lobby_public); - req.mStream << makeKeyValueReference("pgp_signed", pgp_signed); - - ChatLobbyFlags lobby_flags; - - if(lobby_public) - lobby_flags |= RS_CHAT_LOBBY_FLAGS_PUBLIC; - - if(pgp_signed) - lobby_flags |= RS_CHAT_LOBBY_FLAGS_PGP_SIGNED; - - mRsMsgs->createChatLobby(lobby_name, gxsId, lobby_topic, invited_identites, lobby_flags); - - tick(); - resp.setOk(); -} - -} // namespace resource_api diff --git a/libresapi/src/api/ChatHandler.h b/libresapi/src/api/ChatHandler.h deleted file mode 100644 index cac28271d..000000000 --- a/libresapi/src/api/ChatHandler.h +++ /dev/null @@ -1,173 +0,0 @@ -#pragma once - -#include "ResourceRouter.h" -#include "StateTokenServer.h" -#include -#include - -class RsPeers; -class RsIdentity; - -namespace resource_api -{ - -class UnreadMsgNotify -{ -public: - virtual void notifyUnreadMsgCountChanged(const RsPeerId& peer, uint32_t count) = 0; -}; - -class ChatHandler: public ResourceRouter, NotifyClient, Tickable -{ -public: - ChatHandler(StateTokenServer* sts, RsNotify* notify, RsMsgs* msgs, RsPeers* peers, RsIdentity *identity, UnreadMsgNotify* unread); - virtual ~ChatHandler(); - - // from NotifyClient - // note: this may get called from the own and from foreign threads - virtual void notifyChatMessage(const ChatMessage& msg); - virtual void notifyChatCleared(const ChatId& chat_id); - - // typing label for peer, broadcast and distant chat - virtual void notifyChatStatus (const ChatId& /* chat_id */, const std::string& /* status_string */); - - //typing label for lobby chat, peer join and leave messages - virtual void notifyChatLobbyEvent (uint64_t /* lobby id */, uint32_t /* event type */ , - const RsGxsId& /* nickname */,const std::string& /* any string */); - - virtual void notifyListChange(int list, int type); - - // from tickable - virtual void tick(); - -public: - class Triple - { - public: - Triple(): first(-1), second(-1), third(-1){} - double first; - double second; - double third; - }; - - class Msg{ - public: - bool read; - bool incoming; - bool was_send; - //std::string chat_type; - std::string author_id; // peer or gxs id or "system" for system messages - std::string author_name; - std::string msg; // plain text only! - std::vector links; - uint32_t recv_time; - uint32_t send_time; - - uint32_t id; - }; - - class Lobby{ - public: - Lobby(): id(0), subscribed(false), auto_subscribe(false), is_private(false), is_broadcast(false){} - ChatLobbyId id; - std::string name; - std::string topic; - bool subscribed; - bool auto_subscribe; - bool is_private; - bool is_broadcast; - - RsGxsId gxs_id;// for subscribed lobbies: the id we use to write messages - - bool operator==(const Lobby& l) const - { - return id == l.id - && name == l.name - && topic == l.topic - && subscribed == l.subscribed - && auto_subscribe == l.auto_subscribe - && is_private == l.is_private - && is_broadcast == l.is_broadcast - && gxs_id == l.gxs_id; - } - }; - - class LobbyParticipantsInfo{ - public: - StateToken state_token; - std::map participants; - }; - - class ChatInfo{ - public: - bool is_broadcast; - bool is_distant_chat_id; - bool is_lobby; - bool is_peer; - std::string remote_author_id; - std::string remote_author_name; - }; - - class TypingLabelInfo{ - public: - time_t timestamp; - std::string status; - StateToken state_token; - // only for lobbies - RsGxsId author_id; - }; - -private: - void handleWildcard(Request& req, Response& resp); - void handleLobbies(Request& req, Response& resp); - void handleCreateLobby(Request& req, Response& resp); - void handleSubscribeLobby(Request& req, Response& resp); - void handleUnsubscribeLobby(Request& req, Response& resp); - void handleAutoSubsribeLobby(Request& req, Response& resp); - void handleInviteToLobby(Request& req, Response& resp); - void handleGetInvitationsToLobby(Request& req, Response& resp); - void handleAnswerToInvitation(Request& req, Response& resp); - void handleClearLobby(Request& req, Response& resp); - ResponseTask* handleLobbyParticipants(Request& req, Response& resp); - void handleMessages(Request& req, Response& resp); - void handleSendMessage(Request& req, Response& resp); - void handleMarkChatAsRead(Request& req, Response& resp); - void handleInfo(Request& req, Response& resp); - ResponseTask *handleReceiveStatus(Request& req, Response& resp); - void handleSendStatus(Request& req, Response& resp); - void handleUnreadMsgs(Request& req, Response& resp); - void handleInitiateDistantChatConnexion(Request& req, Response& resp); - void handleDistantChatStatus(Request& req, Response& resp); - void handleCloseDistantChatConnexion(Request& req, Response& resp); - - void getPlainText(const std::string& in, std::string &out, std::vector &links); - // last parameter is only used for lobbies! - void locked_storeTypingInfo(const ChatId& chat_id, std::string status, RsGxsId lobby_gxs_id = RsGxsId()); - - StateTokenServer* mStateTokenServer; - RsNotify* mNotify; - RsMsgs* mRsMsgs; - RsPeers* mRsPeers; - RsIdentity* mRsIdentity; - UnreadMsgNotify* mUnreadMsgNotify; - - RsMutex mMtx; - - StateToken mMsgStateToken; - std::list mRawMsgs; - std::map > mMsgs; - - std::map mChatInfo; - - std::map mTypingLabelInfo; - - StateToken mLobbiesStateToken; - std::vector mLobbies; - - std::map mLobbyParticipantsInfos; - - StateToken mUnreadMsgsStateToken; - StateToken mInvitationsStateToken; - -}; -} // namespace resource_api diff --git a/libresapi/src/api/FileSearchHandler.cpp b/libresapi/src/api/FileSearchHandler.cpp deleted file mode 100644 index c159ad913..000000000 --- a/libresapi/src/api/FileSearchHandler.cpp +++ /dev/null @@ -1,242 +0,0 @@ -#include - -#include "FileSearchHandler.h" - -#include -#include - -#include "Operators.h" - -namespace resource_api -{ - -FileSearchHandler::FileSearchHandler(StateTokenServer *sts, RsNotify *notify, RsTurtle *turtle, RsFiles */*files*/): - mStateTokenServer(sts), mNotify(notify), mTurtle(turtle),// mFiles(files), - mMtx("FileSearchHandler") -{ - mNotify->registerNotifyClient(this); - addResourceHandler("*", this, &FileSearchHandler::handleWildcard); - addResourceHandler("create_search", this, &FileSearchHandler::handleCreateSearch); - - mSearchesStateToken = mStateTokenServer->getNewToken(); -} - -FileSearchHandler::~FileSearchHandler() -{ - mNotify->unregisterNotifyClient(this); - mStateTokenServer->discardToken(mSearchesStateToken); -} - -void FileSearchHandler::notifyTurtleSearchResult(uint32_t search_id, const std::list& files) -{ - RsStackMutex stackMtx(mMtx); // ********** STACK LOCKED MTX ********** - std::map::iterator mit = mSearches.find(search_id); - if(mit == mSearches.end()) - return; - - Search& search = mit->second; - // set to a limit of 100 for now, can have more when we have pagination - std::list::const_iterator lit = files.begin(); - bool changed = false; - while(search.mResults.size() < 100 && lit != files.end()) - { - if(search.mHashes.find(lit->hash) == search.mHashes.end()) - { - changed = true; - FileDetail det ; - det.rank = 0 ; - det.age = 0 ; - det.name = (*lit).name; - det.hash = (*lit).hash; - det.size = (*lit).size; - det.id.clear(); - search.mResults.push_back(det); - search.mHashes.insert(lit->hash); - } - lit++; - } - if(changed) - { - mStateTokenServer->discardToken(search.mStateToken); - search.mStateToken = mStateTokenServer->getNewToken(); - } -} - -// TODO: delete searches -void FileSearchHandler::handleWildcard(Request &req, Response &resp) -{ - if(!req.mPath.empty()) - { - std::string str = req.mPath.top(); - req.mPath.pop(); - - if(str.size() != 8) - { - resp.setFail("Error: id has wrong size, should be 8 characters"); - return; - } - uint32_t id = 0; - // TODO fix this - for(uint8_t i = 0; i < 8; i++) - { - id += (uint32_t(str[i]-'A')) << (i*4); - } - - { - RsStackMutex stackMtx(mMtx); // ********** STACK LOCKED MTX ********** - std::map::iterator mit = mSearches.find(id); - if(mit == mSearches.end()) - { - resp.setFail("Error: search id invalid"); - return; - } - - Search& search = mit->second; - resp.mStateToken = search.mStateToken; - resp.mDataStream.getStreamToMember(); - for(std::list::iterator lit = search.mResults.begin(); lit != search.mResults.end(); ++lit) - { - FileDetail& fd = *lit; - double size = fd.size; - resp.mDataStream.getStreamToMember() - << makeKeyValueReference("id", fd.hash) - << makeKeyValueReference("name", fd.name) - << makeKeyValueReference("hash", fd.hash) - << makeKeyValueReference("size", size) - << makeKeyValueReference("rank", fd.rank); - } - } - } - else - { - // list searches - RsStackMutex stackMtx(mMtx); // ********** STACK LOCKED MTX ********** - resp.mDataStream.getStreamToMember(); - for(std::map::iterator mit = mSearches.begin(); mit != mSearches.end(); ++mit) - { - uint32_t id = mit->first; - std::string idstr; - // how many times do i have to write int to string conversation? - // a library should do this - for(uint8_t i = 0; i < 8; i++) - { - char c = ((id>>(i*4))&0xF)+'A'; - idstr += c; - } - resp.mDataStream.getStreamToMember() - << makeKeyValueReference("id", idstr) - << makeKeyValueReference("search_string", mit->second.mSearchString); - } - resp.mStateToken = mSearchesStateToken; - resp.setOk(); - } -} - -static bool dirDetailToFileDetail(const DirDetails& dir, FileDetail& fd) -{ - if (dir.type == DIR_TYPE_FILE) - { - fd.id = dir.id; - fd.name = dir.name; - fd.hash = dir.hash; - fd.path = dir.path; - fd.size = dir.count; - fd.age = time(NULL) - dir.mtime; - fd.rank = 0; - return true; - } - else - return false; -} - -// see retroshare-gui/src/gui/Searchdialog.cpp -void FileSearchHandler::handleCreateSearch(Request &req, Response &resp) -{ - bool distant = false;// distant involves sending data, so have it off by default for privacy - bool local = true; - bool remote = true; - std::string search_string; - req.mStream << makeKeyValueReference("distant", distant) - << makeKeyValueReference("local", local) - << makeKeyValueReference("remote", remote) - << makeKeyValueReference("search_string", search_string); - - std::istringstream iss(search_string); - std::list words; - std::string s; - while (std::getline(iss, s, ' ')) { - std::cout << s << std::endl; - words.push_back(s); - } - - if(words.empty()) - { - resp.setFail("Error: no search string given"); - return; - } - - RsRegularExpression::NameExpression exprs(RsRegularExpression::ContainsAllStrings,words,true) ; - RsRegularExpression::LinearizedExpression lin_exp ; - exprs.linearize(lin_exp) ; - - uint32_t search_id = RSRandom::random_u32(); - if(distant) - { - // i have no idea what the reasons for two different search modes are - // rs-gui does it, so do we - if(words.size() == 1) - search_id = mTurtle->turtleSearch(words.front()); - else - search_id = mTurtle->turtleSearch(lin_exp); - } - - std::list results; - if(local) - { - std::list local_results; - rsFiles->SearchBoolExp(&exprs, local_results, RS_FILE_HINTS_LOCAL); - - for(std::list::iterator lit = local_results.begin(); lit != local_results.end(); ++lit) - { - FileDetail fd; - if(dirDetailToFileDetail(*lit, fd)) - results.push_back(fd); - } - } - if(remote) - { - std::list remote_results; - rsFiles->SearchBoolExp(&exprs, remote_results, RS_FILE_HINTS_REMOTE); - for(std::list::iterator lit = remote_results.begin(); lit != remote_results.end(); ++lit) - { - FileDetail fd; - if(dirDetailToFileDetail(*lit, fd)) - results.push_back(fd); - } - } - - { - RsStackMutex stackMtx(mMtx); // ********** STACK LOCKED MTX ********** - - Search& search = mSearches[search_id]; - search.mStateToken = mStateTokenServer->getNewToken(); - search.mSearchString = search_string; - search.mResults.swap(results); - - mStateTokenServer->discardToken(mSearchesStateToken); - mSearchesStateToken = mStateTokenServer->getNewToken(); - } - - std::string idstr; - // how many times do i have to write int to string conversation? - // a library should do this - for(uint8_t i = 0; i < 8; i++) - { - char c = ((search_id>>(i*4))&0xF)+'A'; - idstr += c; - } - resp.mDataStream << makeKeyValueReference("search_id", idstr); - resp.setOk(); -} - -} // namespace resource_api diff --git a/libresapi/src/api/FileSearchHandler.h b/libresapi/src/api/FileSearchHandler.h deleted file mode 100644 index a049c2207..000000000 --- a/libresapi/src/api/FileSearchHandler.h +++ /dev/null @@ -1,43 +0,0 @@ -#pragma once -#include "ResourceRouter.h" -#include "StateTokenServer.h" - -#include -#include -#include - -namespace resource_api -{ - -class FileSearchHandler: public ResourceRouter, NotifyClient -{ -public: - FileSearchHandler(StateTokenServer* sts, RsNotify* notify, RsTurtle* turtle, RsFiles* files); - virtual ~FileSearchHandler(); - - // from NotifyClient - virtual void notifyTurtleSearchResult(uint32_t search_id, const std::list& files); -private: - void handleWildcard(Request& req, Response& resp); - void handleCreateSearch(Request& req, Response& resp); - - StateTokenServer* mStateTokenServer; - RsNotify* mNotify; - RsTurtle* mTurtle; - //RsFiles* mFiles; - - class Search{ - public: - StateToken mStateToken; - std::string mSearchString; // extra service: store the search string - std::list mResults; - // a set for fast deduplication lookup - std::set mHashes; - }; - - RsMutex mMtx; - StateToken mSearchesStateToken; - std::map mSearches; // mutex protected -}; - -} // namespace resource_api diff --git a/libresapi/src/api/ForumHandler.cpp b/libresapi/src/api/ForumHandler.cpp deleted file mode 100644 index fa7562691..000000000 --- a/libresapi/src/api/ForumHandler.cpp +++ /dev/null @@ -1,148 +0,0 @@ -#include "ForumHandler.h" - -#include -#include - -#include "Operators.h" -#include "ApiTypes.h" -#include "GxsResponseTask.h" -#ifndef WINDOWS_SYS -#include "unistd.h" -#endif - -namespace resource_api -{ -ForumHandler::ForumHandler(RsGxsForums* forums): - mRsGxsForums(forums) -{ - addResourceHandler("*", this, &ForumHandler::handleWildcard); -} - -void ForumHandler::handleWildcard(Request &req, Response &resp) -{ - bool ok = true; - if(!req.mPath.empty()) - { - std::string str = req.mPath.top(); - req.mPath.pop(); - if(str != "") - { - //assume we have a groupID - RsGxsGroupId grpId(str); - std::list groupIds; - groupIds.push_back(grpId); - - uint32_t token; - RsTokReqOptions opts; - opts.mReqType = GXS_REQUEST_TYPE_MSG_DATA; - mRsGxsForums->getTokenService()->requestMsgInfo(token, RS_TOKREQ_ANSTYPE_DATA, opts, groupIds); - - time_t start = time(NULL); - while((mRsGxsForums->getTokenService()->requestStatus(token) != RsTokenService::GXS_REQUEST_V2_STATUS_COMPLETE) - &&(mRsGxsForums->getTokenService()->requestStatus(token) != RsTokenService::GXS_REQUEST_V2_STATUS_FAILED) - &&((time(NULL) < (start+10))) - ) - { - #ifdef WINDOWS_SYS - Sleep(500); - #else - usleep(500*1000) ; - #endif - } - - if(mRsGxsForums->getTokenService()->requestStatus(token) == RsTokenService::GXS_REQUEST_V2_STATUS_COMPLETE) - { - std::vector grps; - ok &= mRsGxsForums->getMsgData(token, grps); - for(std::vector::iterator vit = grps.begin(); vit != grps.end(); vit++) - { - RsGxsForumMsg& grp = *vit; - KeyValueReference group_id("group_id", grp.mMeta.mGroupId); - resp.mDataStream.getStreamToMember() - << group_id - << makeKeyValueReference("name", grp.mMeta.mMsgName) - << makeKeyValueReference("id", grp.mMeta.mMsgId) - << makeKeyValueReference("parent_id", grp.mMeta.mParentId) - << makeKeyValueReference("author_id", grp.mMeta.mAuthorId) - << makeKeyValueReference("orig_msg_id", grp.mMeta.mOrigMsgId) - << makeKeyValueReference("thread_id", grp.mMeta.mThreadId) - << makeKeyValueReference("message", grp.mMsg); - } - } - else - { - ok = false; - } - - } - - } - else - { - // no more path element - RsTokReqOptions opts; - opts.mReqType = GXS_REQUEST_TYPE_GROUP_DATA; - uint32_t token; - mRsGxsForums->getTokenService()->requestGroupInfo(token, RS_TOKREQ_ANSTYPE_DATA, opts); - - time_t start = time(NULL); - while((mRsGxsForums->getTokenService()->requestStatus(token) != RsTokenService::GXS_REQUEST_V2_STATUS_COMPLETE) - &&(mRsGxsForums->getTokenService()->requestStatus(token) != RsTokenService::GXS_REQUEST_V2_STATUS_FAILED) - &&((time(NULL) < (start+10))) - ) - { - #ifdef WINDOWS_SYS - Sleep(500); - #else - usleep(500*1000) ; - #endif - } - if(mRsGxsForums->getTokenService()->requestStatus(token) == RsTokenService::GXS_REQUEST_V2_STATUS_COMPLETE) - { - std::vector grps; - ok &= mRsGxsForums->getGroupData(token, grps); - for(std::vector::iterator vit = grps.begin(); vit != grps.end(); vit++) - { - RsGxsForumGroup& grp = *vit; - KeyValueReference id("id", grp.mMeta.mGroupId); - KeyValueReference vis_msg("visible_msg_count", grp.mMeta.mVisibleMsgCount); - //KeyValueReference pgp_id("pgp_id",grp.mPgpId ); - // not very happy about this, i think the flags should stay hidden in rsidentities - bool own = (grp.mMeta.mSubscribeFlags & GXS_SERV::GROUP_SUBSCRIBE_ADMIN); - bool pgp_linked = (grp.mMeta.mGroupFlags & RSGXSID_GROUPFLAG_REALID_kept_for_compatibility); - bool subscribed = IS_GROUP_SUBSCRIBED(grp.mMeta.mSubscribeFlags); - resp.mDataStream.getStreamToMember() - << id - //<< pgp_id - << makeKeyValueReference("name", grp.mMeta.mGroupName) - //<< makeKeyValueReference("last_post", grp.mMeta.mLastPost) - << makeKeyValueReference("pop", grp.mMeta.mPop) - //<< makeKeyValueReference("publish_ts", grp.mMeta.mPublishTs) - << vis_msg - << makeKeyValueReference("group_status", grp.mMeta.mGroupStatus) - << makeKeyValueReference("author_id", grp.mMeta.mAuthorId) - << makeKeyValueReference("parent_grp_id", grp.mMeta.mParentGrpId) - << makeKeyValueReference("description", grp.mDescription) - << makeKeyValueReference("own", own) - << makeKeyValueReference("subscribed", subscribed) - << makeKeyValueReference("pgp_linked", pgp_linked); - } - } - else - { - ok = false; - } - } - - - if(ok) - { - resp.setOk(); - } - else - { - resp.setFail(); - } -} - -} // namespace resource_api diff --git a/libresapi/src/api/ForumHandler.h b/libresapi/src/api/ForumHandler.h deleted file mode 100644 index e44b19818..000000000 --- a/libresapi/src/api/ForumHandler.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef FORUMHANDLER_H -#define FORUMHANDLER_H - -#include "ResourceRouter.h" - -class RsGxsForums; - -namespace resource_api -{ - -class ForumHandler : public ResourceRouter -{ -public: - ForumHandler(RsGxsForums* forums); -private: - RsGxsForums* mRsGxsForums; - void handleWildcard(Request& req, Response& resp); -}; -} // namespace resource_api -#endif // FORUMHANDLER_H diff --git a/libresapi/src/api/GetPluginInterfaces.cpp b/libresapi/src/api/GetPluginInterfaces.cpp deleted file mode 100644 index f2bac46b0..000000000 --- a/libresapi/src/api/GetPluginInterfaces.cpp +++ /dev/null @@ -1,51 +0,0 @@ -#include "GetPluginInterfaces.h" - -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -namespace resource_api{ - -bool getPluginInterfaces(RsPlugInInterfaces& interfaces) -{ - // when rsPlugins is null, then rs was not started - if(rsPlugins == 0) - return false; - - interfaces.mFiles = rsFiles; - interfaces.mPeers = rsPeers; - interfaces.mMsgs = rsMsgs; - interfaces.mTurtle = rsTurtle; - interfaces.mDisc = rsDisc; - interfaces.mDht = rsDht; - interfaces.mNotify = rsNotify; - interfaces.mServiceControl = rsServiceControl; - interfaces.mPluginHandler = rsPlugins; - - // gxs - interfaces.mGxsDir = ""; - interfaces.mIdentity = rsIdentity; - // not exposed with global variable, can't get it - interfaces.mRsNxsNetMgr = 0; - // same as identity service, but different interface - interfaces.mGxsIdService = 0; - // - interfaces.mGxsCirlces = 0; - // not exposed with global variable - interfaces.mPgpAuxUtils = 0; - interfaces.mGxsForums = rsGxsForums; - interfaces.mGxsChannels = rsGxsChannels; - return true; -} - -} // namespace resource_api diff --git a/libresapi/src/api/GetPluginInterfaces.h b/libresapi/src/api/GetPluginInterfaces.h deleted file mode 100644 index 73cca040a..000000000 --- a/libresapi/src/api/GetPluginInterfaces.h +++ /dev/null @@ -1,10 +0,0 @@ -#pragma once - -class RsPlugInInterfaces; - -namespace resource_api{ - -// populates the given RsPlugInInterfaces object with pointers from gloabl variables like rsPeers, rsMsgs, rsFiles... -bool getPluginInterfaces(RsPlugInInterfaces& interfaces); - -} // namespace resource_api diff --git a/libresapi/src/api/GxsMetaOperators.h b/libresapi/src/api/GxsMetaOperators.h deleted file mode 100644 index ec6a98b9b..000000000 --- a/libresapi/src/api/GxsMetaOperators.h +++ /dev/null @@ -1,6 +0,0 @@ -#pragma once - -#include - -// operators for rsgxsgrpmeta and rsgxsmsgmeta -// diff --git a/libresapi/src/api/GxsResponseTask.cpp b/libresapi/src/api/GxsResponseTask.cpp deleted file mode 100644 index dcb4ebb51..000000000 --- a/libresapi/src/api/GxsResponseTask.cpp +++ /dev/null @@ -1,127 +0,0 @@ -#include "GxsResponseTask.h" - -#include "Operators.h" - -namespace resource_api -{ - -GxsResponseTask::GxsResponseTask(RsIdentity *id_service, RsTokenService *token_service): - mIdService(id_service), mTokenService(token_service), - mDone(false) -{ - -} - -bool GxsResponseTask::doWork(Request &req, Response &resp) -{ - bool ready = true; - // check if gxs requests are ready - if(mTokenService && !mWaitingTokens.empty()) - { - for(std::vector::iterator vit = mWaitingTokens.begin(); vit != mWaitingTokens.end(); ++vit) - { - uint8_t status = mTokenService->requestStatus(*vit); - if(status != RsTokenService::GXS_REQUEST_V2_STATUS_COMPLETE) - { - ready = false; - } - if(status == RsTokenService::GXS_REQUEST_V2_STATUS_FAILED) - { - std::cerr << "GxsResponseTask::doWork() Error: token failed. aborting." << std::endl; - resp.setFail("GxsResponseTask::doWork() Error: token failed."); - return false; // don't continue - } - } - } - - if(mIdService == 0) - { - std::cerr << "GxsResponseTask::doWork() ERROR: constucted with idservice = 0. Fix your code or report this bug." << std::endl; - resp.setFail("GxsResponseTask::doWork() ERROR: constucted with idservice = 0. Fix your code or report this bug."); - return false; // don't continue - } - - // check if we have identities to fetch - bool more = true; - while(!mIdentitiesToFetch.empty() && more) - { - // there are two methods to fetch identity data: - // - request gxs group, get token, get group - // - the direct way where we may have to wait, but identities will cache the result - // if we need to get many identuties, then we may flush the cache - // but if we reaquest the groups, no caching is done on the rs side (OS will cache the identities file) - // it has to be measured what is better - RsGxsId id = mIdentitiesToFetch.back(); - RsIdentityDetails details; - if(mIdService->getIdDetails(id, details)) - { - mIdentitiesToFetch.pop_back(); - mIdentityDetails.push_back(details); - } - else - { - more = false; // pause when an id failed, to give the service time tim fetch the data - ready = false; - // TODO: remove identities which failed many times from list, to avoid blocking when ids fail - } - } - if(!ready) - return true; // want to continue later - - mWaitingTokens.clear(); - mIdentitiesToFetch.clear(); - gxsDoWork(req, resp); - - if(mDone) return false; - else return true; -} - -void GxsResponseTask::addWaitingToken(uint32_t token) -{ - if(mTokenService) - mWaitingTokens.push_back(token); - else - std::cerr << "GxsResponseTask::addWaitingToken() ERROR: constructed with tokenservice=0. Unable to handle token processing. Fix your code or report this bug." << std::endl; -} - -void GxsResponseTask::done() -{ - mDone = true; -} - -void GxsResponseTask::requestGxsId(RsGxsId id) -{ - mIdentitiesToFetch.push_back(id); -} - -void GxsResponseTask::streamGxsId(RsGxsId id, StreamBase &stream) -{ - // will see if this works or if we have to use an index - for(std::vector::iterator vit = mIdentityDetails.begin(); - vit != mIdentityDetails.end(); ++vit) - { - if(vit->mId == id) - { - stream << makeKeyValueReference("id", id) - << makeKeyValueReference("gxs_id", id) - << makeKeyValueReference("flags", vit->mFlags) - << makeKeyValueReference("name", vit->mNickname); - return; - } - } -} - -std::string GxsResponseTask::getName(RsGxsId id) -{ - for(std::vector::iterator vit = mIdentityDetails.begin(); - vit != mIdentityDetails.end(); ++vit) - { - if(vit->mId == id) - return vit->mNickname; - } - std::cerr << "Warning: identity not found in GxsResponseTask::getName(). This is probably a bug. You must call GxsResponseTask::requestGxsId() before you can get the name." << std::endl; - return ""; -} - - -} // namespace resource_api diff --git a/libresapi/src/api/GxsResponseTask.h b/libresapi/src/api/GxsResponseTask.h deleted file mode 100644 index 8200b3eee..000000000 --- a/libresapi/src/api/GxsResponseTask.h +++ /dev/null @@ -1,51 +0,0 @@ -#pragma once - -#include "ApiTypes.h" -#include - -namespace resource_api -{ -// parent class for all responses that use the gxs backend -// this class implements the polling for gxs-tokens -// child classes pass gxs tokens to this class - -// question: should this class be able to handle tokens from different services? -// then we would have to store a pointer to the token service for ever token -class GxsResponseTask: public ResponseTask -{ -public: - // token service is allowed to be null if no token functions are wanted - GxsResponseTask(RsIdentity* id_service, RsTokenService* token_service = 0); - virtual bool doWork(Request &req, Response& resp); - -protected: - // this method gets called when all the pending tokens have either status ok or fail - // (= when the requests for these tokens are processed) - // how will the child class find out if a request failed? - // idea: don't call gxsDoWork() when a request failed, instead set the api response to fail - // con: then the child class has no way to tell the outside world which request failed - // pro: child class gets simpler, because no special error handling is required - // implement this in a child class - virtual void gxsDoWork(Request& req, Response& resp) = 0; - - // call this to wait for tokens before the next call to gxsDoWork() - void addWaitingToken(uint32_t token); - // call this to end the task - void done(); - // request name for gxs id - void requestGxsId(RsGxsId id); - // call stream function in the next cycle, then the names are available - void streamGxsId(RsGxsId id, StreamBase& stream); - std::string getName(RsGxsId id); -private: - RsIdentity* mIdService; - RsTokenService* mTokenService; - - std::vector mWaitingTokens; - bool mDone; - - std::vector mIdentitiesToFetch; - std::vector mIdentityDetails; -}; - -} // namespace resource_api diff --git a/libresapi/src/api/IdentityHandler.cpp b/libresapi/src/api/IdentityHandler.cpp deleted file mode 100644 index 8d132dd85..000000000 --- a/libresapi/src/api/IdentityHandler.cpp +++ /dev/null @@ -1,725 +0,0 @@ -/* - * libresapi - * - * Copyright (C) 2015 electron128 - * Copyright (C) 2017 Gioacchino Mazzurco - * - * 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 . - */ - -#include "IdentityHandler.h" - -#include -#include -#include -#include - -#include "Operators.h" -#include "ApiTypes.h" -#include "GxsResponseTask.h" -#ifndef WINDOWS_SYS -#include "unistd.h" -#endif - -namespace resource_api -{ - -class SendIdentitiesListTask: public GxsResponseTask -{ -public: - SendIdentitiesListTask(RsIdentity* idservice, std::list ids, StateToken state): - GxsResponseTask(idservice, 0), mStateToken(state) - { - for(std::list::iterator vit = ids.begin(); vit != ids.end(); ++vit) - { - requestGxsId(*vit); - mIds.push_back(*vit);// convert from list to vector - } - } -private: - std::vector mIds; - StateToken mStateToken; -protected: - virtual void gxsDoWork(Request& /*req*/, Response &resp) - { - resp.mDataStream.getStreamToMember(); - for(std::vector::iterator vit = mIds.begin(); vit != mIds.end(); ++vit) - { - streamGxsId(*vit, resp.mDataStream.getStreamToMember()); - } - resp.mStateToken = mStateToken; - resp.setOk(); - done(); - } - -}; - -class CreateIdentityTask: public GxsResponseTask -{ -public: - CreateIdentityTask(RsIdentity* idservice): - GxsResponseTask(idservice, idservice->getTokenService()), mState(BEGIN), mToken(0), mRsIdentity(idservice){} -private: - enum State {BEGIN, WAIT_ACKN, WAIT_ID}; - State mState; - uint32_t mToken; - RsIdentity* mRsIdentity; - RsGxsId mId; -protected: - virtual void gxsDoWork(Request &req, Response &resp) - { - switch(mState) - { - case BEGIN:{ - RsIdentityParameters params; - req.mStream - << makeKeyValueReference("name", params.nickname) - << makeKeyValueReference("pgp_linked", params.isPgpLinked); - - std::string avatar; - req.mStream << makeKeyValueReference("avatar", avatar); - - std::vector avatar_data = Radix64::decode(avatar); - uint8_t *p_avatar_data = &avatar_data[0]; - uint32_t size = avatar_data.size(); - params.mImage.clear(); - params.mImage.copy(p_avatar_data, size); - - if(params.nickname == "") - { - resp.setFail("name can't be empty"); - done(); - return; - } - mRsIdentity->createIdentity(mToken, params); - addWaitingToken(mToken); - mState = WAIT_ACKN; - break; - } - case WAIT_ACKN:{ - RsGxsGroupId grpId; - if(!mRsIdentity->acknowledgeGrp(mToken, grpId)) - { - resp.setFail("acknowledge of group id failed"); - done(); - return; - } - mId = RsGxsId(grpId); - requestGxsId(mId); - mState = WAIT_ID; - break; - } - case WAIT_ID: - streamGxsId(mId, resp.mDataStream); - resp.setOk(); - done(); - } - } -}; - -class DeleteIdentityTask : public GxsResponseTask -{ -public: - DeleteIdentityTask(RsIdentity* idservice) : - GxsResponseTask(idservice, idservice->getTokenService()), - mToken(0), - mRsIdentity(idservice) - {} - -protected: - virtual void gxsDoWork(Request &req, Response & /* resp */) - { - RsGxsIdGroup group; - std::string gxs_id; - - req.mStream << makeKeyValueReference("gxs_id", gxs_id); - group.mMeta.mGroupId = RsGxsGroupId(gxs_id); - - mRsIdentity->deleteIdentity(mToken, group); - addWaitingToken(mToken); - - done(); - return; - } - -private: - uint32_t mToken; - RsIdentity* mRsIdentity; - RsGxsId mId; -}; - -IdentityHandler::IdentityHandler(StateTokenServer *sts, RsNotify *notify, - RsIdentity *identity) : - mStateTokenServer(sts), mNotify(notify), mRsIdentity(identity), - mMtx("IdentityHandler Mtx"), mStateToken(sts->getNewToken()) -{ - mNotify->registerNotifyClient(this); - - addResourceHandler("*", this, &IdentityHandler::handleWildcard); - addResourceHandler("own", this, &IdentityHandler::handleOwn); - - addResourceHandler("own_ids", this, &IdentityHandler::handleOwnIdsRequest); - addResourceHandler("notown_ids", this, - &IdentityHandler::handleNotOwnIdsRequest); - - addResourceHandler("export_key", this, &IdentityHandler::handleExportKey); - addResourceHandler("import_key", this, &IdentityHandler::handleImportKey); - - addResourceHandler("add_contact", this, &IdentityHandler::handleAddContact); - addResourceHandler("remove_contact", this, &IdentityHandler::handleRemoveContact); - - addResourceHandler("create_identity", this, &IdentityHandler::handleCreateIdentity); - addResourceHandler("delete_identity", this, &IdentityHandler::handleDeleteIdentity); - - addResourceHandler("get_identity_details", this, &IdentityHandler::handleGetIdentityDetails); - - addResourceHandler("get_avatar", this, &IdentityHandler::handleGetAvatar); - addResourceHandler("set_avatar", this, &IdentityHandler::handleSetAvatar); - - addResourceHandler("set_ban_node", this, &IdentityHandler::handleSetBanNode); - addResourceHandler("set_opinion", this, &IdentityHandler::handleSetOpinion); -} - -IdentityHandler::~IdentityHandler() -{ - mNotify->unregisterNotifyClient(this); -} - -void IdentityHandler::notifyGxsChange(const RsGxsChanges &changes) -{ - RS_STACK_MUTEX(mMtx); - // if changes come from identity service, invalidate own state token - if(changes.mService == mRsIdentity->getTokenService()) - mStateTokenServer->replaceToken(mStateToken); -} - -void IdentityHandler::handleWildcard(Request & /*req*/, Response &resp) -{ - bool ok = true; - - { - RS_STACK_MUTEX(mMtx); - resp.mStateToken = mStateToken; - } - RsTokReqOptions opts; - opts.mReqType = GXS_REQUEST_TYPE_GROUP_DATA; - uint32_t token; - mRsIdentity->getTokenService()->requestGroupInfo( - token, RS_TOKREQ_ANSTYPE_DATA, opts); - - time_t timeout = time(NULL)+10; - uint8_t rStatus = mRsIdentity->getTokenService()->requestStatus(token); - while( rStatus != RsTokenService::GXS_REQUEST_V2_STATUS_COMPLETE && - rStatus != RsTokenService::GXS_REQUEST_V2_STATUS_FAILED && - time(NULL) < timeout ) - { - usleep(50*1000); - rStatus = mRsIdentity->getTokenService()->requestStatus(token); - } - - if(rStatus == RsTokenService::GXS_REQUEST_V2_STATUS_COMPLETE) - { - std::vector grps; - ok &= mRsIdentity->getGroupData(token, grps); - for( std::vector::iterator vit = grps.begin(); - vit != grps.end(); ++vit ) - { - RsGxsIdGroup& grp = *vit; - /* electron: not very happy about this, i think the flags should - * stay hidden in rsidentities */ - bool own = (grp.mMeta.mSubscribeFlags & - GXS_SERV::GROUP_SUBSCRIBE_ADMIN); - bool pgp_linked = (grp.mMeta.mGroupFlags & - RSGXSID_GROUPFLAG_REALID_kept_for_compatibility); - resp.mDataStream.getStreamToMember() -#warning Gioacchino Mazzurco 2017-03-24: @deprecated using "id" as key can cause problems in some JS based \ - languages like Qml @see gxs_id instead - << makeKeyValueReference("id", grp.mMeta.mGroupId) - << makeKeyValueReference("gxs_id", grp.mMeta.mGroupId) - << makeKeyValueReference("pgp_id",grp.mPgpId ) - << makeKeyValueReference("name", grp.mMeta.mGroupName) - << makeKeyValueReference("contact", grp.mIsAContact) - << makeKeyValueReference("own", own) - << makeKeyValueReference("pgp_linked", pgp_linked) - << makeKeyValueReference("is_contact", grp.mIsAContact); - } - } - else ok = false; - - if(ok) resp.setOk(); - else resp.setFail(); -} - -void IdentityHandler::handleNotOwnIdsRequest(Request & /*req*/, Response &resp) -{ - bool ok = true; - - { - RS_STACK_MUTEX(mMtx); - resp.mStateToken = mStateToken; - } - RsTokReqOptions opts; - opts.mReqType = GXS_REQUEST_TYPE_GROUP_DATA; - uint32_t token; - mRsIdentity->getTokenService()->requestGroupInfo( - token, RS_TOKREQ_ANSTYPE_DATA, opts); - - time_t timeout = time(NULL)+10; - uint8_t rStatus = mRsIdentity->getTokenService()->requestStatus(token); - while( rStatus != RsTokenService::GXS_REQUEST_V2_STATUS_COMPLETE && - rStatus != RsTokenService::GXS_REQUEST_V2_STATUS_FAILED && - time(NULL) < timeout ) - { - usleep(50*1000); - rStatus = mRsIdentity->getTokenService()->requestStatus(token); - } - - if(rStatus == RsTokenService::GXS_REQUEST_V2_STATUS_COMPLETE) - { - std::vector grps; - ok &= mRsIdentity->getGroupData(token, grps); - for(std::vector::iterator vit = grps.begin(); - vit != grps.end(); vit++) - { - RsGxsIdGroup& grp = *vit; - if(!(grp.mMeta.mSubscribeFlags & GXS_SERV::GROUP_SUBSCRIBE_ADMIN)) - { - bool pgp_linked = ( - grp.mMeta.mGroupFlags & - RSGXSID_GROUPFLAG_REALID_kept_for_compatibility ); - resp.mDataStream.getStreamToMember() - << makeKeyValueReference("gxs_id", grp.mMeta.mGroupId) - << makeKeyValueReference("pgp_id",grp.mPgpId ) - << makeKeyValueReference("name", grp.mMeta.mGroupName) - << makeKeyValueReference("pgp_linked", pgp_linked) - << makeKeyValueReference("is_contact", grp.mIsAContact); - } - } - } - else ok = false; - - if(ok) resp.setOk(); - else resp.setFail(); -} - -void IdentityHandler::handleOwnIdsRequest(Request & /*req*/, Response &resp) -{ - bool ok = true; - - { - RS_STACK_MUTEX(mMtx); - resp.mStateToken = mStateToken; - } - RsTokReqOptions opts; - opts.mReqType = GXS_REQUEST_TYPE_GROUP_DATA; - uint32_t token; - mRsIdentity->getTokenService()->requestGroupInfo(token, RS_TOKREQ_ANSTYPE_DATA, opts); - - time_t start = time(NULL); - while((mRsIdentity->getTokenService()->requestStatus(token) != RsTokenService::GXS_REQUEST_V2_STATUS_COMPLETE) - &&(mRsIdentity->getTokenService()->requestStatus(token) != RsTokenService::GXS_REQUEST_V2_STATUS_FAILED) - &&((time(NULL) < (start+10))) - ) - { -#ifdef WINDOWS_SYS - Sleep(500); -#else - usleep(500*1000); -#endif - } - - if(mRsIdentity->getTokenService()->requestStatus(token) == RsTokenService::GXS_REQUEST_V2_STATUS_COMPLETE) - { - std::vector grps; - ok &= mRsIdentity->getGroupData(token, grps); - for(std::vector::iterator vit = grps.begin(); vit != grps.end(); vit++) - { - RsGxsIdGroup& grp = *vit; - //electron: not very happy about this, i think the flags should stay hidden in rsidentities - if(vit->mMeta.mSubscribeFlags & GXS_SERV::GROUP_SUBSCRIBE_ADMIN) - { - bool pgp_linked = (grp.mMeta.mGroupFlags & RSGXSID_GROUPFLAG_REALID_kept_for_compatibility ) ; - resp.mDataStream.getStreamToMember() - << makeKeyValueReference("own_gxs_id", grp.mMeta.mGroupId) - << makeKeyValueReference("pgp_id",grp.mPgpId ) - << makeKeyValueReference("name", grp.mMeta.mGroupName) - << makeKeyValueReference("pgp_linked", pgp_linked); - } - } - - } - else - ok = false; - - if(ok) resp.setOk(); - else resp.setFail(); -} - -void IdentityHandler::handleAddContact(Request& req, Response& resp) -{ - std::string gxs_id; - req.mStream << makeKeyValueReference("gxs_id", gxs_id); - - mRsIdentity->setAsRegularContact(RsGxsId(gxs_id), true); - - { - RsStackMutex stack(mMtx); /********** STACK LOCKED MTX ******/ - mStateTokenServer->replaceToken(mStateToken); - } - - resp.setOk(); -} - -void IdentityHandler::handleRemoveContact(Request& req, Response& resp) -{ - std::string gxs_id; - req.mStream << makeKeyValueReference("gxs_id", gxs_id); - - mRsIdentity->setAsRegularContact(RsGxsId(gxs_id), false); - - { - RsStackMutex stack(mMtx); /********** STACK LOCKED MTX ******/ - mStateTokenServer->replaceToken(mStateToken); - } - - resp.setOk(); -} - -void IdentityHandler::handleGetIdentityDetails(Request& req, Response& resp) -{ - std::string gxs_id; - req.mStream << makeKeyValueReference("gxs_id", gxs_id); - - RsTokReqOptions opts; - opts.mReqType = GXS_REQUEST_TYPE_GROUP_DATA; - uint32_t token; - - std::list groupIds; - groupIds.push_back(RsGxsGroupId(gxs_id)); - mRsIdentity->getTokenService()->requestGroupInfo(token, RS_TOKREQ_ANSTYPE_DATA, opts, groupIds); - - time_t start = time(NULL); - while((mRsIdentity->getTokenService()->requestStatus(token) != RsTokenService::GXS_REQUEST_V2_STATUS_COMPLETE) - &&(mRsIdentity->getTokenService()->requestStatus(token) != RsTokenService::GXS_REQUEST_V2_STATUS_FAILED) - &&((time(NULL) < (start+10))) - ) - { -#ifdef WINDOWS_SYS - Sleep(500); -#else - usleep(500*1000); -#endif - } - - RsGxsIdGroup data; - std::vector datavector; - if (!mRsIdentity->getGroupData(token, datavector)) - { - resp.setFail(); - return; - } - - if(datavector.empty()) - { - resp.setFail(); - return; - } - - data = datavector[0]; - - resp.mDataStream << makeKeyValue("gxs_name", data.mMeta.mGroupName); - resp.mDataStream << makeKeyValue("gxs_id", data.mMeta.mGroupId.toStdString()); - - resp.mDataStream << makeKeyValue("pgp_id_known", data.mPgpKnown); - resp.mDataStream << makeKeyValue("pgp_id", data.mPgpId.toStdString()); - - std::string pgp_name; - if (data.mPgpKnown) - { - RsPeerDetails details; - rsPeers->getGPGDetails(data.mPgpId, details); - pgp_name = details.name; - } - else - { - if (data.mMeta.mGroupFlags & RSGXSID_GROUPFLAG_REALID_kept_for_compatibility) - pgp_name = "[Unknown node]"; - else - pgp_name = "Anonymous Id"; - } - resp.mDataStream << makeKeyValue("pgp_name", pgp_name); - - resp.mDataStream << makeKeyValue("last_usage", (uint32_t)data.mLastUsageTS); - - bool isAnonymous = false; - if(!data.mPgpKnown) - { - if (!(data.mMeta.mGroupFlags & RSGXSID_GROUPFLAG_REALID_kept_for_compatibility)) - isAnonymous = true; - } - resp.mDataStream << makeKeyValue("anonymous", isAnonymous); - - - bool isOwnId = (data.mMeta.mSubscribeFlags & GXS_SERV::GROUP_SUBSCRIBE_ADMIN); - resp.mDataStream << makeKeyValue("own", isOwnId); - - std::string type; - if(isOwnId) - { - if (data.mPgpKnown && !data.mPgpId.isNull()) - type = "Identity owned by you, linked to your Retroshare node"; - else - type = "Anonymous identity, owned by you"; - } - else if (data.mMeta.mGroupFlags & RSGXSID_GROUPFLAG_REALID_kept_for_compatibility) - { - if (data.mPgpKnown) - { - if (rsPeers->isGPGAccepted(data.mPgpId)) - type = "Linked to a friend Retroshare node"; - else - type = "Linked to a known Retroshare node"; - } - else - type = "Linked to unknown Retroshare node"; - } - else - type = "Anonymous identity"; - - resp.mDataStream << makeKeyValue("type", type); - - resp.mDataStream << makeKeyValue("bannned_node", rsReputations->isNodeBanned(data.mPgpId)); - - RsReputations::ReputationInfo info; - rsReputations->getReputationInfo(RsGxsId(data.mMeta.mGroupId), data.mPgpId, info); - resp.mDataStream << makeKeyValue("friends_positive_votes", info.mFriendsPositiveVotes); - resp.mDataStream << makeKeyValue("friends_negative_votes", info.mFriendsNegativeVotes); - resp.mDataStream << makeKeyValue("overall_reputation_level", (int)info.mOverallReputationLevel); - resp.mDataStream << makeKeyValue("own_opinion", (int)info.mOwnOpinion); - - RsIdentityDetails details; - mRsIdentity->getIdDetails(RsGxsId(data.mMeta.mGroupId), details); - - std::string base64Avatar; - Radix64::encode(details.mAvatar.mData, details.mAvatar.mSize, base64Avatar); - resp.mDataStream << makeKeyValue("avatar", base64Avatar); - - StreamBase& usagesStream = resp.mDataStream.getStreamToMember("usages"); - usagesStream.getStreamToMember(); - - for(std::map::const_iterator it(details.mUseCases.begin()); it != details.mUseCases.end(); ++it) - { - usagesStream.getStreamToMember() - << makeKeyValue("usage_time", (uint32_t)data.mLastUsageTS) - << makeKeyValue("usage_service", (int)(it->first.mServiceId)) - << makeKeyValue("usage_case", (int)(it->first.mUsageCode)); - } - - resp.setOk(); -} - -void IdentityHandler::handleSetAvatar(Request& req, Response& resp) -{ - std::string gxs_id; - std::string avatar; - req.mStream << makeKeyValueReference("gxs_id", gxs_id); - req.mStream << makeKeyValueReference("avatar", avatar); - - RsTokReqOptions opts; - opts.mReqType = GXS_REQUEST_TYPE_GROUP_DATA; - uint32_t token; - - std::list groupIds; - groupIds.push_back(RsGxsGroupId(gxs_id)); - mRsIdentity->getTokenService()->requestGroupInfo(token, RS_TOKREQ_ANSTYPE_DATA, opts, groupIds); - - time_t start = time(NULL); - while((mRsIdentity->getTokenService()->requestStatus(token) != RsTokenService::GXS_REQUEST_V2_STATUS_COMPLETE) - &&(mRsIdentity->getTokenService()->requestStatus(token) != RsTokenService::GXS_REQUEST_V2_STATUS_FAILED) - &&((time(NULL) < (start+10))) - ) - { -#ifdef WINDOWS_SYS - Sleep(500); -#else - usleep(500*1000); -#endif - } - - RsGxsIdGroup data; - std::vector datavector; - if (!mRsIdentity->getGroupData(token, datavector)) - { - resp.setFail(); - return; - } - - if(datavector.empty()) - { - resp.setFail(); - return; - } - - data = datavector[0]; - - if(!avatar.empty()) - { - std::vector avatar_data = Radix64::decode(avatar); - uint8_t *p_avatar_data = &avatar_data[0]; - uint32_t size = avatar_data.size(); - data.mImage.clear(); - data.mImage.copy(p_avatar_data, size); - - std::string base64Avatar; - Radix64::encode(data.mImage.mData, data.mImage.mSize, base64Avatar); - resp.mDataStream << makeKeyValue("avatar", base64Avatar); - } - else - data.mImage.clear(); - - uint32_t dummyToken = 0; - mRsIdentity->updateIdentity(dummyToken, data); - - resp.setOk(); -} - -void IdentityHandler::handleGetAvatar(Request& req, Response& resp) -{ - std::string gxs_id; - req.mStream << makeKeyValueReference("gxs_id", gxs_id); - - RsIdentityDetails details; - bool got = mRsIdentity->getIdDetails(RsGxsId(gxs_id), details); - - std::string base64Avatar; - Radix64::encode(details.mAvatar.mData, details.mAvatar.mSize, base64Avatar); - resp.mDataStream << makeKeyValue("avatar", base64Avatar); - - if(got) - resp.setOk(); - else - resp.setFail(); -} - -void IdentityHandler::handleSetBanNode(Request& req, Response& resp) -{ - std::string pgp_id; - req.mStream << makeKeyValueReference("pgp_id", pgp_id); - RsPgpId pgpId(pgp_id); - - bool banned_node; - req.mStream << makeKeyValueReference("banned_node", banned_node); - rsReputations->banNode(pgpId, banned_node); - - resp.setOk(); -} - -void IdentityHandler::handleSetOpinion(Request& req, Response& resp) -{ - std::string gxs_id; - req.mStream << makeKeyValueReference("gxs_id", gxs_id); - RsGxsId gxsId(gxs_id); - - int own_opinion; - req.mStream << makeKeyValueReference("own_opinion", own_opinion); - - RsReputations::Opinion opinion; - switch(own_opinion) - { - case 0: - opinion = RsReputations::OPINION_NEGATIVE; - break; - case 1: opinion = - RsReputations::OPINION_NEUTRAL; - break; - case 2: - opinion = RsReputations::OPINION_POSITIVE; - break; - default: - resp.setFail(); - return; - } - rsReputations->setOwnOpinion(gxsId, opinion); - - resp.setOk(); -} - -ResponseTask* IdentityHandler::handleOwn(Request & /* req */, Response &resp) -{ - StateToken state; - { - RS_STACK_MUTEX(mMtx); // ********** LOCKED ********** - state = mStateToken; - } - std::list ids; - if(mRsIdentity->getOwnIds(ids)) - return new SendIdentitiesListTask(mRsIdentity, ids, state); - resp.mDataStream.getStreamToMember(); - resp.setWarning("identities not loaded yet"); - return 0; -} - -ResponseTask* IdentityHandler::handleCreateIdentity(Request & /* req */, Response & /* resp */) -{ - return new CreateIdentityTask(mRsIdentity); -} - -void IdentityHandler::handleExportKey(Request& req, Response& resp) -{ - RsGxsId gxs_id; - req.mStream << makeKeyValueReference("gxs_id", gxs_id); - - std::string radix; - time_t timeout = time(NULL)+2; - bool found = mRsIdentity->serialiseIdentityToMemory(gxs_id, radix); - while(!found && time(nullptr) < timeout) - { - usleep(5000); - found = mRsIdentity->serialiseIdentityToMemory(gxs_id, radix); - } - - if(found) - { - resp.mDataStream << makeKeyValueReference("gxs_id", gxs_id) - << makeKeyValueReference("radix", radix); - - resp.setOk(); - return; - } - - resp.setFail(); -} - -void IdentityHandler::handleImportKey(Request& req, Response& resp) -{ - std::string radix; - req.mStream << makeKeyValueReference("radix", radix); - - RsGxsId gxs_id; - if(mRsIdentity->deserialiseIdentityFromMemory(radix, &gxs_id)) - { - resp.mDataStream << makeKeyValueReference("gxs_id", gxs_id) - << makeKeyValueReference("radix", radix); - resp.setOk(); - return; - } - - resp.setFail(); -} - -ResponseTask* IdentityHandler::handleDeleteIdentity(Request& /*req*/, - Response& /*resp*/) -{ return new DeleteIdentityTask(mRsIdentity); } - -} // namespace resource_api diff --git a/libresapi/src/api/IdentityHandler.h b/libresapi/src/api/IdentityHandler.h deleted file mode 100644 index dff974e73..000000000 --- a/libresapi/src/api/IdentityHandler.h +++ /dev/null @@ -1,73 +0,0 @@ -#pragma once -/* - * libresapi - * - * Copyright (C) 2015 electron128 - * Copyright (C) 2017 Gioacchino Mazzurco - * - * 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 . - */ - -#include -#include - -#include "ResourceRouter.h" -#include "StateTokenServer.h" - -class RsIdentity; - -namespace resource_api -{ - -class IdentityHandler: public ResourceRouter, NotifyClient -{ -public: - IdentityHandler(StateTokenServer* sts, RsNotify* notify, RsIdentity* identity); - virtual ~IdentityHandler(); - - // from NotifyClient - // note: this may get called from foreign threads - virtual void notifyGxsChange(const RsGxsChanges &changes); - -private: - void handleWildcard(Request& req, Response& resp); - void handleNotOwnIdsRequest(Request& req, Response& resp); - void handleOwnIdsRequest(Request& req, Response& resp); - - void handleExportKey(Request& req, Response& resp); - void handleImportKey(Request& req, Response& resp); - - void handleAddContact(Request& req, Response& resp); - void handleRemoveContact(Request& req, Response& resp); - - void handleGetIdentityDetails(Request& req, Response& resp); - - void handleGetAvatar(Request& req, Response& resp); - void handleSetAvatar(Request& req, Response& resp); - - void handleSetBanNode(Request& req, Response& resp); - void handleSetOpinion(Request& req, Response& resp); - - ResponseTask *handleOwn(Request& req, Response& resp); - ResponseTask *handleCreateIdentity(Request& req, Response& resp); - ResponseTask *handleDeleteIdentity(Request& req, Response& resp); - - StateTokenServer* mStateTokenServer; - RsNotify* mNotify; - RsIdentity* mRsIdentity; - - RsMutex mMtx; - StateToken mStateToken; // mutex protected -}; -} // namespace resource_api diff --git a/libresapi/src/api/JsonStream.cpp b/libresapi/src/api/JsonStream.cpp deleted file mode 100644 index bbba2f2c8..000000000 --- a/libresapi/src/api/JsonStream.cpp +++ /dev/null @@ -1,524 +0,0 @@ -#include "JsonStream.h" -#include - -namespace resource_api -{ - -JsonStream::JsonStream(): - mSerialise(true), mDataType(TYPE_UNDEFINED), mArrayNextRead(0), mIsOk(true), mChild(NULL) -{ - -} - -JsonStream::~JsonStream() -{ - deleteCurrentChild(); -} - -void JsonStream::setJsonString(std::string jsonStr) -{ - mRawString = jsonStr; - // have to delay the deserialisation, because this stream can also be a raw data stream without json - // can find this out when others atucally call the operators - mSerialise = false; -} - -std::string JsonStream::getJsonString() -{ - deleteCurrentChild(); - if(mIsOk) - { - switch(mDataType) - { - case TYPE_UNDEFINED: - return ""; - case TYPE_ARRAY: - return json::Serialize(mArray); - case TYPE_OBJECT: - return json::Serialize(mObject); - case TYPE_RAW: - return mRawString; - default: - return ""; - } - } - std::cerr << "JsonStream::getJsonString() Warning: stream not ok, will return empty string." << std::endl; - return ""; -} - -void JsonStream::switchToDeserialisation() -{ - deleteCurrentChild(); - mSerialise = false; -} - - -//----------Stream Interface --------------- - -//----------Array--------------- -StreamBase& JsonStream::operator<<(ValueReference value) -{ - if(serialise()) - { - setType(TYPE_ARRAY); - mArray.push_back(value.value); - } - else - { - if(checkDeserialisation() && arrayBoundsOk()) - { - valueToBool(mArray[mArrayNextRead], value.value); - mArrayNextRead++; - } - } - return *this; -} - -StreamBase& JsonStream::operator<<(ValueReference value) -{ - if(serialise()) - { - setType(TYPE_ARRAY); - mArray.push_back(value.value); - } - else - { - if(checkDeserialisation() && arrayBoundsOk()) - { - valueToInt(mArray[mArrayNextRead], value.value); - mArrayNextRead++; - } - } - return *this; -} - -StreamBase& JsonStream::operator<<(ValueReference value) -{ - if(serialise()) - { - setType(TYPE_ARRAY); - mArray.push_back(value.value); - } - else - { - if(checkDeserialisation() && arrayBoundsOk()) - { - valueToDouble(mArray[mArrayNextRead], value.value); - mArrayNextRead++; - } - } - return *this; -} - -StreamBase& JsonStream::operator<<(ValueReference value) -{ - if(serialise()) - { - setType(TYPE_ARRAY); - mArray.push_back(value.value); - } - else - { - if(checkDeserialisation() && arrayBoundsOk()) - { - valueToString(mArray[mArrayNextRead], value.value); - mArrayNextRead++; - } - } - return *this; -} - -StreamBase& JsonStream::getStreamToMember() -{ - setType(TYPE_ARRAY); - deleteCurrentChild(); - mChild = new JsonStream(); - if(!serialise()) - { - if(checkDeserialisation() && arrayBoundsOk()) - { - mChild->mValue = mArray[mArrayNextRead]; - mChild->mSerialise = false; - mArrayNextRead++; - } - } - return *mChild; -} - -//----------Object--------------- -StreamBase& JsonStream::operator<<(KeyValueReference keyValue) -{ - if(serialise()) - { - setType(TYPE_OBJECT); - mObject[keyValue.key] = keyValue.value; - } - else - { - if(checkDeserialisation() && checkObjectMember(keyValue.key)) - { - valueToBool(mObject[keyValue.key], keyValue.value); - } - } - return *this; -} - -StreamBase& JsonStream::operator<<(KeyValueReference keyValue) -{ - if(serialise()) - { - setType(TYPE_OBJECT); - mObject[keyValue.key] = keyValue.value; - } - else - { - if(checkDeserialisation() && checkObjectMember(keyValue.key)) - { - valueToInt(mObject[keyValue.key], keyValue.value); - } - } - return *this; -} - -StreamBase& JsonStream::operator<<(KeyValueReference keyValue) -{ - if(serialise()) - { - setType(TYPE_OBJECT); - mObject[keyValue.key] = keyValue.value; - } - else - { - if(checkDeserialisation() && checkObjectMember(keyValue.key)) - { - valueToDouble(mObject[keyValue.key], keyValue.value); - } - } - return *this; -} - -StreamBase& JsonStream::operator<<(KeyValueReference keyValue) -{ - if(serialise()) - { - setType(TYPE_OBJECT); - mObject[keyValue.key] = keyValue.value; - } - else - { - if(checkDeserialisation() && checkObjectMember(keyValue.key)) - { - valueToString(mObject[keyValue.key], keyValue.value); - } - } - return *this; -} - -// usefull if the new object member should be an array or object -// the reference should be at least valid until another method of this class gets called -StreamBase& JsonStream::getStreamToMember(std::string name) -{ - setType(TYPE_OBJECT); - deleteCurrentChild(); - mChildKey = name; - mChild = new JsonStream(); - if(!serialise()) - { - mChild->mSerialise = false; - if(checkDeserialisation() && checkObjectMember(name)) - { - mChild->mValue = mObject[name]; - } - } - return *mChild; -} - -// make a binay data object (not a real object, just binary data) -StreamBase& JsonStream::operator<<(std::vector& data) -{ - if(serialise()) - { - if((mDataType == TYPE_UNDEFINED)||(mDataType == TYPE_RAW)) - { - mDataType = TYPE_RAW; - mRawString = std::string(data.begin(), data.end()); - } - else - { - mErrorLog += "Error: trying to set raw data while the type of this object is already another type\n"; - mIsOk = false; - } - } - else - { - if((mDataType == TYPE_UNDEFINED)||(mDataType == TYPE_RAW)) - { - mDataType = TYPE_RAW; - data = std::vector(mRawString.begin(), mRawString.end()); - } - else - { - mErrorLog += "Error: trying to read raw data while the type of this object is already another type\n"; - mIsOk = false; - } - } - return *this; -} - -// return true if there are more members in this object/array -// useful for array reading -bool JsonStream::hasMore() -{ - return arrayBoundsOk(); -} - -bool JsonStream::serialise() -{ - return mSerialise; -} - -bool JsonStream::isOK() -{ - return mIsOk; -} - -void JsonStream::setError() -{ - mIsOk = false; -} - -/* -void JsonStream::addLogMsg(std::string msg) -{} -*/ - -void JsonStream::addErrorMsg(std::string msg) -{ - mErrorLog += msg; -} - -std::string JsonStream::getLog() -{ - return "not implemented yet"; -} - -std::string JsonStream::getErrorLog() -{ - return mErrorLog; -} - -bool JsonStream::isRawData() -{ - return mDataType == TYPE_RAW; -} - -std::string JsonStream::getRawData() -{ - return mRawString; -} - -void JsonStream::setType(DataType type) -{ - if((mDataType == TYPE_UNDEFINED)||(mDataType == type)) - { - mDataType = type; - } - else - { - mIsOk = false; - mErrorLog += "JsonStream::setType() Error: type alread set to another type\n"; - } -} - -bool JsonStream::checkObjectMember(std::string key) -{ - if(mDataType == TYPE_OBJECT) - { - if(mObject.HasKey(key)) - { - return true; - } - else - { - mErrorLog += "JsonStream::checkObjectMember() Warning: missing key \""+key+"\"\n"; - return false; - } - } - else - { - mIsOk = false; - mErrorLog += "JsonStream::checkObjectMember() Error: type is not TYPE_OBJECT\n"; - return false; - } -} - -bool JsonStream::arrayBoundsOk() -{ - if(checkDeserialisation()) - { - if(mDataType == TYPE_ARRAY) - { - if(mArrayNextRead < mArray.size()) - { - return true; - } - else - { - return false; - } - } - else - { - mIsOk = false; - mErrorLog += "JsonStream::arrayBoundsOk() Error: type is not TYPE_ARRAY\n"; - return false; - } - } - return false; -} - -bool JsonStream::checkDeserialisation() -{ - if(mDataType != TYPE_RAW) - { - if(mDataType == TYPE_UNDEFINED) - { - if((mValue.GetType() == json::NULLVal) && mRawString != "") - { - mValue = json::Deserialize(mRawString); - } - if(mValue.GetType() == json::ObjectVal) - { - mDataType = TYPE_OBJECT; - mObject = mValue; - return true; - } - else if(mValue.GetType() == json::ArrayVal) - { - mDataType = TYPE_ARRAY; - mArray = mValue; - return true; - } - else - { - mIsOk = false; - mErrorLog += "JsonStream::checkDeserialisation() Error: deserialisation did not end with an object or array\n"; - return false; - } - } - else - { - // already deserialised - return true; - } - } - else - { - mIsOk = false; - mErrorLog += "JsonStream::checkDeserialisation() Error: type is TYPE_RAW\n"; - return false; - } -} - -void JsonStream::valueToBool(json::Value &value, bool &boolean) -{ - if(value.GetType() == json::BoolVal) - { - boolean = value; - } - else - { - mIsOk = false; - mErrorLog += "JsonStream::valueToBool() Error: wrong type\n"; - } -} - -void JsonStream::valueToInt(json::Value &value, int &integer) -{ - if(value.GetType() == json::IntVal) - { - integer = value; - } - else - { - mIsOk = false; - mErrorLog += "JsonStream::valueToInt() Error: wrong type\n"; - } -} - -void JsonStream::valueToDouble(json::Value &value, double &doubleVal) -{ - if(value.IsNumeric()) - { - doubleVal = value; - } - else - { - mIsOk = false; - mErrorLog += "JsonStream::valueToDouble() Error: wrong type\n"; - } -} - -void JsonStream::valueToString(json::Value &value, std::string& str) -{ - if(value.GetType() == json::StringVal) - { - str = value.ToString(); - } - else - { - mIsOk = false; - mErrorLog += "JsonStream::valueToString() Error: wrong type\n"; - } -} - -void JsonStream::deleteCurrentChild() -{ - if(mChild) - { - if(serialise()) - { - if(mDataType == TYPE_ARRAY) - { - // don't add empty value - if(mChild->getJsonValue().GetType() != json::NULLVal) - mArray.push_back(mChild->getJsonValue()); - } - else if(mDataType == TYPE_OBJECT) - { - mObject[mChildKey] = mChild->getJsonValue(); - } - else - { - mErrorLog += "JsonStream::deleteCurrentChild() Error: cannot add child because own type is wrong\n"; - } - } - else - { - // don't have to do anything for deserialisation - } - delete mChild; - mChild = NULL; - } -} - -json::Value JsonStream::getJsonValue() -{ - // remove the child and add it to own data - deleteCurrentChild(); - switch(mDataType) - { - case TYPE_UNDEFINED: - return json::Value(); - case TYPE_ARRAY: - return mArray; - case TYPE_OBJECT: - return mObject; - case TYPE_RAW: - return mRawString; - default: - return json::Value(); - } -} - -} // namespace resource_api diff --git a/libresapi/src/api/JsonStream.h b/libresapi/src/api/JsonStream.h deleted file mode 100644 index 25b7d8f93..000000000 --- a/libresapi/src/api/JsonStream.h +++ /dev/null @@ -1,106 +0,0 @@ -#pragma once - -#include "ApiTypes.h" -#include "json.h" - -namespace resource_api -{ - -class JsonStream: public StreamBase -{ -public: - JsonStream(); - virtual ~JsonStream(); - - void setJsonString(std::string jsonStr); - std::string getJsonString(); - - // it is possible to use this class as buffer - // first use as serialiser and fill with values - // then call this method to deserialise the values - void switchToDeserialisation(); - - - //----------Stream Interface --------------- - - // make an array - virtual StreamBase& operator<<(ValueReference value); - virtual StreamBase& operator<<(ValueReference value); - virtual StreamBase& operator<<(ValueReference value); - virtual StreamBase& operator<<(ValueReference value); - // usefull if the new array member should be an array or object - // the reference should be at least valid until another method of this class gets called - virtual StreamBase& getStreamToMember(); - - // make an object - virtual StreamBase& operator<<(KeyValueReference keyValue); - virtual StreamBase& operator<<(KeyValueReference keyValue); - virtual StreamBase& operator<<(KeyValueReference keyValue); - virtual StreamBase& operator<<(KeyValueReference keyValue); - // usefull if the new object member should be an array or object - // the reference should be at least valid until another method of this class gets called - virtual StreamBase& getStreamToMember(std::string name); - - // make a binay data object (not a real object, just binary data) - // idea: can use vector.swap() to allow passing larger data items without copying - virtual StreamBase& operator<<(std::vector& data); - - // return true if there are more members in this object/array - // useful for array reading - virtual bool hasMore(); - - virtual bool serialise(); // let external operators find out they should serialise or deserialise - // return true if no serialisation/deserialisation error occoured - virtual bool isOK(); - virtual void setError(); // let external operators set the failed bit - //virtual void addLogMsg(std::string msg); // mayb remove? (put log messages to error log einstead) - virtual void addErrorMsg(std::string msg); - virtual std::string getLog(); - virtual std::string getErrorLog(); - - virtual bool isRawData(); - virtual std::string getRawData(); -private: - bool mSerialise; - enum DataType{ TYPE_UNDEFINED, TYPE_ARRAY, TYPE_OBJECT, TYPE_RAW }; - // check if the current type is undefined - // if not check if the new type matches the old type - // if not set the error bit - void setType(DataType type); - DataType mDataType; - - json::Value mValue; - - json::Object mObject; - // check if we are and object - // check if this key exists - bool checkObjectMember(std::string key); - json::Array mArray; - size_t mArrayNextRead; - // check if we are an array - // check if next read is valid - // if not set error bit - bool arrayBoundsOk(); - std::string mRawString; - - bool mIsOk; - std::string mErrorLog; - - // try serialisation and set error bit on error - bool checkDeserialisation(); - - // check if value has correct type - // if yes return the extracted value - // if not then set the error bit - void valueToBool(json::Value& value, bool& boolean); - void valueToInt(json::Value& value, int& integer); - void valueToDouble(json::Value& value, double& doubleVal); - void valueToString(json::Value& value, std::string& str); - - void deleteCurrentChild(); - json::Value getJsonValue(); - JsonStream* mChild; - std::string mChildKey; -}; - -} // namespace resource_api diff --git a/libresapi/src/api/LivereloadHandler.cpp b/libresapi/src/api/LivereloadHandler.cpp deleted file mode 100644 index 1f433754f..000000000 --- a/libresapi/src/api/LivereloadHandler.cpp +++ /dev/null @@ -1,25 +0,0 @@ -#include "LivereloadHandler.h" - -namespace resource_api -{ -LivereloadHandler::LivereloadHandler(StateTokenServer *sts): - mStateTokenServer(sts), mStateToken(sts->getNewToken()) -{ - addResourceHandler("*", this, &LivereloadHandler::handleWildcard); - addResourceHandler("trigger", this, &LivereloadHandler::handleTrigger); -} - -void LivereloadHandler::handleWildcard(Request &/*req*/, Response &resp) -{ - resp.mStateToken = mStateToken; - resp.setOk(); -} - -void LivereloadHandler::handleTrigger(Request &/*req*/, Response &resp) -{ - mStateTokenServer->replaceToken(mStateToken); - resp.mStateToken = mStateToken; - resp.setOk(); -} - -} // namespace resource_api diff --git a/libresapi/src/api/LivereloadHandler.h b/libresapi/src/api/LivereloadHandler.h deleted file mode 100644 index 9d85999e4..000000000 --- a/libresapi/src/api/LivereloadHandler.h +++ /dev/null @@ -1,23 +0,0 @@ -#pragma once - -#include "ResourceRouter.h" -#include "StateTokenServer.h" - -namespace resource_api -{ - -// very simple livereload system, integrated into the existing state token system -// the response to / is only a statetoken -// if /trigger is called, then the state token is invalidaten and replaced wiht a new one -class LivereloadHandler: public ResourceRouter -{ -public: - LivereloadHandler(StateTokenServer* sts); - -private: - void handleWildcard(Request& req, Response& resp); - void handleTrigger(Request& req, Response& resp); - StateTokenServer* mStateTokenServer; - StateToken mStateToken; -}; -} // namespace resource_api diff --git a/libresapi/src/api/Operators.cpp b/libresapi/src/api/Operators.cpp deleted file mode 100644 index 97dff652d..000000000 --- a/libresapi/src/api/Operators.cpp +++ /dev/null @@ -1,133 +0,0 @@ -#include "Operators.h" - -namespace resource_api -{ - -StreamBase& operator <<(StreamBase& left, KeyValueReference ref) -{ - if(left.serialise()) - { - uint32_t num = ref.value; - uint8_t digit; - std::string str; - while(num >= 10) - { - digit = num % 10; - num = num / 10; - str = (char)(digit + '0') + str; - } - str = (char)(num + '0') + str; - left << makeKeyValueReference(ref.key, str); - } - else - { - std::string str; - left << makeKeyValueReference(ref.key, str); - uint32_t num = 0; - for(std::string::iterator sit = str.begin(); sit != str.end(); sit++) - { - uint32_t numbefore = num; - num = num * 10; - if(num < numbefore) - { - left.addErrorMsg("operator for uint32_t to std::string: oveflow"); - left.setError(); - } - else if((*sit)<'0' || (*sit)>'9') - { - left.addErrorMsg("operator for uint32_t to std::string: invalid characters"); - left.setError(); - } - else - { - // everything ok, can add value - num += (*sit) - '0'; - } - } - } - return left; -} - - - - -/* -template -StreamBase& operator <<(StreamBase& left, t_RsGenericIdType& id) -{ - if(left.serialise()) - { - left << id.toStdString(); - } - else - { - std::string str; - left << str; - } - return left; -} -*/ - -template -StreamBase& operator <<(StreamBase& left, ValueReference& ref) -{ - if(left.serialise()) - { - left << makeValueReference(ref.value.toStdString()); - } - else - { - std::string str; - left << makeValueReference(str); - T_ID id(str); - if(id.isNull) - { - left.setError(); - left.addErrorMsg("operator for retroshare id value: id is null\n"); - } - ref.value = id; - } - return left; -} - -// idea: have external operators which do the translation form different containers to basic operations -// better idea: take input iterators as arguments, will then work with everything which has an iterator -// but what about deserilisation? -template