Code By
Lucas Mouilleron

An Open Source selection

TSAnalysis

Last update : 18/09/2017 - 18:15
Private repository :(

TSMagellan

Last update : 18/09/2017 - 09:40
Private repository :(

TSSysAdmin

Last update : 15/09/2017 - 12:34
Private repository :(

TSDataCenter

Last update : 13/09/2017 - 12:30
Private repository :(

TSDataCenterWebUI

Last update : 07/09/2017 - 17:24
Private repository :(

macInstaller

Last update : 30/08/2017 - 17:35
Private repository :(

heartBeat

Last update : 25/08/2017 - 12:37

Screenshot

An implementation of heartbeat monitoring.

Definitions

  • The server is in charge of monitoring services
  • When a service is considered dead, the server then alerts its owner
  • A service is a pulsing agent
  • A pulse is a sign of aliveness
  • When a service pulse the server, it tells him when he will pulse again in the worst case
  • If the service has not pulsed again in time, the server considers the service dead and alerts its owner
  • When a service is no longer required, it must inform the server to avoid a false dead alerts
  • An Alert can be a mail, a pushover message, etc.

Implementation

  • HTTP client / server architecture
  • All queries protected by password set in HTTP headers under "password"
  • Protocol :
    • Pulse :
      • POST /
      • {"service":"SERVICE_NAME","alertType":"ALERT_TYPE","alertTarget":"TARGET_NAME","nextIn":EXPECTED_NEXT_HEARTBEAT_IN_SECS}
    • Cancel :
      • DELETE /
      • {"service":"SERVICE_NAME"}
    • List :
      • GET /

Server

  • ./server
  • python3
  • Dependencies : pip install -r requirements.txt
  • Config :
    • config/config.json : main config (cp config/sample.json config/config.json)
    • config/certificate.pem : SSL certificate, used only if SSL activated
  • Datas : data
  • Deploy :
    • Install dependencies
    • Setup config
    • Generate ssl certificates (optional)
    • Hook in with upstart (optional, ./server/config/sample.upstart.conf, http://upstart.ubuntu.com/getting-started.html)
  • Run : python server.py
  • Docker :
    • ./docker
    • Config : place server config files in ./docker/config
    • Interactive : cd docker && tools/dockerBuild && tools/dockerRun
    • Detached : cd docker && tools/dockerBuild && tools/dockerRunDetached

Java Client

  • ./clientJava
  • Java 7+
  • No dependencies
  • Run test :

Python Client

  • ./clientPython
  • python3
  • Dependencies : requests (pip install requests)
  • Run test : python test.py

Javascript client

  • ./clientJavascript
  • client.js is a node module
  • Dependencies : packages.json -> devDependencies (npm install)
  • Run test : node test.js
  • Run test in browser : browserify test.js -o bundle.js and open test.html in browser

Certificates

  • Self signed :
    • openssl genrsa -des3 -passout pass:x -out server.pass.key 2048
    • openssl rsa -passin pass:x -in server.pass.key -out server.key
    • rm server.pass.key
    • openssl req -new -key server.key -out server.csr
    • openssl x509 -req -sha256 -days 365 -in server.csr -signkey server.key -out server.crt
    • cat server.crt server.key > server.pem
  • Letsencrypt : TODO

TODO

  • Put data writing in a queue
  • Put alert sending in a queue

TSSite

Last update : 20/07/2017 - 15:36
Private repository :(

stupidCMS

Last update : 20/07/2017 - 08:15

stupidCMS is a flat file stupid CMS with nice templating and caching engines.

Screenshot

Install

  • Drop all files (including .htaccess) at the site root
  • Create the file ./config.php and override default config (cf Overridable Configuration)

Stupid Pages (SP)

  • Stupid Pages files extensions is .html
  • In Stupid Pages, paths are relative to the site root
  • To link from a page to another page, use http://site.com/other-page
  • They use the Stupid Micro Templating Engine (SMTE) allowing administrable content declaration

Stupid Micro Templating Engine (SMTE)

  • Administrable contents : {{CNT:content-name}}
  • Administrable files : <img src="{{FILE:file-name.jpg}}"/> or <a href="{{FILE:file-name.pdf}}">the file</a>
  • Include another page in a page : {{INC:page-name-without-html-extension}}
  • Definitions : {{DEF:CONSTANT_NAME}} (for example SITE_URL)
  • If : {{IF:php expression}}content{{EIF}}

Studid Dynamic Page (SDP)

  • Stupid Pages files extensions can be .php
  • In this case the page is a Stupid Dynamic Page (SDP)
  • Custom php scripting can be addded
  • <?php global $stupid;?> must be called to make the stupid engine available
  • Sutpid API available :
    • $stupid->__inc("page-name-without-html-extension")
    • $stupid->__cnt("content-name")
    • $stupid->__file("file-name")
  • No CSPC cache is applied (it is applied only for included contents)

Compiled Stupid Pages Caching (CSPC)

  • Compiled Stupid Pages are cached for performance optimization
  • The cache engine is selectable in /config.php
  • Three engines are available :
    • None cache engine : no cache, all pages and contents are loaded from original files (not recommended)
    • File cache engine : cache files are located in /__cache
    • Redis cache engine : redis port is configurable in ___stupid/libs/stupidDefinitions.php
  • In DEVELOPMENT_MODE, the cache is disabled

Stupid Backend (SB)

  • stupidCMS comes with a stupid backend
  • Open http://site.com/admin in browser
  • Content editing :
    • Add contents in pages using the SMTE format
    • Run a Scan to populate the backend interface
    • Edit and save contents
    • Tips :
      • Contents are SMTE compatible, which means you can use the SMTE tags
      • Contents can be written in Markdown format :
  • Files editing :
    • Add files in pages using the SMTE format
    • Run a Scan to populate the backend interface
    • Edit and save files
  • Pages editing :
    • All SP and SDP can be edited from the backend
    • Templates can be used for scaffholding (templates are defined in /__templates)
    • /config.php is editable as well
  • Scan :
    • If SMTE administrable content are not visible, run Scan
    • Scan contents scans for contents and files
  • Clear :
    • If new contents or files don't appear, run Clear, to clear the cache
    • In DEVELOPMENT_MODE, cache is disabled, therefore Clear is not needed
  • Clean : TODO

Overridable configuration

  • Defined in ___stupid/libs/stupidDefinitions.php
  • DEBUG_MODE (true): displays hints
  • DEVELOPMENT_MODE (false): no cache for easier development
  • ADMIN_PASSWORD ("password"): has to be changed
  • SITE_URL ("http://localhost"): has to be set to the site root url
  • PAGE_404 (false): false or the name of the 404 page (without extension)
  • NO_SCAN_FOLDERS (none): folders not to scan when finding contents and files
  • SMTE_CACHE_ENGINE ("file"): file | redis | none

Dev

  • Install composer : curl -sS https://getcomposer.org/installer | php && mv composer.phar /usr/local/bin/composer
  • Install dependencies : cd ___stupid && composer install
  • Underlying cotents in ./__contents
  • Underlying files in ./__files

TODO

  • sub folder index
  • guidlines

Naming

Menus

httpBin

Last update : 13/07/2017 - 10:13

Screenshot

HTTP Client Testing Service.

Fork of http://httpbin.org.

Install

  • pip install -r requirements.txt

Run

  • cd .
  • gunicorn -b localhost:8080 httpbin:app