calibre-web
calibre-web copied to clipboard
Preconfigure ldap before the first start
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"
The user must be created in the calibre-web database before you can log in as this user
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?
Just published a proof on concept of how it could be done: https://github.com/janeczku/calibre-web/pull/2799
What‘s wrong with this one: https://github.com/janeczku/calibre-web/pull/2628?
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)
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
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?
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
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.
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 .
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.
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.
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.
I didn't check the contributions guide carefully enough, so I didn't know my PR was pending due to the incorrect branch. Apologies :sweat_smile:
I've created a new PR for the develop branch - https://github.com/janeczku/calibre-web/pull/2968