How to enable Reseller feature¶
How to enable reseller feature in docker deployment¶
In order to enable the reseller feature when you have installed Fleio using the Docker deployment method you will have to:
Change the
FLEIO_ENABLE_RESELLER=0
toFLEIO_ENABLE_RESELLER=1
environment variable in the/home/fleio/compose/.env
file.
Warning
If you don’t have variable in the /home/fleio/compose/.env
file, you need to add it at the end of the file.
Enable the
billing.reseller
feature in the settings.py file:
fleio edit settings.py
Add STAFF_FEATURES['billing.reseller'] = True
at the end of the file.
Save, exit and restart Fleio by pressing
Y
.Run
fleio recreate
.This will recreate all the Fleio containers, and it will include the nginx configuration that is needed for the reseller frontend.
If you’re upgrading from 2021.02 or lower (docker deployment), you also need to create and configure the reseller.config.json file. First we will copy the reseller configuration file from a templated file located at /var/webapps/fleio/frontend/reseller/assets/config-templates/reseller-template.config.json
sudo su fleio && cd /home/fleio/compose
docker-compose exec -T frontend cp /var/webapps/fleio/frontend/reseller/assets/config-templates/reseller-template.config.json /var/webapps/fleio/frontend/reseller/assets/config/reseller.config.json
Then we will configure the Fleio backend URL:
fleio edit reseller.config.json
Replace localhost:8000 with your-fleio-frontend-url.tld/backend/.
The reseller frontend panel should now be available at your-fleio-frontend-url.tld/reseller.
How to enable the reseller feature (package installation)¶
Enable reseller feature¶
In order to enable the reseller feature you must set the billing.reseller
feature to True
in settings.py file.
You can do that by adding the following line at the end of the settings.py file
STAFF_FEATURES['billing.reseller'] = True
For more information see advanced settings file.
Edit nginx configuration¶
Next step would be edit the nginx configuration. Depending on your operating system, you might need to edit
/etc/nginx/sites-enabled/your-site.conf
if you’re using Ubuntu or /etc/nginx/conf.d/your-site.conf
if you’re using CentOS.
If you initially installed Fleio before version 2020.05 the /reseller
nginx configuration section might look differently
or might be totally missing in nginx config. Add the code below.
location /reseller {
alias /var/webapps/fleio/frontend/reseller/;
expires -1;
try_files $uri $uri/ /../reseller/index.html;
}
Restart services¶
The last step is to restart Fleio services (see Restarting Fleio) and to reload the nginx service:
service nginx reload
Upgrading Fleio from 2019.10.0 or lower¶
If you’re upgrading from 2019.10.0 or lower you will also need to run the following commands:
cp /var/webapps/fleio/frontend/reseller/assets/config-templates/reseller-template.config.json /var/webapps/fleio/frontend/reseller/assets/config/reseller.config.json
sed 's|"backendApiUrl": "//localhost:8000/resellerapi|"backendApiUrl": "//REPLACE-ME/backend/resellerapi|' -i /var/webapps/fleio/frontend/reseller/assets/config/reseller.config.json
sed 's|<base href="/">|<base href="/reseller/">|' -i /var/webapps/fleio/frontend/site/reseller/index.html
Please replace “REPLACE-ME” with your domain configured at bootstrapping.
The last step is to restart Fleio services (see Restarting Fleio) and to reload the nginx service:
service nginx reload