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 #318 from mgilangjanuar/staging
Browse files Browse the repository at this point in the history
Release v2.1.2
  • Loading branch information
mgilangjanuar authored Apr 13, 2022
2 parents 5102135 + 8cec166 commit ccd357d
Show file tree
Hide file tree
Showing 9 changed files with 90 additions and 4 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ Read here for full instructions: [teledriveapp.com](https://teledriveapp.com)

Or, just send us an [issue](https://github.com/mgilangjanuar/teledrive/issues) for reporting bugs and/or ask the questions, share your ideas, etc in [discussions](https://github.com/mgilangjanuar/teledrive/discussions).

## Deploy to Heroku
[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/mgilangjanuar/teledrive)

## Folder Structure

We using the monorepo structure with [yarn workspaces](https://classic.yarnpkg.com/en/docs/workspaces/).
Expand Down
61 changes: 61 additions & 0 deletions app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
"name": "TeleDrive",
"description": "Free cloud storage via telegram",
"keywords": [
"cloud",
"drive",
"telegram",
"free",
"storage",
"unlimited"
],
"website": "https://teledriveapp.com",
"repository": "https://github.com/mgilangjanuar/teledrive",

"addons": [
"heroku-postgresql"
],
"env": {
"ENV": {
"description": "Hide the logs for production, default: develop. Read more at: https://teledriveapp.com/docs/Deployment/heroku",
"required": false
},
"API_JWT_SECRET": {
"description": "Random string for encrypt JWT web token. Read more at: https://teledriveapp.com/docs/Deployment/heroku",
"required": true
},
"FILES_JWT_SECRET": {
"description": "Random string for encrypt public files.",
"required": true
},
"REACT_APP_API_URL": {
"description": "Base URL for the API, default: '' (empty string).",
"required": false
},
"REACT_APP_TG_API_HASH": {
"description": "Application hash from Telegram App (for experimental features).",
"required": true
},
"REACT_APP_TG_API_ID": {
"description": "Application ID from your Telegram App (for experimental features).",
"required": true
},
"TG_API_HASH": {
"description": "Application hash from Telegram App.",
"required": true
},
"TG_API_ID": {
"description": "Application ID from your Telegram App.",
"required": true
},
"ADMIN_USERNAME": {
"description": "Username Telegram for admin account.",
"required": true
},
"USE_PSQL_HEROKU": {
"description": "If we are using Heroku PSQL",
"required": true,
"value": "1"
}
}
}
2 changes: 2 additions & 0 deletions install.docker.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

set -e

if [ ! -f docker/.env ]
then
echo "Generating .env file..."
Expand Down
2 changes: 2 additions & 0 deletions install.manual.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

set -e

if [ ! -f server/.env ]
then
echo "Generating server/.env file..."
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.1.1",
"version": "2.1.2",
"repository": "[email protected]:mgilangjanuar/teledrive.git",
"author": "M Gilang Januar <[email protected]>",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion server/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "server",
"version": "2.1.1",
"version": "2.1.2",
"main": "dist/index.js",
"license": "MIT",
"private": true,
Expand Down
18 changes: 18 additions & 0 deletions server/src/api/v1/Auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ export class Auth {
}, { reload: true })
}

user.username = req.userAuth.username || req.userAuth.phone || phoneNumber || user.username
user.plan = 'premium'
await user.save()

const session = req.tg.session.save()
const auth = {
session,
Expand Down Expand Up @@ -159,6 +163,10 @@ export class Auth {
throw { status: 404, body: { error: 'User not found' } }
}

user.username = req.userAuth.username || req.userAuth.phone || user.username
user.plan = 'premium'
await user.save()

const session = req.tg.session.save()
const auth = {
session,
Expand Down Expand Up @@ -252,6 +260,10 @@ export class Auth {
}, { reload: true })
}

user.username = req.userAuth.username || req.userAuth.phone || user.username
user.plan = 'premium'
await user.save()

const session = req.tg.session.save()
const auth = {
session,
Expand Down Expand Up @@ -340,6 +352,9 @@ export class Auth {
tg_id: userAuth.id.toString()
}, { reload: true })
}
user.username = req.userAuth.username || req.userAuth.phone || user.username
user.plan = 'premium'
await user.save()
return buildResponse({ user })
}
return buildResponse({ data, result })
Expand All @@ -366,6 +381,9 @@ export class Auth {
tg_id: userAuth.id.toString()
}, { reload: true })
}
user.username = req.userAuth.username || req.userAuth.phone || user.username
user.plan = 'premium'
await user.save()
return buildResponse({ user })
}

Expand Down
2 changes: 1 addition & 1 deletion web/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "web",
"version": "2.1.1",
"version": "2.1.2",
"private": true,
"dependencies": {
"@ideasio/add-to-homescreen-react": "^1.0.10",
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.1.1'
export const VERSION = '2.1.2'
export const MAX_UPLOAD_SIZE = 2_000_000_000
export const CHUNK_SIZE = 512 * 1024
export const RETRY_COUNT = 50

0 comments on commit ccd357d

Please sign in to comment.