aethernal-agent 0.2.0 → 0.4.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (149) hide show
  1. checksums.yaml +4 -4
  2. data/COPYING +674 -0
  3. data/Gemfile.lock +38 -33
  4. data/README.md +3 -32
  5. data/Vagrantfile +10 -2
  6. data/aethernal-agent.gemspec +4 -1
  7. data/bin/install-aa +121 -0
  8. data/bin/run-aa-for-test +1 -1
  9. data/exe/aa-cli +7 -0
  10. data/lib/aethernal_agent.rb +10 -0
  11. data/lib/aethernal_agent/apache/apache.rb +8 -5
  12. data/lib/aethernal_agent/apache/templates/aa-default.conf +2 -0
  13. data/lib/aethernal_agent/apache/templates/aa-user.conf.erb +2 -0
  14. data/lib/aethernal_agent/app.rb +82 -22
  15. data/lib/aethernal_agent/apt.rb +17 -6
  16. data/lib/aethernal_agent/cli/core.rb +11 -0
  17. data/lib/aethernal_agent/cli/services.rb +56 -0
  18. data/lib/aethernal_agent/docker/container_settings.rb +33 -0
  19. data/lib/aethernal_agent/docker/env.rb +33 -0
  20. data/lib/aethernal_agent/docker/port_binding.rb +32 -0
  21. data/lib/aethernal_agent/docker/volume.rb +28 -0
  22. data/lib/aethernal_agent/filesystem.rb +2 -1
  23. data/lib/aethernal_agent/loader.rb +3 -3
  24. data/lib/aethernal_agent/operation.rb +1 -1
  25. data/lib/aethernal_agent/plugins/bazarr/bazarr.rb +57 -0
  26. data/lib/aethernal_agent/plugins/bazarr/files/bazarr.service +16 -0
  27. data/lib/aethernal_agent/plugins/bazarr/manifest.yml +64 -0
  28. data/lib/aethernal_agent/plugins/bazarr/meta/bazarr.png +0 -0
  29. data/lib/aethernal_agent/plugins/bazarr/templates/bazarr.apache.conf.erb +5 -0
  30. data/lib/aethernal_agent/plugins/bazarr/templates/config.ini.erb +135 -0
  31. data/lib/aethernal_agent/plugins/cardigann/cardigann.rb +45 -0
  32. data/lib/aethernal_agent/plugins/cardigann/files/cardigann.service +13 -0
  33. data/lib/aethernal_agent/plugins/cardigann/manifest.yml +36 -0
  34. data/lib/aethernal_agent/plugins/cardigann/meta/cardigann.png +0 -0
  35. data/lib/aethernal_agent/plugins/cardigann/templates/cardigann.apache.conf.erb +6 -0
  36. data/lib/aethernal_agent/plugins/cardigann/templates/config.json.erb +7 -0
  37. data/lib/aethernal_agent/plugins/couchpotato/couchpotato.rb +45 -0
  38. data/lib/aethernal_agent/plugins/couchpotato/files/couchpotato.service +13 -0
  39. data/lib/aethernal_agent/plugins/couchpotato/manifest.yml +37 -0
  40. data/lib/aethernal_agent/plugins/couchpotato/meta/couchpotato.png +0 -0
  41. data/lib/aethernal_agent/plugins/couchpotato/templates/couchpotato.apache.conf.erb +4 -0
  42. data/lib/aethernal_agent/plugins/couchpotato/templates/settings.conf.erb +585 -0
  43. data/lib/aethernal_agent/plugins/deluge/deluge.rb +5 -0
  44. data/lib/aethernal_agent/plugins/deluge/manifest.yml +2 -2
  45. data/lib/aethernal_agent/plugins/deluge/templates/core.conf.erb +1 -1
  46. data/lib/aethernal_agent/plugins/deluge/templates/deluge-web.service.erb +1 -1
  47. data/lib/aethernal_agent/plugins/deluge/templates/deluge.apache.conf.erb +0 -1
  48. data/lib/aethernal_agent/plugins/deluge/templates/deluged.service.erb +1 -1
  49. data/lib/aethernal_agent/plugins/deluge/templates/ltconfig.conf.erb +21 -0
  50. data/lib/aethernal_agent/plugins/filebrowser/manifest.yml +1 -1
  51. data/lib/aethernal_agent/plugins/gitea/manifest.yml +1 -1
  52. data/lib/aethernal_agent/plugins/jackett/files/jackett.service +15 -0
  53. data/lib/aethernal_agent/plugins/jackett/jackett.rb +49 -0
  54. data/lib/aethernal_agent/plugins/jackett/manifest.yml +54 -0
  55. data/lib/aethernal_agent/plugins/jackett/meta/jackett.png +0 -0
  56. data/lib/aethernal_agent/plugins/jackett/templates/ServerConfig.json.erb +8 -0
  57. data/lib/aethernal_agent/plugins/jackett/templates/jackett.apache.conf.erb +5 -0
  58. data/lib/aethernal_agent/plugins/jdownloader/files/jdownloader.service +13 -0
  59. data/lib/aethernal_agent/plugins/jdownloader/jdownloader.rb +38 -0
  60. data/lib/aethernal_agent/plugins/jdownloader/manifest.yml +53 -0
  61. data/lib/aethernal_agent/plugins/jdownloader/meta/jdownloader.png +0 -0
  62. data/lib/aethernal_agent/plugins/jdownloader/templates/org.jdownloader.api.myjdownloader.MyJDownloaderSettings.json.erb +5 -0
  63. data/lib/aethernal_agent/plugins/medusa/files/medusa.service +13 -0
  64. data/lib/aethernal_agent/plugins/medusa/manifest.yml +54 -0
  65. data/lib/aethernal_agent/plugins/medusa/medusa.rb +47 -0
  66. data/lib/aethernal_agent/plugins/medusa/meta/medusa.png +0 -0
  67. data/lib/aethernal_agent/plugins/medusa/templates/config.ini.erb +1308 -0
  68. data/lib/aethernal_agent/plugins/medusa/templates/medusa.apache.conf.erb +12 -0
  69. data/lib/aethernal_agent/plugins/nextcloud/manifest.yml +54 -0
  70. data/lib/aethernal_agent/plugins/nextcloud/meta/nextcloud.png +0 -0
  71. data/lib/aethernal_agent/plugins/nextcloud/nextcloud.rb +44 -0
  72. data/lib/aethernal_agent/plugins/nextcloud/templates/nextcloud.apache.conf.erb +4 -0
  73. data/lib/aethernal_agent/plugins/nzbget/files/nzbget.service +13 -0
  74. data/lib/aethernal_agent/plugins/nzbget/manifest.yml +54 -0
  75. data/lib/aethernal_agent/plugins/nzbget/meta/nzbget.png +0 -0
  76. data/lib/aethernal_agent/plugins/nzbget/nzbget.rb +44 -0
  77. data/lib/aethernal_agent/plugins/nzbget/templates/nzbget.apache.conf.erb +5 -0
  78. data/lib/aethernal_agent/plugins/nzbget/templates/nzbget.conf.erb +1508 -0
  79. data/lib/aethernal_agent/plugins/olaris/manifest.yml +1 -1
  80. data/lib/aethernal_agent/plugins/ombi/manifest.yml +5 -2
  81. data/lib/aethernal_agent/plugins/ombi/ombi.rb +59 -22
  82. data/lib/aethernal_agent/plugins/ombi/templates/ombi.apache.conf.erb +3 -4
  83. data/lib/aethernal_agent/plugins/ombi/templates/ombi.service.erb +2 -2
  84. data/lib/aethernal_agent/plugins/plex-docker/manifest.yml +74 -0
  85. data/lib/aethernal_agent/plugins/plex-docker/meta/plex.png +0 -0
  86. data/lib/aethernal_agent/plugins/plex-docker/plex_docker.rb +39 -0
  87. data/lib/aethernal_agent/plugins/plex-docker/templates/Preferences.xml.erb +2 -0
  88. data/lib/aethernal_agent/plugins/plex-docker/templates/plex_docker.apache.conf.erb +21 -0
  89. data/lib/aethernal_agent/plugins/plex-docker/templates/plex_docker.service.erb +10 -0
  90. data/lib/aethernal_agent/plugins/plex/files/plex.service +1 -1
  91. data/lib/aethernal_agent/plugins/plex/manifest.yml +6 -5
  92. data/lib/aethernal_agent/plugins/plex/plex.rb +2 -4
  93. data/lib/aethernal_agent/plugins/plex/templates/Preferences.xml.erb +1 -1
  94. data/lib/aethernal_agent/plugins/plex/templates/plex.apache.conf.erb +21 -0
  95. data/lib/aethernal_agent/plugins/portainer/manifest.yml +50 -0
  96. data/lib/aethernal_agent/plugins/portainer/meta/portainer.png +0 -0
  97. data/lib/aethernal_agent/plugins/portainer/portainer.rb +38 -0
  98. data/lib/aethernal_agent/plugins/portainer/templates/portainer.apache.conf.erb +7 -0
  99. data/lib/aethernal_agent/plugins/portainer/templates/portainer.service.erb +10 -0
  100. data/lib/aethernal_agent/plugins/radarr/files/radarr.service +2 -2
  101. data/lib/aethernal_agent/plugins/radarr/manifest.yml +7 -13
  102. data/lib/aethernal_agent/plugins/radarr/radarr.rb +24 -18
  103. data/lib/aethernal_agent/plugins/radarr/templates/radarr.apache.conf.erb +3 -4
  104. data/lib/aethernal_agent/plugins/resilio_docker/manifest.yml +59 -0
  105. data/lib/aethernal_agent/plugins/resilio_docker/meta/resilio.png +0 -0
  106. data/lib/aethernal_agent/plugins/resilio_docker/resilio_docker.rb +29 -0
  107. data/lib/aethernal_agent/plugins/resilio_docker/templates/resilio_docker.apache.conf.erb +11 -0
  108. data/lib/aethernal_agent/plugins/resilio_docker/templates/resilio_docker.conf.erb +38 -0
  109. data/lib/aethernal_agent/plugins/resilio_docker/templates/resilio_docker.service.erb +10 -0
  110. data/lib/aethernal_agent/plugins/rutorrent/manifest.yml +84 -0
  111. data/lib/aethernal_agent/plugins/rutorrent/meta/rtorrent.png +0 -0
  112. data/lib/aethernal_agent/plugins/rutorrent/rutorrent.rb +41 -0
  113. data/lib/aethernal_agent/plugins/rutorrent/templates/rtorrent.rc.erb +69 -0
  114. data/lib/aethernal_agent/plugins/rutorrent/templates/rutorrent.apache.conf.erb +13 -0
  115. data/lib/aethernal_agent/plugins/rutorrent/templates/rutorrent.service.erb +10 -0
  116. data/lib/aethernal_agent/plugins/sabnzbd/files/sabnzbd.service +13 -0
  117. data/lib/aethernal_agent/plugins/sabnzbd/manifest.yml +43 -0
  118. data/lib/aethernal_agent/plugins/sabnzbd/meta/sabnzbd.png +0 -0
  119. data/lib/aethernal_agent/plugins/sabnzbd/sabnzbd.rb +47 -0
  120. data/lib/aethernal_agent/plugins/sabnzbd/templates/sabnzbd.apache.conf.erb +4 -0
  121. data/lib/aethernal_agent/plugins/sabnzbd/templates/sabnzbd.ini.erb +188 -0
  122. data/lib/aethernal_agent/plugins/sickchill/files/sickchill.service +13 -0
  123. data/lib/aethernal_agent/plugins/sickchill/manifest.yml +58 -0
  124. data/lib/aethernal_agent/plugins/sickchill/meta/sickchill.png +0 -0
  125. data/lib/aethernal_agent/plugins/sickchill/sickchill.rb +49 -0
  126. data/lib/aethernal_agent/plugins/sickchill/templates/config.ini.erb +1078 -0
  127. data/lib/aethernal_agent/plugins/sickchill/templates/sickchill.apache.conf.erb +4 -0
  128. data/lib/aethernal_agent/plugins/sonarr/files/sonarr.service +1 -1
  129. data/lib/aethernal_agent/plugins/sonarr/manifest.yml +3 -2
  130. data/lib/aethernal_agent/plugins/sonarr/templates/sonarr.apache.conf.erb +3 -4
  131. data/lib/aethernal_agent/plugins/syncthing/files/syncthing.service +18 -0
  132. data/lib/aethernal_agent/plugins/syncthing/manifest.yml +38 -0
  133. data/lib/aethernal_agent/plugins/syncthing/meta/syncthing.png +0 -0
  134. data/lib/aethernal_agent/plugins/syncthing/syncthing.rb +33 -0
  135. data/lib/aethernal_agent/plugins/syncthing/templates/config.xml.erb +56 -0
  136. data/lib/aethernal_agent/plugins/syncthing/templates/syncthing.apache.conf.erb +7 -0
  137. data/lib/aethernal_agent/plugins/tautulli/files/tautulli.service +13 -0
  138. data/lib/aethernal_agent/plugins/tautulli/manifest.yml +40 -0
  139. data/lib/aethernal_agent/plugins/tautulli/meta/tautulli.png +0 -0
  140. data/lib/aethernal_agent/plugins/tautulli/tautulli.rb +45 -0
  141. data/lib/aethernal_agent/plugins/tautulli/templates/config.ini.erb +222 -0
  142. data/lib/aethernal_agent/plugins/tautulli/templates/tautulli.apache.conf.erb +5 -0
  143. data/lib/aethernal_agent/plugins/vnc/manifest.yml +3 -2
  144. data/lib/aethernal_agent/systemd.rb +19 -13
  145. data/lib/aethernal_agent/utils.rb +85 -6
  146. data/lib/aethernal_agent/version.rb +1 -1
  147. data/lib/aethernal_agent/webserver/api.rb +1 -1
  148. data/lib/aethernal_agent/webserver/core.rb +1 -1
  149. metadata +154 -7
@@ -0,0 +1,38 @@
1
+ class AethernalAgent::Portainer < AethernalAgent::App
2
+ def initialize(options = {})
3
+ super(options)
4
+ end
5
+
6
+ def configure_app_user(options = {})
7
+ install_packages(options)
8
+ res = super(options) do |opts|
9
+ @opts = opts
10
+ end
11
+
12
+ if res[:errors].any?
13
+ return create_return_args(options.merge(res[:errors]))
14
+ end
15
+
16
+ if !wait_on_port(@opts["port"])
17
+ self.remove_app_user(@opts)
18
+ self.add_errors("Portainer never properly started")
19
+ else
20
+ uri = URI("http://localhost:#{@opts["port"]}/api/users/admin/init")
21
+ req = Net::HTTP::Post.new(uri)
22
+ req.content_type = 'application/json'
23
+ req.body = {username: @opts[:user], password: @opts[:password]}.to_json
24
+ Net::HTTP.start(uri.host, uri.port) do |http|
25
+ response = http.request(req)
26
+ jp = JSON.parse(response.body)
27
+ if jp["Username"] == @opts[:user]
28
+ AethernalAgent.logger.info("fininshed setting up user")
29
+ else
30
+ AethernalAgent.logger.warn("failed to setup user: #{jp}")
31
+ self.add_errors("Something went wrong while setting up the admin user for Portainer: '#{jp}'")
32
+ end
33
+ end
34
+ end
35
+
36
+ return create_return_args(@opts)
37
+ end
38
+ end
@@ -0,0 +1,7 @@
1
+ redirect "/portainer" "/portainer/"
2
+
3
+ <Location /portainer/>
4
+ ProxyPass http://localhost:<%= @port %>/
5
+ ProxyPassReverse http://localhost:<%= @port %>/
6
+ Require all granted
7
+ </Location>
@@ -0,0 +1,10 @@
1
+ [Unit]
2
+ Description=Portainer
3
+ Wants=network-online.target
4
+
5
+ [Service]
6
+ ExecStart=/usr/bin/docker start -a <%= @container_name %>
7
+ ExecStop=/usr/bin/docker stop -t 10 <%= @container_name %>
8
+
9
+ [Install]
10
+ WantedBy=default.target
@@ -4,10 +4,10 @@ After=syslog.target network.target
4
4
 
5
5
  [Service]
6
6
  Type=simple
7
- ExecStart=/usr/bin/mono --debug %h/apps/radarr/Radarr.exe -nobrowser
7
+ ExecStart=%h/apps/radarr/Radarr -nobrowser
8
8
  TimeoutStopSec=20
9
9
  KillMode=process
10
10
  Restart=on-failure
11
11
 
12
12
  [Install]
13
- WantedBy=multi-user.target
13
+ WantedBy=default.target
@@ -1,7 +1,7 @@
1
1
  name: Radarr
2
2
  script_name: radarr.rb
3
3
  version: 0.1
4
- required_aethernal_agent_version: "~> 0.1.0"
4
+ required_aethernal_agent_version: ">= 0.2.0"
5
5
  description: Radarr is an independent fork of Sonarr reworked for automatically downloading movies via Usenet and BitTorrent.
6
6
  installation_type: local_install
7
7
  configuration_type: multi_user
@@ -51,18 +51,12 @@ actions:
51
51
  estimated_size_mb: 23
52
52
  package:
53
53
  folder_name: Radarr
54
+ apt:
55
+ "1804":
56
+ packages:
57
+ - mediainfo
54
58
  direct_download:
55
- url: https://github.com/Radarr/Radarr/releases/download/v0.2.0.1450/Radarr.develop.0.2.0.1450.linux.tar.gz
56
- target_name: Radarr.develop.0.2.0.1450.linux.tar.gz
59
+ url: https://radarr.servarr.com/v1/update/nightly/updatefile?os=linux&runtime=netcore&arch=x64
60
+ target_name: Radarr.nightly.linux.tar.gz
57
61
  auto_extract: true
