piston/api/src/globals.js

21 lines
701 B
JavaScript
Raw Normal View History

2021-02-20 15:13:56 +01:00
// Globals are things the user shouldn't change in config, but is good to not use inline constants for
2021-02-20 23:39:03 +01:00
const is_docker = require('is-docker');
const fs = require('fs');
2021-05-08 02:20:21 +02:00
const platform = `${is_docker() ? 'docker' : 'baremetal'}-${fs
2021-05-08 02:30:40 +02:00
.read_file_sync('/etc/os-release')
.toString()
.split('\n')
.find(x => x.startsWith('ID'))
.replace('ID=', '')}`;
2021-02-20 15:13:56 +01:00
module.exports = {
2021-05-08 02:30:40 +02:00
data_directories: {
packages: 'packages',
jobs: 'jobs',
},
version: require('../package.json').version,
platform,
pkg_installed_file: '.ppman-installed', //Used as indication for if a package was installed
clean_directories: ['/dev/shm', '/run/lock', '/tmp', '/var/tmp'],
2021-03-13 06:01:04 +01:00
};