forked from jvassev/image2ipfs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
62 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
server { | ||
listen 443; | ||
ssl on; | ||
ssl_certificate #HTTPS_CERT#; | ||
ssl_certificate_key #HTTPS_KEY#; | ||
ssl_session_timeout 5m; | ||
ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2; | ||
ssl_ciphers "HIGH:!aNULL:!MD5 or HIGH:!aNULL:!MD5:!3DES"; | ||
ssl_prefer_server_ciphers on; | ||
|
||
client_max_body_size 512M; | ||
|
||
include /locations.conf; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
location /v2 { | ||
# uwsgi over http to preserve all Accept headers | ||
# https://github.com/unbit/uwsgi/commit/8a032b41ec356f85104cc856922a18f4eee9b407 | ||
proxy_pass http://127.0.0.1:4444; | ||
} | ||
|
||
location ~ /ipfs/.*/latest-v2$ { | ||
include /proxy.conf; | ||
|
||
# override content-type set by gateway, must clear original value, | ||
# otherwise docker is confused | ||
proxy_hide_header Content-type; | ||
add_header Content-type application/vnd.docker.distribution.manifest.v2+json; | ||
} | ||
|
||
location ~ /ipfs/.*/latest-v1$ { | ||
include /proxy.conf; | ||
|
||
# override content-type set by gateway, must clear original value, | ||
# otherwise docker is confused | ||
proxy_hide_header Content-type; | ||
add_header Content-type application/vnd.docker.distribution.manifest.v1+prettyjws; | ||
} | ||
|
||
location /ipfs/ { | ||
include /proxy.conf; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,21 @@ | ||
#!/bin/bash | ||
|
||
IPFS=${IPFS_GATEWAY//https:\/\//} | ||
IPFS=${IPFS//http:\/\//} | ||
IPFS=${IPFS%%/} | ||
IPFS=${IPFS_GATEWAY%%/} | ||
|
||
# improvised templating engine | ||
sed -i "s|@IPFS@|$IPFS|g" /nginx.conf | ||
sed -i "s|#IPFS#|$IPFS|g" /proxy.conf | ||
cat /proxy.conf | ||
|
||
if [ x$HTTPS_CERT != 'x' ];then | ||
sed -i "s|#HTTPS#|include /https.conf;|g" /nginx.conf | ||
sed -i "s|#HTTPS_KEY#|$HTTPS_KEY|g" /https.conf | ||
sed -i "s|#HTTPS_CERT#|$HTTPS_CERT|g" /https.conf | ||
cat /https.conf | ||
fi | ||
|
||
cat /nginx.conf | ||
|
||
# TODO manage processes with upervisor | ||
# TODO manage processes with supervisor | ||
uwsgi --daemonize /var/log/uwsgi.log --ini /wsgi.conf | ||
|
||
nginx -c /nginx.conf -g "daemon off;" | ||
nginx -c /nginx.conf -g "daemon off;" |