Friday, October 11, 2013

private cloud storage program – my draft log

1.owncloud

1.1 brief

ownCloud gives you universal access to your files through a web interface or WebDAV. It also provides a platform to easily view & sync your contacts, calendars and bookmarks across all your devices and enables basic editing right on the web. Installation has minimal server requirements, doesn’t need special permissions and is quick. ownCloud is extendable via a simple but powerful API for applications and plugins.

ownCloud started with a keynote by Frank Karlitschek at Camp KDE’10 where he talked about the need of a self-controlled free and open source cloud.

为了给用户提供免费的替代,3 年前,Frank Karlitschek 开发了开源版的文件存储、同步及共享软件包ownCloud。目前,该软件包已经正式推出了 4 个版本,支持 42 种语言。除了具备 Dropbox 或 Box.net 的基本功能以外,ownCloud 还支持通讯录、日历等功能。现在,ownCloud 又发布了 5.0 的 beta 版,预计将会在几周后正式推出。

1.2 screenshots

office website:

image

server: install:

image 

 

1.3 install

1.3.1 server package

prepare:

install for  iis

install web plateform installer for iis.

install php 5.3, mysql 5.5,webdav from install web plateform.after that,setting them,and remember enabled webdav on iis.

also can download phpmyadmin for operator mysql.

download and unpack it to your web wwwroot,then open it with browser.

then type new admin username,password, db user,db password,db name,db host,then next.

after iis setup owncloud,remebmer add mime type:

.svg image/svg+xml
.svgz image/svg+xml



a.error:
Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken.
Please double check the installation guides.
fixed:
i used iis,and install webdav with web plateform installer.

b.error:
MySQL user 'oc_admin'@'localhost' exists already.
Drop this user from MySQL
fixed:
in phpmyadmin image 
select oc_admin rows and delete them.

c. warning:
没有安全随机码生成器,请启用 PHP OpenSSL 扩展。
没有安全随机码生成器,黑客可以预测密码重置令牌并接管你的账户。

fixed:

extension=php_openssl.dll

d. error:
then access http://localhost:801/t/owncloud2/ , it redirect too many timers to http://localhost:801/t/owncloud2/index.php?redirect_url=%2Ft%2Fowncloud2%2Findex.php%2Fapps%2Ffiles.
fixed:
install webdav for web server.
my develop log:
i find google result in here:Is this a bug? Installer on IIS7 redirect loop on index.php

but not fixed it, then i debug in here: lib\utils.cpp:

public static function checkLoggedIn() {
// Check if we are a user
if( !OC_User::isLoggedIn()) {
header( 'Location: '.OC_Helper::linkToAbsolute( '', 'index.php',
array('redirect_url' => OC_Request::requestUri())));
exit();
}
}
and found inner is in lib\user.cpp:






public static function isLoggedIn() {
if( isset($_SESSION['user_id']) AND $_SESSION['user_id']) {
OC_App::loadApps(array('authentication'));
self::setupBackends();
if (self::userExists($_SESSION['user_id']) ) {
return true;
}
}
return false;
}
then i delete browser cookit,and open index page,type account and password to track it.
then i found here can break down in lib\user.php:
public static function login( $uid, $password ) {
$run = true;
OC_Hook::emit( "OC_User", "pre_login", array( "run" => &$run, "uid" => $uid ));

if( $run ) {
$uid = self::checkPassword( $uid, $password );
$enabled = self::isEnabled($uid);
if($uid && $enabled) {
session_regenerate_id(true);
self::setUserId($uid);
self::setDisplayName($uid);
OC_Hook::emit( "OC_User", "post_login", array( "uid" => $uid, 'password'=>$password ));
return true;
}
}
return false;
}
then found this in lib\user\database.php:
public function checkPassword( $uid, $password ) {
$query = OC_DB::prepare( 'SELECT `uid`, `password` FROM `*PREFIX*users` WHERE LOWER(`uid`) = LOWER(?)' );
$result = $query->execute( array( $uid));

$row=$result->fetchRow();
if($row) {
$storedHash=$row['password'];
if ($storedHash[0]=='$') {//the new phpass based hashing
$hasher=$this->getHasher();
if($hasher->CheckPassword($password.OC_Config::getValue('passwordsalt', ''), $storedHash)) {
return $row['uid'];
}else{
return false;
}
}else{//old sha1 based hashing
if(sha1($password)==$storedHash) {
//upgrade to new hashing
$this->setPassword($row['uid'], $password);
return $row['uid'];
}else{
return false;
}
}
}else{
return false;
}
}

