mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-06-01 23:30:48 +00:00
Log useful supervisor info to stdout/stderr
This commit is contained in:
parent
932af53913
commit
6193ebe1df
@ -1,3 +1,5 @@
|
|||||||
|
* Log useful supervisor info to stdout/stderr [Kostas]
|
||||||
|
|
||||||
# v1.10.0
|
# v1.10.0
|
||||||
|
|
||||||
* Fix progress bars on docker version 1.10 [Aleksis]
|
* Fix progress bars on docker version 1.10 [Aleksis]
|
||||||
|
@ -28,4 +28,6 @@ export DBUS_SYSTEM_BUS_ADDRESS="unix:path=/mnt/root/run/dbus/system_bus_socket"
|
|||||||
supervisorctl -c /etc/supervisor/supervisord.conf start resin-supervisor
|
supervisorctl -c /etc/supervisor/supervisord.conf start resin-supervisor
|
||||||
supervisorctl -c /etc/supervisor/supervisord.conf start go-supervisor
|
supervisorctl -c /etc/supervisor/supervisord.conf start go-supervisor
|
||||||
|
|
||||||
tail -f /var/log/supervisor/supervisord.log
|
tail -F \
|
||||||
|
/var/log/supervisor/supervisord.log \
|
||||||
|
/var/log/resin_supervisor_stdout.log
|
||||||
|
4
entry.sh
4
entry.sh
@ -30,4 +30,6 @@ export DBUS_SYSTEM_BUS_ADDRESS="unix:path=/mnt/root/run/dbus/system_bus_socket"
|
|||||||
supervisorctl start resin-supervisor
|
supervisorctl start resin-supervisor
|
||||||
supervisorctl start go-supervisor
|
supervisorctl start go-supervisor
|
||||||
|
|
||||||
tail -f /var/log/supervisor/supervisord.log
|
tail -F \
|
||||||
|
/var/log/supervisor/supervisord.log \
|
||||||
|
/var/log/resin_supervisor_stdout.log
|
||||||
|
@ -11,11 +11,6 @@ device = require './device'
|
|||||||
dockerUtils = require './docker-utils'
|
dockerUtils = require './docker-utils'
|
||||||
_ = require 'lodash'
|
_ = require 'lodash'
|
||||||
|
|
||||||
privateAppEnvVars = [
|
|
||||||
'RESIN_SUPERVISOR_API_KEY'
|
|
||||||
'RESIN_API_KEY'
|
|
||||||
]
|
|
||||||
|
|
||||||
module.exports = (application) ->
|
module.exports = (application) ->
|
||||||
api = express()
|
api = express()
|
||||||
unparsedRouter = express.Router()
|
unparsedRouter = express.Router()
|
||||||
@ -151,7 +146,7 @@ module.exports = (application) ->
|
|||||||
if !app?
|
if !app?
|
||||||
throw new Error('App not found')
|
throw new Error('App not found')
|
||||||
# Don't return keys on the endpoint
|
# Don't return keys on the endpoint
|
||||||
app.env = _.omit(JSON.parse(app.env), privateAppEnvVars)
|
app.env = _.omit(JSON.parse(app.env), config.privateAppEnvVars)
|
||||||
# Don't return data that will be of no use to the user
|
# Don't return data that will be of no use to the user
|
||||||
res.json(app)
|
res.json(app)
|
||||||
.catch (err) ->
|
.catch (err) ->
|
||||||
|
@ -44,3 +44,7 @@ module.exports = config =
|
|||||||
hostOsVersionPath: checkString(process.env.HOST_OS_VERSION_PATH) ? '/mnt/root/etc/os-release'
|
hostOsVersionPath: checkString(process.env.HOST_OS_VERSION_PATH) ? '/mnt/root/etc/os-release'
|
||||||
dockerRoot: dockerRoot
|
dockerRoot: dockerRoot
|
||||||
btrfsRoot: checkString(process.env.BTRFS_ROOT) ? "#{dockerRoot}/btrfs/subvolumes"
|
btrfsRoot: checkString(process.env.BTRFS_ROOT) ? "#{dockerRoot}/btrfs/subvolumes"
|
||||||
|
privateAppEnvVars: [
|
||||||
|
'RESIN_SUPERVISOR_API_KEY'
|
||||||
|
'RESIN_API_KEY'
|
||||||
|
]
|
||||||
|
@ -36,6 +36,16 @@ exports.mixpanelTrack = (event, properties = {}) ->
|
|||||||
message: properties.error.message
|
message: properties.error.message
|
||||||
stack: properties.error.stack
|
stack: properties.error.stack
|
||||||
|
|
||||||
|
# Don't log private env vars (e.g. api keys)
|
||||||
|
if properties?.app?.env?
|
||||||
|
try
|
||||||
|
{ env } = properties.app
|
||||||
|
env = JSON.parse(env) if _.isString(env)
|
||||||
|
safeEnv = _.omit(env, config.privateAppEnvVars)
|
||||||
|
properties.app.env = JSON.stringify(safeEnv)
|
||||||
|
catch
|
||||||
|
properties.app.env = 'Fully hidden due to error in selective hiding'
|
||||||
|
|
||||||
console.log('Event:', event, JSON.stringify(properties))
|
console.log('Event:', event, JSON.stringify(properties))
|
||||||
# Mutation is bad, and it should feel bad
|
# Mutation is bad, and it should feel bad
|
||||||
properties = _.assign(_.cloneDeep(properties), mixpanelProperties)
|
properties = _.assign(_.cloneDeep(properties), mixpanelProperties)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user