1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/tube_ynh.git synced 2024-09-04 01:46:11 +02:00

Merge pull request #2 from YunoHost-Apps/testing

Testing
This commit is contained in:
Éric Gaspar 2022-08-27 12:24:39 +02:00 committed by GitHub
commit 2e6ea131d5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 132 additions and 23 deletions

View file

@ -49,6 +49,8 @@ Your video files are stored by default in `/home/yunohost.app/tube/videos`.
You can configure options in this file `/var/www/tube/config.json` using the [documentation](https://git.mills.io/prologic/tube#configuration). Remember to restart Tube service if you change your configuration file.
RSS feed address is available at `https://your_domain.tld/feed.xml`
## Documentation and resources
* Upstream app code repository: <https://git.mills.io/prologic/tube>

View file

@ -49,6 +49,8 @@ Your video files are stored by default in `/home/yunohost.app/tube/videos`.
You can configure options in this file `/var/www/tube/config.json` using the [documentation](https://git.mills.io/prologic/tube#configuration). Remember to restart Tube service if you change your configuration file.
RSS feed address is available at `https://your_domain.tld/feed.xml`
## Documentations et ressources
* Dépôt de code officiel de l'app : <https://git.mills.io/prologic/tube>

View file

@ -10,7 +10,7 @@
"port": __PORT__,
"store_path": "tube.db",
"upload_path": "__DATADIR__/uploads",
"max_upload_size": 104857600
"max_upload_size": __MAX_UPLOAD_SIZE__
},
"thumbnailer": {
"timeout": 60
@ -26,14 +26,14 @@
},
"feed": {
"external_url": "https://__DOMAIN__",
"title": "Feed Title",
"title": "__FEED_TITLE__",
"link": "http://__DOMAIN__/about",
"description": "Feed Description",
"description": "__FEED_DESCRIPTION__",
"author": {
"name": "Author Name",
"email": "author@somewhere.example"
"name": "__AUTHOR_NAME__",
"email": "__AUTHOR_EMAIL__"
},
"copyright": "Copyright Text"
"copyright": "__COPYRIGHT_TEXT__"
},
"copyright": {
"content": "All Content herein Public Domain and User Contributed."

47
config_panel.toml Normal file
View file

@ -0,0 +1,47 @@
version = "1.0"
[main]
name = "Tube configuration"
services = ["__APP__"]
[main.config]
name = "Configuration Options"
[main.config.max_upload_size]
ask = "Max Upload Size"
type = "number"
help = "Set max_upload_size to the maximum number of bytes you wish to impose on uploaded and imported videos. Upload(s)/Import(s) that exceed this size will by denied by the server. This is a saftey measure so as to not DoS the Tube server instance. Set it to a sensible value you see fit."
bind = "max_upload_size:/var/www/__APP__/config.json"
[main.rss]
name = "RSS feed information"
[main.rss.feed_title]
ask = "Feed Title"
type = "string"
help = "Set the feed title for your RSS feed"
bind = "title:/var/www/__APP__/config.json"
[main.rss.feed_description]
ask = "Feed Description"
type = "string"
help = "Set the feed description for your RSS feed"
bind = "description:/var/www/__APP__/config.json"
[main.rss.author_name]
ask = "Author Name"
type = "string"
help = "Set the author name for the RSS feed"
bind = "name:/var/www/__APP__/config.json"
[main.rss.author_email]
ask = "Author Email"
type = "string"
help = "Set the author email for the RSS feed"
bind = "email:/var/www/__APP__/config.json"
[main.rss.copyright_text]
ask = "Copyright Text"
type = "string"
help = "Set the copyright text for the RSS feed"
bind = "copyright:/var/www/__APP__/config.json"

View file

@ -1,15 +0,0 @@
version = "1.0"
[main]
name = "Tube configuration"
services = ["__APP__"]
[main.config]
name = "Configuration Options"
[main.config.max_upload_size]
ask = "Max upload size"
type = "number"
help = "Set max_upload_size to the maximum number of bytes you wish to impose on uploaded and imported videos. Upload(s)/Import(s) that exceed this size will by denied by the server. This is a saftey measure so as to not DoS the Tube server instance. Set it to a sensible value you see fit."
bind = "max_upload_size:/var/www/__APP__/config.json"

View file

@ -5,3 +5,5 @@
Your video files are stored by default in `/home/yunohost.app/tube/videos`.
You can configure options in this file `/var/www/tube/config.json` using the [documentation](https://git.mills.io/prologic/tube#configuration). Remember to restart Tube service if you change your configuration file.
RSS feed address is available at `https://your_domain.tld/feed.xml`

View file

@ -28,6 +28,7 @@ ynh_script_progression --message="Loading installation settings..." --weight=1
# Needed for helper "ynh_add_nginx_config"
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
port=$(ynh_app_setting_get --app=$app --key=port)
#=================================================
# BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP

View file

@ -30,6 +30,13 @@ is_public=$YNH_APP_ARG_IS_PUBLIC
app=$YNH_APP_INSTANCE_NAME
max_upload_size=1048576000
feed_title="Feed title"
feed_description="Feed description"
author_name="Author Name"
author_email="author@somewhere.example"
copyright_text="Copyright Text"
#=================================================
# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
#=================================================
@ -48,6 +55,12 @@ ynh_script_progression --message="Storing installation settings..." --weight=1
ynh_app_setting_set --app=$app --key=domain --value=$domain
ynh_app_setting_set --app=$app --key=path --value=$path_url
ynh_app_setting_set --app=$app --key=max_upload_size --value=$max_upload_size
ynh_app_setting_set --app=$app --key=feed_title --value=$feed_title
ynh_app_setting_set --app=$app --key=feed_description --value=$feed_description
ynh_app_setting_set --app=$app --key=author_name --value=$author_name
ynh_app_setting_set --app=$app --key=author_email --value=$author_email
ynh_app_setting_set --app=$app --key=copyright_text --value=$copyright_text
#=================================================
# STANDARD MODIFICATIONS
@ -80,7 +93,7 @@ ynh_setup_source --dest_dir="$final_path" --source_id=$YNH_ARCH
chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path"
chmod +x "$final_path/$app"
chmod +x "$final_path/tube"
#=================================================
# NGINX CONFIGURATION

View file

@ -19,6 +19,14 @@ app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get --app=$app --key=domain)
path_url=$(ynh_app_setting_get --app=$app --key=path)
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
port=$(ynh_app_setting_get --app=$app --key=port)
max_upload_size=$(ynh_app_setting_get --app=$app --key=max_upload_size)
feed_title=$(ynh_app_setting_get --app=$app --key=feed_title)
feed_description=$(ynh_app_setting_get --app=$app --key=feed_description)
author_name=$(ynh_app_setting_get --app=$app --key=author_name)
author_email=$(ynh_app_setting_get --app=$app --key=author_email)
copyright_text=$(ynh_app_setting_get --app=$app --key=copyright_text)
#=================================================
# CHECK VERSION
@ -49,6 +57,55 @@ ynh_script_progression --message="Stopping a systemd service..." --weight=1
ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log"
#=================================================
# ENSURE DOWNWARD COMPATIBILITY
#=================================================
ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
# If max_upload_size doesn't exist, create it
if [ -z "$max_upload_size" ]; then
max_upload_size=100
ynh_app_setting_set --app=$app --key=max_upload_size --value=$max_upload_size
fi
# If feed_title doesn't exist, create it
if [ -z "$feed_title" ]; then
feed_title="Feed title"
ynh_app_setting_set --app=$app --key=feed_title --value=$feed_title
fi
# If feed_description doesn't exist, create it
if [ -z "$feed_description" ]; then
feed_description="Feed description"
ynh_app_setting_set --app=$app --key=feed_description --value=$feed_description
fi
# If author_name doesn't exist, create it
if [ -z "$author_name" ]; then
author_name="Author Name"
ynh_app_setting_set --app=$app --key=author_name --value=$author_name
fi
# If author_email doesn't exist, create it
if [ -z "$author_email" ]; then
author_email="author@somewhere.example"
ynh_app_setting_set --app=$app --key=author_email --value=$author_email
fi
# If copyright_text doesn't exist, create it
if [ -z "$copyright_text" ]; then
copyright_text="Copyright Text"
ynh_app_setting_set --app=$app --key=copyright_text --value=$copyright_text
fi
# Cleaning legacy permissions
if ynh_legacy_permissions_exists; then
ynh_legacy_permissions_delete_all
ynh_app_setting_delete --app=$app --key=is_public
fi
#=================================================
# CREATE DEDICATED USER
#=================================================
@ -72,7 +129,7 @@ fi
chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path"
chmod +x "$final_path/$app"
chmod +x "$final_path/tube"
#=================================================
# NGINX CONFIGURATION