mirror of
https://github.com/YunoHost-Apps/yourls_ynh.git
synced 2024-09-03 20:35:59 +02:00
add conf + install + manifest
This commit is contained in:
parent
f8619de312
commit
2b0e027399
3 changed files with 116 additions and 4 deletions
90
conf/config.php
Normal file
90
conf/config.php
Normal file
|
@ -0,0 +1,90 @@
|
|||
<?php
|
||||
/* This is a sample config file.
|
||||
* Edit this file with your own settings and save it as "config.php"
|
||||
*/
|
||||
|
||||
/*
|
||||
** MySQL settings - You can get this info from your web host
|
||||
*/
|
||||
|
||||
/** MySQL database username */
|
||||
define( 'YOURLS_DB_USER', 'yunouser' );
|
||||
|
||||
/** MySQL database password */
|
||||
define( 'YOURLS_DB_PASS', 'yunopwd' );
|
||||
|
||||
/** The name of the database for YOURLS */
|
||||
define( 'YOURLS_DB_NAME', 'yunouser' );
|
||||
|
||||
/** MySQL hostname.
|
||||
** If using a non standard port, specify it like 'hostname:port', eg. 'localhost:9999' or '127.0.0.1:666' */
|
||||
define( 'YOURLS_DB_HOST', 'localhost' );
|
||||
|
||||
/** MySQL tables prefix */
|
||||
define( 'YOURLS_DB_PREFIX', 'yourls_' );
|
||||
|
||||
/*
|
||||
** Site options
|
||||
*/
|
||||
|
||||
/** YOURLS installation URL -- all lowercase and with no trailing slash.
|
||||
** If you define it to "http://site.com", don't use "http://www.site.com" in your browser (and vice-versa) */
|
||||
define( 'YOURLS_SITE', 'domain' );
|
||||
|
||||
/** Timezone GMT offset */
|
||||
define( 'YOURLS_HOURS_OFFSET', 0 );
|
||||
|
||||
/** YOURLS language or "locale".
|
||||
** Change this setting to "localize" YOURLS (use a translation instead of the default English). A corresponding .mo file
|
||||
** must be installed in the user/language directory.
|
||||
** See http://yourls.org/translations for more information */
|
||||
define( 'YOURLS_LANG', '' );
|
||||
|
||||
/** Allow multiple short URLs for a same long URL
|
||||
** Set to true to have only one pair of shortURL/longURL (default YOURLS behavior)
|
||||
** Set to false to allow multiple short URLs pointing to the same long URL (bit.ly behavior) */
|
||||
define( 'YOURLS_UNIQUE_URLS', true );
|
||||
|
||||
/** Private means the Admin area will be protected with login/pass as defined below.
|
||||
** Set to false for public usage (eg on a restricted intranet or for test setups)
|
||||
** Read http://yourls.org/privatepublic for more details if you're unsure */
|
||||
define( 'YOURLS_PRIVATE', true );
|
||||
|
||||
/** A random secret hash used to encrypt cookies. You don't have to remember it, make it long and complicated. Hint: copy from http://yourls.org/cookie **/
|
||||
define( 'YOURLS_COOKIEKEY', 'modify this text with something random' );
|
||||
|
||||
/** Username(s) and password(s) allowed to access the site. Passwords either in plain text or as encrypted hashes
|
||||
** YOURLS will auto encrypt plain text passwords in this file
|
||||
** Read http://yourls.org/userpassword for more information */
|
||||
$yourls_user_passwords = array(
|
||||
'username' => '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.
|
||||
*/
|
||||
|
|
@ -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"
|
||||
},
|
||||
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
sudo chown -R www-data: $final_path
|
Loading…
Reference in a new issue