|
| 1 | +#+title: Freesitemgr description |
| 2 | + |
| 3 | +#+BEGIN_ABSTRACT |
| 4 | +Description of the freesitemgr tool. |
| 5 | + |
| 6 | +This is a guide to publishing a freesite on [[https://www.hyphanet.org/][Hyphanet (formerly known |
| 7 | +as Freenet)]]. |
| 8 | + |
| 9 | +Note: You need the current release of [[https://github.com/hyphanet/pyFreenet][pyFreenet]] to use this tool. |
| 10 | +Get it from [[https://pypi.python.org/pypi][PyPI]]: |
| 11 | +#+BEGIN_SRC sh |
| 12 | +# with setuptools |
| 13 | +easy_install --user pyFreenet |
| 14 | +# or pip |
| 15 | +pip install --user pyFreenet |
| 16 | +#+END_SRC |
| 17 | + |
| 18 | +#+END_ABSTRACT |
| 19 | + |
| 20 | +* Basic function of freesitemgr |
| 21 | + |
| 22 | +The purpose of the freesitemgr tool is to use the basic building |
| 23 | +blocks for communication in freenet to upload a site to a USK. |
| 24 | +Subsequent updates of the site can then be updated to a new edition. |
| 25 | + |
| 26 | +The uploaded site consists of all files and directories at a given |
| 27 | +location. |
| 28 | + |
| 29 | +Basic commands |
| 30 | + |
| 31 | +#+BEGIN_SRC sh |
| 32 | +# Create a new freesite: |
| 33 | +$ freesitemgr add [name] |
| 34 | +# Update the version of the freesite: |
| 35 | +$ freesitemgr update name |
| 36 | +#+END_SRC |
| 37 | + |
| 38 | +* The mime-types of the files in the created site |
| 39 | + |
| 40 | +The mime-types used on each file in the created freesite will be |
| 41 | +determined by fcp3/node.py and the function |
| 42 | +#+BEGIN_SRC python |
| 43 | +guestMimeType(filename) |
| 44 | +# that in turn uses |
| 45 | +mimetypes.guess_type(filename, False). |
| 46 | +#+END_SRC |
| 47 | + |
| 48 | +** Controlling the mime-types |
| 49 | + |
| 50 | +If these guesses are not relevant for you use, when creating the site, |
| 51 | +options --mime-type-match=PATTERN=MIME-TYPE can be used. This option |
| 52 | +is only available in the python3 version of pyFreenet. |
| 53 | + |
| 54 | +When using the --mime-type-match option, the order is significant. |
| 55 | + |
| 56 | +Example |
| 57 | +#+BEGIN_EXAMPLE |
| 58 | +$ freesitemgr --mime-type-match=*.gif=image/gif --mime-type-match=databasefiles/*=text/plain add |
| 59 | +#+END_EXAMPLE |
| 60 | +will create a site that will assign the mime-type image/gif to the |
| 61 | +file databasefiles/somedir/imagename.gif while |
| 62 | +#+BEGIN_EXAMPLE |
| 63 | +$ freesitemgr --mime-type-match=databasefiles/*=text/plain --mime-type-match=*.gif=image/gif add |
| 64 | +#+END_EXAMPLE |
| 65 | +will create a site that will assign the mime-type text/plain to the |
| 66 | +same file. |
| 67 | + |
| 68 | +This technique or controlling is used by the [[freenet:/USK@nrDOd1piehaN7z7s~~IYwH-2eK7gcQ9wAtPMxD8xPEs,y61pkcoRy-ccB7BHvLCzt3RUjeMILf8ox26NKvPZ-jk,AQACAAE/dgof/55/][dgof]] tool to control the |
| 69 | +mime-types of the published sites. |
0 commit comments