From cf72bb22c477fb12a5a1ac9500e90141e200ad2e Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Sun, 26 Mar 2023 16:02:39 +0200 Subject: [PATCH 1/3] don't create upfast-src directory --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 9a1b851..7dfcf44 100644 --- a/README.md +++ b/README.md @@ -15,12 +15,12 @@ We will also be setting up an specific user to run the app as safe as possible w sudo useradd --shell /bin/bash --system \ --home-dir "/usr/local/upfast" -m upfast -# Change to upfast user and cd /usr/local/upfast +# Change to upfast user and go to upfast dir su upfast -cd /usr/local/upfast +cd # Clone the project directly into upfast-src directory -git clone https://code.cronyakatsuki.xyz/crony/upfast upfast-src +git clone https://code.cronyakatsuki.xyz/crony/upfast . # Create the virtual environment and load it for user on default python3 -m venv venv @@ -52,7 +52,7 @@ Documentation=https://code.cronyakatsuki.xyz/crony/upfast [Service] User=upfast Group=upfast -WorkingDirectory=/usr/local/upfast/upfast-src +WorkingDirectory=/usr/local/upfast/ ExecStart=/usr/local/upfast/venv/bin/uvicorn main:app --host 127.0.0.1 --port 8000 --proxy-headers --forwarded-allow-ips='*' Restart=on-failure ``` -- 2.45.2 From e8f9e0bf5eb82d8b4a6be4c39f1576692d08a6e2 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Sun, 26 Mar 2023 16:03:18 +0200 Subject: [PATCH 2/3] grouped python commands --- README.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 7dfcf44..008b23a 100644 --- a/README.md +++ b/README.md @@ -24,15 +24,14 @@ git clone https://code.cronyakatsuki.xyz/crony/upfast . # Create the virtual environment and load it for user on default python3 -m venv venv -echo "source /usr/local/upfast/venv/bin/activate" > "/usr/local/upfast/.profile" - # Activate the virtual environment source venv/bin/activate - # Install all the requirements -cd upfast-src/ pip install -r requirements.txt +# Load environment by default +echo "source /usr/local/upfast/venv/bin/activate" > "/usr/local/upfast/.profile" + # create the upload directory mkdir upload -- 2.45.2 From a72cd1a0398961b766038f378ec964a0ee1fd7a7 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Sun, 26 Mar 2023 16:03:38 +0200 Subject: [PATCH 3/3] some corrections --- README.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 008b23a..25ce187 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # UpFast -simple tool for uploading and sharing files that is selfhostable. +Simple tool for uploading and sharing files that you can self-host. ## How to host @@ -35,7 +35,7 @@ echo "source /usr/local/upfast/venv/bin/activate" > "/usr/local/upfast/.profile" # create the upload directory mkdir upload -# Run the project +# UpFast go brrr uvicorn main:app --host 127.0.0.1 --port 8000 --proxy-headers --forwarded-allow-ips='*' ``` @@ -55,8 +55,14 @@ WorkingDirectory=/usr/local/upfast/ ExecStart=/usr/local/upfast/venv/bin/uvicorn main:app --host 127.0.0.1 --port 8000 --proxy-headers --forwarded-allow-ips='*' Restart=on-failure ``` +Finally run following commmands. -Then just run `sudo systemctl daemon-reload` and enable the service with `sudo systemctl enable upfast.service` +``` +# refresh services +`sudo systemctl daemon-reload` +# enable the service +`sudo systemctl enable upfast.service` +``` ### Docker -- 2.45.2