diff --git a/.gitignore b/.gitignore index c7c1095..cbb1f5b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,5 @@ *.db *.pyc -client_secrets.json -webfm_config.json app.pid diff --git a/README.md b/README.md index a10bdb6..932df05 100644 --- a/README.md +++ b/README.md @@ -3,11 +3,13 @@ WebFM is a media and file viewer aspiring to become a full fledged file manager # Usage 1. Install python, sqlite3, and ffmpeg on the system this will be on. -3. Use ufw or gufw to open the port on your computer to the network. -4. Place files or start uploading some to the folders. -5. Place an image such as a jpg, png, or gif labeled "000.itsExtension" in a directory and the viewer will use it as the background image for that folder/directory. -9. Password protect folder based on core/webfm_config.json file settings. -10. Save paths to favorites list for quick access. +3. Use ufw or gufw to open the port on your computer to the local network. +4. Use hosts file (or other methods) to redirect webfm.com and ssoapps.com to local app. +5. Update client_secrets.json > 'client_secret' field with your Keycloak key. (Current one is local to me and not public) +6. Place files or start uploading some to the folders. +7. Place an image such as a jpg, png, or gif labeled "000.itsExtension" in a directory and the viewer will use it as the background image for that folder/directory. +7. Password protect folder based on core/utils/shellfm/windows/webfm_config.json file settings. +8. Save paths to favorites list for quick access. Notes: n/a diff --git a/src/core/client_secrets.json b/src/core/client_secrets.json index e277903..591590c 100644 --- a/src/core/client_secrets.json +++ b/src/core/client_secrets.json @@ -3,10 +3,10 @@ "auth_uri": "https://www.ssoapps.com/auth/realms/apps/protocol/openid-connect/auth", "client_id": "apps", "issuer": "https://www.ssoapps.com/auth/realms/apps", - "client_secret": "[Add your secret key here]", + "client_secret": "ce6fdb7d-fdcb-46ea-bc80-b5df9649d50b", "redirect_uris": [ - "http://www.webfm.com/home", - "https://www.webfm.com/home" + "https://www.webfm.com/home", + "http://www.webfm.com/home" ], "userinfo_uri": "https://www.ssoapps.com/auth/realms/apps/protocol/openid-connect/userinfo", "token_uri": "https://www.ssoapps.com/auth/realms/apps/protocol/openid-connect/token", diff --git a/src/core/config.py b/src/core/config.py index 429ab0c..745ffb7 100644 --- a/src/core/config.py +++ b/src/core/config.py @@ -1,5 +1,5 @@ # System import -import os, secrets, json +import os, secrets from datetime import timedelta @@ -12,19 +12,9 @@ from datetime import timedelta APP_NAME = 'WebFM' # Configs ROOT_FILE_PTH = os.path.dirname(os.path.realpath(__file__)) -CONFIG_FILE = ROOT_FILE_PTH + "/webfm_config.json" # This path is submitted as the redirect URI in certain code flows. REDIRECT_LINK = "https%3A%2F%2Fwww.webfm.com%2F" -# Settings data -def retrieveSettings(): - returnData = [] - with open(CONFIG_FILE) as infile: - try: - return json.load(infile) - except Exception as e: - print(repr(e)) - return ['', 'mplayer', 'xdg-open'] @@ -50,10 +40,14 @@ class Config(object): 'https://localhost:443/auth/realms/apps' ] - WEBFM_CONFIG = retrieveSettings() STATIC_FPTH = ROOT_FILE_PTH + "/static" - REMUX_FOLDER = STATIC_FPTH + "/remuxs" - FFMPG_THUMBNLR = STATIC_FPTH + "/ffmpegthumbnailer" + REMUX_FOLDER = STATIC_FPTH + "/remuxs" # Remuxed files folder + FFMPG_THUMBNLR = STATIC_FPTH + "/ffmpegthumbnailer" # Thumbnail generator binary + + ABS_THUMBS_PTH = STATIC_FPTH + "/imgs/thumbnails" # Used for thumbnail generation + REL_THUMBS_PTH = "static/imgs/thumbnails" # Used for flask thumbnail return + + class ProductionConfig(Config): diff --git a/src/core/routes/Routes.py b/src/core/routes/Routes.py index 6a5211e..115efe7 100644 --- a/src/core/routes/Routes.py +++ b/src/core/routes/Routes.py @@ -30,7 +30,7 @@ def home(): if request.method == 'GET': view = get_window_controller().get_window(1).get_view(0) _path = view.get_path() - _files = view.get_files() + _files = view.get_files_formatted() return render_template('pages/index.html', path=_path, files=_files) return render_template('error.html', diff --git a/src/core/static/css/main.css b/src/core/static/css/main.css index ba98841..d854fc0 100644 --- a/src/core/static/css/main.css +++ b/src/core/static/css/main.css @@ -5,6 +5,7 @@ width: 100%; height: 100%; z-index: -999; + object-fit: cover; } #bg img { @@ -19,7 +20,7 @@ } #master-container { - height: 85vh; + height: 90vh; overflow-x: hidden; overflow-y: auto; } @@ -47,9 +48,9 @@ .dir-style, .video-style, .image-style, .file-style { - height: auto; - width: 24vw; - position: relative; + /* max-width: 24vw; */ + /* height: auto; + position: relative; */ max-width: 20em; } diff --git a/src/core/templates/body-header.html b/src/core/templates/body-header.html index 3591f7d..3766a30 100644 --- a/src/core/templates/body-header.html +++ b/src/core/templates/body-header.html @@ -11,8 +11,8 @@