Selaa lähdekoodia

Many changes and additions.

Andrew Klopper 6 vuotta sitten
vanhempi
commit
cf24199d9e
48 muutettua tiedostoa jossa 5590 lisäystä ja 12 poistoa
  1. 3 3
      base/admin/certbot.sls
  2. 1 0
      base/circusd/init.sls
  3. 6 2
      base/clients/360south/sms_feed/files/settings_local.py
  4. 7 0
      base/clients/andrew/init.sls
  5. 6 0
      base/clients/andrew/xword/files/settings_local.py
  6. 19 0
      base/clients/andrew/xword/files/xword.ini
  7. 22 0
      base/clients/andrew/xword/files/xword.nginx
  8. 80 0
      base/clients/andrew/xword/init.sls
  9. 38 0
      base/clients/billquote/billquote/files/billquote.nginx
  10. 54 0
      base/clients/billquote/billquote/init.sls
  11. 7 0
      base/clients/billquote/init.sls
  12. 7 0
      base/clients/labourpro/init.sls
  13. 4 0
      base/clients/labourpro/lplicencemanager/files/shortdate.reg
  14. 36 0
      base/clients/labourpro/lplicencemanager/files/startwine.sh
  15. 58 0
      base/clients/labourpro/lplicencemanager/init.sls
  16. 32 0
      base/clients/rgroup/bulk_api/files/appsettings.json
  17. 13 0
      base/clients/rgroup/bulk_api/files/bulk_api.ini
  18. 32 0
      base/clients/rgroup/bulk_api/files/bulk_api.nginx
  19. 49 0
      base/clients/rgroup/bulk_api/init.sls
  20. 7 0
      base/clients/rgroup/init.sls
  21. 32 0
      base/clients/rgroup/suitecrm/files/suitecrm.nginx
  22. 46 0
      base/clients/rgroup/suitecrm/init.sls
  23. 2 1
      base/consul/files/consul.service
  24. 2 0
      base/consul/init.sls
  25. 34 0
      base/docker-wine/init.sls
  26. 8 0
      base/docker/init.sls
  27. 13 0
      base/dotnetcore/init.sls
  28. 9 0
      base/dotnetcore/map.jinja
  29. 11 0
      base/firewall/global/smtp.sls
  30. 2 0
      base/firewall/public/vnc.sls
  31. 2 0
      base/generic_packages/djvulibre_bin.sls
  32. 2 0
      base/generic_packages/libmysqlclient_dev.sls
  33. 2 0
      base/generic_packages/libsm6.sls
  34. 2 0
      base/generic_packages/libxrender1.sls
  35. 11 3
      base/generic_packages/map.jinja
  36. 2 0
      base/generic_packages/python3_6.sls
  37. 2 0
      base/generic_packages/python3_6_dev.sls
  38. 2 0
      base/generic_packages/python3_dev.sls
  39. 2 0
      base/generic_packages/python_docker.sls
  40. 1 0
      base/gitea/init.sls
  41. 2031 0
      base/php5/files/php.ini
  42. 2030 0
      base/php5/files/php.ini.orig
  43. 411 0
      base/php5/files/www.conf
  44. 411 0
      base/php5/files/www.conf.orig
  45. 29 0
      base/php5/init.sls
  46. 1 1
      base/screen/files/Ubuntu-17.04/screenrc
  47. 7 0
      base/top.sls
  48. 2 2
      base/vmail/files/Ubuntu-17.04/postfix/main.cf

+ 3 - 3
base/admin/certbot.sls

@@ -20,12 +20,12 @@ include:
20 20
     - require:
21 21
       - file: /data/virtualenvs
22 22
     
23
-/root/.local/share:
23
+/opt/eff.org/certbot/venv:
24 24
   file.symlink:
25
-    - target: /data/virtualenvs
25
+    - target: /data/virtualenvs/letsencrypt
26 26
     - makedirs: True
27 27
     - require:
28
-      - file: /data/virtualenvs
28
+      - file: /data/virtualenvs/letsencrypt
29 29
 
30 30
 /etc/letsencrypt:
31 31
   file.symlink:

+ 1 - 0
base/circusd/init.sls

@@ -49,6 +49,7 @@ include:
49 49
 
50 50
 circusd:
51 51
   service.running:
52
+    - enable: True
52 53
     - require:
53 54
       - module: reload_systemd
54 55
       - file: /var/lib/circus

+ 6 - 2
base/clients/360south/sms_feed/files/settings_local.py

@@ -7,9 +7,11 @@ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
7 7
 DEBUG = False
8 8
 USE_X_FORWARDED_HOST = False
9 9
 
10
-ALLOWED_HOSTS = ['{{ settings['server_name'] }}']
10
+ALLOWED_HOSTS = ['{{ settings["server_name"] }}']
11 11
 
12
-SECRET_KEY = '{{ settings['secret_key'] }}'
12
+FORCE_HTTP_RSS_URLS = True
13
+
14
+SECRET_KEY = '{{ settings["secret_key"] }}'
13 15
 LANGUAGE_CODE = 'en-za'
14 16
 TIME_ZONE = 'Africa/Johannesburg'
15 17
 
@@ -30,3 +32,5 @@ DATABASES = {
30 32
 
31 33
 EMAIL_HOST = '{{ globals.config.mail.host }}'
32 34
 EMAIL_PORT = {{ globals.config.mail.port }}
35
+SERVER_EMAIL = '{{ settings["server_email"] }}'
36
+DEFAULT_FROM_EMAIL = '{{ settings["default_email_from"] }}'

+ 7 - 0
base/clients/andrew/init.sls

@@ -0,0 +1,7 @@
1
+include:
2
+  - clients
3
+
4
+/data/clients/andrew:
5
+  file.directory:
6
+    - require:
7
+      - file: /data/clients

+ 6 - 0
base/clients/andrew/xword/files/settings_local.py

@@ -0,0 +1,6 @@
1
+{% import 'globals.jinja' as globals -%}
2
+{% set settings = pillar['clients']['andrew']['xword'] -%}
3
+
4
+SECRET_KEY = '{{ settings.secret_key }}'
5
+
6
+ALLOWED_HOSTS = ['{{ settings.server_name }}']

+ 19 - 0
base/clients/andrew/xword/files/xword.ini

@@ -0,0 +1,19 @@
1
+[watcher:xword]
2
+cmd = /data/virtualenvs/xword/bin/chaussette --fd $(circus.sockets.xword) xword.wsgi.application
3
+working_dir = /data/clients/andrew/xword
4
+use_sockets = True
5
+numprocesses = {{ grains['num_cpus'] * 2 + 1 }}
6
+uid = www-data
7
+gid = www-data
8
+stdout_stream.class = FileStream
9
+stdout_stream.max_bytes = 1048576
10
+stdout_stream.backup_count = 7
11
+stdout_stream.filename = /var/log/circus/xword.log
12
+stderr_stream.class = FileStream
13
+stderr_stream.max_bytes = 1048576
14
+stderr_stream.backup_count = 7
15
+stderr_stream.filename = /var/log/circus/xword_err.log
16
+
17
+[socket:xword]
18
+host = 127.0.0.1
19
+port = {{ settings.listen_port }}

+ 22 - 0
base/clients/andrew/xword/files/xword.nginx

@@ -0,0 +1,22 @@
1
+server {
2
+	listen 80;
3
+	server_name {{ settings.server_name }};
4
+
5
+	include /etc/nginx/include/certbot.conf;
6
+
7
+	client_max_body_size 8M;
8
+
9
+	location /static/ {
10
+	    alias /data/clients/andrew/xword/static/;
11
+	    expires 30d;
12
+	    autoindex off;
13
+	}
14
+
15
+	location / {
16
+	    # The trailing '/' is important as it causes nginx to send the
17
+	    # cleaned URI through to the destination service (double slashes
18
+	    # removed, etc.).
19
+	    proxy_pass          http://127.0.0.1:{{ settings.listen_port }}/;
20
+	    include		/etc/nginx/include/proxy.conf;
21
+	}
22
+}

+ 80 - 0
base/clients/andrew/xword/init.sls

@@ -0,0 +1,80 @@
1
+{% import 'globals.jinja' as globals %}
2
+{% import 'circusd/lib.jinja' as circusd %}
3
+{% set settings = pillar['clients']['andrew']['xword'] %}
4
+
5
+include:
6
+  - clients.andrew
7
+  - generic_packages.python3_6
8
+  - generic_packages.libsm6
9
+  - generic_packages.libxrender1
10
+
11
+/etc/nginx/sites-enabled/xword:
12
+  file.managed:
13
+    - source: salt://clients/andrew/xword/files/xword.nginx
14
+    - template: jinja
15
+    - context:
16
+        settings: {{ settings }}
17
+    - require:
18
+      - file: nginx_conf
19
+    - watch_in:
20
+      - service: nginx
21
+
22
+/data/clients/andrew/xword:
23
+  file.directory:
24
+    - require:
25
+      - file: /data/clients/andrew
26
+
27
+/data/clients/andrew/xword/static:
28
+  file.directory:
29
+    - require:
30
+      - file: /data/clients/andrew/xword
31
+      - git: xword
32
+
33
+xword:
34
+  git.latest:
35
+    - name: git@git.codefans.co.za:andrew/xword.git
36
+    - target: /data/clients/andrew/xword
37
+    - rev: {{ settings.rev }}
38
+    - identity: {{ globals.config.git.identity_file }}
39
+    - require:
40
+      - file: /data/clients/andrew/xword
41
+  {{ circusd.circusd_watcher_running() }}
42
+
43
+{{ circusd.circusd_watcher_configuration(
44
+     'xword',
45
+     'salt://clients/andrew/xword/files/xword.ini',
46
+     {'settings': settings},
47
+     [],
48
+     [
49
+        'git: xword',
50
+        'file: xword_config',
51
+        'virtualenv: /data/virtualenvs/xword',
52
+     ]
53
+) }}
54
+
55
+/data/virtualenvs/xword:
56
+  virtualenv.managed:
57
+    - python: /usr/bin/python3.6
58
+    - requirements: /data/clients/andrew/xword/requirements.txt
59
+    - require:
60
+      - pkg: python3_6
61
+      - file: /data/virtualenvs
62
+      - git: xword
63
+
64
+xword_config:
65
+  file.managed:
66
+    - name: /data/clients/andrew/xword/xword/settings_local.py
67
+    - source: salt://clients/andrew/xword/files/settings_local.py
68
+    - template: jinja
69
+    - require:
70
+      - git: xword
71
+
72
+xword_collectstatic:
73
+  cmd.run:
74
+    - name: /data/virtualenvs/xword/bin/python3 /data/clients/andrew/xword/manage.py collectstatic --noinput --verbosity 0 --clear --link
75
+    - require:
76
+      - file: /data/clients/andrew/xword/static
77
+    - onchanges:
78
+      - virtualenv: /data/virtualenvs/xword
79
+      - git: xword
80
+      - file: xword_config

+ 38 - 0
base/clients/billquote/billquote/files/billquote.nginx

@@ -0,0 +1,38 @@
1
+server {
2
+	listen 80;
3
+	server_name {{ settings.server_name }};
4
+
5
+	include /etc/nginx/include/certbot.conf;
6
+
7
+	root /home/billquote/billquote/htdocs;
8
+	index index.php;
9
+
10
+	location / {
11
+		try_files $uri $uri/ =404;
12
+	}
13
+
14
+	location /bill_pages/ {
15
+	    alias /home/billquote/billquote/bill_pages/;
16
+	    expires 30d;
17
+	    autoindex off;
18
+	}
19
+
20
+	location ~ \.php$ {
21
+		include snippets/fastcgi-php.conf;
22
+		fastcgi_pass unix:/run/php/php5.6-fpm.sock;
23
+	}
24
+
25
+	location ~ /\.ht {
26
+		deny all;
27
+	}
28
+}
29
+
30
+#server {
31
+#	listen 443 ssl;
32
+#	server_name {{ settings.server_name }};
33
+#
34
+#	include /etc/nginx/include/ssl.conf;
35
+#
36
+#	ssl_certificate /etc/nginx/ssl.d/{{ settings.server_name }}/fullchain.pem;
37
+#	ssl_certificate_key /etc/nginx/ssl.d/{{ settings.server_name }}/privkey.pem;
38
+#}

+ 54 - 0
base/clients/billquote/billquote/init.sls

@@ -0,0 +1,54 @@
1
+{% set settings = pillar['clients']['billquote']['billquote'] %}
2
+{% from 'lib.jinja' import user_present %}
3
+
4
+include:
5
+  - clients.billquote
6
+  - mariadb.server
7
+  - php5
8
+
9
+{{ user_present('billquote', pillar['users']['accounts']['billquote']) }}
10
+
11
+/etc/nginx/sites-enabled/billquote:
12
+  file.managed:
13
+    - source: salt://clients/billquote/billquote/files/billquote.nginx
14
+    - template: jinja
15
+    - context:
16
+        settings: {{ settings }}
17
+    - require:
18
+      - file: nginx_conf
19
+    - watch_in:
20
+      - service: nginx
21
+
22
+/home/billquote/billquote:
23
+  file.directory:
24
+    - user: billquote
25
+    - group: billquote
26
+    - require:
27
+      - user: billquote
28
+
29
+{% for dir in ['bill_pages', 'htdocs', 'mysql_data', 'protected'] %}
30
+/home/billquote/billquote/{{ dir }}:
31
+  file.directory:
32
+    - user: billquote
33
+    - group: billquote
34
+    - require:
35
+      - file: /home/billquote/billquote
36
+{% endfor %}
37
+
38
+/home/billquote/billquote/htdocs/assets:
39
+  file.directory:
40
+    - user: billquote
41
+    - group: www-data
42
+    - mode: 775
43
+    - require:
44
+      - file: /home/billquote/billquote/htdocs
45
+      - user: billquote
46
+
47
+/home/billquote/billquote/protected/runtime:
48
+  file.directory:
49
+    - user: billquote
50
+    - group: www-data
51
+    - mode: 775
52
+    - require:
53
+      - file: /home/billquote/billquote/protected
54
+      - user: billquote

+ 7 - 0
base/clients/billquote/init.sls

@@ -0,0 +1,7 @@
1
+include:
2
+  - clients
3
+
4
+/data/clients/billquote:
5
+  file.directory:
6
+    - require:
7
+      - file: /data/clients

+ 7 - 0
base/clients/labourpro/init.sls

@@ -0,0 +1,7 @@
1
+include:
2
+  - clients
3
+
4
+/data/clients/labourpro:
5
+  file.directory:
6
+    - require:
7
+      - file: /data/clients

+ 4 - 0
base/clients/labourpro/lplicencemanager/files/shortdate.reg

@@ -0,0 +1,4 @@
1
+REGEDIT4
2
+
3
+[HKEY_CURRENT_USER\Control Panel\International]
4
+"sShortDate"="yyyy/MM/dd"

+ 36 - 0
base/clients/labourpro/lplicencemanager/files/startwine.sh

@@ -0,0 +1,36 @@
1
+#!/bin/sh
2
+
3
+export DISPLAY=:0
4
+wname="LPLicenceManager"
5
+
6
+su -c "chown winer -R /home/winer" root
7
+
8
+if [ -f ~/configured1 ]
9
+then
10
+    echo "[$wname]: Using previous configuration."
11
+else
12
+    echo "[$wname]: First run configuration."
13
+    mkdir ~/.vnc
14
+    echo "{{ settings.vnc_password }}" | vncpasswd -f > ~/.vnc/passwd
15
+    winetricks -q settings windowmanagerdecorated=n windowmanagermanaged=n
16
+    touch ~/configured1
17
+fi
18
+while :
19
+do
20
+    echo "[$wname]: Starting."
21
+    Xvfb -screen 0 800x600x16 &
22
+    sleep 2
23
+    x0vncserver -display $DISPLAY -passwordfile ~/.vnc/passwd -rfbport 5900 &
24
+    if [ -f ~/configured2 ]
25
+    then
26
+        echo "[$wname]: Not changing registry."
27
+    else
28
+        echo "[$wname]: Updating registry."
29
+    	wine regedit.exe /s 'c:\shortdate.reg'
30
+    	touch ~/configured2
31
+    fi
32
+    wine 'c:\Data\LPLicenceManager\LPLicenceManager.exe'
33
+    killall x0vncserver
34
+    killall xvfb
35
+done
36
+echo "[$wname]: Exiting."

+ 58 - 0
base/clients/labourpro/lplicencemanager/init.sls

@@ -0,0 +1,58 @@
1
+{% set settings = pillar['clients']['labourpro']['lplicencemanager'] %}
2
+
3
+include:
4
+  - docker
5
+  - clients.labourpro
6
+
7
+/data/clients/labourpro/lplicencemanager:
8
+  file.directory:
9
+    - require:
10
+      - file: /data/clients/labourpro
11
+
12
+/data/clients/labourpro/lplicencemanager/startwine.sh:
13
+  file.managed:
14
+    - source: salt://clients/labourpro/lplicencemanager/files/startwine.sh
15
+    - template: jinja
16
+    - mode: 755
17
+    - context:
18
+        settings: {{ settings }}
19
+    - require:
20
+      - file: /data/clients/labourpro/lplicencemanager
21
+
22
+/data/clients/labourpro/lplicencemanager/winer/.wine/drive_c/shortdate.reg:
23
+  file.managed:
24
+    - source: salt://clients/labourpro/lplicencemanager/files/shortdate.reg
25
+    - makedirs: True
26
+    - require:
27
+      - file: /data/clients/labourpro/lplicencemanager
28
+
29
+/data/clients/labourpro/lplicencemanager/winer/.wine/drive_c/Data/LPLicenceManager:
30
+  file.directory:
31
+    - makedirs: True
32
+    - require:
33
+      - file: /data/clients/labourpro/lplicencemanager
34
+
35
+/data/clients/labourpro/lplicencemanager/LPLicenceManager:
36
+  file.symlink:
37
+    - target: /data/clients/labourpro/lplicencemanager/winer/.wine/drive_c/Data/LPLicenceManager
38
+    - require:
39
+      - file: /data/clients/labourpro/lplicencemanager/winer/.wine/drive_c/Data/LPLicenceManager
40
+
41
+lplicencemanager:
42
+  docker_image.present:
43
+    - name: boggart/docker-wine-vnc
44
+    - require:
45
+      - pkg: docker
46
+  docker_container.running:
47
+    - image: boggart/docker-wine-vnc
48
+    - detach: True
49
+    - port_bindings:
50
+      - 4430:4430
51
+      - 5900:5900
52
+    - binds:
53
+      - /data/clients/labourpro/lplicencemanager/startwine.sh:/usr/local/bin/startwine.sh:ro
54
+      - /data/clients/labourpro/lplicencemanager/winer:/home/winer
55
+    - require:
56
+      - file: /data/clients/labourpro/lplicencemanager/startwine.sh
57
+      - file: /data/clients/labourpro/lplicencemanager/winer/.wine/drive_c/Data/LPLicenceManager
58
+      - docker_image: lplicencemanager

+ 32 - 0
base/clients/rgroup/bulk_api/files/appsettings.json

@@ -0,0 +1,32 @@
1
+{
2
+  "Database": {
3
+    "ConnectionString": "{{ settings.database.connection_string }}"
4
+  },
5
+  "Logging": {
6
+    "IncludeScopes": false,
7
+    "LogLevel": {
8
+      "Default": "Information"
9
+    }
10
+  },
11
+  "TokenAuthentication": {
12
+    "Audience": "{{ settings.token_authentication.audience }}",
13
+    "Issuer": "{{ settings.token_authentication.issuer }}",
14
+    "Key": "{{ settings.token_authentication.key }}",
15
+    "TokenLifetime": {{ settings.token_authentication.lifetime }}
16
+  },
17
+  "MAX": {
18
+    "Host": "{{ settings.max.host }}",
19
+    "Port": {{ settings.max.port }},
20
+    "ConnectTimeout": {{ settings.max.connect_timeout }},
21
+    "ReceiveTimeout": {{ settings.max.receive_timeout }},
22
+    "SendTimeout":  {{ settings.max.send_timeout }}
23
+  },
24
+  "DataEncryption": {
25
+    "DefaultKey": "{{ settings.data_encryption.default_key }}"
26
+  },
27
+  "SFTP": {
28
+    "Host": "{{ settings.sftp.host }}",
29
+    "Username": "{{ settings.sftp.username }}",
30
+    "Password": "{{ settings.sftp.password }}"
31
+  }
32
+}

+ 13 - 0
base/clients/rgroup/bulk_api/files/bulk_api.ini

@@ -0,0 +1,13 @@
1
+[watcher:bulk_api]
2
+cmd = /usr/bin/dotnet BulkPrintingAPI.dll
3
+working_dir = /data/clients/rgroup/bulk_api
4
+uid = www-data
5
+gid = www-data
6
+stdout_stream.class = FileStream
7
+stdout_stream.max_bytes = 1048576
8
+stdout_stream.backup_count = 7
9
+stdout_stream.filename = /var/log/circus/bulk_api.log
10
+stderr_stream.class = FileStream
11
+stderr_stream.max_bytes = 1048576
12
+stderr_stream.backup_count = 7
13
+stderr_stream.filename = /var/log/circus/bulk_api_err.log

+ 32 - 0
base/clients/rgroup/bulk_api/files/bulk_api.nginx

@@ -0,0 +1,32 @@
1
+server {
2
+	listen 80;
3
+	server_name {{ settings.server_name }};
4
+
5
+	include /etc/nginx/include/certbot.conf;
6
+
7
+	location / {
8
+	    # The trailing '/' is important as it causes nginx to send the
9
+	    # cleaned URI through to the destination service (double slashes
10
+	    # removed, etc.).
11
+	    proxy_pass          http://127.0.0.1:{{ settings.listen_port }}/;
12
+	    include		/etc/nginx/include/proxy.conf;
13
+	}
14
+}
15
+
16
+server {
17
+	listen 443 ssl;
18
+	server_name {{ settings.server_name }};
19
+
20
+	include /etc/nginx/include/ssl.conf;
21
+
22
+	ssl_certificate /etc/nginx/ssl.d/{{ settings.server_name }}/fullchain.pem;
23
+	ssl_certificate_key /etc/nginx/ssl.d/{{ settings.server_name }}/privkey.pem;
24
+
25
+	location / {
26
+	    # The trailing '/' is important as it causes nginx to send the
27
+	    # cleaned URI through to the destination service (double slashes
28
+	    # removed, etc.).
29
+	    proxy_pass          http://127.0.0.1:{{ settings.listen_port }}/;
30
+	    include		/etc/nginx/include/proxy.conf;
31
+	}
32
+}

+ 49 - 0
base/clients/rgroup/bulk_api/init.sls

@@ -0,0 +1,49 @@
1
+{% import 'globals.jinja' as globals %}
2
+{% import 'circusd/lib.jinja' as circusd %}
3
+{% from 'nginx/lib.jinja' import nginx_ssl_cert_present %}
4
+{% set settings = pillar['clients']['rgroup']['bulk_api'] %}
5
+
6
+include:
7
+  - clients.rgroup
8
+  - dotnetcore
9
+
10
+/data/clients/rgroup/bulk_api:
11
+  file.directory:
12
+    - require:
13
+      - file: /data/clients/rgroup
14
+
15
+bulk_api:
16
+  {{ circusd.circusd_watcher_running() }}
17
+
18
+{{ circusd.circusd_watcher_configuration(
19
+     'bulk_api',
20
+     'salt://clients/rgroup/bulk_api/files/bulk_api.ini',
21
+     {'settings': settings},
22
+     [],
23
+     [
24
+        'file: bulk_api_config',
25
+     ]
26
+) }}
27
+
28
+bulk_api_config:
29
+  file.managed:
30
+    - name: /data/clients/rgroup/bulk_api/appsettings.json
31
+    - source: salt://clients/rgroup/bulk_api/files/appsettings.json
32
+    - template: jinja
33
+    - context:
34
+        settings: {{ settings }}
35
+    - require:
36
+      - file: /data/clients/rgroup/bulk_api
37
+
38
+/etc/nginx/sites-enabled/bulk_api:
39
+  file.managed:
40
+    - source: salt://clients/rgroup/bulk_api/files/bulk_api.nginx
41
+    - template: jinja
42
+    - context:
43
+        settings: {{ settings }}
44
+    - require:
45
+      - file: nginx_conf
46
+    - watch_in:
47
+      - service: nginx
48
+
49
+{{ nginx_ssl_cert_present(settings.server_name) }}

+ 7 - 0
base/clients/rgroup/init.sls

@@ -0,0 +1,7 @@
1
+include:
2
+  - clients
3
+
4
+/data/clients/rgroup:
5
+  file.directory:
6
+    - require:
7
+      - file: /data/clients

+ 32 - 0
base/clients/rgroup/suitecrm/files/suitecrm.nginx

@@ -0,0 +1,32 @@
1
+server {
2
+	listen 80;
3
+	server_name {{ settings.server_name }};
4
+
5
+	include /etc/nginx/include/certbot.conf;
6
+}
7
+
8
+server {
9
+	listen 443 ssl;
10
+	server_name {{ settings.server_name }};
11
+
12
+	include /etc/nginx/include/ssl.conf;
13
+
14
+	ssl_certificate /etc/nginx/ssl.d/{{ settings.server_name }}/fullchain.pem;
15
+	ssl_certificate_key /etc/nginx/ssl.d/{{ settings.server_name }}/privkey.pem;
16
+
17
+	root /data/clients/rgroup/SuiteCRM-7.9.7;
18
+	index index.php;
19
+
20
+	location / {
21
+		try_files $uri $uri/ =404;
22
+	}
23
+
24
+	location ~ \.php$ {
25
+		include snippets/fastcgi-php.conf;
26
+		fastcgi_pass unix:/run/php/php5.6-fpm.sock;
27
+	}
28
+
29
+	location ~ /\.ht {
30
+		deny all;
31
+	}
32
+}

+ 46 - 0
base/clients/rgroup/suitecrm/init.sls

@@ -0,0 +1,46 @@
1
+{% from 'nginx/lib.jinja' import nginx_ssl_cert_present %}
2
+{% set settings = pillar['clients']['rgroup']['suitecrm'] %}
3
+
4
+include:
5
+  - clients.rgroup
6
+  - mariadb
7
+  - php5
8
+
9
+suitecrm_installed:
10
+  archive.extracted:
11
+    - name: /data/clients/rgroup
12
+    - source: salt://clients/rgroup/suitecrm/files/vendor/SuiteCRM-7.9.7.zip
13
+    - require:
14
+      - file: /data/clients/rgroup
15
+  cmd.run:
16
+    - name: chmod -R g-w,o-w /data/clients/rgroup/SuiteCRM-7.9.7
17
+    - onchanges:
18
+      - archive: suitecrm_installed
19
+
20
+{% for subdir in ['cache', 'custom', 'modules', 'themes', 'data', 'upload'] %}
21
+/data/clients/rgroup/SuiteCRM-7.9.7/{{ subdir }}:
22
+  file.directory:
23
+    - user: www-data
24
+    - recurse:
25
+      - user
26
+    - require:
27
+      - cmd: suitecrm_installed
28
+{% endfor %}
29
+
30
+/data/clients/rgroup/SuiteCRM-7.9.7/config_override.php:
31
+  file.managed:
32
+    - replace: False
33
+    - user: www-data
34
+
35
+/etc/nginx/sites-enabled/suitecrm:
36
+  file.managed:
37
+    - source: salt://clients/rgroup/suitecrm/files/suitecrm.nginx
38
+    - template: jinja
39
+    - context:
40
+        settings: {{ settings }}
41
+    - require:
42
+      - file: nginx_conf
43
+    - watch_in:
44
+      - service: nginx
45
+
46
+{{ nginx_ssl_cert_present(settings.server_name) }}

+ 2 - 1
base/consul/files/consul.service

@@ -1,3 +1,4 @@
1
+{% import 'globals.jinja' as globals -%}
1 2
 [Unit]
2 3
 Description=consul agent
3 4
 Requires=network-online.target
@@ -6,7 +7,7 @@ After=network-online.target
6 7
 [Service]
7 8
 Environment=GOMAXPROCS=2
8 9
 Restart=on-failure
9
-ExecStart=/usr/bin/consul agent -config-dir=/etc/consul -data-dir=/data/consul
10
+ExecStart=/usr/bin/consul agent -config-dir=/etc/consul -data-dir=/data/consul -advertise={{ globals.private_ip_address }}
10 11
 #ExecReload=/bin/kill -HUP $MAINPID
11 12
 KillSignal=SIGTERM
12 13
 

+ 2 - 0
base/consul/init.sls

@@ -21,6 +21,7 @@ consul:
21 21
       - group: consul
22 22
       - group: deployment-keys
23 23
   service.running:
24
+    - enable: True
24 25
     - require:
25 26
       - user: consul
26 27
       - group: consul
@@ -62,5 +63,6 @@ consul:
62 63
 /etc/systemd/system/consul.service:
63 64
   file.managed:
64 65
     - source: salt://consul/files/consul.service
66
+    - template: jinja
65 67
     - onchanges_in:
66 68
       - module: reload_systemd

+ 34 - 0
base/docker-wine/init.sls

@@ -0,0 +1,34 @@
1
+include:
2
+  - docker
3
+  - firewall.public.vnc
4
+
5
+docker-wine:
6
+  docker_image.present:
7
+    - name: suchja/wine:latest
8
+    - require:
9
+      - pkg: docker
10
+  docker_container.running:
11
+    - name: wine
12
+    - image: suchja/wine:latest
13
+    - detach: True
14
+    - entrypoint: /bin/bash
15
+    - links:
16
+      - display:xserver
17
+    - volumes_from:
18
+      - display
19
+    - require:
20
+      - docker_container: docker-x11server
21
+
22
+docker-x11server:
23
+  docker_image.present:
24
+    - name: suchja/x11server
25
+    - require:
26
+      - pkg: docker
27
+  docker_container.running:
28
+    - name: display
29
+    - image: suchja/x11server
30
+    - detach: True
31
+    - environment:
32
+      - VNC_PASSWORD: ahCeiquae0aesee1cee4
33
+    - port_bindings:
34
+      - 5900:5900

+ 8 - 0
base/docker/init.sls

@@ -0,0 +1,8 @@
1
+include:
2
+  - generic_packages.python_docker
3
+
4
+docker:
5
+  pkg.installed:
6
+    - name: docker.io
7
+    - require:
8
+      - pkg: python_docker

+ 13 - 0
base/dotnetcore/init.sls

@@ -0,0 +1,13 @@
1
+{% from 'dotnetcore/map.jinja' import dotnetcore %}
2
+
3
+dotnetcore:
4
+  pkgrepo.managed:
5
+    - name: {{ dotnetcore.repo_name }}
6
+    - file: {{ dotnetcore.repo_file }}
7
+    - keyserver: {{ dotnetcore.keyserver }}
8
+    - keyid: {{ dotnetcore.keyid }}
9
+    - clean_file: True
10
+    - require_in:
11
+      - pkg: dotnetcore
12
+  pkg.installed:
13
+    - name: {{ dotnetcore.package }}

+ 9 - 0
base/dotnetcore/map.jinja

@@ -0,0 +1,9 @@
1
+{% set dotnetcore = salt['grains.filter_by']({
2
+	'Ubuntu': {
3
+		'package': 'dotnet-sharedframework-microsoft.netcore.app-1.1.2',
4
+		'repo_name': 'deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/dotnet-release/ yakkety main',
5
+		'repo_file': '/etc/apt/sources.list.d/dotnetdev.list',
6
+		'keyserver': 'keyserver.ubuntu.com',
7
+		'keyid': '417A0893',
8
+	},
9
+}, grain='os', merge=salt['pillar.get']('dotnetcore:lookup')) %}

+ 11 - 0
base/firewall/global/smtp.sls

@@ -0,0 +1,11 @@
1
+iptables_input_smtp:
2
+  iptables.insert:
3
+    - require:
4
+      - iptables: iptables_input_localhost
5
+    - save: True
6
+    - position: 2
7
+    - table: filter
8
+    - chain: INPUT
9
+    - jump: ACCEPT
10
+    - proto: tcp
11
+    - dport: 25

+ 2 - 0
base/firewall/public/vnc.sls

@@ -0,0 +1,2 @@
1
+{% from 'firewall/public/lib.jinja' import public_tcp_port_present %}
2
+{{ public_tcp_port_present(5900) }}

+ 2 - 0
base/generic_packages/djvulibre_bin.sls

@@ -0,0 +1,2 @@
1
+{% from 'generic_packages/lib.jinja' import generic_package_installed %}
2
+{{ generic_package_installed('djvulibre_bin') }}

+ 2 - 0
base/generic_packages/libmysqlclient_dev.sls

@@ -0,0 +1,2 @@
1
+{% from 'generic_packages/lib.jinja' import generic_package_installed %}
2
+{{ generic_package_installed('libmysqlclient_dev') }}

+ 2 - 0
base/generic_packages/libsm6.sls

@@ -0,0 +1,2 @@
1
+{% from 'generic_packages/lib.jinja' import generic_package_installed %}
2
+{{ generic_package_installed('libsm6') }}

+ 2 - 0
base/generic_packages/libxrender1.sls

@@ -0,0 +1,2 @@
1
+{% from 'generic_packages/lib.jinja' import generic_package_installed %}
2
+{{ generic_package_installed('libxrender1') }}

+ 11 - 3
base/generic_packages/map.jinja

@@ -12,12 +12,20 @@
12 12
 		'zip': 'zip',
13 13
         },
14 14
 	'Ubuntu': {
15
-		'sharutils': 'sharutils',
16
-		'tcpdump': 'tcpdump',
15
+		'djvulibre_bin': 'djvulibre-bin',
17 16
 		'jq': 'jq',
18 17
 		'git': 'git',
19
-		'm2crypto': 'm2crypto',
18
+		'libmysqlclient_dev': 'libmysqlclient-dev',
19
+		'libsm6': 'libsm6',
20
+		'libxrender1': 'libxrender1',
21
+		'm2crypto': 'python-m2crypto',
20 22
 		'net_tools': 'net-tools',
23
+		'python_docker': 'python-docker',
24
+		'python3_dev': 'python3-dev',
25
+		'python3_6': 'python3.6',
26
+		'python3_6_dev': 'python3.6-dev',
27
+		'sharutils': 'sharutils',
28
+		'tcpdump': 'tcpdump',
21 29
 		'unzip': 'unzip',
22 30
 		'zip': 'zip',
23 31
 	}

+ 2 - 0
base/generic_packages/python3_6.sls

@@ -0,0 +1,2 @@
1
+{% from 'generic_packages/lib.jinja' import generic_package_installed %}
2
+{{ generic_package_installed('python3_6') }}

+ 2 - 0
base/generic_packages/python3_6_dev.sls

