Browse Source

Kaz template for jirafeau

pull/3/head
François 2 years ago
parent
commit
d81914cb62
  1. 30
      bin/updateCloud.sh
  2. 1
      config/skip-file.txt
  3. 8
      dockers/jirafeau/Dockerfile
  4. 36
      dockers/jirafeau/build.sh
  5. 47
      dockers/jirafeau/config/config.local.php.dist
  6. 4
      dockers/jirafeau/docker-compose.yml
  7. 40
      dockers/jirafeau/first.sh
  8. BIN
      dockers/jirafeau/media/kaz/bandeau.png
  9. BIN
      dockers/jirafeau/media/kaz/email.png
  10. BIN
      dockers/jirafeau/media/kaz/error.png
  11. BIN
      dockers/jirafeau/media/kaz/favicon.ico
  12. BIN
      dockers/jirafeau/media/kaz/jyraphe.png
  13. BIN
      dockers/jirafeau/media/kaz/kaz.png
  14. BIN
      dockers/jirafeau/media/kaz/ok.png
  15. 205
      dockers/jirafeau/media/kaz/style.css.php

30
bin/updateCloud.sh

@ -41,7 +41,7 @@ esac
PHP_CONF="${CONF_DIR}/config.php"
printKazMsg "update cloud config"
update(){
addVarInConf(){
# $1 key
# $2 val
# $3 where
@ -53,22 +53,22 @@ update(){
printKazMsg "update ${CloudName}:"
echo -n " "
update "default_language" " 'default_language' => 'fr'," "CONFIG = array ("
addVarInConf "default_language" " 'default_language' => 'fr'," "CONFIG = array ("
update "theme" " 'theme' => ''," "'installed' => true,"
update "default_phone_region" " 'default_phone_region' => 'FR'," "'installed' => true,"
update "loglevel" " 'loglevel' => 2," "'installed' => true,"
update "maintenance" " 'maintenance' => false," "'installed' => true,"
update "app_install_overwrite" " 'app_install_overwrite' => \n array (\n 0 => 'documents',\n )," "'installed' => true,"
update "overwriteprotocol" " 'overwriteprotocol' => 'https'," "'installed' => true,"
addVarInConf "theme" " 'theme' => ''," "'installed' => true,"
addVarInConf "default_phone_region" " 'default_phone_region' => 'FR'," "'installed' => true,"
addVarInConf "loglevel" " 'loglevel' => 2," "'installed' => true,"
addVarInConf "maintenance" " 'maintenance' => false," "'installed' => true,"
addVarInConf "app_install_overwrite" " 'app_install_overwrite' => \n array (\n 0 => 'documents',\n )," "'installed' => true,"
addVarInConf "overwriteprotocol" " 'overwriteprotocol' => 'https'," "'installed' => true,"
update "mail_domain" " 'mail_domain' => 'kaz.bzh'," "'installed' => true,"
update "mail_from_address" " 'mail_from_address' => 'admin'," "'installed' => true,"
update "mail_smtpport" " 'mail_smtpport' => '25'," "'installed' => true,"
update "mail_sendmailmode" " 'mail_sendmailmode' => 'smtp'," "'installed' => true,"
update "mail_smtphost" " 'mail_smtphost' => 'smtp.kaz.bzh'," "'installed' => true,"
update "mail_smtpmode" " 'mail_smtpmode' => 'smtp'," "'installed' => true,"
update "enable_previews" " 'enable_previews' => false," "'installed' => true,"
addVarInConf "mail_domain" " 'mail_domain' => 'kaz.bzh'," "'installed' => true,"
addVarInConf "mail_from_address" " 'mail_from_address' => 'admin'," "'installed' => true,"
addVarInConf "mail_smtpport" " 'mail_smtpport' => '25'," "'installed' => true,"
addVarInConf "mail_sendmailmode" " 'mail_sendmailmode' => 'smtp'," "'installed' => true,"
addVarInConf "mail_smtphost" " 'mail_smtphost' => 'smtp.kaz.bzh'," "'installed' => true,"
addVarInConf "mail_smtpmode" " 'mail_smtpmode' => 'smtp'," "'installed' => true,"
addVarInConf "enable_previews" " 'enable_previews' => false," "'installed' => true,"
if ! [[ "$(docker ps -f name=${DockerServName} | grep -w ${DockerServName})" ]]; then
printKazError "DockerServName not running... abort"

1
config/skip-file.txt

@ -79,3 +79,4 @@ dockers/postfix/filter/jirafeauAPI
dockers/postfix/filter/eMailShrinker
dockers/postfix/filter/domainname
dockers/postfix/filter
dockers/jirafeau/config/config.local.php

8
dockers/jirafeau/Dockerfile

@ -38,12 +38,14 @@ RUN docker-php-ext-install zip
RUN mkdir /var/jirafeau/ /var/jirafeauData/
WORKDIR /var/jirafeau
COPY --chown=www-data git/Jirafeau/ .
COPY dockers/jirafeau/config/composer.json .
COPY --chown=www-data git/depollueur/src/Jirafeau/[aft].php ./
COPY --chown=www-data dockers/jirafeau/media/kaz media/kaz
RUN sed -i -e '1i\<p>La limite des t&eacute;l&eacute;versements est actuellement de <?php echo ini_get("post_max_size"); ?></p>' lib/template/footer.php
RUN sed -i -e '/<div id="jyraphe">/i\<div id="kaz">' lib/template/footer.php
COPY dockers/jirafeau/config/composer.json .
RUN /usr/local/bin/composer-setup.sh
RUN php composer.phar install
#RUN php composer.phar self-update
#RUN php composer.phar require phpmailer/phpmailer
RUN echo -e '\
upload_max_filesize = 1024M\n\

36
dockers/jirafeau/build.sh

@ -19,9 +19,43 @@ if [ ! -d "Jirafeau" ]; then
fi
cd "${KAZ_GIT_DIR}/Jirafeau" && git reset --hard && git checkout ${JIR_VER}
cd "${KAZ_GIT_DIR}/Jirafeau" && rsync -a ../depollueur/src/Jirafeau/[aft].php .
printKazMsg "\n - Dockefile"
cd "${KAZ_ROOT}"
# Pour permettre la copy de git il faut que le répertoire soit visible de la racine qui lance la construction
docker build -t filekaz . -f dockers/jirafeau/Dockerfile
. "${DOCKERS_ENV}"
cd "${SERV_DIR}"
CONF_FILE="config/config.local.php"
cp "${CONF_FILE}.dist" "${CONF_FILE}"
updatePhpVar(){
# $1 key
# $2 val
# $3 file
if grep -q "$1" "$3" ; then
sed -i \
-e "s%\([\"']$1[\"']\s*=>\s*\)[^,]*,%\1$2,%" \
"$3"
fi
}
updatePhpVar "web_root" "'${httpProto}://${fileHost}.${domain}/'" "${CONF_FILE}"
updatePhpVar "var_root" "'${jirafeauDir}'" "${CONF_FILE}"
updatePhpVar "style" "'kaz'" "${CONF_FILE}"
updatePhpVar "organisation" "'KAZ'" "${CONF_FILE}"
updatePhpVar "admin_password" "'$(echo -n "${HTTPD_PASSWORD}" | sha256sum | awk '{print $1}')'" "${CONF_FILE}"
updatePhpVar "installation_done" "true" "${CONF_FILE}"
# 'web_root' => 'https://depot.kaz.local/',
# 'var_root' => '/var/jirafeauData/lkuDM16R5Sp4QHr/',
# 'lang' => 'auto',
# 'style' => 'kaz',
# 'organisation' => 'ACME',
# 'admin_password' => 'b5b6bc0196ba130c9c1d7eae9312f1d743dafe793348181653720fa12713e126',
# 'installation_done' => false,

47
dockers/jirafeau/config/config.local.php.dist

@ -0,0 +1,47 @@
<?php
/* This file was generated by the install process. You can edit it. Please see config.original.php to understand the configuration items. */
$cfg = array (
'web_root' => 'XXX',
'var_root' => 'XXX',
'lang' => 'auto',
'style' => 'XXX',
'organisation' => 'XXX',
'contactperson' => '',
'title' => '',
'preview' => true,
'enable_crypt' => false,
'link_name_length' => 8,
'upload_password' =>
array (
),
'upload_ip' =>
array (
),
'upload_ip_nopassword' =>
array (
),
'admin_password' => 'XXX',
'admin_http_auth_user' => '',
'availabilities' =>
array (
'minute' => true,
'hour' => true,
'day' => true,
'week' => true,
'month' => true,
'quarter' => false,
'year' => false,
'none' => false,
),
'availability_default' => 'month',
'one_time_download' => true,
'maximal_upload_size' => 0,
'proxy_ip' =>
array (
),
'file_hash' => 'md5',
'litespeed_workaround' => false,
'store_uploader_ip' => true,
'installation_done' => false /* force first Kaz install*/,
'debug' => false,
);

4
dockers/jirafeau/docker-compose.yml

@ -21,13 +21,13 @@ services:
volumes:
- ./config/jirafeau.conf:/etc/apache2/sites-available/000-default.conf
- fileData:${jirafeauDir}
- fileConfig:/var/jirafeau/lib
- ./config/config.local.php:/var/jirafeau/lib/config.local.php
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
volumes:
fileData:
fileConfig:
config:
networks:
jirafeauNet:

40
dockers/jirafeau/first.sh

@ -10,24 +10,26 @@ cd $(dirname $0)
. "${DOCKERS_ENV}"
. "${KAZ_KEY_DIR}/env-${jirafeauServName}"
if ! [[ "$(docker ps -f name=${jirafeauServName} | grep -w ${jirafeauServName})" ]]; then
printKazError "Jirafeau not running... abort"
exit
fi
if ! grep -q "'installation_done'\s*=>\s*true" "${DOCK_LIB}/volumes/jirafeau_fileConfig/_data/config.local.php" 2>/dev/null ; then
printKazMsg "\n *** Premier lancement de Jirafeau"
CONF_FILE="${DOCK_LIB}/volumes/jirafeau_config/_data/config.local.php"
curl -X POST \
-d "jirafeau=${JIR_VER}" \
-d "step=1" \
-d "admin_password=${HTTPD_PASSWORD}" \
-d "next=1" \
"${httpProto}://${fileHost}.${domain}/install.php"
curl -X POST -d "jirafeau=${JIR_VER}" \
-d "step=2" \
-d "web_root=${httpProto}://${fileHost}.${domain}/" \
-d "var_root=${jirafeauDir}" \
-d "next=1" \
"${httpProto}://${fileHost}.${domain}/install.php"
if grep -q "'installation_done'\s*=>\s*true" "${CONF_FILE}" 2>/dev/null ; then
exit;
fi
printKazMsg "\n *** Premier lancement de Jirafeau"
# if ! [[ "$(docker ps -f name=${jirafeauServName} | grep -w ${jirafeauServName})" ]]; then
# printKazError "Jirafeau not running... abort"
# exit
# fi
# curl -X POST \
# -d "jirafeau=${JIR_VER}" \
# -d "step=1" \
# -d "admin_password=${HTTPD_PASSWORD}" \
# -d "next=1" \
# "${httpProto}://${fileHost}.${domain}/install.php"
# curl -X POST -d "jirafeau=${JIR_VER}" \
# -d "step=2" \
# -d "web_root=${httpProto}://${fileHost}.${domain}/" \
# -d "var_root=${jirafeauDir}" \
# -d "next=1" \
# "${httpProto}://${fileHost}.${domain}/install.php"

BIN
dockers/jirafeau/media/kaz/bandeau.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

BIN
dockers/jirafeau/media/kaz/email.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 596 B

BIN
dockers/jirafeau/media/kaz/error.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 525 B

BIN
dockers/jirafeau/media/kaz/favicon.ico

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
dockers/jirafeau/media/kaz/jyraphe.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
dockers/jirafeau/media/kaz/kaz.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

BIN
dockers/jirafeau/media/kaz/ok.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 492 B

205
dockers/jirafeau/media/kaz/style.css.php

@ -0,0 +1,205 @@
<?php
/*
* Jyraphe, your web file repository
* Copyright (C) 2008 Julien "axolotl" BERNARD <axolotl@magieeternelle.org>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/*
* This stylesheet is the default stylesheet for Jyraphe.
* The content is dynamically generated for easier handling.
*/
$dark = '#8B4513';
header('Content-type: text/css');
?>
body {
font-family: sans-serif;
text-align: center;
margin: 2ex auto;
background: white;
/* border: <?php echo $dark; ?> 5px solid; */
}
fieldset {
text-align: left;
width: 40em;
margin: auto;
background: #E2f5ff;
border: 2px solid #02233f;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
border-radius: 10px;
}
fieldset legend {
color: white;
background: #02233f;
border: 2px solid #02233f;
padding: 1px 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
}
h1 {
width: 100%;
text-align: center;
background: url('bandeau.png') left top repeat-x;
height: 70px;
padding-top: 30px;
}
h1 a {
text-decoration: none;
color: white;
}
fieldset p {
margin-left: 25%;
}
.jyraphe_info {
font-size: small;
margin-left: 30%;
}
label {
float: left;
width: 12em;
}
input[type=text], input[type=submit], select {
color: black;
width: 15em;
border: 1px #02233f solid;
background: white;
}
input:hover {
color: white;
background: #02233f;
}
#jyraphe {
background: url('jyraphe.png') right bottom no-repeat;
position: fixed;
bottom: 0;
right: 0;
height: 100px;
width: 100px;
clear:both;
}
#kaz {
background: url('kaz.png') right bottom no-repeat;
position: fixed;
top: 0;
left: 10px;
height: 64px;
width: 64px;
clear:both;
}
#copyright {
text-align: center;
}
.error, .message {
width: 50em;
margin: 5ex auto;
}
.error {
padding-bottom: 1ex;
border: red 2px solid;
background-color: #FBB;
}
.error p:before {
content: url('error.png');
padding-right: 1ex;
}
.message {
padding: 1ex;
border: green 2px solid;
background-color: #BFB;
}
.message p:before {
content: url('ok.png');
padding-right: 1ex;
}
.info {
text-align: left;
width: 40em;
margin: auto;
background: #E2f5ff;
border: 2px solid #02233f;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
border-radius: 10px;
}
.info h2 {
text-align: center;
}
.info h3 {
text-align: center;
}
.info p {
margin-left: 5%;
margin-right: 5%;
}
#upload {}
#uploading {
text-align: center;
width: 30em;
background: #E2f5ff;
border: 2px solid #02233f;
margin: auto;
}
#upload_finished {
text-align: center;
width: 60em;
background: #E2f5ff;
border: 2px solid #02233f;
margin: auto;
}
#self_destruct {
font-weight: bold;
color: red;
}
#upload_link_email {
margin-left: 10px;
}
#upload_image_email {
padding-left: 20px;
padding-bottom: 15px;
background: url(email.png) no-repeat;
}
Loading…
Cancel
Save