Skip to contentSkip to conversation

Documentation updates; README files as Markdown

PATCH New Tim Orling 1 participant 11 messages Oct 18 Licenses and spdx stuff

lore
Share & tools
lore

Tim Orling

author
#0 lore raw

cover Documentation updates; README files as Markdown

This series applies on top of the "Docker: environment files" and "dockersetup.py" series, which patches 2 and 9 document.

Patches 1-4 update the content: running the tests and the current requirements in README.devel, upgrading to the environment files and the new settings in README, ENABLE_RRS in README.rrs, and removing the obsolete docker/README.

Patches 5-7 convert the README files to Markdown in three steps to keep the history readable: a pure rename, the updated references to the files, and a formatting-only change that leaves the wording alone.

Patches 8-10 correct the REST API note (the API is enabled and read-only, not disabled), fix a JSON example and a typo, use "docker compose" in the examples, and show the git configuration for sending patches to this list.

Tim Orling (10):
README.devel: document running the tests; update requirements
README: document upgrading to env files and the new settings README.rrs: mention ENABLE_RRS for the Docker-based setup docker/README: remove
Rename the README files to .md
Update references to the renamed README files Format the README files as Markdown
README.md: fix the REST API note, a JSON example and a typo README.md: use "docker compose"
README.md: show how to configure git for sending patches

 COPYING.MIT                 |   2 +-
 Dockerfile                  |   2 +-
 README.devel                | 159 --------------
 README.devel.md             | 228 ++++++++++++++++++++
 README => README.md         | 417 ++++++++++++++++++++----------------
 README.rrs => README.rrs.md |  48 +++--
 README.vscode               |  50 -----
 README.vscode.md            |  49 +++++
 SECURITY.md                 |   2 +-
 docker/README               |  52 -----
 10 files changed, 544 insertions(+), 465 deletions(-)
 delete mode 100644 README.devel
 create mode 100644 README.devel.md
 rename README => README.md (50%)
 rename README.rrs => README.rrs.md (53%)
 delete mode 100644 README.vscode
 create mode 100644 README.vscode.md
 delete mode 100644 docker/README

base-commit: e6040597ae0f614581de241fe78f20e34dae13ac
prerequisite-patch-id: 0cfb656e605b0ec4a84298986850c958648f94bf
prerequisite-patch-id: cf25fa25d9d94e47af321358b41c451717173512
prerequisite-patch-id: a3d6bb81b18633b51f922cc20a99b84ac423393b
prerequisite-patch-id: e1c00c40927a7db84488f2ce1b4ed40f3aa14aa0
prerequisite-patch-id: f957afb8dce214b3974e5c8c5924da1f7ba45ea4
prerequisite-patch-id: e67a8b6db7218cda1936f1b5d4eb9a9cad4c2dd0
prerequisite-patch-id: 6876328ca001cfedf7a4c9695dee294b40028ba6

Signature · 1 line
2.56.0
author
#1 lore raw

PATCH 1/10 README.devel: document running the tests; update requirements

Add a "Running the tests" section covering docker/run-tests.sh (the only way to run tests/test_update.py), running the other tests against a local database, tests/test_dockersetup.py, and what the CI and Safety workflows run.

The requirements still listed Python 3.6+ and Django 3.2; Django 5.2 needs Python 3.10 or later. The SMTP test server instructions used python3 -m smtpd, which was removed in Python 3.12; use Django's console email backend instead, which needs nothing extra.

AI-Generated: Claude Opus 5.5

---
 README.devel | 56 ++++++++++++++++++++++++++++++++++++++++------------
 1 file changed, 43 insertions(+), 13 deletions(-)
README.devel +43 -13
index de370e5..31460ef 100644
@@ -7,9 +7,9 @@ covered in the main README.
 
 In order to run this application standalone, you will need:
 
-* Python 3.6+
-* Django 3.2.x (not compatible with 3.0 or older)
-* RabbitMQ 3.8.x
+* Python 3.10+
+* Django 5.2 LTS, as pinned in requirements.txt
+* RabbitMQ
 * For production usage, a web server set up to host Django applications
   (not needed for local-only testing/development)
 * A database system supported by Django (SQLite, MariaDB/MySQL, etc.).
@@ -22,8 +22,8 @@ In order to run this application standalone, you will need:
   have to have Django installed, have the same or similar configuration
   in settings.py and have access to the database used by the web
   application):
-  * Python 3.5+ to match with the version of BitBake
-    for the OpenEmbedded branch being parsed
+  * A Python version supported both by Django and by the BitBake of
+    the OpenEmbedded branches being parsed
   * Python dependencies as per requirements.txt (we still need Django
     etc. here since we interact with the database through Django's ORM.)
 
@@ -128,17 +128,47 @@ SMTP test server
 ----------------
 
 If you want to test email functionality (e.g. for password reset, layer
-submission or other notifications) you can do so without dealing with actual
-emails being sent by running python's built-in SMTP test server (in a
-separate shell session):
+submission or other notifications) without sending real emails, set Django's
+console email backend in settings.py:
 
-python3 -m smtpd -n -c DebuggingServer localhost:1025
+EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
 
-This will stay running and print out any email that is sent to it. All you
-need to do then is edit settings.py and set it to point to the server:
+Every email is then printed to the console running the server (or the Celery
+worker, for emails sent from background tasks) instead of being sent.
 
-EMAIL_HOST = 'localhost'
-EMAIL_PORT = 1025
+
+Running the tests
+-----------------
+
+The tests use pytest and pytest-django, which are not in requirements.txt:
+
+    pip install pytest pytest-django
+
+To run the full suite as CI does, in the Docker image against a throwaway
+MariaDB container, run this from the top of the source tree:
+
+    docker/run-tests.sh
+
+This is the only way to run tests/test_update.py, which fetches
+openembedded-core, meta-layerindex-test and BitBake from the network and runs
+the update scripts (BitBake only runs on Linux).
+
+To run the other tests directly, set SECRET_KEY in settings.py and point it
+at a MariaDB/MySQL server where your database user may create databases
+(pytest-django creates and removes a test_<name> database), then run:
+
+    pytest --ignore=tests/test_update.py tests/
+
+tests/test_dockersetup.py tests the files dockersetup.py writes. It needs only
+pytest and PyYAML, and is skipped inside the Docker image:
+
+    python3 -m pytest tests/test_dockersetup.py
+
+On GitHub, .github/workflows/ci.yml runs docker/run-tests.sh and
+tests/test_dockersetup.py for pushes to master and master-next and for pull
+requests to master. .github/workflows/safety.yml scans the packages
+installed in the Docker image for known vulnerabilities on each push and
+weekly, if the repository has a SAFETY_API_KEY secret.
 
 
 
Signature · 1 line
2.56.0
author
#2 lore raw

PATCH 2/10 README: document upgrading to env files and the new settings

In reply to Tim Orling

dockersetup.py -u does not update the code itself, so say to update it first. Installations set up before the move to environment files keep their secrets in docker-compose.yml, which the update replaces; describe how to carry them over to .env.local.* files once.

List the optional DEBUG, ENABLE_RRS, DATABASE_PORT and STATIC_ROOT settings, and point the HSTS link at the current Django documentation rather than Django 1.11's.

AI-Generated: Claude Opus 5.5

---
 README | 36 +++++++++++++++++++++++++++++++++---
 1 file changed, 33 insertions(+), 3 deletions(-)
README +33 -3
index 3f733af..49ce4d3 100644
@@ -98,6 +98,14 @@ credentials, email server, DEBUG) from .env.<context>.<service> files, where
 
 The .env* files are excluded from the Docker images.
 
+Other settings the app and celery files can set:
+
+  - DEBUG: 1, true or yes enables Django's debug mode; anything else, or
+    leaving it unset, keeps it off. Never enable it on a public site.
+  - ENABLE_RRS: 1 enables the Recipe Reporting System (see README.rrs).
+  - DATABASE_PORT (default 3306) and STATIC_ROOT (default
+    /usr/share/nginx/html/static/).
+
 
 
 TROUBLESHOOTING:
@@ -209,11 +217,33 @@ Alternatively, you can update the data from an existing layer index instance
 Upgrading from an earlier version
 ---------------------------------
 
-To upgrade the Docker-based setup from a previous release, simply run:
+To upgrade the Docker-based setup from a previous release, update the code
+(e.g. with git pull) and then run:
 
 ./dockersetup.py -u
 
-This will update the code and run any required database migrations.
+This will rebuild the containers and run any required database migrations.
+
+Installations set up by dockersetup.py before it used environment files
+(see "Environment files" above) have their secret key and passwords in the
+environment sections of docker-compose.yml. Carry them over by hand once:
+
+1. Copy docker-compose.yml somewhere safe, then restore the tracked version
+   (git checkout docker-compose.yml) and update the code.
+
+2. For each of app, celery, db and rabbit, copy .env.dev.<service> to
+   .env.local.<service> and fill in the values from the matching service
+   in the old file: SECRET_KEY, DATABASE_USER, DATABASE_PASSWORD,
+   MYSQL_ROOT_PASSWORD, RABBITMQ_DEFAULT_USER, RABBITMQ_DEFAULT_PASS and any
+   EMAIL_* settings. Set DEBUG=0 in .env.local.app, and make the files
+   readable only by you (chmod 600 .env.local.*).
+
+3. In docker-compose.yml, change the env_file entries from .env.dev.* to
+   .env.local.*, and reapply your other changes from the old file (hostname,
+   ports, certificate volumes and, if you use Let's Encrypt, the
+   layerscertbot service).
+
+4. Run ./dockersetup.py -u as above.
 
 
 