@@ -0,0 +1,2 @@
1
+{% from 'generic_packages/lib.jinja' import generic_package_installed %}
2
+{{ generic_package_installed('python3_6_dev') }}

+ 2 - 0
base/generic_packages/python3_dev.sls

@@ -0,0 +1,2 @@
1
+{% from 'generic_packages/lib.jinja' import generic_package_installed %}
2
+{{ generic_package_installed('python3_dev') }}

+ 2 - 0
base/generic_packages/python_docker.sls

@@ -0,0 +1,2 @@
1
+{% from 'generic_packages/lib.jinja' import generic_package_installed %}
2
+{{ generic_package_installed('python_docker') }}

+ 1 - 0
base/gitea/init.sls

@@ -15,6 +15,7 @@ gitea:
15 15
     - source: salt://gitea/files/vendor/1.1.2.linux-amd64/gitea
16 16
     - mode: 555
17 17
   service.running:
18
+    - enable: True
18 19
     - watch:
19 20
       - file: gitea
20 21
       - file: /etc/systemd/system/gitea.service

File diff suppressed because it is too large
+ 2031 - 0
base/php5/files/php.ini


File diff suppressed because it is too large
+ 2030 - 0
base/php5/files/php.ini.orig


+ 411 - 0
base/php5/files/www.conf

