Skip to content

Commit

Permalink
Private packgist:
Browse files Browse the repository at this point in the history
- Symfony 3.4 LTS Upgrade
- remove HWIOBundle, NelmioCorsBundle, NelmioSecurityBundle
- don't delete package if github return 404
- disallow robots.txt
- do not replace ssh on https for github repository
- other fixes
  • Loading branch information
vtsykun committed Aug 27, 2018
1 parent 0e933ff commit f3e5856
Show file tree
Hide file tree
Showing 81 changed files with 2,795 additions and 3,273 deletions.
49 changes: 31 additions & 18 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,18 +1,31 @@
web/bundles/
web/packages*.json
web/providers-*.json
web/p/
app/config/parameters.yml
app/bootstrap*
app/cache/*
app/logs/*
bin/
build/
vendor/
/.settings
/.buildpath
/.project
/.idea
composer.phar
/nbproject
.php_cs.cache
/web/bundles
/web/css
/web/js
/web/composer
/web/images
/web/uploads/users/*
/web/media/cache
/web/build.js
/var/password.dat
/var/password.json
/password.json
behat.yml
/.web-server-pid
/app/config/parameters.yml
/build/
.idea
/phpunit.xml
/var/*
/var/cache/*
!var/cache/.gitkeep
!var/hook/.gitkeep
!var/hook/*
/var/logs/*
!var/logs/.gitkeep
!/var/sessions
/var/sessions/*
!var/sessions/.gitkeep
!var/SymfonyRequirements.php
/vendor/
/web/bundles/
/var/bin/
1 change: 1 addition & 0 deletions app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/zipball/
26 changes: 22 additions & 4 deletions app/AppKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,9 @@ public function registerBundles()
new Doctrine\Bundle\DoctrineCacheBundle\DoctrineCacheBundle(),
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
new FOS\UserBundle\FOSUserBundle(),
new HWI\Bundle\OAuthBundle\HWIOAuthBundle(),
new Snc\RedisBundle\SncRedisBundle(),
new WhiteOctober\PagerfantaBundle\WhiteOctoberPagerfantaBundle(),
new Nelmio\SecurityBundle\NelmioSecurityBundle(),
new Knp\Bundle\MenuBundle\KnpMenuBundle(),
new Nelmio\CorsBundle\NelmioCorsBundle(),
new Packagist\WebBundle\PackagistWebBundle(),
);

Expand All @@ -34,8 +31,29 @@ public function registerBundles()
return $bundles;
}

public function getRootDir()
{
return __DIR__;
}

public function getCacheDir()
{
return dirname(__DIR__).'/var/cache/'.$this->getEnvironment();
}

public function getLogDir()
{
return dirname(__DIR__).'/var/logs';
}

public function registerContainerConfiguration(LoaderInterface $loader)
{
$loader->load(__DIR__.'/config/config_'.$this->getEnvironment().'.yml');
$loader->load(function (\Symfony\Component\DependencyInjection\ContainerBuilder $container) {
$container->setParameter('container.autowiring.strict_mode', true);
$container->setParameter('container.dumper.inline_class_loader', true);

$container->addObjectResource($this);
});
$loader->load($this->getRootDir().'/config/config_'.$this->getEnvironment().'.yml');
}
}
12 changes: 2 additions & 10 deletions app/Resources/FOSUserBundle/views/Profile/edit_content.html.twig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<form action="{{ path('fos_user_profile_edit') }}" {{ form_enctype(form) }} method="POST" class="fos_user_profile_edit col-md-6">
{{ form_start(form, {'attr': {'class': 'fos_user_profile_edit col-md-6', 'action': path('fos_user_profile_edit') }}) }}
{{ form_errors(form) }}

<div class="form-group clearfix">
Expand Down Expand Up @@ -40,15 +40,7 @@

<input type="submit" class="btn btn-block btn-success btn-lg" value="{{ 'profile.edit.submit'|trans({}, 'FOSUserBundle') }}" />

<hr>

<h5>Using GitHub:</h5>

<a href="{{ app.user.githubId ? '#' : hwi_oauth_login_url('github') }}" class="btn btn-block btn-github btn-lg {{ app.user.githubId ? 'disabled' : 'btn-primary' }}">
<span class="fab fa-github"></span>
{{ (app.user.githubId ? 'profile.accounts_connected' : 'profile.connect_accounts')|trans }}
</a>
</form>
{{ form_end(form) }}

<div class="col-md-2">
</div>
13 changes: 8 additions & 5 deletions app/Resources/FOSUserBundle/views/Profile/show.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,25 @@

{% block fos_user_content %}
<section class="col-md-9">
{% set isAdmin = is_granted('ROLE_ADMIN') %}
{%- if app.user.apiToken %}
<h3 class="font-normal profile-title">{{ 'profile.your_api_token'|trans }}</h3>

<div class="input-group api-token-group clearfix">
<input id="api-token" type="text" class="form-control" value="" data-api-token="{{ app.user.apiToken }}" readonly="readonly">
<input id="api-token" type="text" class="form-control" value="" data-api-token="{{ app.user.username ~ ':' ~ app.user.apiToken }}" readonly="readonly">
<span class="input-group-btn">
<button class="btn btn-success btn-show-api-token" type="button">{{ 'profile.show_api_token'|trans }}</button>
</span>
</div>

<p>{{ 'profile.api_token_explain'|trans({ '%path_about%':path('about') })|raw }}</p>

<hr>
<p>You need to authenticate to access their Composer repository, for example to enter credentials run command:</p>
<pre>
composer config --global --auth http-basic.{{ app.request.getHttpHost() }} {{ user.username }} {{ user.apiToken }}
</pre>
<p>The storage can be done either globally in the <code>COMPOSER_HOME/auth.json </code> file</p> <hr>
{%- endif %}

{% if is_granted('ROLE_ADMIN') %}
{% if isAdmin %}
{% embed "PackagistWebBundle:Web:list.html.twig" with {noLayout: 'true', showAutoUpdateWarning: true} %}
{% block content_title %}
<h3 class="font-normal">{{ 'packages.yours'|trans }}</h3>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
<div class="col-md-6">
{% if error is defined and error is not empty %}
<div class="alert alert-warning">
{{ error }}
{{ error.messageKey|trans(error.messageData, 'security') }}
</div>
{% endif %}

<form action="{{ path('login_check') }}" method="POST">
<form action="{{ path('fos_user_security_check') }}" method="POST">
<div class="form-group clearfix">
<label for="username">{{ 'security.login.username'|trans({}, 'FOSUserBundle') }}</label>
<div class="input-group clearfix">
Expand Down Expand Up @@ -58,13 +58,4 @@
<hr>
</div>
{% endif %}

{% for owner in hwi_oauth_resource_owners() %}
{% if not app.user %}
<div class="clearfix"></div>
{% endif %}
<div class="col-md-6">
<a class="btn btn-block btn-{{ owner }} btn-primary btn-lg" href="{{ hwi_oauth_login_url(owner) }}"><span class="icon-{{ owner }}"></span>Login with {{ owner | trans({}, 'HWIOAuthBundle') }}</a>{% if not loop.last %}<br />{% endif %}
</div>
{% endfor %}
{% endblock %}

This file was deleted.

21 changes: 0 additions & 21 deletions app/Resources/HWIOAuthBundle/views/Connect/registration.html.twig

This file was deleted.

This file was deleted.

7 changes: 0 additions & 7 deletions app/Resources/HWIOAuthBundle/views/layout.html.twig

This file was deleted.

23 changes: 0 additions & 23 deletions app/autoload.php

This file was deleted.

84 changes: 0 additions & 84 deletions app/check.php

This file was deleted.

Loading

0 comments on commit f3e5856

Please sign in to comment.