Code Monkey home page Code Monkey logo

dynette's Introduction

Setup

python3 -m venv venv
source venv/bin/activate
pip3 install -r requirements.txt

Dev

FLASK_APP=app.py flask run

Production

  • You should also install bind9
  • Include /etc/bind/named.conf.local in /etc/bind/named.conf
  • Install the following services
dynette.service
# Systemd config
[Unit]
Description=Dynette gunicorn daemon
After=network.target

[Service]
PIDFile=/run/gunicorn/dynette-pid
User=dynette
Group=dynette
WorkingDirectory=/var/www/dynette
ExecStart=/var/www/dynette/venv/bin/gunicorn -c /var/www/dynette/gunicorn.py wsgi:app
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s TERM $MAINPID
PrivateTmp=true

[Install]
WantedBy=multi-user.target
dynette-regen-named-conf.service
[Unit]
Description=Dynette named.conf regen
After=network.target
StartLimitIntervalSec=10
StartLimitBurst=5

[Service]
Type=oneshot
WorkingDirectory=/var/www/dynette
ExecStart=/var/www/dynette/venv/bin/python3 /var/www/dynette/regen_named_conf.py
User=root
Group=root

[Install]
WantedBy=multi-user.target
dynette-regen-named-conf.path
[Path]
Unit=dynette-regen-named-conf.service
PathChanged=/var/dynette/db/ 

[Install]
WantedBy=multi-user.target
NGINX conf snippet
location / {
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_redirect  off;
    proxy_pass http://unix:/var/www/dynette/sock;
    proxy_read_timeout 210s;
}

If we ever decide to add another base domain

We should initialize /var/lib/bind/BASE_DOMAIN.db (replace BASE_DOMAIN with e.g. nohost.me) with:

$ORIGIN .
$TTL 10	; 10 seconds
BASE_DOMAIN		IN SOA	ns0.yunohost.org. hostmaster.yunohost.org. (
				1006380    ; serial
				10800      ; refresh (3 hours)
				3600       ; retry (1 hour)
				604800     ; expire (1 week)
				10         ; minimum (10 seconds)
				)
$TTL 3600	; 1 hour
			NS	ns0.yunohost.org.
			NS	ns1.yunohost.org.
$ORIGIN BASE_DOMAIN.

dynette's People

Contributors

alexaubin avatar dependabot[bot] avatar oniricorpe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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.