conpot icon indicating copy to clipboard operation
conpot copied to clipboard

Flatten template directory structure?

Open srenfo opened this issue 5 years ago • 3 comments

For simplifications beyond #534 the template directories could be flattened a bit.

Currently:

conpot/templates
├── default
│   ├── bacnet
│   │   └── bacnet.xml
│   ├── enip
│   │   └── enip.xml
│   ├── ftp
│   │   └── ftp.xml
│   ├── http
│   │   ├── htdocs
│   │   │   ├── tests
│   │   │   └── ...
│   │   ├── statuscodes
│   │   │   └── ...
│   │   └── http.xml
│   ├── ipmi
│   │   └── ipmi.xml
│   ├── ...
│   └── template.xml
...

Suggestion: Move the protocol XMLs up by one level. Keep the subdirectories for protocols that want auxiliary files.

conpot/templates
├── default
│   ├── bacnet.xml
│   ├── enip.xml
│   ├── ftp.xml
│   ├── http
│   │   ├── htdocs
│   │   │   ├── tests
│   │   │   └── ...
│   │   ├── statuscodes
│   │   │   └── ...
│   ├── http.xml
│   ├── ipmi.xml
│   ├── ...
│   └── template.xml
...

Pros: Easier to navigate and thus easier to modify and to keep track of.

Cons: It may look odd to have both an http.xml and an http directory. Also, template.xml is now on the same level as the protocol XMLs despite being one level above them hierarchically.

srenfo avatar Nov 16 '20 12:11 srenfo

How about stuffing all protocols into a flat protocol folder with http as suggested? Kind of a middle ground?

glaslos avatar Nov 16 '20 14:11 glaslos

Do you mean their XMLs or their auxiliary data?

Either way this is not a big deal, but we were talking about simplifying things anyway :see_no_evil:

srenfo avatar Nov 20 '20 11:11 srenfo

This was my suggestion. It would keep the visibility for the template.xml

conpot/templates
├── default
│   ├── protocols
│   │   ├── bacnet.xml
│   │   ├── enip.xml
│   │   ├── ftp.xml
│   │   ├── http
│   │   │   ├── htdocs
│   │   │   │   ├── tests
│   │   │   │   └── ...
│   │   │   ├── statuscodes
│   │   │   │   └── ...
│   │   ├── http.xml
│   │   ├── ipmi.xml
│   │   ├── ...
│   └── template.xml

glaslos avatar Nov 21 '20 13:11 glaslos