@@ -371,7 +401,7 @@ REGISTRATION_OPEN = False
   also enable HSTS in your configuration. Refer to the Django Security
   guide for details on how to do that:
 
-  https://docs.djangoproject.com/en/1.11/topics/security/#ssl-https
+  https://docs.djangoproject.com/en/stable/topics/security/#ssl-https
 
 * To reset a forgotten account password, you can either use the password
   reset function ( /accounts/password_reset/ ) or alternatively from the
Signature · 1 line
2.56.0
author
#3 lore raw

PATCH 3/10 README.rrs: mention ENABLE_RRS for the Docker-based setup

In reply to Tim Orling

docker/settings.py adds 'rrs' to INSTALLED_APPS when ENABLE_RRS=1, so Docker users set that in the environment files rather than editing settings.py.

AI-Generated: Claude Opus 5.5

---
 README.rrs | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
README.rrs +3 -1
index 07bdea9..a311adf 100644
@@ -22,7 +22,9 @@ Setup procedure:
 
 2. Edit settings.py:
 
-   * Add 'rrs' to INSTALLED_APPS
+   * Add 'rrs' to INSTALLED_APPS. In the Docker-based setup, set
+     ENABLE_RRS=1 in the app and celery environment files instead (see
+     "Environment files" in README)
 
    * Configure TOOLS_LOG_DIR if you wish the logs to be written somewhere
      other than the current directory when the scripts are run
Signature · 1 line
2.56.0
author
#4 lore raw

PATCH 4/10 docker/README: remove

In reply to Tim Orling

It has not been updated since 2018 and is superseded by the "Docker Setup" section of the main README. It still describes a setup.py script, an internal Intel clone URL and branch, and an Intel proxy.

AI-Generated: Claude Opus 5.5

---
 docker/README | 52 ---------------------------------------------------
 1 file changed, 52 deletions(-)
 delete mode 100644 docker/README
docker/README deleted +0 -52
deleted file mode 100644
index 86348a1..0000000
@@ -1,52 +0,0 @@
-Layerindex Docker Setup Instructions
-
-The script setup.py will set up and configure a cluster of 5 docker containers:
-
-  - layersapp: the application
-  - layersdb: the database
-  - layersweb: NGINX web server (as a proxy and for serving static content)
-  - layerscelery: Celery (for running background jobs)
-  - layersrabbit: RabbitMQ (required by Celery)
-
-The script will edit all necessary configuration files, build and launch all containers, and do the initial database setup. It is advised that you start with a .sql database file to prepopulate your database. The following instructions will walk you through the setup.  
-
-1) Install docker and docker-compose per instructions: 
- 	https://docs.docker.com/compose/install/ 
-	** Note: for latest docker-compose version follow the directions above, rather than using apt. 
-
-2) Clone the repo and checkout appropriate branch:
- 	git clone https://github.intel.com/peggleto/layerindex-web.git
- 	git checkout origin/dev_snapshot
-
-2) Run the setup script (dockerstup.py). You can optionally supply your hostname, proxy settings, a sql database file of layer mappings to import, and a host to container port mapping. For more information, run: 
- 	./dockersetup.py -h 
-
-	Example command to run containers with a proxy and with a database to import:
- 	./dockersetup.py -d ~/databasedump.sql -p http://proxy-chain.intel.com:911 
-
- 	During the setup you will be asked for a username, email and password to set up a super user for the database. This will allow you to access the database later, should you need to. 
-
-3) Once the script completes, open a web browser and navigate to <hostname>:<mapped_port>/layerindex. If you haven't supplied hostname and/or port mapping, this will by default be localhost:8080. 
-
-4) If you have chosen to not supply a prepopulated database and are instead starting fresh, you should now
-follow the instructions in the "Database Setup" section of the main README.
-
-5) If you need to rerun this script for any reason a second time, make sure to tear the containers down first with docker-compose down. Otherwise, your new automatically generated root database password will not match.
-
-6) To update the layers in the future, you can optionally do the following: 
-
-	Run the layer updates
-	docker-compose run --rm layersapp /opt/layerindex/layerindex/update.py
-
-	Or do a full refresh
-	docker-compose run --rm layersapp /opt/layerindex/layerindex/update.py -r
-
-
-TROUBLESHOOTING:
-
-- Network issues behind a proxy when building container: On some Ubuntu systems, /etc/resolv.conf is set to 127.0.0.x, rather than your local DNS server. Docker will look there for your DNS server, and when it fails to find it it will default to using a public one (frequently 8.8.8.8). Many corporate proxies blocks public DNS servers, so you will need to manually supply the DNS server to docker using /etc/docker/daemon.json:
-	{"dns": ["xx.xx.xx.xx] }
-
-
-
-
Signature · 1 line
2.56.0
author
#5 lore raw

PATCH 5/10 Rename the README files to .md

In reply to Tim Orling

Rename README, README.devel, README.rrs and README.vscode to .md so they can be rendered as Markdown. Only the names change here; the following commits update the formatting and the references to them.

AI-Generated: Claude Opus 5.5

---
 README.devel => README.devel.md   | 0
 README => README.md               | 0
 README.rrs => README.rrs.md       | 0
 README.vscode => README.vscode.md | 0
 4 files changed, 0 insertions(+), 0 deletions(-)
 rename README.devel => README.devel.md (100%)
 rename README => README.md (100%)
 rename README.rrs => README.rrs.md (100%)
 rename README.vscode => README.vscode.md (100%)
README.devel.md renamed from README.devel +0 -0
similarity index 100%
rename from README.devel
rename to README.devel.md
README.md renamed from README +0 -0
similarity index 100%
rename from README
rename to README.md
README.rrs.md renamed from README.rrs +0 -0
similarity index 100%
rename from README.rrs
rename to README.rrs.md
README.vscode.md renamed from README.vscode +0 -0
similarity index 100%
rename from README.vscode
rename to README.vscode.md
Signature · 1 line
2.56.0
author
#6 lore raw

PATCH 6/10 Update references to the renamed README files

In reply to Tim Orling

AI-Generated: Claude Opus 5.5

---
 COPYING.MIT     | 2 +-
 Dockerfile      | 2 +-
 README.devel.md | 2 +-
 README.md       | 4 ++--
 README.rrs.md   | 4 ++--
 SECURITY.md     | 2 +-
 6 files changed, 8 insertions(+), 8 deletions(-)
COPYING.MIT +1 -1
index 3de397c..ea19713 100644
@@ -1,5 +1,5 @@
 Note: for details on which portions of this application are covered by this
-license, please see the README file. Other included components have LICENSE
+license, please see the README.md file. Other included components have LICENSE
 notices within (or in files adjacent to) the distributed files.
 
 Portions copyright (C) 2013-2019 Intel Corporation.
Dockerfile +1 -1
index 8e6e508..4ba040e 100644
@@ -1,4 +1,4 @@
-# See README for how to use this.
+# See README.md for how to use this.
 
 FROM ubuntu:jammy
 LABEL maintainer="Michael Halstead <[email protected]>"
README.devel.md +1 -1
index 31460ef..ae41c8c 100644
@@ -3,7 +3,7 @@ Standalone Setup
 
 NOTE: The standalone setup is most suitable for development and is not
 recommended for production; for production use the Docker-based setup
-covered in the main README.
+covered in the main README.md.
 
 In order to run this application standalone, you will need:
 
README.md +2 -2
index 49ce4d3..32572c5 100644
@@ -9,7 +9,7 @@ There are two main methods of setting up this application - within
 a set of Docker containers, or standalone. The Docker-based setup
 is more suited for production whereas standalone is a bit easier
 for development. This document will consider only the Docker-based
-setup; for standalone please see README.devel.
+setup; for standalone please see README.devel.md.
 
 
 Docker Setup
@@ -102,7 +102,7 @@ Other settings the app and celery files can set:
 
   - DEBUG: 1, true or yes enables Django's debug mode; anything else, or
     leaving it unset, keeps it off. Never enable it on a public site.
-  - ENABLE_RRS: 1 enables the Recipe Reporting System (see README.rrs).
+  - ENABLE_RRS: 1 enables the Recipe Reporting System (see README.rrs.md).
   - DATABASE_PORT (default 3306) and STATIC_ROOT (default
     /usr/share/nginx/html/static/).
 
README.rrs.md +2 -2
index a311adf..b6e3724 100644
@@ -15,7 +15,7 @@ This requirement may be removed in future.
 
 Setup procedure:
 
-1. Follow the layer index setup instructions in the README file first.
+1. Follow the layer index setup instructions in the README.md file first.
    The openembedded-core layer (or whatever replacement you have pointed
    CORE_LAYER_NAME to in settings.py) must be present in order to run the
    Recipe Reporting System database migrations.
@@ -24,7 +24,7 @@ Setup procedure:
 
    * Add 'rrs' to INSTALLED_APPS. In the Docker-based setup, set
      ENABLE_RRS=1 in the app and celery environment files instead (see
-     "Environment files" in README)
+     "Environment files" in README.md)
 
    * Configure TOOLS_LOG_DIR if you wish the logs to be written somewhere
      other than the current directory when the scripts are run
SECURITY.md +1 -1
index 20a28a9..7d2ce1f 100644
@@ -5,7 +5,7 @@ If you would like to report a public issue (for example, one with a released
 CVE number), please report it using the
 [https://bugzilla.yoctoproject.org/enter_bug.cgi?product=Security Security Bugzilla].
 If you have a patch ready, submit it following the same procedure as any other
-patch as described in README.
+patch as described in README.md.
 
 If you are dealing with a not-yet released or urgent issue, please send a
 message to security AT yoctoproject DOT org, including as many details as
Signature · 1 line
2.56.0
author
#7 lore raw

PATCH 7/10 Format the README files as Markdown

In reply to Tim Orling

Use Markdown headings, lists, code blocks and inline code, a table for the core layer values and links between the files. Placeholders such as <service> and <username> are now in code, where they would otherwise be dropped as HTML tags. The wording is unchanged.

AI-Generated: Claude Opus 5.5

---
 README.devel.md  | 155 +++++++++++-------
 README.md        | 401 +++++++++++++++++++++++++----------------------
 README.rrs.md    |  50 +++---
 README.vscode.md |  55 ++++---
 4 files changed, 362 insertions(+), 299 deletions(-)
README.devel.md +97 -58
index ae41c8c..f5b56ec 100644
@@ -1,33 +1,36 @@
-Standalone Setup
-----------------
+## Standalone Setup
 
-NOTE: The standalone setup is most suitable for development and is not
+**NOTE:** The standalone setup is most suitable for development and is not
 recommended for production; for production use the Docker-based setup
-covered in the main README.md.
+covered in the main [README.md](README.md).
 
 In order to run this application standalone, you will need:
 
-* Python 3.10+
-* Django 5.2 LTS, as pinned in requirements.txt
-* RabbitMQ
-* For production usage, a web server set up to host Django applications
+- Python 3.10+
+- Django 5.2 LTS, as pinned in `requirements.txt`
+- RabbitMQ
+- For production usage, a web server set up to host Django applications
   (not needed for local-only testing/development)
-* A database system supported by Django (SQLite, MariaDB/MySQL, etc.).
-* Third-party Django/python modules as detailed by requirements.txt.
+- A database system supported by Django (SQLite, MariaDB/MySQL, etc.).
+- Third-party Django/python modules as detailed by `requirements.txt`.
   If you're using pip, you can install these by running:
-    pip install -r requirements.txt
+
+  ```sh
+  pip install -r requirements.txt
+  ```
+
   (See below for a virtualenv-based setup which is easy to work with.)
-* On the machine that will run the backend update script (which does not
+- On the machine that will run the backend update script (which does not
   have to be the same machine as the web server, however it does still
   have to have Django installed, have the same or similar configuration
-  in settings.py and have access to the database used by the web
+  in `settings.py` and have access to the database used by the web
   application):
-  * A Python version supported both by Django and by the BitBake of
+  - A Python version supported both by Django and by the BitBake of
     the OpenEmbedded branches being parsed
-  * Python dependencies as per requirements.txt (we still need Django
+  - Python dependencies as per `requirements.txt` (we still need Django
     etc. here since we interact with the database through Django's ORM.)
 
-Example virtualenv-based setup for the above:
+### Example virtualenv-based setup for the above
 
 Python's virtualenv provides an easy way to isolate the python dependencies
 of applications such as the layer index. Here's an example of setting up a
@@ -39,27 +42,37 @@ distros).
    pip to build the dependencies; it's also assumed you want MariaDB as
    the database backend):
 
+   ```sh
    sudo apt-get update
    sudo apt-get install python3-venv libmariadb-dev build-essential python3-dev libjpeg-dev libz-dev libfreetype6-dev libssl-dev mariadb-server rabbitmq-server
+   ```
 
 2. Work around path issues (you may not need this):
 
+   ```sh
    sudo ln -s /usr/bin/mariadb_config /usr/bin/mysql_config
+   ```
 
 3. Create a Python 3 virtualenv (path can be anywhere you like):
 
+   ```sh
    python3 -m venv /path/to/desired/venv
+   ```
 
 4. Activate the virtualenv:
 
+   ```sh
    . /path/to/desired/venv/bin/activate
+   ```
 
 5. Install requirements:
 
+   ```sh
    pip install -r requirements.txt
+   ```
 
 
-Setting up MariaDB/MySQL:
+### Setting up MariaDB/MySQL
 
 Assuming you wish to use MariaDB/MySQL for storing the database - the
 following is completely standard, but to save you having to look it up
@@ -67,38 +80,51 @@ elsewhere:
 
 1. Start the server:
 
+   ```sh
    sudo /etc/init.d/mysql start
+   ```
 
 2. Set the root password and secure the database server:
 
+   ```sh
    sudo mysql_secure_installation
+   ```
 
 3. Create a database (substituting "mydatabase" with desired database
    name):
 
+   ```sh
    mysql -u root -p
+   ```
+
+   ```sql
    CREATE DATABASE mydatabase CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
+   ```
 
 
-Configuration and running:
+### Configuration and running
 
-1. Edit settings.py to specify a database, EMAIL_HOST, SECRET_KEY and
+1. Edit `settings.py` to specify a database, `EMAIL_HOST`, `SECRET_KEY` and
    other settings specific to your installation. Ensure you set
-   LAYER_FETCH_DIR to an absolute path to a location with sufficient
-   space for fetching layer repositories. Modify RABBIT_BROKER
-   and RABBIT_BACKEND to reflect the settings used by your RabbitMQ
+   `LAYER_FETCH_DIR` to an absolute path to a location with sufficient
+   space for fetching layer repositories. Modify `RABBIT_BROKER`
+   and `RABBIT_BACKEND` to reflect the settings used by your RabbitMQ
    server.
 
 2. Run the following commands within the layerindex-web directory to
    initialise the database:
 
+   ```sh
    ./manage.py migrate
    ./manage.py createsuperuser
+   ```
 
-3. You can test the web application locally by setting DEBUG = True in
-   settings.py and running the following:
+3. You can test the web application locally by setting `DEBUG = True` in
+   `settings.py` and running the following:
 
+   ```sh
    ./manage.py runserver
+   ```
 
    Then visit http://127.0.0.1:8000/layerindex/ with your browser. As
    with all Django applications there is an admin interface available
@@ -106,84 +132,97 @@ Configuration and running:
    will be those you entered in the step above when creating an admin
    account.
 
-   NOTE: This local server should only be used for testing - for
-   production you need to use a proper web server and have DEBUG set
-   to False (or use the Docker-based setup).
+   **NOTE:** This local server should only be used for testing - for
+   production you need to use a proper web server and have `DEBUG` set
+   to `False` (or use the Docker-based setup).
 
-   3.1. In order to process asynchronous tasks like sending email,
-        you will need to run a Celery worker:
+   1. In order to process asynchronous tasks like sending email,
+      you will need to run a Celery worker:
 
-        celery -A layerindex.tasks worker --loglevel=info
+      ```sh
+      celery -A layerindex.tasks worker --loglevel=info
+      ```
 
 4. To import layer data from the public instance at layers.openembedded.org
    you can run the following (defaults to the master branch only):
 
+   ```sh
    layerindex/tools/import_layers.py -d https://layers.openembedded.org
+   ```
 
    Alternatively you can add layers individually using the separate
-   layerindex/tools/import_layer.py script or through the admin interface.
+   `layerindex/tools/import_layer.py` script or through the admin interface.
 
 
-SMTP test server
-----------------
+## SMTP test server
 
 If you want to test email functionality (e.g. for password reset, layer
 submission or other notifications) without sending real emails, set Django's
-console email backend in settings.py:
+console email backend in `settings.py`:
 
+```python
 EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
+```
 
 Every email is then printed to the console running the server (or the Celery
 worker, for emails sent from background tasks) instead of being sent.
 
 
-Running the tests
------------------
+## Running the tests
 
-The tests use pytest and pytest-django, which are not in requirements.txt:
+The tests use pytest and pytest-django, which are not in `requirements.txt`:
 
-    pip install pytest pytest-django
+```sh
+pip install pytest pytest-django
+```
 
 To run the full suite as CI does, in the Docker image against a throwaway
 MariaDB container, run this from the top of the source tree:
 
-    docker/run-tests.sh
+```sh
+docker/run-tests.sh
+```
 
-This is the only way to run tests/test_update.py, which fetches
+This is the only way to run `tests/test_update.py`, which fetches
 openembedded-core, meta-layerindex-test and BitBake from the network and runs
 the update scripts (BitBake only runs on Linux).
 
-To run the other tests directly, set SECRET_KEY in settings.py and point it
+To run the other tests directly, set `SECRET_KEY` in `settings.py` and point it
 at a MariaDB/MySQL server where your database user may create databases
-(pytest-django creates and removes a test_<name> database), then run:
+(pytest-django creates and removes a `test_<name>` database), then run:
 
-    pytest --ignore=tests/test_update.py tests/
+```sh
+pytest --ignore=tests/test_update.py tests/
+```
 
-tests/test_dockersetup.py tests the files dockersetup.py writes. It needs only
+`tests/test_dockersetup.py` tests the files `dockersetup.py` writes. It needs only
 pytest and PyYAML, and is skipped inside the Docker image:
 
-    python3 -m pytest tests/test_dockersetup.py
+```sh
+python3 -m pytest tests/test_dockersetup.py
+```
 
-On GitHub, .github/workflows/ci.yml runs docker/run-tests.sh and
-tests/test_dockersetup.py for pushes to master and master-next and for pull
-requests to master. .github/workflows/safety.yml scans the packages
+On GitHub, `.github/workflows/ci.yml` runs `docker/run-tests.sh` and
+`tests/test_dockersetup.py` for pushes to master and master-next and for pull
+requests to master. `.github/workflows/safety.yml` scans the packages
 installed in the Docker image for known vulnerabilities on each push and
-weekly, if the repository has a SAFETY_API_KEY secret.
+weekly, if the repository has a `SAFETY_API_KEY` secret.
 
 
-
-Updating OpenEmbedded data
---------------------------
+## Updating OpenEmbedded data
 
 You will likely want to update the OpenEmbedded layer information on a regular
 basis. To do that:
 
-   Incremental update:
-
-       layerindex/update.py
+Incremental update:
 
-   Reload all data (should only be needed if the database structure has
-   changed as part of an upgrade of the application code):
+```sh
+layerindex/update.py
+```
 
-       layerindex/update.py -r
+Reload all data (should only be needed if the database structure has
+changed as part of an upgrade of the application code):
 
+```sh
+layerindex/update.py -r
+```
README.md +212 -189

671 lines not on this page · raw message

README.rrs.md +26 -24

88 lines not on this page · raw message

README.vscode.md +27 -28

78 lines not on this page · raw message

Signature · 1 line
2.56.0
author
#8 lore raw

PATCH 8/10 README.md: fix the REST API note, a JSON example and a typo

In reply to Tim Orling

The security notes said the REST API had been disabled because it has no access controls. It is enabled: it is read-only, needs no login and serves the published layer data, including maintainer email addresses, to tools such as bitbake-layers layerindex-fetch and Toaster. Say so.

Also add the missing quote in the /etc/docker/daemon.json example and drop a doubled "the".

AI-Generated: Claude Opus 5.5

---
 README.md | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
README.md +6 -6
index d33bb5d..e53ddfa 100644
@@ -121,7 +121,7 @@ Other settings the app and celery files can set:
   `/etc/docker/daemon.json`:
 
   ```json
-  {"dns": ["xx.xx.xx.xx] }
+  {"dns": ["xx.xx.xx.xx"]}
   ```
 
 
@@ -473,12 +473,12 @@ Some things to be aware of from a security perspective:
 
   - By account for too many incorrect password reset attempts. To remove
     this lockout, log into the admin interface, go to Users, click on the
-    the user, tick the Active checkbox and then save.
+    user, tick the Active checkbox and then save.
 
-- The REST API inherited from the OpenEmbedded layerindex upon which this
-  application is based has been disabled, since it has no access controls
-  on querying data (since the OE layer index operates entirely on publicly
-  accessible information, whereas this application may not in actual usage).
+- The REST API at `/layerindex/api/` is read-only and needs no login. It
+  serves the same information as the public web pages for published layers,
+  including the names and email addresses of layer maintainers, and is used
+  by tools such as `bitbake-layers layerindex-fetch` and Toaster.
 
 
 ## Backup and restore
Signature · 1 line
2.56.0
author
#9 lore raw

PATCH 9/10 README.md: use "docker compose"

In reply to Tim Orling

Ask for Docker with the Compose plugin rather than docker-compose, and use "docker compose" in the example commands. Current Docker installs provide only the plugin; dockersetup.py now uses it, falling back to the standalone docker-compose.

AI-Generated: Claude Opus 5.5

---
 README.md | 23 ++++++++++++-----------
 1 file changed, 12 insertions(+), 11 deletions(-)
README.md +12 -11
index e53ddfa..a34457f 100644
@@ -29,12 +29,13 @@ containers, and do the initial database setup. It is advised that you start
 with a .sql database file to prepopulate your database. The following
 instructions will walk you through the setup.
 
-1. Install docker and docker-compose per instructions:
+1. Install Docker Engine (or Docker Desktop) with the Compose plugin, which
+   provides the `docker compose` command, per instructions:
 
    https://docs.docker.com/compose/install/
 
-   **Note:** for latest docker-compose version follow the directions above,
-   rather than using a perhaps outdated one provided by your distribution.
+   `dockersetup.py` uses `docker compose`, or the older standalone
+   `docker-compose` if the plugin is not installed.
 
 2. Run the setup script (`dockersetup.py`). You can optionally supply your
    hostname, proxy settings, a sql database file of layer mappings to import,
@@ -135,7 +136,7 @@ setup within it:
    public instance at layers.openembedded.org you can run the following:
 
    ```sh
-   docker-compose run --rm layersapp /opt/layerindex/layerindex/tools/import_layers.py https://layers.openembedded.org
+   docker compose run --rm layersapp /opt/layerindex/layerindex/tools/import_layers.py https://layers.openembedded.org
    ```
 
    Alternatively, you can populate the database manually -
@@ -205,21 +206,21 @@ following:
 Incremental update:
 
 ```sh
-docker-compose run --rm layersapp /opt/layerindex/layerindex/update.py
+docker compose run --rm layersapp /opt/layerindex/layerindex/update.py
 ```
 
 Reload all data (should only be needed if the database structure has
 changed as part of an upgrade of the application code):
 
 ```sh
-docker-compose run --rm layersapp /opt/layerindex/layerindex/update.py -r
+docker compose run --rm layersapp /opt/layerindex/layerindex/update.py -r
 ```
 
 Alternatively, you can update the data from an existing layer index instance
 (as per above during setup):
 
 ```sh
-docker-compose run --rm layersapp /opt/layerindex/layerindex/tools/import_layers.py https://layers.openembedded.org
+docker compose run --rm layersapp /opt/layerindex/layerindex/tools/import_layers.py https://layers.openembedded.org
 ```
 
 
@@ -430,7 +431,7 @@ Some things to be aware of from a security perspective:
   backend you can run the following command:
 
   ```sh
-  docker-compose exec layersapp /opt/layerindex/manage.py changepassword <username>
+  docker compose exec layersapp /opt/layerindex/manage.py changepassword <username>
   ```
 
 - The web-based password reset function will ask the user answers to
@@ -463,7 +464,7 @@ Some things to be aware of from a security perspective:
     immediately using the following command:
 
     ```sh
-    docker-compose exec layersapp /opt/layerindex/manage.py axes_reset
+    docker compose exec layersapp /opt/layerindex/manage.py axes_reset
     ```
 
     If you wish to disable this, remove or comment out "axes" in
@@ -488,14 +489,14 @@ following command (no need to substitute `${MYSQL_ROOT_PASSWORD}`, it's
 already present within the container environment):
 
 ```sh
-docker-compose exec layersdb /bin/sh -c '/usr/bin/mariadb-dump -u root --password=${MYSQL_ROOT_PASSWORD} --max_allowed_packet=512M layersdb' | gzip > backup-`date +%Y_%m_%d_%H%M`.sql.gz
+docker compose exec layersdb /bin/sh -c '/usr/bin/mariadb-dump -u root --password=${MYSQL_ROOT_PASSWORD} --max_allowed_packet=512M layersdb' | gzip > backup-`date +%Y_%m_%d_%H%M`.sql.gz
 ```
 
 To restore one of these backups you would run the following command (take
 care, this will overwrite the data immediately without prompting!):
 
 ```sh
-zcat backupfile.sql.gz | docker-compose exec -T layersdb /bin/sh -c '/usr/bin/mariadb -u root --password=${MYSQL_ROOT_PASSWORD} layersdb'
+zcat backupfile.sql.gz | docker compose exec -T layersdb /bin/sh -c '/usr/bin/mariadb -u root --password=${MYSQL_ROOT_PASSWORD} layersdb'
 ```
 
 
Signature · 1 line
2.56.0
author
#10 lore raw

PATCH 10/10 README.md: show how to configure git for sending patches

In reply to Tim Orling

Contributions go to the yocto-patches mailing list with '[layerindex-web]' in the subject. Show the git config settings that make git format-patch and git send-email do that, as the error-report-web README does, and drop "pull requests", which the list does not take.

AI-Generated: Claude Opus 5.5

---
 README.md | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
README.md +7 -2
index a34457f..a1f6087 100644
@@ -508,9 +508,14 @@ The latest version of the code can always be found here:
 
 https://git.yoctoproject.org/layerindex-web/
 
-Contributions are welcome. Please send patches / pull requests to
+Contributions are welcome. Please send patches with git send-email to
 [email protected] with '[layerindex-web]' in the
-subject.
+subject. To set this up in your clone:
+
+```sh
+git config format.subjectPrefix "layerindex-web][PATCH"
+git config sendemail.to [email protected]
+```
 
 
 ## License
Signature · 1 line
2.56.0