Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preconfigure ldap before the first start #2795

Open
cyberb opened this issue May 26, 2023 · 14 comments
Open

Preconfigure ldap before the first start #2795

cyberb opened this issue May 26, 2023 · 14 comments
Labels

Comments

@cyberb
Copy link

cyberb commented May 26, 2023

I am trying to preconfigure ldap before even starting app, for that I have created an init script
https://github.com/syncloud/calibre/blob/ldap/config/init.sql

But when I try to login with my ldap username and password it still says user not found and logs do not even mention trying to go to l ldap server is this by design or am I missing something?

WARN {cps.web:1400} Login failed for user "user"
@OzzieIsaacs
Copy link
Collaborator

The user must be created in the calibre-web database before you can log in as this user

@cyberb
Copy link
Author

cyberb commented May 26, 2023

Is user not imported from ldap upon successful authentication?
How and when is it imported then (can I trigger it before/after the start in a script)?
Is it possible to change so user is automatically created?

@cyberb
Copy link
Author

cyberb commented May 29, 2023

Just published a proof on concept of how it could be done: #2799

@OzzieIsaacs
Copy link
Collaborator

What‘s wrong with this one: #2628?

@cyberb
Copy link
Author

cyberb commented May 29, 2023

right, I have not seen it :)
well, must be something wrong as it sits there open for half a year :(
ok now you have two, I am not sure if it has role set automatically as when I checked import was doing a user default, but that way you will not have admin users if you start form empty users db (my case)

@OzzieIsaacs
Copy link
Collaborator

Yeah, nobody is writing tests, as I’ve requested (https://github.com/janeczku/calibre-web/blob/master/CONTRIBUTING.md#contributing-code-to-calibre-web), this is so boring, so everything takes a long time

@cyberb
Copy link
Author

cyberb commented May 29, 2023

omg, I really thought there are zero tests as I could not find them, but why are they in a separate repo, are they not supposed to run per commit? should I create two branches and marry them somehow?

@cyberb
Copy link
Author

cyberb commented May 29, 2023

I think if you merge them in and add some CI like github actions (never used myself as I use drone-ci) for auto run and get a green/red status you could sit back and relax just saying add more tests and make it green :)
I have all this for calibre-web as you can see: https://github.com/syncloud/calibre/blob/master/.drone.jsonnet

@cyberb
Copy link
Author

cyberb commented May 29, 2023

I do not care about about specific python versions and windows as I am packaging a self contained package with no dependencies which should run only on Syncloud Linux device but github actions will probably allow you to do more platforms as you need.

@OzzieIsaacs
Copy link
Collaborator

I'm not the owner of the calibre-web repro, so I have only limited access to the admin function (e.g. I can't add any github action), and I have no contact to the repro owner (and I dind't try to contact him in the past). So it was easier for me to have it in a seperate repro where I can do whatever I want. The tests I'm running are real system tests including selenium and server simulators where I can stimulate everything I want. The tests are running for more than 5 hours meanwhile, not ideal, but sometimes things are growing... Especially in the beginning this approach was a good one, as most of the routines were just queries to the database and problems were due to missing variables, wrong variable contents and so on in the jinjia2 templates .

@cyberb
Copy link
Author

cyberb commented May 30, 2023

I'm not the owner of the calibre-web repo

wow, I see, that explains a lot :) I guess you have some rights at least to push/merge.
OK then, I can keep the change on my repo until something similar arrives upstream.

It is sad to see how good open source projects lack a proper maintenance, this is why in Syncloud I am thinking about spreading the income from paid subscribers to app creators as soon as I can cover the running costs in future.

@OzzieIsaacs
Copy link
Collaborator

I don't want to blame anybody. My time is also limited. From my experience calibre-web attracts a lot of newbies users and system admins but less programmers and there is almost no money to think of what to do with it.

@cyberb
Copy link
Author

cyberb commented Jun 4, 2023

and I dind't try to contact him in the past

Why not? automated CI is the way out of this, if the owner is not involved anymore, a fork is not a bad idea either, still less work than running a manual test after each commit. Even time, converring to unit tests will help as well.

@epsilon-0
Copy link

I didn't check the contributions guide carefully enough, so I didn't know my PR was pending due to the incorrect branch. Apologies 😅

I've created a new PR for the develop branch - #2968

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants