浏览代码

protect the bitflu interface with a default user and tell the user how to change the password

Ralf S. Engelschall 18 年之前
父节点
当前提交
17cea31d88
共有 3 个文件被更改,包括 26 次插入1 次删除
  1. 2 0
      bitflu/bitflu.config
  2. 10 1
      bitflu/bitflu.patch
  3. 14 0
      bitflu/bitflu.spec

+ 2 - 0
bitflu/bitflu.config

@@ -25,3 +25,5 @@ notifycompleted   = 0
 
 trackerblacklist  = ^127\.0|^192\.|example\.com
 
+userauth          = openpkg:3a72c5bbae413cfb0d2f149ea4fc3a3586743cdf
+

+ 10 - 1
bitflu/bitflu.patch

@@ -1,6 +1,6 @@
 Index: bitflu.pl
 --- bitflu.pl.orig	2007-02-24 12:26:16 +0100
-+++ bitflu.pl	2007-02-25 11:17:05 +0100
++++ bitflu.pl	2007-02-25 12:42:50 +0100
 @@ -188,6 +188,7 @@
  #Options with getopt support:
  # 1. prio: commandline switch , 2.nd: rcfile 3th: defaults
@@ -36,3 +36,12 @@ Index: bitflu.pl
  	                                           Proto=>'tcp', Listen=>1, ReuseAddr=>1) or die "$0 Unable to bind to $config->{client}->{port} : $!\n";
  	$torrent_handle->add($torrent_socket);
  
+@@ -1166,7 +1167,7 @@
+ 							}
+ 							elsif($ACSTAT{$sock}->{AUTH_STATE} == TELNET_CLIENT_WAITFORUSER) {
+ 								$ACSTAT{$sock}->{GIVEN_USER} = substr($full_data,0,-2);
+-								_xwA($sock, "# Password : ");
++								_xwA($sock, "# Password: ");
+ 								$ACSTAT{$sock}->{AUTH_STATE} = TELNET_CLIENT_WAITFORPASS;
+ 							}
+ 							elsif($ACSTAT{$sock}->{AUTH_STATE} == TELNET_CLIENT_WAITFORPASS) {

+ 14 - 0
bitflu/bitflu.spec

@@ -102,6 +102,20 @@ AutoReqProv:  no
     rm -rf $RPM_BUILD_ROOT
 
 %post
+    if [ $1 -eq 1 ]; then
+        #   display final hints on initial installation
+        ( echo "To complete this installation of Bitflu, please start Bitflu,"
+          echo "connect to its Telnet interface, login with the default"
+          echo "user \"openpkg\" and password \"openpkg\" and change the"
+          echo "password to custom password \"<password>\":"
+          echo "    \$ $RPM_INSTALL_PREFIX/bin/openpkg rc bitflu start"
+          echo "    \$ telnet 127.0.0.1 4001"
+          echo "    # Username: openpkg"
+          echo "    # Password: openpkg"
+          echo "    # user password openpkg openpkg <password>"
+          echo "    # config save"
+        ) | %{l_rpmtool} msg -b -t notice
+    fi
     #   after upgrade, restart service
     [ $1 -eq 2 ] || exit 0
     eval `%{l_rc} bitflu status 2>/dev/null`