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

Discussion: Semi-auto installation and 12 factor app #1644

Open
yookoala opened this issue Sep 26, 2022 · 0 comments
Open

Discussion: Semi-auto installation and 12 factor app #1644

yookoala opened this issue Sep 26, 2022 · 0 comments

Comments

@yookoala
Copy link
Member

yookoala commented Sep 26, 2022

Problem

  • If you install a Gibbon copy, Gibbon requires to have no configuration file in the directory. So before installation, the config file need to be gone.
  • For dockerized applications, we don't usually expose the root directory to volume (i.e. stored outside of docker). But unless a folder is exposed as a volume, files inside it will be removed on reboot. Clearly the config file need to be there.
  • Usual practice includes:
    • Have config file located in a subfolder instead. So the folder can be exposed to volume.
    • Have a config file exposing variables to environment variables. So docker user can set them when initializing the docker.
  • To fit this paradigm, we need to update Gibbon installer to accept installation with config file already in the folder.

Proposed Solution

  1. Following the 12 factors approach, accepts configurations from environment variables.
  2. Rewrite installer to not block installation when the config file exists.
  3. That means the installer should determine the installation steps by detecting the installation status:
    1. First step: setup the config file if none exists.
    2. Second step: install the database tables if the tables are not there.
    3. Third step: Install the user configurations if it was not yet done.
    4. Forth step: Installation is done. Some congratulation message and link to home page.
  4. If installer detects a config file is there, it will detect which step the installation is. It will help user to proceed to the appropriate step (i.e. "semi-auto"):
    1. If the installation is at the second step, proceeding to second step and install database directly (without database information form)
    2. If the installation is at the third step, proceeding to user configuration form.
    3. If the installation is already at the forth step (installation done), it will show some warning and prompt user to clear the database / config file.
  5. To prevent unexpected access to installer, the first visit to installer would create some kind of lock-file with the first visit browser information (e.g. IP address, browser, OS, cookie secret) to ensure only 1 person can do the installation within a reasonable time (e.g. 30 minutes).

Alternatives

  • Migrating the config file into some sub-folder and expose the folder as a docker volume. But that means a rewrite of bootstrap procedure of Gibbon.

Additional Context

@yookoala yookoala changed the title Discussion: Semi-auto installation Discussion: Semi-auto installation and 12 factor app Sep 26, 2022
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

1 participant