Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extension templating #26

Merged
merged 107 commits into from
Apr 16, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
107 commits
Select commit Hold shift + click to select a range
03df1b3
added templates for very basic extensions
Mar 11, 2014
f7d4391
Adding emacs auto-saves to .gitignore
Mar 11, 2014
54f1c89
Work on extension writing focusing on intro and Qt Designer
Mar 11, 2014
ad53e37
added some extra functionality to main template.
Mar 12, 2014
b7be74a
I don't knoiw why I had that half template anyway
Mar 12, 2014
3cd03d7
added extended filled question mark sizes
Mar 12, 2014
dd7da77
continued writing tutorial through ui creation
Mar 12, 2014
7af5e28
added creash and error signals to template and tutorial
Mar 13, 2014
f0a079a
added a basic commotion form stylesheet
Mar 13, 2014
2e4cb5e
Prepared main_window for loading extensions
Mar 13, 2014
e6326b3
Changed custom exit function name to not overwrite default exit function
Mar 13, 2014
9569793
added clean up functions to tutorial files
Mar 13, 2014
957adfb
added viewport clean-up and swap functions
Mar 13, 2014
6f34f71
added clean up functions to welcome page
Mar 13, 2014
79afaf7
replaced exception log.debug logging with log.exception calls
Mar 14, 2014
0f9f973
cleaned up exception handling
Mar 14, 2014
5599068
added extension manager core
Mar 17, 2014
c435185
added proper usage of default values to settings loading.
Mar 17, 2014
f97012f
Fixed filename to == PEP8
Mar 17, 2014
1eb22ed
added a config file validation object
Mar 18, 2014
3d0c03c
applied a shorter variable for qt logging functions
Mar 18, 2014
303ae05
added file management needed for extension management
Mar 18, 2014
4dfc0b5
fixed a mis-typed variable
Mar 18, 2014
597178e
Cleaned up documentation
Mar 18, 2014
7fa33cb
started scoping out extension management functionality.
Mar 18, 2014
a8980c4
Cleaned up validation and file system utils
Mar 19, 2014
87f5162
added basic networking validation class
Mar 19, 2014
d14f0ae
completed extension manager
Mar 19, 2014
ee76366
cleaned up code to be pep8 compliant-ier
Mar 19, 2014
cb19959
hooked extension loader to extension manager
Mar 19, 2014
3a48228
fixed incorrect loading of fs_utils
Mar 19, 2014
fe797ba
cleaned up some markdown
Mar 19, 2014
34c2991
moved config_manager to core
Mar 19, 2014
a7b1d3a
fixed some weirdness
Mar 19, 2014
915112c
messed up links and did not realize till it was already pushed.
Mar 19, 2014
844fdeb
changed config_manager to config_editor
Mar 19, 2014
57a0cbb
removed old todo, as it is no longer needed.
Mar 21, 2014
a131e9e
moved all config files into config directories
Mar 21, 2014
1fcf594
Added proper checking for QVariant type
Mar 21, 2014
6f7f7b3
Changed to .conf naming for configs
Mar 21, 2014
5e8f239
removed old test extension
Mar 21, 2014
8ea9efd
Moved extension handling to extension manager
Mar 21, 2014
d25980a
Added more extension identification functions
Mar 21, 2014
ea4edbf
Added some basic code standards guidance
Mar 24, 2014
055da6c
added missing settings import
Mar 24, 2014
3320464
added basic setup.py
Mar 24, 2014
4bfda66
added loaded config files to data directory
Mar 24, 2014
a878f12
added extension config removal
Mar 24, 2014
10e1363
Made extension configs live in one unified folder under data
Mar 24, 2014
4da5a82
removed all logging of exceptions that are raised
Mar 25, 2014
1bdfb67
added cx_freeze build configurations
Mar 27, 2014
fe18294
added some style specifications
Mar 27, 2014
086d6b0
removed empty file
Mar 27, 2014
9f3637c
removed core and contrib extension differences
Mar 27, 2014
28a692d
added a load_all call in the client
Mar 27, 2014
53d3cff
continued extensive overhaul of extension manager
Mar 27, 2014
8f1e6d6
added tests for extension manager load_all fucntion
Mar 27, 2014
4f10628
making bundling exe's cleaner
Mar 27, 2014
50c94ca
modified dependencies to allow bundling
Mar 27, 2014
6649cf9
cleaned up code. No functional changes
Mar 27, 2014
c4f1bb7
Made logging cleaner, and added a debug message.
Mar 27, 2014
b081a7a
Cleaned up logging
Mar 28, 2014
1c7e6f0
added an in-line-todo.
Mar 28, 2014
fc175ff
added default extension directories
Mar 28, 2014
2ca6a3e
changed load_all call to new load_core name
Mar 28, 2014
017afd5
added easy linux client cx_freeze compilation and creation
Mar 28, 2014
e0cd65d
fixed logger creation functions
Mar 28, 2014
40164ea
fixed some improper logging
Mar 28, 2014
f1ba211
fixed variable creation order and added needed imports.
Mar 28, 2014
2f675b1
added the last-ditch log location to gitignore.
Mar 28, 2014
2d381e3
merged config handling into extension manager
Mar 31, 2014
c7c093c
added build instructions for executable
Mar 31, 2014
000d8a9
Created Zipped extension loader
Apr 1, 2014
3fc9910
removed all current() and currentPath() calls.
Apr 2, 2014
2bd1344
removed exe directory in favor of auto-built exe.<sys> dirs
Apr 2, 2014
3e651bc
added a test runner to the project
Apr 4, 2014
70e7853
added temporary build and testing objects to gitignore
Apr 4, 2014
7319b18
updated the readme's
Apr 4, 2014
04def43
added some missing module __init__ files
Apr 4, 2014
1699f84
added a mock extension object for testing.
Apr 4, 2014
3130227
Made Extension Manager use zipped extensions
Apr 4, 2014
a9c910b
Config properties no longer recursive.
Apr 8, 2014
7466714
Removed mistyped filter
Apr 8, 2014
9eba7a0
fixed dependencies to make install_loaded work
Apr 8, 2014
df8939f
Added test for install loaded function
Apr 8, 2014
d2f41cc
added tests for getting an installed extension from a property.
Apr 8, 2014
c353b40
Made Readme valuable for this project
Apr 10, 2014
979d0ef
updated extension manager installing and uninstalling.
Apr 10, 2014
a76979a
Replaced load_settings with simpler get_config
Apr 11, 2014
66c26cc
updated the readme
Apr 11, 2014
b317b2e
specified a clearer set of test ignores.
Apr 11, 2014
2fe78a7
Added built assets to mock dir for tests
Apr 11, 2014
6cefb8c
added more test functions and fixed code
Apr 11, 2014
fd4a089
finished extension manager tests
Apr 14, 2014
efda801
removed old config utility.
Apr 14, 2014
a79d05f
added missing tests value to config checks
Apr 14, 2014
858bcd6
fix translation and home directory creation errors
Apr 14, 2014
ef656ed
Fixed pathing issues for changing dirs.
Apr 14, 2014
bf883a0
Added loggging and changed a warning to a raise
Apr 14, 2014
c3c1584
removed unneeded type assignment.
Apr 16, 2014
77428da
re-connected the menu-bar to new extensions
Apr 16, 2014
1f29f27
merged core and global paths
Apr 16, 2014
a151dba
Fixed extension initialization in client main
Apr 16, 2014
88c4cd8
Created a working mock extension
Apr 16, 2014
43b449c
Changed tests to reflect new global path
Apr 16, 2014
867cb73
removed assertions for bygone exceptions
Apr 16, 2014
a018595
made extensions fit into the actual main window
Apr 16, 2014
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 23 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,16 +1,38 @@
# Debian .deb cruft
debian/files
debian/commotion-linux-py.debhelper.log
debian/commotion-linux-py.substvars
debian/commotion-linux-py.postinst.debhelper
debian/commotion-linux-py.prerm.debhelper
debian/commotion-linux-py/

