diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..d6588b0eb1266a2c365264c0ca12c307894d9025 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.idea +files diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..6546d51a161de52d0670abdc8c77543b6757c849 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,18 @@ +docker-build: + image: docker:stable + + # When using dind, it's wise to use the overlayfs driver for + # improved performance. + variables: + DOCKER_DRIVER: overlay2 + + services: + - docker:dind + before_script: + - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY + stage: build + tags: + - generic_privileged + script: + - docker build --pull -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" . + - docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..3702a47757b6e547bda8129e4b59c987d5cc258c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,5 @@ +FROM nextcloud:18-fpm +RUN mkdir -p /var/www/skeleton/Documents && mkdir -p /var/www/skeleton/Images +COPY patches/ /tmp/build_patches/ +RUN patch -u /usr/src/nextcloud/version.php -i /tmp/build_patches/001-version-bump.patch && \ + patch -u /usr/src/nextcloud/core/Controller/LoginController.php -i /tmp/build_patches/002-login-without-domain.patch diff --git a/patches/001-version-bump.patch b/patches/001-version-bump.patch new file mode 100644 index 0000000000000000000000000000000000000000..412ab4357bb4310ad0b32c0cc78e3fc76fdb66a8 --- /dev/null +++ b/patches/001-version-bump.patch @@ -0,0 +1,9 @@ +--- version.original.php 2020-12-04 10:55:45.000000000 +0100 ++++ version.php 2020-12-04 10:56:09.000000000 +0100 +@@ -1,5 +1,5 @@ + generateRedirect($redirect_url); + } + ++ $user = trim($user); ++ $domain = $this->config->getSystemValue("mail_domain"); ++ $domain_suffix = "@$domain"; ++ $admin_username = $_ENV["NEXTCLOUD_ADMIN_USER"]; ++ if (stristr($user, $domain_suffix) === FALSE && strcmp($user, $admin_username) != 0) { ++ $user = $user . $domain_suffix; ++ } ++ + $data = new LoginData( + $this->request, + trim($user),