Porte-document pour la GRC
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Go to file
Frédéric Péters 1f55bf44ce
gitea/fargo/pipeline/head This commit looks good Details
debian: apply new pre-commit-debian (#77727)
1 week ago
debian debian: apply new pre-commit-debian (#77727) 1 week ago
fargo misc: limit filename length (#72567) 6 months ago
tests misc: limit filename length (#72567) 6 months ago
.git-blame-ignore-revs trivial: ignore isort/pyupgrade automatic reformatting 2 years ago
.gitignore update .gitignore to mention fargo instead of authentic directories 8 years ago
.pre-commit-config.yaml ci: upgrade pre-commit-debian (#77727) 1 week ago
COPYING Revert "Add a send-to view (fixes #7080)" 8 years ago
Jenkinsfile Prepare Jenkinsfile for Gitea migration (#74572) 3 months ago
MANIFEST.in misc: sync setup stuff with newer templates 8 years ago
README misc: add black files/notes 2 years ago
manage.py Initialize fargo 8 years ago
pylint.sh build: add jenkinsfile 4 years ago
requirements.txt general: switch to django postgresql json field (#65265) 1 year ago
setup.py misc: allow django 3.2 and django-tables2 2.4 (#68784) 9 months ago
tox.ini remove Debian 10 (buster) build (#73932) 4 months ago

README

Fargo
=====

To start do:

    pip install -e .
    ./manage.py migrate
    ./manage.py runserver

To use your own settings make the LOCAL_SETTINGS environment variable point to
a settings file that will be executed in the context of the project settings
module, at its end.

Settings
========

 Nothing for now.

Requesting a file from another application
==========================================

Downloading a file from fargo is easy:
- Open http://fargo/?pick=http://yoursite/pick-a-file/ in a popup or iframe
- When the user choose a file it is returned to

     http://yoursite/pick-a-file/?url=http://fargo/remote-download/name-of-the-file?token=xxxxxx

   Your view on this URL should download the file from the given URL, do
   something with it then close the popup/iframe.

Download URL are only valid during 60 seconds after the request will return
status 403. If the file has been removed a 404 is returned.

Displaying the list of files of a user
======================================

There are two methods JSONP and JSON, both are totally insecure, protect
them with your web server and IP limitations for now.

JSONP
-----

 * Add this to your page

    <script>function callback(data) {
        // display the file list by modifying the DOM
    }</script>
    <script src="http://fargo/jsonp/?callback=callback"></script>

 * data is structured like this:

    [ { 'url': 'http://fargo/download/etc..', 'filename': 'facture.pdf'}, ... ]

JSON
----

 * Do a get on http://fargo/json/?username=john.doe

Showing an upload form
======================

You can open an upload form to fargo by creating a popup or an iframe with
location http://fargo/upload/. You can pass a parameter ?next=http://yoursite/
if you want the user to come back  to your site after the upload, to close the
popup or the destroy the iframe.


Code Style
==========

black is used to format the Python code, using thoses parameters:

    black --target-version py37 --skip-string-normalization --line-length 110

There is .pre-commit-config.yaml to use pre-commit to automatically run black
before commits. (execute `pre-commit install` to install the git hook.)