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

Remove gosu from redis #1250

Merged
merged 3 commits into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
working-directory: openc3
- uses: actions/setup-node@v4
with:
node-version: "16.x"
node-version: 18
registry-url: "https://registry.npmjs.org"
- name: Set up Python
uses: actions/setup-python@v5
Expand Down
12 changes: 6 additions & 6 deletions docs.openc3.com/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,18 @@
"write-heading-ids": "docusaurus write-heading-ids"
},
"dependencies": {
"@docusaurus/core": "3.1.0",
"@docusaurus/plugin-client-redirects": "3.1.0",
"@docusaurus/preset-classic": "3.1.0",
"@docusaurus/core": "^3.3.2",
"@docusaurus/plugin-client-redirects": "^3.3.2",
"@docusaurus/preset-classic": "^3.3.2",
"@mdx-js/react": "3.0.0",
"docusaurus-lunr-search": "3.3.2",
"docusaurus-lunr-search": "3.4.0",
"prism-react-renderer": "2.3.1",
"react": "18.2.0",
"react-dom": "18.2.0"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "3.1.0",
"@docusaurus/types": "3.1.0"
"@docusaurus/module-type-aliases": "^3.3.2",
"@docusaurus/types": "^3.3.2"
},
"browserslist": {
"production": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ export default {
'openc3-cosmos-enterprise-tool-admin',
'openc3-cosmos-tool-autonomic',
'openc3-cosmos-tool-calendar',
'openc3-cosmos-tool-grafana',
'openc3-enterprise-tool-base',
'openc3-tool-base',
],
Expand Down Expand Up @@ -355,13 +356,13 @@ export default {
this.update()
}, 5000)
}
},
}
)
},
formatDate(nanoSecs) {
return format(
toDate(parseInt(nanoSecs) / 1_000_000),
'yyyy-MM-dd HH:mm:ss.SSS',
'yyyy-MM-dd HH:mm:ss.SSS'
)
},
upload: function (existing = null) {
Expand Down Expand Up @@ -547,7 +548,7 @@ export default {
{
okText: 'Ok',
cancelText: 'Cancel',
},
}
)
.then(() => {
this.upload(this.currentPlugin)
Expand All @@ -574,7 +575,7 @@ export default {
{
okText: 'Ok',
cancelText: 'Cancel',
},
}
)
.then(() => {
this.upload(this.currentPlugin)
Expand Down
2 changes: 2 additions & 0 deletions openc3-redis/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ RUN if [[ $OPENC3_DEPENDENCY_REGISTRY == 'docker.io' ]]; then \
apk add shadow; \
usermod -u 1001 redis; \
groupmod -g 1001 redis; \
# Remove gosu to eliminate a ton of CVEs
rm /usr/local/bin/gosu; \
fi

RUN mkdir /config
Expand Down
15 changes: 8 additions & 7 deletions openc3/lib/openc3/utilities/local_mode.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ module LocalMode
'openc3-enterprise-tool-base',
'openc3-cosmos-tool-autonomic',
'openc3-cosmos-tool-calendar',
'openc3-cosmos-tool-grafana',
'openc3-tool-base',
]

Expand Down Expand Up @@ -168,7 +169,7 @@ def self.analyze_local_mode(plugin_name:, scope:)
json = JSON.parse(data, :allow_nan => true, :create_additions => true)

found = false
found_models.each do |name, model_details|
found_models.each do |name, _model_details|
if json["name"] == name
# Matched pair
found = true
Expand Down Expand Up @@ -339,7 +340,7 @@ def self.sync_targets_modified
def self.modified_targets(scope:)
targets = {}
local_catalog = build_local_catalog(scope: scope)
local_catalog.each do |key, size|
local_catalog.each do |key, _size|
split_key = key.split('/') # scope/targets_modified/target_name/*
target_name = split_key[2]
if target_name
Expand All @@ -352,7 +353,7 @@ def self.modified_targets(scope:)
def self.modified_files(target_name, scope:)
modified = []
local_catalog = build_local_catalog(scope: scope)
local_catalog.each do |key, size|
local_catalog.each do |key, _size|
split_key = key.split('/') # scope/targets_modified/target_name/*
local_target_name = split_key[2]
if target_name == local_target_name
Expand Down Expand Up @@ -399,7 +400,7 @@ def self.open_local_file(path, scope:)
def self.local_target_files(scope:, path_matchers:, include_temp: false)
files = []
local_catalog = build_local_catalog(scope: scope)
local_catalog.each do |key, size|
local_catalog.each do |key, _size|
split_key = key.split('/')
# DEFAULT/targets_modified/__TEMP__/YYYY_MM_DD_HH_MM_SS_mmm_temp.rb
# See target_file.rb TEMP_FOLDER
Expand Down Expand Up @@ -434,8 +435,8 @@ def self.sync_tool_config()
JSON.parse(data, :allow_nan => true, :create_additions => true)
# Only save if the parse was successful
ToolConfigModel.save_config(parts[-2], File.basename(config, '.json'), data, scope: scope, local_mode: false)
rescue JSON::ParserError => error
puts "Unable to initialize tool config due to #{error.message}"
rescue JSON::ParserError => e
puts "Unable to initialize tool config due to #{e.message}"
end
end
end
Expand Down Expand Up @@ -555,7 +556,7 @@ def self.sync_with_bucket(bucket, scope:)
end
end

remote_catalog.each do |key, size|
remote_catalog.each do |key, _size|
local_size = local_catalog[key]
if local_size
# Both files exist - Handled earlier
Expand Down
1 change: 1 addition & 0 deletions openc3/python/openc3/utilities/local_mode.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class LocalMode:
"openc3-cosmos-enterprise-tool-admin",
"openc3-cosmos-tool-autonomic",
"openc3-cosmos-tool-calendar",
"openc3-cosmos-tool-grafana",
"openc3-enterprise-tool-base",
"openc3-tool-base",
]
Expand Down
6 changes: 6 additions & 0 deletions playwright/tests/admin/plugins.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ test('shows and hides built-in tools', async ({ page, utils }) => {
await expect(page.locator('id=openc3-tool')).not.toContainText(
'openc3-cosmos-tool-calendar',
)
await expect(page.locator('id=openc3-tool')).not.toContainText(
'openc3-cosmos-tool-grafana',
)
} else {
await expect(page.locator('id=openc3-tool')).not.toContainText(
'openc3-cosmos-tool-admin',
Expand Down Expand Up @@ -105,6 +108,9 @@ test('shows and hides built-in tools', async ({ page, utils }) => {
await expect(page.locator('id=openc3-tool')).toContainText(
'openc3-cosmos-tool-calendar',
)
await expect(page.locator('id=openc3-tool')).toContainText(
'openc3-cosmos-tool-grafana',
)
} else {
await expect(page.locator('id=openc3-tool')).toContainText(
'openc3-cosmos-tool-admin',
Expand Down
Loading