Skip to content

Commit 0d4461c

Browse files
committed
Version 0.3.0
1 parent 9b25c1d commit 0d4461c

149 files changed

Lines changed: 10061 additions & 2501 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.cursorrules

Lines changed: 0 additions & 248 deletions
This file was deleted.

.github/copilot-instructions.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,22 @@ PlainNAS is a Go-based NAS (Network Attached Storage) system with a Vue 3 web fr
8181
- Do **not** add Windows/macOS fallbacks, multi-platform abstractions, or non-Linux build stubs unless explicitly requested.
8282
- It is acceptable for non-Linux builds to fail; correctness on Linux takes priority.
8383

84+
## Linux-Only File Naming
85+
- Prefer **generic filenames** (e.g. `storage_mounts_list.go`) over `*_linux.go` suffixes for new files, since this repo is Linux-only.
86+
- Only use OS-suffixed filenames when a build tag split is truly required (rare here) or when matching an existing established file pattern.
87+
8488
## VS Code / Copilot Rules
8589
- If you change application behavior or logic, update the relevant Markdown docs in `docs/` (preferred) and/or `README.md` (keep docs in sync with code).
8690
- Prefer minimal, readable, maintainable code; avoid unnecessary abstractions and duplication.
8791
- Do not add compatibility/migration/backfill code unless explicitly requested; it is acceptable to require deleting/rebuilding the DB for development workflows.
8892
- Prefer index-backed fast paths; avoid full scans and N+1 patterns.
8993
- Prefer root-cause fixes over workaround logic (e.g., extra guards/dedup that mask bugs). If an invariant is broken, fix the source and let issues surface during development.
94+
- **Timeouts are not yours to “tune”:** Do **not** change network/HTTP/SOAP/GraphQL timeout values (or add new extended timeouts) unless the user explicitly requests it. Treat timeout changes as behavior changes.
95+
- **Fail-fast default:** When timeouts are needed, prefer small, conservative values (e.g. 2–3s) and avoid “make it huge so it works”. If a longer timeout is required, make it configurable (config/env) and get explicit approval.
96+
- **No HTTP context in API requests:** Do **not** use `http.NewRequestWithContext(...)` / `req.WithContext(...)` for outgoing HTTP calls in API code paths (GraphQL/REST/SOAP/etc.) unless explicitly requested. Prefer `http.Client{Timeout: ...}` for request limits.
9097
- Keep `internal/graph/schema.resolvers.go` lightweight: resolvers should only validate/translate inputs and delegate to focused files (e.g. `internal/graph/*_api.go`). Do not put substantial business logic in `schema.resolvers.go`.
9198
- Frontend templates/HTML: keep markup flat and readable—minimize nesting, avoid wrapper `<div>`s unless needed, and do not add `class` attributes unless they are required for styling/layout/testing.
99+
- Frontend UI/UX (minimalism): prefer clean, spacious, “Google/Material-like” minimal UI—show only essential information, avoid redundant metadata blocks, keep copy short, and bias toward one clear primary action.
92100
- Do not remove the `<pre class="view-raw">` element; it is intentionally kept for troubleshooting.
93101
- Frontend styling rule: avoid copy-pasting the same scoped CSS across pages/components. If a style pattern is used in more than one place, extract it into an appropriate shared home (a shared stylesheet under `web/src/styles/`, a component-level style, or a small reusable UI component) and reuse it via classes/components instead of duplicating blocks in each `.vue` file. Keep `scoped` styles for truly view-specific tweaks only.
94102
- Prefer SCSS-style nesting for component-local complex popovers and help cards (for readability). When editing a component's `<style scoped>` block, prefer nested selectors (e.g. `.dm-help-pop { .title { ... } .meta { ... } }`) instead of long flattened selectors.

README.md

Lines changed: 42 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,16 @@ PlainNAS provides a web interface for file browsing and media management, plus b
1313

1414
- Web UI (served by the backend)
1515
- File browsing and basic file operations
16+
- Read-only preview for Office docs (`.doc`/`.docx`/`.xls`/`.xlsx`/`.ppt`/`.pptx`) served as PDF (optional; requires LibreOffice)
1617
- Media scan/index + search
1718
- Thumbnails (photo/video)
1819
- LAN discovery via `.local` (Avahi)
1920
- Optional SMB/Samba sharing
21+
- DLNA casting (TV cast)
22+
23+
Docs:
24+
25+
- [docs/dlna.md](docs/dlna.md)
2026

2127
## Why PlainNAS (vs image-based NAS OS)
2228

@@ -34,6 +40,19 @@ Many NAS products expect you to flash a vendor image to a device/disk/USB drive
3440

3541
If you want “no flashing images”, “no platform lock-in”, and a clean web UI that works out of the box, PlainNAS is a good fit.
3642

43+
## PlainNAS vs other projects
44+
45+
PlainNAS prioritizes performance efficiency, low resource consumption, and secure data transmission.
46+
47+
| Project | What it is (stack / architecture) | Resource profile (CPU / RAM) | Security (API/data transport) |
48+
| --- | --- | --- | --- |
49+
| **PlainNAS** | General-purpose NAS • Go + Pebble + Vue 3 • single-process service | **Low**: single Go process; memory can stay in tens of MB; CPU mainly driven by file I/O | **High**: LAN API traffic secured with TLS + XChaCha20-Poly1305; not plaintext |
50+
| **Immich** | Photo/video management • Node (NestJS) + Postgres + Redis + ML services • multi-service | **High**: many always-on processes; often hundreds of MB idle; indexing/AI can saturate CPU | **Medium**: often HTTP on LAN or reverse-proxy TLS; internal APIs can be plaintext |
51+
| **PhotoPrism** | Photo management • Go + TensorFlow + MariaDB • multi-service | **Med–High**: DB + AI models; CPU/RAM rise significantly during indexing | **Medium**: usually plaintext HTTP on LAN; TLS via external reverse proxy |
52+
| **LibrePhotos** | Photo management • Python + Django + DB + AI • multi-service | **High**: Python runtime + model loading; higher memory footprint; CPU-heavy scanning | **Medium**: commonly plaintext HTTP locally; TLS depends on deployment |
53+
| **Lychee** | Photo gallery • PHP + MySQL/SQLite • web + DB | **Medium**: PHP-FPM + DB are long-running; higher baseline than single Go service | **Low–Medium**: plaintext HTTP by default; HTTPS via web server config |
54+
| **PiGallery2** | Gallery browser • Node.js • single service (heavier runtime) | **Medium**: higher baseline memory than Go; thumbnail generation spikes CPU | **Low–Medium**: plaintext HTTP by default; TLS via external proxy |
55+
3756
## Quick start
3857

3958
**Recommended OS:** Ubuntu or Ubuntu-based distributions (Debian, Mint, etc.) are recommended for best compatibility and package support. Other modern Linux distributions may work, but Ubuntu is preferred for smooth installation and updates.
@@ -64,6 +83,12 @@ go build
6483
sudo ./plainnas install
6584
```
6685

86+
Optional (enables `.doc` / `.docx` PDF preview):
87+
88+
```bash
89+
sudo ./plainnas install --with-libreoffice
90+
```
91+
6792
This will best-effort install required packages (libvips, ffmpeg, samba, avahi) and write:
6893

6994
- `/etc/plainnas/config.toml`
@@ -91,6 +116,18 @@ If you need to change it later, run:
91116
sudo plainnas passwd
92117
```
93118

119+
To uninstall:
120+
121+
```bash
122+
sudo plainnas uninstall
123+
```
124+
125+
To keep config and/or runtime data:
126+
127+
```bash
128+
sudo plainnas uninstall --keep-config --keep-data
129+
```
130+
94131
</details>
95132

96133
## Files and directories
@@ -158,6 +195,7 @@ go generate ./internal/graph
158195
- File conflicts (copy/paste & upload): [docs/file-conflicts.md](docs/file-conflicts.md)
159196
- Tags: [docs/tags.md](docs/tags.md)
160197
- Thumbnails: [docs/thumbnails.md](docs/thumbnails.md)
198+
- Performance benchmarks: [docs/performance-benchmarks.md](docs/performance-benchmarks.md)
161199
- Media items: [docs/media-items.md](docs/media-items.md)
162200
- Events (audit log): [docs/events.md](docs/events.md)
163201
- LAN share (SMB/Samba): [docs/samba.md](docs/samba.md)
@@ -166,11 +204,12 @@ go generate ./internal/graph
166204

167205
Tested setup:
168206

169-
- NanoPi R4S (4 GB RAM)
207+
- NanoPi R4S (4 GB RAM) or NUC-C3 L4 (J3160 + 8 GB RAM)
170208
- USB Type-C to SATA 3.0 controller (5-port)
171209
- 2 × SATA hard drives
172210
- OS: [Armbian for NanoPi R4S](https://www.armbian.com/nanopi-r4s/)
173211

174-
<img src="./images/r4s.png" width="240">
175-
<img src="./images/usb-controller.png" width="180">
212+
<img src="./images/r4s.png" width="200">
213+
<img src="./images/nuc-c3-l4.png" width="240">
214+
<img src="./images/usb-controller.png" width="200">
176215
<img src="./images/disk.png" width="100">

0 commit comments

Comments
 (0)