and found this is no error.and then i found dav keywords.


e.error
Not enough space available 2mb
fixed:
first modify php.ini 
upload_max_filesize = 2G

but it chagned to limited by 8mb,so search by google.and say: OwnCloud 4.0.3 Max Upload Size = 0B?


so i change it in user default storage size with admin.


then error:

upload max. 8 MB


then i changed it in php.ini with:

post_max_size = 2G






f.warning:
{"app":"PHP","message":"PHP Startup: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'UTC' for '8.0\/no DST' instead at Unknown#0","level":4,"time":"2013-10-12T06:13:33+00:00"}

fixed:


php.ini modify your locale: date.timezone =


1.3.2 client


after i install owncloud desktop client on my windows 8 x64.


error:

CSync: Permission deniend

Background message: 405 Method Not Allowed

then i used wireshark to capture network package,and result:

PROPFIND /owncloud/remote.php/webdav HTTP/1.1

User-Agent: Mozilla/5.0 (Windows) csyncoC/0.90.2 neon/0.29.6

Keep-Alive:

Connection: TE, Keep-Alive

TE: trailers

Host: 172.16.16.82:801

Proxy-Connection: Keep-Alive

Depth: 1

Content-Length: 206

Content-Type: application/xml

Cookie: 5258b6c008bfb=7lospeb7k6adu3blqeub05eij6;



HTTP/1.1 405 Method Not Allowed

Allow: GET, HEAD, OPTIONS, TRACE, LOCK, UNLOCK

Content-Type: text/html

Server: Microsoft-IIS/7.5

X-Powered-By: ASP.NET

Date: Sat, 12 Oct 2013 06:57:13 GMT

Content-Length: 1202



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312"/>

<title>405 - .................... HTTP ......</title>

<style type="text/css">

<!--

body{margin:0;font-size:.7em;font-family:Verdana, Arial, Helvetica, sans-serif;background:#EEEEEE;}

fieldset{padding:0 15px 10px 15px;}

h1{font-size:2.4em;margin:0;color:#FFF;}

h2{font-size:1.7em;margin:0;color:#CC0000;}

h3{font-size:1.2em;margin:10px 0 0 0;color:#000000;}

#header{width:96%;margin:0 0 0 0;padding:6px 2% 6px 2%;font-family:"trebuchet MS", Verdana, sans-serif;color:#FFF;

background-color:#555555;}

#content{margin:0 0 0 2%;position:relative;}

.content-container{background:#FFF;width:96%;margin-top:8px;padding:10px;position:relative;}

-->

</style>

</head>

<body>

<div id="header"><h1>..........</h1></div>

<div id="content">

<div class="content-container"><fieldset>

<h2>405 - .................... HTTP ......</h2>

<h3>....................................................(HTTP ....)..</h3>

</fieldset></div>

</div>

</body>

</html>

<?xml version="1.0" encoding="utf-8"?>
<propfind xmlns="DAV:"><prop>
<getlastmodified xmlns="DAV:"/>
<getcontentlength xmlns="DAV:"/>
<resourcetype xmlns="DAV:"/>
<getetag xmlns="DAV:"/>
</prop></propfind>
fixed:Propfind method not allowed

 


















2.SparkleShare


2.1 brief


SparkleShare creates a special folder on your computer. You can add remotely hosted folders (or "projects") to this folder. These projects will be automatically kept in sync with both the host and all of your peers when someone adds, removes or edits a file.


SparkleShare was made to cover certain use cases, but doesn't handle every scenario well. To help you decide if SparkleShare is right for you, here's a few examples of what it does well and less well with smiley faces:


Great


  • Frequently changing project files, like text, office documents, and images
  • Tracking and syncing files edited by multiple people
  • Reverting a file to any point in its history
  • Preventing spying on your files on the server using encryption

Not so great


  • Full computer backups
  • Storing your photo or music collection
  • Large binary files that change often, like video editing projects

No comments: