mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-11 18:35:51 +02:00
refactor: config management
This commit is contained in:
parent
eb9ede5a4e
commit
53ae1a1ef9
12 changed files with 405 additions and 203 deletions
|
@ -7,7 +7,7 @@ import (
|
|||
|
||||
type Config struct {
|
||||
Name string `json:"name"`
|
||||
Content string `json:"content,omitempty"`
|
||||
Content string `json:"content"`
|
||||
ChatGPTMessages []openai.ChatCompletionMessage `json:"chatgpt_messages,omitempty"`
|
||||
FilePath string `json:"filepath,omitempty"`
|
||||
ModifiedAt time.Time `json:"modified_at"`
|
||||
|
|
|
@ -8,4 +8,5 @@ import (
|
|||
func TestIsUnderDirectory(t *testing.T) {
|
||||
assert.Equal(t, true, IsUnderDirectory("/etc/nginx/nginx.conf", "/etc/nginx"))
|
||||
assert.Equal(t, false, IsUnderDirectory("../../root/nginx.conf", "/etc/nginx"))
|
||||
assert.Equal(t, false, IsUnderDirectory("/etc/nginx/../../root/nginx.conf", "/etc/nginx"))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue