Failure unpacking several plugins

Following up on this issue. I reinstalled OpenDeck on my laptop where most plugins fail to install. Same issue. Went back one version. Same issue. I went to the site you mentioned, I can see all the plugins. I downloaded the spotify by hand and unzipped it in .config/com..../plugins, but on restarting opendeck it doesn't see the unpacked plugin. Possibly I have to add it to some registry by hand? Anything else I can do to help debug this issue?
18 Replies
thomasvs
thomasvsOP4mo ago
new user, so far working well, excited that I can now control homeassistant on linux with my streamdeck there are a lot of elgato plugins that don't seem to work or trigger an error when trying to install - is this expected? any recommendations for useful plugins on linux from the official repo? thomasvs — 08/06/2024 10:00 PM In particular, getting a lot of Failed to unzip file: Zip(InvalidArchive("No valid central directory found")) (for example, both spotify plugins) recommendation: add the full url being downloaded to the log, and maybe md5sum the downloaded zip file so there's a way to see if the download was correct.
ninjadev64
ninjadev644mo ago
so it's like ~/.config/com.amansprojects.opendeck/plugins/com.barraider.spotify.sdPlugin/, and inside there is a manifest.json?
thomasvs
thomasvsOP4mo ago
the elgato one. thomasvs@thomasvsl9b:~/.config/com.amansprojects.opendeck$ ls plugins/com.elgato.spotify.sdPlugin/ de.json es.json Images ko.json propertyinspector Spotify en.json fr.json ja.json manifest.json Scripts zh_CN.json thomasvs@thomasvsl9b:~/.config/com.amansprojects.opendeck$
ninjadev64
ninjadev644mo ago
the Elgato plugin is Mac-only it uses AppleScript to control Spotify
thomasvs
thomasvsOP4mo ago
ah, ok but on my work machine it at least registered the plugin and allowed me to drag to the buttons huh, this is odd $ wget https://plugins.amansprojects.com/rezipped/com.barraider.spotify.zip --2024-08-08 10:57:40-- https://plugins.amansprojects.com/rezipped/com.barraider.spotify.zip Resolving plugins.amansprojects.com (plugins.amansprojects.com)... 172.67.158.189, 104.21.57.26, 2606:4700:3036::6815:391a, ... Connecting to plugins.amansprojects.com (plugins.amansprojects.com)|172.67.158.189|:443... connected. HTTP request sent, awaiting response... 403 Forbidden 2024-08-08 10:57:40 ERROR 403: Forbidden. downloading directly with curl gives forbidden. from the browser, it works fine. going to try that from the work desktop
ninjadev64
ninjadev644mo ago
weird? this whole Elgato App Store archive thing is a very hastily put together operation it uses a handful of node.js scripts I wrote to download all of the plugins, and then https://plugins.amansprojects.com is an instance of simple-http-server running on my raspberry pi 😅 now appstore.elgato.com doesn't even exist and the whole thing has been taken down, so this is the last remaining archive of all the plugins
thomasvs
thomasvsOP4mo ago
oh wow 😉 does it run any kind of firewall that might be blocking my curl requests? unzipped barraider spotify by hand, restarted opendeck, same issue, plugin not available. Then I downloaded through opendeck one of your plugins, which triggered a plugin registry rebuild, and now both spotify plugins show up. [11:02 AM] recommendation: rescan plugin directory on startup?
ninjadev64
ninjadev644mo ago
that's pretty weird, seeing as you used to have to restart OpenDeck after installing/uninstalling plugins, nothing special happens, it reads all plugins at startup
thomasvs
thomasvsOP4mo ago
do you want a github issue for this with steps to reproduce?
ninjadev64
ninjadev644mo ago
/// Initialise plugins from the plugins directory.
pub fn initialise_plugins(app: AppHandle) {
tokio::spawn(init_websocket_server());
tokio::spawn(webserver::init_webserver(app.path_resolver().app_config_dir().unwrap()));

let plugin_dir = app.path_resolver().app_config_dir().unwrap().join("plugins");
let _ = fs::create_dir_all(&plugin_dir);
let _ = fs::create_dir_all(app.path_resolver().app_config_dir().unwrap().join("logs").join("plugins"));

let entries = match fs::read_dir(&plugin_dir) {
Ok(p) => p,
Err(error) => {
error!("Failed to read plugins directory at {}: {}", plugin_dir.display(), error);
panic!()
}
};

// Iterate through all directory entries in the plugins folder and initialise them as plugins if appropriate
for entry in entries {
if let Ok(entry) = entry {
let path = match entry.metadata().unwrap().is_symlink() {
true => fs::read_link(entry.path()).unwrap(),
false => entry.path(),
};
let metadata = fs::metadata(&path).unwrap();
if metadata.is_dir() {
tokio::spawn(async move {
if let Err(error) = initialise_plugin(&path).await {
warn!("Failed to initialise plugin at {}: {}", path.display(), error);
}
});
} else {
warn!("Failed to initialise plugin at {}: is a file", entry.path().display());
}
} else if let Err(error) = entry {
warn!("Failed to read entry of plugins directory: {}", error)
}
}
}
/// Initialise plugins from the plugins directory.
pub fn initialise_plugins(app: AppHandle) {
tokio::spawn(init_websocket_server());
tokio::spawn(webserver::init_webserver(app.path_resolver().app_config_dir().unwrap()));

let plugin_dir = app.path_resolver().app_config_dir().unwrap().join("plugins");
let _ = fs::create_dir_all(&plugin_dir);
let _ = fs::create_dir_all(app.path_resolver().app_config_dir().unwrap().join("logs").join("plugins"));

let entries = match fs::read_dir(&plugin_dir) {
Ok(p) => p,
Err(error) => {
error!("Failed to read plugins directory at {}: {}", plugin_dir.display(), error);
panic!()
}
};

// Iterate through all directory entries in the plugins folder and initialise them as plugins if appropriate
for entry in entries {
if let Ok(entry) = entry {
let path = match entry.metadata().unwrap().is_symlink() {
true => fs::read_link(entry.path()).unwrap(),
false => entry.path(),
};
let metadata = fs::metadata(&path).unwrap();
if metadata.is_dir() {
tokio::spawn(async move {
if let Err(error) = initialise_plugin(&path).await {
warn!("Failed to initialise plugin at {}: {}", path.display(), error);
}
});
} else {
warn!("Failed to initialise plugin at {}: is a file", entry.path().display());
}
} else if let Err(error) = entry {
warn!("Failed to read entry of plugins directory: {}", error)
}
}
}
ehhhh this really doesnt feel like something that should be happening at all, i feel like something else is involved
thomasvs
thomasvsOP4mo ago
my rust isn't great but yeah that looks like it would go over all plugin directories
ninjadev64
ninjadev644mo ago
as I said, you used to have to relaunch when installing before I implemented hot-installing, nothing special happens nope
thomasvs
thomasvsOP4mo ago
looks like there's cloudflare in front of your raspberry pi?
thomasvs
thomasvsOP4mo ago
Pastebin
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
thomasvs
thomasvsOP4mo ago
curl errors out too lynx works wonder if cloudflare is doing user agent filtering yeah - this downloads the zip: wget --debug -U Firefox https://plugins.amansprojects.com/rezipped/com.barraider.spotify.zip I don't know what agent downloads plugins under the hood
ninjadev64
ninjadev644mo ago
yep, it's accessed through a CF tunnel huh
thomasvs
thomasvsOP4mo ago
wonder if maybe on cloudflare's admin site there's a block list of user agents?
ninjadev64
ninjadev644mo ago
cf-mitigated: challenge seems like it's trying to serve you a CAPTCHA when you don't use a browser user agent
Want results from more Discord servers?
Add your server