You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

89 lines
3.4 KiB

Index: config.tpl.json
--- config.tpl.json.orig 2018-02-13 18:08:56.000000000 +0100
+++ config.tpl.json 2018-02-13 19:56:42.685804000 +0100
@@ -1,7 +1,9 @@
{
- "schnack_host": "https://schnack.mysite.com",
- "page_url": "https://blog.mysite.com/posts/%SLUG%",
- "database": "comments.db",
+ "schnack_host": "https://www.example.com",
+ "page_url": "https://blog.example.com/posts/%SLUG%",
+ "database": "@l_prefix@/var/schnack/db/comments.db",
+ "sessions": "@l_prefix@/var/schnack/db/sessions.db",
+ "host": "127.0.0.1",
"port": 3000,
"admins": [1],
"oauth": {
@@ -36,5 +38,5 @@
"webhook_url": "xxxxx"
}
},
- "date_format": "MMMM DD, YYYY - h:mm a"
+ "date_format": "YYYY-MMM-DD hh:mm a"
}
Index: node_modules/sqlite3/package.json
--- node_modules/sqlite3/package.json.orig 2018-02-13 18:09:10.000000000 +0100
+++ node_modules/sqlite3/package.json 2018-02-13 19:56:42.685944000 +0100
@@ -136,7 +136,7 @@
"url": "git://github.com/mapbox/node-sqlite3.git"
},
"scripts": {
- "install": "node-pre-gyp install --fallback-to-build",
+ "install": "node-pre-gyp install --build-from-source",
"prepublishOnly": "npm ls",
"pretest": "node test/support/createdb.js",
"test": "mocha -R spec --timeout 480000"
Index: package.json
--- package.json.orig 2018-02-13 18:08:56.000000000 +0100
+++ package.json 2018-02-13 19:56:42.686055000 +0100
@@ -26,7 +26,7 @@
"scripts": {
"start": "node index.js",
"docs": "node docs/generate.js",
- "build": "rollup -cw",
+ "build": "rollup -c",
"test-server": "http-server test -o 'http://localhost:8080/' -P 'http://localhost:3000/'",
"server": "NODE_ENV=development nodemon index.js",
"import": "node src/importer.js",
Index: src/auth.js
--- src/auth.js.orig 2018-02-13 18:08:56.000000000 +0100
+++ src/auth.js 2018-02-13 19:56:42.686177000 +0100
@@ -17,7 +17,7 @@
saveUninitialized: false,
secret: config.oauth.secret,
cookie: { domain: `.${domain}` },
- store: new SQLiteStore({ db: 'sessions.db' })
+ store: new SQLiteStore({ dir: "/", db: config.sessions })
}));
app.use(passport.initialize());
Index: src/db/index.js
--- src/db/index.js.orig 2018-02-13 18:08:56.000000000 +0100
+++ src/db/index.js 2018-02-13 19:57:39.569088000 +0100
@@ -3,12 +3,13 @@
const db = require('sqlite');
const config = require('../../config.json');
const dbname = config.database || 'comments.db';
-const dbpath = path.resolve(__dirname, `../../${dbname}`);
+const dbpath = path.resolve(dbname);
// returns promise that passes db obj
function init() {
return Promise.resolve(db.open(dbpath, { Promise }))
.then(db => db.migrate({
+ migrationsPath: path.resolve(path.join(__dirname, "../../migrations"),
// force: process.env.NODE_ENV === 'development' ? 'last' : false
force: false
}))
Index: src/server.js
--- src/server.js.orig 2018-02-13 18:08:56.000000000 +0100
+++ src/server.js 2018-02-13 19:56:42.686421000 +0100
@@ -163,7 +163,7 @@
db.run('INSERT OR IGNORE INTO user (id,name,blocked,trusted,created_at) VALUES (1,"dev",0,1,datetime())');
}
- var server = app.listen(config.port || process.env.PORT || 3000, (err) => {
+ var server = app.listen(config.port || process.env.PORT || 3000, config.host || process.env.HOST || "127.0.0.1", (err) => {
if (err) throw err;
console.log(`server listening on ${server.address().port}`);
});