This commit is contained in:
Thomas Hobson 2021-02-21 03:13:56 +13:00
parent d8239c2703
commit 91420c39d7
No known key found for this signature in database
GPG key ID: 9F1FD9D87950DB6F
18 changed files with 2328 additions and 0 deletions

25
api/src/globals.js Normal file
View 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
}