@@ -0,0 +1,411 @@
1
+; Start a new pool named 'www'.
2
+; the variable $pool can we used in any directive and will be replaced by the
3
+; pool name ('www' here)
4
+[www]
5
+
6
+; Per pool prefix
7
+; It only applies on the following directives:
8
+; - 'access.log'
9
+; - 'slowlog'
10
+; - 'listen' (unixsocket)
11
+; - 'chroot'
12
+; - 'chdir'
13
+; - 'php_values'
14
+; - 'php_admin_values'
15
+; When not set, the global prefix (or /usr) applies instead.
16
+; Note: This directive can also be relative to the global prefix.
17
+; Default Value: none
18
+;prefix = /path/to/pools/$pool
19
+
20
+; Unix user/group of processes
21
+; Note: The user is mandatory. If the group is not set, the default user's group
22
+;       will be used.
23
+user = www-data
24
+group = www-data
25
+
26
+; The address on which to accept FastCGI requests.
27
+; Valid syntaxes are:
28
+;   'ip.add.re.ss:port'    - to listen on a TCP socket to a specific IPv4 address on
29
+;                            a specific port;
30
+;   '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on
31
+;                            a specific port;
32
+;   'port'                 - to listen on a TCP socket to all IPv4 addresses on a
33
+;                            specific port;
34
+;   '[::]:port'            - to listen on a TCP socket to all addresses
35
+;                            (IPv6 and IPv4-mapped) on a specific port;
36
+;   '/path/to/unix/socket' - to listen on a unix socket.
37
+; Note: This value is mandatory.
38
+listen = /run/php/php5.6-fpm.sock
39
+
40
+; Set listen(2) backlog.
41
+; Default Value: 65535 (-1 on FreeBSD and OpenBSD)
42
+;listen.backlog = 65535
43
+
44
+; Set permissions for unix socket, if one is used. In Linux, read/write
45
+; permissions must be set in order to allow connections from a web server. Many
46
+; BSD-derived systems allow connections regardless of permissions. 
47
+; Default Values: user and group are set as the running user
48
+;                 mode is set to 0660
49
+listen.owner = nginx
50
+listen.group = nginx
51
+;listen.mode = 0660
52
+; When POSIX Access Control Lists are supported you can set them using
53
+; these options, value is a comma separated list of user/group names.
54
+; When set, listen.owner and listen.group are ignored
55
+;listen.acl_users =
56
+;listen.acl_groups =
57
+ 
58
+; List of addresses (IPv4/IPv6) of FastCGI clients which are allowed to connect.
59
+; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original
60
+; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address
61
+; must be separated by a comma. If this value is left blank, connections will be
62
+; accepted from any ip address.
63
+; Default Value: any
64
+;listen.allowed_clients = 127.0.0.1
65
+
66
+; Specify the nice(2) priority to apply to the pool processes (only if set)
67
+; The value can vary from -19 (highest priority) to 20 (lower priority)
68
+; Note: - It will only work if the FPM master process is launched as root
69
+;       - The pool processes will inherit the master process priority
70
+;         unless it specified otherwise
71
+; Default Value: no set
72
+; process.priority = -19
73
+
74
+; Choose how the process manager will control the number of child processes.
75
+; Possible Values:
76
+;   static  - a fixed number (pm.max_children) of child processes;
77
+;   dynamic - the number of child processes are set dynamically based on the
78
+;             following directives. With this process management, there will be
79
+;             always at least 1 children.
80
+;             pm.max_children      - the maximum number of children that can
81
+;                                    be alive at the same time.
82
+;             pm.start_servers     - the number of children created on startup.
83
+;             pm.min_spare_servers - the minimum number of children in 'idle'
84
+;                                    state (waiting to process). If the number
85
+;                                    of 'idle' processes is less than this
86
+;                                    number then some children will be created.
87
+;             pm.max_spare_servers - the maximum number of children in 'idle'
88
+;                                    state (waiting to process). If the number
89
+;                                    of 'idle' processes is greater than this
90
+;                                    number then some children will be killed.
91
+;  ondemand - no children are created at startup. Children will be forked when
92
+;             new requests will connect. The following parameter are used:
93
+;             pm.max_children           - the maximum number of children that
94
+;                                         can be alive at the same time.
95
+;             pm.process_idle_timeout   - The number of seconds after which
96
+;                                         an idle process will be killed.
97
+; Note: This value is mandatory.
98
+pm = dynamic
99
+
100
+; The number of child processes to be created when pm is set to 'static' and the
101
+; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'.
102
+; This value sets the limit on the number of simultaneous requests that will be
103
+; served. Equivalent to the ApacheMaxClients directive with mpm_prefork.
104
+; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP
105
+; CGI. The below defaults are based on a server without much resources. Don't
106
+; forget to tweak pm.* to fit your needs.
107
+; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand'
108
+; Note: This value is mandatory.
109
+pm.max_children = 5
110
+
111
+; The number of child processes created on startup.
112
+; Note: Used only when pm is set to 'dynamic'
113
+; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2
114
+pm.start_servers = 2
115
+
116
+; The desired minimum number of idle server processes.
117
+; Note: Used only when pm is set to 'dynamic'
118
+; Note: Mandatory when pm is set to 'dynamic'
119
+pm.min_spare_servers = 1
120
+
121
+; The desired maximum number of idle server processes.
122
+; Note: Used only when pm is set to 'dynamic'
123
+; Note: Mandatory when pm is set to 'dynamic'
124
+pm.max_spare_servers = 3
125
+
126
+; The number of seconds after which an idle process will be killed.
127
+; Note: Used only when pm is set to 'ondemand'
128
+; Default Value: 10s
129
+;pm.process_idle_timeout = 10s;
130
+ 
131
+; The number of requests each child process should execute before respawning.
132
+; This can be useful to work around memory leaks in 3rd party libraries. For
133
+; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.
134
+; Default Value: 0
135
+;pm.max_requests = 500
136
+
137
+; The URI to view the FPM status page. If this value is not set, no URI will be
138
+; recognized as a status page. It shows the following informations:
139
+;   pool                 - the name of the pool;
140
+;   process manager      - static, dynamic or ondemand;
141
+;   start time           - the date and time FPM has started;
142
+;   start since          - number of seconds since FPM has started;
143
+;   accepted conn        - the number of request accepted by the pool;
144
+;   listen queue         - the number of request in the queue of pending
145
+;                          connections (see backlog in listen(2));
146
+;   max listen queue     - the maximum number of requests in the queue
147
+;                          of pending connections since FPM has started;
148
+;   listen queue len     - the size of the socket queue of pending connections;
149
+;   idle processes       - the number of idle processes;
150
+;   active processes     - the number of active processes;
151
+;   total processes      - the number of idle + active processes;
152
+;   max active processes - the maximum number of active processes since FPM
153
+;                          has started;
154
+;   max children reached - number of times, the process limit has been reached,
155
+;                          when pm tries to start more children (works only for
156
+;                          pm 'dynamic' and 'ondemand');
157
+; Value are updated in real time.
158
+; Example output:
159
+;   pool:                 www
160
+;   process manager:      static
161
+;   start time:           01/Jul/2011:17:53:49 +0200
162
+;   start since:          62636
163
+;   accepted conn:        190460
164
+;   listen queue:         0
165
+;   max listen queue:     1
166
+;   listen queue len:     42
167
+;   idle processes:       4
168
+;   active processes:     11
169
+;   total processes:      15
170
+;   max active processes: 12
171
+;   max children reached: 0
172
+;
173
+; By default the status page output is formatted as text/plain. Passing either
174
+; 'html', 'xml' or 'json' in the query string will return the corresponding
175
+; output syntax. Example:
176
+;   http://www.foo.bar/status
177
+;   http://www.foo.bar/status?json
178
+;   http://www.foo.bar/status?html
179
+;   http://www.foo.bar/status?xml
180
+;
181
+; By default the status page only outputs short status. Passing 'full' in the
182
+; query string will also return status for each pool process.
183
+; Example: 
184
+;   http://www.foo.bar/status?full
185
+;   http://www.foo.bar/status?json&full
186
+;   http://www.foo.bar/status?html&full
187
+;   http://www.foo.bar/status?xml&full
188
+; The Full status returns for each process:
189
+;   pid                  - the PID of the process;
190
+;   state                - the state of the process (Idle, Running, ...);
191
+;   start time           - the date and time the process has started;
192
+;   start since          - the number of seconds since the process has started;
193
+;   requests             - the number of requests the process has served;
194
+;   request duration     - the duration in µs of the requests;
195
+;   request method       - the request method (GET, POST, ...);
196
+;   request URI          - the request URI with the query string;
197
+;   content length       - the content length of the request (only with POST);
198
+;   user                 - the user (PHP_AUTH_USER) (or '-' if not set);
199
+;   script               - the main script called (or '-' if not set);
200
+;   last request cpu     - the %cpu the last request consumed
201
+;                          it's always 0 if the process is not in Idle state
202
+;                          because CPU calculation is done when the request
203
+;                          processing has terminated;
204
+;   last request memory  - the max amount of memory the last request consumed
205
+;                          it's always 0 if the process is not in Idle state
206
+;                          because memory calculation is done when the request
207
+;                          processing has terminated;
208
+; If the process is in Idle state, then informations are related to the
209
+; last request the process has served. Otherwise informations are related to
210
+; the current request being served.
211
+; Example output:
212
+;   ************************
213
+;   pid:                  31330
214
+;   state:                Running
215
+;   start time:           01/Jul/2011:17:53:49 +0200
216
+;   start since:          63087
217
+;   requests:             12808
218
+;   request duration:     1250261
219
+;   request method:       GET
220
+;   request URI:          /test_mem.php?N=10000
221
+;   content length:       0
222
+;   user:                 -
223
+;   script:               /home/fat/web/docs/php/test_mem.php
224
+;   last request cpu:     0.00
225
+;   last request memory:  0
226
+;
227
+; Note: There is a real-time FPM status monitoring sample web page available
228
+;       It's available in: /usr/share/php/5.6/fpm/status.html
229
+;
230
+; Note: The value must start with a leading slash (/). The value can be
231
+;       anything, but it may not be a good idea to use the .php extension or it
232
+;       may conflict with a real PHP file.
233
+; Default Value: not set 
234
+;pm.status_path = /status
235
+ 
236
+; The ping URI to call the monitoring page of FPM. If this value is not set, no
237
+; URI will be recognized as a ping page. This could be used to test from outside
238
+; that FPM is alive and responding, or to
239
+; - create a graph of FPM availability (rrd or such);
240
+; - remove a server from a group if it is not responding (load balancing);
241
+; - trigger alerts for the operating team (24/7).
242
+; Note: The value must start with a leading slash (/). The value can be
243
+;       anything, but it may not be a good idea to use the .php extension or it
244
+;       may conflict with a real PHP file.
245
+; Default Value: not set
246
+;ping.path = /ping
247
+
248
+; This directive may be used to customize the response of a ping request. The
249
+; response is formatted as text/plain with a 200 response code.
250
+; Default Value: pong
251
+;ping.response = pong
252
+
253
+; The access log file
254
+; Default: not set
255
+;access.log = log/$pool.access.log
256
+
257
+; The access log format.
258
+; The following syntax is allowed
259
+;  %%: the '%' character
260
+;  %C: %CPU used by the request
261
+;      it can accept the following format:
262
+;      - %{user}C for user CPU only
263
+;      - %{system}C for system CPU only
264
+;      - %{total}C  for user + system CPU (default)
265
+;  %d: time taken to serve the request
266
+;      it can accept the following format:
267
+;      - %{seconds}d (default)
268
+;      - %{miliseconds}d
269
+;      - %{mili}d
270
+;      - %{microseconds}d
271
+;      - %{micro}d
272
+;  %e: an environment variable (same as $_ENV or $_SERVER)
273
+;      it must be associated with embraces to specify the name of the env
274
+;      variable. Some exemples:
275
+;      - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e
276
+;      - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e
277
+;  %f: script filename
278
+;  %l: content-length of the request (for POST request only)
279
+;  %m: request method
280
+;  %M: peak of memory allocated by PHP
281
+;      it can accept the following format:
282
+;      - %{bytes}M (default)
283
+;      - %{kilobytes}M
284
+;      - %{kilo}M
285
+;      - %{megabytes}M
286
+;      - %{mega}M
287
+;  %n: pool name
288
+;  %o: output header
289
+;      it must be associated with embraces to specify the name of the header:
290
+;      - %{Content-Type}o
291
+;      - %{X-Powered-By}o
292
+;      - %{Transfert-Encoding}o
293
+;      - ....
294
+;  %p: PID of the child that serviced the request
295
+;  %P: PID of the parent of the child that serviced the request
296
+;  %q: the query string 
297
+;  %Q: the '?' character if query string exists
298
+;  %r: the request URI (without the query string, see %q and %Q)
299
+;  %R: remote IP address
300
+;  %s: status (response code)
301
+;  %t: server time the request was received
302
+;      it can accept a strftime(3) format:
303
+;      %d/%b/%Y:%H:%M:%S %z (default)
304
+;  %T: time the log has been written (the request has finished)
305
+;      it can accept a strftime(3) format:
306
+;      %d/%b/%Y:%H:%M:%S %z (default)
307
+;  %u: remote user
308
+;
309
+; Default: "%R - %u %t \"%m %r\" %s"
310
+;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%"
311
+ 
312
+; The log file for slow requests
313
+; Default Value: not set
314
+; Note: slowlog is mandatory if request_slowlog_timeout is set
315
+;slowlog = log/$pool.log.slow
316
+ 
317
+; The timeout for serving a single request after which a PHP backtrace will be
318
+; dumped to the 'slowlog' file. A value of '0s' means 'off'.
319
+; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
320
+; Default Value: 0
321
+;request_slowlog_timeout = 0
322
+ 
323
+; The timeout for serving a single request after which the worker process will
324
+; be killed. This option should be used when the 'max_execution_time' ini option
325
+; does not stop script execution for some reason. A value of '0' means 'off'.
326
+; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
327
+; Default Value: 0
328
+;request_terminate_timeout = 0
329
+ 
330
+; Set open file descriptor rlimit.
331
+; Default Value: system defined value
332
+;rlimit_files = 1024
333
+ 
334
+; Set max core size rlimit.
335
+; Possible Values: 'unlimited' or an integer greater or equal to 0
336
+; Default Value: system defined value
337
+;rlimit_core = 0
338
+ 
339
+; Chroot to this directory at the start. This value must be defined as an
340
+; absolute path. When this value is not set, chroot is not used.
341
+; Note: you can prefix with '$prefix' to chroot to the pool prefix or one
342
+; of its subdirectories. If the pool prefix is not set, the global prefix
343
+; will be used instead.
344
+; Note: chrooting is a great security feature and should be used whenever 
345
+;       possible. However, all PHP paths will be relative to the chroot
346
+;       (error_log, sessions.save_path, ...).
347
+; Default Value: not set
348
+;chroot = 
349
+ 
350
+; Chdir to this directory at the start.
351
+; Note: relative path can be used.
352
+; Default Value: current directory or / when chroot
353
+;chdir = /var/www
354
+ 
355
+; Redirect worker stdout and stderr into main error log. If not set, stdout and
356
+; stderr will be redirected to /dev/null according to FastCGI specs.
357
+; Note: on highloaded environement, this can cause some delay in the page
358
+; process time (several ms).
359
+; Default Value: no
360
+;catch_workers_output = yes
361
+
362
+; Clear environment in FPM workers
363
+; Prevents arbitrary environment variables from reaching FPM worker processes
364
+; by clearing the environment in workers before env vars specified in this
365
+; pool configuration are added.
366
+; Setting to "no" will make all environment variables available to PHP code
367
+; via getenv(), $_ENV and $_SERVER.
368
+; Default Value: yes
369
+;clear_env = no
370
+
371
+; Limits the extensions of the main script FPM will allow to parse. This can
372
+; prevent configuration mistakes on the web server side. You should only limit
373
+; FPM to .php extensions to prevent malicious users to use other extensions to
374
+; exectute php code.
375
+; Note: set an empty value to allow all extensions.
376
+; Default Value: .php
377
+;security.limit_extensions = .php .php3 .php4 .php5
378
+ 
379
+; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from
380
+; the current environment.
381
+; Default Value: clean env
382
+;env[HOSTNAME] = $HOSTNAME
383
+;env[PATH] = /usr/local/bin:/usr/bin:/bin
384
+;env[TMP] = /tmp
385
+;env[TMPDIR] = /tmp
386
+;env[TEMP] = /tmp
387
+
388
+; Additional php.ini defines, specific to this pool of workers. These settings
389
+; overwrite the values previously defined in the php.ini. The directives are the
390
+; same as the PHP SAPI:
391
+;   php_value/php_flag             - you can set classic ini defines which can
392
+;                                    be overwritten from PHP call 'ini_set'. 
393
+;   php_admin_value/php_admin_flag - these directives won't be overwritten by
394
+;                                     PHP call 'ini_set'
395
+; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no.
396
+
397
+; Defining 'extension' will load the corresponding shared extension from
398
+; extension_dir. Defining 'disable_functions' or 'disable_classes' will not
399
+; overwrite previously defined php.ini values, but will append the new value
400
+; instead.
401
+
402
+; Note: path INI options can be relative and will be expanded with the prefix
403
+; (pool, global or /usr)
404
+
405
+; Default Value: nothing is defined by default except the values in php.ini and
406
+;                specified at startup with the -d argument
407
+;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com
408
+;php_flag[display_errors] = off
409
+;php_admin_value[error_log] = /var/log/fpm-php.www.log
410
+;php_admin_flag[log_errors] = on
411
+;php_admin_value[memory_limit] = 32M

