[Q] Tutorial to enable GitLab/GitHub OAuth while keeping PUBLIC_REGISTER_ENABLED=False
#67
Labels
question
Further information is requested
PUBLIC_REGISTER_ENABLED=False
#67
TL;DR
Mount your own
config.py
with #L151 to be updated to override/taiga-back/settings/config.py
(containertaiga-back
)Mount your own
config_env_subst.sh
with #L25 to be updated to override/docker-entrypoint.d/30_config_env_subst.sh
(containertaiga-front
)Note that the
sed
here is to update the condition check (see2.i
below) in the compiled distapp.js
attaiga-back@6.5.1
(i.e.,v-1643209941013
)(Optional) To disable default login form, mount your own
conf.json
with #L13 to be updated to override/usr/share/nginx/html/conf.json.template
(containertaiga-front
)Background
According to #15 and README.md@6.5.0
The GitLab OAuth requires
PUBLIC_REGISTER_ENABLED=True
to be set.However, it's dangerous to keep public register enabled, as one can register with random data and get access to your Taiga instance.
Therefore I spend some time to survey how to adopt a minimal modification to keep
PUBLIC_REGISTER_ENABLED=False
and GitLab (or GitHub) OAuth enabled.Root Cause
By setting
PUBLIC_REGISTER_ENABLED=False
fortaiga-back
:INSTALLED_APPS += [ "taiga_contrib_github_auth"]
is skipped and leads theinvalid login type
error being raised.config.py
By setting
PUBLIC_REGISTER_ENABLED=false
fortaiga-front
:templateFn
returns""
due toif not publicRegisterEnabled
and leads the button be hiddensed -i
that force the condition becometrue?():""
and never return empty stringcontribs+=('"plugins/gitlab-auth/gitlab-auth.json"')
is skipped and leads the login button not shown even the 2.1 is adopted30_config_env_subst.sh
Expected Result
PUBLIC_REGISTER_ENABLED=false
andPUBLIC_REGISTER_ENABLED=False
(thetaiga-back
MUST be False)Only
Login
bottom is shownRegister
page should be not found whenPUBLIC_REGISTER_ENABLED=false
Public registration should be FAILED when
PUBLIC_REGISTER_ENABLED=true
butPUBLIC_REGISTER_ENABLED=False
Note That
EVERY user from the GitLab instance can STILL register a new account, as the (non-public) registration is NOT blocked!!
Any change to
taiga-front
configs auto generated from the template requires 1. the container to be reset / removed & recreated and 2. reload the page using Clear Cache and Hard Reload mode!!The text was updated successfully, but these errors were encountered: