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

Allow orgs to use a custom domain #210

Open
1 of 3 tasks
Powersource opened this issue Feb 7, 2021 · 14 comments
Open
1 of 3 tasks

Allow orgs to use a custom domain #210

Powersource opened this issue Feb 7, 2021 · 14 comments

Comments

@Powersource
Copy link
Member

Powersource commented Feb 7, 2021

Like Dreams. Requested by Kiez Burn.

Blocking issues:

@gustavlrsn
Copy link
Member

gustavlrsn commented Feb 8, 2021

Switching to nextjs-auth0 was to get it to work with server-side rendering in Next.js, so unrelated to getting subdomains to work.

@aerugo aerugo added test and removed test labels Feb 8, 2021
@aerugo aerugo assigned aerugo and unassigned aerugo Feb 8, 2021
@hesslau
Copy link

hesslau commented Feb 16, 2021

just for clarification regarding dreams:
[1] would we be able to use dreams.kiezburn.org as our domain?
[2] would other orgs be visible at dreams.kiezburn.org? (like at http://dreams.blivande.com/)

@aerugo
Copy link
Collaborator

aerugo commented Feb 16, 2021 via email

@DiarmaidEverycs
Copy link

Hi, I would like to talk to someone about transferring accross the data from the old realities to the new one. I have written a script that will take the Excel file and import it into the neo4j database - but it is written in Python and interacts directly with the database, so I can see why you might not want to run it directly. But maybe there is someone I can collaborate with to get the data imported? I see that there is an organisation for us already at
https://realities.platoproject.org/kiezburn/c2a99a3a-7f2f-4a82-a920-75dde65d002e

@aerugo
Copy link
Collaborator

aerugo commented Feb 22, 2021 via email

@DiarmaidEverycs
Copy link

I was using the master branch of your realities to do my development - I am pretty sure that the database that I would have would be the same as yours - from about 2 days ago.

You define organisations via a Org node and needs via a Need node, Relationships via Relationship node and have a HAS edge between them, as far as I can tell. There are other edges as well, I would need to check my script to see what they are. NodeIDs appear to be UUIDs, for example?

I wouldn't expect you to change the script, I just need a schema to work off if you have one. Trial and error is fine when I am hosting my own instance but probably not the best when working with others.

@aerugo
Copy link
Collaborator

aerugo commented Feb 22, 2021

Have you tried your script with multiple orgs set up already? If you can verify that it works, that might be good enough to consider. I will leave it up to @Powersource to make the call. If you put your script on GitHub we could have a look at it. No promises though. :)

@DiarmaidEverycs
Copy link

DiarmaidEverycs commented Feb 22, 2021

Yeah, it works with multiple orgs - you just need to use pass in the org ID. I just need to change it so that the identification is working with the node IDs instead of the title, title works fine when there are no possible conflicts but as we have and are importing the nodeIDs, we can just use them and it should never overlap with possible needs/responsibilities which have been defined for other orgs.

Edit: On a completely different topic, google tells me that having multiple subdomains on a React app is impossible. How do you solve that?

@Powersource
Copy link
Member Author

To run a migration script against production we'd first want to merge that script into this codebase in a PR. And the code would have to be js to not add another language to the codebase and increase its complexity a lot.

And about the subdomains, I don't know but Gustav got it to work somehow :P

@aerugo
Copy link
Collaborator

aerugo commented Feb 22, 2021

Gotcha @Powersource. It seems like we're back to manual migration.

Like I said before: You have just around 152 responsibilites in the Kiez database. If you are 4 people, it should not take you more than an afternoon to copy and paste everything. On the other hand, we need to be very careful when working on our production database. I think that if we combine the time we will spend on getting the script right, on making extra backups before running it, and on potentially fixing things that might go wrong, the number of person-hours required for doing it with code seem to surpass the number of hours to do it manually.

Honestly, this is what I would do myself for an org I ran of this size - even though I technically have access to the DB.

@aerugo
Copy link
Collaborator

aerugo commented Feb 22, 2021

But since you already wrote the script @DiarmaidEverycs - perhaps put it on GitHub? Perhaps we are missing something that makes it obvious to you that this is risk-free and low-hassle?

@DiarmaidEverycs
Copy link

Yeah ok, I'm not a JS programmer so the chances of it being merged into your code base are approximitely nil. Was worth a shot though.

I just hate doing things manually, if it takes me 10 hours to automate a 1 hour task, is that not time well spent :P?

But I can host the script up on Github and link it to you when I get out of work. Maybe you will find it useful - its pretty fragile at the moment.

@aerugo
Copy link
Collaborator

aerugo commented Feb 22, 2021

if it takes me 10 hours to automate a 1 hour task, is that not time well spent

That, my friend, is quite subjective. ;)

@Diemo-zz
Copy link

I've left the script up here if you want to look at it.
https://github.com/Diemo-zz/RealitiesTransferScript

It is pretty simple, it loads up the excel file, gets each individual sheet and loads it into a pandas dataframe. I then iterate over all the rows and match nodes up (by nodeId) to the nodes already in the database. I also add in the edges as required (Need -> Guide, Responsibility -> Guide, Org - [HAS]-> Need/Responsibility.

It has a couple of issues for running it on a production database that I can see:

  1. Identification of the users is just done by email - should be ok I think, but I read somewhere about them being identified by keycloak identifier instead.
  2. When it is adding in the links, it doesnt do any checks to see whether or not the link already exists. If you run it twice, it will create a second link between the nodes.
  3. It doesnt do any checking to see if the nodes already belong to an Org. If you run it on two different Orgs, it will happily connect up the Needs/Responsibilities to both of them
  4. It commits the cardinal sin of using a for loop with a Pandas dataframe :-O. Also it can be cleaned up (e.g. pass the driver into the functions instead of using it as a global variable)

If you think that it will be useful for you in the future, I can fix most of the above problems when I have time, but it might not be worth it. It seems to me to be very fragile at the moment. I wanted to use a framework to access the database, but the one I tried had a broken tutorial, so I gave up and just calculated the Cypher commands manually. This is, uh, not very secure. I'm also not using the graphql framework that you guys have, which seems like a waste.

Let me know if you want to see the Excel template I was working off.

@aerugo aerugo assigned aerugo and unassigned aerugo Mar 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants