structurizr / dsl

Structurizr DSL
https://docs.structurizr.com/dsl
Apache License 2.0
1.41k stars 266 forks source link

Disabling the online DSL editor #194

Closed pirivan closed 1 year ago

pirivan commented 1 year ago

(Note: I created this issue after initially adding a comment to an already closed issue here.)

This link mentions the following properties block which can be used to disable the online DSL editor :

properties {
        "structurizr.dslEditor" "false"
}

I tried adding this block at the top level of my workspace.dsl file, as suggested in the link, but I get the following error:

com.structurizr.dsl.StructurizrDslParserException: Unexpected tokens at line 2: properties {

Also, as per the documentation, I tried putting the properties block inside a configuration block. Unfortunately, I get the same error.

Finally, I tried adding the properties block to the views section of my workspace.dsl file instead. In this case I get no errors, but unfortunately this addition doesn't disable the online DSL editor.

Where then should the properties block go?

Structurizr Lite
Build: 2862
Built: 2022-11-09T12:20:46Z
structurizr-java: v1.16.1
structurizr-dsl: v1.21.0
pirivan commented 1 year ago

@simonbrowndotje Thank you for the update. Unfortunately this option doesn't work for me yet :-(

While I don't get the parsing error any more when adding the properties block to my workspace.dsl file, the online DSL editor is still enabled. I'm testing this with the latest structurizr/lite docker file.

Structurizr Lite
Build: 2892
Built: 2023-01-06T08:55:34Z
structurizr-java: v1.17.0
structurizr-dsl: v1.22.0
simonbrowndotje commented 1 year ago

the online DSL editor is still enabled. I'm testing this with the latest structurizr/lite docker file.

Structurizr Lite doesn't have an online DSL editor. Are you syncing the workspace to an on-premises installation/the cloud service?

pirivan commented 1 year ago

Hmm, maybe I'm using the wrong terms. I'm launching the structurizr/lite docker file mounting a local volume with my dsl files:

docker run -it --rm -p 8080:8080 \
        -e STRUCTURIZR_WORKSPACE_FILENAME=my-model \
        -v $$PWD/docs/architecture:/usr/local/structurizr \
        --name my-structurizr-lite \
        structurizr/lite

When I visit localhost:8080 I see my dsl model, docs, diagrams, and ADRs just fine. I also can modify the diagrams interactively (also, I'm not enabling autolayout). I refer to this latter functionality as the "online DSL editor" but maybe I should call it the "online diagrams editor." This is what I was expecting the properties block would do, to disable the "diagrams editor," but maybe this is not what this block is supposed to do?

Once I test my changes locally, I use the structurizr/lite docker file as the base for my own Kubernetes deployment. That's really where I would like to disable the "diagrams editor" so that they are readonly for my peers to read. But I'm testing this locally first.

simonbrowndotje commented 1 year ago

Yes, that's the diagram editor. To disable that, you'll need this feature instead -> https://structurizr.com/share/76352/documentation#read-only-diagrams