+ 411 - 0
base/php5/files/www.conf.orig

@@ -0,0 +1,411 @@
1
+; Start a new pool named 'www'.
2
+; the variable $pool can we used in any directive and will be replaced by the
3
+; pool name ('www' here)
4
+[www]
5
+
6
+; Per pool prefix
7
+; It only applies on the following directives:
8
+; - 'access.log'
9
+; - 'slowlog'
10
+; - 'listen' (unixsocket)
11
+; - 'chroot'
12
+; - 'chdir'
13
+; - 'php_values'
14
+; - 'php_admin_values'
15
+; When not set, the global prefix (or /usr) applies instead.
16
+; Note: This directive can also be relative to the global prefix.
17
+; Default Value: none
18
+;prefix = /path/to/pools/$pool
19
+
20
+; Unix user/group of processes
21
+; Note: The user is mandatory. If the group is not set, the default user's group
22
+;       will be used.
23
+user = www-data
24
+group = www-data
25
+
26
+; The address on which to accept FastCGI requests.
27
+; Valid syntaxes are:
28
+;   'ip.add.re.ss:port'    - to listen on a TCP socket to a specific IPv4 address on
29
+;                            a specific port;
30
+;   '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on
31
+;                            a specific port;
32
+;   'port'                 - to listen on a TCP socket to all IPv4 addresses on a
33
+;                            specific port;
34
+;   '[::]:port'            - to listen on a TCP socket to all addresses
35
+;                            (IPv6 and IPv4-mapped) on a specific port;
36
+;   '/path/to/unix/socket' - to listen on a unix socket.
37
+; Note: This value is mandatory.
38
+listen = /run/php/php5.6-fpm.sock
39
+
40
+; Set listen(2) backlog.
41
+; Default Value: 65535 (-1 on FreeBSD and OpenBSD)
42
+;listen.backlog = 65535
43
+
44
+; Set permissions for unix socket, if one is used. In Linux, read/write
45
+; permissions must be set in order to allow connections from a web server. Many
46
+; BSD-derived systems allow connections regardless of permissions. 
47
+; Default Values: user and group are set as the running user
48
+;                 mode is set to 0660
49
+listen.owner = www-data
50
+listen.group = www-data
51
+;listen.mode = 0660
52
+; When POSIX Access Control Lists are supported you can set them using
53
+; these options, value is a comma separated list of user/group names.
54
+; When set, listen.owner and listen.group are ignored
55
+;listen.acl_users =
56
+;listen.acl_groups =
57
+ 
58
+; List of addresses (IPv4/IPv6) of FastCGI clients which are allowed to connect.
59
+; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original
60
+; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address
61
+; must be separated by a comma. If this value is left blank, connections will be
62
+; accepted from any ip address.
63
+; Default Value: any
64
+;listen.allowed_clients = 127.0.0.1
65
+
66
+; Specify the nice(2) priority to apply to the pool processes (only if set)
67
+; The value can vary from -19 (highest priority) to 20 (lower priority)
68
+; Note: - It will only work if the FPM master process is launched as root
69
+;       - The pool processes will inherit the master process priority
70
+;         unless it specified otherwise
71
+; Default Value: no set
72
+; process.priority = -19
73
+
74
+; Choose how the process manager will control the number of child processes.
75
+; Possible Values:
76
+;   static  - a fixed number (pm.max_children) of child processes;
77
+;   dynamic - the number of child processes are set dynamically based on the
78
+;             following directives. With this process management, there will be
79
+;             always at least 1 children.
80
+;             pm.max_children      - the maximum number of children that can
81
+;                                    be alive at the same time.
82
+;             pm.start_servers     - the number of children created on startup.
83
+;             pm.min_spare_servers - the minimum number of children in 'idle'
84
+;                                    state (waiting to process). If the number
85
+;                                    of 'idle' processes is less than this
86
+;                                    number then some children will be created.
87
+;             pm.max_spare_servers - the maximum number of children in 'idle'
88
+;                                    state (waiting to process). If the number
89
+;                                    of 'idle' processes is greater than this
90
+;                                    number then some children will be killed.
91
+;  ondemand - no children are created at startup. Children will be forked when
92
+;             new requests will connect. The following parameter are used:
93
+;             pm.max_children           - the maximum number of children that
94
+;                                         can be alive at the same time.
95
+;             pm.process_idle_timeout   - The number of seconds after which
96
+;                                         an idle process will be killed.
97
+; Note: This value is mandatory.
98
+pm = dynamic
99
+
100
+; The number of child processes to be created when pm is set to 'static' and the
101
+; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'.
102
+; This value sets the limit on the number of simultaneous requests that will be
103
+; served. Equivalent to the ApacheMaxClients directive with mpm_prefork.
104
+; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP
105
+; CGI. The below defaults are based on a server without much resources. Don't
106
+; forget to tweak pm.* to fit your needs.
107
+; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand'
108
+; Note: This value is mandatory.
109
+pm.max_children = 5
110
+
111
+; The number of child processes created on startup.
112
+; Note: Used only when pm is set to 'dynamic'
113
+; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2
114
+pm.start_servers = 2
115
+
116
+; The desired minimum number of idle server processes.
117
+; Note: Used only when pm is set to 'dynamic'
118
+; Note: Mandatory when pm is set to 'dynamic'
119
+pm.min_spare_servers = 1
120
+
121
+; The desired maximum number of idle server processes.
122
+; Note: Used only when pm is set to 'dynamic'
123
+; Note: Mandatory when pm is set to 'dynamic'
124
+pm.max_spare_servers = 3
125
+
126
+; The number of seconds after which an idle process will be killed.
127
+; Note: Used only when pm is set to 'ondemand'
128
+; Default Value: 10s
129
+;pm.process_idle_timeout = 10s;
130
+ 
131
+; The number of requests each child process should execute before respawning.
132
+; This can be useful to work around memory leaks in 3rd party libraries. For
133
+; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.
134
+; Default Value: 0
135
+;pm.max_requests = 500
136
+
137
+; The URI to view the FPM status page. If this value is not set, no URI will be
138
+; recognized as a status page. It shows the following informations:
139
+;   pool                 - the name of the pool;
140
+;   process manager      - static, dynamic or ondemand;
141
+;   start time           - the date and time FPM has started;
142
+;   start since          - number of seconds since FPM has started;
143
+;   accepted conn        - the number of request accepted by the pool;
144
+;   listen queue         - the number of request in the queue of pending
145
+;                          connections (see backlog in listen(2));
146
+;   max listen queue     - the maximum number of requests in the queue
147
+;                          of pending connections since FPM has started;
148
+;   listen queue len     - the size of the socket queue of pending connections;
149
+;   idle processes       - the number of idle processes;
150
+;   active processes     - the number of active processes;
151
+;   total processes      - the number of idle + active processes;
152
+;   max active processes - the maximum number of active processes since FPM
153
+;                          has started;
154
+;   max children reached - number of times, the process limit has been reached,
155
+;                          when pm tries to start more children (works only for
156
+;                          pm 'dynamic' and 'ondemand');
157
+; Value are updated in real time.
158
+; Example output:
159
+;   pool:                 www
160
+;   process manager:      static
161
+;   start time:           01/Jul/2011:17:53:49 +0200
162
+;   start since:          62636
163
+;   accepted conn:        190460
164
+;   listen queue:         0
165
+;   max listen queue:     1
166
+;   listen queue len:     42
167
+;   idle processes:       4
168
+;   active processes:     11
169
+;   total processes:      15
170
+;   max active processes: 12
171
+;   max children reached: 0
172
+;
173
+; By default the status page output is formatted as text/plain. Passing either
174
+; 'html', 'xml' or 'json' in the query string will return the corresponding
175
+; output syntax. Example:
176
+;   http://www.foo.bar/status
177
+;   http://www.foo.bar/status?json
178
+;   http://www.foo.bar/status?html
179
+;   http://www.foo.bar/status?xml
180
+;
181
+; By default the status page only outputs short status. Passing 'full' in the
182
+; query string will also return status for each pool process.
183
+; Example: 
184
+;   http://www.foo.bar/status?full
185
+;   http://www.foo.bar/status?json&full
186
+;   http://www.foo.bar/status?html&full
187
+;   http://www.foo.bar/status?xml&full
188
+; The Full status returns for each process:
189
+;   pid                  - the PID of the process;
190
+;   state                - the state of the process (Idle, Running, ...);
191
+;   start time           - the date and time the process has started;
192
+;   start since          - the number of seconds since the process has started;
193
+;   requests             - the number of requests the process has served;
194
+;   request duration     - the duration in µs of the requests;
195
+;   request method       - the request method (GET, POST, ...);
196
+;   request URI          - the request URI with the query string;
197
+;   content length       - the content length of the request (only with POST);
198
+;   user                 - the user (PHP_AUTH_USER) (or '-' if not set);
199
+;   script               - the main script called (or '-' if not set);
200
+;   last request cpu     - the %cpu the last request consumed
201
+;                          it's always 0 if the process is not in Idle state
202
+;                          because CPU calculation is done when the request
203
+;                          processing has terminated;
204
+;   last request memory  - the max amount of memory the last request consumed
205
+;                          it's always 0 if the process is not in Idle state
206
+;                          because memory calculation is done when the request
207
+;                          processing has terminated;
208
+; If the process is in Idle state, then informations are related to the
209
+; last request the process has served. Otherwise informations are related to
210
+; the current request being served.
211
+; Example output:
212
+;   ************************
213
+;   pid:                  31330
214
+;   state:                Running
215
+;   start time:           01/Jul/2011:17:53:49 +0200
216
+;   start since:          63087
217
+;   requests:             12808
218
+;   request duration:     1250261
219
+;   request method:       GET
220
+;   request URI:          /test_mem.php?N=10000
221
+;   content length:       0
222
+;   user:                 -
223
+;   script:               /home/fat/web/docs/php/test_mem.php
224
+;   last request cpu:     0.00
225
+;   last request memory:  0
226
+;
227
+; Note: There is a real-time FPM status monitoring sample web page available
228
+;       It's available in: /usr/share/php/5.6/fpm/status.html
229
+;
230
+; Note: The value must start with a leading slash (/). The value can be
231
+;       anything, but it may not be a good idea to use the .php extension or it
232
+;       may conflict with a real PHP file.
233
+; Default Value: not set 
234
+;pm.status_path = /status
235
+ 
236
+; The ping URI to call the monitoring page of FPM. If this value is not set, no
237
+; URI will be recognized as a ping page. This could be used to test from outside
238
+; that FPM is alive and responding, or to
239
+; - create a graph of FPM availability (rrd or such);
240
+; - remove a server from a group if it is not responding (load balancing);
241
+; - trigger alerts for the operating team (24/7).
242
+; Note: The value must start with a leading slash (/). The value can be
243
+;       anything, but it may not be a good idea to use the .php extension or it
244
+;       may conflict with a real PHP file.
245
+; Default Value: not set
246
+;ping.path = /ping
247
+
248
+; This directive may be used to customize the response of a ping request. The
249
+; response is formatted as text/plain with a 200 response code.
250
+; Default Value: pong
251
+;ping.response = pong
252
+
253
+; The access log file
254
+; Default: not set
255
+;access.log = log/$pool.access.log
256
+
257
+; The access log format.
258
+; The following syntax is allowed
259
+;  %%: the '%' character
260
+;  %C: %CPU used by the request
261
+;      it can accept the following format:
262
+;      - %{user}C for user CPU only
263
+;      - %{system}C for system CPU only
264
+;      - %{total}C  for user + system CPU (default)
265
+;  %d: time taken to serve the request
266
+;      it can accept the following format:
267
+;      - %{seconds}d (default)
268
+;      - %{miliseconds}d
269
+;      - %{mili}d
270
+;      - %{microseconds}d
271
+;      - %{micro}d
272
+;  %e: an environment variable (same as $_ENV or $_SERVER)
273
+;      it must be associated with embraces to specify the name of the env
274
+;      variable. Some exemples:
275
+;      - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e
276
+;      - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e
277
+;  %f: script filename
278
+;  %l: content-length of the request (for POST request only)
279
+;  %m: request method
280
+;  %M: peak of memory allocated by PHP
281
+;      it can accept the following format:
282
+;      - %{bytes}M (default)
283
+;      - %{kilobytes}M
284
+;      - %{kilo}M
285
+;      - %{megabytes}M
286
+;      - %{mega}M
287
+;  %n: pool name
288
+;  %o: output header
289
+;      it must be associated with embraces to specify the name of the header:
290
+;      - %{Content-Type}o
291
+;      - %{X-Powered-By}o
292
+;      - %{Transfert-Encoding}o
293
+;      - ....
294
+;  %p: PID of the child that serviced the request
295
+;  %P: PID of the parent of the child that serviced the request
296
+;  %q: the query string 
297
+;  %Q: the '?' character if query string exists
298
+;  %r: the request URI (without the query string, see %q and %Q)
299
+;  %R: remote IP address
300
+;  %s: status (response code)
301
+;  %t: server time the request was received
302
+;      it can accept a strftime(3) format:
303
+;      %d/%b/%Y:%H:%M:%S %z (default)
304
+;  %T: time the log has been written (the request has finished)
305
+;      it can accept a strftime(3) format:
306
+;      %d/%b/%Y:%H:%M:%S %z (default)
307
+;  %u: remote user
308
+;
309
+; Default: "%R - %u %t \"%m %r\" %s"
310
+;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%"
311
+ 
312
+; The log file for slow requests
313
+; Default Value: not set
314
+; Note: slowlog is mandatory if request_slowlog_timeout is set
315
+;slowlog = log/$pool.log.slow
316
+ 
317
+; The timeout for serving a single request after which a PHP backtrace will be
318
+; dumped to the 'slowlog' file. A value of '0s' means 'off'.
319
+; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
320
+; Default Value: 0
321
+;request_slowlog_timeout = 0
322
+ 
323
+; The timeout for serving a single request after which the worker process will
324
+; be killed. This option should be used when the 'max_execution_time' ini option
325
+; does not stop script execution for some reason. A value of '0' means 'off'.
326
+; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
327
+; Default Value: 0
328
+;request_terminate_timeout = 0
329
+ 
330
+; Set open file descriptor rlimit.
331
+; Default Value: system defined value
332
+;rlimit_files = 1024
333
+ 
334
+; Set max core size rlimit.
335
+; Possible Values: 'unlimited' or an integer greater or equal to 0
336
+; Default Value: system defined value
337
+;rlimit_core = 0
338
+ 
339
+; Chroot to this directory at the start. This value must be defined as an
340
+; absolute path. When this value is not set, chroot is not used.
341
+; Note: you can prefix with '$prefix' to chroot to the pool prefix or one
342
+; of its subdirectories. If the pool prefix is not set, the global prefix
343
+; will be used instead.
344
+; Note: chrooting is a great security feature and should be used whenever 
345
+;       possible. However, all PHP paths will be relative to the chroot
346
+;       (error_log, sessions.save_path, ...).
347
+; Default Value: not set
348
+;chroot = 
349
+ 
350
+; Chdir to this directory at the start.
351
+; Note: relative path can be used.
352
+; Default Value: current directory or / when chroot
353
+;chdir = /var/www
354
+ 
355
+; Redirect worker stdout and stderr into main error log. If not set, stdout and
356
+; stderr will be redirected to /dev/null according to FastCGI specs.
357
+; Note: on highloaded environement, this can cause some delay in the page
358
+; process time (several ms).
359
+; Default Value: no
360
+;catch_workers_output = yes
361
+
362
+; Clear environment in FPM workers
363
+; Prevents arbitrary environment variables from reaching FPM worker processes
364
+; by clearing the environment in workers before env vars specified in this
365
+; pool configuration are added.
366
+; Setting to "no" will make all environment variables available to PHP code
367
+; via getenv(), $_ENV and $_SERVER.
368
+; Default Value: yes
369
+;clear_env = no
370
+
371
+; Limits the extensions of the main script FPM will allow to parse. This can
372
+; prevent configuration mistakes on the web server side. You should only limit
373
+; FPM to .php extensions to prevent malicious users to use other extensions to
374
+; exectute php code.
375
+; Note: set an empty value to allow all extensions.
376
+; Default Value: .php
377
+;security.limit_extensions = .php .php3 .php4 .php5
378
+ 
379
+; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from
380
+; the current environment.
381
+; Default Value: clean env
382
+;env[HOSTNAME] = $HOSTNAME
383
+;env[PATH] = /usr/local/bin:/usr/bin:/bin
384
+;env[TMP] = /tmp
385
+;env[TMPDIR] = /tmp
386
+;env[TEMP] = /tmp
387
+
388
+; Additional php.ini defines, specific to this pool of workers. These settings
389
+; overwrite the values previously defined in the php.ini. The directives are the
390
+; same as the PHP SAPI:
391
+;   php_value/php_flag             - you can set classic ini defines which can
392
+;                                    be overwritten from PHP call 'ini_set'. 
393
+;   php_admin_value/php_admin_flag - these directives won't be overwritten by
394
+;                                     PHP call 'ini_set'
395
+; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no.
396
+
397
+; Defining 'extension' will load the corresponding shared extension from
398
+; extension_dir. Defining 'disable_functions' or 'disable_classes' will not
399
+; overwrite previously defined php.ini values, but will append the new value
400
+; instead.
401
+
402
+; Note: path INI options can be relative and will be expanded with the prefix
403
+; (pool, global or /usr)
404
+
405
+; Default Value: nothing is defined by default except the values in php.ini and
406
+;                specified at startup with the -d argument
407
+;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com
408
+;php_flag[display_errors] = off
409
+;php_admin_value[error_log] = /var/log/fpm-php.www.log
410
+;php_admin_flag[log_errors] = on
411
+;php_admin_value[memory_limit] = 32M

