Skip to content

Commit

Permalink
Removing guest access as it causes issues with basic auth user switch…
Browse files Browse the repository at this point in the history
…ing.

Use reader user for readonly access.
  • Loading branch information
ash0ne committed Sep 9, 2024
1 parent eb1987c commit 42820da
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 14 deletions.
13 changes: 4 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,11 @@ You can then access the app by going to `http://localhost:3040`
### User Management

Any version after 1.4.x, the default admin user configured through env vars `DOCKER_PDF_SERVER_USER` and `DOCKER_PDF_SERVER_PASSWORD`
can add aadditional admins, maintainers and readers
can add additional admins, maintainers and readers

**Admin** - Can add other users
**Maintainer** - Cannot add users but can upload, delete files
**Reader** - Can only read files

#### Guest Access

Enabling guest access means that any unauthenticated user can read files but cannot delete or upload any files. To enable guest access,
set `ENABLE_GUEST_ACCESS` env var to `yes` in your docker run. Any vaule other than `yes` will default to guest access being disabled.
- **Admin** - Can add other users
- **Maintainer** - Cannot add users but can upload, delete files
- **Reader** - Can only read files

### Building and Running Locally for Development

Expand Down
4 changes: 0 additions & 4 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
APP_KEY = os.environ.get("DOCKER_PDF_SERVER_KEY", "super_secret_key")
APP_USER = os.environ.get("DOCKER_PDF_SERVER_USER", "admin")
APP_PASSWORD = os.environ.get("DOCKER_PDF_SERVER_PASSWORD", "password")
ENABLE_GUEST_ACCESS = os.environ.get("ENABLE_GUEST_ACCESS", "no")
ALLOWED_EXTENSIONS = {"pdf"}

app = Flask(__name__)
Expand Down Expand Up @@ -79,9 +78,6 @@ def verify_password(username, password):
if user and user.check_password(password):
g.current_user = user
return g.current_user
if "yes" == ENABLE_GUEST_ACCESS:
g.current_user = User(username="default_guest", role="reader")
return g.current_user
return None


Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ packaging==24.1
SQLAlchemy==2.0.31
typing_extensions==4.12.2
Wand==0.6.13
Werkzeug==3.0.3
Werkzeug==3.0.4
WTForms==3.1.2

0 comments on commit 42820da

Please sign in to comment.