Saturday, 2021-04-03

*** irclogbot_3 has quit IRC03:20
*** irclogbot_0 has joined #ara03:23
*** Arsenick_ has quit IRC04:16
*** Arsenick has joined #ara04:17
*** gvincent has joined #ara06:57
*** gvincent has quit IRC14:31
*** gvincent has joined #ara14:31
*** gvincent has quit IRC14:45
*** stand has quit IRC15:16
ara-slackkfiresmith: Hi Folks - seeing something odd with the say my ALLOWED_HOSTS env var is set up16:33
ara-slackkfiresmith: Here's what I see with docker-compose config (which dumps the running environment)16:34
ara-slackkfiresmith: # docker-compose config16:35
ara-slackservices:16:35
ara-slack  ara-api:16:35
ara-slack    depends_on:16:35
ara-slack    - mariadb16:35
ara-slack    environment:16:35
ara-slack      ARA_ALLOWED_HOSTS: '"[''.college.edu'', ''127.0.0.1'']"'16:35
ara-slackkfiresmith: heh - reading #125 now16:39
ara-slackkfiresmith: https://github.com/ansible-community/ara/issues/12516:39
ara-slackkfiresmith: Sadly the alluded to documentation and switch to settings.yaml isn't very clear to me16:44
ara-slackkfiresmith: 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 is17:12
*** kodiak_f has joined #ara17:32
kodiak_fheya - anyone awake?  Django allowed_hosts is killing me17:33
kodiak_foh wow - that's cool17:33
kodiak_fnever seen an IRC --> slack connector17:33
dmsimardkodiak_f: o/17:34
kodiak_fShould I moan about settings.yaml here or on Slack dmsimard?17:34
dmsimardkodiak_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/teamchat17:35
dmsimardyou can moan wherever you prefer, I don't judge :p17:35
dmsimardALLOWED_HOSTS is the hostname you type in your browser17:36
kodiak_fyep 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 dicts17:37
dmsimardif you intend to reach the web interface or the api over foo.domain.tld then foo.domain.tld needs to be in ALLOWED_HOSTS17:37
kodiak_fHere's what I've gotten so far in paste https://paste.centos.org/view/c6fcb61217:37
kodiak_fara-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_fBUT!  I know it's reading in my settings file that is docker volume mounted because it runs the mysql db migrations17:38
dmsimardnorthbeach.college.edu is in that paste so you should be good -- did you try restarting the container after modifying settings ?17:39
kodiak_fI've been doing a full-on docker-compose kill on them between changes17:39
dmsimardtry going in the container to find out if your settings.yaml is really getting loaded17:39
kodiak_fis there some way to dump the running django config to see what django thinks is the value of ALLOWED_HOSTS?17:40
dmsimardoh wait17:40
dmsimardyour settings.yaml is wrong17:40
kodiak_fI figured that could be the case but it did pass lint17:40
kodiak_fI was just going to figure out if ara-manage could dump running django configs17:41
dmsimardkodiak_f: this is what the default settings.yaml looks like: http://paste.openstack.org/show/804153/17:41
dmsimardneeds to be indented under default:17:42
dmsimardneed to take care of lunch, will be back later17:42
kodiak_fI don't even have default: so that's probably it17:42
kodiak_fThanks!  This gets me where I need to be17:42
kodiak_fAFAICT, 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 level17:43
kodiak_fGot past all that funky stuff - now I'm debugging the mariadb connection18:08
kodiak_fWe see that MariaDB is doing the right thing - and I've logged into mariadb to be sure of this.18:10
kodiak_fif anyone has yaml settings examples for maria that'd be very nice to see18:11
dmsimardkodiak_f: https://github.com/ansible-community/ara-collection/blob/master/tests/vars/mysql_tests.yaml18:13
dmsimardI recommend setting the connection age to >=60 when using mysql18:14
kodiak_fThis one right?   DATABASE_CONN_MAX_AGE: 30018:16
dmsimardyep18:16
kodiak_fha yep all of my settings are the wrong format I think - they are capitalized and don't include ARA_ prefixes - in settings.yaml18:18
kodiak_fhttps://paste.centos.org/view/e95bd0c818:20
kodiak_fthough wait - per the docs they shouldn't have the ARA_ prefix in the settings.yaml right?18:20
dmsimardno ARA_ prefix in settings.yaml, those are if you want to configure using env variables instead18:21
dmsimardthat config looks ok to me18:22
dmsimardthough I usually edit the default file instead of supplying only the edits18:22
dmsimardit could be an issue if SECRET_KEY is not persisted, for example18:23
kodiak_fso inexplicably things started working!18:24
kodiak_fThanks very much for the help - is there a place on github I can pluck the default config?18:24
kodiak_fI'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 - foreman18:25
dmsimardit's generated by default if you don't have one18:25
kodiak_fis that what SECRET_KEY is?18:26
dmsimardno, 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 issues18:27
dmsimardthere's some docs about user things here https://ara.readthedocs.io/en/latest/api-security.html18:28
kodiak_fThanks!18:28
kodiak_fhrm /admin 404s18:37
kodiak_fmaybe the createsuperuser command has to happen first to create that path18:38
kodiak_fder18:39
kodiak_f.  /admin doesn't redir to /admin/18:40
kodiak_fback on track - tahnks again for everything18:40
kodiak_fThe docs don't cover what settings a user such as 'ansible-callback' might need in order to be used for logging callbacks18:50
kodiak_fCreating a new user for that purpose through /admin/ creates the user and dups you to a page where you would set various permissions18:50
kodiak_fI'm guessing I'll just push every role that starts with 'api' over?18:51
dmsimardthat's provided by django out of the box but ara doesn't use it18:51
dmsimardonly raw authentication18:51
kodiak_fah cool - didn't realize18:52
dmsimardyou can use READ_LOGIN_REQUIRED and WRITE_LOGIN_REQUIRED to control whether or not authentication is required to read or write18:52
kodiak_fso should I push no priveleges from available to chosen?18:52
dmsimardnot sure, I haven't used those18:53
kodiak_fThanks!  So that might confuse new users, almost seems better to in the docs keep them out of /admin/ entirely and use ara-manage18:56
dmsimardyeah unfortunately there isn't a createuser command, only createsuperuser :/18:57
kodiak_fah - understandable18:58
kodiak_fFuture feature?  https://ara.readthedocs.io/en/latest/ara-record.html19:08
kodiak_fSeems like /latest/ doesn't --> /stable/ ? https://ara.readthedocs.io/en/stable/ara-record.html19:10
dmsimardbroken link due to doc refactor, it's already fixed in master branch19:17
dmsimard /stable/ points to 0.x branch which is EOL19:18
dmsimardhttps://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 to19:18
kodiak_fah 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 #ara20:22
*** ccamacho1 has quit IRC20:23
*** ccamacho1 has joined #ara22:02
*** ccamacho has quit IRC22:04

Generated by irclog2html.py 2.17.2 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!