Added new SSD to NAS08 for 5 drive RAID
This commit is contained in:
parent
c60719845c
commit
f6eacac926
2 changed files with 37 additions and 10 deletions
27
server_debteliminator_addendum_0f_legal_translations.md
Normal file
27
server_debteliminator_addendum_0f_legal_translations.md
Normal file
|
|
@ -0,0 +1,27 @@
|
||||||
|
# server_debteliminator.md — addendum §0f (paste after §0e)
|
||||||
|
|
||||||
|
## 0f. Legal documents in multiple languages (built 2026-10-20/21, package `legal-translations-v2.1.27.tar.gz`, built against the v2.1.26 QA backup)
|
||||||
|
|
||||||
|
**What it does**
|
||||||
|
- Terms of Use, Privacy Statement and Affiliate Disclosure can each be written in every language the Blog supports (admin picks the language, then edits/publishes, like the Blog editor).
|
||||||
|
- **Every language is its own document with its own version counter.** English stays in `legal_documents` (untouched); other languages are in new table `legal_document_translations` (`doc_type, lang, version, content_html, based_on_en_version, requires_acceptance, published_at, published_by_user_id`).
|
||||||
|
- **Who is asked to accept what** (`legal_i18n.py`): a user is shown the document in their saved locale's language (`users.locale`), or English when that language has no translation yet. They must accept when (a) they have never accepted that document in any language, or (b) their accepted version *in the language they are shown* is below the newest version in that language that requires acceptance.
|
||||||
|
- Publish English v5 → only readers of English, and of languages with no translation, are asked.
|
||||||
|
- Publish Spanish v3 → only Spanish readers are asked (in Spanish).
|
||||||
|
- A language that gets its first translation later: readers are asked once in their language unless the publisher unticks "re-accept".
|
||||||
|
- **"Ask everyone to re-accept" checkbox** (default ticked = the old behaviour): untick for typos/formatting; the text changes immediately, nobody is prompted. New column `legal_documents.requires_acceptance` (default TRUE, added by `ALTER … IF NOT EXISTS` in `main.py`; existing rows = TRUE).
|
||||||
|
- **Acceptance record:** new table `legal_acceptances` (`user_id, doc_type, lang, version, accepted_at`, unique per user/doc/lang). English is still also written to `users.accepted_terms_version` / `accepted_privacy_version`. The Accept button posts the `lang` + `version` the screen showed, so an admin publishing mid-read cannot change what was agreed to.
|
||||||
|
- **Admin → User Accounts → Legal Documents:** document picker; status-by-language table (published version, "based on English vN", Current / **English is newer — review** / Not translated, users waiting to accept); language buttons; English text shown read-only beside the translation; "Start from the English text"; earlier-version loader; confirmation text says exactly who will be prompted. Languages not yet launched can be drafted.
|
||||||
|
- **Reader side:** gate overlays and the footer viewer fetch `/legal/{doc}?lang=xx`. Notes above the text: translation shown → "This is a translation… the English version controls"; fallback → existing "shown in English" note (now only when the visitor's language ≠ English); English reader → no note. The text container gets `lang` = the language of the text (WCAG 3.1.2).
|
||||||
|
- Force-reset (Re-Accept Terms / Privacy) now clears the user's acceptances in every language. Deleting a user removes their `legal_acceptances` rows and nulls `published_by_user_id` on translations.
|
||||||
|
|
||||||
|
**Endpoints** — public: `GET /legal/{doc_type}?lang=` (adds `lang`, `requested_lang`, `is_fallback`), `POST /legal/{doc_type}/accept` (optional body `{lang, version}`), `/auth/accept-terms` and `/auth/accept-privacy` (same optional body). Admin (`legal.manage`): `GET /admin/legal-documents/languages`, `…/{doc}/overview`, `…/{doc}/history?lang=`, `GET …/{doc}?lang=&version=`, `POST /admin/legal-documents` (body adds `lang`, `requires_acceptance`; a translation requires an English version to exist first).
|
||||||
|
|
||||||
|
**Files:** new `legal_i18n.py`; changed `models.py`, `schemas.py`, `security.py`, `main.py`, `routers/legal.py`, `routers/admin.py`, `routers/auth.py`, `static/shared.js`, `static/admin/accounts.html`, `static/i18n/{es,fr}/common.json` + `manifest.json` (rev refreshed; one new string). **Cache marker `?v=1.9.15`** on every page that loads `shared.css/js` (this also unifies `blog.py`, which was on 1.9.10). No new dependencies, no compose changes → **restart-only**.
|
||||||
|
|
||||||
|
**Verified** (real app, fresh Postgres 16, headless Chromium): English+Spanish publish through the admin screen; Spanish user not prompted by an English update, prompted by a Spanish update; French user (no translation) sees English with the note in French; signed-out footer viewer in Spanish; stale warning; history. Logic + API tests are in `tools/legal_i18n_tests/`. **Not run:** `a11y_audit.py` and the manual keyboard/screen-reader pass on the new Legal Documents panel and the changed overlays (required before Deploy to Prod — `accessibility_standards.md` §3).
|
||||||
|
|
||||||
|
**Open / decisions**
|
||||||
|
- Have translations of legal text reviewed (counsel / native speaker) before turning them on for real users.
|
||||||
|
- The "English version controls" sentence now also appears above translations (same wording the site already used for the English fallback). Remove it if counsel prefers.
|
||||||
|
- Reminder still open: `APP_SECRET_KEY` unset (also absent from QA compose); Privacy Statement analytics disclosure.
|
||||||
|
|
@ -4,7 +4,7 @@ Hostname: **NAS08**
|
||||||
IP Address: **192.168.150.35**
|
IP Address: **192.168.150.35**
|
||||||
VLAN: **50 — Lab / Servers**
|
VLAN: **50 — Lab / Servers**
|
||||||
|
|
||||||
Last Updated: 2026-10-20
|
Last Updated: 2026-10-21
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
@ -31,7 +31,7 @@ This device is a **critical infrastructure component**, supporting both internal
|
||||||
| /dev/sdc | Crucial BX500 (CT1000BX500SSD1) | 1TB | Data |
|
| /dev/sdc | Crucial BX500 (CT1000BX500SSD1) | 1TB | Data |
|
||||||
| /dev/sdd | Crucial BX500 (CT1000BX500SSD1) | 1TB | Data |
|
| /dev/sdd | Crucial BX500 (CT1000BX500SSD1) | 1TB | Data |
|
||||||
| /dev/sde | Crucial BX500 (CT1000BX500SSD1) | 1TB | Data |
|
| /dev/sde | Crucial BX500 (CT1000BX500SSD1) | 1TB | Data |
|
||||||
| /dev/sdf | Crucial MX500 (CT1000MX500SSD1) | 1TB | Data — added 2026-10-19, being added to `kingdezignsnas` via RAIDZ expansion (see ZFS Pool section) |
|
| /dev/sdf | Crucial MX500 (CT1000MX500SSD1) | 1TB | Data — added 2026-10-19, being added to `kingdezignsnas` via RAIDZ expansion (expansion completed 2026-10-21; see ZFS Pool section) |
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
@ -681,25 +681,25 @@ sudo zpool attach kingdezignsnas raidz2-0 /dev/disk/by-id/ata-CT1000MX500SSD1_24
|
||||||
```
|
```
|
||||||
Always address disks by `/dev/disk/by-id/...`, not `/dev/sdX`.
|
Always address disks by `/dev/disk/by-id/...`, not `/dev/sdX`.
|
||||||
|
|
||||||
### **Status**
|
### **Status - COMPLETE (2026-10-21)**
|
||||||
- Started **2026-10-19 19:59:42 EDT**. Initial estimate was ~5 hours at ~198 MB/s.
|
- Started **2026-10-19 19:59:42 EDT**. Initial estimate was ~5 hours at ~198 MB/s; it actually averaged ~23 MB/s.
|
||||||
- Progress check on 2026-10-20: **36.44% (1.22T of 3.33T) at 22.8 MB/s, estimate 1 day 3 hours remaining.** Far slower than the first estimate; cause not yet diagnosed (see below). Pool stayed `ONLINE` with 0 errors.
|
- **Completed 2026-10-21 11:28:18 EDT: 3.33T copied in 1 day 15 h 28 m.** An automatic scrub followed and finished 13:55 with 0 repaired, 0 errors (2 h 27 m). Pool `ONLINE`, all five disks 0/0/0 errors. The slowdown was never diagnosed (see below).
|
||||||
- The expansion must not be interrupted: no reboot or power-off until `zpool status` shows it complete.
|
- Results: `zpool list` shows **4.55T** raw (3.40T alloc, 1.15T free, 74% cap, 5% frag); `zfs list` shows **1.69T used / 515G avail** (was ~150G avail before). `zfs list` AVAIL is lower than the ~730 GiB first estimated, consistent with ZFS still accounting free space at the old 2-data:2-parity ratio for existing data; new writes use 3+2.
|
||||||
- **Extra capacity only appears when the expansion completes** (`zpool list`, `zfs list`, and therefore OMV).
|
- OMV capacity check after completion: not yet confirmed (verify with `df -h /kingdezignsnas`; reload the OMV Storage / ZFS page if stale).
|
||||||
|
|
||||||
### **Why it is slow / what to check**
|
### **Why it is slow / what to check**
|
||||||
- Expansion rewrites all existing data (~3.33T), about 4x the data of a single-disk resilver.
|
- Expansion rewrites all existing data (~3.33T), about 4x the data of a single-disk resilver.
|
||||||
- Likely contributors: DRAM-less BX500 drives falling out of their SLC cache on sustained writes, the Pi's CPU doing parity work, and normal NAS08 load (Nextcloud, DNS, sync jobs) competing for the pool.
|
- Likely contributors: DRAM-less BX500 drives falling out of their SLC cache on sustained writes, the Pi's CPU doing parity work, and normal NAS08 load (Nextcloud, DNS, sync jobs) competing for the pool.
|
||||||
- Diagnostics: `sudo zpool iostat -v kingdezignsnas 5 3`, `iostat -x 5 3`, `sudo dmesg -T | grep -i -E "ata|sd[b-f]|reset|error" | tail -30`, `top` (CPU), and `smartctl -A` CRC counts on all five disks (the MX500 sits on the eSATA/SATA-HAT path; watch for link resets or CRC growth).
|
- Diagnostics: `sudo zpool iostat -v kingdezignsnas 5 3`, `iostat -x 5 3`, `sudo dmesg -T | grep -i -E "ata|sd[b-f]|reset|error" | tail -30`, `top` (CPU), and `smartctl -A` CRC counts on all five disks (the MX500 sits on the eSATA/SATA-HAT path; watch for link resets or CRC growth).
|
||||||
|
|
||||||
### **After it finishes**
|
### **Next steps (optional)**
|
||||||
```bash
|
```bash
|
||||||
sudo zpool status kingdezignsnas
|
sudo zpool status kingdezignsnas
|
||||||
sudo zpool list -v kingdezignsnas
|
sudo zpool list -v kingdezignsnas
|
||||||
zfs list kingdezignsnas
|
zfs list kingdezignsnas
|
||||||
sudo zpool scrub kingdezignsnas
|
sudo zpool scrub kingdezignsnas
|
||||||
```
|
```
|
||||||
Expected usable space: roughly 730 GiB free vs ~150 GiB before (estimates). Existing data keeps its old 2-data + 2-parity layout until rewritten; only new writes use the 3-data + 2-parity ratio. OpenZFS 2.4 provides `zfs rewrite` (`rewrite [-Prvx] [-o offset] [-l length] <directory|file ...>`) to re-lay-out existing data and reclaim the rest (~0.9 TiB free after a full rewrite). Considerations before using it: snapshots hold the old blocks, it needs free space as it works, it is heavy I/O (run it when Nextcloud is quiet and away from the Sunday 3:00 AM scrub and 2:30 AM sync), and take a current NAS16 backup first. Not yet run.
|
Existing data keeps its old 2-data + 2-parity layout until rewritten; only new writes use the 3-data + 2-parity ratio. OpenZFS 2.4 provides `zfs rewrite` (`rewrite [-Prvx] [-o offset] [-l length] <directory|file ...>`) to re-lay-out existing data and reclaim the rest (~0.9 TiB free after a full rewrite). Considerations before using it: snapshots hold the old blocks, it needs free space as it works, it is heavy I/O (run it when Nextcloud is quiet and away from the Sunday 3:00 AM scrub and 2:30 AM sync), and take a current NAS16 backup first. Not yet run.
|
||||||
|
|
||||||
### **OMV note**
|
### **OMV note**
|
||||||
OMV reads pool size from ZFS, so it should show the larger capacity after completion. If the Storage / ZFS page still shows the old size, reload the page; verify with `zpool list` and `df -h` first.
|
OMV reads pool size from ZFS, so it should show the larger capacity after completion. If the Storage / ZFS page still shows the old size, reload the page; verify with `zpool list` and `df -h` first.
|
||||||
|
|
@ -1082,7 +1082,7 @@ run of the script correctly reported "up to date."
|
||||||
- Critical infrastructure component for network‑wide DNS and storage.
|
- Critical infrastructure component for network‑wide DNS and storage.
|
||||||
- SSD hardening active: TRIM (weekly Wednesday 1AM), noatime (flashmemory plugin), SMART monitoring via weekly HTML email report.
|
- SSD hardening active: TRIM (weekly Wednesday 1AM), noatime (flashmemory plugin), SMART monitoring via weekly HTML email report.
|
||||||
- Six drives: 1x PNY CS900 500GB (OS), 4x Crucial BX500 1TB (data) plus 1x Crucial MX500 1TB (data, added 2026-10-19).
|
- Six drives: 1x PNY CS900 500GB (OS), 4x Crucial BX500 1TB (data) plus 1x Crucial MX500 1TB (data, added 2026-10-19).
|
||||||
- **ZFS pool `kingdezignsnas`** (OpenZFS 2.4.4) is a single RAIDZ2 vdev. On 2026-10-19 the MX500 was qualified (SMART short/long, full badblocks pass, 0 errors) and attached with `zpool attach kingdezignsnas raidz2-0 /dev/disk/by-id/ata-CT1000MX500SSD1_2415E8A6E7AC` (RAIDZ expansion, `feature@raidz_expansion` enabled). Expansion started 19:59 on 2026-10-19 and was ~36% done at 22.8 MB/s with ~27 h estimated on 2026-10-20 (initially ~5 h). Do not reboot NAS08 until it completes; new space appears only after completion; run a scrub afterward; `zfs rewrite` can later reclaim old-layout overhead. See the ZFS Pool section.
|
- **ZFS pool `kingdezignsnas`** (OpenZFS 2.4.4) is a single RAIDZ2 vdev. On 2026-10-19 the MX500 was qualified (SMART short/long, full badblocks pass, 0 errors) and attached with `zpool attach kingdezignsnas raidz2-0 /dev/disk/by-id/ata-CT1000MX500SSD1_2415E8A6E7AC` (RAIDZ expansion, `feature@raidz_expansion` enabled). **Expansion completed 2026-10-21 11:28** (1d 15h 28m, ~23 MB/s average, slowdown undiagnosed); the follow-up scrub finished clean (0 errors). Pool is now 5 disks, 4.55T raw, 74% full; `zfs list` reports 515G avail (was ~150G). Existing data keeps the old 2+2 layout; `zfs rewrite` can later reclaim the rest (not yet run). See the ZFS Pool section.
|
||||||
- **Shared permissions:** `ncshare` group (GID 1001) shared by `www-data` and `rufusking` — allows both Nextcloud and NFS to read/write the same files.
|
- **Shared permissions:** `ncshare` group (GID 1001) shared by `www-data` and `rufusking` — allows both Nextcloud and NFS to read/write the same files.
|
||||||
- NFS exports use `all_squash,anonuid=33,anongid=1001` — all NFS uploads land as `www-data:ncshare` automatically.
|
- NFS exports use `all_squash,anonuid=33,anongid=1001` — all NFS uploads land as `www-data:ncshare` automatically.
|
||||||
- Default ACLs on `/export/kingdezigns-public` ensure all new files/folders inherit `ncshare` group permissions.
|
- Default ACLs on `/export/kingdezigns-public` ensure all new files/folders inherit `ncshare` group permissions.
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue