Advanced settings file

You can change Fleio options and behavior from the settings.py file as described below.

Note that, besides the backend settings described in this document, frontend settings are also available to personalize your installation.

How to apply Fleio backend settings.py changes

Full file path is:

/var/webapps/fleio/project/fleio/settings.py

Important

After editing the settings.py file, you must restart the fleio service: systemctl restart fleio and tell uwsgi to reload the file: systemctl reload uwsgi, in order for the changes to take effect.

Django and DRF settings

The Fleio backend is built on Django web framework and Django REST framework. You can overwrite Django and DRF settings in the settings.py file, as well. Read about their available settings in the Django documentation and in the DRF documentation.

Fleio specific settings

Some advanced Fleio settings can only be changed by editing the settings.py file:

How to enable/disable features

Fleio is a modular application which allows you to enable or disable features for end-users and staff respectively.

The FEATURES dictionary allows you to enable or disable end-user features. The dictionary key identifies the feature and the dictionary value may have one of the following values:

  • True - feature is enabled
  • False - feature is disabled

The full features list is already present in base_settings.py, which contains default Fleio settings.

Important

Do not edit the base_settings.py file. It will be overwritten when Fleio is updated. Edit settings.py instead. settings.py contains your local installation information and is never overwritten by Fleio.

Here’s how features are defined by default in base_settings.py.

FEATURES = {
    'demo': False,
    'enduser': True,
    'enduser.allow_changing_password': True,

    'billing': True,
    'billing.addcredit': True,
    'billing.history': True,
    'billing.invoices': True,
    'billing.order': True,
    'billing.pdf': True,
    'billing.services': True,

    'clients&users.clients': True,
    'clients&users.signup': True,
    'clients&users.users': True,
    'clients&users.userprofile': True,

    'dashboard': True,
    'license': True,

    'notifications': True,

    'openstack': True,
    'openstack.apiusers': True,
    'openstack.cleanup': False,
    'openstack.cleanup.images': False,
    'openstack.cleanup.images.showdate': False,
    'openstack.dns.ptr': True,
    'openstack.dns.zones': True,
    'openstack.flavors': True,
    'openstack.floatingips': True,
    'openstack.images': True,
    'openstack.images.updatecreate': False,
    'openstack.images.showcommunity': False,
    'openstack.images.showshared': True,
    'openstack.instances': True,
    'openstack.instances.snapshots': True,
    'openstack.instances.traffic': True,
    'openstack.networks': True,
    'openstack.projects': True,
    'openstack.routers': True,
    'openstack.securitygroups': True,
    'openstack.sshkeys': True,
    'openstack.subnetpools': True,
    'openstack.volumes': True,
    'openstack.volumes.boot': True,
    'openstack.osbackup': True,
    'openstack.osbackup.schedules': False,

    'plugins': True,
    'plugins.todo': True,
    'plugins.tickets': True,
    'plugins.cpanel': True,
    'plugins.cpanelserver': True,
    'plugins.domains': True,
    'plugins.hypanel': False,
}

Analogous there’s a STAFF_FEATURES dictionary which allows you to manipulate features for the staff panel.

STAFF_FEATURES = {
    'demo': False,
    'staff': True,

    'billing': True,
    'billing.gateways': True,
    'billing.journal': True,
    'billing.invoices': True,
    'billing.orders': True,
    'billing.products': True,
    'billing.pdf': True,
    'billing.services': True,
    'billing.taxrules': True,
    'billing.transactions': True,
    'billing.reporting': False,

    'clients&users.clients': True,
    'clients&users.clientgroups': True,
    'clients&users.userprofile': True,
    'clients&users.users': True,
    'clients&users.usergroups': True,

    'dashboard': True,
    'license': True,
    'app-status': True,

    'notifications': True,

    'openstack': True,
    'openstack.apiusers': True,
    'openstack.cleanup': False,
    'openstack.cleanup.images': False,
    'openstack.cleanup.images.showdate': False,
    'openstack.dns.ptr': True,
    'openstack.dns.zones': True,
    'openstack.flavors': True,
    'openstack.floatingips': True,
    'openstack.images': True,
    'openstack.images.shareoncreate': True,
    'openstack.images.showcommunity': False,
    'openstack.images.showshared': False,
    'openstack.instances': True,
    'openstack.instances.snapshots': True,
    'openstack.instances.traffic': True,
    'openstack.networks': True,
    'openstack.ports': True,
    'openstack.projects': True,
    'openstack.routers': True,
    'openstack.securitygroups': True,
    'openstack.sshkeys': True,
    'openstack.subnetpools': True,
    'openstack.subnets': True,
    'openstack.volumes': True,
    'openstack.volumes.shareoncreate': True,
    'openstack.osbackup': True,
    'openstack.osbackup.schedules': False,
    'openstack.settings': True,
    'openstack.plans': True,

    'plugins': True,
    'plugins.cpanel': True,
    'plugins.cpanelserver': True,
    'plugins.domains': True,
    'plugins.todo': True,
    'plugins.tickets': True,
    'plugins.hypanel': False,

    'settings': True,
    'settings.general': True,
    'settings.configurations': True,
    'settings.authorization': True,
    'settings.notifications.templates': True,

    'utils': True,
    'utils.activitylog': True,
    'utils.tasklog': True,
    'utils.reports': False,
    'servers': True,
}

And here’s how to enable or disable a feature. Let’s say we want to disable new users sign-up. Add the following line at the end of settings.py:

FEATURES['clients&users.signup'] = False

And let’s say, that we want to enable floating IPs for staff. In order to enable a feature you have to make sure the top level feature is also enabled. To enable floating IPs just add the following lines at the end of settings.py:

STAFF_FEATURES['openstack'] = True
STAFF_FEATURES['openstack.floatingips'] = True

End-user features explained

  • demo - enables demo mode - this will autofill demo/demo username and password on end-user login page, demoadmin/demoadmin are autofilled on staff login page, many features are disabled that would otherwise allow anonymous visitors to break the Fleio installation. Demo mode is enabled on https://demo.fleio.com installation.
  • enduser - feature is available only in end user mode, used to differentiate between enduser and staff
  • billing.addcredit - enables the Add credit button on dashboard
  • billing.history - enabled billing history page
  • billing.invoices - enables invoice functionality,this may be needed for Add credit
  • billing.order - enables order functionality allowing end user to order services
  • billing.pdf - enabled pdf generation for invoices
  • billing.services - enables services view for end user, the user will be able to view and edit services
  • clients&users.clients - enables client feature for end users allowing add or edit of clients
  • clients&users.signup - enables signup for end users
  • clients&users.userprofile - enables used profile editing for end users
  • dashboard- when disabled the dashboard page will be empty
  • notifications - enables notifications for end user
  • openstack.apiusers - enables Openstack API user management
  • openstack.cleanup - enables Openstack objects cleanup
  • openstack.dns.ptr - enables dns ptr record editing for instances
  • openstack.dns.zones - enables dns zones editing
  • openstack.floatingips - enables floating IPs management for end users
  • openstack.images - enables My images feature for end users where users can see snapshots and upload images
  • openstack.images.createupdate - enabled create and update of images in My images page
  • openstack.instances - enables management of instances for end users
  • openstack.instances.snapshots - allows instance snapshots. This feature may require openstack.images to be enabled
  • openstack.instances.traffic - enables instance traffic monitoring and billing functionality
  • openstack.networks - enable networks management for end users
  • openstack.securitygroups - enables security groups management for end users
  • openstack.sshkeys - enables ssh key management for end users
  • openstack.subnetpools - enables management of subnet pools for end users
  • openstack.volumes - enables management of volumes for end users
  • openstack.osbackup - enables backup functionality for end users

