From 6fc05f592be55a9de30cea6ff02a5d5dc44fe217 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Weigert?= Date: Sat, 5 Apr 2025 15:13:05 +0200 Subject: [PATCH 1/6] Feat: install.sh now honors OC_BASE_DIR --- deployments/examples/bare-metal-simple/README.md | 7 +++++++ deployments/examples/bare-metal-simple/install.sh | 5 +++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/deployments/examples/bare-metal-simple/README.md b/deployments/examples/bare-metal-simple/README.md index cc52dc7f1..1de85df0b 100644 --- a/deployments/examples/bare-metal-simple/README.md +++ b/deployments/examples/bare-metal-simple/README.md @@ -26,6 +26,13 @@ This script should **NOT** be run as user root. Set the environment variable `OC_VERSION` to the version you want to download. If not set, there is a reasonable default. +## Data Location + +Set the environment variable `OC_BASE_DIR` to a directory where the +`data` and `config` subdirectories shall be located. Per default, +both configuration and storage data are within a sandbox subdirectory +in the current working directory. + # Example Call diff --git a/deployments/examples/bare-metal-simple/install.sh b/deployments/examples/bare-metal-simple/install.sh index e0cd69c86..ab8aeff09 100755 --- a/deployments/examples/bare-metal-simple/install.sh +++ b/deployments/examples/bare-metal-simple/install.sh @@ -71,8 +71,9 @@ chmod 755 ${dlfile} mkdir data config -export OC_CONFIG_DIR="$(pwd)/config" -export OC_BASE_DATA_PATH="$(pwd)/data" +basedir="${OC_BASE_DIR:-$(pwd)}" +export OC_CONFIG_DIR="$basedir/config" +export OC_BASE_DATA_PATH="$basedir/data" # It is bound to localhost for now to deal with non existing routes # to certain host names for example in WSL From a98c63846cebd71f8f5e1f19bc0e27973c41867e Mon Sep 17 00:00:00 2001 From: Juergen Weigert Date: Sun, 6 Apr 2025 14:27:07 +0200 Subject: [PATCH 2/6] Support OC_HOST for remote access. --- deployments/examples/bare-metal-simple/README.md | 5 +++++ deployments/examples/bare-metal-simple/install.sh | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/deployments/examples/bare-metal-simple/README.md b/deployments/examples/bare-metal-simple/README.md index 1de85df0b..9fc4903ad 100644 --- a/deployments/examples/bare-metal-simple/README.md +++ b/deployments/examples/bare-metal-simple/README.md @@ -33,6 +33,11 @@ Set the environment variable `OC_BASE_DIR` to a directory where the both configuration and storage data are within a sandbox subdirectory in the current working directory. +## Server Address + +Set the environment variable `OC_HOST` to the full qualified hostname +or of this server to allow remote accesse. Default: `localhost`. + # Example Call diff --git a/deployments/examples/bare-metal-simple/install.sh b/deployments/examples/bare-metal-simple/install.sh index ab8aeff09..bb790f8d9 100755 --- a/deployments/examples/bare-metal-simple/install.sh +++ b/deployments/examples/bare-metal-simple/install.sh @@ -77,7 +77,7 @@ export OC_BASE_DATA_PATH="$basedir/data" # It is bound to localhost for now to deal with non existing routes # to certain host names for example in WSL -host="localhost" +host="${OC_HOST:-localhost}" ./${dlfile} init --insecure yes --ap admin From a484237fcca1dac7bff81225b72fb6e195ae5db9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Weigert?= Date: Sun, 6 Apr 2025 22:39:42 +0200 Subject: [PATCH 3/6] Update deployments/examples/bare-metal-simple/README.md Co-authored-by: Klaas Freitag --- deployments/examples/bare-metal-simple/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployments/examples/bare-metal-simple/README.md b/deployments/examples/bare-metal-simple/README.md index 9fc4903ad..3d88ff66a 100644 --- a/deployments/examples/bare-metal-simple/README.md +++ b/deployments/examples/bare-metal-simple/README.md @@ -35,7 +35,7 @@ in the current working directory. ## Server Address -Set the environment variable `OC_HOST` to the full qualified hostname +Set the environment variable `OC_HOST` to the fully qualified hostname or of this server to allow remote accesse. Default: `localhost`. # Example From 56636cc9c47d0b47e5ea7587da97facb56c2a195 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Weigert?= Date: Sun, 6 Apr 2025 23:01:48 +0200 Subject: [PATCH 4/6] Update deployments/examples/bare-metal-simple/README.md --- deployments/examples/bare-metal-simple/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployments/examples/bare-metal-simple/README.md b/deployments/examples/bare-metal-simple/README.md index 3d88ff66a..c27c224fe 100644 --- a/deployments/examples/bare-metal-simple/README.md +++ b/deployments/examples/bare-metal-simple/README.md @@ -36,7 +36,7 @@ in the current working directory. ## Server Address Set the environment variable `OC_HOST` to the fully qualified hostname -or of this server to allow remote accesse. Default: `localhost`. +of this server to allow remote accesse. Default: `localhost`. # Example From 6af2ecfdde5655dd15137647d3b2099e0f85a0ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Weigert?= Date: Mon, 14 Apr 2025 18:20:01 +0200 Subject: [PATCH 5/6] avoid useless mkdir calls --- deployments/examples/bare-metal-simple/install.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/deployments/examples/bare-metal-simple/install.sh b/deployments/examples/bare-metal-simple/install.sh index bb790f8d9..14dc004e7 100755 --- a/deployments/examples/bare-metal-simple/install.sh +++ b/deployments/examples/bare-metal-simple/install.sh @@ -69,11 +69,10 @@ echo "Downloading ${dlurl}/${dlfile}" curl -L -o "${dlfile}" --progress-bar "${dlurl}/${dlfile}" chmod 755 ${dlfile} -mkdir data config - basedir="${OC_BASE_DIR:-$(pwd)}" export OC_CONFIG_DIR="$basedir/config" export OC_BASE_DATA_PATH="$basedir/data" +mkdir "$OC_CONFIG_DIR" "$OC_BASE_DATA_PATH" # It is bound to localhost for now to deal with non existing routes # to certain host names for example in WSL From ad377042dc72b48af34443adc5157bedf7ab41c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Weigert?= Date: Mon, 14 Apr 2025 18:25:01 +0200 Subject: [PATCH 6/6] fix mkdir to use -p --- deployments/examples/bare-metal-simple/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployments/examples/bare-metal-simple/install.sh b/deployments/examples/bare-metal-simple/install.sh index 14dc004e7..71e7ce843 100755 --- a/deployments/examples/bare-metal-simple/install.sh +++ b/deployments/examples/bare-metal-simple/install.sh @@ -72,7 +72,7 @@ chmod 755 ${dlfile} basedir="${OC_BASE_DIR:-$(pwd)}" export OC_CONFIG_DIR="$basedir/config" export OC_BASE_DATA_PATH="$basedir/data" -mkdir "$OC_CONFIG_DIR" "$OC_BASE_DATA_PATH" +mkdir -p "$OC_CONFIG_DIR" "$OC_BASE_DATA_PATH" # It is bound to localhost for now to deal with non existing routes # to certain host names for example in WSL