diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..ff23b07 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,36 @@ +# Javascript Node CircleCI 2.0 configuration file +# +# Check https://circleci.com/docs/2.0/language-javascript/ for more details +# +version: 2 +jobs: + build: + docker: + # specify the version you desire here + - image: circleci/node:8.10 + + # Specify service dependencies here if necessary + # CircleCI maintains a library of pre-built images + # documented at https://circleci.com/docs/2.0/circleci-images/ + # - image: circleci/mongo:3.4.4 + + working_directory: ~/repo + + steps: + - checkout + + # Download and cache dependencies + - restore_cache: + keys: + - v1-dependencies-{{ checksum "yarn.lock" }} + # fallback to using the latest cache if no exact match is found + - v1-dependencies- + + - run: yarn install + + - save_cache: + paths: + - node_modules + key: v1-dependencies-{{ checksum "yarn.lock" }} + + - run: yarn test \ No newline at end of file diff --git a/.gitignore b/.gitignore index 15dfd69..0144959 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,3 @@ .DS_Store -server -client node_modules *.log \ No newline at end of file diff --git a/build.sh b/build.sh index 7588baf..30f3b79 100755 --- a/build.sh +++ b/build.sh @@ -1,5 +1,3 @@ -yarn setup - echo "building client..." cd client yarn --production=false diff --git a/client/.env.example b/client/.env.example new file mode 100644 index 0000000..2695add --- /dev/null +++ b/client/.env.example @@ -0,0 +1,4 @@ +REACT_APP_API_HOST=localhost +REACT_APP_API_PROTOCOL=http +REACT_APP_API_PORT=3001 +REACT_APP_COMMIT_SHA=some_sha \ No newline at end of file diff --git a/client/.gitignore b/client/.gitignore new file mode 100644 index 0000000..e2178dd --- /dev/null +++ b/client/.gitignore @@ -0,0 +1,9 @@ +node_modules +.DS_Store +dist +coverage +*.log +.env* +!.env.example +build/ +*sublime* \ No newline at end of file diff --git a/client/LICENSE b/client/LICENSE new file mode 100644 index 0000000..94da581 --- /dev/null +++ b/client/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2016-present darkwire.io + +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 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/client/README.md b/client/README.md new file mode 100644 index 0000000..076caff --- /dev/null +++ b/client/README.md @@ -0,0 +1,3 @@ +# Darkwire Client + +This is the client for [Darkwire](https://github.com/darkwire/darkwire.io). It requires [darkwire-server](../server) in order to run. \ No newline at end of file diff --git a/client/__mocks__/styles.js b/client/__mocks__/styles.js new file mode 100644 index 0000000..f053ebf --- /dev/null +++ b/client/__mocks__/styles.js @@ -0,0 +1 @@ +module.exports = {}; diff --git a/client/jsconfig.json b/client/jsconfig.json new file mode 100644 index 0000000..e9dfe87 --- /dev/null +++ b/client/jsconfig.json @@ -0,0 +1,8 @@ +{ + "compilerOptions": { + "baseUrl": "src", + "paths": { + "@/*":["src/*"] + } + } +} \ No newline at end of file diff --git a/client/package.json b/client/package.json new file mode 100644 index 0000000..4d73eb2 --- /dev/null +++ b/client/package.json @@ -0,0 +1,69 @@ +{ + "name": "darkwire-client", + "version": "2.0.0-beta.12", + "main": "index.js", + "contributors": [ + { + "name": "Daniel Seripap" + }, + { + "name": "Alan Friedman" + } + ], + "license": "MIT", + "dependencies": { + "autosize": "^4.0.2", + "bootstrap": "^4.3.1", + "clipboard": "^2.0.4", + "feather-icons": "^4.21.0", + "jquery": "^3.4.1", + "lodash": "^4.17.11", + "moment": "^2.24.0", + "node-sass": "^4.12.0", + "popper.js": "^1.15.0", + "query-string": "^6.5.0", + "randomcolor": "^0.5.4", + "react": "^16.8.6", + "react-dom": "^16.8.6", + "react-feather": "^1.1.6", + "react-linkify": "^0.2.2", + "react-modal": "^3.8.1", + "react-redux": "^7.0.3", + "react-router-dom": "^5.0.0", + "react-scripts": "3.0.0", + "react-simple-dropdown": "^3.2.3", + "redux": "^4.0.1", + "redux-thunk": "^2.3.0", + "sanitize-html": "^1.20.1", + "shortid": "^2.2.14", + "socket.io-client": "^2.2.0", + "tinycon": "^0.6.8", + "webcrypto-shim": "^0.1.4" + }, + "scripts": { + "start": "react-scripts start", + "build": "REACT_APP_COMMIT_SHA=`git rev-parse --short HEAD` react-scripts build", + "test": "react-scripts test", + "eject": "react-scripts eject" + }, + "eslintConfig": { + "extends": "react-app" + }, + "browserslist": { + "production": [ + ">0.2%", + "not dead", + "not op_mini all" + ], + "development": [ + "last 1 chrome version", + "last 1 firefox version", + "last 1 safari version" + ] + }, + "devDependencies": { + "enzyme": "^3.9.0", + "enzyme-adapter-react-16": "^1.12.1", + "enzyme-to-json": "^3.3.5" + } +} diff --git a/client/public/favicon.ico b/client/public/favicon.ico new file mode 100644 index 0000000..359faae Binary files /dev/null and b/client/public/favicon.ico differ diff --git a/client/public/index.html b/client/public/index.html new file mode 100644 index 0000000..44f94b9 --- /dev/null +++ b/client/public/index.html @@ -0,0 +1,41 @@ + + +
+ + + + + + + + + + +Client + Commit SHA: {process.env.REACT_APP_COMMIT_SHA}
+Server + Commit SHA: {this.props.serverSHA}
+This software uses the Web Cryptography API to + encrypt data which is transferred using secure WebSockets. + Messages are never stored on a server or sent over the wire in plain-text.
+We believe in privacy and transparency. + View the source code and documentation on GitHub.
+To report any content that violates our Acceptable Use Policy below, email us at abuse[at]darkwire.io or submit the room ID below to report anonymously.
+ +This Acceptable Use Policy (this “Policy”) describes prohibited uses of the web services offered by Darkwire and its affiliates (the “Services”) and the website located at https://darkwire.io (the “Darkwire Site”). The examples described in this Policy are not exhaustive. We may modify this Policy at any time by posting a revised version on the Darkwire Site. By using the Services or accessing the Darkwire Site, you agree to the latest version of this Policy. If you violate the Policy or authorize or help others to do so, we may suspend or terminate your use of the Services.
+ + No Illegal, Harmful, or Offensive Use or Content +You may not use, or encourage, promote, facilitate or instruct others to use, the Services or Darkwire Site for any illegal, harmful, fraudulent, infringing or offensive use, or to transmit, store, display, distribute or otherwise make available content that is illegal, harmful, fraudulent, infringing or offensive. Prohibited activities or content include:
+ +WARNING: Darkwire does not mask IP addresses nor can verify the integrity of parties recieving messages. + Proceed with caution and always confirm recipients beforre starting a chat session.
+Please also note that ALL CHATROOMS are public. + Anyone can guess your room URL. If you need a more-private room, use the lock feature or set the URL manually by entering a room ID after "darkwire.io/". +
+Last updated: December 11, 2017
+Please read these Terms of Service ("Terms", "Terms of Service") carefully before using the https://darkwire.io website (the "Service") operated by Darkwire ("us", "we", or "our").
+Your access to and use of the Service is conditioned on your acceptance of and compliance with these Terms. These Terms apply to all visitors, users and others who access or use the Service.
+By accessing or using the Service you agree to be bound by these Terms. If you disagree with any part of the terms then you may not access the Service.
+ Links To Other Web Sites +Our Service may contain links to third-party web sites or services that are not owned or controlled by Darkwire.
+Darkwire has no control over, and assumes no responsibility for, the content, privacy policies, or practices of any third party web sites or services. You further acknowledge and agree that Darkwire shall not be responsible or liable, directly or indirectly, for any damage or loss caused or alleged to be caused by or in connection with use of or reliance on any such content, goods or services available on or through any such web sites or services.
+We strongly advise you to read the terms and conditions and privacy policies of any third-party web sites or services that you visit.
+ Termination +We may terminate or suspend access to our Service immediately, without prior notice or liability, for any reason whatsoever, including without limitation if you breach the Terms.
+All provisions of the Terms which by their nature should survive termination shall survive termination, including, without limitation, ownership provisions, + warranty disclaimers, indemnity and limitations of liability.
+ Governing Law +These Terms shall be governed and construed in accordance with the laws of New York, United States, without regard to its conflict of law provisions.
+Our failure to enforce any right or provision of these Terms will not be considered a waiver of those rights. If any provision of these Terms is held to be +invalid or unenforceable by a court, the remaining provisions of these Terms will remain in effect. These Terms constitute the entire agreement between us +regarding our Service, and supersede and replace any prior agreements we might have between us regarding the Service.
+ No Warranties; Exclusion of Liability; Indemnification +OUR WEBSITE IS OPERATED BY Darkwire ON AN "AS IS," "AS AVAILABLE" BASIS, WITHOUT REPRESENTATIONS OR WARRANTIES OF ANY KIND. TO THE FULLEST EXTENT PERMITTED BY LAW, Darkwire SPECIFICALLY DISCLAIMS ALL WARRANTIES AND CONDITIONS OF ANY KIND, INCLUDING ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NONINFRINGEMENT FOR OUR WEBSITE AND ANY CONTRACTS AND SERVICES YOU PURCHASE THROUGH IT. Darkwire SHALL NOT HAVE ANY LIABILITY OR RESPONSIBILITY FOR ANY ERRORS OR OMISSIONS IN THE CONTENT OF OUR WEBSITE, FOR CONTRACTS OR SERVICES SOLD THROUGH OUR WEBSITE, FOR YOUR ACTION OR INACTION IN CONNECTION WITH OUR WEBSITE OR FOR ANY DAMAGE TO YOUR COMPUTER OR DATA OR ANY OTHER DAMAGE YOU MAY INCUR IN CONNECTION WITH OUR WEBSITE. YOUR USE OF OUR WEBSITE AND ANY CONTRACTS OR SERVICES ARE AT YOUR OWN RISK. IN NO EVENT SHALL EITHER Darkwire OR THEIR AGENTS BE LIABLE FOR ANY DIRECT, INDIRECT, PUNITIVE, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR IN ANY WAY CONNECTED WITH THE USE OF OUR WEBSITE, CONTRACTS AND SERVICES PURCHASED THROUGH OUR WEBSITE, THE DELAY OR INABILITY TO USE OUR WEBSITE OR OTHERWISE ARISING IN CONNECTION WITH OUR WEBSITE, CONTRACTS OR RELATED SERVICES, WHETHER BASED ON CONTRACT, +TORT, STRICT LIABILITY OR OTHERWISE, EVEN IF ADVISED OF THE POSSIBILITY OF ANY SUCH DAMAGES. IN NO EVENT SHALL Darkwire’s LIABILITY FOR ANY DAMAGE CLAIM EXCEED THE AMOUNT PAID BY YOU TO Darkwire FOR THE TRANSACTION GIVING RISE TO SUCH DAMAGE CLAIM.
+SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THE ABOVE EXCLUSION MAY NOT APPLY TO YOU.
+WITHOUT LIMITING THE FOREGOING, Darkwire DO NOT REPRESENT OR WARRANT THAT THE INFORMATION ON THE WEBITE IS ACCURATE, COMPLETE, RELIABLE, USEFUL, TIMELY OR CURRENT OR THAT OUR WEBSITE WILL OPERATE WITHOUT INTERRUPTION OR ERROR.
+YOU AGREE THAT ALL TIMES, YOU WILL LOOK TO ATTORNEYS FROM WHOM YOU PURCHASE SERVICES FOR ANY CLAIMS OF ANY NATURE, INCLUDING LOSS, DAMAGE, OR WARRANTY. Darkwire AND THEIR RESPECTIVE AFFILIATES MAKE NO REPRESENTATION OR GUARANTEES ABOUT ANY CONTRACTS AND SERVICES OFFERED THROUGH OUR WEBSITE.
+Darkwire MAKES NO REPRESENTATION THAT CONTENT PROVIDED ON OUR WEBSITE, CONTRACTS, OR RELATED SERVICES ARE APPLICABLE OR APPROPRIATE FOR USE IN ALL +JURISDICTIONS.
+ Indemnification +You agree to defend, indemnify and hold Darkwire harmless from and against any and all claims, damages, costs and expenses, including attorneys' fees, arising +from or related to your use of our Website or any Contracts or Services you purchase through it.
+ Changes +We reserve the right, at our sole discretion, to modify or replace these Terms at any time. If a revision is material we will try to provide at least 30 days notice prior to any new terms taking effect. What constitutes a material change will be determined at our sole discretion.
+By continuing to access or use our Service after those revisions become effective, you agree to be bound by the revised terms. If you do not agree to the new +terms, please stop using the Service.
+ Contact Us +If you have any questions about these Terms, please contact us at hello[at]darkwire.io.
+Questions/comments? Email us at hello[at]darkwire.io
+Found a bug or want a new feature? Open a ticket on Github.
+Darkwire is maintained and hosted by two developers with full-time jobs. If you get some value + from this service we would appreciate any donation you can afford. We use these funds for + server and DNS costs. Thank you! +
+ Bitcoin +189sPnHGcjP5uteg2UuNgcJ5eoaRAP4Bw4
+ Ethereum +0xD6e3D881036903999E2c0480fe9d2c20600C1c28
+ Litecoin +LUViQeSggBBtYoN2qNtXSuxYoRMzRY8CSX
+ PayPal: +The person who created the room is the room owner and has special privileges, like the ability to lock and unlock the room. + If the owner leaves the room, the second person to join assumes ownership. If they leave, the third person becomes owner, and so on. + The room owner has a star icon next to their username in the participants dropdown. +
+If you are the room owner, you can lock and unlock the room by clicking the lock icon in the nav bar. When a room is locked, no other participants will be able to join.
+The following slash commands are available:
+Others can join this room using the following URL:
+