ipfspics / ipfspics-server Goto Github PK
View Code? Open in Web Editor NEWContent-addressable, peer-to-peer method of storing and sharing images on the internet.
Home Page: https://ipfs.pics
License: GNU Affero General Public License v3.0
Content-addressable, peer-to-peer method of storing and sharing images on the internet.
Home Page: https://ipfs.pics
License: GNU Affero General Public License v3.0
This needs to be TLS (SSL)/ HTTPS. At the very least, set up a self-signed cert on your server and get a CloudFlare account with SSL. All generated URLs should be https URLs too to avoid potentially breaking any site that the images are embedded in.
Sometimes (when using the random feature) the loading wont stop. I suppose the PHP application is waiting for IPFS. At least when the random feature is used, I think it would make sense to have a shorter timeout. There doesn't seem to be any timeout builtin the ipfs command line client, so the easiest way to implement this right now would probably be in the curl-request.
Seems there are some possibilities for people to do injections.
https://github.com/ipfspics/server/blob/master/preview.php#L21
$hash is coming directly from $_GET
which is no good.
At least this isn't loading along with many other images i've uploaded in the past:
https://ipfs.pics/ipfs/QmTbifDGSNx5Gu1XjbWTa8G1JR5m1PTc63cnU5FT9JzWvU
Unable to load the same image directly from IPFS either:
gareth@skynet:~/Downloads/go-ipfs$ ipfs cat /ipfs/QmTbifDGSNx5Gu1XjbWTa8G1JR5m1PTc63cnU5FT9JzWvU
Error: merkledag: not found
so we can peer host it like how glop.me does
(sorry if my request is too vague)
i just git clone to the local server base on centos7.2,
then what to do next.
Instead of having to save a file with the image and then uploading, would be nice if you supported just pasting an image directly into the website.
There are some console.log
statements in index.php
. I think they can break IE so it might be best to remove them.
I've quickly looked over the code for some minutes and got limited code execution on your server, please have a look at https://secure.php.net/manual/en/function.escapeshellarg.php and some best practises in general.
I get an error while trying to access ipfs.pics with Firefox Developer Edition on Android 10.
Secure Connection Failed
An error occurred during a connection to ipfs.pics. Cannot communicate securely with peer: no common encryption algorithm(s). Error code:
SSL_ERROR_NO_CYPHER_OVERLAP
- The page you are trying to view cannot be shown because the authenticity of the received data could not be verified.
- Please contact the website owners to inform them of this problem.
Try again
Chrome Canary on Android 10 gives a similar error.
This site can't provide a secure connection
ipfs.pics uses an unsupported protocol.
ERR_SSL_VERSION_OR_CIPHER_MISMATCH
ipfs.pics should automatically detect if our ipfs node is down, and then try to load images from ipfs.io.
Html5 offline apis could be also used.
PNG files don't display.
http://ipfs.pics/QmahoGMbbawakfazHfCaFYsVhGkkMPqMYQcTiqe5HxYbBE
I wanted to play around with this project so I tried deploying it in a separate VM running docker & docker-compose. When I go to the page it loads the ipfspics homepage(without any of the logos). Later when I try to upload a picture it gives me HTTP Error 500. I also tried deploying to heroku which gives me the same result.
This is the Log on startup:
WARNING: The IPFSPICS_DB variable is not set. Defaulting to a blank string. Starting mongo ... done Starting ipfs ... done Starting web ... done Attaching to ipfs, mongo, web ipfs | Changing user to ipfs ipfs | ipfs version 0.4.17 ipfs | Found IPFS fs-repo at /data/ipfs ipfs | Initializing daemon... ipfs | Swarm listening on /ip4/127.0.0.1/tcp/4001 ipfs | Swarm listening on /ip4/172.18.0.2/tcp/4001 ipfs | Swarm listening on /p2p-circuit/ipfs/QmeJpcfafqn4CqFu5pu7SrFT9ggD1VvAFzvHBGh9XVufc4 ipfs | Swarm announcing /ip4/127.0.0.1/tcp/4001 ipfs | Swarm announcing /ip4/172.18.0.2/tcp/4001 ipfs | API server listening on /ip4/0.0.0.0/tcp/5001 ipfs | Gateway (readonly) server listening on /ip4/0.0.0.0/tcp/8080 ipfs | Daemon is ready mongo | 2018-10-18T11:56:54.210+0000 I CONTROL [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none' mongo | 2018-10-18T11:56:54.238+0000 I CONTROL [initandlisten] MongoDB starting : pid=1 port=27017 dbpath=/data/db 64-bit host=81f455b0391f mongo | 2018-10-18T11:56:54.238+0000 I CONTROL [initandlisten] db version v4.0.3 mongo | 2018-10-18T11:56:54.238+0000 I CONTROL [initandlisten] git version: 7ea530946fa7880364d88c8d8b6026bbc9ffa48c mongo | 2018-10-18T11:56:54.238+0000 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.2g 1 Mar 2016 mongo | 2018-10-18T11:56:54.238+0000 I CONTROL [initandlisten] allocator: tcmalloc mongo | 2018-10-18T11:56:54.238+0000 I CONTROL [initandlisten] modules: none mongo | 2018-10-18T11:56:54.238+0000 I CONTROL [initandlisten] build environment: mongo | 2018-10-18T11:56:54.238+0000 I CONTROL [initandlisten] distmod: ubuntu1604 mongo | 2018-10-18T11:56:54.238+0000 I CONTROL [initandlisten] distarch: x86_64 mongo | 2018-10-18T11:56:54.238+0000 I CONTROL [initandlisten] target_arch: x86_64 mongo | 2018-10-18T11:56:54.238+0000 I CONTROL [initandlisten] options: { net: { bindIpAll: true } } mongo | 2018-10-18T11:56:54.267+0000 I STORAGE [initandlisten] Detected data files in /data/db created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'. mongo | 2018-10-18T11:56:54.267+0000 I STORAGE [initandlisten] mongo | 2018-10-18T11:56:54.267+0000 I STORAGE [initandlisten] ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine mongo | 2018-10-18T11:56:54.267+0000 I STORAGE [initandlisten] ** See http://dochub.mongodb.org/core/prodnotes-filesystem mongo | 2018-10-18T11:56:54.267+0000 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=256M,session_max=20000,eviction=(threads_min=4,threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),statistics_log=(wait=0),verbose=(recovery_progress), web | AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.18.0.4. Set the 'ServerName' directive globally to suppress this message web | AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.18.0.4. Set the 'ServerName' directive globally to suppress this message mongo | 2018-10-18T11:56:56.361+0000 I STORAGE [initandlisten] WiredTiger message [1539863816:361874][1:0x7f3a35db4a00], txn-recover: Main recovery loop: starting at 4/7168 web | [Thu Oct 18 14:56:56.387319 2018] [core:warn] [pid 7] AH00098: pid file /var/run/apache2/apache2.pid overwritten -- Unclean shutdown of previous Apache run? web | [Thu Oct 18 14:56:56.445193 2018] [mpm_prefork:notice] [pid 7] AH00163: Apache/2.4.29 (Ubuntu) configured -- resuming normal operations web | [Thu Oct 18 14:56:56.453101 2018] [core:notice] [pid 7] AH00094: Command line: '/usr/sbin/apache2 -D FOREGROUND' mongo | 2018-10-18T11:56:56.653+0000 I STORAGE [initandlisten] WiredTiger message [1539863816:653330][1:0x7f3a35db4a00], txn-recover: Recovering log 4 through 5 mongo | 2018-10-18T11:56:57.465+0000 I STORAGE [initandlisten] WiredTiger message [1539863817:465623][1:0x7f3a35db4a00], txn-recover: Recovering log 5 through 5 mongo | 2018-10-18T11:56:57.589+0000 I STORAGE [initandlisten] WiredTiger message [1539863817:589187][1:0x7f3a35db4a00], txn-recover: Set global recovery timestamp: 0 mongo | 2018-10-18T11:56:58.370+0000 I RECOVERY [initandlisten] WiredTiger recoveryTimestamp. Ts: Timestamp(0, 0) mongo | 2018-10-18T11:56:58.473+0000 I CONTROL [initandlisten] mongo | 2018-10-18T11:56:58.474+0000 I CONTROL [initandlisten] ** WARNING: Access control is not enabled for the database. mongo | 2018-10-18T11:56:58.476+0000 I CONTROL [initandlisten] ** Read and write access to data and configuration is unrestricted. mongo | 2018-10-18T11:56:58.477+0000 I CONTROL [initandlisten] mongo | 2018-10-18T11:56:58.478+0000 W CONTROL [initandlisten] mongo | 2018-10-18T11:56:58.479+0000 W CONTROL [initandlisten] mongo | 2018-10-18T11:56:58.479+0000 I CONTROL [initandlisten] mongo | 2018-10-18T11:56:58.579+0000 I FTDC [initandlisten] Initializing full-time diagnostic data capture with directory '/data/db/diagnostic.data' mongo | 2018-10-18T11:56:58.643+0000 I NETWORK [initandlisten] waiting for connections on port 27017
This gets added to that when I access the page and try to upload a photo:
web | 192.168.2.119 - - [18/Oct/2018:14:58:24 +0300] "GET / HTTP/1.1" 200 2485 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36" web | 192.168.2.119 - - [18/Oct/2018:14:58:24 +0300] "GET /cover.css HTTP/1.1" 404 504 "http://192.168.2.128:5000/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36" web | 192.168.2.119 - - [18/Oct/2018:14:58:25 +0300] "GET /static/common.js HTTP/1.1" 200 1483 "http://192.168.2.128:5000/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36" web | 192.168.2.119 - - [18/Oct/2018:14:58:25 +0300] "GET /static/cover.css HTTP/1.1" 200 2913 "http://192.168.2.128:5000/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36" web | [Thu Oct 18 14:58:25.133493 2018] [php7:error] [pid 12] [client 192.168.2.119:63926] PHP Fatal error: Uncaught MongoDB\\Driver\\Exception\\ConnectionTimeoutException: No suitable servers found (
serverSelectionTryOnce set): [connection refused calling ismaster on 'localhost:27017'] in /var/www/html/vendor/mongodb/mongodb/src/Collection.php:645\nStack trace:\n#0 /var/www/html/vendor/mongodb/mongodb/src/Collection.php(645): MongoDB\\Driver\\Manager->selectServer(Object(MongoDB\\Driver\\ReadPreference))\n#1 /var/www/html/app/picture.php(48): MongoDB\\Collection->findOne(Array)\n#2 {main}\n thrown in /var/www/html/vendor/mongodb/mongodb/src/Collection.php on line 645, referer: http://192.168.2.128:5000/ web | [Thu Oct 18 14:58:25.134864 2018] [php7:error] [pid 10] [client 192.168.2.119:63925] PHP Fatal error: Uncaught MongoDB\\Driver\\Exception\\ConnectionTimeoutException: No suitable servers found (
serverSelectionTryOnce set): [connection refused calling ismaster on 'localhost:27017'] in /var/www/html/vendor/mongodb/mongodb/src/Collection.php:645\nStack trace:\n#0 /var/www/html/vendor/mongodb/mongodb/src/Collection.php(645): MongoDB\\Driver\\Manager->selectServer(Object(MongoDB\\Driver\\ReadPreference))\n#1 /var/www/html/app/picture.php(48): MongoDB\\Collection->findOne(Array)\n#2 {main}\n thrown in /var/www/html/vendor/mongodb/mongodb/src/Collection.php on line 645, referer: http://192.168.2.128:5000/ web | 192.168.2.119 - - [18/Oct/2018:14:58:25 +0300] "GET /ipfs/QmdixSJTJWUFuxctcRtHfrxqUqVKcrpyrWjFoojFSZkTZL HTTP/1.1" 500 185 "http://192.168.2.128:5000/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36" web | 192.168.2.119 - - [18/Oct/2018:14:58:25 +0300] "GET /ipfs/QmNvuHJbTHafrABhitFcQ5srv7FeCfHr6jFiyoHhuRh8wK HTTP/1.1" 500 185 "http://192.168.2.128:5000/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36" web | [Thu Oct 18 14:58:26.034115 2018] [php7:error] [pid 9] [client 192.168.2.119:63923] PHP Fatal error: Uncaught MongoDB\\Driver\\Exception\\ConnectionTimeoutException: No suitable servers found (
serverSelectionTryOnce set): [connection refused calling ismaster on 'localhost:27017'] in /var/www/html/vendor/mongodb/mongodb/src/Collection.php:645\nStack trace:\n#0 /var/www/html/vendor/mongodb/mongodb/src/Collection.php(645): MongoDB\\Driver\\Manager->selectServer(Object(MongoDB\\Driver\\ReadPreference))\n#1 /var/www/html/app/picture.php(48): MongoDB\\Collection->findOne(Array)\n#2 {main}\n thrown in /var/www/html/vendor/mongodb/mongodb/src/Collection.php on line 645, referer: http://192.168.2.128:5000/ web | 192.168.2.119 - - [18/Oct/2018:14:58:26 +0300] "GET /ipfs/Qmduj4VjKMMWRLwxcrHugxCTWD1cZ66iiKTeW2JGRZtY9u HTTP/1.1" 500 185 "http://192.168.2.128:5000/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36" web | 192.168.2.119 - - [18/Oct/2018:14:58:26 +0300] "GET /cover.css HTTP/1.1" 404 504 "http://192.168.2.128:5000/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36" web | [Thu Oct 18 14:58:38.620063 2018] [php7:error] [pid 11] [client 192.168.2.119:63936] PHP Fatal error: Uncaught MongoDB\\Driver\\Exception\\ConnectionTimeoutException: No suitable servers found (
serverSelectionTryOnce` set): [connection refused calling ismaster on 'localhost:27017'] in /var/www/html/vendor/mongodb/mongodb/src/Collection.php:645\nStack trace:\n#0 /var/www/html/vendor/mongodb/mongodb/src/Collection.php(645): MongoDB\Driver\Manager->selectServer(Object(MongoDB\Driver\ReadPreference))\n#1 /var/www/html/app/picture.php(48): MongoDB\Collection->findOne(Array)\n#2 {main}\n thrown in /var/www/html/vendor/mongodb/mongodb/src/Collection.php on line 645, referer: http://192.168.2.128:5000/
web | 192.168.2.119 - - [18/Oct/2018:14:58:38 +0300] "GET /ipfs/QmPYVGMVjPSkz6bQaAFChBtigMb4WPGC922tLsZcAe3wvN HTTP/1.1" 500 185 "http://192.168.2.128:5000/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36"
web | 192.168.2.119 - - [18/Oct/2018:14:58:38 +0300] "POST /upload.php HTTP/1.1" 302 294 "http://192.168.2.128:5000/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36"
web | 192.168.2.119 - - [18/Oct/2018:14:58:38 +0300] "GET /QmW3FgNGeD46kHEryFUw1ftEUqRw254WkKxYeKaouz7DJA HTTP/1.1" 500 185 "http://192.168.2.128:5000/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36"
`
Does anyone know of a way to get this project running for me? I think it's pretty cool and would love to explore it further.
Right now, every upload is stored localy in a cookie, but only the last upload is shown. It would be nice to detect if someone has already uploaded stuff, and then show a "last uploads" tab.
r
- randomLooooove the random feature. addicting :) ❤️
Can you add something like we can add more than just upload one image per go ?
would be nice if ipfs.pics supported full IPFS paths, like http://ipfs.pics/ipfs/QmfXQeLt1mUvm1goR2W8PtXTKro8Jaor6iBMjy8EtoeQAi/cap.png
Posts to reddit should have a correct thumbnail that can expand to the full image with reddit/RES
Image pages should perhaps include linkbacks to the reddit comments for the post.
When trying to view a screencast, it shows the video as a broken picture.
https://ipfs.pics/QmVR1vgRiXeq9PsYz62TSvH3ngUX4obVLasKbfEDXnvsFD
Even when linked directly, it sets the mime type wrong. It shows 'document' in Chrome Network tab, and the header says 'Content-Type:image/png'.
https://ipfs.pics/ipfs/QmVR1vgRiXeq9PsYz62TSvH3ngUX4obVLasKbfEDXnvsFD
I uploaded through ipfs.pics fine and it downloads fine, if I save it with the right extension.
Allow users to group images into album such as in Imgur
@victorbjelkholm has suggested to store database credentials in the environment in #17. It could be implemented this way.
We could use this: http://tobiasahlin.com/spinkit/
Can't use any functionality, database seems to be down and it's also outputting the database credentials upon failure.
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111)' in /var/www/html/upload.php:34 Stack trace: #0 /var/www/html/upload.php(34): PDO->__construct('mysql:host=loca...', 'root', 'Patate12345') #1 {main} thrown in /var/www/html/upload.php on line 34
The basic of the API are already there and working:
I'd like to make an API for @didiercf's upcoming backup application, instead of using MySQL directly:
Same thing for the current administration application:
Maybe we could merge in the database the admnistration in the vote table. Ex: a vote by admin_1 of type ban for $hash. It would be more scalable if we add more admninistrators with different priority and maybe different optional type of votes (ex: voting "notInteresting" to remove it from the random feature).
I also want to make the upload smarter:
I'll update this post as things get implemented.
Need to a write query that would advantage the pictures with the most upvotes in the random feature without making them the exclusive content shown.
ipfs.pics should have a status page at https://ipfs.pics/status which contains:
When can webm be supported?
the official ipfs gateway now supports https://ipfs.io/ipfs/...
paths
Tracking issue for new folder structure as discussed in #17 .
RE: This image:
https://ipfs.pics/QmYdhAHrNLztvv9JfnKbG73obetpDZubzqowbbTjwqvBxk
That is the url that was given to me after I uploaded that image, but when using that url in markdown, it is broken. The absolute path is here, and this is what should be given (IMO) to the user:
https://ipfs.pics/ipfs/QmYdhAHrNLztvv9JfnKbG73obetpDZubzqowbbTjwqvBxk
ipfs was updated to v0.4 recently. (https://ipfs.io/blog/14-ipfs-0-4-0-released)
ipfs.pics seams to run an old version... yet :)
Running ipfs version 0.3.10
Different users can add the same image twice or more, isn't it going to be problem? How about we compare the uploading image with other images that are already uploaded to the IPFS?
Currently users can up or down vote multiple times, to the point of negative votes. I down voted a picture to -127 in my test. This should be addressed so users can only vote up or down once.
Seems like this file is not referenced anywhere, can be removed right?
Users visiting the repo should have a one click button to deploy ipfs.pics. Heroku has this as an API and here is the documentation: https://devcenter.heroku.com/articles/heroku-button
https://github.com/honestbleeps/Reddit-Enhancement-Suite/
ipfs.pics should be an integrated image host.
I can go here https://ipfs.pics/ and then click on random, trending and best but all I get is a white screen, no pictures show. It just started doing this day or two ago. I also tried to upload and image and I got the white screen again.
The project's website, ipfs.pics, shows an error.
Right now ipfs.pics uses Google adsense to allow server maintainers to pay for their hosting and their code development. It has the advantage of being quick to set-up and maintenance-free, but its tracking is not something I wish to impose on our users. The current compromise - making sure everything works well under adBlock to those who wish to opt-out of advertising - feels like a bad compromise.
Our advertising code should also allow us to replace ads with protips from time to time (like keyboard shortcuts or why ipfs is cool in the first place), run pro bono ads for Firefox for our IE and chrome users and pro bono ads for charities when major catastrophes occur.
We can run those on our nsfw posts for now, while we scale this, and replace adSense with this when it will scales well.
Some idea of things we can run as ads:
The current uploader looks like it's supposed to support drag and drop but currently does not.
I would really really really like to see CORS support enabled. After all, what's the point of a globally persistent image store if it can't even be accessed from browser based JS?
Let me know if you want me to start on a pull request.
Something that is missing is how to install this on your own machine. Would be good to have in the readme.
Also, as a part of the installation instructions, there is no way to easily recreate the database.
Add a Docker file for getting the app and running quickly.
That automatically mirrors images from imgur to ipfs.pics. And posts a link in the thread comments.
hi,
i think the repo name should be prefixed with a "ipfspics-" or something.
Hey guys!
I was reading through a bit of code, and I think you guys would be better off using the javascript ipfs api bindings instead of calling a fairly costly exec. Could probably speed things up a bit for you (as well as be safer than calling exec).
If you need any help integrating that feel free to ping us in irc or here!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.