2 Commits

Author SHA1 Message Date
eb3bb297b9 Update URLs to use raw.githubusercontent.com for downloads
Switched from git.vdm.dev to raw.githubusercontent.com for fetching [octojoom] and related scripts. This ensures wider accessibility and consistency with GitHub's standard hosting practices. Updated references in the script and README accordingly.Update URLs to use raw.githubusercontent.com for downloads

Switched from git.vdm.dev to raw.githubusercontent.com for fetching [octojoom] and related scripts. This ensures wider accessibility and consistency with GitHub's standard hosting practices. Updated references in the script and README accordingly.
2025-02-26 11:38:38 +02:00
05660f568c Update remote .env handling and set version to 3.7.1
Refactor remote .env file access to use the remote user's home directory for improved reliability. Adjust comments for clarity and ensure consistent handling of tilde expansion remotely. Increment version to 3.7.1 to reflect these changes.
2025-02-26 11:26:10 +02:00
2 changed files with 14 additions and 11 deletions

View File

@ -20,7 +20,7 @@ Linted by [#ShellCheck](https://github.com/koalaman/shellcheck)
---
# Install
```shell
$ sudo curl -L "https://git.vdm.dev/api/v1/repos/octoleo/octojoom/raw/src/octojoom" -o /usr/local/bin/octojoom
$ sudo curl -L "https://raw.githubusercontent.com/octoleo/octojoom/refs/heads/master/src/octojoom" -o /usr/local/bin/octojoom
$ sudo chmod +x /usr/local/bin/octojoom
```

View File

@ -1,7 +1,7 @@
#!/usr/bin/env bash
# The most recent program version.
_VERSION="3.7.0"
_VERSION="3.7.1"
_V="3.7"
# Bash version required
@ -2682,7 +2682,7 @@ function runUpdate() {
# get the target branch to use in our update
isExpert && branch=$(getTargetBranch)
# pull the latest version. Master is always the latest
if sudo curl --fail -L "https://git.vdm.dev/api/v1/repos/octoleo/octojoom/raw/src/octojoom?ref=${branch:-master}" -o /usr/local/bin/octojoom 2>/dev/null; then
if sudo curl --fail -L "https://raw.githubusercontent.com/octoleo/octojoom/refs/heads/${branch:-master}/src/octojoom" -o /usr/local/bin/octojoom 2>/dev/null; then
# give success message
echo "SUCCESS: Update was successful."
# do we have a backup
@ -3849,7 +3849,7 @@ function getImageSource() {
local i=2
# set the defaults
default="joomla|https://hub.docker.com/_/joomla?tab=tags;https://raw.githubusercontent.com/joomla-docker/docker-joomla/master/docker-entrypoint.sh"
default_octojoom="llewellyn/joomla|https://hub.docker.com/r/llewellyn/joomla/tags;https://git.vdm.dev/octoleo/docker-joomla/raw/branch/octoleo/docker-entrypoint.sh"
default_octojoom="llewellyn/joomla|https://hub.docker.com/r/llewellyn/joomla/tags;https://raw.githubusercontent.com/octoleo/docker-joomla/refs/heads/octoleo/docker-entrypoint.sh"
# we only ask if we are in expert mode
if isExpert; then
# set the base images source
@ -5068,24 +5068,27 @@ function getMigrationType() {
echo "${answer:-push}"
}
# Check if the remote .env file exists
# Check if the remote .env file exists using the remote user's home directory
function remoteEnvFileExists() {
local remote_system="$1"
# Check if the file exists on the remote system
# shellcheck disable=SC2029
ssh "${remote_system}" "[ -f \"${VDM_HOME_PATH}/.config/octojoom/.env\" ]"
# The tilde (~) expands to the home directory of the logged-in remote user.
# Using single quotes ensures that the command is passed literally to the remote shell,
# allowing the tilde expansion to occur remotely.
ssh "${remote_system}" '[ -f ~/.config/octojoom/.env ]'
}
# Get a specific value from the remote .env file
# Get a specific value from the remote .env file using the remote user's home directory
function getRemoteEnvValue() {
local remote_system="$1"
local env_key="$2"
local remote_env_value
if remoteEnvFileExists "${remote_system}"; then
# shellcheck disable=SC2029
remote_env_value=$(ssh "${remote_system}" "grep '^${env_key}=' \"${VDM_HOME_PATH}/.config/octojoom/.env\"" | cut -d '=' -f 2-)
# Execute the grep command on the remote system.
# The command uses \$HOME so that the remote shell expands it to the logged-in user's home directory.
# The env_key variable is expanded locally, while the file path remains intact for the remote shell.
remote_env_value=$(ssh "${remote_system}" "grep '^${env_key}=' \"\$HOME/.config/octojoom/.env\"" | cut -d '=' -f 2-)
fi
# Remove any double quotes from the returned value