Rename LBCAlert to Cheky, upgrade to v3.8.1 and security fix

This commit is contained in:
Jérémy MANSON 2018-03-16 15:50:17 +01:00
parent a38a83fea2
commit 5e999aa833
5 changed files with 25 additions and 23 deletions

View File

@ -30,4 +30,6 @@ location YNH_WWW_PATH {
# Include SSOWAT user panel.
include conf.d/yunohost_panel.conf.inc;
}
# Very important security restriction
location /Cheky/var { deny all;}

View File

@ -1,12 +1,12 @@
{
"name": "LBCAlerte",
"id": "LBCAlerte",
"name": "Cheky",
"id": "Cheky",
"packaging_format": 1,
"description": {
"en": "LBCAlerte package for YunoHost.",
"fr": "Application LBCAlerte pour YunoHost."
"en": "Cheky package for YunoHost.",
"fr": "Application Cheky pour YunoHost."
},
"url": "https://alerte.ilatumi.org/",
"url": "https://www.cheky.net/",
"license": "free",
"maintainer": {
"name": "JimboJoe",
@ -28,8 +28,8 @@
"name": "domain",
"type": "domain",
"ask": {
"en": "Choose a domain name for LBCAlerte",
"fr": "Choisissez un nom de domaine pour LBCAlerte"
"en": "Choose a domain name for Cheky",
"fr": "Choisissez un nom de domaine pour Cheky"
},
"example": "example.com"
},
@ -37,11 +37,11 @@
"name": "path",
"type": "path",
"ask": {
"en": "Choose a path for LBCAlerte",
"fr": "Choisissez un chemin pour LBCAlerte"
"en": "Choose a path for Cheky",
"fr": "Choisissez un chemin pour Cheky"
},
"example": "/LBCAlerte",
"default": "/LBCAlerte"
"example": "/Cheky",
"default": "/Cheky"
},
{
"name": "password",

View File

@ -22,15 +22,15 @@ sudo yunohost app checkurl "${domain}${path}" -a "$app" \
|| ynh_die "Path not available: ${domain}${path}"
# Download sources
sudo wget -q https://github.com/Blount/LBCAlerte/archive/3.3.zip -O LBCAlerte.zip
sudo wget -q https://github.com/Blount/Cheky/archive/3.8.1.zip -O Cheky.zip
# Uncompress
sudo unzip -qq LBCAlerte.zip -d ..
sudo unzip -qq Cheky.zip -d ..
# Copy source files
src_path=/var/www/$app
sudo mkdir -p $src_path/var
sudo cp -a ../LBCAlerte*/. $src_path
sudo cp -a ../Cheky*/. $src_path
# Set permissions to app files
sudo chown -R www-data: $src_path
@ -60,9 +60,9 @@ ynh_app_setting_set "$app" unprotected_uris "/"
sudo yunohost app ssowatconf
# Configure LBCAlerte via curl
# Configure Cheky via curl
sleep 2
curl --resolve $domain:443:127.0.0.1 -kL -X POST https://$domain$path/index.php?mod=install --data "password=$password&confirmPassword=$password&type=db&db[host]=localhost&db[user]=$dbuser&db[password]=$dbpass&db[dbname]=$dbname" > /tmp/LBCAlerte-install.log 2>&1
curl --resolve $domain:443:127.0.0.1 -kL -X POST https://$domain$path/index.php?mod=install --data "password=$password&confirmPassword=$password&type=db&db[host]=localhost&db[user]=$dbuser&db[password]=$dbpass&db[dbname]=$dbname" > /tmp/Cheky-install.log 2>&1
#protect URIs if private
if [ $is_public -eq 0 ];
@ -73,6 +73,6 @@ fi
# Add cron job
cron_path="/etc/cron.d/$app"
sed -i "s@#DESTDIR#@${src_path}@g" ../conf/LBCAlerte.cron
sudo cp ../conf/LBCAlerte.cron "$cron_path"
sudo chmod 644 "$cron_path"
sed -i "s@#DESTDIR#@${src_path}@g" ../conf/Cheky.cron
sudo cp ../conf/Cheky.cron "$cron_path"
sudo chmod 644 "$cron_path"

View File

@ -20,15 +20,15 @@ language=$(ynh_app_setting_get "$app" language)
path=${path%/}
# Download sources
sudo wget -q https://github.com/Blount/LBCAlerte/archive/3.3.zip -O LBCAlerte.zip
sudo wget -q https://github.com/Blount/Cheky/archive/3.3.zip -O Cheky.zip
# Uncompress
sudo unzip -qq LBCAlerte.zip -d ..
sudo unzip -qq Cheky.zip -d ..
# Copy source files
src_path=/var/www/$app
sudo mkdir -p $src_path
sudo cp -a ../LBCAlerte*/. $src_path
sudo cp -a ../Cheky*/. $src_path
# Set permissions to app files
# you may need to make some file and/or directory writeable by www-data (nginx user)