destDir = "/run/keys/webapps";
user = apache.user;
group = apache.group;
- permissions = "0700";
+ permissions = "0400";
text = ''
# This file is auto-generated during the composer install
parameters:
'';
};
phpFpm = rec {
+ preStart = ''
+ if [ ! -f "${varDir}/currentWebappDir" -o \
+ ! -f "${varDir}/currentKey" -o \
+ "${webappDir}" != "$(cat ${varDir}/currentWebappDir 2>/dev/null)" ] \
+ || ! sha512sum -c --status ${varDir}/currentKey; then
+ pushd ${webappDir} > /dev/null
+ /run/wrappers/bin/sudo -u wwwrun ./bin/console --env=${environment} cache:clear --no-warmup
+ popd > /dev/null
+ echo -n "${webappDir}" > ${varDir}/currentWebappDir
+ sha512sum /run/keys/webapps/${environment}-tellesflorian > ${varDir}/currentKey
+ fi
+ '';
+ serviceDeps = [
+ "mysql.service"
+ "${environment}-tellesflorian-passwords-key.service"
+ "${environment}-tellesflorian-key.service"
+ ];
socket = "/var/run/phpfpm/floriantelles-${environment}.sock";
pool = ''
listen = ${socket}
destDir = "/run/keys/webapps";
user = apache.user;
group = apache.group;
- permissions = "0700";
+ permissions = "0400";
text = ''
invite:${config.invite_passwords}
'';
install -m 0755 -o ${apache.user} -g ${apache.group} -d ${varDir} \
${varDir}/var
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 ./bin/console --env=${environment} cache:clear --no-warmup
- popd > /dev/null
- echo -n "${webappDir}" > ${varDir}/currentWebappDir
- fi
'';
};
webappDir = composerEnv.buildPackage (