File size: 3,289 Bytes
a6337ea
fd7b298
a6337ea
fd7b298
 
a6337ea
fd7b298
a6337ea
6179a48
a6337ea
 
6179a48
fd7b298
6179a48
fd7b298
6179a48
fd7b298
6179a48
 
 
 
 
 
 
3ea249e
fd7b298
3ea249e
 
 
 
 
 
 
 
 
 
 
fd7b298
6179a48
 
 
 
 
 
 
 
 
 
 
3ea249e
6179a48
 
 
 
 
 
 
 
 
 
 
3ea249e
6179a48
3ea249e
6179a48
 
 
 
 
 
 
3ea249e
 
 
 
 
 
 
 
50a574a
3ea249e
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
---
title: Visual Studio Code
emoji: 💻
colorFrom: blue
colorTo: indigo
sdk: docker
pinned: true
license: mit
short_description: An online VS Code on the Web, now equipped with toolchains.
---

# 💻 VS Code on the Web IDE with Auto Backup

This Space runs **VS Code on the Web** with a **full developer toolchain**, ready for mega collaboration:

### 🔧 Installed Developer Tools

- **Python 3.12**: pip, virtualenv, JupyterLab, `black`, `flake8`, `mypy`, IPython  
- **C/C++**: gcc, g++, clang, lld, cmake, ninja, valgrind, gdb  
- **Rust**: stable toolchain via rustup  
- **Go**: latest stable  
- **Java**: OpenJDK 17  
- **C#/.NET**: .NET SDK 8.0  
- **Node.js 20**: npm, yarn, pnpm, TypeScript, ts-node, nodemon  
- **CLI Productivity Tools**: git, git-lfs, htop, fzf, ripgrep, silversearcher-ag, rsync, sqlite3, tree, jq, net-tools  

---

### 🔒 Security Hardening

- **Bash history is disabled globally**:  
  All interactive shells inside this container are launched with:
  - `HISTFILE` unset  
  - `HISTSIZE=0`, `HISTFILESIZE=0`  
  - `.bash_history` linked to `/dev/null`  

  👉 This ensures **no command history is ever logged to disk**, protecting sensitive tokens and commands.

---

### 🗂️ Auto Backup

Every 45 minutes, `/workspace` is automatically uploaded to your Hugging Face repo defined in environment variables:

- `BACKUP_REPO` → target repo (e.g., `username/my-backup`)  
- `HF_TOKEN` → your Hugging Face API token

> ⚠️ On first launch, the backup service will attempt to restore `/workspace` from your `BACKUP_REPO`. Make sure the repo exists. If empty, a fresh workspace will be created.

Backups are uploaded with a **cache-safe method** to avoid LFS errors.

---

### 🚀 Usage

1. Set secrets in **Space Settings**:
   - `BACKUP_REPO`  
   - `HF_TOKEN`  

   **Notes**:
   - Leaving either secret empty will **disable Auto Backup** and restore.  
   - All files are wiped on Space restart. Using either persistent storage space or the Auto Backup Service is highly recommended.

2. Launch the Space → Access VS Code at `http://<space-url>`  
   - No authentication by default (`--auth none`).  
   - Optional: enable a password via environment variables if desired.

3. Work normally — backups run in the background every 45 minutes.

---

### ⚠️ Important Notes

1. I **STRONGLY ADVISE** against putting credentials directly into the IDE. If you must use them, *remove them immediately* after use to prevent accidental leaks and misuse.  
2. All command history is disabled for your safety — but *always treat the `/workspace` folder contents as sensitive*.  
3. If you plan to duplicate this Space for backups, **DO NOT** make the Space public! Environment variables in Hugging Face Spaces can be exposed to anyone with container access (e.g., via `env`, `printenv`, or process inspection).  
4. I am **NOT** responsible for any damages caused by leaked passwords/tokens from this Space — so take extreme care with your credentials.

### ℹ️ Additional Notes

- Since this Space is hosted remotely (not local), you may experience some latency when performing actions.  
- This IDE is designed for collaborative coding — so feel free to invite friends and enjoy a **feature-packed online coding adventure**! 🚀