Skip to content
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
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
...
2 changes: 1 addition & 1 deletion config/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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;}

Expand Down
39 changes: 39 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -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

14 changes: 14 additions & 0 deletions jira.env
Original file line number Diff line number Diff line change
@@ -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
17 changes: 17 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,23 @@
<artifactId>junit-platform-launcher</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>junit-jupiter</artifactId>
<version>1.20.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>postgresql</artifactId>
<version>1.20.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>

</dependencies>

<build>
Expand Down
10 changes: 5 additions & 5 deletions resources/mails/email-confirmation.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<html th:lang="${#locale}" lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<title>JiraRush - подтверждение почты</title>
<title th:text="#{email.confirmation.title}">JiraRush - подтверждение почты</title>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
</head>
<body>
<p th:text="'Привет, ' + ${user.firstName} + '.'"/>
<p>Чтобы завершить настройку учетной записи и начать пользоваться JiraRush, подтвердите, что вы правильно указали вашу
<p th:text=" #{email.confirmation.text1} + ', ' + ${user.firstName} + '.'"/>
<p th:text="#{email.confirmation.text2}">Чтобы завершить настройку учетной записи и начать пользоваться JiraRush, подтвердите, что вы правильно указали вашу
электронную почту.</p>
<a th:href="${confirmationUrl}">Подтвердить почту</a>
<a th:text="#{email.confirmation.url}" th:href="${confirmationUrl}">Подтвердить почту</a>
</body>
</html>
10 changes: 5 additions & 5 deletions resources/mails/password-reset.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<html th:lang="${#locale}" lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:fragment="head">
<title>JiraRush - установить новый пароль</title>
<title th:text="#{email.reset.title}">JiraRush - установить новый пароль</title>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
</head>
<body>
<p th:text="'Привет, ' + ${user.firstName} + '.'"/>
<p th:text="'Мы получили запрос на установку нового пароля JiraRush для учетной записи: ' + ${user.email} + '.'"/>
<a th:href="${resetUrl}">Установить пароль</a>
<p th:text="#{email.reset.text1} + ', ' + ${user.firstName} + '.'"/>
<p th:text="#{email.reset.text2} + ' ' + ${user.email} + '.'"/>
<a th:text="#{email.reset.url}" th:href="${resetUrl}">Установить пароль</a>
</body>
</html>
6 changes: 3 additions & 3 deletions resources/view/index.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<!DOCTYPE html>
<html lang="ru" xmlns:th="http://www.thymeleaf.org">
<html th:lang="${#locale}" lang="en" xmlns:th="http://www.thymeleaf.org">
<!--/*@thymesVar id="authUser" type="com.javarush.jira.login.AuthUser"*/-->

<th:block th:replace="~{layout/main::page(title='JiraRush: mini bugtracking system',appMain=~{::appMain})}">
<appMain>
<h1>JiraRush Home page</h1>
<h1 th:text="#{index.body.header}">JiraRush Home page</h1>
<div th:if="${authUser} != null">
<form action="/ui/logout" method="post">
<button class="btn btn-primary btn-lg mt-3" type="submit">Logout</button>
<button class="btn btn-primary btn-lg mt-3" type="submit" th:text="#{index.button.logout}">Logout</button>
</form>
</div>
</appMain>
Expand Down
44 changes: 22 additions & 22 deletions resources/view/layout/footer.html
Original file line number Diff line number Diff line change
@@ -1,79 +1,79 @@
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<html th:lang="${#locale}" lang="en" xmlns:th="http://www.thymeleaf.org">

