Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • master
1 result

Target

Select target project
No results found
Select Git revision
  • bookworm-cleanup
  • master
2 results
Show changes

Commits on Source 33

10 files
+ 277
81
Compare changes
  • Side-by-side
  • Inline

Files

+21 −0
Original line number Original line Diff line number Diff line
@@ -15,5 +15,26 @@ build-bullseye:
    entrypoint: [""]
    entrypoint: [""]
  script:
  script:
    - echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
    - echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
    - /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile.debian-bullseye-mkdocs --destination $CI_REGISTRY_IMAGE/bullseye-mkdocs:$CI_COMMIT_TAG
    - /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile.debian-bullseye-hugo --destination $CI_REGISTRY_IMAGE/bullseye-hugo:$CI_COMMIT_TAG
    - /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile.debian-bullseye-hugo --destination $CI_REGISTRY_IMAGE/bullseye-hugo:$CI_COMMIT_TAG
    - /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile.debian-bullseye-directory-listing --destination $CI_REGISTRY_IMAGE/bullseye-directory-listing:$CI_COMMIT_TAG
    - /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile.debian-bullseye-directory-listing --destination $CI_REGISTRY_IMAGE/bullseye-directory-listing:$CI_COMMIT_TAG

build-bookworm:
  stage: build
  image:
    name: gcr.io/kaniko-project/executor:debug
    entrypoint: [""]
  script:
    - echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
    - /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile.debian-bookworm-mkdocs --destination $CI_REGISTRY_IMAGE/bookworm-mkdocs:$CI_COMMIT_TAG
    - /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile.debian-bookworm-hugo --destination $CI_REGISTRY_IMAGE/bookworm-hugo:$CI_COMMIT_TAG

build-trixie:
  stage: build
  image:
    name: gcr.io/kaniko-project/executor:debug
    entrypoint: [""]
  script:
    - echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
    - /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile.debian-trixie-hugo --destination $CI_REGISTRY_IMAGE/trixie-hugo:$CI_COMMIT_TAG
    
+10 −0
Original line number Original line Diff line number Diff line
FROM debian:bookworm

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get -qq update && \
    apt-get -qq dist-upgrade && \
    apt-get -qq install hugo libwebp7 libwebp-dev && \
    apt-get -qq clean
RUN ldconfig -v
RUN hugo version
+8 −0
Original line number Original line Diff line number Diff line
FROM debian:bookworm

RUN apt-get -qq update && \
    apt-get -qq dist-upgrade && \
    apt-get -qq install python3-pip && \
    apt-get -qq clean

RUN pip3 install --break-system-packages mkdocs mkdocs-static-i18n
Original line number Original line Diff line number Diff line
@@ -4,7 +4,8 @@ ENV DEBIAN_FRONTEND=noninteractive


RUN apt-get -qq update && \
RUN apt-get -qq update && \
    apt-get -qq dist-upgrade && \
    apt-get -qq dist-upgrade && \
    apt-get -qq install python3 python3-jinja2 && \
    apt-get -qq install python3 python3-jinja2 libexpat1 && \
    apt-get -qq clean
    apt-get -qq clean


COPY directory listing/create-index.py /usr/local/bin/create-directory-html-index
COPY directory-listing/create-index.py /usr/local/bin/create-directory-html-index
COPY directory-listing/templates/ /usr/local/share/templates/
+8 −0
Original line number Original line Diff line number Diff line
FROM debian:bullseye

RUN apt-get -qq update && \
    apt-get -qq dist-upgrade && \
    apt-get -qq install python3-pip && \
    apt-get -qq clean

RUN pip3 install mkdocs mkdocs-static-i18n
+8 −0
Original line number Original line Diff line number Diff line
FROM debian:trixie

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get -qq update && \
    apt-get -qq dist-upgrade && \
    apt-get -qq install hugo && \
    apt-get -qq clean
Original line number Original line Diff line number Diff line
#!/usr/bin/env python3
#!/usr/bin/env python3
import pathlib

import jinja2
import jinja2
import os
import os
import sys
from datetime import datetime
from datetime import datetime
import argparse


def timestamp_to_datetime(timestamp):
def timestamp_to_datetime(timestamp):
	return datetime.fromtimestamp(timestamp)
	return datetime.fromtimestamp(timestamp)


