مراية لـ
https://github.com/postalserver/postal.git
تم المزامنة 2026-03-03 14:24:06 +00:00
Compare commits
20 الالتزامات
| المؤلف | SHA1 | التاريخ | |
|---|---|---|---|
|
|
d532922ff7 | ||
|
|
11419f9914 | ||
|
|
b7e5232e07 | ||
|
|
e00098b800 | ||
|
|
d00d978872 | ||
|
|
c78000ca8f | ||
|
|
c03c44b442 | ||
|
|
86de372382 | ||
|
|
7c47422c86 | ||
|
|
f5325c49ff | ||
|
|
f193b8e77f | ||
|
|
ab6d4430ba | ||
|
|
9c5f96ae90 | ||
|
|
fd3c7ccdf6 | ||
|
|
da90e75036 | ||
|
|
2b0919c145 | ||
|
|
3a33e53d84 | ||
|
|
4fa88acea0 | ||
|
|
d510499190 | ||
|
|
39f704c256 |
4
.github/workflows/ci.yml
مباع
4
.github/workflows/ci.yml
مباع
@@ -52,10 +52,10 @@ jobs:
|
|||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- run: docker-compose pull
|
- run: docker compose pull
|
||||||
env:
|
env:
|
||||||
POSTAL_IMAGE: ghcr.io/postalserver/postal:ci-${{ github.sha }}
|
POSTAL_IMAGE: ghcr.io/postalserver/postal:ci-${{ github.sha }}
|
||||||
- run: docker-compose run postal sh -c 'bundle exec rspec'
|
- run: docker compose run postal sh -c 'bundle exec rspec'
|
||||||
env:
|
env:
|
||||||
POSTAL_IMAGE: ghcr.io/postalserver/postal:ci-${{ github.sha }}
|
POSTAL_IMAGE: ghcr.io/postalserver/postal:ci-${{ github.sha }}
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
{
|
{
|
||||||
".": "3.3.2"
|
".": "3.3.5"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
3.2.2
|
3.4.6
|
||||||
|
|||||||
43
CHANGELOG.md
43
CHANGELOG.md
@@ -2,6 +2,49 @@
|
|||||||
|
|
||||||
This file contains all the latest changes and updates to Postal.
|
This file contains all the latest changes and updates to Postal.
|
||||||
|
|
||||||
|
## [3.3.5](https://github.com/postalserver/postal/compare/3.3.4...3.3.5) (2026-02-01)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **deliveries:** escape delivery details to prevent HTML injection ([11419f9](https://github.com/postalserver/postal/commit/11419f99140e13688a9613cab3ee03f8d3cbae45))
|
||||||
|
* **health_server:** use rackup handler instead of rack handler ([7c47422](https://github.com/postalserver/postal/commit/7c47422c865e738c4d6af0fed1cca4405288341f))
|
||||||
|
* oidc scopes are invalid when concatenated ([#3332](https://github.com/postalserver/postal/issues/3332)) ([9c5f96a](https://github.com/postalserver/postal/commit/9c5f96ae90cf06dcd5db776806865752f667bd95))
|
||||||
|
* typo in process logging ([#3212](https://github.com/postalserver/postal/issues/3212)) ([b7e5232](https://github.com/postalserver/postal/commit/b7e5232e077b3c9b7a999dcb6676fba0ec61458e))
|
||||||
|
* typo in the credentials page ([fd3c7cc](https://github.com/postalserver/postal/commit/fd3c7ccdf6dc4ee0a76c9523cbd735159e4b8000))
|
||||||
|
* update url for v2 config ([#3225](https://github.com/postalserver/postal/issues/3225)) ([e00098b](https://github.com/postalserver/postal/commit/e00098b8003cf37f2708f536871b3ade377aed2d))
|
||||||
|
|
||||||
|
|
||||||
|
### Documentation
|
||||||
|
|
||||||
|
* **process.rb:** add help about time unit used by metric ([#3339](https://github.com/postalserver/postal/issues/3339)) ([f5325c4](https://github.com/postalserver/postal/commit/f5325c49ff1152ad53eaaec98717ad3412d379ae))
|
||||||
|
|
||||||
|
|
||||||
|
### Miscellaneous Chores
|
||||||
|
|
||||||
|
* **deps:** upgrade puma, net-imap and other deps ([c03c44b](https://github.com/postalserver/postal/commit/c03c44b442a29aa9881c1e1aae60bead9776a6b6))
|
||||||
|
* **dockerfile:** reduce container size ([86de372](https://github.com/postalserver/postal/commit/86de372382bd62bdd5d1372254f8817b0360bd56))
|
||||||
|
* remove version from docker-compose.yml ([c78000c](https://github.com/postalserver/postal/commit/c78000ca8f2998aa04648f465060768db6467de6))
|
||||||
|
* upgrade resolv to 0.6.2 ([d00d978](https://github.com/postalserver/postal/commit/d00d978872a96369544303d08f6a9d11cdf56b62))
|
||||||
|
* upgrade to rails 7.1 and ruby 3.4 ([#3457](https://github.com/postalserver/postal/issues/3457)) ([ab6d443](https://github.com/postalserver/postal/commit/ab6d4430baa33a05f1aa66e776cc2a5bcaa0ede8))
|
||||||
|
* upgrade uri gem to 1.0.3 ([f193b8e](https://github.com/postalserver/postal/commit/f193b8e77fc096382ab7aaa6a2c29641b4cb12df))
|
||||||
|
|
||||||
|
## [3.3.4](https://github.com/postalserver/postal/compare/3.3.3...3.3.4) (2024-06-20)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* fix `postal version` command ([4fa88ac](https://github.com/postalserver/postal/commit/4fa88acea0dececd0eae485506a2ad8268fbea59))
|
||||||
|
* fix issue running message pruning task ([3a33e53](https://github.com/postalserver/postal/commit/3a33e53d843584757bb00898746aa059d7616db4))
|
||||||
|
* raise NotImplementedError when no call method on a scheduled task ([2b0919c](https://github.com/postalserver/postal/commit/2b0919c1454eabea93db96f50ecbd8e36bb89f1f))
|
||||||
|
|
||||||
|
## [3.3.3](https://github.com/postalserver/postal/compare/3.3.2...3.3.3) (2024-04-18)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **legacy-api:** allow _expansions to be provided as true to return all expansions ([39f704c](https://github.com/postalserver/postal/commit/39f704c256fc3e71a1dc009acc77796a1efffead)), closes [#2932](https://github.com/postalserver/postal/issues/2932)
|
||||||
|
|
||||||
## [3.3.2](https://github.com/postalserver/postal/compare/3.3.1...3.3.2) (2024-03-21)
|
## [3.3.2](https://github.com/postalserver/postal/compare/3.3.1...3.3.2) (2024-03-21)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
19
Dockerfile
19
Dockerfile
@@ -1,22 +1,25 @@
|
|||||||
FROM ruby:3.2.2-bullseye AS base
|
FROM ruby:3.4.6-slim-bookworm AS base
|
||||||
|
|
||||||
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
&& apt-get install -y --no-install-recommends \
|
&& apt-get install --no-install-recommends -y curl \
|
||||||
software-properties-common dirmngr apt-transport-https \
|
&& apt-get clean \
|
||||||
&& (curl -sL https://deb.nodesource.com/setup_20.x | bash -) \
|
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
RUN (curl -sL https://deb.nodesource.com/setup_20.x | bash -)
|
||||||
|
|
||||||
# Install main dependencies
|
# Install main dependencies
|
||||||
RUN apt-get update && \
|
RUN apt-get update && \
|
||||||
apt-get install -y --no-install-recommends \
|
apt-get install -y --no-install-recommends \
|
||||||
build-essential \
|
build-essential \
|
||||||
netcat \
|
netcat-openbsd \
|
||||||
curl \
|
|
||||||
libmariadb-dev \
|
libmariadb-dev \
|
||||||
libcap2-bin \
|
libcap2-bin \
|
||||||
nano \
|
nano \
|
||||||
nodejs
|
libyaml-dev \
|
||||||
|
nodejs \
|
||||||
|
&& apt-get clean \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
RUN setcap 'cap_net_bind_service=+ep' /usr/local/bin/ruby
|
RUN setcap 'cap_net_bind_service=+ep' /usr/local/bin/ruby
|
||||||
|
|
||||||
@@ -31,7 +34,7 @@ RUN mkdir -p /opt/postal/app /opt/postal/config
|
|||||||
WORKDIR /opt/postal/app
|
WORKDIR /opt/postal/app
|
||||||
|
|
||||||
# Install bundler
|
# Install bundler
|
||||||
RUN gem install bundler -v 2.5.6 --no-doc
|
RUN gem install bundler -v 2.7.2 --no-doc
|
||||||
|
|
||||||
# Install the latest and active gem dependencies and re-run
|
# Install the latest and active gem dependencies and re-run
|
||||||
# the appropriate commands to handle installs.
|
# the appropriate commands to handle installs.
|
||||||
|
|||||||
18
Gemfile
18
Gemfile
@@ -1,6 +1,7 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
source "https://rubygems.org"
|
source "https://rubygems.org"
|
||||||
|
gem "abbrev"
|
||||||
gem "authie"
|
gem "authie"
|
||||||
gem "autoprefixer-rails"
|
gem "autoprefixer-rails"
|
||||||
gem "bcrypt"
|
gem "bcrypt"
|
||||||
@@ -17,14 +18,18 @@ gem "jwt"
|
|||||||
gem "kaminari"
|
gem "kaminari"
|
||||||
gem "klogger-logger"
|
gem "klogger-logger"
|
||||||
gem "konfig-config", "~> 3.0"
|
gem "konfig-config", "~> 3.0"
|
||||||
|
gem "logger"
|
||||||
gem "mail"
|
gem "mail"
|
||||||
|
gem "mutex_m"
|
||||||
gem "mysql2"
|
gem "mysql2"
|
||||||
gem "nifty-utils"
|
gem "nifty-utils"
|
||||||
gem "nilify_blanks"
|
gem "nilify_blanks"
|
||||||
gem "nio4r"
|
gem "nio4r"
|
||||||
|
gem "ostruct"
|
||||||
gem "prometheus-client"
|
gem "prometheus-client"
|
||||||
gem "puma"
|
gem "puma"
|
||||||
gem "rails", "= 7.0.8.1"
|
gem "rackup"
|
||||||
|
gem "rails", "= 7.1.5.2"
|
||||||
gem "resolv"
|
gem "resolv"
|
||||||
gem "secure_headers"
|
gem "secure_headers"
|
||||||
gem "sentry-rails"
|
gem "sentry-rails"
|
||||||
@@ -47,12 +52,15 @@ end
|
|||||||
|
|
||||||
group :development do
|
group :development do
|
||||||
gem "annotate"
|
gem "annotate"
|
||||||
gem "database_cleaner", require: false
|
|
||||||
gem "factory_bot_rails", require: false
|
|
||||||
gem "rspec", require: false
|
|
||||||
gem "rspec-rails", require: false
|
|
||||||
gem "rubocop"
|
gem "rubocop"
|
||||||
gem "rubocop-rails"
|
gem "rubocop-rails"
|
||||||
|
end
|
||||||
|
|
||||||
|
group :test do
|
||||||
|
gem "database_cleaner-active_record"
|
||||||
|
gem "factory_bot_rails"
|
||||||
|
gem "rspec"
|
||||||
|
gem "rspec-rails"
|
||||||
gem "shoulda-matchers"
|
gem "shoulda-matchers"
|
||||||
gem "timecop"
|
gem "timecop"
|
||||||
gem "webmock"
|
gem "webmock"
|
||||||
|
|||||||
285
Gemfile.lock
285
Gemfile.lock
@@ -1,70 +1,83 @@
|
|||||||
GEM
|
GEM
|
||||||
remote: https://rubygems.org/
|
remote: https://rubygems.org/
|
||||||
specs:
|
specs:
|
||||||
actioncable (7.0.8.1)
|
abbrev (0.1.2)
|
||||||
actionpack (= 7.0.8.1)
|
actioncable (7.1.5.2)
|
||||||
activesupport (= 7.0.8.1)
|
actionpack (= 7.1.5.2)
|
||||||
|
activesupport (= 7.1.5.2)
|
||||||
nio4r (~> 2.0)
|
nio4r (~> 2.0)
|
||||||
websocket-driver (>= 0.6.1)
|
websocket-driver (>= 0.6.1)
|
||||||
actionmailbox (7.0.8.1)
|
zeitwerk (~> 2.6)
|
||||||
actionpack (= 7.0.8.1)
|
actionmailbox (7.1.5.2)
|
||||||
activejob (= 7.0.8.1)
|
actionpack (= 7.1.5.2)
|
||||||
activerecord (= 7.0.8.1)
|
activejob (= 7.1.5.2)
|
||||||
activestorage (= 7.0.8.1)
|
activerecord (= 7.1.5.2)
|
||||||
activesupport (= 7.0.8.1)
|
activestorage (= 7.1.5.2)
|
||||||
|
activesupport (= 7.1.5.2)
|
||||||
mail (>= 2.7.1)
|
mail (>= 2.7.1)
|
||||||
net-imap
|
net-imap
|
||||||
net-pop
|
net-pop
|
||||||
net-smtp
|
net-smtp
|
||||||
actionmailer (7.0.8.1)
|
actionmailer (7.1.5.2)
|
||||||
actionpack (= 7.0.8.1)
|
actionpack (= 7.1.5.2)
|
||||||
actionview (= 7.0.8.1)
|
actionview (= 7.1.5.2)
|
||||||
activejob (= 7.0.8.1)
|
activejob (= 7.1.5.2)
|
||||||
activesupport (= 7.0.8.1)
|
activesupport (= 7.1.5.2)
|
||||||
mail (~> 2.5, >= 2.5.4)
|
mail (~> 2.5, >= 2.5.4)
|
||||||
net-imap
|
net-imap
|
||||||
net-pop
|
net-pop
|
||||||
net-smtp
|
net-smtp
|
||||||
rails-dom-testing (~> 2.0)
|
rails-dom-testing (~> 2.2)
|
||||||
actionpack (7.0.8.1)
|
actionpack (7.1.5.2)
|
||||||
actionview (= 7.0.8.1)
|
actionview (= 7.1.5.2)
|
||||||
activesupport (= 7.0.8.1)
|
activesupport (= 7.1.5.2)
|
||||||
rack (~> 2.0, >= 2.2.4)
|
nokogiri (>= 1.8.5)
|
||||||
|
racc
|
||||||
|
rack (>= 2.2.4)
|
||||||
|
rack-session (>= 1.0.1)
|
||||||
rack-test (>= 0.6.3)
|
rack-test (>= 0.6.3)
|
||||||
rails-dom-testing (~> 2.0)
|
rails-dom-testing (~> 2.2)
|
||||||
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
rails-html-sanitizer (~> 1.6)
|
||||||
actiontext (7.0.8.1)
|
actiontext (7.1.5.2)
|
||||||
actionpack (= 7.0.8.1)
|
actionpack (= 7.1.5.2)
|
||||||
activerecord (= 7.0.8.1)
|
activerecord (= 7.1.5.2)
|
||||||
activestorage (= 7.0.8.1)
|
activestorage (= 7.1.5.2)
|
||||||
activesupport (= 7.0.8.1)
|
activesupport (= 7.1.5.2)
|
||||||
globalid (>= 0.6.0)
|
globalid (>= 0.6.0)
|
||||||
nokogiri (>= 1.8.5)
|
nokogiri (>= 1.8.5)
|
||||||
actionview (7.0.8.1)
|
actionview (7.1.5.2)
|
||||||
activesupport (= 7.0.8.1)
|
activesupport (= 7.1.5.2)
|
||||||
builder (~> 3.1)
|
builder (~> 3.1)
|
||||||
erubi (~> 1.4)
|
erubi (~> 1.11)
|
||||||
rails-dom-testing (~> 2.0)
|
rails-dom-testing (~> 2.2)
|
||||||
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
rails-html-sanitizer (~> 1.6)
|
||||||
activejob (7.0.8.1)
|
activejob (7.1.5.2)
|
||||||
activesupport (= 7.0.8.1)
|
activesupport (= 7.1.5.2)
|
||||||
globalid (>= 0.3.6)
|
globalid (>= 0.3.6)
|
||||||
activemodel (7.0.8.1)
|
activemodel (7.1.5.2)
|
||||||
activesupport (= 7.0.8.1)
|
activesupport (= 7.1.5.2)
|
||||||
activerecord (7.0.8.1)
|
activerecord (7.1.5.2)
|
||||||
activemodel (= 7.0.8.1)
|
activemodel (= 7.1.5.2)
|
||||||
activesupport (= 7.0.8.1)
|
activesupport (= 7.1.5.2)
|
||||||
activestorage (7.0.8.1)
|
timeout (>= 0.4.0)
|
||||||
actionpack (= 7.0.8.1)
|
activestorage (7.1.5.2)
|
||||||
activejob (= 7.0.8.1)
|
actionpack (= 7.1.5.2)
|
||||||
activerecord (= 7.0.8.1)
|
activejob (= 7.1.5.2)
|
||||||
activesupport (= 7.0.8.1)
|
activerecord (= 7.1.5.2)
|
||||||
|
activesupport (= 7.1.5.2)
|
||||||
marcel (~> 1.0)
|
marcel (~> 1.0)
|
||||||
mini_mime (>= 1.1.0)
|
activesupport (7.1.5.2)
|
||||||
activesupport (7.0.8.1)
|
base64
|
||||||
|
benchmark (>= 0.3)
|
||||||
|
bigdecimal
|
||||||
concurrent-ruby (~> 1.0, >= 1.0.2)
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
||||||
|
connection_pool (>= 2.2.5)
|
||||||
|
drb
|
||||||
i18n (>= 1.6, < 2)
|
i18n (>= 1.6, < 2)
|
||||||
|
logger (>= 1.4.2)
|
||||||
minitest (>= 5.1)
|
minitest (>= 5.1)
|
||||||
|
mutex_m
|
||||||
|
securerandom (>= 0.3)
|
||||||
tzinfo (~> 2.0)
|
tzinfo (~> 2.0)
|
||||||
addressable (2.8.6)
|
addressable (2.8.6)
|
||||||
public_suffix (>= 2.0.2, < 6.0)
|
public_suffix (>= 2.0.2, < 6.0)
|
||||||
@@ -74,13 +87,14 @@ GEM
|
|||||||
rake (>= 10.4, < 14.0)
|
rake (>= 10.4, < 14.0)
|
||||||
ast (2.4.2)
|
ast (2.4.2)
|
||||||
attr_required (1.0.2)
|
attr_required (1.0.2)
|
||||||
authie (4.1.3)
|
authie (5.0.0)
|
||||||
activerecord (>= 6.1, < 8.0)
|
activerecord (>= 6.1, < 9.0)
|
||||||
autoprefixer-rails (10.4.13.0)
|
autoprefixer-rails (10.4.13.0)
|
||||||
execjs (~> 2)
|
execjs (~> 2)
|
||||||
base64 (0.2.0)
|
base64 (0.3.0)
|
||||||
bcrypt (3.1.20)
|
bcrypt (3.1.20)
|
||||||
bigdecimal (3.1.6)
|
benchmark (0.4.1)
|
||||||
|
bigdecimal (3.2.3)
|
||||||
bindata (2.5.0)
|
bindata (2.5.0)
|
||||||
builder (3.2.4)
|
builder (3.2.4)
|
||||||
chronic (0.10.2)
|
chronic (0.10.2)
|
||||||
@@ -91,26 +105,25 @@ GEM
|
|||||||
coffee-script-source
|
coffee-script-source
|
||||||
execjs
|
execjs
|
||||||
coffee-script-source (1.12.2)
|
coffee-script-source (1.12.2)
|
||||||
concurrent-ruby (1.2.3)
|
concurrent-ruby (1.3.5)
|
||||||
|
connection_pool (2.5.4)
|
||||||
crack (1.0.0)
|
crack (1.0.0)
|
||||||
bigdecimal
|
bigdecimal
|
||||||
rexml
|
rexml
|
||||||
crass (1.0.6)
|
crass (1.0.6)
|
||||||
database_cleaner (2.0.2)
|
database_cleaner-active_record (2.2.2)
|
||||||
database_cleaner-active_record (>= 2, < 3)
|
|
||||||
database_cleaner-active_record (2.1.0)
|
|
||||||
activerecord (>= 5.a)
|
activerecord (>= 5.a)
|
||||||
database_cleaner-core (~> 2.0.0)
|
database_cleaner-core (~> 2.0)
|
||||||
database_cleaner-core (2.0.1)
|
database_cleaner-core (2.0.1)
|
||||||
date (3.3.4)
|
date (3.4.1)
|
||||||
diff-lcs (1.5.0)
|
diff-lcs (1.6.2)
|
||||||
domain_name (0.6.20240107)
|
domain_name (0.6.20240107)
|
||||||
dotenv (3.0.2)
|
dotenv (3.0.2)
|
||||||
dynamic_form (1.3.1)
|
drb (2.2.3)
|
||||||
actionview (> 5.2.0)
|
dynamic_form (1.2.0)
|
||||||
activemodel (> 5.2.0)
|
|
||||||
email_validator (2.2.4)
|
email_validator (2.2.4)
|
||||||
activemodel
|
activemodel
|
||||||
|
erb (5.0.2)
|
||||||
erubi (1.12.0)
|
erubi (1.12.0)
|
||||||
execjs (2.7.0)
|
execjs (2.7.0)
|
||||||
factory_bot (6.4.6)
|
factory_bot (6.4.6)
|
||||||
@@ -127,7 +140,7 @@ GEM
|
|||||||
ffi (1.15.5)
|
ffi (1.15.5)
|
||||||
gelf (3.1.0)
|
gelf (3.1.0)
|
||||||
json
|
json
|
||||||
globalid (1.2.1)
|
globalid (1.3.0)
|
||||||
activesupport (>= 6.1)
|
activesupport (>= 6.1)
|
||||||
haml (6.3.0)
|
haml (6.3.0)
|
||||||
temple (>= 0.8.2)
|
temple (>= 0.8.2)
|
||||||
@@ -136,8 +149,13 @@ GEM
|
|||||||
hashdiff (1.1.0)
|
hashdiff (1.1.0)
|
||||||
hashie (5.0.0)
|
hashie (5.0.0)
|
||||||
highline (2.1.0)
|
highline (2.1.0)
|
||||||
i18n (1.14.1)
|
i18n (1.14.7)
|
||||||
concurrent-ruby (~> 1.0)
|
concurrent-ruby (~> 1.0)
|
||||||
|
io-console (0.8.1)
|
||||||
|
irb (1.15.2)
|
||||||
|
pp (>= 0.6.0)
|
||||||
|
rdoc (>= 4.0.0)
|
||||||
|
reline (>= 0.4.2)
|
||||||
jquery-rails (4.5.1)
|
jquery-rails (4.5.1)
|
||||||
rails-dom-testing (>= 1, < 3)
|
rails-dom-testing (>= 1, < 3)
|
||||||
railties (>= 4.2.0)
|
railties (>= 4.2.0)
|
||||||
@@ -170,7 +188,8 @@ GEM
|
|||||||
rouge (>= 3.30, < 5.0)
|
rouge (>= 3.30, < 5.0)
|
||||||
konfig-config (3.0.0)
|
konfig-config (3.0.0)
|
||||||
hashie
|
hashie
|
||||||
loofah (2.22.0)
|
logger (1.7.0)
|
||||||
|
loofah (2.24.1)
|
||||||
crass (~> 1.0.2)
|
crass (~> 1.0.2)
|
||||||
nokogiri (>= 1.12.0)
|
nokogiri (>= 1.12.0)
|
||||||
mail (2.8.1)
|
mail (2.8.1)
|
||||||
@@ -178,15 +197,14 @@ GEM
|
|||||||
net-imap
|
net-imap
|
||||||
net-pop
|
net-pop
|
||||||
net-smtp
|
net-smtp
|
||||||
marcel (1.0.2)
|
marcel (1.1.0)
|
||||||
method_source (1.0.0)
|
|
||||||
mini_mime (1.1.5)
|
mini_mime (1.1.5)
|
||||||
mini_portile2 (2.8.5)
|
minitest (5.25.5)
|
||||||
minitest (5.22.2)
|
mutex_m (0.3.0)
|
||||||
mysql2 (0.5.6)
|
mysql2 (0.5.6)
|
||||||
net-http (0.4.1)
|
net-http (0.4.1)
|
||||||
uri
|
uri
|
||||||
net-imap (0.4.10)
|
net-imap (0.5.11)
|
||||||
date
|
date
|
||||||
net-protocol
|
net-protocol
|
||||||
net-pop (0.1.2)
|
net-pop (0.1.2)
|
||||||
@@ -199,17 +217,14 @@ GEM
|
|||||||
nilify_blanks (1.4.0)
|
nilify_blanks (1.4.0)
|
||||||
activerecord (>= 4.0.0)
|
activerecord (>= 4.0.0)
|
||||||
activesupport (>= 4.0.0)
|
activesupport (>= 4.0.0)
|
||||||
nio4r (2.7.0)
|
nio4r (2.7.4)
|
||||||
nokogiri (1.16.2)
|
nokogiri (1.18.10-aarch64-linux-gnu)
|
||||||
mini_portile2 (~> 2.8.2)
|
|
||||||
racc (~> 1.4)
|
racc (~> 1.4)
|
||||||
nokogiri (1.16.2-aarch64-linux)
|
nokogiri (1.18.10-arm64-darwin)
|
||||||
racc (~> 1.4)
|
racc (~> 1.4)
|
||||||
nokogiri (1.16.2-arm64-darwin)
|
nokogiri (1.18.10-x86_64-darwin)
|
||||||
racc (~> 1.4)
|
racc (~> 1.4)
|
||||||
nokogiri (1.16.2-x86_64-darwin)
|
nokogiri (1.18.10-x86_64-linux-gnu)
|
||||||
racc (~> 1.4)
|
|
||||||
nokogiri (1.16.2-x86_64-linux)
|
|
||||||
racc (~> 1.4)
|
racc (~> 1.4)
|
||||||
omniauth (2.1.2)
|
omniauth (2.1.2)
|
||||||
hashie (>= 3.4.6)
|
hashie (>= 3.4.6)
|
||||||
@@ -234,15 +249,22 @@ GEM
|
|||||||
tzinfo
|
tzinfo
|
||||||
validate_url
|
validate_url
|
||||||
webfinger (~> 2.0)
|
webfinger (~> 2.0)
|
||||||
|
ostruct (0.6.3)
|
||||||
parallel (1.22.1)
|
parallel (1.22.1)
|
||||||
parser (3.2.1.1)
|
parser (3.2.1.1)
|
||||||
ast (~> 2.4.1)
|
ast (~> 2.4.1)
|
||||||
|
pp (0.6.2)
|
||||||
|
prettyprint
|
||||||
|
prettyprint (0.2.0)
|
||||||
prometheus-client (4.2.2)
|
prometheus-client (4.2.2)
|
||||||
|
psych (5.2.6)
|
||||||
|
date
|
||||||
|
stringio
|
||||||
public_suffix (5.0.4)
|
public_suffix (5.0.4)
|
||||||
puma (6.4.2)
|
puma (7.0.4)
|
||||||
nio4r (~> 2.0)
|
nio4r (~> 2.0)
|
||||||
racc (1.7.3)
|
racc (1.8.1)
|
||||||
rack (2.2.8.1)
|
rack (3.2.1)
|
||||||
rack-oauth2 (2.2.1)
|
rack-oauth2 (2.2.1)
|
||||||
activesupport
|
activesupport
|
||||||
attr_required
|
attr_required
|
||||||
@@ -250,57 +272,69 @@ GEM
|
|||||||
faraday-follow_redirects
|
faraday-follow_redirects
|
||||||
json-jwt (>= 1.11.0)
|
json-jwt (>= 1.11.0)
|
||||||
rack (>= 2.1.0)
|
rack (>= 2.1.0)
|
||||||
rack-protection (3.2.0)
|
rack-protection (4.1.1)
|
||||||
base64 (>= 0.1.0)
|
base64 (>= 0.1.0)
|
||||||
rack (~> 2.2, >= 2.2.4)
|
logger (>= 1.6.0)
|
||||||
|
rack (>= 3.0.0, < 4)
|
||||||
|
rack-session (2.1.1)
|
||||||
|
base64 (>= 0.1.0)
|
||||||
|
rack (>= 3.0.0)
|
||||||
rack-test (2.1.0)
|
rack-test (2.1.0)
|
||||||
rack (>= 1.3)
|
rack (>= 1.3)
|
||||||
rails (7.0.8.1)
|
rackup (2.2.1)
|
||||||
actioncable (= 7.0.8.1)
|
rack (>= 3)
|
||||||
actionmailbox (= 7.0.8.1)
|
rails (7.1.5.2)
|
||||||
actionmailer (= 7.0.8.1)
|
actioncable (= 7.1.5.2)
|
||||||
actionpack (= 7.0.8.1)
|
actionmailbox (= 7.1.5.2)
|
||||||
actiontext (= 7.0.8.1)
|
actionmailer (= 7.1.5.2)
|
||||||
actionview (= 7.0.8.1)
|
actionpack (= 7.1.5.2)
|
||||||
activejob (= 7.0.8.1)
|
actiontext (= 7.1.5.2)
|
||||||
activemodel (= 7.0.8.1)
|
actionview (= 7.1.5.2)
|
||||||
activerecord (= 7.0.8.1)
|
activejob (= 7.1.5.2)
|
||||||
activestorage (= 7.0.8.1)
|
activemodel (= 7.1.5.2)
|
||||||
activesupport (= 7.0.8.1)
|
activerecord (= 7.1.5.2)
|
||||||
|
activestorage (= 7.1.5.2)
|
||||||
|
activesupport (= 7.1.5.2)
|
||||||
bundler (>= 1.15.0)
|
bundler (>= 1.15.0)
|
||||||
railties (= 7.0.8.1)
|
railties (= 7.1.5.2)
|
||||||
rails-dom-testing (2.2.0)
|
rails-dom-testing (2.2.0)
|
||||||
activesupport (>= 5.0.0)
|
activesupport (>= 5.0.0)
|
||||||
minitest
|
minitest
|
||||||
nokogiri (>= 1.6)
|
nokogiri (>= 1.6)
|
||||||
rails-html-sanitizer (1.6.0)
|
rails-html-sanitizer (1.6.2)
|
||||||
loofah (~> 2.21)
|
loofah (~> 2.21)
|
||||||
nokogiri (~> 1.14)
|
nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
|
||||||
railties (7.0.8.1)
|
railties (7.1.5.2)
|
||||||
actionpack (= 7.0.8.1)
|
actionpack (= 7.1.5.2)
|
||||||
activesupport (= 7.0.8.1)
|
activesupport (= 7.1.5.2)
|
||||||
method_source
|
irb
|
||||||
|
rackup (>= 1.0.0)
|
||||||
rake (>= 12.2)
|
rake (>= 12.2)
|
||||||
thor (~> 1.0)
|
thor (~> 1.0, >= 1.2.2)
|
||||||
zeitwerk (~> 2.5)
|
zeitwerk (~> 2.6)
|
||||||
rainbow (3.1.1)
|
rainbow (3.1.1)
|
||||||
rake (13.1.0)
|
rake (13.1.0)
|
||||||
|
rdoc (6.14.2)
|
||||||
|
erb
|
||||||
|
psych (>= 4.0.0)
|
||||||
regexp_parser (2.7.0)
|
regexp_parser (2.7.0)
|
||||||
resolv (0.3.0)
|
reline (0.6.2)
|
||||||
rexml (3.2.5)
|
io-console (~> 0.5)
|
||||||
|
resolv (0.6.2)
|
||||||
|
rexml (3.4.4)
|
||||||
rouge (4.2.0)
|
rouge (4.2.0)
|
||||||
rspec (3.12.0)
|
rspec (3.13.1)
|
||||||
rspec-core (~> 3.12.0)
|
rspec-core (~> 3.13.0)
|
||||||
rspec-expectations (~> 3.12.0)
|
rspec-expectations (~> 3.13.0)
|
||||||
rspec-mocks (~> 3.12.0)
|
rspec-mocks (~> 3.13.0)
|
||||||
rspec-core (3.12.1)
|
rspec-core (3.13.5)
|
||||||
rspec-support (~> 3.12.0)
|
rspec-support (~> 3.13.0)
|
||||||
rspec-expectations (3.12.2)
|
rspec-expectations (3.13.5)
|
||||||
diff-lcs (>= 1.2.0, < 2.0)
|
diff-lcs (>= 1.2.0, < 2.0)
|
||||||
rspec-support (~> 3.12.0)
|
rspec-support (~> 3.13.0)
|
||||||
rspec-mocks (3.12.4)
|
rspec-mocks (3.13.5)
|
||||||
diff-lcs (>= 1.2.0, < 2.0)
|
diff-lcs (>= 1.2.0, < 2.0)
|
||||||
rspec-support (~> 3.12.0)
|
rspec-support (~> 3.13.0)
|
||||||
rspec-rails (6.1.1)
|
rspec-rails (6.1.1)
|
||||||
actionpack (>= 6.1)
|
actionpack (>= 6.1)
|
||||||
activesupport (>= 6.1)
|
activesupport (>= 6.1)
|
||||||
@@ -309,7 +343,7 @@ GEM
|
|||||||
rspec-expectations (~> 3.12)
|
rspec-expectations (~> 3.12)
|
||||||
rspec-mocks (~> 3.12)
|
rspec-mocks (~> 3.12)
|
||||||
rspec-support (~> 3.12)
|
rspec-support (~> 3.12)
|
||||||
rspec-support (3.12.0)
|
rspec-support (3.13.6)
|
||||||
rubocop (1.48.1)
|
rubocop (1.48.1)
|
||||||
json (~> 2.3)
|
json (~> 2.3)
|
||||||
parallel (~> 1.10)
|
parallel (~> 1.10)
|
||||||
@@ -338,6 +372,7 @@ GEM
|
|||||||
sprockets-rails
|
sprockets-rails
|
||||||
tilt
|
tilt
|
||||||
secure_headers (6.5.0)
|
secure_headers (6.5.0)
|
||||||
|
securerandom (0.4.1)
|
||||||
sentry-rails (5.16.1)
|
sentry-rails (5.16.1)
|
||||||
railties (>= 5.0)
|
railties (>= 5.0)
|
||||||
sentry-ruby (~> 5.16.1)
|
sentry-ruby (~> 5.16.1)
|
||||||
@@ -352,6 +387,7 @@ GEM
|
|||||||
actionpack (>= 5.2)
|
actionpack (>= 5.2)
|
||||||
activesupport (>= 5.2)
|
activesupport (>= 5.2)
|
||||||
sprockets (>= 3.0.0)
|
sprockets (>= 3.0.0)
|
||||||
|
stringio (3.1.7)
|
||||||
swd (2.0.3)
|
swd (2.0.3)
|
||||||
activesupport (>= 3)
|
activesupport (>= 3)
|
||||||
attr_required (>= 0.0.5)
|
attr_required (>= 0.0.5)
|
||||||
@@ -361,7 +397,7 @@ GEM
|
|||||||
thor (1.3.0)
|
thor (1.3.0)
|
||||||
tilt (2.3.0)
|
tilt (2.3.0)
|
||||||
timecop (0.9.8)
|
timecop (0.9.8)
|
||||||
timeout (0.4.1)
|
timeout (0.4.3)
|
||||||
turbolinks (5.2.1)
|
turbolinks (5.2.1)
|
||||||
turbolinks-source (~> 5.2)
|
turbolinks-source (~> 5.2)
|
||||||
turbolinks-source (5.2.0)
|
turbolinks-source (5.2.0)
|
||||||
@@ -370,7 +406,7 @@ GEM
|
|||||||
uglifier (4.2.0)
|
uglifier (4.2.0)
|
||||||
execjs (>= 0.3.0, < 3)
|
execjs (>= 0.3.0, < 3)
|
||||||
unicode-display_width (2.4.2)
|
unicode-display_width (2.4.2)
|
||||||
uri (0.13.0)
|
uri (1.0.3)
|
||||||
validate_url (1.0.15)
|
validate_url (1.0.15)
|
||||||
activemodel (>= 3.0.0)
|
activemodel (>= 3.0.0)
|
||||||
public_suffix
|
public_suffix
|
||||||
@@ -382,8 +418,9 @@ GEM
|
|||||||
addressable (>= 2.8.0)
|
addressable (>= 2.8.0)
|
||||||
crack (>= 0.3.2)
|
crack (>= 0.3.2)
|
||||||
hashdiff (>= 0.4.0, < 2.0.0)
|
hashdiff (>= 0.4.0, < 2.0.0)
|
||||||
webrick (1.8.1)
|
webrick (1.9.1)
|
||||||
websocket-driver (0.7.6)
|
websocket-driver (0.8.0)
|
||||||
|
base64
|
||||||
websocket-extensions (>= 0.1.0)
|
websocket-extensions (>= 0.1.0)
|
||||||
websocket-extensions (0.1.5)
|
websocket-extensions (0.1.5)
|
||||||
zeitwerk (2.6.13)
|
zeitwerk (2.6.13)
|
||||||
@@ -391,18 +428,18 @@ GEM
|
|||||||
PLATFORMS
|
PLATFORMS
|
||||||
aarch64-linux
|
aarch64-linux
|
||||||
arm64-darwin
|
arm64-darwin
|
||||||
ruby
|
|
||||||
x86_64-darwin
|
x86_64-darwin
|
||||||
x86_64-linux
|
x86_64-linux
|
||||||
|
|
||||||
DEPENDENCIES
|
DEPENDENCIES
|
||||||
|
abbrev
|
||||||
annotate
|
annotate
|
||||||
authie
|
authie
|
||||||
autoprefixer-rails
|
autoprefixer-rails
|
||||||
bcrypt
|
bcrypt
|
||||||
chronic
|
chronic
|
||||||
coffee-rails (~> 5.0)
|
coffee-rails (~> 5.0)
|
||||||
database_cleaner
|
database_cleaner-active_record
|
||||||
domain_name
|
domain_name
|
||||||
dotenv
|
dotenv
|
||||||
dynamic_form
|
dynamic_form
|
||||||
@@ -417,16 +454,20 @@ DEPENDENCIES
|
|||||||
kaminari
|
kaminari
|
||||||
klogger-logger
|
klogger-logger
|
||||||
konfig-config (~> 3.0)
|
konfig-config (~> 3.0)
|
||||||
|
logger
|
||||||
mail
|
mail
|
||||||
|
mutex_m
|
||||||
mysql2
|
mysql2
|
||||||
nifty-utils
|
nifty-utils
|
||||||
nilify_blanks
|
nilify_blanks
|
||||||
nio4r
|
nio4r
|
||||||
omniauth-rails_csrf_protection
|
omniauth-rails_csrf_protection
|
||||||
omniauth_openid_connect
|
omniauth_openid_connect
|
||||||
|
ostruct
|
||||||
prometheus-client
|
prometheus-client
|
||||||
puma
|
puma
|
||||||
rails (= 7.0.8.1)
|
rackup
|
||||||
|
rails (= 7.1.5.2)
|
||||||
resolv
|
resolv
|
||||||
rspec
|
rspec
|
||||||
rspec-rails
|
rspec-rails
|
||||||
@@ -443,4 +484,4 @@ DEPENDENCIES
|
|||||||
webrick
|
webrick
|
||||||
|
|
||||||
BUNDLED WITH
|
BUNDLED WITH
|
||||||
2.5.6
|
2.7.2
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ module LegacyAPI
|
|||||||
message_hash = { id: message.id, token: message.token }
|
message_hash = { id: message.id, token: message.token }
|
||||||
expansions = api_params["_expansions"]
|
expansions = api_params["_expansions"]
|
||||||
|
|
||||||
if expansions.include?("status")
|
if expansions == true || (expansions.is_a?(Array) && expansions.include?("status"))
|
||||||
message_hash[:status] = {
|
message_hash[:status] = {
|
||||||
status: message.status,
|
status: message.status,
|
||||||
last_delivery_attempt: message.last_delivery_attempt&.to_f,
|
last_delivery_attempt: message.last_delivery_attempt&.to_f,
|
||||||
@@ -33,7 +33,7 @@ module LegacyAPI
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
if expansions.include?("details")
|
if expansions == true || (expansions.is_a?(Array) && expansions.include?("details"))
|
||||||
message_hash[:details] = {
|
message_hash[:details] = {
|
||||||
rcpt_to: message.rcpt_to,
|
rcpt_to: message.rcpt_to,
|
||||||
mail_from: message.mail_from,
|
mail_from: message.mail_from,
|
||||||
@@ -49,7 +49,7 @@ module LegacyAPI
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
if expansions.include?("inspection")
|
if expansions == true || (expansions.is_a?(Array) && expansions.include?("inspection"))
|
||||||
message_hash[:inspection] = {
|
message_hash[:inspection] = {
|
||||||
inspected: message.inspected,
|
inspected: message.inspected,
|
||||||
spam: message.spam,
|
spam: message.spam,
|
||||||
@@ -59,15 +59,15 @@ module LegacyAPI
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
if expansions.include?("plain_body")
|
if expansions == true || (expansions.is_a?(Array) && expansions.include?("plain_body"))
|
||||||
message_hash[:plain_body] = message.plain_body
|
message_hash[:plain_body] = message.plain_body
|
||||||
end
|
end
|
||||||
|
|
||||||
if expansions.include?("html_body")
|
if expansions == true || (expansions.is_a?(Array) && expansions.include?("html_body"))
|
||||||
message_hash[:html_body] = message.html_body
|
message_hash[:html_body] = message.html_body
|
||||||
end
|
end
|
||||||
|
|
||||||
if expansions.include?("attachments")
|
if expansions == true || (expansions.is_a?(Array) && expansions.include?("attachments"))
|
||||||
message_hash[:attachments] = message.attachments.map do |attachment|
|
message_hash[:attachments] = message.attachments.map do |attachment|
|
||||||
{
|
{
|
||||||
filename: attachment.filename.to_s,
|
filename: attachment.filename.to_s,
|
||||||
@@ -79,15 +79,15 @@ module LegacyAPI
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if expansions.include?("headers")
|
if expansions == true || (expansions.is_a?(Array) && expansions.include?("headers"))
|
||||||
message_hash[:headers] = message.headers
|
message_hash[:headers] = message.headers
|
||||||
end
|
end
|
||||||
|
|
||||||
if expansions.include?("raw_message")
|
if expansions == true || (expansions.is_a?(Array) && expansions.include?("raw_message"))
|
||||||
message_hash[:raw_message] = Base64.encode64(message.raw_message)
|
message_hash[:raw_message] = Base64.encode64(message.raw_message)
|
||||||
end
|
end
|
||||||
|
|
||||||
if expansions.include?("activity_entries")
|
if expansions == true || (expansions.is_a?(Array) && expansions.include?("activity_entries"))
|
||||||
message_hash[:activity_entries] = {
|
message_hash[:activity_entries] = {
|
||||||
loads: message.loads,
|
loads: message.loads,
|
||||||
clicks: message.clicks
|
clicks: message.clicks
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
module ApplicationHelper
|
module ApplicationHelper
|
||||||
|
|
||||||
def format_delivery_details(server, text)
|
def format_delivery_details(server, text)
|
||||||
|
text = h(text)
|
||||||
text.gsub!(/<msg:(\d+)>/) do
|
text.gsub!(/<msg:(\d+)>/) do
|
||||||
id = ::Regexp.last_match(1).to_i
|
id = ::Regexp.last_match(1).to_i
|
||||||
link_to("message ##{id}", organization_server_message_path(server.organization, server, id), class: "u-link")
|
link_to("message ##{id}", organization_server_message_path(server.organization, server, id), class: "u-link")
|
||||||
|
|||||||
@@ -202,7 +202,7 @@ module Worker
|
|||||||
logger.info "stopping tasks thread"
|
logger.info "stopping tasks thread"
|
||||||
ActiveRecord::Base.connection_pool.with_connection do
|
ActiveRecord::Base.connection_pool.with_connection do
|
||||||
if WorkerRole.release(:tasks)
|
if WorkerRole.release(:tasks)
|
||||||
logger.info "releasesd tasks role"
|
logger.info "released tasks role"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -298,7 +298,7 @@ module Worker
|
|||||||
labels: [:thread, :job]
|
labels: [:thread, :job]
|
||||||
|
|
||||||
register_prometheus_histogram :postal_worker_job_runtime,
|
register_prometheus_histogram :postal_worker_job_runtime,
|
||||||
docstring: "The time taken to process jobs",
|
docstring: "The time taken to process jobs (in seconds)",
|
||||||
labels: [:thread, :job]
|
labels: [:thread, :job]
|
||||||
|
|
||||||
register_prometheus_counter :postal_worker_errors,
|
register_prometheus_counter :postal_worker_errors,
|
||||||
@@ -306,11 +306,11 @@ module Worker
|
|||||||
labels: [:error]
|
labels: [:error]
|
||||||
|
|
||||||
register_prometheus_histogram :postal_worker_task_runtime,
|
register_prometheus_histogram :postal_worker_task_runtime,
|
||||||
docstring: "The time taken to process tasks",
|
docstring: "The time taken to process tasks (in seconds)",
|
||||||
labels: [:task]
|
labels: [:task]
|
||||||
|
|
||||||
register_prometheus_histogram :postal_message_queue_latency,
|
register_prometheus_histogram :postal_message_queue_latency,
|
||||||
docstring: "The length of time between a message being queued and being dequeued"
|
docstring: "The length of time between a message being queued and being dequeued (in seconds)"
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ class Credential < ApplicationRecord
|
|||||||
validate :validate_key_cannot_be_changed
|
validate :validate_key_cannot_be_changed
|
||||||
validate :validate_key_for_smtp_ip
|
validate :validate_key_for_smtp_ip
|
||||||
|
|
||||||
serialize :options, Hash
|
serialize :options, type: Hash
|
||||||
|
|
||||||
before_validation :generate_key
|
before_validation :generate_key
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ class WebhookRequest < ApplicationRecord
|
|||||||
validates :url, presence: true
|
validates :url, presence: true
|
||||||
validates :event, presence: true
|
validates :event, presence: true
|
||||||
|
|
||||||
serialize :payload, Hash
|
serialize :payload, type: Hash
|
||||||
|
|
||||||
class << self
|
class << self
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ class ApplicationScheduledTask
|
|||||||
end
|
end
|
||||||
|
|
||||||
def call
|
def call
|
||||||
# override me
|
raise NotImplementedError
|
||||||
end
|
end
|
||||||
|
|
||||||
attr_reader :logger
|
attr_reader :logger
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
class ProcessMessageRetentionScheduledTask < ApplicationScheduledTask
|
class ProcessMessageRetentionScheduledTask < ApplicationScheduledTask
|
||||||
|
|
||||||
def perform
|
def call
|
||||||
Server.all.each do |server|
|
Server.all.each do |server|
|
||||||
if server.raw_message_retention_days
|
if server.raw_message_retention_days
|
||||||
# If the server has a maximum number of retained raw messages, remove any that are older than this
|
# If the server has a maximum number of retained raw messages, remove any that are older than this
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require "socket"
|
require "socket"
|
||||||
require "rack/handler/webrick"
|
require "rackup/handler/webrick"
|
||||||
require "prometheus/client/formats/text"
|
require "prometheus/client/formats/text"
|
||||||
|
|
||||||
class HealthServer
|
class HealthServer
|
||||||
@@ -55,7 +55,7 @@ class HealthServer
|
|||||||
port = ENV.fetch("HEALTH_SERVER_PORT", default_port)
|
port = ENV.fetch("HEALTH_SERVER_PORT", default_port)
|
||||||
bind_address = ENV.fetch("HEALTH_SERVER_BIND_ADDRESS", default_bind_address)
|
bind_address = ENV.fetch("HEALTH_SERVER_BIND_ADDRESS", default_bind_address)
|
||||||
|
|
||||||
Rack::Handler::WEBrick.run(new(**options),
|
Rackup::Handler::WEBrick.run(new(**options),
|
||||||
Port: port,
|
Port: port,
|
||||||
BindAddress: bind_address,
|
BindAddress: bind_address,
|
||||||
AccessLog: [],
|
AccessLog: [],
|
||||||
@@ -95,7 +95,7 @@ class HealthServer
|
|||||||
Postal.logger.info "stopped health server", component: "health-server"
|
Postal.logger.info "stopped health server", component: "health-server"
|
||||||
when /\AWEBrick [\d.]+/,
|
when /\AWEBrick [\d.]+/,
|
||||||
/\Aruby ([\d.]+)/,
|
/\Aruby ([\d.]+)/,
|
||||||
/\ARack::Handler::WEBrick is mounted/,
|
/\ARackup::Handler::WEBrick is mounted/,
|
||||||
/\Aclose TCPSocket/,
|
/\Aclose TCPSocket/,
|
||||||
/\Agoing to shutdown/
|
/\Agoing to shutdown/
|
||||||
# Don't actually print routine messages to avoid too much
|
# Don't actually print routine messages to avoid too much
|
||||||
|
|||||||
@@ -38,7 +38,7 @@
|
|||||||
= f.select :hold, [["Process all messages", false], ["Hold messages from this credential", true]], {}, :class => 'input input--select'
|
= f.select :hold, [["Process all messages", false], ["Hold messages from this credential", true]], {}, :class => 'input input--select'
|
||||||
%p.fieldSet__text
|
%p.fieldSet__text
|
||||||
You may wish to automatically hold all messages that are sent by this credential. This allows you to preview them
|
You may wish to automatically hold all messages that are sent by this credential. This allows you to preview them
|
||||||
for they are delivered to their recipients. This is useful for credentials for development environments.
|
before they are delivered to their recipients. This is useful for credentials for development environments.
|
||||||
|
|
||||||
.fieldSetSubmit.buttonSet
|
.fieldSetSubmit.buttonSet
|
||||||
= f.submit @credential.new_record? ? "Create credential" : "Save credential", :class => 'button button--positive js-form-submit'
|
= f.submit @credential.new_record? ? "Create credential" : "Save credential", :class => 'button button--positive js-form-submit'
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ Rails.application.configure do
|
|||||||
# In the development environment your application's code is reloaded on
|
# In the development environment your application's code is reloaded on
|
||||||
# every request. This slows down response time but is perfect for development
|
# every request. This slows down response time but is perfect for development
|
||||||
# since you don't have to restart the web server when you make code changes.
|
# since you don't have to restart the web server when you make code changes.
|
||||||
config.cache_classes = false
|
config.enable_reloading = true
|
||||||
|
|
||||||
# Do not eager load code on boot.
|
# Do not eager load code on boot.
|
||||||
config.eager_load = false
|
config.eager_load = false
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ Rails.application.configure do
|
|||||||
# Settings specified here will take precedence over those in config/application.rb.
|
# Settings specified here will take precedence over those in config/application.rb.
|
||||||
|
|
||||||
# Code is not reloaded between requests.
|
# Code is not reloaded between requests.
|
||||||
config.cache_classes = true
|
config.enable_reloading = false
|
||||||
|
|
||||||
# Eager load code on boot. This eager loads most of Rails and
|
# Eager load code on boot. This eager loads most of Rails and
|
||||||
# your application in memory, allowing both threaded web servers
|
# your application in memory, allowing both threaded web servers
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ Rails.application.configure do
|
|||||||
# test suite. You never need to work with it otherwise. Remember that
|
# test suite. You never need to work with it otherwise. Remember that
|
||||||
# your test database is "scratch space" for the test suite and is wiped
|
# your test database is "scratch space" for the test suite and is wiped
|
||||||
# and recreated between test runs. Don't rely on the data there!
|
# and recreated between test runs. Don't rely on the data there!
|
||||||
config.cache_classes = true
|
config.enable_reloading = false
|
||||||
|
|
||||||
# Do not eager load code on boot. This avoids loading your whole application
|
# Do not eager load code on boot. This avoids loading your whole application
|
||||||
# just for the purpose of running a single test. If you are using a tool that
|
# just for the purpose of running a single test. If you are using a tool that
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
if Postal::Config.rails.secret_key
|
if Postal::Config.rails.secret_key
|
||||||
Rails.application.secrets.secret_key_base = Postal::Config.rails.secret_key
|
Rails.application.credentials.secret_key_base = Postal::Config.rails.secret_key
|
||||||
else
|
else
|
||||||
warn "No secret key was specified in the Postal config file. Using one for just this session"
|
warn "No secret key was specified in the Postal config file. Using one for just this session"
|
||||||
Rails.application.secrets.secret_key_base = SecureRandom.hex(128)
|
Rails.application.credentials.secret_key_base = SecureRandom.hex(128)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ This document contains all the environment variables which are available for thi
|
|||||||
| `OIDC_ISSUER` | String | The OIDC issuer URL | |
|
| `OIDC_ISSUER` | String | The OIDC issuer URL | |
|
||||||
| `OIDC_IDENTIFIER` | String | The client ID for OIDC | |
|
| `OIDC_IDENTIFIER` | String | The client ID for OIDC | |
|
||||||
| `OIDC_SECRET` | String | The client secret for OIDC | |
|
| `OIDC_SECRET` | String | The client secret for OIDC | |
|
||||||
| `OIDC_SCOPES` | Array of strings | Scopes to request from the OIDC server. | openid,email |
|
| `OIDC_SCOPES` | Array of strings | Scopes to request from the OIDC server. | ["openid", "email"] |
|
||||||
| `OIDC_UID_FIELD` | String | The field to use to determine the user's UID | sub |
|
| `OIDC_UID_FIELD` | String | The field to use to determine the user's UID | sub |
|
||||||
| `OIDC_EMAIL_ADDRESS_FIELD` | String | The field to use to determine the user's email address | email |
|
| `OIDC_EMAIL_ADDRESS_FIELD` | String | The field to use to determine the user's email address | email |
|
||||||
| `OIDC_NAME_FIELD` | String | The field to use to determine the user's name | name |
|
| `OIDC_NAME_FIELD` | String | The field to use to determine the user's name | name |
|
||||||
|
|||||||
@@ -239,7 +239,8 @@ oidc:
|
|||||||
secret:
|
secret:
|
||||||
# Scopes to request from the OIDC server.
|
# Scopes to request from the OIDC server.
|
||||||
scopes:
|
scopes:
|
||||||
- openid,email
|
- openid
|
||||||
|
- email
|
||||||
# The field to use to determine the user's UID
|
# The field to use to determine the user's UID
|
||||||
uid_field: sub
|
uid_field: sub
|
||||||
# The field to use to determine the user's email address
|
# The field to use to determine the user's email address
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
version: "3"
|
|
||||||
services:
|
services:
|
||||||
postal:
|
postal:
|
||||||
image: ${POSTAL_IMAGE}
|
image: ${POSTAL_IMAGE}
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ module Postal
|
|||||||
unless silence_config_messages
|
unless silence_config_messages
|
||||||
warn "WARNING: Using legacy config file format. Upgrade your postal.yml to use"
|
warn "WARNING: Using legacy config file format. Upgrade your postal.yml to use"
|
||||||
warn "version 2 of the Postal configuration or configure using environment"
|
warn "version 2 of the Postal configuration or configure using environment"
|
||||||
warn "variables. See https://postalserver.io/config-v2 for details."
|
warn "variables. See https://docs.postalserver.io/config-v2 for details."
|
||||||
end
|
end
|
||||||
sources << LegacyConfigSource.new(yaml)
|
sources << LegacyConfigSource.new(yaml)
|
||||||
when 2
|
when 2
|
||||||
@@ -145,7 +145,7 @@ module Postal
|
|||||||
ActiveRecord::Base.connection_pool.disconnect!
|
ActiveRecord::Base.connection_pool.disconnect!
|
||||||
|
|
||||||
config = ActiveRecord::Base.configurations
|
config = ActiveRecord::Base.configurations
|
||||||
.configs_for(env_name: Rails.env)
|
.configs_for(env_name: Config.rails.environment)
|
||||||
.first
|
.first
|
||||||
.configuration_hash
|
.configuration_hash
|
||||||
|
|
||||||
@@ -173,7 +173,7 @@ module Postal
|
|||||||
private
|
private
|
||||||
|
|
||||||
def read_version_file(file)
|
def read_version_file(file)
|
||||||
path = Rails.root.join(file)
|
path = File.expand_path("../../../" + file, __FILE__)
|
||||||
return unless File.exist?(path)
|
return unless File.exist?(path)
|
||||||
|
|
||||||
value = File.read(path).strip
|
value = File.read(path).strip
|
||||||
|
|||||||
@@ -550,7 +550,7 @@ module Postal
|
|||||||
string :scopes do
|
string :scopes do
|
||||||
description "Scopes to request from the OIDC server."
|
description "Scopes to request from the OIDC server."
|
||||||
array
|
array
|
||||||
default "openid,email"
|
default ["openid", "email"]
|
||||||
end
|
end
|
||||||
|
|
||||||
string :uid_field do
|
string :uid_field do
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env ruby
|
#!/usr/bin/env ruby
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require File.expand_path("../lib/postal/version", __dir__)
|
require File.expand_path("../lib/postal/config", __dir__)
|
||||||
puts Postal.version
|
puts Postal.version
|
||||||
|
|||||||
@@ -88,6 +88,49 @@ RSpec.describe "Legacy Messages API", type: :request do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context "when all expansions are requested" do
|
||||||
|
let(:expansions) { true }
|
||||||
|
|
||||||
|
it "returns details about the message" do
|
||||||
|
expect(response.status).to eq 200
|
||||||
|
parsed_body = JSON.parse(response.body)
|
||||||
|
expect(parsed_body["status"]).to eq "success"
|
||||||
|
expect(parsed_body["data"]).to match({
|
||||||
|
"id" => message.id,
|
||||||
|
"token" => message.token,
|
||||||
|
"status" => { "held" => false,
|
||||||
|
"hold_expiry" => nil,
|
||||||
|
"last_delivery_attempt" => nil,
|
||||||
|
"status" => "Pending" },
|
||||||
|
"details" => { "bounce" => false,
|
||||||
|
"bounce_for_id" => 0,
|
||||||
|
"direction" => "outgoing",
|
||||||
|
"mail_from" => "test@example.com",
|
||||||
|
"message_id" => message.message_id,
|
||||||
|
"rcpt_to" => "john@example.com",
|
||||||
|
"received_with_ssl" => nil,
|
||||||
|
"size" => kind_of(String),
|
||||||
|
"subject" => "An example message",
|
||||||
|
"tag" => nil,
|
||||||
|
"timestamp" => kind_of(Float) },
|
||||||
|
"inspection" => { "inspected" => false,
|
||||||
|
"spam" => false,
|
||||||
|
"spam_score" => 0.0,
|
||||||
|
"threat" => false,
|
||||||
|
"threat_details" => nil },
|
||||||
|
"plain_body" => message.plain_body,
|
||||||
|
"html_body" => message.html_body,
|
||||||
|
"attachments" => [],
|
||||||
|
"headers" => message.headers,
|
||||||
|
"raw_message" => Base64.encode64(message.raw_message),
|
||||||
|
"activity_entries" => {
|
||||||
|
"loads" => [],
|
||||||
|
"clicks" => []
|
||||||
|
}
|
||||||
|
})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
context "when the status expansion is requested" do
|
context "when the status expansion is requested" do
|
||||||
let(:expansions) { ["status"] }
|
let(:expansions) { ["status"] }
|
||||||
|
|
||||||
|
|||||||
@@ -120,6 +120,8 @@ describe Server do
|
|||||||
end
|
end
|
||||||
|
|
||||||
describe "deletion" do
|
describe "deletion" do
|
||||||
|
let(:server) { create(:server) }
|
||||||
|
|
||||||
it "removes the database" do
|
it "removes the database" do
|
||||||
expect(server.message_db.provisioner).to receive(:drop).once
|
expect(server.message_db.provisioner).to receive(:drop).once
|
||||||
server.provision_database = true
|
server.provision_database = true
|
||||||
|
|||||||
@@ -10,14 +10,12 @@ require "rspec/rails"
|
|||||||
require "spec_helper"
|
require "spec_helper"
|
||||||
require "factory_bot"
|
require "factory_bot"
|
||||||
require "timecop"
|
require "timecop"
|
||||||
require "database_cleaner"
|
|
||||||
require "webmock/rspec"
|
require "webmock/rspec"
|
||||||
require "shoulda-matchers"
|
require "shoulda-matchers"
|
||||||
|
|
||||||
DatabaseCleaner.allow_remote_database_url = true
|
DatabaseCleaner.allow_remote_database_url = true
|
||||||
ActiveRecord::Base.logger = Logger.new("/dev/null")
|
ActiveRecord::Base.logger = Logger.new("/dev/null")
|
||||||
|
|
||||||
Dir[File.expand_path("factories/*.rb", __dir__)].each { |f| require f }
|
|
||||||
Dir[File.expand_path("helpers/**/*.rb", __dir__)].each { |f| require f }
|
Dir[File.expand_path("helpers/**/*.rb", __dir__)].each { |f| require f }
|
||||||
|
|
||||||
ActionMailer::Base.delivery_method = :test
|
ActionMailer::Base.delivery_method = :test
|
||||||
|
|||||||
@@ -59,8 +59,11 @@ RSpec.describe WebhookDeliveryService do
|
|||||||
end
|
end
|
||||||
|
|
||||||
it "updates the last used at time on the webhook" do
|
it "updates the last used at time on the webhook" do
|
||||||
|
frozen_time = Time.current.change(usec: 0)
|
||||||
|
Timecop.freeze(frozen_time) do
|
||||||
service.call
|
service.call
|
||||||
expect(webhook.reload.last_used_at).to be_within(1.second).of(Time.current)
|
expect(webhook.reload.last_used_at).to eq(frozen_time)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
المرجع في مشكلة جديدة
حظر مستخدم