Skip to content
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
39 changes: 0 additions & 39 deletions .claude/prs/docs-node-v0.3.4.md

This file was deleted.

46 changes: 46 additions & 0 deletions .github/scripts/sanitize-config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/usr/bin/env python3
"""
Sanitize GenLayer node configuration by removing dev and admin sections.

This script is used by the GitHub Actions workflow to prepare the config
for documentation by removing sensitive sections.
"""

import sys
import yaml


def sanitize_config(config_file_path):
"""Remove node.dev and node.admin sections from config file."""
# Read the YAML file
with open(config_file_path, 'r') as f:
config = yaml.safe_load(f)

# Remove node.dev and node.admin if they exist
if 'node' in config:
if 'dev' in config['node']:
del config['node']['dev']
if 'admin' in config['node']:
del config['node']['admin']

# Write back to file preserving the structure
with open(config_file_path, 'w') as f:
yaml.dump(config, f, default_flow_style=False, sort_keys=False, allow_unicode=True)


def main():
if len(sys.argv) != 2:
print(f"Usage: {sys.argv[0]} <config_file_path>", file=sys.stderr)
sys.exit(1)

config_file_path = sys.argv[1]

try:
sanitize_config(config_file_path)
except Exception as e:
print(f"Error sanitizing config: {e}", file=sys.stderr)
sys.exit(1)


if __name__ == "__main__":
main()
22 changes: 1 addition & 21 deletions .github/workflows/sync-docs-from-node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -205,27 +205,7 @@ jobs:
sed -i 's|zksyncwebsocketurl: *"[^"]*"|zksyncwebsocketurl: "TODO: Set your GenLayer Chain ZKSync WebSocket RPC URL here"|' "$TEMP_CONFIG"

# Remove node.dev and node.admin sections using Python for reliable YAML parsing
python3 -c "
import yaml
import sys

config_file = sys.argv[1]

# Read the YAML file
with open(config_file, 'r') as f:
config = yaml.safe_load(f)

# Remove node.dev and node.admin if they exist
if 'node' in config:
if 'dev' in config['node']:
del config['node']['dev']
if 'admin' in config['node']:
del config['node']['admin']

# Write back to file preserving the structure
with open(config_file, 'w') as f:
yaml.dump(config, f, default_flow_style=False, sort_keys=False, allow_unicode=True)
" "$TEMP_CONFIG"
python3 .github/scripts/sanitize-config.py "$TEMP_CONFIG"

# Check if the config has changed
if [ -f "$DEST_CONFIG" ]; then
Expand Down