How to share a private file in slack with everyone in workspace but not public? - slack

After my app got installed, users can upload files in direct message with my bot.
Now I want to send a message to everyone and include this uploaded file but since it was uploaded in a private chat with my bot, this file is private.
I don't want to make it public(internet) available(also user should have this extra workspace permission to make files publicly available), just want to share it with everyone in the workspace only. so app.client.files.sharedPublicURL is not an option.
Maybe download the file using url_private and upload it again to slack using files.upload? which seems crazy!
Or with some other method which lets me change shares part of file to "general" channel so everyone can see it, do we have such method?
{
files: [
{
id: '...',
...
user: '....',
editable: false,
mode: 'hosted',
is_external: false,
external_type: '',
is_public: false,
public_url_shared: false,
display_as_bot: false,
username: '',
url_private: 'https://files.slack.com/files-pri/.../file.png',
url_private_download: 'https://files.slack.com/files-pri/..../download/file.png',
....
permalink: 'https://myworkspace.slack.com/files/....png',
permalink_public: 'https://slack-files.com/...',
has_rich_preview: false,
file_access: 'visible'
"shares": {
"public": {
"C0T8SE4AU": [
{
...
"channel_name": "general", //<<<<<<means everyone? is this possible?
...
}
]
}
},
}
]..
}

Related

Youtube upload API : Videos automatically private

I'm using the Youtube API to upload videos.
The videos are uploaded public, but after the upload, they automatically changed to Private.
I've done the approval from the developer console, so the youtube.upload scope has been approved already. I'm only using the scope to upload and nothing else.
Any ideas ? I tried to contact the support, but no luck :(
Edit:
My application has been verified:
And I have the correct scope:
And the code:
let oauth = Youtube.authenticate({
type: "oauth",
client_id:
"client",
client_secret: "secret",
redirect_url: "redirect",
});
oauth.setCredentials(token);
Youtube.videos.insert(
{
resource: {
snippet: {
title: `blabla`,
description: `blabla`,
},
status: {
privacyStatus: "public",
madeForKids: true,
},
},
part: "snippet,status",
media: {
body: fs.createReadStream(`blabla.mp4`),
},
},
(err, data) => {
console.log("Done.");
}
);
Videos: insert
When your application is still in the testing phase and has not been verified by google yet all videos uploaded will be uploaded as private.
Once you have set your application to published and gone though the verification process you will then be abled to upload public videos.
YouTube API Services - Audit and Quota Extension Form
YouTube API Services Terms of Service
July 28, 2020
update
Audit is not verification, these are two different things. You need to apply for an audit. YouTube API Services - Audit and Quota Extension Form

Fastlane disable availability on Mac

I am trying to disable the availability of my apps on Mac when I deploy them with Fastlane.
I found this article enter link description here but I do not understand how to implement this.
I've got a lane that is responsible for creating a new app. So I don't use Spaceship at all here. How can implement this on my end?
Thank you
Here is a part of the Fastfile code:
conf = get_app_config(app)
update_user_credentials(conf)
name = conf.company_name
ios_meta = IosMetadata.new(conf)
ios_meta.deploy
puts "Screenshots: ##{ios_meta.screenshots_path}"
deliver(
force: true,
username: ENV["USERNAME"],
skip_binary_upload: false,
ipa: File.join(path_to_ipa),
app_icon: ios_meta.icon_path,
app_version: options[:app_version],
app_identifier: conf.app_identifier,
screenshots_path: ios_meta.screenshots_path,
overwrite_screenshots: true,
metadata_path: ios_meta.metadata_path,
ignore_language_directory_validation: true,
submit_for_review: true,
automatic_release: true,
submission_information: {
add_id_info_uses_idfa: true,
add_id_info_limits_tracking: true,
add_id_info_tracks_install: true,
add_id_info_serves_ads: false,
export_compliance_uses_encryption: false,
export_compliance_encryption_updated: false,
export_compliance_compliance_required: true,
content_rights_contains_third_party_content: false,
content_rights_has_rights: false
},
team_name: conf.team_name,
team_id: conf.itc_team_id
)
Any implementation of is_opted_in_to_distribute_ios_app_on_mac_app_store I tried inside this code brought errors of type "Unknown property"

Cannot fire Bigcommerce webhooks

so far I've managed to create two webhooks by using their official gem (https://github.com/bigcommerce/bigcommerce-api-ruby) with the following events:
store/order/statusUpdated
store/app/uninstalled
The destination URL is a localhost tunnel managed by ngrok (the https) version.
status_update_hook = Bigcommerce::Webhook.create(connection: connection, headers: { is_active: true }, scope: 'store/order/statusUpdated', destination: 'https://myapp.ngrok.io/bigcommerce/notifications')
uninstall_hook = Bigcommerce::Webhook.create(connection: connection, headers: { is_active: true }, scope: 'store/app/uninstalled', destination: 'https://myapp.ngrok.io/bigcommerce/notifications')
The webhooks seems to be active and correctly created as I can retrieve and list them.
Bigcommerce::Webhook.all(connection:connection)
I manually created an order in my store dashboard but no matter to which state or how many states I change it, no notification is fired. Am I missing something?
The exception that I'm seeing in the logs is:
ExceptionMessage: true is not a valid header value
The "is-active" flag should be sent as part of the request body--your headers, if you choose to include them, would be an arbitrary key value pair that you can check at runtime to verify the hook's origin.
Here's an example request body:
{
"scope": "store/order/*",
"headers": {
"X-Custom-Auth-Header": "{secret_auth_password}"
},
"destination": "https://app.example.com/orders",
"is_active": true
}
Hope this helps!

CKEditor 'Send it to the server' button is invisible

Experiencing strange behaviour with CKEditor. I have everything set up and I can upload images just fine. But the only problem I have is that I cannot see the 'Send it to the server' button in the upload form. I know it's there because if I hover over the area it's supposed to be on, the alternative information reads 'Send it to the server'. Furthermore if I press the area, it will upload the photo:
I haven't edited any CSS files or tampered with the code except to include the upload script.
The image.js file reads:
{
id: 'Upload',
filebrowser: 'uploadButton',
label: editor.lang.image.upload,
elements: [
{
type: 'file',
id: 'upload',
label: editor.lang.image.btnUpload,
style: 'height:40px',
size: 38
},
{
type: 'fileButton',
id: 'uploadButton',
filebrowser: 'info:txtUrl',
label: editor.lang.image.btnUpload,
'for': [ 'Upload', 'upload' ]
}
]
}
The file input shows but not the button.
Turned out to be a custom skin I was using that didn't contain all the necessary classes.

raven - sentry + django = No servers configured, and sentry not installed. Cannot send message

I have a sentry server that works ok.
raven test <dnstoserver> -> Sending a test message... success!
I have a dev machine with django 1.3 and raven 1.93.
In the django project I have this:
setting.py:
SENTRY_KEY=<secretkey>
SENTRY_DNS=<dnstoserver>
INSTALLED_APPS = (
'bar',
'foo',
'raven.contrib.django',
)
LOGGING = {
'version': 1,
'disable_existing_loggers': True,
'root': {
'level': 'WARNING',
'handlers': ['sentry'],
},
'formatters': {
'verbose': {
'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'
},
},
'handlers': {
'sentry': {
'level': 'ERROR',
'class': 'raven.contrib.django.handlers.SentryHandler',
},
'console': {
'level': 'DEBUG',
'class': 'logging.StreamHandler',
'formatter': 'verbose'
}
},
'loggers': {
'django.db.backends': {
'level': 'ERROR',
'handlers': ['console'],
'propagate': False,
},
'raven': {
'level': 'DEBUG',
'handlers': ['console', 'sentry'],
'propagate': False,
},
},
}
Mind the absence of 'sentry' in the installed_apps. This is intentionally, since sentry is the server and should not be on a client!
views.py (in a view):
import logging
logger = logging.getLogger("raven")
logger.error("test")
When I run the view I get on the console:
No servers configured, and sentry not installed. Cannot send message
Why, and how to fix?
Were you really setting SENTRY_DNS or SENTRY_DSN?
When you set SENTRY_DSN the instantiation of the major config variables happens automatically (including SENTRY_SERVERS, SENTRY_PUBLIC_KEY, SENTRY_SECRET_KEY, and SENTRY_PROJECT)
The problem was in the construction of the raven DjangoClient. It did not get passed any servers, and couldn't find sentry config to steal that config from.
I added in the settings.py:
SENTRY_SERVERS=<dnstoserver>
Console now outputs this every time raven is called:
INFO 2012-06-21 05:33:19,831 base 4323 140735075462336 Configuring Raven for host: <dnstoserver>
But it works like a charm! Messages in sentry...
BTW. for all the undocumented settings take a look in raven.contrib.django.models.get_client()
I suggest to use:
SENTRY_DSN = 'http://user:password#<domain>:<port>/<project_id>'
And in APPS_INSTALLED add:
'raven.contrib.django.raven_compat'
Also take a look at this guide:
http://code.fetzig.at/post/18607051916/sentry-and-raven-setup-for-django-projects

Resources