From fca175ed84a37397e95ba8a44f03e71e4166e755 Mon Sep 17 00:00:00 2001 From: Kevin Morris Date: Tue, 18 Jan 2022 01:55:41 -0800 Subject: [PATCH] update more documentation Signed-off-by: Kevin Morris --- INSTALL | 4 +--- TESTING | 58 ++++++++++++++++++++++++++++++++++++--------- doc/maintenance.txt | 14 +++++------ 3 files changed, 55 insertions(+), 21 deletions(-) diff --git a/INSTALL b/INSTALL index 763da3b7..4b904e25 100644 --- a/INSTALL +++ b/INSTALL @@ -4,9 +4,7 @@ Setup on Arch Linux For testing aurweb patches before submission, you can use the instructions in TESTING for testing the web interface only. -Note that you can only do limited testing using the PHP built-in web server. -In particular, the cgit interface will be unusable as well as the ssh+git -interface. For a detailed description on how to setup a full aurweb server, +For a detailed description on how to setup a full aurweb server, read the instructions below. 1) Clone the aurweb project and install it (via `python-poetry`): diff --git a/TESTING b/TESTING index 972bce2c..75271596 100644 --- a/TESTING +++ b/TESTING @@ -5,19 +5,47 @@ Note that this setup is only to test the web interface. If you need to have a full aurweb instance with cgit, ssh interface, etc, follow the directions in INSTALL. +docker-compose +-------------- + 1) Clone the aurweb project: $ git clone git://git.archlinux.org/aurweb.git 2) Install the necessary packages: - # pacman -S --needed php php-sqlite sqlite words fortune-mod \ - python python-sqlalchemy python-alembic \ - python-fastapi uvicorn nginx \ - python-authlib python-itsdangerous python-httpx \ - words fortune-mod + # pacman -S docker-compose - Ensure to enable the pdo_sqlite extension in php.ini. +2) Build the aurweb:latest image: + + $ cd /path/to/aurweb/ + $ docker-compose build + +3) Run local Docker development instance: + + $ cd /path/to/aurweb/ + $ docker-compose up -d nginx + +4) Browse to local aurweb development server. + + Python: https://localhost:8444/ + PHP: https://localhost:8443/ + +Bare Metal +---------- + +1) Clone the aurweb project: + + $ git clone git://git.archlinux.org/aurweb.git + +2) Install the necessary packages: + + # pacman -S python-poetry + +4) Install the package/dependencies via `poetry`: + + $ cd /path/to/aurweb/ + $ poetry install 3) Copy conf/config.dev to conf/config and replace YOUR_AUR_ROOT by the absolute path to the root of your aurweb clone. sed can do both tasks for you: @@ -27,15 +55,23 @@ INSTALL. Note that when the upstream config.dev is updated, you should compare it to your conf/config, or regenerate your configuration with the command above. -4) Prepare the testing database: +4) Prepare a database: $ cd /path/to/aurweb/ - $ AUR_CONFIG=conf/config python -m aurweb.initdb + $ AUR_CONFIG=conf/config poetry run python -m aurweb.initdb - $ schema/gendummydata.py data.sql - $ sqlite3 aurweb.sqlite3 < data.sql + $ poetry run schema/gendummydata.py dummy_data.sql + $ mysql -uaur -paur aurweb < dummy_data.sql 5) Run the test server: - $ AUR_CONFIG=conf/config python -m aurweb.spawn + ## set AUR_CONFIG to our locally created config + $ export AUR_CONFIG=conf/config + + ## with aurweb.spawn + $ poetry run python -m aurweb.spawn + + ## with systemd service + $ sudo install -m644 examples/aurweb.service /etc/systemd/system/ + $ systemctl enable --now aurweb.service diff --git a/doc/maintenance.txt b/doc/maintenance.txt index 2c5c9faf..fbde1fff 100644 --- a/doc/maintenance.txt +++ b/doc/maintenance.txt @@ -76,16 +76,16 @@ computations and clean up the database: * aurweb-usermaint removes the last login IP address of all users that did not login within the past seven days. -These scripts can be installed by running `python3 setup.py install` and are +These scripts can be installed by running `poetry install` and are usually scheduled using Cron. The current setup is: ---- -*/5 * * * * aurweb-mkpkglists [--extended] -1 */2 * * * aurweb-popupdate -2 */2 * * * aurweb-aurblup -3 */2 * * * aurweb-pkgmaint -4 */2 * * * aurweb-usermaint -5 */12 * * * aurweb-tuvotereminder +*/5 * * * * poetry run aurweb-mkpkglists [--extended] +1 */2 * * * poetry run aurweb-popupdate +2 */2 * * * poetry run aurweb-aurblup +3 */2 * * * poetry run aurweb-pkgmaint +4 */2 * * * poetry run aurweb-usermaint +5 */12 * * * poetry run aurweb-tuvotereminder ---- Advanced Administrative Features