diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..6787c506f --- /dev/null +++ b/Dockerfile @@ -0,0 +1,5 @@ +FROM openjdk:17.0.2-jdk-slim-buster +ARG JAR_FILE=target/*.jar +COPY resources /resources +COPY ${JAR_FILE} app.jar +ENTRYPOINT ["java", "-jar","app.jar"] \ No newline at end of file diff --git a/README.md b/README.md index 719b268f5..5ee08eaf7 100644 --- a/README.md +++ b/README.md @@ -27,4 +27,14 @@ - https://habr.com/ru/articles/259055/ Список выполненных задач: + +- Удалить социальные сети +- Вынести чувствительную информацию (jira.env) +- Добавить testcontainers +- Написать интеграционное тестирование для ProfileRestController +- Сделать рефакторинг метода com.javarush.jira.bugtracking.attachment.FileUtil#upload +- Добавить подсчет времени сколько задача находилась в работе и тестировании +- Добавить локализацию +- Написать Dockerfile для основного сервера +- Написать docker-compose файл для запуска контейнера сервера вместе с БД и nginx ... \ No newline at end of file diff --git a/config/nginx.conf b/config/nginx.conf index 82b9e234d..634d2c528 100644 --- a/config/nginx.conf +++ b/config/nginx.conf @@ -10,7 +10,7 @@ server { gzip_min_length 2048; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - root /opt/jirarush/resources; + root /resources; if ($request_uri ~ ';') {return 404;} diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 000000000..3e0bda448 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,39 @@ +version: "3.7" +services: + app: + container_name: jira-project + restart: always + build: + context: . + dockerfile: Dockerfile + ports: + - "8080:8080" + depends_on: + - db + - nginx + env_file: + - ./jira.env + + + db: + container_name: postgres_db + image: postgres:latest + restart: always + volumes: + - ./data/db:/var/lib/postgresql/data/ + ports: + - "5432:5432" + environment: + POSTGRES_USER: jira + POSTGRES_PASSWORD: JiraRush + + + nginx: + container_name: nginx + image: nginx:latest + restart: always + ports: + - "80:80" + volumes: + - ./config/nginx.conf:/etc/nginx/conf.d/nginx.conf + diff --git a/jira.env b/jira.env new file mode 100644 index 000000000..34c618996 --- /dev/null +++ b/jira.env @@ -0,0 +1,14 @@ +DB_URL=jdbc:postgresql://db:5432/jira +DB_USERNAME=jira +DB_PASSWORD=JiraRush +MAIL_HOST=smtp.gmail.com +MAIL_USERNAME=jira4jr@gmail.com +MAIL_PASSWORD=zdfzsrqvgimldzyj +MAIL_PORT=587 +MAIL_USERNAME_TEST=jira4jr@gmail.com +GITHUB_CLIENT_ID=3d0d8738e65881fff266 +GITHUB_CLIENT_SECRET=0f97031ce6178b7dfb67a6af587f37e222a16120 +GOOGLE_CLIENT_ID=329113642700-f8if6pu68j2repq3ef6umd5jgiliup60.apps.googleusercontent.com +GOOGLE_CLIENT_SECRET=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 +GITLAB_CLIENT_ID=b8520a3266089063c0d8261cce36971defa513f5ffd9f9b7a3d16728fc83a494 +GITLAB_CLIENT_SECRET=e72c65320cf9d6495984a37b0f9cc03ec46be0bb6f071feaebbfe75168117004 \ No newline at end of file diff --git a/pom.xml b/pom.xml index f6c152c68..f6cb79c8b 100644 --- a/pom.xml +++ b/pom.xml @@ -142,6 +142,23 @@ junit-platform-launcher test + + org.testcontainers + junit-jupiter + 1.20.1 + test + + + org.testcontainers + postgresql + 1.20.1 + test + + + org.springframework.boot + spring-boot-starter-thymeleaf + + diff --git a/resources/mails/email-confirmation.html b/resources/mails/email-confirmation.html index 106e6129a..4f3eba176 100644 --- a/resources/mails/email-confirmation.html +++ b/resources/mails/email-confirmation.html @@ -1,13 +1,13 @@ - + - JiraRush - подтверждение почты + JiraRush - подтверждение почты -

-

Чтобы завершить настройку учетной записи и начать пользоваться JiraRush, подтвердите, что вы правильно указали вашу +

+

Чтобы завершить настройку учетной записи и начать пользоваться JiraRush, подтвердите, что вы правильно указали вашу электронную почту.

-Подтвердить почту +Подтвердить почту \ No newline at end of file diff --git a/resources/mails/password-reset.html b/resources/mails/password-reset.html index b37a49007..3a7b68a67 100644 --- a/resources/mails/password-reset.html +++ b/resources/mails/password-reset.html @@ -1,12 +1,12 @@ - + - JiraRush - установить новый пароль + JiraRush - установить новый пароль -

-

-Установить пароль +

+

+Установить пароль \ No newline at end of file diff --git a/resources/view/index.html b/resources/view/index.html index e8656ef96..c90fa6e3c 100644 --- a/resources/view/index.html +++ b/resources/view/index.html @@ -1,13 +1,13 @@ - + -

JiraRush Home page

+

JiraRush Home page

- +
diff --git a/resources/view/layout/footer.html b/resources/view/layout/footer.html index abd5ae968..2637f7de1 100644 --- a/resources/view/layout/footer.html +++ b/resources/view/layout/footer.html @@ -1,5 +1,5 @@ - +
diff --git a/resources/view/layout/header.html b/resources/view/layout/header.html index 451f9652d..d5b4caffc 100644 --- a/resources/view/layout/header.html +++ b/resources/view/layout/header.html @@ -1,5 +1,5 @@ - +
@@ -9,7 +9,7 @@