From 6f81285c36cc5a16f82462ad4731a6967359478b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 9 May 2023 22:10:59 +0000 Subject: [PATCH 01/81] Bump json5 from 1.0.1 to 1.0.2 Bumps [json5](https://github.com/json5/json5) from 1.0.1 to 1.0.2. - [Release notes](https://github.com/json5/json5/releases) - [Changelog](https://github.com/json5/json5/blob/main/CHANGELOG.md) - [Commits](https://github.com/json5/json5/compare/v1.0.1...v1.0.2) --- updated-dependencies: - dependency-name: json5 dependency-type: indirect ... Signed-off-by: dependabot[bot] --- package-lock.json | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/package-lock.json b/package-lock.json index b40e7d63..584d14c3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -545,9 +545,9 @@ "integrity": "sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w==" }, "node_modules/@types/react": { - "version": "18.0.9", - "resolved": "https://registry.npmjs.org/@types/react/-/react-18.0.9.tgz", - "integrity": "sha512-9bjbg1hJHUm4De19L1cHiW0Jvx3geel6Qczhjd0qY5VKVE2X5+x77YxAepuCwVh4vrgZJdgEJw48zrhRIeF4Nw==", + "version": "17.0.59", + "resolved": "https://registry.npmjs.org/@types/react/-/react-17.0.59.tgz", + "integrity": "sha512-gSON5zWYIGyoBcycCE75E9+r6dCC2dHdsrVkOEiIYNU5+Q28HcBAuqvDuxHcCbMfHBHdeT5Tva/AFn3rnMKE4g==", "dependencies": { "@types/prop-types": "*", "@types/scheduler": "*", @@ -2991,9 +2991,9 @@ "dev": true }, "node_modules/json5": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", - "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", "dev": true, "dependencies": { "minimist": "^1.2.0" @@ -5119,9 +5119,9 @@ "integrity": "sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w==" }, "@types/react": { - "version": "18.0.9", - "resolved": "https://registry.npmjs.org/@types/react/-/react-18.0.9.tgz", - "integrity": "sha512-9bjbg1hJHUm4De19L1cHiW0Jvx3geel6Qczhjd0qY5VKVE2X5+x77YxAepuCwVh4vrgZJdgEJw48zrhRIeF4Nw==", + "version": "17.0.59", + "resolved": "https://registry.npmjs.org/@types/react/-/react-17.0.59.tgz", + "integrity": "sha512-gSON5zWYIGyoBcycCE75E9+r6dCC2dHdsrVkOEiIYNU5+Q28HcBAuqvDuxHcCbMfHBHdeT5Tva/AFn3rnMKE4g==", "requires": { "@types/prop-types": "*", "@types/scheduler": "*", @@ -7048,9 +7048,9 @@ "dev": true }, "json5": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", - "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", "dev": true, "requires": { "minimist": "^1.2.0" From df52107ff66e08a7fcbfb4950066ad8332f166a3 Mon Sep 17 00:00:00 2001 From: xbdm Date: Thu, 11 May 2023 17:57:11 -0400 Subject: [PATCH 02/81] Update README.md --- README.md | 176 ++++++------------------------------------------------ 1 file changed, 17 insertions(+), 159 deletions(-) diff --git a/README.md b/README.md index f795c0fe..6df966f7 100644 --- a/README.md +++ b/README.md @@ -1,171 +1,29 @@ -

- - -

+# hat.sh +Encrypt and Decrypt files securely in your browser. -

hat.sh

+## Security Audits: -
+- [Internet.ml](https://internet.nl/site/hat.whateveritworks.org/2060148/) +- [Mozilla.org](https://observatory.mozilla.org/) +- [ImmuniWeb](https://www.immuniweb.com/ssl/hat.whateveritworks.org/a8FxuGr6/) +- [HSTS Preload](https://hstspreload.org/) +- [SSL Labs](https://www.ssllabs.com/ssltest/analyze.html?d=hat.whateveritworks.org) +- [Security Headers](https://securityheaders.com/?q=hat.whateveritworks.org&hide=on&followRedirects=on) -[![Status](https://img.shields.io/badge/status-active-success.svg)](#) -[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](#) -[![CodeQL](https://github.com/sh-dv/hat.sh/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/sh-dv/hat.sh/actions/workflows/codeql-analysis.yml) -[![Node.js CI](https://github.com/sh-dv/hat.sh/actions/workflows/node.js.yml/badge.svg?branch=master)](https://github.com/sh-dv/hat.sh/actions/workflows/node.js.yml) -[![Snyk](https://github.com/sh-dv/hat.sh/actions/workflows/snyk.yml/badge.svg)](https://github.com/sh-dv/hat.sh/actions/workflows/snyk.yml) -
+## Usage: ---- +1. Buy [Hetzner.com](https://hetzner.com) it's 100% renewal hardware and you get affordable dedicated servers, and you also help save the world. -[Hat.sh](https://hat.sh) is a web app that provides secure local file encryption in the browser. It's fast, secure, and uses modern cryptographic algorithms with chunked AEAD stream encryption/decryption. +2. Get [Cloudflare](https://cloudflare.com) it's carbon renewal and you help save the world. -V2 of hat.sh introduced memory efficient in-browser large file chunked encryption using streams with libsodium. +2. ```apt install git``` -## Usage +3. ```git clone https://github.com/WhateverItWorks/my-uptime-kuma-docker-compose.git status``` -![how-to-use-gif](https://i.imgur.com/NbAZOgP.gif) +4. ```nano docker-compose.yml``` -
+5. ```docker-compose up -d``` -## Features -### Security - -- XChaCha20-Poly1305 - for symmetric encryption. -- Argon2id - for password-based key derivation. -- X25519 - for key exchange. - -The libsodium library is used for all cryptographic algorithms. - -### Privacy - -- The app runs locally in your browser. -- No data is ever collected or sent to anyone.​ - -### Functionality - -- Secure multiple file encryption/decryption with passwords or keys. -- Secure random password generation. -- Asymmetric key pair generation. -- Authenticated key exchange. -- Password strength estimation. - -
- -## Offline Use - -The app can be easily self hosted, please follow the [installation](https://hat.sh/about/#installation) instructions. - -
- -## Browser Compatibility - -We officially support the last two versions of every major browser. Specifically, we test on the following - -- **Chrome** on Windows, macOS, and Linux , Android -- **Firefox** on Windows, macOS, and Linux -- **Safari** on iOS and macOS -- **Edge** on Windows - -Safari and Mobile browsers are limited to single 1GB files, due to lack of support with server-worker fetch api. - -
- -## Official running instances of the app - -| # | URL | -| --- | ----------------------------------------- | -| 1 | [hat.sh](https://hat.sh/) | -| 2 | [hat.now.sh](https://hat.now.sh/) | -| 2 | [hat.vercel.app](https://hat.vercel.app/) | - -
- -## Donations - -The project is maintained in my free time. Donations of any size are appreciated : - -
- -
- -Crypto - - - - - - - - - - - - - - - - - - - - - - -
CoinAddress
Monero - 84zQq4Xt7sq8cmGryuvWsXFMDvBvHjWjnMQXZWQQRXjB1TgoZWS9zBdNcYL7CRbQBqcDdxr4RtcvCgApmQcU6SemVXd7RuG -
Bitcoinbc1qlfnq8nu2k84h3jth7a27khaq0p2l2gvtyl2dv6
Ethereum0xF6F204B044CC73Fa90d7A7e4C5EC2947b83b917e
- -
- - Kofi - -[https://ko-fi.com/shdvapps](https://ko-fi.com/shdvapps) - -Open Collective - -[https://opencollective.com/hatsh](https://opencollective.com/hatsh) - -
- -
-
- -## Social - -- [Reddit](https://reddit.com/r/hatsh) - -
- -## Acknowledgements - -- Everyone who supported the project. -- [Samuel-lucas6](https://github.com/samuel-lucas6) from the [Kryptor](https://github.com/samuel-lucas6/Kryptor) project for being helpful and doing a lot of beta testing. -- [stophecom](https://github.com/stophecom) from the [Scrt.link](https://scrt.link/) project for translating to German. -- [bbouille](https://github.com/bbouille) for translating to French. -- [qaqland](https://github.com/qaqland) for translating to Chinese. -- [Ser-Bul](https://github.com/Ser-Bul) for translating to Russian. -- [matteotardito](https://github.com/matteotardito) for translating to Italian. -- [t0mzSK](https://github.com/t0mzSK) for translating to Slovak. -- [Xurdejl](https://github.com/Xurdejl) for translating to Spanish. -- [Franatrtur](https://github.com/Franatrtur) for translating to Czech. -- [darkao](https://github.com/darkao) for translating to Turkish. -- [Frank7sun](https://github.com/Frank7sun) for translating to Japanese. - -
- -## Credits - -[libsodium.js](https://github.com/jedisct1/libsodium.js) - -[next.js](https://nextjs.org/) - -[material-ui](https://material-ui.com/) - -
- -## License - -[Copyright (c) 2022 sh-dv](https://github.com/sh-dv/hat.sh/blob/master/LICENSE) +```http://localhost:3001``` From f2907db66c8707aa71f780c797bc8a86eac191c6 Mon Sep 17 00:00:00 2001 From: xbdm Date: Thu, 11 May 2023 18:13:32 -0400 Subject: [PATCH 03/81] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6df966f7..51103ed3 100644 --- a/README.md +++ b/README.md @@ -19,11 +19,11 @@ Encrypt and Decrypt files securely in your browser. 2. ```apt install git``` -3. ```git clone https://github.com/WhateverItWorks/my-uptime-kuma-docker-compose.git status``` +3. ```git clone https://github.com/WhateverItWorks/my-hat.sh-docker-compose.git hat``` 4. ```nano docker-compose.yml``` 5. ```docker-compose up -d``` -```http://localhost:3001``` +```http://localhost:3991``` From ca0078dc66fac57114459e1c4094e84b07b57c12 Mon Sep 17 00:00:00 2001 From: xbdm Date: Thu, 11 May 2023 18:14:20 -0400 Subject: [PATCH 04/81] oops --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 51103ed3..74733bbc 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ Encrypt and Decrypt files securely in your browser. 4. ```nano docker-compose.yml``` -5. ```docker-compose up -d``` +5. ```docker-compose up -d --build``` ```http://localhost:3991``` From 5df0839b4c40269df2bd974e9435dd0cb7172d3e Mon Sep 17 00:00:00 2001 From: xbdm Date: Thu, 11 May 2023 18:18:09 -0400 Subject: [PATCH 05/81] Update docker-compose.yml --- docker-compose.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 38ec428b..d1534a90 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,4 @@ -version: "3" +version: "3.7" services: web: @@ -6,7 +6,11 @@ services: build: context: ./ dockerfile: Dockerfile + security_opt: + - no-new-privileges:true + cap_drop: + - ALL ports: - - 3991:80 + - '127.0.0.1:3991:80' volumes: - - ./src:/usr/share/nginx/html/out \ No newline at end of file + - ./src:/usr/share/nginx/html/out From c3bd62b773c712699b9036393e0148207df33f8b Mon Sep 17 00:00:00 2001 From: xbdm Date: Thu, 11 May 2023 18:22:24 -0400 Subject: [PATCH 06/81] Update docker-compose.yml --- docker-compose.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index d1534a90..264352b3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,6 +10,10 @@ services: - no-new-privileges:true cap_drop: - ALL + cap_add: + - CHOWN + - SETGID + - SETUID ports: - '127.0.0.1:3991:80' volumes: From fea97e52bb48bd7fa867679323cf4b7a0c20c65b Mon Sep 17 00:00:00 2001 From: xbdm Date: Thu, 11 May 2023 18:27:43 -0400 Subject: [PATCH 07/81] Create nginx.conf --- nginx.conf | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 nginx.conf diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 00000000..11cb5b91 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,42 @@ +server { + listen 443 ssl http2; + listen [::]:443 ssl http2; + + server_name changethis; + + ssl_certificate /etc/letsencrypt/live/changethis/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/changethis/privkey.pem; + ssl_trusted_certificate /etc/letsencrypt/live/changethis/chain.pem; + include /etc/letsencrypt/options-ssl-nginx.conf; + ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; + ssl_stapling on; + ssl_stapling_verify on; + + add_header strict_sni on; + add_header strict_sni_header on; + add_header Strict-Transport-Security "max-age=31536000" always; # managed by Certbot + add_header Content-Security-Policy upgrade-insecure-requests; + add_header X-XSS-Protection "1; mode=block"; + add_header X-Frame-Options "DENY"; + add_header Clear-Site-Data "cookies"; + add_header X-Content-Type-Options nosniff; + add_header Referrer-Policy "strict-origin"; + add_header Permissions-Policy "geolocation=(),midi=(),sync-xhr=(),microphone=(),camera=(),magnetometer=(),gyroscope=(),fullscreen=(self),payment=()"; + resolver 1.1.1.1; + + access_log /dev/null; + error_log /dev/null; + + location / { + + proxy_pass http://localhost:3991; + } + +} + +server { + listen 80; + listen [::]:80; + server_name changethis; + return 301 https://changethis$request_uri; +} From 88e87fe07ca141170e2a252f7a31e99ea98dfd7d Mon Sep 17 00:00:00 2001 From: xbdm Date: Sun, 18 Jun 2023 20:56:51 -0400 Subject: [PATCH 08/81] Delete about.js useless info --- pages/about.js | 456 ------------------------------------------------- 1 file changed, 456 deletions(-) delete mode 100644 pages/about.js diff --git a/pages/about.js b/pages/about.js deleted file mode 100644 index df0028c9..00000000 --- a/pages/about.js +++ /dev/null @@ -1,456 +0,0 @@ -/* eslint-disable @next/next/no-html-link-for-pages */ -/* eslint-disable @next/next/no-img-element */ -import fs from "fs"; -import path from "path"; -import { marked } from "marked"; -import { useState, useEffect } from "react"; -import PropTypes from "prop-types"; -import AppBar from "@material-ui/core/AppBar"; -import CssBaseline from "@material-ui/core/CssBaseline"; -import Divider from "@material-ui/core/Divider"; -import Drawer from "@material-ui/core/Drawer"; -import Hidden from "@material-ui/core/Hidden"; -import IconButton from "@material-ui/core/IconButton"; -import List from "@material-ui/core/List"; -import ListItem from "@material-ui/core/ListItem"; -import ListItemIcon from "@material-ui/core/ListItemIcon"; -import ListItemText from "@material-ui/core/ListItemText"; -import MenuIcon from "@material-ui/icons/Menu"; -import Toolbar from "@material-ui/core/Toolbar"; -import Typography from "@material-ui/core/Typography"; -import { makeStyles, useTheme } from "@material-ui/core/styles"; -import Link from "next/link"; -import Container from "@material-ui/core/Container"; -import Button from "@material-ui/core/Button"; -import GitHubIcon from "@material-ui/icons/GitHub"; -import Footer from "../src/components/Footer"; -import BookmarkBorderIcon from "@material-ui/icons/BookmarkBorder"; -import StarsIcon from "@material-ui/icons/Stars"; -import GetAppIcon from "@material-ui/icons/GetApp"; -import EmojiObjectsIcon from "@material-ui/icons/EmojiObjects"; -import ErrorOutlineIcon from "@material-ui/icons/ErrorOutline"; -import VerifiedUserIcon from "@material-ui/icons/VerifiedUser"; -import MenuBookIcon from "@material-ui/icons/MenuBook"; -import LiveHelpIcon from "@material-ui/icons/LiveHelp"; -import HistoryIcon from "@material-ui/icons/History"; -import prism from "prismjs"; -import Settings from "../src/components/Settings"; -import { ThemeProvider } from "@material-ui/styles"; -import { Theme, checkTheme } from "../src/config/Theme"; -import locales from "../locales/locales"; -import { getTranslations as t } from "../locales"; -const drawerWidth = 240; - -marked.setOptions({ - highlight: function (code, lang) { - if (prism.languages[lang]) { - return prism.highlight(code, prism.languages[lang], lang); - } else { - return code; - } - }, -}); - -const useStyles = makeStyles((theme) => ({ - root: { - backgroundColor: Theme.palette.alabaster.main, - minHeight: "100vh", - }, - drawer: { - [theme.breakpoints.down("lg")]: { - display: "none", - }, - }, - appBar: { - backgroundColor: Theme.palette.alabaster.main, - [theme.breakpoints.up("sm")]: { - width: "100%", - marginLeft: drawerWidth, - zIndex: theme.zIndex.drawer - 1, - }, - }, - - logo: { - flexGrow: 1, - marginTop: 5, - }, - button: { - textTransform: "none", - color: Theme.palette.diamondBlack.main, - }, - - menuButton: { - marginRight: theme.spacing(2), - [theme.breakpoints.up("xl")]: { - display: "none", - }, - }, - // necessary for content to be below app bar - toolbar: theme.mixins.toolbar, - drawerPaper: { - width: drawerWidth, - }, - content: { - padding: theme.spacing(3), - marginTop: "20px", - - "& h1": { - marginTop: 20, - color: Theme.palette.mineShaft.main, - borderRadius: "8px", - paddingBottom: 15, - "& a": { - textDecoration: "none", - fontWeight: "bold", - fontSize: 40, - letterSpacing: "1px", - borderBottom: "1px solid #000", - }, - }, - - "& h2": { - color: Theme.palette.mineShaft.main, - fontSize: "26px", - paddingTop: 20, - paddingBottom: 20, - fontWeight: "700", - }, - - "& h3": { - color: Theme.palette.mineShaft.main, - fontSize: "24px", - paddingTop: 20, - paddingBottom: 20, - fontWeight: "700", - }, - - "& a": { - color: Theme.palette.mineShaft.main, - }, - - "& p": { - fontSize: "17px", - color: Theme.palette.mineShaft.main, - lineHeight: 2, - "& code": { - backgroundColor: "#f1f1f1", - wordWrap: "break-word", - fontFamily: "inherit", - paddingRight: 7, - paddingLeft: 7, - borderRadius: "3px", - }, - }, - - "& li": { - padding: 2.5, - fontSize: "18px", - color: Theme.palette.mineShaft.main, - "& a": { - textDecoration: "none", - letterSpacing: "0.5px", - borderBottom: "1px solid #000", - }, - }, - - "& hr": { - backgroundColor: Theme.palette.mercury.main, - border: "none", - height: "1.5px", - marginTop: 20, - marginBottom: 30, - }, - - "& ul": { - paddingLeft: 25, - paddingBottom: 15, - fontSize: "16px", - "& code": { - backgroundColor: "#f1f1f1", - wordWrap: "break-word", - fontFamily: "inherit", - paddingRight: 7, - paddingLeft: 7, - borderRadius: "3px", - }, - }, - - "& ol": { - paddingLeft: 25, - paddingBottom: 15, - fontSize: "16px", - "& code": { - backgroundColor: "#f1f1f1", - wordWrap: "break-word", - fontFamily: "inherit", - paddingRight: 7, - paddingLeft: 7, - borderRadius: "3px", - }, - }, - - "& pre": { - background: "rgb(235, 235, 235)", - padding: "13px", - marginTop: "-5px", - marginBottom: "20px", - lineHeight: "1.3", - fontSize: "14px", - borderRadius: "3px", - overflow: "auto", - "& code": { - color: Theme.palette.mineShaft.main, - }, - }, - - "& .codeBox": { - "& pre": { - background: "#2E3440", - "& code": { - color: "#f8f8f2", - }, - }, - }, - - "& blockquote": { - backgroundColor: "#f1f1f1", - marginTop: "15px", - color: "#535a60", - borderLeft: "5px solid #c8ccd0", - marginBottom: 20, - "& p": { - padding: 10, - }, - }, - }, -})); - -export default function About(props) { - const classes = useStyles(); - const theme = useTheme(); - const [mobileOpen, setMobileOpen] = useState(false); - const [docContent, setDocContent] = useState(""); - - useEffect(() => { - checkTheme(); - }, []); - - useEffect(() => { - const getLocale = () => { - if (typeof window !== "undefined") { - let language = window.localStorage.getItem("language"); - let userLanguage = navigator.language.replace("-", "_"); - return language ? language : locales[userLanguage] ? userLanguage : "en_US"; - } - }; - - let languages = props.docs; - let langFilter = { lang: getLocale() }; - let langResult; - - languages.forEach(function (obj) { - let matches = true; - for (let key in langFilter) { - if (langFilter[key] !== obj[key]) { - matches = false; - } - } - if (matches) { - langResult = obj; - } else { - //default en docs - setDocContent(languages[0].content); - } - }); - - const getContent = async () => { - for (const key in langResult) { - if (key == "content") { - setDocContent(langResult[key]); - } - } - }; - - getContent(); - }, [props.docs]); - - const handleDrawerToggle = () => { - setMobileOpen(!mobileOpen); - }; - - const handleClose = () => { - mobileOpen ? setMobileOpen(false) : null; - }; - - const drawer = ( -
-
- - - - - - - - - - {[ - { name: t("introduction"), icon: }, - { name: t("features"), icon: }, - { name: t("installation"), icon: }, - { name: t("usage"), icon: }, - { name: t("limitations"), icon: }, - { name: t("best_practices"), icon: }, - { name: t("faq"), icon: }, - { name: t("technical_details"), icon: }, - { name: t("changelog"), icon: }, - ].map((text, index) => ( -
- - - {text.icon} - - - -
- ))} -
-
- ); - - return ( - -
- - - - - - - - - - - - logo - - - - - - - - - - - - - - - -
- -
- -
-
- -
- -
-
-
- ); -} - -About.propTypes = { - /** - * Injected by the documentation to work in an iframe. - * You won't need it on your project. - */ - window: PropTypes.func, -}; - -export async function getStaticProps() { - // Get files from the posts dir - - let docs = []; - - { - Object.entries(locales).map(([code, name]) => { - let docFilePath = `locales/${code}/docs.md`; - let docFile; - try { - docFile = fs.readFileSync( - path.join(docFilePath), - "utf-8" - ); - } catch (error) { - docFile = fs.readFileSync( - path.join(`locales/en_US/docs.md`), - "utf-8" - ); - } - - let docStructure = { lang: code, content: docFile }; - docs.push(docStructure); - }); - } - - const changelog = fs.readFileSync("CHANGELOG.md", "utf-8"); - - return { - props: { - docs: docs, - changelog: changelog, - }, - }; -} From 29aafc037e98e6cc500e8f6c0ec4e52c39860d50 Mon Sep 17 00:00:00 2001 From: xbdm Date: Sun, 18 Jun 2023 21:01:24 -0400 Subject: [PATCH 09/81] remove about --- locales/en_US/index.js | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/locales/en_US/index.js b/locales/en_US/index.js index e01ff81c..d8119745 100644 --- a/locales/en_US/index.js +++ b/locales/en_US/index.js @@ -2,21 +2,8 @@ const en_US = { language_name: "English", // Menu - sub_title: "Simple, fast, secure client-side file encryption", - home: "Home", - about: "About", - - // About page menu - introduction: "Introduction", - features: "Features", - installation: "Installation", - usage: "Usage", - limitations: "Limitations", - best_practices: "Best-Practices", - faq: "FAQ", - technical_details: "Technical-Details", - changelog: "Changelog", - donation_message: "Love hat.sh? You can donate to support the project.", + sub_title: "Simple, Fast, & Secure Client-Side File Encryption In The Browser", + home: "Home" // Settings settings: "Settings", @@ -182,4 +169,4 @@ const en_US = { }; -export default en_US; \ No newline at end of file +export default en_US; From aa0b1e7da9aff0f73f9dffbb80cb0f56e0ba3d25 Mon Sep 17 00:00:00 2001 From: xbdm Date: Sun, 18 Jun 2023 21:03:27 -0400 Subject: [PATCH 10/81] hotfix --- locales/en_US/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locales/en_US/index.js b/locales/en_US/index.js index d8119745..9678fc07 100644 --- a/locales/en_US/index.js +++ b/locales/en_US/index.js @@ -3,7 +3,7 @@ const en_US = { // Menu sub_title: "Simple, Fast, & Secure Client-Side File Encryption In The Browser", - home: "Home" + home: "Home", // Settings settings: "Settings", From 443aaf38373ef60ea8f666e03e1abd0fef9906f7 Mon Sep 17 00:00:00 2001 From: xbdm Date: Sun, 18 Jun 2023 21:05:07 -0400 Subject: [PATCH 11/81] remove about in cs --- locales/cs_CS/index.js | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/locales/cs_CS/index.js b/locales/cs_CS/index.js index f9457633..045d2ee3 100644 --- a/locales/cs_CS/index.js +++ b/locales/cs_CS/index.js @@ -4,19 +4,6 @@ const cs_CS = { // Menu sub_title: "Jednoduché, rychlé, bezpečné šifrování souborů v prohlížeči", //client-side replaced by "in browser", other translations would sound extremely weird home: "Domů", - about: "Více", - - // About page menu - introduction: "Úvod", - features: "Vlastnosti", - installation: "Instalace", - usage: "Používání", - limitations: "Omezení", - best_practices: "Správné používání", - faq: "FAQ", - technical_details: "Technické detaily", - changelog: "Záznam změn", - donation_message: "Líbí se Vám hat.sh? Můžete projekt podpořit.", // Settings settings: "Nastvení", From 5b308eb19d598b1746e4012b13fb59495a5c0036 Mon Sep 17 00:00:00 2001 From: xbdm Date: Sun, 18 Jun 2023 21:05:38 -0400 Subject: [PATCH 12/81] remove about in de --- locales/de_DE/index.js | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/locales/de_DE/index.js b/locales/de_DE/index.js index fa0380f6..03647fe9 100644 --- a/locales/de_DE/index.js +++ b/locales/de_DE/index.js @@ -4,19 +4,6 @@ const de_DE = { // Menu sub_title: "Einfache, schnelle, sichere Client-seitige Dateiverschlüsselung", home: "Startseite", - about: "Über", - - // About page menu - introduction: "Einführung", - features: "Merkmale", - installation: "Installation", - usage: "Verwendung", - limitations: "Beschränkungen", - best_practices: "Best Practices", - faq: "FAQ", - technische_details: "Technische Details", - changelog: "Changelog", - donation_message: "Liebst du hat.sh? Unterstütze das Projekt mit einer Spende.", // Settings settings: "Einstellungen", From 54d73b0c896fdb765a40f51b39ac8c44799ad167 Mon Sep 17 00:00:00 2001 From: xbdm Date: Sun, 18 Jun 2023 21:06:07 -0400 Subject: [PATCH 13/81] remove about in es --- locales/es_ES/index.js | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/locales/es_ES/index.js b/locales/es_ES/index.js index ab35853a..86ca4fad 100644 --- a/locales/es_ES/index.js +++ b/locales/es_ES/index.js @@ -4,19 +4,6 @@ const es_ES = { // Menu sub_title: "Cifrado de archivos del lado del cliente sencillo, rápido y seguro", home: "Inicio", - about: "Acerca de", - - // About page menu - introduction: "Introducción", - features: "Características", - installation: "Instalación", - usage: "Uso", - limitations: "Limitaciones", - best_practices: "Mejores practicas", - faq: "FAQ", - technical_details: "Detalles técnicos", - changelog: "Registro de cambios", - donation_message: "¿Te encanta hat.sh? Puedes donar para apoyar el proyecto.", // Settings settings: "Ajustes", @@ -182,4 +169,4 @@ const es_ES = { }; -export default es_ES; \ No newline at end of file +export default es_ES; From 9d5b29e5d6e790d5dd09dab2180616906efe220e Mon Sep 17 00:00:00 2001 From: xbdm Date: Sun, 18 Jun 2023 21:06:38 -0400 Subject: [PATCH 14/81] remove about in fr --- locales/fr_FR/index.js | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/locales/fr_FR/index.js b/locales/fr_FR/index.js index 661f2dfc..030920d6 100644 --- a/locales/fr_FR/index.js +++ b/locales/fr_FR/index.js @@ -4,19 +4,6 @@ const fr_FR = { // Menu sub_title: "Chiffrement de fichier simple, rapide et sécurisé", home: "accueil", - about: "à propos", - - // About page menu - introduction: "Introduction", - features: "Fonctionnalités", - installation: "Installation", - usage: "Utilisation", - limitations: "Limitations", - best_practices: "Bonnes pratiques", - faq: "FAQ", - technical_details: "Détails techniques", - changelog: "Journaux", - donation_message: "Vous amez hat.sh? Vous pouvez donner pour supporter le projet.", // Settings settings: "Paramètre", From 214792d400ae7bf2a59f8e01887be3c2f92b70aa Mon Sep 17 00:00:00 2001 From: xbdm Date: Sun, 18 Jun 2023 21:07:10 -0400 Subject: [PATCH 15/81] remove about in it --- locales/it_IT/index.js | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/locales/it_IT/index.js b/locales/it_IT/index.js index 5332f173..bd8a4629 100644 --- a/locales/it_IT/index.js +++ b/locales/it_IT/index.js @@ -4,19 +4,6 @@ const it_IT = { // Menu sub_title: "Una semplice, veloce e sicura crittografia di file in locale", home: "Home", - about: "Dettagli", - - // About page menu - introduction: "Introduzione", - features: "Caratteristiche", - installation: "Installazione", - usage: "Utilizzo", - limitations: "Limitazioni", - best_practices: "Consigli sull'utilizzo", - faq: "Domande frequenti", - technical_details: "Dettagli tecnici", - changelog: "Registro modifiche", - donation_message: "Ti piace hat.sh? Puoi donare per supportare il progetto.", // Settings settings: "Impostazioni", @@ -182,4 +169,4 @@ const it_IT = { }; -export default it_IT; \ No newline at end of file +export default it_IT; From 690376f0141cc32fb816bb7ca0d504a56c118b8b Mon Sep 17 00:00:00 2001 From: xbdm Date: Sun, 18 Jun 2023 21:07:42 -0400 Subject: [PATCH 16/81] remove about in jp --- locales/ja_JP/index.js | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/locales/ja_JP/index.js b/locales/ja_JP/index.js index be189550..e4926f55 100644 --- a/locales/ja_JP/index.js +++ b/locales/ja_JP/index.js @@ -4,19 +4,6 @@ const ja_JP = { // Menu sub_title: "シンプル、高速、セキュアなクライアントサイドでのファイル暗号化", home: "ホーム", - about: "私たちについて", - - // About page menu - introduction: "紹介", - features: "特徴", - installation: "インストール手順", - usage: "使用方法", - limitations: "制約", - best_practices: "ベストプラクティス", - faq: "FAQ", - technical_details: "技術的な詳細", - changelog: "変更履歴", - donation_message: "hat.shを気に入ってくれましたか? 寄付をすることでこのプロジェクトを支援できます。", // Settings settings: "設定", @@ -182,4 +169,4 @@ const ja_JP = { }; -export default ja_JP; \ No newline at end of file +export default ja_JP; From c2ca19dd0186dca95d6f8079484c0f10880b381f Mon Sep 17 00:00:00 2001 From: xbdm Date: Sun, 18 Jun 2023 21:08:12 -0400 Subject: [PATCH 17/81] remove about in ru --- locales/ru_RU/index.js | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/locales/ru_RU/index.js b/locales/ru_RU/index.js index 4005e632..04455f62 100644 --- a/locales/ru_RU/index.js +++ b/locales/ru_RU/index.js @@ -4,19 +4,6 @@ const ru_RU = { // Menu sub_title: "Простое, быстрое, безопасное шифрование файлов на стороне клиента", home: "Домой", - about: "О проекте", - - // About page menu - introduction: "Вступление", - features: "Возможности", - installation: "Установка", - usage: "Использование", - limitations: "Ограничения", - best_practices: "Рекомендации", - faq: "ЧАВО", - technical_details: "Технические детали", - changelog: "История изменений", - donation_message: "Нравится hat.sh? Вы можете поддержать проект небольшим взносом.", // Settings settings: "Настройки", @@ -182,4 +169,4 @@ const ru_RU = { }; -export default ru_RU; \ No newline at end of file +export default ru_RU; From f3ebf433d9be287f803d3593013f045133620cda Mon Sep 17 00:00:00 2001 From: xbdm Date: Sun, 18 Jun 2023 21:08:43 -0400 Subject: [PATCH 18/81] remove about in sk --- locales/sk_SK/index.js | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/locales/sk_SK/index.js b/locales/sk_SK/index.js index 5aa60da2..d3953ac8 100644 --- a/locales/sk_SK/index.js +++ b/locales/sk_SK/index.js @@ -4,19 +4,6 @@ const sk_SK = { // Menu sub_title: "Jednoduché, rýchle a bezpečné šifrovanie súborov na strane klienta", home: "Domov", - about: "O projekte", - - // About page menu - introduction: "Úvod", - features: "Funkcie", - installation: "Inštalácia", - usage: "Použitie", - limitations: "Obmedzenia", - best_practices: "Osvedčené postupy", - faq: "Často kladené otázky", - technical_details: "Technické detaily", - changelog: "Zoznam zmien", - donation_message: "Máte radi hat.sh? Na podporu projektu môžete prispieť.", // Settings settings: "Nastavenia", From 2080bcaa70d69ecf2a934609eb0f4ba2a768de14 Mon Sep 17 00:00:00 2001 From: xbdm Date: Sun, 18 Jun 2023 21:09:09 -0400 Subject: [PATCH 19/81] remove about in tr --- locales/tr_TR/index.js | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/locales/tr_TR/index.js b/locales/tr_TR/index.js index cc5438d9..101f6033 100644 --- a/locales/tr_TR/index.js +++ b/locales/tr_TR/index.js @@ -4,19 +4,6 @@ const tr_TR = { // Menu sub_title: "Basit, hızlı, güvenli istemci taraflı dosya şifreleme", home: "Anasayfa", - about: "Hakkında", - - // About page menu - introduction: "Giriş", - features: "Özellikler", - installation: "Kurulum", - usage: "Kullanım", - limitations: "Sınırlandırmalar", - best_practices: "En İyi Uygulama", - faq: "SSS", - technical_details: "Teknik-Detaylar", - changelog: "Değişiklik Günlüğü", - donation_message: "Hat.sh'yi sevdin mi? Bu projeye bağış yaparak destekleyebilirsin.", // Settings settings: "Ayarlar", From ea2643062e4375149dcc29e746a5e6acb2b9172b Mon Sep 17 00:00:00 2001 From: xbdm Date: Sun, 18 Jun 2023 21:09:40 -0400 Subject: [PATCH 20/81] remove about in cn --- locales/zh_CN/index.js | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/locales/zh_CN/index.js b/locales/zh_CN/index.js index bd271c01..036b011c 100644 --- a/locales/zh_CN/index.js +++ b/locales/zh_CN/index.js @@ -4,19 +4,6 @@ const zh_CN = { // Menu sub_title: "简洁、快速、安全的用户端文件加密", // simple, fast, secure client-side file encryption home: "主页", // home - about: "关于", - - // About page menu - introduction: "介绍", // Introduction - features: "特点", // Features - installation: "安装", // Installation - usage: "使用", // Usage - limitations: "限制", // Limitations - best_practices: "最佳实践", // Best-Practices - faq: "问与答", // FAQ - technical_details: "技术细节", // Technical-Details - changelog: "更新日志", // Changelog - donation_message: "喜欢 hat.sh 吗?您可以捐赠来支持本项目", // Love hat.sh? You can donate to support the project. // Settings settings: "设置", // Settings @@ -181,4 +168,4 @@ const zh_CN = { }; - export default zh_CN; // zh-CN \ No newline at end of file + export default zh_CN; // zh-CN From 102cb58723f47088342424009bbad2709d76e4d8 Mon Sep 17 00:00:00 2001 From: xbdm Date: Sun, 18 Jun 2023 21:14:26 -0400 Subject: [PATCH 21/81] update title --- pages/_app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/_app.js b/pages/_app.js index ff15f5b6..3311f1de 100644 --- a/pages/_app.js +++ b/pages/_app.js @@ -12,7 +12,7 @@ function MyApp({ Component, pageProps }) { <> - {"Hat.sh"} + {"Client-side Encryption"} {" - "} {t("sub_title")} From 0b1e719de3f5fb72cdbd14b1391b5560cbf6d8f3 Mon Sep 17 00:00:00 2001 From: xbdm Date: Sun, 18 Jun 2023 21:15:48 -0400 Subject: [PATCH 22/81] Update config.js --- service-worker/config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service-worker/config.js b/service-worker/config.js index df6fca3b..97755b21 100644 --- a/service-worker/config.js +++ b/service-worker/config.js @@ -2,7 +2,7 @@ const APP_URL = self.location.origin + "/file"; const encoder = new TextEncoder(); const decoder = new TextDecoder(); const sigCodes = { - v1: "Encrypted Using Hat.sh", + v1: "Encrypted Using Client-side Encryption", v2_symmetric: "zDKO6XYXioc", v2_asymmetric: "hTWKbfoikeg", }; From 50e1d23d8526bac1920357e2307263243abc1945 Mon Sep 17 00:00:00 2001 From: xbdm Date: Sun, 18 Jun 2023 21:19:16 -0400 Subject: [PATCH 23/81] Update Language.js --- src/config/Language.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/config/Language.js b/src/config/Language.js index ec796699..f7a649da 100644 --- a/src/config/Language.js +++ b/src/config/Language.js @@ -53,7 +53,7 @@ const Language = () => { severity="info" action={ - From 898325ca5491bfeeaaa0d662ef00dc7008247890 Mon Sep 17 00:00:00 2001 From: xbdm Date: Sun, 18 Jun 2023 22:04:19 -0400 Subject: [PATCH 26/81] remove crypto/donation garbage --- src/components/Footer.js | 248 --------------------------------------- 1 file changed, 248 deletions(-) diff --git a/src/components/Footer.js b/src/components/Footer.js index f9925125..14c7ff7a 100644 --- a/src/components/Footer.js +++ b/src/components/Footer.js @@ -90,251 +90,3 @@ const TabPanel = (props) => {
); }; - -export default function Footer() { - const classes = useStyles(); - const [tabValue, setTabValue] = useState(0); - const [currAvatar, setCurrAvatar] = useState("xmr"); - const [donateDialog, setDonateDialog] = useState(false); - const [snackOpen, setSnackOpen] = useState(false); - - const cryptoAddrs = [ - { - type: "monero", - alt: "xmr", - addr: "84zQq4Xt7sq8cmGryuvWsXFMDvBvHjWjnMQXZWQQRXjB1TgoZWS9zBdNcYL7CRbQBqcDdxr4RtcvCgApmQcU6SemVXd7RuG", - }, - { - type: "bitcoin", - alt: "btc", - addr: "bc1qlfnq8nu2k84h3jth7a27khaq0p2l2gvtyl2dv6", - }, - { - type: "ethereum", - alt: "eth", - addr: "0xF6F204B044CC73Fa90d7A7e4C5EC2947b83b917e", - }, - ]; - - const handleSnackClose = (event, reason) => { - if (reason === "clickaway") return; - setSnackOpen(false); - handleSnackOpen(); - }; - - const handleSnackOpen = () => { - setTimeout(function () { - setSnackOpen(true); - }, 60000); - }; - - const handleTabChange = (event, newValue) => { - setTabValue(newValue); - }; - - const handleClickOpen = () => { - setDonateDialog(true); - }; - - const handleClose = () => { - setDonateDialog(false); - }; - - useEffect(() => { - handleSnackOpen(); - - setInterval(() => { - setCurrAvatar( - cryptoAddrs[Math.floor(Math.random() * cryptoAddrs.length)].alt - ); - }, 10000); - }, []); - - return ( -
-
- - - Built and developed by{" "} - - {"sh-dv"} - - - - - } - label="Donations Accepted" - clickable - onClick={() => handleClickOpen()} - onDelete={() => handleClickOpen()} - deleteIcon={} - /> - - {"Donations"} - - - - - Hat.sh is an open-source application. The project is - maintained in my free time. Donations of any size are - appreciated. - - - - - {cryptoAddrs.map((res, index) => ( - - ))} - - - {cryptoAddrs.map((res, index) => ( - -
- -
- - - { - navigator.clipboard.writeText(res.addr); - }} - > - - - - - ), - }} - variant="outlined" - fullWidth - /> -
- ))} -
- - -
- - -
-
-
- - - - - - - - - - - - - - - - - } - > - {t("donation_message")} - - - -
- ); -} From 75646846a389b43a4c9da180087de29ff714174e Mon Sep 17 00:00:00 2001 From: xbdm Date: Sun, 18 Jun 2023 22:08:54 -0400 Subject: [PATCH 27/81] Delete Footer.js --- src/components/Footer.js | 92 ---------------------------------------- 1 file changed, 92 deletions(-) delete mode 100644 src/components/Footer.js diff --git a/src/components/Footer.js b/src/components/Footer.js deleted file mode 100644 index 14c7ff7a..00000000 --- a/src/components/Footer.js +++ /dev/null @@ -1,92 +0,0 @@ -/* eslint-disable react-hooks/exhaustive-deps */ -/* eslint-disable @next/next/no-img-element */ -import { useState, useEffect } from "react"; -import Typography from "@material-ui/core/Typography"; -import { makeStyles } from "@material-ui/core/styles"; -import Container from "@material-ui/core/Container"; -import Tabs from "@material-ui/core/Tabs"; -import Tab from "@material-ui/core/Tab"; -import FavoriteIcon from "@material-ui/icons/Favorite"; -import MonetizationOnIcon from "@material-ui/icons/MonetizationOn"; -import FileCopyIcon from "@material-ui/icons/FileCopy"; -import Link from "@material-ui/core/Link"; -import { Chip, Avatar, Hidden } from "@material-ui/core"; -import Button from "@material-ui/core/Button"; -import Dialog from "@material-ui/core/Dialog"; -import DialogActions from "@material-ui/core/DialogActions"; -import DialogContent from "@material-ui/core/DialogContent"; -import DialogContentText from "@material-ui/core/DialogContentText"; -import DialogTitle from "@material-ui/core/DialogTitle"; -import { IconButton, Tooltip, TextField } from "@material-ui/core"; -import { Alert } from "@material-ui/lab"; -import Snackbar from "@material-ui/core/Snackbar"; -import { getTranslations as t } from "../../locales"; -let QRCode = require("qrcode.react"); - -const useStyles = makeStyles((theme) => ({ - root: { - marginTop: "auto", - }, - - footer: { - textAlign: "center", - color: theme.palette.diamondBlack.main, - padding: theme.spacing(3, 2), - }, - - topScrollPaper: { - alignItems: "start", - marginTop: "10vh", - }, - topPaperScrollBody: { - verticalAlign: "middle", - }, - - chip: { - marginTop: 5, - border: "none", - borderRadius: 8, - textTransform: "none", - boxShadow: "none", - color: theme.palette.diamondBlack.main, - backgroundColor: theme.palette.alto.light, - "&:hover": { - backgroundColor: theme.palette.alto.main, - }, - "&:focus": { - backgroundColor: theme.palette.alto.main, - boxShadow: "none", - }, - transition: "background-color 0.2s ease-out", - transition: "color .01s", - }, - - monIcon: { - color: theme.palette.mountainMist.main, - }, - - qr: { - display: "flex", - flexDirection: "column", - margin: "auto", - width: "fit-content", - marginBottom: 20, - }, -})); - -const TabPanel = (props) => { - const { children, value, index, ...other } = props; - - return ( - - ); -}; From 5b03205966703150e64e17d65ec16f738a4c9f9c Mon Sep 17 00:00:00 2001 From: xbdm Date: Sun, 18 Jun 2023 22:12:54 -0400 Subject: [PATCH 28/81] Create Footer.js --- src/components/Footer.js | 340 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 340 insertions(+) create mode 100644 src/components/Footer.js diff --git a/src/components/Footer.js b/src/components/Footer.js new file mode 100644 index 00000000..f9925125 --- /dev/null +++ b/src/components/Footer.js @@ -0,0 +1,340 @@ +/* eslint-disable react-hooks/exhaustive-deps */ +/* eslint-disable @next/next/no-img-element */ +import { useState, useEffect } from "react"; +import Typography from "@material-ui/core/Typography"; +import { makeStyles } from "@material-ui/core/styles"; +import Container from "@material-ui/core/Container"; +import Tabs from "@material-ui/core/Tabs"; +import Tab from "@material-ui/core/Tab"; +import FavoriteIcon from "@material-ui/icons/Favorite"; +import MonetizationOnIcon from "@material-ui/icons/MonetizationOn"; +import FileCopyIcon from "@material-ui/icons/FileCopy"; +import Link from "@material-ui/core/Link"; +import { Chip, Avatar, Hidden } from "@material-ui/core"; +import Button from "@material-ui/core/Button"; +import Dialog from "@material-ui/core/Dialog"; +import DialogActions from "@material-ui/core/DialogActions"; +import DialogContent from "@material-ui/core/DialogContent"; +import DialogContentText from "@material-ui/core/DialogContentText"; +import DialogTitle from "@material-ui/core/DialogTitle"; +import { IconButton, Tooltip, TextField } from "@material-ui/core"; +import { Alert } from "@material-ui/lab"; +import Snackbar from "@material-ui/core/Snackbar"; +import { getTranslations as t } from "../../locales"; +let QRCode = require("qrcode.react"); + +const useStyles = makeStyles((theme) => ({ + root: { + marginTop: "auto", + }, + + footer: { + textAlign: "center", + color: theme.palette.diamondBlack.main, + padding: theme.spacing(3, 2), + }, + + topScrollPaper: { + alignItems: "start", + marginTop: "10vh", + }, + topPaperScrollBody: { + verticalAlign: "middle", + }, + + chip: { + marginTop: 5, + border: "none", + borderRadius: 8, + textTransform: "none", + boxShadow: "none", + color: theme.palette.diamondBlack.main, + backgroundColor: theme.palette.alto.light, + "&:hover": { + backgroundColor: theme.palette.alto.main, + }, + "&:focus": { + backgroundColor: theme.palette.alto.main, + boxShadow: "none", + }, + transition: "background-color 0.2s ease-out", + transition: "color .01s", + }, + + monIcon: { + color: theme.palette.mountainMist.main, + }, + + qr: { + display: "flex", + flexDirection: "column", + margin: "auto", + width: "fit-content", + marginBottom: 20, + }, +})); + +const TabPanel = (props) => { + const { children, value, index, ...other } = props; + + return ( + + ); +}; + +export default function Footer() { + const classes = useStyles(); + const [tabValue, setTabValue] = useState(0); + const [currAvatar, setCurrAvatar] = useState("xmr"); + const [donateDialog, setDonateDialog] = useState(false); + const [snackOpen, setSnackOpen] = useState(false); + + const cryptoAddrs = [ + { + type: "monero", + alt: "xmr", + addr: "84zQq4Xt7sq8cmGryuvWsXFMDvBvHjWjnMQXZWQQRXjB1TgoZWS9zBdNcYL7CRbQBqcDdxr4RtcvCgApmQcU6SemVXd7RuG", + }, + { + type: "bitcoin", + alt: "btc", + addr: "bc1qlfnq8nu2k84h3jth7a27khaq0p2l2gvtyl2dv6", + }, + { + type: "ethereum", + alt: "eth", + addr: "0xF6F204B044CC73Fa90d7A7e4C5EC2947b83b917e", + }, + ]; + + const handleSnackClose = (event, reason) => { + if (reason === "clickaway") return; + setSnackOpen(false); + handleSnackOpen(); + }; + + const handleSnackOpen = () => { + setTimeout(function () { + setSnackOpen(true); + }, 60000); + }; + + const handleTabChange = (event, newValue) => { + setTabValue(newValue); + }; + + const handleClickOpen = () => { + setDonateDialog(true); + }; + + const handleClose = () => { + setDonateDialog(false); + }; + + useEffect(() => { + handleSnackOpen(); + + setInterval(() => { + setCurrAvatar( + cryptoAddrs[Math.floor(Math.random() * cryptoAddrs.length)].alt + ); + }, 10000); + }, []); + + return ( +
+
+ + + Built and developed by{" "} + + {"sh-dv"} + + + + + } + label="Donations Accepted" + clickable + onClick={() => handleClickOpen()} + onDelete={() => handleClickOpen()} + deleteIcon={} + /> + + {"Donations"} + + + + + Hat.sh is an open-source application. The project is + maintained in my free time. Donations of any size are + appreciated. + + + + + {cryptoAddrs.map((res, index) => ( + + ))} + + + {cryptoAddrs.map((res, index) => ( + +
+ +
+ + + { + navigator.clipboard.writeText(res.addr); + }} + > + + + + + ), + }} + variant="outlined" + fullWidth + /> +
+ ))} +
+ + +
+ + +
+
+
+ + + + + + + + + + + + + + + + + } + > + {t("donation_message")} + + + +
+ ); +} From aac1412404a8d1af4137d680563077819717b719 Mon Sep 17 00:00:00 2001 From: xbdm Date: Sun, 18 Jun 2023 22:15:19 -0400 Subject: [PATCH 29/81] security enhancements --- nginx.conf | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/nginx.conf b/nginx.conf index 11cb5b91..eee2ad79 100644 --- a/nginx.conf +++ b/nginx.conf @@ -1,7 +1,8 @@ server { - listen 443 ssl http2; - listen [::]:443 ssl http2; - + listen 443 ssl; + listen [::]:443 ssl; + http2 on; + server_name changethis; ssl_certificate /etc/letsencrypt/live/changethis/fullchain.pem; @@ -9,21 +10,21 @@ server { ssl_trusted_certificate /etc/letsencrypt/live/changethis/chain.pem; include /etc/letsencrypt/options-ssl-nginx.conf; ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; - ssl_stapling on; + ssl_stapling on; ssl_stapling_verify on; - add_header strict_sni on; - add_header strict_sni_header on; - add_header Strict-Transport-Security "max-age=31536000" always; # managed by Certbot - add_header Content-Security-Policy upgrade-insecure-requests; - add_header X-XSS-Protection "1; mode=block"; - add_header X-Frame-Options "DENY"; - add_header Clear-Site-Data "cookies"; - add_header X-Content-Type-Options nosniff; - add_header Referrer-Policy "strict-origin"; - add_header Permissions-Policy "geolocation=(),midi=(),sync-xhr=(),microphone=(),camera=(),magnetometer=(),gyroscope=(),fullscreen=(self),payment=()"; - resolver 1.1.1.1; - + add_header strict_sni on; + add_header strict_sni_header on; + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; + add_header Content-Security-Policy "upgrade-insecure-requests; default-src 'none'; script-src 'self'; style-src 'self' form-action 'self'; form-action 'self'; font-src 'self'; frame-ancestors 'self'; base-uri 'self'; connect-src 'self' https://overpass-api.de; img-src 'self' data: https://*.tile.openstreetmap.org; frame-src https://www.youtube-nocookie.com https://player.vimeo.com https://www.dailymotion.com https://www.deezer.com https://www.mixcloud.com https://w.soundcloud.com https://embed.spotify.com"; + add_header X-XSS-Protection "1; mode=block"; + add_header X-Content-Type-Options nosniff; + add_header X-Frame-Options "DENY"; + add_header Clear-Site-Data "cookies"; + add_header Referrer-Policy "no-referrer"; + add_header Permissions-Policy "interest-cohort=(),accelerometer=(),ambient-light-sensor=(),autoplay=(),camera=(),encrypted-media=(),focus-without-user-activation=(),geolocation=(),gyroscope=(),magnetometer=(),microphone=(),midi=(),payment=(),picture-in-picture=(),speaker=(),sync-xhr=(),usb=(),vr=()"; + resolver 1.1.1.1; + access_log /dev/null; error_log /dev/null; From 92404d156986605c3ad0d9f2f89afe494ad60c49 Mon Sep 17 00:00:00 2001 From: xbdm Date: Sun, 18 Jun 2023 22:20:09 -0400 Subject: [PATCH 30/81] Update README.md --- README.md | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 74733bbc..26547d23 100644 --- a/README.md +++ b/README.md @@ -4,11 +4,14 @@ Encrypt and Decrypt files securely in your browser. ## Security Audits: - [Internet.ml](https://internet.nl/site/hat.whateveritworks.org/2060148/) -- [Mozilla.org](https://observatory.mozilla.org/) -- [ImmuniWeb](https://www.immuniweb.com/ssl/hat.whateveritworks.org/a8FxuGr6/) - [HSTS Preload](https://hstspreload.org/) - [SSL Labs](https://www.ssllabs.com/ssltest/analyze.html?d=hat.whateveritworks.org) - [Security Headers](https://securityheaders.com/?q=hat.whateveritworks.org&hide=on&followRedirects=on) +- [pagespeed](https://pagespeed.web.dev/) +- [webbkoll](https://webbkoll.dataskydd.net/en) +- [ImmuniWeb](https://www.immuniweb.com/ssl/hat.whateveritworks.org/uLlrAeMb/) +- [Hardenize](https://www.hardenize.com/report/hat.whateveritworks.org/1686343966) +- [Mozilla.org](https://observatory.mozilla.org/) ## Usage: @@ -17,13 +20,13 @@ Encrypt and Decrypt files securely in your browser. 2. Get [Cloudflare](https://cloudflare.com) it's carbon renewal and you help save the world. -2. ```apt install git``` - -3. ```git clone https://github.com/WhateverItWorks/my-hat.sh-docker-compose.git hat``` +3. ```apt install git``` -4. ```nano docker-compose.yml``` +4. ```git clone https://github.com/WhateverItWorks/my-hat.sh-docker-compose.git hat``` -5. ```docker-compose up -d --build``` +5. ```nano docker-compose.yml``` + +6. ```docker-compose up -d --build``` ```http://localhost:3991``` From bfd46752c30e2152546391697689a0ccb98635eb Mon Sep 17 00:00:00 2001 From: xbdm Date: Sun, 18 Jun 2023 22:35:36 -0400 Subject: [PATCH 31/81] hotfix --- nginx.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nginx.conf b/nginx.conf index eee2ad79..5fbd417b 100644 --- a/nginx.conf +++ b/nginx.conf @@ -16,7 +16,7 @@ server { add_header strict_sni on; add_header strict_sni_header on; add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; - add_header Content-Security-Policy "upgrade-insecure-requests; default-src 'none'; script-src 'self'; style-src 'self' form-action 'self'; form-action 'self'; font-src 'self'; frame-ancestors 'self'; base-uri 'self'; connect-src 'self' https://overpass-api.de; img-src 'self' data: https://*.tile.openstreetmap.org; frame-src https://www.youtube-nocookie.com https://player.vimeo.com https://www.dailymotion.com https://www.deezer.com https://www.mixcloud.com https://w.soundcloud.com https://embed.spotify.com"; + add_header Content-Security-Policy "upgrade-insecure-requests"; add_header X-XSS-Protection "1; mode=block"; add_header X-Content-Type-Options nosniff; add_header X-Frame-Options "DENY"; From 38f5e3706ec352d428cae4061ba025d201eab684 Mon Sep 17 00:00:00 2001 From: xbdm Date: Fri, 7 Jul 2023 11:10:07 -0400 Subject: [PATCH 32/81] Update Dockerfile --- Dockerfile | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/Dockerfile b/Dockerfile index bee12c58..43fe231c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,22 +1,14 @@ -FROM node:alpine as builder +#https://hub.docker.com/_/node +#https://hub.docker.com/_/nginx +FROM node:latest as builder WORKDIR /app - COPY package*.json ./ - RUN npm install - COPY . ./ - ENV NEXT_TELEMETRY_DISABLED 1 - RUN npm run build - - -FROM nginx:stable-alpine - +FROM nginx:latest COPY --from=builder /app/out /usr/share/nginx/html - EXPOSE 3991 - -ENTRYPOINT ["nginx", "-g", "daemon off;"] \ No newline at end of file +ENTRYPOINT ["nginx", "-g", "daemon off;"] From 2315cd39af9d8bf6089b5352c42203c7d4d3269b Mon Sep 17 00:00:00 2001 From: xbdm Date: Fri, 7 Jul 2023 11:25:09 -0400 Subject: [PATCH 33/81] Update docker-compose.yml --- docker-compose.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 264352b3..d1df03de 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,11 +1,13 @@ version: "3.7" services: - web: - image: shdv/hat.sh + hat: build: - context: ./ + context: . dockerfile: Dockerfile + #image: shdv/hat.sh:latest + container_name: hat + hostname: hat security_opt: - no-new-privileges:true cap_drop: From fda0aa8a8f3380b4639847f0b5cb8080454fb25a Mon Sep 17 00:00:00 2001 From: xbdm Date: Fri, 7 Jul 2023 11:49:54 -0400 Subject: [PATCH 34/81] cleanup --- README.md | 151 ++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 130 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 26547d23..961c0a3b 100644 --- a/README.md +++ b/README.md @@ -1,32 +1,141 @@ -# hat.sh -Encrypt and Decrypt files securely in your browser. +### hat.sh -## Security Audits: +Hat.sh is a web app that provides secure local file encryption in the browser. It's fast, secure, and uses modern cryptographic algorithms with chunked AEAD stream encryption/decryption. -- [Internet.ml](https://internet.nl/site/hat.whateveritworks.org/2060148/) -- [HSTS Preload](https://hstspreload.org/) -- [SSL Labs](https://www.ssllabs.com/ssltest/analyze.html?d=hat.whateveritworks.org) -- [Security Headers](https://securityheaders.com/?q=hat.whateveritworks.org&hide=on&followRedirects=on) -- [pagespeed](https://pagespeed.web.dev/) -- [webbkoll](https://webbkoll.dataskydd.net/en) -- [ImmuniWeb](https://www.immuniweb.com/ssl/hat.whateveritworks.org/uLlrAeMb/) -- [Hardenize](https://www.hardenize.com/report/hat.whateveritworks.org/1686343966) -- [Mozilla.org](https://observatory.mozilla.org/) +V2 of hat.sh introduced memory efficient in-browser large file chunked encryption using streams with libsodium. + +### Screenshots +![](https://camo.githubusercontent.com/f318a430202b6dbec2db62b84bd614720de8dda55f0f0dd362d5ea8ad33a1515/68747470733a2f2f692e696d6775722e636f6d2f4e62415a4f67502e676966) + +### Features +### Security +- XChaCha20-Poly1305 - for symmetric encryption. +- Argon2id - for password-based key derivation. +- X25519 - for key exchange. +The libsodium library is used for all cryptographic algorithms. + +### Privacy +- The app runs locally in your browser. +- No data is ever collected or sent to anyone.​ + +### Functionality +- Secure multiple file encryption/decryption with passwords or keys. +- Secure random password generation. +- Asymmetric key pair generation. +- Authenticated key exchange. +- Password strength estimation. + +### Offline Use +## Deploy with Docker +### €⁠20 on [Hetzner Cloud](https://hetzner.cloud/?ref=eLtKhFK70n4h) + +### Automatic Installs +``` +https://github.com/WhateverItWorks/Watchtower +``` + +``` +git clone https://github.com/WhateverItWorks/my-hat.sh-docker-compose.git hat +cd hat +nano docker-compose.yml +docker-compose up -d --build +``` +http://localhost:3991 + + +### Browser Compatibility +We officially support the last two versions of every major browser. Specifically, we test on the following + +- Chrome on Windows, macOS, and Linux , Android +- Firefox on Windows, macOS, and Linux +- Safari on iOS and macOS +- Edge on Windows +Safari and Mobile browsers are limited to single 1GB files, due to lack of support with server-worker fetch api. -## Usage: +## Clearnet Instances -1. Buy [Hetzner.com](https://hetzner.com) it's 100% renewal hardware and you get affordable dedicated servers, and you also help save the world. +| Instance URL | Region | Notes | +| ------------------------------------------------------------------------------- | -------------------------------- | ------------------------------------------------------------------------------------------------ | +| [hat.whateveritworks.org](https://hat.whateveritworks.org) | Germany | Operated by [WhateverItWorks](https://whateveritworks.org) and [xbdm](https://xbdm.fun) | +| [hat.sh](https://hat.sh) | | | +| [hat.now.sh](https://hat.now.sh) +| [hat.vercel.app](https://hat.vercel.app) -2. Get [Cloudflare](https://cloudflare.com) it's carbon renewal and you help save the world. +### Donations +The project is maintained in my free time. Donations of any size are appreciated: +
-3. ```apt install git``` +
-4. ```git clone https://github.com/WhateverItWorks/my-hat.sh-docker-compose.git hat``` +Crypto -5. ```nano docker-compose.yml``` - -6. ```docker-compose up -d --build``` + + + + + + + + + + + + + + + + + + + + + +
CoinAddress
Monero + adding soon +
Bitcoinadding soon
Ethereumadding soon
-```http://localhost:3991``` +## Acknowledgements + +- Everyone who supported the project. +- [Samuel-lucas6](https://github.com/samuel-lucas6) from the [Kryptor](https://github.com/samuel-lucas6/Kryptor) project for being helpful and doing a lot of beta testing. +- [stophecom](https://github.com/stophecom) from the [Scrt.link](https://scrt.link/) project for translating to German. +- [bbouille](https://github.com/bbouille) for translating to French. +- [qaqland](https://github.com/qaqland) for translating to Chinese. +- [Ser-Bul](https://github.com/Ser-Bul) for translating to Russian. +- [matteotardito](https://github.com/matteotardito) for translating to Italian. +- [t0mzSK](https://github.com/t0mzSK) for translating to Slovak. +- [Xurdejl](https://github.com/Xurdejl) for translating to Spanish. +- [Franatrtur](https://github.com/Franatrtur) for translating to Czech. +- [darkao](https://github.com/darkao) for translating to Turkish. +- [Frank7sun](https://github.com/Frank7sun) for translating to Japanese. + + +## Credits + +[libsodium.js](https://github.com/jedisct1/libsodium.js) + +[next.js](https://nextjs.org/) + +[material-ui](https://material-ui.com/) + + +## Security Audits: + +- [Internet.nl](https://internet.nl/site/hat.whateveritworks.org) +- [HSTS Preload](https://hstspreload.org/) +- [SSL Labs](https://www.ssllabs.com/ssltest/analyze.html?d=hat.whateveritworks.org) +- [Security Headers](https://securityheaders.com/?q=hat.whateveritworks.org&hide=on&followRedirects=on) +- [pagespeed](https://pagespeed.web.dev/) +- [webbkoll](https://webbkoll.dataskydd.net/en) +- [ImmuniWeb](https://www.immuniweb.com/ssl/hat.whateveritworks.org) +- [Hardenize](https://www.hardenize.com/report/hat.whateveritworks.org) +- [Mozilla.org](https://observatory.mozilla.org/) +- [report-uri.com](https://report-uri.com/home/tools) +- [check-your-website.server-daten.de](https://check-your-website.server-daten.de/?q=hat.whateveritworks.org) +- [csp-evaluator.withgoogle.com](https://csp-evaluator.withgoogle.com/) +- [OpenWPM](https://github.com/openwpm/OpenWPM) +- [privacyscore.org](https://privacyscore.org/) From 95e6bb3c968e04a1c875d7dd1b22af94147affe8 Mon Sep 17 00:00:00 2001 From: xbdm Date: Fri, 7 Jul 2023 11:57:04 -0400 Subject: [PATCH 35/81] Update Footer.js --- src/components/Footer.js | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/src/components/Footer.js b/src/components/Footer.js index f9925125..9e0777bb 100644 --- a/src/components/Footer.js +++ b/src/components/Footer.js @@ -157,12 +157,12 @@ export default function Footer() { Built and developed by{" "} - {"sh-dv"} + {"WhateverItWorks"} @@ -271,17 +271,6 @@ export default function Footer() { ))} -