Skip to content

Feat/local auth#139

Open
ibaraki-douji wants to merge 10 commits intoEugeny:masterfrom
ibaraki-douji:feat/local-auth
Open

Feat/local auth#139
ibaraki-douji wants to merge 10 commits intoEugeny:masterfrom
ibaraki-douji:feat/local-auth

Conversation

@ibaraki-douji
Copy link
Copy Markdown

@ibaraki-douji ibaraki-douji commented May 16, 2025

This pull request allow users to login with a username/password.
As requested in #116 and also because i wanted to keep the admin UI and not only use the API.

How to use it ?

  • After you created you Tabby Instance create a super user : /manage.sh createsuperuser
  • Then you can login either on /login or /admin with your user and password.
  • To create new local users, create them from the admin panel, then use thoses credentials to login iin the frontend.

Screenshots

Empty form :
image

Invalid Form :
image

Pull Request Changes

  • Added /api/1/auth/login for local logins
  • Added login form inside /login view
  • Fixed Github Actions linter issue

@ibaraki-douji
Copy link
Copy Markdown
Author

I forgot the .form-control to match the rest of the inputs ...
Here is a new screenshot :
image

@wes1993
Copy link
Copy Markdown

wes1993 commented Jun 22, 2025

Hello @ibaraki-douji,
I have installed your fork but encountered errors to missing modules:

pip install django
pip install dj-database-url
pip install dotenv
apk add build-base python3-dev
pip install djangorestframework
apk add libffi-dev
pip install social-auth-app-django
pip install django-cors-headers
apk add mariadb-dev build-base python3-dev
pip install mysqlclient
pip install fsspec
pip install djangorestframework-dataclasses
pip install websockets
pip install gql[all]

django.db.utils.OperationalError: (2005, "Unknown server host 'db' (-2)") --> Unresolved

I hope you can assist me with this.

Best regards,
Stefano

@ibaraki-douji
Copy link
Copy Markdown
Author

@wes1993
i would recommend to use the same way the README shows the module install : https://github.com/Eugeny/tabby-web?tab=readme-ov-file#development-setup
i don't use poetry on my personnal projects so a bit harder to debug.

tho to help me, can you tell me which command gave you that error django.db.utils.OperationalError: (2005, "Unknown server host 'db' (-2)") --> Unresolve ?
and looking at the error did you run the app using the docker-compose to start the db as well ?

@wes1993
Copy link
Copy Markdown

wes1993 commented Jun 22, 2025

Hello @ibaraki-douji,
I’ve set up the containers using the Docker Compose file, then SSH’d into the tabby-web container and ran:

python manage.py createsuperuser

However, that resulted in an error.

How can I configure your PR so that I can authenticate using a local user?

@ibaraki-douji
Copy link
Copy Markdown
Author

@wes1993
Did you really SSH ? or you mean exec inside the container ?

for that command that throw an error it's normal : python manage.py createsuperuser
You need to run inside the container /manage.sh createsuperuser not python manage.py

And for the last question, you just setup the project like the original one using docker, tho switch to my branch/repo to use my changes.

@wes1993
Copy link
Copy Markdown

wes1993 commented Jun 22, 2025

@ibaraki-douji,
My mistake — I used docker exec to enter the running container and then ran:

/manage.sh createsuperuser

I was able to create the superuser successfully, but I still don’t see the login form:
image

For reference, I cloned your repository and built everything from within its root folder using docker compose up command.

@ibaraki-douji
Copy link
Copy Markdown
Author

ibaraki-douji commented Jun 22, 2025

@wes1993 by any chance did you cloned the master branch and not switched to feat/local-auth branch ?
If yes, that might be the reason

@wes1993
Copy link
Copy Markdown

wes1993 commented Jun 22, 2025

Probably :-(

Now i'm building again after running

git clone -b feat/local-auth https://github.com/ibaraki-douji/tabby-web.git

I'll keep you updated thanks a lot

@wes1993
Copy link
Copy Markdown

wes1993 commented Jun 22, 2025

@ibaraki-douji,
Now I have the login form but the UI won't work:

tabby-1  | Not Found: /app-dist/1.0.163/tabby-web-container/dist/preload.js
tabby-1  | WARNING Not Found: /app-dist/1.0.163/tabby-web-container/dist/preload.js
tabby-1  | Not Found: /app-dist/1.0.163/tabby-web-container/dist/bundle.js
tabby-1  | WARNING Not Found: /app-dist/1.0.163/tabby-web-container/dist/bundle.js
tabby-1  | Not Found: /app-dist/1.0.163/tabby-web-container/dist/preload.js
tabby-1  | WARNING Not Found: /app-dist/1.0.163/tabby-web-container/dist/preload.js

Do you have some suggestion?

Best Regards
Stefano

@ibaraki-douji
Copy link
Copy Markdown
Author

ibaraki-douji commented Jun 22, 2025

@wes1993 you need to install a dist-version of the webui (basicly install a web version of tabby client)
if your using the docker-compose.yml without changes you should have a folder in the same directory as the compose file named app-dist/dist/.
Inside it you should have a version of tabby (in my case 1.0.187-nightly.1).
If you don't, please refer to https://github.com/Eugeny/tabby-web?tab=readme-ov-file#adding-tabby-app-versions

also inside the webui, on the bottom left, you have a page icon. You can choose the installed tabby version from there if you have multiple or a wrong default one

@wes1993
Copy link
Copy Markdown

wes1993 commented Jun 23, 2025

@ibaraki-douji,
Good news! everything is now working perfectly! Thank you so much! 😄

Warm regards,
Stefano

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants