8 | Date: 01 Aug 2021, (10:35 AM)
9 |
10 | Copyright:
11 | Copyright (C) Josh Sunnex - All Rights Reserved
12 |
13 | Permission is hereby granted, free of charge, to any person obtaining a copy
14 | of this software and associated documentation files (the "Software"), to deal
15 | in the Software without restriction, including without limitation the rights
16 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
17 | copies of the Software, and to permit persons to whom the Software is
18 | furnished to do so, subject to the following conditions:
19 |
20 | The above copyright notice and this permission notice shall be included in all
21 | copies or substantial portions of the Software.
22 |
23 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
26 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
27 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
28 | OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
29 | OR OTHER DEALINGS IN THE SOFTWARE.
30 |
31 | """
32 |
--------------------------------------------------------------------------------
/unmanic/webserver/docs/privacy_policy.md:
--------------------------------------------------------------------------------
1 | Your privacy is important. I, Josh Sunnex, am committed to being transparent and open. This Privacy Policy
2 | explains generally how I receive information about you, and what I do with that information once I have it.
3 |
4 | ## Definition of “personal information”?
5 |
6 | For me, “personal information” means information which identifies you, like your name or email address.
7 |
8 | Any information that falls outside of this is “non-personal information”.
9 |
10 | If I store your personal information with information that is non-personal, I will consider the combination
11 | as personal information. If I remove all personal information from a set of data then the remaining is
12 | non-personal information.
13 |
14 | ## How do I learn information about you?
15 |
16 | I learn information about you when:
17 |
18 | - You give it to me directly (e.g., when you choose to send me logs in the forums)
19 | - I collect it automatically through my software and services (e.g., when your Unmanic installation registers with the Unmanic site, or when your Unmanic installation connects with my servers to download plugins)
20 | - You visit the Unmanic website
21 |
22 | ## What do I do with your information once I have it?
23 |
24 | Generally, I use your information to help me provide and improve my software and services for you (e.g., I
25 | use a log you send me to figure out why Unmanic isn’t working correctly, or I determine how many active
26 | users are using Unmanic and on what platforms it is being used in order to determine how to allocate
27 | resources per platform).
28 |
29 | ## When do I share your information with others?
30 |
31 | The information that you provide me is intended for me alone. The only time I will share this information
32 | with a third party is when I have asked and received your permission to share it.
33 |
34 | ## How do I store and protect your personal information?
35 |
36 | I am committed to protecting your personal information once I have it. All information will be securely
37 | stored using best practices. Despite these efforts, if I learn of a security breach, I’ll notify you so
38 | that you can take appropriate protective steps.
39 |
40 | ## What if I change this privacy policy?
41 |
42 | I may need to change this policy. Updates to the policy will be amended here with a changelog at the
43 | bottom.
44 | If the changes are substantive, I will announce the update through social media channels. Your continued
45 | use of my products or services after the effective date of such changes constitutes your acceptance of such
46 | changes. To make your review more convenient, I will post an effective date at the top of the page.
47 |
48 | ---
49 |
50 |
51 | Effective Date:
52 | 21 March, 2021
53 |
54 |
55 | ---
56 |
57 | ## Changelog
58 |
59 | **21 March, 2021**
60 | - Initial policy
61 |
--------------------------------------------------------------------------------
/unmanic/webserver/helpers/__init__.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | # -*- coding: utf-8 -*-
3 |
4 | """
5 | unmanic.__init__.py
6 |
7 | Written by: Josh.5
8 | Date: 21 Oct 2020, (2:42 PM)
9 |
10 | Copyright:
11 | Copyright (C) Josh Sunnex - All Rights Reserved
12 |
13 | Permission is hereby granted, free of charge, to any person obtaining a copy
14 | of this software and associated documentation files (the "Software"), to deal
15 | in the Software without restriction, including without limitation the rights
16 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
17 | copies of the Software, and to permit persons to whom the Software is
18 | furnished to do so, subject to the following conditions:
19 |
20 | The above copyright notice and this permission notice shall be included in all
21 | copies or substantial portions of the Software.
22 |
23 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
26 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
27 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
28 | OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
29 | OR OTHER DEALINGS IN THE SOFTWARE.
30 |
31 | """
32 |
--------------------------------------------------------------------------------
/unmanic/webserver/helpers/documents.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | # -*- coding: utf-8 -*-
3 |
4 | """
5 | unmanic.documents.py
6 |
7 | Written by: Josh.5
8 | Date: 25 Aug 2021, (2:59 PM)
9 |
10 | Copyright:
11 | Copyright (C) Josh Sunnex - All Rights Reserved
12 |
13 | Permission is hereby granted, free of charge, to any person obtaining a copy
14 | of this software and associated documentation files (the "Software"), to deal
15 | in the Software without restriction, including without limitation the rights
16 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
17 | copies of the Software, and to permit persons to whom the Software is
18 | furnished to do so, subject to the following conditions:
19 |
20 | The above copyright notice and this permission notice shall be included in all
21 | copies or substantial portions of the Software.
22 |
23 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
26 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
27 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
28 | OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
29 | OR OTHER DEALINGS IN THE SOFTWARE.
30 |
31 | """
32 | import os
33 | import zipfile
34 |
35 | from unmanic import config
36 |
37 |
38 | def generate_log_files_zip():
39 | settings = config.Config()
40 |
41 | cache_path = settings.get_cache_path()
42 | logs_path = settings.get_log_path()
43 |
44 | # Ensure the cache path exists
45 | if not os.path.exists(cache_path):
46 | os.makedirs(cache_path)
47 |
48 | # Ensure the logs path exists
49 | if not os.path.exists(logs_path):
50 | os.makedirs(logs_path)
51 |
52 | # Create zip of all log files
53 | out_file = os.path.join(cache_path, 'UnmanicLogs.zip')
54 | with zipfile.ZipFile(out_file, 'w') as zip_object:
55 | # Iterate over all the files in directory
56 | for dir_name, subdirectories, filenames in os.walk(logs_path):
57 | for filename in filenames:
58 | # create complete filepath of file in directory
59 | logfile_path = os.path.join(dir_name, filename)
60 | # Add file to zip
61 | zip_object.write(logfile_path, os.path.basename(logfile_path))
62 |
63 | return out_file
64 |
--------------------------------------------------------------------------------
/unmanic/webserver/main.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | # -*- coding: utf-8 -*-
3 |
4 | """
5 | unmanic.main.py
6 |
7 | Written by: Josh.5
8 | Date: 06 Dec 2018, (7:21 AM)
9 |
10 | Copyright:
11 | Copyright (C) Josh Sunnex - All Rights Reserved
12 |
13 | Permission is hereby granted, free of charge, to any person obtaining a copy
14 | of this software and associated documentation files (the "Software"), to deal
15 | in the Software without restriction, including without limitation the rights
16 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
17 | copies of the Software, and to permit persons to whom the Software is
18 | furnished to do so, subject to the following conditions:
19 |
20 | The above copyright notice and this permission notice shall be included in all
21 | copies or substantial portions of the Software.
22 |
23 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
26 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
27 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
28 | OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
29 | OR OTHER DEALINGS IN THE SOFTWARE.
30 |
31 | """
32 | import tornado.web
33 | import tornado.websocket
34 |
35 | from unmanic.libs import session
36 |
37 |
38 | class MainUIRequestHandler(tornado.web.RequestHandler):
39 | name = None
40 | config = None
41 | session = None
42 | data_queues = None
43 | foreman = None
44 | components = None
45 |
46 | def initialize(self):
47 | self.name = 'main'
48 | self.session = session.Session()
49 |
50 | def get(self, path):
51 | self.set_header("Content-Type", "text/html")
52 | self.render("index.html")
53 |
54 | def handle_ajax_call(self, query):
55 | self.set_header("Content-Type", "application/json")
56 | if query == 'login':
57 | self.session.register_unmanic(force=True)
58 | self.redirect("/unmanic/ui/dashboard/")
59 |
--------------------------------------------------------------------------------
/unmanic/webserver/package-lock.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "unmanic-webui",
3 | "version": "1.0.0",
4 | "lockfileVersion": 2,
5 | "requires": true,
6 | "packages": {
7 | "": {
8 | "name": "unmanic-webui",
9 | "version": "1.0.0",
10 | "license": "GPL-3.0",
11 | "dependencies": {
12 | "vendor-copy": "^3.0.1"
13 | },
14 | "devDependencies": {},
15 | "engines": {
16 | "node": ">=14.17.2",
17 | "npm": ">=6.14.13"
18 | }
19 | },
20 | "node_modules/ncp": {
21 | "version": "2.0.0",
22 | "resolved": "https://registry.npmjs.org/ncp/-/ncp-2.0.0.tgz",
23 | "integrity": "sha1-GVoh1sRuNh0vsSgbo4uR6d9727M=",
24 | "bin": {
25 | "ncp": "bin/ncp"
26 | }
27 | },
28 | "node_modules/vendor-copy": {
29 | "version": "3.0.1",
30 | "resolved": "https://registry.npmjs.org/vendor-copy/-/vendor-copy-3.0.1.tgz",
31 | "integrity": "sha512-XjQ707tDNDVR9HBH2XoDffBB6em2QmWmD52uh8mt+KbFjv94DjDtz/Sh9lXSEWU1POg/fWXnjswe8hW5fqgL+w==",
32 | "dependencies": {
33 | "ncp": "^2.0.0"
34 | },
35 | "bin": {
36 | "vendor-copy": "cli.js"
37 | },
38 | "engines": {
39 | "node": ">=12"
40 | }
41 | }
42 | },
43 | "dependencies": {
44 | "ncp": {
45 | "version": "2.0.0",
46 | "resolved": "https://registry.npmjs.org/ncp/-/ncp-2.0.0.tgz",
47 | "integrity": "sha1-GVoh1sRuNh0vsSgbo4uR6d9727M="
48 | },
49 | "vendor-copy": {
50 | "version": "3.0.1",
51 | "resolved": "https://registry.npmjs.org/vendor-copy/-/vendor-copy-3.0.1.tgz",
52 | "integrity": "sha512-XjQ707tDNDVR9HBH2XoDffBB6em2QmWmD52uh8mt+KbFjv94DjDtz/Sh9lXSEWU1POg/fWXnjswe8hW5fqgL+w==",
53 | "requires": {
54 | "ncp": "^2.0.0"
55 | }
56 | }
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/unmanic/webserver/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "unmanic-webui",
3 | "version": "1.0.0",
4 | "private": true,
5 | "description": "Unmanic webui.",
6 | "author": "Josh.5",
7 | "license": "GPL-3.0",
8 | "repository": {
9 | "type": "git",
10 | "url": "git+https://github.com/Unmanic/unmanic.git"
11 | },
12 | "bugs": {
13 | "url": "https://github.com/Unmanic/unmanic/issues"
14 | },
15 | "homepage": "https://unmanic.app",
16 | "engines": {
17 | "node": ">=14.17.2",
18 | "npm": ">=6.14.13"
19 | },
20 | "scripts": {
21 | "build": "npm --prefix frontend run build && vendor-copy",
22 | "clean": "rimraf public"
23 | },
24 | "keywords": [
25 | ],
26 | "dependencies": {
27 | "vendor-copy": "^3.0.1"
28 | },
29 | "devDependencies": {
30 | },
31 | "vendorCopy": [
32 | {
33 | "from": "frontend/dist/spa",
34 | "to": "public"
35 | }
36 | ]
37 | }
38 |
--------------------------------------------------------------------------------
/unmanic/webserver/templates/global/insufficient-permissions.html:
--------------------------------------------------------------------------------
1 |
49 |
--------------------------------------------------------------------------------
/unmanic/webserver/templates/global/login-popup.html:
--------------------------------------------------------------------------------
1 |
48 |
--------------------------------------------------------------------------------
/unmanic/webserver/templates/global/support-future-development.html:
--------------------------------------------------------------------------------
1 |
49 |
--------------------------------------------------------------------------------