Skip to content
This repository has been archived by the owner on Apr 23, 2024. It is now read-only.

Commit

Permalink
Merge pull request #292 from mgilangjanuar/staging
Browse files Browse the repository at this point in the history
Release v2.0.3
  • Loading branch information
mgilangjanuar authored Mar 29, 2022
2 parents 03fb4b6 + ead13c7 commit 427decc
Show file tree
Hide file tree
Showing 25 changed files with 75 additions and 96 deletions.
10 changes: 6 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ 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
# RUN rm -f ~/.npmrc
COPY . .
RUN yarn workspaces run build
2 changes: 0 additions & 2 deletions docker/.env.example
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
NPM_TOKEN=your_github_token

# server configuration
ENV=develop

Expand Down
14 changes: 0 additions & 14 deletions docs/docs/Deployment/heroku.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
16 changes: 10 additions & 6 deletions docs/docs/Installation/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand All @@ -38,23 +37,26 @@ 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 🎊

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.*

Stop the services by:

```shell
docker-compose -f docker/docker-compose.yml down
cd docker
docker-compose down
```


Expand All @@ -65,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
Expand All @@ -75,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).
11 changes: 0 additions & 11 deletions docs/docs/Installation/manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions docs/src/components/HomepageFeatures/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ export default function HomepageFeatures() {
<h3>Easy Installation</h3>
<pre style={{ textAlign: 'left' }}>
$ git clone https://github.com/mgilangjanuar/teledrive.git<br />
$ cd teledrive<br />
$ docker-compose -f docker/docker-compose.yml up -d
$ cd teledrive/docker<br />
$ docker-compose up -d
</pre>
<p>
<Link className="button button--secondary" to="/docs/intro">
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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 <mgilangjanuar@teledriveapp.com>",
"license": "MIT",
Expand Down
4 changes: 2 additions & 2 deletions server/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "server",
"version": "2.0.2",
"version": "2.0.3",
"main": "dist/index.js",
"license": "MIT",
"private": true,
Expand All @@ -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",
Expand Down Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion server/src/Types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { TelegramClient } from '@mgilangjanuar/telegram'
import { TelegramClient } from 'teledrive-client'
import { Users } from './model/entities/Users'

declare module 'http' {
Expand Down
6 changes: 3 additions & 3 deletions server/src/api/middlewares/Auth.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
6 changes: 3 additions & 3 deletions server/src/api/middlewares/TGClient.ts
Original file line number Diff line number Diff line change
@@ -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'

Expand Down
6 changes: 3 additions & 3 deletions server/src/api/middlewares/TGSessionAuth.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
10 changes: 5 additions & 5 deletions server/src/api/v1/Auth.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
2 changes: 1 addition & 1 deletion server/src/api/v1/Dialogs.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
6 changes: 3 additions & 3 deletions server/src/api/v1/Files.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
2 changes: 1 addition & 1 deletion server/src/api/v1/Messages.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
2 changes: 1 addition & 1 deletion server/src/api/v1/Users.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
4 changes: 2 additions & 2 deletions web/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
{
"name": "web",
"version": "2.0.2",
"version": "2.0.3",
"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",
Expand Down Expand Up @@ -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",
Expand Down
6 changes: 3 additions & 3 deletions web/src/pages/Login.tsx
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
2 changes: 1 addition & 1 deletion web/src/pages/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
SyncOutlined,
WarningOutlined
} from '@ant-design/icons'
import { Api } from '@mgilangjanuar/telegram'
import { Api } from 'teledrive-client'
import {
Avatar,
Button,
Expand Down
2 changes: 1 addition & 1 deletion web/src/pages/dashboard/components/Upload.tsx
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
2 changes: 1 addition & 1 deletion web/src/utils/Constant.ts
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion web/src/utils/Download.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
4 changes: 2 additions & 2 deletions web/src/utils/Telegram.ts
Original file line number Diff line number Diff line change
@@ -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 = {
Expand Down
44 changes: 22 additions & 22 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 427decc

Please sign in to comment.