Skip to content

Commit

Permalink
daily
Browse files Browse the repository at this point in the history
  • Loading branch information
szepeviktor committed Oct 27, 2016
1 parent 1fa9455 commit 8bc78ed
Show file tree
Hide file tree
Showing 13 changed files with 144 additions and 54 deletions.
11 changes: 11 additions & 0 deletions package/apt-sources/jessie-fastly.list
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Fastly mirror
deb http://cdn-fastly.deb.debian.org/debian jessie main contrib non-free

# Security updates
deb http://security.debian.org/ jessie/updates main contrib non-free

# Updates
deb http://cdn-fastly.deb.debian.org/debian jessie-updates main contrib non-free

# Backports
deb http://cdn-fastly.deb.debian.org/debian jessie-backports main contrib non-free
29 changes: 15 additions & 14 deletions package/apt-sources/sources.list
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
# Packet: http://mirror.ewr1.packet.net/debian
# Linode: http://mirrors.linode.com/debian
# OVH: http://debian.mirrors.ovh.net/debian
# server4you: http://debian.intergenia.de/debian
# PCextreme: http://debian.apt-get.eu/debian
# Closest mirror: http://http.debian.net/debian
# National mirror: http://ftp.COUNTRY-CODE.debian.org/debian
# Fastest mirror: netselect-apt -c de stable
deb @@MIRROR@@ jessie main contrib non-free
# Packet: http://mirror.ewr1.packet.net/debian
# Linode: http://mirrors.linode.com/debian
# OVH: http://debian.mirrors.ovh.net/debian
# server4you: http://debian.intergenia.de/debian
# PCextreme: http://debian.apt-get.eu/debian
# Fastly/CloudFront: http://deb.debian.org/debian
# Closest mirror: http://http.debian.net/debian
# National mirror: http://ftp.COUNTRY-CODE.debian.org/debian
# Fastest mirror: netselect-apt -c de stable
deb @@MIRROR@@ stable main contrib non-free

# Security
deb http://security.debian.org/ jessie/updates main contrib non-free
# Security updates
deb http://security.debian.org/ stable/updates main contrib non-free

# Updates
# (previously known as 'volatile')
deb @@MIRROR@@ jessie-updates main contrib non-free
deb @@MIRROR@@ stable-updates main contrib non-free

# Backports
# http://backports.debian.org/changes/jessie-backports.html
deb @@MIRROR@@ jessie-backports main contrib non-free
# http://backports.debian.org/changes/stable-backports.html
deb @@MIRROR@@ stable-backports main contrib non-free
7 changes: 7 additions & 0 deletions package/mirror-test/mirror-list.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<h3><a name="ZZ">World-wide</a></h3>
Site: <tt>mirror</tt><br>
Type: leaf
<br>Packages over HTTP: <tt><a rel="nofollow" href="@@MIRROR@@">/debian/</a>
</tt><br>Includes architectures: amd64 i386
<br>Update frequency: once a day
<br><br>
8 changes: 8 additions & 0 deletions package/mirror-test/mirror-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

# Create mirror list for netselect-apt
cat mirror-urls.txt | xargs -I % bash -c "sed -e 's|@@MIRROR@@|%|' mirror-list.tpl" > netselect-apt.infile

# Select best mirror
netselect-apt --infile netselect-apt.infile
rm -f netselect-apt.infile sources.list
15 changes: 15 additions & 0 deletions package/mirror-test/mirror-urls.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
http://mirror.ewr1.packet.net/debian
http://mirrors.linode.com/debian
http://debian.mirrors.ovh.net/debian
http://debian.intergenia.de/debian
http://debian.apt-get.eu/debian
http://deb.debian.org/debian
http://http.debian.net/debian
http://ftp.debian.org/debian
http://ftp.hu.debian.org/debian
http://ftp.de.debian.org/debian
http://ftp.cz.debian.org/debian
http://cdn-fastly.deb.debian.org/debian
http://cdn-aws.deb.debian.org/debian
http://cloudfront.debian.net/debian
http://debian-archive.trafficmanager.net/debian
62 changes: 62 additions & 0 deletions upcloud-init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#!/bin/bash
#
# nano upcloud-init.sh
#
# bash -x upcloud-init.sh

# http://deb.debian.org/debian/pool/contrib/g/geoip-database-contrib/
GEOIP_VERSION="1.19"

Auto_country() {
apt-get clean
apt-get update
apt-get install -qq -y geoip-bin netselect-apt
wget -nv "http://deb.debian.org/debian/pool/contrib/g/geoip-database-contrib/geoip-database-contrib_${GEOIP_VERSION}_all.deb"
dpkg -i geoip-database-contrib_*_all.deb

IP="$(ifconfig|sed -ne '0,/^\s*inet addr:\([0-9\.]\+\)\b.*$/s//\1/p')"
test -n "$IP"
COUNTRY="$(geoiplookup -f /usr/share/GeoIP/GeoIP.dat "$IP"|sed -ne 's|^GeoIP Country Edition: \(..\),.*$|\1|p')"
test -n "$COUNTRY"
netselect-apt -c "$COUNTRY" stable
MIRROR="$(sed -ne '0,/^deb \(http\S\+\) .*$/s//\1/p' sources.list)"
test -n "$MIRROR"
rm -f geoip-database-contrib_*_all.deb sources.list

wget -nv -O- "https://github.com/szepeviktor/debian-server-tools/raw/master/package/apt-sources/sources.list" \
| sed -e "s|@@MIRROR@@|${MIRROR}|" > /etc/apt/sources.list
}

set -e

# Change to home directory
cd || exit 100

# LeaseWeb sources
wget -nv -O /etc/apt/sources.list \
"https://github.com/szepeviktor/debian-server-tools/raw/master/package/apt-sources/jessie-for-upcloud.list"
#Auto_country

apt-get clean
apt-get update
# Prevent kernel update
#apt-mark hold linux-image-amd64 "linux-image-[0-9].*-amd64"
apt-get dist-upgrade -y

# docker
apt-get install -qq -y apt-transport-https
apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 2C52609D
echo "deb https://apt.dockerproject.org/repo debian-jessie main" \
> /etc/apt/sources.list.d/docker.list
apt-get update
apt-get install -qq -y docker-engine
docker version

# pip
apt-get install -qq -y python3-dev
wget -nv "https://bootstrap.pypa.io/get-pip.py"
python3 get-pip.py
pip3 --version
rm -f get-pip.py

echo "OK."
4 changes: 2 additions & 2 deletions virtualization/jessie-backport/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#
# szepeviktor/jessie-backport
#
# VERSION 0.2.2
# VERSION 0.2.3
# BUILD docker build -t szepeviktor/jessie-backport:0.2.2 jessie-backport
# RUN docker run --rm --tty -v $TARGET_PATH:/opt/results --env PACKAGE="$SOURCE-PACKAGE/$RELEASE" szepeviktor/jessie-backport:0.2.2
# RUN docker run --rm --tty -v $TARGET_PATH:/opt/results --env PACKAGE="$SOURCE-PACKAGE/$RELEASE" szepeviktor/jessie-backport

FROM szepeviktor/jessie-build

Expand Down
24 changes: 0 additions & 24 deletions virtualization/jessie-backport/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,27 +31,3 @@ Packages dependencies should be placed in the mounted volume, by default `/opt/r
- courier-unicode
- courier-authlib
- courier

### Backport S3QL

http://pythonhosted.org/llfuse/install.html

```bash
cat > /opt/results/debackport-init <<"EOF"
sudo chmod 0666 /dev/fuse
echo "deb http://debian-archive.trafficmanager.net/debian jessie-backports main" | sudo tee /etc/apt/sources.list.d/jessie-backports.list
EOF

cat > /opt/results/debackport-pre-deps <<"EOF"
sudo apt-get install -t jessie-backports -y python3-pytest \
python3-py python3-pytest python3-setuptools \
python-pytest cython3
EOF
```

1. PKG=pytest-catchlog/testing #-> python3-pytest-catchlog
1. PKG=python-llfuse/testing #-> python3-llfuse, python3-llfuse-dbg
1. PKG=python-dugong/testing #-> python3-dugong
1. PKG=s3ql/testing

`docker run --rm --tty --volume /opt/results:/opt/results --env PACKAGE="$PKG" szepeviktor/jessie-backport`
21 changes: 14 additions & 7 deletions virtualization/jessie-backport/debackport.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Backport a Debian package.
#
# DOCKER :szepeviktor/jessie-backport
# VERSION :0.2.2
# VERSION :0.2.3
# REFS :http://backports.debian.org/Contribute/#index6h3
# DOCS :https://wiki.debian.org/SimpleBackportCreation

Expand All @@ -20,7 +20,7 @@
# Hooks
#
# 1. init - Before everything else
# 2. source - Provide custom source, should cd to source directory and set CHANGELOG_MSG
# 2. source - Provide custom source, should change to source directory and set CHANGELOG_MSG
# 3. pre-deps - Just before dependency installation
# 4. changes - Custom changelog entry
# 5. post-build - After build
Expand All @@ -30,8 +30,8 @@

export DEBEMAIL="Viktor Szépe <viktor@szepe.net>"

ARCHIVE_URL="http://ftp.hu.debian.org/debian"
#ARCHIVE_URL="http://archive.ubuntu.com/ubuntu/"
ARCHIVE_URL="http://debian-archive.trafficmanager.net/debian"
#ARCHIVE_URL="http://archive.ubuntu.com/ubuntu"

ALLOW_UNAUTH="--allow-unauthenticated"

Expand All @@ -52,6 +52,7 @@ Execute_hook() {
return 0
fi

# shellcheck disable=SC1090
if source "/opt/results/${HOOK}"; then
return 0
else
Expand Down Expand Up @@ -87,8 +88,12 @@ elif [ "${PACKAGE//[^\/]/}" == "/" ]; then
RELEASE="${PACKAGE#*/}"
{
echo "deb-src ${ARCHIVE_URL} ${RELEASE} main"
# Release updates if available
wget -q --spider "${ARCHIVE_URL}/dists/${RELEASE}-updates/" \
&& echo "deb-src ${ARCHIVE_URL} ${RELEASE}-updates main"
# Security updates if available
wget -q --spider "http://security.debian.org/dists/${RELEASE}/updates/" \
&& echo "deb-src http://security.debian.org/ ${RELEASE}/updates main"
} | sudo tee -a /etc/apt/sources.list
sudo apt-get update -qq
apt-get source "$PACKAGE"
Expand All @@ -97,9 +102,9 @@ elif [ "${PACKAGE//[^\/]/}" == "/" ]; then
CHANGELOG_MSG="Built from ${PACKAGE}"
else
# From a custom source
# Should cd to source directory and set CHANGELOG_MSG
# Should change to source directory and set CHANGELOG_MSG
Execute_hook source
if ! [ -d "debian" ]; then
if ! [ -d "debian" ] || [ -z "$CHANGELOG_MSG" ]; then
Error 3 "Custom source not available"
fi
fi
Expand All @@ -111,6 +116,7 @@ Execute_hook pre-deps
DEPENDENCIES="$(dpkg-checkbuilddeps 2>&1 \
| sed -e 's/^.*Unmet build dependencies: //' -e 's/ ([^)]\+)//g' -e 's/\(\S\+\)\( | \S\+\)\+/\1/g')"
if [ -n "$DEPENDENCIES" ]; then
# shellcheck disable=SC2086
sudo apt-get install -y ${DEPENDENCIES}
fi

Expand All @@ -120,6 +126,7 @@ dpkg-checkbuilddeps
# Hook: changes (e.g. dch --edit, edit files, debcommit --message $TEXT --all)
ORIG_HASH="$(md5sum debian/changelog)"
if ! Execute_hook changes || echo "$ORIG_HASH" | md5sum --status -c - ; then
# If 'changes' hook fails/is missing or does nothing to changelog
dch --bpo --distribution "${CURRENT_RELEASE}-backports" "$CHANGELOG_MSG"
fi

Expand All @@ -129,7 +136,7 @@ dpkg-buildpackage -us -uc
Execute_hook post-build

cd ../
#lintian --info
lintian --display-info --display-experimental --pedantic --show-overrides ./*.deb || true
sudo cp -av ./*.deb /opt/results/

echo "OK."
4 changes: 2 additions & 2 deletions virtualization/jessie-backport/docker-backport-munin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# Build munin from Debian pristine-tar branch.
#
# DEPENDS :docker pull szepeviktor/jessie-backport:0.2.1
# DEPENDS :docker pull szepeviktor/jessie-backport

# Usage
#
Expand Down Expand Up @@ -63,5 +63,5 @@ EOF

# Build it ----------
# EDIT jessie-backport version
docker run --rm --tty -v /opt/results:/opt/results --env PACKAGE="munin" szepeviktor/jessie-backport:0.2.1
docker run --rm --tty -v /opt/results:/opt/results --env PACKAGE="munin" szepeviktor/jessie-backport
rm -f /opt/results/{debackport-init,debackport-source,debackport-pre-deps,debackport-changes,debackport-post-build}
1 change: 1 addition & 0 deletions virtualization/jessie-backport/docker-backport-s3ql.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,4 @@ Build s3ql/testing
rm -f /opt/results/{debackport-init,debackport-pre-deps}

echo "4×OK."
echo "scp -r root@94.237.28.148:/opt/results/ ./"
10 changes: 5 additions & 5 deletions virtualization/jessie-build/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#
# szepeviktor/jessie-build
#
# VERSION 0.2.3
# VERSION 0.2.4
# BUILD docker build -t szepeviktor/jessie-build jessie-build
# RUN docker run --rm -it -v /opt/results:/opt/results szepeviktor/jessie-build

Expand All @@ -9,11 +10,10 @@ FROM debian:jessie
ENV LC_ALL C
ENV DEBIAN_FRONTEND noninteractive

# httpredir.debian.org won't redirect to ftp.hu.debian.org
RUN sed -i -e 's|httpredir\.debian\.org|ftp.hu.debian.org|' /etc/apt/sources.list
RUN apt-get update && apt-get dist-upgrade -y --force-yes
RUN sed -i -e 's|deb\.debian\.org|debian-archive.trafficmanager.net|' /etc/apt/sources.list
RUN apt-get update && apt-get install -y apt-utils && apt-get dist-upgrade -y --force-yes

RUN apt-get install -y sudo apt-utils dialog wget nano devscripts git
RUN apt-get install -y sudo dialog wget nano devscripts git
RUN apt-get clean

RUN adduser --disabled-password --gecos "" debian
Expand Down
2 changes: 2 additions & 0 deletions webserver/Production-website.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ Static maintenance page

### Set up CDN

- Consider multiple A records `host -t A cdn.example.com`
- [Revving filenames](http://www.stevesouders.com/blog/2008/08/23/revving-filenames-dont-use-querystring/)
- Combine and minify CSS and JavaScript files
- HTML caching or no-cache?
Expand Down Expand Up @@ -333,6 +334,7 @@ http://google-public-dns.appspot.com/cache
- Conditional, lazy or late loading (slider, map, facebook content, image gallery)
- Light loading, e.g. `&controls=2` for YouTube
- HTTP/2 server push
- [DNS Prefetch, Preconnect, Prefetch, Prerender](http://w3c.github.io/resource-hints/#resource-hints)
- YouTube custom video thumbnail (FullHD)

### HTTP
Expand Down

0 comments on commit 8bc78ed

Please sign in to comment.