Staff user features explained

  • demo - enables demo mode - this will autofill demo/demo username and password on end-user login page, demoadmin/demoadmin are autofilled on staff login page, many features are disabled that would otherwise allow anonymous visitors to break the Fleio installation. Demo mode is enabled on https://demo.fleio.com installation.
  • staff - feature is available only in staff mode, used to differentiate between end user and staff
  • billing.gateways - enables gateways functionality for staff
  • billing.journal - enables journal viewer for staff
  • billing.history - enabled billing history page
  • billing.invoices - enables invoice management for staff
  • billing.order - enables order management for staff
  • billing.pdf - enabled pdf generation for invoices
  • billing.services - enables services services management for staff
  • billing.taxrules - enables tax rules management for staff
  • billing.transactions - enables transactions functionality
  • clients&users.clients - enables clients management for staff
  • clients&users.users - enables users management for staff
  • clients&users.clientgroups - enables client groups management for staff
  • clients&users.usergroups - enables user group management for staff
  • dashboard- when disabled the dashboard page will be empty
  • openstack.apiusers - enables Openstack API user management
  • openstack.cleanup - enables Openstack objects cleanup
  • openstack.dns.ptr - enables dns ptr record editing for instances
  • openstack.dns.zones - enables dns zones editing
  • openstack.flavors - enables flavors management
  • openstack.floatingips - enables floating IPs management for staff
  • openstack.images - enables Image management for staff where staff users can see snapshots and upload images
  • openstack.instances - enables management of instances for staff
  • openstack.instances.snapshots - allows instance snapshots. This feature may require openstack.images to be enabled
  • openstack.instances.traffic - enables instance traffic monitoring and billing functionality
  • openstack.networks - enable networks management for staff
  • openstack.ports - enables ports management for staff
  • openstack.projects - enables project management for staff
  • openstack.routers - enables routers management for staff
  • openstack.securitygroups - enables security groups management for staff
  • openstack.sshkeys - enables ssh key management for staff
  • openstack.subnetpools - enables management of subnet pools for staff
  • openstack.subnets - enables subnet management for staff
  • openstack.volumes - enables management of volumes for staff
  • openstack.osbackup - enables backup of instances
  • openstack.settings - enables openstack settings on staff panel
  • openstack.plans - enables management of openstack plans
  • settings.general - enables general settings on staff panel
  • settings.configurations - enables management of configurations
  • settings.authorization - enables authorization frontend for staff
  • settings.notification-templates - enables notification templates frontend for staff
  • utils.activitylog - enables activity log viewer on staff page
  • utils.tasklog - enables task log viewer on staff page
  • servers - enables servers feature

Configure custom add credit URL

You can customize the add credit URL in backend as well as the one in frontend. The add credit URL is used in backend when sending email notifications regarding low credit and out of credit.

Edit settings.py and add:

# Leave empty to use the default add credit URL of Fleio
# fill in 'client_group_name': 'http://url...' pairs when using an external billing
# when the dictionary has a single entry it will be used regardless of the 'client_group_name'
ADD_CREDIT_URLS = {}

SSO_MAX_AGE

External billing systems, like WHMCS, generate single sign-on URL’s. For security reasons, SSO URL’s contain a timestamp from the moment they were generated.

SSO_MAX_AGE specifies after how many seconds, from the generation time, the single sign-on URL expires.

If single sign-on ULR is expired, it won’t work anymore.

PROXY_SETTINGS

If you are behind a proxy server, you must set this variable, to access the licensing server for setting the license.

Set it to: PROXY_SETTINGS = {‘https’: ‘<ip>:<port>’, }. For example:

PROXY_SETTINGS = {'https': '10.10.1.11:1080', }

Default OpenStack object names

Fleio creates a new security group for each client (OpenStack project) the first time an instance is created. And this new security group will be automatically added to all instances the end-user creates.

By default this security group is called fleio. You can change the default name by adding a line in your settings.py file:

# name of automatically created security groups
SECURITY_GROUP_NAME = 'fleio'