How to browse user generated folder in Openshift? - openshift

I made new app with PHP and JS, some users already uploaded the images on generated folder, I wanted to explore their images were submitted, but I did git pull, it won't download images
http://canvasuploader-powerupware.rhcloud.com/
Generated folder is http://canvasuploader-powerupware.rhcloud.com/user_images and it displays Not found.
Actually there are some images are saved on this folder, so how to explore this folder in Openshift?

Anything your users upload to OpenShift will not be put into your git repository. You will need to save the images into your OPENSHIFT_DATA_DIR, and then create a symlink into your app-root/repo-runtime/php folder so that they will be web accessible if you need to display them. if you want to download them to your computer, you can use the scp command, or you can use the rhc snapshot save command.

Related

Git live preview HTML file does not working

I am working on the odin project and make my first html project, the first recipe project.
I have now finished it and upload it to my repo on github. If I want to see it with live preview the index.html page is working well. But if I click on a link at the index page it does not working.
Can u check my html file?
Or is it maybe that I have make failure with github workflow. I have changed/finished my coding on MS VisualStudio and then add the following statements in the terminal:
git add .
git commit -m "something"
git push origin main
My Repo:
https://github.com/ztrk-dev/odin-recipes/tree/main/recipes
You are hosting what Github Pages refers to as a Project site, which means the page is being hosted at "username.github.io/repository".
The reason the pages with images aren't loading as expected(if I'm misunderstanding the question let me know) is because they are linked as /images/spaghetti-napoli.jpeg, which is a relative file path for the file spaghetti-napoli.jpeg that is located in a folder "images" located in the root directory. The problem is that the root directory / isn't the base directory of your project site. /{repo-name}/ is (so that you could have many different projects with their own websites if you wanted to).
If you want the repository to be the root of your site, you'd need a User site, which would require a repository named ztrk-dev.github.io to host the projects files. If you'd rather use a project site, you would need to link the images as /{repo-name}/{path-to-file} instead of /{path-to-file}.
That is to say, /images/spaghetti-napoli.jpeg would become
/odin-recipes/images/spaghetti-napoli.jpeg or ../images/spaghetti-napoli.jpeg

Sharing workspace across multiple computers

I am trying to use phpStorm on 2 computers to work on a project that is synchronized through dropbox. From what I read it looks like concurrent use of a personal license on multiple computers is supported as of 2015. However, when I save files on each computer, it changes workspace.xml in the .idea folder. This throws the following error when I go to work on the other computer.
"Project Files Changed
Project components were changed externally and cannot be reloaded:
ToolWindowManager
Would you like to reload project?"
How can I fix this problem so I don't have to reload phpStorm every time I save a file?
Use git instead of dropbox and commit your changes excluding .idea project files to a branch before you leave one computer.
You could also try to exclude the .idea project files from the dropbox sync folder via symlinks to not have them synced.

Openshift: where to put resource files that I want outside of the deployment folder

I'm starting a new web app with Openshift (jboss, mysql). It's the first time I use openshift and after reading through some doc and experimenting a bit with it, I'm having one question regarding best practices for the architecture of my app.
There will be some files generated by- or uploaded to the application (resources). I'd like those files to be outside the deployment folder so they are not erased/overwritten when the app deploys again. I have browsed through the directories and I was wondering:
is it ok to use the /var/lib/openshift/[openshift-id]/app-root/data folder for these files?
Yes, you should use your ~/app-root/data folder for any files that you want to not be erased when you do a git push, there is also an environment variable that you can use that points to that folder called OPENSHIFT_DATA_DIR. Please note that if you are using a scaled application, that folder is not shared among your gears.

How can I stop "jekyll build" from overwriting existing files in the output directory?

The source for my Jekyll-powered website lives in a git repo, but the website also needs to have a couple large static files that are too large to go under version control. Thus, they are not part of the Jekyll build pipeline.
I would like for these to simply live in an assets directory in the Jekyll destination (which is a server directory; note that I don't have have any control over the server here; all I can do is dump static files into a designated directory) that does not exist in the git repo. But, running jekyll build deletes everything in the output directory.
Is there a way to change Jekyll's behavior in this case? Or is there some other good way to handle this issue?
Not sure this addresses the specific case in the OP, but seeing as how I kept getting to this page when I finally found an answer here, I thought I'd add an answer to this question in case it helps others.
I have a git post-hook that builds my jekyll site in my webhost when I push to my host, but it was also deleting anything else that I had FTP'ed over. So now I've put anything I need to stick around in a directory (external/ in my case), and added the following to my _config.yml:
exclude: [external]
keep_files: [external]
and now files in external/ survive.
If you upload Jekyll's output directory via FTP to your server, you can use a FTP tool that lets you ignore folders.
For example, my own site is built with Jekyll, but hosted on my own webspace, so I'm uploading it via FTP.
I explained in this answer how I scripted the building and uploading process, so I can update my site with a single click.
In my case (Windows), I used WinSCP, a free command-line FTP client, for this.
If you're not on Windows, you need to use something else, but there are probably other FTP tools out there that are able to ignore folders.
To ignore your assets folder in WinSCP, you just need to put this line into the script file:
(the file which contains the actual WinSCP commands - read my other answer for more information)
option exclude "assets/"
Now you can upload your large assets folder on the server once, and it won't be overwritten/deleted when you later update your site via FTP.

How to update OJS

Would you please let me know how to update OJS (Open Journal System). I have installed it on a shared server and I have no access to the shell, only a web interface and control panel (direct admin) is allowed. I think there must be some update button online, But i could not find it.
Thanks
Download and decompress the package from the OJS web site
Make a copy of the config.inc.php provided in the new package
Move or copy the following files and directories from your current OJS
installation:
config.inc.php
public/
Your uploaded files directory ("files_dir" in config.inc.php), if it
resides within your OJS directory
Replace the current OJS directory with the new OJS directory, moving the
old one to a safe location as a backup
Be sure to review the Configuration Changes section of the release notes
in docs/release-notes/README-(version) for all versions between your
original version and the new version. You may need to manually add
new items to your config.inc.php file.
The easiest thing would be to make a new folder on your shared hosts with the latest version. Copy over the config.ing.php, cache, and public folders. If your files is within your OJS folder as well, copy it too (though, you should move it outside the web accessible location).
Then you'll find an option to upgrade the database in the Admin pages.