Skip to main content

Introduction

About Eenos Apps

Eenos apps are  third party  plugins for the Eenos control panel.  This feature will help you to develop and manage custom apps for Eenos.

Eenos currently support two types of apps.

  • Python App : Apps developed using Django framework in  Python
  • PHP App : Apps developed on  PHP programming language. 

You can develop the apps in python or php as you wish. 

Directory Structure of Eenos Apps

Eenos apps have the following directory structure.

sampleapp/
├── app.conf
├── hooks
│   └── createacct
│       ├── post
│       │   └── sampleapp_post.sh
│       └── pre
│           └── sampleapp_pre.sh
├── LICENSE
├── post
│   └── 02-post.sh
├── pre
│   └── 01-ps.sh
├── rapp
│   └── sampleapp
│       ├── admin.py
│       ├── apps.py
│       ├── __init__.py
│       ├── migrations
│       │   └── __init__.py
│       ├── models.py
│       ├── templates
│       │   └── sampleapp_index.html
│       ├── tests.py
│       ├── urls.py
│       └── views.py
├── README
├── requirements.txt
├── scripts
│   ├── sampleapp_scripts1
│   ├── sampleapp_scripts.py
│   └── sampleapp_scripts.sh
├── static
│   └── sampleapp
│       ├── sampleapp.js
│       └── style.css
├── uapp
│   └── sampleapp
│       ├── admin.py
│       ├── apps.py
│       ├── __init__.py
│       ├── migrations
│       │   └── __init__.py
│       ├── models.py
│       ├── templates
│       │   └── sampleapp_index.html
│       ├── tests.py
│       ├── urls.py
│       └── views.py
├── vhosts
│   ├── rapp.sampleapp.conf
│   ├── uapp.sampleapp.conf
│   └── wap.sampleapp.conf
└── wap
    └── sampleapp
        ├── admin.py
        ├── apps.py
        ├── __init__.py
        ├── migrations
        │   └── __init__.py
        ├── models.py
        ├── templates
        │   └── sampleapp_index.html
        ├── tests.py
        ├── urls.py
        └── views.py

The detailed explanation of the directories and files are given below

app.conf

This file contain the configuration settings of app. It is a generic INI format file. Every  Eenos app need this file.  An Example configuration is given below:

[settings]
# All the settings fields are mandatory 
# The Name of the parent folder of the app.
# The name may contain letters, digits, hyphen and underscore
# The name always starts with a letter and a length of 20 characters.
name = sampleapp

# The menu name that will be showing inside the control panel pages
#  Maximum menu name length is 24 characters.
menu = A Sample App

# A description about the app. What is the use of this app ?
# Maximum length of description is 6o characters. 
description = This is a sample python app for testing purpose

# The programming language , currently support python or php only
# If this is a Python Django app use python
# if this is a  PHP app chose , php
# Accepted values [ python , php]
language = python

# This app version number
version = 1.0.0

# The version_check_url is a remote url shows the available current version of the app
# This url must give the version number as plain text output
# This version should ensure if the app is up-to-date
version_check_url =  https://download.eenos.com/apps/sample-python-app/version.txt

# The auto update script path used to update the scripts
# You can place this in ,/scripts/ folder so that will be installed 
auto_update = /usr/local/eenos/scripts/sampleapp_update

[wap]
# The general settings for WAP admin app
# To enable or disable this app in admin panel 
# Supported values ,[ on , off ]
status = on

# If you wish to open the app in new browser window during a click action
# from the  control panel
# Supported values [ off,  on] , default off
open_new_window = off

[rapp]
# The general settings for RAPP - Reseller control panel app
# To enable or disable this app in reseller  panel 
# Supported values ,[ on , off ]
status = on

# If you wish to open the app in new browser window during a click action
# from the  control panel
# Supported values, [ off,  on] , default off
open_new_window = off

[uapp]
# The general settings for UAPP - User control panel app
# To enable or disable this app in user  panel 
# Supported values, [ on , off ]
status = on

# If you wish to open the app in new browser window during a click action
# from the  control panel
# Supported values [ off,  on] , default off
open_new_window = off

This file have the following four sections:

Settings

This section contain the basic settings of the app. All fields are mandatory. The settings  block have the following

  • name :  The name of the app, it is the folder name of the app
  • menu : The menu name of the app.
  • description : A description about the app
  • language : The programming language used in the app. May be python or php.
  • version : The version number of the app.
  • version_check_url : A  url to show the current version  which will display the version as plain text format.
  • auto_update : A full path to update script. This script will be used to update the plugin
wap

This section contain the  app settings for admin panel. This block have the following fields:

  • status :  To enable or disable it on admin panel . You can chose on or off on this field
  • open_new_window: If you like to open the menu in a new browser tab , you can make it on or off
rapp

This section contain the  app settings for reseller panel. This block have the following fields:

  • status :  To enable or disable it on reseller panel . You can chose on or off on this field
  • open_new_window: If you like to open the menu in a new browser tab , you can make it on or off
uapp

This section contain the  app settings for user panel. This block have the following fields:

  • status :  To enable or disable it on user panel . You can chose on or off on this field
  • open_new_window: If you like to open the menu in a new browser tab , you can make it on or off

hooks

This folder contain the action hooks associated with the  plugin. The contents of the hook folder will be copied to  Eenos hooks directory.

To know more about  Eenos hooks please read from here

pre and post scripts

These scripts will be called during the app installation time.

The pre scripts need to place inside the folder pre/ which will be called before starting the app installation

The post scripts need to place inside the folder post/ which will be called after the app installation.

You can use any type of scripts or binaries ,  these scripts simply need execute permission.

scripts

This folder contain any custom scripts associated with your plugin. These scripts will be copied to  the  Eenos scripts folder  /usr/local/eenos/scripts/

The scripts must need to start with  your plugin name followed by undescore.

vhosts

This folder contain the nginx vhost configuration for your app. This is only required for PHP apps.  You can place three types of  vhosts in this folder. There are wap,rapp and uapp configuration.

The file name format for the vhost is  PANEL.APP_NAME.conf , where  PANEL is  wap,uapp or rapp and  APP_NAME is the name of the app.

An  Example of  vhost for sampleapp is as follows,

├── vhosts
│   ├── rapp.sampleapp.conf
│   ├── uapp.sampleapp.conf
│   └── wap.sampleapp.conf

static

This folder contain the static files of the app includes images , css and js scripts and other static file. The static files must be inside the folder with name of the plugin inside static/  fodler.

For example place the static file for sampleapp in static/sampleapp folder.

requirements.txt

This file is a standard requirement file of the Django Python apps or scripts. These are  python modules that need for the app.

These requirement python modules will be installed on the Eenosd Python

wap,uapp,rapp

This folder contain the app source files.  You need to place the app  files inside these folder for the respective control panel interface. Please make sure you place the app inside a sub folder wit your app name.

For example if we have an app name sampleapp , the app files will be as follows,

  •  wap/sampleapp   - For admin panel plugin
  • rapp/sampleapp  -  For reseller control panel plugin
  • uapp/sampleapp  -  For user control panel plugin

These folders contain  either python scripts or php scripts as per your app project.

To start developing apps  try to start with the sample app setup from the  coming sections.