mirror of
https://github.com/cmur2/openvpn-status-web.git
synced 2025-09-28 21:52:05 +02:00
Compare commits
31 Commits
Author | SHA1 | Date | |
---|---|---|---|
e4034073a6 | |||
![]() |
f4d17809a2 | ||
08b50d5974 | |||
![]() |
f287906240 | ||
27306b831f | |||
1e12701fc3 | |||
597b619b0b | |||
61f7cbd76c | |||
2628c08975 | |||
![]() |
7343081406 | ||
ec4d028c03 | |||
12b5153604 | |||
7c0722e875 | |||
![]() |
afd7f4fa98 | ||
![]() |
63272da3e3 | ||
![]() |
ae7fc1137b | ||
![]() |
1f69dabf5f | ||
0e9c9fea68 | |||
0ffe369ef1 | |||
![]() |
c2cac319ae | ||
![]() |
5f343d7873 | ||
![]() |
0a45726857 | ||
109b27fecc | |||
b44517ec21 | |||
![]() |
520da15739 | ||
![]() |
9b3a13abef | ||
![]() |
b81d61b8d7 | ||
147a905bfc | |||
eeed0fa089 | |||
586ae8ae0f | |||
![]() |
075ec1e548 |
9
.editorconfig
Normal file
9
.editorconfig
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 2
|
||||||
|
end_of_line = lf
|
||||||
|
charset = utf-8
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
insert_final_newline = true
|
32
.github/workflows/ci.yml
vendored
Normal file
32
.github/workflows/ci.yml
vendored
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
---
|
||||||
|
name: ci
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [master]
|
||||||
|
pull_request:
|
||||||
|
branches: [master]
|
||||||
|
workflow_dispatch:
|
||||||
|
schedule:
|
||||||
|
- cron: '35 4 * * 4' # weekly on thursday morning
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
ruby-version:
|
||||||
|
- '2.5'
|
||||||
|
- '2.6'
|
||||||
|
- '2.7'
|
||||||
|
- '3.0'
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Set up Ruby ${{ matrix.ruby-version }}
|
||||||
|
uses: ruby/setup-ruby@v1
|
||||||
|
with:
|
||||||
|
ruby-version: ${{ matrix.ruby-version }}
|
||||||
|
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
||||||
|
- name: Lint and Test
|
||||||
|
run: |
|
||||||
|
bundle exec rake ci
|
14
.rubocop.yml
14
.rubocop.yml
@@ -1,3 +1,7 @@
|
|||||||
|
require:
|
||||||
|
- rubocop-rake
|
||||||
|
- rubocop-rspec
|
||||||
|
|
||||||
AllCops:
|
AllCops:
|
||||||
TargetRubyVersion: '2.5'
|
TargetRubyVersion: '2.5'
|
||||||
NewCops: enable
|
NewCops: enable
|
||||||
@@ -86,3 +90,13 @@ Style/Semicolon:
|
|||||||
|
|
||||||
Style/SymbolArray:
|
Style/SymbolArray:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
|
RSpec/ExampleLength:
|
||||||
|
Max: 10
|
||||||
|
|
||||||
|
RSpec/FilePath:
|
||||||
|
CustomTransform:
|
||||||
|
OpenVPNStatusWeb: openvpn-status-web
|
||||||
|
|
||||||
|
RSpec/MultipleExpectations:
|
||||||
|
Max: 5
|
||||||
|
10
.travis.yml
10
.travis.yml
@@ -1,10 +0,0 @@
|
|||||||
---
|
|
||||||
os: linux
|
|
||||||
language: ruby
|
|
||||||
rvm:
|
|
||||||
- 2.7
|
|
||||||
- 2.6
|
|
||||||
- 2.5
|
|
||||||
|
|
||||||
script:
|
|
||||||
- bundle exec rake travis
|
|
@@ -1,6 +1,6 @@
|
|||||||
# openvpn-status-web
|
# openvpn-status-web
|
||||||
|
|
||||||
[](https://travis-ci.org/cmur2/openvpn-status-web) [](https://depfu.com/github/cmur2/openvpn-status-web?project_id=6194)
|
 [](https://depfu.com/github/cmur2/openvpn-status-web?project_id=6194)
|
||||||
|
|
||||||
## Description
|
## Description
|
||||||
|
|
||||||
|
19
Rakefile
19
Rakefile
@@ -9,16 +9,19 @@ RSpec::Core::RakeTask.new(:spec)
|
|||||||
RuboCop::RakeTask.new
|
RuboCop::RakeTask.new
|
||||||
Bundler::Audit::Task.new
|
Bundler::Audit::Task.new
|
||||||
|
|
||||||
desc 'Should be run by developer once to prepare initial solargraph usage (fill caches etc.)'
|
|
||||||
task :'solargraph:init' do
|
|
||||||
sh 'solargraph download-core'
|
|
||||||
end
|
|
||||||
|
|
||||||
desc 'Run experimental solargraph type checker'
|
desc 'Run experimental solargraph type checker'
|
||||||
task :'solargraph:tc' do
|
task :solargraph do
|
||||||
sh 'solargraph typecheck'
|
sh 'solargraph typecheck'
|
||||||
end
|
end
|
||||||
|
|
||||||
task default: [:rubocop, :spec, 'bundle:audit']
|
namespace :solargraph do
|
||||||
|
desc 'Should be run by developer once to prepare initial solargraph usage (fill caches etc.)'
|
||||||
|
task :init do
|
||||||
|
sh 'solargraph download-core'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
task travis: [:default, :'solargraph:tc']
|
task default: [:rubocop, :spec, 'bundle:audit', :solargraph]
|
||||||
|
|
||||||
|
desc 'Run all tasks desired for CI'
|
||||||
|
task ci: ['solargraph:init', :default]
|
||||||
|
@@ -1,8 +1,8 @@
|
|||||||
FROM alpine:3.12
|
FROM alpine:3.13
|
||||||
|
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
|
|
||||||
ENV VERSION=3.0.0
|
ENV VERSION=3.1.0
|
||||||
|
|
||||||
RUN apk --no-cache add openssl ca-certificates && \
|
RUN apk --no-cache add openssl ca-certificates && \
|
||||||
apk --no-cache add ruby ruby-etc ruby-webrick && \
|
apk --no-cache add ruby ruby-etc ruby-webrick && \
|
||||||
|
@@ -107,7 +107,7 @@ module OpenVPNStatusWeb
|
|||||||
if config['logfile']
|
if config['logfile']
|
||||||
OpenVPNStatusWeb.logger = Logger.new(config['logfile'])
|
OpenVPNStatusWeb.logger = Logger.new(config['logfile'])
|
||||||
else
|
else
|
||||||
OpenVPNStatusWeb.logger = Logger.new(STDOUT)
|
OpenVPNStatusWeb.logger = Logger.new($stdout)
|
||||||
end
|
end
|
||||||
|
|
||||||
OpenVPNStatusWeb.logger.progname = 'openvpn-status-web'
|
OpenVPNStatusWeb.logger.progname = 'openvpn-status-web'
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module OpenVPNStatusWeb
|
module OpenVPNStatusWeb
|
||||||
VERSION = '3.0.0'
|
VERSION = '3.1.0'
|
||||||
end
|
end
|
||||||
|
@@ -28,6 +28,7 @@ Gem::Specification.new do |s|
|
|||||||
|
|
||||||
s.add_runtime_dependency 'metriks'
|
s.add_runtime_dependency 'metriks'
|
||||||
s.add_runtime_dependency 'rack', '~> 2.0'
|
s.add_runtime_dependency 'rack', '~> 2.0'
|
||||||
|
s.add_runtime_dependency 'webrick', '>= 1.6.1'
|
||||||
|
|
||||||
s.add_development_dependency 'better_errors'
|
s.add_development_dependency 'better_errors'
|
||||||
s.add_development_dependency 'binding_of_caller'
|
s.add_development_dependency 'binding_of_caller'
|
||||||
@@ -36,6 +37,8 @@ Gem::Specification.new do |s|
|
|||||||
s.add_development_dependency 'rack-test'
|
s.add_development_dependency 'rack-test'
|
||||||
s.add_development_dependency 'rake'
|
s.add_development_dependency 'rake'
|
||||||
s.add_development_dependency 'rspec'
|
s.add_development_dependency 'rspec'
|
||||||
s.add_development_dependency 'rubocop', '~> 0.88.0'
|
s.add_development_dependency 'rubocop', '~> 1.8.1'
|
||||||
s.add_development_dependency 'solargraph'
|
s.add_development_dependency 'rubocop-rake', '~> 0.5.1'
|
||||||
|
s.add_development_dependency 'rubocop-rspec', '~> 2.1.0'
|
||||||
|
s.add_development_dependency 'solargraph', ' ~> 0.40.0'
|
||||||
end
|
end
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require_relative '../spec_helper'
|
require_relative '../../spec_helper'
|
||||||
|
|
||||||
describe OpenVPNStatusWeb::Parser::ModernStateless do
|
describe OpenVPNStatusWeb::Parser::ModernStateless do
|
||||||
{
|
{
|
||||||
@@ -8,7 +8,7 @@ describe OpenVPNStatusWeb::Parser::ModernStateless do
|
|||||||
3 => status_v3
|
3 => status_v3
|
||||||
}.each do |version, status|
|
}.each do |version, status|
|
||||||
context "for status-version #{version}" do
|
context "for status-version #{version}" do
|
||||||
context 'for client list' do
|
context 'with client list' do
|
||||||
it 'parses common names' do
|
it 'parses common names' do
|
||||||
expect(status.client_list.map { |client| client[0] }).to eq(%w[foo bar])
|
expect(status.client_list.map { |client| client[0] }).to eq(%w[foo bar])
|
||||||
end
|
end
|
||||||
@@ -34,7 +34,7 @@ describe OpenVPNStatusWeb::Parser::ModernStateless do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'for routing table' do
|
context 'with routing table' do
|
||||||
it 'parses virtual addresses' do
|
it 'parses virtual addresses' do
|
||||||
expect(status.routing_table.map { |route| route[0] }).to eq(['192.168.0.0/24', '192.168.66.2', '192.168.66.3', '2001:db8:0:0::1000'])
|
expect(status.routing_table.map { |route| route[0] }).to eq(['192.168.0.0/24', '192.168.66.2', '192.168.66.3', '2001:db8:0:0::1000'])
|
||||||
end
|
end
|
@@ -1,13 +1,13 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require_relative '../spec_helper'
|
require_relative '../../spec_helper'
|
||||||
|
|
||||||
describe OpenVPNStatusWeb::Parser::V1 do
|
describe OpenVPNStatusWeb::Parser::V1 do
|
||||||
def status
|
def status
|
||||||
status_v1
|
status_v1
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'for client list' do
|
context 'with client list' do
|
||||||
it 'parses common names' do
|
it 'parses common names' do
|
||||||
expect(status.client_list.map { |client| client[0] }).to eq(%w[foo bar])
|
expect(status.client_list.map { |client| client[0] }).to eq(%w[foo bar])
|
||||||
end
|
end
|
||||||
@@ -33,7 +33,7 @@ describe OpenVPNStatusWeb::Parser::V1 do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'for routing table' do
|
context 'with routing table' do
|
||||||
it 'parses virtual addresses' do
|
it 'parses virtual addresses' do
|
||||||
expect(status.routing_table.map { |route| route[0] }).to eq(['192.168.0.0/24', '192.168.66.2', '192.168.66.3', '2001:db8:0:0::1000'])
|
expect(status.routing_table.map { |route| route[0] }).to eq(['192.168.0.0/24', '192.168.66.2', '192.168.66.3', '2001:db8:0:0::1000'])
|
||||||
end
|
end
|
Reference in New Issue
Block a user