mirror of
https://github.com/engineer-man/piston.git
synced 2025-04-20 20:16:26 +02:00
api: v3
This commit is contained in:
parent
d8239c2703
commit
91420c39d7
18 changed files with 2328 additions and 0 deletions
25
api/src/globals.js
Normal file
25
api/src/globals.js
Normal file
|
@ -0,0 +1,25 @@
|
|||
// Globals are things the user shouldn't change in config, but is good to not use inline constants for
|
||||
const is_docker = require("is-docker")
|
||||
const fs = require("fs")
|
||||
const platform = `${is_docker() ? "docker" : "baremetal"}-${
|
||||
fs.read_file_sync("/etc/os-release")
|
||||
.toString()
|
||||
.split("\n")
|
||||
.find(x=>x.startsWith("ID"))
|
||||
.replace("ID=","")
|
||||
}`
|
||||
|
||||
module.exports = {
|
||||
data_directories: {
|
||||
cache: "cache",
|
||||
packages: "packages",
|
||||
runtimes: "runtimes",
|
||||
jobs: "jobs"
|
||||
},
|
||||
data_files:{
|
||||
state: "state.json"
|
||||
},
|
||||
version: require("../package.json").version,
|
||||
platform,
|
||||
pkg_installed_file: ".ppman-installed" //Used as indication for if a package was installed
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue