Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ MAINTAINER myself@mydomain.org
# if already downloaded you can use COPY instead
COPY owncloud-7.0.15.tar.bz2 /var/www/html/
RUN cd /var/www/html/ && tar xfj owncloud-7.0.15.tar.bz2 && rm -f owncloud-7.0.15.tar.bz2
COPY config.php /var/www/html/owncloud/config/
#COPY config.php /var/www/html/owncloud/config/
RUN mkdir -p /data/owncloud
RUN chown -R apache:apache /var/www/html/owncloud /data/owncloud
RUN yum install -y php-mysql
Expand Down
711 changes: 440 additions & 271 deletions Docker/README.md

Large diffs are not rendered by default.

Binary file added Docker/img/cna.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 2 additions & 3 deletions Docker/registry/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
FROM fedora:latest
RUN dnf update -y
RUN dnf install -y httpd mod_ssl
FROM fedora:30
RUN dnf install -y httpd
RUN useradd pki
RUN chmod 755 /home/pki
RUN rm /etc/httpd/conf.d/welcome.conf
Expand Down
6 changes: 4 additions & 2 deletions Docker/registry/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,20 @@ services:
build:
context: .
ports:
- "80:80"
- "81:80"
volumes:
- ./certs:/home/pki/srv
environment:
- PUBFQDN=
hostname: $PUBFQDN
restart: always
registry:
image:
registry:2
ports:
- "5500:5000"
- "443:443"
environment:
- REGISTRY_HTTP_ADDR=0.0.0.0:443
- REGISTRY_HTTP_TLS_CERTIFICATE=certs/repo.crt
- REGISTRY_HTTP_TLS_KEY=certs/repo.key
volumes:
Expand Down
8 changes: 4 additions & 4 deletions Docker/registry/run.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
#!/bin/bash
# Modify openssl.cnf to activate extensions (SAN)
sed -i -e 's/# req_extensions = v3_req/req_extensions = v3_req/' /etc/pki/tls/openssl.cnf
sed -i -e '/keyUsage = nonRepudiation, digitalSignature, keyEncipherment/ a subjectAltName = @alt_names' /etc/pki/tls/openssl.cnf
sed -i -e '/^keyUsage = nonRepudiation, digitalSignature, keyEncipherment/ a subjectAltName = @alt_names' /etc/pki/tls/openssl.cnf
cat << EOF >>/etc/pki/tls/openssl.cnf
[alt_names]
DNS.1 = $PUBFQDN
EOF

# Generate CA key + cert
umask 277 && openssl genrsa 2048 > ca/ca.key
umask 007 && openssl req -new -x509 -days 365 -subj "/C=FR/ST=/L=Grenoble/O=HPE/CN=ca" -key ca/ca.key > ca/ca.crt
umask 007 && openssl req -new -x509 -days 365 -subj "/C=FR/ST=Isere/L=Grenoble/O=CGI/CN=ca" -key ca/ca.key > ca/ca.crt
# Generate server (registry) key + csr
umask 002 && openssl genrsa 2048 > srv/repo.key
umask 002 && openssl req -new \
-subj "/C=FR/ST=/L=Grenoble/O=HPE/CN=$PUBFQDN" \
-subj "/C=FR/ST=Isere/L=Grenoble/O=CGI/CN=$PUBFQDN" \
-key srv/repo.key \
> srv/repo.csr
# Sign the csr with the CA
Expand All @@ -28,4 +28,4 @@ umask 002 && openssl x509 -req -in srv/repo.csr \
# Put the CA certificate on the web
cp /home/pki/ca/ca.crt /var/www/html
chown pki:pki /var/www/html/ca.crt && chmod 644 /var/www/html/ca.crt
/usr/sbin/apachectl -DFOREGROUND -k start
httpd -DFOREGROUND
26 changes: 26 additions & 0 deletions Docker/server.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# -*- coding: utf-8 -*-
# test on python 3.4 ,python of lower version has different
# module organization.
import http.server
import socketserver

PORT = 8000

Handler = http.server.SimpleHTTPRequestHandler

Handler.extensions_map = {
'.manifest': 'text/cache-manifest',
'.html': 'text/html',
'.png': 'image/png',
'.jpg': 'image/jpg',
'.svg': 'image/svg+xml',
'.css': 'text/css',
'.js': 'application/x-javascript',
'.md': 'text/markdown',
'': 'application/octet-stream', # Default
}

httpd = socketserver.TCPServer(("", PORT), Handler)

print("serving at port", PORT)
httpd.serve_forever()