|
1 | | -Welcome to StackSync! |
2 | | -===================== |
| 1 | +StackSync API module |
| 2 | +-------------------- |
3 | 3 |
|
4 | | -> **NOTE:** This is BETA quality code! |
5 | 4 |
|
6 | | -**Table of Contents** |
| 5 | +1) Install StackSync REST API. |
7 | 6 |
|
8 | | -- [Introduction](#introduction) |
9 | | -- [Architecture](#architecture) |
10 | | -- [Swift REST API](#swift-rest-api) |
11 | | - - [Differences between V1 and V2](#differences-between-v1-and-v2) |
12 | | -- [Requirements](#requirements) |
13 | | -- [Installation instructions](#installation-instructions) |
14 | | -- [Uninstallation intructions](#uninstallation-instructions) |
15 | | -- [Issue Tracking](#issue-tracking) |
16 | | -- [Licensing](#licensing) |
17 | | -- [Contact](#contact) |
| 7 | + $ sudo python setup.py install |
18 | 8 |
|
19 | | -# Introduction |
20 | 9 |
|
21 | | -StackSync (<http://stacksync.com>) is a scalable open source Personal Cloud |
22 | | -that implements the basic components to create a synchronization tool. |
| 10 | +2) Edit your proxy-server.conf pipeline to enable the StackSync API module. |
23 | 11 |
|
| 12 | + [pipeline:main] |
| 13 | + pipeline = healthcheck cache authtoken keystone stacksync-api proxy-server |
24 | 14 |
|
25 | | -# Architecture |
26 | | - |
27 | | -In general terms, StackSync can be divided into three main blocks: clients |
28 | | -(desktop and mobile), synchronization service (SyncService) and storage |
29 | | -service (Swift, Amazon S3, FTP...). An overview of the architecture |
30 | | -with the main components and their interaction is shown in the following image. |
31 | | - |
32 | | -<p align="center"> |
33 | | - <img width="500" src="https://raw.github.com/stacksync/desktop/master/res/stacksync-architecture.png"> |
34 | | -</p> |
35 | | - |
36 | | -The StackSync client and the SyncService interact through the communication |
37 | | -middleware called ObjectMQ. The sync service interacts with the metadata |
38 | | -database. The StackSync client directly interacts with the storage back-end |
39 | | -to upload and download files. |
40 | | - |
41 | | -As storage back-end we are using OpenStack Swift, an open source cloud storage |
42 | | -software where you can store and retrieve lots of data in virtual containers. |
43 | | -It's based on the Cloud Files offering from Rackspace. But it is also possible |
44 | | -to use other storage back-ends, such as a FTP server or S3. |
45 | | - |
46 | | -# Swift REST API |
47 | | - |
48 | | -This is a module for OpenStack Swift. It's aim is to simulate StackSync behaviour |
49 | | -with a simple REST API for mobile and web applications. |
50 | | - |
51 | | -In the [docs folder](docs) there is the API specification. There are two different |
52 | | -APIs documents. This code implements V1 since V2 is not developed yet, but we |
53 | | -have ready the specification. |
54 | | - |
55 | | -## Differences between V1 and V2 |
56 | | - |
57 | | -Main differences are: |
58 | | -- V1 code is hard to follow and it is bad structured. We started with some simple |
59 | | -features but then we stated adding new functionalities until we finally get a huge |
60 | | -file with horrible code. |
61 | | -- V1 is too inefficient since it has to create chunks and communicate with SyncService. |
62 | | -- Besides V2, V1 is not a real REST API! |
63 | | - |
64 | | -With API v2 we want to solve all these problems. |
65 | | - |
66 | | -# Requirements |
67 | | - |
68 | | -- [Python-magic](https://github.com/ahupp/python-magic) library to obtain files mimetype: |
69 | | - |
70 | | - $ sudo apt-get install pip |
71 | | - $ sudo pip install python-magic |
72 | | - |
73 | | -# Installation instructions |
74 | | - |
75 | | -1) Install StackSync REST API with: |
76 | | - |
77 | | - $ sudo python setup.py install |
78 | | - |
79 | | - |
80 | | -2) Alter your proxy-server.conf pipeline to enable apiweb: |
81 | | - |
82 | | -From: |
83 | | - |
84 | | - [pipeline:main] |
85 | | - pipeline = healthcheck cache authtoken keystone proxy-server |
86 | | - |
87 | | -To: |
88 | | - |
89 | | - [pipeline:main] |
90 | | - pipeline = healthcheck cache authtoken keystone apiweb proxy-server |
91 | | - |
92 | | -3) Add to your proxy-server.conf the section for the StackSync WSGI filter:: |
93 | | - |
94 | | - [filter:apiweb] |
95 | | - use = egg:apiweb#apiweb |
96 | | - rpc_server_ip = SERVER_IP |
97 | | - rpc_server_port = SERVER_PORT |
98 | | - |
99 | | -If rpc_server_ip and rpc_server_port are not defined the default values will be 127.0.0.1 and 61234. |
| 15 | +3) And add the WSGI filter below: |
100 | 16 |
|
| 17 | + [filter:stacksync-api] |
| 18 | + use = egg:stacksync-api-swift#stacksync_api |
| 19 | + stacksync_host = 127.0.0.1 |
| 20 | + stacksync_port = 61234 |
101 | 21 |
|
102 | 22 | 4) Restart the proxy: |
103 | | - |
104 | | - $ sudo swift-init proxy restart |
105 | | - |
106 | | - |
107 | | -# Uninstallation instructions |
108 | | - |
109 | | -1) Change the pipeline of the proxy-server.conf again to disable the stacksync module. |
110 | | - |
111 | | -From: |
112 | | - |
113 | | - [pipeline:main] |
114 | | - pipeline = healthcheck cache authtoken keystone apiweb proxy-server |
115 | | - |
116 | | -To: |
117 | | - |
118 | | - [pipeline:main] |
119 | | - pipeline = healthcheck cache authtoken keystone proxy-server |
120 | | - |
121 | | -2) Restart the proxy: |
122 | | - |
123 | | - $ sudo swift-init proxy restart |
124 | | - |
125 | | -# Issue Tracking |
126 | | -For the moment, we are going to use the github issue tracking. |
127 | 23 |
|
128 | | -# Licensing |
129 | | -StackSync is licensed under the GPLv3. Check [license.txt](license.txt) for the latest |
130 | | -licensing information. |
| 24 | + $ swift-init proxy restart |
131 | 25 |
|
132 | | -# Contact |
133 | | -Visit www.stacksync.com to contact information. |
0 commit comments