+ 29 - 0
base/php5/init.sls

@@ -0,0 +1,29 @@
1
+php5:
2
+  pkgrepo.managed:
3
+    - ppa: ondrej/php
4
+    - require_in:
5
+      - pkg: php5
6
+  pkg.installed:
7
+    - pkgs:
8
+      - php5.6-curl
9
+      - php5.6-fpm
10
+      - php5.6-gd
11
+      - php5.6-imap
12
+      - php5.6-mbstring
13
+      - php5.6-mysql
14
+      - php5.6-xml
15
+      - php5.6-zip
16
+  service.running:
17
+    - name: php5.6-fpm
18
+
19
+/etc/php/5.6/fpm/php.ini:
20
+  file.managed:
21
+    - source: salt://php5/files/php.ini
22
+    - watch_in:
23
+      - service: php5
24
+
25
+/etc/php/5.6/fpm/pool.d/www.conf:
26
+  file.managed:
27
+    - source: salt://php5/files/www.conf
28
+    - watch_in:
29
+      - service: php5

+ 1 - 1
base/screen/files/Ubuntu-17.04/screenrc

@@ -86,7 +86,7 @@ termcapinfo xterm 'is=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;4;6l'
86 86
 # following termcapinfo line which tells xterm to use the normal screen buffer
