From 8b71811efa4bf06ea20a9561d1db1b29feab1b67 Mon Sep 17 00:00:00 2001 From: Stanislaw Adaszewski Date: Fri, 1 May 2020 16:22:47 +0200 Subject: [PATCH] Working on examples --- example/certbot/Fockerfile | 14 ++++++++++++++ example/gitea/Fockerfile | 31 ++++++++++++++++++++++--------- example/gitea/focker-compose.yml | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 68 insertions(+), 9 deletions(-) create mode 100644 example/certbot/Fockerfile create mode 100644 example/gitea/focker-compose.yml diff --git a/example/certbot/Fockerfile b/example/certbot/Fockerfile new file mode 100644 index 0000000..fb643d8 --- /dev/null +++ b/example/certbot/Fockerfile @@ -0,0 +1,14 @@ +base: freebsd-latest + +steps: + - run: + - ASSUME_ALWAYS_YES=yes pkg bootstrap + - ASSUME_ALWAYS_YES=yes pkg install py37-certbot + - run: + - ASSUME_ALWAYS_YES=yes pkg install ca_root_nss + - run: + - echo 'weekly_certbot_enable="YES"' >>/etc/periodic.conf + - run: + - mkdir -p /certbot/webroot + - mkdir -p /usr/local/etc/letsencrypt + - sysrc sshd_enable=NO diff --git a/example/gitea/Fockerfile b/example/gitea/Fockerfile index 8e5c173..ff913ba 100644 --- a/example/gitea/Fockerfile +++ b/example/gitea/Fockerfile @@ -2,15 +2,28 @@ base: freebsd-latest steps: - run: - - pkg install -y gmake go node npm + - portsnap fetch extract - run: - - pkg install -y ca_root_nss - - fetch https://github.com/go-gitea/gitea/releases/download/v1.11.4/gitea-src-1.11.4.tar.gz - - mkdir gitea-build - - cd gitea-build - - tar -zvxf ../gitea-src-1.11.4.tar.gz + - ASSUME_ALWAYS_YES=yes pkg bootstrap + - ASSUME_ALWAYS_YES=yes IGNORE_OSVERSION=yes pkg install gmake go git git-lfs ca_root_nss + - run: # downgrade to Go 1.13 + - ASSUME_ALWAYS_YES=yes pkg remove go + - cd /usr/ports/lang/go + - sed -i -e 's/PORTVERSION?=.*1.14.2/PORTVERSION?= 1.13.10/g' Makefile + - sed -i -e 's/BOOTSTRAP_TAG=.*go1.14/BOOTSTRAP_TAG= go1.14/g' Makefile + - rm files/patch-src_cmd_go_internal_modload_init.go + - sed -i -e 's/ONLY_FOR_ARCHS=.*aarch64 amd64 armv6 armv7 i386/ONLY_FOR_ARCHS= amd64/g' Makefile + - ALLOW_UNSUPPORTED_SYSTEM=yes BATCH=yes make distclean makesum install clean - run: - - cd gitea-build - - TAGS="sqlite sqlite_unlock_notify pam" gmake build + - cd /usr/ports/www/gitea + - ALLOW_UNSUPPORTED_SYSTEM=yes BATCH=yes make install clean - run: - - pkg install -y git + - pkg remove -y gmake go + - run: + - rm -rvf /usr/ports/* + - rm -rvf /var/db/portsnap/* + - ASSUME_ALWAYS_YES=yes pkg autoremove + - run: + - sysrc sshd_enable=NO + - sysrc gitea_enable=YES + - sysrc syslogd_flags="-ss" diff --git a/example/gitea/focker-compose.yml b/example/gitea/focker-compose.yml new file mode 100644 index 0000000..d6e0b18 --- /dev/null +++ b/example/gitea/focker-compose.yml @@ -0,0 +1,32 @@ +images: + gitea-latest: . + certbot-latest: ../certbot + +volumes: + gitea-data: {} + certbot-webroot: {} + certbot-config-gitea: {} + +jails: + gitea: + image: gitea-latest + mounts: + gitea-data: /var/db/gitea + ip4.addr: 127.0.8.1 + exec.start: | + chown git:git /var/db/gitea && \ + sed -i -e 's/HTTP_ADDR = 127.0.0.1/HTTP_ADDR = 127.0.8.1/g' /usr/local/etc/gitea/conf/app.ini && \ + /bin/sh /etc/rc + + certbot-gitea: + image: certbot-latest + mounts: + certbot-webroot: /certbot/webroot + certbot-config-gitea: /usr/local/etc/letsencrypt + ip4.addr: 127.0.9.1 + exec.start: | + if [ ! -f /usr/local/etc/letsencrypt/cli.ini ]; then + echo 'webroot-path=/certbot/webroot' >>/usr/local/etc/letsencrypt/cli.ini && \ + echo 'authenticator=webroot' >>/usr/local/etc/letsencrypt/cli.ini; + fi && \ + /bin/sh /etc/rc