Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Owo Sugiana
/
maintenance
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 624fdfe5
authored
Oct 19, 2026
by
Owo Sugiana
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Bug fixed bila /var/log/openvpn/ipp.txt karena IP-nya tidak perlu ditambah 2
1 parent
7a478559
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
8 deletions
CHANGES.txt
pyproject.toml
vpn_check/__init__.py
CHANGES.txt
View file @
624fdfe
1.0.1 19-10-2026
----------------
- Bug fixed bila /var/log/openvpn/ipp.txt karena IP-nya tidak perlu ditambah 2.
1.0.0 30-1-2026
---------------
- Tambah VPN Checker
...
...
pyproject.toml
View file @
624fdfe
...
...
@@ -3,11 +3,10 @@ requires = ['setuptools >= 64']
[project]
name
=
'maintenance'
version
=
'
1.0.
0
'
version
=
'
1.0.
1
'
dependencies
=
[
'
sqlalchemy
'
,
'
psycopg
'
,
'zope.sqlalchemy'
,
'psycopg
2
-binary'
,
'opensipkd-hitung
@
git+https://git.opensipkd.com/sugiana/opensipkd-hitung.git'
,
]
requires-python
=
'>=
3.9
'
...
...
vpn_check/__init__.py
View file @
624fdfe
...
...
@@ -39,10 +39,12 @@ def init_db(argv=sys.argv[1:]):
def
get_ipp_file
():
files
=
[
'/etc/openvpn/ipp.txt'
,
'/var/log/openvpn/ipp.txt'
]
for
filename
in
files
:
files
=
[
(
'/etc/openvpn/ipp.txt'
,
2
),
(
'/var/log/openvpn/ipp.txt'
,
0
)]
for
filename
,
increment_for_ip
in
files
:
if
os
.
path
.
exists
(
filename
):
return
filename
return
filename
,
increment_for_ip
def
get_db_session
(
engine
):
...
...
@@ -72,14 +74,14 @@ def init_ip(argv=sys.argv[1:]):
conf
.
read
(
conf_file
)
cf
=
dict
(
conf
.
items
(
'main'
))
engine
=
engine_from_config
(
cf
,
'sqlalchemy.'
)
ipp_file
=
get_ipp_file
()
ipp_file
,
increment_for_ip
=
get_ipp_file
()
db_session
=
get_db_session
(
engine
)
base_q
=
db_session
.
query
(
VPN
)
with
open
(
ipp_file
)
as
f
:
for
line
in
f
.
readlines
():
nama
,
ip
=
line
.
strip
()
.
split
(
','
)[:
2
]
i
=
int
(
ip
.
split
(
'.'
)[
-
1
])
i
+=
2
i
+=
increment_for_ip
ip
=
'.'
.
join
(
ip
.
split
(
'.'
)[:
-
1
])
+
'.
%
d'
%
i
q
=
base_q
.
filter_by
(
ip
=
ip
)
row
=
q
.
first
()
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment