mirror of
https://github.com/YunoHost-Apps/thelounge_ynh.git
synced 2024-09-03 20:35:54 +02:00
deb
This commit is contained in:
parent
3e641515e5
commit
07f8f26941
4 changed files with 51 additions and 51 deletions
7
conf/deb.src
Normal file
7
conf/deb.src
Normal file
|
@ -0,0 +1,7 @@
|
|||
SOURCE_URL=https://github.com/thelounge/thelounge/releases/download/v4.3.0-pre.6/thelounge_4.3.0.pre.6_all.deb
|
||||
SOURCE_SUM=0224f2bf7b3223358b92be8fa5a5a68fd93b1547f791ed20f9107c8e5933256a
|
||||
SOURCE_SUM_PRG=sha256sum
|
||||
SOURCE_FORMAT=deb
|
||||
SOURCE_IN_SUBDIR=true
|
||||
SOURCE_FILENAME=thelounge_4.3.0.pre.6_all.deb
|
||||
SOURCE_EXTRACT=false
|
|
@ -44,6 +44,10 @@
|
|||
"example": "/irc",
|
||||
"default": "/irc"
|
||||
},
|
||||
{
|
||||
"name": "admin",
|
||||
"type": "user"
|
||||
},
|
||||
{
|
||||
"name": "is_public",
|
||||
"type": "boolean",
|
||||
|
|
|
@ -23,6 +23,7 @@ ynh_abort_if_errors
|
|||
domain=$YNH_APP_ARG_DOMAIN
|
||||
path_url=$YNH_APP_ARG_PATH
|
||||
is_public=$YNH_APP_ARG_IS_PUBLIC
|
||||
admin=$YNH_APP_ARG_ADMIN
|
||||
|
||||
app=$YNH_APP_INSTANCE_NAME
|
||||
|
||||
|
@ -61,11 +62,9 @@ ynh_app_setting_set --app=$app --key=port --value=$port
|
|||
#=================================================
|
||||
ynh_script_progression --message="Installing dependencies..."
|
||||
|
||||
# Install Nodejs
|
||||
ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version
|
||||
|
||||
# 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"
|
||||
tempdir="$(mktemp -d)"
|
||||
ynh_setup_source --dest_dir=$tempdir --source_id=deb
|
||||
ynh_exec_warn_less dpkg -i $tempdir/thelounge_4.3.0.pre.6_all.deb
|
||||
|
||||
#=================================================
|
||||
# CREATE DEDICATED USER
|
||||
|
@ -75,18 +74,20 @@ ynh_script_progression --message="Configuring system user..."
|
|||
# Create a system user
|
||||
ynh_system_user_create --username=$app --home_dir="$final_path"
|
||||
|
||||
#=================================================
|
||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Setting up source files..."
|
||||
# #=================================================
|
||||
# # DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||
# #=================================================
|
||||
# ynh_script_progression --message="Setting up source files..."
|
||||
|
||||
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
|
||||
# Download, check integrity, uncompress and patch the source from app.src
|
||||
ynh_setup_source --dest_dir=$final_path
|
||||
# ynh_app_setting_set --app=$app --key=final_path --value=$final_path
|
||||
# # Download, check integrity, uncompress and patch the source from app.src
|
||||
# ynh_setup_source --dest_dir=$final_path
|
||||
|
||||
chmod 750 "$final_path"
|
||||
chmod -R o-rwx "$final_path"
|
||||
chown -R $app:www-data "$final_path"
|
||||
# chmod 750 "$final_path"
|
||||
# chmod -R o-rwx "$final_path"
|
||||
# chown -R $app:www-data "$final_path"
|
||||
|
||||
ynh_exec_as $app thelounge add $admin
|
||||
|
||||
#=================================================
|
||||
# NGINX CONFIGURATION
|
||||
|
@ -96,48 +97,36 @@ ynh_script_progression --message="Configuring NGINX web server..."
|
|||
# Create a dedicated NGINX config
|
||||
ynh_add_nginx_config
|
||||
|
||||
#=================================================
|
||||
# CREATE DATA DIRECTORY
|
||||
#=================================================
|
||||
ynh_script_progression --message="Creating a data directory..."
|
||||
# #=================================================
|
||||
# # CREATE DATA DIRECTORY
|
||||
# #=================================================
|
||||
# ynh_script_progression --message="Creating a data directory..."
|
||||
|
||||
datadir=/home/yunohost.app/$app
|
||||
ynh_app_setting_set --app=$app --key=datadir --value=$datadir
|
||||
# datadir=/home/yunohost.app/$app
|
||||
# ynh_app_setting_set --app=$app --key=datadir --value=$datadir
|
||||
|
||||
mkdir -p $datadir
|
||||
# mkdir -p $datadir
|
||||
|
||||
chmod 750 "$datadir"
|
||||
chmod -R o-rwx "$datadir"
|
||||
chown -R $app:www-data "$datadir"
|
||||
# chmod 750 "$datadir"
|
||||
# chmod -R o-rwx "$datadir"
|
||||
# chown -R $app:www-data "$datadir"
|
||||
|
||||
#=================================================
|
||||
# SPECIFIC SETUP
|
||||
#=================================================
|
||||
# MODIFY A CONFIG FILE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Modifying a config file..."
|
||||
# #=================================================
|
||||
# # SPECIFIC SETUP
|
||||
# #=================================================
|
||||
# # MODIFY A CONFIG FILE
|
||||
# #=================================================
|
||||
# ynh_script_progression --message="Modifying a config file..."
|
||||
|
||||
ynh_add_config --template="../conf/config.js" --destination="$datadir/config.js"
|
||||
# ynh_add_config --template="../conf/config.js" --destination="$datadir/config.js"
|
||||
|
||||
#=================================================
|
||||
# INSTALL THE LOUNGE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Installing The Lounge..."
|
||||
# #=================================================
|
||||
# # SETUP SYSTEMD
|
||||
# #=================================================
|
||||
# ynh_script_progression --message="Configuring a systemd service..."
|
||||
|
||||
pushd $final_path
|
||||
ynh_use_nodejs
|
||||
ynh_exec_warn_less NODE_ENV=production yarn install
|
||||
yarn add webpack webpack-dev-server --dev
|
||||
ynh_exec_warn_less NODE_ENV=production yarn build
|
||||
popd
|
||||
|
||||
#=================================================
|
||||
# SETUP SYSTEMD
|
||||
#=================================================
|
||||
ynh_script_progression --message="Configuring a systemd service..."
|
||||
|
||||
ynh_replace_string --match_string="__ENV_PATH__" --replace_string="$PATH" --target_file="../conf/systemd.service"
|
||||
ynh_add_systemd_config
|
||||
# ynh_replace_string --match_string="__ENV_PATH__" --replace_string="$PATH" --target_file="../conf/systemd.service"
|
||||
# ynh_add_systemd_config
|
||||
|
||||
#=================================================
|
||||
# INTEGRATE SERVICE IN YUNOHOST
|
||||
|
|
|
@ -48,7 +48,7 @@ ynh_remove_systemd_config
|
|||
ynh_script_progression --message="Removing dependencies..."
|
||||
|
||||
# Remove NodeJS
|
||||
ynh_remove_nodejs
|
||||
dpkg --remove thelounge
|
||||
|
||||
#=================================================
|
||||
# REMOVE APP MAIN DIR
|
||||
|
|
Loading…
Add table
Reference in a new issue