twofactorauth icon indicating copy to clipboard operation
twofactorauth copied to clipboard

Modularize the repo into UI and data

Open nitrocode opened this issue 6 years ago • 7 comments

Hi! I noticed a few apps that want to or are following your UI. So far I've found dongleauth and your app but soon it might also be for https://github.com/duffn/dumb-password-rules/issues/114.

It would be nice if we could split the UI into a maintained flexible repo between the teams and then twofactorauth, dongleauth, dumb-password-rules and future repos would just have category data, column data, and yaml data. Perhaps the column data can be inferred dynamically from the yaml files so they aren't hard coded directly in html.

What do you devs think? @stephengroat @Carlgo11

nitrocode avatar Jan 21 '19 04:01 nitrocode

Can github pages work cross-repos? Because that's how we host the site.

mxxcon avatar Jan 21 '19 04:01 mxxcon

i think the idea is to turn it into something like a github supported jekyll theme (https://pages.github.com/themes/)

stephengroat avatar Jan 21 '19 04:01 stephengroat

Yes that would be perfect and much more scaleable. It's not blocking the new repo because for now we can copy and paste and rework the site to work for us but I wanted to create a ticket in the backlog eventually come up with a jekyll theme to make it easier to maintain between the teams.

I noticed that changes in this repo have to be pulled into the dongleauth repo so that must be a pain to have to do every time. Multiply that by the number of forks and future forks. Using stargazer fork I noticed that acceptbitcoincash is also one of the forks reusing the code base so I'll tag their top contributor too @kenman345.

If you guys think it's worth it then I'd love to come up with ideas and create a separate repo/branch for it. Since you folks created it, I imagine the core base would be managed by 2factorauth unless you think a new organization should be created?

nitrocode avatar Jan 21 '19 05:01 nitrocode

Note, the current code for the mobile vs desktop view is not a great way of handling it and separating the code to a new repository might make things a bit easier to rework so that we maintain the same experience while also ensuring it’s done with the time and care it needs. Right now you’re reliant on JavaScript for resizing and so everything is on the page twice technically, making the page need to load twice the amount of data.

I’ve been way too busy to work on a rewrite but could contribute to those efforts as long as I am not lead.

On Mon, Jan 21, 2019 at 12:13 AM nitro [email protected] wrote:

Yes that would be perfect and much more scaleable. It's not blocking the new repo because for now we can copy and paste and rework the site to work for us but I wanted to create a ticket in the backlog eventually come up with a jekyll theme to make it easier to maintain between the teams.

I noticed that changes in this repo have to be pulled into the dongleauth repo so that must be a pain to have to do every time. Multiply that by the number of forks and future forks. Using stargazer fork http://forked.yannick.io/2factorauth/twofactorauth I noticed that acceptbitcoincash https://github.com/acceptbitcoincash/acceptbitcoincash is also one of the forks reusing the code base so I'll tag their top contributor too @kenman345 https://github.com/kenman345.

If you guys think it's worth it then I'd love to come up with ideas and create a separate repo/branch for it. Since you folks created it, I imagine the core base would be managed by 2factorauth unless you think a new organization should be created?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/2factorauth/twofactorauth/issues/3651#issuecomment-455950626, or mute the thread https://github.com/notifications/unsubscribe-auth/AKeM19vjAmfMFvayUGB9G4QR5zC6EaHxks5vFUx7gaJpZM4aKFQP .

kenman345 avatar Jan 21 '19 05:01 kenman345

Sounds like a great idea. Some possibilities:

  • link items together (Google and Youtube for example)
  • include account deletion info (https://www.accountkiller.com/)
  • include company contact info
  • whether email address or username can be changed
  • whether email address or username can be reclaimed after deletion
  • whether 2fa can be used without giving away your phone number
  • whether kind of 2fa are supported (https://en.wikipedia.org/wiki/Time-based_One-time_Password_algorithm)

carlosjeurissen avatar Feb 05 '19 14:02 carlosjeurissen

nice idea. FYI 2fa is handled by twofactorauth and dongleauth projects

nitrocode avatar Feb 05 '19 15:02 nitrocode

so just to clarify, Github Pages supports the "jekyll-remote-theme" plugin, along with the others listed here: https://pages.github.com/versions/

The remote theme plugin means you can refer to a repository thats your theme, instructions on this are here: https://github.com/benbalter/jekyll-remote-theme#usage

So basically, we can separate out the theme quite instantly without a refactor just to transition things, then work on refactors. I really would love help getting the UI fixed to be responsive for desktop/mobile instead of how it is now, like I mentioned before. Its instantly at least 40% of each pages generated code right now that can be gone.

When turning it to a theme, we would need to at least make it work for 2FA social media, but it could easily be updated with a fork to support anyone elses needs. Working on other themes, we could advance the theme for use on other projects by allowing different social media sites to work, and they are enabled by default but would easily be configurable to be disabled if not wanted/needed.

@carlosjeurissen I am not entirely sure what your list has to do with a specific theme, but I am happy to help enhance what the UI components currently do with those sort of features once we create a theme and as it might be clear, focus on refactoring out unused code and making what we currently have better before we go bandaging it up with more things.

EDIT: @stephengroat getting a theme to be officially supported by Github is rare, and I think most have been made by Jekyll team themselves, but the plugin I mentioned above will in fact give us the same functionality without it being officially listed on that URL you provided, and it wont have any trouble with Github Pages when it generates the page.

kenman345 avatar Feb 05 '19 15:02 kenman345

Done :partying_face: See 2factorauth/frontend

Carlgo11 avatar Dec 25 '22 22:12 Carlgo11