1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/yourls_ynh.git synced 2024-09-03 20:35:59 +02:00

Restrict admin page to specified user

This commit is contained in:
anmol 2019-01-05 22:59:57 +05:30
parent 4c896e46b9
commit d589591dd7
4 changed files with 9 additions and 5 deletions

View file

@ -48,7 +48,7 @@ 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 );
define( 'YOURLS_PRIVATE', false );
/** 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' );
@ -57,7 +57,6 @@ define( 'YOURLS_COOKIEKEY', 'modify this text with something random' );
** YOURLS will auto encrypt plain text passwords in this file
** Read http://yourls.org/userpassword for more information */
$yourls_user_passwords = array(
'yourlsuser' => 'yourpassword',
);
/** Debug mode to output some internal information

View file

@ -118,8 +118,6 @@ ynh_replace_string "yunopass" "$db_pwd" "$final_path/user/config.php"
ynh_replace_string "yunobase" "$db_name" "$final_path/user/config.php"
ynh_replace_string "yunodomain" "$domain" "$final_path/user/config.php"
ynh_replace_string "_yourlspath" "${path_url%/}" "$final_path/user/config.php"
ynh_replace_string "yourlsuser" "$admin" "$final_path/user/config.php"
ynh_replace_string "yourpassword" "$pass" "$final_path/user/config.php"
ynh_replace_string "modify this text with something random" "$(ynh_string_random 24)$(ynh_string_random 24)" "$final_path/user/config.php"
# The script "add_sso_conf.py" will just add en entry for the path "/admin" in the sso conf.json.persistent file in the cathegory "protected_urls".
@ -145,6 +143,9 @@ sudo chown -R $app: $final_path
# Reload Nginx and regenerate SSOwat conf
yunohost app setting $app unprotected_uris -v "/"
# Restrict access to admin only
yunohost app addaccess --users=$admin $app
yunohost app ssowatconf
# Reload Nginx

View file

@ -80,7 +80,7 @@ ynh_system_user_create $app
#=================================================
# Restore permissions on app files
chown -R root: $final_path
chown -R $app: $final_path
#=================================================
# RESTORE THE PHP-FPM CONFIGURATION

View file

@ -131,6 +131,10 @@ chown -R $app: $final_path
ynh_app_setting_set $app unprotected_uris "/"
# Restrict access to admin only
yunohost app addaccess --users=$admin $app
yunohost app ssowatconf
#=================================================
# RELOAD NGINX