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

updates for staging #447

Merged
merged 198 commits into from
Nov 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
198 commits
Select commit Hold shift + click to select a range
0464b14
submodule sync
suculent Jan 16, 2023
2b23f23
debugging non-working coveralls
suculent Jan 16, 2023
31469f9
debuging coveralls (sh: |: unknown operand)
suculent Jan 16, 2023
80873e5
updated npm; moving coveralls to non-dev install phase (seems to be m…
suculent Jan 16, 2023
0898c8c
removed pipe from test call, testing two variants
suculent Jan 16, 2023
9c8ae0e
submodule sync; test fix; GitHub login refactoring/extraction
suculent Jan 16, 2023
3fb94aa
moving to GIT_ASKPASS, debugging nonexistent coverage folder
suculent Jan 16, 2023
c75ec24
worker update
suculent Jan 16, 2023
b07da66
debugging github key adder; coveralls fix in progress (lcov is genera…
suculent Jan 16, 2023
8b3c19f
post-start baseline log cleanup
suculent Jan 16, 2023
bf6503e
refactoring fix, coveralls is global (not in ./node_modules)
suculent Jan 16, 2023
b37fd99
refactoring fix, GitHub seems to return 422 because of spamming
suculent Jan 16, 2023
7b344e4
GitHub auth fix
suculent Jan 16, 2023
816067c
simplified test script; git clone forced password (hangs on prompt); …
suculent Jan 16, 2023
e308413
5 failures (some specs may be just badly coded, but the git fetch fai…
suculent Jan 16, 2023
fe68658
amend fixes
suculent Jan 16, 2023
d7cd9a7
from 5 failures; moving askpass variables back into the shell
suculent Jan 16, 2023
581e8d5
npm update, minor refactoring (shorter code), adding static askpass i…
suculent Jan 16, 2023
05c4876
refactored using AI, added the actual contents with askpass file (rea…
suculent Jan 16, 2023
97e0031
hopefully fixed ssh_keys copy with contents
suculent Jan 16, 2023
9a5095a
creating the askfile automatically, but the ssh-add fails anyway (sho…
suculent Jan 16, 2023
8e977c9
debugging git ssh-add using temporary askfile; some identities were a…
suculent Jan 16, 2023
51b2fdf
more refactoring... the suite does not detect these errors properly
suculent Jan 16, 2023
39a073d
dep sync, focusing on git specs only
suculent Jan 16, 2023
cb8c82e
tests seem to return meaningful failures, that are not properly proce…
suculent Jan 16, 2023
e9940f6
validator and spec fix
suculent Jan 16, 2023
9ce362d
git result validator fix
suculent Jan 16, 2023
a33c8f2
updated result validator; silenced ssh-add (may cause problems with d…
suculent Jan 16, 2023
8465ec7
improved git validator, logging cleanup
suculent Jan 16, 2023
112c78e
re-enabled full test suite
suculent Jan 16, 2023
0566642
logging cleanup; ready to deploy
suculent Jan 16, 2023
63fadce
Merge branch 'master' into thinx-staging
suculent Jan 16, 2023
ca0b69b
refactoring and reviewing the Git approaches in Devices, Builder and …
suculent Jan 17, 2023
c26e66f
refactoring/fixes
suculent Jan 17, 2023
015eb7f
from 3 failures; more fixes
suculent Jan 17, 2023
d0c741f
refactoring improvements and fixes
suculent Jan 17, 2023
498620f
Merge pull request #415 from suculent/thinx-staging
suculent Jan 17, 2023
c10099a
cleanup, testing new broker base image
suculent Jan 20, 2023
34aca28
disabled spec expect for smoke-test deployment (testing broker, seems…
suculent Jan 20, 2023
01e614d
Merge pull request #416 from suculent/thinx-staging
suculent Jan 20, 2023
0cfcc26
broker update smoke-test
suculent Jan 20, 2023
b190891
removed useless device listing in messenger (meanwhile on production,…
suculent Jan 23, 2023
848453f
removed now useless test
suculent Jan 23, 2023
a7f8afe
var2lib + include_docs: true in view
suculent Jan 23, 2023
dcae3d3
var/let fixes, issue seems to be only production-wise (prefix?)
suculent Jan 23, 2023
8cee6ac
debugging db connect, because the issue seems app-related (db looks g…
suculent Jan 23, 2023
50edc6e
Bump cookiejar from 2.1.3 to 2.1.4
dependabot[bot] Jan 24, 2023
0fe669d
Merge commit '50edc6ee476ee40aa38f93e69d0326bea767e20d' into thinx-st…
suculent Jan 25, 2023
54535b0
debugging 404 and %22 in GET /managed_devices/_design/devices/_view/d…
suculent Jan 25, 2023
b5fa27b
debugging failing key fetch for devices only
suculent Jan 25, 2023
6d97910
trying different design doc, the test got crazy (no created DBs, no d…
suculent Jan 25, 2023
59b1304
disruptive update to npm nano 10 (promise-based, not sure about incom…
suculent Jan 25, 2023
29fbfac
fixing error "doc is null"
suculent Jan 26, 2023
bdc3d1a
var to let
suculent Jan 26, 2023
e33acda
disabled non-essential test suites to pinpoint the database issues in…
suculent Jan 26, 2023
7eab647
enabled coveralls debug; database init spec in beforeall
suculent Jan 26, 2023
7005d27
github login log fix
suculent Jan 26, 2023
a7ae1dc
debugging fetchOrCreateSecretKey
suculent Jan 26, 2023
2aec51d
all redis v4 calls are wrong (async only); this does fix app start as…
suculent Jan 27, 2023
f17a198
re-enabled test suite to see the scope of fails (77 results in 12 files)
suculent Jan 27, 2023
839cf29
fixed infinite loop error in sources; reverted Redis API because it n…
suculent Jan 27, 2023
5092879
from 233 failures, debugging [error] Adding MQTT hash
suculent Jan 27, 2023
2983718
still 233 failures, disabling 2nd and 3rd level of tests
suculent Jan 27, 2023
e6588c5
base suite passed, adding 2nd level specs
suculent Jan 27, 2023
7578d9d
2nd level: 237 specs, 2 failures (potentially fixing one)
suculent Jan 27, 2023
4d3ab06
2nd level: 237 specs, 1 failure - potential fix in messenger, found p…
suculent Jan 27, 2023
6149948
temporarily disabled 1 failing spec; enabled 3rd level tests
suculent Jan 27, 2023
146ef32
with 5 failing specs; queue refactored to async to solve complex sema…
suculent Jan 27, 2023
6d4bc83
with 3 failures in Notifier, Queue and Devices
suculent Jan 27, 2023
4db93bc
533 specs, 4 failures, 2 pending specs; typo fix in debugging
suculent Jan 28, 2023
7754fc7
from 2 failures, spec fix
suculent Jan 28, 2023
4a85e74
from 19 failures, Redis refactoring fixes regarding SMEMBERS (incorre…
suculent Jan 28, 2023
445c22a
queue worker validation fix/refactoring
suculent Jan 28, 2023
d0659d6
disabled Coveralls debug, the issue seems to be somewhere else; from …
suculent Jan 28, 2023
c568edb
three error cases fixed
suculent Jan 28, 2023
7822b08
smembers seem to work, cleaning up
suculent Jan 28, 2023
8db3197
from 2 failures; solving async issue in QueueSpec
suculent Jan 28, 2023
89fbc44
from still same 2 issues, logging cleanup
suculent Jan 28, 2023
ce0f393
from 1 issue (serialization); limited to failing specs; improved Util…
suculent Jan 28, 2023
b07c31b
limited suite had no issues (1 disabled); re-enabling all integration…
suculent Jan 28, 2023
bc6ebfc
log cleanup
suculent Jan 28, 2023
c5bd554
added support for config.override.json (to allow easier config switch…
suculent Jan 28, 2023
674f2b0
log cleanup; device/attach (JWT) hangs with invalid device (not found…
suculent Jan 28, 2023
8a59600
all tests passed; enabling failing spec in notifier
suculent Jan 28, 2023
1cc127b
all tests passed, tagging unmanaged loglines
suculent Jan 28, 2023
c78da63
test passing; log fixes, notifier test changed a bit (no invalid stat…
suculent Jan 28, 2023
155218c
log fixes; tests passed; fixed view document name on production; depr…
suculent Jan 28, 2023
df7bb94
test spec fix
suculent Jan 28, 2023
a57d8f3
version bump
suculent Jan 28, 2023
41bd130
Merge pull request #417 from suculent/thinx-staging
suculent Jan 28, 2023
bc69ced
base image update
suculent Feb 15, 2023
59b122b
base image module update
suculent Feb 15, 2023
b6a4f56
license change
suculent Feb 15, 2023
a7b9d12
worker update (minor fixes to demonstrate SAST result changes)
suculent Feb 15, 2023
9e7e225
node.js update; push token validation fix
suculent Feb 19, 2023
974bde3
fixed to buildable package.json
suculent Feb 19, 2023
415d56d
npm update
suculent Feb 19, 2023
cd291bc
docker version update
suculent Feb 19, 2023
215738a
older docker in ci pipeline
suculent Feb 19, 2023
f25a19c
fixed potential first-run and security issue
suculent Feb 19, 2023
c8dbb43
potential build fix
suculent Feb 19, 2023
a6663ef
prod build fix for new docker
suculent Feb 19, 2023
53139b2
submodule sync
suculent Feb 20, 2023
0ff97af
build passes, debugging only failing Repository section
suculent Feb 20, 2023
0c9f509
all Repository tests passed; adding full test suite and upgrading Docker
suculent Feb 20, 2023
500b9c5
pinned remote docker to latest supported version, removed legacy LGTM…
suculent Feb 20, 2023
1a2b75e
potential queue fix
suculent Feb 20, 2023
d39da42
improved repository beforeAll order of events
suculent Feb 20, 2023
4d5ad64
fix crash with false worker
suculent Feb 20, 2023
3f3df0e
support drop for NodeMCU, almost ready to merge (tested)
suculent Feb 20, 2023
9c3c7cf
Merge pull request #420 from suculent/thinx-staging
suculent Feb 20, 2023
347f6ee
leak fix, syntax error fix in worker (builds fail with no worker bein…
suculent Feb 20, 2023
dd8bf7f
builder fix
suculent Feb 20, 2023
f0a585a
worker startup fix
suculent Feb 20, 2023
a5f5008
potential async fix, set should have callback or await
suculent Feb 20, 2023
2fc91c8
more redis fixes
suculent Feb 20, 2023
7f79a87
fixing fault: "Running test script 0; /opt/cmd.sh: line 205: 0: comma…
suculent Feb 20, 2023
ba9413c
Merge pull request #421 from suculent/thinx-staging
suculent Feb 21, 2023
5a4c18b
subproject updates
suculent Feb 21, 2023
3964418
spec test repo update
suculent Feb 21, 2023
9d85a6b
submodule doc sync (Arduino builder is currently broken - as of lates…
suculent Feb 21, 2023
2b8e12e
added GitHub action to see how this will work (issue with submodules …
suculent Feb 21, 2023
0bc764d
updated failing submodule to also have thinx-staging branch to prove …
suculent Feb 21, 2023
f61ae48
moved components to thing-staging branches so all changes can be now …
suculent Feb 21, 2023
0430b34
submodule sync
suculent Feb 21, 2023
92c91af
sync
suculent Feb 21, 2023
faaceed
workarounds and cleaning unsupported stuff
suculent Feb 21, 2023
0f06547
Bump golang.org/x/text from 0.3.7 to 0.3.8 in /services/broker/goauth
dependabot[bot] Feb 23, 2023
f2eda12
Merge commit 'ba9413c8972d1b9a8b9fb66517059296cdc853bc' into thinx-st…
suculent Mar 5, 2023
638d37e
staging merge
suculent Mar 5, 2023
7a0526e
potential console nginx config login/logout fix
suculent Mar 5, 2023
8fd0e34
deployment fix
suculent Mar 5, 2023
692015f
console redeploy trigger
suculent Mar 5, 2023
9dc5b17
Merge pull request #423 from suculent/thinx-staging
suculent Mar 6, 2023
6886ca9
Merge pull request #424 from suculent/dependabot/go_modules/services/…
suculent Mar 6, 2023
912b9af
early exit on tokenLogin with invalid wrapper (oauth does not map to …
suculent Mar 6, 2023
b9b670d
debugging API Key create issue (with one possible fix)
suculent Mar 7, 2023
63774a9
console debugging in broken API Key creation
suculent Mar 7, 2023
4376726
queue logic fix
suculent Mar 7, 2023
8a639bb
improved apikeys debug
suculent Mar 7, 2023
d4021e9
minor refactoring in apikeys (removing unused params, fixing arg type…
suculent Mar 7, 2023
98eba1c
one-off error?
suculent Mar 7, 2023
704ac82
oversight fix redeploy
suculent Mar 7, 2023
6e1eaa7
Merge pull request #426 from suculent/thinx-staging
suculent Mar 7, 2023
6a5c024
Bump yaml from 2.1.0 to 2.2.2
dependabot[bot] Apr 25, 2023
284e03a
fix: package.json & package-lock.json to reduce vulnerabilities
snyk-bot Apr 26, 2023
b860229
Bump engine.io and socket.io
dependabot[bot] May 4, 2023
d7819cb
Merge commit '284e03a4cf2a1042445dea22b865e8bab3096348' into thinx-st…
suculent May 4, 2023
237b569
Merge commit 'b86022917164182b78c3190f6e0e838e3d3c1688' into thinx-st…
suculent May 4, 2023
8a9d7ec
console dependency update
suculent May 4, 2023
bce5468
fix: package.json & package-lock.json to reduce vulnerabilities
snyk-bot May 17, 2023
2f8a5b0
Merge commit 'bce5468a8d8596fa2487344b6a05aec5a74c4181' into thinx-st…
suculent Aug 21, 2023
830c981
merge
suculent Aug 21, 2023
72275e4
Merge branch 'main' of github.com:thinx-cloud/thinx
suculent Aug 21, 2023
250f81b
Merge branch 'main' of github.com:suculent/thinx-device-api
suculent Aug 21, 2023
494db0a
Merge branch 'main' into thinx-staging
suculent Aug 21, 2023
855f3af
test project branch migration to main
suculent Nov 2, 2023
e11dd37
base image update
suculent Nov 2, 2023
150d8fd
updated node.js to v21
suculent Nov 2, 2023
1f32d75
submodule sync w/o builders
suculent Nov 2, 2023
28680a8
builder submodules (not updating legacy stuff)
suculent Nov 2, 2023
c836824
merge conflict fix via socket.io update
suculent Nov 2, 2023
e23a7c2
merge conflict fix via socket.io update
suculent Nov 2, 2023
229f396
npm audit fix forced updates
suculent Nov 2, 2023
fbece67
removing deprecated vulnerable package (imports request transitively)
suculent Nov 2, 2023
c9e66e1
transformer and worker updates
suculent Nov 3, 2023
72703d1
moved SLACK_WEBHOOK from conf to ENV
suculent Nov 3, 2023
16c457b
moved Slack authentication to env vars from config file
suculent Nov 5, 2023
f36826e
limited tests to failing suite
suculent Nov 5, 2023
f84ce49
all tests passed, reverting... expecting to disable a test in next co…
suculent Nov 5, 2023
27fbb5c
disabled failing test (build log 04 - list; crashes with channel_not_…
suculent Nov 5, 2023
b6b7990
verified spec/slack_test.js (works)
suculent Nov 6, 2023
1a7c3fc
version bump; added catch to slack-notify
suculent Nov 6, 2023
aba3fbf
base module update; rebuild with current base image (build notifier p…
suculent Nov 6, 2023
021f573
rewritten oauth-github to got
suculent Nov 6, 2023
6c993e2
updated npm, fixed oauth GET request using got
suculent Nov 6, 2023
f6fae7d
submodule updates
suculent Nov 6, 2023
5ca9aec
working around problem with unsupported require of ES module
suculent Nov 6, 2023
a897034
moved from got to axios
suculent Nov 6, 2023
5138ecb
fix axios get error
suculent Nov 6, 2023
bf39b33
ssrf fix
suculent Nov 6, 2023
f8d2cc1
github fix
suculent Nov 6, 2023
bbf0802
recent test passed, build stable, adding debug logging only for next …
suculent Nov 6, 2023
36f1761
fix for potent. unlinked github login addRoutes
suculent Nov 6, 2023
dcfe2c5
recent test passed, build stable, adding debug logging only for next …
suculent Nov 6, 2023
da36c7d
task renamed
suculent Nov 7, 2023
ad06bc0
debugging broken github-oauth login
suculent Nov 7, 2023
03ab1a0
gpg
suculent Nov 8, 2023
7e173d9
fixes
suculent Nov 8, 2023
fa37728
removed json
suculent Nov 8, 2023
6f8d875
fails in tests, because code is B
suculent Nov 8, 2023
4a834f3
spec fix for staging
suculent Nov 8, 2023
a0ae8a1
test passes, but parsing fails
suculent Nov 8, 2023
3e86382
dependency updates, fixing github login (has code but different objec…
suculent Nov 8, 2023
6e3dd1f
version bump, log cleanup and base image update after fixing GitHub O…
suculent Nov 8, 2023
2b5080e
submodule sync
suculent Nov 8, 2023
2b40b09
log cleanup, redeploy after changing expired Rollbar Project Access T…
suculent Nov 8, 2023
78eeed6
log leak fix
suculent Nov 8, 2023
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
41 changes: 21 additions & 20 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
executor: docker/docker
steps:
- setup_remote_docker:
version: 20.10.12
version: 20.10.18
- checkout
- docker/check
- run:
Expand All @@ -33,7 +33,7 @@ jobs:
executor: docker/docker
steps:
- setup_remote_docker:
version: 20.10.12
version: 20.10.18
- checkout
- run:
name: Fetch all dependencies (esp. console)
Expand Down Expand Up @@ -75,7 +75,7 @@ jobs:
executor: docker/docker
steps:
- setup_remote_docker:
version: 20.10.12
version: 20.10.18
- checkout
- run:
name: Fetch all dependencies (esp. console)
Expand Down Expand Up @@ -111,7 +111,7 @@ jobs:
executor: docker/docker
steps:
- setup_remote_docker:
version: 20.10.12
version: 20.10.18
- checkout
- run:
name: Clean package-lock
Expand Down Expand Up @@ -175,7 +175,7 @@ jobs:
docker compose version

- setup_remote_docker:
version: 20.10.12
version: 20.10.18

- checkout

Expand Down Expand Up @@ -212,7 +212,7 @@ jobs:
command: |
mkdir -p /mnt/data/
mkdir -p /mnt/data && cp -R ./conf /mnt/data
mkdir -p /mnt/data/ssh_keys
mkdir -p /mnt/data/ssh_keys && cp -R ./spec/mnt/data/ssh_keys /mnt/data
mkdir -p /mnt/data/mosquitto/auth
mkdir -p /mnt/data/mosquitto/config
mkdir -p /mnt/data/mosquitto/data
Expand Down Expand Up @@ -316,16 +316,17 @@ jobs:
docker compose logs couchdb

- run:
name: Starting API Test
name: Running Unit and Integration Tests
command: |
export ENVIRONMENT=test
pwd
docker compose up --build api | tee -ia ./test.log
if [ ! $(cat ./test.log | grep "specs, 0 failures") ]; then
echo "Docker test complete."
if [[ ! $(grep "specs, 0 failures" ./test.log) ]]; then
echo "» TEST failed. Should not deploy this commit."
cat ./test.log | grep "Failures:"
grep "Failures:" ./test.log
exit 1
fi
date

- run:
name: Allow inspecting MQTT logs
Expand Down Expand Up @@ -372,7 +373,7 @@ jobs:
executor: docker/docker
steps:
- setup_remote_docker:
version: 20.10.12
version: 20.10.18
- checkout
- docker/check
- run:
Expand Down Expand Up @@ -426,15 +427,15 @@ workflows:
- main
- master

# - build-console-classic:
# context:
# - thinx-docker-repo
# - console
# filters:
# branches:
# only:
# - thinx-staging
# - master
- build-console-classic:
context:
- thinx-docker-repo
- console
filters:
branches:
only:
- thinx-staging
- master

# - build-console-cloud:
# context:
Expand Down
1 change: 0 additions & 1 deletion .coveralls.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
repo_token: nJpg2RHfxQRyMMmHAYmGTUyWa3B7L76ty

15 changes: 4 additions & 11 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
clair*
.git
node_modules/
**/node_modules/
package-lock.json
tools/arduino-docker-build
tools/platformio-docker-build
tools/micropython-docker-build
tools/mongoose-docker-build
tools/nodemcu-docker-build
tools/nodemcu-firmware
tools/lua-inspect

conf/
tools/
conf/
clair*
3 changes: 3 additions & 0 deletions .env.dist
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ WORKER_SECRET=twilight_zone

# Slack Bot Notifications
# SLACK_BOT_TOKEN=
# SLACK_CLIENT_ID=
# SLACK_CLIENT_SECRET=
# SLACK_WEBHOOK=

# Mailgun API Key
# MAILGUN_API_KEY=
34 changes: 34 additions & 0 deletions .github/workflows/checkmarx.ym_
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: "Checkmarx"

on:
push:
branches: [master, thinx-staging, main]
pull_request:
# The branches below must be a subset of the branches above
branches: [master, thinx-staging, main]
schedule:
- cron: '0 18 * * 5'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
# Override automatic language detection by changing the below list
# Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
language: ['javascript']
# Learn more...
# https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection

steps:
- name: Checkmarx AST Github Action
uses: Checkmarx/[email protected]

with:
base_uri: https://ast.checkmarx.net/
cx_tenant: nfr_nfr_ast_corpus
cx_client_id: ${{ secrets.CX_CLIENT_ID }}
cx_client_secret: ${{ secrets.CX_CLIENT_SECRET }}
8 changes: 0 additions & 8 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
path = builders/arduino-docker-build
url = https://github.com/suculent/arduino-docker-build.git

[submodule "builders/lua-inspect"]
path = builders/lua-inspect
url = https://github.com/davidm/lua-inspect.git

[submodule "builders/micropython-docker-build"]
path = builders/micropython-docker-build
url = https://github.com/suculent/micropython-docker-build.git
Expand All @@ -18,10 +14,6 @@
path = builders/nodemcu-docker-build
url = https://github.com/suculent/nodemcu-docker-build.git

[submodule "builders/nodemcu-firmware"]
path = builders/nodemcu-firmware
url = https://github.com/suculent/nodemcu-firmware.git

[submodule "builders/platformio-docker-build"]
path = builders/platformio-docker-build
url = https://github.com/suculent/platformio-docker-build.git
Expand Down
14 changes: 11 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM thinxcloud/base:alpine

LABEL maintainer="Matej Sychra <[email protected]>"
LABEL name="THiNX API" version="1.8.2247"
LABEL name="THiNX API" version="1.9.2451"

ARG DEBIAN_FRONTEND=noninteractive

Expand Down Expand Up @@ -47,9 +47,17 @@ ARG GITHUB_CLIENT_ID
ENV GITHUB_CLIENT_ID=${GITHUB_CLIENT_ID}
ARG GITHUB_CLIENT_SECRET
ENV GITHUB_CLIENT_SECRET=${GITHUB_CLIENT_SECRET}
ARG GITHUB_ACCESS_TOKEN
ENV GITHUB_ACCESS_TOKEN={GITHUB_ACCESS_TOKEN}

ARG SLACK_BOT_TOKEN
ENV SLACK_BOT_TOKEN=${SLACK_BOT_TOKEN}
ARG SLACK_CLIENT_ID
ENV SLACK_CLIENT_ID=${SLACK_CLIENT_ID}
ARG SLACK_CLIENT_SECRET
ENV SLACK_CLIENT_SECRET=${SLACK_CLIENT_SECRET}
ARG SLACK_WEBHOOK
ENV SLACK_WEBHOOK=${SLACK_WEBHOOK}

ARG ENTERPRISE
ENV ENTERPRISE=${ENTERPRISE}
Expand All @@ -66,8 +74,8 @@ WORKDIR /opt/thinx/thinx-device-api
# Install app dependencies
COPY package.json ./

RUN npm install -g npm@8.6.0 \
&& npm install --unsafe-perm --only-prod .
RUN npm install -g npm@10.2.3 \
&& npm install --only-prod .

# THiNX Web & Device API (HTTP)
EXPOSE 7442
Expand Down
22 changes: 13 additions & 9 deletions Dockerfile.test
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
FROM thinxcloud/base:alpine

LABEL maintainer="Matej Sychra <[email protected]>"
LABEL name="THiNX API" version="1.8.2247"
LABEL name="THiNX API" version="1.9.2451"

ARG DEBIAN_FRONTEND=noninteractive

# For test-env node-18
ENV NODE_TLS_REJECT_UNAUTHORIZED=0
ENV NODE_EXTRA_CA_CERTS=/mnt/data/ssl/testRoot.crt

ARG THINX_HOSTNAME
ENV THINX_HOSTNAME=${THINX_HOSTNAME}

Expand All @@ -33,9 +29,6 @@ ENV AQUA_SEC_TOKEN=${AQUA_SEC_TOKEN}
ARG SNYK_TOKEN
ENV SNYK_TOKEN=${SNYK_TOKEN}

ARG GITHUB_ACCESS_TOKEN
ENV GITHUB_ACCESS_TOKEN={GITHUB_ACCESS_TOKEN}

ARG ENVIRONMENT
ENV ENVIRONMENT=${ENVIRONMENT}

Expand All @@ -54,9 +47,17 @@ ARG GITHUB_CLIENT_ID
ENV GITHUB_CLIENT_ID=${GITHUB_CLIENT_ID}
ARG GITHUB_CLIENT_SECRET
ENV GITHUB_CLIENT_SECRET=${GITHUB_CLIENT_SECRET}
ARG GITHUB_ACCESS_TOKEN
ENV GITHUB_ACCESS_TOKEN={GITHUB_ACCESS_TOKEN}

ARG SLACK_BOT_TOKEN
ENV SLACK_BOT_TOKEN=${SLACK_BOT_TOKEN}
ARG SLACK_CLIENT_ID
ENV SLACK_CLIENT_ID=${SLACK_CLIENT_ID}
ARG SLACK_CLIENT_SECRET
ENV SLACK_CLIENT_SECRET=${SLACK_CLIENT_SECRET}
ARG SLACK_WEBHOOK
ENV SLACK_WEBHOOK=${SLACK_WEBHOOK}

ARG GITHUB_SECRET
ENV GITHUB_SECRET=${GITHUB_SECRET}
Expand All @@ -73,6 +74,9 @@ ENV CIRCLE_NODE_TOTAL=${CIRCLE_NODE_TOTAL}
ARG CIRCLE_NODE_INDEX
ENV CIRCLE_NODE_INDEX=${CIRCLE_NODE_INDEX}

ARG NODE_COVERALLS_DEBUG
ENV NODE_COVERALLS_DEBUG=0

# Create app directory
WORKDIR /opt/thinx/thinx-device-api

Expand All @@ -82,7 +86,7 @@ RUN apk add openjdk8-jre p7zip
# Install app dependencies
COPY package.json ./

RUN npm install -g npm@8.6.0 \
RUN npm install -g npm@10.2.3 \
&& npm install .

VOLUME /var/lib/docker
Expand Down
10 changes: 10 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@

## HISTORY

6/11/2023 1.9.2451

» Updating vulnerable components
» Improving security configuration
» Cleaning vulnerable/unnecessary parts of code

28/1/2023 1.8.2343

» Refactoring fixes, optimizations, dependency updates and cleanup, production fix

16/1/2023 1.8.2247

» Security fixes due to Circle CI leak (moved Mailgun API key to env var)
Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ IoT Device Management Server running on node.js.

[![CodeFactor](https://www.codefactor.io/repository/github/suculent/thinx-device-api/badge)](https://www.codefactor.io/repository/github/suculent/thinx-device-api)
[![codebeat badge](https://codebeat.co/badges/a3b416b1-b53b-4bc5-ae6e-8a2b9ca31880)](https://codebeat.co/projects/github-com-suculent-thinx-device-api-master)
[![Language grade: JavaScript](https://img.shields.io/lgtm/grade/javascript/g/suculent/thinx-device-api.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/suculent/thinx-device-api/context:javascript)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/9a7d084ad97e430ba12333f384b44255)](https://www.codacy.com/app/suculent/thinx-device-api?utm_source=github.com&utm_medium=referral&utm_content=suculent/thinx-device-api&utm_campaign=badger)
[![Total alerts](https://img.shields.io/lgtm/alerts/g/suculent/thinx-device-api.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/suculent/thinx-device-api/alerts/)
<a href="https://scan.coverity.com/projects/suculent-thinx-device-api">
<img alt="Coverity Scan Build Status"
src="https://scan.coverity.com/projects/18787/badge.svg"/>
Expand Down
28 changes: 28 additions & 0 deletions VeracodeIgnored.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[
{
"CWEId": "259",
"FlawMatch": {
"ProcedureHash": "1057981634",
"PrototypeHash": "2924686005",
"FlawHash": "2666345062",
"FlawHashCount": "1",
"FlawHashOrdinal": "1",
"CauseHash": "3488685266",
"CauseHashCount": "1",
"CauseHashOrdinal": "1",
"CauseHash2": "0",
"CauseHash2Ordinal": "0"
},
"Files": {
"SourceFile": {
"File": "auth.js",
"Line": "23",
"FunctionName": "add_mqtt_credentials",
"QualifiedFunctionName": "Auth.add_mqtt_credentials",
"FunctionPrototype": "add_mqtt_credentials(: ::Auth, : any, : any, : any, ...) : any",
"Scope": "^::Auth",
"AbsoluteFilePath": "/Users/sychram/Repositories/thinx-device-api/lib/thinx/auth.js"
}
}
}
]
2 changes: 1 addition & 1 deletion base
Submodule base updated 5 files
+1 −0 .cxast
+3 −4 Dockerfile
+3 −0 README.md
+2,162 −2,451 package-lock.json
+19 −19 package.json
2 changes: 1 addition & 1 deletion builders/arduino-docker-build
1 change: 0 additions & 1 deletion builders/lua-inspect
Submodule lua-inspect deleted from 901900
Loading
Loading