From fa692413ad215af2aba37ded8276296e7190d494 Mon Sep 17 00:00:00 2001 From: M Gilang Januar Date: Tue, 29 Mar 2022 08:44:55 +0700 Subject: [PATCH 01/13] update homepage docs --- docs/src/components/HomepageFeatures/index.js | 45 +++++++++---------- 1 file changed, 21 insertions(+), 24 deletions(-) diff --git a/docs/src/components/HomepageFeatures/index.js b/docs/src/components/HomepageFeatures/index.js index 1c67e144a..fd2f99f3a 100644 --- a/docs/src/components/HomepageFeatures/index.js +++ b/docs/src/components/HomepageFeatures/index.js @@ -1,6 +1,7 @@ -import React from 'react'; -import clsx from 'clsx'; -import styles from './styles.module.css'; +import Link from '@docusaurus/Link' +import clsx from 'clsx' +import React from 'react' +import styles from './styles.module.css' const FeatureList = [ { @@ -13,6 +14,9 @@ const FeatureList = [

The open source project to give you what you deserve. Using the Telegram API as your unlimited storage. So, you can upload as many as you want without any limit 👌

+

+ Demo applications: teledrive.vercel.app, or teledriveapp.herokuapp.com (*expect high traffic) +

), }, @@ -44,38 +48,28 @@ export default function HomepageFeatures() { -

-
-
-

Always FREE

-

- All your needed services are on you, the application itself will always free. -

-
-
-
+
+

Easy Installation

+
+                  $ git clone https://github.com/mgilangjanuar/teledrive.git
+ $ cd teledrive
+ $ docker-compose -f docker/docker-compose.yml up -d +

- We provide Docker installation and make installation easier for everyone. -

-
-
-
-
-

No Limitations

-

- We remove all the restrictions. Everyone can share and download anything without limits. + + Learn more +

-

@@ -84,7 +78,10 @@ export default function HomepageFeatures() {

Need Help?

- We provide a Discord server for you to get help from the community. Join now! + We provide a Discord server for you to get help from the community. +

+

+ Join now!

From 0281ef89cdf59ea4f891f7d036ecd330c6cb4ba1 Mon Sep 17 00:00:00 2001 From: M Gilang Januar Date: Tue, 29 Mar 2022 09:27:19 +0700 Subject: [PATCH 02/13] update manual installation page --- docs/docs/Installation/manual.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/docs/Installation/manual.md b/docs/docs/Installation/manual.md index e8af4ecf1..3c65d7adb 100644 --- a/docs/docs/Installation/manual.md +++ b/docs/docs/Installation/manual.md @@ -115,8 +115,7 @@ You need to create and import the database schema. ``` **Note.** *If you follow the instructions above then you need to fill the server variables:* -- `DB_NAME`: teledrive -- `DB_USERNAME`: postgres +- `DATABASE_URL`: postgresql://postgres@localhost:5432/teledrive ### Provide a GitHub personal token From c7e3ca419abdf58be1deb36bf1d9c09a2b63059d Mon Sep 17 00:00:00 2001 From: M Gilang Januar Date: Tue, 29 Mar 2022 10:08:01 +0700 Subject: [PATCH 03/13] update tutorial upgrade with heroku --- docs/docs/Deployment/heroku.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/docs/docs/Deployment/heroku.md b/docs/docs/Deployment/heroku.md index 00a8da2b3..6092dbfe5 100644 --- a/docs/docs/Deployment/heroku.md +++ b/docs/docs/Deployment/heroku.md @@ -93,4 +93,14 @@ Push your code to main branch in Heroku: git push heroku main # or staging:main, if you're from staging branch ``` -Your app will automatically deploy to `[YOUR_APP_NAME].herokuapp.com` \ No newline at end of file +Your app will automatically deploy to `[YOUR_APP_NAME].herokuapp.com` + +## Upgrade + +Upgrade to the latest version of TeleDrive with this command: + +```shell +git pull origin main # or, staging for the latest updates + +git push heroku main # or staging:main, if you're from staging branch +``` \ No newline at end of file From 493638c5ed985b60516cc9e56b742620f5933696 Mon Sep 17 00:00:00 2001 From: M Gilang Januar Date: Tue, 29 Mar 2022 13:59:50 +0700 Subject: [PATCH 04/13] trigger deploy From 91b4641d1e49c1a97d3bbaae05c6e8db9b32165a Mon Sep 17 00:00:00 2001 From: M Gilang Januar Date: Tue, 29 Mar 2022 14:21:35 +0700 Subject: [PATCH 05/13] update deps --- server/package.json | 4 +- web/package.json | 4 +- web/src/pages/components/Navbar.tsx | 13 +-- yarn.lock | 158 +++++----------------------- 4 files changed, 35 insertions(+), 144 deletions(-) diff --git a/server/package.json b/server/package.json index 6881761c0..65676687f 100644 --- a/server/package.json +++ b/server/package.json @@ -9,7 +9,7 @@ "build": "tsc" }, "dependencies": { - "@mgilangjanuar/telegram": "2.5.0", + "@mgilangjanuar/telegram": "^2.5.44", "@sentry/node": "^6.14.1", "@sentry/tracing": "^6.14.1", "@types/moment": "^2.13.0", @@ -86,4 +86,4 @@ "rimraf": "^3.0.2", "typescript": "^4.4.2" } -} \ No newline at end of file +} diff --git a/web/package.json b/web/package.json index 37d5df917..42755f163 100644 --- a/web/package.json +++ b/web/package.json @@ -4,7 +4,7 @@ "private": true, "dependencies": { "@ideasio/add-to-homescreen-react": "^1.0.10", - "@mgilangjanuar/telegram": "2.5.0", + "@mgilangjanuar/telegram": "^2.5.44", "antd": "4.18.3", "antd-country-phone-input": "^4.3.1", "axios": "^0.21.4", @@ -107,4 +107,4 @@ "workbox-strategies": "^5.1.3", "workbox-streams": "^5.1.3" } -} \ No newline at end of file +} diff --git a/web/src/pages/components/Navbar.tsx b/web/src/pages/components/Navbar.tsx index 76b4b6617..76927da84 100644 --- a/web/src/pages/components/Navbar.tsx +++ b/web/src/pages/components/Navbar.tsx @@ -1,14 +1,11 @@ import { CrownOutlined, DashboardOutlined, GithubOutlined, LoginOutlined, LogoutOutlined, MenuOutlined, SettingOutlined, UserOutlined, WarningOutlined } from '@ant-design/icons' -import { Button, Checkbox, Form, Layout, Menu, Modal, Popover, Progress, Tag, Tooltip, Typography } from 'antd' +import { Button, Checkbox, Form, Layout, Menu, Modal, Popover, Tag, Typography } from 'antd' import Avatar from 'antd/lib/avatar/avatar' -import moment from 'moment' -import prettyBytes from 'pretty-bytes' import React, { useState } from 'react' import { useThemeSwitcher } from 'react-css-theme-switcher' import { useHistory } from 'react-router' import { Link, useLocation } from 'react-router-dom' -import useSWR from 'swr' -import { apiUrl, fetcher, req } from '../../utils/Fetcher' +import { apiUrl, req } from '../../utils/Fetcher' interface Props { user?: any @@ -22,7 +19,7 @@ const Navbar: React.FC = ({ user }) => { const [logoutConfirmation, setLogoutConfirmation] = useState(false) const [popoverVisibility, setPopoverVisibility] = useState(false) const [destroySession, setDestroySession] = useState(false) - const { data: usage } = useSWR('/users/me/usage', fetcher) + // const { data: usage } = useSWR('/users/me/usage', fetcher) const logout = async () => { await req.post('/auth/logout', {}, destroySession ? { params: { destroySession: 1 } } : undefined) @@ -47,12 +44,12 @@ const Navbar: React.FC = ({ user }) => {
{user ? <>{/\/dashboard/.test(pathname) ? <> -
+ {/*
Bandwidth: { } {user?.plan === 'premium' ? Unlimited : You can download up to {prettyBytes(Math.max(0, 1_500_000_000 - Number(usage?.usage.usage) || 0))} until {moment(usage?.usage.expire).local().format('lll')}}> } -
+
*/} { setPopoverVisibility(false) if (key === 'settings') { diff --git a/yarn.lock b/yarn.lock index 6de1e1fb3..14b5d8e54 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1687,27 +1687,23 @@ "@types/yargs" "^16.0.0" chalk "^4.0.0" -"@mgilangjanuar/telegram@2.5.0": - version "2.5.0" - resolved "https://npm.pkg.github.com/download/@mgilangjanuar/telegram/2.5.0/d8cab3d9e89f91fdb584ef38cd29f28edd2eed91f414dc71803fdc3e06c68805#9f05e49851d44294eb49c02b9174766e243ff132" - integrity sha512-oVAKIw9/rhaUr/W9oo7CTgaHXOLasTnbb5mZz9DJyKc20V4rq8yqes9caasvVz3i5EGpczMYQEOIZiC8+/iKGA== +"@mgilangjanuar/telegram@^2.5.44": + version "2.5.44" + resolved "https://npm.pkg.github.com/download/@mgilangjanuar/telegram/2.5.44/cee00d3c92fd003c837e4a78e656047d50db73cd8adf3713fdf171ae84b30068#4dc784c63bfcf79e4c7f14d4a5ec211f8fb2403d" + integrity sha512-vaIME37btxOxK3dNiUv8C7irLfEkdqYSCl7TXClNAE575isuor76k7znOYw8mmLcLqu4+h2jaj3m1ivOG1RKdw== dependencies: "@cryptography/aes" "^0.1.1" async-mutex "^0.3.0" big-integer "^1.6.48" - browser-or-node "^1.3.0" buffer "^6.0.3" htmlparser2 "^6.1.0" - mime-types "^2.1.30" - node-localstorage "^2.1.6" - os-browserify "^0.3.0" + mime "^3.0.0" + node-localstorage "^2.2.1" pako "^2.0.3" path-browserify "^1.0.1" - process "^0.11.10" - socks "^2.6.1" + socks "^2.6.2" store2 "^2.12.0" ts-custom-error "^3.2.0" - util "^0.12.4" websocket "^1.0.34" optionalDependencies: bufferutil "^4.0.3" @@ -3533,11 +3529,6 @@ autoprefixer@^9.6.1: postcss "^7.0.32" postcss-value-parser "^4.1.0" -available-typed-arrays@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz#92f95616501069d07d10edb2fc37d3e1c65123b7" - integrity sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw== - axe-core@^4.0.2: version "4.3.3" resolved "https://registry.yarnpkg.com/axe-core/-/axe-core-4.3.3.tgz#b55cd8e8ddf659fe89b064680e1c6a4dceab0325" @@ -3963,11 +3954,6 @@ brorand@^1.0.1, brorand@^1.1.0: resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" integrity sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8= -browser-or-node@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/browser-or-node/-/browser-or-node-1.3.0.tgz#f2a4e8568f60263050a6714b2cc236bb976647a7" - integrity sha512-0F2z/VSnLbmEeBcUrSuDH5l0HxTXdQQzLjkmBR4cYfvg1zJrKSlmIZFqyFR8oX0NrwPhy3c3HQ6i3OxMbew4Tg== - browser-process-hrtime@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz#3c9b4b7d782c8121e56f10106d84c0d0ffc94626" @@ -5965,32 +5951,6 @@ es-abstract@^1.17.2, es-abstract@^1.18.0-next.1, es-abstract@^1.18.0-next.2, es- string.prototype.trimstart "^1.0.4" unbox-primitive "^1.0.1" -es-abstract@^1.18.5: - version "1.19.1" - resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.19.1.tgz#d4885796876916959de78edaa0df456627115ec3" - integrity sha512-2vJ6tjA/UfqLm2MPs7jxVybLoB8i1t1Jd9R3kISld20sIxPcTbLuggQOUxeWeAvIUkduv/CfMjuh4WmiXr2v9w== - dependencies: - call-bind "^1.0.2" - es-to-primitive "^1.2.1" - function-bind "^1.1.1" - get-intrinsic "^1.1.1" - get-symbol-description "^1.0.0" - has "^1.0.3" - has-symbols "^1.0.2" - internal-slot "^1.0.3" - is-callable "^1.2.4" - is-negative-zero "^2.0.1" - is-regex "^1.1.4" - is-shared-array-buffer "^1.0.1" - is-string "^1.0.7" - is-weakref "^1.0.1" - object-inspect "^1.11.0" - object-keys "^1.1.1" - object.assign "^4.1.2" - string.prototype.trimend "^1.0.4" - string.prototype.trimstart "^1.0.4" - unbox-primitive "^1.0.1" - es-to-primitive@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.1.tgz#e55cd4c9cdc188bcefb03b366c736323fc5c898a" @@ -6787,11 +6747,6 @@ for-in@^1.0.2: resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" integrity sha1-gQaNKVqBQuwKxybG4iAMMPttXoA= -foreach@^2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/foreach/-/foreach-2.0.5.tgz#0bee005018aeb260d0a3af3ae658dd0136ec1b99" - integrity sha1-C+4AUBiusmDQo6865ljdATbsG5k= - fork-ts-checker-webpack-plugin@4.1.6: version "4.1.6" resolved "https://registry.yarnpkg.com/fork-ts-checker-webpack-plugin/-/fork-ts-checker-webpack-plugin-4.1.6.tgz#5055c703febcf37fa06405d400c122b905167fc5" @@ -7001,14 +6956,6 @@ get-stream@^5.0.0, get-stream@^5.1.0: dependencies: pump "^3.0.0" -get-symbol-description@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/get-symbol-description/-/get-symbol-description-1.0.0.tgz#7fdb81c900101fbd564dd5f1a30af5aadc1e58d6" - integrity sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw== - dependencies: - call-bind "^1.0.2" - get-intrinsic "^1.1.1" - get-uri@3: version "3.0.2" resolved "https://registry.yarnpkg.com/get-uri/-/get-uri-3.0.2.tgz#f0ef1356faabc70e1f9404fa3b66b2ba9bfc725c" @@ -7870,7 +7817,7 @@ is-buffer@^2.0.0: resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-2.0.5.tgz#ebc252e400d22ff8d77fa09888821a24a658c191" integrity sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ== -is-callable@^1.1.4, is-callable@^1.2.3, is-callable@^1.2.4: +is-callable@^1.1.4, is-callable@^1.2.3: version "1.2.4" resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.4.tgz#47301d58dd0259407865547853df6d61fe471945" integrity sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w== @@ -8006,13 +7953,6 @@ is-generator-fn@^2.0.0: resolved "https://registry.yarnpkg.com/is-generator-fn/-/is-generator-fn-2.1.0.tgz#7d140adc389aaf3011a8f2a2a4cfa6faadffb118" integrity sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ== -is-generator-function@^1.0.7: - version "1.0.10" - resolved "https://registry.yarnpkg.com/is-generator-function/-/is-generator-function-1.0.10.tgz#f1558baf1ac17e0deea7c0415c438351ff2b3c72" - integrity sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A== - dependencies: - has-tostringtag "^1.0.0" - is-glob@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-3.1.0.tgz#7ba5ae24217804ac70707b96922567486cc3e84a" @@ -8155,7 +8095,7 @@ is-redirect@^1.0.0: resolved "https://registry.yarnpkg.com/is-redirect/-/is-redirect-1.0.0.tgz#1d03dded53bd8db0f30c26e4f95d36fc7c87dc24" integrity sha1-HQPd7VO9jbDzDCbk+V02/HyH3CQ= -is-regex@^1.0.4, is-regex@^1.1.3, is-regex@^1.1.4: +is-regex@^1.0.4, is-regex@^1.1.3: version "1.1.4" resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.4.tgz#eef5663cd59fa4c0ae339505323df6854bb15958" integrity sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg== @@ -8183,11 +8123,6 @@ is-root@2.1.0: resolved "https://registry.yarnpkg.com/is-root/-/is-root-2.1.0.tgz#809e18129cf1129644302a4f8544035d51984a9c" integrity sha512-AGOriNp96vNBd3HtU+RzFEc75FfR5ymiYv8E553I71SCeXBiMsVDUtdio1OEFvrPyLIQ9tVR5RxXIFe5PUFjMg== -is-shared-array-buffer@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-shared-array-buffer/-/is-shared-array-buffer-1.0.1.tgz#97b0c85fbdacb59c9c446fe653b82cf2b5b7cfe6" - integrity sha512-IU0NmyknYZN0rChcKhRO1X8LYz5Isj/Fsqh8NJOSf+N/hCOTwy29F32Ik7a+QszE63IdvmwdTPDd6cZ5pg4cwA== - is-stream@^1.0.0, is-stream@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" @@ -8198,7 +8133,7 @@ is-stream@^2.0.0: resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.1.tgz#fac1e3d53b97ad5a9d0ae9cef2389f5810a5c077" integrity sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg== -is-string@^1.0.5, is-string@^1.0.6, is-string@^1.0.7: +is-string@^1.0.5, is-string@^1.0.6: version "1.0.7" resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.7.tgz#0dd12bf2006f255bb58f695110eff7491eebc0fd" integrity sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg== @@ -8212,17 +8147,6 @@ is-symbol@^1.0.2, is-symbol@^1.0.3: dependencies: has-symbols "^1.0.2" -is-typed-array@^1.1.3, is-typed-array@^1.1.7: - version "1.1.8" - resolved "https://registry.yarnpkg.com/is-typed-array/-/is-typed-array-1.1.8.tgz#cbaa6585dc7db43318bc5b89523ea384a6f65e79" - integrity sha512-HqH41TNZq2fgtGT8WHVFVJhBVGuY3AnP3Q36K8JKXUxSxRgk/d+7NjmwG2vo2mYmXK8UYZKu0qH8bVP5gEisjA== - dependencies: - available-typed-arrays "^1.0.5" - call-bind "^1.0.2" - es-abstract "^1.18.5" - foreach "^2.0.5" - has-tostringtag "^1.0.0" - is-typedarray@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" @@ -8238,13 +8162,6 @@ is-uuid@^1.0.2: resolved "https://registry.yarnpkg.com/is-uuid/-/is-uuid-1.0.2.tgz#ad1898ddf154947c25c8e54966f48604e9caecc4" integrity sha1-rRiY3fFUlHwlyOVJZvSGBOnK7MQ= -is-weakref@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-weakref/-/is-weakref-1.0.1.tgz#842dba4ec17fa9ac9850df2d6efbc1737274f2a2" - integrity sha512-b2jKc2pQZjaeFYWEf7ScFj+Be1I+PXmlu572Q8coTXZ+LD/QQZ7ShPMst8h16riVgyXTQwUsFEl74mDvc/3MHQ== - dependencies: - call-bind "^1.0.0" - is-what@^3.12.0: version "3.14.1" resolved "https://registry.yarnpkg.com/is-what/-/is-what-3.14.1.tgz#e1222f46ddda85dead0fd1c9df131760e77755c1" @@ -10000,11 +9917,6 @@ mime-db@1.49.0, "mime-db@>= 1.43.0 < 2": resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.49.0.tgz#f3dfde60c99e9cf3bc9701d687778f537001cbed" integrity sha512-CIc8j9URtOVApSFCQIF+VBkX1RwXp/oMMOrqdyXSBXq5RWNEsRfyj1kiRnQgmNXmHxPoFIxOroKA3zcU9P+nAA== -mime-db@1.50.0: - version "1.50.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.50.0.tgz#abd4ac94e98d3c0e185016c67ab45d5fde40c11f" - integrity sha512-9tMZCDlYHqeERXEHO9f/hKfNXhre5dK2eE/krIvUjZbS2KPcqGDfNShIWS1uW9XOTKQKqK6qbeOci18rbfW77A== - mime-types@^2.1.12, mime-types@^2.1.27, mime-types@^2.1.32, mime-types@~2.1.17, mime-types@~2.1.24: version "2.1.32" resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.32.tgz#1d00e89e7de7fe02008db61001d9e02852670fd5" @@ -10012,13 +9924,6 @@ mime-types@^2.1.12, mime-types@^2.1.27, mime-types@^2.1.32, mime-types@~2.1.17, dependencies: mime-db "1.49.0" -mime-types@^2.1.30: - version "2.1.33" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.33.tgz#1fa12a904472fafd068e48d9e8401f74d3f70edb" - integrity sha512-plLElXp7pRDd0bNZHw+nMd52vRYjLwQjygaNg7ddJ2uJtTlmnTCjWuPKxVu6//AdaRuME84SvLW91sIkBqGT0g== - dependencies: - mime-db "1.50.0" - mime@1.6.0, mime@^1.4.1: version "1.6.0" resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" @@ -10029,6 +9934,11 @@ mime@^2.4.4, mime@^2.4.6: resolved "https://registry.yarnpkg.com/mime/-/mime-2.5.2.tgz#6e3dc6cc2b9510643830e5f19d5cb753da5eeabe" integrity sha512-tqkh47FzKeCPD2PUiPB6pkbMzsCasjxAfC62/Wap5qrUWcb+sFasXUC5I3gYM5iBM8v/Qpn4UK0x+j0iHyFPDg== +mime@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/mime/-/mime-3.0.0.tgz#b374550dca3a0c18443b0c950a6a58f1931cf7a7" + integrity sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A== + mimic-fn@^1.0.0: version "1.2.0" resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" @@ -10380,7 +10290,7 @@ node-libs-browser@^2.2.1: util "^0.11.0" vm-browserify "^1.0.1" -node-localstorage@^2.1.6: +node-localstorage@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/node-localstorage/-/node-localstorage-2.2.1.tgz#869723550a4883e426cb391d2df0b563a51c7c1c" integrity sha512-vv8fJuOUCCvSPjDjBLlMqYMHob4aGjkmrkaE42/mZr0VT+ZAU10jRF8oTnX9+pgU9/vYJ8P7YT3Vd6ajkmzSCw== @@ -14010,7 +13920,7 @@ slide@^1.1.5: resolved "https://registry.yarnpkg.com/slide/-/slide-1.1.6.tgz#56eb027d65b4d2dce6cb2e2d32c4d4afc9e1d707" integrity sha1-VusCfWW00tzmyy4tMsTUr8nh1wc= -smart-buffer@^4.1.0: +smart-buffer@^4.1.0, smart-buffer@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/smart-buffer/-/smart-buffer-4.2.0.tgz#6e1d71fa4f18c05f7d0ff216dd16a481d0e8d9ae" integrity sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg== @@ -14075,7 +13985,7 @@ socks-proxy-agent@5, socks-proxy-agent@^5.0.0: debug "4" socks "^2.3.3" -socks@^2.3.3, socks@^2.6.1: +socks@^2.3.3: version "2.6.1" resolved "https://registry.yarnpkg.com/socks/-/socks-2.6.1.tgz#989e6534a07cf337deb1b1c94aaa44296520d30e" integrity sha512-kLQ9N5ucj8uIcxrDwjm0Jsqk06xdpBjGNQtpXy4Q8/QY2k+fY7nZH8CARy+hkbG+SGAovmzzuauCpBlb8FrnBA== @@ -14083,6 +13993,14 @@ socks@^2.3.3, socks@^2.6.1: ip "^1.1.5" smart-buffer "^4.1.0" +socks@^2.6.2: + version "2.6.2" + resolved "https://registry.yarnpkg.com/socks/-/socks-2.6.2.tgz#ec042d7960073d40d94268ff3bb727dc685f111a" + integrity sha512-zDZhHhZRY9PxRruRMR7kMhnf3I8hDs4S3f9RecfnGxvcBHQcKcIH/oUcEWffsfl1XxdYlA7nnlGbbTvPz9D8gA== + dependencies: + ip "^1.1.5" + smart-buffer "^4.2.0" + sort-keys@^1.0.0: version "1.1.2" resolved "https://registry.yarnpkg.com/sort-keys/-/sort-keys-1.1.2.tgz#441b6d4d346798f1b4e49e8920adfba0e543f9ad" @@ -15515,18 +15433,6 @@ util@^0.11.0: dependencies: inherits "2.0.3" -util@^0.12.4: - version "0.12.4" - resolved "https://registry.yarnpkg.com/util/-/util-0.12.4.tgz#66121a31420df8f01ca0c464be15dfa1d1850253" - integrity sha512-bxZ9qtSlGUWSOy9Qa9Xgk11kSslpuZwaxCg4sNIDj6FLucDab2JxnHwyNTCpHMtK1MjoQiWQ6DiUMZYbSrO+Sw== - dependencies: - inherits "^2.0.3" - is-arguments "^1.0.4" - is-generator-function "^1.0.7" - is-typed-array "^1.1.3" - safe-buffer "^5.1.2" - which-typed-array "^1.1.2" - utila@~0.4: version "0.4.0" resolved "https://registry.yarnpkg.com/utila/-/utila-0.4.0.tgz#8a16a05d445657a3aea5eecc5b12a4fa5379772c" @@ -15846,18 +15752,6 @@ which-module@^2.0.0: resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho= -which-typed-array@^1.1.2: - version "1.1.7" - resolved "https://registry.yarnpkg.com/which-typed-array/-/which-typed-array-1.1.7.tgz#2761799b9a22d4b8660b3c1b40abaa7739691793" - integrity sha512-vjxaB4nfDqwKI0ws7wZpxIlde1XrLX5uB0ZjpfshgmapJMD7jJWhZI+yToJTqaFByF0eNBcYxbjmCzoRP7CfEw== - dependencies: - available-typed-arrays "^1.0.5" - call-bind "^1.0.2" - es-abstract "^1.18.5" - foreach "^2.0.5" - has-tostringtag "^1.0.0" - is-typed-array "^1.1.7" - which@^1.2.9, which@^1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" From 20a1ac1e4f7f70d8f0275e263831b6eff4e455ca Mon Sep 17 00:00:00 2001 From: M Gilang Januar Date: Tue, 29 Mar 2022 14:27:38 +0700 Subject: [PATCH 06/13] fix download interface after update dep --- server/src/api/v1/Files.ts | 2 +- web/src/utils/Download.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/server/src/api/v1/Files.ts b/server/src/api/v1/Files.ts index 05835d8b6..63d12f059 100644 --- a/server/src/api/v1/Files.ts +++ b/server/src/api/v1/Files.ts @@ -862,7 +862,7 @@ export class Files { } return updateProgess })() - }) + } as any) let trial = 0 while (trial < PROCESS_RETRY) { diff --git a/web/src/utils/Download.ts b/web/src/utils/Download.ts index fb1fa7b23..4ac4e01b8 100644 --- a/web/src/utils/Download.ts +++ b/web/src/utils/Download.ts @@ -50,7 +50,7 @@ export async function download(id: string): Promise { } return updateProgess })() - }) + } as any) data = await getData() controller.enqueue(data) } From 6240912c399db16a412b95fe88d70f695a0f1c5d Mon Sep 17 00:00:00 2001 From: M Gilang Januar Date: Tue, 29 Mar 2022 14:32:39 +0700 Subject: [PATCH 07/13] update .gitignore --- .gitignore | 3 +-- .npmrc | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 .npmrc diff --git a/.gitignore b/.gitignore index 462a0188f..7882cd501 100644 --- a/.gitignore +++ b/.gitignore @@ -10,5 +10,4 @@ lab/ sessions/ *.crt dump\.rdb -*.log -.npmrc \ No newline at end of file +*.log \ No newline at end of file diff --git a/.npmrc b/.npmrc new file mode 100644 index 000000000..8fe9e00d9 --- /dev/null +++ b/.npmrc @@ -0,0 +1,2 @@ +@mgilangjanuar:registry=https://npm.pkg.github.com/ +//npm.pkg.github.com/:_authToken=${NPM_TOKEN} From 547427e6577801505cd8ed1df5504bc569b5f9f5 Mon Sep 17 00:00:00 2001 From: M Gilang Januar Date: Tue, 29 Mar 2022 14:48:49 +0700 Subject: [PATCH 08/13] fix clear localstorage if 401 on /me --- web/src/pages/components/Navbar.tsx | 8 +++----- web/src/pages/dashboard/index.tsx | 1 + 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/web/src/pages/components/Navbar.tsx b/web/src/pages/components/Navbar.tsx index 76927da84..7c7b1fa76 100644 --- a/web/src/pages/components/Navbar.tsx +++ b/web/src/pages/components/Navbar.tsx @@ -44,12 +44,10 @@ const Navbar: React.FC = ({ user }) => { {user ? <>{/\/dashboard/.test(pathname) ? <> - {/*
+
Bandwidth: { } - {user?.plan === 'premium' ? Unlimited : You can download up to {prettyBytes(Math.max(0, 1_500_000_000 - Number(usage?.usage.usage) || 0))} until {moment(usage?.usage.expire).local().format('lll')}}> - - } -
*/} + Unlimited +
{ setPopoverVisibility(false) if (key === 'settings') { diff --git a/web/src/pages/dashboard/index.tsx b/web/src/pages/dashboard/index.tsx index f8092a333..086f9042e 100644 --- a/web/src/pages/dashboard/index.tsx +++ b/web/src/pages/dashboard/index.tsx @@ -105,6 +105,7 @@ const Dashboard: React.FC = ({ match }) useEffect(() => { if (errorMe) { + window.localStorage.clear() history.replace('/login') } }, [errorMe]) From 68c2eaf3c529e32b6c4d00528222129a5c34007d Mon Sep 17 00:00:00 2001 From: M Gilang Januar Date: Tue, 29 Mar 2022 15:47:43 +0700 Subject: [PATCH 09/13] 2.0.2 --- package.json | 2 +- server/package.json | 4 ++-- web/package.json | 4 ++-- web/src/utils/Constant.ts | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 9025a5237..f32270e4c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "teledrive", - "version": "2.0.1", + "version": "2.0.2", "repository": "git@github.com:mgilangjanuar/teledrive.git", "author": "M Gilang Januar ", "license": "MIT", diff --git a/server/package.json b/server/package.json index 65676687f..fa02fce8b 100644 --- a/server/package.json +++ b/server/package.json @@ -1,6 +1,6 @@ { "name": "server", - "version": "2.0.1", + "version": "2.0.2", "main": "dist/index.js", "license": "MIT", "private": true, @@ -86,4 +86,4 @@ "rimraf": "^3.0.2", "typescript": "^4.4.2" } -} +} \ No newline at end of file diff --git a/web/package.json b/web/package.json index 42755f163..c9ce39fd9 100644 --- a/web/package.json +++ b/web/package.json @@ -1,6 +1,6 @@ { "name": "web", - "version": "2.0.1", + "version": "2.0.2", "private": true, "dependencies": { "@ideasio/add-to-homescreen-react": "^1.0.10", @@ -107,4 +107,4 @@ "workbox-strategies": "^5.1.3", "workbox-streams": "^5.1.3" } -} +} \ No newline at end of file diff --git a/web/src/utils/Constant.ts b/web/src/utils/Constant.ts index 8a03a5f8f..f2b139c2b 100644 --- a/web/src/utils/Constant.ts +++ b/web/src/utils/Constant.ts @@ -1,4 +1,4 @@ -export const VERSION = '2.0.1' +export const VERSION = '2.0.2' export const MAX_UPLOAD_SIZE = 2_000_000_000 export const CHUNK_SIZE = 512 * 1024 export const RETRY_COUNT = 50 \ No newline at end of file From dd67f1c40004a427d61a537e79a1c2469a8b4946 Mon Sep 17 00:00:00 2001 From: M Gilang Januar Date: Tue, 29 Mar 2022 17:13:24 +0700 Subject: [PATCH 10/13] update @mgilangjanuar/telegram to teledrive-client --- Dockerfile | 8 ++-- server/package.json | 4 +- server/src/Types.ts | 2 +- server/src/api/middlewares/Auth.ts | 6 +-- server/src/api/middlewares/TGClient.ts | 6 +-- server/src/api/middlewares/TGSessionAuth.ts | 6 +-- server/src/api/v1/Auth.ts | 10 ++--- server/src/api/v1/Dialogs.ts | 2 +- server/src/api/v1/Files.ts | 6 +-- server/src/api/v1/Messages.ts | 2 +- server/src/api/v1/Users.ts | 2 +- web/package.json | 4 +- web/src/pages/Login.tsx | 6 +-- web/src/pages/Settings.tsx | 2 +- web/src/pages/dashboard/components/Upload.tsx | 2 +- web/src/utils/Download.ts | 2 +- web/src/utils/Telegram.ts | 4 +- yarn.lock | 44 +++++++++---------- 18 files changed, 60 insertions(+), 58 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6cb209e66..515cbf57e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,9 +5,11 @@ WORKDIR /apps COPY yarn.lock . COPY package.json . -RUN echo "//npm.pkg.github.com/:_authToken=${NPM_TOKEN}" > ~/.npmrc && \ - echo "@mgilangjanuar:registry=https://npm.pkg.github.com/" >> ~/.npmrc -RUN npm i npm@latest && npm i react-scripts -g --force --silent && npm i typescript --force +COPY server/package.json server/package.json +COPY web/package.json web/package.json +# RUN echo "//npm.pkg.github.com/:_authToken=${NPM_TOKEN}" > ~/.npmrc && \ +# echo "@mgilangjanuar:registry=https://npm.pkg.github.com/" >> ~/.npmrc +# RUN npm i npm@latest && npm i react-scripts -g --force --silent && npm i typescript --force RUN yarn install RUN rm -f ~/.npmrc COPY . . diff --git a/server/package.json b/server/package.json index fa02fce8b..51cb16b48 100644 --- a/server/package.json +++ b/server/package.json @@ -9,7 +9,6 @@ "build": "tsc" }, "dependencies": { - "@mgilangjanuar/telegram": "^2.5.44", "@sentry/node": "^6.14.1", "@sentry/tracing": "^6.14.1", "@types/moment": "^2.13.0", @@ -47,6 +46,7 @@ "redis": "^4.0.1", "serialize-error": "^8.1.0", "source-map-support": "^0.5.19", + "teledrive-client": "^2.5.47", "typeorm": "^0.2.41", "typeorm-naming-strategies": "^2.0.0", "uuid-random": "^1.3.2" @@ -86,4 +86,4 @@ "rimraf": "^3.0.2", "typescript": "^4.4.2" } -} \ No newline at end of file +} diff --git a/server/src/Types.ts b/server/src/Types.ts index 82dede790..ec4511e03 100644 --- a/server/src/Types.ts +++ b/server/src/Types.ts @@ -1,4 +1,4 @@ -import { TelegramClient } from '@mgilangjanuar/telegram' +import { TelegramClient } from 'teledrive-client' import { Users } from './model/entities/Users' declare module 'http' { diff --git a/server/src/api/middlewares/Auth.ts b/server/src/api/middlewares/Auth.ts index 62e0bd60f..84413f169 100644 --- a/server/src/api/middlewares/Auth.ts +++ b/server/src/api/middlewares/Auth.ts @@ -1,6 +1,6 @@ -import { Logger, TelegramClient } from '@mgilangjanuar/telegram' -import { LogLevel } from '@mgilangjanuar/telegram/extensions/Logger' -import { StringSession } from '@mgilangjanuar/telegram/sessions' +import { Logger, TelegramClient } from 'teledrive-client' +import { LogLevel } from 'teledrive-client/extensions/Logger' +import { StringSession } from 'teledrive-client/sessions' import { NextFunction, Request, Response } from 'express' import { verify } from 'jsonwebtoken' import { Users } from '../../model/entities/Users' diff --git a/server/src/api/middlewares/TGClient.ts b/server/src/api/middlewares/TGClient.ts index 780dd733c..b97cbba0c 100644 --- a/server/src/api/middlewares/TGClient.ts +++ b/server/src/api/middlewares/TGClient.ts @@ -1,6 +1,6 @@ -import { Logger, TelegramClient } from '@mgilangjanuar/telegram' -import { LogLevel } from '@mgilangjanuar/telegram/extensions/Logger' -import { StringSession } from '@mgilangjanuar/telegram/sessions' +import { Logger, TelegramClient } from 'teledrive-client' +import { LogLevel } from 'teledrive-client/extensions/Logger' +import { StringSession } from 'teledrive-client/sessions' import { NextFunction, Request, Response } from 'express' import { CONNECTION_RETRIES, TG_CREDS } from '../../utils/Constant' diff --git a/server/src/api/middlewares/TGSessionAuth.ts b/server/src/api/middlewares/TGSessionAuth.ts index 03606b863..03098e656 100644 --- a/server/src/api/middlewares/TGSessionAuth.ts +++ b/server/src/api/middlewares/TGSessionAuth.ts @@ -1,6 +1,6 @@ -import { Logger, TelegramClient } from '@mgilangjanuar/telegram' -import { LogLevel } from '@mgilangjanuar/telegram/extensions/Logger' -import { StringSession } from '@mgilangjanuar/telegram/sessions' +import { Logger, TelegramClient } from 'teledrive-client' +import { LogLevel } from 'teledrive-client/extensions/Logger' +import { StringSession } from 'teledrive-client/sessions' import { NextFunction, Request, Response } from 'express' import { verify } from 'jsonwebtoken' import { CONNECTION_RETRIES, TG_CREDS } from '../../utils/Constant' diff --git a/server/src/api/v1/Auth.ts b/server/src/api/v1/Auth.ts index df7cfcdc1..f8deaeaa2 100644 --- a/server/src/api/v1/Auth.ts +++ b/server/src/api/v1/Auth.ts @@ -1,8 +1,8 @@ -import { Api, Logger, TelegramClient } from '@mgilangjanuar/telegram' -import { LogLevel } from '@mgilangjanuar/telegram/extensions/Logger' -import { generateRandomBytes } from '@mgilangjanuar/telegram/Helpers' -import { computeCheck } from '@mgilangjanuar/telegram/Password' -import { StringSession } from '@mgilangjanuar/telegram/sessions' +import { Api, Logger, TelegramClient } from 'teledrive-client' +import { LogLevel } from 'teledrive-client/extensions/Logger' +import { generateRandomBytes } from 'teledrive-client/Helpers' +import { computeCheck } from 'teledrive-client/Password' +import { StringSession } from 'teledrive-client/sessions' import { AES } from 'crypto-js' import { Request, Response } from 'express' import { sign, verify } from 'jsonwebtoken' diff --git a/server/src/api/v1/Dialogs.ts b/server/src/api/v1/Dialogs.ts index e6a82c29f..a47f5f4c7 100644 --- a/server/src/api/v1/Dialogs.ts +++ b/server/src/api/v1/Dialogs.ts @@ -1,4 +1,4 @@ -import { Api } from '@mgilangjanuar/telegram' +import { Api } from 'teledrive-client' import bigInt from 'big-integer' import { Request, Response } from 'express' import { Redis } from '../../service/Cache' diff --git a/server/src/api/v1/Files.ts b/server/src/api/v1/Files.ts index 63d12f059..72c044d65 100644 --- a/server/src/api/v1/Files.ts +++ b/server/src/api/v1/Files.ts @@ -1,6 +1,6 @@ -import { Api, Logger, TelegramClient } from '@mgilangjanuar/telegram' -import { LogLevel } from '@mgilangjanuar/telegram/extensions/Logger' -import { StringSession } from '@mgilangjanuar/telegram/sessions' +import { Api, Logger, TelegramClient } from 'teledrive-client' +import { LogLevel } from 'teledrive-client/extensions/Logger' +import { StringSession } from 'teledrive-client/sessions' import bigInt from 'big-integer' import contentDisposition from 'content-disposition' import { AES, enc } from 'crypto-js' diff --git a/server/src/api/v1/Messages.ts b/server/src/api/v1/Messages.ts index 65b2344f3..426d2763e 100644 --- a/server/src/api/v1/Messages.ts +++ b/server/src/api/v1/Messages.ts @@ -1,4 +1,4 @@ -import { Api } from '@mgilangjanuar/telegram' +import { Api } from 'teledrive-client' import bigInt from 'big-integer' import { Request, Response } from 'express' import { Redis } from '../../service/Cache' diff --git a/server/src/api/v1/Users.ts b/server/src/api/v1/Users.ts index 95e92cdd6..2fc92eb24 100644 --- a/server/src/api/v1/Users.ts +++ b/server/src/api/v1/Users.ts @@ -1,4 +1,4 @@ -import { Api } from '@mgilangjanuar/telegram' +import { Api } from 'teledrive-client' import axios from 'axios' import { Request, Response } from 'express' import moment from 'moment' diff --git a/web/package.json b/web/package.json index c9ce39fd9..0682ab4c5 100644 --- a/web/package.json +++ b/web/package.json @@ -4,7 +4,6 @@ "private": true, "dependencies": { "@ideasio/add-to-homescreen-react": "^1.0.10", - "@mgilangjanuar/telegram": "^2.5.44", "antd": "4.18.3", "antd-country-phone-input": "^4.3.1", "axios": "^0.21.4", @@ -43,6 +42,7 @@ "streamsaver": "^2.0.5", "sw-precache-cra": "^1.0.0", "swr": "^1.0.0", + "teledrive-client": "^2.5.47", "through2": "^4.0.2", "typescript": "^4.0.3", "use-debounce": "^7.0.1", @@ -107,4 +107,4 @@ "workbox-strategies": "^5.1.3", "workbox-streams": "^5.1.3" } -} \ No newline at end of file +} diff --git a/web/src/pages/Login.tsx b/web/src/pages/Login.tsx index 29e8f807f..db6fdcdb0 100644 --- a/web/src/pages/Login.tsx +++ b/web/src/pages/Login.tsx @@ -1,7 +1,7 @@ import { ArrowRightOutlined, LoginOutlined } from '@ant-design/icons' -import { Api } from '@mgilangjanuar/telegram' -import { generateRandomBytes } from '@mgilangjanuar/telegram/Helpers' -import { computeCheck } from '@mgilangjanuar/telegram/Password' +import { Api } from 'teledrive-client' +import { generateRandomBytes } from 'teledrive-client/Helpers' +import { computeCheck } from 'teledrive-client/Password' import { Button, Card, Col, Form, Input, Layout, notification, Row, Spin, Steps, Typography } from 'antd' import CountryPhoneInput, { ConfigProvider } from 'antd-country-phone-input' import { useForm } from 'antd/lib/form/Form' diff --git a/web/src/pages/Settings.tsx b/web/src/pages/Settings.tsx index b9a4d51e9..4aebbfc4d 100644 --- a/web/src/pages/Settings.tsx +++ b/web/src/pages/Settings.tsx @@ -18,7 +18,7 @@ import { SyncOutlined, WarningOutlined } from '@ant-design/icons' -import { Api } from '@mgilangjanuar/telegram' +import { Api } from 'teledrive-client' import { Avatar, Button, diff --git a/web/src/pages/dashboard/components/Upload.tsx b/web/src/pages/dashboard/components/Upload.tsx index 2305a650c..9118a16f9 100644 --- a/web/src/pages/dashboard/components/Upload.tsx +++ b/web/src/pages/dashboard/components/Upload.tsx @@ -1,5 +1,5 @@ import { CloudUploadOutlined } from '@ant-design/icons' -import { Api } from '@mgilangjanuar/telegram' +import { Api } from 'teledrive-client' import { notification, Upload as BaseUpload } from 'antd' import mime from 'mime-types' import React, { useEffect, useRef } from 'react' diff --git a/web/src/utils/Download.ts b/web/src/utils/Download.ts index 4ac4e01b8..9708d7507 100644 --- a/web/src/utils/Download.ts +++ b/web/src/utils/Download.ts @@ -1,4 +1,4 @@ -import { Api } from '@mgilangjanuar/telegram' +import { Api } from 'teledrive-client' import bigInt from 'big-integer' import streamSaver from 'streamsaver' import { req } from './Fetcher' diff --git a/web/src/utils/Telegram.ts b/web/src/utils/Telegram.ts index 09f24dc45..2ef0f6592 100644 --- a/web/src/utils/Telegram.ts +++ b/web/src/utils/Telegram.ts @@ -1,5 +1,5 @@ -import { TelegramClient } from '@mgilangjanuar/telegram' -import { StringSession } from '@mgilangjanuar/telegram/sessions' +import { TelegramClient } from 'teledrive-client' +import { StringSession } from 'teledrive-client/sessions' import { notification } from 'antd' export const telegramClient = { diff --git a/yarn.lock b/yarn.lock index 14b5d8e54..110278efb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1687,28 +1687,6 @@ "@types/yargs" "^16.0.0" chalk "^4.0.0" -"@mgilangjanuar/telegram@^2.5.44": - version "2.5.44" - resolved "https://npm.pkg.github.com/download/@mgilangjanuar/telegram/2.5.44/cee00d3c92fd003c837e4a78e656047d50db73cd8adf3713fdf171ae84b30068#4dc784c63bfcf79e4c7f14d4a5ec211f8fb2403d" - integrity sha512-vaIME37btxOxK3dNiUv8C7irLfEkdqYSCl7TXClNAE575isuor76k7znOYw8mmLcLqu4+h2jaj3m1ivOG1RKdw== - dependencies: - "@cryptography/aes" "^0.1.1" - async-mutex "^0.3.0" - big-integer "^1.6.48" - buffer "^6.0.3" - htmlparser2 "^6.1.0" - mime "^3.0.0" - node-localstorage "^2.2.1" - pako "^2.0.3" - path-browserify "^1.0.1" - socks "^2.6.2" - store2 "^2.12.0" - ts-custom-error "^3.2.0" - websocket "^1.0.34" - optionalDependencies: - bufferutil "^4.0.3" - utf-8-validate "^5.0.5" - "@node-redis/client@^1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/@node-redis/client/-/client-1.0.1.tgz#ddca6021097ce1026fedc193cac8c36b05c6cad8" @@ -14656,6 +14634,28 @@ tar@^6.0.2: mkdirp "^1.0.3" yallist "^4.0.0" +teledrive-client@^2.5.47: + version "2.5.47" + resolved "https://registry.yarnpkg.com/teledrive-client/-/teledrive-client-2.5.47.tgz#eecf3fc43502292c3b31638fa45996b9af0abf22" + integrity sha512-uVEYAa66bhInaOfxm1YyfFINZDffOOrCyxPkOiFXjp/PHWN0BsV4DYhkfXHsJsEcrRnjCd5rewyw0Qi8EwFQyg== + dependencies: + "@cryptography/aes" "^0.1.1" + async-mutex "^0.3.0" + big-integer "^1.6.48" + buffer "^6.0.3" + htmlparser2 "^6.1.0" + mime "^3.0.0" + node-localstorage "^2.2.1" + pako "^2.0.3" + path-browserify "^1.0.1" + socks "^2.6.2" + store2 "^2.12.0" + ts-custom-error "^3.2.0" + websocket "^1.0.34" + optionalDependencies: + bufferutil "^4.0.3" + utf-8-validate "^5.0.5" + temp-dir@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/temp-dir/-/temp-dir-1.0.0.tgz#0a7c0ea26d3a39afa7e0ebea9c1fc0bc4daa011d" From ee35c3a1dca8ea8f94e1002c0db4f78f02e80a6a Mon Sep 17 00:00:00 2001 From: M Gilang Januar Date: Tue, 29 Mar 2022 17:19:23 +0700 Subject: [PATCH 11/13] remove docs to set npm_token --- .npmrc | 2 -- Dockerfile | 2 +- docker/.env.example | 2 -- docs/docs/Deployment/heroku.md | 14 -------------- docs/docs/Installation/docker.md | 1 - docs/docs/Installation/manual.md | 11 ----------- 6 files changed, 1 insertion(+), 31 deletions(-) delete mode 100644 .npmrc diff --git a/.npmrc b/.npmrc deleted file mode 100644 index 8fe9e00d9..000000000 --- a/.npmrc +++ /dev/null @@ -1,2 +0,0 @@ -@mgilangjanuar:registry=https://npm.pkg.github.com/ -//npm.pkg.github.com/:_authToken=${NPM_TOKEN} diff --git a/Dockerfile b/Dockerfile index 515cbf57e..2d073b2da 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,6 +11,6 @@ COPY web/package.json web/package.json # echo "@mgilangjanuar:registry=https://npm.pkg.github.com/" >> ~/.npmrc # RUN npm i npm@latest && npm i react-scripts -g --force --silent && npm i typescript --force RUN yarn install -RUN rm -f ~/.npmrc +# RUN rm -f ~/.npmrc COPY . . RUN yarn workspaces run build diff --git a/docker/.env.example b/docker/.env.example index a5470fee8..251ffe092 100644 --- a/docker/.env.example +++ b/docker/.env.example @@ -1,5 +1,3 @@ -NPM_TOKEN=your_github_token - # server configuration ENV=develop diff --git a/docs/docs/Deployment/heroku.md b/docs/docs/Deployment/heroku.md index 6092dbfe5..c6347c4f6 100644 --- a/docs/docs/Deployment/heroku.md +++ b/docs/docs/Deployment/heroku.md @@ -27,20 +27,6 @@ Get started by build all needed services. ```shell heroku git:remote -a [YOUR_APP_NAME] ``` -- Set NPM_TOKEN: - - Create a personal token from your [GitHub account](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token) with [these permissions](https://docs.github.com/en/packages/learn-github-packages/about-permissions-for-github-packages#about-scopes-and-permissions-for-package-registries) and set it as an environment variable: - - ```shell - heroku config:set NPM_TOKEN=[YOUR_TOKEN] - ``` - - Create `.npmrc` file in root project or run this command: - - ```shell - echo '@mgilangjanuar:registry=https://npm.pkg.github.com/' > .npmrc - echo '//npm.pkg.github.com/:_authToken=${NPM_TOKEN}' >> .npmrc - ``` ### Database preparation diff --git a/docs/docs/Installation/docker.md b/docs/docs/Installation/docker.md index 4aaa5f935..6881ff9b0 100644 --- a/docs/docs/Installation/docker.md +++ b/docs/docs/Installation/docker.md @@ -23,7 +23,6 @@ Get started by installing all needed services and define all variables. | env | required | description | | ---------------------- | -------- | ----------------------------------------------------------------- | - | NPM_TOKEN | yes | Your [GitHub personal token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token) with [these permissions](https://docs.github.com/en/packages/learn-github-packages/about-permissions-for-github-packages#about-scopes-and-permissions-for-package-registries) | | ENV | no | Hide the logs for production, default: develop | | TG_API_ID | yes | Application ID from your Telegram App | | TG_API_HASH | yes | Application hash from Telegram App | diff --git a/docs/docs/Installation/manual.md b/docs/docs/Installation/manual.md index 3c65d7adb..ad02c49ae 100644 --- a/docs/docs/Installation/manual.md +++ b/docs/docs/Installation/manual.md @@ -117,17 +117,6 @@ You need to create and import the database schema. **Note.** *If you follow the instructions above then you need to fill the server variables:* - `DATABASE_URL`: postgresql://postgres@localhost:5432/teledrive -### Provide a GitHub personal token - -Create a personal access token from your GitHub account: https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token with [these permissions](https://docs.github.com/en/packages/learn-github-packages/about-permissions-for-github-packages#about-scopes-and-permissions-for-package-registries) - -Create `~/.npmrc` and add these lines: - -```shell -//npm.pkg.github.com/:_authToken=[YOUR_GITHUB_PERSONAL_TOKEN] -@mgilangjanuar:registry=https://npm.pkg.github.com/ -``` - ### Dependencies installation Install all dependencies with yarn: From 10367666878be917aab93faff2ca300119f0fc0e Mon Sep 17 00:00:00 2001 From: M Gilang Januar Date: Tue, 29 Mar 2022 17:25:56 +0700 Subject: [PATCH 12/13] update docs and dockerfile --- docs/docs/Installation/docker.md | 15 ++++++++++----- docs/src/components/HomepageFeatures/index.js | 4 ++-- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/docs/docs/Installation/docker.md b/docs/docs/Installation/docker.md index 6881ff9b0..eac2e1296 100644 --- a/docs/docs/Installation/docker.md +++ b/docs/docs/Installation/docker.md @@ -37,7 +37,8 @@ Get started by installing all needed services and define all variables. Build and run with this command: ```shell -docker-compose -f docker/docker-compose.yml up -d +cd docker +docker-compose up -d ``` Done! You can now open [teledrive.localhost](http://teledrive.localhost) or [localhost:4000](http://localhost:4000) in your browser 🎊 @@ -45,7 +46,8 @@ Done! You can now open [teledrive.localhost](http://teledrive.localhost) or [loc View the app logs with this command: ```shell -docker-compose -f docker/docker-compose.yml logs app --follow +cd docker +docker-compose logs app --follow ``` **Note.** *You need to set `ENV=develop` in the variables to logging all events.* @@ -53,7 +55,8 @@ docker-compose -f docker/docker-compose.yml logs app --follow Stop the services by: ```shell -docker-compose -f docker/docker-compose.yml down +cd docker +docker-compose down ``` @@ -64,7 +67,8 @@ Upgrade to the latest version of TeleDrive with this command: ```shell git pull origin main # or, staging for the latest updates -docker-compose -f docker/docker-compose.yml up -d --build app +cd docker +docker-compose up -d --build app ``` ## Common Issues @@ -74,7 +78,8 @@ docker-compose -f docker/docker-compose.yml up -d --build app Try to up the services again with command: ```shell - docker-compose -f docker/docker-compose.yml up -d + cd docker + docker-compose up -d ``` Next, you need to reverse proxy the application to your domain with [Nginx](/docs/deployment/nginx). \ No newline at end of file diff --git a/docs/src/components/HomepageFeatures/index.js b/docs/src/components/HomepageFeatures/index.js index fd2f99f3a..51dd5a337 100644 --- a/docs/src/components/HomepageFeatures/index.js +++ b/docs/src/components/HomepageFeatures/index.js @@ -57,8 +57,8 @@ export default function HomepageFeatures() {

Easy Installation

                   $ git clone https://github.com/mgilangjanuar/teledrive.git
- $ cd teledrive
- $ docker-compose -f docker/docker-compose.yml up -d + $ cd teledrive/docker
+ $ docker-compose up -d

From 95f7b29f8d13fdc29a54574c79db029478fb81e1 Mon Sep 17 00:00:00 2001 From: M Gilang Januar Date: Tue, 29 Mar 2022 17:31:40 +0700 Subject: [PATCH 13/13] 2.0.3 --- package.json | 2 +- server/package.json | 4 ++-- web/package.json | 4 ++-- web/src/utils/Constant.ts | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index f32270e4c..bd084dd38 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "teledrive", - "version": "2.0.2", + "version": "2.0.3", "repository": "git@github.com:mgilangjanuar/teledrive.git", "author": "M Gilang Januar ", "license": "MIT", diff --git a/server/package.json b/server/package.json index 51cb16b48..fb086a9e8 100644 --- a/server/package.json +++ b/server/package.json @@ -1,6 +1,6 @@ { "name": "server", - "version": "2.0.2", + "version": "2.0.3", "main": "dist/index.js", "license": "MIT", "private": true, @@ -86,4 +86,4 @@ "rimraf": "^3.0.2", "typescript": "^4.4.2" } -} +} \ No newline at end of file diff --git a/web/package.json b/web/package.json index 0682ab4c5..11a0d5aba 100644 --- a/web/package.json +++ b/web/package.json @@ -1,6 +1,6 @@ { "name": "web", - "version": "2.0.2", + "version": "2.0.3", "private": true, "dependencies": { "@ideasio/add-to-homescreen-react": "^1.0.10", @@ -107,4 +107,4 @@ "workbox-strategies": "^5.1.3", "workbox-streams": "^5.1.3" } -} +} \ No newline at end of file diff --git a/web/src/utils/Constant.ts b/web/src/utils/Constant.ts index f2b139c2b..684540685 100644 --- a/web/src/utils/Constant.ts +++ b/web/src/utils/Constant.ts @@ -1,4 +1,4 @@ -export const VERSION = '2.0.2' +export const VERSION = '2.0.3' export const MAX_UPLOAD_SIZE = 2_000_000_000 export const CHUNK_SIZE = 512 * 1024 export const RETRY_COUNT = 50 \ No newline at end of file