Browse Source

ee secure command to change HTTP AUTH & EasyEngine admin port 22222

old-stable
Mitesh Shah 11 years ago
parent
commit
f5c3a9f54b
  1. 8
      bin/easyengine
  2. 4
      bin/update
  3. 4
      config/easyengine/ee.conf
  4. 6
      src/modules/secure/ee_mod_secure_auth.sh
  5. 14
      src/modules/secure/ee_mod_secure_port.sh

8
bin/easyengine

@ -566,6 +566,14 @@ elif [ "$EE_FIRST" = "debug" ]; then
ee_lib_echo_info "tail -f $EE_DEBUG_MSG"
fi
fi
elif [ "$EE_FIRST" = "secure" ]; then
if [ "$EE_SECOND" = "--auth" ]; then
ee_mod_secure_auth
elif [ "$EE_SECOND" = "--port" ]; then
ee_mod_secure_port
fi
elif [ "$EE_FIRST" = "update" ]; then
ee_lib_echo "Please set/use following alias to update EasyEngine (ee)"
echo "alias eeupdate=\"wget -qO /tmp/eeupdate https://raw.githubusercontent.com/rtCamp/easyengine/refactor/bin/update && sudo bash /tmp/eeupdate\""

4
bin/update

@ -163,8 +163,6 @@ if [[ $EE_CURRENT_VERSION < $EE_LATEST_VERSION ]]; then
# Get old value from ee.bak file
ee_stack_ip=$(grep ip_address /etc/easyengine/ee.bak | cut -d'=' -f2)
ee_auth_user=$(grep htpasswduser /etc/easyengine/ee.bak | cut -d'=' -f2)
ee_auth_pass=$(grep htpasswdpass /etc/easyengine/ee.bak | cut -d'=' -f2)
ee_mysql_host=$(grep mysqlhost /etc/easyengine/ee.bak | cut -d'=' -f2)
ee_wp_user=$(grep wpadminuser /etc/easyengine/ee.bak | cut -d'=' -f2)
ee_wp_pass=$(grep wpadminpass /etc/easyengine/ee.bak | cut -d'=' -f2)
@ -181,8 +179,6 @@ if [[ $EE_CURRENT_VERSION < $EE_LATEST_VERSION ]]; then
# Update value in ee.conf file
$EE_CONFIG_SET stack.ip-address "$(echo -n $ee_stack_ip)" && \
$EE_CONFIG_SET auth.user "$(echo -n $ee_auth_user)" && \
$EE_CONFIG_SET auth.password "$(echo -n $ee_auth_pass)" && \
$EE_CONFIG_SET mysql.host "$(echo -n $ee_mysql_host)" && \
$EE_CONFIG_SET wordpress.user "$(echo -n $ee_wp_user)" && \
$EE_CONFIG_SET wordpress.password "$(echo -n $ee_wp_pass)" && \

4
config/easyengine/ee.conf

@ -5,10 +5,6 @@
gpg-key-fix = false
ip-address =
[auth]
user = easyengine
password = easyengine
[mysql]
host = localhost
db-name = false

6
src/lib/ee_lib_http_auth.sh → src/modules/secure/ee_mod_secure_auth.sh

@ -1,6 +1,6 @@
# Setup HTTP authentication
function ee_lib_http_auth()
function ee_mod_secure_auth()
{
local ee_http_auth_user ee_http_auth_pass
@ -17,8 +17,8 @@ function ee_lib_http_auth()
fi
# Add HTTP authentication details
$EE_CONFIG_SET auth.user $ee_http_auth_user
$EE_CONFIG_SET auth.password $ee_http_auth_pass
ee_lib_echo "HTTP authentication username: $ee_http_auth_user" &>> $EE_COMMAND_LOG
ee_lib_echo "HTTP authentication password: $ee_http_auth_pass" &>> $EE_COMMAND_LOG
# Generate htpasswd-ee file
printf "$ee_http_auth_user:$(openssl passwd -crypt $ee_http_auth_pass 2> /dev/null)\n" > /etc/nginx/htpasswd-ee 2> /dev/null

14
src/modules/secure/ee_mod_secure_port.sh

@ -0,0 +1,14 @@
# Setup EasyEngine admin port
function ee_mod_secure_port()
{
read -p "EasyEngine admin port [22222]: " ee_port
# If enter is pressed, set 22222
if [[ $ee_port = "" ]]; then
ee_port=22222
fi
sed -i "s/listen 22222/listen $ee_port" /etc/nginx/sites-available/22222 \
|| ee_lib_error "Unable to change EasyEngine admin port, exit status = " $?
}
Loading…
Cancel
Save