Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

customizable look and feel for portal #20848

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
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
12 changes: 12 additions & 0 deletions make/harbor.yml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -314,3 +314,15 @@ cache:
# # suggest switch provider to redis if you were ran into the db connections spike around
# # the scenario of high concurrent pushing to same project, no improvement for other scenes.
# quota_update_provider: redis # Or db

# Look and Feel
# Use this section to customize the Look and Feel of your Harbor instance
# see https://goharbor.io/docs/latest/build-customize-contribute/customize-look-feel/
# look_and_feel:
# header_bg_color_dark_mode:
# header_bg_color_light_mode:
# login_bg_img:
# login_title:
# product_logo:
# product_name:
# product_introduction:
15 changes: 10 additions & 5 deletions make/photon/prepare/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
ARG harbor_base_image_version
ARG harbor_base_namespace
FROM ${harbor_base_namespace}/harbor-prepare-base:${harbor_base_image_version}
FROM photon:5.0

RUN tdnf install -y python3 python3-pip python3-PyYAML python3-jinja2 && tdnf clean all
RUN pip3 install pipenv==2022.1.8

#To install only htpasswd binary from photon package httpd
RUN tdnf install -y rpm cpio apr-util
RUN tdnf -y --downloadonly --downloaddir=/tmp/ install httpd && rpm2cpio /tmp/httpd-*.rpm | cpio -ivdm ./usr/bin/htpasswd && rm -f /tmp/*

ENV LANG en_US.UTF-8

WORKDIR /usr/src/app

RUN mkdir -p /harbor_make

COPY make/photon/prepare/Pipfile.lock make/photon/prepare/Pipfile /usr/src/app/
COPY Pipfile.lock Pipfile /usr/src/app/
RUN set -ex && pipenv install --deploy --system
COPY make/photon/prepare /usr/src/app
COPY . /usr/src/app

ENTRYPOINT [ "python3", "main.py" ]

Expand Down
21 changes: 21 additions & 0 deletions make/photon/prepare/migrations/version_2_12_0/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import os
from jinja2 import Environment, FileSystemLoader, StrictUndefined, select_autoescape
from utils.migration import read_conf

revision = '2.12.0'
down_revisions = ['2.11.0']

def migrate(input_cfg, output_cfg):
current_dir = os.path.dirname(__file__)
tpl = Environment(
loader=FileSystemLoader(current_dir),
undefined=StrictUndefined,
trim_blocks=True,
lstrip_blocks=True,
autoescape = select_autoescape()
).get_template('harbor.yml.jinja')

config_dict = read_conf(input_cfg)

with open(output_cfg, 'w') as f:
f.write(tpl.render(**config_dict))
Loading