Code Monkey home page Code Monkey logo

snominator's Introduction

SNOMINATOR
==========

A (very) simple webservice to configure your snom IP phones. Really no pretention, use it as a toy :)

Relies on mysql, but can easily be changed, thanks to sequel.

Dependencies
------------

 * sinatra
 * sequel
 * haml

Setup
-----

the database schema :

    mysql> desc md_phones;
    +-------------+--------------+------+-----+---------------------+----------------+
    | Field       | Type         | Null | Key | Default             | Extra          |
    +-------------+--------------+------+-----+---------------------+----------------+
    | id          | int(11)      | NO   | PRI | NULL                | auto_increment | 
    | mac         | varchar(20)  | NO   |     | NULL                |                | 
    | sipnumber   | int(11)      | NO   |     | NULL                |                | 
    | sippassword | varchar(20)  | YES  |     | 1234                |                | 
    | identnumber | int(11)      | YES  |     | 1                   |                | 
    | nom         | varchar(255) | YES  |     | John Doe            |                | 
    | email       | varchar(255) | NO   |     | [email protected]      |                | 
    +-------------+--------------+------+-----+---------------------+----------------+
    
    mysql> desc md_phones_keys;
    +----------------+-------------+------+-----+---------+----------------+
    | Field          | Type        | Null | Key | Default | Extra          |
    +----------------+-------------+------+-----+---------+----------------+
    | id             | int(11)     | NO   | PRI | NULL    | auto_increment |
    | sipnumber      | varchar(20) | NO   |     | NULL    |                |
    | sipdestination | varchar(20) | NO   |     | NULL    |                |
    | keynumber      | int(11)     | NO   |     | NULL    |                |
    +----------------+-------------+------+-----+---------+----------------+


Yes, it's shitty but I don't care :D


The config.yaml is easy to understand, no need to say more


Running it
----------

    $ ruby phones.rb
 
And then point to http://127.0.0.1:4567/

DHCP configuration :

If you want the automagical thing you need the ISC DHCP server (note that openbsd's server does not have the substring feature) and the following things in your dhcpd.conf :

    if substring(binary-to-ascii(16,8,":",hardware),0,9)="1:0:4:13:"
    {
        option tftp-server-name "http://provisioning.mycorp.net";
        option bootfile-name "config/{mac}";
    }

Of course it means your app is located at http://provisioning.mycorp.net


TODO
----
 * global config settings
 
This project was a introduction to sinatra/sequel/haml for me.

snominator's People

Stargazers

Blagovest Petrov avatar Nicolas Szalai avatar

Watchers

Nicolas Szalai avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.