Skip to content

Commit b262952

Browse files
committed
upload_upgraded
0 parents  commit b262952

File tree

275 files changed

+24260
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

275 files changed

+24260
-0
lines changed

.babelrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
{
3+
"presets": ["@babel/env", "@babel/react"],
4+
"plugins": ["@babel/plugin-proposal-class-properties", "@babel/plugin-proposal-object-rest-spread"]
5+
}
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Docker Build and Push (Development)
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
build-and-push-dev:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
packages: write
14+
security-events: write
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
20+
- name: Docker Setup QEMU
21+
uses: docker/setup-qemu-action@v3
22+
id: qemu
23+
with:
24+
platforms: amd64,arm64
25+
26+
- name: Set up Docker Buildx
27+
uses: docker/setup-buildx-action@v3
28+
29+
- name: Log into ghcr.io registry
30+
uses: docker/login-action@v3
31+
with:
32+
registry: ghcr.io
33+
username: ${{ github.repository_owner }}
34+
password: ${{ secrets.GITHUB_TOKEN }}
35+
36+
- name: Log in to Docker Hub
37+
uses: docker/login-action@v3
38+
with:
39+
username: ${{ secrets.DOCKER_HUB_USERNAME }}
40+
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
41+
42+
- name: Build Docker Metadata
43+
id: docker-metadata
44+
uses: docker/metadata-action@v5
45+
with:
46+
images: |
47+
ghcr.io/subnub/mydrive
48+
docker.io/kylehoell/mydrive
49+
flavor: |
50+
latest=auto
51+
tags: |
52+
type=ref,event=branch
53+
type=sha,commit=${{ github.sha }}
54+
type=raw,value=dev,enable={{is_default_branch}}
55+
56+
- name: Push Service Image to repo
57+
uses: docker/build-push-action@v5
58+
with:
59+
context: .
60+
file: ./Dockerfile
61+
push: true
62+
provenance: mode=max
63+
tags: ${{ steps.docker-metadata.outputs.tags }}
64+
labels: ${{ steps.docker-metadata.outputs.labels }}
65+
platforms: linux/amd64,linux/arm64
66+
cache-from: type=gha,scope=${{ github.workflow }}
67+
cache-to: type=gha,mode=max,scope=${{ github.workflow }}

.github/workflows/docker-build.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Docker Build and Push (Production)
2+
3+
on:
4+
push:
5+
tags:
6+
- "v[0-9]+.[0-9]+.[0-9]+"
7+
workflow_dispatch:
8+
9+
jobs:
10+
build-and-push:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write
14+
packages: write
15+
security-events: write
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v4
20+
21+
- name: Docker Setup QEMU
22+
uses: docker/setup-qemu-action@v3
23+
id: qemu
24+
with:
25+
platforms: amd64,arm64
26+
27+
- name: Set up Docker Buildx
28+
uses: docker/setup-buildx-action@v3
29+
30+
- name: Log into ghcr.io registry
31+
uses: docker/login-action@v3
32+
with:
33+
registry: ghcr.io
34+
username: ${{ github.repository_owner }}
35+
password: ${{ secrets.GITHUB_TOKEN }}
36+
37+
- name: Log in to Docker Hub
38+
uses: docker/login-action@v3
39+
with:
40+
username: ${{ secrets.DOCKER_HUB_USERNAME }}
41+
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
42+
43+
- name: Build Docker Metadata
44+
id: docker-metadata
45+
uses: docker/metadata-action@v5
46+
with:
47+
images: |
48+
ghcr.io/subnub/mydrive
49+
docker.io/kylehoell/mydrive
50+
flavor: |
51+
latest=auto
52+
tags: |
53+
type=ref,event=tag
54+
type=sha,commit=${{ github.sha }}
55+
type=semver,pattern={{version}}
56+
type=raw,value=latest,enable={{is_default_branch}}
57+
58+
- name: Push Service Image to repo
59+
uses: docker/build-push-action@v5
60+
with:
61+
context: .
62+
file: ./Dockerfile
63+
push: true
64+
provenance: mode=max
65+
tags: ${{ steps.docker-metadata.outputs.tags }}
66+
labels: ${{ steps.docker-metadata.outputs.labels }}
67+
platforms: linux/amd64,linux/arm64
68+
cache-from: type=gha,scope=${{ github.workflow }}
69+
cache-to: type=gha,mode=max,scope=${{ github.workflow }}

