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

Commit

Permalink
Merge branch 'staging'
Browse files Browse the repository at this point in the history
  • Loading branch information
birdup000 committed Jan 30, 2023
2 parents 6a800c2 + 64ada64 commit d30809b
Show file tree
Hide file tree
Showing 9 changed files with 106 additions and 18 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ Or, just send us an [issue](https://github.com/mgilangjanuar/teledrive/issues) f
## Deploy to Heroku
[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/mgilangjanuar/teledrive)

If you're experiencing issues check this https://github.com/mgilangjanuar/teledrive/issues/373

## Folder Structure

We using the monorepo structure with [yarn workspaces](https://classic.yarnpkg.com/en/docs/workspaces/).
Expand All @@ -53,6 +55,8 @@ We using the monorepo structure with [yarn workspaces](https://classic.yarnpkg.c
└── yarn.lock
```

## Community
[![img](https://user-images.githubusercontent.com/34012548/172031316-60d858c7-8401-42f3-9c73-0b75e80c8292.png)](https://discord.gg/PKNVJwAZnR)

<a href="https://discord.gg/PKNVJwAZnR"> <img src="https://user-images.githubusercontent.com/34012548/172031316-60d858c7-8401-42f3-9c73-0b75e80c8292.png" alt="discord"></a>

Expand Down
6 changes: 3 additions & 3 deletions api/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ app.use(cors({
]
}))
// app.use(compression())
app.use(json())
app.use(urlencoded({ extended: true }))
app.use(raw())
app.use(json({ limit: '100mb' }))
app.use(urlencoded({ extended: true, limit: '100mb' }))
app.use(raw({ limit: '100mb' }))
app.use(cookieParser())
if (process.env.ENV !== 'production') {
app.use(morgan('tiny'))
Expand Down
21 changes: 18 additions & 3 deletions docs/docs/Deployment/heroku.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,29 @@ sidebar_position: 4

For deployment to [Heroku](https://heroku.com/) you need to create an account first.

**Note.** *You need to clone TeleDrive in your local machine first.*
## Deployment
**Note.** *You need a github account to follow the next steps.*

- [Fork teledrive](https://github.com/mgilangjanuar/teledrive/fork)

- Copy your forked teledrive repository url

> _Make sure to copy the entire url with "https://"_
## One-click Deployment
![image](https://user-images.githubusercontent.com/42100404/180603080-abb10755-0d40-40b7-801a-1396877c31e1.png)

[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/mgilangjanuar/teledrive)
- Use this heroku template url

> _Replace "{forked-repo-url}" with your forked teledrive repository url_
```
https://dashboard.heroku.com/new?template={forked-repo-url}
```

**If you want to upgrade your application to the latest version, you can use these following steps:**

**Note.** *You need to clone TeleDrive in your local machine first.*

## Prerequisite

Get started by build all needed services.
Expand Down
14 changes: 7 additions & 7 deletions docs/docs/Installation/manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ If it's succeed you don't need to follow the steps below.
npm i -g yarn
```

- Define all server variables in `./server/.env`, you can copy from `./server/.env.example`
- Define all api variables in `./api/.env`, you can copy from `./api/.env.example`

```shell
cp ./server/.env.example ./server/.env
cp ./api/.env.example ./api/.env
```

Explanation:
Expand Down Expand Up @@ -104,7 +104,7 @@ You need to create and import the database schema.
CREATE DATABASE teledrive;
```

**Note.** *If you follow the instructions above then you need to fill the server variables:*
**Note.** *If you follow the instructions above then you need to fill the api variables:*
- `DATABASE_URL`: postgresql://postgres@localhost:5432/teledrive

### Dependencies installation
Expand All @@ -124,8 +124,8 @@ yarn workspaces run build
## Run:

```shell
yarn server prisma migrate deploy
cd server && node dist/index.js
yarn api prisma migrate deploy
cd api && node dist/index.js
```

Done! You can now open [localhost:4000](http://localhost:4000) in your browser 🎊
Expand All @@ -140,8 +140,8 @@ git pull origin main # or, staging for the latest updates
yarn install # install
yarn workspaces run build # build

yarn server prisma migrate deploy
cd server && node dist/index.js # run
yarn api prisma migrate deploy
cd api && node dist/index.js # run
```

Next, you can deploy TeleDrive with [Vercel](/docs/deployment/vercel) or [PM2](/docs/deployment/pm2).
45 changes: 45 additions & 0 deletions docs/docs/faq.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
sidebar_position: 1
---


# Frequently Asked Questions
Q: What is Teledrive?

A: Teledrive is a free cloud storage program that allows you to have free unlimited cloud using the Telegram API

Q: Bandwidth limits are there any?

A: No, Teledrive allows you to upload as much as you want without any bandwidth limit within the program.
_Free Heroku deployments do have a 2TB per month bandwidth limit_.

Q: File size limits are any?

A: No, Teledrive automatically splits up your files for your upload to Telegram.
_This way Teledrive doesn't have any file size limits._

Q: How long will my files be on Teledrive?

A: Telegram has automatic self-destruction if you don't use it in 6 months by default but you can set it to 1 year.
Keep your Telegram account active that way your files don't get deleted.

# **Docker Frequently Asked Questions**
Q: How do I start containers?

A: You will need to run this command
`$ cd teledrive/docker`
`$ docker-compose up -d`

Q: How much RAM do I need to host?

A: Minimum of 2.5GB of RAM (building requirement)

# **Manual installation Frequently Asked Questions**
Q: How much RAM do I need to host?

A: Minimum of 2.5GB of RAM (building requirement)

# **Heroku Deployment Frequently Asked Questions**
Q: How much bandwidth can I use for Heroku deployment?

A: Heroku provides 2TB per month for free deployment.
18 changes: 18 additions & 0 deletions docs/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ const config = {
href: 'https://github.com/mgilangjanuar/teledrive',
label: 'GitHub',
position: 'right',

},
{
href: 'https://opencollective.com/teledrive/contribute',
label: 'Donate',
position: 'right',
},
],
},
Expand All @@ -74,6 +80,10 @@ const config = {
label: 'Tutorial',
to: '/docs/intro',
},
{
label: 'FAQ',
to: '/docs/faq',
},
],
},
{
Expand All @@ -86,6 +96,10 @@ const config = {
{
label: 'Discord',
href: 'https://discord.gg/8v26KavKa4'
},
{
label: 'Youtube',
href: 'https://www.youtube.com/channel/UCg9WsNAHdOpo8SyM8JHGuZQ',
}
],
},
Expand All @@ -96,6 +110,10 @@ const config = {
label: 'GitHub',
href: 'https://github.com/mgilangjanuar/teledrive',
},
{
label: 'Donate',
href: 'https://opencollective.com/teledrive/contribute',
},
],
},
],
Expand Down
2 changes: 1 addition & 1 deletion install.docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ then
read -p "Enter your PORT: " PORT
PORT="${PORT:=4000}"