def main(inputfolder, outputfolder, ignore_files):
def main(inputfolder, outputfolder, template, ignore_files):
	jinjaenv = jinja2.Environment(autoescape=jinja2.select_autoescape())
	jinjaenv = jinja2.Environment(autoescape=jinja2.select_autoescape(), loader=jinja2.FileSystemLoader("/usr/local/share/templates"))
	jinjaenv.filters["timestamp_to_datetime"] = timestamp_to_datetime
	jinjaenv.filters["timestamp_to_datetime"] = timestamp_to_datetime
	template = jinjaenv.from_string("""<!DOCTYPE html>

		<html>
	template = jinjaenv.get_template(f"{template}.html.j2")
			<head>

				<meta http-equiv="content-type" content="text/html; charset=utf-8">
				<meta name="viewport" content="width=device-width">
				<style type="text/css">
					body,html {
						background: #fff;
						font-family: "Bitstream Vera Sans","Lucida Grande","Lucida Sans Unicode",Lucidux,Verdana,Lucida,sans-serif;
					}
					tr:nth-child(even) {
						background:#f4f4f4;
					}
					th,td {
						padding:0.1em 0.5em;
					}
					th {
						text-align:left;
						font-weight:bold;
						background:#eee;
						border-bottom:1px solid #aaa;
					}
					#list {
						border:1px solid #aaa;
						width:100%;
					}
					a {
						color:#a33;
					}
					a:hover {
						color:#e33;
					}
				</style>
			</head>
			<body>
				<h1>Index of /{{ path }}</h1>
				<table id="list">
					<thead>
						<tr>
							<th style="width:55%">
								File Name
							</th>
							<th style="width:20%">
								File Size</th>
							<th style="width:25%">
								Date
							</th>
						</tr>
					</thead>
					<tbody>
						<tr>
							<td class="link">
								<a href="../">Parent directory/</a>
							</td>
							<td class="size">-</td>
							<td class="date">-</td>
						</tr>
						{% for entry, stat, is_dir in entries %}
						<tr>
							<td class="link">
								<a href="{{ entry + ('/' if is_dir else '') }}" title="{{ entry }}">{{ entry  + ('/' if is_dir else '') }}</a>
							</td>
							<td class="size">{{ '-' if is_dir else stat.st_size|filesizeformat }}</td>
							<td class="date">{{ (stat.st_mtime|timestamp_to_datetime).isoformat(timespec='seconds') }}</td>
						</tr>
						{% endfor  %}
					</tbody>
				</table>
				<p><a href="https://legal.cccv.de">Impressum - Datenschutzerklärung</a></p>
			</body>
		</html>
	""")
	for path, dirs, files in os.walk(inputfolder):
	for path, dirs, files in os.walk(inputfolder):
		dirs.sort()
		dirs.sort()
		files.sort()
		files.sort()
@@ -96,7 +29,11 @@ def main(inputfolder, outputfolder, ignore_files):
		outputfile.close()
		outputfile.close()


if __name__ == '__main__':
if __name__ == '__main__':
	if len(sys.argv) != 3:
	parser = argparse.ArgumentParser(description='Create html directory index for given path.')
		print(f'Usage: {sys.argv[0]} <directory tree to create index from> <output path for index tree>')
	parser.add_argument('path', type=pathlib.Path, help='Path to create index from')
		sys.exit(1)
	parser.add_argument('output_directory', type=pathlib.Path, help='Directory for generated html files')
	main(inputfolder=sys.argv[1], outputfolder=sys.argv[2], ignore_files=['index.html'])
	parser.add_argument('--template', help='Template to use without file extension (.html.j2)', default='default')

	args = parser.parse_args()

	main(inputfolder=args.path, outputfolder=args.output_directory, template=args.template, ignore_files=['index.html'])
