diff --git a/README.md b/README.md new file mode 100644 index 0000000..3056138 --- /dev/null +++ b/README.md @@ -0,0 +1,19 @@ +# NoBullShit-cloud +A personal cloud without bullshit + +## Prerequisites +nbscloud requires `java>=18` + +## Install +### systemd service +### `deploy.sh` + +## Config +To adjust the default configuration create the file `~/.config/nbscloud/application.properties`. It allows overwriting +properties from every configuration file of nbscloud. To get a full list of existing properties look at the following +files: +|File|Description| +|----|-----------| +|[application.properties](./web-container/src/main/resources/config/application.properties)|Main config file providing general app properties| +|[shared-application.properties](./web-container-config/src/main/resources/config/shared-application.properties)|Properties shared by all apps| +|[files-application.properties](./files/src/main/resources/config/files-application.properties)|Config file for the files app| \ No newline at end of file diff --git a/files/src/main/java/de/nbscloud/files/config/FilesConfig.java b/files/src/main/java/de/nbscloud/files/config/FilesConfig.java index 216032c..d59806e 100644 --- a/files/src/main/java/de/nbscloud/files/config/FilesConfig.java +++ b/files/src/main/java/de/nbscloud/files/config/FilesConfig.java @@ -7,7 +7,6 @@ import org.springframework.context.annotation.PropertySource; @Configuration @ConfigurationProperties(prefix = "nbs-cloud.files") @PropertySource("classpath:/config/files-application.properties") -@PropertySource(value = "classpath:/config/files-application-${spring.profiles.active}.properties", ignoreResourceNotFound = true) public class FilesConfig { private String baseDir; private boolean filterHidden; diff --git a/files/src/main/resources/config/files-application-mk.properties b/files/src/main/resources/config/files-application-mk.properties deleted file mode 100644 index 63f6ad5..0000000 --- a/files/src/main/resources/config/files-application-mk.properties +++ /dev/null @@ -1 +0,0 @@ -nbs-cloud.files.baseDir=/opt/nextcloud_data/marius/files \ No newline at end of file diff --git a/pom.xml b/pom.xml index e5b9cea..5c3bfd1 100644 --- a/pom.xml +++ b/pom.xml @@ -32,7 +32,6 @@ UTF-8 18 - @@ -195,13 +194,4 @@ - - - release - - ${deploymentProfile} - - - - diff --git a/tools/deploy.sh b/tools/deploy.sh index 625ffc5..78b0306 100644 --- a/tools/deploy.sh +++ b/tools/deploy.sh @@ -1,54 +1,16 @@ #!/bin/bash -workspace_loc=$1 -echo "$workspace_loc" +version=$1 -profile=$2 -echo "$profile" +echo "Create required directories" +mkdir -p ~/.local/share/java/nbscloud/ +mkdir -p ~/.config/nbscloud/ +mkdir -p ~/nbscloud -pwd +echo "Download nbscloud version $version to ~/.local/share/java/nbscloud/nbscloud.jar" -deploy_tmp="deploy_tmp" -target_loc="/opt/nbscloud" +wget -qO ~/.local/share/java/nbscloud/nbscloud.jar http://192.168.10.4:8100/releases/de/77zzcx7/nbs-cloud/web-container/"$version"/web-container-"$version".jar -app_props_loc="$workspace_loc/web-container/target/classes/config/application-$profile.properties" -files_prop_loc="$workspace_loc/files/target/classes/config/files-application-$profile.properties" - -echo "$app_props_loc" -echo "$files_prop_loc" - -deploy_path=$(grep "nbscloud.deploy.path" "$app_props_loc" | cut -d'=' -f2) -echo "$deploy_path" - -base_dir=$(grep "nbs-cloud.files.baseDir" "$files_prop_loc" | cut -d'=' -f2) -echo "$base_dir" - -cd tools -mkdir $deploy_tmp - -cp "template-nbscloud.service" $deploy_tmp"/nbscloud.service" - -cd $deploy_tmp - -sed -i "s|DEPLOY_PATH_R|$deploy_path|g" nbscloud.service -sed -i "s|BASE_DIR_R|$base_dir|g" nbscloud.service -sed -i "s|PROFILE_R|$profile|g" nbscloud.service - -echo "" -cat nbscloud.service -echo "" - -cp nbscloud.service $target_loc"/nbscloud.service" -echo "Copied service file" - -jar_path=$(find "$workspace_loc/web-container/target/" -name "*.jar") -echo "$jar_path" - -cp "$jar_path" "$target_loc"/nbscloud.jar -echo "Copied jar" - -echo "Finished deployment" -echo "" -echo "Manually reload service files via 'systemctl --user daemon-reload'" -echo "Then, enable the service 'systemctl --user enable --now nbscloud.service'" -echo "Or, restart the service 'systemctl --user restart nbscloud.service'" \ No newline at end of file +echo "Reload and restart service" +systemctl --user daemon-reload +systemctl restart nbscloud \ No newline at end of file diff --git a/tools/template-nbscloud.service b/tools/template-nbscloud.service index d1c7d61..8c44773 100644 --- a/tools/template-nbscloud.service +++ b/tools/template-nbscloud.service @@ -5,10 +5,10 @@ Wants=network-online.target [Service] Type=simple - -# Values substituted from application.properties -ExecStart=java -jar DEPLOY_PATH_R/nbscloud.jar --spring.profiles.active=PROFILE_R -ReadWritePaths=BASE_DIR_R +ExecStart=java -jar %h/.local/share/java/nbscloud/nbscloud.jar --spring.config.additional-location="file://%h/.config/nbscloud/application.properties" +ReadWritePaths=%h/nbscloud +ReadOnlyPaths=%h/.local/share/java/nbscloud/nbscloud.jar +ReadOnlyPaths=%h/.config/nbscloud/application.properties # Hardening ProtectHome=true diff --git a/web-container/src/main/resources/config/application-mk.properties b/web-container/src/main/resources/config/application-mk.properties deleted file mode 100644 index 4c997bf..0000000 --- a/web-container/src/main/resources/config/application-mk.properties +++ /dev/null @@ -1,2 +0,0 @@ -nbscloud.deploy.service.user=marius -nbscloud.deploy.path=/opt/nbscloud \ No newline at end of file diff --git a/web-container/src/main/resources/static/changelog.txt b/web-container/src/main/resources/static/changelog.txt index af50a10..c6ae841 100644 --- a/web-container/src/main/resources/static/changelog.txt +++ b/web-container/src/main/resources/static/changelog.txt @@ -1,3 +1,6 @@ +v13 -> v14: +- #19 Release & deployment v2 + v12 - v13: - #18 Add profiles