Geeklog-Core / geeklog

Geeklog - The Secure CMS.
https://www.geeklog.net
25 stars 19 forks source link

MacOsX zip file cannot be uploaded #1100

Closed remyKobolski closed 2 years ago

remyKobolski commented 2 years ago

Having a plugin on my MacOsX, Uploading this plugin as a zip file shows no errors but the plugin is not recognised. Other symptoms:

  1. a _MACOS directory in system/data and in system/plugins.
  2. These _MACOS directories on the server contain an icon? file which I cannot delete. FreeBSD error.
  3. a plugin is present with the name of the zip file, NOT the plugin name. glossary-0.9.8.zip
eSilverStrike commented 2 years ago

The plugin shouldn't have those files in it and the plugin name shouldn't include the version number. Where did you get the zip file?

remyKobolski commented 2 years ago

The plugin shouldn't have those files in it

Well, it has those files in it and I can’t get rid of them. The file is created, obviously, on a iMac running MACOSX.

and the plugin name shouldn't include the version number.

That’s a easy misunderstanding. Plugins downloaded from Geeklog do contain their version number. There is none remark found, saying that the file name should be renamed. But okay, I’ll remember this.

Where did you get the zip file?

From my iMac. Zipping my development creates a “.icon?” for all directories and a “_MACOSX” directory that contains links to very files. names preceded by a period. It’s the way Apple handles their filesystems. The ‘.icon?’ file creates a problem on my install. Which, btw, I solved with some help of my server support. To overcome this, I need some windows guy, removing these files from my files? — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Geeklog-Core/geeklog/issues/1100#issuecomment-962439145, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHMY6ZC3EHUB3I2Y3LOFHNDUKUPDXANCNFSM5HO7ROSQ. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

eSilverStrike commented 2 years ago

Sorry I meant the plugin folder name in the zip file shouldn't contain the version number. That's probably why Geeklog has a problem displaying the name for it. It's been a while since I have handle this part of the plugin install code.

I also didn't realize this is a plugin you updated yourself.

Use the autotags plugin:

https://www.geeklog.net/downloads/index.php/file_autotags_plugin-1.1.3

as an example. It also contains the newer version of how Geeklog plugin install and updates are handled (by having files like autoinstall.php, etc... with additional information and checks)

I am not a Mac guy so I am not sure why unzipping these files would cause an issue with your host. I believe the files are marked hidden in the zip so maybe that is part of the problem? Maybe the files where some how when uploaded are set with a different FTP username than what the Web server has access to (this happened to me before on a host a few years ago where files I uploaded via FTP was not accessible by the webserver or where only read only).

I did do a quick search on Google on there are a few pages that explain how to get rid of those extra folders apple adds to zip files. maybe this will help?

https://perishablepress.com/remove-macosx-ds-store-zip-files-mac/

remyKobolski commented 2 years ago

I did resolve the problems. iMac creates by default resource forks per directory called ‘__MACOSX’. I found out how to remove them on my iMac. The real problem is caused by the ‘Icon?’ file, which contains a CR in its name. Basically, unzipping the plugin should not allow to extract such files: skip files that begin with a dot, have unprintable names, or contains characters like ‘<‘, ‘>’, ‘!’, ‘?’.

Thanks for support.

On 7. Nov 2021, at 14:59, Tom @.***> wrote:

Sorry I meant the plugin folder name in the zip file shouldn't contain the version number. That's probably why Geeklog has a problem displaying the name for it. It's been a while since I have handle this part of the plugin install code.

I also didn't realize this is a plugin you updated yourself.

Use the autotags plugin:

https://www.geeklog.net/downloads/index.php/file_autotags_plugin-1.1.3 https://www.geeklog.net/downloads/index.php/file_autotags_plugin-1.1.3 as an example. It also contains the newer version of how Geeklog plugin install and updates are handled (by having files like autoinstall.php, etc... with additional information and checks)

I am not a Mac guy so I am not sure why unzipping these files would cause an issue with your host. I believe the files are marked hidden in the zip so maybe that is part of the problem? Maybe the files where some how when uploaded are set with a different FTP username than what the Web server has access to (this happened to me before on a host a few years ago where files I uploaded via FTP was not accessible by the webserver or where only read only).

I did do a quick search on Google on there are a few pages that explain how to get rid of those extra folders apple adds to zip files. maybe this will help?

https://perishablepress.com/remove-macosx-ds-store-zip-files-mac/ https://perishablepress.com/remove-macosx-ds-store-zip-files-mac/ — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Geeklog-Core/geeklog/issues/1100#issuecomment-962615653, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHMY6ZDMCR76EQHQ5MAMZJLUK2A5ZANCNFSM5HO7ROSQ. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

eSilverStrike commented 2 years ago

This is part of Geeklog I have never touched so I only assuming things here at the moment before I have a chance to look into it. Geeklog may scan the zip files to determine the name of the plugin and other details but I know it doesn't scan things for example like all file names that are not compatible with the actual OS environment of the server. There are some assumptions on the part of Geeklog that the plugin zip file is supported by Geeklog itself and the hosting environment.

If we do implement such a feature, a scan would have to happen before hand (which could take a long time) and if an incompatible file is found in the zip we would just prevent the plugin from being installed as we have no way to determine if the file is required by the plugin and if it is that it would take down the website if it doesn't exist on the server.

By the way we did run into similar issues a while ago with user images and Linux and Windows environments when migrating a website to a different host. See #1002

I am going to close this issue and open one that describes the problem more specifically. You can add to the issue comments if you think I missed anything.

eSilverStrike commented 2 years ago

Open issue #1101