aboutsummaryrefslogtreecommitdiff
path: root/virtual/packages
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2019-01-09 12:36:23 +0100
committerIsmaël Bouya <ismael.bouya@normalesup.org>2019-01-09 12:36:23 +0100
commitd9998b44feff669636822b694b9a9327e3ecc925 (patch)
treeb39b144d0b51bc52dcafe2d8f330a68a9ef0bbc7 /virtual/packages
parent1635a4ae886314be343c9699f40b5a7c7d32fe32 (diff)
downloadNix-d9998b44feff669636822b694b9a9327e3ecc925.tar.gz
Nix-d9998b44feff669636822b694b9a9327e3ecc925.tar.zst
Nix-d9998b44feff669636822b694b9a9327e3ecc925.zip
Add davical
Diffstat (limited to 'virtual/packages')
-rw-r--r--virtual/packages/davical.nix163
-rw-r--r--virtual/packages/davical_19eb79ebf9250e5f339675319902458c40ed1755.patch26
-rw-r--r--virtual/packages/infcloud_config.js2
-rw-r--r--virtual/packages/test_goaccess.conf99
4 files changed, 289 insertions, 1 deletions
diff --git a/virtual/packages/davical.nix b/virtual/packages/davical.nix
new file mode 100644
index 0000000..f539ba6
--- /dev/null
+++ b/virtual/packages/davical.nix
@@ -0,0 +1,163 @@
1{ stdenv, fetchurl, gettext, writeText, checkEnv }:
2let
3 awl = stdenv.mkDerivation rec {
4 version = "0.59";
5 name = "awl-${version}";
6 src = fetchurl {
7 url = "https://www.davical.org/downloads/awl_${version}.orig.tar.xz";
8 sha256 = "01b7km7ga3ggbpp8axkc55nizgk5c35fl2z93iydb3hwbxmsvnjp";
9 };
10 unpackCmd = ''
11 tar --one-top-level -xf $curSrc
12 '';
13 installPhase = ''
14 mkdir -p $out
15 cp -ra dba docs inc scripts tests $out
16 '';
17 };
18 # FIXME: e-mail sending
19 davical = rec {
20 config =
21 assert checkEnv "NIXOPS_DAVICAL_DB_PASSWORD";
22 assert checkEnv "NIXOPS_DAVICAL_LDAP_PASSWORD";
23 writeText "davical_config.php" ''
24 <?php
25 $c->pg_connect[] = "dbname=davical user=davical_app host=db-1.immae.eu password=${builtins.getEnv "NIXOPS_DAVICAL_DB_PASSWORD"}";
26
27 $c->readonly_webdav_collections = false;
28
29 $c->admin_email ='davical@immae.eu';
30
31 $c->restrict_setup_to_admin = true;
32
33 $c->collections_always_exist = false;
34
35 $c->external_refresh = 60;
36
37 $c->enable_scheduling = true;
38
39 $c->iMIP = (object) array("send_email" => true);
40
41 $c->authenticate_hook['optional'] = false;
42 $c->authenticate_hook['call'] = 'LDAP_check';
43 $c->authenticate_hook['config'] = array(
44 'host' => 'ldap.immae.eu',
45 'port' => '389',
46 'startTLS' => 'yes',
47 'bindDN'=> 'cn=davical,ou=services,dc=immae,dc=eu',
48 'passDN'=> '${builtins.getEnv "NIXOPS_DAVICAL_LDAP_PASSWORD"}',
49 'protocolVersion' => '3',
50 'baseDNUsers'=> array('ou=users,dc=immae,dc=eu', 'ou=group_users,dc=immae,dc=eu'),
51 'filterUsers' => 'memberOf=cn=users,cn=davical,ou=services,dc=immae,dc=eu',
52 'baseDNGroups' => 'ou=groups,dc=immae,dc=eu',
53 'filterGroups' => 'memberOf=cn=groups,cn=davical,ou=services,dc=immae,dc=eu',
54 'mapping_field' => array(
55 "username" => "uid",
56 "fullname" => "cn",
57 "email" => "mail",
58 "modified" => "modifyTimestamp",
59 ),
60 'format_updated'=> array('Y' => array(0,4),'m' => array(4,2),'d'=> array(6,2),'H' => array(8,2),'M'=>array(10,2),'S' => array(12,2)),
61 /** used to set default value for all users, will be overcharged by ldap if defined also in mapping_field **/
62 // 'default_value' => array("date_format_type" => "E","locale" => "fr_FR"),
63 'group_mapping_field' => array(
64 "username" => "cn",
65 "updated" => "modifyTimestamp",
66 "fullname" => "givenName",
67 "displayname" => "givenName",
68 "members" => "memberUid",
69 "email" => "mail",
70 ),
71 );
72
73 $c->do_not_sync_from_ldap = array('admin' => true);
74 include('drivers_ldap.php');
75 '';
76 webapp = stdenv.mkDerivation rec {
77 version = "1.1.7";
78 name = "davical-${version}";
79 src = fetchurl {
80 url = "https://www.davical.org/downloads/davical_${version}.orig.tar.xz";
81 sha256 = "1ar5m2dxr92b204wkdi8z33ir9vz2jbh5k1p74icpv9ywifvjjp9";
82 };
83 unpackCmd = ''
84 tar --one-top-level -xf $curSrc
85 '';
86 makeFlags = "all";
87 patches = [ ./davical_19eb79ebf9250e5f339675319902458c40ed1755.patch ];
88 installPhase = ''
89 mkdir -p $out
90 cp -ra config dba docs htdocs inc locale po scripts testing zonedb $out
91 ln -s ${config} $out/config/config.php
92 '';
93 buildInputs = [ gettext ];
94 };
95 webRoot = "${webapp}/htdocs";
96 apache = {
97 user = "wwwrun";
98 group = "wwwrun";
99 vhostConf = ''
100 Alias /davical "${webRoot}"
101 Alias /caldav.php "${webRoot}/caldav.php"
102 <Directory "${webRoot}">
103 DirectoryIndex index.php index.html
104 AcceptPathInfo On
105 AllowOverride None
106 Require all granted
107
108 <FilesMatch "\.php$">
109 CGIPassAuth on
110 SetHandler "proxy:unix:${phpFpm.socket}|fcgi://localhost"
111 </FilesMatch>
112
113 RewriteEngine On
114 <IfModule mod_headers.c>
115 Header unset Access-Control-Allow-Origin
116 Header unset Access-Control-Allow-Methods
117 Header unset Access-Control-Allow-Headers
118 Header unset Access-Control-Allow-Credentials
119 Header unset Access-Control-Expose-Headers
120
121 Header always set Access-Control-Allow-Origin "*"
122 Header always set Access-Control-Allow-Methods "GET,POST,OPTIONS,PROPFIND,PROPPATCH,REPORT,PUT,MOVE,DELETE,LOCK,UNLOCK"
123 Header always set Access-Control-Allow-Headers "User-Agent,Authorization,Content-type,Depth,If-match,If-None-Match,Lock-Token,Timeout,Destination,Overwrite,Prefer,X-client,X-Requested-With"
124 Header always set Access-Control-Allow-Credentials false
125 Header always set Access-Control-Expose-Headers "Etag,Preference-Applied"
126
127 RewriteCond %{HTTP:Access-Control-Request-Method} !^$
128 RewriteCond %{REQUEST_METHOD} OPTIONS
129 RewriteRule ^(.*)$ $1 [R=200,L]
130 </IfModule>
131 </Directory>
132 '';
133 };
134 phpFpm = rec {
135 basedir = builtins.concatStringsSep ":" [ webapp config awl ];
136 socket = "/var/run/phpfpm/davical.sock";
137 pool = ''
138 listen = ${socket}
139 user = ${apache.user}
140 group = ${apache.group}
141 listen.owner = ${apache.user}
142 listen.group = ${apache.group}
143 pm = dynamic
144 pm.max_children = 60
145 pm.start_servers = 2
146 pm.min_spare_servers = 1
147 pm.max_spare_servers = 10
148
149 ; Needed to avoid clashes in browser cookies (same domain)
150 php_value[session.name] = DavicalPHPSESSID
151 php_admin_value[open_basedir] = "${basedir}:/tmp"
152 php_admin_value[include_path] = "${awl}/inc:${webapp}/inc"
153 php_admin_value[session.save_path] = "/var/lib/php/sessions/davical"
154 php_flag[magic_quotes_gpc] = Off
155 php_flag[register_globals] = Off
156 php_admin_value[error_reporting] = "E_ALL & ~E_NOTICE"
157 php_admin_value[default_charset] = "utf-8"
158 php_flag[magic_quotes_runtime] = Off
159 '';
160 };
161 };
162in
163 davical
diff --git a/virtual/packages/davical_19eb79ebf9250e5f339675319902458c40ed1755.patch b/virtual/packages/davical_19eb79ebf9250e5f339675319902458c40ed1755.patch
new file mode 100644
index 0000000..2a08a5c
--- /dev/null
+++ b/virtual/packages/davical_19eb79ebf9250e5f339675319902458c40ed1755.patch
@@ -0,0 +1,26 @@
1diff --git a/inc/ui/collection-edit.php b/inc/ui/collection-edit.php
2index 3af9edd3b8c4ad9074113273175098841af6a28e..8c1d84012b035f7bc7faedcb24916581a02a5d3e 100644
3--- a/inc/ui/collection-edit.php
4+++ b/inc/ui/collection-edit.php
5@@ -190,7 +190,7 @@ $privilege_xlate = array(
6 * @param dbrow $row The row object we read from the database.
7 * @return string The formatted privileges.
8 */
9-function collection_privilege_format_function( $value, $column, $row ) {
10+function collection_privilege_format_function( $value, $column = NULL, $row = NULL ) {
11 global $privilege_xlate;
12
13 $privs = bits_to_privilege($value, 'calendar');
14diff --git a/inc/ui/principal-edit.php b/inc/ui/principal-edit.php
15index 20dee7fa4ca2235ff2f74be0dfb52cbe937ef822..2e37cd596b597bcce1e59d7c02a1c5fc2a7f88ce 100644
16--- a/inc/ui/principal-edit.php
17+++ b/inc/ui/principal-edit.php
18@@ -454,7 +454,7 @@ EOTEMPLATE;
19 * @param dbrow $row The row object we read from the database.
20 * @return string The formatted privileges.
21 */
22-function principal_privilege_format_function( $value, $column, $row ) {
23+function principal_privilege_format_function( $value, $column = NULL, $row = NULL ) {
24 global $privilege_xlate;
25
26 $privs = bits_to_privilege($value,'*');
diff --git a/virtual/packages/infcloud_config.js b/virtual/packages/infcloud_config.js
index f2182d0..ba73860 100644
--- a/virtual/packages/infcloud_config.js
+++ b/virtual/packages/infcloud_config.js
@@ -332,7 +332,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
332// port, ... (client installed into Davical "htdocs" subdirectory; 332// port, ... (client installed into Davical "htdocs" subdirectory;
333// works "out of the box", no additional setup required): 333// works "out of the box", no additional setup required):
334var globalNetworkCheckSettings={ 334var globalNetworkCheckSettings={
335 href: location.protocol+'//'+"outils.immae.eu"+ 335 href: location.protocol+'//'+location.hostname+
336 (location.port ? ':'+location.port: '')+ 336 (location.port ? ':'+location.port: '')+
337 location.pathname.replace(RegExp('/+[^/]+/*(index\.html)?$'),'')+ 337 location.pathname.replace(RegExp('/+[^/]+/*(index\.html)?$'),'')+
338 '/caldav.php/', 338 '/caldav.php/',
diff --git a/virtual/packages/test_goaccess.conf b/virtual/packages/test_goaccess.conf
new file mode 100644
index 0000000..d4f243a
--- /dev/null
+++ b/virtual/packages/test_goaccess.conf
@@ -0,0 +1,99 @@
1time-format %H:%M:%S
2date-format %d/%b/%Y
3
4#sur immae.eu
5#log-format %v %h %^[%d:%t %^] "%r" %s %b "%R" "%u" $^
6
7log-format VCOMBINED
8#= %v:%^ %h %^[%d:%t %^] "%r" %s %b "%R" "%u"
9
10html-prefs {"theme":"bright","layout":"vertical"}
11
12exclude-ip 188.165.209.148
13exclude-ip 178.33.252.96
14exclude-ip 2001:41d0:2:9c94::1
15exclude-ip 2001:41d0:2:9c94::
16exclude-ip 176.9.151.89
17exclude-ip 2a01:4f8:160:3445::
18exclude-ip 82.255.56.72
19
20no-query-string true
21
22keep-db-files true
23load-from-disk true
24db-path /var/lib/goaccess/cloud.immae.eu
25
26ignore-panel REFERRERS
27ignore-panel KEYPHRASES
28
29static-file .css
30static-file .js
31static-file .jpg
32static-file .png
33static-file .gif
34static-file .ico
35static-file .jpeg
36static-file .pdf
37static-file .csv
38static-file .mpeg
39static-file .mpg
40static-file .swf
41static-file .woff
42static-file .woff2
43static-file .xls
44static-file .xlsx
45static-file .doc
46static-file .docx
47static-file .ppt
48static-file .pptx
49static-file .txt
50static-file .zip
51static-file .ogg
52static-file .mp3
53static-file .mp4
54static-file .exe
55static-file .iso
56static-file .gz
57static-file .rar
58static-file .svg
59static-file .bmp
60static-file .tar
61static-file .tgz
62static-file .tiff
63static-file .tif
64static-file .ttf
65static-file .flv
66#static-file .less
67#static-file .ac3
68#static-file .avi
69#static-file .bz2
70#static-file .class
71#static-file .cue
72#static-file .dae
73#static-file .dat
74#static-file .dts
75#static-file .ejs
76#static-file .eot
77#static-file .eps
78#static-file .img
79#static-file .jar
80#static-file .map
81#static-file .mid
82#static-file .midi
83#static-file .ogv
84#static-file .webm
85#static-file .mkv
86#static-file .odp
87#static-file .ods
88#static-file .odt
89#static-file .otf
90#static-file .pict
91#static-file .pls
92#static-file .ps
93#static-file .qt
94#static-file .rm
95#static-file .svgz
96#static-file .wav
97#static-file .webp
98
99