diff --git a/README.md b/README.md new file mode 100644 index 0000000..34d5a78 --- /dev/null +++ b/README.md @@ -0,0 +1,42 @@ +### Create `photos` user for DB + +You will need to know the root password for your mariadb installation. If you +need to reset the root password, you can perform the following: + +```bash +export PASSWORD=m4g1cP4ssw0rd +sudo service mysql stop +sudo mysqld_safe --skip-grant-tables & +sleep 1 # mysqld_safe can take a bit of time to come online +sudo mysql << EOF +use mysql; +UPDATE user SET PASSWORD=PASSWORD("${PASSWORD}") WHERE USER='root'; +UPDATE user SET plugin='mysql_native_password' WHERE USER='root'; +FLUSH PRIVILEGES; +QUIT +EOF +sudo service mysql stop +sudo service mysql start +``` + +Once you know the root password, you can then create a new user and DB +for the photo app via: + +### Create the USER + +```bash +U=photos +P=p4$$w0rd +mysql -u root --password=${PASSWORD} << EOF +GRANT ALL PRIVILEGES ON *.* TO '${U}'@'localhost' IDENTIFIED BY '${P}'; +EOF +``` + +```bash +D=photos +mysql -u ${U} --password=${P} << EOF +DROP DATABASE IF EXISTS ${D}; +CREATE DATABASE ${D} CHARACTER SET utf8 COLLATE utf8_general_ci; +EOF +``` + diff --git a/config/default.json b/config/default.json index 04ec597..bc36635 100644 --- a/config/default.json +++ b/config/default.json @@ -1,3 +1,11 @@ { - "picturesPath": "./pictures" + "db": { + "host": "mysql://photos:p4$$w0rd@localhost/photos", + "options": {} + }, + "server": { + "port": 8080 + }, + "picturesPath": "./pictures", + "basePath": "/photos" } diff --git a/frontend/bower.json b/frontend/bower.json index a9d7803..3ba5abf 100644 --- a/frontend/bower.json +++ b/frontend/bower.json @@ -40,7 +40,7 @@ "paper-dialog": "PolymerElements/paper-dialog#^1.1.0", "paper-dialog-scrollable": "PolymerElements/paper-dialog-scrollable#^1.1.5", "iron-collapse": "PolymerElements/iron-collapse#^1.2.1", - "paper-spinner": "PolymerElements/paper-spinner#^1.0.0", + "paper-spinner": "PolymerElements/paper-spinner#^2.0.0", "paper-autocomplete": "^1.3.0", "iron-accordions": "https://github.com/alijaya/iron-accordions.git#^1.1.0", "paper-input": "PolymerElements/paper-input#^1.1.20", @@ -52,6 +52,7 @@ "resolutions": { "polymer": "^1.4.0", "iron-location": "^1.0.0", - "iron-collapse": "^1.2.1" + "iron-collapse": "^1.2.1", + "paper-spinner": "^1.0.0" } } diff --git a/package.json b/package.json index 67d9d48..d2e23f2 100644 --- a/package.json +++ b/package.json @@ -16,12 +16,16 @@ "license": "Apache-2.0", "dependencies": { "bluebird": "^3.5.1", - "body-parser": "^1.17.2", + "body-parser": "^1.18.2", "config": "^1.28.1", - "express": "^4.15.2", - "morgan": "^1.8.1", + "cookie-parser": "^1.4.3", + "express": "^4.16.2", + "mariasql": "^0.2.6", + "morgan": "^1.9.0", + "mysql2": "^1.5.1", "node-inspector": "^1.1.1", - "sequelize": "^4.28.6" + "sequelize": "^4.28.6", + "sequelize-mysql": "^1.7.0" }, "jshintConfig": { "undef": true,