dashboard/docs/INSTALL.md

117 lines
3.3 KiB
Markdown
Raw Normal View History

# Installation instructions
2022-06-25 13:15:37 +00:00
## Configuration template
[dashboard/local_settings.example.py](../dashboard/local_settings.example.py)
contains a configuration template that may be used to create production
configuration file to override [dashboard/settings.py](../dashboard/settings.py).
Please copy local_settings.example.py to local_settings.py and make
changes to the newly copied file.
## Static files
In order to serve static files, please run the following command before
running the Dashbaord server:
```bash
yes yes | python manage.py collectstatic
```
This command will gather all static assets from all the modules in
Dashbaord and place them in `static/` in the base directory.
## Cron jobs
Run cron job at an interval of your choosing with the following comamnd:
```bash
python manage.py rm_unverified_users
```
It will delete all users that are below maximum tolerated duration
unverified users, as configured in settings.py:
```python
HOSTEA = {
# <--snip--->
"ACCOUNTS": {"MAX_VERIFICATION_TOLERANCE_PERIOD": 60 * 60 * 24}, # in seconds
}
```
In future, the cronjob will be run as part of the Hostea/Dashbaord and
hence the current redundancy in configuration and cronjob duration.
## Support Platform Integration
Hostea Dashbaord delegates support to Hostea's meta Gitea instance, as
discussed [here](https://gitea.hostea.org/Hostea/july-mvp/issues/17).
To configure support platform integration , please set the following
attributes in `settings.py`:
```python
HOSTEA = {
# <--snip--->
"META": {
# <--snip--->
"GITEA_INSTANCE": "https://gitea.hostea.org", # meta Gitea insatnce
"GITEA_ORG_NAME": "Hostea", # Organisation name on Hostea meta instance
# Repository dedicated for handling support
# ref: https://gitea.hostea.org/Hostea/july-mvp/issues/17
"SUPPORT_REPOSITORY": "support",
},
}
```
## Payments
At present, we rely on [Stripe](https://stripe.com) for processing
payments. So we are limited to the countries at which Stripe operates.
To deploy payments, please configure the options in settins.py that
start with `PAYMENT_*`
**NOTE: Please don't change the `PAYMENT_MODEL`. Changing it will
break the app**
```python
## django-payments configuration
PAYMENT_MODEL = "billing.Payment" # please don't change this value
# the URL at which Dashbaord will be listening
PAYMENT_HOST = "http://localhost:8000"
PAYMENT_VARIANTS = {
"stripe": (
"payments.stripe.StripeProvider",
{
# stripe API secret key, available in Stripe dashboard
"secret_key": env.get_value("STRIPE_SECRET_KEY"),
# stripe API public key, available in Stripe dashboard
"public_key": env.get_value("STRIPE_PUBLIC_KEY"),
},
)
}
```
## Infrastructure(via [Enough](https://enough.community))
```python
HOSTEA = {
# <------snip-------->
"INFRA": {
"HOSTEA_REPO": {
# where to clone the repository
"PATH": "/srv/hostea/dashboard/infrastructure",
# Git remote URI of the repository
"REMOTE": "git@localhost:Hostea/enough.git",
# SSH key that can push to the Git repository remote mentioned above
"SSH_KEY": "/srv/hostea/deploy",
2022-06-25 12:27:23 +00:00
},
},
```
### References:
https://enough-community.readthedocs.io/en/latest/services/hostea.html