removed unnecessary files
This commit is contained in:
parent
2bdafdf7ce
commit
7ecf38f932
|
|
@ -1,43 +0,0 @@
|
|||
# Use the official Node.js development container as base
|
||||
FROM mcr.microsoft.com/devcontainers/javascript-node:1-20-bullseye
|
||||
|
||||
# Set the working directory
|
||||
WORKDIR /workspaces
|
||||
|
||||
# Install additional system dependencies that might be needed for n8n
|
||||
RUN apt-get update && apt-get install -y \
|
||||
python3 \
|
||||
python3-pip \
|
||||
build-essential \
|
||||
curl \
|
||||
git \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Switch to node user for security
|
||||
USER node
|
||||
|
||||
# Set up npm configuration for the node user
|
||||
RUN npm config set prefix '/home/node/.npm-global'
|
||||
ENV PATH=/home/node/.npm-global/bin:$PATH
|
||||
|
||||
# Create necessary directories
|
||||
RUN mkdir -p /home/node/.n8n \
|
||||
&& mkdir -p /home/node/.npm-global
|
||||
|
||||
# Pre-install some global packages to speed up container startup
|
||||
RUN npm install -g npm@latest typescript ts-node nodemon
|
||||
|
||||
# Set the default shell to bash for better development experience
|
||||
SHELL ["/bin/bash", "-c"]
|
||||
|
||||
# Expose the default n8n port
|
||||
EXPOSE 5678
|
||||
|
||||
# Set environment variables for n8n
|
||||
ENV N8N_HOST=0.0.0.0
|
||||
ENV N8N_PORT=5678
|
||||
ENV N8N_PROTOCOL=http
|
||||
ENV NODE_ENV=development
|
||||
|
||||
# Set the default command
|
||||
CMD ["bash"]
|
||||
|
|
@ -1,158 +0,0 @@
|
|||
# Seclore n8n Development Container
|
||||
|
||||
This devcontainer provides a complete development environment for the Seclore n8n custom node project.
|
||||
|
||||
## 🚀 Quick Start
|
||||
|
||||
1. **Open in Container**:
|
||||
- Open this project in VS Code
|
||||
- Click "Reopen in Container" when prompted
|
||||
- Or use Command Palette: `Dev Containers: Reopen in Container`
|
||||
|
||||
2. **Wait for Setup**:
|
||||
- The container will automatically install dependencies
|
||||
- This may take a few minutes on first run
|
||||
|
||||
3. **Start Development**:
|
||||
```bash
|
||||
start_dev # Build and start n8n with custom nodes
|
||||
```
|
||||
|
||||
4. **Access n8n**:
|
||||
- Open http://localhost:5678 in your browser
|
||||
- Your custom Seclore Protect node will be available
|
||||
|
||||
## 📦 What's Included
|
||||
|
||||
### Software
|
||||
- **Node.js 20.x** - Latest LTS version
|
||||
- **npm** - Latest version
|
||||
- **n8n** - Latest version (globally installed)
|
||||
- **TypeScript** - For development
|
||||
- **ts-node** - TypeScript execution
|
||||
- **nodemon** - Auto-restart on changes
|
||||
|
||||
### VS Code Extensions
|
||||
- **TypeScript & JavaScript**: Enhanced language support
|
||||
- **ESLint & Prettier**: Code formatting and linting
|
||||
- **Node.js IntelliSense**: Smart completions for Node.js
|
||||
- **npm IntelliSense**: Package import suggestions
|
||||
- **Git Tools**: GitLens and Git Graph
|
||||
- **REST Client**: API testing tools
|
||||
- **Docker**: Container management
|
||||
|
||||
### Development Tools
|
||||
- **build_and_test**: Build project and run linter
|
||||
- **start_dev**: Build and start n8n with custom nodes
|
||||
- **watch_build**: Auto-rebuild on file changes
|
||||
- **~/start-n8n.sh**: Direct n8n startup script
|
||||
|
||||
## 🔧 Development Workflow
|
||||
|
||||
### 1. Make Changes
|
||||
Edit your TypeScript files in:
|
||||
- `nodes/SecloreProtect/` - Main node logic
|
||||
- `Services/` - API service classes
|
||||
- `credentials/` - Credential definitions
|
||||
|
||||
### 2. Build & Test
|
||||
```bash
|
||||
build_and_test # Compile TypeScript and run linter
|
||||
```
|
||||
|
||||
### 3. Start n8n
|
||||
```bash
|
||||
start_dev # Build and start n8n
|
||||
# OR
|
||||
~/start-n8n.sh # Start n8n directly (after manual build)
|
||||
```
|
||||
|
||||
### 4. Auto-rebuild (Optional)
|
||||
```bash
|
||||
watch_build # Watch for changes and auto-rebuild
|
||||
```
|
||||
|
||||
## 🌐 Port Forwarding
|
||||
|
||||
The container automatically forwards these ports:
|
||||
- **5678**: n8n web interface
|
||||
- **3000**: Development server
|
||||
- **8080**: Alternative port
|
||||
|
||||
## 📁 Volume Mounts
|
||||
|
||||
- **Project Files**: `/workspaces/Seclore n8n` (your source code)
|
||||
- **n8n Data**: `~/.n8n` (n8n configuration and data)
|
||||
- **Node Modules**: Cached for faster rebuilds
|
||||
|
||||
## 🔐 Environment Variables
|
||||
|
||||
The container sets up these environment variables:
|
||||
```bash
|
||||
N8N_HOST=0.0.0.0
|
||||
N8N_PORT=5678
|
||||
N8N_PROTOCOL=http
|
||||
NODE_ENV=development
|
||||
N8N_LOG_LEVEL=debug
|
||||
N8N_CUSTOM_EXTENSIONS=/workspaces/Seclore n8n
|
||||
```
|
||||
|
||||
## 🛠️ Customization
|
||||
|
||||
### Adding Extensions
|
||||
Edit `.devcontainer/devcontainer.json` and add extension IDs to the `extensions` array.
|
||||
|
||||
### Changing Ports
|
||||
Modify the `forwardPorts` array in `devcontainer.json`.
|
||||
|
||||
### Additional Software
|
||||
Add installation commands to `.devcontainer/post-create.sh`.
|
||||
|
||||
## 🐛 Troubleshooting
|
||||
|
||||
### Container Won't Start
|
||||
- Check Docker is running
|
||||
- Ensure you have enough disk space
|
||||
- Try rebuilding: `Dev Containers: Rebuild Container`
|
||||
|
||||
### n8n Won't Start
|
||||
- Check if port 5678 is available
|
||||
- Verify the build completed successfully
|
||||
- Check logs for error messages
|
||||
|
||||
### Build Errors
|
||||
- Run `npm install` to ensure dependencies are installed
|
||||
- Check TypeScript compilation errors
|
||||
- Verify all import paths are correct
|
||||
|
||||
### Custom Node Not Visible
|
||||
- Ensure the build completed successfully
|
||||
- Check that `N8N_CUSTOM_EXTENSIONS` points to the correct path
|
||||
- Restart n8n after making changes
|
||||
|
||||
## 📚 Useful Commands
|
||||
|
||||
```bash
|
||||
# Development
|
||||
npm run build # Build the project
|
||||
npm run lint # Run ESLint
|
||||
npm run lint:fix # Fix ESLint issues
|
||||
|
||||
# n8n
|
||||
n8n start # Start n8n manually
|
||||
n8n --help # n8n help
|
||||
|
||||
# Container
|
||||
cat ~/welcome.txt # Show welcome message
|
||||
source ~/dev-scripts.sh # Reload development functions
|
||||
```
|
||||
|
||||
## 🎯 Tips
|
||||
|
||||
1. **Use the integrated terminal** in VS Code for the best experience
|
||||
2. **Enable auto-save** in VS Code for faster development cycles
|
||||
3. **Use the REST Client extension** to test your APIs
|
||||
4. **Check the n8n logs** in the terminal for debugging
|
||||
5. **Use `watch_build`** during active development for auto-rebuilds
|
||||
|
||||
Happy coding! 🚀
|
||||
|
|
@ -1,91 +0,0 @@
|
|||
{
|
||||
"name": "Seclore n8n Development",
|
||||
"image": "mcr.microsoft.com/devcontainers/javascript-node:1-20-bullseye",
|
||||
|
||||
"features": {
|
||||
"ghcr.io/devcontainers/features/git:1": {},
|
||||
"ghcr.io/devcontainers/features/github-cli:1": {}
|
||||
},
|
||||
|
||||
"customizations": {
|
||||
"vscode": {
|
||||
"extensions": [
|
||||
// TypeScript and JavaScript
|
||||
"ms-vscode.vscode-typescript-next",
|
||||
"bradlc.vscode-tailwindcss",
|
||||
"esbenp.prettier-vscode",
|
||||
"dbaeumer.vscode-eslint",
|
||||
|
||||
// Node.js specific
|
||||
"ms-vscode.vscode-node-azure-pack",
|
||||
"christian-kohler.npm-intellisense",
|
||||
"eg2.vscode-npm-script",
|
||||
"leizongmin.node-module-intellisense",
|
||||
|
||||
// General development
|
||||
"ms-vscode.vscode-json",
|
||||
"redhat.vscode-yaml",
|
||||
"ms-vscode.hexdump",
|
||||
"ms-vscode.vscode-markdown",
|
||||
|
||||
// Git and version control
|
||||
"mhutchie.git-graph",
|
||||
"eamodio.gitlens",
|
||||
|
||||
// API and REST
|
||||
"humao.rest-client",
|
||||
"rangav.vscode-thunder-client",
|
||||
|
||||
// Utilities
|
||||
"formulahendry.auto-rename-tag",
|
||||
"streetsidesoftware.code-spell-checker",
|
||||
"ms-vscode.vscode-todo-highlight",
|
||||
"gruntfuggly.todo-tree",
|
||||
|
||||
// Docker (for n8n)
|
||||
"ms-azuretools.vscode-docker"
|
||||
],
|
||||
|
||||
"settings": {
|
||||
"typescript.preferences.includePackageJsonAutoImports": "on",
|
||||
"typescript.suggest.autoImports": true,
|
||||
"typescript.updateImportsOnFileMove.enabled": "always",
|
||||
"editor.formatOnSave": true,
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||
"editor.codeActionsOnSave": {
|
||||
"source.fixAll.eslint": "explicit",
|
||||
"source.organizeImports": "explicit"
|
||||
},
|
||||
"files.associations": {
|
||||
"*.json": "jsonc"
|
||||
},
|
||||
"npm.enableScriptExplorer": true,
|
||||
"npm.scriptExplorerAction": "run"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
"forwardPorts": [5678, 3000, 8080],
|
||||
"portsAttributes": {
|
||||
"5678": {
|
||||
"label": "n8n",
|
||||
"onAutoForward": "notify"
|
||||
},
|
||||
"3000": {
|
||||
"label": "Development Server",
|
||||
"onAutoForward": "notify"
|
||||
},
|
||||
"8080": {
|
||||
"label": "Alternative Port",
|
||||
"onAutoForward": "ignore"
|
||||
}
|
||||
},
|
||||
|
||||
"postCreateCommand": ".devcontainer/post-create.sh",
|
||||
|
||||
"remoteUser": "node",
|
||||
|
||||
"mounts": [
|
||||
"source=${localWorkspaceFolder}/.n8n,target=/home/node/.n8n,type=bind,consistency=cached"
|
||||
]
|
||||
}
|
||||
|
|
@ -1,37 +0,0 @@
|
|||
version: '3.8'
|
||||
|
||||
services:
|
||||
app:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
|
||||
volumes:
|
||||
- ../..:/workspaces:cached
|
||||
- node_modules:/workspaces/Seclore\ n8n/node_modules
|
||||
- n8n_data:/home/node/.n8n
|
||||
|
||||
ports:
|
||||
- "5678:5678" # n8n
|
||||
- "3000:3000" # Development server
|
||||
- "8080:8080" # Alternative port
|
||||
|
||||
environment:
|
||||
- N8N_HOST=0.0.0.0
|
||||
- N8N_PORT=5678
|
||||
- N8N_PROTOCOL=http
|
||||
- NODE_ENV=development
|
||||
- N8N_LOG_LEVEL=debug
|
||||
|
||||
# Keep container running
|
||||
command: sleep infinity
|
||||
|
||||
# Use node user for security
|
||||
user: node
|
||||
|
||||
# Set working directory
|
||||
working_dir: /workspaces/Seclore n8n
|
||||
|
||||
volumes:
|
||||
node_modules:
|
||||
n8n_data:
|
||||
|
|
@ -1,161 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Make script executable and set proper permissions
|
||||
chmod +x /workspaces/*/devcontainer/post-create.sh
|
||||
|
||||
echo "🚀 Setting up Seclore n8n Development Environment..."
|
||||
|
||||
# Update npm to latest version
|
||||
echo "📦 Updating npm..."
|
||||
npm install -g npm@latest
|
||||
|
||||
# Install n8n globally
|
||||
echo "🔧 Installing n8n..."
|
||||
npm install -g n8n
|
||||
|
||||
# Install common development tools
|
||||
echo "🛠️ Installing development tools..."
|
||||
npm install -g typescript ts-node nodemon
|
||||
|
||||
# Install project dependencies
|
||||
echo "📋 Installing project dependencies..."
|
||||
npm install
|
||||
|
||||
# Create .n8n directory if it doesn't exist
|
||||
mkdir -p ~/.n8n
|
||||
|
||||
# Set up n8n environment variables
|
||||
echo "⚙️ Setting up n8n configuration..."
|
||||
cat > ~/.n8n/.env << EOF
|
||||
# n8n Configuration
|
||||
N8N_BASIC_AUTH_ACTIVE=false
|
||||
N8N_HOST=0.0.0.0
|
||||
N8N_PORT=5678
|
||||
N8N_PROTOCOL=http
|
||||
|
||||
# Development settings
|
||||
NODE_ENV=development
|
||||
N8N_LOG_LEVEL=debug
|
||||
|
||||
# Custom nodes path
|
||||
N8N_CUSTOM_EXTENSIONS=/workspaces/Seclore\ n8n
|
||||
EOF
|
||||
|
||||
# Create a startup script for n8n
|
||||
echo "📝 Creating n8n startup script..."
|
||||
cat > ~/start-n8n.sh << 'EOF'
|
||||
#!/bin/bash
|
||||
echo "🎯 Starting n8n with custom Seclore nodes..."
|
||||
echo "📍 Custom nodes path: /workspaces/Seclore n8n"
|
||||
echo "🌐 n8n will be available at: http://localhost:5678"
|
||||
echo ""
|
||||
|
||||
# Build the custom nodes first
|
||||
cd "/workspaces/Seclore n8n"
|
||||
npm run build
|
||||
|
||||
# Start n8n with custom nodes
|
||||
N8N_CUSTOM_EXTENSIONS="/workspaces/Seclore n8n" n8n start
|
||||
EOF
|
||||
|
||||
chmod +x ~/start-n8n.sh
|
||||
|
||||
# Create development scripts
|
||||
echo "📋 Creating development scripts..."
|
||||
cat > ~/dev-scripts.sh << 'EOF'
|
||||
#!/bin/bash
|
||||
|
||||
# Function to build and test the custom node
|
||||
build_and_test() {
|
||||
echo "🔨 Building Seclore n8n nodes..."
|
||||
cd "/workspaces/Seclore n8n"
|
||||
npm run build
|
||||
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "✅ Build successful!"
|
||||
echo "🧪 Running linter..."
|
||||
npm run lint
|
||||
else
|
||||
echo "❌ Build failed!"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
# Function to start n8n in development mode
|
||||
start_dev() {
|
||||
echo "🚀 Starting n8n in development mode..."
|
||||
build_and_test && ~/start-n8n.sh
|
||||
}
|
||||
|
||||
# Function to watch for changes and rebuild
|
||||
watch_build() {
|
||||
echo "👀 Watching for changes..."
|
||||
cd "/workspaces/Seclore n8n"
|
||||
npm run build:watch
|
||||
}
|
||||
|
||||
# Export functions
|
||||
export -f build_and_test
|
||||
export -f start_dev
|
||||
export -f watch_build
|
||||
|
||||
echo "📚 Available commands:"
|
||||
echo " build_and_test - Build and lint the project"
|
||||
echo " start_dev - Build and start n8n with custom nodes"
|
||||
echo " watch_build - Watch for changes and rebuild automatically"
|
||||
echo " ~/start-n8n.sh - Start n8n directly (after manual build)"
|
||||
EOF
|
||||
|
||||
chmod +x ~/dev-scripts.sh
|
||||
|
||||
# Add to bashrc for easy access
|
||||
echo "source ~/dev-scripts.sh" >> ~/.bashrc
|
||||
|
||||
# Create a welcome message
|
||||
echo "📄 Creating welcome message..."
|
||||
cat > ~/welcome.txt << 'EOF'
|
||||
🎉 Seclore n8n Development Environment Ready!
|
||||
|
||||
📁 Project Structure:
|
||||
/workspaces/Seclore n8n/
|
||||
├── nodes/SecloreProtect/ # Custom n8n node
|
||||
├── credentials/ # Credential types
|
||||
└── Services/ # API services
|
||||
|
||||
🚀 Quick Start:
|
||||
1. Run: start_dev # Build and start n8n
|
||||
2. Open: http://localhost:5678 # Access n8n interface
|
||||
3. Use: build_and_test # Build and test changes
|
||||
|
||||
🔧 Development Commands:
|
||||
- start_dev : Build project and start n8n
|
||||
- build_and_test : Build project and run linter
|
||||
- watch_build : Auto-rebuild on file changes
|
||||
- ~/start-n8n.sh : Start n8n (manual build required)
|
||||
|
||||
📦 Installed Tools:
|
||||
- Node.js 20.x
|
||||
- npm (latest)
|
||||
- n8n (latest)
|
||||
- TypeScript
|
||||
- ts-node
|
||||
- nodemon
|
||||
|
||||
🔌 VS Code Extensions:
|
||||
- TypeScript & JavaScript support
|
||||
- ESLint & Prettier
|
||||
- Node.js IntelliSense
|
||||
- Git tools
|
||||
- REST client for API testing
|
||||
|
||||
Happy coding! 🎯
|
||||
EOF
|
||||
|
||||
# Display welcome message
|
||||
echo ""
|
||||
echo "✅ Setup complete!"
|
||||
echo ""
|
||||
cat ~/welcome.txt
|
||||
echo ""
|
||||
echo "💡 Tip: Run 'cat ~/welcome.txt' anytime to see this guide again."
|
||||
echo ""
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
name: CI
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '22'
|
||||
|
||||
- name: Install dependencies
|
||||
run: 'npm ci'
|
||||
|
||||
- name: Run lint
|
||||
run: 'npm run lint'
|
||||
|
||||
- name: Run build
|
||||
run: 'npm run build'
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
{
|
||||
"recommendations": [
|
||||
"dbaeumer.vscode-eslint",
|
||||
"EditorConfig.EditorConfig",
|
||||
"esbenp.prettier-vscode",
|
||||
]
|
||||
}
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Attach to running n8n",
|
||||
"processId": "${command:PickProcess}",
|
||||
"request": "attach",
|
||||
"skipFiles": ["<node_internals>/**"],
|
||||
"type": "node"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -1,48 +0,0 @@
|
|||
# n8n-nodes-_node-name_
|
||||
|
||||
This is an n8n community node. It lets you use _app/service name_ in your n8n workflows.
|
||||
|
||||
_App/service name_ is _one or two sentences describing the service this node integrates with_.
|
||||
|
||||
[n8n](https://n8n.io/) is a [fair-code licensed](https://docs.n8n.io/reference/license/) workflow automation platform.
|
||||
|
||||
[Installation](#installation)
|
||||
[Operations](#operations)
|
||||
[Credentials](#credentials) <!-- delete if no auth needed -->
|
||||
[Compatibility](#compatibility)
|
||||
[Usage](#usage) <!-- delete if not using this section -->
|
||||
[Resources](#resources)
|
||||
[Version history](#version-history) <!-- delete if not using this section -->
|
||||
|
||||
## Installation
|
||||
|
||||
Follow the [installation guide](https://docs.n8n.io/integrations/community-nodes/installation/) in the n8n community nodes documentation.
|
||||
|
||||
## Operations
|
||||
|
||||
_List the operations supported by your node._
|
||||
|
||||
## Credentials
|
||||
|
||||
_If users need to authenticate with the app/service, provide details here. You should include prerequisites (such as signing up with the service), available authentication methods, and how to set them up._
|
||||
|
||||
## Compatibility
|
||||
|
||||
_State the minimum n8n version, as well as which versions you test against. You can also include any known version incompatibility issues._
|
||||
|
||||
## Usage
|
||||
|
||||
_This is an optional section. Use it to help users with any difficult or confusing aspects of the node._
|
||||
|
||||
_By the time users are looking for community nodes, they probably already know n8n basics. But if you expect new users, you can link to the [Try it out](https://docs.n8n.io/try-it-out/) documentation to help them get started._
|
||||
|
||||
## Resources
|
||||
|
||||
* [n8n community nodes documentation](https://docs.n8n.io/integrations/#community-nodes)
|
||||
* _Link to app/service documentation._
|
||||
|
||||
## Version history
|
||||
|
||||
_This is another optional section. If your node has multiple versions, include a short description of available versions and what changed, as well as any compatibility impact._
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue