mirror of
https://github.com/YunoHost-Apps/couchpotato_ynh.git
synced 2024-09-03 18:16:22 +02:00
[fix] Installation and update the whole app !
Major upgrade
This commit is contained in:
commit
2a1494da6a
13 changed files with 674 additions and 619 deletions
12
README.md
12
README.md
|
@ -4,20 +4,19 @@
|
||||||
[](https://github.com/Snipees/couchpotato_ynh/milestones)
|
[](https://github.com/Snipees/couchpotato_ynh/milestones)
|
||||||
[](https://github.com/Snipees/couchpotato_ynh#dependencies)
|
[](https://github.com/Snipees/couchpotato_ynh#dependencies)
|
||||||
[](https://raw.githubusercontent.com/Snipees/couchpotato_ynh/master/LICENSE)
|
[](https://raw.githubusercontent.com/Snipees/couchpotato_ynh/master/LICENSE)
|
||||||
[](https://github.com/YunoHost/yunohost)
|
[](https://github.com/YunoHost/yunohost)
|
||||||
[](https://github.com/Snipees/couchpotato_ynh/issues)
|
[](https://github.com/YunoHost-Apps/couchpotato_ynh/issues)
|
||||||
|
|
||||||
[ **CouchPotato Integration for Yunohost** ]
|
[ **CouchPotato Integration for Yunohost** ]
|
||||||
This install script uses a Git-fork as sources for a local installation.
|
Download movies automatically, easily and in the best quality as soon as they are available.
|
||||||
Otherwise the script sets a reverse-proxy to a remote instance.
|
|
||||||
|
|
||||||
|
- Integrates automatically with [transmission_ynh](https://github.com/YunoHost-Apps/transmission_ynh) (or tries to...),
|
||||||
|
- Integrates [YunoHost multimedia](https://github.com/YunoHost-Apps/yunohost.multimedia) folder structure
|
||||||
|
|
||||||
### How to install:
|
### How to install:
|
||||||
- Use **Install software** option from Yunohost admin panel
|
- Use **Install software** option from Yunohost admin panel
|
||||||
- Find textbox tagged as **Install custom App from github**
|
- Find textbox tagged as **Install custom App from github**
|
||||||
- Copy and paste: https://github.com/YunoHost-Apps/couchpotato_ynh
|
- Copy and paste: https://github.com/YunoHost-Apps/couchpotato_ynh
|
||||||
- Choose the method installation: *local* or *remote* (as described above)
|
|
||||||
- Answer the required questions to the selected method
|
|
||||||
|
|
||||||
|
|
||||||
### More information about:
|
### More information about:
|
||||||
|
@ -26,6 +25,7 @@ Otherwise the script sets a reverse-proxy to a remote instance.
|
||||||
|
|
||||||
|
|
||||||
#### Special Thanks to the Yunohost Community:
|
#### Special Thanks to the Yunohost Community:
|
||||||
|
[Snipees](https://github.com/Snipees)
|
||||||
[anaqreon](https://github.com/anaqreon),
|
[anaqreon](https://github.com/anaqreon),
|
||||||
[aymhce](https://github.com/aymhce),
|
[aymhce](https://github.com/aymhce),
|
||||||
[beudbeud](https://github.com/abeudin),
|
[beudbeud](https://github.com/abeudin),
|
||||||
|
|
22
check_process
Normal file
22
check_process
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
;; Test CouchPotato
|
||||||
|
auto_remove=1
|
||||||
|
; Manifest
|
||||||
|
domain="domain.tld" (DOMAIN)
|
||||||
|
path="/couchpotato" (PATH)"
|
||||||
|
; Checks
|
||||||
|
pkg_linter=1
|
||||||
|
setup_sub_dir=1
|
||||||
|
setup_root=1
|
||||||
|
setup_nourl=0
|
||||||
|
setup_private=0
|
||||||
|
setup_public=0
|
||||||
|
upgrade=1
|
||||||
|
backup_restore=1
|
||||||
|
multi_instance=0
|
||||||
|
wrong_user=0
|
||||||
|
wrong_path=1
|
||||||
|
incorrect_path=1
|
||||||
|
corrupt_source=0
|
||||||
|
fail_download_source=0
|
||||||
|
port_already_use=1 (5050)
|
||||||
|
final_path_already_use=0
|
|
@ -1,18 +1,28 @@
|
||||||
[core]
|
[core]
|
||||||
api_key =
|
api_key =
|
||||||
username =
|
username =
|
||||||
ssl_key =
|
ssl_key =
|
||||||
ssl_cert =
|
ssl_cert =
|
||||||
data_dir = DATADIRTOCHANGE
|
data_dir = __DATADIR__
|
||||||
permission_folder = 0755
|
permission_folder = 0755
|
||||||
development = 0
|
development = 0
|
||||||
url_base = PATHTOCHANGE
|
url_base = __PATH__
|
||||||
debug = 0
|
debug = 0
|
||||||
launch_browser = False
|
launch_browser = False
|
||||||
password =
|
password =
|
||||||
port = PORTTOCHANGE
|
port = __PORT__
|
||||||
permission_file = 0755
|
permission_file = 0755
|
||||||
show_wizard = 1
|
show_wizard = 0
|
||||||
|
username_internal_meta = rw
|
||||||
|
proxy_server =
|
||||||
|
use_proxy = 0
|
||||||
|
proxy_password =
|
||||||
|
bookmarklet_host =
|
||||||
|
dereferer = http://www.nullrefer.com/?
|
||||||
|
dark_theme = False
|
||||||
|
api_key_internal_meta = ro
|
||||||
|
proxy_username =
|
||||||
|
ipv6 = 0
|
||||||
|
|
||||||
[download_providers]
|
[download_providers]
|
||||||
|
|
||||||
|
@ -26,38 +36,44 @@ automatic = False
|
||||||
rating = 7.0
|
rating = 7.0
|
||||||
votes = 1000
|
votes = 1000
|
||||||
hour = 12
|
hour = 12
|
||||||
required_genres =
|
required_genres =
|
||||||
year = 2011
|
year = 2011
|
||||||
ignored_genres =
|
ignored_genres =
|
||||||
|
|
||||||
[manage]
|
[manage]
|
||||||
startup_scan = True
|
startup_scan = True
|
||||||
library_refresh_interval = 0
|
library_refresh_interval = 0
|
||||||
cleanup = True
|
cleanup = True
|
||||||
enabled = False
|
enabled = False
|
||||||
library =
|
library =
|
||||||
|
|
||||||
[renamer]
|
[renamer]
|
||||||
nfo_name = <filename>.orig.<ext>
|
nfo_name = <filename>.orig.<ext>
|
||||||
from =
|
from = /home/yunohost.transmission/completed
|
||||||
force_every = 2
|
force_every = 2
|
||||||
move_leftover = False
|
move_leftover = False
|
||||||
to =
|
to = /home/yunohost.multimedia/share/Video/Movies
|
||||||
file_name = <thename><cd>.<ext>
|
file_name = <thename><cd>.<ext>
|
||||||
enabled = False
|
enabled = __RENAMER__
|
||||||
next_on_failed = True
|
next_on_failed = True
|
||||||
unrar = False
|
unrar = False
|
||||||
rename_nfo = True
|
rename_nfo = True
|
||||||
cleanup = False
|
cleanup = 1
|
||||||
separator =
|
separator =
|
||||||
folder_name = <namethe> (<year>)
|
folder_name = <namethe> (<year>)
|
||||||
run_every = 1
|
run_every = 1
|
||||||
foldersep =
|
foldersep =
|
||||||
file_action = link
|
file_action = link
|
||||||
ntfs_permission = False
|
ntfs_permission = False
|
||||||
|
default_file_action = move
|
||||||
|
check_space = True
|
||||||
|
unrar_modify_date = False
|
||||||
|
replace_doubles = True
|
||||||
|
unrar_path =
|
||||||
|
remove_lower_quality_copies = True
|
||||||
|
|
||||||
[subtitle]
|
[subtitle]
|
||||||
languages =
|
languages =
|
||||||
force = False
|
force = False
|
||||||
enabled = False
|
enabled = False
|
||||||
|
|
||||||
|
@ -67,25 +83,26 @@ enabled = False
|
||||||
name = <filename>-trailer
|
name = <filename>-trailer
|
||||||
|
|
||||||
[blackhole]
|
[blackhole]
|
||||||
directory =
|
directory = __WATCHDIR__
|
||||||
manual = 0
|
manual = 0
|
||||||
enabled = 0
|
enabled = __BLACKHOLE__
|
||||||
create_subdir = 0
|
create_subdir = 0
|
||||||
use_for = both
|
use_for = torrent
|
||||||
|
magnet_file = 0
|
||||||
|
|
||||||
[deluge]
|
[deluge]
|
||||||
username =
|
username =
|
||||||
delete_failed = True
|
delete_failed = True
|
||||||
completed_directory =
|
completed_directory =
|
||||||
manual = 0
|
manual = 0
|
||||||
enabled = 0
|
enabled = 0
|
||||||
label =
|
label =
|
||||||
paused = False
|
paused = False
|
||||||
host = localhost:58846
|
host = localhost:58846
|
||||||
delete_files = True
|
delete_files = True
|
||||||
directory =
|
directory =
|
||||||
remove_complete = True
|
remove_complete = True
|
||||||
password =
|
password =
|
||||||
|
|
||||||
[nzbget]
|
[nzbget]
|
||||||
username = nzbget
|
username = nzbget
|
||||||
|
@ -96,7 +113,7 @@ enabled = 0
|
||||||
priority = 0
|
priority = 0
|
||||||
ssl = 0
|
ssl = 0
|
||||||
host = localhost:6789
|
host = localhost:6789
|
||||||
password =
|
password =
|
||||||
|
|
||||||
[nzbvortex]
|
[nzbvortex]
|
||||||
delete_failed = True
|
delete_failed = True
|
||||||
|
@ -104,39 +121,44 @@ manual = False
|
||||||
enabled = 0
|
enabled = 0
|
||||||
ssl = 1
|
ssl = 1
|
||||||
host = localhost:4321
|
host = localhost:4321
|
||||||
api_key =
|
api_key =
|
||||||
|
group =
|
||||||
|
|
||||||
[pneumatic]
|
[pneumatic]
|
||||||
directory =
|
directory =
|
||||||
manual = 0
|
manual = 0
|
||||||
enabled = 0
|
enabled = 0
|
||||||
|
|
||||||
[qbittorrent]
|
[qbittorrent]
|
||||||
username =
|
username =
|
||||||
manual = 0
|
manual = 0
|
||||||
enabled = 0
|
enabled = 0
|
||||||
paused = False
|
paused = False
|
||||||
host = http://localhost:8080/
|
host = http://localhost:8080/
|
||||||
delete_files = True
|
delete_files = True
|
||||||
remove_complete = False
|
remove_complete = False
|
||||||
password =
|
password =
|
||||||
|
label = couchpotato
|
||||||
|
|
||||||
[rtorrent]
|
[rtorrent]
|
||||||
username =
|
username =
|
||||||
rpc_url = RPC2
|
rpc_url = RPC2
|
||||||
manual = 0
|
manual = 0
|
||||||
enabled = 0
|
enabled = 0
|
||||||
label =
|
label =
|
||||||
paused = False
|
paused = False
|
||||||
ssl = 0
|
ssl = 0
|
||||||
host = localhost:80
|
host = localhost:80
|
||||||
delete_files = True
|
delete_files = True
|
||||||
directory =
|
directory =
|
||||||
remove_complete = False
|
remove_complete = False
|
||||||
password =
|
password =
|
||||||
|
authentication = basic
|
||||||
|
ssl_verify = 1
|
||||||
|
ssl_ca_bundle =
|
||||||
|
|
||||||
[sabnzbd]
|
[sabnzbd]
|
||||||
category =
|
category =
|
||||||
delete_failed = True
|
delete_failed = True
|
||||||
manual = False
|
manual = False
|
||||||
enabled = 0
|
enabled = 0
|
||||||
|
@ -144,103 +166,106 @@ priority = 0
|
||||||
ssl = 0
|
ssl = 0
|
||||||
host = localhost:8080
|
host = localhost:8080
|
||||||
remove_complete = False
|
remove_complete = False
|
||||||
api_key =
|
api_key =
|
||||||
|
|
||||||
[synology]
|
[synology]
|
||||||
username =
|
username =
|
||||||
manual = 0
|
manual = 0
|
||||||
destination =
|
destination =
|
||||||
enabled = 0
|
enabled = 0
|
||||||
host = localhost:5000
|
host = localhost:5000
|
||||||
password =
|
password =
|
||||||
use_for = both
|
use_for = both
|
||||||
|
|
||||||
[transmission]
|
[transmission]
|
||||||
username =
|
username = transmission
|
||||||
stalled_as_failed = True
|
stalled_as_failed = True
|
||||||
delete_failed = True
|
delete_failed = True
|
||||||
rpc_url = transmission
|
rpc_url = __RPCURL__
|
||||||
manual = 0
|
manual = 0
|
||||||
enabled = 0
|
enabled = __RPC__
|
||||||
paused = False
|
paused = False
|
||||||
host = localhost:9091
|
host = 127.0.0.1:9091
|
||||||
delete_files = True
|
delete_files = True
|
||||||
directory =
|
directory =
|
||||||
remove_complete = True
|
remove_complete = True
|
||||||
password =
|
password = __RPCPASSWORD__
|
||||||
|
|
||||||
[utorrent]
|
[utorrent]
|
||||||
username =
|
username =
|
||||||
delete_failed = True
|
delete_failed = True
|
||||||
manual = 0
|
manual = 0
|
||||||
enabled = 0
|
enabled = 0
|
||||||
label =
|
label =
|
||||||
paused = False
|
paused = False
|
||||||
host = localhost:8000
|
host = localhost:8000
|
||||||
delete_files = True
|
delete_files = True
|
||||||
remove_complete = True
|
remove_complete = True
|
||||||
password =
|
password =
|
||||||
|
|
||||||
[notification_providers]
|
[notification_providers]
|
||||||
|
|
||||||
[boxcar2]
|
[boxcar2]
|
||||||
token =
|
token =
|
||||||
enabled = 0
|
enabled = 0
|
||||||
on_snatch = 0
|
on_snatch = 0
|
||||||
|
|
||||||
[email]
|
[email]
|
||||||
starttls = 0
|
starttls = 0
|
||||||
smtp_pass =
|
smtp_pass =
|
||||||
on_snatch = 0
|
on_snatch = 0
|
||||||
from =
|
from =
|
||||||
to =
|
to =
|
||||||
smtp_port = 25
|
smtp_port = 25
|
||||||
enabled = 0
|
enabled = 0
|
||||||
smtp_server =
|
smtp_server =
|
||||||
smtp_user =
|
smtp_user =
|
||||||
ssl = 0
|
ssl = 0
|
||||||
|
|
||||||
[growl]
|
[growl]
|
||||||
password =
|
password =
|
||||||
on_snatch = False
|
on_snatch = False
|
||||||
hostname =
|
hostname =
|
||||||
enabled = 0
|
enabled = 0
|
||||||
port =
|
port =
|
||||||
|
|
||||||
[nmj]
|
[nmj]
|
||||||
host = localhost
|
host = localhost
|
||||||
enabled = 0
|
enabled = 0
|
||||||
mount =
|
mount =
|
||||||
database =
|
database =
|
||||||
|
|
||||||
[notifymyandroid]
|
[notifymyandroid]
|
||||||
priority = 0
|
priority = 0
|
||||||
dev_key =
|
dev_key =
|
||||||
api_key =
|
api_key =
|
||||||
enabled = 0
|
enabled = 0
|
||||||
on_snatch = 0
|
on_snatch = 0
|
||||||
|
|
||||||
[notifymywp]
|
[notifymywp]
|
||||||
priority = 0
|
priority = 0
|
||||||
dev_key =
|
dev_key =
|
||||||
api_key =
|
api_key =
|
||||||
enabled = 0
|
enabled = 0
|
||||||
on_snatch = 0
|
on_snatch = 0
|
||||||
|
|
||||||
[plex]
|
[plex]
|
||||||
on_snatch = 0
|
on_snatch = 0
|
||||||
clients =
|
clients =
|
||||||
enabled = 0
|
enabled = 0
|
||||||
media_server = localhost
|
media_server = localhost
|
||||||
|
username =
|
||||||
|
auth_token =
|
||||||
|
password =
|
||||||
|
|
||||||
[prowl]
|
[prowl]
|
||||||
priority = 0
|
priority = 0
|
||||||
on_snatch = 0
|
on_snatch = 0
|
||||||
api_key =
|
api_key =
|
||||||
enabled = 0
|
enabled = 0
|
||||||
|
|
||||||
[pushalot]
|
[pushalot]
|
||||||
auth_token =
|
auth_token =
|
||||||
important = 0
|
important = 0
|
||||||
enabled = 0
|
enabled = 0
|
||||||
silent = 0
|
silent = 0
|
||||||
|
@ -248,14 +273,15 @@ on_snatch = 0
|
||||||
|
|
||||||
[pushbullet]
|
[pushbullet]
|
||||||
on_snatch = 0
|
on_snatch = 0
|
||||||
api_key =
|
api_key =
|
||||||
enabled = 0
|
enabled = 0
|
||||||
devices =
|
devices =
|
||||||
|
channels =
|
||||||
|
|
||||||
[pushover]
|
[pushover]
|
||||||
sound =
|
sound =
|
||||||
on_snatch = 0
|
on_snatch = 0
|
||||||
user_key =
|
user_key =
|
||||||
enabled = 0
|
enabled = 0
|
||||||
priority = 0
|
priority = 0
|
||||||
api_token = YkxHMYDZp285L265L3IwH3LmzkTaCy
|
api_token = YkxHMYDZp285L265L3IwH3LmzkTaCy
|
||||||
|
@ -265,24 +291,26 @@ enabled = 0
|
||||||
|
|
||||||
[toasty]
|
[toasty]
|
||||||
on_snatch = 0
|
on_snatch = 0
|
||||||
api_key =
|
api_key =
|
||||||
enabled = 0
|
enabled = 0
|
||||||
|
|
||||||
[trakt]
|
[trakt]
|
||||||
remove_watchlist_enabled = False
|
remove_watchlist_enabled = False
|
||||||
notification_enabled = False
|
notification_enabled = False
|
||||||
automation_password =
|
automation_password =
|
||||||
automation_enabled = False
|
automation_enabled = False
|
||||||
automation_username =
|
automation_username =
|
||||||
automation_api_key =
|
automation_api_key =
|
||||||
|
automation_oauth_refresh =
|
||||||
|
automation_oauth_token =
|
||||||
|
|
||||||
[twitter]
|
[twitter]
|
||||||
on_snatch = 0
|
on_snatch = 0
|
||||||
screen_name =
|
screen_name =
|
||||||
enabled = 0
|
enabled = 0
|
||||||
access_token_key =
|
access_token_key =
|
||||||
mention =
|
mention =
|
||||||
access_token_secret =
|
access_token_secret =
|
||||||
direct_message = 0
|
direct_message = 0
|
||||||
|
|
||||||
[xbmc]
|
[xbmc]
|
||||||
|
@ -293,7 +321,7 @@ only_first = 0
|
||||||
enabled = 0
|
enabled = 0
|
||||||
remote_dir_scan = 0
|
remote_dir_scan = 0
|
||||||
host = localhost:8080
|
host = localhost:8080
|
||||||
password =
|
password =
|
||||||
meta_disc_art_name = disc.png
|
meta_disc_art_name = disc.png
|
||||||
meta_extra_thumbs_name = extrathumbs/thumb<i>.jpg
|
meta_extra_thumbs_name = extrathumbs/thumb<i>.jpg
|
||||||
meta_thumbnail = True
|
meta_thumbnail = True
|
||||||
|
@ -318,18 +346,18 @@ meta_extra_thumbs = False
|
||||||
meta_disc_art = False
|
meta_disc_art = False
|
||||||
|
|
||||||
[xmpp]
|
[xmpp]
|
||||||
username =
|
username =
|
||||||
on_snatch = 0
|
on_snatch = 0
|
||||||
hostname = talk.google.com
|
hostname = talk.google.com
|
||||||
enabled = 0
|
enabled = 0
|
||||||
to =
|
to =
|
||||||
password =
|
password =
|
||||||
port = 5222
|
port = 5222
|
||||||
|
|
||||||
[nzb_providers]
|
[nzb_providers]
|
||||||
|
|
||||||
[binsearch]
|
[binsearch]
|
||||||
enabled =
|
enabled =
|
||||||
extra_score = 0
|
extra_score = 0
|
||||||
|
|
||||||
[newznab]
|
[newznab]
|
||||||
|
@ -341,7 +369,7 @@ custom_tag = ,,,,,
|
||||||
api_key = ,,,,,
|
api_key = ,,,,,
|
||||||
|
|
||||||
[nzbclub]
|
[nzbclub]
|
||||||
enabled =
|
enabled =
|
||||||
extra_score = 0
|
extra_score = 0
|
||||||
|
|
||||||
[nzbindex]
|
[nzbindex]
|
||||||
|
@ -349,10 +377,11 @@ enabled = True
|
||||||
extra_score = 0
|
extra_score = 0
|
||||||
|
|
||||||
[omgwtfnzbs]
|
[omgwtfnzbs]
|
||||||
username =
|
username =
|
||||||
api_key =
|
api_key =
|
||||||
enabled =
|
enabled =
|
||||||
extra_score = 20
|
extra_score = 20
|
||||||
|
custom_tag =
|
||||||
|
|
||||||
[torrent_providers]
|
[torrent_providers]
|
||||||
|
|
||||||
|
@ -360,55 +389,56 @@ extra_score = 20
|
||||||
seed_time = 40
|
seed_time = 40
|
||||||
extra_score = 20
|
extra_score = 20
|
||||||
only_internal = 1
|
only_internal = 1
|
||||||
passkey =
|
passkey =
|
||||||
enabled = False
|
enabled = False
|
||||||
favor = both
|
favor = both
|
||||||
prefer_internal = 1
|
prefer_internal = 1
|
||||||
seed_ratio = 1
|
seed_ratio = 1
|
||||||
|
|
||||||
[bithdtv]
|
[bithdtv]
|
||||||
username =
|
username =
|
||||||
seed_time = 40
|
seed_time = 40
|
||||||
extra_score = 20
|
extra_score = 20
|
||||||
enabled = False
|
enabled = False
|
||||||
password =
|
password =
|
||||||
seed_ratio = 1
|
seed_ratio = 1
|
||||||
|
|
||||||
[bitsoup]
|
[bitsoup]
|
||||||
username =
|
username =
|
||||||
seed_time = 40
|
seed_time = 40
|
||||||
extra_score = 20
|
extra_score = 20
|
||||||
enabled = False
|
enabled = False
|
||||||
password =
|
password =
|
||||||
seed_ratio = 1
|
seed_ratio = 1
|
||||||
|
|
||||||
[hdbits]
|
[hdbits]
|
||||||
username =
|
username =
|
||||||
seed_time = 40
|
seed_time = 40
|
||||||
extra_score = 0
|
extra_score = 0
|
||||||
passkey =
|
passkey =
|
||||||
enabled = False
|
enabled = False
|
||||||
seed_ratio = 1
|
seed_ratio = 1
|
||||||
|
internal_only = False
|
||||||
|
|
||||||
[ilovetorrents]
|
[ilovetorrents]
|
||||||
username =
|
username =
|
||||||
seed_time = 40
|
seed_time = 40
|
||||||
extra_score = 0
|
extra_score = 0
|
||||||
enabled = False
|
enabled = False
|
||||||
password =
|
password =
|
||||||
seed_ratio = 1
|
seed_ratio = 1
|
||||||
|
|
||||||
[iptorrents]
|
[iptorrents]
|
||||||
username =
|
username =
|
||||||
freeleech = 0
|
freeleech = 0
|
||||||
extra_score = 0
|
extra_score = 0
|
||||||
enabled = False
|
enabled = False
|
||||||
seed_time = 40
|
seed_time = 40
|
||||||
password =
|
password =
|
||||||
seed_ratio = 1
|
seed_ratio = 1
|
||||||
|
|
||||||
[kickasstorrents]
|
[kickasstorrents]
|
||||||
domain =
|
domain =
|
||||||
seed_time = 40
|
seed_time = 40
|
||||||
extra_score = 0
|
extra_score = 0
|
||||||
enabled = True
|
enabled = True
|
||||||
|
@ -416,74 +446,77 @@ only_verified = False
|
||||||
seed_ratio = 1
|
seed_ratio = 1
|
||||||
|
|
||||||
[passthepopcorn]
|
[passthepopcorn]
|
||||||
username =
|
username =
|
||||||
domain =
|
domain =
|
||||||
seed_time = 40
|
seed_time = 40
|
||||||
extra_score = 20
|
extra_score = 20
|
||||||
passkey =
|
passkey =
|
||||||
prefer_scene = 0
|
prefer_scene = 0
|
||||||
enabled = False
|
enabled = False
|
||||||
prefer_golden = 1
|
prefer_golden = 1
|
||||||
require_approval = 0
|
require_approval = 0
|
||||||
password =
|
password =
|
||||||
seed_ratio = 1
|
seed_ratio = 1
|
||||||
|
prefer_freeleech = 1
|
||||||
|
|
||||||
[sceneaccess]
|
[sceneaccess]
|
||||||
username =
|
username =
|
||||||
seed_time = 40
|
seed_time = 40
|
||||||
extra_score = 20
|
extra_score = 20
|
||||||
enabled = False
|
enabled = False
|
||||||
password =
|
password =
|
||||||
seed_ratio = 1
|
seed_ratio = 1
|
||||||
|
|
||||||
[thepiratebay]
|
[thepiratebay]
|
||||||
seed_time = 40
|
seed_time = 40
|
||||||
domain =
|
domain =
|
||||||
enabled = False
|
enabled = False
|
||||||
seed_ratio = 1
|
seed_ratio = 1
|
||||||
extra_score = 0
|
extra_score = 0
|
||||||
|
trusted_only = False
|
||||||
|
|
||||||
[torrentbytes]
|
[torrentbytes]
|
||||||
username =
|
username =
|
||||||
seed_time = 40
|
seed_time = 40
|
||||||
extra_score = 20
|
extra_score = 20
|
||||||
enabled = False
|
enabled = False
|
||||||
password =
|
password =
|
||||||
seed_ratio = 1
|
seed_ratio = 1
|
||||||
|
|
||||||
[torrentday]
|
[torrentday]
|
||||||
username =
|
username =
|
||||||
seed_time = 40
|
seed_time = 40
|
||||||
extra_score = 0
|
extra_score = 0
|
||||||
enabled = False
|
enabled = False
|
||||||
password =
|
password =
|
||||||
seed_ratio = 1
|
seed_ratio = 1
|
||||||
|
cookiesetting =
|
||||||
|
|
||||||
[torrentleech]
|
[torrentleech]
|
||||||
username =
|
username =
|
||||||
seed_time = 40
|
seed_time = 40
|
||||||
extra_score = 20
|
extra_score = 20
|
||||||
enabled = False
|
enabled = False
|
||||||
password =
|
password =
|
||||||
seed_ratio = 1
|
seed_ratio = 1
|
||||||
|
|
||||||
[torrentpotato]
|
[torrentpotato]
|
||||||
use =
|
use =
|
||||||
seed_time = 40
|
seed_time = 40
|
||||||
name =
|
name =
|
||||||
extra_score = 0
|
extra_score = 0
|
||||||
enabled = False
|
enabled = False
|
||||||
host =
|
host =
|
||||||
pass_key = ,
|
pass_key = ,
|
||||||
seed_ratio = 1
|
seed_ratio = 1
|
||||||
|
|
||||||
[torrentshack]
|
[torrentshack]
|
||||||
username =
|
username =
|
||||||
seed_time = 40
|
seed_time = 40
|
||||||
extra_score = 0
|
extra_score = 0
|
||||||
enabled = False
|
enabled = False
|
||||||
scene_only = False
|
scene_only = False
|
||||||
password =
|
password =
|
||||||
seed_ratio = 1
|
seed_ratio = 1
|
||||||
|
|
||||||
[torrentz]
|
[torrentz]
|
||||||
|
@ -496,16 +529,16 @@ seed_ratio = 1
|
||||||
|
|
||||||
[yify]
|
[yify]
|
||||||
seed_time = 40
|
seed_time = 40
|
||||||
domain =
|
domain =
|
||||||
enabled = False
|
enabled = False
|
||||||
seed_ratio = 1
|
seed_ratio = 1
|
||||||
extra_score = 0
|
extra_score = 0
|
||||||
|
|
||||||
[searcher]
|
[searcher]
|
||||||
preferred_method = both
|
preferred_method = both
|
||||||
required_words =
|
required_words =
|
||||||
ignored_words = german, dutch, french, truefrench, danish, swedish, spanish, italian, korean, dubbed, swesub, korsub, dksubs, vain
|
ignored_words = german, dutch, french, truefrench, danish, swedish, spanish, italian, korean, dubbed, swesub, korsub, dksubs, vain
|
||||||
preferred_words =
|
preferred_words =
|
||||||
|
|
||||||
[nzb]
|
[nzb]
|
||||||
retention = 1500
|
retention = 1500
|
||||||
|
@ -524,13 +557,13 @@ chart_display_enabled = True
|
||||||
backlog = False
|
backlog = False
|
||||||
|
|
||||||
[flixster]
|
[flixster]
|
||||||
automation_ids_use =
|
automation_ids_use =
|
||||||
automation_enabled = False
|
automation_enabled = False
|
||||||
automation_ids =
|
automation_ids =
|
||||||
|
|
||||||
[goodfilms]
|
[goodfilms]
|
||||||
automation_enabled = False
|
automation_enabled = False
|
||||||
automation_username =
|
automation_username =
|
||||||
|
|
||||||
[imdb]
|
[imdb]
|
||||||
automation_charts_top250 = False
|
automation_charts_top250 = False
|
||||||
|
@ -538,8 +571,8 @@ chart_display_boxoffice = True
|
||||||
chart_display_top250 = False
|
chart_display_top250 = False
|
||||||
automation_enabled = False
|
automation_enabled = False
|
||||||
chart_display_rentals = True
|
chart_display_rentals = True
|
||||||
automation_urls_use =
|
automation_urls_use =
|
||||||
automation_urls =
|
automation_urls =
|
||||||
automation_providers_enabled = False
|
automation_providers_enabled = False
|
||||||
automation_charts_rentals = True
|
automation_charts_rentals = True
|
||||||
chart_display_theater = False
|
chart_display_theater = False
|
||||||
|
@ -557,16 +590,16 @@ automation_enabled = False
|
||||||
|
|
||||||
[letterboxd]
|
[letterboxd]
|
||||||
automation_enabled = False
|
automation_enabled = False
|
||||||
automation_urls_use =
|
automation_urls_use =
|
||||||
automation_urls =
|
automation_urls =
|
||||||
|
|
||||||
[moviemeter]
|
[moviemeter]
|
||||||
automation_enabled = False
|
automation_enabled = False
|
||||||
|
|
||||||
[moviesio]
|
[moviesio]
|
||||||
automation_enabled = False
|
automation_enabled = False
|
||||||
automation_urls_use =
|
automation_urls_use =
|
||||||
automation_urls =
|
automation_urls =
|
||||||
|
|
||||||
[popularmovies]
|
[popularmovies]
|
||||||
automation_enabled = False
|
automation_enabled = False
|
||||||
|
@ -578,7 +611,7 @@ automation_urls_use = 1
|
||||||
automation_urls = http://www.rottentomatoes.com/syndication/rss/in_theaters.xml
|
automation_urls = http://www.rottentomatoes.com/syndication/rss/in_theaters.xml
|
||||||
|
|
||||||
[themoviedb]
|
[themoviedb]
|
||||||
api_key = 9b939aee0aaafc12a65bf448e4af9543
|
api_key =
|
||||||
|
|
||||||
[mediabrowser]
|
[mediabrowser]
|
||||||
meta_enabled = False
|
meta_enabled = False
|
||||||
|
@ -595,4 +628,139 @@ cron_hour = 12
|
||||||
cron_minute = 42
|
cron_minute = 42
|
||||||
always_search = False
|
always_search = False
|
||||||
run_on_launch = 0
|
run_on_launch = 0
|
||||||
search_on_add = 1
|
search_on_add = 1
|
||||||
|
|
||||||
|
[hadouken]
|
||||||
|
auth_type = api_key
|
||||||
|
auth_pass =
|
||||||
|
enabled = 0
|
||||||
|
label =
|
||||||
|
host = localhost:7890
|
||||||
|
version = v4
|
||||||
|
auth_user =
|
||||||
|
api_key =
|
||||||
|
|
||||||
|
[putio]
|
||||||
|
delete_file = 0
|
||||||
|
callback_host =
|
||||||
|
download_dir =
|
||||||
|
manual = 0
|
||||||
|
enabled = 0
|
||||||
|
oauth_token =
|
||||||
|
download = 0
|
||||||
|
folder = 0
|
||||||
|
|
||||||
|
[androidpn]
|
||||||
|
broadcast = 1
|
||||||
|
username =
|
||||||
|
on_snatch = 0
|
||||||
|
enabled = 0
|
||||||
|
url =
|
||||||
|
|
||||||
|
[emby]
|
||||||
|
host = localhost:8096
|
||||||
|
apikey =
|
||||||
|
enabled = 0
|
||||||
|
|
||||||
|
[homey]
|
||||||
|
url =
|
||||||
|
enabled = 0
|
||||||
|
|
||||||
|
[slack]
|
||||||
|
on_snatch = 0
|
||||||
|
as_user = False
|
||||||
|
enabled = 0
|
||||||
|
bot_name = CouchPotato
|
||||||
|
channels =
|
||||||
|
token =
|
||||||
|
icon_emoji =
|
||||||
|
icon_url =
|
||||||
|
include_imdb = True
|
||||||
|
|
||||||
|
[telegrambot]
|
||||||
|
bot_token =
|
||||||
|
on_snatch = 0
|
||||||
|
enabled = 0
|
||||||
|
receiver_user_id =
|
||||||
|
|
||||||
|
[webhook]
|
||||||
|
url =
|
||||||
|
on_snatch = 0
|
||||||
|
enabled = 0
|
||||||
|
|
||||||
|
[alpharatio]
|
||||||
|
username =
|
||||||
|
seed_time = 40
|
||||||
|
extra_score = 0
|
||||||
|
enabled = False
|
||||||
|
scene_only = False
|
||||||
|
password =
|
||||||
|
seed_ratio = 1
|
||||||
|
|
||||||
|
[hd4free]
|
||||||
|
username =
|
||||||
|
apikey =
|
||||||
|
seed_time = 0
|
||||||
|
extra_score = 0
|
||||||
|
enabled = False
|
||||||
|
internal_only = False
|
||||||
|
prefer_internal = 1
|
||||||
|
seed_ratio = 0
|
||||||
|
|
||||||
|
[magnetdl]
|
||||||
|
seed_time = 40
|
||||||
|
max_pages = 3
|
||||||
|
enabled = False
|
||||||
|
seed_ratio = 1
|
||||||
|
extra_score = 0
|
||||||
|
|
||||||
|
[morethantv]
|
||||||
|
username =
|
||||||
|
seed_time = 40
|
||||||
|
extra_score = 0
|
||||||
|
enabled = False
|
||||||
|
scene_only = False
|
||||||
|
password =
|
||||||
|
seed_ratio = 1
|
||||||
|
|
||||||
|
[rarbg]
|
||||||
|
min_leechers = 0
|
||||||
|
enabled = False
|
||||||
|
ranked_only = 1
|
||||||
|
extra_score = 0
|
||||||
|
min_seeders = 10
|
||||||
|
|
||||||
|
[scenetime]
|
||||||
|
username =
|
||||||
|
seed_time = 40
|
||||||
|
extra_score = 20
|
||||||
|
enabled = False
|
||||||
|
password =
|
||||||
|
seed_ratio = 1
|
||||||
|
|
||||||
|
[torrent]
|
||||||
|
minimum_seeders = 1
|
||||||
|
|
||||||
|
[crowdai]
|
||||||
|
automation_enabled = False
|
||||||
|
number_grabs = 500
|
||||||
|
automation_urls_use = 1
|
||||||
|
automation_urls = http://YOUR_PROVIDER/rss?t=THE_MOVIE_CATEGORY&i=YOUR_USER_ID&r=YOUR_API_KEY&res=2&rls=2&num=100
|
||||||
|
|
||||||
|
[hummingbird]
|
||||||
|
automation_list_dropped = False
|
||||||
|
automation_enabled = False
|
||||||
|
automation_username =
|
||||||
|
automation_list_hold = False
|
||||||
|
automation_list_completed = False
|
||||||
|
automation_list_plan = True
|
||||||
|
automation_list_current = False
|
||||||
|
|
||||||
|
[wdtvlive]
|
||||||
|
meta_thumbnail = True
|
||||||
|
meta_enabled = False
|
||||||
|
meta_nfo = True
|
||||||
|
|
||||||
|
[suggestion]
|
||||||
|
enabled = True
|
||||||
|
|
||||||
|
|
|
@ -1,15 +0,0 @@
|
||||||
# COPY THIS FILE TO /etc/default/couchpotato
|
|
||||||
# OPTIONS: CP_HOME, CP_USER, CP_DATA, CP_PIDFILE, PYTHON_BIN, CP_OPTS, SSD_OPTS, CP_PORT
|
|
||||||
|
|
||||||
## EXAMPLE if want to run as different user
|
|
||||||
## add CP_USER=username to /etc/default/couchpotato
|
|
||||||
## otherwise default couchpotato is used
|
|
||||||
|
|
||||||
CP_USER=USERTOCHANGE #$RUN_AS, username to run couchpotato under, the default is couchpotato
|
|
||||||
CP_HOME=APPDIRTOCHANGE #$APP_PATH, the location of couchpotato.py, the default is /opt/couchpotato
|
|
||||||
CP_DATA=DATADIRTOCHANGE #$DATA_DIR, the location of couchpotato.db, cache, logs, the default is /opt/couchpotato
|
|
||||||
CP_PIDFILE=PIDFILETOCHANGE #$PID_FILE, the location of couchpotato.pid, the default is /var/run/couchpotato/couchpotato.pid
|
|
||||||
PYTHON_BIN=PYTBINTOCHANGE #$DAEMON, the location of the python binary, the default is /usr/bin/python
|
|
||||||
CP_OPTS=" --config_file=OPTSTOCHANGE" #$EXTRA_DAEMON_OPTS, extra cli option for couchpotato, i.e. " --config_file=/home/couchpotato/couchpotato.ini"
|
|
||||||
#SSD_OPTS=SSDTOCHANGE #$EXTRA_SSD_OPTS, extra start-stop-daemon option like " --group=users"
|
|
||||||
#CP_PORT=PORTTOCHANGE #$PORT_OPTS, hardcoded port for the webserver, overrides value in couchpotato.ini
|
|
|
@ -1,135 +0,0 @@
|
||||||
#! /bin/sh
|
|
||||||
|
|
||||||
### BEGIN INIT INFO
|
|
||||||
# Provides: couchpotato
|
|
||||||
# Required-Start: $local_fs $network $remote_fs
|
|
||||||
# Required-Stop: $local_fs $network $remote_fs
|
|
||||||
# Should-Start: $NetworkManager
|
|
||||||
# Should-Stop: $NetworkManager
|
|
||||||
# Default-Start: 2 3 4 5
|
|
||||||
# Default-Stop: 0 1 6
|
|
||||||
# Short-Description: starts instance of CouchPotato
|
|
||||||
# Description: starts instance of CouchPotato using start-stop-daemon
|
|
||||||
### END INIT INFO
|
|
||||||
|
|
||||||
# Check for existance of defaults file
|
|
||||||
# and utilze if available
|
|
||||||
if [ -f /etc/default/couchpotato ]; then
|
|
||||||
. /etc/default/couchpotato
|
|
||||||
else
|
|
||||||
echo "/etc/default/couchpotato not found using default settings.";
|
|
||||||
fi
|
|
||||||
|
|
||||||
. /lib/lsb/init-functions
|
|
||||||
|
|
||||||
# Script name
|
|
||||||
NAME=couchpotato
|
|
||||||
|
|
||||||
# App name
|
|
||||||
DESC=CouchPotato
|
|
||||||
|
|
||||||
## Don't edit this file
|
|
||||||
## Edit user configuation in /etc/default/couchpotato to change
|
|
||||||
##
|
|
||||||
## CP_USER= #$RUN_AS, username to run couchpotato under, the default is couchpotato
|
|
||||||
## CP_HOME= #$APP_PATH, the location of couchpotato.py, the default is /opt/couchpotato
|
|
||||||
## CP_DATA= #$DATA_DIR, the location of couchpotato.db, cache, logs, the default is /var/opt/couchpotato
|
|
||||||
## CP_PIDFILE= #$PID_FILE, the location of couchpotato.pid, the default is /var/run/couchpotato/couchpotato.pid
|
|
||||||
## PYTHON_BIN= #$DAEMON, the location of the python binary, the default is /usr/bin/python
|
|
||||||
## CP_OPTS= #$EXTRA_DAEMON_OPTS, extra cli option for couchpotato, i.e. " --config_file=/home/couchpotato/couchpotato.ini"
|
|
||||||
## SSD_OPTS= #$EXTRA_SSD_OPTS, extra start-stop-daemon option like " --group=users"
|
|
||||||
##
|
|
||||||
## EXAMPLE if want to run as different user
|
|
||||||
## add CP_USER=username to /etc/default/couchpotato
|
|
||||||
## otherwise default couchpotato is used
|
|
||||||
|
|
||||||
# Run CP as username
|
|
||||||
RUN_AS=${CP_USER-couchpotato}
|
|
||||||
|
|
||||||
# Path to app
|
|
||||||
# CP_HOME=path_to_app_CouchPotato.py
|
|
||||||
APP_PATH=${CP_HOME-/opt/couchpotato/}
|
|
||||||
|
|
||||||
# Data directory where couchpotato.db, cache and logs are stored
|
|
||||||
DATA_DIR=${CP_DATA-/var/opt/couchpotato}
|
|
||||||
|
|
||||||
# Path to store PID file
|
|
||||||
PID_FILE=${CP_PIDFILE-/var/run/couchpotato/couchpotato.pid}
|
|
||||||
|
|
||||||
# path to python bin
|
|
||||||
DAEMON=${PYTHON_BIN-/usr/bin/python}
|
|
||||||
|
|
||||||
# Extra daemon option like: CP_OPTS=" --config=/home/couchpotato/couchpotato.ini"
|
|
||||||
EXTRA_DAEMON_OPTS=${CP_OPTS-}
|
|
||||||
|
|
||||||
# Extra start-stop-daemon option like START_OPTS=" --group=users"
|
|
||||||
EXTRA_SSD_OPTS=${SSD_OPTS-}
|
|
||||||
|
|
||||||
|
|
||||||
## Parameter | Description
|
|
||||||
## ————————————— | ————————————————————————————————————
|
|
||||||
## data_dir | Absolute or ~/ path of the data dir
|
|
||||||
## config_file | Absolute or ~/ path of the settings file (default DATA_DIR/settings.conf)
|
|
||||||
## debug | Debug mode
|
|
||||||
## console_log | Log to console
|
|
||||||
## quiet | No console logging
|
|
||||||
## daemon | Daemonize the app
|
|
||||||
## pid_file | Path to pidfile needed for daemon
|
|
||||||
|
|
||||||
|
|
||||||
PID_PATH=`dirname $PID_FILE`
|
|
||||||
DAEMON_OPTS="CouchPotato.py --quiet --daemon --pid_file=${PID_FILE} --data_dir=${DATA_DIR} ${EXTRA_DAEMON_OPTS}"
|
|
||||||
|
|
||||||
|
|
||||||
test -x $DAEMON || exit 0
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
# Create PID directory if not exist and ensure the CouchPotato user can write to it
|
|
||||||
if [ ! -d $PID_PATH ]; then
|
|
||||||
mkdir -p $PID_PATH
|
|
||||||
chown $RUN_AS $PID_PATH
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! -d $DATA_DIR ]; then
|
|
||||||
mkdir -p $DATA_DIR
|
|
||||||
chown $RUN_AS $DATA_DIR
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -e $PID_FILE ]; then
|
|
||||||
PID=`cat $PID_FILE`
|
|
||||||
if ! kill -0 $PID > /dev/null 2>&1; then
|
|
||||||
echo "Removing stale $PID_FILE"
|
|
||||||
rm $PID_FILE
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
case "$1" in
|
|
||||||
start)
|
|
||||||
touch $PID_FILE
|
|
||||||
chown $RUN_AS $PID_FILE
|
|
||||||
echo "Starting $DESC"
|
|
||||||
start-stop-daemon -d $APP_PATH -c $RUN_AS $EXTRA_SSD_OPTS --start --pidfile $PID_FILE --exec $DAEMON -- $DAEMON_OPTS
|
|
||||||
;;
|
|
||||||
stop)
|
|
||||||
echo "Stopping $DESC"
|
|
||||||
start-stop-daemon --stop --pidfile $PID_FILE --retry 15 --oknodo
|
|
||||||
;;
|
|
||||||
|
|
||||||
restart|force-reload)
|
|
||||||
echo "Restarting $DESC"
|
|
||||||
start-stop-daemon --stop --pidfile $PID_FILE --retry 15 --oknodo
|
|
||||||
start-stop-daemon -d $APP_PATH -c $RUN_AS $EXTRA_SSD_OPTS --start --pidfile $PID_FILE --exec $DAEMON -- $DAEMON_OPTS
|
|
||||||
;;
|
|
||||||
|
|
||||||
status)
|
|
||||||
status_of_proc -p $PID_FILE "$DAEMON" "$NAME"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
N=/etc/init.d/$NAME
|
|
||||||
echo "Usage: $N {start|stop|restart|force-reload|status}" >&2
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
exit 0
|
|
|
@ -1,7 +1,7 @@
|
||||||
location PATHTOCHANGE {
|
location __PATH__ {
|
||||||
proxy_http_version 1.1;
|
proxy_http_version 1.1;
|
||||||
proxy_pass_header Server;
|
proxy_pass_header Server;
|
||||||
proxy_pass HOSTTOCHANGE;
|
proxy_pass http://127.0.0.1:__PORT__;
|
||||||
proxy_redirect off;
|
proxy_redirect off;
|
||||||
proxy_set_header Host $http_host;
|
proxy_set_header Host $http_host;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
@ -12,4 +12,4 @@ location PATHTOCHANGE {
|
||||||
# Include SSOWAT user panel.
|
# Include SSOWAT user panel.
|
||||||
include conf.d/yunohost_panel.conf.inc;
|
include conf.d/yunohost_panel.conf.inc;
|
||||||
more_clear_input_headers 'Accept-Encoding';
|
more_clear_input_headers 'Accept-Encoding';
|
||||||
}
|
}
|
||||||
|
|
12
conf/systemd.service
Normal file
12
conf/systemd.service
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
[Unit]
|
||||||
|
Description=CouchPotato application instance
|
||||||
|
After=network.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
ExecStart=__PYTHON__ __APPDIR__/CouchPotato.py --quiet --pid_file=__PIDFILE__ --data_dir=__DATADIR__ --config_file=__CONFIGFILE__
|
||||||
|
Type=simple
|
||||||
|
User=__USER__
|
||||||
|
Group=__USER__
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
|
@ -1,17 +1,25 @@
|
||||||
{
|
{
|
||||||
|
"packaging_format": 1,
|
||||||
"name": "CouchPotato",
|
"name": "CouchPotato",
|
||||||
"id": "couchpotato",
|
"id": "couchpotato",
|
||||||
"description": {
|
"description": {
|
||||||
"en": "Automatic movie downloader",
|
"en": "Automatic movie downloader",
|
||||||
"fr": "Téléchargement automatisé de film"
|
"fr": "Téléchargement automatisé de film"
|
||||||
},
|
},
|
||||||
"license": "GPL-3",
|
"url": "https://couchpota.to/",
|
||||||
|
"license": "free",
|
||||||
"maintainer": {
|
"maintainer": {
|
||||||
"name": "Snipees",
|
"name": "Snipees",
|
||||||
"email": "snipees@wareziens.net",
|
"email": "snipees@wareziens.net",
|
||||||
"url": "https://github.com/Snipees"
|
"url": "https://github.com/Snipees"
|
||||||
},
|
},
|
||||||
"multi_instance": "false",
|
"multi_instance": false,
|
||||||
|
"services": [
|
||||||
|
"nginx"
|
||||||
|
],
|
||||||
|
"requirements": {
|
||||||
|
"yunohost": ">= 2.4.0"
|
||||||
|
},
|
||||||
"arguments": {
|
"arguments": {
|
||||||
"install": [
|
"install": [
|
||||||
{
|
{
|
||||||
|
@ -30,63 +38,7 @@
|
||||||
},
|
},
|
||||||
"example": "/couchpotato",
|
"example": "/couchpotato",
|
||||||
"default": "/couchpotato"
|
"default": "/couchpotato"
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "public",
|
|
||||||
"ask": {
|
|
||||||
"en": "Is it a public application ?",
|
|
||||||
"fr": "Est-ce une application publique ?"
|
|
||||||
},
|
|
||||||
"choices": ["Yes", "No"],
|
|
||||||
"default": "No"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "method",
|
|
||||||
"ask": {
|
|
||||||
"en": "Choose installation method",
|
|
||||||
"fr": "Choisissez le type d'installation"
|
|
||||||
},
|
|
||||||
"choices": ["LOCAL", "REMOTE"],
|
|
||||||
"default": "LOCAL"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "port",
|
|
||||||
"ask": {
|
|
||||||
"en": "LOCAL: Choose the listening port of the app",
|
|
||||||
"fr": "LOCAL: Choisissez le port d'écoute de l'application"
|
|
||||||
},
|
|
||||||
"example": "5050",
|
|
||||||
"default": "5050"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "fork",
|
|
||||||
"ask": {
|
|
||||||
"en": "LOCAL: Source URL of GIT to use",
|
|
||||||
"fr": "LOCAL: URL du GIT source à utiliser"
|
|
||||||
},
|
|
||||||
"example": "https://github.com/Adelscott/CouchPotatoServer",
|
|
||||||
"default": "https://github.com/RuudBurger/CouchPotatoServer"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "host",
|
|
||||||
"ask": {
|
|
||||||
"en": "REMOTE: Specify URL for the host",
|
|
||||||
"fr": "REMOTE: Indiquez l'URL de l'hôte"
|
|
||||||
},
|
|
||||||
"example": "http://192.168.1.100:8888/myapp",
|
|
||||||
"default": "http://"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"remove": [
|
|
||||||
{
|
|
||||||
"name": "data",
|
|
||||||
"ask": {
|
|
||||||
"en": "Would you like to keep data files ?",
|
|
||||||
"fr": "Souhaitez-vous conserver les données ?"
|
|
||||||
},
|
|
||||||
"choices": ["Yes", "No"],
|
|
||||||
"default": "Yes"
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,37 +1,25 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
set -eu
|
||||||
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
|
|
||||||
|
# Source app helpers
|
||||||
|
. /usr/share/yunohost/helpers
|
||||||
|
|
||||||
# Common variable declaration
|
# Common variable declaration
|
||||||
app_id=couchpotato
|
app_install_dir="/opt/yunohost/$app"
|
||||||
app_user=couchpotato
|
app_data_dir="/home/yunohost.app/$app"
|
||||||
app_install_dir="/opt/yunohost/${app_id}"
|
|
||||||
app_data_dir="/home/yunohost.app/${app_id}"
|
|
||||||
|
|
||||||
# Retrieve arguments
|
# Retrieve arguments
|
||||||
app_method="$(sudo yunohost app setting ${app_id} method)"
|
domain=$(ynh_app_setting_get "$app" domain)
|
||||||
app_domain="$(sudo yunohost app setting ${app_id} domain)"
|
|
||||||
|
|
||||||
# The parameter $1 is the backup directory location
|
# Backup sources
|
||||||
# which will be compressed afterward
|
ynh_backup "$app_install_dir" "sources"
|
||||||
app_backup_dir="$1/apps/${app_id}"
|
|
||||||
sudo mkdir -p $app_backup_dir
|
|
||||||
|
|
||||||
|
# Backup data
|
||||||
# Backup files if localhost installation
|
ynh_backup "$app_data_dir" "data"
|
||||||
if [[ $app_method == "LOCAL"* ]]; then
|
|
||||||
|
|
||||||
# Backup sources
|
|
||||||
sudo cp -a $app_install_dir/. $app_backup_dir/sources
|
|
||||||
|
|
||||||
# Backup data
|
|
||||||
sudo cp -a $app_data_dir/. $app_backup_dir/data
|
|
||||||
|
|
||||||
# Backup daemon config
|
# Backup daemon
|
||||||
sudo cp -a /etc/default/$app_id $app_backup_dir/conf/$app_id.default
|
ynh_backup "/etc/systemd/system/$app.service" "$app.service"
|
||||||
sudo cp -a /etc/init.d/$app_id $app_backup_dir/conf/$app_id.init
|
|
||||||
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
# Copy the conf files
|
||||||
# Copy Nginx and YunoHost parameters to make the script "standalone"
|
ynh_backup "/etc/nginx/conf.d/${domain}.d/${app}.conf" "nginx.conf"
|
||||||
sudo cp -a /etc/yunohost/apps/$app_id/. $app_backup_dir/yunohost
|
|
||||||
sudo cp -a /etc/nginx/conf.d/$app_domain.d/$app_id.conf $app_backup_dir/nginx.conf
|
|
||||||
|
|
227
scripts/install
227
scripts/install
|
@ -1,62 +1,54 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
#debug commands
|
set -eu
|
||||||
#exec > >(tee /tmp/debug-install.log)
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
#exec 2>&1
|
source="https://github.com/CouchPotato/CouchPotatoServer"
|
||||||
|
|
||||||
|
|
||||||
|
# Source app helpers
|
||||||
|
. /usr/share/yunohost/helpers
|
||||||
|
|
||||||
# Retrieve arguments
|
# Retrieve arguments
|
||||||
app_domain=$1
|
domain=$YNH_APP_ARG_DOMAIN
|
||||||
app_path=$2
|
path=$YNH_APP_ARG_PATH
|
||||||
app_public=$3
|
|
||||||
app_method=$4
|
|
||||||
app_port=$5
|
|
||||||
app_fork=$6
|
|
||||||
app_host=$7
|
|
||||||
|
|
||||||
# Basic variable declaration
|
|
||||||
BASEDIR="$(dirname "$(pwd)")"
|
|
||||||
|
|
||||||
# Common variable declaration
|
|
||||||
app_id=couchpotato
|
|
||||||
app_user=couchpotato
|
|
||||||
app_local_host="127.0.0.1"
|
|
||||||
app_python_bin="/usr/bin/python"
|
|
||||||
## Destinations definitions
|
|
||||||
app_install_dir="/opt/yunohost/${app_id}"
|
|
||||||
app_data_dir="/home/yunohost.app/${app_id}"
|
|
||||||
app_logs_dir="/var/log/${app_id}"
|
|
||||||
app_config_file="${app_data_dir}/settings.conf"
|
|
||||||
app_pid_file="/var/run/${app_id}/${app_id}.pid"
|
|
||||||
## Sources definitions
|
|
||||||
app_src_conf="$BASEDIR/conf/${app_id}.conf"
|
|
||||||
app_src_dfts="$BASEDIR/conf/${app_id}.defaults"
|
|
||||||
app_src_init="$BASEDIR/conf/${app_id}.init"
|
|
||||||
app_src_nginx_conf="$BASEDIR/conf/nginx.conf"
|
|
||||||
|
|
||||||
|
# Correct path: puts a / at the start and nothing at the end
|
||||||
|
if [ "${path:0:1}" != "/" ]; then
|
||||||
|
path="/$path"
|
||||||
|
fi
|
||||||
|
if [ "${path:${#path}-1}" == "/" ] && [ ${#path} -gt 1 ]; then
|
||||||
|
path="${path:0:${#path}-1}"
|
||||||
|
fi
|
||||||
|
|
||||||
# Check domain/path availability
|
# Check domain/path availability
|
||||||
sudo yunohost app checkurl $app_domain$app_path -a $app_id
|
sudo yunohost app checkurl "${domain}${path}" -a "$app" \
|
||||||
if [[ ! $? -eq 0 ]]; then
|
|| ynh_die "Path not available: ${domain}${path}"
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
# Destinations definitions
|
||||||
|
app_install_dir="/opt/yunohost/$app"
|
||||||
|
app_data_dir="/home/yunohost.app/$app"
|
||||||
|
app_logs_dir="/var/log/$app"
|
||||||
|
app_config_file="${app_data_dir}/settings.conf"
|
||||||
|
app_pid_file="/var/run/$app/$app.pid"
|
||||||
|
app_python_bin="/usr/bin/python"
|
||||||
|
|
||||||
# Make install if localhost installation
|
# Install Couchpotato
|
||||||
if [[ $app_method == "LOCAL"* ]]; then
|
|
||||||
|
|
||||||
# Check port availability
|
# Get first available port
|
||||||
sudo yunohost app checkport $app_port
|
port=5050
|
||||||
if [[ ! $? -eq 0 ]]; then
|
sudo yunohost app checkport $port
|
||||||
exit 1
|
while [[ ! $? -eq 0 ]]; do
|
||||||
fi
|
port=$((port+1))
|
||||||
|
sudo yunohost app checkport $port
|
||||||
|
done
|
||||||
|
ynh_app_setting_set "$app" port "$port"
|
||||||
|
|
||||||
# Make directories
|
# Make directories
|
||||||
sudo mkdir -p $app_data_dir
|
sudo mkdir -p $app_data_dir
|
||||||
sudo mkdir -p $app_install_dir
|
sudo mkdir -p $app_install_dir
|
||||||
|
|
||||||
# Install latest version of app using the fork
|
# Install latest version of app using the fork
|
||||||
sudo apt-get install -y git-core
|
sudo git clone $source $app_install_dir
|
||||||
sudo git clone $app_fork $app_install_dir
|
|
||||||
|
|
||||||
# Install dependencies (using virtualenv)
|
# Install dependencies (using virtualenv)
|
||||||
if [[ $(python --version 2>&1) != Python\ 2* ]]; then
|
if [[ $(python --version 2>&1) != Python\ 2* ]]; then
|
||||||
|
@ -67,73 +59,98 @@ if [[ $app_method == "LOCAL"* ]]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Create app user
|
# Create app user
|
||||||
id -u $app_user &>/dev/null || sudo useradd --home-dir $app_install_dir --shell /bin/false $app_user
|
id -u $app &>/dev/null || sudo useradd --home-dir $app_install_dir --shell /bin/false $app
|
||||||
|
|
||||||
# Configure daemon
|
# YunoHost multimedia
|
||||||
sudo sed -i "s@USERTOCHANGE@$app_user@g" $app_src_dfts
|
# Add yunohost.multimedia directory
|
||||||
sudo sed -i "s@APPDIRTOCHANGE@$app_install_dir@g" $app_src_dfts
|
wget -qq https://github.com/YunoHost-Apps/yunohost.multimedia/archive/master.zip
|
||||||
sudo sed -i "s@DATADIRTOCHANGE@$app_data_dir@g" $app_src_dfts
|
unzip -qq master.zip
|
||||||
sudo sed -i "s@PIDFILETOCHANGE@$app_pid_file@g" $app_src_dfts
|
sudo ./yunohost.multimedia-master/script/ynh_media_build.sh
|
||||||
sudo sed -i "s@PYTBINTOCHANGE@$app_python_bin@g" $app_src_dfts
|
# Give write access to the yunohost.multimedia directory so that Couchpotato can move Movies to the Movie directory
|
||||||
sudo sed -i "s@OPTSTOCHANGE@$app_config_file@g" $app_src_dfts
|
sudo usermod -a -G multimedia $app
|
||||||
sudo cp -a $app_src_dfts /etc/default/$app_id
|
# Creates the "Movies" subfolder in "Video"
|
||||||
sudo cp -a $app_src_init /etc/init.d/$app_id
|
sudo mkdir -p "/home/yunohost.multimedia/share/Video/Movies"
|
||||||
|
# Fix permissions
|
||||||
|
sudo ./yunohost.multimedia-master/script/ynh_media_build.sh
|
||||||
|
|
||||||
|
# Transmission link: Preferred method is direct RPC link. If not available, switch to watchdir.
|
||||||
|
transmission_rpcurl=""
|
||||||
|
transmission_rpcpassword=""
|
||||||
|
transmission_watchdir=""
|
||||||
|
# Check if Transmission is installed
|
||||||
|
if [[ -z $(sudo yunohost app list -i -f transmission | grep -v 'apps:') ]]; then
|
||||||
|
sudo sed -i "s@__RPC__@0@g" ../conf/couchpotato.conf # Disable Transmission RPC
|
||||||
|
sudo sed -i "s@__BLACKHOLE__@0@g" ../conf/couchpotato.conf # Disable Transmission Watchdir
|
||||||
|
sudo sed -i "s@__RENAMER__@0@g" ../conf/couchpotato.conf # Disable Renamer
|
||||||
|
else
|
||||||
|
echo "Transmission is installed. Trying to link it to CouchPotato..."
|
||||||
|
# Check if the transmission password is in settings
|
||||||
|
if [[ -n $(ynh_app_setting_get transmission rpcpassword || true) ]]; then
|
||||||
|
echo "Transmission will be linked to CouchPotato directly"
|
||||||
|
transmission_rpcurl="$(ynh_app_setting_get transmission path)transmission"
|
||||||
|
transmission_rpcpassword=$(ynh_app_setting_get transmission rpcpassword)
|
||||||
|
sudo sed -i "s@__RPC__@1@g" ../conf/couchpotato.conf # Enable Transmission RPC
|
||||||
|
sudo sed -i "s@__BLACKHOLE__@0@g" ../conf/couchpotato.conf # Disable Transmission Watchdir
|
||||||
|
sudo sed -i "s@__RENAMER__@1@g" ../conf/couchpotato.conf # Enable Renamer
|
||||||
|
# If transmission uses YunoHost multimedia, use its folder for the renamer
|
||||||
|
else
|
||||||
|
# Check if transmission has watchdir enabled
|
||||||
|
if [[ -n $(ynh_app_setting_get transmission watchdir || true) ]]; then
|
||||||
|
echo "Transmission will be linked to CouchPotato with watchdir"
|
||||||
|
transmission_watchdir=$(ynh_app_setting_get transmission watchdir)
|
||||||
|
sudo sed -i "s@__RPC__@0@g" ../conf/couchpotato.conf # Disable Transmission RPC
|
||||||
|
sudo sed -i "s@__BLACKHOLE__@1@g" ../conf/couchpotato.conf # Enable Transmission Watchdir
|
||||||
|
sudo sed -i "s@__RENAMER__@1@g" ../conf/couchpotato.conf # Enable Renamer
|
||||||
|
# If transmission uses YunoHost multimedia, use its folder for the renamer
|
||||||
|
else
|
||||||
|
echo "Cannot link Couchpotato to Transmission because Transmission has no RPC password or watchdir available."
|
||||||
|
sudo sed -i "s@__RPC__@0@g" ../conf/couchpotato.conf # Disable Transmission RPC
|
||||||
|
sudo sed -i "s@__BLACKHOLE__@0@g" ../conf/couchpotato.conf # Disable Transmission Watchdir
|
||||||
|
sudo sed -i "s@__RENAMER__@0@g" ../conf/couchpotato.conf # Disable Renamer
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# Configure App
|
# Configure App
|
||||||
sudo sed -i "s@PATHTOCHANGE@$app_path@g" $app_src_conf
|
sudo sed -i "s@__RPCURL__@$transmission_rpcurl@g" ../conf/couchpotato.conf
|
||||||
sudo sed -i "s@PORTTOCHANGE@$app_port@g" $app_src_conf
|
sudo sed -i "s@__RPCPASSWORD__@$transmission_rpcpassword@g" ../conf/couchpotato.conf
|
||||||
sudo sed -i "s@DATADIRTOCHANGE@$app_data_dir@g" $app_src_conf
|
sudo sed -i "s@__WATCHDIR__@$transmission_watchdir@g" ../conf/couchpotato.conf
|
||||||
sudo cp -a $app_src_conf $app_config_file
|
|
||||||
|
sudo sed -i "s@__PATH__@$path@g" ../conf/couchpotato.conf
|
||||||
|
sudo sed -i "s@__PORT__@$port@g" ../conf/couchpotato.conf
|
||||||
|
sudo sed -i "s@__DATADIR__@$app_data_dir@g" ../conf/couchpotato.conf
|
||||||
|
|
||||||
|
sudo cp -a ../conf/couchpotato.conf $app_config_file
|
||||||
|
|
||||||
# Redirect logs directory
|
# Redirect logs directory
|
||||||
if [[ $app_logs_dir != "$app_data_dir"* ]]; then
|
sudo mkdir -p $app_logs_dir
|
||||||
sudo mkdir -p $app_logs_dir
|
sudo chown -R $app $app_logs_dir
|
||||||
sudo chown -R $app_user $app_logs_dir
|
sudo chmod +x -R $app_logs_dir
|
||||||
sudo chmod +x -R $app_logs_dir
|
sudo sed -i "s@self.log_dir =.*@self.log_dir = '$app_logs_dir'@g" $app_install_dir/CouchPotato.py
|
||||||
sudo sed -i "s@self.log_dir =.*@self.log_dir = '$app_logs_dir'@g" $app_install_dir/CouchPotato.py
|
|
||||||
fi
|
# Permissions
|
||||||
|
sudo chown -R $app:$app $app_install_dir
|
||||||
# Set rights
|
sudo chown -R $app:$app $app_data_dir
|
||||||
sudo chown -R $app_user $app_install_dir
|
|
||||||
sudo chown -R $app_user $app_data_dir
|
|
||||||
sudo chmod +x /etc/init.d/$app_id
|
|
||||||
sudo chmod +x -R $app_install_dir
|
|
||||||
sudo chmod +x -R $app_data_dir
|
|
||||||
|
|
||||||
# Add service to YunoHost's monitoring
|
|
||||||
sudo yunohost service add $app_id --log $app_logs_dir --status "ps aux | grep $app_id | grep -v grep"
|
|
||||||
|
|
||||||
# Start daemon at boot
|
|
||||||
sudo update-rc.d $app_id defaults
|
|
||||||
|
|
||||||
|
# Configure service
|
||||||
|
sed -i "s@__PYTHON__@$app_python_bin@g" ../conf/systemd.service
|
||||||
|
sed -i "s@__APPDIR__@$app_install_dir@g" ../conf/systemd.service
|
||||||
|
sed -i "s@__DATADIR__@$app_data_dir@g" ../conf/systemd.service
|
||||||
|
sed -i "s@__PIDFILE__@$app_pid_file@g" ../conf/systemd.service
|
||||||
|
sed -i "s@__CONFIGFILE__@$app_config_file@g" ../conf/systemd.service
|
||||||
|
sed -i "s@__USER__@$app@g" ../conf/systemd.service
|
||||||
|
sudo cp ../conf/systemd.service /etc/systemd/system/$app.service
|
||||||
|
sudo systemctl daemon-reload
|
||||||
|
sudo systemctl enable $app
|
||||||
|
sudo yunohost service add $app
|
||||||
|
|
||||||
# Start service
|
# Start service
|
||||||
sudo service $app_id start
|
sudo yunohost service start $app
|
||||||
|
|
||||||
# Set proxy host variable
|
|
||||||
app_host="http://${app_local_host}:${app_port}${app_path%/}"
|
|
||||||
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
# Configure Nginx and reload
|
||||||
# Remove trailing "/" for next commands
|
sed -i "s@__PATH__@$path@g" ../conf/nginx.conf
|
||||||
app_path=${app_path%/}
|
sed -i "s@__PORT__@$port@g" ../conf/nginx.conf
|
||||||
|
sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/$app.conf
|
||||||
# Configure Nginx
|
|
||||||
sudo sed -i "s@PATHTOCHANGE@$app_path@g" $app_src_nginx_conf
|
|
||||||
sudo sed -i "s@HOSTTOCHANGE@$app_host@g" $app_src_nginx_conf
|
|
||||||
sudo cp $app_src_nginx_conf /etc/nginx/conf.d/$app_domain.d/$app_id.conf
|
|
||||||
|
|
||||||
# If app is public, add url to SSOWat conf as skipped_uris
|
|
||||||
if [[ $app_public == "Yes" ]]; then
|
|
||||||
# unprotected_uris allows SSO credentials to be passed anyway.
|
|
||||||
sudo yunohost app setting $app_id unprotected_uris -v "/"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Save app settings
|
|
||||||
sudo yunohost app setting $app_id public -v "$app_public"
|
|
||||||
sudo yunohost app setting $app_id method -v "$app_method"
|
|
||||||
sudo yunohost app setting $app_id host -v "$app_host"
|
|
||||||
|
|
||||||
# Reload Nginx and regenerate SSOwat conf
|
# Reload Nginx and regenerate SSOwat conf
|
||||||
sudo service nginx reload
|
sudo service nginx reload
|
||||||
sudo yunohost app ssowatconf
|
|
||||||
|
|
|
@ -1,56 +1,41 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
#set -eu
|
||||||
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
|
|
||||||
|
# Source app helpers
|
||||||
|
. /usr/share/yunohost/helpers
|
||||||
|
|
||||||
# Common variable declaration
|
# Common variable declaration
|
||||||
app_id=couchpotato
|
app_install_dir="/opt/yunohost/$app"
|
||||||
app_user=couchpotato
|
app_data_dir="/home/yunohost.app/$app"
|
||||||
app_install_dir="/opt/yunohost/${app_id}"
|
app_logs_dir="/var/log/$app"
|
||||||
app_data_dir="/home/yunohost.app/${app_id}"
|
|
||||||
app_logs_dir="/var/log/${app_id}"
|
|
||||||
|
|
||||||
# Retrieve arguments
|
# Retrieve arguments
|
||||||
app_method="$(sudo yunohost app setting ${app_id} method)"
|
domain=$(ynh_app_setting_get "$app" domain)
|
||||||
app_domain="$(sudo yunohost app setting ${app_id} domain)"
|
|
||||||
keep_data=$1
|
|
||||||
|
|
||||||
|
|
||||||
# Remove files if localhost installation
|
|
||||||
if [[ $app_method == "LOCAL"* ]]; then
|
|
||||||
|
|
||||||
|
# Remove files
|
||||||
# Kill app and remove from boot
|
# Kill app and remove from boot
|
||||||
sudo service $app_id stop
|
sudo service $app stop
|
||||||
sudo killall $app_id
|
|
||||||
sudo update-rc.d $app_id remove
|
|
||||||
|
|
||||||
# Delete app user
|
# Delete app user
|
||||||
sudo deluser $app_user
|
sudo deluser $app
|
||||||
|
|
||||||
# Remove sources
|
# Remove sources
|
||||||
sudo rm -rf $app_install_dir
|
sudo rm -rf $app_install_dir
|
||||||
|
sudo rm -rf $app_data_dir
|
||||||
# Remove logs
|
sudo rm -rf $app_logs_dir
|
||||||
if [[ $app_logs_dir != "$app_data_dir"* ]]; then
|
|
||||||
sudo rm -rf $app_logs_dir
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Remove data
|
# Remove data
|
||||||
if [[ $keep_data == "No" ]]; then
|
sudo rm -rf $app_data_dir
|
||||||
sudo rm -rf $app_data_dir
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Remove daemon config
|
# Remove service
|
||||||
sudo rm -f /etc/init.d/$app_id
|
sudo systemctl disable $app.service
|
||||||
sudo rm -f /etc/default/$app_id
|
sudo rm -f /etc/systemd/system/$app.service
|
||||||
sudo rm -rf /var/run/$app_id
|
sudo systemctl daemon-reload
|
||||||
|
sudo yunohost service remove $app
|
||||||
|
|
||||||
fi
|
# Remove nginx configuration file
|
||||||
|
sudo rm -f /etc/nginx/conf.d/$domain.d/$app.conf
|
||||||
|
|
||||||
|
# Restart services
|
||||||
# Remove Nginx parameters
|
sudo service nginx reload
|
||||||
sudo rm -f /etc/nginx/conf.d/$app_domain.d/$app_id.conf
|
|
||||||
|
|
||||||
# Remove Yunohost service
|
|
||||||
sudo yunohost service remove $app_id
|
|
||||||
|
|
||||||
# Reload Nginx and update Yunohost
|
|
||||||
sudo service nginx reload
|
|
||||||
sudo yunohost app ssowatconf
|
|
||||||
|
|
122
scripts/restore
122
scripts/restore
|
@ -1,56 +1,92 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
|
|
||||||
|
# Source app helpers
|
||||||
|
. /usr/share/yunohost/helpers
|
||||||
|
|
||||||
# Common variable declaration
|
# Common variable declaration
|
||||||
app_id=couchpotato
|
app_install_dir="/opt/yunohost/$app"
|
||||||
app_user=couchpotato
|
app_data_dir="/home/yunohost.app/$app"
|
||||||
app_install_dir="/opt/yunohost/${app_id}"
|
app_logs_dir="/var/log/$app"
|
||||||
app_data_dir="/home/yunohost.app/${app_id}"
|
app_python_bin="/usr/bin/python"
|
||||||
|
|
||||||
# Retrieve arguments
|
# Retrieve arguments
|
||||||
app_method="$(sudo yunohost app setting ${app_id} method)"
|
domain=$(ynh_app_setting_get "$app" domain)
|
||||||
app_domain="$(sudo yunohost app setting ${app_id} domain)"
|
path=$(ynh_app_setting_get "$app" path)
|
||||||
|
|
||||||
# The parameter $1 is the uncompressed restore directory location
|
# Check destination directories
|
||||||
app_backup_dir="$1/apps/${app_id}"
|
[[ -d $app_install_dir ]] && ynh_die \
|
||||||
|
"The destination directory '$app_install_dir' already exists.\
|
||||||
|
You should safely delete it before restoring this app."
|
||||||
|
|
||||||
|
[[ -d $app_data_dir ]] && ynh_die \
|
||||||
|
"The destination directory '$app_data_dir' already exists.\
|
||||||
|
You should safely delete it before restoring this app."
|
||||||
|
|
||||||
# Restore files if localhost installation
|
nginx_conf="/etc/nginx/conf.d/${domain}.d/${app}.conf"
|
||||||
if [[ $app_method == "LOCAL"* ]]; then
|
[[ -f $nginx_conf ]] && ynh_die \
|
||||||
|
"The NGINX configuration already exists at '${nginx_conf}'.
|
||||||
|
You should safely delete it before restoring this app."
|
||||||
|
|
||||||
# Kill app
|
systemd_conf="/etc/systemd/system/${app}.service"
|
||||||
sudo service $app_id stop
|
[[ -f $systemd_conf ]] && ynh_die \
|
||||||
sudo killall $app_id
|
"The Systemd configuration already exists at '${systemd_conf}'.
|
||||||
|
You should safely delete it before restoring this app."
|
||||||
|
|
||||||
# Restore sources
|
# Kill app if running
|
||||||
sudo cp -a $app_backup_dir/sources/. $app_install_dir
|
sudo systemctl stop $app
|
||||||
|
|
||||||
# Restore data
|
# Restore sources
|
||||||
sudo cp -a $app_backup_dir/data/. $app_data_dir
|
sudo mkdir -p $app_install_dir
|
||||||
|
sudo cp -a ./sources/. $app_install_dir
|
||||||
|
|
||||||
|
# Restore data
|
||||||
|
sudo mkdir -p $app_data_dir
|
||||||
|
sudo cp -a ./data/. $app_data_dir
|
||||||
|
|
||||||
|
# Reinstall dependencies (using virtualenv)
|
||||||
|
if [[ $(python --version 2>&1) != Python\ 2* ]]; then
|
||||||
|
sudo apt-get install -y python-pip python-virtualenv python-dev uwsgi uwsgi-plugin-python
|
||||||
|
sudo virtualenv $app_install_dir
|
||||||
|
sudo bash -c "source $app_install_dir/bin/activate && pip install cheetah"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Recreate app user
|
||||||
|
id -u $app &>/dev/null || sudo useradd --home-dir $app_install_dir --shell /bin/false $app
|
||||||
|
|
||||||
|
# YunoHost multimedia
|
||||||
|
# Add yunohost.multimedia directory
|
||||||
|
wget -qq https://github.com/YunoHost-Apps/yunohost.multimedia/archive/master.zip
|
||||||
|
unzip -qq master.zip
|
||||||
|
sudo ./yunohost.multimedia-master/script/ynh_media_build.sh
|
||||||
|
# Give write access to the yunohost.multimedia directory so that Couchpotato can move Movies to the Movie directory
|
||||||
|
sudo usermod -a -G multimedia $app
|
||||||
|
# Creates the "Movies" subfolder in "Video"
|
||||||
|
sudo mkdir -p "/home/yunohost.multimedia/share/Video/Movies"
|
||||||
|
# Fix permissions
|
||||||
|
sudo ./yunohost.multimedia-master/script/ynh_media_build.sh
|
||||||
|
|
||||||
|
# Redirect logs directory
|
||||||
|
sudo mkdir -p $app_logs_dir
|
||||||
|
sudo chown -R $app $app_logs_dir
|
||||||
|
sudo chmod +x -R $app_logs_dir
|
||||||
|
sudo sed -i "s@self.log_dir =.*@self.log_dir = '$app_logs_dir'@g" $app_install_dir/CouchPotato.py
|
||||||
|
|
||||||
|
# Permissions
|
||||||
|
sudo chown -R $app:$app $app_install_dir
|
||||||
|
sudo chown -R $app:$app $app_data_dir
|
||||||
|
|
||||||
|
# Restore daemon config
|
||||||
|
sudo cp -a ./$app.service $systemd_conf
|
||||||
|
sudo systemctl daemon-reload
|
||||||
|
sudo systemctl enable $app
|
||||||
|
sudo yunohost service add $app
|
||||||
|
|
||||||
|
# Start service
|
||||||
|
sudo yunohost service start $app
|
||||||
|
|
||||||
# Restore daemon config
|
# Restore Nginx conf
|
||||||
sudo cp -a $app_backup_dir/conf/$app_id.default /etc/default/$app_id
|
sudo cp -a ./nginx.conf "$nginx_conf"
|
||||||
sudo cp -a $app_backup_dir/conf/$app_id.init /etc/init.d/$app_id
|
|
||||||
|
|
||||||
# Set rights
|
|
||||||
sudo chown -R $app_user $app_install_dir
|
|
||||||
sudo chown -R $app_user $app_data_dir
|
|
||||||
sudo chmod +x /etc/init.d/$app_id
|
|
||||||
sudo chmod +x -R $app_install_dir
|
|
||||||
sudo chmod +x -R $app_data_dir
|
|
||||||
|
|
||||||
# Start daemon at boot
|
|
||||||
sudo update-rc.d $app_id defaults
|
|
||||||
|
|
||||||
# Reload daemon
|
|
||||||
sudo service $app_id restart
|
|
||||||
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
# Reload Nginx
|
||||||
# Restore Nginx and YunoHost parameters
|
sudo service nginx reload
|
||||||
sudo cp -a $app_backup_dir/yunohost/. /etc/yunohost/apps/$app_id
|
|
||||||
sudo cp -a $app_backup_dir/nginx.conf /etc/nginx/conf.d/$app_domain.d/$app_id.conf
|
|
||||||
|
|
||||||
# Reload Nginx and regenerate SSOwat conf
|
|
||||||
sudo service nginx reload
|
|
||||||
sudo yunohost app ssowatconf
|
|
||||||
|
|
131
scripts/upgrade
131
scripts/upgrade
|
@ -1,75 +1,100 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
|
source="https://github.com/CouchPotato/CouchPotatoServer"
|
||||||
|
|
||||||
# Basic variable declaration
|
# Backup the current version of the app, restore it if the upgrade fails
|
||||||
BASEDIR="$(dirname "$(pwd)")"
|
EXIT_PROPERLY () {
|
||||||
|
trap '' EXIT
|
||||||
|
set +e
|
||||||
|
sudo yunohost backup restore --ignore-hooks $app-before-upgrade --apps $app --force --quiet # Restore the backup if upgrade failed
|
||||||
|
ynh_die "Upgrade failed. The app was restored to the way it was before the failed upgrade."
|
||||||
|
}
|
||||||
|
if [[ -n $(sudo yunohost backup info $app-before-upgrade || true) ]]; then
|
||||||
|
sudo yunohost backup delete $app-before-upgrade
|
||||||
|
fi
|
||||||
|
sudo yunohost backup create --ignore-hooks --apps $app --name $app-before-upgrade --quiet
|
||||||
|
set -e
|
||||||
|
trap EXIT_PROPERLY ERR
|
||||||
|
|
||||||
# Common variable declaration
|
# Source app helpers
|
||||||
app_id=couchpotato
|
. /usr/share/yunohost/helpers
|
||||||
app_user=couchpotato
|
|
||||||
app_install_dir="/opt/yunohost/${app_id}"
|
|
||||||
app_data_dir="/home/yunohost.app/${app_id}"
|
|
||||||
app_logs_dir="/var/log/${app_id}"
|
|
||||||
## Sources definitions
|
|
||||||
app_src_init="$BASEDIR/conf/${app_id}.init"
|
|
||||||
app_src_nginx_conf="$BASEDIR/conf/nginx.conf"
|
|
||||||
|
|
||||||
# Retrieve arguments
|
# Retrieve arguments
|
||||||
app_public="$(sudo yunohost app setting ${app_id} public)"
|
domain=$(ynh_app_setting_get "$app" domain)
|
||||||
app_method="$(sudo yunohost app setting ${app_id} method)"
|
path=$(ynh_app_setting_get "$app" path)
|
||||||
app_domain="$(sudo yunohost app setting ${app_id} domain)"
|
port=$(ynh_app_setting_get "$app" port)
|
||||||
app_path="$(sudo yunohost app setting ${app_id} path)"
|
|
||||||
app_host="$(sudo yunohost app setting ${app_id} host)"
|
|
||||||
|
|
||||||
|
# Cancel upgrade if the version is too old
|
||||||
|
if [[ -n $(ynh_app_setting_get $app method) ]]; then
|
||||||
|
ynh_die "Your current version is too old and cannot be upgraded.\
|
||||||
|
If you had a local install, please remove the app and reinstall it.\
|
||||||
|
If you had a remote install, please remove the app and install redirect_ynh for this purpose instead."
|
||||||
|
fi
|
||||||
|
|
||||||
# Make upgrade if localhost installation
|
# Destinations definitions
|
||||||
if [[ $app_method == "LOCAL"* ]]; then
|
app_install_dir="/opt/yunohost/$app"
|
||||||
|
app_data_dir="/home/yunohost.app/$app"
|
||||||
|
app_logs_dir="/var/log/$app"
|
||||||
|
app_config_file="${app_data_dir}/settings.conf"
|
||||||
|
app_pid_file="/var/run/$app/$app.pid"
|
||||||
|
app_python_bin="/usr/bin/python"
|
||||||
|
|
||||||
|
# Upgrade Couchpotato
|
||||||
|
|
||||||
# Kill app
|
# Kill app
|
||||||
sudo service $app_id stop
|
sudo service $app stop || true
|
||||||
sudo killall $app_id
|
|
||||||
|
|
||||||
# Upgrade to the latest version of app using the fork
|
# Upgrade to the latest version of app using the fork
|
||||||
cd $app_install_dir && sudo git pull
|
cd $app_install_dir && sudo git pull
|
||||||
cd -
|
cd -
|
||||||
|
|
||||||
# Upgrade dependencies
|
|
||||||
|
|
||||||
|
# Upgrade dependencies
|
||||||
|
if [[ $(python --version 2>&1) != Python\ 2* ]]; then
|
||||||
|
app_python_bin=$app_install_dir/bin/python
|
||||||
|
sudo apt-get install -y python-pip python-virtualenv python-dev uwsgi uwsgi-plugin-python
|
||||||
|
fi
|
||||||
|
|
||||||
|
# YunoHost multimedia
|
||||||
|
# Add yunohost.multimedia directory
|
||||||
|
wget -qq https://github.com/YunoHost-Apps/yunohost.multimedia/archive/master.zip
|
||||||
|
unzip -qq master.zip
|
||||||
|
sudo ./yunohost.multimedia-master/script/ynh_media_build.sh
|
||||||
|
# Give write access to the yunohost.multimedia directory so that Couchpotato can move Movies to the Movie directory
|
||||||
|
sudo usermod -a -G multimedia $app
|
||||||
|
# Creates the "Movies" subfolder in "Video"
|
||||||
|
sudo mkdir -p "/home/yunohost.multimedia/share/Video/Movies"
|
||||||
|
# Fix permissions
|
||||||
|
sudo ./yunohost.multimedia-master/script/ynh_media_build.sh
|
||||||
|
|
||||||
|
|
||||||
# Redirect logs directory
|
# Redirect logs directory
|
||||||
if [[ $app_logs_dir != "$app_data_dir"* ]]; then
|
if [[ $app_logs_dir != "$app_data_dir"* ]]; then
|
||||||
sudo sed -i "s@self.log_dir =.*@self.log_dir = '$app_logs_dir'@g" $app_install_dir/CouchPotato.py
|
sudo sed -i "s@self.log_dir =.*@self.log_dir = '$app_logs_dir'@g" $app_install_dir/CouchPotato.py
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Permissions
|
||||||
|
sudo chown -R $app:$app $app_install_dir
|
||||||
|
sudo chown -R $app:$app $app_data_dir
|
||||||
|
|
||||||
# Update init file
|
# Configure service
|
||||||
sudo cp -a $app_src_init /etc/init.d/$app_id
|
sed -i "s@__PYTHON__@$app_python_bin@g" ../conf/systemd.service
|
||||||
|
sed -i "s@__APPDIR__@$app_install_dir@g" ../conf/systemd.service
|
||||||
# Set rights
|
sed -i "s@__DATADIR__@$app_data_dir@g" ../conf/systemd.service
|
||||||
sudo chown -R $app_user $app_install_dir
|
sed -i "s@__PIDFILE__@$app_pid_file@g" ../conf/systemd.service
|
||||||
sudo chmod +x /etc/init.d/$app_id
|
sed -i "s@__CONFIGFILE__@$app_config_file@g" ../conf/systemd.service
|
||||||
sudo chmod +x -R $app_install_dir
|
sed -i "s@__USER__@$app@g" ../conf/systemd.service
|
||||||
|
sudo cp ../conf/systemd.service /etc/systemd/system/$app.service
|
||||||
|
sudo systemctl daemon-reload
|
||||||
|
sudo systemctl enable $app
|
||||||
|
sudo yunohost service add $app
|
||||||
|
|
||||||
# Start service
|
# Start service
|
||||||
sudo service $app_id start
|
sudo yunohost service start $app
|
||||||
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
# Configure Nginx and reload
|
||||||
# Remove trailing "/" for next commands
|
sed -i "s@__PATH__@$path@g" ../conf/nginx.conf
|
||||||
app_path=${app_path%/}
|
sed -i "s@__PORT__@$port@g" ../conf/nginx.conf
|
||||||
|
sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/$app.conf
|
||||||
# Configure Nginx
|
|
||||||
sudo sed -i "s@PATHTOCHANGE@$app_path@g" $app_src_nginx_conf
|
|
||||||
sudo sed -i "s@HOSTTOCHANGE@$app_host@g" $app_src_nginx_conf
|
|
||||||
sudo cp $app_src_nginx_conf /etc/nginx/conf.d/$app_domain.d/$app_id.conf
|
|
||||||
|
|
||||||
# If app is public, add url to SSOWat conf as skipped_uris
|
|
||||||
if [[ $app_public = "Yes" ]];
|
|
||||||
then
|
|
||||||
# See install script
|
|
||||||
sudo yunohost app setting $app_id unprotected_uris -v "/"
|
|
||||||
# Remove old settings
|
|
||||||
sudo yunohost app setting $app_id skipped_uris -d
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Reload Nginx and regenerate SSOwat conf
|
# Reload Nginx and regenerate SSOwat conf
|
||||||
sudo service nginx reload
|
sudo service nginx reload
|
||||||
sudo yunohost app ssowatconf
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue