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

[TEMPLATE] create init script #3030

Merged
merged 3 commits into from
Dec 9, 2024

Conversation

Renizmy
Copy link
Contributor

@Renizmy Renizmy commented Nov 25, 2024

Proposed changes

  • Create an init script to de-templatize a template connector

Checklist

  • I consider the submitted work as finished
  • I tested the code for its functionality using different use cases
  • I added/update the relevant documentation (either on github or on notion)
  • Where necessary I refactored code to improve the overall quality

Further comments

It might be interesting to automatically add the build steps from the script, but I had no idea how to do it automatically ..

@helene-nguyen
Copy link
Member

helene-nguyen commented Nov 27, 2024

@Renizmy Thanks a lot for this script, I've tested in local and it works pretty well!
But in the file, when creating a connector with a dash (-), I got

image

Or

image

May I suggest some improvement ?
Do you think you can add in the script a way to replace into the file from examples below to:

image

image

And same for:

in config.yml.sample
image

in config_variables.py
image

Remove the dash (-) and replace with underscore ( _ ) ?

image
image

🔒️ lower case name
@Megafredo
Copy link
Member

Hello @Renizmy, thank you for your script, it does the job well and the changes you made following @helene-nguyen suggestion work perfectly. Well done !

However, I found a small bug when using :
sed: can't read ../external-import/proofpoint-et/src/external-import_connector/config_variables.py: No such file or directory
The problem seems to be that the hyphen "-" in the directory name (external-import_connector) has not been converted to an underscore "_"
To fix this, here's a suggested change ${TYPE} -> ${TYPE//-/_} l.134

sed -i -e "s/$NAME/${NAME//-/_}/g" "$NEW_CONNECTOR_DIR/src/${TYPE//-/_}_connector/config_variables.py"

@helene-nguyen helene-nguyen added the community use to identify PR from community label Dec 5, 2024
@Renizmy
Copy link
Contributor Author

Renizmy commented Dec 5, 2024

@Megafredo Nice one !

Copy link
Member

@Megafredo Megafredo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's ok for me ! ;) thanks for the changes !

@Megafredo Megafredo merged commit 8990857 into OpenCTI-Platform:master Dec 9, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community use to identify PR from community
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants