mirror of
https://github.com/YunoHost-Apps/kiwiirc_ynh.git
synced 2024-09-03 19:35:59 +02:00
Merge branch 'deb' into testing
This commit is contained in:
commit
19553b42c8
6 changed files with 51 additions and 68 deletions
|
@ -1,5 +1,7 @@
|
||||||
SOURCE_URL=https://github.com/kiwiirc/kiwiirc/releases/download/v1.5.0/kiwiirc_v1.5.0.zip
|
SOURCE_URL=https://kiwiirc.com/downloads/kiwiirc_20.05.24.1-1_amd64.deb
|
||||||
SOURCE_SUM=c7b31b2a92b173db4a3878d95aa74c8eb796e7b4d5600a80a00a73d80aa12ada
|
SOURCE_SUM=c99504c6de678fd91aed357ff0dada16a8df9e932970ed85767b516a9f87df52
|
||||||
SOURCE_SUM_PRG=sha256sum
|
SOURCE_SUM_PRG=sha256sum
|
||||||
SOURCE_FORMAT=zip
|
SOURCE_FORMAT=deb
|
||||||
SOURCE_IN_SUBDIR=true
|
SOURCE_IN_SUBDIR=true
|
||||||
|
SOURCE_FILENAME=kiwiirc_20.05.24.1-1_amd64.deb
|
||||||
|
SOURCE_EXTRACT=false
|
||||||
|
|
|
@ -1,9 +1,21 @@
|
||||||
#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent;
|
location / {
|
||||||
location __PATH__/ {
|
index index.html;
|
||||||
|
root /usr/share/kiwiirc/;
|
||||||
# Path to source
|
}
|
||||||
alias __FINALPATH__/ ;
|
|
||||||
|
location /webirc/ {
|
||||||
# Include SSOWAT user panel.
|
# Forward incoming requests to local webircgateway socket
|
||||||
include conf.d/yunohost_panel.conf.inc;
|
proxy_pass http://127.0.0.1:__PORT__/webirc/;
|
||||||
|
|
||||||
|
# Set http version and headers
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
|
||||||
|
# Add X-Forwarded-* headers
|
||||||
|
proxy_set_header X-Forwarded-Host $host;
|
||||||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
proxy_set_header X-Forwarded-For $remote_addr;
|
||||||
|
|
||||||
|
# Allow upgrades to websockets
|
||||||
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
|
proxy_set_header Connection "upgrade";
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,14 +0,0 @@
|
||||||
[Unit]
|
|
||||||
Description=Websocket gateway to IRC networks
|
|
||||||
Documentation=https://github.com/kiwiirc/webircgateway
|
|
||||||
After=network.target
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
User=__APP__
|
|
||||||
Group=__APP__
|
|
||||||
ExecStart=/var/www/webircgateway/kiwiirc --config=/var/www/webircgateway/config.conf
|
|
||||||
ExecReload=/usr/bin/kill -USR1 $MAINPID
|
|
||||||
LimitNOFILE=1048576
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=multi-user.target
|
|
|
@ -32,12 +32,6 @@
|
||||||
"name": "domain",
|
"name": "domain",
|
||||||
"type": "domain"
|
"type": "domain"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "path",
|
|
||||||
"type": "path",
|
|
||||||
"example": "/kiwiirc",
|
|
||||||
"default": "/kiwiirc"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "is_public",
|
"name": "is_public",
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
|
|
|
@ -21,7 +21,7 @@ ynh_abort_if_errors
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
domain=$YNH_APP_ARG_DOMAIN
|
domain=$YNH_APP_ARG_DOMAIN
|
||||||
path_url=$YNH_APP_ARG_PATH
|
path_url="/"
|
||||||
is_public=$YNH_APP_ARG_IS_PUBLIC
|
is_public=$YNH_APP_ARG_IS_PUBLIC
|
||||||
|
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
|
@ -31,8 +31,8 @@ app=$YNH_APP_INSTANCE_NAME
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Validating installation parameters..." --weight=1
|
ynh_script_progression --message="Validating installation parameters..." --weight=1
|
||||||
|
|
||||||
final_path=/var/www/$app
|
# final_path=/var/www/$app
|
||||||
test ! -e "$final_path" || ynh_die --message="This path already contains a folder"
|
# 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
|
||||||
|
@ -60,37 +60,26 @@ ynh_app_setting_set --app=$app --key=port --value=$port
|
||||||
ynh_script_progression --message="Configuring system user..." --weight=3
|
ynh_script_progression --message="Configuring system user..." --weight=3
|
||||||
|
|
||||||
# Create a system user
|
# Create a system user
|
||||||
ynh_system_user_create --username=$app --home_dir=$final_path
|
#ynh_system_user_create --username=$app --home_dir=$final_path
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Setting up source files..." --weight=2
|
# ynh_script_progression --message="Setting up source files..." --weight=2
|
||||||
|
|
||||||
ynh_app_setting_set --app=$app --key=final_path --value=$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
|
# # Download, check integrity, uncompress and patch the source from app.src
|
||||||
ynh_setup_source --dest_dir="$final_path"
|
# #ynh_setup_source --dest_dir="$final_path"
|
||||||
|
|
||||||
chmod 750 "$final_path"
|
# chmod 750 "$final_path"
|
||||||
chmod -R o-rwx "$final_path"
|
# chmod -R o-rwx "$final_path"
|
||||||
chown -R $app:www-data "$final_path"
|
# chown -R $app:www-data "$final_path"
|
||||||
|
|
||||||
#=================================================
|
tempdir="$(mktemp -d)"
|
||||||
#CREAT GATEWAYPATH
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Setting up gatheway path..." --weight=2
|
|
||||||
|
|
||||||
webircgateway_path=/var/www/webircgateway
|
ynh_setup_source --dest_dir=$tempdir --source_id=app
|
||||||
mkdir -p $webircgateway_path
|
|
||||||
|
|
||||||
ynh_app_setting_set --app=$app --key=webircgateway_path --value=$webircgateway_path
|
ynh_exec_warn_less dpkg -i $tempdir/kiwiirc_20.05.24.1-1_amd64.deb
|
||||||
|
|
||||||
mv ../sources/webircgateway/* $webircgateway_path
|
|
||||||
|
|
||||||
chmod 750 "$webircgateway_path"
|
|
||||||
chmod -R o-rwx "$webircgateway_path"
|
|
||||||
chown -R $app:www-data "$webircgateway_path"
|
|
||||||
chmod +x "$webircgateway_path/kiwiirc"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# NGINX CONFIGURATION
|
# NGINX CONFIGURATION
|
||||||
|
@ -103,18 +92,18 @@ ynh_add_nginx_config
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP SYSTEMD
|
# SETUP SYSTEMD
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Configuring a systemd service..." --weight=1
|
#ynh_script_progression --message="Configuring a systemd service..." --weight=1
|
||||||
|
|
||||||
# Create a dedicated systemd config
|
# Create a dedicated systemd config
|
||||||
ynh_add_systemd_config
|
#ynh_add_systemd_config
|
||||||
|
|
||||||
#=================================================
|
# #=================================================
|
||||||
# MODIFY A CONFIG FILE
|
# # MODIFY A CONFIG FILE
|
||||||
#=================================================
|
# #=================================================
|
||||||
ynh_script_progression --message="Modifying a config file..."
|
# ynh_script_progression --message="Modifying a config file..."
|
||||||
|
|
||||||
ynh_add_config --template="../conf/config.json.example" --destination="$final_path/static/config.json"
|
# ynh_add_config --template="../conf/config.json.example" --destination="$final_path/static/config.json"
|
||||||
ynh_add_config --template="../conf/config.conf.example" --destination="$webircgateway_path/config.conf"
|
# ynh_add_config --template="../conf/config.conf.example" --destination="$webircgateway_path/config.conf"
|
||||||
|
|
||||||
chmod 600 "$final_path/static/config.json"
|
chmod 600 "$final_path/static/config.json"
|
||||||
chmod 600 "$webircgateway_path/config.conf"
|
chmod 600 "$webircgateway_path/config.conf"
|
||||||
|
|
|
@ -45,11 +45,11 @@ ynh_remove_systemd_config
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Removing the app main directory..." --weight=6
|
ynh_script_progression --message="Removing the app main directory..." --weight=6
|
||||||
|
|
||||||
# Remove the app directory securely
|
# # Remove the app directory securely
|
||||||
ynh_secure_remove --file="$final_path"
|
# ynh_secure_remove --file="$final_path"
|
||||||
|
|
||||||
ynh_secure_remove --file="/var/www/webircgateway"
|
|
||||||
|
|
||||||
|
# ynh_secure_remove --file="/var/www/webircgateway"
|
||||||
|
dpkg --remove kiwiirc
|
||||||
#=================================================
|
#=================================================
|
||||||
# REMOVE NGINX CONFIGURATION
|
# REMOVE NGINX CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
Loading…
Reference in a new issue