aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2019-01-24 09:56:31 +0100
committerIsmaël Bouya <ismael.bouya@normalesup.org>2019-01-24 09:56:31 +0100
commita3d281ea34a6e3c66789455c1c1edf223030a589 (patch)
tree5fb1a32e3a3395333d316473bc42fc060bd88814
parentf27f4c9de97789e1bff31e2939395a8c6c50279d (diff)
downloadNix-a3d281ea34a6e3c66789455c1c1edf223030a589.tar.gz
Nix-a3d281ea34a6e3c66789455c1c1edf223030a589.tar.zst
Nix-a3d281ea34a6e3c66789455c1c1edf223030a589.zip
Purify wallabag's website
-rw-r--r--virtual/modules/websites/commons/composer-env.nix4
-rw-r--r--virtual/modules/websites/tools/tools/wallabag.nix50
-rw-r--r--virtual/modules/websites/tools/tools/wallabag_ldap.patch199
3 files changed, 220 insertions, 33 deletions
diff --git a/virtual/modules/websites/commons/composer-env.nix b/virtual/modules/websites/commons/composer-env.nix
index 051ac6e..416a61c 100644
--- a/virtual/modules/websites/commons/composer-env.nix
+++ b/virtual/modules/websites/commons/composer-env.nix
@@ -63,6 +63,7 @@ let
63 , noDev ? false 63 , noDev ? false
64 , unpackPhase ? "true" 64 , unpackPhase ? "true"
65 , buildPhase ? "true" 65 , buildPhase ? "true"
66 , doRemoveVendor ? true
66 , ...}@args: 67 , ...}@args:
67 68
68 let 69 let
@@ -197,9 +198,10 @@ let
197 198
198 export HOME=$TMPDIR 199 export HOME=$TMPDIR
199 200
201 ${if doRemoveVendor then ''
200 # Remove the provided vendor folder if it exists 202 # Remove the provided vendor folder if it exists
201 rm -Rf vendor 203 rm -Rf vendor
202 204 '' else ""}
203 # If there is no composer.lock file, compose a dummy file. 205 # If there is no composer.lock file, compose a dummy file.
204 # Otherwise, composer attempts to download the package.json file from 206 # Otherwise, composer attempts to download the package.json file from
205 # the registry which we do not want. 207 # the registry which we do not want.
diff --git a/virtual/modules/websites/tools/tools/wallabag.nix b/virtual/modules/websites/tools/tools/wallabag.nix
index 03291dc..d742c5d 100644
--- a/virtual/modules/websites/tools/tools/wallabag.nix
+++ b/virtual/modules/websites/tools/tools/wallabag.nix
@@ -1,4 +1,4 @@
1{ stdenv, fetchurl, writeText, env, phpPackages, php, which }: 1{ stdenv, fetchurl, writeText, env, composerEnv, phpPackages, php, which }:
2let 2let
3 wallabag = rec { 3 wallabag = rec {
4 varDir = "/var/lib/wallabag"; 4 varDir = "/var/lib/wallabag";
@@ -56,8 +56,31 @@ let
56 ldap_name_attribute: cn 56 ldap_name_attribute: cn
57 ldap_enabled_attribute: null 57 ldap_enabled_attribute: null
58 ''; 58 '';
59 webappDir = stdenv.mkDerivation rec { 59 webappDir = composerEnv.buildPackage rec {
60 __noChroot = true; 60 packages = {
61 "fr3d/ldap-bundle" = {
62 targetDir = "";
63 src = composerEnv.buildZipPackage {
64 name = "fr3d-ldap-bundle-5a8927c11af45fa06331b97221c6da1a4a237475";
65 src = fetchurl {
66 url = https://api.github.com/repos/Maks3w/FR3DLdapBundle/zipball/5a8927c11af45fa06331b97221c6da1a4a237475;
67 sha256 = "168zkd82j200wd6h0a3lq81g5s2pifg889rv27q2g429nppsbfxc";
68 };
69 };
70 };
71 "zendframework/zend-ldap" = {
72 targetDir = "";
73 src = composerEnv.buildZipPackage {
74 name = "zendframework-zend-ldap-b63c7884a08d3a6bda60ebcf7d6238cf8ad89f49";
75 src = fetchurl {
76 url = https://api.github.com/repos/zendframework/zend-ldap/zipball/b63c7884a08d3a6bda60ebcf7d6238cf8ad89f49;
77 sha256 = "0mn4yqnb5prqhrbbybmw1i2rx7xf4s4wagbdq9qi55fa0vk3jgw9";
78 };
79 };
80 };
81 };
82 noDev = true;
83 doRemoveVendor = false;
61 # Beware when upgrading, I probably messed up with the migrations table 84 # Beware when upgrading, I probably messed up with the migrations table
62 # (due to a psql bug in wallabag) 85 # (due to a psql bug in wallabag)
63 version = "2.3.6"; 86 version = "2.3.6";
@@ -66,21 +89,22 @@ let
66 url = "https://static.wallabag.org/releases/wallabag-release-${version}.tar.gz"; 89 url = "https://static.wallabag.org/releases/wallabag-release-${version}.tar.gz";
67 sha256 = "0m0dy3r94ks5pfxyb9vbgrsm0vrwdl3jd5wqwg4f5vd107lq90q1"; 90 sha256 = "0m0dy3r94ks5pfxyb9vbgrsm0vrwdl3jd5wqwg4f5vd107lq90q1";
68 }; 91 };
92 unpackPhase = ''
93 unpackFile "$src"
94 sourceRoot=${version}
95 src=$PWD/${version}
96 '';
69 patches = [ ./wallabag_ldap.patch ]; 97 patches = [ ./wallabag_ldap.patch ];
70 dontBuild = "true"; 98 preInstall = ''
71 installPhase = '' 99 export SYMFONY_ENV="prod"
72 cp -a . $out 100 '';
73 cd $out 101 postInstall = ''
74 export SYMFONY_ENV=prod 102 rm -rf web/assets var/{cache,logs,sessions} app/config/parameters.yml data
75 php -d memory_limit=-1 ${phpPackages.composer}/libexec/composer/composer.phar require --update-no-dev -o --prefer-dist fr3d/ldap-bundle
76 rm -rf web/assets var/cache app/config/parameters.yml data
77 mv var var_old
78 ln -sf ${parameters} app/config/parameters.yml 103 ln -sf ${parameters} app/config/parameters.yml
79 ln -sf ../../../../../${varDir}/var var 104 ln -sf ../../../../../../${varDir}/var/{cache,logs,sessions} var
80 ln -sf ../../../../../${varDir}/data data 105 ln -sf ../../../../../${varDir}/data data
81 ln -sf ../../../../../../${varDir}/assets web/assets 106 ln -sf ../../../../../../${varDir}/assets web/assets
82 ''; 107 '';
83 buildInputs = [ php phpPackages.composer ];
84 }; 108 };
85 activationScript = '' 109 activationScript = ''
86 install -m 0755 -o ${apache.user} -g ${apache.group} -d ${varDir} \ 110 install -m 0755 -o ${apache.user} -g ${apache.group} -d ${varDir} \
diff --git a/virtual/modules/websites/tools/tools/wallabag_ldap.patch b/virtual/modules/websites/tools/tools/wallabag_ldap.patch
index 1b93b57..9caf7da 100644
--- a/virtual/modules/websites/tools/tools/wallabag_ldap.patch
+++ b/virtual/modules/websites/tools/tools/wallabag_ldap.patch
@@ -1,14 +1,8 @@
1commit 4cd6e7f3bbcff7e2a1c5a39917176d28fa02911f
2Author: Ismaël Bouya <ismael.bouya@normalesup.org>
3Date: Sat Jun 16 11:40:00 2018 +0200
4
5 Add ldap
6
7diff --git a/.travis.yml b/.travis.yml 1diff --git a/.travis.yml b/.travis.yml
8index 57b3aa53..3b7638eb 100644 2index 04cea258..56b1f576 100644
9--- a/.travis.yml 3--- a/.travis.yml
10+++ b/.travis.yml 4+++ b/.travis.yml
11@@ -54,6 +54,7 @@ branches: 5@@ -58,6 +58,7 @@ install:
12 6
13 before_script: 7 before_script:
14 - PHP=$TRAVIS_PHP_VERSION 8 - PHP=$TRAVIS_PHP_VERSION
@@ -120,7 +114,7 @@ index 6b0cb8e8..cfd41b69 100644
120+ # optional (default sets user as enabled unconditionally) 114+ # optional (default sets user as enabled unconditionally)
121+ ldap_enabled_attribute: ~ 115+ ldap_enabled_attribute: ~
122diff --git a/app/config/security.yml b/app/config/security.yml 116diff --git a/app/config/security.yml b/app/config/security.yml
123index 796dc361..59f48626 100644 117index 02afc9ea..48fbb553 100644
124--- a/app/config/security.yml 118--- a/app/config/security.yml
125+++ b/app/config/security.yml 119+++ b/app/config/security.yml
126@@ -6,6 +6,7 @@ security: 120@@ -6,6 +6,7 @@ security:
@@ -140,24 +134,191 @@ index 796dc361..59f48626 100644
140 pattern: ^/ 134 pattern: ^/
141 form_login: 135 form_login:
142diff --git a/composer.json b/composer.json 136diff --git a/composer.json b/composer.json
143index dca274ed..f115d229 100644 137index 68cfad05..32a3d1a4 100644
144--- a/composer.json 138--- a/composer.json
145+++ b/composer.json 139+++ b/composer.json
146@@ -87,6 +87,9 @@ 140@@ -85,7 +85,11 @@
141 "friendsofsymfony/jsrouting-bundle": "^1.6.3",
142 "bdunogier/guzzle-site-authenticator": "^1.0.0",
147 "defuse/php-encryption": "^2.1", 143 "defuse/php-encryption": "^2.1",
148 "html2text/html2text": "^4.1" 144- "html2text/html2text": "^4.1"
149 }, 145+ "html2text/html2text": "^4.1",
146+ "fr3d/ldap-bundle": "^3.0"
147+ },
150+ "suggest": { 148+ "suggest": {
151+ "fr3d/ldap-bundle": "If you want to authenticate via LDAP" 149+ "fr3d/ldap-bundle": "If you want to authenticate via LDAP"
152+ }, 150 },
153 "require-dev": { 151 "require-dev": {
154 "doctrine/doctrine-fixtures-bundle": "~2.2", 152 "doctrine/doctrine-fixtures-bundle": "~2.2",
155 "doctrine/data-fixtures": "~1.1", 153diff --git a/composer.lock b/composer.lock
154index 251ee081..37795e0b 100644
155--- a/composer.lock
156+++ b/composer.lock
157@@ -4,7 +4,7 @@
158 "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
159 "This file is @generated automatically"
160 ],
161- "content-hash": "d2a0bd8408dccdeb7a7455996519829b",
162+ "content-hash": "4699d166d03a8e5f70d802d0bc3e6a20",
163 "packages": [
164 {
165 "name": "bdunogier/guzzle-site-authenticator",
166@@ -1346,6 +1346,65 @@
167 ],
168 "time": "2018-12-14T19:44:53+00:00"
169 },
170+ {
171+ "name": "fr3d/ldap-bundle",
172+ "version": "v3.0.0",
173+ "source": {
174+ "type": "git",
175+ "url": "https://github.com/Maks3w/FR3DLdapBundle.git",
176+ "reference": "5a8927c11af45fa06331b97221c6da1a4a237475"
177+ },
178+ "dist": {
179+ "type": "zip",
180+ "url": "https://api.github.com/repos/Maks3w/FR3DLdapBundle/zipball/5a8927c11af45fa06331b97221c6da1a4a237475",
181+ "reference": "5a8927c11af45fa06331b97221c6da1a4a237475",
182+ "shasum": ""
183+ },
184+ "require": {
185+ "php": ">=5.5",
186+ "psr/log": "~1.0",
187+ "symfony/config": "2.3 - 3",
188+ "symfony/dependency-injection": "2.3 - 3",
189+ "symfony/polyfill-php56": "^1.1",
190+ "symfony/security": "2.3 - 3",
191+ "symfony/security-bundle": "2.3 - 3",
192+ "zendframework/zend-ldap": "2.5 - 3"
193+ },
194+ "require-dev": {
195+ "fabpot/php-cs-fixer": "1.11.*",
196+ "fr3d/psr3-message-assertions": "0.1.*",
197+ "friendsofsymfony/user-bundle": "~1.3",
198+ "maks3w/phpunit-methods-trait": "^4.6",
199+ "phpunit/phpunit": "^4.6",
200+ "symfony/validator": "2.3 - 3"
201+ },
202+ "suggest": {
203+ "friendsofsymfony/user-bundle": "Integrate authentication and management for DB users, useful for unmanned LDAP servers",
204+ "symfony/validator": "Allow pre-validate for existing users before register new ones"
205+ },
206+ "type": "symfony-bundle",
207+ "autoload": {
208+ "psr-4": {
209+ "FR3D\\LdapBundle\\": ""
210+ }
211+ },
212+ "notification-url": "https://packagist.org/downloads/",
213+ "license": [
214+ "MIT"
215+ ],
216+ "authors": [
217+ {
218+ "name": "Maks3w"
219+ }
220+ ],
221+ "description": "This package provide users and authentication services based on LDAP directories for Symfony2 framework",
222+ "homepage": "https://github.com/Maks3w/FR3DLdapBundle",
223+ "keywords": [
224+ "Authentication",
225+ "ldap"
226+ ],
227+ "time": "2016-02-12T17:45:14+00:00"
228+ },
229 {
230 "name": "friendsofsymfony/jsrouting-bundle",
231 "version": "1.6.3",
232@@ -7027,6 +7086,59 @@
233 "zf2"
234 ],
235 "time": "2018-04-25T15:33:34+00:00"
236+ },
237+ {
238+ "name": "zendframework/zend-ldap",
239+ "version": "2.10.0",
240+ "source": {
241+ "type": "git",
242+ "url": "https://github.com/zendframework/zend-ldap.git",
243+ "reference": "b63c7884a08d3a6bda60ebcf7d6238cf8ad89f49"
244+ },
245+ "dist": {
246+ "type": "zip",
247+ "url": "https://api.github.com/repos/zendframework/zend-ldap/zipball/b63c7884a08d3a6bda60ebcf7d6238cf8ad89f49",
248+ "reference": "b63c7884a08d3a6bda60ebcf7d6238cf8ad89f49",
249+ "shasum": ""
250+ },
251+ "require": {
252+ "ext-ldap": "*",
253+ "php": "^5.6 || ^7.0"
254+ },
255+ "require-dev": {
256+ "php-mock/php-mock-phpunit": "^1.1.2 || ^2.1.1",
257+ "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1.2",
258+ "zendframework/zend-coding-standard": "~1.0.0",
259+ "zendframework/zend-config": "^2.5",
260+ "zendframework/zend-eventmanager": "^2.6.3 || ^3.0.1",
261+ "zendframework/zend-stdlib": "^2.7 || ^3.0"
262+ },
263+ "suggest": {
264+ "zendframework/zend-eventmanager": "Zend\\EventManager component"
265+ },
266+ "type": "library",
267+ "extra": {
268+ "branch-alias": {
269+ "dev-master": "2.10.x-dev",
270+ "dev-develop": "2.11.x-dev"
271+ }
272+ },
273+ "autoload": {
274+ "psr-4": {
275+ "Zend\\Ldap\\": "src/"
276+ }
277+ },
278+ "notification-url": "https://packagist.org/downloads/",
279+ "license": [
280+ "BSD-3-Clause"
281+ ],
282+ "description": "Provides support for LDAP operations including but not limited to binding, searching and modifying entries in an LDAP directory",
283+ "keywords": [
284+ "ZendFramework",
285+ "ldap",
286+ "zf"
287+ ],
288+ "time": "2018-07-05T05:05:12+00:00"
289 }
290 ],
291 "packages-dev": [
292@@ -7561,12 +7673,12 @@
293 "source": {
294 "type": "git",
295 "url": "https://github.com/symfony/phpunit-bridge.git",
296- "reference": "5dab0d4b2ac99ab22b447b615fdfdc10ec4af3d5"
297+ "reference": "d61ec438634e0f234c6bda1c6ee97016bbb0e7a1"
298 },
299 "dist": {
300 "type": "zip",
301- "url": "https://api.github.com/repos/symfony/phpunit-bridge/zipball/5dab0d4b2ac99ab22b447b615fdfdc10ec4af3d5",
302- "reference": "5dab0d4b2ac99ab22b447b615fdfdc10ec4af3d5",
303+ "url": "https://api.github.com/repos/symfony/phpunit-bridge/zipball/d61ec438634e0f234c6bda1c6ee97016bbb0e7a1",
304+ "reference": "d61ec438634e0f234c6bda1c6ee97016bbb0e7a1",
305 "shasum": ""
306 },
307 "require": {
308@@ -7619,7 +7731,7 @@
309 ],
310 "description": "Symfony PHPUnit Bridge",
311 "homepage": "https://symfony.com",
312- "time": "2019-01-01T13:45:19+00:00"
313+ "time": "2019-01-16T13:27:11+00:00"
314 },
315 {
316 "name": "symfony/polyfill-php72",
156diff --git a/scripts/install.sh b/scripts/install.sh 317diff --git a/scripts/install.sh b/scripts/install.sh
157index 62a46f4f..5ea3933c 100644 318index 8b7ea03f..3a4a33ab 100755
158--- a/scripts/install.sh 319--- a/scripts/install.sh
159+++ b/scripts/install.sh 320+++ b/scripts/install.sh
160@@ -12,5 +12,8 @@ ENV=$1 321@@ -26,5 +26,8 @@ ENV=$1
161 TAG=$(git describe --tags $(git rev-list --tags --max-count=1)) 322 TAG=$(git describe --tags $(git rev-list --tags --max-count=1))
162 323
163 git checkout $TAG 324 git checkout $TAG
@@ -167,10 +328,10 @@ index 62a46f4f..5ea3933c 100644
167 SYMFONY_ENV=$ENV $COMPOSER_COMMAND install --no-dev -o --prefer-dist 328 SYMFONY_ENV=$ENV $COMPOSER_COMMAND install --no-dev -o --prefer-dist
168 php bin/console wallabag:install --env=$ENV 329 php bin/console wallabag:install --env=$ENV
169diff --git a/scripts/update.sh b/scripts/update.sh 330diff --git a/scripts/update.sh b/scripts/update.sh
170index d0598135..753ccbc3 100644 331index c62d104a..6259a431 100755
171--- a/scripts/update.sh 332--- a/scripts/update.sh
172+++ b/scripts/update.sh 333+++ b/scripts/update.sh
173@@ -18,6 +18,9 @@ git fetch origin 334@@ -32,6 +32,9 @@ git fetch origin
174 git fetch --tags 335 git fetch --tags
175 TAG=$(git describe --tags $(git rev-list --tags --max-count=1)) 336 TAG=$(git describe --tags $(git rev-list --tags --max-count=1))
176 git checkout $TAG --force 337 git checkout $TAG --force