├── .gitattributes
├── .gitignore
├── LICENSE
├── NuGet Server.sln
├── README.md
├── build
├── Svenkle NuGet Server.aip
└── Website.props
├── resources
└── iisexpress.msi
└── src
├── Svenkle.NuGetServer.Service
├── App.config
├── Host
│ └── Website
│ │ └── Configuration
│ │ └── applicationhost.config
├── Program.cs
├── Properties
│ └── AssemblyInfo.cs
├── Resources
│ └── iisexpress.msi
└── Svenkle.NuGetServer.Service.csproj
└── Svenkle.NuGetServer.Website
├── App_Start
└── NuGetODataConfig.cs
├── Default.aspx
├── Packages
└── Readme.txt
├── Properties
└── AssemblyInfo.cs
├── Svenkle.NuGetServer.Website.csproj
├── Web.Debug.config
├── Web.Release.config
├── Web.config
├── favicon.ico
└── packages.config
/.gitattributes:
--------------------------------------------------------------------------------
1 | * text=auto
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 |
4 | # User-specific files
5 | *.suo
6 | *.user
7 | *.userosscache
8 | *.sln.docstates
9 |
10 | # User-specific files (MonoDevelop/Xamarin Studio)
11 | *.userprefs
12 |
13 | # Build results
14 | [Dd]ebug/
15 | [Dd]ebugPublic/
16 | [Rr]elease/
17 | [Rr]eleases/
18 | x64/
19 | x86/
20 | bld/
21 | [Bb]in/
22 | [Oo]bj/
23 | [Ll]og/
24 |
25 | # Visual Studio 2015 cache/options directory
26 | .vs/
27 | # Uncomment if you have tasks that create the project's static files in wwwroot
28 | #wwwroot/
29 |
30 | # MSTest test Results
31 | [Tt]est[Rr]esult*/
32 | [Bb]uild[Ll]og.*
33 |
34 | # NUNIT
35 | *.VisualState.xml
36 | TestResult.xml
37 |
38 | # Build Results of an ATL Project
39 | [Dd]ebugPS/
40 | [Rr]eleasePS/
41 | dlldata.c
42 |
43 | # DNX
44 | project.lock.json
45 | artifacts/
46 |
47 | *_i.c
48 | *_p.c
49 | *_i.h
50 | *.ilk
51 | *.meta
52 | *.obj
53 | *.pch
54 | *.pdb
55 | *.pgc
56 | *.pgd
57 | *.rsp
58 | *.sbr
59 | *.tlb
60 | *.tli
61 | *.tlh
62 | *.tmp
63 | *.tmp_proj
64 | *.log
65 | *.vspscc
66 | *.vssscc
67 | .builds
68 | *.pidb
69 | *.svclog
70 | *.scc
71 |
72 | # Chutzpah Test files
73 | _Chutzpah*
74 |
75 | # Visual C++ cache files
76 | ipch/
77 | *.aps
78 | *.ncb
79 | *.opendb
80 | *.opensdf
81 | *.sdf
82 | *.cachefile
83 | *.VC.db
84 | *.VC.VC.opendb
85 |
86 | # Visual Studio profiler
87 | *.psess
88 | *.vsp
89 | *.vspx
90 | *.sap
91 |
92 | # TFS 2012 Local Workspace
93 | $tf/
94 |
95 | # Guidance Automation Toolkit
96 | *.gpState
97 |
98 | # ReSharper is a .NET coding add-in
99 | _ReSharper*/
100 | *.[Rr]e[Ss]harper
101 | *.DotSettings.user
102 |
103 | # JustCode is a .NET coding add-in
104 | .JustCode
105 |
106 | # TeamCity is a build add-in
107 | _TeamCity*
108 |
109 | # DotCover is a Code Coverage Tool
110 | *.dotCover
111 |
112 | # NCrunch
113 | _NCrunch_*
114 | .*crunch*.local.xml
115 | nCrunchTemp_*
116 |
117 | # MightyMoose
118 | *.mm.*
119 | AutoTest.Net/
120 |
121 | # Web workbench (sass)
122 | .sass-cache/
123 |
124 | # Installshield output folder
125 | [Ee]xpress/
126 |
127 | # DocProject is a documentation generator add-in
128 | DocProject/buildhelp/
129 | DocProject/Help/*.HxT
130 | DocProject/Help/*.HxC
131 | DocProject/Help/*.hhc
132 | DocProject/Help/*.hhk
133 | DocProject/Help/*.hhp
134 | DocProject/Help/Html2
135 | DocProject/Help/html
136 |
137 | # Click-Once directory
138 | publish/
139 |
140 | # Publish Web Output
141 | *.[Pp]ublish.xml
142 | *.azurePubxml
143 | # TODO: Comment the next line if you want to checkin your web deploy settings
144 | # but database connection strings (with potential passwords) will be unencrypted
145 | *.pubxml
146 | *.publishproj
147 |
148 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
149 | # checkin your Azure Web App publish settings, but sensitive information contained
150 | # in these scripts will be unencrypted
151 | PublishScripts/
152 |
153 | # NuGet Packages
154 | *.nupkg
155 | # The packages folder can be ignored because of Package Restore
156 | **/packages/*
157 | # except build/, which is used as an MSBuild target.
158 | !**/packages/build/
159 | # Uncomment if necessary however generally it will be regenerated when needed
160 | #!**/packages/repositories.config
161 | # NuGet v3's project.json files produces more ignoreable files
162 | *.nuget.props
163 | *.nuget.targets
164 |
165 | # Microsoft Azure Build Output
166 | csx/
167 | *.build.csdef
168 |
169 | # Microsoft Azure Emulator
170 | ecf/
171 | rcf/
172 |
173 | # Windows Store app package directories and files
174 | AppPackages/
175 | BundleArtifacts/
176 | Package.StoreAssociation.xml
177 | _pkginfo.txt
178 |
179 | # Visual Studio cache files
180 | # files ending in .cache can be ignored
181 | *.[Cc]ache
182 | # but keep track of directories ending in .cache
183 | !*.[Cc]ache/
184 |
185 | # Others
186 | ClientBin/
187 | ~$*
188 | *~
189 | *.dbmdl
190 | *.dbproj.schemaview
191 | *.pfx
192 | *.publishsettings
193 | node_modules/
194 | orleans.codegen.cs
195 |
196 | # Since there are multiple workflows, uncomment next line to ignore bower_components
197 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
198 | #bower_components/
199 |
200 | # RIA/Silverlight projects
201 | Generated_Code/
202 |
203 | # Backup & report files from converting an old project file
204 | # to a newer Visual Studio version. Backup files are not needed,
205 | # because we have git ;-)
206 | _UpgradeReport_Files/
207 | Backup*/
208 | UpgradeLog*.XML
209 | UpgradeLog*.htm
210 |
211 | # SQL Server files
212 | *.mdf
213 | *.ldf
214 |
215 | # Business Intelligence projects
216 | *.rdl.data
217 | *.bim.layout
218 | *.bim_*.settings
219 |
220 | # Microsoft Fakes
221 | FakesAssemblies/
222 |
223 | # GhostDoc plugin setting file
224 | *.GhostDoc.xml
225 |
226 | # Node.js Tools for Visual Studio
227 | .ntvs_analysis.dat
228 |
229 | # Visual Studio 6 build log
230 | *.plg
231 |
232 | # Visual Studio 6 workspace options file
233 | *.opt
234 |
235 | # Visual Studio LightSwitch build output
236 | **/*.HTMLClient/GeneratedArtifacts
237 | **/*.DesktopClient/GeneratedArtifacts
238 | **/*.DesktopClient/ModelManifest.xml
239 | **/*.Server/GeneratedArtifacts
240 | **/*.Server/ModelManifest.xml
241 | _Pvt_Extensions
242 |
243 | # Paket dependency manager
244 | .paket/paket.exe
245 | paket-files/
246 |
247 | # FAKE - F# Make
248 | .fake/
249 |
250 | # JetBrains Rider
251 | .idea/
252 | *.sln.iml
253 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2017 Svenkle
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/NuGet Server.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 15
4 | VisualStudioVersion = 15.0.27004.2009
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{50F4F821-6975-48B8-99D1-28536BE4047D}"
7 | ProjectSection(SolutionItems) = preProject
8 | build\Website.props = build\Website.props
9 | EndProjectSection
10 | EndProject
11 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Svenkle.NuGetServer.Service", "src\Svenkle.NuGetServer.Service\Svenkle.NuGetServer.Service.csproj", "{849C4739-2DC5-4112-97B0-23907F39A44E}"
12 | EndProject
13 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Svenkle.NuGetServer.Website", "src\Svenkle.NuGetServer.Website\Svenkle.NuGetServer.Website.csproj", "{C4157CB8-9CF6-4956-9570-743EF65337D7}"
14 | EndProject
15 | Global
16 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
17 | Debug|Any CPU = Debug|Any CPU
18 | Release|Any CPU = Release|Any CPU
19 | EndGlobalSection
20 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
21 | {849C4739-2DC5-4112-97B0-23907F39A44E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
22 | {849C4739-2DC5-4112-97B0-23907F39A44E}.Debug|Any CPU.Build.0 = Debug|Any CPU
23 | {849C4739-2DC5-4112-97B0-23907F39A44E}.Release|Any CPU.ActiveCfg = Release|Any CPU
24 | {849C4739-2DC5-4112-97B0-23907F39A44E}.Release|Any CPU.Build.0 = Release|Any CPU
25 | {C4157CB8-9CF6-4956-9570-743EF65337D7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
26 | {C4157CB8-9CF6-4956-9570-743EF65337D7}.Debug|Any CPU.Build.0 = Debug|Any CPU
27 | {C4157CB8-9CF6-4956-9570-743EF65337D7}.Release|Any CPU.ActiveCfg = Release|Any CPU
28 | {C4157CB8-9CF6-4956-9570-743EF65337D7}.Release|Any CPU.Build.0 = Release|Any CPU
29 | EndGlobalSection
30 | GlobalSection(SolutionProperties) = preSolution
31 | HideSolutionNode = FALSE
32 | EndGlobalSection
33 | GlobalSection(ExtensibilityGlobals) = postSolution
34 | SolutionGuid = {59ED5E82-CA50-4729-8F2A-05AB2E98A4DF}
35 | EndGlobalSection
36 | EndGlobal
37 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # NuGet Server
2 | NuGet Server is essentially a self-hosted wrapper of the [NuGet.Server](https://www.nuget.org/packages/NuGet.Server) package. NuGet Server is distributed with its own IIS Express instance and as such does not require a webserver to be installed on the machine.
3 |
4 | ## Requirements
5 | * .NET 4.8 or higher
6 | * Windows Server 2012, Windows Server 2016, Windows Server 2019, Windows 7, Windows 8, Windows 8.1, Windows 10 or Windows 11
7 |
8 | ## Getting Started
9 | ### Install as a Windows Service
10 | * Download **Install.msi** from the [Releases](https://github.com/svenkle/nuget-server/releases) page
11 | * Run **Install.msi** as a user with Administrator privledges
12 | * Complete all wizard steps
13 | * Browse to http://localhost:8080
14 |
15 | ### Run from the Command Line
16 | * Download **NuGetServer.zip** from the [Releases](https://github.com/svenkle/nuget-server/releases) page
17 | * Unzip **NuGetServer.zip** to a location of your choosing
18 | * Run **Svenkle.NuGetServer.Service.exe**
19 |
20 | ## Configuration
21 |
22 | ### Host configuration
23 | You can configure many different features of the host using the **applicationhost.config** file located in **Host\\Website\\Configuration**.
24 |
25 | ### API Key, Package location etc.
26 | You can customise all of the normal NuGet.Server functionality by editing the **Web.config** located in **Host\\Website**. Further documentation on the configuration settings can be found [here](https://docs.microsoft.com/en-us/nuget/hosting-packages/nuget-server).
27 |
28 | ## FAQ
29 | ### How is this different to the Cassini based NuGet Server?
30 | It's simple! This one is free and open-source.
31 |
32 | ### Why do you bundle IIS Express as an MSI?
33 | In order to increase support for servers that do not have IIS Express installed it must be bundled with the service. The Microsoft license agreement for IIS Express only allows distribution in .msi form.
34 |
35 | ## Problems and Solutions
36 |
37 | ### Specified Argument was out of the range of valid values
38 | This issue is caused by a partial installation of Visual Studio ie. Visual Studio Build Tools. To resolve either install Visual Studio completely, Install IIS Express using the installed .msi or install the full IIS suite.
39 |
--------------------------------------------------------------------------------
/build/Svenkle NuGet Server.aip:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
--------------------------------------------------------------------------------
/build/Website.props:
--------------------------------------------------------------------------------
1 |
2 |
3 | $(MSBuildProjectDirectory)\..\Svenkle.NuGetServer.Service\bin\$(Configuration)\Host\Website
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/resources/iisexpress.msi:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/svenkle/nuget-server/9404910fe362cf2e896e4720877b0187139c87fa/resources/iisexpress.msi
--------------------------------------------------------------------------------
/src/Svenkle.NuGetServer.Service/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/src/Svenkle.NuGetServer.Service/Host/Website/Configuration/applicationhost.config:
--------------------------------------------------------------------------------
1 |
2 |
20 |
21 |
22 |
23 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
224 |
225 |
226 |
227 |
228 |
229 |
230 |
231 |
232 |
233 |
234 |
235 |
236 |
237 |
238 |
239 |
240 |
241 |
242 |
243 |
244 |
245 |
246 |
247 |
248 |
249 |
250 |
251 |
252 |
253 |
254 |
255 |
256 |
257 |
258 |
259 |
260 |
261 |
262 |
263 |
264 |
265 |
266 |
267 |
268 |
269 |
270 |
271 |
272 |
273 |
274 |
275 |
276 |
277 |
278 |
279 |
280 |
281 |
282 |
283 |
284 |
285 |
286 |
287 |
288 |
289 |
290 |
291 |
292 |
293 |
294 |
295 |
296 |
297 |
298 |
299 |
300 |
301 |
302 |
303 |
304 |
305 |
306 |
307 |
308 |
309 |
310 |
311 |
312 |
313 |
314 |
315 |
316 |
317 |
318 |
319 |
320 |
321 |
322 |
323 |
324 |
325 |
326 |
327 |
328 |
329 |
330 |
331 |
332 |
333 |
334 |
335 |
336 |
337 |
338 |
339 |
340 |
341 |
342 |
343 |
344 |
345 |
346 |
347 |
348 |
349 |
350 |
351 |
352 |
353 |
354 |
355 |
356 |
357 |
358 |
359 |
360 |
361 |
362 |
363 |
364 |
365 |
366 |
367 |
368 |
369 |
370 |
371 |
372 |
373 |
374 |
375 |
376 |
377 |
378 |
379 |
380 |
381 |
382 |
383 |
384 |
385 |
386 |
387 |
388 |
389 |
390 |
391 |
392 |
393 |
394 |
395 |
396 |
397 |
398 |
399 |
400 |
401 |
402 |
403 |
404 |
405 |
406 |
407 |
408 |
409 |
410 |
411 |
412 |
413 |
414 |
415 |
416 |
417 |
418 |
419 |
420 |
421 |
422 |
423 |
424 |
425 |
426 |
427 |
428 |
429 |
430 |
431 |
432 |
433 |
434 |
435 |
436 |
437 |
438 |
439 |
440 |
441 |
442 |
443 |
444 |
445 |
446 |
447 |
448 |
449 |
450 |
451 |
452 |
453 |
454 |
455 |
456 |
457 |
458 |
459 |
460 |
461 |
462 |
463 |
464 |
465 |
466 |
467 |
468 |
469 |
470 |
471 |
472 |
473 |
474 |
475 |
476 |
477 |
478 |
479 |
480 |
481 |
482 |
483 |
484 |
485 |
486 |
487 |
488 |
489 |
490 |
491 |
492 |
493 |
494 |
495 |
496 |
497 |
498 |
499 |
500 |
501 |
502 |
503 |
504 |
505 |
506 |
507 |
508 |
509 |
510 |
511 |
512 |
513 |
514 |
515 |
516 |
517 |
518 |
519 |
520 |
521 |
522 |
523 |
524 |
525 |
526 |
527 |
528 |
529 |
530 |
531 |
532 |
533 |
534 |
535 |
536 |
537 |
538 |
539 |
540 |
541 |
542 |
543 |
544 |
545 |
546 |
547 |
548 |
549 |
550 |
551 |
552 |
553 |
554 |
555 |
556 |
557 |
558 |
559 |
560 |
561 |
562 |
563 |
564 |
565 |
566 |
567 |
568 |
569 |
570 |
571 |
572 |
573 |
574 |
575 |
576 |
577 |
578 |
579 |
580 |
581 |
582 |
583 |
584 |
585 |
586 |
587 |
588 |
589 |
590 |
591 |
592 |
593 |
594 |
595 |
596 |
597 |
598 |
599 |
600 |
601 |
602 |
603 |
604 |
605 |
606 |
607 |
608 |
609 |
610 |
611 |
612 |
613 |
614 |
615 |
616 |
617 |
618 |
619 |
620 |
621 |
622 |
623 |
624 |
625 |
626 |
627 |
628 |
629 |
630 |
631 |
632 |
633 |
634 |
635 |
636 |
637 |
638 |
639 |
640 |
641 |
642 |
643 |
644 |
645 |
646 |
647 |
648 |
649 |
650 |
651 |
652 |
653 |
654 |
655 |
656 |
657 |
658 |
659 |
660 |
661 |
662 |
663 |
664 |
665 |
666 |
667 |
668 |
669 |
670 |
671 |
672 |
673 |
674 |
675 |
676 |
677 |
678 |
679 |
680 |
681 |
682 |
683 |
684 |
685 |
686 |
687 |
688 |
689 |
690 |
691 |
692 |
693 |
694 |
695 |
696 |
697 |
698 |
699 |
700 |
701 |
702 |
703 |
704 |
705 |
706 |
707 |
708 |
709 |
710 |
711 |
712 |
713 |
714 |
715 |
716 |
717 |
718 |
719 |
720 |
721 |
722 |
723 |
724 |
725 |
726 |
727 |
728 |
729 |
730 |
731 |
732 |
733 |
734 |
735 |
736 |
737 |
738 |
739 |
740 |
741 |
742 |
743 |
744 |
745 |
746 |
747 |
748 |
749 |
750 |
751 |
752 |
753 |
754 |
755 |
756 |
757 |
758 |
759 |
760 |
761 |
762 |
763 |
764 |
765 |
766 |
767 |
768 |
769 |
770 |
771 |
772 |
773 |
774 |
775 |
776 |
777 |
778 |
779 |
780 |
781 |
782 |
783 |
784 |
785 |
786 |
787 |
788 |
789 |
790 |
791 |
792 |
793 |
794 |
795 |
796 |
797 |
798 |
799 |
800 |
801 |
802 |
803 |
804 |
805 |
806 |
807 |
808 |
809 |
810 |
811 |
812 |
813 |
814 |
815 |
816 |
817 |
818 |
819 |
820 |
821 |
822 |
823 |
824 |
825 |
826 |
827 |
828 |
829 |
830 |
831 |
832 |
833 |
834 |
835 |
836 |
837 |
838 |
839 |
840 |
841 |
842 |
843 |
844 |
845 |
846 |
847 |
848 |
849 |
850 |
851 |
852 |
853 |
854 |
855 |
856 |
857 |
858 |
859 |
860 |
861 |
862 |
863 |
864 |
865 |
866 |
867 |
868 |
869 |
870 |
871 |
872 |
873 |
874 |
875 |
876 |
877 |
878 |
879 |
880 |
881 |
882 |
883 |
884 |
887 |
888 |
889 |
890 |
891 |
892 |
893 |
894 |
895 |
896 |
897 |
898 |
899 |
900 |
903 |
904 |
905 |
906 |
907 |
908 |
909 |
910 |
911 |
912 |
913 |
914 |
915 |
916 |
917 |
918 |
919 |
920 |
921 |
922 |
923 |
924 |
925 |
926 |
927 |
928 |
929 |
930 |
931 |
932 |
933 |
934 |
935 |
936 |
937 |
938 |
939 |
940 |
941 |
942 |
943 |
944 |
945 |
946 |
947 |
948 |
949 |
950 |
951 |
952 |
953 |
954 |
955 |
956 |
957 |
958 |
959 |
960 |
961 |
962 |
963 |
964 |
965 |
966 |
967 |
968 |
969 |
970 |
971 |
972 |
973 |
974 |
975 |
976 |
977 |
978 |
979 |
980 |
981 |
982 |
983 |
984 |
985 |
986 |
987 |
988 |
989 |
990 |
991 |
992 |
993 |
994 |
995 |
996 |
997 |
998 |
999 |
1000 |
1001 |
1002 |
1003 |
1004 |
1005 |
1006 |
1007 |
1008 |
1009 |
1010 |
1011 |
1012 |
1013 |
1014 |
1015 |
1016 |
1017 |
1018 |
1019 |
1020 |
1021 |
1022 |
1023 |
1024 |
1025 |
1026 |
1027 |
1028 |
1029 |
1030 |
1031 |
--------------------------------------------------------------------------------
/src/Svenkle.NuGetServer.Service/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Diagnostics;
3 | using System.IO;
4 | using System.ServiceProcess;
5 | using Microsoft.VisualBasic.FileIO;
6 |
7 | namespace Svenkle.NuGetServer.Service
8 | {
9 | public class Service : ServiceBase
10 | {
11 | private Process _hostRunnerProcess;
12 | private ProcessStartInfo _hostRunnerProcessStartInfo;
13 | private const string ConfigurationFilename = "Host\\Website\\Configuration\\applicationhost.config";
14 | private const string HostInstallerFilename = "Resources\\iisexpress.msi";
15 | private const string UserFolder = "Host\\Website\\User";
16 | private const string Host = "Host\\iisexpress.exe";
17 | private const string WorkingFolder = "NuGetServer";
18 | private const string HostFolder = "Host";
19 | private string _configurationFile;
20 | private string _hostInstaller;
21 | private string _hostArguments;
22 | private string _workingFolder;
23 | private string _userFolder;
24 | private string _rootFolder;
25 | private string _hostFolder;
26 | private string _host;
27 |
28 | private static void Main(string[] args)
29 | {
30 | var service = new Service();
31 | if (Environment.UserInteractive)
32 | {
33 | Console.WriteLine($@"[{typeof(Service).Namespace}]");
34 | Console.WriteLine(@"Starting...");
35 | service.OnStart(args);
36 | Console.WriteLine(@"Started!");
37 | Console.ReadLine();
38 | service.Stop();
39 | }
40 | else
41 | {
42 | Run(service);
43 | }
44 | }
45 |
46 | protected override void OnStart(string[] args)
47 | {
48 | AppDomain.CurrentDomain.UnhandledException += ServiceOnUnhandledException;
49 | AppDomain.CurrentDomain.ProcessExit += ServiceOnProcessExit;
50 |
51 | _rootFolder = Path.GetDirectoryName(new Uri(typeof(Service).Assembly.CodeBase).LocalPath);
52 | _configurationFile = Path.Combine(_rootFolder, ConfigurationFilename);
53 | _hostInstaller = Path.Combine(_rootFolder, HostInstallerFilename);
54 | _workingFolder = Path.Combine(Path.GetTempPath(), WorkingFolder);
55 | _userFolder = Path.Combine(_rootFolder, UserFolder);
56 | _hostFolder = Path.Combine(_rootFolder, HostFolder);
57 | _host = Path.Combine(_rootFolder, Host);
58 |
59 | ExtractHost();
60 | ConfigureHost();
61 | StartHost();
62 | }
63 |
64 | protected override void OnStop()
65 | {
66 | StopHost();
67 | }
68 |
69 | private void ExtractHost()
70 | {
71 | if (!File.Exists(_host))
72 | {
73 | // Use a VB Move command as C# doesn't allow moving between volumes
74 | // TODO: Potentially change this as the temp folder is not just for IIS
75 | ExtractWindowsInstallPackage(_hostInstaller);
76 | FileSystem.MoveDirectory(Path.Combine(_workingFolder, "WowOnly"), _hostFolder, true);
77 | }
78 | }
79 |
80 | private void StartHost()
81 | {
82 | _hostRunnerProcess.Start();
83 | _hostRunnerProcess.BeginErrorReadLine();
84 | }
85 |
86 | private void StopHost()
87 | {
88 | if (_hostRunnerProcess != null && !_hostRunnerProcess.HasExited)
89 | {
90 | _hostRunnerProcess.CancelErrorRead();
91 | _hostRunnerProcess.Kill();
92 | _hostRunnerProcess = null;
93 | }
94 | }
95 |
96 | private void ConfigureHost()
97 | {
98 | _hostArguments = $"/config:\"{_configurationFile}\" /systray:{false} /userhome:\"{_userFolder}\" /trace:error";
99 |
100 | _hostRunnerProcessStartInfo = new ProcessStartInfo(_host, _hostArguments)
101 | {
102 | WindowStyle = ProcessWindowStyle.Hidden,
103 | UseShellExecute = false,
104 | RedirectStandardError = true,
105 | RedirectStandardOutput = true,
106 | RedirectStandardInput = false
107 | };
108 |
109 | _hostRunnerProcess = new Process
110 | {
111 | StartInfo = _hostRunnerProcessStartInfo,
112 | EnableRaisingEvents = true
113 | };
114 |
115 | _hostRunnerProcess.Exited += HostRunnerOnExited;
116 | _hostRunnerProcess.ErrorDataReceived += HostRunnerOnErrorDataReceived;
117 | }
118 |
119 | private void HostRunnerOnExited(object sender, EventArgs eventArgs)
120 | {
121 | Console.WriteLine(nameof(HostRunnerOnExited));
122 | Stop();
123 | }
124 |
125 | private void ServiceOnProcessExit(object sender, EventArgs eventArgs)
126 | {
127 | Console.WriteLine(nameof(ServiceOnProcessExit));
128 | StopHost();
129 | }
130 |
131 | private void ExtractWindowsInstallPackage(string packageFilePath)
132 | {
133 | Process.Start("msiexec.exe", $"/a \"{packageFilePath}\" /qb targetdir=\"{_workingFolder}\" /quiet").WaitForExit();
134 | }
135 |
136 | private void HostRunnerOnErrorDataReceived(object sender, DataReceivedEventArgs dataReceivedEventArgs)
137 | {
138 | Console.WriteLine(dataReceivedEventArgs.Data);
139 | StopHost();
140 | }
141 |
142 | private void ServiceOnUnhandledException(object sender, UnhandledExceptionEventArgs e)
143 | {
144 | Console.WriteLine((Exception)e.ExceptionObject);
145 | StopHost();
146 | }
147 | }
148 | }
149 |
--------------------------------------------------------------------------------
/src/Svenkle.NuGetServer.Service/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.InteropServices;
3 |
4 | // General Information about an assembly is controlled through the following
5 | // set of attributes. Change these attribute values to modify the information
6 | // associated with an assembly.
7 | [assembly: AssemblyTitle("Svenkle.NuGetServer.Service")]
8 | [assembly: AssemblyDescription("")]
9 | [assembly: AssemblyConfiguration("")]
10 | [assembly: AssemblyCompany("")]
11 | [assembly: AssemblyProduct("NuGet Server")]
12 | [assembly: AssemblyCopyright("Copyright © Svenkle 2023")]
13 | [assembly: AssemblyTrademark("")]
14 | [assembly: AssemblyCulture("")]
15 |
16 | // Setting ComVisible to false makes the types in this assembly not visible
17 | // to COM components. If you need to access a type in this assembly from
18 | // COM, set the ComVisible attribute to true on that type.
19 | [assembly: ComVisible(false)]
20 |
21 | // The following GUID is for the ID of the typelib if this project is exposed to COM
22 | [assembly: Guid("849c4739-2dc5-4112-97b0-23907f39a44e")]
23 |
24 | // Version information for an assembly consists of the following four values:
25 | //
26 | // Major Version
27 | // Minor Version
28 | // Build Number
29 | // Revision
30 | //
31 | // You can specify all the values or you can default the Build and Revision Numbers
32 | // by using the '*' as shown below:
33 | // [assembly: AssemblyVersion("1.0.*")]
34 | [assembly: AssemblyVersion("0.0.*")]
35 |
--------------------------------------------------------------------------------
/src/Svenkle.NuGetServer.Service/Resources/iisexpress.msi:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/svenkle/nuget-server/9404910fe362cf2e896e4720877b0187139c87fa/src/Svenkle.NuGetServer.Service/Resources/iisexpress.msi
--------------------------------------------------------------------------------
/src/Svenkle.NuGetServer.Service/Svenkle.NuGetServer.Service.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {849C4739-2DC5-4112-97B0-23907F39A44E}
8 | Exe
9 | Svenkle.NuGetServer.Service
10 | Svenkle.NuGetServer.Service
11 | v4.8
12 | 512
13 | true
14 |
15 | false
16 | publish\
17 | true
18 | Disk
19 | false
20 | Foreground
21 | 7
22 | Days
23 | false
24 | false
25 | true
26 | 1
27 | 1.0.0.%2a
28 | false
29 | true
30 | true
31 |
32 |
33 | AnyCPU
34 | true
35 | full
36 | false
37 | bin\Debug\
38 | DEBUG;TRACE
39 | prompt
40 | 4
41 |
42 |
43 | AnyCPU
44 | pdbonly
45 | true
46 | bin\Release\
47 | TRACE
48 | prompt
49 | 4
50 |
51 |
52 | Svenkle.NuGetServer.Service.Service
53 |
54 |
55 | E05304E958FC89FF34578E9FB3DCC567389EF091
56 |
57 |
58 | Svenkle.NuGetServer.Service_TemporaryKey.pfx
59 |
60 |
61 | true
62 |
63 |
64 | true
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 | Component
75 |
76 |
77 |
78 |
79 |
80 |
81 | PreserveNewest
82 | Designer
83 |
84 |
85 | PreserveNewest
86 |
87 |
88 |
89 |
90 | False
91 | Microsoft .NET Framework 4.8 %28x86 and x64%29
92 | true
93 |
94 |
95 | False
96 | .NET Framework 3.5 SP1
97 | false
98 |
99 |
100 |
101 |
--------------------------------------------------------------------------------
/src/Svenkle.NuGetServer.Website/App_Start/NuGetODataConfig.cs:
--------------------------------------------------------------------------------
1 | using System.Net.Http;
2 | using System.Web.Http;
3 | using System.Web.Http.ExceptionHandling;
4 | using System.Web.Http.Routing;
5 | using NuGet.Server;
6 | using NuGet.Server.Infrastructure;
7 | using NuGet.Server.V2;
8 |
9 | [assembly: WebActivatorEx.PreApplicationStartMethod(typeof(Svenkle.NuGetServer.Website.App_Start.NuGetODataConfig), "Start")]
10 |
11 | namespace Svenkle.NuGetServer.Website.App_Start
12 | {
13 | public static class NuGetODataConfig
14 | {
15 | public static void Start()
16 | {
17 | ServiceResolver.SetServiceResolver(new DefaultServiceResolver());
18 |
19 | var config = GlobalConfiguration.Configuration;
20 |
21 | NuGetV2WebApiEnabler.UseNuGetV2WebApiFeed(
22 | config,
23 | "NuGetDefault",
24 | "nuget",
25 | "PackagesOData",
26 | enableLegacyPushRoute: true);
27 |
28 | config.Services.Replace(typeof(IExceptionLogger), new TraceExceptionLogger());
29 |
30 | // Trace.Listeners.Add(new TextWriterTraceListener(HostingEnvironment.MapPath("~/NuGet.Server.log")));
31 | // Trace.AutoFlush = true;
32 |
33 | config.Routes.MapHttpRoute(
34 | name: "NuGetDefault_ClearCache",
35 | routeTemplate: "nuget/clear-cache",
36 | defaults: new { controller = "PackagesOData", action = "ClearCache" },
37 | constraints: new { httpMethod = new HttpMethodConstraint(HttpMethod.Get) }
38 | );
39 |
40 | }
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/src/Svenkle.NuGetServer.Website/Default.aspx:
--------------------------------------------------------------------------------
1 | <%@ Page Language="C#" %>
2 |
3 | <%@ Import Namespace="NuGet.Server" %>
4 | <%@ Import Namespace="NuGet.Server.App_Start" %>
5 | <%@ Import Namespace="NuGet.Server.Infrastructure" %>
6 |
7 |
8 |
9 |
10 | NuGet Private Repository
11 |
16 |
17 |
18 |
19 |
You are running NuGet.Server v<%= typeof(NuGetODataConfig).Assembly.GetName().Version %>
20 |
21 | Click ">here to view your packages.
22 |
23 |
42 |
43 | <% if (Request.IsLocal || ServiceResolver.Current.Resolve
().GetBoolSetting("allowRemoteCacheManagement", false))
44 | { %>
45 |
54 | <% } %>
55 |
56 |
57 |
58 |
--------------------------------------------------------------------------------
/src/Svenkle.NuGetServer.Website/Packages/Readme.txt:
--------------------------------------------------------------------------------
1 | To add packages to the feed put package files (.nupkg files) in this folder.
2 | NuGet Server will automatically copy the package to the correct location.
--------------------------------------------------------------------------------
/src/Svenkle.NuGetServer.Website/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.InteropServices;
3 |
4 | // General Information about an assembly is controlled through the following
5 | // set of attributes. Change these attribute values to modify the information
6 | // associated with an assembly.
7 | [assembly: AssemblyTitle("Svenkle.NuGetServer.Website")]
8 | [assembly: AssemblyDescription("")]
9 | [assembly: AssemblyConfiguration("")]
10 | [assembly: AssemblyCompany("")]
11 | [assembly: AssemblyProduct("NuGet Server")]
12 | [assembly: AssemblyCopyright("Copyright © Svenkle 2023")]
13 | [assembly: AssemblyTrademark("")]
14 | [assembly: AssemblyCulture("")]
15 |
16 | // Setting ComVisible to false makes the types in this assembly not visible
17 | // to COM components. If you need to access a type in this assembly from
18 | // COM, set the ComVisible attribute to true on that type.
19 | [assembly: ComVisible(false)]
20 |
21 | // The following GUID is for the ID of the typelib if this project is exposed to COM
22 | [assembly: Guid("4dbc0822-4cf2-41e3-a3e1-d87c64856985")]
23 |
24 | // Version information for an assembly consists of the following four values:
25 | //
26 | // Major Version
27 | // Minor Version
28 | // Build Number
29 | // Revision
30 | //
31 | // You can specify all the values or you can default the Revision and Build Numbers
32 | // by using the '*' as shown below:
33 | [assembly: AssemblyVersion("0.0.*")]
34 |
35 |
--------------------------------------------------------------------------------
/src/Svenkle.NuGetServer.Website/Svenkle.NuGetServer.Website.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 |
8 |
9 | 2.0
10 | {C4157CB8-9CF6-4956-9570-743EF65337D7}
11 | {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}
12 | Library
13 | Properties
14 | Svenkle.NuGetServer.Website
15 | Svenkle.NuGetServer.Website
16 | v4.8
17 | true
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 | true
29 | full
30 | false
31 | bin\
32 | DEBUG;TRACE
33 | prompt
34 | 4
35 |
36 |
37 | true
38 | pdbonly
39 | true
40 | bin\
41 | TRACE
42 | prompt
43 | 4
44 |
45 |
46 |
47 | ..\..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.3.6.0\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll
48 |
49 |
50 | ..\..\packages\Microsoft.Data.Edm.5.8.4\lib\net40\Microsoft.Data.Edm.dll
51 |
52 |
53 | ..\..\packages\Microsoft.Data.OData.5.8.4\lib\net40\Microsoft.Data.OData.dll
54 |
55 |
56 | ..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll
57 |
58 |
59 | ..\..\packages\Microsoft.Web.Xdt.2.1.1\lib\net40\Microsoft.Web.XmlTransform.dll
60 |
61 |
62 | ..\..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll
63 |
64 |
65 | ..\..\packages\NuGet.Core.2.14.0\lib\net40-Client\NuGet.Core.dll
66 |
67 |
68 | ..\..\packages\NuGet.Server.3.4.2\lib\net46\NuGet.Server.dll
69 |
70 |
71 | ..\..\packages\NuGet.Server.Core.3.4.2\lib\net46\NuGet.Server.Core.dll
72 |
73 |
74 | ..\..\packages\NuGet.Server.V2.3.4.2\lib\net46\NuGet.Server.V2.dll
75 |
76 |
77 |
78 |
79 |
80 |
81 | ..\..\packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll
82 |
83 |
84 |
85 |
86 |
87 | ..\..\packages\System.Spatial.5.8.4\lib\net40\System.Spatial.dll
88 |
89 |
90 |
91 |
92 | ..\..\packages\Microsoft.AspNet.WebApi.Core.5.2.3\lib\net45\System.Web.Http.dll
93 |
94 |
95 | ..\..\packages\Microsoft.AspNet.WebApi.OData.5.7.0\lib\net45\System.Web.Http.OData.dll
96 |
97 |
98 | ..\..\packages\Microsoft.AspNet.WebApi.WebHost.5.2.3\lib\net45\System.Web.Http.WebHost.dll
99 |
100 |
101 | ..\..\packages\WebActivatorEx.2.2.0\lib\net40\WebActivatorEx.dll
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 | Web.config
116 |
117 |
118 | Web.config
119 |
120 |
121 |
122 |
123 | 10.0
124 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 | True
134 | True
135 | 60189
136 | /
137 | http://localhost:60189/
138 | False
139 | False
140 |
141 |
142 | False
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 | This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
151 |
152 |
153 |
154 |
161 |
--------------------------------------------------------------------------------
/src/Svenkle.NuGetServer.Website/Web.Debug.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/src/Svenkle.NuGetServer.Website/Web.Release.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/src/Svenkle.NuGetServer.Website/Web.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
--------------------------------------------------------------------------------
/src/Svenkle.NuGetServer.Website/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/svenkle/nuget-server/9404910fe362cf2e896e4720877b0187139c87fa/src/Svenkle.NuGetServer.Website/favicon.ico
--------------------------------------------------------------------------------
/src/Svenkle.NuGetServer.Website/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------