smoonb 0.0.70 → 0.0.72
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.pt-BR.md +24 -0
- package/README.md +446 -352
- package/README.pt-BR.md +730 -0
- package/bin/smoonb.js +187 -128
- package/package.json +4 -2
- package/src/commands/backup/index.js +22 -13
- package/src/commands/backup/steps/06-storage.js +228 -5
- package/src/commands/backup/utils.js +25 -31
- package/src/commands/check.js +13 -8
- package/src/commands/config.js +142 -134
- package/src/commands/functions.js +14 -10
- package/src/commands/import.js +22 -19
- package/src/commands/restore/index.js +13 -12
- package/src/i18n/index.js +217 -0
- package/src/i18n/locales/en.json +251 -0
- package/src/i18n/locales/pt-BR.json +251 -0
- package/src/index.js +19 -18
- package/src/utils/banner.js +19 -16
- package/src/utils/prompt.js +4 -1
package/README.md
CHANGED
|
@@ -2,378 +2,461 @@
|
|
|
2
2
|
|
|
3
3
|
**Complete Supabase backup and migration tool**
|
|
4
4
|
|
|
5
|
-
Backup
|
|
5
|
+
Backup and restore: complete and simple, as it should be
|
|
6
6
|
|
|
7
|
-
> **
|
|
7
|
+
> **Note on commercial access:** Supa Moonbase will require account validation before executing operations (login + subscription verification) in a future phase. In this version, there is no authentication implemented — this README only presents the legal/commercial basis. Operational use will be governed by the [Terms of Service](https://smoonb.com/terms) and [Privacy Policy](https://smoonb.com/privacy).
|
|
8
8
|
|
|
9
|
-
**
|
|
9
|
+
**Read this in other languages:** [Português (Brasil)](README.pt-BR.md)
|
|
10
|
+
|
|
11
|
+
**Developed by:** Goalmoon Tecnologia LTDA
|
|
10
12
|
**Website:** https://smoonb.com
|
|
11
13
|
**GitHub:** https://github.com/almmello/smoonb
|
|
12
14
|
|
|
13
|
-
## 🎯
|
|
15
|
+
## 🎯 Objective
|
|
14
16
|
|
|
15
|
-
|
|
17
|
+
**smoonb** solves the problem of existing tools that only backup the PostgreSQL database, ignoring critical Supabase components.
|
|
16
18
|
|
|
17
|
-
## 📦
|
|
19
|
+
## 📦 Backup Components
|
|
18
20
|
|
|
19
|
-
|
|
21
|
+
smoonb performs a complete backup of all components of your Supabase project:
|
|
20
22
|
|
|
21
23
|
- ✅ **Database PostgreSQL** (backup completo via `pg_dumpall` + SQL separados, idêntico ao Dashboard)
|
|
22
24
|
- ✅ **Database Extensions and Settings** (extensões PostgreSQL e configurações)
|
|
23
25
|
- ✅ **Custom Roles** (roles personalizados do PostgreSQL)
|
|
24
26
|
- ✅ **Edge Functions** (download automático do servidor)
|
|
25
27
|
- ✅ **Auth Settings** (configurações de autenticação via Management API)
|
|
26
|
-
- ✅ **Storage Buckets** (metadados e
|
|
28
|
+
- ✅ **Storage Buckets** (backup completo: metadados, configurações e todos os arquivos via Management API + Supabase Client, cria ZIP no padrão do Dashboard)
|
|
27
29
|
- ✅ **Realtime Settings** (7 parâmetros capturados interativamente)
|
|
28
30
|
- ✅ **Supabase .temp** (arquivos temporários do Supabase CLI)
|
|
29
31
|
- ✅ **Migrations** (todas as migrations do projeto via `supabase migration fetch`)
|
|
30
32
|
|
|
31
|
-
## ⚠️
|
|
32
|
-
|
|
33
|
-
Ao usar o smoonb, você reconhece e concorda que o smoonb é fornecido "NO ESTADO EM QUE SE ENCONTRA" ("AS IS") e "CONFORME DISPONIBILIDADE", sem garantias de qualquer natureza—expressas, implícitas ou legais—incluindo, sem limitação, garantias de comercialização, adequação a um fim específico e não violação, na máxima extensão permitida pela lei aplicável.
|
|
34
|
-
|
|
35
|
-
Operações de backup e restauração envolvem riscos, os ambientes variam amplamente e não é possível prever ou validar todas as configurações dos usuários. Você é o único responsável por validar seu ambiente, manter cópias independentes e verificar os resultados antes de utilizá-los em produção.
|
|
33
|
+
## ⚠️ Universal Disclaimer / Aviso Legal Universal
|
|
36
34
|
|
|
37
|
-
|
|
35
|
+
By continuing, you acknowledge and agree that Supa Moonbase (smoonb) is provided "AS IS" and "AS AVAILABLE", with no warranties of any kind—express, implied, or statutory—including but not limited to merchantability, fitness for a particular purpose, and non-infringement, to the maximum extent permitted by applicable law. Backup and restore operations inherently carry risk, environments vary widely, and we cannot foresee or validate all user setups. You are solely responsible for validating your own environment, keeping independent copies, and verifying results before relying on them in production. We build Supa Moonbase (smoonb) on public, auditable, open-source repositories to help people simplify their workflows, but this does not create any warranty, promise of support, or service-level commitment.
|
|
38
36
|
|
|
39
|
-
**
|
|
37
|
+
**Limitation of liability** — To the maximum extent permitted by law, Goalmoon Tecnologia LTDA, its contributors, and licensors will not be liable for any indirect, incidental, special, consequential, exemplary, or punitive damages (including loss of data, interruption of business, or lost profits) arising from or related to the use of, inability to use, backup/restore operations performed by, or results produced by Supa Moonbase (smoonb). In any case, our aggregate liability for all claims relating to Supa Moonbase (smoonb) will not exceed the amount you paid for Supa Moonbase (smoonb) in the 12 months preceding the event. Nothing in this notice excludes or limits liability where such limits are prohibited by law, including (as applicable) for willful misconduct or gross negligence.
|
|
40
38
|
|
|
41
|
-
## 🚀
|
|
39
|
+
## 🚀 Installation
|
|
42
40
|
|
|
43
|
-
**⚠️
|
|
41
|
+
**⚠️ IMPORTANT: Install ONLY locally in the project!**
|
|
44
42
|
|
|
45
43
|
```bash
|
|
46
|
-
# ✅
|
|
44
|
+
# ✅ CORRECT - Install locally in the project
|
|
47
45
|
npm install smoonb
|
|
48
46
|
|
|
49
|
-
# ✅
|
|
47
|
+
# ✅ CORRECT - Use with npx
|
|
50
48
|
npx smoonb --help
|
|
51
49
|
|
|
52
|
-
# ❌
|
|
53
|
-
npm install -g smoonb # ←
|
|
50
|
+
# ❌ WRONG - DO NOT install globally
|
|
51
|
+
npm install -g smoonb # ← This will be blocked!
|
|
54
52
|
```
|
|
55
53
|
|
|
56
|
-
### 🔄
|
|
54
|
+
### 🔄 Update to Latest Version
|
|
57
55
|
|
|
58
|
-
|
|
56
|
+
To update smoonb to the latest available version:
|
|
59
57
|
|
|
60
58
|
```bash
|
|
61
|
-
#
|
|
59
|
+
# Update in current project
|
|
62
60
|
npm install smoonb@latest
|
|
63
61
|
```
|
|
64
62
|
|
|
65
|
-
**⚠️
|
|
63
|
+
**⚠️ IMPORTANT:** smoonb must be installed locally in the project. Using without installing (e.g., `npx smoonb@latest`) is not allowed.
|
|
66
64
|
|
|
67
|
-
**💡
|
|
68
|
-
- **🔒
|
|
69
|
-
- **📦
|
|
70
|
-
- **🔄
|
|
71
|
-
- **🛡️
|
|
65
|
+
**💡 Why local only?**
|
|
66
|
+
- **🔒 Security**: Avoids version conflicts
|
|
67
|
+
- **📦 Isolation**: Each project uses its own version
|
|
68
|
+
- **🔄 Updates**: Granular control per project
|
|
69
|
+
- **🛡️ Stability**: Prevents breaking other projects
|
|
72
70
|
|
|
73
|
-
## 📋
|
|
71
|
+
## 📋 Prerequisites
|
|
74
72
|
|
|
75
|
-
### 1. Docker Desktop (
|
|
73
|
+
### 1. Docker Desktop (REQUIRED)
|
|
76
74
|
```bash
|
|
77
|
-
#
|
|
75
|
+
# Install Docker Desktop
|
|
78
76
|
# Windows/macOS: https://docs.docker.com/desktop/install/
|
|
79
77
|
# Linux: https://docs.docker.com/engine/install/
|
|
80
78
|
|
|
81
|
-
#
|
|
79
|
+
# Verify if it's running
|
|
82
80
|
docker --version
|
|
83
81
|
docker ps
|
|
84
82
|
```
|
|
85
83
|
|
|
86
|
-
**⚠️
|
|
87
|
-
-
|
|
88
|
-
-
|
|
89
|
-
-
|
|
84
|
+
**⚠️ IMPORTANT:** Docker is required for:
|
|
85
|
+
- Database backup via `pg_dumpall` (compatible with Supabase Dashboard)
|
|
86
|
+
- Compression of `.backup.gz` files
|
|
87
|
+
- Restoration of `.backup` and `.backup.gz` backups
|
|
90
88
|
|
|
91
89
|
### 2. Supabase CLI
|
|
92
90
|
```bash
|
|
93
91
|
npm install -g supabase
|
|
94
92
|
```
|
|
95
93
|
|
|
96
|
-
### 3. Personal Access Token
|
|
97
|
-
|
|
94
|
+
### 3. Supabase Personal Access Token
|
|
95
|
+
You need to obtain a Supabase personal access token to use the Management API:
|
|
98
96
|
|
|
99
|
-
1.
|
|
100
|
-
2.
|
|
101
|
-
3.
|
|
102
|
-
4.
|
|
97
|
+
1. Visit: https://supabase.com/dashboard/account/tokens
|
|
98
|
+
2. Click "Generate new token"
|
|
99
|
+
3. Copy the token (format: `sbp_...`)
|
|
100
|
+
4. Add to `.env.local` as `SUPABASE_ACCESS_TOKEN`
|
|
103
101
|
|
|
104
|
-
## ⚙️
|
|
102
|
+
## ⚙️ Configuration
|
|
105
103
|
|
|
106
|
-
###
|
|
104
|
+
### Modern Method: `.env.local` (RECOMMENDED)
|
|
107
105
|
|
|
108
|
-
|
|
106
|
+
**smoonb** now uses `.env.local` for configuration, following industry standards. This makes the process simpler and more integrated with your workflow.
|
|
109
107
|
|
|
110
|
-
#### 1.
|
|
108
|
+
#### 1. Create or edit `.env.local` in the project root
|
|
111
109
|
|
|
112
110
|
```bash
|
|
113
|
-
#
|
|
111
|
+
# Create .env.local file
|
|
114
112
|
touch .env.local
|
|
115
113
|
```
|
|
116
114
|
|
|
117
|
-
#### 2.
|
|
115
|
+
#### 2. Add required environment variables
|
|
118
116
|
|
|
119
117
|
```env
|
|
120
|
-
# URLs
|
|
121
|
-
NEXT_PUBLIC_SUPABASE_URL=[
|
|
122
|
-
NEXT_PUBLIC_SUPABASE_ANON_KEY=[
|
|
123
|
-
SUPABASE_SERVICE_ROLE_KEY=
|
|
118
|
+
# Supabase URLs and Keys
|
|
119
|
+
NEXT_PUBLIC_SUPABASE_URL=[your-supabase-url]
|
|
120
|
+
NEXT_PUBLIC_SUPABASE_ANON_KEY=[your-anon-key]
|
|
121
|
+
SUPABASE_SERVICE_ROLE_KEY=[your-service-role]
|
|
124
122
|
|
|
125
123
|
# Database Connection
|
|
126
|
-
SUPABASE_DB_URL=postgresql://postgres:[
|
|
124
|
+
SUPABASE_DB_URL=postgresql://postgres:[your-database-password]@db.[your-project-id].supabase.co:5432/postgres
|
|
127
125
|
|
|
128
|
-
#
|
|
129
|
-
SUPABASE_PROJECT_ID=[
|
|
126
|
+
# Project Identification
|
|
127
|
+
SUPABASE_PROJECT_ID=[your-project-id]
|
|
130
128
|
|
|
131
|
-
# Personal Access Token (
|
|
132
|
-
SUPABASE_ACCESS_TOKEN=[
|
|
129
|
+
# Personal Access Token (REQUIRED for Management API)
|
|
130
|
+
SUPABASE_ACCESS_TOKEN=[your-access-token]
|
|
133
131
|
|
|
134
|
-
#
|
|
132
|
+
# Backup Directory (optional, default: ./backups)
|
|
135
133
|
SMOONB_OUTPUT_DIR=./backups
|
|
136
134
|
```
|
|
137
135
|
|
|
138
|
-
#### 3.
|
|
136
|
+
#### 3. Interactive Mapping
|
|
137
|
+
|
|
138
|
+
When running `backup` or `restore` for the first time, **smoonb** will:
|
|
139
|
+
|
|
140
|
+
1. **Read** your current `.env.local`
|
|
141
|
+
2. **Identify** the keys you already have
|
|
142
|
+
3. **Ask interactively** which keys correspond to the expected ones (if names are different)
|
|
143
|
+
4. **Add** missing keys if necessary
|
|
144
|
+
5. **Create automatic backup** of `.env.local` before any changes
|
|
145
|
+
6. **Save mapping** for future executions
|
|
146
|
+
|
|
147
|
+
**Mapping example:**
|
|
148
|
+
```
|
|
149
|
+
🔧 Mapping variable: NEXT_PUBLIC_SUPABASE_URL
|
|
150
|
+
Current value: https://abc123.supabase.co
|
|
151
|
+
Is this the correct value for the target project? (Y/n): Y
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
## 🌐 Internationalization (i18n)
|
|
155
|
+
|
|
156
|
+
**smoonb** supports multiple languages automatically. Currently supported languages are:
|
|
157
|
+
|
|
158
|
+
- **English (en)** - Default language
|
|
159
|
+
- **Portuguese (Brazil) (pt-BR)** - Full support
|
|
160
|
+
|
|
161
|
+
### Automatic Language Detection
|
|
162
|
+
|
|
163
|
+
Language is detected automatically in the following order of precedence:
|
|
164
|
+
|
|
165
|
+
1. **CLI flag `--lang`** (highest priority)
|
|
166
|
+
```bash
|
|
167
|
+
npx smoonb --lang pt-BR backup
|
|
168
|
+
npx smoonb --lang en restore
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
2. **Environment variable `SMOONB_LANG`**
|
|
172
|
+
```bash
|
|
173
|
+
# Windows PowerShell
|
|
174
|
+
$env:SMOONB_LANG="pt-BR"
|
|
175
|
+
npx smoonb backup
|
|
176
|
+
|
|
177
|
+
# Linux/macOS
|
|
178
|
+
export SMOONB_LANG=pt-BR
|
|
179
|
+
npx smoonb backup
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
3. **System locale** (LANG, LC_ALL, LC_MESSAGES)
|
|
183
|
+
```bash
|
|
184
|
+
# smoonb automatically detects system locale
|
|
185
|
+
# Example: LANG=pt_BR.UTF-8 → pt-BR
|
|
186
|
+
# Example: LANG=en_US.UTF-8 → en
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
4. **Fallback to English (en)** if none of the above are detected
|
|
139
190
|
|
|
140
|
-
|
|
191
|
+
### Supported Languages and Aliases
|
|
141
192
|
|
|
142
|
-
|
|
143
|
-
2. **Identificar** as chaves que você já tem
|
|
144
|
-
3. **Perguntar interativamente** quais chaves correspondem às esperadas (se os nomes forem diferentes)
|
|
145
|
-
4. **Adicionar** chaves faltantes se necessário
|
|
146
|
-
5. **Criar backup** automático do `.env.local` antes de qualquer alteração
|
|
147
|
-
6. **Salvar mapeamento** para futuras execuções
|
|
193
|
+
smoonb accepts the following language codes:
|
|
148
194
|
|
|
149
|
-
|
|
195
|
+
- `en` or `en-US` → English
|
|
196
|
+
- `pt-BR`, `pt_BR` or `pt` → Portuguese (Brazil)
|
|
197
|
+
|
|
198
|
+
### Usage Examples
|
|
199
|
+
|
|
200
|
+
**Force Portuguese:**
|
|
201
|
+
```bash
|
|
202
|
+
npx smoonb --lang pt-BR backup
|
|
150
203
|
```
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
204
|
+
|
|
205
|
+
**Force English:**
|
|
206
|
+
```bash
|
|
207
|
+
npx smoonb --lang en restore
|
|
154
208
|
```
|
|
155
209
|
|
|
156
|
-
|
|
210
|
+
**Use environment variable:**
|
|
211
|
+
```bash
|
|
212
|
+
# Windows PowerShell
|
|
213
|
+
$env:SMOONB_LANG="pt-BR"
|
|
214
|
+
npx smoonb check
|
|
215
|
+
|
|
216
|
+
# Linux/macOS
|
|
217
|
+
export SMOONB_LANG=en
|
|
218
|
+
npx smoonb check
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
**Automatic system detection:**
|
|
222
|
+
```bash
|
|
223
|
+
# If system is configured with LANG=pt_BR.UTF-8
|
|
224
|
+
# smoonb will automatically use Portuguese
|
|
225
|
+
npx smoonb backup
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
### Important Notes
|
|
229
|
+
|
|
230
|
+
- **Machine outputs** (e.g., `--json` if implemented) are **not** translated; fields and keys remain in English
|
|
231
|
+
- If a translation key is missing in a language, the system automatically **falls back to English**
|
|
232
|
+
- Language is detected once at the start of execution and applied to all CLI messages
|
|
233
|
+
|
|
234
|
+
## 🎯 Usage
|
|
157
235
|
|
|
158
|
-
### Backup
|
|
236
|
+
### Full Backup
|
|
159
237
|
|
|
160
238
|
```bash
|
|
161
239
|
npx smoonb backup
|
|
162
240
|
```
|
|
163
241
|
|
|
164
|
-
**
|
|
165
|
-
|
|
166
|
-
1. **
|
|
167
|
-
2. **
|
|
168
|
-
3. **
|
|
169
|
-
4.
|
|
170
|
-
5. **
|
|
171
|
-
- ⚡ Edge Functions (
|
|
172
|
-
- 📦 Storage (
|
|
173
|
-
- 🔐 Auth Settings (
|
|
174
|
-
- 🔄 Realtime Settings (
|
|
175
|
-
- 🗑️
|
|
176
|
-
6. **
|
|
177
|
-
7. **
|
|
178
|
-
8. **
|
|
179
|
-
- 📊 1/10 - Backup
|
|
180
|
-
- 📊 2/10 -
|
|
181
|
-
- 🔧 3/10 -
|
|
182
|
-
- 🔐 4/10 -
|
|
183
|
-
- 🔄 5/10 -
|
|
184
|
-
- 📦 6/10 - Backup
|
|
185
|
-
- 👥 7/10 -
|
|
186
|
-
- ⚡ 8/10 -
|
|
187
|
-
- 📁 9/10 -
|
|
188
|
-
- 📋 10/10 - Backup
|
|
189
|
-
|
|
190
|
-
**
|
|
242
|
+
**Interactive backup flow:**
|
|
243
|
+
|
|
244
|
+
1. **Docker Validation** - Verifies if Docker is running
|
|
245
|
+
2. **Consent** - Asks permission to read/write `.env.local`
|
|
246
|
+
3. **Variable Mapping** - Maps your environment variables (first time)
|
|
247
|
+
4. **.env.local Backup** - Creates automatic backup before changes
|
|
248
|
+
5. **Component Selection** - Asks which components to include:
|
|
249
|
+
- ⚡ Edge Functions (explanation about link reset and download)
|
|
250
|
+
- 📦 Storage (explanation about full backup: file download + ZIP in Dashboard format)
|
|
251
|
+
- 🔐 Auth Settings (explanation about configurations)
|
|
252
|
+
- 🔄 Realtime Settings (explanation about interactive capture of 7 parameters)
|
|
253
|
+
- 🗑️ Cleanup options (functions, .temp, migrations after backup)
|
|
254
|
+
6. **Configuration Summary** - Shows everything that will be done
|
|
255
|
+
7. **Final Confirmation** - Confirms before starting
|
|
256
|
+
8. **Step Execution:**
|
|
257
|
+
- 📊 1/10 - Database Backup via `pg_dumpall` (Docker)
|
|
258
|
+
- 📊 2/10 - Separate Database SQL (schema, data, roles)
|
|
259
|
+
- 🔧 3/10 - Database Extensions and Settings Backup
|
|
260
|
+
- 🔐 4/10 - Auth Settings Backup (if selected)
|
|
261
|
+
- 🔄 5/10 - Realtime Settings Backup (if selected) - 7 parameters captured interactively
|
|
262
|
+
- 📦 6/10 - Storage Backup (if selected) - Full file download + ZIP in Dashboard format
|
|
263
|
+
- 👥 7/10 - Custom Roles Backup
|
|
264
|
+
- ⚡ 8/10 - Edge Functions Backup (if selected)
|
|
265
|
+
- 📁 9/10 - Supabase .temp Backup (if selected)
|
|
266
|
+
- 📋 10/10 - Migrations Backup (if selected)
|
|
267
|
+
|
|
268
|
+
**Result:**
|
|
191
269
|
```
|
|
192
270
|
backups/backup-2025-10-31-09-37-54/
|
|
193
|
-
├── backup-manifest.json #
|
|
194
|
-
├── db_cluster-31-10-2025@09-38-57.backup.gz #
|
|
195
|
-
├── schema.sql #
|
|
196
|
-
├── data.sql #
|
|
197
|
-
├── roles.sql #
|
|
198
|
-
├── database-settings-*.json #
|
|
199
|
-
├── auth-settings.json #
|
|
200
|
-
├── realtime-settings.json #
|
|
201
|
-
├── storage/ #
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
├──
|
|
205
|
-
|
|
271
|
+
├── backup-manifest.json # Manifest with metadata
|
|
272
|
+
├── db_cluster-31-10-2025@09-38-57.backup.gz # Full backup (Dashboard compatible)
|
|
273
|
+
├── schema.sql # Database schema
|
|
274
|
+
├── data.sql # Data
|
|
275
|
+
├── roles.sql # PostgreSQL roles
|
|
276
|
+
├── database-settings-*.json # Extensions and settings
|
|
277
|
+
├── auth-settings.json # Auth configurations
|
|
278
|
+
├── realtime-settings.json # Realtime configurations
|
|
279
|
+
├── storage/ # Storage metadata
|
|
280
|
+
│ └── [bucket-name].json # Metadata for each bucket
|
|
281
|
+
├── [project-id].storage.zip # Full Storage backup (Dashboard format)
|
|
282
|
+
├── storage_temp/ # Temporary structure (optional, can be removed)
|
|
283
|
+
│ └── [project-id]/ # Downloaded files structure
|
|
284
|
+
│ └── [bucket-name]/ # Files for each bucket
|
|
285
|
+
├── edge-functions/ # Downloaded Edge Functions
|
|
286
|
+
│ └── [function-name]/
|
|
287
|
+
├── supabase-temp/ # Supabase CLI .temp files
|
|
288
|
+
├── migrations/ # All migrations
|
|
206
289
|
└── env/
|
|
207
|
-
├── .env.local #
|
|
208
|
-
└── env-map.json #
|
|
290
|
+
├── .env.local # .env.local backup
|
|
291
|
+
└── env-map.json # Variable mapping
|
|
209
292
|
```
|
|
210
293
|
|
|
211
|
-
###
|
|
294
|
+
### Interactive Restoration
|
|
212
295
|
|
|
213
|
-
**
|
|
296
|
+
**Restore existing backup:**
|
|
214
297
|
```bash
|
|
215
298
|
npx smoonb restore
|
|
216
299
|
```
|
|
217
300
|
|
|
218
|
-
**
|
|
301
|
+
**Import and restore directly from Dashboard:**
|
|
219
302
|
```bash
|
|
220
|
-
#
|
|
303
|
+
# Database only
|
|
221
304
|
npx smoonb restore --file "C:\Downloads\db_cluster-04-03-2024@14-16-59.backup.gz"
|
|
222
305
|
|
|
223
|
-
# Database
|
|
224
|
-
npx smoonb restore --file "backup.backup.gz" --storage "
|
|
306
|
+
# Database and storage together
|
|
307
|
+
npx smoonb restore --file "backup.backup.gz" --storage "my-project.storage.zip"
|
|
225
308
|
```
|
|
226
309
|
|
|
227
|
-
**
|
|
228
|
-
|
|
229
|
-
1. **
|
|
230
|
-
2. **
|
|
231
|
-
3. **
|
|
232
|
-
4. **
|
|
233
|
-
5.
|
|
234
|
-
6. **
|
|
235
|
-
-
|
|
236
|
-
-
|
|
237
|
-
7. **
|
|
238
|
-
- 📊 Database (
|
|
239
|
-
- ⚡ Edge Functions (
|
|
240
|
-
- 🔐 Auth Settings (
|
|
241
|
-
- 📦 Storage (
|
|
242
|
-
- 🔧 Database Extensions and Settings (
|
|
243
|
-
- 🔄 Realtime Settings (
|
|
244
|
-
8. **
|
|
245
|
-
9. **
|
|
246
|
-
10. **
|
|
247
|
-
- 📊 Database -
|
|
248
|
-
- ⚡ Edge Functions -
|
|
249
|
-
- 🔐 Auth Settings -
|
|
250
|
-
- 📦 Storage -
|
|
251
|
-
- 🔧 Database Settings -
|
|
252
|
-
- 🔄 Realtime Settings -
|
|
253
|
-
|
|
254
|
-
**
|
|
255
|
-
- ✅ `.backup.gz` (
|
|
256
|
-
- ✅ `.backup` (
|
|
257
|
-
|
|
258
|
-
**
|
|
259
|
-
-
|
|
260
|
-
-
|
|
261
|
-
-
|
|
262
|
-
-
|
|
263
|
-
|
|
264
|
-
###
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
**
|
|
310
|
+
**Interactive restore flow:**
|
|
311
|
+
|
|
312
|
+
1. **Docker Validation** - Verifies if Docker is running
|
|
313
|
+
2. **Terms of Use** - Displays and requests acceptance of terms
|
|
314
|
+
3. **Consent** - Asks permission to read/write `.env.local`
|
|
315
|
+
4. **Variable Mapping** - Maps variables to target project
|
|
316
|
+
5. **.env.local Backup** - Creates automatic backup
|
|
317
|
+
6. **Backup Selection** - Lists and allows choosing which backup to restore (skips if `--file` provided)
|
|
318
|
+
- If `--file` is provided: automatically imports and auto-selects the backup
|
|
319
|
+
- If `--storage` is provided along with `--file`: also imports the storage file
|
|
320
|
+
7. **Component Selection** - Asks which components to restore:
|
|
321
|
+
- 📊 Database (always available)
|
|
322
|
+
- ⚡ Edge Functions (if available in backup)
|
|
323
|
+
- 🔐 Auth Settings (if available in backup)
|
|
324
|
+
- 📦 Storage (if available in backup)
|
|
325
|
+
- 🔧 Database Extensions and Settings (if available in backup)
|
|
326
|
+
- 🔄 Realtime Settings (if available in backup)
|
|
327
|
+
8. **Detailed Summary** - Shows selected backup, target project and components
|
|
328
|
+
9. **Final Confirmation** - Confirms before starting
|
|
329
|
+
10. **Restore Execution:**
|
|
330
|
+
- 📊 Database - Restores via `psql` (supports `.backup.gz` and `.backup`)
|
|
331
|
+
- ⚡ Edge Functions - Copies and deploys to target project
|
|
332
|
+
- 🔐 Auth Settings - Displays configurations for manual application
|
|
333
|
+
- 📦 Storage - Restores buckets and files from ZIP (if available) or displays information for manual migration
|
|
334
|
+
- 🔧 Database Settings - Restores extensions and settings via SQL
|
|
335
|
+
- 🔄 Realtime Settings - Displays configurations for manual application
|
|
336
|
+
|
|
337
|
+
**Supported file formats:**
|
|
338
|
+
- ✅ `.backup.gz` (compressed) - Automatically decompresses before restoring
|
|
339
|
+
- ✅ `.backup` (uncompressed) - Restores directly
|
|
340
|
+
|
|
341
|
+
**When to use `--file`:**
|
|
342
|
+
- Automatically imports backup file before restoring
|
|
343
|
+
- Eliminates backup selection step
|
|
344
|
+
- If `--storage` provided, also imports storage file
|
|
345
|
+
- Useful for restoring backups downloaded directly from Supabase Dashboard
|
|
346
|
+
|
|
347
|
+
### Import Backup from Supabase Dashboard
|
|
348
|
+
|
|
349
|
+
If you downloaded a backup directly from the Supabase Dashboard (`.backup.gz` format), you can import it to the format expected by smoonb. The command also supports optionally importing storage files (`.storage.zip`).
|
|
350
|
+
|
|
351
|
+
**Import database only:**
|
|
269
352
|
```bash
|
|
270
|
-
npx smoonb import --file "
|
|
353
|
+
npx smoonb import --file "full/path/to/db_cluster-04-03-2024@14-16-59.backup.gz"
|
|
271
354
|
```
|
|
272
355
|
|
|
273
|
-
**
|
|
356
|
+
**Import database and storage together:**
|
|
274
357
|
```bash
|
|
275
|
-
npx smoonb import --file "backup.backup.gz" --storage "
|
|
358
|
+
npx smoonb import --file "backup.backup.gz" --storage "my-project.storage.zip"
|
|
276
359
|
```
|
|
277
360
|
|
|
278
|
-
**
|
|
279
|
-
1.
|
|
280
|
-
2.
|
|
281
|
-
3.
|
|
282
|
-
4.
|
|
283
|
-
5.
|
|
284
|
-
6.
|
|
285
|
-
7.
|
|
361
|
+
**What the command does:**
|
|
362
|
+
1. Reads the `.backup.gz` file from Dashboard (required)
|
|
363
|
+
2. If provided, reads the `.storage.zip` file from Dashboard (optional)
|
|
364
|
+
3. Extracts information from backup file name (date and time)
|
|
365
|
+
4. Creates a backup folder in expected format (`backup-YYYY-MM-DD-HH-MM-SS`)
|
|
366
|
+
5. Copies backup file to created folder
|
|
367
|
+
6. If provided, copies storage file to same folder
|
|
368
|
+
7. Makes backup ready to be found by `restore` command
|
|
286
369
|
|
|
287
|
-
**
|
|
370
|
+
**Complete example - Database only (using import + restore):**
|
|
288
371
|
```bash
|
|
289
|
-
# 1.
|
|
290
|
-
#
|
|
372
|
+
# 1. Download backup from Supabase Dashboard
|
|
373
|
+
# File: db_cluster-04-03-2024@14-16-59.backup.gz
|
|
291
374
|
|
|
292
|
-
# 2.
|
|
375
|
+
# 2. Import the file
|
|
293
376
|
npx smoonb import --file "C:\Downloads\db_cluster-04-03-2024@14-16-59.backup.gz"
|
|
294
377
|
|
|
295
|
-
# 3.
|
|
378
|
+
# 3. Restore the imported backup
|
|
296
379
|
npx smoonb restore
|
|
297
|
-
#
|
|
380
|
+
# The imported backup will appear in the list of available backups
|
|
298
381
|
```
|
|
299
382
|
|
|
300
|
-
**
|
|
383
|
+
**Complete example - Database only (using restore directly):**
|
|
301
384
|
```bash
|
|
302
|
-
# 1.
|
|
303
|
-
#
|
|
385
|
+
# 1. Download backup from Supabase Dashboard
|
|
386
|
+
# File: db_cluster-04-03-2024@14-16-59.backup.gz
|
|
304
387
|
|
|
305
|
-
# 2.
|
|
388
|
+
# 2. Import and restore directly (skips backup selection)
|
|
306
389
|
npx smoonb restore --file "C:\Downloads\db_cluster-04-03-2024@14-16-59.backup.gz"
|
|
307
390
|
```
|
|
308
391
|
|
|
309
|
-
**
|
|
392
|
+
**Complete example - Database and Storage (using import + restore):**
|
|
310
393
|
```bash
|
|
311
|
-
# 1.
|
|
312
|
-
#
|
|
394
|
+
# 1. Download backup and storage from Supabase Dashboard
|
|
395
|
+
# Files:
|
|
313
396
|
# - db_cluster-04-03-2024@14-16-59.backup.gz
|
|
314
|
-
# -
|
|
397
|
+
# - my-project.storage.zip
|
|
315
398
|
|
|
316
|
-
# 2.
|
|
317
|
-
npx smoonb import --file "C:\Downloads\db_cluster-04-03-2024@14-16-59.backup.gz" --storage "C:\Downloads\
|
|
399
|
+
# 2. Import both files
|
|
400
|
+
npx smoonb import --file "C:\Downloads\db_cluster-04-03-2024@14-16-59.backup.gz" --storage "C:\Downloads\my-project.storage.zip"
|
|
318
401
|
|
|
319
|
-
# 3.
|
|
402
|
+
# 3. Restore the imported backup
|
|
320
403
|
npx smoonb restore
|
|
321
|
-
#
|
|
404
|
+
# The imported backup will appear in the list of available backups
|
|
322
405
|
```
|
|
323
406
|
|
|
324
|
-
**
|
|
407
|
+
**Complete example - Database and Storage (using restore directly):**
|
|
325
408
|
```bash
|
|
326
|
-
# 1.
|
|
327
|
-
#
|
|
409
|
+
# 1. Download backup and storage from Supabase Dashboard
|
|
410
|
+
# Files:
|
|
328
411
|
# - db_cluster-04-03-2024@14-16-59.backup.gz
|
|
329
|
-
# -
|
|
412
|
+
# - my-project.storage.zip
|
|
330
413
|
|
|
331
|
-
# 2.
|
|
332
|
-
npx smoonb restore --file "C:\Downloads\db_cluster-04-03-2024@14-16-59.backup.gz" --storage "C:\Downloads\
|
|
414
|
+
# 2. Import and restore directly (skips backup selection)
|
|
415
|
+
npx smoonb restore --file "C:\Downloads\db_cluster-04-03-2024@14-16-59.backup.gz" --storage "C:\Downloads\my-project.storage.zip"
|
|
333
416
|
```
|
|
334
417
|
|
|
335
|
-
**
|
|
336
|
-
-
|
|
337
|
-
-
|
|
338
|
-
-
|
|
339
|
-
-
|
|
340
|
-
-
|
|
341
|
-
-
|
|
418
|
+
**Important:**
|
|
419
|
+
- Backup file is **required** and must be in Dashboard format: `db_cluster-DD-MM-YYYY@HH-MM-SS.backup.gz`
|
|
420
|
+
- Storage file is **optional** and must be in format: `*.storage.zip`
|
|
421
|
+
- Storage depends on a backup, but backup does not depend on storage
|
|
422
|
+
- Both files will be copied to the same backup folder
|
|
423
|
+
- Path can be absolute or relative
|
|
424
|
+
- Command will automatically create necessary folder structure
|
|
342
425
|
|
|
343
|
-
**
|
|
344
|
-
- `import`:
|
|
345
|
-
- `restore --file`:
|
|
426
|
+
**Difference between `import` and `restore --file`:**
|
|
427
|
+
- `import`: Only imports the file and creates backup structure. You need to run `restore` afterwards.
|
|
428
|
+
- `restore --file`: Automatically imports the file and starts the restoration process, skipping the backup selection step.
|
|
346
429
|
|
|
347
|
-
###
|
|
430
|
+
### Post-Restore Verification
|
|
348
431
|
|
|
349
432
|
```bash
|
|
350
433
|
npx smoonb check
|
|
351
434
|
```
|
|
352
435
|
|
|
353
|
-
**
|
|
354
|
-
- ✅
|
|
355
|
-
- ✅
|
|
356
|
-
- ✅
|
|
357
|
-
- ✅
|
|
358
|
-
- ✅
|
|
359
|
-
- ✅
|
|
436
|
+
**Verifies:**
|
|
437
|
+
- ✅ Database connection
|
|
438
|
+
- ✅ Installed extensions
|
|
439
|
+
- ✅ Created tables
|
|
440
|
+
- ✅ RLS policies
|
|
441
|
+
- ✅ Realtime publications
|
|
442
|
+
- ✅ Storage buckets
|
|
360
443
|
|
|
361
444
|
|
|
362
|
-
## 🔧
|
|
445
|
+
## 🔧 Available Commands
|
|
363
446
|
|
|
364
|
-
|
|
|
365
|
-
|
|
366
|
-
| `npx smoonb backup` |
|
|
367
|
-
| `npx smoonb restore` |
|
|
368
|
-
| `npx smoonb restore --file <path> [--storage <path>]` |
|
|
369
|
-
| `npx smoonb import --file <path> [--storage <path>]` |
|
|
370
|
-
| `npx smoonb check` |
|
|
447
|
+
| Command | Description |
|
|
448
|
+
|---------|-------------|
|
|
449
|
+
| `npx smoonb backup` | Full interactive backup using Docker |
|
|
450
|
+
| `npx smoonb restore` | Interactive restoration using psql (Docker) |
|
|
451
|
+
| `npx smoonb restore --file <path> [--storage <path>]` | Import and restore directly .backup.gz file and optionally .storage.zip from Dashboard |
|
|
452
|
+
| `npx smoonb import --file <path> [--storage <path>]` | Import .backup.gz file and optionally .storage.zip from Supabase Dashboard |
|
|
453
|
+
| `npx smoonb check` | Post-restore integrity verification |
|
|
371
454
|
|
|
372
|
-
## 🏗️
|
|
455
|
+
## 🏗️ Technical Architecture
|
|
373
456
|
|
|
374
|
-
###
|
|
457
|
+
### Modular Structure
|
|
375
458
|
|
|
376
|
-
|
|
459
|
+
The code has been refactored to a **modular architecture** with independent steps:
|
|
377
460
|
|
|
378
461
|
#### Backup (`src/commands/backup/`)
|
|
379
462
|
```
|
|
@@ -414,28 +497,38 @@ restore/
|
|
|
414
497
|
### Backup Strategy
|
|
415
498
|
|
|
416
499
|
#### Database
|
|
417
|
-
- **Backup
|
|
418
|
-
-
|
|
419
|
-
-
|
|
420
|
-
- **Backup
|
|
421
|
-
- `schema.sql` -
|
|
422
|
-
- `data.sql` -
|
|
423
|
-
- `roles.sql` - Roles
|
|
500
|
+
- **Main Backup**: `pg_dumpall` via Docker (identical to Dashboard)
|
|
501
|
+
- File: `db_cluster-XX-XX-XXXX@XX-XX-XX.backup.gz`
|
|
502
|
+
- Compatible with restoration via Supabase Dashboard
|
|
503
|
+
- **Separate Backup**: SQL in separate files via Supabase CLI
|
|
504
|
+
- `schema.sql` - Table structure
|
|
505
|
+
- `data.sql` - Data (COPY statements)
|
|
506
|
+
- `roles.sql` - Roles and permissions
|
|
424
507
|
|
|
425
508
|
#### Edge Functions
|
|
426
|
-
- **Download
|
|
427
|
-
- **Reset
|
|
428
|
-
- **Backup
|
|
509
|
+
- **Automatic Download**: Via Supabase CLI `supabase functions download`
|
|
510
|
+
- **Link Reset**: Ensures clean link with project before download
|
|
511
|
+
- **Complete Backup**: Full code of each function
|
|
429
512
|
|
|
430
513
|
#### Migrations
|
|
431
|
-
- **Download
|
|
432
|
-
- **Reset
|
|
433
|
-
- **Backup
|
|
434
|
-
|
|
435
|
-
####
|
|
436
|
-
- **
|
|
437
|
-
- **
|
|
438
|
-
- **
|
|
514
|
+
- **Automatic Download**: Via `supabase migration fetch`
|
|
515
|
+
- **Link Reset**: Ensures clean link with project
|
|
516
|
+
- **Complete Backup**: All server migrations
|
|
517
|
+
|
|
518
|
+
#### Storage
|
|
519
|
+
- **Complete Backup**: Download of all files from all buckets
|
|
520
|
+
- **Temporary Structure**: Creates `storage_temp/project-id/bucket-name/files...` inside backupDir
|
|
521
|
+
- **ZIP in Dashboard Format**: Creates `{project-id}.storage.zip` with structure `project-id/bucket-name/files...`
|
|
522
|
+
- **Restore Compatible**: Created ZIP is compatible with restore process (same format as Dashboard)
|
|
523
|
+
- **Interactive Question**: After creating ZIP, asks if you want to clean temporary structure
|
|
524
|
+
- **Fallback**: If Supabase credentials are not available, backs up metadata only
|
|
525
|
+
- **Management API**: Uses Personal Access Token to list buckets and objects
|
|
526
|
+
- **Supabase Client**: Uses Service Role Key for file downloads
|
|
527
|
+
|
|
528
|
+
#### Auth, Realtime
|
|
529
|
+
- **Management API**: Uses Personal Access Token
|
|
530
|
+
- **JSON Export**: Configurations exported as JSON
|
|
531
|
+
- **Realtime Settings**: Interactive capture of 7 parameters:
|
|
439
532
|
1. Enable Realtime service
|
|
440
533
|
2. Allow public access
|
|
441
534
|
3. Database connection pool size
|
|
@@ -443,194 +536,195 @@ restore/
|
|
|
443
536
|
5. Max events per second
|
|
444
537
|
6. Max presence events per second
|
|
445
538
|
7. Max payload size in KB
|
|
446
|
-
- **Manual
|
|
539
|
+
- **Manual for some**: Some settings need to be applied manually for security
|
|
447
540
|
|
|
448
541
|
### Restore Strategy
|
|
449
542
|
|
|
450
543
|
#### Database
|
|
451
|
-
- **
|
|
452
|
-
- `.backup.gz` -
|
|
453
|
-
- `.backup` -
|
|
454
|
-
- **Clean Restore**:
|
|
544
|
+
- **Format Support**:
|
|
545
|
+
- `.backup.gz` - Automatically decompresses via Docker
|
|
546
|
+
- `.backup` - Restores directly via `psql` (Docker)
|
|
547
|
+
- **Clean Restore**: Can overwrite existing data (with confirmation)
|
|
455
548
|
|
|
456
549
|
#### Edge Functions
|
|
457
|
-
- **Clean Deploy**:
|
|
458
|
-
- **Reset
|
|
459
|
-
- **Deploy
|
|
550
|
+
- **Clean Deploy**: Cleans `supabase/functions` before deploy
|
|
551
|
+
- **Link Reset**: Ensures correct link with target project
|
|
552
|
+
- **Automatic Deploy**: Uses `supabase functions deploy`
|
|
460
553
|
|
|
461
|
-
####
|
|
462
|
-
- **Database Settings**:
|
|
463
|
-
- **
|
|
554
|
+
#### Other Components
|
|
555
|
+
- **Database Settings**: Restores via SQL
|
|
556
|
+
- **Storage**: Restores buckets and files from ZIP (if available) or displays information for manual configuration
|
|
557
|
+
- **Auth/Realtime**: Displays information for manual configuration in Dashboard
|
|
464
558
|
|
|
465
|
-
###
|
|
559
|
+
### Cross-Platform
|
|
466
560
|
|
|
467
|
-
- **Windows/macOS/Linux**:
|
|
468
|
-
- **Cross-platform**:
|
|
469
|
-
- **Docker
|
|
561
|
+
- **Windows/macOS/Linux**: Automatic binary detection
|
|
562
|
+
- **Cross-platform**: Uses `fs.promises.cp`, `path.join`, Docker
|
|
563
|
+
- **Docker for Everything**: Backup, restore and compression via Docker (ensures consistency)
|
|
470
564
|
|
|
471
|
-
## 📊
|
|
565
|
+
## 📊 Recommended Flow
|
|
472
566
|
|
|
473
567
|
```bash
|
|
474
|
-
# 1.
|
|
475
|
-
#
|
|
568
|
+
# 1. Configure .env.local (first time)
|
|
569
|
+
# Edit .env.local with your source project credentials
|
|
476
570
|
|
|
477
|
-
# 2. Backup
|
|
571
|
+
# 2. Backup source project
|
|
478
572
|
npx smoonb backup
|
|
479
|
-
# -
|
|
480
|
-
# -
|
|
481
|
-
# -
|
|
573
|
+
# - Maps variables interactively (first time)
|
|
574
|
+
# - Selects components for backup
|
|
575
|
+
# - Executes full backup
|
|
482
576
|
|
|
483
|
-
# 3.
|
|
484
|
-
# (via Dashboard
|
|
577
|
+
# 3. Create new Supabase project
|
|
578
|
+
# (via Dashboard or Supabase CLI)
|
|
485
579
|
|
|
486
|
-
# 4.
|
|
487
|
-
#
|
|
580
|
+
# 4. Edit .env.local with new project credentials
|
|
581
|
+
# Update variables to point to target project
|
|
488
582
|
|
|
489
|
-
# 5.
|
|
583
|
+
# 5. Restore backup (interactive mode)
|
|
490
584
|
npx smoonb restore
|
|
491
|
-
# -
|
|
492
|
-
# -
|
|
493
|
-
# -
|
|
585
|
+
# - Selects desired backup
|
|
586
|
+
# - Selects components to restore
|
|
587
|
+
# - Executes restoration
|
|
494
588
|
|
|
495
|
-
# 6.
|
|
589
|
+
# 6. Verify integrity
|
|
496
590
|
npx smoonb check
|
|
497
591
|
|
|
498
|
-
# 7.
|
|
592
|
+
# 7. Apply manual configurations (if necessary)
|
|
499
593
|
# - Auth Settings: Dashboard → Authentication → Settings
|
|
500
|
-
# - Storage: Dashboard → Storage → Buckets
|
|
501
594
|
# - Realtime: Dashboard → Database → Replication
|
|
595
|
+
# Note: Storage is automatically restored from ZIP if available
|
|
502
596
|
```
|
|
503
597
|
|
|
504
|
-
## 🎨
|
|
598
|
+
## 🎨 User Experience
|
|
505
599
|
|
|
506
|
-
### Interface
|
|
600
|
+
### Multi-Language Interface
|
|
507
601
|
|
|
508
|
-
|
|
509
|
-
-
|
|
510
|
-
-
|
|
511
|
-
-
|
|
512
|
-
-
|
|
602
|
+
All interactions are **automatically translated** based on system locale or `--lang` flag:
|
|
603
|
+
- Clear and direct questions
|
|
604
|
+
- Explanations before each process
|
|
605
|
+
- Detailed summaries before confirming
|
|
606
|
+
- Confirmations with `(Y/n)` or `(y/N)` in English, `(S/n)` or `(s/N)` in Portuguese
|
|
513
607
|
|
|
514
|
-
###
|
|
608
|
+
### Intelligent Variable Mapping
|
|
515
609
|
|
|
516
|
-
- **
|
|
517
|
-
- **
|
|
518
|
-
- **
|
|
519
|
-
- **Backup
|
|
610
|
+
- **Automatic Detection**: If key already exists with expected name, skips selection
|
|
611
|
+
- **Add Option**: Allows adding new keys if they don't exist
|
|
612
|
+
- **Value Validation**: Confirms values before saving
|
|
613
|
+
- **Automatic Backup**: Always creates backup of `.env.local` before changes
|
|
520
614
|
|
|
521
|
-
###
|
|
615
|
+
### Guided Process
|
|
522
616
|
|
|
523
|
-
- **
|
|
524
|
-
- **
|
|
525
|
-
- **
|
|
526
|
-
- **Feedback
|
|
617
|
+
- **Prior Validation**: Verifies Docker before starting
|
|
618
|
+
- **Contextual Explanations**: Explains each process before asking
|
|
619
|
+
- **Final Summary**: Shows everything that will be done before executing
|
|
620
|
+
- **Visual Feedback**: Colors and icons for better experience
|
|
527
621
|
|
|
528
622
|
## 🐛 Troubleshooting
|
|
529
623
|
|
|
530
|
-
### Docker
|
|
624
|
+
### Docker not found or not running
|
|
531
625
|
```bash
|
|
532
|
-
#
|
|
626
|
+
# Verify if Docker is installed
|
|
533
627
|
docker --version
|
|
534
628
|
|
|
535
|
-
#
|
|
629
|
+
# Verify if Docker Desktop is running
|
|
536
630
|
docker ps
|
|
537
631
|
|
|
538
|
-
#
|
|
539
|
-
# Windows/macOS:
|
|
632
|
+
# If not, start Docker Desktop
|
|
633
|
+
# Windows/macOS: Open Docker Desktop application
|
|
540
634
|
# Linux: sudo systemctl start docker
|
|
541
635
|
```
|
|
542
636
|
|
|
543
|
-
### Supabase CLI
|
|
637
|
+
### Supabase CLI not found
|
|
544
638
|
```bash
|
|
545
639
|
npm install -g supabase
|
|
546
640
|
```
|
|
547
641
|
|
|
548
|
-
### Personal Access Token
|
|
642
|
+
### Invalid or missing Personal Access Token
|
|
549
643
|
|
|
550
|
-
1.
|
|
551
|
-
2.
|
|
552
|
-
3.
|
|
644
|
+
1. Verify if `SUPABASE_ACCESS_TOKEN` is in `.env.local`
|
|
645
|
+
2. Generate new token: https://supabase.com/dashboard/account/tokens
|
|
646
|
+
3. Update `.env.local` with new token
|
|
553
647
|
|
|
554
|
-
### Database URL
|
|
555
|
-
-
|
|
556
|
-
-
|
|
557
|
-
-
|
|
648
|
+
### Incorrect Database URL
|
|
649
|
+
- Verify password in connection URL
|
|
650
|
+
- Use Connection string from Supabase Dashboard (Settings → Database)
|
|
651
|
+
- Test connection: `psql "your-database-url" -c "SELECT 1"`
|
|
558
652
|
|
|
559
|
-
###
|
|
653
|
+
### .backup.gz file cannot be restored
|
|
560
654
|
|
|
561
|
-
|
|
562
|
-
- ✅ `.backup.gz` -
|
|
563
|
-
- ✅ `.backup` -
|
|
655
|
+
smoonb automatically supports:
|
|
656
|
+
- ✅ `.backup.gz` - Decompresses via Docker before restoring
|
|
657
|
+
- ✅ `.backup` - Restores directly
|
|
564
658
|
|
|
565
|
-
|
|
566
|
-
1.
|
|
567
|
-
2.
|
|
568
|
-
3.
|
|
659
|
+
If there are problems:
|
|
660
|
+
1. Verify if Docker is running
|
|
661
|
+
2. Verify file permissions
|
|
662
|
+
3. Verify disk space
|
|
569
663
|
|
|
570
|
-
###
|
|
664
|
+
### Error downloading Edge Functions
|
|
571
665
|
|
|
572
|
-
1.
|
|
573
|
-
2.
|
|
574
|
-
3.
|
|
666
|
+
1. Verify if `SUPABASE_ACCESS_TOKEN` is configured
|
|
667
|
+
2. Verify if project is linked: `supabase link`
|
|
668
|
+
3. Verify if functions exist on server
|
|
575
669
|
|
|
576
|
-
###
|
|
670
|
+
### Error downloading Migrations
|
|
577
671
|
|
|
578
|
-
1.
|
|
579
|
-
2.
|
|
580
|
-
3.
|
|
672
|
+
1. Verify if `SUPABASE_ACCESS_TOKEN` is configured
|
|
673
|
+
2. Verify if project is linked: `supabase link`
|
|
674
|
+
3. Verify if there are migrations on server
|
|
581
675
|
|
|
582
|
-
## 🔒
|
|
676
|
+
## 🔒 Security
|
|
583
677
|
|
|
584
|
-
- **Backup
|
|
585
|
-
- **
|
|
586
|
-
- **
|
|
587
|
-
- **Docker
|
|
678
|
+
- **Automatic Backup**: Always creates backup of `.env.local` before changes
|
|
679
|
+
- **Local Mapping**: Variable mapping saved only locally
|
|
680
|
+
- **No Sensitive Data**: No sensitive data is sent outside your environment
|
|
681
|
+
- **Isolated Docker**: Database operations via Docker (isolation)
|
|
588
682
|
|
|
589
|
-
## 💼
|
|
683
|
+
## 💼 Access Model and Subscription
|
|
590
684
|
|
|
591
|
-
|
|
685
|
+
Supa Moonbase code is provided under MIT license (see `LICENSE`). In a future phase, CLI execution will be linked to a per-account subscription, allowing use associated with a valid account. Account validation will occur before any sensitive operations (e.g., backup and restore).
|
|
592
686
|
|
|
593
|
-
|
|
687
|
+
Until validation is active, the tool can be used without login.
|
|
594
688
|
|
|
595
|
-
|
|
689
|
+
Learn more at [Pricing](https://smoonb.com/pricing) and [Commercial FAQ](https://smoonb.com/faq).
|
|
596
690
|
|
|
597
|
-
## 🎁 Grandfathering (
|
|
691
|
+
## 🎁 Grandfathering (concept)
|
|
598
692
|
|
|
599
|
-
|
|
693
|
+
Accounts created during the initial commercial availability period may maintain differentiated access conditions while they remain active. The goal is to recognize early users. Specific details will be in the [Terms of Service](https://smoonb.com/terms) and [Pricing](https://smoonb.com/pricing).
|
|
600
694
|
|
|
601
|
-
## 🔒
|
|
695
|
+
## 🔒 Privacy and LGPD (summary)
|
|
602
696
|
|
|
603
|
-
|
|
697
|
+
Supa Moonbase adopts the data minimization principle. When account validation is active, we will only process information strictly necessary for access control and billing (e.g., account identifier and contact). Purposes, legal bases and data subject rights will be described in the [Privacy Policy](https://smoonb.com/privacy).
|
|
604
698
|
|
|
605
|
-
## 📋
|
|
699
|
+
## 📋 Terms of Service and Brand Usage
|
|
606
700
|
|
|
607
|
-
|
|
701
|
+
The code license (MIT) does not replace the Terms of Service that will govern per-account operational access and subscription validation.
|
|
608
702
|
|
|
609
|
-
"Supa Moonbase"
|
|
703
|
+
"Supa Moonbase" and visual identity elements are trademarks of Goalmoon Tecnologia Ltda.; brand and branding assets usage is restricted, as per [Terms of Service](https://smoonb.com/terms).
|
|
610
704
|
|
|
611
|
-
## ❓ FAQ
|
|
705
|
+
## ❓ Commercial FAQ
|
|
612
706
|
|
|
613
|
-
**
|
|
707
|
+
**Why subscription if the code is MIT?**
|
|
614
708
|
|
|
615
|
-
>
|
|
709
|
+
> The code remains open for audit and contributions. Operational access will be conditioned to account validation, as per Terms of Service.
|
|
616
710
|
|
|
617
|
-
**
|
|
711
|
+
**What does grandfathering mean?**
|
|
618
712
|
|
|
619
|
-
>
|
|
713
|
+
> Accounts from the initial period may maintain differentiated conditions while active; details will be in the Terms.
|
|
620
714
|
|
|
621
715
|
|
|
622
716
|
|
|
623
|
-
## 📝
|
|
717
|
+
## 📝 License
|
|
624
718
|
|
|
625
|
-
|
|
719
|
+
Supa Moonbase code is provided under MIT license. See [LICENSE](LICENSE) for the full license text. A Portuguese translation is available in [LICENSE.pt-BR.md](LICENSE.pt-BR.md) for convenience only.
|
|
626
720
|
|
|
627
|
-
## 🤝
|
|
721
|
+
## 🤝 Contributing
|
|
628
722
|
|
|
629
|
-
|
|
723
|
+
Contributions are welcome! This is an experimental project and we need community feedback.
|
|
630
724
|
|
|
631
725
|
|
|
632
726
|
---
|
|
633
727
|
|
|
634
|
-
**
|
|
728
|
+
**Developed by:** Goalmoon Tecnologia LTDA
|
|
635
729
|
**Website:** https://smoonb.com
|
|
636
730
|
**GitHub:** https://github.com/almmello/smoonb
|