1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/thelounge_ynh.git synced 2024-09-03 20:35:54 +02:00
This commit is contained in:
ericgaspar 2021-07-02 17:14:11 +02:00
parent e042f453d9
commit ed6deb72d9
No known key found for this signature in database
GPG key ID: 574F281483054D44
3 changed files with 24 additions and 43 deletions

View file

@ -1,6 +1,6 @@
SOURCE_URL=https://github.com/thelounge/thelounge/archive/v4.2.0.tar.gz SOURCE_URL=https://github.com/thelounge/thelounge-deb/releases/download/v4.2.0/thelounge_4.2.0_all.deb
SOURCE_SUM=6119c0692f03678940848ec19a8095ba67f8fdba42bb12481205314eabc0672d SOURCE_SUM=
SOURCE_SUM_PRG=sha256sum SOURCE_SUM_PRG=sha256sum
ARCH_FORMAT=tar.gz ARCH_FORMAT=deb
SOURCE_IN_SUBDIR=true SOURCE_IN_SUBDIR=true
SOURCE_FILENAME= SOURCE_FILENAME=thelounge_4.2.0_all.deb

View file

@ -1,20 +1,18 @@
[Unit] [Unit]
Description=The Lounge IRC client Description=The Lounge (IRC client)
After=network.target After=network-online.target
Wants=network-online.target
[Service] [Service]
Type=simple
User=__APP__ User=__APP__
Group=__APP__ Group=__APP__
WorkingDirectory=__FINALPATH__ Type=simple
Environment="PATH=__ENV_PATH__" ExecStart=/usr/bin/thelounge start
Environment="THELOUNGE_HOME=/home/yunohost.app/__APP__/" ProtectSystem=yes
Environment="NODE_ENV=production" ProtectHome=yes
ExecStart=/usr/bin/yarn start NoNewPrivileges=yes
Restart=on-failure PrivateTmp=yes
RestartSec=5
StartLimitInterval=60s
StartLimitBurst=3
[Install] [Install]
WantedBy=default.target WantedBy=multi-user.target

View file

@ -33,10 +33,6 @@ app=$YNH_APP_INSTANCE_NAME
#================================================= #=================================================
ynh_script_progression --message="Validating installation parameters..." ynh_script_progression --message="Validating installation parameters..."
final_path=/var/www/$app
config_path=/home/yunohost.app/$app
test ! -e "$final_path" || ynh_die --message="This path already contains a folder"
# Register (book) web path # Register (book) web path
ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url
@ -68,8 +64,8 @@ ynh_script_progression --message="Installing dependencies..."
# Install Nodejs # Install Nodejs
ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version
# Install Yarn # # Install Yarn
ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg" # ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg"
#================================================= #=================================================
# CREATE DEDICATED USER # CREATE DEDICATED USER
@ -84,9 +80,9 @@ ynh_system_user_create --username=$app --home_dir="$final_path"
#================================================= #=================================================
ynh_script_progression --message="Setting up source files..." ynh_script_progression --message="Setting up source files..."
ynh_app_setting_set --app=$app --key=final_path --value=$final_path tempdir="$(mktemp -d)"
# Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir=$tempdir --source_id=app
ynh_setup_source --dest_dir=$final_path ynh_exec_warn_less dpkg -i $tempdir/thelounge_4.2.0_all.deb
#================================================= #=================================================
# NGINX CONFIGURATION # NGINX CONFIGURATION
@ -103,29 +99,15 @@ ynh_add_nginx_config
#================================================= #=================================================
ynh_script_progression --message="Modifying a config file..." ynh_script_progression --message="Modifying a config file..."
mkdir -p /home/yunohost.app/$app #mkdir -p /home/yunohost.app/$app
ynh_add_config --template="../conf/config.js" --destination="$config_path/config.js" ynh_add_config --template="../conf/config.js" --destination="/etc/thelounge/config.js"
#=================================================
# INSTALL THE LOUNGE
#=================================================
ynh_script_progression --message="Installing The Lounge..."
pushd $final_path
ynh_use_nodejs
yarn install
ynh_exec_warn_less NODE_ENV=production yarn build
popd
#================================================= #=================================================
# SETUP SYSTEMD # SETUP SYSTEMD
#================================================= #=================================================
ynh_script_progression --message="Configuring a systemd service..." ynh_script_progression --message="Configuring a systemd service..."
ynh_replace_string --match_string="__ENV_PATH__" --replace_string="$PATH" --target_file="../conf/systemd.service"
ynh_replace_string --match_string="__NODE__" --replace_string="$nodejs_path" --target_file="../conf/systemd.service"
ynh_add_systemd_config ynh_add_systemd_config
#================================================= #=================================================
@ -152,7 +134,8 @@ yunohost service add $app --description="Client Web IRC" --log="/var/log/$app/$a
ynh_script_progression --message="Starting a systemd service..." ynh_script_progression --message="Starting a systemd service..."
# Start a systemd service # Start a systemd service
ynh_systemd_action --service_name=$app --action=start --log_path=systemd --line_match="Available at http" #ynh_systemd_action --service_name=$app --action=start --log_path=systemd --line_match="Available at http"
systemctl enable --now thelounge.service
#================================================= #=================================================
# SETUP SSOWAT # SETUP SSOWAT