Comments (5)
Hi @cameronwilby, there a feature, i lack to explain on a tutorial to create your own mirror, next few days i fixed this problem.
The mirror creation save all data as .gz to save disk space, you need to enable reverse gz decode when a client ask for the decompressed version.
To do this, change you nginx configuration of gzip_static and gunzip as is:
server {
index.html;
server_name packagist.com.br www.packagist.com.br;
location / {
try_files $uri $uri/ =404;
gzip_static on;
gunzip on;
}
}
Source:
http://nginx.org/en/docs/http/ngx_http_gunzip_module.html
http://nginx.org/en/docs/http/ngx_http_gzip_static_module.html
from packagist-mirror.
This is the output I get:
Composer version 1.6.5 2018-05-04 11:44:59
[Seld\JsonLint\ParsingException]
"" does not contain valid JSON
Parse error on line 1:
composer
^
Expected one of: 'STRING', 'NUMBER', 'NULL', 'TRUE', 'FALSE', '{', '['
config [-g|--global] [-e|--editor] [-a|--auth] [--unset] [-l|--list] [-f|--file FILE] [--absolute] [--] [<setting-key>] [<setting-value>]...```
from packagist-mirror.
@webysther that did the trick, thank you! Here is the nginx config I ended up with:
server {
listen 80;
listen [::]:80;
root /var/www/html;
index index.php index.html index.htm;
server_name packagist.com.br;
location / {
try_files $uri $uri/ =404;
gzip_static on;
gunzip on;
}
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
}
listen [::]:443 ssl ipv6only=on
listen 443 ssl;
ssl_certificate /etc/letsencrypt/live/packagist.com.br/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/packagist.com.br/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
}
from packagist-mirror.
Great @cameronwilby! Another tip is using a machine with 2GB at least of memory. With that all metadata keep to the memory helping the nginx and disk to not be consumed.
from packagist-mirror.
Good to know, I went with the 2GB droplet on DigitalOcean 👍 Thanks again @webysther, awesome work.
from packagist-mirror.
Related Issues (20)
- Services lose get parameters after mirroring HOT 1
- Add FOSSA
- Update mirroring code to our official mirror code HOT 10
- support composer v2? HOT 1
- packagist.hostuj.to down HOT 1
- "do not match its signature" HOT 13
- Will it mirror zip files of packages? HOT 1
- A
- A
- Error - Impossible to create the root directory HOT 4
- Add support to Google Analytics HOT 1
- in progress HOT 1
- Not Downloading Meta information properly HOT 20
- Sync Packes More Frequent. HOT 3
- Build a miror behind a proxy HOT 4
- Warning: failed to open stream: Too many open file HOT 2
- composer install error HOT 3
- How I can use an internal domain ? HOT 13
- Extra dependencies?
- Drop PHP 7.1 support for next release
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from packagist-mirror.