speedianet / os

Speedia OS is a container operating system designed so you never have to write a Dockerfile again.
https://speedia.net/os/
Eclipse Public License 2.0
12 stars 2 forks source link

feat: separate cmdSteps into installCmdSteps and uninstallCmdSteps #51

Closed ntorga closed 2 months ago

polillomm commented 3 months ago

Some marketplace items require the database service to be available during installation to create their respective databases. However, during uninstallation, we allow the user to choose whether or not to uninstall these services along with the marketplace item itself. To prevent useless databases from remaining in the database service, steps for removing these databases and their users were added to the uninstallation process for marketplace items. However, this is not possible if the service has already been uninstalled. To avoid this issue, all uninstallation steps will be performed before uninstalling services and removing files.

polillomm commented 3 months ago

A validation has been added to ensure that a marketplace item is installed in the selected installation directory. This prevents the need for backups or other methods to replace one installation with another.

From now on, installation directories that already have a marketplace item installed will not accept a new installation. To replace the current item, the existing marketplace item must be uninstalled before installing the new one.

polillomm commented 3 months ago

The installation of Drupal and Laravel has a specific peculiarity for installations with routing typically managed by .htaccess in subdirectories, such as Drupal using /web and Laravel using /public. To correctly reflect these characteristics in the NGINX mapping configuration, a symlink is created from the virtual host directory to the installation subdirectory (e.g., /web or /public). This ensures the root directory of the virtual host performs the correct routing required by these installations.

Due to the inherent nature of these installations, the uninstallation process becomes quite complex to execute effectively. This complexity arises because, upon uninstallation, it is necessary to remove the symlinks of these items since their files and directories no longer exist. Consequently, if there are other similar installations in subdirectories, they will also lose their symlinks. To ensure their continued functionality, the recommended approach is to recreate the correct symlinks for their respective routing directories.

Marketplace item Symlink source path
Drupal /app/drupal-%installHostname%-%installUuid%/web/
Laravel /app/laravel-%installHostname%-%installUuid%/public/

The installHostname refers to the virtual hostname where the marketplace item will be installed. The installUuid is the unique installation ID that can be easily found in the /marketplace/installed/ path.