Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -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://<host_ip>:4567/`.
Expand All @@ -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.
Expand Down
23 changes: 7 additions & 16 deletions framework/web.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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

Expand All @@ -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
Expand All @@ -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)

Expand All @@ -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})"
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/dark/apple-touch-icon-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/dark/favicon-dark-16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/dark/favicon-dark-32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/dark/favicon-dark.ico
Binary file not shown.
25 changes: 25 additions & 0 deletions public/images/dark/favicon-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions public/images/dark/site.webmanifest
Original file line number Diff line number Diff line change
@@ -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"
}
File renamed without changes.
File renamed without changes
19 changes: 19 additions & 0 deletions public/images/light/site.webmanifest
Original file line number Diff line number Diff line change
@@ -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"
}
1 change: 0 additions & 1 deletion public/images/site.webmanifest

This file was deleted.

2 changes: 1 addition & 1 deletion version.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v2.5.1
v2.5.2
27 changes: 22 additions & 5 deletions views/layout.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,33 @@
<meta name="theme-color" content="#ffffff" />
<meta name="description" content="the qbop ui" />
<link rel="stylesheet" href="https://unpkg.com/terminal.css@0.7.5/dist/terminal.min.css" integrity="sha512-X8PpCFdlyXfQ93O7R/tmLP0uln53P5/hY29faFCjhpfinyggAeQbcwiv8pDvu49vHvZPWJN+yfb4VomHJK6sJA==" crossorigin="anonymous" />

<!-- Theme stylesheets -->
<% if Service::Helpers.new.env_variables[:ui_mode] == "light" %>
<link rel="stylesheet" href="/css/light.css" />
<% else %>
<link rel="stylesheet" href="/css/dark.css" />
<% end %>
<link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon.png" />
<link rel="icon" sizes="32x32" href="/images/favicon-32x32.png" />
<link rel="icon" sizes="16x16" href="/images/favicon-16x16.png" />
<link rel="icon" href="/images/favicon.svg" />
<link rel="manifest" href="/images/site.webmanifest" />

<!-- Light mode favicons -->
<% if Service::Helpers.new.env_variables[:ui_mode] == "light" %>
<link rel="icon" type="image/x-icon" href="/images/light/favicon-light.ico" />
<link rel="apple-touch-icon" sizes="180x180" href="/images/light/apple-touch-icon-light.png" />
<link rel="icon" sizes="32x32" href="/images/light/favicon-light-32x32.png" />
<link rel="icon" sizes="16x16" href="/images/light/favicon-light-16x16.png" />
<link rel="icon" href="/images/light/favicon-light.svg" />
<link rel="manifest" href="/images/light/site.webmanifest" />

<!-- Dark mode favicons -->
<% else %>
<link rel="icon" type="image/x-icon" href="/images/dark/favicon-dark.ico" />
<link rel="apple-touch-icon" sizes="180x180" href="/images/dark/apple-touch-icon-dark.png" />
<link rel="icon" sizes="32x32" href="/images/dark/favicon-dark-32x32.png" />
<link rel="icon" sizes="16x16" href="/images/dark/favicon-dark-16x16.png" />
<link rel="icon" href="/images/dark/favicon-dark.svg" />
<link rel="manifest" href="/images/dark/site.webmanifest" />
<% end %>

<title>qbop</title>
</head>
<body class="terminal">
Expand Down