Trộm chó hahaha
This commit is contained in:
@@ -1,112 +1,186 @@
|
|||||||
# Vitastor
|
# tromcho.net
|
||||||
|
|
||||||
[Читать на русском](README-ru.md)
|
Repository này chứa toàn bộ source code của website **tromcho.net**.
|
||||||
|
|
||||||
## The Idea
|
## Giới thiệu
|
||||||
|
|
||||||
Make Clustered Block Storage Fast Again.
|
`tromcho.net` là mã nguồn website được tổ chức để phục vụ phát triển, triển khai và vận hành theo quy trình chuẩn trên GitHub.
|
||||||
|
README này đóng vai trò tài liệu khởi đầu cho lập trình viên, DevOps engineer và cộng tác viên khi tiếp cận repository.
|
||||||
|
|
||||||
Vitastor is a distributed block, file and object SDS, direct replacement of Ceph RBD, CephFS and RGW,
|
## Mục tiêu repository
|
||||||
and also internal SDS's of public clouds. However, in contrast to them, Vitastor is fast
|
|
||||||
and simple at the same time. The only thing is it's slightly young :-).
|
|
||||||
|
|
||||||
Vitastor is architecturally similar to Ceph which means strong consistency,
|
- Quản lý tập trung toàn bộ source code của website.
|
||||||
primary-replication, symmetric clustering and automatic data distribution over any
|
- Chuẩn hóa quy trình phát triển, review và triển khai.
|
||||||
number of drives of any size with configurable redundancy (replication or erasure codes/XOR).
|
- Tạo nền tảng rõ ràng cho việc CI/CD, kiểm thử và vận hành production.
|
||||||
|
- Hỗ trợ onboarding nhanh cho thành viên mới.
|
||||||
|
|
||||||
Vitastor targets primarily SSD and SSD+HDD clusters with at least 10 Gbit/s network,
|
## Cấu trúc thư mục đề xuất
|
||||||
supports TCP and RDMA and may achieve 4 KB read and write latency as low as ~0.1 ms
|
|
||||||
with proper hardware which is ~10 times faster than other popular SDS's like Ceph
|
|
||||||
or internal systems of public clouds.
|
|
||||||
|
|
||||||
Vitastor supports QEMU, UBLK, NBD, NFS protocols, OpenStack, OpenNebula, Proxmox, Kubernetes drivers.
|
```text
|
||||||
More drivers may be created easily.
|
.
|
||||||
|
├── app/ # Source code ứng dụng chính
|
||||||
|
├── public/ # Static files, images, favicon, robots.txt
|
||||||
|
├── config/ # Cấu hình môi trường, app, service integration
|
||||||
|
├── database/ # Migration, seed, schema
|
||||||
|
├── tests/ # Unit test, integration test, e2e test
|
||||||
|
├── scripts/ # Script hỗ trợ build, deploy, backup, maintenance
|
||||||
|
├── docs/ # Tài liệu kỹ thuật, kiến trúc, quy trình
|
||||||
|
├── .github/ # GitHub Actions, issue template, PR template
|
||||||
|
├── Dockerfile # Build image ứng dụng
|
||||||
|
├── docker-compose.yml # Chạy local/dev bằng container
|
||||||
|
├── .env.example # Biến môi trường mẫu
|
||||||
|
└── README.md
|
||||||
|
```
|
||||||
|
|
||||||
Read more details in the documentation. You can start from here: [Quick Start](docs/intro/quickstart.en.md).
|
> Cấu trúc thực tế có thể thay đổi theo framework đang sử dụng.
|
||||||
|
|
||||||
## Talks and presentations
|
## Yêu cầu môi trường
|
||||||
|
|
||||||
- KuberConf'2025: [video](https://vitastor.io/presentation/kuberconf.webm)
|
Tùy theo stack công nghệ của website, môi trường phát triển nên có:
|
||||||
- Highload'2025: [video](https://vitastor.io/presentation/hl2025/hl2025.webm),
|
|
||||||
[youtube](https://www.youtube.com/watch?v=0R8MLjFtz7g), presentation
|
|
||||||
([in Russian](https://vitastor.io/presentation/hl2025/), [in English](https://vitastor.io/presentation/hl2025/en.html))
|
|
||||||
- Highload'2022: presentation ([in Russian](https://vitastor.io/presentation/highload/highload.html)),
|
|
||||||
[video](https://vitastor.io/presentation/highload/talk.webm)
|
|
||||||
- DevOpsConf'2021: presentation ([in Russian](https://vitastor.io/presentation/devopsconf/devopsconf.html),
|
|
||||||
[in English](https://vitastor.io/presentation/devopsconf/devopsconf_en.html)),
|
|
||||||
[video](https://vitastor.io/presentation/devopsconf/talk.webm)
|
|
||||||
|
|
||||||
## Documentation
|
- Git
|
||||||
|
- Docker và Docker Compose
|
||||||
|
- Node.js / PHP / Python / runtime phù hợp với dự án
|
||||||
|
- Make (khuyến nghị)
|
||||||
|
- Truy cập vào file cấu hình môi trường `.env`
|
||||||
|
|
||||||
- Introduction
|
## Bắt đầu nhanh
|
||||||
- [Quick Start](docs/intro/quickstart.en.md)
|
|
||||||
- [Features](docs/intro/features.en.md)
|
|
||||||
- [Architecture](docs/intro/architecture.en.md)
|
|
||||||
- [Author and license](docs/intro/author.en.md)
|
|
||||||
- Installation
|
|
||||||
- [Packages](docs/installation/packages.en.md)
|
|
||||||
- [Docker](docs/installation/docker.en.md)
|
|
||||||
- [Proxmox](docs/installation/proxmox.en.md)
|
|
||||||
- [OpenNebula](docs/installation/opennebula.en.md)
|
|
||||||
- [OpenStack](docs/installation/openstack.en.md)
|
|
||||||
- [Kubernetes CSI](docs/installation/kubernetes.en.md)
|
|
||||||
- [S3](docs/installation/s3.en.md)
|
|
||||||
- [Building from Source](docs/installation/source.en.md)
|
|
||||||
- Configuration
|
|
||||||
- [Overview](docs/config.en.md)
|
|
||||||
- Parameter Reference
|
|
||||||
- [Common](docs/config/common.en.md)
|
|
||||||
- [Network](docs/config/network.en.md)
|
|
||||||
- [Client](docs/config/client.en.md)
|
|
||||||
- [Global Disk Layout](docs/config/layout-cluster.en.md)
|
|
||||||
- [OSD Disk Layout](docs/config/layout-osd.en.md)
|
|
||||||
- [OSD Runtime Parameters](docs/config/osd.en.md)
|
|
||||||
- [Monitor](docs/config/monitor.en.md)
|
|
||||||
- [Pool configuration](docs/config/pool.en.md)
|
|
||||||
- [Image metadata in etcd](docs/config/inode.en.md)
|
|
||||||
- Usage
|
|
||||||
- [vitastor-cli](docs/usage/cli.en.md) (command-line interface)
|
|
||||||
- [vitastor-disk](docs/usage/disk.en.md) (disk management tool)
|
|
||||||
- [fio](docs/usage/fio.en.md) for benchmarks
|
|
||||||
- [UBLK](docs/usage/ublk.en.md) for kernel mounts
|
|
||||||
- [NBD](docs/usage/nbd.en.md) - old interface for kernel mounts
|
|
||||||
- [QEMU, qemu-img and VDUSE](docs/usage/qemu.en.md)
|
|
||||||
- [NFS](docs/usage/nfs.en.md) clustered file system and pseudo-FS proxy
|
|
||||||
- [Administration](docs/usage/admin.en.md)
|
|
||||||
- Performance
|
|
||||||
- [Understanding storage performance](docs/performance/understanding.en.md)
|
|
||||||
- [Theoretical performance](docs/performance/theoretical.en.md)
|
|
||||||
- [Example comparison with Ceph](docs/performance/comparison1.en.md)
|
|
||||||
- [Newer benchmark of Vitastor 1.3.1](docs/performance/bench2.en.md)
|
|
||||||
|
|
||||||
## Author and License
|
### 1. Clone repository
|
||||||
|
|
||||||
Copyright (c) Vitaliy Filippov (vitalif [at] yourcmc.ru), 2019+
|
```bash
|
||||||
|
git clone https://github.com/<your-org>/tromcho.net.git
|
||||||
|
cd tromcho.net
|
||||||
|
```
|
||||||
|
|
||||||
Join Vitastor Telegram Chat: https://t.me/vitastor
|
### 2. Tạo file môi trường
|
||||||
|
|
||||||
All server-side code (OSD, Monitor and so on) is licensed under the terms of
|
```bash
|
||||||
Vitastor Network Public License 1.1 (VNPL 1.1), a copyleft license based on
|
cp .env.example .env
|
||||||
GNU GPLv3.0 with the additional "Network Interaction" clause which requires
|
```
|
||||||
opensourcing all programs directly or indirectly interacting with Vitastor
|
|
||||||
through a computer network and expressly designed to be used in conjunction
|
|
||||||
with it ("Proxy Programs"). Proxy Programs may be made public not only under
|
|
||||||
the terms of the same license, but also under the terms of any GPL-Compatible
|
|
||||||
Free Software License, as listed by the Free Software Foundation.
|
|
||||||
This is a stricter copyleft license than the Affero GPL.
|
|
||||||
|
|
||||||
Please note that VNPL doesn't require you to open the code of proprietary
|
Sau đó cập nhật các biến cấu hình cần thiết trong file `.env`.
|
||||||
software running inside a VM if it's not specially designed to be used with
|
|
||||||
Vitastor.
|
|
||||||
|
|
||||||
Basically, you can't use the software in a proprietary environment to provide
|
### 3. Chạy môi trường local
|
||||||
its functionality to users without opensourcing all intermediary components
|
|
||||||
standing between the user and Vitastor or purchasing a commercial license
|
|
||||||
from the author 😀.
|
|
||||||
|
|
||||||
Client libraries (cluster_client and so on) are dual-licensed under the same
|
Nếu dự án dùng Docker:
|
||||||
VNPL 1.1 and also GNU GPL 2.0 or later to allow for compatibility with GPLed
|
|
||||||
software like QEMU and fio.
|
|
||||||
|
|
||||||
You can find the full text of VNPL-1.1 in the file [VNPL-1.1.txt](VNPL-1.1.txt).
|
```bash
|
||||||
GPL 2.0 is also included in this repository as [GPL-2.0.txt](GPL-2.0.txt).
|
docker compose up -d --build
|
||||||
|
```
|
||||||
|
|
||||||
|
Nếu dự án chạy trực tiếp theo framework, sử dụng lệnh tương ứng của stack hiện tại.
|
||||||
|
|
||||||
|
## Quy trình phát triển
|
||||||
|
|
||||||
|
- Tạo branch mới từ `main` hoặc `develop`.
|
||||||
|
- Đặt tên branch rõ ràng, ví dụ: `feature/homepage-banner`, `fix/login-timeout`.
|
||||||
|
- Commit ngắn gọn, đúng ngữ cảnh thay đổi.
|
||||||
|
- Tạo Pull Request để review trước khi merge.
|
||||||
|
- Không commit file bí mật như `.env`, private key hoặc credential.
|
||||||
|
|
||||||
|
## Quy ước commit
|
||||||
|
|
||||||
|
Khuyến nghị dùng convention sau:
|
||||||
|
|
||||||
|
```text
|
||||||
|
feat: thêm chức năng mới
|
||||||
|
fix: sửa lỗi
|
||||||
|
refactor: tái cấu trúc mã nguồn
|
||||||
|
chore: cập nhật tác vụ phụ trợ
|
||||||
|
ci: thay đổi pipeline CI/CD
|
||||||
|
docs: cập nhật tài liệu
|
||||||
|
test: bổ sung hoặc cập nhật kiểm thử
|
||||||
|
```
|
||||||
|
|
||||||
|
## CI/CD
|
||||||
|
|
||||||
|
Repository nên tích hợp các bước tự động sau:
|
||||||
|
|
||||||
|
- Lint source code
|
||||||
|
- Chạy unit test / integration test
|
||||||
|
- Build artifact hoặc Docker image
|
||||||
|
- Scan bảo mật dependency/container
|
||||||
|
- Deploy tới staging hoặc production theo rule xác định
|
||||||
|
|
||||||
|
Ví dụ vị trí cấu hình pipeline:
|
||||||
|
|
||||||
|
```text
|
||||||
|
.github/workflows/
|
||||||
|
```
|
||||||
|
|
||||||
|
## Biến môi trường
|
||||||
|
|
||||||
|
Không commit file `.env` thật lên GitHub.
|
||||||
|
Nên cung cấp `.env.example` với:
|
||||||
|
|
||||||
|
- Danh sách biến bắt buộc
|
||||||
|
- Giá trị mẫu an toàn
|
||||||
|
- Ghi chú ngắn cho từng biến quan trọng
|
||||||
|
|
||||||
|
Ví dụ:
|
||||||
|
|
||||||
|
```env
|
||||||
|
APP_ENV=local
|
||||||
|
APP_DEBUG=true
|
||||||
|
APP_URL=http://localhost
|
||||||
|
DB_HOST=127.0.0.1
|
||||||
|
DB_PORT=3306
|
||||||
|
DB_NAME=tromcho
|
||||||
|
DB_USER=user
|
||||||
|
DB_PASSWORD=change_me
|
||||||
|
```
|
||||||
|
|
||||||
|
## Triển khai
|
||||||
|
|
||||||
|
Khuyến nghị tách rõ các môi trường:
|
||||||
|
|
||||||
|
- local
|
||||||
|
- development
|
||||||
|
- staging
|
||||||
|
- production
|
||||||
|
|
||||||
|
Các thành phần nên được chuẩn hóa khi triển khai:
|
||||||
|
|
||||||
|
- Biến môi trường
|
||||||
|
- Reverse proxy / web server
|
||||||
|
- TLS certificate
|
||||||
|
- Database migration
|
||||||
|
- Backup strategy
|
||||||
|
- Log rotation và monitoring
|
||||||
|
|
||||||
|
## Bảo mật
|
||||||
|
|
||||||
|
- Không đưa secrets vào source code.
|
||||||
|
- Bật branch protection cho nhánh quan trọng.
|
||||||
|
- Review dependency định kỳ.
|
||||||
|
- Áp dụng nguyên tắc least privilege cho tài khoản deploy.
|
||||||
|
- Theo dõi log, audit và cảnh báo bất thường.
|
||||||
|
|
||||||
|
## Đóng góp
|
||||||
|
|
||||||
|
Khi đóng góp vào repository:
|
||||||
|
|
||||||
|
1. Fork hoặc tạo branch làm việc.
|
||||||
|
2. Cập nhật mã nguồn theo phạm vi thay đổi.
|
||||||
|
3. Kiểm tra local trước khi tạo Pull Request.
|
||||||
|
4. Viết mô tả PR rõ ràng: mục tiêu, phạm vi ảnh hưởng, cách kiểm thử.
|
||||||
|
|
||||||
|
## Tài liệu nên bổ sung
|
||||||
|
|
||||||
|
Repository này nên có thêm các tài liệu sau trong thư mục `docs/`:
|
||||||
|
|
||||||
|
- Kiến trúc hệ thống
|
||||||
|
- Sơ đồ database
|
||||||
|
- Luồng deploy
|
||||||
|
- Quy trình backup/restore
|
||||||
|
- Hướng dẫn xử lý sự cố
|
||||||
|
- Checklist release
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
Bổ sung thông tin license phù hợp với mục đích sử dụng của dự án.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Có thể cập nhật README này tiếp theo theo đúng stack thực tế của `tromcho.net` như Laravel, WordPress, Next.js, Nuxt, Django hoặc static site.
|
||||||
|
|||||||
Reference in New Issue
Block a user