2023-09-20 02:28:43 +00:00
|
|
|
|
# Software Freedom Conservancy website
|
2023-09-07 12:59:23 +00:00
|
|
|
|
|
2023-09-20 02:28:43 +00:00
|
|
|
|
## Contributing
|
2014-12-05 15:18:17 +00:00
|
|
|
|
|
2015-12-22 00:57:01 +00:00
|
|
|
|
The canonical location for this repository is [on Conservancy’s
|
2023-09-20 02:28:43 +00:00
|
|
|
|
Kallithea instance](https://k.sfconservancy.org/website).
|
2014-12-05 15:18:17 +00:00
|
|
|
|
|
2023-09-07 12:59:23 +00:00
|
|
|
|
|
2023-09-20 02:28:43 +00:00
|
|
|
|
## License
|
2014-12-05 15:21:01 +00:00
|
|
|
|
|
|
|
|
|
The software included herein, such as the Python source files, are generally
|
|
|
|
|
licensed [AGPLv3](AGPLv3)-or-later. The Javascript is a hodgepodge of
|
|
|
|
|
licensing, but all of it is compatible with [AGPLv3](AGPLv3)-or-later. See
|
|
|
|
|
the notices at the top of each Javascript file for licensing details.
|
|
|
|
|
|
|
|
|
|
The content and text (such as the HTML files) is currently
|
|
|
|
|
[CC-BY-SA-3.0](CC-By-SA-3.0).
|
2014-12-05 15:18:17 +00:00
|
|
|
|
|
2010-09-26 22:00:53 +00:00
|
|
|
|
|
2023-09-20 02:28:43 +00:00
|
|
|
|
## Server configuration
|
2023-09-07 12:59:23 +00:00
|
|
|
|
|
2023-09-14 08:14:22 +00:00
|
|
|
|
Conservancy's webserver runs on a standard Debian installation. For
|
|
|
|
|
configuration requirements, see `deploy/ansible/install.yml`.
|
2010-09-26 22:00:53 +00:00
|
|
|
|
|
|
|
|
|
|
2023-09-20 02:28:43 +00:00
|
|
|
|
## CDN
|
|
|
|
|
|
|
|
|
|
Requests to any URL starting with `/videos/` are forwarded to our CDN server to
|
|
|
|
|
reduce bandwidth use. These files are uploaded to the CDN manually via the
|
|
|
|
|
Rackspace API. Note that the Apache rewrite rule requires that the file **not
|
|
|
|
|
exist** on disk for the redirect to be applied.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Local development
|
2023-09-14 08:14:22 +00:00
|
|
|
|
|
2023-10-26 02:22:45 +00:00
|
|
|
|
Python dependencies in `requirements.txt` are tied to the versions available in
|
|
|
|
|
Debian:
|
2023-09-07 12:59:23 +00:00
|
|
|
|
|
|
|
|
|
python3 -m pip install -r requirements.txt
|
2023-10-26 02:22:45 +00:00
|
|
|
|
|
|
|
|
|
You'll need a copy of `conservancy/djangocommonsettings.py`, a file that not
|
|
|
|
|
committed to the repository that has database settings and other
|
|
|
|
|
environment-specific config.
|
|
|
|
|
|
2024-03-13 03:26:01 +00:00
|
|
|
|
To run the tests, install `pytest-django` and run pytest:
|
|
|
|
|
|
|
|
|
|
python3 -m pip install pytest-django
|
|
|
|
|
python3 -m pytest
|
|
|
|
|
|
2023-10-26 02:22:45 +00:00
|
|
|
|
Then run:
|
|
|
|
|
|
2024-03-13 03:26:01 +00:00
|
|
|
|
python3 manage.py migrate
|
|
|
|
|
python3 manage.py runserver
|
2023-09-07 12:59:23 +00:00
|
|
|
|
|
2023-10-26 02:22:45 +00:00
|
|
|
|
There is also a Dockerfile available if that's more convenient. See that file
|
|
|
|
|
for details.
|
|
|
|
|
|
2023-09-14 08:14:22 +00:00
|
|
|
|
|
2023-09-20 02:28:43 +00:00
|
|
|
|
## Deploying
|
2023-09-07 12:59:23 +00:00
|
|
|
|
|
|
|
|
|
Changes pushed to the https://k.sfconservancy.org/website repository are
|
|
|
|
|
automatically deployed to the production website by the `conservancy-www-update`
|
|
|
|
|
SystemD timer. See `systemd/conservancy-www-update.timer` for details.
|
2023-10-26 02:22:45 +00:00
|
|
|
|
|
|
|
|
|
The `migrate` and `collectstatic` commands are not run automatically. You may
|
|
|
|
|
need to run these if modifying the database schema or adding/moving static files:
|
|
|
|
|
|
2024-03-13 03:26:01 +00:00
|
|
|
|
sudo -u www-data /var/www/venv-website/bin/python3 manage.py migrate
|
|
|
|
|
sudo -u www-data /var/www/venv-website/bin/python3 manage.py collectstatic --link
|