Commit 26b90611 authored by Laurent Bachelier's avatar Laurent Bachelier

Add "getting started" section to the documentation

parent cbe193f5
......@@ -68,3 +68,65 @@ For instance, to run the ass2m CLI::
$ PYTHONPATH=. ./bin/ass2m
Beware that if you also have installed ass2m globally, the installed data files (assets, templates) could be used (the local ones of course have an higher priority).
Getting started
---------------
First, we have to create the *working directory* where all files you want to share will be put.::
$ cd mysharedfiles
$ ass2m init
Ass2m working directory created.
You can test ass2m *right now* by starting the integrated server. However, for a more serious usage, it is recommended to configure it to work with a full-blown web server (see the Configuration section)::
$ ass2m-serve .
serving on 0.0.0.0:8042 view at http://127.0.0.1:8042
You can now play around with the web interface. Add some files in your working directory, and they will appear. For instance, let's add one file::
$ cp ~/pics/my_gf_naked.jpg ./
Refresh the web page. By default, since we added an image, it will be shown as a thumbnail.
However, you might not want this picture to be seen by everyone::
$ ass2m chmod all -irl my_gf_naked.jpg
Check all set permissions::
$ ass2m tree
-/ all(irl-)
|-.ass2m/ all(----)
-my_gf_naked.jpg all(----)
``all`` is a special name to refer to everyone (anonymous users being part of it of course). ``i`` is for appearing In a list, ``r`` is for Reading, ``w`` is for Writing, and ``l`` is for Listing a directory. All modes are inherited from the parents if they are not specified at a higher level.
Refresh the web page. Now, no one can read and or even know that file exists. But let's do something fun!::
$ ass2m chmod all +i my_gf_naked.jpg
$ ass2m tree
-/ all(irl-)
|-.ass2m/ all(----)
-my_gf_naked.jpg all(i---)
Refresh the web page. The file will appear, but if you try to view it, you will be denied.
The next step is to allow only some users to view that file::
$ ass2m contacts add myfriend
$ ass2m chmod u.myfriend +ir my_gf_naked.jpg
$ ass2m tree
-/ all(irl-)
|-.ass2m/ all(----)
-my_gf_naked.jpg u.myfriend(ir--) all(i---)
``u`` is a prefix to specify it concerns an user.
Now, connect as this user::
$ ass2m contacts genkey myfriend
Key of user myfriend set to 455b00b1e5.
$ ass2m geturl -u myfriend .
http://127.0.0.1:8042/?authkey=455b00b1e5
Open the URL. You can now access the file!
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment