@ossy/deployment-tools 1.17.10 → 1.17.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,22 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## 1.17.12 (2026-05-25)
7
+
8
+ **Note:** Version bump only for package @ossy/deployment-tools
9
+
10
+
11
+
12
+
13
+
14
+ ## 1.17.11 (2026-05-25)
15
+
16
+ **Note:** Version bump only for package @ossy/deployment-tools
17
+
18
+
19
+
20
+
21
+
6
22
  ## 1.17.10 (2026-05-25)
7
23
 
8
24
  **Note:** Version bump only for package @ossy/deployment-tools
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ossy/deployment-tools",
3
- "version": "1.17.10",
3
+ "version": "1.17.12",
4
4
  "description": "Collection of scripts and tools to aid deployment of containers and static files to Amazon Web Services through GitHub Actions",
5
5
  "source": "./src/index.js",
6
6
  "main": "./src/index.js",
@@ -26,5 +26,5 @@
26
26
  "devDependencies": {
27
27
  "jest": "^27.5.1"
28
28
  },
29
- "gitHead": "9c65b3f68767d269cb25810b3110798f1acc7a1d"
29
+ "gitHead": "c6eb8d3b9ffef1e426fc0e49099d5ea99aa5aa7f"
30
30
  }
@@ -4,6 +4,7 @@
4
4
  * @property {string} platformName - Name of platform
5
5
  * @property {string[]=} sesDomains - list of domains to configure AWS SES email identity and DKIM records for
6
6
  * @property {object} dnsRecords - map of dns records by root domain, only supports MX records so that we can add dns records for our email service
7
+ * @property {Record<string,string>=} env - environment variables written to /etc/environment on the EC2 host at boot time; never uploaded to S3
7
8
  *
8
9
  * @property {string} awsAccountId - Aws account id
9
10
  * @property {string=} awsRegion - ?
@@ -15,6 +15,32 @@ api.ossy.se {
15
15
  reverse_proxy localhost:3001
16
16
  }
17
17
 
18
+ # TODO: remove this block once ossy.se traffic flows through the platform runtime.
19
+ # Once ossy app publish is validated for ossy.se, delete this block and the
20
+ # ossy-website-ossy.service so the catch-all below serves it via the platform.
21
+ ossy.se {
22
+ tls {
23
+ dns route53 {
24
+ max_retries 10
25
+ profile ci-client
26
+ }
27
+ }
28
+ reverse_proxy localhost:3002
29
+ }
30
+
31
+ # TODO: remove this block once www.plexus-sanitas.com traffic flows through the platform runtime.
32
+ # Once ossy app publish is validated for plexus-sanitas, delete this block and the
33
+ # ossy-website-plexus-sanitas.service so the catch-all below serves it via the platform.
34
+ www.plexus-sanitas.com {
35
+ tls {
36
+ dns route53 {
37
+ max_retries 10
38
+ profile ci-client
39
+ }
40
+ }
41
+ reverse_proxy localhost:3003
42
+ }
43
+
18
44
  :443 {
19
45
  tls {
20
46
  on_demand
@@ -19,6 +19,8 @@ const { getInstallNodeJs, getInstallNpm, getInstallDocker } = require('./user-da
19
19
  const { CaddyService } = require('./caddy.service')
20
20
  const { OssyRuntimeService } = require('./ossy-runtime.service')
21
21
  const { OssyApiService } = require('./ossy-api.service')
22
+ const { OssyWebsiteOssyService } = require('./ossy-website-ossy.service')
23
+ const { OssyWebsitePlexusSanitasService } = require('./ossy-website-plexus-sanitas.service')
22
24
  const { AwsProfile } = require('./aws-profile')
23
25
  const { SupportedRegions } = require('../../config')
24
26
 
@@ -69,7 +71,7 @@ class ContainerDeploymentTarget extends Construct {
69
71
  )
70
72
 
71
73
  const platformConfigDeployment = new BucketDeployment(this, 'PlatformConfigDeployment', {
72
- sources: [Source.jsonData('platform-config.json', { ...props.config, awsRoleToAssume: undefined })],
74
+ sources: [Source.jsonData('platform-config.json', { ...props.config, awsRoleToAssume: undefined, env: undefined })],
73
75
  destinationBucket: props.bucket,
74
76
  // Default prune:true would delete every other object (e.g. media/*) on each infra deploy.
75
77
  prune: false
@@ -106,6 +108,9 @@ class ContainerDeploymentTarget extends Construct {
106
108
 
107
109
  const userData = UserData.forLinux()
108
110
 
111
+ // Write platform env vars to /etc/environment so all systemd services pick them up.
112
+ const envLines = Object.entries(props.config.env ?? {}).map(([k, v]) => `${k}=${v}`)
113
+
109
114
  userData.addCommands(
110
115
  'sudo groupadd docker',
111
116
  'sudo usermod -aG docker ubuntu',
@@ -116,11 +121,15 @@ class ContainerDeploymentTarget extends Construct {
116
121
  ...getInstallDocker(),
117
122
  'sudo apt-get install awscli --yes',
118
123
  ...AwsProfile.writeFile(role.roleArn, SupportedRegions.North),
124
+ // Write all platform env vars before starting any service
125
+ `sudo tee /etc/environment << 'ENVEOF'\n${envLines.join('\n')}\nENVEOF`,
119
126
  // Create shared Docker network for inter-container communication
120
127
  'docker network create ossy-network || true',
121
128
  ...CaddyService.install(),
122
129
  ...OssyRuntimeService.install(),
123
- ...OssyApiService.install()
130
+ ...OssyApiService.install(),
131
+ ...OssyWebsiteOssyService.install(),
132
+ ...OssyWebsitePlexusSanitasService.install()
124
133
  )
125
134
 
126
135
  userData.addS3DownloadCommand({
@@ -136,7 +145,11 @@ class ContainerDeploymentTarget extends Construct {
136
145
  ...OssyRuntimeService.enable(),
137
146
  ...OssyRuntimeService.start(),
138
147
  ...OssyApiService.enable(),
139
- ...OssyApiService.start()
148
+ ...OssyApiService.start(),
149
+ ...OssyWebsiteOssyService.enable(),
150
+ ...OssyWebsiteOssyService.start(),
151
+ ...OssyWebsitePlexusSanitasService.enable(),
152
+ ...OssyWebsitePlexusSanitasService.start()
140
153
  )
141
154
 
142
155
  const ec2Instance = new Instance(this, 'Ec2Instance', {
@@ -0,0 +1,52 @@
1
+ // TODO: remove this service once ossy.se traffic flows through the platform runtime.
2
+ // The platform runtime (ghcr.io/ossy-se/platform) is the long-term host for all
3
+ // tenant sites including ossy.se. This service is a stopgap while the CMS-based
4
+ // publish flow is validated in production.
5
+
6
+ const systemdServiceFile = `
7
+ [Unit]
8
+ Description=Ossy Website (ossy.se)
9
+ After=network.target docker.service
10
+ Requires=docker.service
11
+
12
+ [Service]
13
+ EnvironmentFile=/etc/environment
14
+ ExecStartPre=-/usr/bin/docker rm -f ossy-website-ossy
15
+ ExecStartPre=/usr/bin/docker pull ghcr.io/ossy-se/website-ossy:latest
16
+ ExecStart=/usr/bin/docker run --name ossy-website-ossy \\
17
+ --network ossy-network \\
18
+ -p 3002:3000 \\
19
+ -e PORT=3000 \\
20
+ -e OSSY_API_URL=http://ossy-api:3001 \\
21
+ -e OSSY_COOKIE_SECRET=\${OSSY_COOKIE_SECRET} \\
22
+ ghcr.io/ossy-se/website-ossy:latest
23
+ ExecStop=/usr/bin/docker stop ossy-website-ossy
24
+ Restart=on-failure
25
+ RestartSec=5
26
+
27
+ [Install]
28
+ WantedBy=multi-user.target
29
+ `
30
+
31
+ /**
32
+ * @class
33
+ */
34
+ class OssyWebsiteOssyService {
35
+
36
+ static install() {
37
+ return [`sudo tee /etc/systemd/system/ossy-website-ossy.service > /dev/null << 'EOF'\n${systemdServiceFile}\nEOF`]
38
+ }
39
+
40
+ static enable() {
41
+ return ['sudo systemctl enable ossy-website-ossy']
42
+ }
43
+
44
+ static start() {
45
+ return ['sudo systemctl start ossy-website-ossy']
46
+ }
47
+
48
+ }
49
+
50
+ module.exports = {
51
+ OssyWebsiteOssyService
52
+ }
@@ -0,0 +1,52 @@
1
+ // TODO: remove this service once www.plexus-sanitas.com traffic flows through the platform runtime.
2
+ // The platform runtime (ghcr.io/ossy-se/platform) is the long-term host for all
3
+ // tenant sites including plexus-sanitas. This service is a stopgap while the CMS-based
4
+ // publish flow is validated in production.
5
+
6
+ const systemdServiceFile = `
7
+ [Unit]
8
+ Description=Ossy Website (www.plexus-sanitas.com)
9
+ After=network.target docker.service
10
+ Requires=docker.service
11
+
12
+ [Service]
13
+ EnvironmentFile=/etc/environment
14
+ ExecStartPre=-/usr/bin/docker rm -f ossy-website-plexus-sanitas
15
+ ExecStartPre=/usr/bin/docker pull ghcr.io/ossy-se/website-plexus-sanitas:latest
16
+ ExecStart=/usr/bin/docker run --name ossy-website-plexus-sanitas \\
17
+ --network ossy-network \\
18
+ -p 3003:3000 \\
19
+ -e PORT=3000 \\
20
+ -e OSSY_API_URL=http://ossy-api:3001 \\
21
+ -e OSSY_COOKIE_SECRET=\${OSSY_COOKIE_SECRET} \\
22
+ ghcr.io/ossy-se/website-plexus-sanitas:latest
23
+ ExecStop=/usr/bin/docker stop ossy-website-plexus-sanitas
24
+ Restart=on-failure
25
+ RestartSec=5
26
+
27
+ [Install]
28
+ WantedBy=multi-user.target
29
+ `
30
+
31
+ /**
32
+ * @class
33
+ */
34
+ class OssyWebsitePlexusSanitasService {
35
+
36
+ static install() {
37
+ return [`sudo tee /etc/systemd/system/ossy-website-plexus-sanitas.service > /dev/null << 'EOF'\n${systemdServiceFile}\nEOF`]
38
+ }
39
+
40
+ static enable() {
41
+ return ['sudo systemctl enable ossy-website-plexus-sanitas']
42
+ }
43
+
44
+ static start() {
45
+ return ['sudo systemctl start ossy-website-plexus-sanitas']
46
+ }
47
+
48
+ }
49
+
50
+ module.exports = {
51
+ OssyWebsitePlexusSanitasService
52
+ }