configure arch mirror server
This commit is contained in:
parent
95e442219f
commit
edcc01db3e
@ -149,3 +149,56 @@ nginx_vhosts:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- listen: 80
|
||||||
|
server_name: "arch.{{domain.name}}"
|
||||||
|
filename: "archMirror.conf"
|
||||||
|
template: "{{ nginx_vhost_template }}"
|
||||||
|
root: "{{arch_mirror_location}}"
|
||||||
|
access_log: /var/log/nginx/archmirror.access.log
|
||||||
|
error_log: /var/log/nginx/archmirror.error.log
|
||||||
|
extra_parameters: |
|
||||||
|
autoindex on;
|
||||||
|
|
||||||
|
# Requests for package db, signature files and files db should redirect upstream without caching
|
||||||
|
location ~ \.(db|sig|files)$ {
|
||||||
|
proxy_pass http://archMirrorUp$request_uri;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Requests for actual packages should be served directly from cache if available.
|
||||||
|
# If not available, retrieve and save the package from an upstream mirror.
|
||||||
|
location ~ \.tar\.(xz|zst)$ {
|
||||||
|
try_files $uri @pkg_mirror;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Retrieve package from upstream mirrors and cache for future requests
|
||||||
|
location @pkg_mirror {
|
||||||
|
proxy_store on;
|
||||||
|
proxy_redirect off;
|
||||||
|
proxy_store_access user:rw group:rw all:r;
|
||||||
|
proxy_next_upstream error timeout http_404;
|
||||||
|
proxy_pass http://archMirrorUp$request_uri;
|
||||||
|
}
|
||||||
|
- listen: "127.0.0.1:7001"
|
||||||
|
server_name: "_"
|
||||||
|
filename: "archMirrorUpstream1.conf"
|
||||||
|
template: "{{ nginx_vhost_template }}"
|
||||||
|
extra_parameters: |
|
||||||
|
location / {
|
||||||
|
proxy_pass http://archlinux.de-labrusse.fr$request_uri;
|
||||||
|
}
|
||||||
|
- listen: "127.0.0.1:7002"
|
||||||
|
server_name: "_"
|
||||||
|
filename: "archMirrorUpstream2.conf"
|
||||||
|
template: "{{ nginx_vhost_template }}"
|
||||||
|
extra_parameters: |
|
||||||
|
location / {
|
||||||
|
proxy_pass http://mirror.23media.com/archlinux$request_uri;
|
||||||
|
}
|
||||||
|
- listen: "127.0.0.1:7003"
|
||||||
|
server_name: "_"
|
||||||
|
filename: "archMirrorUpstream3.conf"
|
||||||
|
template: "{{ nginx_vhost_template }}"
|
||||||
|
extra_parameters: |
|
||||||
|
location / {
|
||||||
|
proxy_pass http://mirror.archlinux.ikoula.com$request_uri;
|
||||||
|
}
|
||||||
|
@ -68,6 +68,13 @@ systemd_mounts:
|
|||||||
- vers=3.0
|
- vers=3.0
|
||||||
- dir_mode=0770
|
- dir_mode=0770
|
||||||
automount: true
|
automount: true
|
||||||
|
diskstation_archMirror:
|
||||||
|
share: diskstation.ducamps.win:/volume2/archMirror
|
||||||
|
mount: /mnt/diskstation/archMirror
|
||||||
|
type: nfs
|
||||||
|
options:
|
||||||
|
- " "
|
||||||
|
automount: true
|
||||||
systemd_mounts_enabled:
|
systemd_mounts_enabled:
|
||||||
- diskstation_git
|
- diskstation_git
|
||||||
- diskstation_music
|
- diskstation_music
|
||||||
@ -78,7 +85,7 @@ systemd_mounts_enabled:
|
|||||||
- diskstation_media
|
- diskstation_media
|
||||||
- diskstation_ebook
|
- diskstation_ebook
|
||||||
- diskstation_nextcloud
|
- diskstation_nextcloud
|
||||||
|
- diskstation_archMirror
|
||||||
|
|
||||||
credentials_files:
|
credentials_files:
|
||||||
1:
|
1:
|
||||||
|
@ -78,3 +78,5 @@ chisel_server_backend: https://www.{{domain.name}}
|
|||||||
chisel_server_auth:
|
chisel_server_auth:
|
||||||
user: chisel
|
user: chisel
|
||||||
pass: "{{vault_chisel_server_pass}}"
|
pass: "{{vault_chisel_server_pass}}"
|
||||||
|
|
||||||
|
arch_mirror_location: "/mnt/diskstation/archMirror"
|
@ -15,11 +15,17 @@ certbot_certs:
|
|||||||
- ww.{{domain.name}}
|
- ww.{{domain.name}}
|
||||||
|
|
||||||
nginx_server_tokens: "off"
|
nginx_server_tokens: "off"
|
||||||
|
nginx_server_resolver: "192.168.1.40 192.168.1.10"
|
||||||
nginx_realIP_Proxy: 192.168.1.40/24
|
nginx_realIP_Proxy: 192.168.1.40/24
|
||||||
nginx_upstreams:
|
nginx_upstreams:
|
||||||
- name: PHP-handler
|
- name: PHP-handler
|
||||||
servers:
|
servers:
|
||||||
- unix:/var/run/php-fpm/php-fpm.sock
|
- unix:/var/run/php-fpm/php-fpm.sock
|
||||||
|
- name: archMirrorUp
|
||||||
|
servers:
|
||||||
|
- localhost:7001
|
||||||
|
- localhost:7002
|
||||||
|
- localhost:7003
|
||||||
nginx_extra_http_options: |
|
nginx_extra_http_options: |
|
||||||
proxy_connect_timeout 600s;
|
proxy_connect_timeout 600s;
|
||||||
proxy_send_timeout 600s;
|
proxy_send_timeout 600s;
|
||||||
@ -280,3 +286,56 @@ nginx_vhosts:
|
|||||||
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
|
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
|
||||||
proxy_pass http://localhost:9090;
|
proxy_pass http://localhost:9090;
|
||||||
}
|
}
|
||||||
|
- listen: 80
|
||||||
|
server_name: "arch.{{domain.name}}"
|
||||||
|
filename: "archMirror.conf"
|
||||||
|
template: "{{ nginx_vhost_template }}"
|
||||||
|
root: "{{arch_mirror_location}}"
|
||||||
|
access_log: /var/log/nginx/archmirror.access.log
|
||||||
|
error_log: /var/log/nginx/archmirror.error.log
|
||||||
|
extra_parameters: |
|
||||||
|
autoindex on;
|
||||||
|
|
||||||
|
# Requests for package db, signature files and files db should redirect upstream without caching
|
||||||
|
location ~ \.(db|sig|files)$ {
|
||||||
|
proxy_pass http://archMirrorUp$request_uri;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Requests for actual packages should be served directly from cache if available.
|
||||||
|
# If not available, retrieve and save the package from an upstream mirror.
|
||||||
|
location ~ \.tar\.(xz|zst)$ {
|
||||||
|
try_files $uri @pkg_mirror;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Retrieve package from upstream mirrors and cache for future requests
|
||||||
|
location @pkg_mirror {
|
||||||
|
proxy_store on;
|
||||||
|
proxy_redirect off;
|
||||||
|
proxy_store_access user:rw group:rw all:r;
|
||||||
|
proxy_next_upstream error timeout http_404;
|
||||||
|
proxy_pass http://archMirrorUp$request_uri;
|
||||||
|
}
|
||||||
|
- listen: "127.0.0.1:7001"
|
||||||
|
server_name: "_"
|
||||||
|
filename: "archMirrorUpstream1.conf"
|
||||||
|
template: "{{ nginx_vhost_template }}"
|
||||||
|
extra_parameters: |
|
||||||
|
location / {
|
||||||
|
proxy_pass http://archlinux.mirrors.ovh.net/archlinux$request_uri;
|
||||||
|
}
|
||||||
|
- listen: "127.0.0.1:7002"
|
||||||
|
server_name: "_"
|
||||||
|
filename: "archMirrorUpstream2.conf"
|
||||||
|
template: "{{ nginx_vhost_template }}"
|
||||||
|
extra_parameters: |
|
||||||
|
location / {
|
||||||
|
proxy_pass http://archlinux.cu.be$request_uri;
|
||||||
|
}
|
||||||
|
- listen: "127.0.0.1:7003"
|
||||||
|
server_name: "_"
|
||||||
|
filename: "archMirrorUpstream3.conf"
|
||||||
|
template: "{{ nginx_vhost_template }}"
|
||||||
|
extra_parameters: |
|
||||||
|
location / {
|
||||||
|
proxy_pass http://mirror.neostrada.nl/archlinux$request_uri;
|
||||||
|
}
|
||||||
|
@ -30,3 +30,12 @@
|
|||||||
- chainetv
|
- chainetv
|
||||||
- user_config
|
- user_config
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: create paccache job for arch mirror
|
||||||
|
cron:
|
||||||
|
job: "find {{arch_mirror_location}} -type d -exec paccache -v -r -k 2 -c {} \\;"
|
||||||
|
user: "root"
|
||||||
|
name: "paccache job"
|
||||||
|
hour: "4"
|
||||||
|
state: present
|
||||||
|
become: true
|
Loading…
Reference in New Issue
Block a user