.github/workflows/release-please.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: 'Release Please'
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: write
11+
pull-requests: write
12+
13+
jobs:
14+
release-please:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: googleapis/release-please-action@v4
18+
with:
19+
token: ${{ secrets.GITHUB_TOKEN }}
20+
release-type: node

.gitignore

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
node_modules/
2+
public/dist/
3+
config/dev.env
4+
config/prod.env
5+
config/test.env
6+
config/.env.development
7+
config/.env.test
8+
config/.env.production
9+
config/.env.test
10+
.env
11+
.env.development
12+
.env.test
13+
.env.production
14+
.well-known/
15+
.eslintrc.js
16+
.eslintrc.json
17+
changeEncrytionPassword/
18+
certificate.ca-bundle
19+
certificate.crt
20+
certificate.key
21+
package-lock.json
22+
._*
23+
.DS_Store
24+
dist/
25+
rds-combined-ca-bundle.pem
26+
docker-variables.env
27+
dist-frontend/
28+
dist-backend/
29+
stats.html

README.md

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
# ![Drive Homepage]
2+
3+
4+
5+
<div align="center">
6+
<h1>☁️ Drive</h1>
7+
<strong>Open Source cloud file storage server (Similar To Google Drive)</strong>
8+
</div>
9+
10+
## 🔍 Index
11+
12+
- [Features](#features)
13+
- [Tech stack](#tech-stack)
14+
- [Common installation issues](#common-installation-issues)
15+
16+
17+
<span id="features"></span>
18+
19+
## ⭐️ Features
20+
21+
- Upload Files
22+
- Download Files
23+
- Upload Folders
24+
- Download Folders
25+
- Photo, Video Viewer and Media Gallery
26+
- JWT (Access and Refresh Tokens)
27+
28+
<span id="tech-stack"></span>
29+
30+
## 👨‍🔬 Tech Stack
31+
32+
- React
33+
- Node.js
34+
- Express
35+
- MongoDB
36+
37+
<span id="running"></span>
38+
39+
> [!IMPORTANT]
40+
> Requirements
41+
> - Node.js (20 Recommended)
42+
> - MongoDB (Unless using a service like Atlas)
43+
> - FFMPEG (Optional, used for video thumbnails)
44+
> - build-essential package (If using linux)
45+
46+
1. Install dependencies
47+
48+
```sh
49+
npm install
50+
```
51+
52+
2. Create Environment Variables
53+
54+
You can find enviroment variable examples under: <br />
55+
[`backend/config`](backend/config) -> Backend Enviroment Variables
56+
[`src/config`](src/config) -> Frontend Enviroment Variables
57+
58+
Simply remove the .example from the end of the filename, and fill in the values.
59+
> Note: In most cases you will only have to change FE enviroment variables for development purposes.
60+
61+
3. Run the build command
62+
63+
```sh
64+
npm run build
65+
```
66+
67+
4. Start the server
68+
69+
```sh
70+
npm run start
71+
```
72+
73+
<span id="common-installation-issues"></span>
74+
75+
#### Possible installation issues
76+
77+
Make issue
78+
79+
```sh
80+
npm error gyp ERR! stack Error: not found: make
81+
```
82+
83+
This is because you do not have the build essentials installed which is required for Linux. You can install them by running the following command:
84+
85+
```sh
86+
sudo apt-get install build-essential
87+
```
88+
89+
Memory issue
90+
91+
```sh
92+
Aborted (core dumped)
93+
```
94+
95+
When running the `npm run build` command it may take more memory than node allows by default. You will get the above error in such a case. To fix this, you can run the following command instead when building:
96+
97+
```sh
98+
NODE_OPTIONS="--max-old-space-size=4096" npm run build
99+
```
100+
101+
102+
103+
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# Either remove the .example from the end of this filename.
2+
# Or create a new file with the same name, but without the .example extension.
3+
4+
# MongoDB URL: Connection string for your MongoDB database
5+
# example: mongodb://localhost:27017/mydrive
6+
MONGODB_URL=
7+
8+
# Database Type: Choose between "fs" and "s3", this specifies where the files will be stored.
9+
# fs = Filesystem
10+
# s3 = Amazon S3
11+
DB_TYPE=
12+
13+
# If using fs,
14+
# File Storage Directory: The directory where the files will be stored. Must be exact path.
15+
# PATH MUST END IN A SLASH
16+
# Example: /Users/kyle/mydrive/
17+
FS_DIRECTORY=
18+
19+
# If using s3,
20+
# S3 Data: The S3 bucket and key where the files will be stored.
21+
S3_ID=
22+
S3_KEY=
23+
S3_BUCKET=
24+
25+
# Encryiption Key (optional): The encryption key used to encrypt the files.
26+
# DO NOT LOSE OR FORGET THIS KEY AS ALL DATA WILL BE LOST IF YOU LOSE IT.
27+
# If you do not supply a key, the app will instead prompt you to type one into the terminal when you start the server.
28+
KEY=
29+
30+
# Ports (optional): The ports to run the server on.
31+
# HTTP_PORT: Default port is 3000
32+
# HTTPS_PORT: Default port is 8080
33+
HTTP_PORT=
34+
HTTPS_PORT=
35+
36+
# URL (optional): The URL to run the server on.
37+
# Most likely not needed, this changes the ip address/url express listens on.
38+
URL=
39+
40+
# Email verifcation (optional): If you want to enable email verification configure as so.
41+
# EMAIL_VERIFICATION=true
42+
# Remote URL: This refers to the URL sent in the verification email: Example https://mydrive-storage.com
43+
# Please navigate to the following link to verify your email address: {REMOTE_URL}/verify
44+
# Should NOT end with a slash
45+
EMAIL_VERIFICATION=
46+
EMAIL_DOMAIN=
47+
EMAIL_ADDRESS=
48+
EMAIL_API_KEY=
49+
EMAIL_HOST=
50+
REMOTE_URL=
51+
52+
# Access tokens, refresh, and cookie
53+
# These should be randomly generated in a secure manner.
54+
# If you lose these tokens, all users will be logged out.
55+
# You can also change these if you want to force all users to be logged out.
56+
# Each token should be a different string.
57+
# Example: sa4hQqJwGFLC1LJk59
58+
PASSWORD_ACCESS=
59+
PASSWORD_REFRESH=
60+
PASSWORD_COOKIE=
61+
62+
# Video thumbnails (optional): If you want to enable video thumbnails, configure as so.
63+
# Video thumbnail generation relies on ffmpeg, please ensure you have it installed.
64+
# VIDEO_THUMBNAILS_ENABLED=true
65+
VIDEO_THUMBNAILS_ENABLED=
66+
67+
# Video thumbnails continued (optional):
68+
# Sometimes generating a video thumbnail will fail with the default method.
69+
# If so you can choose to instead temporarily store the video in a directory, and generate a thumbnail from that.
70+
# WARNING: The file will be temporarily stored in this directory UNENCRYPTED.
71+
# Temp directory example: /Users/kyle/mydrive/temp/
72+
# Temp video thumbnail limit: The maximum size of a video thumbnail in bytes.
73+
# Example: 5000000000
74+
TEMP_DIRECTORY=
75+
TEMP_VIDEO_THUMBNAIL_LIMIT=
76+
77+
# Marks cookie generation as secure (Optional)
78+
# This is recommended and should be enabled if you are running the app on HTTPS.
79+
# SECURE_COOKIES=true
80+
SECURE_COOKIES=
81+
82+
# SSL (Optional): If you want to enable SSL, configure as so.
83+
# SSL=true
84+
# Place your SSL certificate files in the root directory of the project
85+
# With the names: certificate.crt, certificate.key, and certificate.ca-bundle;
86+
SSL=
87+
88+
# HTTPS cert paths (optional): If you need to change the paths of the https certs
89+
# You can do so with these env variables.
90+
# By default myDrive looks for certificate.crt, certificate.ca-bundle and certificate.key on the root of the project
91+
HTTPS_KEY_PATH=
92+
HTTPS_CA_PATH=
93+
HTTPS_CRT_PATH=
94+
95+
# Block account creation (optional): If you want to block account creation, configure as so, but after you create an account.
96+
# BLOCK_CREATE_ACCOUNT=true

0 commit comments

Comments
 (0)