-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f9486f9
commit efc7cd9
Showing
35 changed files
with
354 additions
and
190 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,4 +7,5 @@ vendor/ | |
|
||
# test | ||
tmp/ | ||
|
||
~tmp/ | ||
~/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
path: ~/tmp/mirror/apt | ||
path: mirror/apt | ||
|
||
mirrors: | ||
ubuntu: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#path: ~/tmp/mirror/git | ||
# | ||
#workpath: ~/mymirror | ||
# | ||
## naming은... github/{user}/{repo}를 기본으로 | ||
## 아니면 | ||
## repoanme만 쓸 수 있으면 쓰고.. | ||
## {user}-{repo} 안되는 경우 | ||
# | ||
#mirrors: | ||
# github: | ||
# zitryss: | ||
# groups: ['go'] | ||
# repos: | ||
# go-sample: | ||
# # branch: master | ||
# groups: ['git', 'go'] | ||
# PersonaIam: | ||
# groups: ['coin'] | ||
# repos: | ||
# persona-client: | ||
# groups: ['coin', 'go'] | ||
# streamlit: | ||
# groups: ['coin', 'python'] | ||
# repos: | ||
# streamlit: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,8 @@ | ||
base_dir: ~/tmp | ||
config_dir: ~/tmp/config | ||
#proxy: | ||
# http: 192.168.11.99:3128 | ||
# https: 192.168.11.99:3129 | ||
|
||
proxy: | ||
http: 192.168.11.99:3128 | ||
https: 192.168.11.99:3129 | ||
|
||
cache_enabled: false | ||
cache_dir: ~/tmp/cache | ||
mirror_enabled: false | ||
mirror_dir: ~/tmp/mirror | ||
#if base_dir set? proxy, mirror relative | ||
base_dir: ~/tmp/deproxy | ||
#proxy_root: ~/tmp/proxy | ||
#mirror_root: ~/tmp/mirror |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#path: ~/tmp/data/maven/ | ||
# | ||
#repositories: | ||
# company-dev: | ||
# snapshot: true | ||
# overwrite: true | ||
# company-prd: | ||
# snapshot: false | ||
# overwrite: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
users: | ||
- name: admin | ||
password: passw0rd | ||
roles: [ admin ] | ||
- name: user | ||
password: passw0rd | ||
roles: [ user, deploy ] | ||
|
||
roles: | ||
admin: | ||
permissions: | ||
- * | ||
developer: | ||
permissions: | ||
- read | ||
- write | ||
- deploy | ||
deployer: | ||
permissions: | ||
- deploy | ||
#users: | ||
# - name: admin | ||
# password: passw0rd | ||
# roles: [ admin ] | ||
# - name: user | ||
# password: passw0rd | ||
# roles: [ user, deploy ] | ||
# | ||
#roles: | ||
# admin: | ||
# permissions: | ||
# - * | ||
# developer: | ||
# permissions: | ||
# - read | ||
# - write | ||
# - deploy | ||
# deployer: | ||
# permissions: | ||
# - deploy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#cache: | ||
# relative: false | ||
# path: /proxy/vagrant | ||
# | ||
#servers: | ||
# - id: official | ||
# name: Official | ||
# url: http://official |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package configs | ||
|
||
import ( | ||
"deproxy/helpers" | ||
"path" | ||
"strings" | ||
) | ||
|
||
type GlobalConfig struct { | ||
BaseDir string `yaml:"base_dir,omitempty"` | ||
//ConfigDir string `yaml:"config_dir,omitempty"` | ||
} | ||
|
||
func (cfg *GlobalConfig) ReadConfig() { | ||
confDir := helpers.GetEnv("CONFIG_DIR", "conf/") | ||
helpers.ReadYaml(path.Join(confDir, "global.yaml"), cfg) | ||
|
||
if cfg.BaseDir == "" { | ||
cfg.BaseDir = "~/tmp/deproxy" | ||
} | ||
if strings.HasPrefix(cfg.BaseDir, "~") { | ||
cfg.BaseDir = helpers.ExpandHome(cfg.BaseDir) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package configs | ||
|
||
import ( | ||
"deproxy/helpers" | ||
"fmt" | ||
"github.com/go-playground/assert/v2" | ||
"os" | ||
"testing" | ||
) | ||
|
||
func TestRead_GlobalConfig(t *testing.T) { | ||
os.Setenv("CONFIG_DIR", "../conf/") | ||
cfg := GlobalConfig{} | ||
cfg.ReadConfig() | ||
assert.Equal(t, cfg.BaseDir, "~/tmp/deproxy") | ||
//assert.Equal(t, cfg.ConfigDir, "~/tmp/config") | ||
fmt.Println(helpers.ToStringYaml(cfg)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.