-
Notifications
You must be signed in to change notification settings - Fork 24
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
[ENH][DOC]: Add a script for installation and upgrade options for specific Cypht versions #93
[ENH][DOC]: Add a script for installation and upgrade options for specific Cypht versions #93
Conversation
install.html
Outdated
@@ -93,12 +82,12 @@ <h2>Install Cypht master</h2> | |||
<hr> | |||
<h2>1. Manual installation</h2> | |||
<h2>Requirements</h2> | |||
<p>Cypht master requires at least PHP 8.1, <a href="https://getcomposer.org/">Composer 2</a>, and at minimum the | |||
<p>Cypht 1.4.x requires PHP 5.6 or 7.0 or 7.1 or 7.2 or 7.3 or 7.4 (for PHP 8.1+, please use Cypht 2.1+), <a href="https://getcomposer.org/">Composer 2</a>, and at minimum the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you just put a range here instead of listing all versions ? Also isn't better to add the link when you talk about Cypht 2.1+ ?
install.html
Outdated
|
||
if [ "$choice" -eq 1 ]; then | ||
# Install specific version | ||
read -p "Enter the version to install (e.g., 2.1.0, 2.2.0, etc.): " version |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please provide a default version? And can you also list the tag versions as options so the user doesn't have to fumble around? That way if they enter an invalid option it will be handled properly. https://api.github.com/repos/cypht-org/cypht/tags will help you get the list of tags.
install.html
Outdated
sudo test -r $DESTINATION -a -x $DESTINATION | ||
if [ $? -ne 0 ]; then | ||
sudo mkdir $DESTINATION | ||
# Base directory for Cypht installations |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about windows users. Can we handle this for now ?
Also I have an idea if @kroky agrees. We can put the code below in a file and put a download link here then one can just execute it. All static variables here that the user can change may be options.
install.html
Outdated
# Fix permissions and ownership | ||
find . -type d -exec chmod 755 {} \; | ||
find . -type f -exec chmod 644 {} \; | ||
sudo chown -R root:root . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is there is not group root ? on my case on macOS I don't have that. Perhaps It can be better to asked this to the user.
install.html
Outdated
echo "Cypht $version installed successfully to $destination" | ||
} | ||
|
||
# Function to upgrade Cypht from one version to another |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this will be difficult to handle. Cypht 1.x uses ini files, some in module folders but Cypht 2.x uses .env file and config folder for configuration. It will be a bit complicated to rewrite the contents of the different .ini files to the .env. Some variables where renamed in the new .env.
In my opinion we can perhaps upgrade to the same version. For example from v1.3.0 to v1.4.4.
Also what if one wants to test multiple versions ?
install.html
Outdated
composer install | ||
|
||
# Handle configuration file creation | ||
if [[ "$version" =~ ^1\.4\.[0-9]+$ ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you change the regex here as there are other tags for Cypht version 1 that don't start with 1.4 ?
install.html
Outdated
} | ||
|
||
# Function to upgrade Cypht from one version to another | ||
upgrade_cypht() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function doesn't work as expected. Can you review it please ?
install.html
Outdated
|
||
<pre>sudo mkdir /var/lib/hm3 | ||
<pre> | ||
sudo mkdir /var/lib/hm3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we replace this with something like sudo mkdir -p /var/lib/hm3/{attachments,users,app_data} ?
install.html
Outdated
<h4>8. Other INI files</h4> | ||
<p>Some Cypht modules require additional ini files to be configured. These should NOT be inside the web-server | ||
document root. Cypht will look for them in the location defined by "app_data_dir" in the hm3.ini file. A | ||
sample |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you check formatting here please ?
Hi @Baraka24! I can adapt the contents to the new site structure, but would it perhaps be easier for you to first take care of the comments posted above, and then afterwards me moving it to the correct spot? I can also move it first if you prefer, but due to the removal of the different install-1x & install-2x, it will no longer require the fancy tricks used in the current SSG adaptation. |
2e5b787
to
157a8ef
Compare
@Denperidge, here’s what I need: please update the l |
Related Issue
Summary
This pull request introduces an enhanced installation script for Cypht that supports both installation of specific versions and the ability to upgrade from one version to another. The script automates the process of downloading the selected version, unpacking the archive, running the necessary Composer install steps, and configuring the installation with the appropriate settings. Additionally, it now handles the safe movement of both regular and hidden files, ensuring that all required files, including configuration files like
.env.example
and.gitignore
, are correctly copied to the target installation directory.Changes:
composer install
.hm3.ini
for version 1.4.x and.env
for other versions.Why this change?
The goal of this change is to provide a more flexible and automated installation and upgrade process for Cypht, addressing both new installations of specific versions and upgrades from older versions. This enhances the usability and maintainability of Cypht installations, ensuring that all necessary files are correctly handled during installation, including hidden files that are essential for the proper functioning of the application.
Testing:
.env
orhm3.ini
).Additional Notes:
wget
to download the ZIP file of the selected version andunzip
to unpack it.composer install
step is executed to ensure all dependencies are correctly installed for the selected version.