From 8dfc58feb9ae4f80b857c938ef15a4e03e5ab1e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Tue, 26 Sep 2023 14:47:45 +0200 Subject: [PATCH] Use github artifacts instead of deb package --- conf/systemd.service | 2 +- manifest.toml | 25 ++++++++++++++++++++++--- scripts/install | 1 + scripts/upgrade | 4 ++-- 4 files changed, 26 insertions(+), 6 deletions(-) diff --git a/conf/systemd.service b/conf/systemd.service index 195dfbc..1c5e161 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -8,7 +8,7 @@ User=__APP__ Group=__APP__ WorkingDirectory=__INSTALL_DIR__/ EnvironmentFile=-__INSTALL_DIR__/ttyd_httpsh.conf -ExecStart=ttyd $OPTIONS $COMMAND $COMMAND_ARGS +ExecStart=__INSTALL_DIR__/ttyd $OPTIONS $COMMAND $COMMAND_ARGS StandardOutput=append:/var/log/__APP__/__APP__.log StandardError=inherit diff --git a/manifest.toml b/manifest.toml index 3f19459..19ba965 100644 --- a/manifest.toml +++ b/manifest.toml @@ -44,6 +44,28 @@ ram.runtime = "10M" default = "all_users" [resources] + [resources.sources.ttyd] + format = "whatever" + rename = "ttyd" + + armhf.url = "https://github.com/tsl0922/ttyd/releases/download/1.7.3/ttyd.armhf" + armhf.sha256 = "b0784080bd78f0a5916462672f461542c607f8ea7cee56b075e8cd04e1ffcc4d" + + arm64.url = "https://github.com/tsl0922/ttyd/releases/download/1.7.3/ttyd.aarch64" + arm64.sha256 = "c77fbb475a767c8f2d52c1fd28f167eb115a3b10ff114920d38c13f8ad4fcfbd" + + i386.url = "https://github.com/tsl0922/ttyd/releases/download/1.7.3/ttyd.i686" + i386.sha256 = "0ad0feb6ed0f356cfbc70a2c6009d99dc528a43686363e5fb6580410294ea60d" + + amd64.url = "https://github.com/tsl0922/ttyd/releases/download/1.7.3/ttyd.x86_64" + amd64.sha256 = "67cf926ddf157dcb089106c2aa6623b8613bb7f3b493048eeb6cc34423570b3c" + + autoupdate.strategy = "latest_github_release" + autoupdate.asset.armhf = "ttyd.armhf" + autoupdate.asset.arm64 = "ttyd.aarch64" + autoupdate.asset.i386 = "ttyd.i686" + autoupdate.asset.amd64 = "ttyd.x86_64" + [resources.sources.httpsh] url = "https://github.com/leshniak/httpsh/archive/7d80fac0d48f30e29eaff9a7471399c19ad31518.tar.gz" sha256 = "cc7354752e80e1563e80271b7253c0f293346cd46cdfe4858dcf68865e573d30" @@ -56,6 +78,3 @@ ram.runtime = "10M" main.url = "/" [resources.ports] - - [resources.apt] - packages = ["ttyd"] diff --git a/scripts/install b/scripts/install index a0bb486..4bd7752 100755 --- a/scripts/install +++ b/scripts/install @@ -16,6 +16,7 @@ source /usr/share/yunohost/helpers #================================================= ynh_script_progression --message="Setting up source files..." --weight=1 +ynh_setup_source --source_id=ttyd --dest_dir="$install_dir/ttyd" ynh_setup_source --source_id=httpsh --dest_dir="$install_dir/httpsh" # TODO: copy files where needed diff --git a/scripts/upgrade b/scripts/upgrade index 3f581fb..663918a 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -53,8 +53,8 @@ if [ "$upgrade_type" == "UPGRADE_APP" ] then ynh_script_progression --message="Upgrading source files..." --weight=1 - # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$install_dir" + ynh_setup_source --source_id=ttyd --dest_dir="$install_dir/ttyd" + ynh_setup_source --source_id=httpsh --dest_dir="$install_dir/httpsh" fi # $install_dir will automatically be initialized with some decent