Original line number Original line Diff line number Diff line
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="content-type" content="text/html; charset=utf-8">
        <meta name="viewport" content="width=device-width">
        <style type="text/css">
            body,html {
                background: #fff;
                font-family: "Bitstream Vera Sans","Lucida Grande","Lucida Sans Unicode",Lucidux,Verdana,Lucida,sans-serif;
            }
            tr:nth-child(even) {
                background:#f4f4f4;
            }
            th,td {
                padding:0.1em 0.5em;
            }
            th {
                text-align:left;
                font-weight:bold;
                background:#eee;
                border-bottom:1px solid #aaa;
            }
            #list {
                border:1px solid #aaa;
                width:100%;
            }
            a {
                color:#a33;
            }
            a:hover {
                color:#e33;
            }
        </style>
    </head>
    <body>
        <h1>Index of /{{ path }}</h1>
        <table id="list">
            <thead>
                <tr>
                    <th style="width:55%">
                        File Name
                    </th>
                    <th style="width:20%">
                        File Size</th>
                    <th style="width:25%">
                        Date
                    </th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td class="link">
                        <a href="../">Parent directory/</a>
                    </td>
                    <td class="size">-</td>
                    <td class="date">-</td>
                </tr>
                {% for entry, stat, is_dir in entries if not entry.startswith('.') %}
                <tr>
                    <td class="link">
                        <a href="{{ entry + ('/' if is_dir else '') }}" title="{{ entry }}">{{ entry  + ('/' if is_dir else '') }}</a>
                    </td>
                    <td class="size">{{ '-' if is_dir else stat.st_size|filesizeformat }}</td>
                    <td class="date">{{ (stat.st_mtime|timestamp_to_datetime).isoformat(timespec='seconds') }}</td>
                </tr>
                {% endfor  %}
            </tbody>
        </table>
        <p><a href="https://legal.cccv.de">Impressum - Datenschutzerklärung</a></p>
    </body>
</html>
 No newline at end of file
+66 −0
Original line number Original line Diff line number Diff line
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="content-type" content="text/html; charset=utf-8">
        <meta name="viewport" content="width=device-width">
        <style type="text/css">
            body,html {
                background: #fff;
                font-family: "Bitstream Vera Sans","Lucida Grande","Lucida Sans Unicode",Lucidux,Verdana,Lucida,sans-serif;
            }
            tr:nth-child(even) {
                background:#f4f4f4;
            }
            th,td {
                padding:0.1em 0.5em;
            }
            th {
                text-align:left;
                font-weight:bold;
                background:#eee;
                border-bottom:1px solid #aaa;
            }
            #list {
                border:1px solid #aaa;
                width:100%;
            }
            a {
                color:#a33;
            }
            a:hover {
                color:#e33;
            }
        </style>
    </head>
    <body>
        <h1>Index of /{{ path }}</h1>
        <table id="list">
            <thead>
                <tr>
                    <th style="width:55%">
                        File Name
                    </th>
                    <th style="width:20%">
                        File Size</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td class="link">
                        <a href="../">Parent directory/</a>
                    </td>
                    <td class="size">-</td>
                </tr>
                {% for entry, stat, is_dir in entries if not entry.startswith('.') %}
                <tr>
                    <td class="link">
                        <a href="{{ entry + ('/' if is_dir else '') }}" title="{{ entry }}">{{ entry  + ('/' if is_dir else '') }}</a>
                    </td>
                    <td class="size">{{ '-' if is_dir else stat.st_size|filesizeformat }}</td>
                </tr>
                {% endfor  %}
            </tbody>
        </table>
        <p><a href="https://legal.rc3.world">Impressum - Datenschutzerklärung</a></p>
    </body>
</html>
Original line number Original line Diff line number Diff line
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="content-type" content="text/html; charset=utf-8">
        <meta name="viewport" content="width=device-width">
        <style type="text/css">
            body,html {
                background: #fff;
                font-family: "Bitstream Vera Sans","Lucida Grande","Lucida Sans Unicode",Lucidux,Verdana,Lucida,sans-serif;
            }
            tr:nth-child(even) {
                background:#f4f4f4;
            }
            th,td {
                padding:0.1em 0.5em;
            }
            th {
                text-align:left;
                font-weight:bold;
                background:#eee;
                border-bottom:1px solid #aaa;
            }
            #list {
                border:1px solid #aaa;
                width:100%;
            }
            a {
                color:#a33;
            }
            a:hover {
                color:#e33;
            }
        </style>
    </head>
    <body>
        <h1>Index of /{{ path }}</h1>
        <table id="list">
            <thead>
                <tr>
                    <th style="width:55%">
                        File Name
                    </th>
                    <th style="width:20%">
                        File Size</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td class="link">
                        <a href="../">Parent directory/</a>
                    </td>
                    <td class="size">-</td>
                </tr>
                {% for entry, stat, is_dir in entries if not entry.startswith('.') %}
                <tr>
                    <td class="link">
                        <a href="{{ entry + ('/' if is_dir else '') }}" title="{{ entry }}">{{ entry  + ('/' if is_dir else '') }}</a>
                    </td>
                    <td class="size">{{ '-' if is_dir else stat.st_size|filesizeformat }}</td>
                </tr>
                {% endfor  %}
            </tbody>
        </table>
        <p><a href="https://legal.cccv.de">Impressum - Datenschutzerklärung</a></p>
    </body>
</html>
 No newline at end of file