}
class {'supervisord':
- maildirs => '/home/kite/Maildirs'
+ maildirs => '/home/kite/Maildirs/kitebox.dev/testuser', #FIXME: revert to Maildirs when multiple users are supported
+ appdir => "/home/kite/app/back/kite/",
+ require => File["/home/kite/app"]
}
# deploy files
# a class for installing and configuring a basic nginx setup
-class supervisord ($maildirs) {
+class supervisord ($maildirs, $appdir) {
$packages = ["supervisor"]
package { $packages:
file {"/etc/supervisord.conf":
owner => "root",
group => "root",
- content => template('supervisord/supervisord.conf.erb')
+ content => template('supervisord/supervisord.conf.erb'),
}
service {'supervisor':
enable => true,
hasstatus => true,
hasrestart => true,
- require => Package["supervisor"]
+ require => [Package["supervisor"], File["/etc/supervisord.conf"]]
}
}
+++ /dev/null
-server {
- listen 80;
- server_name _;
- access_log /var/log/nginx/<%= server_name %>.access.log;
- charset utf-8;
- client_max_body_size 8m;
- sendfile off; # apparently, it doesn't work so well in virtualized envs.
-
- gzip_types text/plain text/xml text/css application/javascript application/x-javascript application/json;
-
- location ^~ /kite {
- proxy_pass http://localhost:8080;
- proxy_set_header Host $host;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- }
-
- location / {
- root <%= appdir %>/front/app/;
- autoindex off;
- expires 1M;
- }
-
-
- #error_page 404 /404.html;
-
- # redirect server error pages to the static page /50x.html
- error_page 500 502 503 504 /50x.html;
- location = /50x.html {
- root /var/www/nginx-default;
- }
-}
; create one or more 'real' program: sections to be able to control them under
; supervisor.
-;[program:theprogramname]
-;command=/bin/cat ; the program (relative uses PATH, can take args)
-;process_name=%(program_name)s ; process_name expr (default %(program_name)s)
+[program:filterdaemon]
+command=<%= appdir %>/filterdaemon.py <%= maildirs %> ; the program (relative uses PATH, can take args)
+process_name=filterdaemon_sup ; process_name expr (default %(program_name)s)
+stdout_logfile=/tmp/filterdaemon.out ; stdout log path, NONE for none; default AUTO
;numprocs=1 ; number of processes copies to start (def 1)
;directory=/tmp ; directory to cwd to before exec (def no cwd)
;umask=022 ; umask for process (default None)
;exitcodes=0,2 ; 'expected' exit codes for process (default 0,2)
;stopsignal=QUIT ; signal used to kill process (default TERM)
;stopwaitsecs=10 ; max num secs to wait b4 SIGKILL (default 10)
-;user=chrism ; setuid to this UNIX account to run the program
;redirect_stderr=true ; redirect proc stderr to stdout (default false)
-;stdout_logfile=/a/path ; stdout log path, NONE for none; default AUTO
;stdout_logfile_maxbytes=1MB ; max # logfile bytes b4 rotation (default 50MB)
;stdout_logfile_backups=10 ; # of stdout logfile backups (default 10)
;stdout_capture_maxbytes=1MB ; number of bytes in 'capturemode' (default 0)
+#!/usr/bin/env python
# filterdaemon.py
# This background process creates indexes files for threads and filters.
#
if __name__ == "__main__":
path = sys.argv[1]
+ print "Watching %s..." % path
+
threads_index = JsonFile(os.path.join(path, "threads_index.json"))
if threads_index.data == None:
threads_index.data = {}