1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-26 00:29:47 +02:00

Merge pull request #66 from documize/db-setup

Db setup
This commit is contained in:
Harvey Kandola 2016-11-27 16:01:28 -08:00 committed by GitHub
commit 4849dd83de
10 changed files with 646 additions and 736 deletions

View file

@ -8,7 +8,7 @@ The mission is to bring software dev inspired features (refactoring, testing, li
## Latest version ## Latest version
v0.34.0 v0.34.1
## OS Support ## OS Support

View file

@ -1,4 +1,4 @@
<div class=" page-setup container-fluid padding-100 background-color-primary"> <div class="page-setup container-fluid padding-100">
<div class="row"> <div class="row">
<div class="col-lg-3 col-md-3 col-sm-3"> <div class="col-lg-3 col-md-3 col-sm-3">
<div> <div>

View file

@ -1,38 +1,34 @@
<div class="col-lg-9 col-md-9 col-sm-9"> <div class="col-lg-9 col-md-9 col-sm-9">
<div class="input-form"> <div class="form-bordered">
<form> <div class="form-header">
<div class="heading"> <div class="title">Let's setup Documize</div>
<div class="title">Let's setup Documize</div> <div class="tip">Database name is <em>{{model.dbname}}</em></div>
<div class="tip">Database name is <em>{{model.dbname}}</em></div> </div>
</div> <div class="input-control">
<div> <label>Team</label>
<div class="input-control"> <div class="tip">What's your tribe called?</div>
<label>Team</label> {{focus-input id="siteTitle" type="text" value=model.title class=(if hasEmptyTitleError 'error')}}
<div class="tip">What's your tribe called?</div> </div>
{{focus-input id="siteTitle" type="text" value=model.title class=(if hasEmptyTitleError 'error')}} <div class="input-control">
</div> <label>Firstname</label>
<div class="input-control"> <div class="tip">What do people call you?</div>
<label>Firstname</label> {{input id="adminFirstname" type="text" value=model.firstname class=(if hasEmptyFirstnameError 'error')}}
<div class="tip">What do people call you?</div> </div>
{{input id="adminFirstname" type="text" value=model.firstname class=(if hasEmptyFirstnameError 'error')}} <div class="input-control">
</div> <label>Lastname</label>
<div class="input-control"> <div class="tip">How the government refers to you.</div>
<label>Lastname</label> {{input id="adminLastname" type="text" value=model.lastname class=(if hasEmptyLastnameError 'error')}}
<div class="tip">How the government refers to you.</div> </div>
{{input id="adminLastname" type="text" value=model.lastname class=(if hasEmptyLastnameError 'error')}} <div class="input-control">
</div> <label>Email</label>
<div class="input-control"> <div class="tip">No spam. Ever!</div>
<label>Email</label> {{input id="adminEmail" type="email" value=model.email class=(if hasEmptyEmailError 'error')}}
<div class="tip">No spam. Ever!</div> </div>
{{input id="adminEmail" type="email" value=model.email class=(if hasEmptyEmailError 'error')}} <div class="input-control">
</div> <label>Password</label>
<div class="input-control"> <div class="tip">Something you can remember without writing it down.</div>
<label>Password</label> {{input id="adminPassword" type="text" value=model.password class=(if hasEmptyPasswordError 'error')}}
<div class="tip">Something you can remember without writing it down.</div> </div>
{{input id="adminPassword" type="text" value=model.password class=(if hasEmptyPasswordError 'error')}} <div class="regular-button button-green" {{ action 'save' }}>Setup</div>
</div> </div>
<div class="regular-button button-green" {{ action 'save' }}>Go Setup</div>
</div>
</form>
</div>
</div> </div>

View file

@ -1,6 +1,6 @@
{ {
"name": "documize", "name": "documize",
"version": "0.33.0", "version": "0.34.1",
"description": "The Document IDE", "description": "The Document IDE",
"private": true, "private": true,
"directories": { "directories": {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

Before After
Before After

View file

@ -118,7 +118,7 @@ func Check(Db *sqlx.DB, connectionString string) bool {
return false return false
} }
if strings.TrimSpace(flds[0]) == "0" { if strings.TrimSpace(flds[0]) == "0" {
log.Error("Entering database set-up mode because the database is empty.", errors.New("no tables")) log.Info("Entering database set-up mode because the database is empty.....")
web.SiteMode = web.SiteModeSetup web.SiteMode = web.SiteModeSetup
return false return false
} }

View file

@ -87,6 +87,11 @@ func Create(w http.ResponseWriter, r *http.Request) {
dbname := r.Form.Get("dbname") dbname := r.Form.Get("dbname")
dbhash := r.Form.Get("dbhash") dbhash := r.Form.Get("dbhash")
fmt.Println(dbname)
fmt.Println(dbhash)
fmt.Println(web.SiteInfo.DBname)
fmt.Println(web.SiteInfo.DBhash)
if dbname != web.SiteInfo.DBname || dbhash != web.SiteInfo.DBhash { if dbname != web.SiteInfo.DBname || dbhash != web.SiteInfo.DBhash {
log.Error("database.Create()'s security credentials error ", errors.New("bad db name or validation code")) log.Error("database.Create()'s security credentials error ", errors.New("bad db name or validation code"))
return return

View file

@ -9,7 +9,6 @@ CREATE TABLE IF NOT EXISTS `user` (
`lastname` NVARCHAR(500) NOT NULL, `lastname` NVARCHAR(500) NOT NULL,
`email` NVARCHAR(250) NOT NULL UNIQUE, `email` NVARCHAR(250) NOT NULL UNIQUE,
`initials` NVARCHAR(10) NOT NULL DEFAULT "", `initials` NVARCHAR(10) NOT NULL DEFAULT "",
`global` BOOL NOT NULL DEFAULT 0,
`password` NVARCHAR(500) NOT NULL DEFAULT "", `password` NVARCHAR(500) NOT NULL DEFAULT "",
`salt` NVARCHAR(100) NOT NULL DEFAULT "", `salt` NVARCHAR(100) NOT NULL DEFAULT "",
`reset` NVARCHAR(100) NOT NULL DEFAULT "", `reset` NVARCHAR(100) NOT NULL DEFAULT "",
@ -131,7 +130,6 @@ CREATE TABLE IF NOT EXISTS `document` (
`slug` NVARCHAR(2000) NOT NULL, `slug` NVARCHAR(2000) NOT NULL,
`tags` NVARCHAR(1000) NOT NULL DEFAULT '', `tags` NVARCHAR(1000) NOT NULL DEFAULT '',
`template` BOOL NOT NULL DEFAULT 0, `template` BOOL NOT NULL DEFAULT 0,
`layout` CHAR(10) NOT NULL DEFAULT 'doc',
`created` TIMESTAMP DEFAULT CURRENT_TIMESTAMP, `created` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
`revised` TIMESTAMP DEFAULT CURRENT_TIMESTAMP, `revised` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT pk_refid PRIMARY KEY (refid), CONSTRAINT pk_refid PRIMARY KEY (refid),
@ -150,7 +148,6 @@ CREATE TABLE IF NOT EXISTS `page` (
`documentid` CHAR(16) NOT NULL COLLATE utf8_bin, `documentid` CHAR(16) NOT NULL COLLATE utf8_bin,
`userid` CHAR(16) DEFAULT '' COLLATE utf8_bin, `userid` CHAR(16) DEFAULT '' COLLATE utf8_bin,
`contenttype` CHAR(20) NOT NULL DEFAULT 'wysiwyg', `contenttype` CHAR(20) NOT NULL DEFAULT 'wysiwyg',
`pagetype` CHAR(10) NOT NULL DEFAULT 'section',
`level` INT UNSIGNED NOT NULL, `level` INT UNSIGNED NOT NULL,
`sequence` DOUBLE NOT NULL, `sequence` DOUBLE NOT NULL,
`title` NVARCHAR(2000) NOT NULL, `title` NVARCHAR(2000) NOT NULL,
@ -241,7 +238,6 @@ CREATE TABLE IF NOT EXISTS `revision` (
`pageid` CHAR(16) NOT NULL COLLATE utf8_bin, `pageid` CHAR(16) NOT NULL COLLATE utf8_bin,
`userid` CHAR(16) NOT NULL COLLATE utf8_bin, `userid` CHAR(16) NOT NULL COLLATE utf8_bin,
`contenttype` CHAR(20) NOT NULL DEFAULT 'wysiwyg', `contenttype` CHAR(20) NOT NULL DEFAULT 'wysiwyg',
`pagetype` CHAR(10) NOT NULL DEFAULT 'section',
`title` NVARCHAR(2000) NOT NULL, `title` NVARCHAR(2000) NOT NULL,
`body` LONGTEXT, `body` LONGTEXT,
`rawbody` LONGBLOB, `rawbody` LONGBLOB,
@ -282,90 +278,3 @@ CREATE TABLE IF NOT EXISTS `userconfig` (
UNIQUE INDEX `idx_userconfig_orguserkey` (`orgid`, `userid`, `key` ASC)) UNIQUE INDEX `idx_userconfig_orguserkey` (`orgid`, `userid`, `key` ASC))
DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci
ENGINE = InnoDB; ENGINE = InnoDB;
DROP TABLE IF EXISTS `share`;
CREATE TABLE IF NOT EXISTS `share` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`orgid` CHAR(16) NOT NULL COLLATE utf8_bin,
`documentid` CHAR(16) NOT NULL COLLATE utf8_bin,
`userid` CHAR(16) DEFAULT '' COLLATE utf8_bin,
`email` NVARCHAR(250) NOT NULL DEFAULT '',
`message` NVARCHAR(500) NOT NULL DEFAULT '',
`viewed` VARCHAR(500) NOT NULL DEFAULT '',
`secret` VARCHAR(200) NOT NULL DEFAULT '',
`expires` CHAR(16) DEFAULT '' COLLATE utf8_bin,
`active` BOOL NOT NULL DEFAULT 1,
`created` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT pk_id PRIMARY KEY (id))
DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci
ENGINE = InnoDB;
DROP TABLE IF EXISTS `feedback`;
CREATE TABLE IF NOT EXISTS `feedback` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`refid` CHAR(16) NOT NULL COLLATE utf8_bin,
`orgid` CHAR(16) NOT NULL COLLATE utf8_bin,
`documentid` CHAR(16) NOT NULL COLLATE utf8_bin,
`userid` CHAR(16) DEFAULT '' COLLATE utf8_bin,
`email` NVARCHAR(250) NOT NULL DEFAULT '',
`feedback` LONGTEXT,
`created` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT pk_id PRIMARY KEY (id))
DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci
ENGINE = InnoDB;
DROP TABLE IF EXISTS `link`;
CREATE TABLE IF NOT EXISTS `link` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`refid` CHAR(16) NOT NULL COLLATE utf8_bin,
`orgid` CHAR(16) NOT NULL COLLATE utf8_bin,
`folderid` CHAR(16) NOT NULL COLLATE utf8_bin,
`userid` CHAR(16) NOT NULL COLLATE utf8_bin,
`sourcedocumentid` CHAR(16) NOT NULL COLLATE utf8_bin,
`sourcepageid` CHAR(16) NOT NULL COLLATE utf8_bin,
`linktype` CHAR(16) NOT NULL COLLATE utf8_bin,
`targetdocumentid` CHAR(16) NOT NULL COLLATE utf8_bin,
`targetid` CHAR(16) NOT NULL DEFAULT '' COLLATE utf8_bin,
`orphan` BOOL NOT NULL DEFAULT 0,
`created` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
`revised` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT pk_id PRIMARY KEY (id))
DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci
ENGINE = InnoDB;
DROP TABLE IF EXISTS `participant`;
CREATE TABLE IF NOT EXISTS `participant` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`refid` CHAR(16) NOT NULL COLLATE utf8_bin,
`orgid` CHAR(16) NOT NULL COLLATE utf8_bin,
`documentid` CHAR(16) NOT NULL COLLATE utf8_bin,
`userid` CHAR(16) DEFAULT '' COLLATE utf8_bin,
`roletype` CHAR(1) NOT NULL DEFAULT 'I' COLLATE utf8_bin,
`lastviewed` TIMESTAMP NULL,
`created` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT pk_id PRIMARY KEY (id),
INDEX `idx_participant_documentid` (`documentid` ASC))
DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci
ENGINE = InnoDB;
DROP TABLE IF EXISTS `pin`;
CREATE TABLE IF NOT EXISTS `pin` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`refid` CHAR(16) NOT NULL COLLATE utf8_bin,
`orgid` CHAR(16) NOT NULL COLLATE utf8_bin,
`userid` CHAR(16) DEFAULT '' COLLATE utf8_bin,
`labelid` CHAR(16) DEFAULT '' COLLATE utf8_bin,
`documentid` CHAR(16) DEFAULT '' COLLATE utf8_bin,
`sequence` INT UNSIGNED NOT NULL DEFAULT 99,
`pin` CHAR(20) NOT NULL DEFAULT '' COLLATE utf8_bin,
`created` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
`revised` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT pk_id PRIMARY KEY (id),
INDEX `idx_pin_userid` (`userid` ASC))
DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci
ENGINE = InnoDB;

View file

@ -27,7 +27,7 @@ type ProdInfo struct {
func Product() (p ProdInfo) { func Product() (p ProdInfo) {
p.Major = "0" p.Major = "0"
p.Minor = "34" p.Minor = "34"
p.Patch = "0" p.Patch = "1"
p.Version = fmt.Sprintf("%s.%s.%s", p.Major, p.Minor, p.Patch) p.Version = fmt.Sprintf("%s.%s.%s", p.Major, p.Minor, p.Patch)
p.Edition = "Community" p.Edition = "Community"
p.Title = fmt.Sprintf("%s Edition", p.Edition) p.Title = fmt.Sprintf("%s Edition", p.Edition)

File diff suppressed because one or more lines are too long