Compare commits
26 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 67190605a6 | |||
| 9479a07ddf | |||
| fbed56092f | |||
| 547b82b35b | |||
| 3dc63fa02e | |||
| e0154f5b70 | |||
| b268409897 | |||
| f3a9fd12c5 | |||
| ef741d84fb | |||
| b0ea97b922 | |||
| d1560811f5 | |||
| 5e872c4e6a | |||
| 3620e4549a | |||
| b32865e790 | |||
| ebe71a2a94 | |||
| 877a2ad0ee | |||
| 7be1aaedb3 | |||
| 05eb8e9723 | |||
| d95d89ea6f | |||
| 5d1b988579 | |||
| bae85eea9e | |||
| 2be7974991 | |||
| ac03b1f081 | |||
| 5ca209dd5a | |||
| 867e93b246 | |||
| aa9c4c1c28 |
@@ -6,7 +6,7 @@ on:
|
|||||||
- '**'
|
- '**'
|
||||||
|
|
||||||
env:
|
env:
|
||||||
IMAGE: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
IMAGE: code.foss.global/host.today/ht-docker-node:szci
|
||||||
NPMCI_COMPUTED_REPOURL: https://${{gitea.repository_owner}}:${{secrets.GITEA_TOKEN}}@gitea.lossless.digital/${{gitea.repository}}.git
|
NPMCI_COMPUTED_REPOURL: https://${{gitea.repository_owner}}:${{secrets.GITEA_TOKEN}}@gitea.lossless.digital/${{gitea.repository}}.git
|
||||||
NPMCI_TOKEN_NPM: ${{secrets.NPMCI_TOKEN_NPM}}
|
NPMCI_TOKEN_NPM: ${{secrets.NPMCI_TOKEN_NPM}}
|
||||||
NPMCI_TOKEN_NPM2: ${{secrets.NPMCI_TOKEN_NPM2}}
|
NPMCI_TOKEN_NPM2: ${{secrets.NPMCI_TOKEN_NPM2}}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ on:
|
|||||||
- '*'
|
- '*'
|
||||||
|
|
||||||
env:
|
env:
|
||||||
IMAGE: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
IMAGE: code.foss.global/host.today/ht-docker-node:szci
|
||||||
NPMCI_COMPUTED_REPOURL: https://${{gitea.repository_owner}}:${{secrets.GITEA_TOKEN}}@gitea.lossless.digital/${{gitea.repository}}.git
|
NPMCI_COMPUTED_REPOURL: https://${{gitea.repository_owner}}:${{secrets.GITEA_TOKEN}}@gitea.lossless.digital/${{gitea.repository}}.git
|
||||||
NPMCI_TOKEN_NPM: ${{secrets.NPMCI_TOKEN_NPM}}
|
NPMCI_TOKEN_NPM: ${{secrets.NPMCI_TOKEN_NPM}}
|
||||||
NPMCI_TOKEN_NPM2: ${{secrets.NPMCI_TOKEN_NPM2}}
|
NPMCI_TOKEN_NPM2: ${{secrets.NPMCI_TOKEN_NPM2}}
|
||||||
@@ -74,7 +74,7 @@ jobs:
|
|||||||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
|
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
container:
|
||||||
image: registry.gitlab.com/hosttoday/ht-docker-dbase:npmci
|
image: code.foss.global/host.today/ht-docker-node:dbase_dind
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
@@ -82,15 +82,13 @@ jobs:
|
|||||||
- name: Prepare
|
- name: Prepare
|
||||||
run: |
|
run: |
|
||||||
pnpm install -g pnpm
|
pnpm install -g pnpm
|
||||||
pnpm install -g @shipzone/npmci
|
pnpm install -g @git.zone/tsdocker
|
||||||
|
|
||||||
- name: Release
|
- name: Release
|
||||||
run: |
|
run: |
|
||||||
npmci docker login
|
tsdocker login
|
||||||
npmci docker build
|
tsdocker build
|
||||||
npmci docker test
|
tsdocker push
|
||||||
# npmci docker push gitea.lossless.digital
|
|
||||||
npmci docker push dockerregistry.lossless.digital
|
|
||||||
|
|
||||||
metadata:
|
metadata:
|
||||||
needs: test
|
needs: test
|
||||||
|
|||||||
40
Dockerfile
40
Dockerfile
@@ -1,44 +1,24 @@
|
|||||||
# gitzone dockerfile_service
|
# gitzone dockerfile_service
|
||||||
## STAGE 1 // BUILD
|
## STAGE 1 // BUILD
|
||||||
FROM registry.gitlab.com/hosttoday/ht-docker-node:npmci as node1
|
FROM code.foss.global/host.today/ht-docker-node:lts AS build
|
||||||
COPY ./ /app
|
COPY ./ /app
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
ARG NPMCI_TOKEN_NPM2
|
|
||||||
ENV NPMCI_TOKEN_NPM2 $NPMCI_TOKEN_NPM2
|
|
||||||
RUN npmci npm prepare
|
|
||||||
RUN pnpm config set store-dir .pnpm-store
|
RUN pnpm config set store-dir .pnpm-store
|
||||||
RUN rm -rf node_modules && pnpm install
|
RUN rm -rf node_modules && pnpm install
|
||||||
RUN pnpm run build
|
RUN pnpm run build
|
||||||
|
RUN rm -rf .pnpm-store node_modules && pnpm install --prod
|
||||||
|
|
||||||
|
## STAGE 2 // PRODUCTION
|
||||||
|
FROM code.foss.global/host.today/ht-docker-node:alpine-node AS production
|
||||||
|
|
||||||
|
# gcompat + libstdc++ for glibc-linked Rust binaries (smartproxy, smartmta, remoteingress)
|
||||||
|
RUN apk add --no-cache gcompat libstdc++
|
||||||
|
|
||||||
# gitzone dockerfile_service
|
|
||||||
## STAGE 2 // install production
|
|
||||||
FROM registry.gitlab.com/hosttoday/ht-docker-node:npmci as node2
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY --from=node1 /app /app
|
COPY --from=build /app /app
|
||||||
RUN rm -rf .pnpm-store
|
|
||||||
ARG NPMCI_TOKEN_NPM2
|
|
||||||
ENV NPMCI_TOKEN_NPM2 $NPMCI_TOKEN_NPM2
|
|
||||||
RUN npmci npm prepare
|
|
||||||
RUN pnpm config set store-dir .pnpm-store
|
|
||||||
RUN rm -rf node_modules/ && pnpm install --prod
|
|
||||||
|
|
||||||
|
ENV DCROUTER_MODE=OCI_CONTAINER
|
||||||
|
|
||||||
## STAGE 3 // rebuild dependencies for alpine
|
|
||||||
FROM registry.gitlab.com/hosttoday/ht-docker-node:alpinenpmci as node3
|
|
||||||
WORKDIR /app
|
|
||||||
COPY --from=node2 /app /app
|
|
||||||
ARG NPMCI_TOKEN_NPM2
|
|
||||||
ENV NPMCI_TOKEN_NPM2 $NPMCI_TOKEN_NPM2
|
|
||||||
RUN npmci npm prepare
|
|
||||||
RUN pnpm config set store-dir .pnpm-store
|
|
||||||
RUN pnpm rebuild -r
|
|
||||||
|
|
||||||
## STAGE 4 // the final production image with all dependencies in place
|
|
||||||
FROM registry.gitlab.com/hosttoday/ht-docker-node:alpine as node4
|
|
||||||
WORKDIR /app
|
|
||||||
COPY --from=node3 /app /app
|
|
||||||
|
|
||||||
### Healthchecks
|
|
||||||
RUN pnpm install -g @servezone/healthy
|
RUN pnpm install -g @servezone/healthy
|
||||||
HEALTHCHECK --interval=30s --timeout=30s --start-period=30s --retries=3 CMD [ "healthy" ]
|
HEALTHCHECK --interval=30s --timeout=30s --start-period=30s --retries=3 CMD [ "healthy" ]
|
||||||
|
|
||||||
|
|||||||
70
changelog.md
70
changelog.md
@@ -1,5 +1,75 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 2026-03-18 - 11.3.0 - feat(docker)
|
||||||
|
add OCI container startup configuration and migrate Docker release pipeline to tsdocker
|
||||||
|
|
||||||
|
- adds OCI container mode startup that reads DcRouter options from environment variables and an optional JSON config file
|
||||||
|
- simplifies the Docker image to a two-stage build with production dependencies only and Alpine runtime compatibility packages
|
||||||
|
- updates Gitea workflows and npm scripts to use tsdocker for image build and release
|
||||||
|
|
||||||
|
## 2026-03-18 - 11.2.56 - fix(deps)
|
||||||
|
bump @serve.zone/remoteingress to ^4.9.0
|
||||||
|
|
||||||
|
- Updates @serve.zone/remoteingress from ^4.8.18 to ^4.9.0 in package.json
|
||||||
|
|
||||||
|
## 2026-03-17 - 11.2.55 - fix(deps)
|
||||||
|
bump @serve.zone/catalog to ^2.7.0 and @serve.zone/remoteingress to ^4.8.18
|
||||||
|
|
||||||
|
- updates @serve.zone/catalog from ^2.6.2 to ^2.7.0
|
||||||
|
- updates @serve.zone/remoteingress from ^4.8.16 to ^4.8.18
|
||||||
|
|
||||||
|
## 2026-03-17 - 11.2.54 - fix(deps)
|
||||||
|
bump @serve.zone/remoteingress to ^4.8.16
|
||||||
|
|
||||||
|
- Updates @serve.zone/remoteingress from ^4.8.14 to ^4.8.16 in package.json.
|
||||||
|
|
||||||
|
## 2026-03-17 - 11.2.53 - fix(deps)
|
||||||
|
bump @push.rocks/smartproxy and @serve.zone/remoteingress patch versions
|
||||||
|
|
||||||
|
- update @push.rocks/smartproxy from ^25.11.23 to ^25.11.24
|
||||||
|
- update @serve.zone/remoteingress from ^4.8.13 to ^4.8.14
|
||||||
|
|
||||||
|
## 2026-03-17 - 11.2.52 - fix(deps)
|
||||||
|
bump @serve.zone/remoteingress to ^4.8.13
|
||||||
|
|
||||||
|
- Updates the @serve.zone/remoteingress dependency from ^4.8.12 to ^4.8.13.
|
||||||
|
|
||||||
|
## 2026-03-17 - 11.2.51 - fix(deps)
|
||||||
|
bump @serve.zone/remoteingress to ^4.8.12
|
||||||
|
|
||||||
|
- Updates @serve.zone/remoteingress from ^4.8.11 to ^4.8.12 in package.json
|
||||||
|
|
||||||
|
## 2026-03-17 - 11.2.50 - fix(deps)
|
||||||
|
bump @serve.zone/remoteingress to ^4.8.11
|
||||||
|
|
||||||
|
- updates @serve.zone/remoteingress from ^4.8.10 to ^4.8.11
|
||||||
|
|
||||||
|
## 2026-03-17 - 11.2.49 - fix(deps)
|
||||||
|
bump @serve.zone/remoteingress to ^4.8.10
|
||||||
|
|
||||||
|
- Updates @serve.zone/remoteingress from ^4.8.9 to ^4.8.10 in package.json
|
||||||
|
|
||||||
|
## 2026-03-17 - 11.2.48 - fix(deps)
|
||||||
|
bump @serve.zone/remoteingress to ^4.8.9
|
||||||
|
|
||||||
|
- Updates @serve.zone/remoteingress from ^4.8.7 to ^4.8.9 in package.json
|
||||||
|
|
||||||
|
## 2026-03-17 - 11.2.47 - fix(deps)
|
||||||
|
bump @push.rocks/smartproxy to ^25.11.23
|
||||||
|
|
||||||
|
- Updates the @push.rocks/smartproxy dependency from ^25.11.22 to ^25.11.23 in package.json
|
||||||
|
|
||||||
|
## 2026-03-17 - 11.2.46 - fix(deps)
|
||||||
|
bump @push.rocks/smartproxy to ^25.11.22
|
||||||
|
|
||||||
|
- Updates the @push.rocks/smartproxy dependency from ^25.11.21 to ^25.11.22 in package.json.
|
||||||
|
|
||||||
|
## 2026-03-17 - 11.2.45 - fix(deps)
|
||||||
|
bump @push.rocks/smartproxy and @serve.zone/remoteingress dependencies
|
||||||
|
|
||||||
|
- update @push.rocks/smartproxy from ^25.11.20 to ^25.11.21
|
||||||
|
- update @serve.zone/remoteingress from ^4.8.3 to ^4.8.7
|
||||||
|
|
||||||
## 2026-03-17 - 11.2.44 - fix(deps)
|
## 2026-03-17 - 11.2.44 - fix(deps)
|
||||||
bump @serve.zone/remoteingress to ^4.8.3
|
bump @serve.zone/remoteingress to ^4.8.3
|
||||||
|
|
||||||
|
|||||||
@@ -72,9 +72,14 @@
|
|||||||
"dockerRegistryRepoMap": {
|
"dockerRegistryRepoMap": {
|
||||||
"registry.gitlab.com": "code.foss.global/serve.zone/dcrouter"
|
"registry.gitlab.com": "code.foss.global/serve.zone/dcrouter"
|
||||||
},
|
},
|
||||||
"dockerBuildargEnvMap": {
|
|
||||||
"NPMCI_TOKEN_NPM2": "NPMCI_TOKEN_NPM2"
|
|
||||||
},
|
|
||||||
"npmRegistryUrl": "verdaccio.lossless.digital"
|
"npmRegistryUrl": "verdaccio.lossless.digital"
|
||||||
|
},
|
||||||
|
"@git.zone/tsdocker": {
|
||||||
|
"registries": ["code.foss.global"],
|
||||||
|
"registryRepoMap": {
|
||||||
|
"code.foss.global": "serve.zone/dcrouter",
|
||||||
|
"dockerregistry.lossless.digital": "serve.zone/dcrouter"
|
||||||
|
},
|
||||||
|
"platforms": ["linux/amd64", "linux/arm64"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
10
package.json
10
package.json
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@serve.zone/dcrouter",
|
"name": "@serve.zone/dcrouter",
|
||||||
"private": false,
|
"private": false,
|
||||||
"version": "11.2.44",
|
"version": "11.3.0",
|
||||||
"description": "A multifaceted routing service handling mail and SMS delivery functions.",
|
"description": "A multifaceted routing service handling mail and SMS delivery functions.",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"exports": {
|
"exports": {
|
||||||
@@ -16,6 +16,8 @@
|
|||||||
"start": "(node --max_old_space_size=250 ./cli.js)",
|
"start": "(node --max_old_space_size=250 ./cli.js)",
|
||||||
"startTs": "(node cli.ts.js)",
|
"startTs": "(node cli.ts.js)",
|
||||||
"build": "(tsbuild tsfolders --allowimplicitany && npm run bundle)",
|
"build": "(tsbuild tsfolders --allowimplicitany && npm run bundle)",
|
||||||
|
"build:docker": "tsdocker build",
|
||||||
|
"release:docker": "tsdocker push",
|
||||||
"bundle": "(tsbundle)",
|
"bundle": "(tsbundle)",
|
||||||
"watch": "tswatch"
|
"watch": "tswatch"
|
||||||
},
|
},
|
||||||
@@ -51,15 +53,15 @@
|
|||||||
"@push.rocks/smartnetwork": "^4.4.0",
|
"@push.rocks/smartnetwork": "^4.4.0",
|
||||||
"@push.rocks/smartpath": "^6.0.0",
|
"@push.rocks/smartpath": "^6.0.0",
|
||||||
"@push.rocks/smartpromise": "^4.2.3",
|
"@push.rocks/smartpromise": "^4.2.3",
|
||||||
"@push.rocks/smartproxy": "^25.11.20",
|
"@push.rocks/smartproxy": "^25.11.24",
|
||||||
"@push.rocks/smartradius": "^1.1.1",
|
"@push.rocks/smartradius": "^1.1.1",
|
||||||
"@push.rocks/smartrequest": "^5.0.1",
|
"@push.rocks/smartrequest": "^5.0.1",
|
||||||
"@push.rocks/smartrx": "^3.0.10",
|
"@push.rocks/smartrx": "^3.0.10",
|
||||||
"@push.rocks/smartstate": "^2.2.0",
|
"@push.rocks/smartstate": "^2.2.0",
|
||||||
"@push.rocks/smartunique": "^3.0.9",
|
"@push.rocks/smartunique": "^3.0.9",
|
||||||
"@serve.zone/catalog": "^2.6.2",
|
"@serve.zone/catalog": "^2.7.0",
|
||||||
"@serve.zone/interfaces": "^5.3.0",
|
"@serve.zone/interfaces": "^5.3.0",
|
||||||
"@serve.zone/remoteingress": "^4.8.3",
|
"@serve.zone/remoteingress": "^4.9.0",
|
||||||
"@tsclass/tsclass": "^9.4.0",
|
"@tsclass/tsclass": "^9.4.0",
|
||||||
"lru-cache": "^11.2.7",
|
"lru-cache": "^11.2.7",
|
||||||
"uuid": "^13.0.0"
|
"uuid": "^13.0.0"
|
||||||
|
|||||||
30
pnpm-lock.yaml
generated
30
pnpm-lock.yaml
generated
@@ -78,8 +78,8 @@ importers:
|
|||||||
specifier: ^4.2.3
|
specifier: ^4.2.3
|
||||||
version: 4.2.3
|
version: 4.2.3
|
||||||
'@push.rocks/smartproxy':
|
'@push.rocks/smartproxy':
|
||||||
specifier: ^25.11.20
|
specifier: ^25.11.24
|
||||||
version: 25.11.20
|
version: 25.11.24
|
||||||
'@push.rocks/smartradius':
|
'@push.rocks/smartradius':
|
||||||
specifier: ^1.1.1
|
specifier: ^1.1.1
|
||||||
version: 1.1.1
|
version: 1.1.1
|
||||||
@@ -96,14 +96,14 @@ importers:
|
|||||||
specifier: ^3.0.9
|
specifier: ^3.0.9
|
||||||
version: 3.0.9
|
version: 3.0.9
|
||||||
'@serve.zone/catalog':
|
'@serve.zone/catalog':
|
||||||
specifier: ^2.6.2
|
specifier: ^2.7.0
|
||||||
version: 2.6.2(@tiptap/pm@2.27.2)
|
version: 2.7.0(@tiptap/pm@2.27.2)
|
||||||
'@serve.zone/interfaces':
|
'@serve.zone/interfaces':
|
||||||
specifier: ^5.3.0
|
specifier: ^5.3.0
|
||||||
version: 5.3.0
|
version: 5.3.0
|
||||||
'@serve.zone/remoteingress':
|
'@serve.zone/remoteingress':
|
||||||
specifier: ^4.8.3
|
specifier: ^4.9.0
|
||||||
version: 4.8.3
|
version: 4.9.0
|
||||||
'@tsclass/tsclass':
|
'@tsclass/tsclass':
|
||||||
specifier: ^9.4.0
|
specifier: ^9.4.0
|
||||||
version: 9.4.0
|
version: 9.4.0
|
||||||
@@ -1256,8 +1256,8 @@ packages:
|
|||||||
'@push.rocks/smartpromise@4.2.3':
|
'@push.rocks/smartpromise@4.2.3':
|
||||||
resolution: {integrity: sha512-Ycg/TJR+tMt+S3wSFurOpEoW6nXv12QBtKXgBcjMZ4RsdO28geN46U09osPn9N9WuwQy1PkmTV5J/V4F9U8qEw==}
|
resolution: {integrity: sha512-Ycg/TJR+tMt+S3wSFurOpEoW6nXv12QBtKXgBcjMZ4RsdO28geN46U09osPn9N9WuwQy1PkmTV5J/V4F9U8qEw==}
|
||||||
|
|
||||||
'@push.rocks/smartproxy@25.11.20':
|
'@push.rocks/smartproxy@25.11.24':
|
||||||
resolution: {integrity: sha512-FsevYAXGB7ZvqIE6tPf5exVXEQeTJPce+3VU2+DnHRLhHzUtobACNZFf+k8MHJs3EZKGhgCJi1U5azLE3T0gSw==}
|
resolution: {integrity: sha512-dkeQJM2W5wKwTBZXxy3hGhIyQv2XeAQqwWliDbi/2oy6LU6BFdgpzEdhE5emG+wOcfQTagALpOIt7lBAzetjSA==}
|
||||||
|
|
||||||
'@push.rocks/smartpuppeteer@2.0.5':
|
'@push.rocks/smartpuppeteer@2.0.5':
|
||||||
resolution: {integrity: sha512-yK/qSeWVHIGWRp3c8S5tfdGP6WCKllZC4DR8d8CQlEjszOSBmHtlTdyyqOMBZ/BA4kd+eU5f3A1r4K2tGYty1g==}
|
resolution: {integrity: sha512-yK/qSeWVHIGWRp3c8S5tfdGP6WCKllZC4DR8d8CQlEjszOSBmHtlTdyyqOMBZ/BA4kd+eU5f3A1r4K2tGYty1g==}
|
||||||
@@ -1545,14 +1545,14 @@ packages:
|
|||||||
'@selderee/plugin-htmlparser2@0.11.0':
|
'@selderee/plugin-htmlparser2@0.11.0':
|
||||||
resolution: {integrity: sha512-P33hHGdldxGabLFjPPpaTxVolMrzrcegejx+0GxjrIb9Zv48D8yAIA/QTDR2dFl7Uz7urX8aX6+5bCZslr+gWQ==}
|
resolution: {integrity: sha512-P33hHGdldxGabLFjPPpaTxVolMrzrcegejx+0GxjrIb9Zv48D8yAIA/QTDR2dFl7Uz7urX8aX6+5bCZslr+gWQ==}
|
||||||
|
|
||||||
'@serve.zone/catalog@2.6.2':
|
'@serve.zone/catalog@2.7.0':
|
||||||
resolution: {integrity: sha512-1XPdgkqjx80r3mjE03QOex0r48jz2SzQ8lwz/VBvPtwgJYH0DO5TBuMSgT56YeQ1c/e2vVpqdXIicbcJoreBYw==}
|
resolution: {integrity: sha512-BSfLi9BZE5wvu5Dxh0p/mM9bE+9lf35PGHRZ1Cw/+YpWxOfIFPTZKkBz2OUn3yctWw+V7l1VBBYuLX1bVCKFfA==}
|
||||||
|
|
||||||
'@serve.zone/interfaces@5.3.0':
|
'@serve.zone/interfaces@5.3.0':
|
||||||
resolution: {integrity: sha512-venO7wtDR9ixzD9NhdERBGjNKbFA5LL0yHw4eqGh0UpmvtXVc3SFG0uuHDilOKMZqZ8bttV88qVsFy1aSTJrtA==}
|
resolution: {integrity: sha512-venO7wtDR9ixzD9NhdERBGjNKbFA5LL0yHw4eqGh0UpmvtXVc3SFG0uuHDilOKMZqZ8bttV88qVsFy1aSTJrtA==}
|
||||||
|
|
||||||
'@serve.zone/remoteingress@4.8.3':
|
'@serve.zone/remoteingress@4.9.0':
|
||||||
resolution: {integrity: sha512-umDqJWW7Kwts88/sJ9F6Sv5nZLxP/wbBJygva+jMFiyHgYqj7uLyZ0+15ij9er67izzzMV0h02KckO//X2jpxw==}
|
resolution: {integrity: sha512-GeQqU6uqtJqfV1fJauneuyodeAVK7X5eVCo8j83fTNt9r0TXFBNvAa7u1sxRNuGRBScQs4urHlUf9P8vuZLV0g==}
|
||||||
|
|
||||||
'@sindresorhus/is@5.6.0':
|
'@sindresorhus/is@5.6.0':
|
||||||
resolution: {integrity: sha512-TV7t8GKYaJWsn00tFDqBw8+Uqmr8A0fRU1tvTQhyZzGv0sJCGRQL3JGMI3ucuKo3XIZdUP+Lx7/gh2t3lewy7g==}
|
resolution: {integrity: sha512-TV7t8GKYaJWsn00tFDqBw8+Uqmr8A0fRU1tvTQhyZzGv0sJCGRQL3JGMI3ucuKo3XIZdUP+Lx7/gh2t3lewy7g==}
|
||||||
@@ -6534,7 +6534,7 @@ snapshots:
|
|||||||
|
|
||||||
'@push.rocks/smartpromise@4.2.3': {}
|
'@push.rocks/smartpromise@4.2.3': {}
|
||||||
|
|
||||||
'@push.rocks/smartproxy@25.11.20':
|
'@push.rocks/smartproxy@25.11.24':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@push.rocks/smartcrypto': 2.0.4
|
'@push.rocks/smartcrypto': 2.0.4
|
||||||
'@push.rocks/smartlog': 3.2.1
|
'@push.rocks/smartlog': 3.2.1
|
||||||
@@ -6932,7 +6932,7 @@ snapshots:
|
|||||||
domhandler: 5.0.3
|
domhandler: 5.0.3
|
||||||
selderee: 0.11.0
|
selderee: 0.11.0
|
||||||
|
|
||||||
'@serve.zone/catalog@2.6.2(@tiptap/pm@2.27.2)':
|
'@serve.zone/catalog@2.7.0(@tiptap/pm@2.27.2)':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@design.estate/dees-catalog': 3.48.5(@tiptap/pm@2.27.2)
|
'@design.estate/dees-catalog': 3.48.5(@tiptap/pm@2.27.2)
|
||||||
'@design.estate/dees-domtools': 2.5.1
|
'@design.estate/dees-domtools': 2.5.1
|
||||||
@@ -6951,7 +6951,7 @@ snapshots:
|
|||||||
'@push.rocks/smartlog-interfaces': 3.0.2
|
'@push.rocks/smartlog-interfaces': 3.0.2
|
||||||
'@tsclass/tsclass': 9.4.0
|
'@tsclass/tsclass': 9.4.0
|
||||||
|
|
||||||
'@serve.zone/remoteingress@4.8.3':
|
'@serve.zone/remoteingress@4.9.0':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@push.rocks/qenv': 6.1.3
|
'@push.rocks/qenv': 6.1.3
|
||||||
'@push.rocks/smartrust': 1.3.2
|
'@push.rocks/smartrust': 1.3.2
|
||||||
|
|||||||
@@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@serve.zone/dcrouter',
|
name: '@serve.zone/dcrouter',
|
||||||
version: '11.2.44',
|
version: '11.3.0',
|
||||||
description: 'A multifaceted routing service handling mail and SMS delivery functions.'
|
description: 'A multifaceted routing service handling mail and SMS delivery functions.'
|
||||||
}
|
}
|
||||||
|
|||||||
23
ts/index.ts
23
ts/index.ts
@@ -5,6 +5,7 @@ export { UnifiedEmailServer } from '@push.rocks/smartmta';
|
|||||||
export type { IUnifiedEmailServerOptions, IEmailRoute, IEmailDomainConfig } from '@push.rocks/smartmta';
|
export type { IUnifiedEmailServerOptions, IEmailRoute, IEmailDomainConfig } from '@push.rocks/smartmta';
|
||||||
|
|
||||||
// DcRouter
|
// DcRouter
|
||||||
|
import { DcRouter } from './classes.dcrouter.js';
|
||||||
export * from './classes.dcrouter.js';
|
export * from './classes.dcrouter.js';
|
||||||
|
|
||||||
// RADIUS module
|
// RADIUS module
|
||||||
@@ -13,4 +14,24 @@ export * from './radius/index.js';
|
|||||||
// Remote Ingress module
|
// Remote Ingress module
|
||||||
export * from './remoteingress/index.js';
|
export * from './remoteingress/index.js';
|
||||||
|
|
||||||
export const runCli = async () => {};
|
export const runCli = async () => {
|
||||||
|
let options: import('./classes.dcrouter.js').IDcRouterOptions = {};
|
||||||
|
|
||||||
|
if (process.env.DCROUTER_MODE === 'OCI_CONTAINER') {
|
||||||
|
const { getOciContainerConfig } = await import('../ts_oci_container/index.js');
|
||||||
|
options = getOciContainerConfig();
|
||||||
|
console.log('[DCRouter] Starting in OCI Container mode...');
|
||||||
|
}
|
||||||
|
|
||||||
|
const dcRouter = new DcRouter(options);
|
||||||
|
await dcRouter.start();
|
||||||
|
console.log('[DCRouter] Running. Send SIGTERM or SIGINT to stop.');
|
||||||
|
|
||||||
|
const shutdown = async () => {
|
||||||
|
console.log('[DCRouter] Shutting down...');
|
||||||
|
await dcRouter.stop();
|
||||||
|
process.exit(0);
|
||||||
|
};
|
||||||
|
process.on('SIGINT', shutdown);
|
||||||
|
process.on('SIGTERM', shutdown);
|
||||||
|
};
|
||||||
|
|||||||
100
ts_oci_container/index.ts
Normal file
100
ts_oci_container/index.ts
Normal file
@@ -0,0 +1,100 @@
|
|||||||
|
import * as plugins from './plugins.js';
|
||||||
|
import type { IDcRouterOptions } from '../ts/classes.dcrouter.js';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parses a comma-separated env var into a string array.
|
||||||
|
* Returns undefined if the env var is not set or empty.
|
||||||
|
*/
|
||||||
|
function parseCommaSeparated(envVar: string | undefined): string[] | undefined {
|
||||||
|
if (!envVar || envVar.trim() === '') return undefined;
|
||||||
|
return envVar.split(',').map((s) => s.trim()).filter(Boolean);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parses a comma-separated env var into a number array.
|
||||||
|
* Returns undefined if the env var is not set or empty.
|
||||||
|
*/
|
||||||
|
function parseCommaSeparatedNumbers(envVar: string | undefined): number[] | undefined {
|
||||||
|
const parts = parseCommaSeparated(envVar);
|
||||||
|
if (!parts) return undefined;
|
||||||
|
return parts.map((s) => parseInt(s, 10)).filter((n) => !isNaN(n));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Builds IDcRouterOptions from environment variables for OCI container mode.
|
||||||
|
*
|
||||||
|
* If DCROUTER_CONFIG_PATH is set and the file exists, it is loaded as a JSON base config.
|
||||||
|
* Individual env vars are then applied as overrides on top.
|
||||||
|
*/
|
||||||
|
export function getOciContainerConfig(): IDcRouterOptions {
|
||||||
|
let options: IDcRouterOptions = {};
|
||||||
|
|
||||||
|
// Load JSON config file if specified
|
||||||
|
const configPath = process.env.DCROUTER_CONFIG_PATH;
|
||||||
|
if (configPath && plugins.fs.existsSync(configPath)) {
|
||||||
|
const raw = plugins.fs.readFileSync(configPath, 'utf8');
|
||||||
|
options = JSON.parse(raw);
|
||||||
|
console.log(`[OCI Container] Loaded config from ${configPath}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Apply env var overrides
|
||||||
|
if (process.env.DCROUTER_BASE_DIR) {
|
||||||
|
options.baseDir = process.env.DCROUTER_BASE_DIR;
|
||||||
|
}
|
||||||
|
|
||||||
|
// TLS config
|
||||||
|
const tlsEmail = process.env.DCROUTER_TLS_EMAIL;
|
||||||
|
const tlsDomain = process.env.DCROUTER_TLS_DOMAIN;
|
||||||
|
if (tlsEmail || tlsDomain) {
|
||||||
|
options.tls = {
|
||||||
|
...options.tls,
|
||||||
|
contactEmail: tlsEmail || options.tls?.contactEmail || '',
|
||||||
|
...(tlsDomain ? { domain: tlsDomain } : {}),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
// Network config
|
||||||
|
if (process.env.DCROUTER_PUBLIC_IP) {
|
||||||
|
options.publicIp = process.env.DCROUTER_PUBLIC_IP;
|
||||||
|
}
|
||||||
|
|
||||||
|
const proxyIps = parseCommaSeparated(process.env.DCROUTER_PROXY_IPS);
|
||||||
|
if (proxyIps) {
|
||||||
|
options.proxyIps = proxyIps;
|
||||||
|
}
|
||||||
|
|
||||||
|
// DNS config
|
||||||
|
const nsDomains = parseCommaSeparated(process.env.DCROUTER_DNS_NS_DOMAINS);
|
||||||
|
if (nsDomains) {
|
||||||
|
options.dnsNsDomains = nsDomains;
|
||||||
|
}
|
||||||
|
|
||||||
|
const dnsScopes = parseCommaSeparated(process.env.DCROUTER_DNS_SCOPES);
|
||||||
|
if (dnsScopes) {
|
||||||
|
options.dnsScopes = dnsScopes;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Email config
|
||||||
|
const emailHostname = process.env.DCROUTER_EMAIL_HOSTNAME;
|
||||||
|
const emailPorts = parseCommaSeparatedNumbers(process.env.DCROUTER_EMAIL_PORTS);
|
||||||
|
if (emailHostname || emailPorts) {
|
||||||
|
options.emailConfig = {
|
||||||
|
...options.emailConfig,
|
||||||
|
...(emailHostname ? { hostname: emailHostname } : {}),
|
||||||
|
...(emailPorts ? { ports: emailPorts } : {}),
|
||||||
|
domains: options.emailConfig?.domains || [],
|
||||||
|
routes: options.emailConfig?.routes || [],
|
||||||
|
} as IDcRouterOptions['emailConfig'];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Cache config
|
||||||
|
const cacheEnabled = process.env.DCROUTER_CACHE_ENABLED;
|
||||||
|
if (cacheEnabled !== undefined) {
|
||||||
|
options.cacheConfig = {
|
||||||
|
...options.cacheConfig,
|
||||||
|
enabled: cacheEnabled === 'true',
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
return options;
|
||||||
|
}
|
||||||
7
ts_oci_container/plugins.ts
Normal file
7
ts_oci_container/plugins.ts
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
import * as fs from 'fs';
|
||||||
|
import * as path from 'path';
|
||||||
|
|
||||||
|
export {
|
||||||
|
fs,
|
||||||
|
path,
|
||||||
|
};
|
||||||
@@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@serve.zone/dcrouter',
|
name: '@serve.zone/dcrouter',
|
||||||
version: '11.2.44',
|
version: '11.3.0',
|
||||||
description: 'A multifaceted routing service handling mail and SMS delivery functions.'
|
description: 'A multifaceted routing service handling mail and SMS delivery functions.'
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user