58
62
  always_latest: false
59
- apt:
60
- "18.04":
61
- add_sources:
62
- mono_stable:
63
- source_url: "deb https://download.mono-project.com/repo/ubuntu stable-bionic main"
64
- key_id: "3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF"
65
- packages:
66
- - gnupg
67
- - ca-certificates
68
- - mono-devel
@@ -39,7 +39,15 @@ class AethernalAgent::Radarr < AethernalAgent::App
39
39
  {owner: @vars[:user]})
40
40
  end
41
41
  # If we run this within the super we have no systemd scripts yet so we need to do this after everything has been setup except the user.
42
- add_user_to_db
42
+ # We need to start it for the database and migrations to be created
43
+ start
44
+
45
+ if wait_on_port(@vars[:port])
46
+ add_user_to_db
47
+ else
48
+ self.add_errors("Radarr never started up, there is probably a configuration error")
49
+ end
50
+
43
51
  return create_return_args(@vars)
44
52
  end
45
53
 
@@ -49,24 +57,22 @@ class AethernalAgent::Radarr < AethernalAgent::App
49
57
  File.join(home_folder_path(".config/Radarr"), path)
50
58
  end
51
59
 
52
- def add_user_to_db
53
- # We need to start it for the database and migrations to be created
54
- start
55
- # Let's sleep a bit so we have some guarantee that the database has been migrated properly
56
- sleep 120
57
- # Let's stop it so we can mess with the database, not sure this is needed
58
- stop
59
- begin
60
- db = SQLite3::Database.open(home_folder_path(".config/Radarr/nzbdrone.db"))
61
- # Add default user
62
- db.execute "INSERT INTO Users VALUES (1, 'e852a6bb-6812-4e6c-8f99-f8c3c5201594', '#{self.user}', '#{Digest::SHA256.hexdigest(@vars[:password])}');"
63
- rescue SQLite3::Exception => e
64
- raise "Error setting up Radarr: #{e}"
65
- ensure
66
- db.close if db
60
+ def add_user_to_db(tries=0)
61
+ if wait_on_file(home_folder_path(".config/Radarr/radarr.db"))
62
+ # Let's sleep a bit so we have some guarantee that the database has been migrated properly
63
+ sleep 10
64
+ begin
65
+ db = SQLite3::Database.open(home_folder_path(".config/Radarr/radarr.db"))
66
+ # Add default user
67
+ db.execute "INSERT INTO Users VALUES (1, 'e852a6bb-6812-4e6c-8f99-f8c3c5201594', '#{self.user}', '#{Digest::SHA256.hexdigest(@vars[:password])}');"
68
+ rescue SQLite3::Exception => e
69
+ raise "Error setting up Radarr: #{e}"
70
+ ensure
71
+ db.close if db
72
+ end
73
+ else
74
+ self.add_errors("Radarr database was never created, there is probably a configuration error")
67
75
  end