87 87
 # (which has scrollback), not the alternate screen buffer.
88 88
 #
89
-#termcapinfo xterm|xterms|xs|rxvt ti@:te@
89
+termcapinfo xterm|xterms|xs|rxvt ti@:te@
90 90
 
91 91
 # Enable non-blocking mode to better cope with flaky ssh connections.
92 92
 defnonblock 5

+ 7 - 0
base/top.sls

@@ -19,8 +19,15 @@ base:
19 19
   hosting1:
20 20
     - circusd
21 21
     - clients.360south.sms_feed
22
+    - clients.andrew.xword
23
+    - clients.billquote.billquote
24
+    - clients.labourpro.lplicencemanager
25
+    - clients.rgroup.bulk_api
26
+    - clients.rgroup.suitecrm
22 27
     - firewall.public.http
23 28
     - firewall.public.https
29
+    - firewall.global.smtp
30
+    - generic_packages.djvulibre_bin
24 31
     - gitea
25 32
     - gitea.deploy
26 33
     - mariadb.server

+ 2 - 2
base/vmail/files/Ubuntu-17.04/postfix/main.cf

@@ -40,11 +40,11 @@ alias_database = hash:/etc/aliases
40 40
 myorigin = /etc/mailname
41 41
 mydestination = $myhostname, {{ grains['id'] }}, localhost.localdomain, localhost
42 42
 relayhost = 
43
-mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 {{ globals.all_private_ip_addresses|join(" ") }}
43
+mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 {{ globals.all_private_ip_addresses|join(" ") }}{% if 'postfix' in globals.config and 'extra_relay_networks' in globals.config.postfix %} {{ globals.config.postfix.extra_relay_networks }}{% endif %}
44 44
 mailbox_size_limit = 0
45 45
 recipient_delimiter = +
46 46
 inet_interfaces = all
47
-inet_protocols = all
47
+inet_protocols = ipv4
48 48
 
49 49
 ## Tells Postfix to use Dovecot's LMTP instead of its own LDA to save emails to the local mailboxes.
50 50
 virtual_transport = lmtp:unix:private/dovecot-lmtp