Update desktop utility instructions

This commit is contained in:
Alice Gaudon 2020-07-06 11:05:17 +02:00
parent e911089c97
commit 48cf655917

View File

@ -7,13 +7,33 @@
<hr>
<section>
<h3>First alternative: sh script (native on linux)</h3>
<p>If you have the sh shell on your machine (i.e. you are on linux, git bash on windows...), you can
<a href="{{ route('file-linux-script') }}">download this script</a>.</p>
<p>If you have the sh shell on your machine (i.e. you are on linux, git bash on windows...) and curl, you can
download and use these scripts:</p>
<table class="data-table">
<thead>
<tr>
<th>Name</th>
<th>Download link</th>
</tr>
</thead>
<tbody>
<tr>
<td>upload_file.sh</td>
<td><a href="{{ route('file-linux-script') }}">Download</a></td>
</tr>
<tr>
<td>shorten_url.sh</td>
<td><a href="{{ route('url-linux-script') }}">Download</a></td>
</tr>
</tbody>
</table>
<p>You must put a valid auth token (generated in the form at the bottom of this page) in a .ily_token
file in your home directory ($HOME/.ily_token).</p>
file in your home directory (<code>$HOME/.ily_token</code>).</p>
<p>Examples:</p>
<pre>upload_script.sh path/to/file</pre>
<pre>upload_script.sh path/to/file my_very_important_file.png</pre>
<pre>upload_file.sh path/to/file</pre>
<pre>upload_file.sh path/to/file my_very_important_file.png</pre>
<pre>shorten_url.sh https://gitlab.com/ArisuOngaku/ilyli</pre>
<pre>shorten_url.sh https://gitlab.com/ArisuOngaku/ilyli repo</pre>
</section>
<hr>
@ -34,44 +54,52 @@
<tr>
<th>Field name</th>
<th>Description</th>
<th>Optional?</th>
<th>Example</th>
<th>Required?</th>
<th>Value(s)</th>
</tr>
</thead>
<tbody>
<tr>
<td>upload</td>
<td>The file field</td>
<td>No</td>
<td>-</td>
<th colspan="4">File upload</th>
</tr>
<tr>
<td>type</td>
<td>Request type</td>
<td>Yes</td>
<td>file</td>
</tr>
<tr>
<td>upload</td>
<td>File field</td>
<td>Yes</td>
<td>The actual file contents</td>
</tr>
<tr>
<td>ttl</td>
<td>How much time (in seconds) to keep the file</td>
<td>Yes</td>
<td>No</td>
<td>0 (never delete), 30 (delete after 30s)</td>
</tr>
<tr>
<th colspan="4">URL shorten</th>
</tr>
<tr>
<td>type</td>
<td>Request type</td>
<td>Yes</td>
<td>url</td>
</tr>
<tr>
<td>target_url</td>
<td>Target url</td>
<td>Yes</td>
<td>A valid URL starting with https:// or http://</td>
</tr>
</tbody>
</table>
<p>Example with curl:</p>
<pre>curl -X POST -H 'Accept: application/json' \
-H "Authorization: very_secret_and_personal_token" \
-F 'type=file' \
-F 'upload=@path/to/local/file' \
https://ily.li/</pre>
<pre>curl -X PUT -H 'Accept: application/json' \
-H "Authorization: very_secret_and_personal_token" \
-F 'type=file' \
-F 'upload=@path/to/local/file' \
https://ily.li/my_very_important_file.png</pre>
<pre>curl -X POST -H 'Accept: application/json' \
-H "Authorization: very_secret_and_personal_token" \
-F 'type=file' \
-F 'upload=@path/to/local/file' \
-F 'ttl=30' \
https://ily.li/</pre>
<p>For examples with curl, please download and review the scripts above.</p>
</section>
</section>
</div>