DB_PASSWORD=$(node -e "console.log(require('crypto').randomBytes(48).toString('base64'));")
DB_PASSWORD=$(node -e "console.log(require('crypto').randomBytes(48).toString('hex'));")

echo "ENV=$ENV" > docker/.env
echo "PORT=$PORT" >> docker/.env
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "teledrive",
"version": "2.5.1",
"version": "2.5.2",
"repository": "git@github.com:mgilangjanuar/teledrive.git",
"author": "M Gilang Januar <mgilangjanuar@teledriveapp.com>",
"license": "MIT",
Expand All @@ -18,4 +18,4 @@
"api"
],
"dependencies": {}
}
}
10 changes: 8 additions & 2 deletions web/src/pages/admin/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,17 @@ const Admin: FC<Props> = ({ me, errorMe }) => {
width: 350,
// responsive: ['md'],
},
{
title: 'Role',
dataIndex: 'role',
key: 'role',
render: (value: string, record) => <>{<Tag color="blue">{record.role}</Tag>}</>
},
{
title: 'Username',
dataIndex: 'username',
key: 'username',
render: (value: string, record) => <>{record.role && <Tag color="red">{record.role}</Tag>} {value}</>
render: (value: string, record) => <>{value}</>
},
{
title: 'Name',
Expand Down Expand Up @@ -268,4 +274,4 @@ const Admin: FC<Props> = ({ me, errorMe }) => {
</Layout>
}

export default Admin
export default Admin

1 comment on commit d30809b

@vercel
Copy link

@vercel vercel bot commented on d30809b Jan 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.