68
-
69
- start
70
76
  end
71
77
 
72
78
  end
@@ -1,6 +1,5 @@
1
- Redirect "/radarr" "/radarr/app"
2
- <Location /radarr/>
3
- ProxyPass http://localhost:<%= @port %>
4
- ProxyPassReverse http://localhost:<%= @port %>
1
+ <Location /radarr>
2
+ ProxyPass http://localhost:<%= @port %>/radarr
3
+ ProxyPassReverse http://localhost:<%= @port %>/radarr
5
4
  Require all granted
6
5
  </Location>
@@ -0,0 +1,59 @@
1
+ name: Resilio sync (Docker)
2
+ script_name: resilio_docker.rb
3
+ version: 0.1
4
+ required_aethernal_agent_version: ">= 0.3.0"
5
+ description: Sync uses peer-to-peer technology to provide fast, private file sharing for teams and individuals
6
+ installation_type: docker_image
7
+ configuration_type: multi_user
8
+ plain_name: resilio_docker
9
+ apache_configuration: resilio_docker.apache.conf.erb
10
+ built_in_updater: false
11
+ icon:
12
+ name: resilio.png
13
+ sha256sum: 5321a37b10ccc3d93f3c08c782252edb619b28f0473fe77f472f4e2703898906
14
+ services:
15
+ - resilio_docker
16
+ actions:
17
+ restart:
18
+ user:
19
+ required: true
20
+ linux_user: true
21
+ configure_app_user:
22
+ puid:
23
+ docker:
24
+ env: PUID
25
+ auto_source: user_id
26
+ required: false
27
+ user:
28
+ required: true
29
+ linux_user: true
30
+ password:
31
+ required: false
32
+ auto_generate: true
33
+ timezone:
34
+ required: false
35
+ value: "Europe/Amsterdam"
36
+ docker:
37
+ env: TZ
38
+ port:
39
+ auto_generate_port: true
40
+ required: false
41
+ docker:
42
+ source: "8888/tcp"
43
+ listen_port:
44
+ auto_generate_port: true
45
+ required: false
46
+ match_host_port: true
47
+ docker:
48
+ source: "$port/tcp"
49
+ data_volume:
50
+ value: "/home/$user/sync-data"
51
+ required: false
52
+ docker:
53
+ volume: "/mnt/sync"
54
+ display_values:
55
+
56
+ estimated_size_mb: 30
57
+ package:
58
+ docker:
59
+ image: "resilio/sync:latest"
@@ -0,0 +1,29 @@
1
+ class AethernalAgent::ResilioDocker < AethernalAgent::App
2
+ def initialize(options = {})
3
+ super(options)
4
+ end
5
+
6
+ def install_packages(options = {})
7
+ super(options)
8
+ end
9
+
10
+ def configure_app_user(options = {})
11
+ install_packages(options)
12
+ super(options) do |opts|
13
+ write_template(template_path('resilio_docker.conf.erb'),
14
+ File.join(opts[:data_volume], ('sync.conf')),
15
+ opts.merge(home: '/mnt/sync'),
16
+ {owner: self.user})
17
+ end
18
+ end
19
+
20
+ def uninstall_packages(options = {})
21
+ super(options)
22
+ end
23
+
24
+ def remove_app_user(options = {})
25
+ uninstall_packages(options)
26
+ super(options)
27
+ end
28
+
29
+ end
@@ -0,0 +1,11 @@
1
+ RewriteEngine on
2
+ RewriteRule ^/resilio_docker$ /gui/ [R]
3
+ RewriteRule ^/resilio_docker/ /gui/ [R]
4
+ RewriteRule ^/gui$ /gui/ [R]
5
+
6
+ <Location /gui/>
7
+ ProxyPass http://127.0.0.1:<%= @port %>/gui/
8
+ ProxyPassReverse http://127.0.0.1:<%= @port %>/gui/
9
+ Order Allow,Deny
10
+ Allow from All
11
+ </Location>
@@ -0,0 +1,38 @@
1
+ {
2
+ "device_name": "Resilio Sync",
3
+ "listening_port" : <%= @listen_port %>, // 0 - randomize port
4
+
5
+ /* storage_path dir contains auxilliary app files
6
+ of no storage_path field: .sync dir created in the directory
7
+ where binary is located.
8
+ otherwise user-defined directory will be used
9
+ */
10
+ "storage_path" : "<%= @home %>",
11
+
12
+ // uncomment next line if you want to set location of pid file
13
+ "pid_file" : "<%= @home %>/btsync.pid",
14
+
15
+
16
+ "check_for_updates" : true,
17
+ "use_upnp" : true, // use UPnP for port mapping
18
+
19
+ /* limits in kB/s
20
+ 0 - no limit
21
+ */
22
+ "download_limit" : 0,
23
+ "upload_limit" : 0,
24
+
25
+ /* directory_root path defines where the WebUI Folder browser starts
26
+ (linux only)
27
+ */
28
+ /* remove "listen" field to disable WebUI
29
+ remove "login" and "password" fields to disable credentials check
30
+ */
31
+ "directory_root" : "<%= @home %>",
32
+ "webui" :
33
+ {
34
+ "listen" : "0.0.0.0:8888",
35
+ "login" : "<%= @user %>",
36
+ "password" : "<%= @password %>"
37
+ }
38
+ }
@@ -0,0 +1,10 @@
1
+ [Unit]
2
+ Description=Resilio docker
3
+ Wants=network-online.target
4
+
5
+ [Service]
6
+ ExecStart=/usr/bin/docker start -a <%= @container_name %>
7
+ ExecStop=/usr/bin/docker stop -t 10 <%= @container_name %>
8
+
9
+ [Install]
10
+ WantedBy=default.target
@@ -0,0 +1,84 @@
1
+ name: Rutorrent (Docker)
2
+ script_name: rutorrent.rb
3
+ version: 0.1
4
+ required_aethernal_agent_version: ">= 0.3.0"
5
+ description: Rutorrent with build-in rTorrent
6
+ installation_type: docker_image
7
+ configuration_type: multi_user
8
+ plain_name: rutorrent
9
+ apache_configuration: rutorrent.apache.conf.erb
10
+ built_in_updater: false
11
+ icon:
12
+ name: rtorrent.png
13
+ sha256sum: 62d331723f582be2d966c9c4c1eeaee8634ba55d13d731cdc711e8ca786bb854
14
+ services:
15
+ - rutorrent
16
+ actions:
17
+ restart:
18
+ user:
19
+ required: true
20
+ linux_user: true
21
+ configure_app_user:
22
+ password:
23
+ required: false
24
+ auto_generate: true
25
+ config_mount:
26
+ value: /home/$user/config/
27
+ required: true
28
+ docker:
29
+ volume: /data
30
+ download_mount:
31
+ value: /home/$user/downloads
32
+ required: true
33
+ docker:
34
+ volume: /downloads
35
+ password_mount:
36
+ value: /home/$user/.config/passwd
37
+ required: true
38
+ docker:
39
+ volume: /passwd
40
+ puid:
41
+ docker:
42
+ env: PUID
43
+ auto_source: user_id
44
+ required: false
45
+ timezone:
46
+ required: false
47
+ value: "Europe/Amsterdam"
48
+ docker:
49
+ env: TZ
50
+ port:
51
+ auto_generate_port: true
52
+ required: false
53
+ docker:
54
+ source: 8080/tcp
55
+ dht_port:
56
+ auto_generate_port: true
57
+ required: false
58
+ docker:
59
+ source: 6881/udp
60
+ xml_rpc_port:
61
+ auto_generate_port: true
62
+ required: false
63
+ docker:
64
+ source: 8000/tcp
65
+ web_dav_port:
66
+ auto_generate_port: true
67
+ required: false
68
+ docker:
69
+ source: 9000/tcp
70
+ connection_port:
71
+ auto_generate_port: true
72
+ required: false
73
+ match_host_port: true
74
+ docker:
75
+ source: $port/tcp
76
+ user:
77
+ required: true
78
+ linux_user: true
79
+ display_values:
80
+
81
+ estimated_size_mb: 80
82
+ package:
83
+ docker:
84
+ image: "crazymax/rtorrent-rutorrent"
@@ -0,0 +1,41 @@
1
+ class AethernalAgent::Rutorrent < AethernalAgent::App
2
+ def initialize(options = {})
3
+ super(options)
4
+ end
5
+
6
+ def install_packages(options = {})
7
+ super(options)
8
+ end
9
+
10
+ def configure_app_user(options = {})
11
+ install_packages(options)
12
+
13
+ super do |opts|
14
+
15
+ # Setup rc for custom port
16
+ conf_path = File.join(opts[:config_mount], "rtorrent/")
17
+ directory(conf_path, owner: self.user)
18
+ write_template(template_path('rtorrent.rc.erb'),
19
+ File.join(conf_path, ".rtorrent.rc"),
20
+ opts,
21
+ {owner: opts[:user]})
22
+
23
+
24
+ # Setup authentication
25
+ directory(opts[:password_mount], owner: @user)
26
+
27
+ ["rpc.htpasswd", "rutorrent.htpasswd", "webdav.htpasswd"].each do |file_name|
28
+ run_command("htpasswd -cbB #{opts[:password_mount]}/#{file_name} #{@user} #{opts[:password]}")
29
+ end
30
+ end
31
+ end
32
+
33
+ def uninstall_packages(options = {})
34
+ super(options)
35
+ end
36
+
37
+ def remove_app_user(options = {})
38
+ uninstall_packages(options)
39
+ super(options)
40
+ end
41
+ end