Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nginx-redirector
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
eterfund
nginx-redirector
Commits
01bf4663
You need to sign in or sign up before continuing.
Commit
01bf4663
authored
Mar 25, 2022
by
Soldatoff
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
изменил путь к yaml файлу. поправил под более старые версии питона
parent
5eb42b64
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
9 deletions
+9
-9
nginx-redirector.service
nginx-redirector.service
+1
-1
redirector_test.py
redirector/tests/redirector_test.py
+7
-7
generators.py
redirector/utils/generators.py
+1
-1
No files found.
nginx-redirector.service
View file @
01bf4663
...
@@ -3,7 +3,7 @@ Description=service for nginx-redirector
...
@@ -3,7 +3,7 @@ Description=service for nginx-redirector
[Service]
[Service]
Type=simple
Type=simple
ExecStart=/usr/bin/nginx-redirector-watch /
EXAPLE/file
.yaml
ExecStart=/usr/bin/nginx-redirector-watch /
etc/nginx-redirector/config
.yaml
WorkingDirectory=/usr/bin/
WorkingDirectory=/usr/bin/
Restart=always
Restart=always
User=root
User=root
...
...
redirector/tests/redirector_test.py
View file @
01bf4663
...
@@ -15,7 +15,7 @@ class EqualRedirectorTest(unittest.TestCase):
...
@@ -15,7 +15,7 @@ class EqualRedirectorTest(unittest.TestCase):
abs_yaml_path
=
get_abs_path
(
CONFIG
)
abs_yaml_path
=
get_abs_path
(
CONFIG
)
abs_test_path
=
get_abs_path
(
'test.map'
)
abs_test_path
=
get_abs_path
(
'test.map'
)
abs_res_conf_path
=
get_rel_path
(
f
"{CONFIG_DIR}/test.conf"
)
abs_res_conf_path
=
get_rel_path
(
"{}/test.conf"
.
format
(
CONFIG_DIR
)
)
res_conf_file
=
open
(
abs_res_conf_path
,
'r'
)
res_conf_file
=
open
(
abs_res_conf_path
,
'r'
)
res_conf_lines
=
[]
res_conf_lines
=
[]
...
@@ -28,9 +28,9 @@ class EqualRedirectorTest(unittest.TestCase):
...
@@ -28,9 +28,9 @@ class EqualRedirectorTest(unittest.TestCase):
maps_dir
=
get_rel_path
(
MAPS_DIR
)
maps_dir
=
get_rel_path
(
MAPS_DIR
)
abs_res_map_paths
=
[
abs_res_map_paths
=
[
f
"{maps_dir}/test.map"
,
"{}/test.map"
.
format
(
maps_dir
)
,
f
"{maps_dir}/test_permanent_options.map"
,
"{}/test_permanent_options.map"
.
format
(
maps_dir
)
,
f
"{maps_dir}/test_status=301_options.map"
"{}/test_status=301_options.map"
.
format
(
maps_dir
)
]
]
res_map_lines
=
[]
res_map_lines
=
[]
...
@@ -58,9 +58,9 @@ class EqualRedirectorTest(unittest.TestCase):
...
@@ -58,9 +58,9 @@ class EqualRedirectorTest(unittest.TestCase):
test_maps_dir
=
get_rel_path
(
'nginx/maps'
)
test_maps_dir
=
get_rel_path
(
'nginx/maps'
)
abs_test_map_paths
=
[
abs_test_map_paths
=
[
f
"{test_maps_dir}/test.map"
,
"{}/test.map"
.
format
(
test_maps_dir
)
,
f
"{test_maps_dir}/test_permanent_options.map"
,
"{}/test_permanent_options.map"
.
format
(
test_maps_dir
)
,
f
"{test_maps_dir}/test_status=301_options.map"
"{}/test_status=301_options.map"
.
format
(
test_maps_dir
)
]
]
test_map_lines
=
[]
test_map_lines
=
[]
...
...
redirector/utils/generators.py
View file @
01bf4663
...
@@ -17,7 +17,7 @@ class Generator:
...
@@ -17,7 +17,7 @@ class Generator:
maps_dir
,
config_dir
=
self
.
get_conf_dirs
()
maps_dir
,
config_dir
=
self
.
get_conf_dirs
()
try
:
try
:
with
open
(
f
"{maps_dir}/{project_name}.map"
,
"w"
)
as
map_file
:
with
open
(
"{}/{}.map"
.
format
(
maps_dir
,
project_name
)
,
"w"
)
as
map_file
:
map_file
.
write
(
redirects_map
)
map_file
.
write
(
redirects_map
)
for
code
,
data
in
redirects_with_options
:
for
code
,
data
in
redirects_with_options
:
if
code
==
"301"
:
if
code
==
"301"
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment