Sendgrid Inbound Webhook Sending Empty Body - meteor
Trying to get Sendgrid's Inbound Parse Webhook following their instructions here
Using Meteor and Iron Router. I am capturing the request but the request body is empty. I'm following this tutorial https://sendgrid.com/blog/receive-inbound-email-meteorjs/ and https://sendgrid.com/blog/control-home-lighting-parse-webhook/, but when I do a console.log(this.request.body), it's returning an empty object {}.
I've also tried getting text (this.request.text), html, from, to, subject, but nothing. The only thing I've had success getting is this.request.headers.
The Sendgrid activity dashboard does show that the emails are being parsed, and I am clearly receiving them, but the body is empty. This is unexpected behaviour and I'm not sure how to troubleshoot. Can anybody point me in the right direction? Thanks. Here's a sample request.
{ _readableState:
{ highWaterMark: 16384,
buffer: [],
length: 0,
pipes: null,
pipesCount: 0,
flowing: false,
ended: false,
endEmitted: false,
reading: false,
calledRead: false,
sync: true,
needReadable: false,
emittedReadable: false,
readableListening: false,
objectMode: false,
defaultEncoding: 'utf8',
ranOut: false,
awaitDrain: 0,
readingMore: false,
decoder: null,
encoding: null },
readable: true,
domain: null,
_events: { close: [Function] },
_maxListeners: 10,
socket:
{ _connecting: false,
_handle:
{ fd: 34,
writeQueueSize: 0,
owner: [Circular],
onread: [Function: onread],
reading: true },
_readableState:
{ highWaterMark: 16384,
buffer: [],
length: 0,
pipes: null,
pipesCount: 0,
flowing: false,
ended: false,
endEmitted: false,
reading: true,
calledRead: true,
sync: false,
needReadable: true,
emittedReadable: false,
readableListening: false,
objectMode: false,
defaultEncoding: 'utf8',
ranOut: false,
awaitDrain: 0,
readingMore: false,
decoder: null,
encoding: null },
readable: true,
domain: null,
_events:
{ end: [Object],
finish: [Function: onSocketFinish],
_socketEnd: [Function: onSocketEnd],
drain: [Object],
timeout: [Function],
error: [Function],
close: [Object] },
_maxListeners: 10,
_writableState:
{ highWaterMark: 16384,
objectMode: false,
needDrain: false,
ending: false,
ended: false,
finished: false,
decodeStrings: false,
defaultEncoding: 'utf8',
length: 0,
writing: false,
sync: true,
bufferProcessing: false,
onwrite: [Function],
writecb: null,
writelen: 0,
buffer: [],
errorEmitted: false },
writable: true,
allowHalfOpen: true,
onend: [Function],
destroyed: false,
bytesRead: 8249,
_bytesDispatched: 0,
_pendingData: null,
_pendingEncoding: '',
server:
{ domain: null,
_events: [Object],
_maxListeners: 10,
_connections: 1,
connections: [Getter/Setter],
_handle: [Object],
_usingSlaves: false,
_slaves: [],
allowHalfOpen: true,
httpAllowHalfOpen: false,
timeout: 5000,
_connectionKey: '4:0.0.0.0:23683' },
_idleTimeout: 5000,
_idleNext:
{ _connecting: false,
_handle: [Object],
_readableState: [Object],
readable: true,
domain: null,
_events: [Object],
_maxListeners: 10,
_writableState: [Object],
writable: true,
allowHalfOpen: false,
onend: null,
destroyed: false,
bytesRead: 79134,
_bytesDispatched: 14036,
_pendingData: null,
_pendingEncoding: '',
_idleTimeout: 30000,
_idleNext: [Object],
_idlePrev: [Circular],
_idleStart: 1459115857090,
_monotonicStartTime: 543430569,
pipe: [Function],
addListener: [Function: addListener],
on: [Function: addListener],
pause: [Function],
resume: [Function],
read: [Function],
_consuming: true },
_idlePrev: { _idleNext: [Circular], _idlePrev: [Object] },
_idleStart: 1459115857771,
_monotonicStartTime: 543431251,
parser:
{ _headers: [],
_url: '',
onHeaders: [Function: parserOnHeaders],
onHeadersComplete: [Function: parserOnHeadersComplete],
onBody: [Function: parserOnBody],
onMessageComplete: [Function: parserOnMessageComplete],
socket: [Circular],
incoming: [Circular],
maxHeaderPairs: 2000,
onIncoming: [Function] },
ondata: [Function],
_paused: false,
_httpMessage:
{ domain: null,
_events: [Object],
_maxListeners: 10,
output: [],
outputEncodings: [],
writable: true,
_last: false,
chunkedEncoding: false,
shouldKeepAlive: true,
useChunkedEncodingByDefault: true,
sendDate: true,
_headerSent: false,
_header: '',
_hasBody: true,
_trailer: '',
finished: false,
_hangupClose: false,
socket: [Circular],
connection: [Circular],
_headers: [Object],
_headerNames: [Object],
write: [Function],
end: [Function] } },
connection:
{ _connecting: false,
_handle:
{ fd: 34,
writeQueueSize: 0,
owner: [Circular],
onread: [Function: onread],
reading: true },
_readableState:
{ highWaterMark: 16384,
buffer: [],
length: 0,
pipes: null,
pipesCount: 0,
flowing: false,
ended: false,
endEmitted: false,
reading: true,
calledRead: true,
sync: false,
needReadable: true,
emittedReadable: false,
readableListening: false,
objectMode: false,
defaultEncoding: 'utf8',
ranOut: false,
awaitDrain: 0,
readingMore: false,
decoder: null,
encoding: null },
readable: true,
domain: null,
_events:
{ end: [Object],
finish: [Function: onSocketFinish],
_socketEnd: [Function: onSocketEnd],
drain: [Object],
timeout: [Function],
error: [Function],
close: [Object] },
_maxListeners: 10,
_writableState:
{ highWaterMark: 16384,
objectMode: false,
needDrain: false,
ending: false,
ended: false,
finished: false,
decodeStrings: false,
defaultEncoding: 'utf8',
length: 0,
writing: false,
sync: true,
bufferProcessing: false,
onwrite: [Function],
writecb: null,
writelen: 0,
buffer: [],
errorEmitted: false },
writable: true,
allowHalfOpen: true,
onend: [Function],
destroyed: false,
bytesRead: 8249,
_bytesDispatched: 0,
_pendingData: null,
_pendingEncoding: '',
server:
{ domain: null,
_events: [Object],
_maxListeners: 10,
_connections: 1,
connections: [Getter/Setter],
_handle: [Object],
_usingSlaves: false,
_slaves: [],
allowHalfOpen: true,
httpAllowHalfOpen: false,
timeout: 5000,
_connectionKey: '4:0.0.0.0:23683' },
_idleTimeout: 5000,
_idleNext:
{ _connecting: false,
_handle: [Object],
_readableState: [Object],
readable: true,
domain: null,
_events: [Object],
_maxListeners: 10,
_writableState: [Object],
writable: true,
allowHalfOpen: false,
onend: null,
destroyed: false,
bytesRead: 79134,
_bytesDispatched: 14036,
_pendingData: null,
_pendingEncoding: '',
_idleTimeout: 30000,
_idleNext: [Object],
_idlePrev: [Circular],
_idleStart: 1459115857090,
_monotonicStartTime: 543430569,
pipe: [Function],
addListener: [Function: addListener],
on: [Function: addListener],
pause: [Function],
resume: [Function],
read: [Function],
_consuming: true },
_idlePrev: { _idleNext: [Circular], _idlePrev: [Object] },
_idleStart: 1459115857771,
_monotonicStartTime: 543431251,
parser:
{ _headers: [],
_url: '',
onHeaders: [Function: parserOnHeaders],
onHeadersComplete: [Function: parserOnHeadersComplete],
onBody: [Function: parserOnBody],
onMessageComplete: [Function: parserOnMessageComplete],
socket: [Circular],
incoming: [Circular],
maxHeaderPairs: 2000,
onIncoming: [Function] },
ondata: [Function],
_paused: false,
_httpMessage:
{ domain: null,
_events: [Object],
_maxListeners: 10,
output: [],
outputEncodings: [],
writable: true,
_last: false,
chunkedEncoding: false,
shouldKeepAlive: true,
useChunkedEncodingByDefault: true,
sendDate: true,
_headerSent: false,
_header: '',
_hasBody: true,
_trailer: '',
finished: false,
_hangupClose: false,
socket: [Circular],
connection: [Circular],
_headers: [Object],
_headerNames: [Object],
write: [Function],
end: [Function] } },
httpVersion: '1.1',
complete: false,
headers:
{ 'x-forwarded-proto': 'http',
'x-forwarded-port': '80',
'x-forwarded-for': '167.89.125.249,127.0.0.1',
'content-type': 'multipart/form-data; boundary=xYzZY',
'content-length': '8782',
'user-agent': 'SendGrid 1.0',
host: '6f496891.ngrok.io',
connection: 'TE, close',
te: 'deflate,gzip;q=0.3' },
trailers: {},
_pendings: [],
_pendingIndex: 0,
url: '/webhook/sendgrid',
method: 'POST',
statusCode: null,
client:
{ _connecting: false,
_handle:
{ fd: 34,
writeQueueSize: 0,
owner: [Circular],
onread: [Function: onread],
reading: true },
_readableState:
{ highWaterMark: 16384,
buffer: [],
length: 0,
pipes: null,
pipesCount: 0,
flowing: false,
ended: false,
endEmitted: false,
reading: true,
calledRead: true,
sync: false,
needReadable: true,
emittedReadable: false,
readableListening: false,
objectMode: false,
defaultEncoding: 'utf8',
ranOut: false,
awaitDrain: 0,
readingMore: false,
decoder: null,
encoding: null },
readable: true,
domain: null,
_events:
{ end: [Object],
finish: [Function: onSocketFinish],
_socketEnd: [Function: onSocketEnd],
drain: [Object],
timeout: [Function],
error: [Function],
close: [Object] },
_maxListeners: 10,
_writableState:
{ highWaterMark: 16384,
objectMode: false,
needDrain: false,
ending: false,
ended: false,
finished: false,
decodeStrings: false,
defaultEncoding: 'utf8',
length: 0,
writing: false,
sync: true,
bufferProcessing: false,
onwrite: [Function],
writecb: null,
writelen: 0,
buffer: [],
errorEmitted: false },
writable: true,
allowHalfOpen: true,
onend: [Function],
destroyed: false,
bytesRead: 8249,
_bytesDispatched: 0,
_pendingData: null,
_pendingEncoding: '',
server:
{ domain: null,
_events: [Object],
_maxListeners: 10,
_connections: 1,
connections: [Getter/Setter],
_handle: [Object],
_usingSlaves: false,
_slaves: [],
allowHalfOpen: true,
httpAllowHalfOpen: false,
timeout: 5000,
_connectionKey: '4:0.0.0.0:23683' },
_idleTimeout: 5000,
_idleNext:
{ _connecting: false,
_handle: [Object],
_readableState: [Object],
readable: true,
domain: null,
_events: [Object],
_maxListeners: 10,
_writableState: [Object],
writable: true,
allowHalfOpen: false,
onend: null,
destroyed: false,
bytesRead: 79134,
_bytesDispatched: 14036,
_pendingData: null,
_pendingEncoding: '',
_idleTimeout: 30000,
_idleNext: [Object],
_idlePrev: [Circular],
_idleStart: 1459115857090,
_monotonicStartTime: 543430569,
pipe: [Function],
addListener: [Function: addListener],
on: [Function: addListener],
pause: [Function],
resume: [Function],
read: [Function],
_consuming: true },
_idlePrev: { _idleNext: [Circular], _idlePrev: [Object] },
_idleStart: 1459115857771,
_monotonicStartTime: 543431251,
parser:
{ _headers: [],
_url: '',
onHeaders: [Function: parserOnHeaders],
onHeadersComplete: [Function: parserOnHeadersComplete],
onBody: [Function: parserOnBody],
onMessageComplete: [Function: parserOnMessageComplete],
socket: [Circular],
incoming: [Circular],
maxHeaderPairs: 2000,
onIncoming: [Function] },
ondata: [Function],
_paused: false,
_httpMessage:
{ domain: null,
_events: [Object],
_maxListeners: 10,
output: [],
outputEncodings: [],
writable: true,
_last: false,
chunkedEncoding: false,
shouldKeepAlive: true,
useChunkedEncodingByDefault: true,
sendDate: true,
_headerSent: false,
_header: '',
_hasBody: true,
_trailer: '',
finished: false,
_hangupClose: false,
socket: [Circular],
connection: [Circular],
_headers: [Object],
_headerNames: [Object],
write: [Function],
end: [Function] } },
_consuming: false,
_dumped: false,
httpVersionMajor: 1,
httpVersionMinor: 1,
upgrade: false,
originalUrl: '/webhook/sendgrid',
_parsedUrl:
{ protocol: null,
slashes: null,
auth: null,
host: null,
port: null,
hostname: null,
hash: null,
search: null,
query: null,
pathname: '/webhook/sendgrid',
path: '/webhook/sendgrid',
href: '/webhook/sendgrid' },
body: {},
query: {} }
So, the Parse API makes a POST request to an endpoint of your choosing, but the data is encoded as a multipart/form-data. I recommend using Formidable which is an express middleware to parse the data, and then extract it via a regular key-value lookup. Here's some sample code to help you out:
var form = new formidable.IncomingForm();
form.parse(req, function(err, fields, files){//do something here})
Related
Transform a array data into a nested objects
I have this issue when using echarts tree, need to solve by using recursive somehow Can someone help me. Thank you I have tried with some codes as blow and still not working Here is my sample data sampleData: any[] = [ { input: '093098448-0000', output: '4971432_01', children: [ { name: '4971432_01', }, ], inputData: { recId: '295ad5b2-4924-4ca4-899d-76fbfbba4f87', userId: 'FrontendTestUser', containerId: null, handlingUnitId: null, documentNo: null, materialNo: '093098448-0000', orderNo: '4971432', workplaceId: '84960950', workplaceDescription: null, operationNo: '0010', operationShortText: 'Kivágás, formázás 60 HUB; SÁRGA', inputDate: '2022-02-04T11:55:11.193', quantityOK: 5321, quantityNok: 0, processNumberJoined: null, warningText: null, coil: null, containerRecId: null, workplaceRecId: '16111747-ef85-4402-96e5-444dffc209dd', lastModified: '0001-01-01T00:00:00', }, outputData: { workplaceOutputRecId: '7a57cc35-0020-4130-81bc-0078b98deb9b', workplaceId: null, workplaceName: null, workcenter: '84960950', operationNo: '0010', operationShortText: 'Kivágás, formázás 60 HUB; SÁRGA', additionalInfo: null, containerId: '4971432_01', handlingUnitId: null, orderNo: null, orderRecId: '00000000-0000-0000-0000-000000000000', materialNo: null, documentNo: null, index: null, outputDate: '2022-02-04T12:41:32.007', userId: 'FISCHMTA', quantityOK: 11, quantityNok: 1, isFinalFeedback: true, processNumberJoined: null, skipped: false, comment: null, containerRecId: 'fabd939e-0110-44c0-9d62-06f2b1b85044', workplaceRecId: '16111747-ef85-4402-96e5-444dffc209dd', lastModified: '0001-01-01T00:00:00', }, nested: false, }, { input: '093098448-0000', output: '4971432_05', children: [ { name: '4971432_05', }, ], inputData: { recId: '295ad5b2-4924-4ca4-899d-76fbfbba4f87', userId: 'FrontendTestUser', containerId: null, handlingUnitId: null, documentNo: null, materialNo: '093098448-0000', orderNo: '4971432', workplaceId: '84960950', workplaceDescription: null, operationNo: '0010', operationShortText: 'Kivágás, formázás 60 HUB; SÁRGA', inputDate: '2022-02-04T11:55:11.193', quantityOK: 5321, quantityNok: 0, processNumberJoined: null, warningText: null, coil: null, containerRecId: null, workplaceRecId: '16111747-ef85-4402-96e5-444dffc209dd', lastModified: '0001-01-01T00:00:00', }, outputData: { workplaceOutputRecId: 'd3f6bce2-54a2-4adf-bf19-68c178b6492a', workplaceId: null, workplaceName: null, workcenter: '84960950', operationNo: '0010', operationShortText: '0010', additionalInfo: null, containerId: '4971432_05', handlingUnitId: null, orderNo: null, orderRecId: '00000000-0000-0000-0000-000000000000', materialNo: null, documentNo: null, index: null, outputDate: '2022-02-21T16:22:16.507', userId: 'ernstfri', quantityOK: 25, quantityNok: 0, isFinalFeedback: true, processNumberJoined: '0010', skipped: false, comment: null, containerRecId: '1234069d-7a04-430c-b425-105bb6254320', workplaceRecId: '16111747-ef85-4402-96e5-444dffc209dd', lastModified: '0001-01-01T00:00:00', }, nested: false, } ] The output data looks like data: { name: string; children: any[] } = { name: '093098448-0000', children: [ { name: '4971432_01', }, { name: '4971432_05', children: [ { name: '4971432_88', }, ], }, ], }; I have run this function findNode(ele, obj) { console.log('findNode', ele); if (ele.name === obj.input) { let child = { name: obj.input, children: obj.children }; ele.children.push(child); return true; } else { const c = ele.children.length; if (c > 0) { for (let i = 0; c > i; i++) { const found = this.findNode(ele.children[i], obj); // console.log('found', found); if (found) break; } } } }
R markdown - Where can I see what options I can set for a css class to modify a code chunk's style
I'm trying to replicate the Rstudio 'cobalt' theme on my Rmarkdown code chunks. So far I have this: ```{css, echo=FALSE} .cobalt { background-color: #002240; border: 3px #324c63; } ``` ```{r class.source="cobalt"} "string" x <- 1 function() return() # comment TRUE ``` Which looks like this: But I want it to look like this: How can I do this? notice that the font (and ligatures), highlighting of strings, booleans, doubles and functions are all different. My hope is that there is some template in GitHub or perhaps as part of Rstudio itself so that I can simply do class.source=cobalt and class.output=cobalt. The biggest problem I have at the moment is that I don't know besides background-color: and border: what other options I can specify. So If someone could point me towards the relevant documentation that would be appreciated too. Thanks for your help!
One way to replicate Rstudio cobalt theme on the Rmarkdown code syntax highlighting, is to create a custom theme for syntax highlighting. (I have added the complete theme file down below, tweak that as necessary following this cobalt rstheme) and refer to this page to know which selector in rstheme means what. --- title: "Cobalt - Syntax Highlighting" output: html_document: highlight: cobalt.theme theme: version: 4 code_font: google: Fira Code --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) ``` ## R Markdown ```{r results='hide'} "string" x <- 1 function() return() y <- x + 1 # comment TRUE ``` cobalt.theme { "text-color": "#F4F4F4", "background-color": "#002240", "line-number-color": "#aaaaaa", "line-number-background-color": null, "text-styles": { "Other": { "text-color": "#BED6FF", "background-color": null, "bold": false, "italic": false, "underline": false }, "Attribute": { "text-color": "#FF9D00", "background-color": null, "bold": false, "italic": false, "underline": false }, "SpecialString": { "text-color": "#FF9D00", "background-color": null, "bold": false, "italic": false, "underline": false }, "Annotation": { "text-color": "#60a0b0", "background-color": null, "bold": true, "italic": true, "underline": false }, "Function": { "text-color": "#FF9D00", "background-color": null, "bold": false, "italic": false, "underline": false }, "String": { "text-color": "#3AD900", "background-color": null, "bold": false, "italic": false, "underline": false }, "ControlFlow": { "text-color": "#FF9D00", "background-color": null, "bold": true, "italic": false, "underline": false }, "Operator": { "text-color": "#BED6FF", "background-color": null, "bold": false, "italic": false, "underline": false }, "Error": { "text-color": "#FF0000", "background-color": null, "bold": true, "italic": false, "underline": false }, "BaseN": { "text-color": "#40a070", "background-color": null, "bold": false, "italic": false, "underline": false }, "Alert": { "text-color": "#ff0000", "background-color": null, "bold": true, "italic": false, "underline": false }, "Variable": { "text-color": "#CCCCCC", "background-color": null, "bold": false, "italic": false, "underline": false }, "BuiltIn": { "text-color": "#BED6FF", "background-color": null, "bold": false, "italic": false, "underline": false }, "Extension": { "text-color": null, "background-color": null, "bold": false, "italic": false, "underline": false }, "Preprocessor": { "text-color": "#bc7a00", "background-color": null, "bold": false, "italic": false, "underline": false }, "Information": { "text-color": "#60a0b0", "background-color": null, "bold": true, "italic": true, "underline": false }, "VerbatimString": { "text-color": "#4070a0", "background-color": null, "bold": false, "italic": false, "underline": false }, "Warning": { "text-color": "#60a0b0", "background-color": null, "bold": true, "italic": true, "underline": false }, "Documentation": { "text-color": "#ba2121", "background-color": null, "bold": false, "italic": true, "underline": false }, "Import": { "text-color": null, "background-color": null, "bold": false, "italic": false, "underline": false }, "Char": { "text-color": "#4070a0", "background-color": null, "bold": false, "italic": false, "underline": false }, "DataType": { "text-color": "#902000", "background-color": null, "bold": false, "italic": false, "underline": false }, "Float": { "text-color": "#40a070", "background-color": null, "bold": false, "italic": false, "underline": false }, "Comment": { "text-color": "#0088FF", "background-color": null, "bold": false, "italic": true, "underline": false }, "CommentVar": { "text-color": "#60a0b0", "background-color": null, "bold": true, "italic": true, "underline": false }, "Constant": { "text-color": "#FF628C", "background-color": null, "bold": false, "italic": false, "underline": false }, "SpecialChar": { "text-color": "#BED6FF", "background-color": null, "bold": false, "italic": false, "underline": false }, "DecVal": { "text-color": "#FF628C", "background-color": null, "bold": false, "italic": false, "underline": false }, "Keyword": { "text-color": "#FF628C", "background-color": null, "bold": true, "italic": false, "underline": false } } }
Openstack Horizon : alway back to login page
Opening http://mycloud/dashboard I got http://mycloud/dashboard/auth/login/?next=/dashboard/ After auth succed, I got http://mycloud/dashboard/project/ Try to click on 'API Access', I'm thrown back to login page http://mycloud/dashboard/auth/login/?next=/dashboard/project/api_access/ Basically, anywhere I click I always back to login page. Below is my openstack_dashboard/local/local_settings.py import os from django.utils.translation import ugettext_lazy as _ from horizon.utils import secret_key from openstack_dashboard.settings import HORIZON_CONFIG DEBUG = True DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'horizon', 'USER': 'packstack', 'PASSWORD': 'L3tM31n', 'HOST': '192.168.5.80', 'PORT': '5432', } } COMPRESS_OFFLINE = True SESSION_TIMEOUT = 1800 WEBROOT = '/dashboard/' LOGIN_URL = WEBROOT + 'auth/login/' LOGOUT_URL = WEBROOT + 'auth/logout/' LOGIN_REDIRECT_URL = WEBROOT ALLOWED_HOSTS = ['*'] OPENSTACK_KEYSTONE_MULTIDOMAIN_SUPPORT = True LOCAL_PATH = os.path.dirname(os.path.abspath(__file__)) SECRET_KEY = secret_key.generate_or_read_from_file( os.path.join(LOCAL_PATH, '.secret_key_store')) SESSION_ENGINE = "django.contrib.sessions.backends.cache" CACHES = { 'default':{ 'BACKEND': 'django.core.cache.backends.locmem.LocMemCache', 'LOCATION': '127.0.0.1:11211', }, } EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' OPENSTACK_HOST = "127.0.0.1" OPENSTACK_KEYSTONE_URL = "http://%s:7001/v3" % OPENSTACK_HOST OPENSTACK_KEYSTONE_DEFAULT_ROLE = "_member_" OPENSTACK_KEYSTONE_BACKEND = { 'name': 'native', 'can_edit_user': True, 'can_edit_group': True, 'can_edit_project': True, 'can_edit_domain': True, 'can_edit_role': True, } OPENSTACK_HYPERVISOR_FEATURES = { 'can_set_mount_point': False, 'can_set_password': False, 'requires_keypair': False, 'enable_quotas': True } OPENSTACK_CINDER_FEATURES = { 'enable_backup': False, } OPENSTACK_NEUTRON_NETWORK = { 'enable_router': True, 'enable_quotas': True, 'enable_ipv6': True, 'enable_distributed_router': False, 'enable_ha_router': False, 'enable_fip_topology_check': True, 'supported_vnic_types': ['*'], 'physical_networks': [], } OPENSTACK_HEAT_STACK = { 'enable_user_pass': True, } IMAGE_CUSTOM_PROPERTY_TITLES = { "architecture": _("Architecture"), "kernel_id": _("Kernel ID"), "ramdisk_id": _("Ramdisk ID"), "image_state": _("Euca2ools state"), "project_id": _("Project ID"), "image_type": _("Image Type"), } IMAGE_RESERVED_CUSTOM_PROPERTIES = [] API_RESULT_LIMIT = 1000 API_RESULT_PAGE_SIZE = 20 SWIFT_FILE_TRANSFER_CHUNK_SIZE = 512 * 1024 INSTANCE_LOG_LENGTH = 35 DROPDOWN_MAX_ITEMS = 30 TIME_ZONE = "UTC" LOGGING = { 'version': 1, 'disable_existing_loggers': False, 'formatters': { 'console': { 'format': '%(levelname)s %(name)s %(message)s' }, 'operation': { 'format': '%(message)s' }, }, 'handlers': { 'null': { 'level': 'DEBUG', 'class': 'logging.NullHandler', }, 'console': { 'level': 'DEBUG', 'class': 'logging.StreamHandler', 'formatter': 'console', }, 'operation': { 'level': 'INFO', 'class': 'logging.StreamHandler', 'formatter': 'operation', }, }, 'loggers': { 'horizon': { 'handlers': ['console'], 'level': 'DEBUG', 'propagate': False, }, 'horizon.operation_log': { 'handlers': ['operation'], 'level': 'INFO', 'propagate': False, }, 'openstack_dashboard': { 'handlers': ['console'], 'level': 'DEBUG', 'propagate': False, }, 'novaclient': { 'handlers': ['console'], 'level': 'DEBUG', 'propagate': False, }, 'cinderclient': { 'handlers': ['console'], 'level': 'DEBUG', 'propagate': False, }, 'keystoneauth': { 'handlers': ['console'], 'level': 'DEBUG', 'propagate': False, }, 'keystoneclient': { 'handlers': ['console'], 'level': 'DEBUG', 'propagate': False, }, 'glanceclient': { 'handlers': ['console'], 'level': 'DEBUG', 'propagate': False, }, 'neutronclient': { 'handlers': ['console'], 'level': 'DEBUG', 'propagate': False, }, 'swiftclient': { 'handlers': ['console'], 'level': 'DEBUG', 'propagate': False, }, 'oslo_policy': { 'handlers': ['console'], 'level': 'DEBUG', 'propagate': False, }, 'openstack_auth': { 'handlers': ['console'], 'level': 'DEBUG', 'propagate': False, }, 'django': { 'handlers': ['console'], 'level': 'DEBUG', 'propagate': False, }, 'django.db.backends': { 'handlers': ['null'], 'propagate': False, }, 'requests': { 'handlers': ['null'], 'propagate': False, }, 'urllib3': { 'handlers': ['null'], 'propagate': False, }, 'chardet.charsetprober': { 'handlers': ['null'], 'propagate': False, }, 'iso8601': { 'handlers': ['null'], 'propagate': False, }, 'scss': { 'handlers': ['null'], 'propagate': False, }, }, } SECURITY_GROUP_RULES = { 'all_tcp': { 'name': _('All TCP'), 'ip_protocol': 'tcp', 'from_port': '1', 'to_port': '65535', }, 'all_udp': { 'name': _('All UDP'), 'ip_protocol': 'udp', 'from_port': '1', 'to_port': '65535', }, 'all_icmp': { 'name': _('All ICMP'), 'ip_protocol': 'icmp', 'from_port': '-1', 'to_port': '-1', }, 'ssh': { 'name': 'SSH', 'ip_protocol': 'tcp', 'from_port': '22', 'to_port': '22', }, 'smtp': { 'name': 'SMTP', 'ip_protocol': 'tcp', 'from_port': '25', 'to_port': '25', }, 'dns': { 'name': 'DNS', 'ip_protocol': 'tcp', 'from_port': '53', 'to_port': '53', }, 'http': { 'name': 'HTTP', 'ip_protocol': 'tcp', 'from_port': '80', 'to_port': '80', }, 'pop3': { 'name': 'POP3', 'ip_protocol': 'tcp', 'from_port': '110', 'to_port': '110', }, 'imap': { 'name': 'IMAP', 'ip_protocol': 'tcp', 'from_port': '143', 'to_port': '143', }, 'ldap': { 'name': 'LDAP', 'ip_protocol': 'tcp', 'from_port': '389', 'to_port': '389', }, 'https': { 'name': 'HTTPS', 'ip_protocol': 'tcp', 'from_port': '443', 'to_port': '443', }, 'smtps': { 'name': 'SMTPS', 'ip_protocol': 'tcp', 'from_port': '465', 'to_port': '465', }, 'imaps': { 'name': 'IMAPS', 'ip_protocol': 'tcp', 'from_port': '993', 'to_port': '993', }, 'pop3s': { 'name': 'POP3S', 'ip_protocol': 'tcp', 'from_port': '995', 'to_port': '995', }, 'ms_sql': { 'name': 'MS SQL', 'ip_protocol': 'tcp', 'from_port': '1433', 'to_port': '1433', }, 'mysql': { 'name': 'MYSQL', 'ip_protocol': 'tcp', 'from_port': '3306', 'to_port': '3306', }, 'rdp': { 'name': 'RDP', 'ip_protocol': 'tcp', 'from_port': '3389', 'to_port': '3389', }, } REST_API_REQUIRED_SETTINGS = ['OPENSTACK_HYPERVISOR_FEATURES', 'LAUNCH_INSTANCE_DEFAULTS', 'OPENSTACK_IMAGE_FORMATS', 'OPENSTACK_KEYSTONE_BACKEND', 'OPENSTACK_KEYSTONE_DEFAULT_DOMAIN', 'CREATE_IMAGE_DEFAULTS', 'ENFORCE_PASSWORD_CHECK'] ALLOWED_PRIVATE_SUBNET_CIDR = {'ipv4': [], 'ipv6': []} LOGIN_REDIRECT_URL = WEBROOT MEDIA_URL = WEBROOT + '/media/' STATIC_URL = WEBROOT + '/static/'
Should Prepros work to compile my SASS to CSS on a Github.io page? If so, what could be causing my SASS styling to not work on the Github.io page?
My project is styled just as I want it to be locally. After pushing it to GitHub and all the files appear to be present I published it to a GitHub.io page and none of my stylings are present. Have I fundamentally misunderstood the purpose and use of Prepros or am I making some other mistake? What info do you need to determine what the issue is? My prepros-6.config file { "name": "landingPage", "firstRun": false, "exportConfig": true, "fileConfigs": [ { "path": "styles/style.sass", "configJson": "{\"forceCompile\":false,\"customOutput\":\"styles/style.css\",\"autoCompile\":true,\"sourceMap\":false,\"compiler-node-sass\":{\"enabled\":true,\"outputStyle\":\"nested\"},\"compiler-autoprefixer\":{\"enabled\":true},\"compiler-minify-css\":{\"enabled\":false}}" } ], "fileTree": { "expandedDirs": [], "hideSystemFiles": true, "systemFiles": [ ".*", "desktop.ini", "prepros.config", "$RECYCLE.BIN", "prepros.cfg", "prepros-6.config", "Prepros Export" ], "hideUnwatchedFiles": false }, "imports": [ { "path": "styles/style.sass", "imports": [ "styles/_colors.sass" ] } ], "projectView": { "selectedView": "file-tree" }, "fileWatcher": { "enabled": true, "watchedExtensions": [ "less", "sass", "scss", "styl", "md", "markdown", "coffee", "js", "jade", "haml", "slim", "ls", "kit", "png", "jpg", "jpeg", "ts", "pug", "css", "html", "htm", "php" ] }, "pathFilters": [ "node_modules", ".*", "bower_components", "prepros.config", "Prepros Export", "prepros-6.config", "prepros.cfg", "wp-admin", "wp-includes" ], "server": { "port": 7887, "assignNewPortAutomatically": true, "enable": true, "proxy": { "enable": false, "url": "" } }, "browser-sync": { "enable": false, "clicks": true, "forms": true, "scroll": true }, "live-reload": { "enable": true, "animate": true, "delay": 0 }, "ftp-deploy": { "connectionType": "ftp", "remotePath": "", "uploadTimeout": 20000, "uploadOnChange": false, "ftp": { "secure": false, "host": "", "port": 21, "user": "", "password": "" }, "sftp": { "host": "", "port": 22, "usePrivateKey": false, "username": "", "password": "", "privateKey": "", "passphrase": "" }, "pathFilters": [ "config.rb", "prepros.config", "prepros-6.config", "node_modules", "Prepros Export", ".git", ".idea", ".sass-cache", ".hg", ".svn", ".cache", ".DS_Store", "*.sass", "*.scss", "*.less", "*.pug", "*.jade", "*.styl", "*.haml", "*.slim", "*.coffee", "*.ls", "*.kit", "*.ts" ], "history": [] }, "file-type-sass": "{\"compilers\":[\"node-sass\",\"autoprefixer\",\"minify-css\"]}", "file-type-less": "{\"compilers\":[\"less\",\"autoprefixer\",\"minify-css\"]}", "autoprefixer": { "browsers": "last 5 versions" }, "file-type-pug": "{\"compilers\":[\"pug\"]}", "file-type-css": "{\"compilers\":[\"autoprefixer\",\"cssnext\",\"minify-css\"]}", "file-type-javascript": "{\"compilers\":[\"concat-js\",\"babel\",\"uglify-js\"]}", "file-type-stylus": "{\"compilers\":[\"stylus\",\"autoprefixer\",\"minify-css\"]}", "file-type-markdown": "{\"compilers\":[\"markdown\"]}", "file-type-haml": "{\"compilers\":[\"haml\"]}", "file-type-slim": "{\"compilers\":[\"slim\"]}", "file-type-coffee-script": "{\"compilers\":[\"coffee-script\",\"uglify-js\"]}", "file-type-livescript": "{\"compilers\":[\"livescript\",\"uglify-js\"]}", "file-type-kit": "{\"compilers\":[\"kit\"]}", "uglify-js": { "ie8": false, "compress": { "sequences": true, "properties": true, "dead_code": true, "drop_debugger": true, "unsafe": false, "unsafe_comps": false, "unsafe_math": false, "unsafe_proto": false, "unsafe_regexp": false, "conditionals": true, "comparisons": true, "evaluate": true, "booleans": true, "loops": true, "unused": true, "toplevel": false, "top_retain": "", "hoist_funs": true, "hoist_vars": false, "if_return": true, "join_vars": true, "cascade": true, "collapse_vars": true, "reduce_vars": true, "warnings": true, "negate_iife": true, "pure_getters": false, "pure_funcs": [], "drop_console": false, "expression": false, "keep_fargs": true, "keep_fnames": false, "passes": 1, "keep_infinity": false, "side_effects": true, "global_defs": [] }, "output": { "ascii_only": false, "beautify": false, "bracketize": false, "comments": "", "indent_level": 4, "indent_start": 0, "inline_script": false, "keep_quoted_props": false, "max_line_len": false, "preamble": "", "preserve_line": false, "quote_keys": false, "quote_style": 0, "semicolons": true, "shebang": true, "width": 80 } }, "cssnext": { "customProperties": true, "applyRule": true, "calc": false, "nesting": true, "customMedia": true, "mediaQueriesRange": true, "customSelectors": true, "attributeCaseInsensitive": true, "colorRebeccapurple": true, "colorHwb": true, "colorGray": true, "colorHexAlpha": true, "colorFunction": true, "fontVariant": true, "filter": true, "initial": true, "rem": true, "pseudoElements": true, "pseudoClassMatches": true, "pseudoClassNot": true, "pseudoClassAnyLink": true, "colorRgba": true, "overflowWrap": true }, "file-type-typescript": "{\"compilers\":[\"typescript\",\"uglify-js\"]}", "babel": { "useBabelRc": true, "presets": { "babel-preset-es2015": true }, "plugins": { "babel-plugin-syntax-jsx": true, "babel-plugin-transform-react-jsx": true, "babel-plugin-transform-async-to-generator": true, "babel-plugin-transform-class-properties": true, "babel-plugin-transform-object-rest-spread": true } }, "file-type-png": "{\"compilers\":[\"png\"]}", "file-type-jpg": "{\"compilers\":[\"jpg\"]}" }
Github pages only serve static files (*.html, *.css, *.js). Github pages allow for the use of a static site generator Jekyll. This way you can push the project to Github and will build. If you are pushing code to Github hoping to compile your SASS file with Prepros that won't happen. You have to compile on your machine and push that static files to Github. Github can explain it better than I can here on pages.github.com
No Github pages will not process sass with prepros. It can only do this with jekyll. But here, you're problem is that path to your css resolves to a 404 page. https://lenocam.github.io/landing-page/ + /styles/style.css = 404 on https://lenocam.github.io/styles/style.css Try to call your css with a relative path : <link rel="stylesheet" href="./styles/style.css"> Same for your images. eg: <img src="./images/barrels.jpg" alt="">
How to produce a single line output of a record with jq
I have the following JSON { "guid": "dce38b4b-9989-42d2-b6bd-702645e344cf", "name": "dev", "apps": [ { "guid": "5d5498cb-a885-4242-a55a-d7d286a1cf48", "urls": [ "nodered.cloudfoundry.org" ], "routes": [ { "guid": "aca4d04b-f99d-4b43-afaa-82ab41afa07c", "host": "nodered-test", "port": null, "path": "", "domain": { "guid": "f4b90d7e-2cd3-4d30-b200-f28bbaf6be20", "name": "cloudfoundry.org" } } ], "service_count": 1, "service_names": [ "nodered-test-cloudantNoSQLDB" ], "running_instances": 1, "name": "perik-nodered-test", "production": false, "space_guid": "dce38b4b-9989-42d2-b6bd-702645e344cf", "stack_guid": "ac91d31a-86a3-453b-babf-8d49c9d763fc", "buildpack": null, "detected_buildpack": "SDK for Node.js(TM) (ibm-node.js-6.13.0, buildpack-v3.20-20180403-1426)", "detected_buildpack_guid": "33e9e82f-8846-4362-a60a-92964285a31e", "environment_json": {}, "memory": 256, "instances": 1, "disk_quota": 1024, "state": "STARTED", "version": "8c8c97a0-bc2e-424c-a0a3-d64704feb634", "command": null, "console": false, "debug": null, "staging_task_id": "539f460c-e4d2-49f9-b5e5-9f4fd31a8370", "package_state": "STAGED", "health_check_type": "port", "health_check_timeout": null, "health_check_http_endpoint": null, "staging_failed_reason": null, "staging_failed_description": null, "diego": true, "docker_image": null, "package_updated_at": "2018-04-10T17:32:06Z", "detected_start_command": "./vendor/initial_startup.rb", "enable_ssh": true, "ports": null }, { "guid": "4089ce19-19fb-467b-8876-3635819d5d91", "urls": [ "nodered.cloudfoundry.org" ], "routes": [ { "guid": "b79988d8-5ac5-455d-8fdd-00bc208dd2bc", "host": "NodeRedTestApp", "port": null, "path": "", "domain": { "guid": "f4b90d7e-2cd3-4d30-b200-f28bbaf6be20", "name": "cloudfoundry.org" } } ], "service_count": 1, "service_names": [ "NodeRedTestApp-cloudantNoSQLDB" ], "running_instances": 1, "name": "perik-NodeRedTestApp", "production": false, "space_guid": "dce38b4b-9989-42d2-b6bd-702645e344cf", "stack_guid": "ac91d31a-86a3-453b-babf-8d49c9d763fc", "buildpack": null, "detected_buildpack": "SDK for Node.js(TM) (ibm-node.js-6.13.0, buildpack-v3.20-20180403-1426)", "detected_buildpack_guid": "33e9e82f-8846-4362-a60a-92964285a31e", "environment_json": {}, "memory": 256, "instances": 1, "disk_quota": 1024, "state": "STARTED", "version": "17175bdb-df93-4745-9a17-cf214fe05976", "command": null, "console": false, "debug": null, "staging_task_id": "5c74633a-25db-4adf-9eb8-09454a70be52", "package_state": "STAGED", "health_check_type": "port", "health_check_timeout": null, "health_check_http_endpoint": null, "staging_failed_reason": null, "staging_failed_description": null, "diego": true, "docker_image": null, "package_updated_at": "2018-04-09T21:23:27Z", "detected_start_command": "./vendor/initial_startup.rb", "enable_ssh": true, "ports": null } ] } and getting the following values using cat test.json | jq -r '.apps[].routes[].host, .apps[].state, .apps[].package_updated_at' which produces the following output nodered-test NodeRedTestApp STARTED STARTED 2018-04-10T17:32:06Z 2018-04-09T21:23:27Z How can I get the output as nodered-test STARTED 2018-04-10T17:32:06Z NodeRedTestApp STARTED 2018-04-09T21:23:27Z So that I can assign it to a bash script array.
jq solution: jq -r '.apps[] | [.routes[].host, .state, .package_updated_at] | join(" ")' test.json The output: nodered-test STARTED 2018-04-10T17:32:06Z NodeRedTestApp STARTED 2018-04-09T21:23:27Z