Skip to content

Commit

Permalink
작업하다만거
Browse files Browse the repository at this point in the history
  • Loading branch information
archmagece committed Aug 27, 2024
1 parent 9d2cf73 commit 8bfa566
Show file tree
Hide file tree
Showing 12 changed files with 145 additions and 53 deletions.
35 changes: 35 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# EditorConfig is awesome: http://EditorConfig.org

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
charset = utf-8
max_line_length = 200

# 4 space indentation
[*.{py,java,r,R}]
indent_style = space
indent_size = 4

# 2 space indentation
[*.{js,json,y{a,}ml,html,cwl}]
indent_style = space
indent_size = 2

[*.xml]
indent_style = space
indent_size = 2

[*.{md,Rmd,rst}]
trim_trailing_whitespace = false
indent_style = space
indent_size = 2

[justfile]
indent_style = space
indent_size = 4
4 changes: 4 additions & 0 deletions conf/global.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
base_dir: ~/tmp
config_dir: ~/tmp/config

proxy:
http: 192.168.11.99:3128
https: 192.168.11.99:3129

cache_enabled: false
cache_dir: ~/tmp/cache
mirror_enabled: false
Expand Down
9 changes: 9 additions & 0 deletions conf/host-maven.yaml
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
23 changes: 15 additions & 8 deletions conf/mirror-apt.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
path: ~/tmp/cachedir/mirror/apt
servers:
- name: official
url: http://archive.ubuntu.com/ubuntu
- name: kakao
url: http://mirror.kakao.com/ubuntu
- name: ubuntu-security
url: http://security.ubuntu.com/ubuntu
path: ~/tmp/mirror/apt

mirrors:
ubuntu:
official:
url: http://archive.ubuntu.com/ubuntu
kakao:
url: http://mirror.kakao.com/ubuntu
ubuntu-security:
url: http://security.ubuntu.com/ubuntu
debian:
official:
url: http://ftp.debian.org/debian
kakao:
url: http://mirror.kakao.com/debian
13 changes: 0 additions & 13 deletions conf/mirror-git.yaml

This file was deleted.

26 changes: 26 additions & 0 deletions conf/mirror-github.yaml
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:
8 changes: 6 additions & 2 deletions conf/proxy-apt.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
path: ~/tmp/cachedir/proxy/apt
path: ~/tmp/proxy/apt
use_cache: true
servers:
- name: official
- name: ubuntu
id: ubuntu
url: http://archive.ubuntu.com/ubuntu
- name: kakao
id: kakao
url: http://mirror.kakao.com/ubuntu
- name: ubuntu-security
id: ubuntu-security
url: http://security.ubuntu.com/ubuntu
24 changes: 12 additions & 12 deletions conf/proxy-maven.yaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
path: d:/tmp/cachedir/proxy/maven
use_cache: true
# https://docs.gradle.org/current/userguide/declaring_repositories.html
servers:
- name: Maven Center
id: maven-center
url: https://repo.maven.apache.org/maven2/
description: "maven centeral"
- name: jcener
id: jcenter
url: https://jcenter.bintray.com
description: "jcenter"
# google:
# url: https://maven.google.com
# description: "google android"
# # https://repo.spring.io/webapp/#/home
# spring_release:
# name: repo.spring.io-releases
# url: https://repo.spring.io/release
# spring_snapshorts:
# id: spring-snapshots
# name: repo.spring.io-snapshots
# url: https://repo.spring.io/snapshot
- name: google
id: google
url: https://maven.google.com
# https://repo.spring.io/webapp/#/home
- name: spring_release
id: repo.spring.io-releases
url: https://repo.spring.io/release
- name: spring_snapshots
id: repo.spring.io-snapshots
url: https://repo.spring.io/snapshot

# company_internal:
# url: http://company
Expand Down
20 changes: 20 additions & 0 deletions conf/users.yml
Original file line number Diff line number Diff line change
@@ -0,0 +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
11 changes: 11 additions & 0 deletions integration/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Integration 테스트에서 할일

- apt
- docker ubuntu 이미지 실행 후 mirror 설정해서 apt update apt upgrade
- 두번 연속 실행으로 빨라지는지 체크
1. 프록시 안쓰고 두번 실행
2. 프록시 쓰고 두번 실행

- maven
- 패키지 다운로드
- 패키지 업로드
1 change: 1 addition & 0 deletions integration/dc-test-apt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

24 changes: 6 additions & 18 deletions routers/proxy_router.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,12 @@ import (
)

func ProxyRouter(r *gin.Engine) {

//proxy := goproxy.NewProxyHttpServer()
//proxy.Verbose = true
//log.Fatal(http.ListenAndServe(":8080", proxy))

//mavenGroup := r.Group("/repo")
//mavenGroup.GET("maven*", handlers.Proxy)
mavenGroup := r.Group("/proxy/repo")
mavenGroup.GET("*path", dproxy.Maven)
//r.GET("/repo/maven/:path", handlers.Proxy)
r.GET("/proxy/apt/*path", dproxy.Apt)
r.GET("/proxy/maven/*path", dproxy.Maven)
//r.GET("/proxy/maven/*path", dproxy.Maven)
aptGroup := r.Group("/proxy/apt")
aptGroup.GET("*path", dproxy.Apt)
//r.GET("/proxy/apt/*path", dproxy.Apt)
//r.GET("/proxy/vagrant/*path", func(context *gin.Context) {
// proxy.OnRequest().DoFunc(
// func(r *http.Request, ctx *goproxy.ProxyCtx) (*http.Request, *http.Response) {
// if h, _, _ := time.Now().Clock(); h <= 8 && h <= 17 {
// return r, goproxy.NewResponse(r, goproxy.ContentTypeText, http.StatusForbidden, "Don't waste your time!")
// }
// return r, nil
// },
// )
//})
}

0 comments on commit 8bfa566

Please sign in to comment.