diff mbox series

[layerindex-web,4/4] README: Document --app-dir option usage

Message ID 20260402195112.1369295-5-sandeep.gundlupet-raju@amd.com
State New
Headers show
Series Add app dir support | expand

Commit Message

Sandeep Gundlupet Raju April 2, 2026, 7:51 p.m. UTC
Update README to reflect the new --app-dir support added to
dockersetup.py:

- Step 2: Add a note explaining that the default installation base
  directory inside the containers is /opt (requiring the repo to be
  cloned at /opt/layerindex), and document the --app-dir option for
  using a custom  directory (e.g. when the repo is cloned to a
  non-default path)
- Database Setup: add note to replace /opt with --app-dir value if used
- Updating OE data: add same note
- Security section: add reminder to substitute --app-dir value in the
  changepassword and axes_reset commands

  AI-Generated: GitHub Copilot (Claude Sonnet 4.6)

Signed-off-by: Sandeep Gundlupet Raju <sandeep.gundlupet-raju@amd.com>
---
 README | 39 +++++++++++++++++++++++++++++++--------
 1 file changed, 31 insertions(+), 8 deletions(-)
diff mbox series

Patch

diff --git a/README b/README
index 1335b7a..e40ff25 100644
--- a/README
+++ b/README
@@ -49,6 +49,19 @@  instructions will walk you through the setup.
 
         ./dockersetup.py -d ~/databasedump.sql -p http://<proxyserver>:<port>
 
+   NOTE: By default, the application is installed inside the containers under
+   /opt (e.g. /opt/layerindex, /opt/migrate.sh). This means you should clone
+   this repository into /opt/layerindex on the host before running the script,
+   or alternatively use the --app-dir option to specify a different base
+   directory inside the container:
+
+        ./dockersetup.py --app-dir /path/to/appdir
+
+   For example, if you have cloned the repository to
+   /scratch2/myuser/layerindex-web, you would run:
+
+        ./dockersetup.py --app-dir /scratch2/myuser/layerindex-web
+
    NOTE: If you want email sending to work (required for user registration and
    password resets), you should use the -e/--email-host option to specify your
    outgoing email server.
@@ -99,11 +112,14 @@  Database Setup
 Once the application is running you'll need to do a bit of further
 setup within it:
 
+NOTE: The following commands use /opt as the default base directory. If you
+ran dockersetup.py with --app-dir, replace /opt with the value you specified.
+
 1. For a fresh database (without importing any database dump) you will
    need layer data. To import the full set for the master branch from the
    public instance at layers.openembedded.org you can run the following:
 
-   docker-compose run --rm layersapp /opt/layerindex/layerindex/tools/import_layers.py https://layers.openembedded.org
+   docker-compose -f docker-compose.yml run --rm layersapp /opt/layerindex/layerindex/tools/import_layers.py https://layers.openembedded.org
 
    Alternatively, you can populate the database manually -
    you'll need to add at least the openembedded-core layer to the
@@ -169,19 +185,22 @@  You will likely want to update the OpenEmbedded layer information on a regular
 basis. To do that by fetching and parsing all layer repositories, run the
 following:
 
+NOTE: The following commands use /opt as the default base directory. If you
+ran dockersetup.py with --app-dir, replace /opt with the value you specified.
+
    Incremental update:
 
-       docker-compose run --rm layersapp /opt/layerindex/layerindex/update.py
+       docker-compose -f docker-compose.yml 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):
 
-       docker-compose run --rm layersapp /opt/layerindex/layerindex/update.py -r
+       docker-compose -f docker-compose.yml 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):
 
-    docker-compose run --rm layersapp /opt/layerindex/layerindex/tools/import_layers.py https://layers.openembedded.org
+    docker-compose -f docker-compose.yml run --rm layersapp /opt/layerindex/layerindex/tools/import_layers.py https://layers.openembedded.org
 
 
 
@@ -356,7 +375,9 @@  REGISTRATION_OPEN = False
   reset function ( /accounts/password_reset/ ) or alternatively from the
   backend you can run the following command:
 
-  docker-compose exec layersapp /opt/layerindex/manage.py changepassword <username>
+  docker-compose -f docker-compose.yml exec layersapp /opt/layerindex/manage.py changepassword <username>
+
+  (Replace /opt with your --app-dir value if you used a custom directory.)
 
 * The web-based password reset function will ask the user answers to
   security questions they selected and answered when they created the
@@ -387,7 +408,9 @@  REGISTRATION_OPEN = False
     (default 4, resets after an hour). The lockout can be removed
     immediately using the following command:
 
-    docker-compose exec layersapp /opt/layerindex/manage.py axes_reset
+    docker-compose -f docker-compose.yml exec layersapp /opt/layerindex/manage.py axes_reset
+
+    (Replace /opt with your --app-dir value if you used a custom directory.)
 
     If you wish to disable this, remove or comment out "axes" in
     INSTALLED_APPS. For more information on configuring axes, see:
@@ -412,12 +435,12 @@  To back up the database within the docker-based setup, you can run the
 following command (no need to substitute ${MYSQL_ROOT_PASSWORD}, it's
 already present within the container environment):
 
-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 -f docker-compose.yml 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!):
 
-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 -f docker-compose.yml exec -T layersdb /bin/sh -c '/usr/bin/mariadb -u root --password=${MYSQL_ROOT_PASSWORD} layersdb'