diff options
-rw-r--r-- | README.md | 14 | ||||
-rw-r--r-- | data/databases.yml | 20 | ||||
-rw-r--r-- | index.js | 10 | ||||
-rw-r--r-- | modules/_.js | 21 | ||||
-rw-r--r-- | modules/version.js | 2 |
5 files changed, 47 insertions, 20 deletions
diff --git a/README.md b/README.md new file mode 100644 index 0000000..3d3ebf7 --- /dev/null +++ b/README.md @@ -0,0 +1,14 @@ +# EquestriaDB + +Lightweight but powerful database system, made by and for Equestria.dev + +## Installation +* Download the repository +* + +## Compatibility +The following services **optionally** support connecting with EquestriaDB: +* [Neutron](https://gitlab.minteck.org/minteck/neutron) + +The following services **rely** on EquestriaDB to function correctly: +* [Bits Server](https://git.equestria.dev/equestria.dev/bits-server)
\ No newline at end of file diff --git a/data/databases.yml b/data/databases.yml index 0544709..62646f6 100644 --- a/data/databases.yml +++ b/data/databases.yml @@ -1,9 +1,10 @@ -# __ ____ ____ -# \ \ ____ ____ __ _____ _____/ __ \/ __ ) -# \ \/ __ \/ __ `/ | /| / / _ \/ ___/ / / / __ | -# / / /_/ / /_/ /| |/ |/ / __/ / / /_/ / /_/ / -# /_/ .___/\__,_/ |__/|__/\___/_/ /_____/_____/_____ -# /_/ /_____/ +# +# _____ _ _ ____ ____ +# | ____|__ _ _ _ ___ ___| |_ _ __(_) __ _| _ \| __ ) +# | _| / _` | | | |/ _ \/ __| __| '__| |/ _` | | | | _ \ +# | |__| (_| | |_| | __/\__ \ |_| | | | (_| | |_| | |_) | +# |_____\__, |\__,_|\___||___/\__|_| |_|\__,_|____/|____/ +# |_| # # Databases Configuration File # @@ -13,9 +14,10 @@ # Add an entry for every database you want to have: neutron: - # You can set a quota, or use -1 to not set a quota - node_quota: -1 # Either for nodes (every entry is a node) - storage_quota: 10000 # Or for storage (in kilobytes) + # Whether the database should be immutable (read-only) or not + # If enabled, all 'delete' and 'write' commands will be + # rejected. + immutable: false # You can add one or multiple access tokens; make sure all # the access tokens are unique across all databases. @@ -48,6 +48,14 @@ console.log("Starting server..."); let server = http.createServer(function (req, res) { try { + if (req.headers["x-equestriadb-token"]) { + req.headers["x-pawerdb-token"] = req.headers["x-equestriadb-token"]; + } + + if (req.headers["x-eqdb-token"]) { + req.headers["x-pawerdb-token"] = req.headers["x-eqdb-token"]; + } + parts = req.url.split("/").filter(i => i.trim() !== ""); console.log(req.socket.address(), parts); @@ -98,4 +106,4 @@ let server = http.createServer(function (req, res) { server.listen(4459); -console.log("pawerDB listening on port 4459")
\ No newline at end of file +console.log("EquestriaDB listening on port 4459")
\ No newline at end of file diff --git a/modules/_.js b/modules/_.js index f5f9cb5..b460588 100644 --- a/modules/_.js +++ b/modules/_.js @@ -2,23 +2,24 @@ const os = require("os"); module.exports = (req, res) => { res.writeHead(200, {'Content-Type':'text/plain'}); const os = require('os'); - res.write("__ ____ ____\n" + - "\\ \\ ____ ____ __ _____ _____/ __ \\/ __ )\n" + - " \\ \\/ __ \\/ __ `/ | /| / / _ \\/ ___/ / / / __ |\n" + - " / / /_/ / /_/ /| |/ |/ / __/ / / /_/ / /_/ /\n" + - "/_/ .___/\\__,_/ |__/|__/\\___/_/ /_____/_____/_____\n" + - " /_/ /_____/\n" + - "\n" + + res.write( + " _____ _ _ ____ ____\n" + + "| ____|__ _ _ _ ___ ___| |_ _ __(_) __ _| _ \\| __ )\n" + + "| _| / _` | | | |/ _ \\/ __| __| '__| |/ _` | | | | _ \\\n" + + "| |__| (_| | |_| | __/\\__ \\ |_| | | | (_| | |_| | |_) |\n" + + "|_____\\__, |\\__,_|\\___||___/\\__|_| |_|\\__,_|____/|____/\n" + + " |_|" + + "\n\n" + "==============================\n" + "Runtime Information:\n" + - " pawerDB version: " + variables.version + "\n NodeJS version: " + process.versions.node + "\n System: " + os.type() + " " + os.arch() + " " + os.release() + "\n User: " + os.userInfo().username + " (" + os.userInfo().uid + ":" + os.userInfo().gid + ")" + + " EquestriaDB version: " + variables.version + "\n NodeJS version: " + process.versions.node + "\n System: " + os.type() + " " + os.arch() + " " + os.release() + "\n User: " + os.userInfo().username + " (" + os.userInfo().uid + ":" + os.userInfo().gid + ")" + "\n\n" + "==============================\n" + - "Get libpawerdb:\n" + + "Get libeqdb:\n" + " PHP: -\n NodeJS: -\n JavaScript (browser): -\n Bash: -\n Python: -" + "\n\n" + "==============================\n" + - "About pawerDB:\n" + + "About EquestriaDB:\n" + " Setting up: -\n API: -\n Maintenance tasks: -\n Optimizations: -" + "\n\n" ); diff --git a/modules/version.js b/modules/version.js index 22a3667..be59c8b 100644 --- a/modules/version.js +++ b/modules/version.js @@ -9,6 +9,8 @@ module.exports = (req, res, entry, dbid) => { error: 200, ...process.versions, pawerdb: variables.version, + eqdb: variables.version, + equestriadb: variables.version, os: os.type() + " " + os.arch() + " " + os.release(), user: os.userInfo() })); |