Skip to content

add option to turn off https repo url to private recipes #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions assets/js/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,17 @@ let vm = new Vue({
return this.buildRecipeRepoUrl(recipe) + '/' + version
},
buildRecipeRepoUrl (recipe) {
let repoUrl, pattern, gitServerHostName
let repoUrl, pattern, gitServerHostName, gitServerProtocol

repoUrl = recipe.repo.url.replace('.git', '')

pattern = /^git\@[a-z.]*\:/
if (pattern.test(repoUrl)) {
gitServerHostName = pattern.exec(repoUrl)[0].replace('git@', '').replace(':', '')
repoUrl = repoUrl.replace(pattern, 'https://' + gitServerHostName + '/')

gitServerProtocol = recipe.repo.slug != "private" || this.status.config.enableHttpsPrivateRecipe == true ? 'https' : 'http'

repoUrl = repoUrl.replace(pattern, gitServerProtocol + '://' + gitServerHostName + '/')
}

pattern = /^https?\:\/\/[a-z.]*/
Expand Down
2 changes: 2 additions & 0 deletions config/services.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
parameters:
recipe_repo_private: https://github.com/moay/demo-recipes
enable_https_private_recipe: true

official_endpoint: https://symfony.sh/
proxy_official_endpoint: true
Expand Down Expand Up @@ -28,6 +29,7 @@ services:
$mirrorOfficialRepo: '%mirror_official_recipes%'
$mirrorContribRepo: '%mirror_contrib_recipes%'
$projectDir: '%kernel.project_dir%'
$enableHttpsPrivateRecipe: '%enable_https_private_recipe%'

# makes classes in src/ available to be used as services
# this creates a service per class whose id is the fully-qualified class name
Expand Down

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/build/manifest.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"build/dashboard.css": "/build/dashboard.b1963f9d56ce5d23c3b365942619a02a.css",
"build/dashboard.js": "/build/dashboard.5e02d380f9d70724d94b.js"
"build/dashboard.js": "/build/dashboard.51fa9ca7177550ce7e34.js"
}
7 changes: 5 additions & 2 deletions src/Service/Compiler/SystemStatusReportCompiler.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class SystemStatusReportCompiler
* @param bool $cacheEndpoint
* @param bool $mirrorOfficialRepo
* @param bool $mirrorContribRepo
* @param bool $enableHttpsPrivateRecipe
*/
public function __construct(
string $projectDir,
Expand All @@ -52,7 +53,8 @@ public function __construct(
bool $enableProxy,
bool $cacheEndpoint,
bool $mirrorOfficialRepo,
bool $mirrorContribRepo
bool $mirrorContribRepo,
bool $enableHttpsPrivateRecipe
) {
$this->reportFilePath = $projectDir . self::HEALTH_REPORT_FILE;
$this->repos = [
Expand All @@ -64,7 +66,8 @@ public function __construct(
'enableProxy' => $enableProxy,
'enableCache' => $cacheEndpoint,
'mirrorOfficial' => $mirrorOfficialRepo,
'mirrorContrib' => $mirrorContribRepo
'mirrorContrib' => $mirrorContribRepo,
'enableHttpsPrivateRecipe' => $enableHttpsPrivateRecipe
];

}
Expand Down