Implement Read Only mode
This commit is contained in:
parent
6464d92dd4
commit
e1bd235785
19 changed files with 544 additions and 335 deletions
8
main.go
8
main.go
|
@ -21,6 +21,7 @@ func main() {
|
|||
assetsPath = flag.String("assets", ".", "Path of the assets (templates, css, js, img)")
|
||||
hostname = flag.String("hostname", "xfmro77i3lixucja.onion", "Hostname of the website")
|
||||
loggerConfig = flag.String("logger-conf", "logger.xml", "xml configuration of the logger")
|
||||
ro = flag.Bool("ro", false, "read only mode")
|
||||
)
|
||||
flag.Parse()
|
||||
|
||||
|
@ -40,8 +41,13 @@ func main() {
|
|||
os.Exit(1)
|
||||
}
|
||||
|
||||
if *ro {
|
||||
store = storage.RO(store)
|
||||
db = database.RO(db)
|
||||
}
|
||||
|
||||
template := trantor.InitTemplate(*assetsPath)
|
||||
sg := trantor.InitStats(db, store, *hostname, template)
|
||||
sg := trantor.InitStats(db, store, *hostname, template, *ro)
|
||||
trantor.InitUpload(db, store)
|
||||
trantor.InitTasks(db, *loggerConfig)
|
||||
|
||||
|
|
Reference in a new issue