From 2b0e02739901c30293e866ff0f396b00ea180f14 Mon Sep 17 00:00:00 2001 From: Thomas LEBEAU Date: Thu, 12 Jun 2014 18:16:54 +0200 Subject: [PATCH] add conf + install + manifest --- conf/config.php | 90 +++++++++++++++++++++++++++++++++++++++++++++++++ manifest.json | 11 +++++- scripts/install | 19 +++++++++-- 3 files changed, 116 insertions(+), 4 deletions(-) create mode 100644 conf/config.php diff --git a/conf/config.php b/conf/config.php new file mode 100644 index 0000000..ab548a9 --- /dev/null +++ b/conf/config.php @@ -0,0 +1,90 @@ + 'password' // You can have one or more 'login'=>'password' lines +); + +/** Debug mode to output some internal information + ** Default is false for live site. Enable when coding or before submitting a new issue */ +define( 'YOURLS_DEBUG', false ); + +/* + ** URL Shortening settings + */ + +/** URL shortening method: 36 or 62 */ +define( 'YOURLS_URL_CONVERT', 36 ); +/* + * 36: generates all lowercase keywords (ie: 13jkm) + * 62: generates mixed case keywords (ie: 13jKm or 13JKm) + * Stick to one setting. It's best not to change after you've started creating links. + */ + +/** +* Reserved keywords (so that generated URLs won't match them) +* Define here negative, unwanted or potentially misleading keywords. +*/ +$yourls_reserved_URL = array( + 'porn', 'faggot', 'sex', 'nigger', 'fuck', 'cunt', 'dick', 'gay', +); + +/* + ** Personal settings would go after here. + */ + diff --git a/manifest.json b/manifest.json index 2aea448..1ea073b 100644 --- a/manifest.json +++ b/manifest.json @@ -29,7 +29,16 @@ }, "example": "/yourls", "default": "/yourls" - } + }, + { + "name": "admin", + "ask": { + "en": "Choose the Yourls administrator (must be an existing YunoHost user)", + "fr": "Administrateur du site (doit ĂȘtre un utilisateur Yunohost existant)" + }, + "example": "yoda" + }, + ] } } diff --git a/scripts/install b/scripts/install index 74d3c95..90cd54c 100644 --- a/scripts/install +++ b/scripts/install @@ -10,11 +10,24 @@ if [[ ! $? -eq 0 ]]; then exit 1 fi +# Generate random password +db_pwd=$(dd if=/dev/urandom bs=1 count=200 2> /dev/null | tr -c -d 'A-Za-z0-9' | sed -n 's/\(.\{24\}\).*/\1/p') + +# Use 'yourls' as database name and user +db_user=yourls + +# Initialize database and store mysql password for upgrade +sudo yunohost app initdb $db_user -p $db_pwd +sudo yunohost app setting yourls mysqlpwd -v $db_pwd + + # Copy files to the right place final_path=/var/www/yourls sudo mkdir -p $final_path -pwd -#sudo cp -a ../sources/* $final_path +sudo cp -a ../sources/* $final_path + + +sudo cp $final_path/user/config-sample.php $final_path/user/config.php # Set permissions -#sudo chown -R www-data: $final_path \ No newline at end of file +sudo chown -R www-data: $final_path \ No newline at end of file