isntallation steps
This commit is contained in:
38
README.md
38
README.md
@ -11,3 +11,41 @@ isnd&
|
|||||||
isn push -k <lame-api-key> -s http://localhost:5000/packages your-lame-versionned.nupkg
|
isn push -k <lame-api-key> -s http://localhost:5000/packages your-lame-versionned.nupkg
|
||||||
|
|
||||||
````
|
````
|
||||||
|
|
||||||
|
# Installation
|
||||||
|
|
||||||
|
Depuis le dossier de la solution, compiler la solution :
|
||||||
|
|
||||||
|
````bash
|
||||||
|
dotnet build /restore
|
||||||
|
dotnet publish -c Release
|
||||||
|
````
|
||||||
|
|
||||||
|
Déployer le serveur :
|
||||||
|
|
||||||
|
````bash
|
||||||
|
sudo cp -a src/isnd/bin/Release/netcoreapp2.1/publish/ /srv/www/isnd
|
||||||
|
sudo cp contrib/isnd /etc/init.d/isnd
|
||||||
|
sudo chmod +x /etc/init.d/isnd
|
||||||
|
sudo chown -R www-data.www-data /srv/www/isnd
|
||||||
|
sudo systemctl daemon-reload
|
||||||
|
````
|
||||||
|
|
||||||
|
* Créer une base de donées Postgresql,
|
||||||
|
* ajuster un fichier de configuration `/srv/www/isnd/appsettings.Production.json`
|
||||||
|
* Démarrer le serveur :
|
||||||
|
|
||||||
|
````bash
|
||||||
|
sudo systemctl start isnd
|
||||||
|
````
|
||||||
|
|
||||||
|
Installer le client :
|
||||||
|
|
||||||
|
````bash
|
||||||
|
sudo cp -a src/isn/bin/Release/net472/ /usr/local/lib/isn
|
||||||
|
sudo chown -R root.root /usr/local/lib/isn
|
||||||
|
sudo chmod +x /usr/local/lib/isn/isn.exe
|
||||||
|
sudo cp contrib/isn /usr/local/bin
|
||||||
|
sudo chmod +x /usr/local/bin
|
||||||
|
sudo chown root.root /usr/local/bin/isn
|
||||||
|
````
|
||||||
|
3
contrib/isn
Executable file
3
contrib/isn
Executable file
@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
/usr/bin/mono /usr/local/lib/isn/isn.exe $*
|
@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
### BEGIN INIT INFO
|
### BEGIN INIT INFO
|
||||||
# Provides: nugetd
|
# Provides: isnd
|
||||||
# Required-Start: $local_fs $network $named $time $syslog $postgresql
|
# Required-Start: $local_fs $network $named $time $syslog $postgresql
|
||||||
# Required-Stop: $local_fs $network $named $time $syslog $postgresql
|
# Required-Stop: $local_fs $network $named $time $syslog $postgresql
|
||||||
# Default-Start: 2 3 4 5
|
# Default-Start: 2 3 4 5
|
||||||
@ -14,10 +14,9 @@
|
|||||||
. /lib/init/vars.sh
|
. /lib/init/vars.sh
|
||||||
. /lib/lsb/init-functions
|
. /lib/lsb/init-functions
|
||||||
|
|
||||||
NAME=nugetd
|
NAME=isnd
|
||||||
|
|
||||||
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
||||||
CONFIGS="/etc/kestrel/*.webenv"
|
|
||||||
|
|
||||||
TMP_SAVE_runlevel_VAR=$runlevel
|
TMP_SAVE_runlevel_VAR=$runlevel
|
||||||
unset runlevel
|
unset runlevel
|
||||||
@ -36,7 +35,7 @@ running() {
|
|||||||
|
|
||||||
|
|
||||||
export WWW_USER=www-data
|
export WWW_USER=www-data
|
||||||
export ROOT=/srv/www/nuget
|
export ROOT=/srv/www/${NAME}
|
||||||
export DESC="$NAME"
|
export DESC="$NAME"
|
||||||
export PIDFILE=/var/run/kestrel-${NAME}.pid
|
export PIDFILE=/var/run/kestrel-${NAME}.pid
|
||||||
export LOGDIR=/var/log
|
export LOGDIR=/var/log
|
@ -22,13 +22,27 @@ namespace isn
|
|||||||
// GET: PackageVersion
|
// GET: PackageVersion
|
||||||
public async Task<IActionResult> Index(PackageVersionIndexViewModel model)
|
public async Task<IActionResult> Index(PackageVersionIndexViewModel model)
|
||||||
{
|
{
|
||||||
var applicationDbContext = _context.PackageVersions.Include(p => p.Package).Where(p => p.PackageId == model.PackageId);
|
var applicationDbContext = _context.PackageVersions.Include(p => p.Package).Where(p => p.PackageId.StartsWith(model.PackageId));
|
||||||
|
|
||||||
model.Versions = await applicationDbContext.ToListAsync();
|
model.Versions = await applicationDbContext.ToListAsync();
|
||||||
|
|
||||||
return View(model);
|
return View(model);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Authorize]
|
||||||
|
public async Task<IActionResult> Mines(PackageVersionIndexViewModel model)
|
||||||
|
{
|
||||||
|
var userId = User.FindFirstValue(ClaimTypes.NameIdentifier);
|
||||||
|
var applicationDbContext = _context.PackageVersions
|
||||||
|
.Include(p => p.Package).Where(
|
||||||
|
p => (string.IsNullOrEmpty(model.PackageId) || p.PackageId.StartsWith(model.PackageId))
|
||||||
|
&& p.Package.OwnerId == userId);
|
||||||
|
|
||||||
|
model.Versions = await applicationDbContext.ToListAsync();
|
||||||
|
|
||||||
|
return View("Index", model);
|
||||||
|
}
|
||||||
|
|
||||||
// GET: PackageVersion/Details/5
|
// GET: PackageVersion/Details/5
|
||||||
public async Task<IActionResult> Details(string pkgid, string version)
|
public async Task<IActionResult> Details(string pkgid, string version)
|
||||||
{
|
{
|
||||||
|
@ -30,5 +30,10 @@ namespace isn.Data
|
|||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public virtual Package Package { get; set; }
|
public virtual Package Package { get; set; }
|
||||||
|
|
||||||
|
public string GetParmaLink()
|
||||||
|
{
|
||||||
|
return $"/package/{PackageId}/{FullString}/{PackageId}{FullString}.nupkg";
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -10,24 +10,6 @@
|
|||||||
<h4>PackageVersion</h4>
|
<h4>PackageVersion</h4>
|
||||||
<hr />
|
<hr />
|
||||||
<dl class="dl-horizontal">
|
<dl class="dl-horizontal">
|
||||||
<dt>
|
|
||||||
@Html.DisplayNameFor(model => model.Major)
|
|
||||||
</dt>
|
|
||||||
<dd>
|
|
||||||
@Html.DisplayFor(model => model.Major)
|
|
||||||
</dd>
|
|
||||||
<dt>
|
|
||||||
@Html.DisplayNameFor(model => model.Minor)
|
|
||||||
</dt>
|
|
||||||
<dd>
|
|
||||||
@Html.DisplayFor(model => model.Minor)
|
|
||||||
</dd>
|
|
||||||
<dt>
|
|
||||||
@Html.DisplayNameFor(model => model.Patch)
|
|
||||||
</dt>
|
|
||||||
<dd>
|
|
||||||
@Html.DisplayFor(model => model.Patch)
|
|
||||||
</dd>
|
|
||||||
<dt>
|
<dt>
|
||||||
@Html.DisplayNameFor(model => model.IsPrerelease)
|
@Html.DisplayNameFor(model => model.IsPrerelease)
|
||||||
</dt>
|
</dt>
|
||||||
@ -35,14 +17,20 @@
|
|||||||
@Html.DisplayFor(model => model.IsPrerelease)
|
@Html.DisplayFor(model => model.IsPrerelease)
|
||||||
</dd>
|
</dd>
|
||||||
<dt>
|
<dt>
|
||||||
@Html.DisplayNameFor(model => model.Package)
|
@Html.DisplayNameFor(model => model.PackageId)
|
||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
@Html.DisplayFor(model => model.Package.Id)
|
@Html.DisplayFor(model => model.PackageId)
|
||||||
|
</dd>
|
||||||
|
<dt>
|
||||||
|
@Html.DisplayNameFor(model => model.FullString)
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
<a href="@Model.GetParmaLink();" >@Html.DisplayFor(model => model.FullString)</a>
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
@Html.ActionLink("Edit", "Edit", new { /* id = Model.PrimaryKey */ }) |
|
@Html.ActionLink("Edit", "Edit", new { pkgid = Model.PackageId, version = Model.FullString }) |
|
||||||
<a asp-action="Index">Back to List</a>
|
<a asp-action="Index">Back to List</a>
|
||||||
</div>
|
</div>
|
||||||
|
@ -24,20 +24,14 @@
|
|||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>
|
<th>
|
||||||
@Html.DisplayNameFor(model => model.Versions[0].Major)
|
@Html.DisplayNameFor(model => model.Versions[0].Package.Id)
|
||||||
</th>
|
</th>
|
||||||
<th>
|
<th>
|
||||||
@Html.DisplayNameFor(model => model.Versions[0].Minor)
|
@Html.DisplayNameFor(model => model.Versions[0].FullString)
|
||||||
</th>
|
|
||||||
<th>
|
|
||||||
@Html.DisplayNameFor(model => model.Versions[0].Patch)
|
|
||||||
</th>
|
</th>
|
||||||
<th>
|
<th>
|
||||||
@Html.DisplayNameFor(model => model.Versions[0].IsPrerelease)
|
@Html.DisplayNameFor(model => model.Versions[0].IsPrerelease)
|
||||||
</th>
|
</th>
|
||||||
<th>
|
|
||||||
@Html.DisplayNameFor(model => model.Versions[0].Package)
|
|
||||||
</th>
|
|
||||||
<th></th>
|
<th></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
@ -45,20 +39,17 @@
|
|||||||
@foreach (var item in Model.Versions) {
|
@foreach (var item in Model.Versions) {
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
@Html.DisplayFor(modelItem => item.Major)
|
@Html.DisplayFor(modelItem => item.Package.Id)
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
@Html.DisplayFor(modelItem => item.Minor)
|
@Html.DisplayFor(modelItem => item.FullString)
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
@Html.DisplayFor(modelItem => item.Patch)
|
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
@Html.DisplayFor(modelItem => item.IsPrerelease)
|
@Html.DisplayFor(modelItem => item.IsPrerelease)
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
@Html.ActionLink("Details", "Details", new { pkgid = Model.PackageId, version = item.FullString }) |
|
@Html.ActionLink("Details", "Details", new { pkgid = item.PackageId, version = item.FullString }) |
|
||||||
@Html.ActionLink("Delete", "Delete", new { pkgid = Model.PackageId, version = item.FullString })
|
@Html.ActionLink("Delete", "Delete", new { pkgid = item.PackageId, version = item.FullString })
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
<header>
|
<header>
|
||||||
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3">
|
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<a class="navbar-brand" asp-area="" asp-controller="Home" asp-action="Index">mvc_ident</a>
|
<a class="navbar-brand" asp-area="" asp-controller="PackageVersion" asp-action="Index">mvc_ident</a>
|
||||||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target=".navbar-collapse" aria-controls="navbarSupportedContent"
|
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target=".navbar-collapse" aria-controls="navbarSupportedContent"
|
||||||
aria-expanded="false" aria-label="Toggle navigation">
|
aria-expanded="false" aria-label="Toggle navigation">
|
||||||
<span class="navbar-toggler-icon"></span>
|
<span class="navbar-toggler-icon"></span>
|
||||||
|
@ -6,7 +6,10 @@
|
|||||||
@if (SignInManager.IsSignedIn(User))
|
@if (SignInManager.IsSignedIn(User))
|
||||||
{
|
{
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link text-dark" asp-area="Identity" asp-page="/Account/Manage/Index" title="Manage">Hello @User.Identity.Name!</a>
|
<a class="nav-link text-dark" asp-area="Identity" asp-page="/Account/Manage/Index" title="Manage">Hello @User.Identity.Name!</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link text-dark" asp-controller="ApiKeys" asp-action="Index" title="Api Keys">Your API keys</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<form class="form-inline" asp-area="Identity" asp-page="/Account/Logout" asp-route-returnUrl="@Url.Action("Index", "Home", new { area = "" })">
|
<form class="form-inline" asp-area="Identity" asp-page="/Account/Logout" asp-route-returnUrl="@Url.Action("Index", "Home", new { area = "" })">
|
||||||
|
@ -20,7 +20,7 @@ namespace nuget.host.tests
|
|||||||
|
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void TestHaveTestDbContext()
|
public void TestHaveTestDbContextAndMigrate()
|
||||||
{
|
{
|
||||||
string envVar = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT");
|
string envVar = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT");
|
||||||
Assert.Equal("Development", envVar);
|
Assert.Equal("Development", envVar);
|
||||||
|
Reference in New Issue
Block a user