# python build products
*.pyc
__pycache__

# example code
examples/

# PyQt auto-created asset tracking file.
*_rc.py
commotion_client/temp/

#All compiled versions of designer created UI files.
Ui_*.py
Ui_*.py

# Emacs auto-save cruft because s2e does not want to spend the time debugging his .emacs config right now.
\#.*#

#Extension Application Data
commotion_client/data/extensions/*

#compiled clients
build/exe*
build/lib
build/resources

#testing objects
tests/temp/*

#auto-created commotion on failure of everywhere else
commotion.log
34 changes: 24 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,24 +1,38 @@
.PHONY: build windows osx debian clean install
.PHONY: build windows osx debian clean install tests

all: build windows debian osx
all: build

build: clean
python3.3 build/build.py build
pyrcc4 -py3 commotion_client/assets/commotion_assets.qrc -o commotion_client/assets/commotion_assets_rc.py
build: clean assets
python3.3 build/scripts/build.py build
python3.3 build/scripts/zip_extensions.py

test: clean build
cp commotion_client/assets/commotion_assets_rc.py commotion_client/.
assets:
mkdir build/resources || true
pyrcc4 -py3 commotion_client/assets/commotion_assets.qrc -o build/resources/commotion_assets_rc.py

windows:
@echo "windows compileing is not yet implemented"

osx:
@echo "macintosh saddening is not yet implemented"

linux: build
python3.3 setup.py build

debian:
@echo "debian packaging is not yet implemented"

test: tests
@echo "test build complete"

tests: build
mkdir tests/temp || true
mkdir tests/mock/assets || true
cp build/resources/commotion_assets_rc.py tests/mock/assets/. || true
python3.3 tests/run_tests.py

clean:
python3.3 build/build.py clean
rm commotion_client/assets/commotion_assets_rc.py || true
rm commotion_client/commotion_assets_rc.py || true
python3.3 build/scripts/build.py clean
rm -fr build/resources/* || true
rm -fr build/exe.* || true
rm -fr tests/temp/* || true
194 changes: 103 additions & 91 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,91 +1,103 @@
##Commotion Linux - Python Implementation

##INTRODUCTION
This is an initial implementation of core Commotion functionality in the form of a python module (commotionc) and related scripts. None of the code in this bundle is intended to be called directly, but rather serves as a backend for commotion-mesh-applet and nm-applet-olsrd (although if you really want to you can use fallback.py as a basic command-line interface to bring Commotion up and down). Future versions of this code will allow for full command-line control of the Commotion software stack via one unified binary.

##PRE-REQUISITES
1. Confirm that you have a wireless adapter whose driver supports both the cfg80211 kernel interface and ibss mode. A list of drivers that support these features can be found at http://wireless.kernel.org/en/users/Drivers.
2. Ensure that you are running an up-to-date OS and kernel. Where possible, download and install the newest kernel your OS supports (optimally 3.5 or higher). Many wireless drivers are embedded in the kernel, and some of these have only recently gotten full cfg80211 support.
3. If you are running an OS that uses a version of wpasupplicant older than v. 1.0, you will either need to recompile wpasupplicant for your platform with support for IBSS\_RSN, or install the commotion-wpasupplicant package. If you opt to use commotion-wpasupplicant, your system will only be able connect in "fallback" mode, which entirely bypasses network manager.

##INSTALLATION
----------
If you are using Debian, Ubuntu, Mint, or any other Debian-derivative, you can
install Commotion by downloading all .deb packages located at
https://downloads.commotionwireless.net/linux, and installing them with:

sudo dpkg -i \*.deb

If you encounter any dependency errors during this process, simply run:

apt-get install -f

to resolve the problems, and then run the original dpkg command once again.

##USAGE
###Step 1
Define a new mesh network profile or modify the default profile in `/etc/commotion/profiles.d/`. You can define as many different network profiles as you wish, one per file. .profile files consist of simple parameter=value pairs, one per line. The default `commotionwireless.net.profile` file installed by the commotion-mesh-applet package shows all available parameters:

```
ssid=commotionwireless.net
#Network name (REQUIRED)
bssid=02:CA:FF:EE:BA:BE
#IBSS cell ID, which takes the form of a fake mac address. If this field is omitted, it will be automatically generated via an md4 hash of the ssid and channel.
channel=5
#2.4 GHz Channel (REQUIRED)
ip=5.0.0.0
#When ipgenerate=true, ip holds the base address from which the actual ip will be generated. When ipgenerate=false, ip holds the actual ip that will be used for the connection (REQUIRED)
ipgenerate=true
#See note for ip parameter. ipgenerate is automatically set to false once a permanent ip has been generated (REQUIRED)
netmask=255.0.0.0
#The subnet mask of the network (REQUIRED)
dns=8.8.8.8
#DNS server (REQUIRED)
psk=meshpassword
#The password required to connect to an IBSS-RSN encrypted mesh network. When connecting to a network with an encrypted backhaul, this parameter is required. When connecting to a networking without encryption, the parameter should be omitted entirely.
```

###Step 2
Once you have either modified the default profile or installed a new one, you will need to force the various Commotion helper applets to reparse the profiles.d directory, like so:
* **commotion-mesh-applet:** Restart commotion-mesh-applet either by logging out of your current user session and logging in again, or exiting the applet and then running it directly from the command line: `/usr/bin/gnome-applets/commotion-mesh-applet`.
* **nm-dispatcher-olsrd:** Have network manager connect or disconnect to a network - but *NOT* the mesh network you're trying to connect to. This will force the dispatcher script to run, which will pull the updates to the `profiles.d` directory into the appropriate connection files in `/etc/NetworkManager/system-connections/`. You can can confirm that the new Commotion settings have been accepted by looking at the appropriate network profile in the nm-applet interface, and/or the contents of `/etc/NetworkManager/system-connections/<connectionname>`

###Step 3
Click on the mesh profile you wish to connect to in the list of networks shown by commotion-mesh-applet. If your system is capable of using the "network manager" connection path, Network Manager will activate the specified connection, and nm-applet will display an ad-hoc icon once you are connected. If your system relies on the "fallback" connection path, Network Manager will be put to sleep when the mesh network is activated, and will remain so until the mesh connection is deactivated. In the fallback case, all networking mechanics are handled directly by wpasupplicant and calls to ifconfig.

###Step 4
When you wish to restore normal networking functionality, click <Disconnect> in commotion-mesh-applet.

##TROUBLESHOOTING NOTES
* Logging for all commotion modules is handled by syslog, with each message prefixed by the module that generated it (ie, `nm-dispatcher-olsrd.log`).
* Hence, a useful command to run while trying to connect to a mesh might be: *tail -f `/var/log/syslog` | grep -e commotion -e nm-dispatcher*
* Some additional function failure information may be dumped to standard out by commotion-mesh-applet, so if you're having trouble connecting you should close the applet and restart it from a command line, so that you can see its output.
* If you are using the "network manager" connection path, you might want to launch and keep *wpa_cli* open while you're trying to connect. This will allow you to see whether or not the Linux client is able to successfully complete the authentication handshake with the rest of the network.
* When connecting to encrypted mesh networks, you want to see output that says "Key negotiation completed with <MAC address>" immediately after you connect. In the fallback case, this output should be dumped to stdout by commotion-mesh-applet. In the "network manager" connection process, this output should be shown by *wpa_cli*.
* Some drivers much more likely to properly connect to a mesh after being unloaded from and then reloaded into the kernel. Weirdly, this also applies to olsrd: If everything else seems to be working, but olsrd refuses to get routes, try unloading/reloading the driver, and reconnecting.
* iwconfig and iw both lie horribly about data such as active channel and authentication status. Don't necessarily believe what they tell you.

##BUGS
----
If you encounter any problems or wish to request features, please add them to
our issue tracker:

https://github.com/opentechinstitute/nm-dispatcher-olsrd

##BUILDING
--------
If you are on a non-Debian-derivitive GNU/Linux distro, then you'll need to
install this manually. We are looking for contributions of packaging to make
this easy for people to do.

Check the `debian/control` file for a list of standard libraries that are
required. Here are the other libraries needed:

* https://github.com/opentechinstitute/commotion-linux-py
* https://pypi.python.org/pypi/python-networkmanager

This project relies heavily on the NetworkManager 0.9.x dbus API, currently
via the python-networkmanager library available on pypi:

http://people.redhat.com/dcbw/NetworkManager/NetworkManager%20DBUS%20API.txt
http://projects.gnome.org/NetworkManager/developers/api/09/spec.html
##Commotion Client (UNSTABLE)

The Commotion Wireless desktop/laptop client.

To allow desktop clients to create, connect to, and configure Commotion wireless mesh networks.

This repository is in active development. **IT DOES NOT WORK!** Please look at the roadmap below to see where the project is currently at.

###FUTURE Features:

* A graphical user interface with:
* A "setup wizard" for quickly creating/connecting to a Commotion mesh.
* Mesh network advances settings configuration tools
* Commotion mesh config customizer
* Application system with:
* Mesh network application viewer
* Client application advertisement
* Multiple user accounts with:
* Seperate "Serval Keychains"
* Custom Network & Application Settings
* A status bar icon for selecting, connecting to, and disconnecting from ad-hoc networks
* A robust extension system that allows for easy customization and extension of the core platform
* Full string translation & internationalization support
* Built in accessability support

###Requirements: ( To run )

* Python 3 or higher

###Requirements: ( To build from source )

* Python 3.3 or higher
* cx_freeze (See: build/README.md for instructions)

###Current Roadmap:

* Core application
* Single application support
* Cross-application instance messaging
* Crash reporting
* With PGP encryption to the Commotion Team (planned)
* unit tests (planned)
* Main Window
* unit tests (planned)
* Menu Bar
* Automatically displays all core and user loaded extensions (planned)
* Unit Tests (planned)
* Task Bar
* unit tests (planned)
* Extension Manager
* unit tests (planned)
* Core Extensions
* Network vizualizer (planned)
* unit tests (planned)
* Commotion Config File Editor (planned)
* unit tests (planned)
* Setup Wizard (planned)
* unit tests (planned)
* User Settings [applications] (planned)
* unit tests (planned)
* User Settings [Serval & Security] (planned)
* unit tests (planned)
* Application Viewer (planned)
* unit tests (planned)
* Application Advertiser (planned)
* unit tests (planned)
* Welcome Page (planned)
* Crash Window
* unit tests (planned)
* Network Status overview (planned)
* unit tests (planned)
* Setting menu
* unit tests (planned)
* Core application settings
* unit tests (planned)
* User settings
* unit tests (planned)
* Extension settings menu
* unit tests (planned)
* Settings for any extensions with custom settings pages
* Commotion Service Manager integration
* unit tests (planned)
* CSM python bindings
* Threaded messaging to CSM (planned)
* Application viewer (planned)
* Application advertiser (planned)
* Commotion Controller
* unit tests (planned)
* Threaded messaging (planned)
* Messaging objects to pass to extensions (planned)
* Network agent interceptor [for extending commotiond functionality across platforms] (planned)
* Commotiond integration (planned)
* Control Panel settings menu
* A client agnostic control panel tool for mesh-network settings in an operating systems generic control panel. (planned)
* unit tests (planned)
* Linux Support (planned)
* Windows Support (planned LONGTERM)
* OSX Support (planned LONGTERM)
* Commotion Human Interface Guidelines compliant interface (planned)
* In-Line Documentation tranlation into developer API (planned)



46 changes: 0 additions & 46 deletions TODO

This file was deleted.