Skip to content

2factorauth/2fa.directory

2FA.Directory Frontend

This repository contains the HTML, JavaScript and CSS for 2fa.directory.
All data used to populate the categories is located in 2factorauth/twofactorauth.

Local installation

The website is based on the static site generator Hugo. To build locally you will need to follow the installation instructions for Hugo.
Ruby is also required for some scripts.

After you've installed Hugo and Ruby, follow these steps to build the site locally:

  1. Install NPM packages npm install
  2. Install Ruby gems bundle install
  3. Fetch entries: ./scripts/generate_entries.rb
  4. Generate regional pages: ./scripts/generate_regions.rb
  5. Run Hugo locally: hugo serve
    The site should then be reachable at 127.0.0.1:1313.

Note The region-redirection script does not run locally. You will therefore always be directed to the international page when using hugo serve.

Publishing forks

This repository is built on the frameworks of Cloudflare Pages and requires the build process to be done via Cloudflare.

To publish your fork of this repo, follow these steps:

  1. Log in to your Cloudflare Dashboard and select Pages. Create a new project and select your fork as the source.
  2. When prompted for build configuration, enter the following:
    • Framework preset: None
    • Build command: ./scripts/build.sh
    • Build output directory: /public

Contributing

When contributing changes to this repository, please make sure your IDE follows our editorconfig.

The general file structure is as follows:

Type Path
JavaScript assets/js
CSS assets/css
Layouts layouts/_default
Pages content
Translations data/languages.json

License

This project is licensed under GPLv3. For the entire license see LICENSE.

Before you make changes to the code, please keep the following in mind:

  • The data is licensed separately.
  • Attribution is required if you use this project as a template for your own website.
  • The initial contents of LICENSE must still be included in distributions and forks but we allow (and encourage) you to prepend your own copyright and GPLv3-compatible license for changes you make.

For a more information on what is and isn't allowed under a GPLv3 license, see this guide.