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

Deployment fails if site password is set #111

Closed
pl4nty opened this issue Mar 9, 2023 · 4 comments · Fixed by #114
Closed

Deployment fails if site password is set #111

pl4nty opened this issue Mar 9, 2023 · 4 comments · Fixed by #114

Comments

@pl4nty
Copy link
Contributor

pl4nty commented Mar 9, 2023

ctf challenge sync, install and deploy fail if a site password is configured. I noticed a site_password cookie is sent in the web UI though, and manual API calls succeed with it (eg curl)

@ColdHeat
Copy link
Member

Yes the site password is transmitted via a cookie. However there isn't currently any UI to set those cookies in ctfcli. For the time being I would disable the password and disable registration so no one can login to the authenticated parts.

@pl4nty
Copy link
Contributor Author

pl4nty commented Mar 12, 2023

Yeah, I ended up disabling the password. I'm happy write a PR for this if you want? Maybe something like

if config["config"]["site_password"]:
  s.cookies["site_password"] = config["config"]["site_password"]

s.headers.update({"Authorization": f"Token {access_token}"})
return s

@ColdHeat
Copy link
Member

Sure a PR wolud be great! However, I would prefer a more generic solution to the problem instead of specific keys. Perhaps if you could define an entire cookies sub-section or a cookies dictionary?

pl4nty added a commit to pl4nty/ctfcli that referenced this issue Mar 12, 2023
@pl4nty
Copy link
Contributor Author

pl4nty commented Mar 12, 2023

Looks like ConfigParser doesn't parse [config.xyz], cookies = {'site_password': 'password'}, or cookies['site_password'] = 'password', so I used a separate [cookies] section instead

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 a pull request may close this issue.

2 participants