#hangar-dev
1 messages ยท Page 10 of 1
i don't know anything about the current state so I can't compare it to a previous state :p
noice
why is that a thing?
iirc mini, you don't need to add nonce to scripts that load stuff from url's that are listed in the CSP header
only for script tags that you have plain javascript inside
yeah idk why I did that, I had a bit of a fight
although, if you do add the nonce, do you have to include the hostname in the CSP header?
if you can just include the nonce in all the script tags, that might be better
He really did it
at hangar, we take user request serious!
Even if it wasn't meant to be taken seriously ๐
need skript support next...
Brb, lemme compile script jar to wasm first
Or wait! I'll just use gwt!
Do we wanna bet if Skript works in gwt? ๐ ๐
On that note, i just saw on Twitter that somebody finished his wasm SMB impl, isn't the future great? ๐
you just said a bunch of random letters that have no meaning to me ๐
speaking of random letters that have no meaning
that'd be a totally awesome prank to play on someone... go into their pc and change all their fonts by just switching two letters
I think it'd take me a while to think of the font as the issue if I found that
||we did something like that with player messages on a server||
ok, so am playing around with paypal a bit, its rather fun
Making you looking like a billionaire :3
So plan is you gotta donate $5 to create a new project right? Gotta charge for status changes as well. ๐ take the EA model.
Nah gotta make it pay-to-approve
No staff to actually approve the resources, either wait 2 weeks to approve, or receive Hangar crates for visiting daily then pay $37.99 for a pack of 5 approval keys to unlock the crates that might contain a free approval
now I just gotta figure out how I can tell paypal to actually send IPN
and then do the whole backend ๐
2021-01-07 19:14:14.118 INFO 1 --- [onPool-worker-3] io.papermc.hangar.service.PaypalService : Receiver is: minidigger-author@hangar.minidigger.me
2021-01-07 19:14:14.118 INFO 1 --- [onPool-worker-3] io.papermc.hangar.service.PaypalService : transaction id is 29V83400L18625404
2021-01-07 19:14:14.119 INFO 1 --- [onPool-worker-3] io.papermc.hangar.service.PaypalService : Status was completed
2021-01-07 19:14:14.119 INFO 1 --- [onPool-worker-3] io.papermc.hangar.service.PaypalService : Currency USD amount 20.00 fee 0.88
2021-01-07 19:14:14.119 INFO 1 --- [onPool-worker-3] io.papermc.hangar.service.PaypalService : Was test ipn
2021-01-07 19:14:14.119 INFO 1 --- [onPool-worker-3] io.papermc.hangar.service.PaypalService : Payer minidigger-buyer@hangar.minidigger.me
2021-01-07 19:14:14.119 INFO 1 --- [onPool-worker-3] io.papermc.hangar.service.PaypalService : Custom
that was easy
๐
my IPN code broke for subscription tho
posting for future reference
2021-01-07 19:36:17.079 INFO 1 --- [onPool-worker-3] io.papermc.hangar.service.PaypalService : Verified ipn: {charset=UTF-8, business=minidigger-author@hangar.minidigger.me, payer_email=minidigger-buyer@hangar.minidigger.me, receiver_email=minidigger-author@hangar.minidigger.me, recurring=1, payer_status=verified, last_name=MiniDigger, mc_amount3=20.00, reattempt=1, subscr_date=11:35:31 Jan 07, 2021 PST, notify_version=3.9, residence_country=US, mc_currency=USD, test_ipn=1, amount3=20.00, txn_type=subscr_signup, subscr_id=I-22YKC67HNW3T, period3=1 M, payer_id=FHTXGJW2L68DN, verify_sign=AfZ0l8aEstwgUfENnMUNUA5tzTi7AFo-HaASfh4eu.7LF48ycmoO3e3E, first_name=Martin, ipn_track_id=93fa0be5e2600}
2021-01-07 19:36:17.080 INFO 1 --- [onPool-worker-3] io.papermc.hangar.service.PaypalService : Receiver is: minidigger-author@hangar.minidigger.me
2021-01-07 19:36:17.080 INFO 1 --- [onPool-worker-3] io.papermc.hangar.service.PaypalService : transaction id is null
ooo secrets!
sandbox, lol
nah ik
is the husky git hook working to fix all ur formatting issues?
or nah.
I hoped it would prevent bad indentation
I just need to install it properly
@mellow pebble return didnt work for donations
actually
nvm
as I was typing
thanks!
I was gonna say, strange you can return for payments but not donations
tomorrow ill implement the backend
store transaction IDs, IPN and stuff
send notifications to authors
so much to do
but I think this is good enough for a POC
should get a list of possible perks going
unless I already did that... and forgot about it
oh I did badges https://github.com/PaperMC/Hangar/issues/272
Animated pfps ๐
yeah, that was def mentioned somewhere
I mean, hangar-auth allows me to upload gifs, buuut https://i.imgur.com/qjteO6A.png
lul
yeah, some issue sending that from hangarauth
I mean, it does if you make uploading of animated avatars a paid perk
But then you'd probably just want to have a boolean on auth for that
but I thought auth kinda held the main user db row
and you'd want donations associated with that user, idk
I don't have the model in kind, doesn't hangar itself have an author too?
To link projects?
Or are projects just linked to user id?
But like, donations could be linked to org, user or project
I meant the person who made the donation tho
I would link donations to receiver, not sender
Sender is still in the table as a user id, so you can still query all donations of a user
But it makes more sense to attach them to the receiver i would say
Is this sandboxed or are you currently throwing out hundreds of dollars out of the window?
Cool
noice
Man Mini has either 50.128 or 03 EURs but it's hard to tell
No, he has 148.400 USD
Imagine how many drinks you could get with that ๐ฅบ
yeah, I think Europe messed up commas and periods in numbers...
I think that's a german thing
It's only some parts of germany
it's the only thing that's wrong in germany!
Eh
As long as you don't use 3 decimal places it's okay
Other things would be that many people in germany don't use an asterisk in multiplication (at least I was taught that)
Only $148? damn
It's used in whole Europe except for the UK and maybe one or two other countries
e
hi i'm am starting at plugin programming for spigot/bukkit and using eclipse IDE i didn't even made my first plugin and i need some tips, but i'm not here just to it, i don't know how to compile it and test my server, how do i do it?
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
...
oh sorry, wrong channel
Curious: why donโt you guys just use XenForo resources like spigot?
Why pay for Xenforo if you can have a dedicated and better system for free (excluding time spent for development)
Because xenforo is the reason spigots resource section is so bad
- XenForo expensive
- XenForo bad
for support/maintance, yes iirc
xenforo doesn't have cool stuff like an API, not support for stuff like multiple resource owners, etc
Will Hangar have multi-language support?
๐คทโโ๏ธ
Not sure that's worth the complexity, in theory it's possible tho
Both our server sided and the client sided message apis do support multiple locales
I see
can i haz verification tnx.
Not sure what you're asking for, but this channel is for discussion of Hangar
Not sure if we're currently approving people, @pallid yoke ?
Sure why not, if they wanna test
@carmine heath If you DM me the email you used to sign up, I'll approve your account
You gotta send her the link, you can't click it yourself
Shh I remember
thanls!
i 'member
mini how different will hangar be from the bukkit API?
Wat
bukkit API? Bukkit dev or something else?
Do you understand what hangar is?
It's a replacement for spigots resource section
It has nothing to do with Bukkit
Worse than mini after lots of beer.
then I confused this with the independence of paper
this is a part of that
Hangar will be the site where you get paper plugins
Figured out
Making us independent of spigots resource section
It's a requirement for all further steps
Revolutionary I see
Paperweight (the Gradle plugin that allows us to use mojang mappings) is another requirement, as it drastically reduces the maintenance burden
alright mini, gn
Better approve PlaceboRemover tmrw, it has almost as much views as essentials.
is PlaceboRemover just a TruAntiLag ripoff?
Oh no, I actually called it LagRemover
I think I should put EnchantmentsPlus on there to be the first CE plugin on Hangar
I like how the TOS redirects to google
I always use Google for dummy links, lol
@carmine heath what are you uploading?
more specifically, can you post your plugin.yml (or equivalent)?
that error is when its missing something (or more likely, the validation is broken)
lovely
oh is this a new logo for hangar ๐
It always looked like that ^^
We don't have a proper logo yet so I never replaced it
@carmine heath mmkay, should be all fixed. For some reason, an author field in plugin.yml was required, but it shouldn't be. Only required things are name and version now.
How does one get through the email verification for Hangar? It appears to not send a verification link via my email.
someone will send it to you sooner or later
Okay cool
https://github.com/PaperMC/Hangar/blob/master/src/main/java/io/papermc/hangar/controller/filters/ContentSecurityPolicyFilter.java#L51
there a downside to changing this to upgrade-insecure-requests?
getting a weird issue
Blocked loading mixed active content โhttp://hangar.minidigger.me/Narimm/Prism-Bukkit/versions/2.1.8-SNAPSHOT.4/reviewsโ
which results from a simple location.reload() on a button click.
when I run location.reload() from the devtools, it reloads fine.
No you have to ask for it.
Interesting that a reload uses the wrong protocol
Strange, since window.location does contain the protocol
But yeah, doesn't seem a bad change then
We don't loose much
@pallid yoke Gonna get a mock up started for the new logo, any ideas on how you'd like it to look?
I'm sad to see my awesome logo get replaced
lol it is awesome for Ore!
OHHH
yea ๐
Still sad we're not using this one https://cdn.discordapp.com/attachments/746367733699969104/788161015749541899/unknown.png
Yeah thats awesome I didnt see that. @mellow pebble Do you have the bg for that hangar logo? The hangar part that is?
I could try and works something out for that
That's just a fucked up non symetric curve i made in Illustrator
fair ยฏ_(ใ)_/ยฏ
I don't think anyone really has an idea of what exactly it should look like other than "hangar and paper planes" ๐
no wait it actually is an ellipsoid with a white on layered on top since i dรญdn't know how to make it hollow
I did try and make a proper logo at one point but gave up
Main idea was the Paper squares with something that looked like a hangar or had some sort of relevant symbolism instead of the plane
Also had the thought of changing the squares behind the grey square to be different shades of the same colour
(not saying you have to go with any of this, that's just ideas I had before I knew how to use illustrator)
re:
There could be something like this or with a different hangar design in the background. Suggestions?
Generally, am open to everything and I am sure we can brainstorm in here and stuff
Since the name hangar is a play on the paper plane logo, something like auroras mockup is a nice direction
Sweet, perhaps we can add different mockups around that design and see which one fits best
star trek vibes anyone?
make it a star trek logo
that would be pog
just put paper icon there
and boom

srsly try it once XD
ehhh im good
lol ok
that was kinda where i was going with my idea ๐
sweet! Lemme know if you have any more ideas and Ill see what I can do for it
if i can add my singular cent, i like the more minimalistic direction silent is taking
I like it, but it seems to me like the paper plane is not centered. Or it is, but it looks strange because of the perspective of the plane? Idk. It's too far on the right
Was thinking something along these lines (though obviously with a better hangar than that)
Also tried a couple fading between shades
And this one fading between two different colours from the squares (in retrospect this one looks a bit PS1-startup-esque)
honestly why not that
Idk looks a bit scruffy to me
Small paper plane in there maybe?
Was thinking we could use the colours to differentiate between different projects under Paper's umbrella, but then idk how many Paper projects would get their own logos
The shader one is also a nice concept
I thought about that as well but I think that will look too crowded
Could try a paper plane but feel like it might look a bit crowded
I like that idea
hmm (middle is 1.1)
I still like the second one
I like the middle one, but I agree the paper plane makes it too crowded.
And could imply that hangar is limited to paper plugins, which it isn't iirc
the second option with the gradient looks nice, but I think the gradient should be a bit more spread out maybe?
and yea, without the plane
if we go with the gradient we have to get logos for everything else as well ๐
I like the second one too, but i also don't like the color paper stack in the first place
PaperMC Org can have all the colors and every project gets one color
Yeah, I like that, every project then has a "slice" of the organization logo.
Since the current logo has all the different colors.
Nice idea
And we still have the paper in the hangar logo, cause of the stack of rotated papers
exactly
what happens if paper runs out of colors?
Oh and as a project overview you could have a nice animation with the paper sheets ๐
I doubt that will happen
then paper shuts down, we all have to move to spigot
Running out of colors I mean
why not put the paper logo on the hangar in the white space? like it's paper's hangar but anything can go inside
not a big fan of the hangar tbh, looks too much like a barn. But the colors are nice
.
there isn't much of a difference between a barn and a hangar
If pigs can fly, none
besides what it's used for
the shape is a bit different usually
It's a picture in your head that you associate with something. I can see what Malfrador means when I look at it
By "more spread out", do you mean bigger differences between the colours, or something else?
I mean, idk about you but if someone says "hangar" to me I don't picture anything
yeah. I think it gets too dark too fast
Maybe instead of it going all the way to the gray of the "front" square, it could go like halfway?
maybe like that
Peak laziness is firing up IntelliJ and copying code from an Adventure PR to generate colours
Just playing with the colours, how does this look (1.2)
(compared to second above)
why orange? I think its a little close to sponge's yellowy-orange
I liked the initial more, probably because the color difference was much more noticeable
Randomly picked from the Paper logo colours, see #hangar-dev message
o i c
hmm, could try a bit darker? I kinda prefer the distance in colours between the squares behind and the grey square compared to the initial one
Yeah I understand, the initial one was too close
Also this was another shot at incorporating the plane, but meh not really a fan of including the plane in general (as mini pointed out, the squares kinda already incorporate paper)
xd
idk, I like that except the plane looks off-center
ik it might be technically centered, but it looks like its to the right
I agree
Gonna tweak the colours again
Yeah that looks weird
Because the outer thing has hard corners, and the soft corners of the hangae
Another shot at the colours (1.3)
I'm certainly not a whiner, but it might be a bit too dark now xd
Idk why but I still like the initial version the most
Which initial version? The initial orange->grey one was darker
This one
Yeah, that's darker?
It doesn't have a background bc I exported that instead of screenshotting, this is what the initial one would look like on a while background
(1.1)
(also note that the last square is a weird colour bc I did the maths wrong and picked that one at random)
Ah, yeah. Now it's looking worse.
Maybe the perfect version is between this and that one?
.
.
hmm, not sure that I want to go any darker than that tho
imo it looks weird fading exactly to the grey used in the frontmost square
Can you make this background transparent and send it here?
1.3
also for this one?
i like that
god this is confusing
#hangar-dev message this one?
i'm not sure what the difference between the last 2 is but i like both
I would personally go with 1.3 because 1.2 looks a bit more flat (less difference in color between them)
Or you have to add a little shadow to every paper
I prefer 1.3 too tbh
Kinda wary of adding a shadow bc it'll probably look worse at smaller sizes
Yeah prob.
(willing to bet most people don't even know the paper logo is 10 squares, I didn't until I ran hangar without css once)
But I like the concept of every paper in the stack being a different project
Nah, that should be noticeable right?
It's pretty hard to tell, I thought it was just some rainbow gradient until I saw it at full res lol
well its an svg right? not really a "full res"
xd
but yeah, hangar w/o css its just a big logo
Can't remember if the 500x500 PNG or the SVG was embedded, but either way it was considerably bigger than it was meant to be
Different hangar shape (1.3.1)
Any thoughts on that hangar shape? Looks a bit thin to me but idk
I think it looks less like a barn like this.
But, idk.
A lot of hangars seem to have higher cutout in the middle. But not sure if it'd look good on a logo, especially in smaller sizes.
https://www.rubbusa.com/wp-content/uploads/2019/01/DSC_0763.jpg
Yeah, that was my thought too
I think this is better than the previous one
Me too. I was wondering how more "rough" ceiling would look like though. Especially since it looks like most hangars are like that. And Paper logo doesn't have big rounded corners either.
So, like currently, but make the ceiling out of 2/4/6 straight lines, instead of half-dome.
Instead of round, the top could be a triangle
Might look less weird than the round stuff in contrast to the square paper stack
That's what I meant with sharper, 2-line ceiling.
Does someone remember my pullrequest yesterday?
Iยดve discovered that it does not work if you are logged out ๐
The plane does?
3 looks like a rj45
I prefer 2
ffs what is this
Thx discord, grabbing emojis at its best
I still want the helmet version of 2 ๐
3
3 looks a bit too much like rj45. But I like it anyway.
Though I feel like door from 2 with ceiling from 3 could look better.
3 do be looking dope
I think that could be nice as well
Might be better than the current two imo
pretty sure he already had a mockup of that, looks a bit boring imo
eh not quite, the ones before had slightly rounded roofs with a spike on top
3 looks better than 2 imo, but I still prefer 2 of the previous batch
The top image of that screenshot is the same as the top-right from the previous screenshot
Yeah, that one looks best imo
I prefer it without the RJ45 door as well, but idk
Same
rj45 door lol
what's this
well we're pretty sure the entire frontend should probably just be moved to vue.
and therefore nuxt for that ssr goodness
so that was just a demo
I literally only just used default theme and made part of the main page
Vue

I also went with typescript since if it happens, its a kinda "from scratch" thing, but idk if people like that or nah
it certainly makes writing the code easier
(once I figured out how to do it ๐ )
ts is definitely more bearable than js
I can tolerate js and vue
Typescript and vue was a mess in the beginning but tooling improved since then
take a look at the nuxt-frontend branch and let me know what you think
Yeah i saw, have to do actual paid work first tho ^^
๐
seems generally fine, I think I understand everything
the $api took me a while, but its like the prototype stuff in normal vue
Yes. Difference is, just make sure you arenโt using localStorage, or โwindowโ or smth
Cause that isnโt guaranteed to exist
we do need to store stuff in local storage too (thats where the session stuff goes iirc)
but I assume we can tell a component to not server render, right?
Yes.
just scrolled thru the nuxt docs, they say you just use the mounted and beforeMount hooks for that
How does spring put stuff in local storage tho? Cause thatโs client side.
I like the validate thing
localStorage is client
Well I just changed it to use cookies. So you donโt need local storage
I think thats the only place where we use that
cookies arent a good replacement for local storage, I would stick to local storage
Hmm, see, weโd miss out on a good opportunity for ssr stuff tho...
Having the main page already list projects.
As an example, since getting the list of projects requires session stuff
mmh
Like itโs useful to have the users session server-side via cookies as well.
we did that with headers before, right?
Well isnโt that how cookies are sent around anyways?
yeah, it seems like cookies are the solutions that ppl bring up
feels like a step back but oh well
its just that we have way more control over local storage than cookies
Yeah, for sure, but itโs important I think to have access to the session server-side
Yeah, I looked at that.
Iโve tried using it in the past for discord oauth, but Iโve just ended up writing the logic myself.
it just removes some builerplate I guess
only other concern I have really is having to write types for stuff
but I guess theres no way around that
There is smth out there for auto generating types via swagger schema I think.
But the API is gonna need some serious expanding anyways
Yeah.
but I am not opposed to that
we can focus on trying to replicate ores layout, but shouldn't spend time on style yet
and then we can just style vuetify
Me either. I almost want to just start completely over on the API and make sure there is access to everything.
and dont have anything legacy
So you are fine with vuetify?
Itโs just what Iโve used so I used it in the demo
yeah, I used it before, I remember now seing all the types
unless you have other proposals for a component lib
I donโt know any others, but other people might.
I know bootstrap vue exist and I have used that before
but its constrained by bootstrap I think
I like vuetify more
But if we wanted a more material design like papermc.io... I donโt think bootstrap is the way to go.
we not talking about design here
I dont care how the components look
that we need to solve ourselves anyways
the default style will never work
Right ok. I seem to keep forgetting that.
my company website is bootstrap and there is no way to tell that
but yeah, lets go with vuetify unless somebody disagrees
When I think bootstrap... I seem to just think โthe default bootstrap feelโ
because many ppl are lazy to write the styles ^^
What did you use to generate the generated api models?
ore and swagger
Oh swagger has something for making Java classes?
if you want to restructure so much, lets have the new frontend in src/main/frontend, rename old frontend to frontend-old, do the same with the current controllers, move them to a controllersold and then copy stuff over
and do /api/v1 for external and /api/internal for the new internal apis
Ok yeah, that was gonna be another question, is all the API gonna be public api.
I think we can probably have some models for both, maybe internal models extend the public ones with more fields
I dont think we need to restrict the internal api (and some we might even need to call from the client ourselves, like reloading projects on filter and stuff), but I would make a distintction between "this is stuff we guarantee is stable and is to be used by bots" and "this is our stuff for the website, no touchy"
yeah I hate how currently stuff is so weird and duplicated
Yeah, thatโs bothered me for a while. Also, the lack of abstract classes and interfaces for stuff thatโs in like half of the db/api models
for swagger code gen: https://editor.swagger.io/ paste content of https://hangar.minidigger.me/v2/api-docs say yes to convert to yaml, then generate client
and see if one of the options fits
this is what TS fetch generated
ah the types are here
meh
lets just write it ourselves
the types arent really usable
I did some of the types for things, itโs not that bad
Unless I did them wrong... idk,
and code gen is the reason current api in hangar has this shitty model
man, vuetify got crazy new components
Thereโs some fancy stuff
was way less when I last tocuhed it
I wonder how much JS we ship when we do SSR
in theory the bundle size should be way smaller
but no clue how smart nuxt build system is
For vue ssr, itโs just nuxt and quasar right?
you can do ssr without a framework too
but nuxt is nice builerplate for the layout and pages shit
and has nice vuex stuff, we dev should use that more
kek
ppl at my company struggeld so hard to implement a stepper
this is nice for project setup and stuff
It looks sick on mobile, (the stepper)
I had only seen it on desktop
(A component lib will probably make making mobile-compatible pages way easier)
well, you still have to check and set cols for mobile
but yes
if you want you can continue the setup I described above (if you agree) and then others can join
can prolly revive on of the github issues for the pages
else I can setup stuff after work, but its gonna be another 6 hours, long day ahead
this?
yeah
its super late for me, but I can work on it tmrw (6-8 hours)
in 6 hours
ah ok, we will see who is first then, have a good one
One thing we need to keep in mind if we do ssr in this way is that we have stateful html and can't cache it
That's a potential downside
@MiniDigger#0000 ัั ะบัะพ?
@MiniDigger#0000 Who are you when you write if you're not here?
Beep boop ๐ค

@midnight anchor i love your profile picture
:P
WOW! I just turned on my pc to move the stuff
heh
you can do it if you want, I wanna fuck around with nuxt in general a bit
do you run spring or port 80 or smth?
nuxt is trying to access port 80 on the server when I open localhost:3000 in the browser
ah backend url wasn't defined
Yes, gotta make that .env file.
I just made it default to localhost:8080 for now
so do you wanna do stuff for should I?
You can. I decided to eat instead
I didnโt put the front end in the same place, since itโs going to be running as a whole separate thing.
I just thought itโd be better for it to be more separated from the backend.
Like, the maven-frontend-plugin isnโt needed anymore, and you probably just have to add a bit to the deployment docker-compose
meh I dont like polluting the project root so much
but I guess that makes sense
ill name it frontend tho
Yeah call it whatever. I also donโt like cluttered roots (oreโs root just makes me wanna die inside) but itโs just one folder here
Oreโs got like 200 modules in its root
how do we wanna design the model?
we still need seperate model for db, right?
or can we make DB return the api/internal model already?
We already have the db returning api model stuff
All the api daoโs do that
I think we should have separate models for db and api tho.
The db models are supposed to reflect exactly what is in the table
Where as api models can combine stuff
I donโt think you have to refactor anything about the db models right now. I think naturally, as we add more api routes, theyโll get used less and less
ok, so we can keep those then
ill go thru and create pages for everything now
I think we can add controllers on demand then
Yes. The one bit Iโm not sure how itโll work is logging in.
Thatโs not really an API thing. Hopefully you can just redirect to localhost:8080/login with the return url being like localhost:3000/where/you/were
yeah that shouldnt be an issue
Will probably need a /api/users/@me route as well so we can store the user in vuex
man we got so many pages, lol
yes, yes we do. ๐
make sure you are only doing actual pages tho, not just all routes
yeah
do you know what this is?
when I generated the nuxt project, it put this in the static directory
https://paste.gg/p/Machine_Maker/3efd6881446743e0b21dae7c3d52be89
but why shouldn't it be in version control?
oh so it generates it automatically... ok ๐คทโโ๏ธ it was just left over when I pulled the move from git
erm... @pallid yoke can you open any of the .png files in frontend-old/?
I'm getting some Fatal error reading PNG image file: PNG file corrupted by ASCII conversion
yes
huh... well idk what happened there
interesting, broken on github too
but you can open them... maybe they got corrupted on your latest push or smth?
xd
so looking at re-doing the models... is it an issue if they are mutable? keeping the non-final fields, and getter/setter methods?
nah I dont mind them being mutable
what about JSON field naming? camelCase or snake_case?
cause that should be consistent throughout
snamel_Case
or there is kebab-case
cAPS-lOCK_cASE
I would just do camelCase
there is no standard
but both in java and in js we name our vars camelCase
so json matching that is nice
PascalCase please
also, do we need to have builder methods for the api model?
I don't think its really necessary
also, pros and cons of using beanmappers vs constructor mappers in jdbi?
I don't have any experience outside of hangar with db stuff like this, so idk if one is better or not
iirc beanmappers require both getters and setters
hangar is my first jdbi project too
yeah, i know the difference, I just dont know if one is better or not
If you're going immutable then you want constructor mappers, but meh
we dont need immutable, but I think using constructor mappers are just nicer? then you dont need to have an empty constructor for everything
might need that for spring tho, when incoming requests contain models
if you are talking about jackson deserialization, iirc it can do constructor as well
mmkay, let me know what you think https://github.com/PaperMC/Hangar/commit/7feab029e595c9dbf323ea0120bb5b6b9a2dee17
basically, I was thinking the internal api model can just extend the public one and have additional stuff
that should be what we need in most cases
idk about calling all 3 User or the same name, that might be confusing later on
IDed -> Identified
yeah, I knew that was a bad name
I also wouldn't have two user classes, we can prefix internal stuff with Internal or Hangar or whatever
well rn its 3 User classes
yeah, that can change to that
I was thinking that, if setup right, they shouldn't ever need to be imported into the same file
(except for extending it)
well ok, it can be like HangarUser or smth
I am curious if we can get away with re-using jdbi queries for the public/internal api. or would that even be a good idea.
say the public model needed just a name, but the internal one a name and id. If we queried both and then used smth like <T> T getUser(String name); to be able to use the same query for both models
but that might not be a good idea, cause internal queries might be more complex and they'd get called for public queries where that info just is never used
idek if jdbi would even work w/that
I thought about that too
we kinda need to down cast with loosing fields for that
should be possible in general
I dont understand what this means?
down cast*
oh I see, yeah so just query the internal model and send the public one in the public api controller
how would you get jackson to only serialize fields that are in the right class?
I hope it uses the right type and only looks at methods declared in that class?
๐
need to play with that
for the public API, do we wanna go the interface + controller route? I assume you did that the first time cause of the mountain of annotations
yeah
I mean, if we remove nearly all code from the controllers and shove it into services, it might be not so bad
mini... I think you'd be better off defining a list of objects and iterating through it for the header menu thing
hmm @pallid yoke it looks like jackson doesnt care about the return type of the controller method, it includes all the fields
no option for that?
I googled a bit and couldnt find one
if we did indeed want to use the same DAOs for both
we could just do separate ones, and then forget about this issue
public static User fromHangar(HangarUser hangarUser) {
return new User(
hangarUser.getCreatedAt(),
hangarUser.getName(),
hangarUser.getTagline(),
hangarUser.getJoinDate(),
hangarUser.getRoles()
);
}
thats how we have it now kinda
smth different, I fail to make a computed property, do you know how?
ah
well actually, I think
public User toUser() {
return new User(
this.getCreatedAt(),
this.getName(),
this.getTagline(),
this.getJoinDate(),
this.getRoles()
);
}
is better, and have that in the HangarUser
its kinda like what we do now, but we are still getting rid of duplicate fields and stuff I think
since we still have inheritance?
yeah
I see
unless there is indeed a way to get jackson to use the class we want
hmm, there is JsonSerialize#as
Supertype (of declared type, which itself is supertype of runtime type) to use as type when locating serializer to use.
that is what we want
ok that looks nicer than this hack
lol
ah, how did that one not show up for me...
but idk where to put that annotation...
we want the programatic version of that
yeah, I can put the JsonSerialize annotation on the sub class, but then anytime its serialized it uses the super class
we just want that some of the time
when I click on the "view user on forums" button, it ends up being a 404. its going to users/notOM3GA when it should go to u/notOM3GA
That was changed? I swear that worked before
well that isnt really done, it kinda assumes you have the same username
@pallid yoke well JDBI had us covered with its MapTo annotation... can just do this now.
<T extends User> T getUser(String name, @MapTo Class<T> type);
and specify the type you want
yeah, that's exactly what we wanted
yeah, I'm liking it quite a bit
yeah... I wasn't sure how to handle that.
also, just probably a good tip, try and keep the vue component class name similar to the file name.
like header.vue has a class name of NewPage
which makes it confusing while I use vue devtools
That's a copy paste error
oh
I am not confident in bootstrapping new vue classes, and intellij doesn't create class components, so i copy paste
im gonna see if I can get logging in to work
Yeah if you can get the current user into a vuex store or smth and plug that into the nav, that's like all different layers we have covered and it should be easy to adapt for the rest of the stuff then
yeah, exactly what im gonna try to do
Good luck then, I'll gonna sleep now
Sadly will have a rather long day at work tomorrow again
So I'll be at my pc in like 16 hours
so I think I have the user auth stuff in a good place
we will need to work out exactly how we want to handle permissions. Most of the permission stuff can still be in spring, but we'll need a solid way to handle those errors in nuxt.
Sounds good!
I think we can just move the whole perm stuff to ja too, like on middlewares but also for the nav and prolly more stuff. Maybe we can find a way to not duplicate all roles and stuff
Why do I need that?
Went thru all the commits, looking great, can't wait to continue later
The last commit, i think we actually want to log out everywhere. Single sign on also means signals sign off
We will have one central account, one central wait to login, makes sense to also log out everywhere then
idk why, but I was getting typescript errors w/o it.
Pretty sure ! means nonnull
Maybe I should actually learn TS for once, lol
Yeah, Iโve been doing a โas-I-goโ thing for a while
Yeah, so rn, the users global permission is stored in vuex, and that can probably be used to change whatโs displayed to the user. Thatโs client-side only, but it doesnโt matter cause weโll verify permission on the backend.
As for project perms, I think a middleware applied to all project pages can fetch and store the scoped project data (including perms) in vuex.
Yeah... Iโm not sure what the best way of โcopyingโ the Permission class is. Thereโs a bunch of stuff like that which needs copying.
So, vuex has an asyncServerInit which is perfect for requesting that stuff from the server.
Well... see, some stuff like the stuff that are enums, isnโt gonna change dynamically. Is there really a benefit to making an api request for it rather than just hard-coding it? I feel like there is either already a tool for โcopyingโ it to typescript/JavaScript, or we can make one.
But asyncServerInit is just called once, on initial request, and then the client has access to it, right?
Seems perfect for this
There is also stuff like categories, platforms, roles, etc, which we even have in db tables
Yeah I guess... in a few hours I can try to get all that stuff into the store.
Ok, I'll hopefully be able to get a bit more layout down
Speaking of layout, I think the footer is too tall. Itโs like 1/5 of the screen.
I think it should probably just be a bit taller than the default button height.
Maybe throw the paper logo in the corner position absolutely or smth
It doesn't matter how tall it is really
Since it's at the bottom
It's just so in ya face right since we have no content
I'll first try to replicate what we had before, layout, not design, and then we can think about what to change layout wise and then paint it pretty
heh, when I login, I get redirected to // and the page becomes unresponsive and chrome just kills it after a while
its fine we can investiage later, ill just do more layout
oh right, I can't log in on chrome... hangarauth is broken on chrome
I dont use hangarauth
oh, are you using fake user?
I didn't test w/that, something is prob off there
you get redirected to :3000//?
or like :8080//
yes
... which one?
first, sorry
on line 13 of plugins/auth.ts, remove the trailing / right after localhost:3000
I think the redirect variable includes a /
yeah, pretty sure that's it. firefox must not mind the double /
well, no, it doesn't like it. it freezes as well.
Spring itself doesn't like double slashes
but its not a spring thing here
For whatever reason it's considered its own route
if its hanging on :3000 its a nuxt thing
Yeah I don't know enough about the project to know what that is lol
spring has a dedicated firewall to block double slash
and yes its it own route, why wouldn't it
I just added this
(req, res, next) => {
if (/\/{2,}/.test(req.url)) {
const url = req.url.replace(/\/{2,}/g, '/');
res.writeHead(301, { Location: url });
return res.end();
}
next();
},
to serverMiddleware in nuxt.config.js
yeah, this works too.
it'll always start with a /
not a productive day :/
and I gtg already
the blockout for the profile page is done https://i.imgur.com/cLlTKjf.png
No, but my idea was to go to a layout we can use to reimpl the features and then easily iterate on the layout
And then later give it a fresh coat of paint
Do we want/need font awesome?
The material design icons look fine and got everything too
I mean a ton of icons are from that
Everything I touched i used mdi for
I mean just look at the old font-awesome.js file
I just hate their website cause the search is slow as fuck
yes it is painful
I just added them cause they Categories have default icons
If we decide to use mdi we would just replace them
wait, I think we have it reversed?
mdi search is super slow?
the font awesome one is fine
That's what I meant yes
oh I thought you meant font awesome was slow, yeah OK, we can just do mdi then
so we probably need a $perm plugin as well...
Oh btw what do you think of my utils plugin?
I didn't know what would be the best way to implement such "static" methods
yeah, I mean I think that's probably fine
Good
should we do localization since we are rewriting everything?
When I do bullshit just @ me, i don't have much experience with nuxt nor TS
like, a big hurdle for that was just going through and getting rid of all the english stuff
I thought about that too and was lazy and didn't do it
I mean... if we are gonna do it. now is the time
Should be easier now that all strings are frontend
But the question is, do we need it?
Do we plan on having multiple languages?
Because else there is really not much point
I think it'd be cool to support multiple languages
I can handle that tomorrow for the shit i already did
Ah nice
Ah it's vue i18n at the core
I think it'd probably be best that we didn't just convert the whole .properties file too, since alot of that is unused
and just add as we go
Yeah just add strings at we go
I just use the old frontend as guideline and then look how it work work with vuetify
like changing /new to whatever new is in some other language
We can figure that out later
And no, localized urls are papermc.io/hangar/de-DE/new
Vs papermc.io/hangar/new for default
oh I see...
So we don't need to worry about that for now
(at least that's what I expect, i saw the docs too but didn't look too deep)
The big thing is getting the strings out of your code, and we should add the method for the urls too, and then we can see later
Cause you know, we actually need translations of we wanna go multilingual
Which is out of scope for mvp/1.0 i would say
ugh, I can't seem to get the typescript types to work for i18n... like its there, but typescript doesn't think it is
Urg
The typescript fun begins
Maybe they don't have types and we need to add our own ones?
nah they do, im looking at the source rn
I can't really look, if you can't figure it out, commit current work and look at smth else and I can pickup tomorrow
ok, so I was able to manually finagle it
... idk how that happened.
You ran yarn add nuxt-i18n in the wrong dir
well you know what... I think that was the root cause of all the issues
yikes
yeah, that was it
๐คฆ
Kek
Well, that's why this isn't a one person project, watching each other's commits helps
yeah, literally just one other set of eyes can really just see something you were blind to.
Yeah
I can't help with dev cuz I'm not that good, but if you still need testers like https://hangar.minidigger.me/ says I can poke random buttons and try to break things for you lol
well... somehow I caused a memory leak somewhere?
only time ive ever done that before is accidentally with vue mixins...
but we dont have any of those
ok, I think I narrowed it down to nuxt-i18n
if I include it, I can just keep refreshing the page, watching the memory usage keep going up until it crashes. remove it, and no such thing
yeah, ok, including it w/default configuration seems to still cause it
so idk
Iโve run into that problem with global mixins before
amazing https://i.imgur.com/2rloU6p.png
didnt do nearly as much as I hoped for today
hangar git repo?
I was talking about a git repo hosting site embedded in hangar
so mini, I think we can take advantage of the <NuxtChild> component for the project layout
basically, that is replaced by the child route of the current route
so it functions as a layout w/in a layout
Ah I was searching for that and google told me child layouts aren't a thing and I should use a component
I've never used it before, but I think that's what its for
also, when you do internal links in vuetify components, I think we need to put the nuxt prop as well
idk exactly what it does, but it exists and the docs say to use it if you are using nuxt
maybe something to do with nuxt's pre-fetching
Ah on the button
Makes sense
Mini, I almost think the โutilsโ would be better as a global mixin.
Since thatโs just what the mixin stuff is for.
you ppl are just grinding hangar development aren't you
I am not really understand the difference in nuxt really
Since both are injected into the component
Yeah, Im totally wrong. Itโs better to have it the current way, so itโs injected into more places. Idk what I was thinking. :/
Closed all the PRs, don't really need to let master and current head branch diverge even more
Iโll try and do some more new api stuff today.
its monday so am super dead, no clue if I can look at stuff
(By that I mean re-doing the old api with new models)
Gonna be watching SpaceX tho... possible hop today.
@all, now is the best time to contribute to hangar btw, just taking vuetify blocks, putting them together in something that kinda looks like ore, for all the pages
oh right, yeah
.wa time texas
(MiniDigger) Result: 7:29:03 am CST | Monday, January 25, 2021 - https://is.gd/o2zDPo
Wolfram|Alpha brings expert-level knowledge and capabilities to the broadest possible range of peopleโspanning all professions and education levels.
so like 5 hours to go
Yes, totally. Not just on the frontend, the backend is getting some big refractors as well.
It was right
Still a couple hours out
do we think the Role enum is gonna stick around?
is there a reason in the future to make it dynamic?
cause I'd like to do a bit of refactoring where it uses the enum ordinal in the db instead of this random string
actually, it doesn't really matter, since I can just make a db mapper for it
I mean, if we modify roles, we would modify the code too
Not changing ordinal is easy enough
well, I was just trying to avoid not changing the role column cause that would mess up the staging db
Hmm, so not convinced that re-using queries for api + internal models would really work for most cases.
Like just trying to replicate the ProjectData model, it doesnโt really make sense to have it extend the public api model.
I am now thinking the internal models should extend the db models, and have separate queries for them, or sequences of queries for the more complicated ones.
Yeah i don't really care we can write different queries
Prolly should split up the DAOs then?
Yeah.
sorry if this has been answered already
is there a list of stuff that needs to get done for hangar?
GitHub issues tab
Currently easiest way is to look at the nuxt frontend branch
And implement new pages
*if vue is not hard lol
I think a huge thing is somebody who isn't shit at design to look over at stuff
judgingly at mini
glares judgingly at mini
design
I mean, in part, I just throw shots at mini coz that's how I show I care about him, or something, but, if you have any UI improvements or suggestions, stuff like that's on the "would be nice" list
been meaning to ook myself but balancing paid work and paper and dying means that I ain't found the time to look over it properly yet
mood
We currently completely redoing the UI layout
This is easy to help with
Then we go over everything and look if we can improve layout
Then we can start with the actual design, that's the hard part
Prolly begins with ppl drawing shit in Paint
Hopefully that's as collaborative as the quest to find a logo
Alice uses Vue at work, maybe I can force her to look help with hangar >:D
Currently trying to come up with designs for the logo and to consult my artists on hand, is there any recommendations that I should mention when I talk to my artist about a design? Such as any description that I can provide them?
How can I make intellij not complain about this possibly being null?
the supplier isn't called if the value is null, so it will always be nonnull
Not sure if this still works but try this @random badger
The check is done by the Constant conditions & exceptions and @NotNull/@Nullable problems inspections. You can configure the way these inspections work in the Settings/Preferences Ctrl+Alt+S dialog. Go to Editor | Inspections | Java | Probable bugs.
When you compile your project, the IDE adds assertions to all methods and parameters annotated with the @NotNull annotation. The assertions will fail if null is passed in code where @NotNull is expected. You can disable this option and configure the list of annotations in the Settings/Preferences dialog Ctrl+Alt+S. Go to Build, Execution, Deployment | Compiler.
I dont really want to disable the check tho, cause its useful. its just wrong here
I can just use comments to disable it for that I guess
Fair enough, is testString referencing anything that exists or is it a blank variable?
well I just threw that together as an example, it can either be null or not null
so it doesnt mean anything
Java doesn't have the means to see the context there
You'd need to mark the supplier method as supporting a nullable value
testString is marked as nullable. mark is as notnull and viola
hmm
it just seems like IJ isn't understanding that yes, its nullable in the method, it just isn't in the supplier
I think I just got it actually...
bit of generics
ya, that works, just pass it back through
hmm ok @pallid yoke there's another decision to make here, so before, when spring was service the pages, we used spring's whole auth system for the user, but now that everything is moving to a more API oriented approach, how do we want to handle that? We have the api session stuff already in place from v1 api, do we just want to "get the current user" from the session token that is sent w/all requests?
well actually, on second thought, we don't want to get rid of spring's auth system, cause its still really useful for those custom annotations for permissions
And those should still work on internal api methods that need to be protected
but we are kinda now keeping track of the users two ways now, do we want that? once way is using our own session token/api key thing, and the other is spring's.
the api key is great for the public api, cause you don't have to be "logged in"
should we maybe not even use the auth header for internal requests? the Authorization: HangarApi session="xzxadsfasfas" thing
and solely rely on spring keeping track of the current user?
you annotated testString as nullable, your supplier method which you're passing that string into is marked as NotNull, IJ doesn't have the means to see that that will be called if it's not null, the reason why that replacement works is because you're actually passing the value inside of it, which you've got correctly marked for NotNull
Is there a way to do nullability annotations on lambdas?
We only need one auth scheme for any given request, so for internal relying on the session seems fine to me
@random badger afaik you can use Alt+Enter on a particular warning to suppress it. Not sure if it suppresses the entire warning type as such or just the specific one, pretty sure it was specific though.
https://www.jetbrains.com/help/idea/nullable-and-notnull-annotations.html and https://www.jetbrains.com/help/idea/parametersarenonnullbydefault-annotation.html will probably be interesting for you.
Although not gonna lie the way they phrased some things there is quite confusing.
Pretty sure that is still a no. Has been requested since '14 if not longer.
There were several ideas to workaround it like casting the lamba expression into a type and then annotate the type reference of the cast expression.
Which was maybe a good idea, but failed since the class will not be annotated with the annotation of the cast expression.
And by session you mean springs auth?
Yeah
hey mini, why didnt we use java 15 for hangar? some spring requirement or smth?
Every 3rd year, every 6th release
Is there anything in particular you wanna use? I don't mind updating
I mean the switch expressions can probably be used in places. Records would also be used in a bunch of places probably but those are still preview in 15 I think
Yeah i think they coming out of preview with 16 tho?
yes
September 2021, 17 LTS
well I hope we are at least done by then ๐ but its taken longer than I thought initally
ok, so I'm no longer liking the way I setup projects having multiple versions with the same version strings.
in the URL/API its just the version string (1.3.2) concatenated with the row ID in the database (302) so it'd be 1.3.2.302
