This is the server for T3MPL Editor. You can forget about .zip/.t3data/.t3mpl files. You may update your site directly from the editor.
Node.js is required. Clone this repository.
git clone https://github.com/b4rtaz/t3mpl-server.git
Run scripts/install.sh
:
bash scripts/install.sh
You need to build the server. The instruction is above. To start server, execute:
npm run serve
The server uses configuration.json
file. This file will be created when you run scripts/install.sh
. The server supports only that method for now.
This project uses cookie session. This middleware does not require any database, but it requires secret keys to validate session cookies. It is very important to set custom keys for each instance of server.
"session": {
"secretKeys": [
"<enter_session_secret_key_1_here>",
"<enter_session_secret_key_2_here>",
"<enter_session_secret_key_3_here>"
],
"maxAge": 43200000
}
You can use scripts/random-session-keys.js
to generate new keys.
node scripts/random-session-keys.js configuration.json
The server support many users.
name
- user name,hashedPassword
- hashed password by SHA256, you may use this tool for that.
"users": [
{
"name": "<USER_NAME>",
"hashedPassword": "<SHA_256_HASH>"
}
]
The default configuration contains the admin
user with the admin
password.
Each user can have many websites.
name
- display name,owner
- user name of owner,templateDirPath
- relative or absolute path to template directory, in this directory should betemplate.yaml
file,dataDirPath
- relative or absolute path to data directory, in this directory should bedata.json
file,releaseDirPath
- relative or absolute path to release directory, the generator generates final website here.keepReleaseFiles
- the generator cleans the release dir before upload a new version, you can specify which files/directories should be kept in. This field doesn't support subdirectories.
The server must have access to read/write provides directories.
"websites": [
{
"name": "boilerplate",
"owner": "admin",
"templateDirPath": "./websites/boilerplate/template",
"dataDirPath": "./websites/boilerplate/data",
"releaseDirPath": "./websites/boilerplate/release",
"keepReleaseFiles": [".gitignore", "dirname"]
}
]
This project is released under the MIT license.