<div th:fragment="footer">
<footer class="text-center text-lg-start text-white footer">
<section>
<div class="container text-center text-md-start">
<div class="row ms-0 ms-md-5">
<div class="col-md-4 col-xl-2 mb-4 mt-4">
<h6 class="fw-bold mt-2 mt-md-0 mb-4">
<h6 th:text="#{footer.learn}" class="fw-bold mt-2 mt-md-0 mb-4">
LEARN
</h6>
<p>
<a class="footer-href" href="#">Programming Courses</a>
<a th:text="#{footer.learn.courses}"class="footer-href" href="#">Programming Courses</a>
</p>
<p>
<a class="footer-href" href="#">Java Course</a>
<a th:text="#{footer.learn.java}" class="footer-href" href="#">Java Course</a>
</p>
<p>
<a class="footer-href" href="#">Help with Tasks</a>
<a th:text="#{footer.learn.help}" class="footer-href" href="#">Help with Tasks</a>
</p>
<p>
<a class="footer-href" href="#">Pricing</a>
<a th:text="#{footer.learn.pricing}" class="footer-href" href="#">Pricing</a>
</p>
<p>
<a class="footer-href" href="#">Game Projects</a>
<a th:text="#{footer.learn.project}" class="footer-href" href="#">Game Projects</a>
</p>
</div>
<div class="col-md-4 col-xl-2 mb-4 mt-0 mt-md-4">
<h6 class="fw-bold mb-4">
<h6 th:text="#{footer.community}" class="fw-bold mb-4">
COMMUNITY
</h6>
<p>
<a class="footer-href" href="#">Users</a>
<a th:text="#{footer.community.users}" class="footer-href" href="#">Users</a>
</p>
<p>
<a class="footer-href" href="#">Articles</a>
<a th:text="#{footer.community.articles}" class="footer-href" href="#">Articles</a>
</p>
<p>
<a class="footer-href" href="#">Forum</a>
<a th:text="#{footer.community.forum}" class="footer-href" href="#">Forum</a>
</p>
<p>
<a class="footer-href" href="#">Chat</a>
<a th:text="#{footer.community.chat}" class="footer-href" href="#">Chat</a>
</p>
<p>
<a class="footer-href" href="#">Success Stories</a>
<a th:text="#{footer.community.stories}" class="footer-href" href="#">Success Stories</a>
</p>
</div>
<div class="col-md-4 col-xl-2 mb-4 mt-0 mt-md-4">
<h6 class="fw-bold mb-4">COMPANY</h6>
<h6 th:text="#{footer.company}" class="fw-bold mb-4">COMPANY</h6>
<p>
<a class="footer-href" href="#">About us</a>
<a th:text="#{footer.company.about}" class="footer-href" href="#">About us</a>
<p>
<p>
<a class="footer-href" href="#">Contacts</a>
<a th:text="#{footer.company.contacts}" class="footer-href" href="#">Contacts</a>
<p>
<p>
<a class="footer-href" href="#">Reviews</a>
<a th:text="#{footer.company.reviews}" class="footer-href" href="#">Reviews</a>
<p>
<p>
<a class="footer-href" href="#">FAQ</a>
<a th:text="#{footer.company.faq}" class="footer-href" href="#">FAQ</a>
<p>
<p>
<a class="footer-href" href="#">Support</a>
<a th:text="#{footer.company.support}" class="footer-href" href="#">Support</a>
<p>
</div>

<div class="col-xl-5 mb-4 mt-0 mt-md-4">
<img alt="JavaRush" class="mb-3" src="/static/images/logo/jr.svg">
<p>
<p th:text="#{footer.description}">
JavaRush is an online course for learning Java programming from scratch.
This course is a perfect way to master Java for beginners.
It contains 1200+ of tasks with instant verification and an essential scope of Java
fundamentals theory.
</p>
<h6>FOLLOW US</h6>
<h6 th:text="#{footer.follow}">FOLLOW US</h6>
<div>
<a class="btn btn-sm btn-outline-light me-2" href="#" type="button">
<i class="fab fa-facebook-f pe-1"></i>
Expand All @@ -98,7 +98,7 @@ <h6>FOLLOW US</h6>
</div>
</div>
</section>
<div class="text-center pb-4">
<div class="text-center pb-4" th:text="#{footer.made}">
Programmers Are Made, Not Born © 2023 JavaRush
</div>
</footer>
Expand Down
10 changes: 5 additions & 5 deletions resources/view/layout/header.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<html th:lang="${#locale}" lang="en" xmlns:th="http://www.thymeleaf.org">
<!--/*@thymesVar id="authUser" type="com.javarush.jira.login.AuthUser"*/-->

<div th:fragment="header">
Expand All @@ -9,21 +9,21 @@
<div class="collapse navbar-collapse mt-2 mb-2 px-5">
<ul class="navbar-nav m-auto">
<form class="d-flex" role="search">
<input aria-label="Search" class="form-control" id="header-search" placeholder="Search"
<input th:placeholder="#{header.search}" aria-label="Search" class="form-control" id="header-search" placeholder="Search"
type="search">
</form>
<li class="nav-item menu-item me-3 ms-4">
<a class="btn btn-yellow" href="/doc" target="_blank" type="button">Swagger API</a>
</li>
</ul>
<div th:if="${authUser} == null">
<a class="btn btn-orange" href="/view/login" type="button">Login/Register</a>
<a th:text="#{header.login}" class="btn btn-orange" href="/view/login" type="button">Login/Register</a>
</div>
<th:block th:if="${authUser} != null">
<a class="btn btn-orange" href="/ui/profile" type="button"><i
<a th:text="#{header.profile}" class="btn btn-orange" href="/ui/profile" type="button"><i
class="fa-solid fa-address-card"></i> Profile</a>
<form action="/ui/logout" class="mx-2" method="post">
<button class="btn btn-yellow btn-orange" type="submit"><i class="fa-solid fa-sign-out"></i>
<button th:text="#{header.logout}" class="btn btn-yellow btn-orange" type="submit"><i class="fa-solid fa-sign-out"></i>
Logout
</button>
</form>
Expand Down
12 changes: 6 additions & 6 deletions resources/view/layout/sidebar.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<html th:lang="${#locale}" lang="en" xmlns:th="http://www.thymeleaf.org">
<!--/*@thymesVar id="authUser" type="com.javarush.jira.login.AuthUser"*/-->

<div th:fragment="sidebar">
Expand Down Expand Up @@ -39,28 +39,28 @@
<ul class="navbar-nav mb-2 mb-lg-0" th:if="${authUser != null}">
<li class="nav-item mt-3 mt-lg-0 mb-0 mb-lg-3" id="tree">
<a class="nav-link sidebar-nav-link" href="/view/tree">
<span class="ms-4"><i class="fa-solid fa-folder-tree fa-fw me-2"></i>Tree</span>
<span th:text="#{menu.tree}" class="ms-4"><i class="fa-solid fa-folder-tree fa-fw me-2"></i>Tree</span>
</a>
</li>
<li class="nav-item mt-3 mt-lg-0 mb-0 mb-lg-3" id="dashboard">
<a class="nav-link sidebar-nav-link" href="/ui/dashboard">
<span class="ms-4"><i class="fa-solid fa-rectangle-list fa-fw me-2"></i>Dashboard</span>
<span th:text="#{menu.dashboard}" class="ms-4"><i class="fa-solid fa-rectangle-list fa-fw me-2"></i>Dashboard</span>
</a>
</li>
<li class="nav-item mt-3 mt-lg-0 mb-0 mb-lg-3" id="reports">
<a class="nav-link sidebar-nav-link" href="/ui/reports">
<span class="ms-4"><i class="fa-solid fa-chart-simple fa-fw me-2"></i>Reports</span>
<span th:text="#{menu.reports}" class="ms-4"><i class="fa-solid fa-chart-simple fa-fw me-2"></i>Reports</span>
</a>
</li>
<th:block th:if="${authUser.isAdmin()}">
<li class="nav-item mt-3 mt-lg-0 mb-0 mb-lg-3" id="users">
<a class="nav-link sidebar-nav-link" href="/view/admin/users">
<span class="ms-4"><i class="fa-solid fa-users fa-fw me-2"></i>Users</span>
<span th:text="#{menu.users}" class="ms-4"><i class="fa-solid fa-users fa-fw me-2"></i>Users</span>
</a>
</li>
<li class="nav-item mt-3 mt-lg-0 mb-0 mb-lg-3" id="references">
<a class="nav-link sidebar-nav-link" href="/ui/admin/references">
<span class="ms-4"><i class="fa-solid fa-book-bookmark fa-fw me-2"></i>References</span>
<span th:text="#{menu.references}" class="ms-4"><i class="fa-solid fa-book-bookmark fa-fw me-2"></i>References</span>
</a>
</li>
</th:block>
Expand Down
8 changes: 0 additions & 8 deletions resources/view/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,6 @@ <h3 class="mb-3">Sign in</h3>
type="button">
<i class="fa-brands fa-google"></i>
</a>
<a class="btn btn-primary btn-lg me-2" href="/oauth2/authorization/vk" style="padding-left: 17px; padding-right: 17px;"
type="button">
<i class="fa-brands fa-vk"></i>
</a>
<a class="btn btn-danger btn-lg me-2" href="/oauth2/authorization/yandex" style="padding-left: 21px; padding-right: 21px;"
type="button">
<i class="fa-brands fa-yandex"></i>
</a>
<a class="btn btn-dark btn-lg me-2" href="/oauth2/authorization/github" type="button">
<i class="fa-brands fa-github"></i>
</a>
Expand Down
Loading