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

Dev4 #30

Open
wants to merge 311 commits into
base: main
Choose a base branch
from
Open

Dev4 #30

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
311 commits
Select commit Hold shift + click to select a range
f915c85
TP-565 add: TeshLogin
wonderf00l Oct 3, 2023
eb29292
dev del: block else
Gvidow Oct 3, 2023
09732de
added dataSourceName as a new OpenDB argument
wonderf00l Oct 4, 2023
11c590b
Merge branch 'dev' of github.com:go-park-mail-ru/2023_2_OND_team into…
wonderf00l Oct 4, 2023
ec91580
merged dev into TP_565-tests
wonderf00l Oct 4, 2023
3926040
TP-a49 add: fileserver
Gvidow Oct 4, 2023
e63ba1f
TP-565 add,update: added TestSignUp, TestLogout, updated previous tests
wonderf00l Oct 4, 2023
c228379
TP-a49 add: log fileserver
Gvidow Oct 4, 2023
afd7f4b
Merge pull request #3 from go-park-mail-ru/TP-565_tests
wonderf00l Oct 4, 2023
17f5304
minor update in test
wonderf00l Oct 4, 2023
96b1087
dev update: passing the config from main and return from main when er…
Gvidow Oct 4, 2023
04d3c4e
dev update: moved the const variable higher
Gvidow Oct 4, 2023
bfd13d7
dev add: wrapping errors in func OpenDB and prealocation
Gvidow Oct 4, 2023
10ff286
add targets for testing
wonderf00l Oct 4, 2023
7482c79
added tests for usecases
wonderf00l Oct 4, 2023
6dcc34e
TP-565 add: error test
Gvidow Oct 4, 2023
1250abb
dev update: configs, Makefile and handlers auth
Gvidow Oct 18, 2023
48c9f51
TP-aad add: er-diagram.png and docker-compose file
Gvidow Oct 18, 2023
d11590e
TP-aad add: migrations
Gvidow Oct 19, 2023
d05df61
TP-aad update: er-diagram.png
Gvidow Oct 19, 2023
ab5f116
TP-aad update: rename users relation to auth
Gvidow Oct 19, 2023
0bc9feb
TP-ee7 update: change register router and start server
Gvidow Oct 20, 2023
a5308df
TP-ee7 update: divided into 3 layers: delivery, usecase, repository
Gvidow Oct 21, 2023
bafd19d
TP-ee7 add: middleware auth
Gvidow Oct 21, 2023
fe33158
TP-46f add: repository based on posgtres
Gvidow Oct 21, 2023
a236967
TP-aad add: description relations and description of functional depen…
Gvidow Oct 22, 2023
94ff1e3
TP-aad update: relations.md
Gvidow Oct 22, 2023
813792a
TP-aad update: relations.md
Gvidow Oct 22, 2023
4230710
TP-5b0 add: handler upload and change avatar
Gvidow Oct 22, 2023
5eb05b7
TP-5b0 update: change upload avatar dir
Gvidow Oct 22, 2023
a66902b
TP-aad update: merge relations auth and profile in profile
Gvidow Oct 25, 2023
de61a65
TP-5b0 update: made requests to global variables
Gvidow Oct 25, 2023
f14ad69
TP-5b0 add: get all data in repository
Gvidow Oct 25, 2023
2f4da72
TP-aad update: rename migrations: add prefix 00n_*.sql
Gvidow Oct 25, 2023
8fee1b8
Merge branch 'TP-aad_db' into dev2
Gvidow Oct 25, 2023
f6098bc
TP-5b0 update: get profile info
Gvidow Oct 25, 2023
bc4a44c
TP-5b0 update: entity user
Gvidow Oct 25, 2023
42fe827
TP-5b0 update: handler edit user info
Gvidow Oct 26, 2023
2e055a0
Merge branch 'TP-5b0_handlers_profile' into dev2
Gvidow Oct 26, 2023
ca2d93e
dev2 add: search_path in all migrations
Gvidow Oct 26, 2023
39393bc
dev2 add: volumes in docker-compose.yml
Gvidow Oct 26, 2023
cffc94d
TP-5b0 add: validation of new user data
Gvidow Oct 26, 2023
b2fea41
Merge branch 'TP-5b0_handlers_profile' into dev2
Gvidow Oct 26, 2023
fafa6dd
TP-e3a add: pin creations
Gvidow Oct 26, 2023
4f85ac1
TP-e3a update: reducing the number of database requests when creating…
Gvidow Oct 27, 2023
0e1774c
TP-e3a add: likes, delete pin
Gvidow Oct 27, 2023
6af77ba
PT-e3a add: hander for edit pins
Gvidow Oct 27, 2023
73f3c50
TP-aad_db update: move creating triggers after create tables
Gvidow Oct 28, 2023
8ef0afb
TP-c80 add: middleware with csrf token verification or installation
Gvidow Oct 29, 2023
aa4c773
TP-c80 update: updated the check for the need to update the csrf token
Gvidow Oct 29, 2023
c19fa6d
TP-c80 update: updated the check for the need to update the csrf token
Gvidow Oct 29, 2023
aa62ad3
TP-2f3 add: repository with storage in redis
Gvidow Oct 29, 2023
7036971
Merge branch 'TP-e3a_handlers_pin' into dev2
Gvidow Oct 29, 2023
0bb79c7
dev2 update: hashing the password when it is changed
Gvidow Oct 29, 2023
ce380dd
dev2 add: method PUT in allowed
Gvidow Oct 29, 2023
58834db
TP-add_db update: add ERD-description
wonderf00l Oct 29, 2023
fcb4456
dev2 update: cors
Gvidow Oct 29, 2023
608b1c7
dev2 add: description of the database schema in mermaidjs; del: migra…
Gvidow Oct 29, 2023
a161d6a
TP-fcc_handlers_board update: add board repository, usecase, moved ge…
wonderf00l Oct 30, 2023
3bd4f3b
Merge branch 'dev2' into TP-ffc_handlers_board
wonderf00l Oct 30, 2023
6611b1f
TP-aad add: attribute amout_me for profile relation
Gvidow Oct 30, 2023
ca7c937
Merge branch 'TP-aad_db' into dev2
Gvidow Oct 30, 2023
99a016f
TP-aad add: migrations 003_alter_relations.sql
Gvidow Oct 30, 2023
a73d523
dev2 add: new migrainos 003
Gvidow Oct 30, 2023
19c6549
TP-5b0 add: attribute AboutMe
Gvidow Oct 30, 2023
b2a22b2
Merge branch 'TP-5b0_handlers_profile' into dev2
Gvidow Oct 30, 2023
7c99937
TP-e3a update: select pins from tape
Gvidow Oct 31, 2023
17095db
TP-e3a update: select pin for tape
Gvidow Nov 1, 2023
4f2b0f9
TP-e3a add: chek avalability pins
Gvidow Nov 2, 2023
4fb2585
TP-e3a add: check action fix pin on board
Gvidow Nov 2, 2023
833bc55
TP-e3a add: user info when get pin
Gvidow Nov 2, 2023
1b64bc3
TP-ffc_handlers_board update: add response codes/messages
wonderf00l Nov 3, 2023
8141be2
TP-ffc_handlers_board update: add repo.go with general info about rep…
wonderf00l Nov 3, 2023
4582b0f
TP-ffc_handlers_board update: add CreateBoard, GetUserBoards, GetCert…
wonderf00l Nov 3, 2023
1e88794
TP-ffc_handlers_board update: add access for contributors in GetUserB…
wonderf00l Nov 3, 2023
47ff285
TP-e3a add: getting user pins
Gvidow Nov 3, 2023
aa153ae
TP-ffc_handlers_board update: add UpdateBoard, DeleteBoard handlers, …
wonderf00l Nov 4, 2023
7f7ef4f
TP-a9b add: pkg/validator
Gvidow Nov 4, 2023
0a4cdb7
dev2 merge: fix merge dev2 and TP-a9b_image_valid
Gvidow Nov 4, 2023
cb54f60
TP-ffc_handlers_board update: fixed GetBoardsByUserID, GetBoardByID i…
wonderf00l Nov 4, 2023
c87ca52
dev2 add: returning count like when request on set like
Gvidow Nov 4, 2023
907df11
TP-113 add: logger
Gvidow Nov 4, 2023
b9d8393
TP-113 add: logger in context
Gvidow Nov 5, 2023
9bd35af
TP-113 add: get logger in handlers
Gvidow Nov 5, 2023
981c4bf
dev2 add: check set like to pin from user
Gvidow Nov 5, 2023
f6b3a03
Merge branch 'TP-ffc_handlers_board' into dev2
wonderf00l Nov 5, 2023
77680b0
Merge branch 'dev2' of github.com:go-park-mail-ru/2023_2_OND_team int…
wonderf00l Nov 5, 2023
0afbd3d
TP-113 add: logger with formater
Gvidow Nov 5, 2023
0fb8624
Merge branch 'TP-113_logging' into dev2
Gvidow Nov 5, 2023
e202855
TP-errors update: usecase image
Gvidow Nov 5, 2023
76c0e21
TP-erros update: both sides fall into range
Gvidow Nov 5, 2023
d620112
TP-f21 update: responseOk
Gvidow Nov 6, 2023
45c8707
TP-f21 update: rename BoardUsecase to boardUsecase
Gvidow Nov 6, 2023
f0e2cd9
TP-f21 update: repository board
Gvidow Nov 6, 2023
a5b028b
TP-f21 update: logger in delivery board
Gvidow Nov 6, 2023
585c0b3
TP-f21 add: fix pins on board
Gvidow Nov 6, 2023
dabb9d8
TP-28e add: mock for usecases and repositories
Gvidow Nov 6, 2023
122b891
TP-28e_mockTests update: add tests on CreateNewBoard, UpdateBoardInfo
wonderf00l Nov 6, 2023
44dcb6d
TP-2e4 update: old test
Gvidow Nov 6, 2023
fc96333
TP-28e_mockTests update: add GetBoardsByUsername test
wonderf00l Nov 6, 2023
350e337
TP-28e_mockTests update: modified test_with_coverage target
wonderf00l Nov 6, 2023
4ceb357
TP-28e_mockTests update: add GetCertainBoard, GetBoardByUsername tests
wonderf00l Nov 6, 2023
7798f91
TP-28e_mockTests update: add DeleteCertainBoard test
wonderf00l Nov 6, 2023
9136230
TP-28e_mockTests update: moved return value checking into if clause
wonderf00l Nov 7, 2023
8ab83e8
TP-28e_mockTests update: moved logger initialization to the outer scope
wonderf00l Nov 7, 2023
9b2590f
TP-28e_mockTests: replaced log.Fatal with t.Fatalf
wonderf00l Nov 7, 2023
9b366c5
TP-2e4 add testing cover
Gvidow Nov 7, 2023
0f2511c
TP-28e_mockTests update: delete makefile target, delete old pin useca…
wonderf00l Nov 7, 2023
e35385e
TP-28e_mockTests update: update makefile
wonderf00l Nov 7, 2023
0aab4f3
Merge branch 'dev2' into TP-28e_mockTests
wonderf00l Nov 7, 2023
c5524e2
Merge pull request #9 from go-park-mail-ru/TP-28e_mockTests
wonderf00l Nov 7, 2023
4c1c90f
dev2 update: deleted generated mock duplicates
wonderf00l Nov 7, 2023
4995fc4
TP-2e4 add: usecase test session and image
Gvidow Nov 7, 2023
755bd30
Merge pull request #10 from go-park-mail-ru/TP-2e4_tests_cover
Gvidow Nov 7, 2023
aa248b9
dev2 update: not view deleted pin in tape
Gvidow Nov 7, 2023
b2b1695
dev2 add: test for usecase pin
Gvidow Nov 7, 2023
5440c54
dev2 add: returning count like with delete
Gvidow Nov 8, 2023
e51042a
dev2 del: status code 204 on path /api/v1/csrf
Gvidow Nov 8, 2023
b232598
dev2 update: select pin users
Gvidow Nov 8, 2023
803f972
dev2 update: fail test
Gvidow Nov 8, 2023
34f143d
TP-2e4 add: cover usecase/pin
Gvidow Nov 8, 2023
1c06f9b
TP-ffc_handlers_board_fix update: add types.go with common content ty…
wonderf00l Nov 10, 2023
7de8fb1
TP-ffc_handlers_board_fix update: fixed tags assignment, add GetBoard…
wonderf00l Nov 10, 2023
68e1b12
TP-ffc_handlers_board_fix update: moved validation to the delivery la…
wonderf00l Nov 10, 2023
7e5938b
TP-ffc_handlers_board_fix update: regenerate mocks
wonderf00l Nov 10, 2023
154279c
TP-ffc_handlers_board_fix update: add board validation, additional er…
wonderf00l Nov 10, 2023
704383b
Merge branch 'dev2' into TP-ffc_handlers_board_fix
wonderf00l Nov 10, 2023
9c3e929
Merge pull request #12 from go-park-mail-ru/TP-ffc_handlers_board_fix
wonderf00l Nov 10, 2023
a0de50f
dev 2 update: minor board repo fix
wonderf00l Nov 10, 2023
5a12489
TP-db2 update: test version of working with the tape
Gvidow Nov 10, 2023
d2b251a
TP-db2 add: return user id on request login
Gvidow Nov 10, 2023
e023ebd
TP-db2 update: feed condition change
Gvidow Nov 10, 2023
2886ba1
dev2 update: fixed error display
wonderf00l Nov 12, 2023
bd4f068
dev2 update: add field in GetCertainBoard response
wonderf00l Nov 12, 2023
0b66ce3
TP-db2 update: feed pins
Gvidow Nov 12, 2023
2eac8d4
Merge pull request #13 from go-park-mail-ru/TP-db2_liked_pins
Gvidow Nov 12, 2023
5a10596
TP-db2: update repository add filters
Gvidow Nov 12, 2023
4df2052
Merge branch 'dev2' into TP-db2_liked_pins
Gvidow Nov 12, 2023
d6b51ab
Merge pull request #14 from go-park-mail-ru/TP-db2_liked_pins
Gvidow Nov 12, 2023
c7479a9
dev2 update: check valid photo for pin
Gvidow Nov 12, 2023
22bb6d2
TP-619 add: config for redis and .env file for postgres
Gvidow Nov 12, 2023
d7f69b1
TP-619 add: pkg config for parse *.conf files
Gvidow Nov 12, 2023
274847f
TP-619 add: connect with config
Gvidow Nov 12, 2023
000fca3
TP-619 update: check author for edit pin
Gvidow Nov 12, 2023
05b7224
dev2 update: add insertBoard, CreateBoard, GetBoardByUserID tests
wonderf00l Nov 15, 2023
bc4eb86
TP-fcc_board_dataflow_change: removed dto from usecase, changed entit…
wonderf00l Nov 16, 2023
6521b99
Merge pull request #15 from go-park-mail-ru/TP-fcc_board_dataflow_change
wonderf00l Nov 16, 2023
305555f
dev2 update: fixed pins view on board(s)
wonderf00l Nov 17, 2023
8c2dc94
dev2 update: changed null value processing in board repo methods
wonderf00l Nov 17, 2023
158ada4
dev 2 update: fixed double delete on board
wonderf00l Nov 17, 2023
acabd74
TP-d07 update: rename func to dirToSave
Gvidow Nov 17, 2023
1304a0e
update: use PrefixURLImage
Gvidow Nov 18, 2023
1459ce0
dev2 update: changed permissions on uploaded images, added :8081 in A…
wonderf00l Nov 18, 2023
e784459
Merge branch 'dev2' of github.com:go-park-mail-ru/2023_2_OND_team int…
wonderf00l Nov 18, 2023
c82bdb3
TP-f07 add: entity Message
Gvidow Nov 18, 2023
658591f
TP-f07 add write layers: delivery, usecase, repository for message
Gvidow Nov 19, 2023
7155b87
TP-f07 update sql queries
Gvidow Nov 19, 2023
26ee235
TP-f07 add: fake communication via websocket
Gvidow Nov 19, 2023
5077b35
TP-f07 add: origin patterns
Gvidow Nov 19, 2023
7db4eec
TP-f07 add: implementation http.Flusher
Gvidow Nov 20, 2023
5f210ac
TP-500 update: add global errors package with general application err…
wonderf00l Nov 21, 2023
2be95f2
TP-500 update: add function to get logger from ctx
wonderf00l Nov 21, 2023
9527e92
TP-500 update: add middleware with request timeout assignment
wonderf00l Nov 21, 2023
0e5fc51
TP-500 update: add general rest api errors on the delivery layer, add…
wonderf00l Nov 21, 2023
cc67ccf
TP-500 update: add user subscription handlers, converter from postgre…
wonderf00l Nov 21, 2023
64a6139
TP-409 add: description real time server as .proto
Gvidow Nov 21, 2023
6ab1d30
TP-500_subscriptions update: add handlers for getting user/profile in…
wonderf00l Nov 21, 2023
6371133
TP-500_subscriptions: add id field in profile header
wonderf00l Nov 22, 2023
25d9970
Merge branch 'TP-500_subscriptions' into dev3
wonderf00l Nov 22, 2023
0b539fa
TP-409 add: skeleton real time server
Gvidow Nov 22, 2023
7149f24
TP-409 add: partitions package internal/microservices/realtime
Gvidow Nov 22, 2023
423ec07
TP-409 update: websocket handler
Gvidow Nov 23, 2023
831b6fd
TP-409 update func new websocket
Gvidow Nov 23, 2023
685015d
TP-409 update: entity message json tag
Gvidow Nov 23, 2023
7299621
dev3: changed pagination for subscriptions, minor errors update
wonderf00l Nov 24, 2023
f937532
dev3 minor: removed default case
wonderf00l Nov 24, 2023
810c02a
TP-409 add: get feed user chats with other users
Gvidow Nov 24, 2023
21adbf3
merge TP-409 to dev3
Gvidow Nov 25, 2023
63bdccf
microservice auth
Gvidow Nov 25, 2023
c3111f8
TP-34d_search: add user, board, pin search with pagination and sort o…
wonderf00l Nov 26, 2023
6d9f6a8
TP-34d_search: changed pin likes aggregation
wonderf00l Nov 26, 2023
b7492da
TP-4b9 update: auth
Gvidow Nov 26, 2023
3220a4c
TP-0a2 add: metrics
Gvidow Nov 27, 2023
8ceb550
TP-34d_search: add DeletePinFromBoard handler
wonderf00l Nov 28, 2023
cf5940a
Merge branch 'TP-34d_search' into dev3
wonderf00l Nov 28, 2023
3c6b04b
dev3 minor: deleted redundant query.go from search repo
wonderf00l Nov 28, 2023
5046160
TP-0a2 update: move api/auth, api/realtime to internal/api/auth, inte…
Gvidow Nov 28, 2023
1f8e5a2
Merge branch 'TP-0a2_metrics' into dev3
Gvidow Nov 28, 2023
4f8e548
dev3 del defer close grpc connect
Gvidow Nov 29, 2023
73ca3b1
dev3 del: scheme https for prometheus target pinspire.online:9100
Gvidow Nov 29, 2023
3bca698
dev3 update: change option for proto files
Gvidow Nov 29, 2023
7b3f54b
TP-cc2 add: proto description service messenger
Gvidow Nov 29, 2023
0bb3a3a
TP-cc2 add: microservice messenger
Gvidow Nov 29, 2023
c6d8274
Tp cc2 ms message (#19)
Gvidow Nov 29, 2023
dfc3278
dev3: add author_username field in GetCertainBoard
wonderf00l Nov 29, 2023
272d5a9
Merge branch 'dev3' of github.com:go-park-mail-ru/2023_2_OND_team int…
wonderf00l Nov 29, 2023
8591ba1
dev3 update: address for metrics servers
Gvidow Nov 29, 2023
a119062
dev3 add: eventType in message response
Gvidow Dec 5, 2023
d7e827b
TP-c01_ci-cd: add Dockerfiles for nginx and microservices, add servic…
wonderf00l Dec 5, 2023
f8ec2a3
TP-c01_ci-cd: changed prometheus targets, servers addresses from loca…
wonderf00l Dec 5, 2023
e38aacf
TP-3a4 add: output files flag for logging
Gvidow Dec 6, 2023
4143183
dev3 add: generate mocks
Gvidow Dec 6, 2023
f862979
TP-c01_ci-cd: add linter configuration
wonderf00l Dec 7, 2023
ea75fda
TP-c01_ci-cd: add named volumes for postgres and redis, add compose.p…
wonderf00l Dec 7, 2023
6c8a215
TP-c01_ci-cd: add workflows description, add configuration file for a…
wonderf00l Dec 7, 2023
7318fe6
TP-c01_ci-cd: add kafka healthcheck
wonderf00l Dec 8, 2023
eaa7ece
TP-c01_ci-cd: deleted nginx config from compose.yml, changed triggers…
wonderf00l Dec 8, 2023
8d07119
TP-c01_ci-cd: deleted dev3 from triggers
wonderf00l Dec 9, 2023
df49eed
TP-c01_ci-cd: changed triggers, add step
wonderf00l Dec 9, 2023
4b6b885
TP-59b add: comments
Gvidow Dec 10, 2023
24e85bd
TP-6ec_easyjson: generated easyjson, changed serialization for user, …
wonderf00l Dec 13, 2023
39924e7
TP-1c3 add: notification ws handler
Gvidow Dec 13, 2023
8e1a2a4
TP-1c3 update: the subscription is carried out on the backend
Gvidow Dec 13, 2023
103d539
TP-1c3 update: work with realtime for chat
Gvidow Dec 13, 2023
4dcb282
TP-1c3 update: proto scheme for a reltime microservice
Gvidow Dec 14, 2023
9538afa
TP-1c3 update: chat
Gvidow Dec 14, 2023
bf36ddc
TP-1c3 update: rename request publish struct
Gvidow Dec 14, 2023
4626d24
TP-1c3 update: regenerate
Gvidow Dec 14, 2023
02b3da9
TP-1c3 add: notification after commenting on the pin
Gvidow Dec 15, 2023
430f974
TP-1c3 add: easyjson generation
Gvidow Dec 15, 2023
ea2a4d0
TP-8da update: returned user from and to when deleting message
Gvidow Dec 17, 2023
5fcf9c3
Merge pull request #22 from go-park-mail-ru/TP-6ec_easyjson
Gvidow Dec 19, 2023
1c0e335
Merge branch 'dev4' into TP-c01_ci-cd
Gvidow Dec 19, 2023
d63df1b
Update websocket.go: delete unused package "os"
Gvidow Dec 19, 2023
cd3b116
Merge pull request #23 from go-park-mail-ru/TP-c01_ci-cd
Gvidow Dec 19, 2023
2d1c6d2
TP-6ec_easyjson: add rest easyjson
wonderf00l Dec 19, 2023
fab4cf5
Merge pull request #24 from go-park-mail-ru/TP-6ec_easyjson
wonderf00l Dec 19, 2023
febce68
dev4: removed pull request trigger for deploy workflow
wonderf00l Dec 19, 2023
e3d1477
dev4: replaced auth service host:port string with env variables, move…
wonderf00l Dec 19, 2023
0170995
TP-87a_filtration: add filtration of pin content
wonderf00l Dec 19, 2023
ff13346
TP-87a_filtration: add task with cloud api token provision, add '2023…
wonderf00l Dec 19, 2023
1b8f327
Merge pull request #25 from go-park-mail-ru/TP-87a_filtration
wonderf00l Dec 19, 2023
6311811
dev4: replaced google vision client with image filter interface
wonderf00l Dec 20, 2023
e4dc478
de4: changed deployment branch, add cloud api token to the .env file
wonderf00l Dec 20, 2023
cae7718
dev4: add images volume for main service container
wonderf00l Dec 20, 2023
e71947b
dev4: changed makefile variable, included all branches in CI
wonderf00l Dec 20, 2023
a57dbec
dev4: add skip_files for linter
wonderf00l Dec 20, 2023
39f6e2f
dev4: fix comment
wonderf00l Dec 20, 2023
2a28e24
dev4: fix linter
wonderf00l Dec 20, 2023
d582b3f
dev4: added profanityCensor, changed XSS sanitizer, added convertedHT…
wonderf00l Dec 24, 2023
4e60714
dev4: add advertised listeners in kafka container environment, add zo…
wonderf00l Dec 24, 2023
d387657
TP-f07 update: fixed a messed up parameter
Gvidow Dec 27, 2023
16144b1
Merge pull request #27 from go-park-mail-ru/TP-f07_fix
Gvidow Dec 27, 2023
aeffef9
dev4: changed profanity censor
wonderf00l Dec 28, 2023
2f1d1c2
TP-f07 update: get deleted message
Gvidow Dec 28, 2023
f4b29eb
Merge pull request #28 from go-park-mail-ru/TP-f07_fix
Gvidow Dec 28, 2023
ecc73f0
Edit origin (#32)
Gvidow Feb 25, 2024
9a6b07b
Updated host in deployment.yml
wonderf00l Feb 25, 2024
70ad140
Updated host in last job deployment.yml
wonderf00l Feb 25, 2024
02bb5c2
dev4: Update usecase.go - changed image prefix
wonderf00l Mar 2, 2024
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
31 changes: 31 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Start pinspire CI

on:
workflow_dispatch: {}
push: {}
pull_request:
types: [opened, edited, reopened]

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Get repository code
uses: actions/checkout@v4
- name: Test application
continue-on-error: true
run: go test ./...
lint:
runs-on: ubuntu-latest
steps:
- name: Get repository code
uses: actions/checkout@v4
- name: Lint application
run: make lint
build:
runs-on: ubuntu-latest
steps:
- name: Get repository code
uses: actions/checkout@v4
- name: Build application
run: make build_all
58 changes: 58 additions & 0 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Start Pinspire deployment

on:
workflow_dispatch: {}
push:
branches:
- main
- dev4

jobs:
build_images:
runs-on: ubuntu-latest
steps:
- name: get repository code
uses: actions/checkout@v4
- name: Login to DockerHub Registry
run: echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin
- name: Build docker images of services
run: |
docker build -t pinspireapp/main:latest -f deployments/Dockerfile.main . &
docker build -t pinspireapp/auth:latest -f deployments/Dockerfile.auth . &
docker build -t pinspireapp/realtime:latest -f deployments/Dockerfile.realtime . &
docker build -t pinspireapp/messenger:latest -f deployments/Dockerfile.messenger . &
for p in $(jobs -p); do wait "$p" || { echo "job $p failed" >&2; exit; }; done
- name: Push docker images
run: |
docker push pinspireapp/main:latest &
docker push pinspireapp/auth:latest &
docker push pinspireapp/realtime:latest &
docker push pinspireapp/messenger:latest &
for p in $(jobs -p); do wait "$p" || { echo "job $p failed" >&2; exit; }; done

deploy:
runs-on: ubuntu-latest
needs: build_images
steps:
- name: fetch changes
uses: appleboy/ssh-action@master
with:
host: pinspire.site
username: ${{ secrets.REMOTE_USERNAME }}
key: ${{ secrets.PRIVATE_KEY }}
script: |
cd ${{ secrets.PINSPIRE_BACKEND_PATH }}
sudo git switch dev4
sudo git pull
- name: deploy application
uses: appleboy/ssh-action@master
with:
host: pinspire.site
username: ${{ secrets.REMOTE_USERNAME }}
key: ${{ secrets.PRIVATE_KEY }}
script: |
cd ${{ secrets.PINSPIRE_BACKEND_PATH }}/deployments
sudo docker compose down main_service auth_service realtime_service messenger_service
sudo docker rmi pinspireapp/main:latest pinspireapp/auth:latest pinspireapp/realtime:latest pinspireapp/messenger:latest
sudo docker compose -f docker-compose.yml -f compose.prod.yml up -d

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,6 @@ testdata/
cert/
.env
redis.conf
inventory
keyVision.json
script*
26 changes: 26 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,31 @@
.PHONY: build run test test_with_coverage cleantest retest doc generate cover_all currcover
.PHONY: build_auth build_realtime build_messenger build_all
.PHONY: .install-linter lint lint-fast

ENTRYPOINT=cmd/app/main.go
DOC_DIR=./docs
COV_OUT=coverage.out
COV_HTML=coverage.html
CURRCOVER=github.com/go-park-mail-ru/2023_2_OND_team/internal/pkg/delivery/http/v1

PROJECT_BIN = $(CURDIR)/bin
$(shell [ -f bin ] || mkdir -p $(PROJECT_BIN))
GOLANGCI_LINT = $(PROJECT_BIN)/golangci-lint

build:
go build -o bin/app cmd/app/*.go

build_auth:
go build -o bin/auth cmd/auth/*.go

build_realtime:
go build -o bin/realtime cmd/realtime/*.go

build_messenger:
go build -o bin/messenger cmd/messenger/*.go

build_all: build build_auth build_realtime build_messenger

run: build
./bin/app

Expand Down Expand Up @@ -40,3 +57,12 @@ cover_all:
currcover:
go test -cover -v -coverprofile=cover.out ${CURRCOVER}
go tool cover -html=cover.out -o cover.html

.install-linter:
[ -f $(PROJECT_BIN)/golangci-lint ] || curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(PROJECT_BIN) v1.55.2

lint: .install-linter
$(GOLANGCI_LINT) run ./... --config=configs/.golangci.yml

lint-fast: .install-linter
$(GOLANGCI_LINT) run ./... --fast --config=configs/.golangci.yml
41 changes: 41 additions & 0 deletions api/proto/auth.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
syntax = "proto3";

import "google/protobuf/empty.proto";
import "google/protobuf/timestamp.proto";

option go_package = "github.com/go-park-mail-ru/2023_2_OND_team/internal/api/auth";

package auth;

service Auth {
rpc Register(RegisterData) returns (google.protobuf.Empty) {}
rpc Login(Credentials) returns (Session) {}
rpc Logout(Session) returns (google.protobuf.Empty) {}
rpc GetUserID(Session) returns (UserID) {}
}

message Credentials {
string password = 1;
string username = 2;
}

message RegisterData {
Credentials cred = 1;
string email = 2;
}

message User {
int64 id = 1;
string username = 2;
string avatar = 3;
}

message Session {
string key = 1;
int64 userID = 2;
google.protobuf.Timestamp expire = 3;
}

message UserID {
int64 id = 1;
}
64 changes: 64 additions & 0 deletions api/proto/messenger.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
syntax = "proto3";

import "google/protobuf/empty.proto";

option go_package = "github.com/go-park-mail-ru/2023_2_OND_team/internal/api/messenger";

package messenger;

service Messenger {
rpc UserChatsWithOtherUsers(FeedChatRequest) returns (FeedChat) {}
rpc SendMessage(Message) returns (MsgID) {}
rpc MessageFromChat(FeedMessageRequest) returns (FeedMessage) {}
rpc UpdateMessage(Message) returns (google.protobuf.Empty) {}
rpc DeleteMessage(MsgID) returns (google.protobuf.Empty) {}
rpc GetMessage(MsgID) returns (Message) {}
}

message MsgID {
int64 id = 1;
}

message Message {
MsgID id = 1;
int64 user_from = 2;
int64 user_to = 3;
string content = 4;
}

message Chat {
int64 userID1 = 1;
int64 userID2 = 2;
}

message FeedChatRequest {
int64 count = 1;
int64 lastID = 2;
}

message FeedMessageRequest {
Chat chat = 1;
int64 count = 2;
int64 lastID = 3;
}

message WichWhomChat {
int64 userID = 1;
string username = 2;
string avatar = 3;
}

message ChatWithUser {
int64 lastMessageID = 1;
WichWhomChat chat = 2;
}

message FeedMessage {
repeated Message messages = 1;
int64 lastID = 2;
}

message FeedChat {
repeated ChatWithUser chats = 1;
int64 lastID = 2;
}
49 changes: 49 additions & 0 deletions api/proto/realtime.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
syntax = "proto3";

import "google/protobuf/empty.proto";

option go_package = "github.com/go-park-mail-ru/2023_2_OND_team/internal/api/realtime";

package realtime;

service RealTime {
rpc Publish(PublishMessage) returns (google.protobuf.Empty) {}
rpc Subscribe(Channels) returns (stream Message) {}
}

message Channels {
repeated Channel chans = 1;
}

message Channel {
string topic = 1;
string name = 2;
}

enum EventType {
EV_CREATE = 0;
EV_DELETE = 1;
EV_UPDATE = 2;
}

message EventObject {
int64 id = 1;
EventType type = 2;
}

message EventMap {
int64 type = 1;
map<string, string> m = 2;
}

message Message {
oneof body {
EventObject object = 1;
EventMap content = 2;
}
}

message PublishMessage {
Channel channel = 1;
Message message = 2;
}
8 changes: 0 additions & 8 deletions cmd/app/config.go

This file was deleted.

20 changes: 19 additions & 1 deletion cmd/app/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,18 @@ package main

import (
"context"
"flag"
"fmt"
"os"

"github.com/go-park-mail-ru/2023_2_OND_team/internal/app"
"github.com/go-park-mail-ru/2023_2_OND_team/pkg/logger"
"github.com/joho/godotenv"
)

var (
logOutput = flag.String("log", "stdout", "file paths to write logging output to")
logErrorOutput = flag.String("logerror", "stderr", "path to write internal logger errors to.")
)

// @title Pinspire API
Expand All @@ -21,15 +29,25 @@ import (
// @license.url http://www.apache.org/licenses/LICENSE-2.0.html

func main() {
godotenv.Load()
flag.Parse()
ctxBase, cancel := context.WithCancel(context.Background())
defer cancel()

log, err := logger.New(logger.RFC3339FormatTime())
log, err := logger.New(
logger.RFC3339FormatTime(),
logger.SetOutputPaths(*logOutput),
logger.SetErrorOutputPaths(*logErrorOutput),
)
if err != nil {
fmt.Println(err)
return
}
defer log.Sync()

configFiles := app.ConfigFiles{
ServerConfigFile: "configs/config.yml",
AddrAuthServer: os.Getenv("AUTH_SERVICE_HOST") + ":" + os.Getenv("AUTH_SERVICE_PORT"), // "localhost:8085",
}
app.Run(ctxBase, log, configFiles)
}
8 changes: 8 additions & 0 deletions cmd/auth/config.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package main

import "github.com/go-park-mail-ru/2023_2_OND_team/internal/app/auth"

var configAuth = auth.Config{
Addr: "0.0.0.0:8085",
RedisFileConfig: "redis.conf",
}
20 changes: 20 additions & 0 deletions cmd/auth/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package main

import (
"context"
"fmt"

"github.com/go-park-mail-ru/2023_2_OND_team/internal/app/auth"
"github.com/go-park-mail-ru/2023_2_OND_team/pkg/logger"
)

func main() {
log, err := logger.New(logger.RFC3339FormatTime())
if err != nil {
fmt.Println(err)
return
}
defer log.Sync()

auth.Run(context.Background(), log, configAuth)
}
Loading