-
Notifications
You must be signed in to change notification settings - Fork 385
Open
Labels
Description
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
- Following the 12 factors approach, accepts configurations from environment variables.
- Rewrite installer to not block installation when the config file exists.
- That means the installer should determine the installation steps by detecting the installation status:
- First step: setup the config file if none exists.
- Second step: install the database tables if the tables are not there.
- Third step: Install the user configurations if it was not yet done.
- Forth step: Installation is done. Some congratulation message and link to home page.
- 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"):
- If the installation is at the second step, proceeding to second step and install database directly (without database information form)
- If the installation is at the third step, proceeding to user configuration form.
- 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.
- 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
Reactions are currently unavailable