Skip to content

Commit a26fef8

Browse files
committed
Fix dependency and error with setting port
1 parent 9a04138 commit a26fef8

File tree

5 files changed

+20
-9
lines changed

5 files changed

+20
-9
lines changed

Pipfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ natural = "==0.2.0"
1414
pymongo = "*" # Required by motor
1515
dnspython = "*" # Required for pymongo srv support
1616
python-dateutil = "==2.9.0.post0"
17+
python-dotenv = "==1.2.1"
1718
sanic = "== 25.3.0"
1819

1920
[scripts]

Pipfile.lock

Lines changed: 10 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ sudo apt install -y make build-essential libssl-dev zlib1g-dev \
4747
libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev libzstd-dev
4848
curl https://pyenv.run | bash
4949

50-
# Add pyenv to bash so that it loads every time
50+
# Auto-loads pyenv every time you start a terminal session
5151
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
5252
echo '[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
5353
echo 'eval "$(pyenv init - bash)"' >> ~/.bashrc
@@ -61,6 +61,7 @@ exec "$SHELL"
6161
# Install Python 3.12
6262
pyenv install 3.12
6363
pyenv global 3.12
64+
python -m pip install -U pip
6465
```
6566

6667
### Deployment
@@ -71,10 +72,9 @@ Run the following shell commands:
7172
git clone https://github.com/modmail-dev/logviewer
7273
cd logviewer
7374

74-
# Create and activate virtual environment (optional, but recommended)
75-
python3.12 -m pip install -U pip venv
76-
python3.12 -m venv .venv
77-
source .venv/bin/activate
75+
# Create and activate virtual environment (optional, but strongly recommended)
76+
python -m venv venv
77+
source venv/bin/activate
7878

7979
# Install dependencies
8080
pip install -r requirements.txt
@@ -92,7 +92,7 @@ python app.py
9292

9393
> [!NOTE]
9494
> If you are using a virtual environment, ensure you activate it every time you reconnect your terminal session before you run/update the logviewer.
95-
> You can do this by running `source .venv/bin/activate` in the logviewer directory.
95+
> You can do this by running `source venv/bin/activate` in the logviewer directory.
9696
9797
You can verify the logviewer is working by navigating to `http://<IP_OF_SERVER>:8000` (if you didn't change the bind IP / port) and should be greeted with the Logviewer main page.
9898

app.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = "1.1.2"
1+
__version__ = "1.1.3"
22

33
import html
44
import os
@@ -110,6 +110,6 @@ async def get_logs_file(request, key):
110110
if __name__ == "__main__":
111111
app.run(
112112
host=os.getenv("HOST", "0.0.0.0"),
113-
port=os.getenv("PORT", 8000),
113+
port=int(os.getenv("PORT", 8000)),
114114
debug=bool(os.getenv("DEBUG", False)),
115115
)

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ pymongo == 4.15.5
55
dnspython # Required for pymongo srv support
66
pymongo # Required for motor
77
python-dateutil == 2.9.0.post0
8+
python-dotenv == 1.2.1
89
sanic == 25.3.0

0 commit comments

Comments
 (0)