*** irclogbot_3 has quit IRC | 03:20 | |
*** irclogbot_0 has joined #ara | 03:23 | |
*** Arsenick_ has quit IRC | 04:16 | |
*** Arsenick has joined #ara | 04:17 | |
*** gvincent has joined #ara | 06:57 | |
*** gvincent has quit IRC | 14:31 | |
*** gvincent has joined #ara | 14:31 | |
*** gvincent has quit IRC | 14:45 | |
*** stand has quit IRC | 15:16 | |
ara-slack | kfiresmith: Hi Folks - seeing something odd with the say my ALLOWED_HOSTS env var is set up | 16:33 |
---|---|---|
ara-slack | kfiresmith: Here's what I see with docker-compose config (which dumps the running environment) | 16:34 |
ara-slack | kfiresmith: # docker-compose config | 16:35 |
ara-slack | services: | 16:35 |
ara-slack | ara-api: | 16:35 |
ara-slack | depends_on: | 16:35 |
ara-slack | - mariadb | 16:35 |
ara-slack | environment: | 16:35 |
ara-slack | ARA_ALLOWED_HOSTS: '"[''.college.edu'', ''127.0.0.1'']"' | 16:35 |
ara-slack | kfiresmith: heh - reading #125 now | 16:39 |
ara-slack | kfiresmith: https://github.com/ansible-community/ara/issues/125 | 16:39 |
ara-slack | kfiresmith: Sadly the alluded to documentation and switch to settings.yaml isn't very clear to me | 16:44 |
ara-slack | kfiresmith: OK got past all that but my ALLOWED hosts is still having some trouble - it's hard to figure out where the corresponding django code is to see what django thinks my ALLOWED_HOSTS is | 17:12 |
*** kodiak_f has joined #ara | 17:32 | |
kodiak_f | heya - anyone awake? Django allowed_hosts is killing me | 17:33 |
kodiak_f | oh wow - that's cool | 17:33 |
kodiak_f | never seen an IRC --> slack connector | 17:33 |
dmsimard | kodiak_f: o/ | 17:34 |
kodiak_f | Should I moan about settings.yaml here or on Slack dmsimard? | 17:34 |
dmsimard | kodiak_f: there used to be an IRC gateway for slack but then they closed it down and I put this together: https://github.com/dmsimard/teamchat | 17:35 |
dmsimard | you can moan wherever you prefer, I don't judge :p | 17:35 |
dmsimard | ALLOWED_HOSTS is the hostname you type in your browser | 17:36 |
kodiak_f | yep for sure - and I've tried every permutation including * and .college.edu - trying this YAML settings file method after fiding bug #125 which shows that docker-compose complicated dicts | 17:37 |
dmsimard | if you intend to reach the web interface or the api over foo.domain.tld then foo.domain.tld needs to be in ALLOWED_HOSTS | 17:37 |
kodiak_f | Here's what I've gotten so far in paste https://paste.centos.org/view/c6fcb612 | 17:37 |
kodiak_f | ara-api_1 | 2021-04-03 17:31:48,632 ERROR django.security.DisallowedHost: Invalid HTTP_HOST header: 'northbeach.college.edu:8000'. You may need to add 'northbeach.college.edu' to ALLOWED_HOSTS. | 17:38 |
kodiak_f | BUT! I know it's reading in my settings file that is docker volume mounted because it runs the mysql db migrations | 17:38 |
dmsimard | northbeach.college.edu is in that paste so you should be good -- did you try restarting the container after modifying settings ? | 17:39 |
kodiak_f | I've been doing a full-on docker-compose kill on them between changes | 17:39 |
dmsimard | try going in the container to find out if your settings.yaml is really getting loaded | 17:39 |
kodiak_f | is there some way to dump the running django config to see what django thinks is the value of ALLOWED_HOSTS? | 17:40 |
dmsimard | oh wait | 17:40 |
dmsimard | your settings.yaml is wrong | 17:40 |
kodiak_f | I figured that could be the case but it did pass lint | 17:40 |
kodiak_f | I was just going to figure out if ara-manage could dump running django configs | 17:41 |
dmsimard | kodiak_f: this is what the default settings.yaml looks like: http://paste.openstack.org/show/804153/ | 17:41 |
dmsimard | needs to be indented under default: | 17:42 |
dmsimard | need to take care of lunch, will be back later | 17:42 |
kodiak_f | I don't even have default: so that's probably it | 17:42 |
kodiak_f | Thanks! This gets me where I need to be | 17:42 |
kodiak_f | AFAICT, the current docs go into great detail about the options but don't cover the actual settings.yaml structure - I had no idea these weren't all top level | 17:43 |
kodiak_f | Got past all that funky stuff - now I'm debugging the mariadb connection | 18:08 |
kodiak_f | We see that MariaDB is doing the right thing - and I've logged into mariadb to be sure of this. | 18:10 |
kodiak_f | if anyone has yaml settings examples for maria that'd be very nice to see | 18:11 |
dmsimard | kodiak_f: https://github.com/ansible-community/ara-collection/blob/master/tests/vars/mysql_tests.yaml | 18:13 |
dmsimard | I recommend setting the connection age to >=60 when using mysql | 18:14 |
kodiak_f | This one right? DATABASE_CONN_MAX_AGE: 300 | 18:16 |
dmsimard | yep | 18:16 |
kodiak_f | ha yep all of my settings are the wrong format I think - they are capitalized and don't include ARA_ prefixes - in settings.yaml | 18:18 |
kodiak_f | https://paste.centos.org/view/e95bd0c8 | 18:20 |
kodiak_f | though wait - per the docs they shouldn't have the ARA_ prefix in the settings.yaml right? | 18:20 |
dmsimard | no ARA_ prefix in settings.yaml, those are if you want to configure using env variables instead | 18:21 |
dmsimard | that config looks ok to me | 18:22 |
dmsimard | though I usually edit the default file instead of supplying only the edits | 18:22 |
dmsimard | it could be an issue if SECRET_KEY is not persisted, for example | 18:23 |
kodiak_f | so inexplicably things started working! | 18:24 |
kodiak_f | Thanks very much for the help - is there a place on github I can pluck the default config? | 18:24 |
kodiak_f | I'd like to see if I can create a django superuser (or whatever it is called) in the config so that user-login can be enforced right from the start similar to say - foreman | 18:25 |
dmsimard | it's generated by default if you don't have one | 18:25 |
kodiak_f | is that what SECRET_KEY is? | 18:26 |
dmsimard | no, it's a passphrase used by django to store things and so a different installation using another secret key against the same database would encounter issues | 18:27 |
dmsimard | there's some docs about user things here https://ara.readthedocs.io/en/latest/api-security.html | 18:28 |
kodiak_f | Thanks! | 18:28 |
kodiak_f | hrm /admin 404s | 18:37 |
kodiak_f | maybe the createsuperuser command has to happen first to create that path | 18:38 |
kodiak_f | der | 18:39 |
kodiak_f | . /admin doesn't redir to /admin/ | 18:40 |
kodiak_f | back on track - tahnks again for everything | 18:40 |
kodiak_f | The docs don't cover what settings a user such as 'ansible-callback' might need in order to be used for logging callbacks | 18:50 |
kodiak_f | Creating a new user for that purpose through /admin/ creates the user and dups you to a page where you would set various permissions | 18:50 |
kodiak_f | I'm guessing I'll just push every role that starts with 'api' over? | 18:51 |
dmsimard | that's provided by django out of the box but ara doesn't use it | 18:51 |
dmsimard | only raw authentication | 18:51 |
kodiak_f | ah cool - didn't realize | 18:52 |
dmsimard | you can use READ_LOGIN_REQUIRED and WRITE_LOGIN_REQUIRED to control whether or not authentication is required to read or write | 18:52 |
kodiak_f | so should I push no priveleges from available to chosen? | 18:52 |
dmsimard | not sure, I haven't used those | 18:53 |
kodiak_f | Thanks! So that might confuse new users, almost seems better to in the docs keep them out of /admin/ entirely and use ara-manage | 18:56 |
dmsimard | yeah unfortunately there isn't a createuser command, only createsuperuser :/ | 18:57 |
kodiak_f | ah - understandable | 18:58 |
kodiak_f | Future feature? https://ara.readthedocs.io/en/latest/ara-record.html | 19:08 |
kodiak_f | Seems like /latest/ doesn't --> /stable/ ? https://ara.readthedocs.io/en/stable/ara-record.html | 19:10 |
dmsimard | broken link due to doc refactor, it's already fixed in master branch | 19:17 |
dmsimard | /stable/ points to 0.x branch which is EOL | 19:18 |
dmsimard | https://ara.readthedocs.io/en/latest/ansible-plugins-and-use-cases.html#ara-record-arbitrary-key-values-in-playbook-reports is where that link has moved to | 19:18 |
kodiak_f | ah OK I get it now - so once I upgrade to 1x (when the container drops, pulling latest), that broken link will go away - I get it. thanks! | 19:23 |
*** ccamacho has joined #ara | 20:22 | |
*** ccamacho1 has quit IRC | 20:23 | |
*** ccamacho1 has joined #ara | 22:02 | |
*** ccamacho has quit IRC | 22:04 |
Generated by irclog2html.py 2.17.2 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!