You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/copilot-instructions.md
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -81,14 +81,22 @@ PlainNAS is a Go-based NAS (Network Attached Storage) system with a Vue 3 web fr
81
81
- Do **not** add Windows/macOS fallbacks, multi-platform abstractions, or non-Linux build stubs unless explicitly requested.
82
82
- It is acceptable for non-Linux builds to fail; correctness on Linux takes priority.
83
83
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
+
84
88
## VS Code / Copilot Rules
85
89
- 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).
- Do not add compatibility/migration/backfill code unless explicitly requested; it is acceptable to require deleting/rebuilding the DB for development workflows.
88
92
- Prefer index-backed fast paths; avoid full scans and N+1 patterns.
89
93
- 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.
90
97
- 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`.
91
98
- 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.
92
100
- Do not remove the `<pre class="view-raw">` element; it is intentionally kept for troubleshooting.
93
101
- 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.
94
102
- 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.
Copy file name to clipboardExpand all lines: README.md
+42-3Lines changed: 42 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,10 +13,16 @@ PlainNAS provides a web interface for file browsing and media management, plus b
13
13
14
14
- Web UI (served by the backend)
15
15
- 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)
16
17
- Media scan/index + search
17
18
- Thumbnails (photo/video)
18
19
- LAN discovery via `.local` (Avahi)
19
20
- Optional SMB/Samba sharing
21
+
- DLNA casting (TV cast)
22
+
23
+
Docs:
24
+
25
+
-[docs/dlna.md](docs/dlna.md)
20
26
21
27
## Why PlainNAS (vs image-based NAS OS)
22
28
@@ -34,6 +40,19 @@ Many NAS products expect you to flash a vendor image to a device/disk/USB drive
34
40
35
41
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.
36
42
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
+
37
56
## Quick start
38
57
39
58
**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
64
83
sudo ./plainnas install
65
84
```
66
85
86
+
Optional (enables `.doc` / `.docx` PDF preview):
87
+
88
+
```bash
89
+
sudo ./plainnas install --with-libreoffice
90
+
```
91
+
67
92
This will best-effort install required packages (libvips, ffmpeg, samba, avahi) and write:
68
93
69
94
-`/etc/plainnas/config.toml`
@@ -91,6 +116,18 @@ If you need to change it later, run:
0 commit comments