Commit graph

3374 commits

Author SHA1 Message Date
Kevin Morris
3efb9a57b5
change(popupdate): converted to use aurweb.db ORM
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-11-28 19:55:07 -08:00
Kevin Morris
3a65e33abe
fix(gitlab-ci): prepare conf/config for setup
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-11-28 19:35:32 -08:00
Kevin Morris
dbeebd3b01
change(fastapi): setup live database in mariadb-init-entrypoint.sh
Centralize database setup there and remove all copying of
config.dev from the entrypoint scripts (the Dockerfile
now does it).

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-11-27 23:29:49 -08:00
Kevin Morris
343a306bb8
change(docker): setup AUR_CONFIG in Dockerfile
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-11-27 23:29:44 -08:00
Kevin Morris
84beacd427
fix(docker): supply AUR_CONFIG_IMMUTABLE for docker-compose
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-11-27 22:49:52 -08:00
Kevin Morris
5b350bc361
change(docker): use aurweb-config to update AUR_CONFIG
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-11-27 22:49:48 -08:00
Kevin Morris
0726a08677
fix(docker): remove sqlite scripts
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-11-27 22:46:11 -08:00
Kevin Morris
f3efc18b50
feat(docker): force test db configuration
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-11-27 22:42:12 -08:00
Kevin Morris
0e938209af
feat(aurweb-config): add unset action and simplify
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-11-27 22:34:15 -08:00
Kevin Morris
199622c53f
fix(fastapi): refresh records when fetching updated packages
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-11-27 21:35:48 -08:00
Kevin Morris
232594ae44
Merge branch 'fix-sid-generation' into pu 2021-11-27 21:32:21 -08:00
Kevin Morris
7b0d664bc0
fix(docker): reorg ./data mounts
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-11-27 21:03:24 -08:00
Kevin Morris
47feb72f48
fix(fastapi): fix SessionID (and ResetKey) generation
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-11-27 20:19:40 -08:00
Kevin Morris
d658627e99
fix(fastapi): don't redirect to login on authed /login
Closes #184

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-11-27 19:14:32 -08:00
Kevin Morris
a87973e0c7
Merge branch 'pu-config' into pu 2021-11-27 16:54:19 -08:00
Kevin Morris
759f18ea75
feat: add aurweb-config console script
This can be used to update config values for the entirety
of a config. When config values are set through this tool,
$AUR_CONFIG is overridden with a copy of the config file
with all sections and options found in $AUR_CONFIG
+ $AUR_CONFIG_DEFAULTS.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-11-27 16:44:56 -08:00
Kevin Morris
b98159d5b9
change(docker): use step-ca for CA + cert generation
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-11-27 16:43:29 -08:00
Kevin Morris
e558e979ff
fix(fastapi): check ssh key prefixes against configured valid-keytypes
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-11-24 21:29:28 -08:00
Kevin Morris
1aab960401
fix: use corrent u2f ssh key prefixes
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-11-24 21:29:15 -08:00
Kevin Morris
6bb002e708
fix: use correct u2f ssh key prefixes
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-11-24 21:23:01 -08:00
Kevin Morris
47d83244bb
change(gitlab-ci): add 'fast-single-thread' tag to the test stage
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-11-22 22:26:56 -08:00
Kevin Morris
3b686c475d
fix: default detailed loglevel to DEBUG
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-11-22 10:22:58 -08:00
Kevin Morris
39fd3b891e
change: set -v for sh tests
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-11-22 10:22:32 -08:00
Kevin Morris
e891d7c8e8
change(docker): allow run-pytests to collect coverage
Additionally fix up the argument parsing to be a bit less
flexible.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-11-22 10:22:01 -08:00
Kevin Morris
34747359ba
fix(docker): expose git service's 2222 through 0.0.0.0
Other ports we use are locked to 127.0.0.1. The `git` service,
however, already promotes security in its sshd service and
can't really be abused from an external source. This simplifies
the need to forward to localhost if deploy targets want the sshd
to be available.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-11-21 23:11:02 -08:00
Kevin Morris
41e0eaaece
fix(docker): force bind ports to localhost only
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-11-21 21:43:59 -08:00
Kevin Morris
ffb450db71
Merge branch 'logging-fix' into pu 2021-11-21 00:56:29 -08:00
Kevin Morris
bc7bf9866a
docker: bind ./aurweb in cron service by default
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-11-21 00:55:27 -08:00
Kevin Morris
e8f4c9cf69
fix(fastapi): remove aurweb logger definition
Both the root and aurweb loggers are included in output,
causing repeated log messages. Now, just rely on the
root logger for aurweb logging.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-11-21 00:54:23 -08:00
Kevin Morris
d4d9f50b8f
change(docker): use ./data instead of ./cache
For the `git` service, ./data is always used to provide an
optional overriding of ssh host keys. In aur-dev production
containers, most services which use the data mount use an
internal Docker `data` volume instead.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-11-20 20:05:32 -08:00
Kevin Morris
604901fe74
fix(docker): fix nginx .gz match against cgit snapshots
This only deals with .gz files in the root of the request_uri
and now more. That is: /packages.gz goes through the nginx regex,
but now /cgit/.../snapshot/package.tar.gz is served by the cgit
block.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-11-20 20:00:53 -08:00
Kevin Morris
c7feecd4b8
housekeep(docker): remove configuration regexes in the nginx service
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-11-20 19:34:33 -08:00
Kevin Morris
a1e547c057
feat(docker): allow configurable SSH_CMDLINE in git service
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-11-20 19:04:38 -08:00
Kevin Morris
ba3ef742ce
feat(docker): allow user-customizable ssh host keys
There is a new ./data bind mount used here. If ssh_host_* keys are
in ./data when the git service starts, they'll override the
container-generated host keys.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-11-20 18:40:32 -08:00
Kevin Morris
233d25b1c3
feat: add test_spawn, an aurweb.spawn test
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-11-20 15:47:25 -08:00
Kevin Morris
19191fa8b5
fix: update nginx config in aurweb.spawn
Host a specific FastAPI nginx frontend as well as a PHP
nginx frontend, configurable by the (PHP|FASTAPI)_NGINX_PORT
environment variables.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-11-20 15:47:25 -08:00
Kevin Morris
47d0df76e6
feat: support gunicorn in aurweb.spawn
This also comes with a -w|--workers argument that allows
the caller to set the number of gunicorn workers.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-11-20 15:47:24 -08:00
Kevin Morris
82ca4ad9a0
feat: check php configuration in aurweb.spawn
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-11-20 15:47:24 -08:00
Kevin Morris
191198ca41
housekeep(fastapi): simplify aurweb.spawn.stop()
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-11-20 15:47:24 -08:00
Kevin Morris
0b5d088016
fix(fastapi): catch ProgrammingError instead of OperationalError in conftest
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-11-20 13:20:47 -08:00
Kevin Morris
008a8824ce
housekeep(fastapi): simplify package_base_comaintainers_post
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-11-20 13:20:46 -08:00
Kevin Morris
f897411ddf
change(fastapi): let conftest bypass create database errors
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-11-18 21:27:09 -08:00
Kevin Morris
7f981b9ed7
fix(fastapi): utilize auto_{orphan,deletion}_age
Didn't get this in when the initial request port went down;
here it is.

