Skip to content
Open
Show file tree
Hide file tree
Changes from 114 commits
Commits
Show all changes
131 commits
Select commit Hold shift + click to select a range
e15d8ab
ui
NamSupawan Jan 31, 2025
45b09fb
vpn
NamSupawan Jan 31, 2025
419670f
template
NamSupawan Jan 31, 2025
85a18af
wg
NamSupawan Jan 31, 2025
5cb4312
vpn
NamSupawan Feb 1, 2025
139eeb8
vpn
NamSupawan Feb 1, 2025
b67b885
vpn
NamSupawan Feb 1, 2025
6bd89bc
vpn
NamSupawan Feb 1, 2025
d6a23a8
redirect
NamSupawan Feb 1, 2025
ccda009
btn
NamSupawan Feb 1, 2025
17fe598
vpn
NamSupawan Feb 1, 2025
0abb10c
btn
NamSupawan Feb 1, 2025
3ba48aa
wg
NamSupawan Feb 1, 2025
398d35c
fix error
NamSupawan Feb 1, 2025
c0daa11
fix error
NamSupawan Feb 1, 2025
58bbd9a
param
NamSupawan Feb 1, 2025
106a8e2
vpn
NamSupawan Feb 1, 2025
117750e
vpn users
NamSupawan Feb 1, 2025
3c1a54a
vpn users
NamSupawan Feb 1, 2025
756c879
vpn users-error
NamSupawan Feb 1, 2025
8aadf48
fix error
NamSupawan Feb 1, 2025
0200d14
vpnddd
NamSupawan Feb 1, 2025
d224200
method
NamSupawan Feb 1, 2025
d5e0e68
fix
NamSupawan Feb 1, 2025
6ad2488
open
NamSupawan Feb 1, 2025
d43a413
open
NamSupawan Feb 1, 2025
fd9ddbf
open
NamSupawan Feb 1, 2025
29b32f2
open
NamSupawan Feb 1, 2025
04ba672
open
NamSupawan Feb 1, 2025
1be8dea
open
NamSupawan Feb 1, 2025
49e64d2
open
NamSupawan Feb 1, 2025
be1341d
open
NamSupawan Feb 1, 2025
d271308
rem
NamSupawan Feb 1, 2025
3fc5cbf
open
NamSupawan Feb 2, 2025
557b7fe
firewall
NamSupawan Feb 2, 2025
6fcb2df
show
NamSupawan Feb 2, 2025
13a2c66
firewall
NamSupawan Feb 2, 2025
4171444
show
NamSupawan Feb 2, 2025
4fe5789
firewall
NamSupawan Feb 2, 2025
14b38a7
firewall
NamSupawan Feb 2, 2025
adb558f
firewall
NamSupawan Feb 2, 2025
e7d4621
firewall
NamSupawan Feb 2, 2025
2f68573
firewall
NamSupawan Feb 2, 2025
a9a6f44
firewall_params
NamSupawan Feb 2, 2025
c75325e
firewall_params
NamSupawan Feb 2, 2025
e560124
firewall_params
NamSupawan Feb 2, 2025
fefaad4
fix error
NamSupawan Feb 2, 2025
c118881
fix error
NamSupawan Feb 2, 2025
b7f6ef5
fix error
NamSupawan Feb 2, 2025
8ef73de
fix error
NamSupawan Feb 2, 2025
9d73f20
fix error
NamSupawan Feb 2, 2025
f05883d
fix error
NamSupawan Feb 2, 2025
d610bf3
fix error
NamSupawan Feb 2, 2025
99db980
fix error
NamSupawan Feb 2, 2025
6b4c7a9
fix error
NamSupawan Feb 2, 2025
6dab87c
fix error
NamSupawan Feb 2, 2025
d57ad56
fix error
NamSupawan Feb 2, 2025
b9d0920
fix error
NamSupawan Feb 2, 2025
5f0e25d
fix error
NamSupawan Feb 2, 2025
27905e0
fix error
NamSupawan Feb 2, 2025
409c8fe
fix error
NamSupawan Feb 2, 2025
7496f9e
fix error
NamSupawan Feb 2, 2025
ee79cbb
fix error
NamSupawan Feb 2, 2025
4b88825
fix error
NamSupawan Feb 2, 2025
5b12384
fix error
NamSupawan Feb 2, 2025
08297f5
fix error
NamSupawan Feb 2, 2025
c4bc830
fix error
NamSupawan Feb 2, 2025
871b5f3
fix error
NamSupawan Feb 2, 2025
8312bb7
fix error
NamSupawan Feb 2, 2025
e042bc8
html
NamSupawan Feb 2, 2025
e409a58
html
NamSupawan Feb 2, 2025
27f9f1a
html
NamSupawan Feb 2, 2025
a18f390
html
NamSupawan Feb 2, 2025
92ffba4
htmld
NamSupawan Feb 2, 2025
cfea219
firewall
NamSupawan Feb 2, 2025
6809887
url path
NamSupawan Feb 2, 2025
9165ec9
url path
NamSupawan Feb 2, 2025
0f59315
url path
NamSupawan Feb 2, 2025
aad34c1
url path
NamSupawan Feb 2, 2025
d4e287e
url path
NamSupawan Feb 2, 2025
27e7d59
url path
NamSupawan Feb 2, 2025
6e1dcb1
url path
NamSupawan Feb 2, 2025
cf5c7ce
url path
NamSupawan Feb 2, 2025
8b5e5fe
url path
NamSupawan Feb 2, 2025
5e431d2
url path
NamSupawan Feb 2, 2025
bc9552f
url path
NamSupawan Feb 2, 2025
2a602ba
url path
NamSupawan Feb 2, 2025
607d11b
url path
NamSupawan Feb 2, 2025
bb6669a
url path
NamSupawan Feb 2, 2025
cdea5af
url path
NamSupawan Feb 2, 2025
b7c7de1
url path
NamSupawan Feb 2, 2025
dbeaac0
url path
NamSupawan Feb 2, 2025
f7782b7
url path
NamSupawan Feb 2, 2025
4fe4f15
url path
NamSupawan Feb 2, 2025
fcfe0a5
url path
NamSupawan Feb 2, 2025
c5728e3
url path
NamSupawan Feb 2, 2025
2afe32e
url path
NamSupawan Feb 2, 2025
ea12a5f
url path
NamSupawan Feb 2, 2025
6d72fe1
url path
NamSupawan Feb 2, 2025
7967bb9
url path
NamSupawan Feb 2, 2025
7082eba
url path
NamSupawan Feb 2, 2025
1ff06fc
url path
NamSupawan Feb 2, 2025
1a97433
url path
NamSupawan Feb 2, 2025
d70d5ea
url path
NamSupawan Feb 2, 2025
9a765fe
url path
NamSupawan Feb 2, 2025
c5d264c
url path
NamSupawan Feb 2, 2025
68b5bfc
url path
NamSupawan Feb 2, 2025
207d888
url path
NamSupawan Feb 3, 2025
b2f965d
peer
NamSupawan Feb 3, 2025
8394d82
peer
NamSupawan Feb 4, 2025
8edbbf1
required field
NamSupawan Feb 4, 2025
e648988
ip Address
NamSupawan Feb 4, 2025
268d6ca
ip Address
NamSupawan Feb 4, 2025
74dc12e
ip Address
NamSupawan Feb 5, 2025
8bd03e0
test
NamSupawan Feb 6, 2025
eea234b
config
NamSupawan Feb 6, 2025
a5d82c1
add
NamSupawan Jun 6, 2025
486af41
1
NamSupawan Jun 6, 2025
dff208d
vpn devices
NamSupawan Jun 6, 2025
f93314a
vpn
NamSupawan Jun 6, 2025
5493aea
userId
NamSupawan Jun 6, 2025
d1774e6
path
NamSupawan Jun 6, 2025
0aa6aa6
devices
NamSupawan Jun 6, 2025
c0c7509
create
NamSupawan Jun 6, 2025
b713825
controller
NamSupawan Jun 6, 2025
9420fb5
check
NamSupawan Jun 6, 2025
6c4b307
routes
NamSupawan Jun 6, 2025
a9becb7
Prod-drift snapshot 2026-05-13: live state from product-wireguard-vpn
pachara-flow May 13, 2026
5dac7db
Merge pull request #12 from flowaccount/prod-drift-2026-05
pachara-flow May 13, 2026
0d53db4
Hot-reload WireGuard on peer changes, race-safe IP allocation (#11)
pachara-flow May 14, 2026
e5ccf3c
Fix wg syncconf failing on new signups (stderr poisoning + 0644 perms…
pachara-flow May 25, 2026
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
12 changes: 11 additions & 1 deletion app/controllers/admin_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,20 @@ def users
end
end

def update_users_admin
if current_user.admin?
@user = User.find(params[:id])
@user.admin = !@user.admin
@user.save!
else
redirect_to root_path, alert: 'You are not authorized to access this page.'
end
end

def vpn_configurations
if current_user.admin?
@vpn_configuration = VpnConfiguration.get_vpn_configuration

@all_vpn_configuration = VpnConfiguration.all
else
redirect_to root_path, alert: 'You are not authorized to access this page.'
end
Expand Down
89 changes: 89 additions & 0 deletions app/controllers/firewalls_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@


class FirewallsController < ApplicationController
before_action :require_login
# before_action :get_iptables_rules, only: %i[show edit update destroy]
# before_action :set_vpn_configuration, only: %i[ show update edit ]
layout 'admin'

def index
@firewall = Firewall.new
end

def rules
@iptables_output = get_iptables_rules
end

def new
@firewall = Firewall.new
end

# Handle form submission
def create
@firewall = Firewall.new(firewall_params)
#@firewall.name = @rule_name
if @firewall.name.blank? || @firewall.name.nil? || @firewall.ipAddress.nil?
render json: @firewall, status: :ok
else
name = @firewall.name
ip = @firewall.ipAddress
command = "sudo ipset add #{name} #{ip}"
output, status = Open3.capture2e(command)

if status.success?
Open3.capture2e("sudo iptables-save > /etc/iptables/rules.v4")
Open3.capture2e("sudo systemctl restart iptables")
flash[:notice] = "Add Allowed IP Address: #{@firewall.name}"
render plain: "Success Add Allowed IP", status: :ok
else
render :index, alert: "Failed to create WireGuard interface:\n#{output}"
end
end
end

def update_display_rules
rules_name = params[:rules_name]

if rules_name
@allowed_ips_output = get_allowed_ip_addresses(rules_name)
@firewall = Firewall.new
@firewall.name = rules_name
@rule_name = rules_name
# Handle active status logic here
render :index
else
# Handle inactive status logic here
render plain: "Failed to update firewall", status: :unprocessable_entity
end
end

private

def firewall_params
params.require(:firewall).permit(:name, :ipAddress)
end

def get_allowed_ip_addresses(name)
command = "sudo ipset list #{name} | awk 'NR > 7 { print $1 }'"

output, status = Open3.capture2e(command)

Check failure

Code scanning / CodeQL

Uncontrolled command line Critical

This command depends on a
user-provided value
.

Copilot Autofix

AI over 1 year ago

To fix the problem, we need to ensure that user input is not directly used to construct shell commands. Instead, we should validate and sanitize the input to ensure it is safe. One way to do this is to use a whitelist of allowed values or to escape the input properly. In this case, we can use a whitelist approach to ensure that only valid rules_name values are used.

  1. Create a whitelist of allowed rules_name values.
  2. Check if the rules_name provided by the user is in the whitelist.
  3. If it is, proceed with the command execution; otherwise, handle the error appropriately.
Suggested changeset 1
app/controllers/firewalls_controller.rb

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/app/controllers/firewalls_controller.rb b/app/controllers/firewalls_controller.rb
--- a/app/controllers/firewalls_controller.rb
+++ b/app/controllers/firewalls_controller.rb
@@ -45,4 +45,5 @@
     rules_name = params[:rules_name]
+    allowed_rules_names = ["allowed_rule1", "allowed_rule2"] # Example whitelist
     
-    if rules_name
+    if rules_name && allowed_rules_names.include?(rules_name)
       @allowed_ips_output = get_allowed_ip_addresses(rules_name)
EOF
@@ -45,4 +45,5 @@
rules_name = params[:rules_name]
allowed_rules_names = ["allowed_rule1", "allowed_rule2"] # Example whitelist

if rules_name
if rules_name && allowed_rules_names.include?(rules_name)
@allowed_ips_output = get_allowed_ip_addresses(rules_name)
Copilot is powered by AI and may make mistakes. Always verify output.

if status.success?
output # Return iptables output
else
"Error fetching iptables rules: #{stderr}" # Handle errors
end
end

def get_iptables_rules
command = "sudo iptables -L -n -v --line-number"

output, status = Open3.capture2e(command)

if status.success?
output # Return iptables output
else
"Error fetching iptables rules: #{stderr}" # Handle errors
end
end
end
3 changes: 1 addition & 2 deletions app/controllers/vpn_devices_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ def new
# POST /vpn_devices or /vpn_devices.json
def create
config_file = params[:config_file]
output, status = Open3.capture2e("sudo wg-quick up #{config_file}")

output, status = Open3.capture2e("sudo wg-quick up #{config_file}")
Comment thread Fixed

Check failure

Code scanning / CodeQL

Uncontrolled command line Critical

This command depends on a
user-provided value
.

Copilot Autofix

AI 21 days ago

Use a non-shell invocation and strict input validation/allowlisting before execution.

Best fix here (without changing intended functionality):

  1. Validate config_file against a conservative allowlist (e.g., only letters, numbers, _, -, ., and /) and reject unsafe values.
  2. Invoke Open3.capture2e with argument separation ("sudo", "wg-quick", "up", config_file) instead of a single interpolated string, so the shell is not used.
  3. Keep existing redirect behavior, adding an early return for invalid input.

Edit region: app/controllers/vpn_devices_controller.rb, inside def create (lines shown 107–115).

No new imports or dependencies are required (Open3 is already used in this file/snippet context).

Suggested changeset 1
app/controllers/vpn_devices_controller.rb

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/app/controllers/vpn_devices_controller.rb b/app/controllers/vpn_devices_controller.rb
--- a/app/controllers/vpn_devices_controller.rb
+++ b/app/controllers/vpn_devices_controller.rb
@@ -105,8 +105,14 @@
 
   # POST /vpn_devices or /vpn_devices.json
   def create
-    config_file = params[:config_file]
-    output, status = Open3.capture2e("sudo wg-quick up #{config_file}")   
+    config_file = params[:config_file].to_s
+
+    unless config_file.match?(/\A[\w.\-\/]+\z/)
+      redirect_to new_vpn_device_path, alert: 'Invalid configuration file name.'
+      return
+    end
+
+    output, status = Open3.capture2e('sudo', 'wg-quick', 'up', config_file)
     if status.success?
       redirect_to vpn_devices_path, notice: 'WireGuard interface created successfully.'
     else
EOF
@@ -105,8 +105,14 @@

# POST /vpn_devices or /vpn_devices.json
def create
config_file = params[:config_file]
output, status = Open3.capture2e("sudo wg-quick up #{config_file}")
config_file = params[:config_file].to_s

unless config_file.match?(/\A[\w.\-\/]+\z/)
redirect_to new_vpn_device_path, alert: 'Invalid configuration file name.'
return
end

output, status = Open3.capture2e('sudo', 'wg-quick', 'up', config_file)
if status.success?
redirect_to vpn_devices_path, notice: 'WireGuard interface created successfully.'
else
Copilot is powered by AI and may make mistakes. Always verify output.
if status.success?
redirect_to vpn_devices_path, notice: 'WireGuard interface created successfully.'
else
Expand Down
9 changes: 9 additions & 0 deletions app/models/firewall.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# app/models/firewall.rb
class Firewall
include ActiveModel::Model
# model code
attr_accessor :name, :ipAddress


end

14 changes: 11 additions & 3 deletions app/views/admin/users.html.erb
Original file line number Diff line number Diff line change
@@ -1,20 +1,28 @@
<table class="table table-striped">
<thead>
<tr>
<th>Row</th>
<th>Name</th>
<th>Email</th>
<th>Admin</th>
</tr>
</thead>
<tbody>
<% @users.each do |user| %>
<% @users.each_with_index do |user , index| %>
<tr>
<td><%= index+1 %></td>
<td><%= user.name %></td>
<td><%= user.email %></td>
<td>
<div class="form-check">
<input class="form-check-input" type="checkbox" <%= 'checked' if user.admin? %>
<%= 'disabled' if current_user == user %>>

<%= form_with url: update_users_admin_path(user), method: :patch, remote: false do |form| %>
<%= form.check_box :active, {
onchange: 'this.form.submit();',
disabled: current_user == user,
checked: user.admin
} %>
<% end %>
</div>
</div>
</td>
Expand Down
8 changes: 8 additions & 0 deletions app/views/admin/vpn_configurations.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@
<div style="color: red">You will be required to re-configure all client devices on update, please be careful,
don't do it if you don't understand
</div>

<% @all_vpn_configuration.each do |config| %>
<tr>
<td><%= config.wg_ip_address %></td>
<td><%= config.wg_interface_name %></td>
</tr>
<% end %>

<hr>

<%= form_with model: @vpn_configuration, url: update_vpn_configuration_path(@vpn_configuration), local: true, html: { class: "form-horizontal" } do |form| %>
Expand Down
32 changes: 32 additions & 0 deletions app/views/firewalls/index.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<h2>Rules Access</h2>

<%= turbo_frame_tag "status_display" do %>
<span>Select Name List:
<%= form_with url: update_display_rules_path, method: :patch, remote: false do %>
<%= select_tag :rules_name, options_for_select(["allowed_remotes", "allowed_remotes_crm"], selected: nil),{ onchange: "this.form.submit();", prompt: "Please select rule name" } %>
<% end %>
</span>

<br/>
<span>Rules Name: <%= raw @rule_name%></span>
<br/>
<span>Allowed IPs: <%= raw @allowed_ips_output%></span>
<% end %>

<br/><br/>

<%= form_for @firewall , method: :post do |f| %>
<div>
<%= f.label :name, "Name Rule" %>
<%= f.text_field :name %>
</div>
<br/>
<div>
<%= f.label :ipAddress, "IP Allow" %>
<%= f.text_field :ipAddress %>
</div>
<br/>
<div>
<%= f.submit "Submit", class: "btn btn-primary" %>
</div>
<% end %>
3 changes: 3 additions & 0 deletions app/views/shared/_navbar.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
<li class="nav-item">
<a class="nav-link" href="/admin/vpn_configurations">Configuration</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/firewall/rules">IP</a>
</li>
<% end %>
<li class="nav-item">
<a class="nav-link" href="/logout">Logout</a>
Expand Down
22 changes: 14 additions & 8 deletions app/views/vpn_devices/_vpn_device.html.erb
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
<table class="table table-striped table-hover">
<thead class="table-light">
<tr>
<th>User</th>
<th>VPN Device</th>
<th colspan="2"></th>
<th>Row</th>
<th>User ID</th>
<th>User</th>
<th>Device IP</th>
<th>Device description</th>
<th colspan="2"></th>
</tr>
</thead>

<tbody>
<% @vpn_devices.each do |vpn_device| %>
<% @vpn_devices.each_with_index do |vpn_device,index| %>
<tr>
<td><%= vpn_device.user.name %></td>
<td><%= link_to vpn_device.description, vpn_device %></td>

<td><%= link_to 'Destroy', vpn_device, method: :delete, data: { confirm: 'Are you sure?' }, class: 'btn btn-danger btn-sm' %></td>
<td><%= index+1 %></td>
<td><%= vpn_device.user.id %></td>
<td><%= vpn_device.user.name %></td>
<td><%= vpn_device.ip_allocation.ip_address %></td>
<td><%= vpn_device.description %></td>
<td><%= link_to 'Remove Device', vpn_device, data: { turbo_method: :delete, turbo_confirm: 'Are you sure?' }, class: 'btn btn-danger btn-sm' %></td>
<td><%= link_to 'Show Device', vpn_device, data: { turbo_method: :get }, class: 'btn btn-primary btn-sm' %></td>
</tr>
<% end %>
</tbody>
Expand Down
17 changes: 5 additions & 12 deletions app/views/vpn_devices/_vpn_devices.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<%= form_with model: vpn_device do |form| %>
<div class="row">
<div class="col-md-3">
<%= form.text_field :description, id: "description", class: "form-control", placeholder: "Device Description" %>
<%= form.text_field :description, id: "description", class: "form-control", placeholder: "Device Description" , required: true %>
</div>

<div class="col-md-3">
Expand All @@ -31,11 +31,12 @@
</div>
</div>
<% end %>
<br/>
<% end %>
<% end %>

<% if vpn_devices_require_updates.count == 0 %>
<%= link_to 'Add a VPN Device', new_vpn_device_path, class: 'btn btn-primary btn-sm' %>
<% if vpn_devices.count == 0 && vpn_devices_require_updates.count == 0 %>
<%= button_tag "Add a VPN Device", onclick: "window.location.href='#{new_vpn_device_path}'", class: "btn btn-primary btn-sm" %>
<% end %>
<br>
<br>
Expand Down Expand Up @@ -93,15 +94,7 @@
<h6 class="card-title"> <%= vpn_device.ip_allocation.ip_address %></h6>
</div>
</div>
<div class="row">
<div class="col-sm-4">
<h6 class="card-title">Accessible remote networks</h6>
</div>
<div class="col-sm-8">
<td></td>
<h6 class="card-title"> <%= @vpn_configuration.network_addresses.map(&:network_address).join(", ") %></h6>
</div>
</div>

<br/>

<%= link_to 'Download Configuration', download_config_path(vpn_device.id), class: 'btn btn-primary btn-sm' %>
Expand Down
9 changes: 7 additions & 2 deletions app/views/vpn_devices/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,23 @@
<table class="table table-striped table-hover">
<thead class="table-light">
<tr>
<th>Row</th>
<th>User ID</th>
<th>User</th>
<th>Device IP</th>
<th>Device description</th>
<th colspan="2"></th>
</tr>
</thead>

<tbody>
<% @vpn_devices.each do |vpn_device| %>
<% @vpn_devices.each_with_index do |vpn_device,index| %>
<tr>
<td><%= index+1 %></td>
<td><%= vpn_device.user.id %></td>
<td><%= vpn_device.user.name %></td>
<td><%= vpn_device.ip_allocation.ip_address %></td>
<td><%= vpn_device.description %></td>

<td><%= link_to 'Remove Device', vpn_device, data: { turbo_method: :delete, turbo_confirm: 'Are you sure?' }, class: 'btn btn-danger btn-sm' %></td>
<td><%= link_to 'Show Device', vpn_device, data: { turbo_method: :get }, class: 'btn btn-primary btn-sm' %></td>
</tr>
Expand Down
10 changes: 0 additions & 10 deletions app/views/vpn_devices/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,6 @@
<%= @vpn_device.ip_allocation.ip_address %></h6>
</div>
</div>
<div class="row">
<div class="col-sm-4">
<h6 class="card-title">Accessible remote networks</h6>
</div>
<div class="col-sm-8">
<td></td>
<h6 class="card-title">
<%= @vpn_configuration.network_addresses.map(&:network_address).join(", ") %></h6>
</div>
</div>
<br/>

<%= link_to "Download Configuration",
Expand Down
8 changes: 7 additions & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Rails.application.routes.draw do
resources :configurations
resources :vpn_devices
resources :firewalls
get 'dns_records/refresh', to: 'dns_records#refresh_zones', as: 'refresh_dns_records'
resources :dns_records
get 'home/index'
Expand All @@ -12,8 +13,13 @@
get 'auth/:provider/callback', to: 'sessions#create'
get 'auth/failure', to: redirect('/')
get 'logout', to: 'sessions#destroy', as: 'logout'

get 'admin/users'
#get 'firewall' , to: 'firewall#index'
post 'firewalls', to: 'firewalls#create', as: 'firewall_create'
patch 'firewalls', to: 'firewalls#update_display_rules', as: 'update_display_rules'

patch 'admin/user/:id', to: 'admin#update_users_admin', as: 'update_users_admin'

get 'admin/vpn_configurations'
patch 'admin/vpn_configuration/:id', to: 'admin#update_vpn_configuration', as: 'update_vpn_configuration'

Expand Down
2 changes: 2 additions & 0 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,11 @@
t.string "uid"
t.string "email"
t.string "name"
t.string "role"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.boolean "admin"
t.boolean "isDeleted", default: false
end

create_table "vpn_configurations", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
Expand Down
Loading