File tree 2 files changed +15
-1
lines changed
2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -92,6 +92,17 @@ using:
92
92
kill -USR2 $( pidof suricata)
93
93
```
94
94
95
+ ### How can I start the webapp in read-only mode?
96
+
97
+ A SQLite database is generated in ` webapp/database/database.db ` on the first run
98
+ of the uvicorn webapp.
99
+ If you want to host a read-only Shovel instance (e.g. after the end of a CTF
100
+ event for further analysis), you may run the webapp in immutable mode using the
101
+ following environment variable:
102
+ ```
103
+ DATABASE_URL=file:database/database.db?immutable=1
104
+ ```
105
+
95
106
## Licensing
96
107
97
108
Copyright (C) 2023 ANSSI
Original file line number Diff line number Diff line change @@ -114,7 +114,10 @@ async def connect(self):
114
114
# WAL journal mode allows multiple concurrent readers
115
115
await self .con .execute ("PRAGMA journal_mode=wal" )
116
116
await self .con .execute ("PRAGMA synchronous=normal" )
117
- await self .init_database_structure ()
117
+ try :
118
+ await self .init_database_structure ()
119
+ except aiosqlite .OperationalError as e :
120
+ raise RuntimeError (f"unable to create database '{ self .database_uri } '" ) from e
118
121
119
122
async def is_readonly (self ) -> bool :
120
123
assert self .con is not None , "database connection closed"
You can’t perform that action at this time.
0 commit comments