Compare commits
No commits in common. "master" and "sneak/prepfocal" have entirely different histories.
master
...
sneak/prep
@ -12,7 +12,7 @@ steps:
|
|||||||
password:
|
password:
|
||||||
from_secret: docker_password
|
from_secret: docker_password
|
||||||
tags:
|
tags:
|
||||||
- ${DRONE_BRANCH//\//-}-${DRONE_COMMIT_SHA:0:8}
|
|
||||||
- ${DRONE_COMMIT_SHA}
|
- ${DRONE_COMMIT_SHA}
|
||||||
- ${DRONE_BRANCH/\//-}
|
- ${DRONE_BRANCH/\//-}
|
||||||
- latest
|
|
||||||
|
|
||||||
|
@ -6,9 +6,8 @@ ENV MIRROR_UPDATE_INTERVAL_SECONDS 43200
|
|||||||
ENV UBUNTU_MIRROR_ARCHITECTURES amd64
|
ENV UBUNTU_MIRROR_ARCHITECTURES amd64
|
||||||
# set to anything but 'false' to mirror source code as well
|
# set to anything but 'false' to mirror source code as well
|
||||||
ENV UBUNTU_ENABLE_SOURCE_MIRRORING false
|
ENV UBUNTU_ENABLE_SOURCE_MIRRORING false
|
||||||
ENV UBUNTU_MIRROR_CATEGORIES main,universe,restricted,multiverse,main/debian-installer
|
ENV UBUNTU_MIRROR_CATEGORIES main,universe,restricted,multiverse
|
||||||
ENV UBUNTU_MIRROR_UPSTREAM archive.ubuntu.com
|
ENV UBUNTU_MIRROR_UPSTREAM archive.ubuntu.com
|
||||||
ENV UBUNTU_MIRROR_UPSTREAM_PATH /ubuntu
|
|
||||||
ENV UBUNTU_MIRROR_PROJECTS bionic,bionic-updates,bionic-security,bionic-backports,focal,focal-updates,focal-security,focal-backports
|
ENV UBUNTU_MIRROR_PROJECTS bionic,bionic-updates,bionic-security,bionic-backports,focal,focal-updates,focal-security,focal-backports
|
||||||
|
|
||||||
# The following is the URL populated in /mirrors.txt as used by mirror://
|
# The following is the URL populated in /mirrors.txt as used by mirror://
|
||||||
|
@ -41,30 +41,21 @@ The mirror stores all the data in a docker volume at path
|
|||||||
```
|
```
|
||||||
docker rm -f local-ubuntu-mirror
|
docker rm -f local-ubuntu-mirror
|
||||||
docker run -d --name local-ubuntu-mirror \
|
docker run -d --name local-ubuntu-mirror \
|
||||||
-v /storage/mirrors/ubuntu:/var/mirror/ubuntu \
|
-v /storage/mirrors/ubuntu:/var/mirror/ubuntu \
|
||||||
--env MIRROR_UPDATE_INTERVAL_SECONDS=3600 \
|
--env MIRROR_UPDATE_INTERVAL_SECONDS=3600 \
|
||||||
--env UBUNTU_MIRROR_ARCHITECTURES=amd64 \
|
--env UBUNTU_MIRROR_ARCHITECTURES=amd64 \
|
||||||
--env UBUNTU_MIRROR_UPSTREAM=us.archive.ubuntu.com \
|
--env UBUNTU_MIRROR_UPSTREAM=us.archive.ubuntu.com \
|
||||||
--env UBUNTU_MIRROR_PROJECTS=focal,focal-updates,focal-security,focal-backports \
|
--env UBUNTU_MIRROR_PROJECTS=focal,focal-updates,focal-security,focal-backports \
|
||||||
-p 8080:80 \
|
-p 8080:80 \
|
||||||
--restart unless-stopped \
|
--restart unless-stopped \
|
||||||
sneak/ubuntumirror@sha256:7de7cc8245106bb574029a2dedca5aa218af08d802b989cdc7857fb57f876a02
|
sneak/ubuntumirror:latest
|
||||||
```
|
```
|
||||||
|
|
||||||
# Example CapRover Definition File
|
# Example CapRover Definition File
|
||||||
|
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
"schemaVersion": 2,
|
"schemaVersion": 2,
|
||||||
"imageName": "sneak/ubuntumirror@sha256:7de7cc8245106bb574029a2dedca5aa218af08d802b989cdc7857fb57f876a02"
|
"imageName": "sneak/ubuntumirror:latest"
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
# Author
|
|
||||||
|
|
||||||
sneak <[sneak@sneak.berlin](mailto:sneak@sneak.berlin)>
|
|
||||||
|
|
||||||
# License
|
|
||||||
|
|
||||||
This software is released into the public domain.
|
|
||||||
|
|
||||||
|
@ -9,5 +9,5 @@ rm -rf /var/mirror/ubuntu/.temp
|
|||||||
while sleep 1 ; do
|
while sleep 1 ; do
|
||||||
cd /opt/mirror && make
|
cd /opt/mirror && make
|
||||||
|
|
||||||
sleep ${MIRROR_UPDATE_INTERVAL_SECONDS}
|
sleep ${MIRROR_INTERVAL_SECONDS}
|
||||||
done
|
done
|
||||||
|
39
mirror/syncubuntu.sh
Normal file → Executable file
39
mirror/syncubuntu.sh
Normal file → Executable file
@ -16,30 +16,17 @@ if [[ "$UBUNTU_ENABLE_SOURCE_MIRRORING" != "false" ]]; then
|
|||||||
SOURCEOPT="--source"
|
SOURCEOPT="--source"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
DONE=0
|
debmirror \
|
||||||
|
-a ${UBUNTU_MIRROR_ARCHITECTURES} \
|
||||||
|
-s ${UBUNTU_MIRROR_CATEGORIES} \
|
||||||
|
-h ${UBUNTU_MIRROR_UPSTREAM} \
|
||||||
|
-d ${UBUNTU_MIRROR_PROJECTS} \
|
||||||
|
$SOURCEOPT \
|
||||||
|
--ignore-small-errors \
|
||||||
|
-r /ubuntu \
|
||||||
|
--getcontents \
|
||||||
|
--progress \
|
||||||
|
--method=http \
|
||||||
|
$DST/ubuntu
|
||||||
|
|
||||||
DIDIST="$(
|
chmod -R a+rX $DST
|
||||||
echo -n "$UBUNTU_MIRROR_PROJECTS" | tr "," "\n" | grep -v "\-" | tr "\n" ","
|
|
||||||
)"
|
|
||||||
|
|
||||||
while [[ $DONE -eq 0 ]]; do
|
|
||||||
debmirror \
|
|
||||||
-a ${UBUNTU_MIRROR_ARCHITECTURES} \
|
|
||||||
-s ${UBUNTU_MIRROR_CATEGORIES} \
|
|
||||||
-h ${UBUNTU_MIRROR_UPSTREAM} \
|
|
||||||
-d ${UBUNTU_MIRROR_PROJECTS} \
|
|
||||||
$SOURCEOPT \
|
|
||||||
--di-dist="$DIDIST" \
|
|
||||||
--di-arch=arches \
|
|
||||||
--ignore-small-errors \
|
|
||||||
-r "$UBUNTU_MIRROR_UPSTREAM_PATH" \
|
|
||||||
--getcontents \
|
|
||||||
--progress \
|
|
||||||
--method=http \
|
|
||||||
$DST/ubuntu
|
|
||||||
if [[ $? -eq 0 ]]; then
|
|
||||||
DONE=1
|
|
||||||
fi
|
|
||||||
chmod -R a+rX $DST
|
|
||||||
sleep 1
|
|
||||||
done
|
|
||||||
|
@ -3,14 +3,11 @@ worker_processes auto;
|
|||||||
|
|
||||||
pid /var/run/nginx.pid;
|
pid /var/run/nginx.pid;
|
||||||
|
|
||||||
error_log /dev/stdout info;
|
|
||||||
|
|
||||||
events {
|
events {
|
||||||
worker_connections 1024;
|
worker_connections 1024;
|
||||||
}
|
}
|
||||||
|
|
||||||
http {
|
http {
|
||||||
access_log /dev/stdout;
|
|
||||||
include /etc/nginx/mime.types;
|
include /etc/nginx/mime.types;
|
||||||
default_type application/octet-stream;
|
default_type application/octet-stream;
|
||||||
|
|
||||||
@ -33,12 +30,12 @@ http {
|
|||||||
|
|
||||||
index index.html index.htm;
|
index index.html index.htm;
|
||||||
|
|
||||||
location /ubuntu/ {
|
#location /ubuntu/ {
|
||||||
# # alias, not root!
|
# # alias, not root!
|
||||||
# # trailing slash important!
|
# # trailing slash important!
|
||||||
# alias /var/mirror/ubuntu/;
|
# alias /var/mirror/ubuntu/;
|
||||||
autoindex on;
|
# autoindex on;
|
||||||
}
|
#}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user