diff --git a/README.md b/README.md index 35d0b55..653a72a 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ For a comprehensive introduction to rooms 2.0, watch [this video](https://www.yo ## Disclaimers / important information * requires a full dedicated domain and does not support sub-paths - * currently ony supported on amd64 architecture (until more binaries are built upstream) + * currently ony supports the following architectures: amd64, arm64, arm7 * ssb rooms work best when the app is in public mode. ssb-room has its own user and authentication system, and doesn't need yunohost SSO ## Documentation and resources diff --git a/compile_binaries/cross_compile_ssbroom.py b/compile_binaries/cross_compile_ssbroom.py index 584d1e0..0093f4f 100644 --- a/compile_binaries/cross_compile_ssbroom.py +++ b/compile_binaries/cross_compile_ssbroom.py @@ -3,6 +3,7 @@ script to cross-compile go-ssb-room for arm64 and other architectures before running, run: - sudo apt install gcc-aarch64-linux-gnu +- sudo apt install gcc-arm-linux-gnueabi """ import subprocess @@ -34,6 +35,18 @@ def crosscompile_go_ssb_room(): "GOARCH=arm64", "go", "build", "./cmd/insert-user"], cwd=WORKING_DIR) publish(architecture="aarch64") +def crosscompile_go_ssb_room_for_arm7(): + subprocess.check_call(["git", "pull"], cwd=WORKING_DIR) + print("[CROSS-COMPILING for arm7 go-ssb-room/server]") + subprocess.check_call(["env", "CGO_ENABLED=1", "CC=arm-linux-gnueabi-gcc", + "GOOS=linux", + "GOARCH=arm", "GOARM=7", "go", "build", "./cmd/server"], cwd=WORKING_DIR) + print("[CROSS-COMPILING for arm7 go-ssb-room/insert-user]") + subprocess.check_call(["env", "CGO_ENABLED=1", "CC=arm-linux-gnueabi-gcc", + "GOOS=linux", + "GOARCH=arm", "GOARM=7", "go", "build", "./cmd/insert-user"], cwd=WORKING_DIR) + publish(architecture="arm7") + def compile_go_ssb_room(): subprocess.check_call(["git", "pull"], cwd=WORKING_DIR) print("[COMPILING go-ssb-room/server for amd64]") @@ -60,5 +73,6 @@ def publish(architecture): if __name__ == '__main__': pull_repo() - crosscompile_go_ssb_room() - compile_go_ssb_room() + # crosscompile_go_ssb_room() + crosscompile_go_ssb_room_for_arm7() + # compile_go_ssb_room() diff --git a/conf/arm7.src b/conf/arm7.src new file mode 100644 index 0000000..d648c9d --- /dev/null +++ b/conf/arm7.src @@ -0,0 +1,7 @@ +SOURCE_URL=https://files.commoninternet.net/go-ssb-room_2.0.6_Linux_arm7.tar.gz +SOURCE_SUM=8894b7b21031976e1d79265fefdcef4edb6fde38f34231e8aea4cebcc85a4f88 +SOURCE_SUM_PRG=sha256sum +SOURCE_FORMAT=tar.gz +SOURCE_IN_SUBDIR=true +SOURCE_FILENAME= +SOURCE_EXTRACT=true diff --git a/conf/systemd.service b/conf/systemd.service index 08eb433..2456797 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -6,7 +6,7 @@ After=network.target Type=simple User=__APP__ Group=__APP__ -WorkingDirectory=__DATADIR__/ +WorkingDirectory=__DATADIR__ ExecStart=__FINALPATH__/server -repo __DATADIR__/ -lishttp localhost:__PORT__ -https-domain __DOMAIN__ -lismux :__SSBPORT__ -aliases-as-subdomains false StandardOutput=append:/var/log/__APP__/__APP__.log StandardError=inherit diff --git a/doc/DISCLAIMER.md b/doc/DISCLAIMER.md index a80e63e..a05a19f 100644 --- a/doc/DISCLAIMER.md +++ b/doc/DISCLAIMER.md @@ -1,3 +1,3 @@ * requires a full dedicated domain and does not support sub-paths - * currently ony supported on amd64 architecture (until more binaries are built upstream) + * currently ony supports the following architectures: amd64, arm64, arm7 * ssb rooms work best when the app is in public mode. ssb-room has its own user and authentication system, and doesn't need yunohost SSO \ No newline at end of file diff --git a/scripts/install b/scripts/install index e3b69d2..6814af3 100755 --- a/scripts/install +++ b/scripts/install @@ -147,6 +147,15 @@ ynh_script_progression --message="Configuring a systemd service..." --weight=1 # Create a dedicated systemd config ynh_add_systemd_config +# for yunohost version < 4.2, this is a workaround to replace string variables +ynh_script_progression --message="String replacing systemd service with $datadir" --weight=1 +systemd_file="/etc/systemd/system/$app.service" +ynh_replace_string --match_string=__DATADIR__ --replace_string=$datadir --target_file=$systemd_file +ynh_replace_string --match_string=__PORT__ --replace_string=$port --target_file=$systemd_file +ynh_replace_string --match_string=__DOMAIN__ --replace_string=$domain --target_file=$systemd_file +ynh_replace_string --match_string=__SSBPORT__ --replace_string=$ssbport --target_file=$systemd_file +systemctl daemon-reload + #================================================= # GENERIC FINALIZATION #=================================================