update more documentation

Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
Kevin Morris 2022-01-18 01:55:41 -08:00
parent 3102736b13
commit fca175ed84
No known key found for this signature in database
GPG key ID: F7E46DED420788F3
3 changed files with 55 additions and 21 deletions

58
TESTING
View file

@ -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