Skip to content

Commit

Permalink
update README file
Browse files Browse the repository at this point in the history
  • Loading branch information
robatipoor committed Mar 10, 2024
1 parent 32e2c1e commit 976e05c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# PasteFile 📁 📥
The service provides a convenient means of sharing files without the necessity for user accounts or a complicated setup. The accompanying code includes the server, encompassing everything you need to create your own instance.
The service provides a convenient means of sharing files with easy setup. The code includes the server API and CLI client tool, encompassing everything you need to create your own instance.

![License](https://img.shields.io/github/license/robatipoor/pf)
[![Lines Of Code](https://tokei.rs/b1/github/robatipoor/pf?category=code)](https://github.com/robatipoor/pf)
Expand All @@ -13,7 +13,6 @@ The service provides a convenient means of sharing files without the necessity f
**Feature highlights**

* Basic Authentication
* Anonymous Uploads
* File Expiration
* Burn After Reading
* Large File Support
Expand Down Expand Up @@ -56,6 +55,9 @@ $ docker run --name pf-api --rm -p 8080:8080 \
**How to Use**

```sh
# Open it in the default browser.
$ open http://127.0.0.1:8080

# Ping the server.
$ curl -X GET http://127.0.0.1:8080/healthz

Expand Down Expand Up @@ -160,23 +162,23 @@ $ mv ~/.cargo/bin/cli ~/.cargo/bin/pf
# Define an alias in the shell profile for 'pf' with server address
$ alias pf="pf --server-addr http://localhost:8080"

# Upload a file and retrieve the corresponding download URL.
$ pf upload --source-file ~/example-file.txt --progress-bar
# Encrypt and upload a file and retrieve the corresponding download URL.
$ pf upload --source-file ~/example-file.txt --key-nonce "{key}:{nonce}" --progress-bar

# Upload a file with basic authentication and progress bar option.
$ pf --auth "username:password" upload --source-file ~/example-file.txt

# Upload a file with an expiration time of 10 minutes.
$ pf upload --expire "10 minute" --source-file ~/example-file.txt
# Upload a text with an expiration time of 10 minutes.
$ echo 'Hello World!' | pf copy --expire "10 minute"

# Upload a file and then display the QR code.
$ pf upload --source-file ~/example-file.txt --output qr-code

# Download a file with progress bar option.
$ pf download --destination ~/example-dir/ --url-path "{code}/{file_name}" --progress-bar

# Download a file.
$ pf download --destination ~/example-dir/ --url-path "{code}/{file_name}"
# Paste a file.
$ pf paste --url-path "{code}/{file_name}" > my_file.txt

# Get metadata for a file.
$ pf info --url-path "{code}/{file_name}"
Expand Down
2 changes: 1 addition & 1 deletion api/src/service/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ pub async fn delete(
}

pub fn read_file(config: &ApiConfig, file_path: &FilePath) -> ServeFile {
ServeFile::new(get_fs_path(&config.fs.base_dir, &file_path))
ServeFile::new(get_fs_path(&config.fs.base_dir, file_path))
}

pub fn authorize_user(secret: Option<Secret>, secret_hash: &Option<SecretHash>) -> ApiResult<()> {
Expand Down
6 changes: 6 additions & 0 deletions scripts/rm-test-dump.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash

SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
rm -rf test-dump
rm -rf api/test-dump
rm -rf tmp/

0 comments on commit 976e05c

Please sign in to comment.