2022-06-11 12:52:04 +00:00
|
|
|
# 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.
|
|
|
|
|
2022-07-07 05:29:23 +00:00
|
|
|
## 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.
|
|
|
|
|
2022-06-11 12:52:04 +00:00
|
|
|
## 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.
|
2022-06-17 13:49:00 +00:00
|
|
|
|
|
|
|
## Support Platform Integration
|
|
|
|
|
|
|
|
Hostea Dashbaord delegates support to Hostea's meta Gitea instance, as
|
2022-09-11 21:27:08 +00:00
|
|
|
discussed [here](https://gitea.gna.org/Hostea/july-mvp/issues/17).
|
2022-06-17 13:49:00 +00:00
|
|
|
|
|
|
|
To configure support platform integration , please set the following
|
|
|
|
attributes in `settings.py`:
|
|
|
|
|
|
|
|
```python
|
|
|
|
HOSTEA = {
|
|
|
|
# <--snip--->
|
|
|
|
"META": {
|
|
|
|
# <--snip--->
|
2022-09-11 21:27:08 +00:00
|
|
|
"GITEA_INSTANCE": "https://gitea.gna.org", # meta Gitea insatnce
|
2022-06-17 13:49:00 +00:00
|
|
|
"GITEA_ORG_NAME": "Hostea", # Organisation name on Hostea meta instance
|
|
|
|
# Repository dedicated for handling support
|
2022-09-11 21:27:08 +00:00
|
|
|
# ref: https://gitea.gna.org/Hostea/july-mvp/issues/17
|
2022-06-17 13:49:00 +00:00
|
|
|
"SUPPORT_REPOSITORY": "support",
|
|
|
|
},
|
|
|
|
}
|
|
|
|
```
|
2022-06-21 19:10:06 +00:00
|
|
|
|
|
|
|
## 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"),
|
|
|
|
},
|
|
|
|
)
|
|
|
|
}
|
|
|
|
```
|
2022-06-24 15:08:37 +00:00
|
|
|
|
|
|
|
## 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
|
|
|
},
|
2022-06-24 15:08:37 +00:00
|
|
|
},
|
|
|
|
```
|
|
|
|
|
|
|
|
### References:
|
|
|
|
|
|
|
|
https://enough-community.readthedocs.io/en/latest/services/hostea.html
|