zhsso / ubunto-one Goto Github PK
View Code? Open in Web Editor NEWimport from https://code.launchpad.net/filesync-server
License: GNU Affero General Public License v3.0
import from https://code.launchpad.net/filesync-server
License: GNU Affero General Public License v3.0
How to setup Filesync Server and Client ======================================= These are the general instructions to do all the needed setup to have a proper file synchronization service up and running. Before server or client ----------------------- Create the SSL certificates for client to communicate with server securely. First, the private key: openssl genrsa -out privkey.pem Then, then self-signed certificate. Note that at some point it will ask you to write the "Common Name (e.g. server FQDN or YOUR name)", I found that what you put there needs to match the '--host' parameter you pass to the client (see below, in the part where the client is started), so this host name must be such the client machine can ping it. openssl req -new -x509 -key privkey.pem -out cacert.pem -days 1095 The just generated 'privkey.pem' and 'cacert.pem' will be used below. Server setup ------------ Start with a clean Ubuntu Precise environment (for example, in a VPS). Install tools and dependencies: sudo apt-get install bzr make python-transaction protobuf-compiler \ python-setuptools gcc python-dev python-twisted-web postgresql-9.1 \ python-yaml python-psycopg2 postgresql-contrib supervisor \ postgresql-plpython-9.1 python-django python-boto squid \ python-protobuf python-psutil python-testresources Branch the project and get into that dir: bzr branch lp:filesync-server cd filesync-server Edit the `config/development.yaml` file and in the `secret` section set the `api_server_crt` key with the content of `cacert.pem` file, and the `api_server_key` key with the content of `privkey.pem` file (both files produced in the "Before server or client" section). Then, start the server: make start-oauth Note that the server will listen on port 21101, so you need to assure than the client could reach it (open it in your firewall config, etc). Finally, create all the users you want: dev-scripts/user-mgr.py create testuser John Doe [email protected] testpass (with this script you'll be able to also retrieve and update user data, and delete users) Client setup ------------ This is to be repeated in all places that you want the system to run. Instructions are for an Ubuntu Trusty environment, adapt as needed. It's assuming you're starting from a clean machine (e.g.: a just installed one, or an LXC), if you're not you may have some of the needed parts already installed. First, install tools and dependencies: sudo apt-get install python-twisted-bin python-twisted-core \ python-dirspec python-pyinotify python-configglue \ python-twisted-names python-ubuntu-sso-client \ python-distutils-extra protobuf-compiler python-protobuf Go to a new directory (anyone you chooses), let's call it $SOMEDIR, and there, after following the steps below, you'll get the following structure: $SOMEDIR/storage-protocol <-- this is a subproject needed by the client $SOMEDIR/client <-- this is the proper filesync client $SOMEDIR/certifs <-- this is where you'll store the SSL certifs for the client Just to follow the next instructions, it's easier if you do: export SOMEDIR=<the path where you want to put everything> mkdir -p $SOMEDIR So, branch and build the storage protocol: cd $SOMEDIR bzr branch lp:~facundo/ubuntuone-storage-protocol/opensourcing storage-protocol cd storage-protocol ./setup.py build Put the SSL certificate in a separate directory (wherever you want): cd $SOMEDIR mkdir certif cp <path of cacert.pem file created above> certif/ Also branch and build the client: cd $SOMEDIR bzr branch lp:~facundo/ubuntuone-client/opensourcing client cd client/ubuntuone ln -s $SOMEDIR/storage-protocol/ubuntuone/storageprotocol . cd .. ./setup.py build Finally, start the client export $(dbus-launch) # seems this is needed if you're inside a LXC or VPS PYTHONPATH=. SSL_CERTIFICATES_DIR=$SOMEDIR/certif bin/ubuntuone-syncdaemon \ --auth=testuser:testpass --host=testfsyncserver \ --port=21101 --logging-level=DEBUG If you want, check logs to see all went ok less $HOME/.cache/ubuntuone/log/syncdaemon.log There, this line will show that the client started ok: ubuntuone.SyncDaemon.Main - NOTE - ---- MARK (state: <State: 'INIT' ... And this line will show that the client reached the server ok (so no network issues): ubuntuone.SyncDaemon.StateManager - DEBUG - received event 'SYS_CONNECTION_MADE' Finally, this line will show that client authenticated OK to the server (no username/password issues): ubuntuone.SyncDaemon.StateManager - DEBUG - received event 'SYS_AUTH_OK' Enjoy.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.