diff --git a/conf/ethercalc b/conf/ethercalc index 5240b21..7c176ff 100644 --- a/conf/ethercalc +++ b/conf/ethercalc @@ -25,7 +25,7 @@ set -e start() { echo "Starting $DESC... " - start-stop-daemon --start --chuid "$USER:$GROUP" --chdir $EPLITE_DIR --background --make-pidfile --pidfile /var/run/$NAME.pid --startas /bin/bash -- -c "exec $EPLITE_DIR/$EPLITE_BIN --port YUNOPORT --basepath YUNOPATH > $LOGFILE 2>&1" + start-stop-daemon --start --chuid "$USER:$GROUP" --chdir $EPLITE_DIR --background --make-pidfile --pidfile /var/run/$NAME.pid --startas /bin/bash -- -c "exec $EPLITE_DIR/$EPLITE_BIN --port YUNOPORT --basepath YUNOPATH YUNOEXPIRE > $LOGFILE 2>&1" echo "done" } diff --git a/manifest.json b/manifest.json index c985155..0ac3899 100644 --- a/manifest.json +++ b/manifest.json @@ -2,7 +2,8 @@ "name": "EtherCalc", "id": "ethercalc", "description": { - "en": "online web spreadsheet editor providing collaborative editing in really real-time" + "en": "Online web spreadsheet editor providing collaborative editing in really real-time", + "fr": "Feuille de calcul collaborative en ligne" }, "developer": { "name": "zamentur", @@ -14,15 +15,19 @@ "install" : [ { "name": "domain", + "type": "domain", "ask": { - "en": "Choose a domain for EtherCalc" + "en": "Choose a domain for EtherCalc", + "fr": "Choisissez un domaine pour EterCalc" }, "example": "domain.org" }, { "name": "path", + "type": "path", "ask": { - "en": "Choose a path for EtherCalc" + "en": "Choose a path for EtherCalc", + "fr": "Choisissez un chemin pour EterCalc" }, "example": "/calc", "default": "/calc" @@ -30,10 +35,19 @@ { "name": "public_site", "ask": { - "en": "Is it a public EtherCalc ?" + "en": "Is it a public EtherCalc ?", + "fr": "Des personnes n'ayant pas de compte Yunohost peuvent elles utiliser ce EtherCalc ?" }, "choices": ["Yes", "No"], "default": "Yes" + }, + { + "name": "expire", + "ask": { + "en": "Deletes a spreadsheet's content after N days of inactivity. (0 to diasable this feature)", + "fr": "Suppression après N jours d'inactivités. (0 pour désactiver cette fonctionnalité)" + }, + "default": "0" } diff --git a/scripts/install b/scripts/install index bcc4d8e..694a7e5 100644 --- a/scripts/install +++ b/scripts/install @@ -8,6 +8,7 @@ instance_number=$(echo $app | sed 's/[^0-9]//g') domain=$1 path=$2 is_public=$3 +expire=$4 port=$((instance_number+8000)) # Check domain/path availability @@ -19,6 +20,7 @@ fi echo "Register configuration..." sudo yunohost app setting $app is_public -v $is_public sudo yunohost app setting $app port -v $port +sudo yunohost app setting $app expire -v $expire # Remove trailing "/" for next commands path=${path%/} @@ -48,6 +50,12 @@ sed -i "s@YUNOPORT@$port@g" ../conf/$name sed -i "s@YUNOLOG@$app@g" ../conf/$name sed -i "s@YUNOPATH@$path@g" ../conf/$name sed -i "s@YUNOAPP@$app@g" ../conf/$name +if [ "$expire" -eq 0 ]; then + expire="" +else + expire="--expire $(($expire * 86400))" +fi +sed -i "s@YUNOEXPIRE@$expire@g" ../conf/$name sudo cp ../conf/$name /etc/init.d/$app sudo chmod +x /etc/init.d/$app sudo update-rc.d $app defaults