Skip to content

Commit 9fb6d26

Browse files
authored
Merge pull request #70 from clajiness/fix-missing-update-notification-in-tools-view
Fix missing update notification in tools view
2 parents 2d4c3fe + 4778085 commit 9fb6d26

21 files changed

+96
-28
lines changed

README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
![qbop logo](https://github.com/clajiness/qbop/blob/main/public/images/apple-touch-icon.png)
1+
![qbop logo](https://github.com/clajiness/qbop/blob/main/public/images/light/apple-touch-icon-light.png)
22

33
# qbop
44
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://<host_ip>:4567/`.
@@ -8,11 +8,9 @@ qbop is built with Ruby and available as a Docker image.
88
## Installation
99
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.
1010

11-
You can ignore OPNsense and/or qBittorrent by using the `OPN_SKIP` and `QBIT_SKIP` environment variables.
11+
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.
1212

13-
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).
14-
15-
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.
13+
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.
1614

1715
### Requirements
1816
* AMD64 or ARM64/v8 architecture - If you need support for a different architecture, file an issue.

framework/web.rb

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@ module Framework
22
# The Web class is a Sinatra application that provides three routes
33
# for displaying statistics, logs, and about information.
44
class Web < Sinatra::Application
5-
get '/' do
6-
helpers = Service::Helpers.new
7-
stats = Stat.as_hash
8-
5+
before do
96
update = Notification.select(:info, :active).where(name: 'update_available').first
107
@recent_tag = update[:info]
118
@update_available = update[:active]
9+
end
10+
11+
get '/' do
12+
helpers = Service::Helpers.new
13+
stats = Stat.as_hash
1214

1315
@proton_stats = stats[1]
1416
@opn_stats = stats[2]
@@ -33,10 +35,6 @@ class Web < Sinatra::Application
3335
end
3436

3537
get '/api-docs' do
36-
update = Notification.select(:info, :active).where(name: 'update_available').first
37-
@recent_tag = update[:info]
38-
@update_available = update[:active]
39-
4038
erb :api_docs
4139
end
4240

@@ -57,6 +55,7 @@ class Web < Sinatra::Application
5755

5856
service = params['select']&.strip&.downcase&.shellescape
5957
public_ip = helpers.get_public_ip(service)
58+
6059
@public_ip = "#{service} -> #{public_ip}"
6160

6261
erb :tools
@@ -65,10 +64,6 @@ class Web < Sinatra::Application
6564
get '/logs' do
6665
helpers = Service::Helpers.new
6766

68-
update = Notification.select(:info, :active).where(name: 'update_available').first
69-
@recent_tag = update[:info]
70-
@update_available = update[:active]
71-
7267
@log_lines = helpers.env_variables[:log_lines]
7368
@output = helpers.log_lines_to_a(@log_lines)
7469

@@ -78,10 +73,6 @@ class Web < Sinatra::Application
7873
get '/about' do # rubocop:disable Metrics/BlockLength
7974
helpers = Service::Helpers.new
8075

81-
update = Notification.select(:info, :active).where(name: 'update_available').first
82-
@recent_tag = update[:info]
83-
@update_available = update[:active]
84-
8576
@app_version = ENV['VERSION']
8677
@schema_version = helpers.get_db_version
8778
@ruby_version = "#{RUBY_VERSION} (p#{RUBY_PATCHLEVEL})"
4.19 KB
Loading
14.4 KB
Loading
4.02 KB
Loading
301 Bytes
Loading
511 Bytes
Loading
15 KB
Binary file not shown.
Lines changed: 25 additions & 0 deletions
Loading
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"name": "",
3+
"short_name": "",
4+
"icons": [
5+
{
6+
"src": "/android-chrome-dark-192x192.png",
7+
"sizes": "192x192",
8+
"type": "image/png"
9+
},
10+
{
11+
"src": "/android-chrome-dark-512x512.png",
12+
"sizes": "512x512",
13+
"type": "image/png"
14+
}
15+
],
16+
"theme_color": "#ffffff",
17+
"background_color": "#ffffff",
18+
"display": "standalone"
19+
}

0 commit comments

Comments
 (0)