From 5d829e8c5534b18e449477541cbd96e158c28d36 Mon Sep 17 00:00:00 2001 From: Matias De lellis Date: Mon, 8 Jun 2026 12:01:52 -0300 Subject: [PATCH] Just translate the new files. --- README.md | 38 ++++++----- docker/.env.example | 10 +++ docker/README.md | 124 ++++++++++++++++++----------------- docker/docker-compose.yml | 15 +++++ docker/scripts/build.sh | 16 ++--- docker/scripts/down.sh | 6 +- docker/scripts/enable-app.sh | 10 +-- docker/scripts/up.sh | 22 +++---- 8 files changed, 138 insertions(+), 103 deletions(-) diff --git a/README.md b/README.md index 681cad3..e76ec2c 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,17 @@ # Quick notes -The Quick notes application, is an application to take quick notes -Forgive the -redundancy :sweat_smile:- on small cards, organizedby colors and tags. It allows -a basic rich text as **Bold**, *italic*, and numbered or bullet list to improve -the notes. Also it allows attaching files, and the notes can be shared as -read-only to other users. +The Quick notes application is a tool to take quick notes (forgive the +redundancy :sweat_smile:) on small cards, organized by colors and tags. It +supports basic rich text formatting such as **bold**, *italic*, and numbered or +bullet lists to enhance your notes. It also allows attaching files, and the +notes can be shared as read-only with other users. ![Screenshot of Quick notes](/doc/quicknotes-grid-view.jpeg "App screenshot") ## :heart: Support -If you'd like to support the creation and maintenance of this software, consider -donating. +If you'd like to support the creation and maintenance of this software, please +consider donating. [![Donate](https://img.shields.io/badge/Donate-PayPal-blue)](https://github.com/matiasdelellis/quicknotes/wiki/Donate) [![Donate](https://img.shields.io/badge/Donate-Bitcoin-orange)](https://github.com/matiasdelellis/quicknotes/wiki/Donate) @@ -20,25 +20,31 @@ donating. ## :rocket: Installation Quick notes is available in the Nextcloud App Store and can be installed -directly from your Nextcloud installation looking in the category Office. +directly from your Nextcloud instance by browsing to the Office category. -Nextcloud will notify you about possible updates. Please have a look at +Nextcloud will notify you about available updates. Please have a look at [CHANGELOG.md](CHANGELOG.md) for details about changes. ## :exclamation: Bugs Before reporting bugs: -* Get the newest version of the Quick notes app -* Please consider also installing the [latest development version](https://github.com/matiasdelellis/quicknotes.git) -* [Check if they have already been reported](https://github.com/matiasdelellis/quicknotes/issues) +* Make sure you are running the latest version of the Quick notes app. +* Consider also installing the [latest development version](https://github.com/matiasdelellis/quicknotes.git). +* [Check whether the issue has already been reported](https://github.com/matiasdelellis/quicknotes/issues). ## Building the app -1. Clone this into your `apps` folder of your Nextcloud: `git clone https://github.com/matiasdelellis/quicknotes.git` -2. In a terminal, just run the command `make` to install the dependencies and build the aplication. -3. Enable the app through the app management of your Nextcloud. +1. Clone this repository into your Nextcloud `apps` folder: `git clone https://github.com/matiasdelellis/quicknotes.git`. +2. In a terminal, run `make` to install the dependencies and build the application. +3. Enable the app from the Apps management page of your Nextcloud instance. + +## Local development with Docker + +A self-contained Docker environment is provided under the [`docker/`](docker/) +folder. See [docker/README.md](docker/README.md) for details on how to spin up +a Nextcloud + MariaDB stack with this app mounted as `custom_apps/quicknotes`. ## Translating -Join project on https://www.transifex.com/matias/quicknotes/ +Join the project on https://www.transifex.com/matias/quicknotes/ diff --git a/docker/.env.example b/docker/.env.example index 883f0de..ddcd89e 100644 --- a/docker/.env.example +++ b/docker/.env.example @@ -1,11 +1,21 @@ +# Copy this file to `../.env` and adjust the values to your needs. +# All variables are consumed by docker-compose.yml. + +# --- MariaDB --------------------------------------------------------------- MARIADB_ROOT_PASSWORD=changeme-root MARIADB_DATABASE=nextcloud MARIADB_USER=nextcloud MARIADB_PASSWORD=changeme-db +# --- Nextcloud HTTP port --------------------------------------------------- +# Host port mapped to the container's port 80. NEXTCLOUD_HTTP_PORT=8080 +# --- Nextcloud admin account ---------------------------------------------- NEXTCLOUD_ADMIN_USER=admin NEXTCLOUD_ADMIN_PASSWORD=changeme-admin + +# Comma-separated list of hostnames/IPs that Nextcloud should trust. NEXTCLOUD_TRUSTED_DOMAINS=localhost:8080 +# Use "http" for plain local development; switch to "https" behind a reverse proxy. NEXTCLOUD_OVERWRITEPROTOCOL=http diff --git a/docker/README.md b/docker/README.md index 5c69eac..f3252fc 100644 --- a/docker/README.md +++ b/docker/README.md @@ -1,10 +1,10 @@ -# Entorno de desarrollo local (Docker) +# Local development environment (Docker) -Levanta un Nextcloud 32 + MariaDB y monta este repositorio dentro de -`custom_apps/quicknotes` para poder probar la app sin instalar Nextcloud -a mano. +Spins up a Nextcloud 32 + MariaDB stack and mounts this repository into +`custom_apps/quicknotes`, so you can try the app without installing +Nextcloud manually. -Todo lo necesario para el entorno vive en este directorio: +Everything required for the environment lives in this directory: ``` docker/ @@ -15,100 +15,104 @@ docker/ │ ├── down.sh │ ├── build.sh │ └── enable-app.sh -└── README.md ← este archivo +└── README.md ← this file ``` -## Requisitos +## Requirements -- Docker 20.10+ y Docker Compose v2 (o `docker-compose` v1.29+) -- ~2 GB de RAM libres -- Puertos: `8080` (configurable en `.env`) +- Docker 20.10+ and Docker Compose v2 (or `docker-compose` v1.29+) +- ~2 GB of free RAM +- Port: `8080` (configurable in `.env`) -## Arranque rápido +## Quick start ```bash -# 1) Configurar credenciales (la primera vez) +# 1) Configure credentials (only the first time) cp .env.example .env -# editar .env si querés cambiar puertos/contraseñas +# edit .env if you want to change ports/passwords -# 2) Levantar y habilitar la app +# 2) Bring the stack up and enable the app ./docker/scripts/up.sh ``` -> Nota: el `.env` se mantiene en la raíz del repo para que `docker -> compose` (que busca `.env` relativo al compose) lo encuentre. Si -> preferís tenerlo todo dentro de `docker/`, mové `.env` también a esa -> carpeta y borrá el `--env-file` que pasa `up.sh`. +> Note: the `.env` file is kept at the repository root so that +> `docker compose` (which looks for `.env` relative to the compose file) +> can find it. If you prefer to keep everything inside `docker/`, move +> `.env` into that folder as well and drop the `--env-file` flag that +> `up.sh` passes. -El script: -1. Levanta MariaDB y Nextcloud. -2. **Si faltan assets compilados** (`js/templates.js`, `js/vendor/`, - `js/quicknotes-*.js`), corre `./docker/scripts/build.sh` - automáticamente usando el servicio `builder` (Node 20) de - docker-compose. -3. Espera a que Nextcloud termine el primer arranque. -4. Pregunta si querés habilitar Quick notes (responde `s`). +The script: -Una vez listo, abrí y entrá con las credenciales -definidas en `.env` (`NEXTCLOUD_ADMIN_USER` / `NEXTCLOUD_ADMIN_PASSWORD`). +1. Brings MariaDB and Nextcloud up. +2. **If compiled assets are missing** (`js/templates.js`, `js/vendor/`, + `js/quicknotes-*.js`), it automatically runs `./docker/scripts/build.sh` + using the `builder` service (Node 20) from the compose file. +3. Waits for Nextcloud to finish its first-time setup. +4. Asks whether you want to enable Quick notes (answer `y`). -## Compilar assets manualmente +Once everything is ready, open and sign in with the +credentials defined in `.env` (`NEXTCLOUD_ADMIN_USER` / +`NEXTCLOUD_ADMIN_PASSWORD`). -Si tocás un `.vue` en `src/components/`, un template Handlebars en -`js/templates/` o un `.js` en `js/`, hay que re-compilar: +## Building assets manually + +If you edit a `.vue` file in `src/components/`, a Handlebars template in +`js/templates/`, or any other JS file, you need to re-build: ```bash ./docker/scripts/build.sh ``` -El build se hace dentro del contenedor `quicknotes-builder` (Node 20) -y escribe los artefactos en el host, que ya están montados en -`custom_apps/quicknotes` dentro de Nextcloud. Para que el navegador -tome los cambios, refrescá con Ctrl+Shift+R (Nextcloud cachea JS -agresivamente). +The build runs inside the `quicknotes-builder` container (Node 20) and +writes the artifacts to the host, where they are already mounted into +`custom_apps/quicknotes` inside Nextcloud. For the browser to pick up +the changes, hard-reload with Ctrl+Shift+R (Nextcloud caches JS +aggressively). -## Comandos útiles +## Useful commands ```bash -# Re-habilitar la app luego de cambios de código PHP/templates +# Re-enable the app after PHP/templates changes ./docker/scripts/enable-app.sh -# Re-compilar assets luego de tocar .vue, .handlebars, .js +# Re-build assets after editing .vue, .handlebars or .js files ./docker/scripts/build.sh -# Entrar al contenedor de Nextcloud +# Open a shell inside the Nextcloud container docker exec -it -u www-data quicknotes-app bash -# Ver logs de Nextcloud +# Tail the Nextcloud logs docker logs -f quicknotes-app -# Ver logs de la DB +# Tail the database logs docker logs -f quicknotes-db -# Bajar los contenedores (conservando los datos) +# Stop the containers (preserving data) ./docker/scripts/down.sh -# Bajar y borrar TODO (DB + archivos de Nextcloud + caché de npm) +# Stop the containers and wipe EVERYTHING (DB + Nextcloud files + npm cache) ./docker/scripts/down.sh --purge ``` -## Cómo funciona +## How it works -- `docker-compose.yml` define tres servicios: `db` (MariaDB 11.4), - `app` (Nextcloud 32) y `builder` (Node 20, para compilar assets). -- El directorio raíz del repo se monta como volumen en - `/var/www/html/custom_apps/quicknotes` (los volúmenes del compose - usan `../` para salir de `docker/` y montar el proyecto completo). -- Los datos persistentes (DB + `data/`, `config/`, `apps/` no montados) - viven en los volúmenes `quicknotes_db`, `quicknotes_nc` y - `quicknotes_npm_cache`. +- `docker-compose.yml` defines three services: `db` (MariaDB 11.4), + `app` (Nextcloud 32) and `builder` (Node 20, used to build assets). +- The repository root is bind-mounted into + `/var/www/html/custom_apps/quicknotes` (the compose volumes use + `../` to step out of `docker/` and mount the whole project). +- Persistent data (database + `data/`, `config/`, unmounted `apps/`) + lives in the `quicknotes_db`, `quicknotes_nc` and `quicknotes_npm_cache` + volumes. -## Limitaciones +## Limitations -- El `info.xml` declara la app para Nextcloud 32. Si necesitás otra - versión, cambiá el tag de la imagen en `docker-compose.yml` (p. ej. +- `info.xml` declares the app for Nextcloud 32. If you need a different + version, change the image tag in `docker-compose.yml` (e.g. `nextcloud:31`). -- SELinux en Enforcing requiere el sufijo `:z` en el bind mount (ya - está configurado). Si tu distro no usa SELinux podés sacarlo. -- El bundle Vue de dashboard pesa ~3 MB (warning de webpack). Es - tamaño aceptable para dev; la app oficial lo reduce con code-split. +- SELinux in Enforcing mode requires the `:z` suffix on the bind mounts + (already configured). If your distribution does not use SELinux, you + can remove it. +- The dashboard Vue bundle is ~3 MB (webpack warning). That is + acceptable for development; the shipped app reduces it with + code-splitting. diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 84f349f..df34405 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -1,10 +1,15 @@ +# Local development stack for the Quick notes Nextcloud app. +# See ../docker/README.md for usage instructions. name: quicknotes services: + # MariaDB 11.4 — backing store for Nextcloud. db: image: mariadb:11.4 container_name: quicknotes-db restart: unless-stopped + # READ-COMMITTED + ROW-based binlog are the settings recommended by Nextcloud + # for use with MariaDB / MySQL. command: --transaction-isolation=READ-COMMITTED --log-bin=binlog --binlog-format=ROW environment: MARIADB_ROOT_PASSWORD: ${MARIADB_ROOT_PASSWORD} @@ -19,6 +24,9 @@ services: timeout: 5s retries: 10 + # Nextcloud 32 — the application server. The repository is bind-mounted into + # custom_apps/quicknotes so changes to the code are picked up live. The + # `:z` SELinux relabeling option is required when SELinux is in Enforcing mode. app: image: nextcloud:32 container_name: quicknotes-app @@ -39,6 +47,9 @@ services: NEXTCLOUD_OVERWRITEPROTOCOL: ${NEXTCLOUD_OVERWRITEPROTOCOL} volumes: - nc:/var/www/html + # Mount the parent directory (the repository root) into the Nextcloud + # custom_apps folder. The leading `../` steps out of this `docker/` + # directory so the whole project ends up in the right place. - ../:/var/www/html/custom_apps/quicknotes:z healthcheck: test: ["CMD", "curl", "-fsS", "http://localhost/status.php"] @@ -46,6 +57,10 @@ services: timeout: 10s retries: 5 + # Node 20 — used solely to build the front-end assets. Trigger the build + # with `docker/scripts/build.sh`. The container stays idle (`sleep infinity`) + # between builds; dependencies and the npm cache are persisted via the + # `npm_cache` volume. builder: image: node:20-bookworm container_name: quicknotes-builder diff --git a/docker/scripts/build.sh b/docker/scripts/build.sh index b90a325..c69a432 100755 --- a/docker/scripts/build.sh +++ b/docker/scripts/build.sh @@ -1,14 +1,14 @@ #!/usr/bin/env bash -# Compila los assets de la app (vendors JS, templates Handlebars, bundles Vue). -# Requiere el servicio `builder` del docker-compose (node:20). +# Builds the app assets (JS vendors, precompiled Handlebars templates, Vue bundles). +# Requires the `builder` service from docker-compose (node:20). set -euo pipefail cd "$(dirname "$0")/.." # -> docker/ if ! docker compose ps builder --status running >/dev/null 2>&1; then - echo ">> El servicio 'builder' no está corriendo. Levantando..." + echo ">> The 'builder' service is not running. Starting it..." docker compose up -d builder - echo ">> Esperando a que 'builder' esté listo..." + echo ">> Waiting for 'builder' to be ready..." for i in {1..30}; do if docker compose ps builder --status running >/dev/null 2>&1; then break @@ -17,15 +17,15 @@ if ! docker compose ps builder --status running >/dev/null 2>&1; then done fi -echo ">> Ejecutando make build dentro del contenedor builder..." +echo ">> Running the build inside the builder container..." docker compose exec -T builder sh -c ' set -e cd /app - echo "[1/3] npm install (puede tardar varios minutos la primera vez)..." + echo "[1/3] npm install (may take several minutes the first time)..." npm ci --no-audit --no-fund || npm install --no-audit --no-fund - echo "[2/3] copy deps (depsmin) + precompilar templates handlebars..." + echo "[2/3] Copy vendors (depsmin) + precompile Handlebars templates..." mkdir -p vendor js/vendor css/vendor rm -rf js/vendor/* cp node_modules/handlebars/dist/handlebars.min.js js/vendor/handlebars.js @@ -37,7 +37,7 @@ docker compose exec -T builder sh -c ' node_modules/.bin/handlebars js/templates -f js/templates.js - echo "[3/3] webpack build (vue + js principal)..." + echo "[3/3] Webpack build (Vue + main JS)..." npm run build echo "" diff --git a/docker/scripts/down.sh b/docker/scripts/down.sh index 47c7daa..5209c5f 100755 --- a/docker/scripts/down.sh +++ b/docker/scripts/down.sh @@ -1,13 +1,13 @@ #!/usr/bin/env bash -# Baja los contenedores y opcionalmente borra volúmenes. +# Stops the containers and (optionally) wipes their volumes. set -euo pipefail cd "$(dirname "$0")/.." # -> docker/ if [[ "${1:-}" == "--purge" || "${1:-}" == "-p" ]]; then - echo ">> Bajando contenedores y borrando volúmenes..." + echo ">> Stopping containers and removing volumes..." docker compose down -v else - echo ">> Bajando contenedores (los volúmenes se conservan)..." + echo ">> Stopping containers (volumes are preserved)..." docker compose down fi diff --git a/docker/scripts/enable-app.sh b/docker/scripts/enable-app.sh index b36c43c..7099528 100755 --- a/docker/scripts/enable-app.sh +++ b/docker/scripts/enable-app.sh @@ -1,20 +1,20 @@ #!/usr/bin/env bash -# Habilita la app Quick notes dentro del contenedor de Nextcloud. +# Enables the Quick notes app inside the Nextcloud container. set -euo pipefail cd "$(dirname "$0")/.." # -> docker/ -echo ">> Verificando que el código de la app esté montado en el contenedor..." +echo ">> Verifying that the app code is mounted in the container..." docker exec quicknotes-app test -f /var/www/html/custom_apps/quicknotes/appinfo/info.xml -echo ">> Ajustando permisos..." +echo ">> Fixing file ownership..." docker exec --user root quicknotes-app chown -R www-data:www-data /var/www/html/custom_apps/quicknotes -echo ">> Deshabilitando por si estaba activa, luego habilitando..." +echo ">> Disabling (in case it was enabled) and re-enabling..." docker exec --user www-data quicknotes-app php occ app:disable quicknotes || true docker exec --user www-data quicknotes-app php occ app:enable quicknotes -echo ">> Estado:" +echo ">> Status:" docker exec --user www-data quicknotes-app php occ app:list | grep -A1 '^Enabled:' | grep quicknotes || true echo "OK." diff --git a/docker/scripts/up.sh b/docker/scripts/up.sh index 58d6a47..25d5096 100755 --- a/docker/scripts/up.sh +++ b/docker/scripts/up.sh @@ -1,12 +1,12 @@ #!/usr/bin/env bash -# Arranca Nextcloud 32 + MariaDB y monta este repo como custom_apps/quicknotes. +# Brings up Nextcloud 32 + MariaDB and mounts this repo as custom_apps/quicknotes. set -euo pipefail cd "$(dirname "$0")/.." # -> docker/ REPO_ROOT="$(cd .. && pwd)" if [[ ! -f "$REPO_ROOT/.env" ]]; then - echo "Falta $REPO_ROOT/.env. Copiá docker/.env.example: cp $REPO_ROOT/.env.example $REPO_ROOT/.env" >&2 + echo "Missing $REPO_ROOT/.env. Copy docker/.env.example first: cp $REPO_ROOT/.env.example $REPO_ROOT/.env" >&2 exit 1 fi @@ -15,25 +15,25 @@ set -a source "$REPO_ROOT/.env" set +a -echo ">> Levantando contenedores..." +echo ">> Bringing containers up..." docker compose --env-file "$REPO_ROOT/.env" up -d echo -echo ">> Verificando assets compilados de la app..." +echo ">> Checking compiled assets..." if [[ ! -f "$REPO_ROOT/js/templates.js" \ || ! -d "$REPO_ROOT/js/vendor" \ || ! -f "$REPO_ROOT/js/quicknotes-dashboard.js" ]]; then - echo " Faltan assets (templates.js / vendor / bundles Vue). Compilando..." + echo " Missing assets (templates.js / vendor / Vue bundles). Building..." "$(dirname "$0")/build.sh" else echo " Assets OK." fi echo -echo ">> Esperando a que Nextcloud termine el primer arranque (puede tardar 1-2 min)..." +echo ">> Waiting for Nextcloud to finish its first-time setup (may take 1-2 min)..." for i in {1..60}; do if docker exec quicknotes-app curl -fsS http://localhost/status.php >/dev/null 2>&1; then - echo " Nextcloud está respondiendo." + echo " Nextcloud is responding." break fi printf "." @@ -41,12 +41,12 @@ for i in {1..60}; do done echo -echo ">> ¿Habilitar Quick notes ahora? [s/N]" +echo ">> Enable Quick notes now? [y/N]" read -r ans -if [[ "${ans:-N}" =~ ^[sSyY]$ ]]; then +if [[ "${ans:-N}" =~ ^[yYsS]$ ]]; then "$(dirname "$0")/enable-app.sh" fi echo -echo "Listo. Abrí http://localhost:${NEXTCLOUD_HTTP_PORT:-8080}" -echo "Usuario: ${NEXTCLOUD_ADMIN_USER:-admin}" +echo "Done. Open http://localhost:${NEXTCLOUD_HTTP_PORT:-8080}" +echo "User: ${NEXTCLOUD_ADMIN_USER:-admin}"