Commit graph

18 commits

Author SHA1 Message Date
Joakim Saario
9c6c13b78a
style: Run pre-commit 2022-08-22 22:40:45 +02:00
Kevin Morris
12f74fc40a
fix: docker cron config timing and doc
This wasn't matching up with what's suggested in doc/maintenance.
This patch resolves that inconsistency.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-01-18 09:05:47 -08:00
Kevin Morris
34a29df1a8
fix(docker): remove fastapi rewrite rule
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-01-15 20:19:58 -08:00
Kevin Morris
0f4ead759c
fix(docker): correct proxy configuration
- On non-localhost communication, this whitelists forwarded headers
  on all remote ips
- Add more headers
- Force https X-Forwarded-Proto
- Unset Forwarded header and rely on X-Forwarded-*

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-01-15 20:11:51 -08:00
Kevin Morris
88cb1096c0
feat(docker): add more cron scripts
Added the rest:
- aurweb-pkgmaint
- aurweb-usermaint
- aurweb-tuvotereminder
- aurweb-popupdate

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-01-14 01:02:00 -08:00
Kevin Morris
1ee8d177b4
fix(docker): rewrite trailing slashes to non-trailing in nginx config
Without this rewriting, we've been running into conversing with
HTTP over HTTPS (400 Bad Request).

TODO: Refactor this entire nginx config to something a bit more
simple and clean.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-01-10 14:49:53 -08:00
Kevin Morris
9f9b1c1732
change(docker): host fastapi over plain http
We don't need the https certificates being dealt with in the fastapi
service; we will define our certificates in any frontend nginx
running on top.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-01-10 00:12:01 -08:00
Kevin Morris
e75aa386ea
Merge branch 'pu-cron-fix' into pu
- Removed user specification from cron config.
- Removed logging to /var/log; this commit brings in `-x proc`,
  which logs out to std(out|err).
2021-12-22 14:41:03 -08:00
Hunter Wittenborn
48973fe036
Fixed incorrect syntax usage and missing environment variables in cron jobs 2021-12-14 16:56:29 -06: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
4f7aeafa8d
feat(docker): host gzip archive downloads
- added config option [mkpkglists] archivedir
    - created by mkpkglists

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-11-10 07:39:23 -08:00
Kevin Morris
107367f958
feat(docker): use mkpkglists --extended flag
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-11-09 02:29:39 -08:00
Kevin Morris
068b067e14
feat(docker): log cron executions
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-11-09 02:28:52 -08:00
Kevin Morris
4b8963b7ba
feat(docker): add cron service (aurblup + mkpkglists)
Normally, these scripts are used to update official providers
in the aurweb database along with archives that can be retrieved.

Run both of these scripts in a 5 minute cron job, to both reflect
the live instance database and production load.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-11-09 00:29:19 -08:00
Kevin Morris
3b1809e2ea
feat(Docker): allow custom certificates for fastapi/nginx
Now, when a `./cache/production.{cert,key}.pem` pair is found, it is
used in place of any certificates generated by the `ca` service.
This allows users to customize the certificate that the FastAPI
ASGI server uses as well as the front-end nginx certificates.

Optional:

- ./cache/production.cert.pem
- ./cache/production.key.pem

Fallback:

- ./cache/localhost.cert.pem + ./cache/root.ca.pem (chain)
- ./cache/localhost.key.pem

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-10-02 13:27:19 -07:00
Kevin Morris
a120af5a00 Docker: remove asset forward to index.php
This makes logging look a little better for development purposes.
Now, `docker-compose logs php-fpm` will only show details about PHP
accesses, while `docker-compose logs nginx` will show accesses
regarding PHP assets.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-06-29 10:30:26 -07:00
Kevin Morris
3bacfe6cd9 Docker: increase nginx and php-fpm logging
Log toward stdout/stderr which is accessible via
`docker-compose logs <service>`.

Examples:

- `docker-compose logs nginx`
- `docker-compose logs php-fpm`

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-06-29 10:29:24 -07:00
Kevin Morris
af96be7d09 Docker: move nginx config to its own file
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-06-29 10:27:45 -07:00