VITAS changed the topic of #spacedock to: Problems?: https://github.com/KSP-SpaceDock/SpaceDock/issues | Matrix/Riot Chat: https://im.52k.de +spacedock:52k.de Feel free to ask for help, we only bite a little bit! | If you want to help, please check https://github.com/KSP-SpaceDock/SpaceDock-Backend/issues/5 :) | <VITAS> inet users have the attentionspan of a squirrel...
DasSkelett[m] has joined #spacedock
<DasSkelett[m]> Do you think 512 chars is enough for the lock reason?
<DasSkelett[m]> Now comes with automatic CKAN notification and support for a lock message πŸ₯³ :
<DasSkelett[m]> Hmm, newlines are not preserved. A solution would be
im52kde has joined #spacedock
<DasSkelett[m]> ```
<DasSkelett[m]> {% autoescape false %} {{ mod.lock_reason | replace('\n', '<br>') }} {% endautoescape %}
<DasSkelett[m]> ```
<DasSkelett[m]> but this also allows arbitrary JS code to be inserted and executed. Is it worth this risk, because only admins can use it? Or should we do without line breaks?
<DasSkelett[m]> Hmm, newlines are not preserved. A solution would be
<DasSkelett[m]> ```
<DasSkelett[m]> {% autoescape false %} {{ mod.lock_reason | replace('\n', '<br>') }} {% endautoescape %}
<DasSkelett[m]> ```
<DasSkelett[m]> but this also allows arbitrary JS code to be inserted and executed. Is it worth this risk, because only admins can fill in the lock reason text? Or should we do without line breaks?
<DasSkelett[m]> Oooh, that could work. Let me try
<DasSkelett[m]> πŸŽ‰
<DasSkelett[m]> Yeah, that happens automatically because the markdown text is automatically wrapped in a `<p></p>`. I like that too, so I kept it.
<DasSkelett[m]> Yep! Something else I should change? Rephrase the boilerplate?
<DasSkelett[m]> Unlock-then-relock. Not sure where I should add an option to change the text, and quickly relocking works quite well.
<DasSkelett[m]> Also mods have to be manually re-published after unlocking because there's no way to save the previous published state, but I think that's not much of an issue.
<DasSkelett[m]> Also mods have to be manually re-published after unlocking because there's no way to save the previous published state, but I think that's not much of an issue, admins can do it right there.
<DasSkelett[m]> Is this needed? AFAIK there are currently only about 3 people with admin access to prod. They should be able to find out who did it, and can discuss it here.
<DasSkelett[m]> Ah okay. I mean, it wouldn't be hard to add, it'll behave exactly like `lock_reason`.
<DasSkelett[m]> That's a 401. I guess CKAN will fallback to archive.org if possible, but that would need testing.
HebaruSan[m] has joined #spacedock
<HebaruSan[m]> *edit:* ~~What about markdown?
<HebaruSan[m]> ```html
<HebaruSan[m]> <div class="tab-pane active space-left-right" id="info">
<HebaruSan[m]> {{ mod.description | markdown }}
<HebaruSan[m]> </div>
<HebaruSan[m]> ```~~ -> What about markdown?
<HebaruSan[m]> ```django
<HebaruSan[m]> <div class="tab-pane active space-left-right" id="info">
<HebaruSan[m]> {{ mod.description | markdown }}
<HebaruSan[m]> </div>
<HebaruSan[m]> ```
<HebaruSan[m]> It's nice how it sets off the message text from the boilerplate around it
<HebaruSan[m]> Can "the support email address" be replaced with a `mailto:` link?
<HebaruSan[m]> So the user doesn't have to figure it out
<HebaruSan[m]> Can the admin edit the lock message?
<HebaruSan[m]> Or is it unlock-then-relock?
<HebaruSan[m]> What about showing the admin which other admin locked it, in case they need to discuss?
<HebaruSan[m]> I guess I'd classify it as "nice to have". I might want to exchange forum PMs without having to ask who it was first.
<HebaruSan[m]> What will CKAN users see if they try to download a mod that's been locked? A 404 and/or fallback to archive.org?
tehbeard has quit [Ping timeout: 378 seconds]
tehbeard has joined #spacedock
DasSkelett[m] has quit [Quit: Idle timeout reached: 10800s]
<RockyTV> +1 for markdown
HebaruSan[m] has quit [Quit: Idle timeout reached: 10800s]
VITAS[m] has joined #spacedock
<VITAS[m]> cool stuff
<VITAS[m]> thank you!
<VITAS[m]> theres a difference between site admin and server admin
<VITAS[m]> only darklight and me have server admin
<VITAS[m]> but about 5-6 people have site admin
<VITAS[m]> if i had role managemant i would increase it
<VITAS[m]> e.g. giving people only the right to feature mods
<VITAS[m]> or even per game admin
<VITAS[m]> (ksp2 is a new game)
DasSkelett[m] has joined #spacedock
<DasSkelett[m]> Okay I think I have it ready now. E-Mail notifications for the user when locked is working, and the locking admin is saved in `mod.locked_by` and shown on the mod page.
* DasSkelett[m] uploaded an image: Screenshot_20200515_131910.png (92KB) < https://52k.de/_matrix/media/v1/download/t2bot.io/91740183fd57370c3b4c8ca45ca05d8481a5d073 >
<DasSkelett[m]> Notice the `(locked by ...)` on the unlock button
<VITAS[m]> thats so great :)
<DasSkelett[m]> PR is up. Please take an extra close look at the database stuff, because I don't like database stuff, and I don't understand database stuff, but I had to do database stuff.
<DasSkelett[m]> Of course I tested it, and everything seems to work as expected, but that doesn't say much.
<VITAS[m]> yes database stuff
<DasSkelett[m]> Never liked database stuff. Probably because I never really did much database stuff so far.
<VITAS[m]> if you dont want to do db stuff ... the frontend code needs cleaning up and to be returend to not destroyed bootstrap ....:>
<VITAS[m]> but only if you want to
<DasSkelett[m]> I dislike frontend stuff even more. πŸ˜„
<VITAS[m]> i will throw some eyebals on the db part later :D
<VITAS[m]> what do you like then?
<DasSkelett[m]> Only if you don't need them, please πŸ‘€
<DasSkelett[m]> You're also welcome to look at all the other parts.
<VITAS[m]> i expect to fin them later
<DasSkelett[m]> No web dev at all would be preferable :P
<DasSkelett[m]> But backend stuff is okay
<VITAS[m]> you could check if you can migrate the backend to up to date framework an libary versions
<VITAS[m]> i dont know what allready has been done but i remember when i moved sd to the new server it was a rough patchjob
<DasSkelett[m]> Isn't there a problem that wells are unsupported in Bootstrap 4? I think they are used quite heavily in the frontend code.
<VITAS[m]> yes i was talking more about flask and python
<VITAS[m]> the frontend is a mess and should be redone compleatly
<VITAS[m]> it could get mobile friendly at the same time and also add those cookie warnings
<DasSkelett[m]> Flask seems to be the latest version on alpha (1.1.2). The other packages from `pip freeze` also look fine.
<DasSkelett[m]> Only Python with 3.6 is a bit outdated, yes.
<VITAS[m]> and can we do something about that?
<DasSkelett[m]> I'll try moving the virtualenv and re-creating it, hopefully this pulls a newer python.
<VITAS[m]> you are free to mess up alpha as much as you want. but clean it up afterwards please :D
<DasSkelett[m]> I also find it kinda weird to create in virtualenv right in the project folder, I'd do it in a `venv` subfolder. But if I change this now, we'd need to adjust some pathes in scripts, and it would have to be done on prod in the future too, so I let it be.
<VITAS[m]> no you can change as much as you want if its more inline with the official best practice
<DasSkelett[m]> I also find it kinda weird to create an virtualenv right in the project folder, I'd do it in a `venv` subfolder. But if I change this now, we'd need to adjust some pathes in scripts, and it would have to be done on prod in the future too, so I let it be.
<VITAS[m]> remmeber the code was written by someone who was learning python
<VITAS[m]> if prod needs to change we can do that if we paln it properly
<DasSkelett[m]> Ah okay, python3.6 seems to be the default on 18.04
<VITAS[m]> yes but 20 will come in june
<VITAS[m]> would be good to be prepared
<DasSkelett[m]> Install Python3.8. Let's see if I can get the venv set back up
<VITAS[m]> go DasSkelett !
<VITAS[m]> cheers
<DasSkelett[m]> Alpha is back up again. Downloading mods works, I guess we are fine. Let's test uploading to be sure πŸ˜‰
<DasSkelett[m]> Works. We are now running Python 3.8 on Alpha. I'll repeat the process on Beta.
<VITAS[m]> cool
<VITAS[m]> so we should do the next update on prod when prod gets ubuntu 20
<DasSkelett[m]> Note: Python3.8-dev needs to be installed, else uwsgi won't install.
<VITAS[m]> could you edit the readme in git with the install isntructions?
<DasSkelett[m]> Yep. Beta also doesn't want to start for another reason, I'll try to figure it out.
<VITAS[m]> who breaks it fixes it or calls darklight :D
<DasSkelett[m]> Pystache is broken for some reason on beta, even if it is the same version as on alpha
<DasSkelett[m]> Pystache is broken for some reason on beta, even though it is the same version as on alpha
<DasSkelett[m]> pystache seems to be stuck in Python2 land (last updated 2014), thus invalid syntax. No idea why it works on alpha though, really weird.
<DasSkelett[m]> There seems to be a replacement for it, not sure how drop-in it is. https://github.com/noahmorrison/chevron
<DasSkelett[m]> I'll check it out locally and test it. We use it only in `email.py` anyway.
<VITAS[m]> and so the archelogy begins :D
<VITAS[m]> tell me when you reached roman times :P
* DasSkelett[m] uploaded an image: annex-chaplin-charlie-modern-times_01.png (3682KB) < https://52k.de/_matrix/media/v1/download/t2bot.io/cdf56ddc2972d5678f4fc7e48a3884eab58bedae >
<DasSkelett[m]> Ha! Right into the modern times. Beta works again.
<VITAS[m]> gearhead
<RockyTV> I liked the old frontend :p
<RockyTV> what framework would you prefer vitas
<RockyTV> bootstrap or bulma or any other one that isn't bootstrap?
<VITAS[m]> if we are talking frontend only i would still use bootstrap because adapting it would be easiest
<VITAS[m]> i dotn want to go back to the old design
<VITAS[m]> its more about the code
<VITAS[m]> and using propper bootstrap as it was intended
<VITAS[m]> (remember even ks didnt use bootstrap as it shoudl have been)
RockyTV has quit [*.net *.split]
DasSkelett[m] has quit [*.net *.split]
tehbeard has quit [*.net *.split]
Lartza has quit [*.net *.split]
DuoDex has quit [*.net *.split]
NBones has quit [*.net *.split]
Majiir has quit [*.net *.split]
VITAS[m] has quit [*.net *.split]
im52kde has quit [*.net *.split]
tehbeard has joined #spacedock
VITAS[m] has joined #spacedock
DasSkelett[m] has joined #spacedock
im52kde has joined #spacedock
DuoDex has joined #spacedock
RockyTV has joined #spacedock
Majiir has joined #spacedock
Lartza has joined #spacedock
NBones has joined #spacedock
<DasSkelett[m]> I PMed that guy on the forum who posted he can't view his profile.
<VITAS[m]> thank you
<DasSkelett[m]> Interesting, because I can view the profile page just fine.
<DasSkelett[m]> Interesting, because I can view his profile page just fine.
<VITAS[m]> adblocker or alike?
<VITAS[m]> i know it saometimes hides the dl button
<VITAS[m]> maybe other parts too
<DasSkelett[m]> Would be a crappy adblocker. uBlock Origin doesn't hide anything, just tested.
<VITAS[m]> yes but some adblockers react to certain sized elements
<DasSkelett[m]> Uninstall these adblockers, install a proper one, problem solved πŸ™‚
<VITAS[m]> sure and then demand everyone to switch to linux
<VITAS[m]> thats how it works
<DasSkelett[m]> Yes!
<VITAS[m]> this site requres this specific build of linux and only runs on 1366x922 on a 3.3336 ghz cpu
<VITAS[m]> back to the 90s we go :D
<DasSkelett[m]> Really? You know what I'm just listening to, right now?
<VITAS[m]> may i suggest:
<VITAS[m]> i should make another of those 90s techno mixes
<VITAS[m]> https://staticweb.52k.de/dbmix1.mp3 not 90s but i like this one
<DasSkelett[m]> Well now I have a few hours worth of listening to.
<VITAS[m]> yes
<VITAS[m]> all for your motivation :)
<DasSkelett[m]> Hmm, the guy with the profile error says he gets 500s. Maybe it's an unpublished mod of him making problems during page load, but I can't check this.
<VITAS[m]> wasnt there a feature to impersonate?
<VITAS[m]> if youre not admin ill make you one
<VITAS[m]> i need the username on SD
<DasSkelett[m]> Yes, there is and that'll probably help, but you are right in that I'm not an admin
<DasSkelett[m]> Take a guess
<VITAS[m]> Tom
<VITAS[m]> Edward
<VITAS[m]> MrCheeseStick
<DasSkelett[m]> Almost
<DasSkelett[m]> Guess what, it's DasSkelett!
<VITAS[m]> now you are
<VITAS[m]> go my child and rescue the world from 500!
<DasSkelett[m]> πŸƒ πŸ’― πŸ’― πŸ’― πŸ’― πŸ’―
<DasSkelett[m]> Well yeah, I can confirm he gets an internal server error...
<VITAS[m]> hmm wheres the log i could check?
<VITAS[m]> they have screen processes i think but i dont know the process that actualy serves you
<DasSkelett[m]> Hmm yeah, good question We would need a log from Flask I think, not sure where we can find one.
<DasSkelett[m]> Maybe `/var/log/apache2/spacedock.info-error.log` contains something, not sure
<VITAS[m]> ill check
<VITAS[m]> reload the 500 error
<DasSkelett[m]> Done
<VITAS[m]> nothing
<DasSkelett[m]> :/
<VITAS[m]> ive stuff like these in acc:
<VITAS[m]> 10.150.1.9 - - [15/May/2020:19:04:32 +0000] "GET /profile/Nigel_Cardozo HTTP/1.1" 500 338 "https://spacedock.info/mod/2100/All%20Tweak" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:76.0) Gecko/20100101 Firefox/76.0"
<VITAS[m]> 10.150.1.9 - - [15/May/2020:19:04:45 +0000] "GET /profile/Nigel_Cardozo HTTP/1.1" 500 338 "https://spacedock.info/mod/2100/All%20Tweak" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:76.0) Gecko/20100101 Firefox/76.0"
<VITAS[m]> not related to our problem but still
<DasSkelett[m]> Yeah that was me I think
<VITAS[m]> it was?
<DasSkelett[m]> Yes. That's his profile.
<VITAS[m]> maybe that helps
<VITAS[m]> i see a certain mod
<VITAS[m]> is see the combination of mod and 500 error only with you today
<VITAS[m]> i can acc that mod directly
<VITAS[m]> i only get the error if i impersonate him not if i visit the mod or his profile regularly
<DasSkelett[m]> I think that's just the referrer that Firefox keeps sending
<RockyTV> his profile might include bad stuff or something like that
<RockyTV> I remember having a similar issue when testing SD locally
<VITAS[m]> yes but how to debug?
<VITAS[m]> i can monitor wone process and reload often enough for it to show up
<VITAS[m]> depending on how you neter the profile
<VITAS[m]> it dosent have a gameversion id
<RockyTV> mod doesn't have a default version
<DasSkelett[m]> I try to find something in the code that is shown to the user itself, but not to others and admins.
<VITAS[m]> because you directly anter the profile and havent clicked on ksp
<VITAS[m]> beforehand
<VITAS[m]> -a +e
<VITAS[m]> the gameversion is missing
<VITAS[m]> not the modversion
<VITAS[m]> and gameversion is missing because the gameid is missing
<VITAS[m]> and gameid is missing because you start out on spacedock.info/
<VITAS[m]> and then edit your url to go directly to his profile
<VITAS[m]> and you didnt click on ksp
<VITAS[m]> or something like that
<VITAS[m]> anyway you figure it out guys :)
<DasSkelett[m]> Are you speaking of All Tweak?
<VITAS[m]> im speaking of the profile that tries to load mods and display them
<VITAS[m]> as thumbnails
<VITAS[m]> mods are game bound
<VITAS[m]> the profile is not
<VITAS[m]> but i might be wrong and that isnt the problem
<RockyTV> the error is because the mod doesn't have a default version
<VITAS[m]> how did he manage that?
<RockyTV> I think it's because the mod was published and doesn't have a version, though I'm not sure if that's even possible
<VITAS[m]> exactly
<DasSkelett[m]> Which one?
<VITAS[m]> and it seems to be abug we want to fix
<RockyTV> I think the issue is here, after you create a mod and don't upload any files, it doesn't update the default version
<VITAS[m]> Version 0.7 for Kerbal Space Program 1.9.1 they have gamecersions itself
<VITAS[m]> he has files
<VITAS[m]> ill check the db
<RockyTV> yeah but if you create a mod without a zip file, it's like it doesn't have a default version
<DasSkelett[m]> It won't let you do that AFAIk
<VITAS[m]> and it has a default version number
<RockyTV> is that the faulty mod?
<VITAS[m]> yes
<RockyTV> his profile is working for me
<RockyTV> and all tweak is here
<VITAS[m]> yes
<VITAS[m]> but if you impersonate him its not
<VITAS[m]> and throws above error
<DasSkelett[m]> That's why I suspect an unublished mod of him, but he says he doesn't have one
<VITAS[m]> we should see it
<RockyTV> ^
<RockyTV> and that's weirder because I'm pretty sure I fixed this issue with unpublished mods
<VITAS[m]> my guess is that the profile hasnt got the gameid and thus the gameversion for some reason
<DasSkelett[m]> Yes I'm looking at your PR right now
<VITAS[m]> May 15 19:13:46 sd1 gunicorn[831]: return getattr(obj, attribute)
<VITAS[m]> May 15 19:13:46 sd1 gunicorn[831]: jinja2.exceptions.UndefinedError: 'None' has no attribute 'gameversion'
<RockyTV> I don't think so VITAS[m], the error is because there's no default_version field, so it can't get the gameid/version from the mod version
<DasSkelett[m]> But what does a profile have to do with a gameid?
<VITAS[m]> the mods need gameid
<RockyTV> I'm gonna try creating a new test mod with an empty zip file
<VITAS[m]> but the profile doesnt supply it in any case
<RockyTV> this is the line causing the error:
<RockyTV> {{ mod.default_version.gameversion.friendly_version }}
<RockyTV> default_version is None thus there's no gameversion field
<VITAS[m]> i see it the other way arround
<VITAS[m]> gameid is null
<VITAS[m]> resulting in gameversion beeing null
<VITAS[m]> but anyways
<VITAS[m]> all i can supΓΌply is the error message
<VITAS[m]> the question is now can we recreate the error on alpha?
<VITAS[m]> and then find ways to fix it there?
<DasSkelett[m]> VITAS can you check in the db if one of his mods doesn't have a default version?
<RockyTV> I created a new mod and it worked
<VITAS[m]> sec
<VITAS[m]> oooh yes
<VITAS[m]> Intake Air-Drain it! exists twice
<DasSkelett[m]> Also I just confirmed that admins do not see unpublished mods on the profile page.
HebaruSan[m] has joined #spacedock
<HebaruSan[m]> Don't the exceptions go to syslog?
<RockyTV> VITAS[m], remove the one that isn't unpublished or doesn't have a default version
<VITAS[m]> HebaruSan: thx found that
<HebaruSan[m]> Digging the stack trace out of `dmesg` should settle the question of what's causing it
<HebaruSan[m]> `dmesg -u` ?
<VITAS[m]> worked?
<VITAS[m]> please check
<DasSkelett[m]> Yes
<VITAS[m]> cool
<VITAS[m]> my theory: he made a mod and then imidatly made another with the same name
<DasSkelett[m]> Did you remove the duplicate mod?
<VITAS[m]> he didnt finish the first one
<VITAS[m]> yes
<VITAS[m]> we couldnt see the first because it was overlayed with the later oen with the same name
<VITAS[m]> we could check if a mod with the same name exists and prevent users from making another
<VITAS[m]> woudl also help douping by other users
<VITAS[m]> (not only id shoudl be unique but name too)
<HebaruSan[m]> Or handle non-unique names better
<DasSkelett[m]> I start by fixing admins not being able to see unpublished mods and catching `mod.default_version` being `null`
<DasSkelett[m]> I don't think it's a non-unique name problem
<VITAS[m]> i think we can learn multiple things from it
<RockyTV> did you submit the pull request
<DasSkelett[m]> I submitted the PR to fix the profile page now, but there are more places we need to implement checks, for example the mod page itself.
<DasSkelett[m]> I'm not sure what we should do with the primary download button in such a case for example.
<DasSkelett[m]> I'd prefer setting `nullable=False` for `Mod.default_version_id`, so any action that would result in setting it `None` would fail. But that would need a somewhat complex database migration, and it would conflict with <span class="d-mention d-user">VITAS</span> plan to allow mods without releases to exist.
HebaruSan[m] has quit [Quit: Idle timeout reached: 10800s]
VITAS[m] has quit [Quit: Idle timeout reached: 10800s]
<RockyTV> DasSkelett[m], I messed it up on my review, had some comments to add but approved before requesting changes :P