diff --git a/README.md b/README.md index 25e5b35..9ce3233 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -![qbop logo](https://github.com/clajiness/qbop/blob/main/public/images/apple-touch-icon.png) +![qbop logo](https://github.com/clajiness/qbop/blob/main/public/images/light/apple-touch-icon-light.png) # qbop A tool for maintaining a forwarded port from ProtonVPN, while optionally keeping OPNsense and qBittorrent in sync. The tool offers a simple web UI and API via `http://:4567/`. @@ -8,11 +8,9 @@ qbop is built with Ruby and available as a Docker image. ## Installation I recommend using the provided sample Docker Compose files to simplify the set up of qbop. This container must be routed through ProtonVPN due to the required `natpmpc` dependency. -You can ignore OPNsense and/or qBittorrent by using the `OPN_SKIP` and `QBIT_SKIP` environment variables. +You can ignore OPNsense and/or qBittorrent by using the `OPN_SKIP` and/or `QBIT_SKIP` environment variables. This is handy if you're using a firewall and routing platform like a Unifi gateway or a different BitTorrent client. -The container image is available [here](https://github.com/clajiness/qbop/pkgs/container/qbop). The sample docker-compose.yml file is available [here](https://github.com/clajiness/qbop/blob/main/docker-compose/docker-compose.yml). - -There is also a [community compose directory](https://github.com/clajiness/qbop/blob/main/docker-compose/community/). Feel free to open a pull request to share your own compose files. +The container image is available [here](https://github.com/clajiness/qbop/pkgs/container/qbop). The sample docker-compose.yml file is available [here](https://github.com/clajiness/qbop/blob/main/docker-compose/docker-compose.yml). There is also a [community compose directory](https://github.com/clajiness/qbop/blob/main/docker-compose/community/). Feel free to open a pull request to share your own compose files. ### Requirements * AMD64 or ARM64/v8 architecture - If you need support for a different architecture, file an issue. diff --git a/framework/web.rb b/framework/web.rb index ddc301c..ed4eee8 100644 --- a/framework/web.rb +++ b/framework/web.rb @@ -2,13 +2,15 @@ module Framework # The Web class is a Sinatra application that provides three routes # for displaying statistics, logs, and about information. class Web < Sinatra::Application - get '/' do - helpers = Service::Helpers.new - stats = Stat.as_hash - + before do update = Notification.select(:info, :active).where(name: 'update_available').first @recent_tag = update[:info] @update_available = update[:active] + end + + get '/' do + helpers = Service::Helpers.new + stats = Stat.as_hash @proton_stats = stats[1] @opn_stats = stats[2] @@ -33,10 +35,6 @@ class Web < Sinatra::Application end get '/api-docs' do - update = Notification.select(:info, :active).where(name: 'update_available').first - @recent_tag = update[:info] - @update_available = update[:active] - erb :api_docs end @@ -57,6 +55,7 @@ class Web < Sinatra::Application service = params['select']&.strip&.downcase&.shellescape public_ip = helpers.get_public_ip(service) + @public_ip = "#{service} -> #{public_ip}" erb :tools @@ -65,10 +64,6 @@ class Web < Sinatra::Application get '/logs' do helpers = Service::Helpers.new - update = Notification.select(:info, :active).where(name: 'update_available').first - @recent_tag = update[:info] - @update_available = update[:active] - @log_lines = helpers.env_variables[:log_lines] @output = helpers.log_lines_to_a(@log_lines) @@ -78,10 +73,6 @@ class Web < Sinatra::Application get '/about' do # rubocop:disable Metrics/BlockLength helpers = Service::Helpers.new - update = Notification.select(:info, :active).where(name: 'update_available').first - @recent_tag = update[:info] - @update_available = update[:active] - @app_version = ENV['VERSION'] @schema_version = helpers.get_db_version @ruby_version = "#{RUBY_VERSION} (p#{RUBY_PATCHLEVEL})" diff --git a/public/images/dark/android-chrome-dark-192x192.png b/public/images/dark/android-chrome-dark-192x192.png new file mode 100644 index 0000000..524fa0d Binary files /dev/null and b/public/images/dark/android-chrome-dark-192x192.png differ diff --git a/public/images/dark/android-chrome-dark-512x512.png b/public/images/dark/android-chrome-dark-512x512.png new file mode 100644 index 0000000..bd15b66 Binary files /dev/null and b/public/images/dark/android-chrome-dark-512x512.png differ diff --git a/public/images/dark/apple-touch-icon-dark.png b/public/images/dark/apple-touch-icon-dark.png new file mode 100644 index 0000000..58c813f Binary files /dev/null and b/public/images/dark/apple-touch-icon-dark.png differ diff --git a/public/images/dark/favicon-dark-16x16.png b/public/images/dark/favicon-dark-16x16.png new file mode 100644 index 0000000..cce547a Binary files /dev/null and b/public/images/dark/favicon-dark-16x16.png differ diff --git a/public/images/dark/favicon-dark-32x32.png b/public/images/dark/favicon-dark-32x32.png new file mode 100644 index 0000000..16d1984 Binary files /dev/null and b/public/images/dark/favicon-dark-32x32.png differ diff --git a/public/images/dark/favicon-dark.ico b/public/images/dark/favicon-dark.ico new file mode 100644 index 0000000..7958afc Binary files /dev/null and b/public/images/dark/favicon-dark.ico differ diff --git a/public/images/dark/favicon-dark.svg b/public/images/dark/favicon-dark.svg new file mode 100644 index 0000000..f417f4d --- /dev/null +++ b/public/images/dark/favicon-dark.svg @@ -0,0 +1,25 @@ + + + + + + + + + + + diff --git a/public/images/dark/site.webmanifest b/public/images/dark/site.webmanifest new file mode 100644 index 0000000..6386413 --- /dev/null +++ b/public/images/dark/site.webmanifest @@ -0,0 +1,19 @@ +{ + "name": "", + "short_name": "", + "icons": [ + { + "src": "/android-chrome-dark-192x192.png", + "sizes": "192x192", + "type": "image/png" + }, + { + "src": "/android-chrome-dark-512x512.png", + "sizes": "512x512", + "type": "image/png" + } + ], + "theme_color": "#ffffff", + "background_color": "#ffffff", + "display": "standalone" +} diff --git a/public/images/android-chrome-192x192.png b/public/images/light/android-chrome-light-192x192.png similarity index 100% rename from public/images/android-chrome-192x192.png rename to public/images/light/android-chrome-light-192x192.png diff --git a/public/images/android-chrome-512x512.png b/public/images/light/android-chrome-light-512x512.png similarity index 100% rename from public/images/android-chrome-512x512.png rename to public/images/light/android-chrome-light-512x512.png diff --git a/public/images/apple-touch-icon.png b/public/images/light/apple-touch-icon-light.png similarity index 100% rename from public/images/apple-touch-icon.png rename to public/images/light/apple-touch-icon-light.png diff --git a/public/images/favicon-16x16.png b/public/images/light/favicon-light-16x16.png similarity index 100% rename from public/images/favicon-16x16.png rename to public/images/light/favicon-light-16x16.png diff --git a/public/images/favicon-32x32.png b/public/images/light/favicon-light-32x32.png similarity index 100% rename from public/images/favicon-32x32.png rename to public/images/light/favicon-light-32x32.png diff --git a/public/images/favicon.ico b/public/images/light/favicon-light.ico similarity index 100% rename from public/images/favicon.ico rename to public/images/light/favicon-light.ico diff --git a/public/images/favicon.svg b/public/images/light/favicon-light.svg similarity index 100% rename from public/images/favicon.svg rename to public/images/light/favicon-light.svg diff --git a/public/images/light/site.webmanifest b/public/images/light/site.webmanifest new file mode 100644 index 0000000..139846f --- /dev/null +++ b/public/images/light/site.webmanifest @@ -0,0 +1,19 @@ +{ + "name": "", + "short_name": "", + "icons": [ + { + "src": "/android-chrome-light-192x192.png", + "sizes": "192x192", + "type": "image/png" + }, + { + "src": "/android-chrome-light-512x512.png", + "sizes": "512x512", + "type": "image/png" + } + ], + "theme_color": "#ffffff", + "background_color": "#ffffff", + "display": "standalone" +} diff --git a/public/images/site.webmanifest b/public/images/site.webmanifest deleted file mode 100644 index 1dd9112..0000000 --- a/public/images/site.webmanifest +++ /dev/null @@ -1 +0,0 @@ -{"name":"","short_name":"","icons":[{"src":"/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"} diff --git a/version.yml b/version.yml index 2c3fc41..f6dcb64 100644 --- a/version.yml +++ b/version.yml @@ -1 +1 @@ -v2.5.1 +v2.5.2 diff --git a/views/layout.erb b/views/layout.erb index e014605..314765b 100644 --- a/views/layout.erb +++ b/views/layout.erb @@ -7,16 +7,33 @@ + + <% if Service::Helpers.new.env_variables[:ui_mode] == "light" %> <% else %> <% end %> - - - - - + + + <% if Service::Helpers.new.env_variables[:ui_mode] == "light" %> + + + + + + + + + <% else %> + + + + + + + <% end %> + qbop