Skip to content

Commit 0e1b733

Browse files
wowi42davlgd
authored andcommitted
Create a new guide for send, an alternative to WeTranfer
1 parent db1dce6 commit 0e1b733

File tree

1 file changed

+248
-0
lines changed

1 file changed

+248
-0
lines changed

content/guides/send.md

Lines changed: 248 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,248 @@
1+
---
2+
title: 'Send'
3+
description:
4+
tags:
5+
- guides
6+
keywords:
7+
-
8+
9+
draft: false
10+
type: docs
11+
---
12+
13+
{{< hextra/hero-subtitle >}}
14+
Simple, private file sharing. A fork of Mozilla's Firefox Send that allows you to encrypt and send files with links that automatically expire.
15+
{{< /hextra/hero-subtitle >}}
16+
17+
## Send architecture overview
18+
19+
[Send](https://github.com/timvisee/send) is a Node.js application that provides secure file sharing with automatic expiration. It uses Redis for metadata storage and supports multiple storage backends including local filesystem, S3-compatible services, and Google Cloud Storage.
20+
21+
```mermaid
22+
flowchart TD
23+
subgraph s1["Node.js"]
24+
n6["Send Application"]
25+
end
26+
n1["Redis"] --> s1
27+
s1 --> n1 & n4["S3/Cellar"]
28+
n4 --> s1
29+
n1@{ shape: cyl}
30+
n4@{ shape: rect}
31+
```
32+
33+
## Prerequisites
34+
35+
Before deploying Send on Clever Cloud, make sure you have:
36+
37+
- **Node.js 16.x** (required by Send)
38+
- **Redis** for metadata storage
39+
- **Cellar S3** for file storage
40+
- **Clever Tools CLI** ([documentation](https://www.clever-cloud.com/developers/doc/cli/))
41+
- **s3cmd** for bucket management
42+
- **Git**
43+
44+
## Installation and deployment
45+
46+
### 1. Clone and prepare the Send repository
47+
48+
Clone the Send repository and prepare it for deployment:
49+
50+
```bash
51+
# Clone the Send repository
52+
git clone https://github.com/timvisee/send.git
53+
cd send
54+
```
55+
56+
### 2. Create and configure Redis add-on
57+
58+
Create a Redis add-on first for metadata storage:
59+
60+
```bash
61+
# Create Redis addon
62+
clever addon create redis-addon --plan s_mono send-redis
63+
```
64+
65+
### 3. Create and configure Cellar S3 storage
66+
67+
Create the Cellar S3 addon for file storage:
68+
69+
```bash
70+
# Create Cellar addon
71+
clever addon create cellar-addon --plan S send-storage
72+
```
73+
74+
and configure a bucket for send "send-storage-bucket"
75+
76+
Check the docs for more information https://www.clever-cloud.com/developers/doc/addons/cellar/
77+
78+
#### Configure bucket policy for public read access
79+
80+
Create a `policy.json` file for public read access:
81+
82+
```json
83+
{
84+
"Id": "Policy1587216857769",
85+
"Version": "2012-10-17",
86+
"Statement": [
87+
{
88+
"Sid": "Stmt1587216727444",
89+
"Action": [
90+
"s3:GetObject"
91+
],
92+
"Effect": "Allow",
93+
"Resource": "arn:aws:s3:::send-storage-bucket/*",
94+
"Principal": "*"
95+
}
96+
]
97+
}
98+
```
99+
100+
Apply the policy using s3cmd:
101+
102+
```bash
103+
# Apply the public read policy
104+
s3cmd setpolicy ./policy.json s3://send-storage-bucket
105+
106+
# Verify the policy is applied
107+
s3cmd info s3://send-storage-bucket
108+
```
109+
110+
111+
### 4. Create and configure Node.js application
112+
113+
Create the Node.js application on Clever Cloud:
114+
115+
```bash
116+
# Create the Node.js app on Clever Cloud
117+
clever create --type node send-app
118+
119+
# Link Redis addon to the application
120+
clever service link-addon send-redis
121+
122+
# Link Cellar addon to the application
123+
clever service link-addon send-storage
124+
```
125+
126+
Set Node.js version and basic configuration:
127+
128+
```bash
129+
# Set Node.js version and environment
130+
clever env set CC_NODE_VERSION 16
131+
clever env set NODE_ENV production
132+
clever env set PORT 8080
133+
clever env set CC_POST_BUILD_HOOK "npm install && npm install -g rimraf && npm run build"
134+
```
135+
136+
### 5. Configure environment variables
137+
138+
First, get the IDs of the addons with `clever addon`.
139+
140+
Set Redis connection environment variables:
141+
142+
```bash
143+
# Redis configuration
144+
clever env set REDIS_DB 0
145+
```
146+
147+
All other variables are configured automatically.
148+
149+
Configure S3/Cellar storage (replace with actual values from `clever addon env <addon_id>`):
150+
151+
```bash
152+
# S3/Cellar configuration
153+
clever env set S3_BUCKET send-storage-bucket
154+
clever env set S3_ENDPOINT <CELLAR_ADDON_HOST>
155+
clever env set AWS_ACCESS_KEY_ID <CELLAR_ADDON_KEY_ID>
156+
clever env set AWS_SECRET_ACCESS_KEY <CELLAR_ADDON_KEY_SECRET>
157+
clever env set S3_USE_PATH_STYLE_ENDPOINT true
158+
```
159+
160+
Set Send application configuration:
161+
162+
get the current testing domain with `clever domain`, then
163+
164+
```bash
165+
# Base URL (replace with your test domain)
166+
clever env set BASE_URL https://<your-test-domain>
167+
168+
# File upload limits
169+
clever env set MAX_FILE_SIZE 2147483648
170+
clever env set MAX_FILES_PER_ARCHIVE 64
171+
clever env set MAX_ARCHIVES_PER_USER 16
172+
173+
# Download and expiration settings
174+
clever env set DEFAULT_EXPIRE_SECONDS 86400
175+
clever env set MAX_EXPIRE_SECONDS 604800
176+
clever env set DEFAULT_DOWNLOADS 1
177+
clever env set MAX_DOWNLOADS 100
178+
179+
# UI dropdown options
180+
clever env set DOWNLOAD_COUNTS "1,5,10,25,50,100"
181+
clever env set EXPIRE_TIMES_SECONDS "3600,86400,604800,2592000"
182+
```
183+
184+
### 6. Deploy the application
185+
186+
Deploy your Send application:
187+
188+
```bash
189+
190+
# Deploy to Clever Cloud
191+
clever deploy
192+
```
193+
194+
### 7. Set up custom domain (optional)
195+
196+
If you want to use a custom domain:
197+
198+
```bash
199+
# Add your custom domain
200+
clever domain add <your-custom-domain.com>
201+
202+
# Update the BASE_URL environment variable
203+
clever env set BASE_URL https://<your-custom-domain.com>
204+
205+
# Restart to apply new BASE_URL
206+
clever restart
207+
```
208+
209+
## Alternative configurations
210+
211+
### Custom branding (optional)
212+
213+
Customize the appearance of your Send instance:
214+
215+
```bash
216+
# Custom branding
217+
clever env set UI_COLOR_PRIMARY "#ff6600"
218+
clever env set UI_COLOR_ACCENT "#cc5200"
219+
clever env set CUSTOM_TITLE "My Send Instance"
220+
clever env set CUSTOM_DESCRIPTION "Secure file sharing for our organization"
221+
clever env set CUSTOM_FOOTER_TEXT "Powered by Send"
222+
clever env set CUSTOM_FOOTER_URL "https://example.com"
223+
```
224+
225+
## Common issues
226+
227+
**1. Redis connection failed:**
228+
- Verify Redis addon is linked: `clever service`
229+
- Check Redis environment variables: `clever env | grep REDIS`
230+
231+
**2. S3 upload fails:**
232+
- Verify bucket exists: `s3cmd ls`
233+
- Check S3 environment variables: `clever env | grep -E "(S3_|AWS_)"`
234+
- Verify bucket policy: `s3cmd info s3://your-bucket`
235+
236+
**3. Application won't start:**
237+
- Check logs: `clever logs`
238+
- Verify all required environment variables are set: `clever env`
239+
- Restart application: `clever restart`
240+
241+
## 🎓 Further Help
242+
243+
{{< cards >}}
244+
{{< card link="https://github.com/timvisee/send" title="Send GitHub Repository" subtitle="Source code and documentation" icon="code-bracket" >}}
245+
{{< card link="https://www.clever-cloud.com/developers/doc/cli/" title="Clever Cloud CLI" subtitle="CLI documentation and commands" icon="terminal" >}}
246+
{{< card link="https://www.clever-cloud.com/developers/doc/addons/cellar/" title="Cellar Documentation" subtitle="S3-compatible storage guide" icon="server" >}}
247+
{{< card link="https://github.com/timvisee/send/blob/master/docs/docker.md" title="Docker Documentation" subtitle="Container deployment guide" icon="cube" >}}
248+
{{< /cards >}}

0 commit comments

Comments
 (0)