Auto-accept orphan requests when the package has been out of
date for longer than auto_orphan_age.

Auto-accept deletion requests by the package's maintainer
if the package has been uploaded within auto_deletion_age
seconds ago.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-11-18 21:27:03 -08:00
Kevin Morris
a348cdaac3
housekeep(fastapi): cleanup unneeded jinja set statement
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-11-18 16:44:13 -08:00
Kevin Morris
7739b2178e
fix(fastapi): fix comment edit image sources
These were using the old comment image sources. Slipped in
due to cache and not checking without cache.

Fixed them to use src="/static/images/...".

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-11-18 16:43:10 -08:00
Kevin Morris
dbe5cb4a33
fix(fastapi): only include comment-edit.js where needed
Closes: #178

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-11-18 16:42:26 -08:00
Kevin Morris
672af707ad
remove C901 and E741 per-file-ignores exclusion
We no longer have C901 violations and we're already ignoring
E741 (short variable names) in the overall `ignore` option.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-11-17 06:00:12 -08:00
Kevin Morris
2df7187514
fix global test_ssh_pub_key E501 flake8 violation
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-11-17 06:00:12 -08:00
Kevin Morris
2892d21ff1
remove global aurweb.models flake8 F401 ignore
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-11-17 06:00:12 -08:00
Kevin Morris
303585cdbf
change(fastapi): decouple update logic from account edit
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-11-17 06:00:07 -08:00