Skip to content

Commit 498960c

Browse files
committed
Update send guide
1 parent 91b7dc8 commit 498960c

File tree

1 file changed

+218
-0
lines changed

1 file changed

+218
-0
lines changed

content/guides/send.md

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

0 commit comments

Comments
 (0)