mirror of
https://github.com/YunoHost-Apps/calibreweb_ynh.git
synced 2024-09-03 18:16:20 +02:00
Remove script
Comment on the install Update README.md add update to manifest
This commit is contained in:
parent
6c11235288
commit
66db4a5935
5 changed files with 78 additions and 87 deletions
70
README.md
70
README.md
|
@ -1,69 +1,35 @@
|
||||||
# Usage of this package (REMOVE THIS SECTION BEFORE RELEASE)
|
|
||||||
- Copy this app before working on it.
|
|
||||||
- Edit `conf/nginx.conf` file to match application prerequisites.
|
|
||||||
- Edit `manifest.json` with application specific information.
|
|
||||||
- Edit the `install`, `upgrade`, `remove`, `backup`, and `restore` scripts.
|
|
||||||
- Add a `LICENSE` file for the package.
|
|
||||||
- Edit `README.md`.
|
|
||||||
|
|
||||||
# Example app for YunoHost
|
# Example app for YunoHost
|
||||||
|
|
||||||
[](https://ci-apps.yunohost.org/jenkins/job/REPLACEBYYOURAPP%20%28Community%29/lastBuild/consoleFull)
|
[](https://ci-apps.yunohost.org/jenkins/job/calibreweb%20%28Community%29/lastBuild/consoleFull)
|
||||||
[](https://install-app.yunohost.org/?app=REPLACEBYYOURAPP)
|
[](https://install-app.yunohost.org/?app=calibreweb)
|
||||||
|
|
||||||
> *This package allow you to install REPLACEBYYOURAPP quickly and simply on a YunoHost server.
|
> *This package allow you to install calibreweb quickly and simply on a YunoHost server.
|
||||||
If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to know how to install and enjoy it.*
|
If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to know how to install and enjoy it.*
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
Quick description of this app.
|
This is an implementation of [Calibre-web](https://github.com/janeczku/calibre-web) for Yunohost.
|
||||||
|
|
||||||
**Shipped version:** 1.0
|
Calibre-Web is a web app providing a clean interface for browsing, reading and downloading eBooks using an existing [Calibre](https://calibre-ebook.com) database.
|
||||||
|
|
||||||
|
*This software is a fork of [library](https://github.com/mutschler/calibreserver) and licensed under the GPL v3 License.*
|
||||||
|
|
||||||
|
**Shipped version:** To be 1.0
|
||||||
|
|
||||||
## Screenshots
|
## Screenshots
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## Demo
|
|
||||||
|
|
||||||
* [Official demo](Link to a demo site for this app)
|
|
||||||
|
|
||||||
## Configuration
|
|
||||||
|
|
||||||
How to configure this app: by an admin panel, a plain file with SSH, or any other way.
|
|
||||||
|
|
||||||
## Documentation
|
|
||||||
|
|
||||||
* Official documentation: Link to the official documentation of this app
|
|
||||||
* YunoHost documentation: If specific documentation is needed, feel free to contribute.
|
|
||||||
|
|
||||||
## YunoHost specific features
|
|
||||||
|
|
||||||
#### Multi-users support
|
|
||||||
|
|
||||||
Are LDAP and HTTP auth supported?
|
|
||||||
Can the app be used by multiple users?
|
|
||||||
|
|
||||||
#### Supported architectures
|
|
||||||
|
|
||||||
* x86-64b - [/badge/icon)](https://ci-apps.yunohost.org/jenkins/job/REPLACEBYYOURAPP%20(Community)/)
|
|
||||||
* ARMv8-A - [%20(%7EARM%7E)/badge/icon)](https://ci-apps-arm.yunohost.org/jenkins/job/REPLACEBYYOURAPP%20(Community)%20(%7EARM%7E)/)
|
|
||||||
* Jessie x86-64b - [/badge/icon)](https://ci-stretch.nohost.me/jenkins/job/REPLACEBYYOURAPP%20(Community)/)
|
|
||||||
|
|
||||||
## Limitations
|
## Limitations
|
||||||
|
|
||||||
* Any known limitations.
|
* No LDAP support
|
||||||
|
* backup, restore and upgrade script not yet up to date
|
||||||
## Additional information
|
* access to library to be done manually after install
|
||||||
|
|
||||||
* Other information you would add about this application
|
|
||||||
|
|
||||||
**More information on the documentation page:**
|
|
||||||
https://yunohost.org/packaging_apps
|
|
||||||
|
|
||||||
## Links
|
## Links
|
||||||
|
|
||||||
* Report a bug: https://github.com/YunoHost-Apps/REPLACEBYYOURAPP_ynh/issues
|
* Report a bug: https://github.com/YunoHost-Apps/calibreweb_ynh/issues
|
||||||
* App website: Link to the official website of this app
|
* App website: https://github.com/janeczku/calibre-web
|
||||||
* YunoHost website: https://yunohost.org/
|
* YunoHost website: https://yunohost.org/
|
||||||
|
|
||||||
---
|
---
|
||||||
|
@ -72,11 +38,11 @@ Developers info
|
||||||
----------------
|
----------------
|
||||||
|
|
||||||
**Only if you want to use a testing branch for coding, instead of merging directly into master.**
|
**Only if you want to use a testing branch for coding, instead of merging directly into master.**
|
||||||
Please do your pull request to the [testing branch](https://github.com/YunoHost-Apps/REPLACEBYYOURAPP_ynh/tree/testing).
|
Please do your pull request to the [testing branch](https://github.com/YunoHost-Apps/calibreweb_ynh/tree/testing).
|
||||||
|
|
||||||
To try the testing branch, please proceed like that.
|
To try the testing branch, please proceed like that.
|
||||||
```
|
```
|
||||||
sudo yunohost app install https://github.com/YunoHost-Apps/REPLACEBYYOURAPP_ynh/tree/testing --debug
|
sudo yunohost app install https://github.com/YunoHost-Apps/calibreweb_ynh/tree/testing --debug
|
||||||
or
|
or
|
||||||
sudo yunohost app upgrade REPLACEBYYOURAPP -u https://github.com/YunoHost-Apps/REPLACEBYYOURAPP_ynh/tree/testing --debug
|
sudo yunohost app upgrade calibreweb -u https://github.com/YunoHost-Apps/calibreweb_ynh/tree/testing --debug
|
||||||
```
|
```
|
||||||
|
|
|
@ -7,4 +7,5 @@ config_remote_login=0,
|
||||||
config_use_goodreads=0,
|
config_use_goodreads=0,
|
||||||
config_logfile=\'\',
|
config_logfile=\'\',
|
||||||
config_converterpath=\'\',
|
config_converterpath=\'\',
|
||||||
config_calibre=\'\'
|
config_calibre=\'\',
|
||||||
|
config_uploading=\'$upload\'
|
|
@ -62,25 +62,7 @@
|
||||||
},
|
},
|
||||||
"example": "johndoe"
|
"example": "johndoe"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "language",
|
|
||||||
"type":"language",
|
|
||||||
"ask": {
|
|
||||||
"en": "Select a default language (you may change it later in the app",
|
|
||||||
"fr": "Choisissez une langue par défaut (vous pourrez la changer ultérieurement dans l'application"
|
|
||||||
},
|
|
||||||
"choices": [ "fr", "en", "es", "de"],
|
|
||||||
"default": "fr"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "is_public",
|
|
||||||
"type": "boolean",
|
|
||||||
"ask": {
|
|
||||||
"en": "Is it a public application?",
|
|
||||||
"fr": "Est-ce une application publique ?"
|
|
||||||
},
|
|
||||||
"default": false
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "password",
|
"name": "password",
|
||||||
"type": "password",
|
"type": "password",
|
||||||
|
@ -94,6 +76,34 @@
|
||||||
},
|
},
|
||||||
"example": "Choose a password"
|
"example": "Choose a password"
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
"name": "language",
|
||||||
|
"type":"language",
|
||||||
|
"ask": {
|
||||||
|
"en": "Select a default language (you may change it later in the app)",
|
||||||
|
"fr": "Choisissez une langue par défaut (vous pourrez la changer ultérieurement dans l'application)"
|
||||||
|
},
|
||||||
|
"choices": [ "fr", "en", "es", "de"],
|
||||||
|
"default": "fr"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "upload",
|
||||||
|
"type":"boolean",
|
||||||
|
"ask": {
|
||||||
|
"en": "Do you want to allow uploading of books (you may change it later in the app)?",
|
||||||
|
"fr": "Voulez vous autoriser l'upload de livres (vous pourrez la changer ultérieurement dans l'application)?"
|
||||||
|
},
|
||||||
|
"default": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "is_public",
|
||||||
|
"type": "boolean",
|
||||||
|
"ask": {
|
||||||
|
"en": "Is it a public application?",
|
||||||
|
"fr": "Est-ce une application publique ?"
|
||||||
|
},
|
||||||
|
"default": false
|
||||||
|
},
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,9 +25,12 @@ path_url=$YNH_APP_ARG_PATH
|
||||||
admin=$YNH_APP_ARG_ADMIN
|
admin=$YNH_APP_ARG_ADMIN
|
||||||
is_public=$YNH_APP_ARG_IS_PUBLIC
|
is_public=$YNH_APP_ARG_IS_PUBLIC
|
||||||
language=$YNH_APP_ARG_LANGUAGE
|
language=$YNH_APP_ARG_LANGUAGE
|
||||||
|
ynh_print_OFF
|
||||||
pass=$YNH_APP_ARG_PASSWORD
|
pass=$YNH_APP_ARG_PASSWORD
|
||||||
|
ynh_print_ON
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
calibre_dir=$3
|
calibre_dir=$3
|
||||||
|
upload=$7
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
|
# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
|
||||||
|
@ -54,6 +57,7 @@ ynh_app_setting_set $app domain $domain
|
||||||
ynh_app_setting_set $app path $path_url
|
ynh_app_setting_set $app path $path_url
|
||||||
ynh_app_setting_set $app admin $admin
|
ynh_app_setting_set $app admin $admin
|
||||||
ynh_app_setting_set $app is_public $is_public
|
ynh_app_setting_set $app is_public $is_public
|
||||||
|
ynh_app_setting_set $app calibre_dir $calibre_dir
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STANDARD MODIFICATIONS
|
# STANDARD MODIFICATIONS
|
||||||
|
@ -72,10 +76,12 @@ ynh_app_setting_set $app port $port
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_app_setting_set $app final_path $final_path
|
ynh_app_setting_set $app final_path $final_path
|
||||||
|
|
||||||
# Download, check integrity, uncompress and patch the source from app.src
|
# Download, check integrity, uncompress and patch the source from app.src
|
||||||
#as long as v1 is not reached, sha256sum will change without notice so not usable.
|
#as long as v1 is not reached, sha256sum will change without notice so not usable, so we use cp -a instead.
|
||||||
#source are directly in the app so far
|
#source are directly in the app so far
|
||||||
#ynh_setup_source "$final_path"
|
#ynh_setup_source "$final_path"
|
||||||
|
|
||||||
cp -a ../src/. $final_path
|
cp -a ../src/. $final_path
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -85,7 +91,6 @@ cp -a ../src/. $final_path
|
||||||
ynh_install_app_dependencies $pkg_dependencies
|
ynh_install_app_dependencies $pkg_dependencies
|
||||||
pip install --target $final_path/vendor -r $final_path/requirements.txt
|
pip install --target $final_path/vendor -r $final_path/requirements.txt
|
||||||
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# NGINX CONFIGURATION
|
# NGINX CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -113,9 +118,14 @@ ynh_add_systemd_config
|
||||||
# SECURE FILES AND DIRECTORIES
|
# SECURE FILES AND DIRECTORIES
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
### For security reason, any app should set the permissions to root: before anything else.
|
#Check if library folder exists. If not create it
|
||||||
### Then, if write authorization is needed, any access should be given only to directories
|
test ! -e "$calibre_dir"
|
||||||
### that really need such authorization.
|
if [[ $? = 0 ]] ; then
|
||||||
|
ynh_print_info "Create calibre library folder $calibre_dir"
|
||||||
|
mkdir -p $calibre_dir
|
||||||
|
chown -R $app:$app $calibre_dir
|
||||||
|
create_dir=1
|
||||||
|
fi
|
||||||
|
|
||||||
# Set permissions to app files
|
# Set permissions to app files
|
||||||
chown -R $app:$app $final_path
|
chown -R $app:$app $final_path
|
||||||
|
@ -149,8 +159,9 @@ conf="\"UPDATE user SET $(. <(echo -E echo $(<../conf/init_calibre_db_user))) WH
|
||||||
eval sqlite3 $final_path/app.db "$conf"
|
eval sqlite3 $final_path/app.db "$conf"
|
||||||
|
|
||||||
#mise à jour du mot de passe (je ne sais pas pourquoi, je n'arrive pas à l'intégrer dans le fichier de conf, pb de " et ')
|
#mise à jour du mot de passe (je ne sais pas pourquoi, je n'arrive pas à l'intégrer dans le fichier de conf, pb de " et ')
|
||||||
|
ynh_print_OFF
|
||||||
sqlite3 $final_path/app.db "UPDATE user SET password='$(python ../conf/generate_password_hash.py $pass $final_path/vendor)' WHERE ID=1"
|
sqlite3 $final_path/app.db "UPDATE user SET password='$(python ../conf/generate_password_hash.py $pass $final_path/vendor)' WHERE ID=1"
|
||||||
|
ynh_print_ON
|
||||||
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -176,4 +187,12 @@ fi
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
systemctl reload nginx
|
systemctl reload nginx
|
||||||
systemctl start $app
|
systemctl start $app
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# WARNING FOR READ ACCESS
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
if [[ ! $create_dir = 1 ]] ; then
|
||||||
|
ynh_print_warn "Please, give required access to $app user to the $calibre_dir folder."
|
||||||
|
fi
|
|
@ -38,7 +38,7 @@ ynh_remove_systemd_config
|
||||||
if yunohost service status | grep -q $app
|
if yunohost service status | grep -q $app
|
||||||
then
|
then
|
||||||
echo "Remove $app service"
|
echo "Remove $app service"
|
||||||
yunohost service remove $app
|
yunohost service remove $app.service
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -46,7 +46,7 @@ fi
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
# Remove metapackage and its dependencies
|
# Remove metapackage and its dependencies
|
||||||
#ynh_remove_app_dependencies
|
ynh_remove_app_dependencies
|
||||||
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -83,14 +83,9 @@ fi
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC REMOVE
|
# SPECIFIC REMOVE
|
||||||
#=================================================
|
#=================================================
|
||||||
# REMOVE THE CRON FILE
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
# Remove a directory securely
|
|
||||||
#ynh_secure_remove "/etc/$app/"
|
|
||||||
|
|
||||||
# Remove the log files
|
# Remove the log files
|
||||||
#ynh_secure_remove "/var/log/$app/"
|
ynh_secure_remove "/var/log/$app/"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC FINALIZATION
|
# GENERIC FINALIZATION
|
||||||
|
|
Loading…
Add table
Reference in a new issue