diff --git a/build/alpine/Dockerfile b/build/alpine/Dockerfile index 110586b3822..f903fa2afa3 100644 --- a/build/alpine/Dockerfile +++ b/build/alpine/Dockerfile @@ -8,17 +8,18 @@ FROM wire-server-builder:alpine as builder ARG service -COPY . /src +COPY . /src/wire-server/ -RUN cd /src/services/${service} && make install +RUN cd /src/wire-server/services/${service} && make install #--- Minified stage --- FROM wire-server-deps:alpine ARG service -COPY --from=builder /src/services/${service}/dist/${service} /usr/local/bin/${service} +ARG executable +COPY --from=builder /src/wire-server/services/${service}/dist/${executable} /usr/bin/${exectuable} # ARGs are not available at runtime, create symlink at build time # more info: https://stackoverflow.com/questions/40902445/using-variable-interpolation-in-string-in-docker -RUN ln -s /usr/local/bin/${service} /usr/local/bin/service -ENTRYPOINT ["/usr/local/bin/service"] +RUN ln -s /usr/bin/${executable} /usr/bin/service +ENTRYPOINT ["/usr/bin/service"] diff --git a/libs/api-bot/src/Network/Wire/Bot/Cache.hs b/libs/api-bot/src/Network/Wire/Bot/Cache.hs index ad3277191e7..f37321b25c6 100644 --- a/libs/api-bot/src/Network/Wire/Bot/Cache.hs +++ b/libs/api-bot/src/Network/Wire/Bot/Cache.hs @@ -16,6 +16,7 @@ import Data.ByteString.Conversion import Data.IORef import Data.LanguageCodes import Data.Maybe (fromMaybe) +import Data.Misc import Data.Monoid import Data.Text.Encoding import Data.Text.Lazy hiding (length, map) diff --git a/libs/api-bot/src/Network/Wire/Bot/Monad.hs b/libs/api-bot/src/Network/Wire/Bot/Monad.hs index bf64e046743..b85910957c0 100644 --- a/libs/api-bot/src/Network/Wire/Bot/Monad.hs +++ b/libs/api-bot/src/Network/Wire/Bot/Monad.hs @@ -84,6 +84,7 @@ import Data.Id import Data.IORef import Data.List (foldl', partition) import Data.Maybe (fromMaybe, isNothing) +import Data.Misc import Data.Metrics (Metrics) import Data.Monoid ((<>)) import Data.String (IsString) @@ -861,6 +862,7 @@ randUser (Email loc dom) (BotTag tag) = do , newUserInvitationCode = Nothing , newUserLabel = Nothing , newUserLocale = Nothing + , newUserTeam = Nothing }, passw) randMailbox :: BotNet Mailbox diff --git a/libs/api-bot/stack.yaml b/libs/api-bot/stack.yaml index 1a83851049e..7b1390718bf 100644 --- a/libs/api-bot/stack.yaml +++ b/libs/api-bot/stack.yaml @@ -20,3 +20,4 @@ extra-deps: flags: types-common: protobuf: True + arbitrary: True diff --git a/libs/api-client/stack.yaml b/libs/api-client/stack.yaml index 1be86de7533..1ac57bc8023 100644 --- a/libs/api-client/stack.yaml +++ b/libs/api-client/stack.yaml @@ -18,3 +18,4 @@ extra-deps: flags: types-common: protobuf: True + arbitrary: True diff --git a/libs/galley-types/src/Galley/Types/Teams/Intra.hs b/libs/galley-types/src/Galley/Types/Teams/Intra.hs index c65f2cfda3a..4da7b2f3f52 100644 --- a/libs/galley-types/src/Galley/Types/Teams/Intra.hs +++ b/libs/galley-types/src/Galley/Types/Teams/Intra.hs @@ -13,6 +13,7 @@ data TeamStatus | PendingDelete | Deleted | Suspended + | PendingActive deriving (Eq, Show) instance ToJSON TeamStatus where @@ -20,12 +21,14 @@ instance ToJSON TeamStatus where toJSON PendingDelete = String "pending_delete" toJSON Deleted = String "deleted" toJSON Suspended = String "suspended" + toJSON PendingActive = String "pending_active" instance FromJSON TeamStatus where parseJSON (String "active") = pure Active parseJSON (String "pending_delete") = pure PendingDelete parseJSON (String "deleted") = pure Deleted parseJSON (String "suspended") = pure Suspended + parseJSON (String "pending_active") = pure PendingActive parseJSON other = fail $ "Unknown TeamStatus: " <> show other data TeamData = TeamData @@ -56,3 +59,4 @@ instance FromJSON TeamStatusUpdate where instance ToJSON TeamStatusUpdate where toJSON s = object ["status" .= tuStatus s] + diff --git a/services/brig/.ghci b/services/brig/.ghci index 0bfc9da170d..222adaf8d94 100644 --- a/services/brig/.ghci +++ b/services/brig/.ghci @@ -1,2 +1 @@ -:set -isrc :set -XOverloadedStrings diff --git a/services/brig/Makefile b/services/brig/Makefile index a096446f021..e80ca8b8c49 100644 --- a/services/brig/Makefile +++ b/services/brig/Makefile @@ -12,6 +12,7 @@ DEB_IT := dist/$(NAME)-integration_$(VERSION)+$(BUILD)_amd64.deb DEB_SCHEMA := dist/$(NAME)-schema_$(VERSION)+$(BUILD)_amd64.deb DEB_INDEX := dist/$(NAME)-index_$(VERSION)+$(BUILD)_amd64.deb KEIRETSU_ENV ?= ../.env +EXECUTABLES := $(NAME) $(NAME)-integration $(NAME)-schema $(NAME)-index guard-%: @ if [ "${${*}}" = "" ]; then \ @@ -115,4 +116,11 @@ index-reset: install .PHONY: docker docker: - docker build -t $(NAME) -f ../../build/alpine/Dockerfile --build-arg service=$(NAME) ../.. + $(foreach executable,$(EXECUTABLES),\ + docker build -t $(executable) \ + -f ../../build/alpine/Dockerfile \ + --build-arg service=$(NAME) \ + --build-arg executable=$(executable) \ + ../.. \ + ;) + diff --git a/services/brig/Procfile b/services/brig/Procfile index d6b29710c26..411b68e50d6 100644 --- a/services/brig/Procfile +++ b/services/brig/Procfile @@ -1 +1 @@ -web: LOG_LEVEL=Warn ./dist/brig --host=$BRIG_WEB_HOST --port=$PORT --cassandra-host=$BRIG_CASSANDRA_HOST --cassandra-port=$BRIG_CASSANDRA_PORT --cassandra-keyspace=$BRIG_CASSANDRA_KEYSPACE --galley-host=$GALLEY_WEB_HOST --galley-port=$GALLEY_WEB_PORT --gundeck-host=$GUNDECK_WEB_HOST --gundeck-port=$GUNDECK_WEB_PORT --aws-ses-queue=$AWS_USER_SES_QUEUE --aws-internal-queue=$AWS_USER_INTERNAL_QUEUE --aws-dynamo-blacklist=$AWS_USER_BLACKLIST_TABLE --aws-dynamo-prekeys=$AWS_USER_PREKEYS_TABLE --aws-account-id=$AWS_ACCOUNT --aws-access-key-id=$AWS_ACCESS_KEY_ID --aws-secret-access-key=$AWS_SECRET_ACCESS_KEY --twilio-sid=$TWILIO_SID --twilio-token=$TWILIO_TOKEN --twilio-sender=$TWILIO_SENDER --nexmo-key=$NEXMO_KEY --nexmo-secret=$NEXMO_SECRET --nexmo-endpoint=$NEXMO_ENDPOINT --activation-url=http://$BRIG_WEB_HOST:$PORT/activate?key=\${key}\&code=\${code} --sms-activation-url=http://$BRIG_WEB_HOST:$PORT/v/\${code} --password-reset-url=http://$BRIG_WEB_HOST:$PORT/password-reset/\${key}?code=\${code} --invitation-url=http://$BRIG_WEB_HOST:$PORT/register?invitation_code=\${code} --deletion-url=http://$BRIG_WEB_HOST:$PORT/users/delete?key=\${key}\&code=\${code} --provider-activation-url=http://$BRIG_WEB_HOST:$PORT/provider/activate?key=\${key}\&code=\${code} --provider-approval-url=http://$BRIG_WEB_HOST:$PORT/provider/approve?key=\${key}\&code=\${code} --team-invitation-url=http://$BRIG_WEB_HOST:$PORT/register?team=\${team}\&team_code=\${code} --template-dir=deb/opt/brig/templates --email-sender=$EMAIL_SENDER --activation-timeout=$USER_ACTIVATION_TIMEOUT --user-connection-limit=$USER_CONNECTION_LIMIT --cookie-domain=$COOKIE_DOMAIN --provider-approval-to=$PROVIDER_APPROVAL_TO --provider-home-url=$PROVIDER_HOME_URL --zauth-provider-token-timeout=$ZAUTH_PROVIDER_TOKEN_TIMEOUT --zauth-private-keys=$ZAUTH_PRIVKEYS --zauth-public-keys=$ZAUTH_PUBKEYS --zauth-key-index=$ZAUTH_KEY_INDEX --zauth-user-token-timeout=$ZAUTH_USER_TOKEN_TIMEOUT --user-cookie-renew-age=$USER_COOKIE_RENEW_AGE --zauth-access-token-timeout=$ZAUTH_ACCESS_TOKEN_TIMEOUT --zauth-session-token-timeout=$ZAUTH_SESSION_TOKEN_TIMEOUT --cookie-insecure --user-cookie-retry-after=$USER_COOKIE_RETRY_AFTER --user-cookie-min-deviation=$USER_COOKIE_MIN_DEVIATION --user-cookie-limit=$USER_COOKIE_LIMIT --turn-servers=$TURN_SERVERS --turn-secret=$TURN_SECRET --elasticsearch-url=$BRIG_ELASTICSEARCH_URL --elasticsearch-user-index=$BRIG_ELASTICSEARCH_USER_INDEX +web: LOG_LEVEL=Warn ./dist/brig --host=$BRIG_WEB_HOST --port=$PORT --cassandra-host=$BRIG_CASSANDRA_HOST --cassandra-port=$BRIG_CASSANDRA_PORT --cassandra-keyspace=$BRIG_CASSANDRA_KEYSPACE --galley-host=$GALLEY_WEB_HOST --galley-port=$GALLEY_WEB_PORT --gundeck-host=$GUNDECK_WEB_HOST --gundeck-port=$GUNDECK_WEB_PORT --aws-ses-queue=$AWS_USER_SES_QUEUE --aws-internal-queue=$AWS_USER_INTERNAL_QUEUE --aws-dynamo-blacklist=$AWS_USER_BLACKLIST_TABLE --aws-dynamo-prekeys=$AWS_USER_PREKEYS_TABLE --aws-account-id=$AWS_ACCOUNT --aws-access-key-id=$AWS_ACCESS_KEY_ID --aws-secret-access-key=$AWS_SECRET_ACCESS_KEY --twilio-sid=$TWILIO_SID --twilio-token=$TWILIO_TOKEN --twilio-sender=$TWILIO_SENDER --nexmo-key=$NEXMO_KEY --nexmo-secret=$NEXMO_SECRET --nexmo-endpoint=$NEXMO_ENDPOINT --activation-url=http://$BRIG_WEB_HOST:$PORT/activate?key=\${key}\&code=\${code} --team-activation-url=http://$BRIG_WEB_HOST:$PORT/activate?key=\${key}\&code=\${code} --sms-activation-url=http://$BRIG_WEB_HOST:$PORT/v/\${code} --password-reset-url=http://$BRIG_WEB_HOST:$PORT/password-reset/\${key}?code=\${code} --invitation-url=http://$BRIG_WEB_HOST:$PORT/register?invitation_code=\${code} --deletion-url=http://$BRIG_WEB_HOST:$PORT/users/delete?key=\${key}\&code=\${code} --provider-activation-url=http://$BRIG_WEB_HOST:$PORT/provider/activate?key=\${key}\&code=\${code} --provider-approval-url=http://$BRIG_WEB_HOST:$PORT/provider/approve?key=\${key}\&code=\${code} --team-invitation-url=http://$BRIG_WEB_HOST:$PORT/register?team=\${team}\&team_code=\${code} --template-dir=deb/opt/brig/templates --email-sender=$EMAIL_SENDER --activation-timeout=$USER_ACTIVATION_TIMEOUT --user-connection-limit=$USER_CONNECTION_LIMIT --cookie-domain=$COOKIE_DOMAIN --provider-approval-to=$PROVIDER_APPROVAL_TO --provider-home-url=$PROVIDER_HOME_URL --zauth-provider-token-timeout=$ZAUTH_PROVIDER_TOKEN_TIMEOUT --zauth-private-keys=$ZAUTH_PRIVKEYS --zauth-public-keys=$ZAUTH_PUBKEYS --zauth-key-index=$ZAUTH_KEY_INDEX --zauth-user-token-timeout=$ZAUTH_USER_TOKEN_TIMEOUT --user-cookie-renew-age=$USER_COOKIE_RENEW_AGE --zauth-access-token-timeout=$ZAUTH_ACCESS_TOKEN_TIMEOUT --zauth-session-token-timeout=$ZAUTH_SESSION_TOKEN_TIMEOUT --cookie-insecure --user-cookie-retry-after=$USER_COOKIE_RETRY_AFTER --user-cookie-min-deviation=$USER_COOKIE_MIN_DEVIATION --user-cookie-limit=$USER_COOKIE_LIMIT --turn-servers=$TURN_SERVERS --turn-secret=$TURN_SECRET --elasticsearch-url=$BRIG_ELASTICSEARCH_URL --elasticsearch-user-index=$BRIG_ELASTICSEARCH_USER_INDEX diff --git a/services/brig/brig.cabal b/services/brig/brig.cabal index 3ba092f2295..019dae43e04 100644 --- a/services/brig/brig.cabal +++ b/services/brig/brig.cabal @@ -130,7 +130,7 @@ library , iproute >= 1.5 , lens >= 3.8 , lens-aeson >= 1.0 - , lifted-async >= 0.8 + , lifted-async >= 0.9.3 , mime-mail >= 0.4 , metrics-core >= 0.3 , metrics-wai >= 0.3 @@ -317,6 +317,7 @@ test-suite brig-integration , directory >= 1.2 , errors >= 1.4 , exceptions >= 0.5 + , extra , filepath >= 1.4 , galley-types , gundeck-types @@ -326,7 +327,7 @@ test-suite brig-integration , HsOpenSSL , lens >= 3.9 , lens-aeson >= 1.0 - , lifted-async >= 0.7 + , lifted-async >= 0.9.3 , mtl >= 2.1 , network , options >= 0.1 diff --git a/services/brig/deb/etc/sv/brig/run b/services/brig/deb/etc/sv/brig/run index 9558bddba0a..b9d6d4cffc3 100755 --- a/services/brig/deb/etc/sv/brig/run +++ b/services/brig/deb/etc/sv/brig/run @@ -62,6 +62,7 @@ exec chpst -u $USER \ --cassandra-port=${BRIG_CASSANDRA_PORT?'unset'} \ --cassandra-keyspace=${BRIG_CASSANDRA_KEYSPACE?'unset'} \ --activation-url=${BRIG_ACTIVATION_URL?'unset'} \ + --team-activation-url=${BRIG_TEAM_ACTIVATION_URL?'unset'} \ --activation-timeout=${BRIG_ACTIVATION_TIMEOUT?'unset'} \ --sms-activation-url=${BRIG_SMS_ACTIVATION_URL?'unset'} \ --password-reset-url=${BRIG_PASSWORD_RESET_URL?'unset'} \ diff --git a/services/brig/deb/opt/brig/templates/user/ar/email/team-activation-subject.txt b/services/brig/deb/opt/brig/templates/user/ar/email/team-activation-subject.txt new file mode 120000 index 00000000000..784e3a04e39 --- /dev/null +++ b/services/brig/deb/opt/brig/templates/user/ar/email/team-activation-subject.txt @@ -0,0 +1 @@ +../../en/email/team-activation-subject.txt \ No newline at end of file diff --git a/services/brig/deb/opt/brig/templates/user/ar/email/team-activation.html b/services/brig/deb/opt/brig/templates/user/ar/email/team-activation.html new file mode 120000 index 00000000000..39707d4f014 --- /dev/null +++ b/services/brig/deb/opt/brig/templates/user/ar/email/team-activation.html @@ -0,0 +1 @@ +../../en/email/team-activation.html \ No newline at end of file diff --git a/services/brig/deb/opt/brig/templates/user/ar/email/team-activation.txt b/services/brig/deb/opt/brig/templates/user/ar/email/team-activation.txt new file mode 120000 index 00000000000..731780a7a2d --- /dev/null +++ b/services/brig/deb/opt/brig/templates/user/ar/email/team-activation.txt @@ -0,0 +1 @@ +../../en/email/team-activation.txt \ No newline at end of file diff --git a/services/brig/deb/opt/brig/templates/user/ar/email/update-subject.txt b/services/brig/deb/opt/brig/templates/user/ar/email/update-subject.txt deleted file mode 100644 index 97b5791f48e..00000000000 --- a/services/brig/deb/opt/brig/templates/user/ar/email/update-subject.txt +++ /dev/null @@ -1 +0,0 @@ -Your new email address on Wire \ No newline at end of file diff --git a/services/brig/deb/opt/brig/templates/user/ar/email/update-subject.txt b/services/brig/deb/opt/brig/templates/user/ar/email/update-subject.txt new file mode 120000 index 00000000000..52adaf74932 --- /dev/null +++ b/services/brig/deb/opt/brig/templates/user/ar/email/update-subject.txt @@ -0,0 +1 @@ +../../en/email/update-subject.txt \ No newline at end of file diff --git a/services/brig/deb/opt/brig/templates/user/ar/email/update.html b/services/brig/deb/opt/brig/templates/user/ar/email/update.html deleted file mode 100644 index 0bcf986aa4b..00000000000 --- a/services/brig/deb/opt/brig/templates/user/ar/email/update.html +++ /dev/null @@ -1,126 +0,0 @@ - - -
- - - - -|
- |
- - wire.com - | -
|
- - Hello, - - -- ${email} was registered as your new email address on Wire. We want to verify that you are indeed ${name}. - -- - VERIFY - - -- Click the button above to verify your new address. - -
- If you can’t click on the button, use this link: - ${url} - -- If you didn’t request this change, you can ignore this email or - - contact us - . - - |
- |
|
- Privacy Policy ·
- Report misuse
- - © Wire Swiss GmbH. All rights reserved. - |
- |
+
|
+||||||
+ Click the button above to verify your address. You won’t be able to use Wire until you do. +
+
+ If you can’t click on the button, use this link:
+
+ ${url} +
++ If you didn’t create a Wire account using this email address, please + + contact us + . +
+ + + + +