From 0ce678e1edf2cba146d123d220baa4f0dc0932fc Mon Sep 17 00:00:00 2001 From: Umputun Date: Mon, 19 Feb 2018 00:22:00 -0600 Subject: [PATCH] combine dev and dev-passwd --- README.md | 5 ++--- app/main.go | 9 ++++----- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 610f5c9e..4c032009 100644 --- a/README.md +++ b/README.md @@ -48,8 +48,7 @@ Remark42 is a self-hosted, lightweight, and simple (yet functional) comment engi | --site | | `remark` | no | import | site ID | | --file | | `disqus.xml` | no | import | import file | | --dbg | DEBUG | `false` | no | all | debug mode | -| --dev | DEV | `false` | no | all | enable `dev` user | -| --dev-password | DEV_PASSWD | `password` | no | all | password for `dev` user | +| --dev-password | DEV_PASSWD | | no | all | password for `dev` user | #### Run modes @@ -100,7 +99,7 @@ _instructions for google oauth2 setup borrowed from [oauth2_proxy](https://githu 1. Disqus provides an export of all comments on your site in a g-zipped file. This is found in your Moderation panel at Disqus Admin > Setup > Export. The export will be sent into a queue and then emailed to the address associated with your account once it's ready. 2. Move this file to your remark42 host and unzip. 3. Stop remark42 containers if started, i.e. `docker-compose stop` -4. Run import command - `docker-compose run --rm /srv/remark import --file= --site=` +4. Run import command - `docker-compose run --rm remark /srv/remark import --file= --site=` 5. Start remark42 containers `docker-compose up -d` ### Frontend diff --git a/app/main.go b/app/main.go index a73cf853..dffc0ad9 100644 --- a/app/main.go +++ b/app/main.go @@ -28,8 +28,7 @@ var opts struct { RemarkURL string `long:"url" env:"REMARK_URL" default:"https://remark42.com" description:"url to remark"` Admins []string `long:"admin" env:"ADMIN" description:"admin(s) names" env-delim:","` - DevMode bool `long:"dev" env:"DEV" description:"development mode, no auth enforced"` - DevPasswd string `long:"dev-passwd" env:"DEV_PASSWD" default:"password" description:"development mode password"` + DevPasswd string `long:"dev-passwd" env:"DEV_PASSWD" default:"" description:"development mode password"` Dbg bool `long:"dbg" env:"DEBUG" description:"debug mode"` BackupLocation string `long:"backup" env:"BACKUP_PATH" default:"./var" description:"backups location"` @@ -117,15 +116,15 @@ func main() { SessionStore: sessionStore, Providers: makeAuthProviders(sessionStore, avatarProxy), AvatarProxy: avatarProxy, - DevEnabled: opts.DevMode, + DevEnabled: opts.DevPasswd != "", DevPasswd: opts.DevPasswd, }, Cache: rest.NewLoadingCache(4*time.Hour, 15*time.Minute, postFlushFn), Notifier: notifier.NewNoOperation(), } - if opts.DevMode { - log.Printf("[WARN] running in dev mode, no auth!") + if opts.DevPasswd != "" { + log.Printf("[WARN] running in dev mode") } for _, siteID := range opts.Sites {