- <Directory ${webRoot}>
- Options Indexes FollowSymLinks MultiViews Includes
- AllowOverride All
- Require all granted
- DirectoryIndex index.php
- FallbackResource /index.php
- </Directory>
- '';
- };
- activationScript = {
- deps = [ "wrappers" ];
- text = ''
- install -m 0755 -o ${apache.user} -g ${apache.group} -d ${varDir}
- install -m 0750 -o ${apache.user} -g ${apache.group} -d ${varDir}/phpSessions
- if [ ! -f "${varDir}/currentWebappDir" -o \
- "${webappDir}" != "$(cat ${varDir}/currentWebappDir 2>/dev/null)" ]; then
- pushd ${webappDir} > /dev/null
- $wrapperDir/sudo -u wwwrun APP_ENV=${environment} ./bin/console --env=${environment} cache:clear --no-warmup
- popd > /dev/null
- echo -n "${webappDir}" > ${varDir}/currentWebappDir
- fi
- '';
- };
- yarnModules = let
- info = fetchedGitPrivate ./aten.json;
- in
- yarn2nix.mkYarnModules {
- name = "aten-yarn-modules";
- packageJSON = "${info.src}/package.json";
- yarnLock = "${info.src}/yarn.lock";
- pkgConfig = {
- node-sass = {
- buildInputs = [ libsass python ];
- postInstall = let
- nodeHeaders = fetchurl {
- url = "https://nodejs.org/download/release/v${nodejs.version}/node-v${nodejs.version}-headers.tar.gz";
- sha256 = "12zzsf8my43b8qnlacp871ih5vqafl2vlpqp51xp6h3gckn2frwy";
- };
- in
- ''
- node scripts/build.js --tarball=${nodeHeaders}
- '';
- };
- };
- };
- webappDir = composerEnv.buildPackage (
- import ./php-packages.nix { inherit composerEnv fetchurl fetchgit; } //
- fetchedGitPrivate ./aten.json //
- rec {
- noDev = (environment == "prod");
- preInstall = ''
- export SYMFONY_ENV="${environment}"
- export APP_ENV="${environment}"
- export DATABASE_URL="${config.psql_url}"
- export APP_SECRET="${config.secret}"
- '';
- postInstall = ''
- cd $out
- ln -sf ${yarnModules}/node_modules .
- yarn run --offline encore production
- rm -rf var/{log,cache}
- ln -sf ../../../../../../../${varDir}/{log,cache} var/
- '';
- buildInputs = [ yarn2nix.yarn ];
- });
- webRoot = "${webappDir}/public";
+ <Location /backend>
+ Use LDAPConnect
+ Require ldap-group cn=aten.pro,cn=httpd,ou=services,dc=immae,dc=eu
+ ErrorDocument 401 "<html><meta http-equiv=\"refresh\" content=\"0;url=https://aten.pro\"></html>"
+ </Location>
+ ''}
+
+ <Directory ${root}>
+ Options Indexes FollowSymLinks MultiViews Includes
+ AllowOverride All
+ Require all granted
+ DirectoryIndex index.php
+ FallbackResource /index.php
+ </Directory>
+ '';
+ };
+ activationScript = {
+ deps = [ "wrappers" ];
+ text = ''
+ install -m 0755 -o ${apache.user} -g ${apache.group} -d ${app.varDir}
+ install -m 0750 -o ${apache.user} -g ${apache.group} -d ${app.varDir}/phpSessions
+ '';