Compare commits

202 Commits

Author SHA1 Message Date
58f77a06ea A valid package index page 2022-10-15 18:26:55 +01:00
88c8480911 A valid registration page Index 2022-10-15 18:25:40 +01:00
c147eaf54a by Nuget version 2022-09-27 00:39:43 +01:00
e49db8e1a1 re_Vision 2022-09-26 23:34:13 +01:00
9aac183e2c Merge branch 'broken/ef' 2022-09-26 23:30:58 +01:00
037559a0b7 layout 2022-09-26 23:30:54 +01:00
9c4d45b97c + Revsion 2022-09-26 21:54:22 +01:00
9aa3140a11 WIP 2022-09-25 17:07:56 +01:00
7f9344d437 add a vscode task for ef db update 2022-09-25 16:47:31 +01:00
f46ca00de9 REORG 2022-09-25 02:24:21 +01:00
fcea41f8c1 Catalog++ 2022-09-24 12:32:00 +01:00
58f49af5f0 publish 2022-09-23 22:16:12 +01:00
fececb327e WIP reg page 2022-09-23 20:34:51 +01:00
14206ac477 catalog impl 2022-08-20 17:44:33 +01:00
fa9a12ad49 WIP Page leaf 2022-07-29 09:06:59 +01:00
7f9984b059 WIP page leaf 2022-07-10 17:05:16 +01:00
2dcf1a2806 refacts 2022-07-03 14:50:57 +01:00
a84e1d9750 Corrige la suppression de paquets 2022-06-19 21:40:31 +01:00
97eba2390e https redirection 2022-06-19 14:17:49 +01:00
6c9f29bc56 MEF 2022-06-19 14:17:36 +01:00
2d5438c943 presentation 2022-06-18 15:44:06 +01:00
519a4fbd46 Okey 2022-06-16 17:03:38 +01:00
a11bab759e retour sur la MEF du footer 2022-05-25 19:17:31 +01:00
d7f0a5db36 Footer layout 2022-05-25 09:07:36 +01:00
5d59760a77 version bump 2022-04-24 15:13:12 +01:00
3e09afcbfe Errors to Error std output 2022-04-18 20:59:36 +01:00
8fa4c04367 naming 2022-04-18 20:58:14 +01:00
60e4ca8c54 ex to output 2022-04-17 23:30:48 +01:00
da92b9dbec er 2022-04-17 22:33:06 +01:00
6194e185b9 gitversion tool 2022-04-17 22:30:33 +01:00
5c1a49811a Versioning 2022-04-17 20:36:28 +01:00
328f6f166a deploy 2022-04-17 17:59:15 +01:00
4191513eef Compilation warns 2022-04-17 16:22:40 +01:00
217cc49019 Versionning 2022-04-17 14:48:18 +01:00
a4a1c6e271 WIP NuGet API 3.5.0 2022-04-17 14:10:20 +01:00
c06f518836 fixing url's 2022-04-16 03:55:37 +01:00
edc9628b67 testing config 2022-04-16 03:10:12 +01:00
4bb43877c7 Build test host using given app config file 2022-04-16 02:35:20 +01:00
ce8b7bcdb3 Fixes the 500 2022-04-16 01:30:33 +01:00
67ec19184b reposted a pkg 2022-04-15 23:56:15 +01:00
57609e6ed3 Response status code does not indicate success: 500 (Internal Server Error). 2022-04-15 22:54:05 +01:00
b46e786ace warn-- 2022-04-11 20:36:45 +01:00
423f9c15b3 not working by me. 2022-04-11 20:05:35 +01:00
6d21d7370c test 2022-04-11 19:57:30 +01:00
ee07affbbd ... 2022-04-11 01:48:43 +01:00
cba0720150 sources set-default 2022-04-10 18:07:14 +01:00
a2d91e072f ... 2022-04-09 19:53:41 +01:00
1befc2e053 ... 2022-04-09 19:53:26 +01:00
df55836c58 fixes the isn client update 2021-09-13 23:50:20 +01:00
cd3629a5a0 dark theme, logo, tests 2021-09-13 23:28:56 +01:00
51a08dec9a icon 2021-09-12 22:51:28 +01:00
386eec262d dark theme 2021-09-12 20:45:43 +01:00
45d6c22d1e bad config file path 2021-09-12 17:17:36 +01:00
225c8ef588 bad config file name 2021-09-12 17:14:51 +01:00
290a3047b5 echo settings file path 2021-09-12 17:08:14 +01:00
ec70927830 env is Dev 2021-09-12 17:02:21 +01:00
9f338ca09f testing app settings for ci 2021-09-12 17:00:30 +01:00
cfd63fe68d default source apikey 2021-09-12 16:47:26 +01:00
f33ca22255 uhnit testing from vscode 2021-09-08 01:55:00 +01:00
e6f4349621 reorg 2021-09-05 19:33:39 +01:00
903f5157d2 unleash migrates 2021-09-05 19:24:21 +01:00
066c038e4d web ui 2021-09-05 18:55:38 +01:00
95aae91156 Refactorisation of deletion 2021-09-05 17:10:50 +01:00
6dd76ac1a5 REORG+histo 2021-09-05 15:44:47 +01:00
459f8ea422 nodejs ... 2021-09-04 13:55:06 +01:00
5607c53329 Fixes the base resource 2021-09-04 13:41:00 +01:00
71de903f13 bodies 2021-09-03 03:07:58 +01:00
a92bee32e1 CQ 2021-09-02 23:37:28 +01:00
7a835c5c95 Fixes the versionCommit migration 2021-08-29 22:27:12 +01:00
f918d26273 catalog updated at push 2021-08-29 00:51:43 +01:00
25d545e327 isn as net472 assembly 2021-08-29 00:31:19 +01:00
57feb53e82 Fixe l'Url du paquet dans le catalogue 2021-08-29 00:18:16 +01:00
b7dae240cd Catalog packages 2021-08-29 00:08:34 +01:00
d8bfdc293d catalog index 2021-08-28 21:26:39 +01:00
f6fa7a0ec9 unit tests and pkg version commits 2021-08-28 18:41:47 +01:00
55e407d951 commit version 2021-08-27 21:25:33 +01:00
cdb9a26d2c Catalog 2021-08-23 03:21:08 +01:00
504f431937 refact 2021-08-15 19:09:01 +01:00
7da74b0dfb dep & tags 2021-08-15 16:21:34 +01:00
6520d8e4cc dotnet 2021-08-15 14:09:11 +01:00
55b74a584a msbuild 2021-08-15 14:03:53 +01:00
0ec9889e96 msbuild ci tag 2021-08-15 14:02:29 +01:00
b17ee8be75 Settings 2021-08-15 12:59:31 +01:00
f6f3473346 protect 2021-08-15 05:32:08 +01:00
ae114c68db refacts 2021-08-15 01:50:07 +01:00
5f0dfee768 bug on config 2021-08-13 18:55:25 +01:00
9ee058e1c8 bootstrap upgrade 2021-08-12 01:32:20 +01:00
30d81c06df update git ignore list 2021-08-12 01:06:21 +01:00
3845e2c9c4 serve 2021-08-12 01:04:39 +01:00
74427cc15e better Display 2021-08-12 00:38:16 +01:00
5c188b57fc cleaning 2021-08-12 00:02:40 +01:00
74ffc8e83e Prre release buton 2021-08-12 00:01:11 +01:00
7f0518ec82 Put it better 2021-08-11 23:59:08 +01:00
58750587d0 pkg upd by no db 2021-08-11 23:25:15 +01:00
bd1c47e7c6 throw 2021-08-11 20:57:46 +01:00
f7b375ad50 isnapikey 2021-08-11 20:52:50 +01:00
558d5fc8ae . 2021-08-11 20:45:40 +01:00
fff4599ff4 fixes the put 2021-08-10 00:10:26 +01:00
e356636539 Client installation notes 2021-07-12 03:35:03 +01:00
1aef7ce614 upgrade notes 2021-07-12 03:23:11 +01:00
82cec8eece Api Key view 2021-07-12 02:17:26 +01:00
cd7c0be03d Unleash client instance as singleton 2021-07-11 22:13:48 +01:00
a345992351 isn brand fix 2021-07-11 20:15:50 +01:00
5e74b24439 refact & client install notes 2021-07-11 20:04:12 +01:00
451d810ade using async methods 2021-07-11 19:20:56 +01:00
6f82a0a00f Activer le serveur 2021-07-11 19:14:55 +01:00
48ca2df19e async calls 2021-07-11 18:09:02 +01:00
355b2d4c7c Unleash client init 2021-07-11 18:08:49 +01:00
d33a19d35f installation instructions 2021-07-11 18:07:45 +01:00
5a783edac2 Pipline status 2021-07-05 21:46:18 +01:00
32d25733af ci fix due to refact 2021-07-05 21:30:49 +01:00
709e1433bb isntallation steps 2021-07-05 21:24:37 +01:00
476d35ae8a refact 2021-07-05 12:55:52 +01:00
5de53a3cba rebrand 2021-06-27 01:53:00 +01:00
ae6abc104a resources 2021-06-22 23:03:38 +01:00
eba75d0db4 getversions 2021-06-22 01:25:28 +01:00
aaa49788dc autocomplete 2021-06-22 00:10:01 +01:00
b8809deaa1 search 2021-06-21 23:38:05 +01:00
6fcad7c252 MAJ de la description À l'incrément de version 2021-06-21 01:51:57 +01:00
2c31ffb7c4 ignorer une version existante en base mais pas sur le disque 2021-06-21 01:49:19 +01:00
58501329ac removes auto devops 2021-06-21 00:58:44 +01:00
8c25889e88 not only main 2021-06-20 07:07:54 +01:00
90b8913e98 master => main 2021-06-20 07:01:37 +01:00
c88dccd950 reference some env 2021-06-20 06:41:26 +01:00
963ce8579c Update .gitlab-ci.yml 2021-06-20 05:28:47 +00:00
1c1964eb2c renames the 'deploy' job 2021-06-20 05:19:13 +01:00
a5d6e08945 Merge branch 'set-sast-config-1' into 'master'
Set .gitlab-ci.yml to enable or configure SAST

See merge request Paul/nuget-host!1
2021-06-20 04:09:43 +00:00
21b51d4cbd Set .gitlab-ci.yml to enable or configure SAST 2021-06-20 04:07:59 +00:00
27634c3159 api key settings 2021-06-19 00:41:05 +01:00
a11c30e782 re-ignore already present 2021-06-19 00:31:29 +01:00
5cb35f54d5 ci & admin & auth & cli 2021-06-18 23:57:02 +01:00
981f3209e0 ignore code 1 2021-06-18 21:16:38 +01:00
3fa1241ea2 cleaning 2021-06-18 20:44:20 +01:00
c14adcdd80 try++ 2021-06-16 20:19:08 +01:00
25069e5aa2 try++ 2021-06-16 20:14:53 +01:00
b341fdfa4d trying and fix 401 2021-06-16 20:10:33 +01:00
e88763df09 simplified 2021-06-16 19:39:58 +01:00
c456a28282 re push 2021-06-14 19:59:16 +01:00
f7cfeeba8d add source or true 2021-06-14 00:57:06 +01:00
7752620bef deploy src/**/*.nupkg 2021-06-14 00:53:59 +01:00
4fa03c5a1d link warn & deploy to gitlab 2021-06-14 00:46:09 +01:00
61ba3b2bf8 a valid nuget local repo 2021-05-23 20:21:46 +01:00
1266dd54db nugetd 2021-05-23 01:00:57 +01:00
be30ef3c25 gestion des versions :
* dossier des versions = FullString
* Suppressioni de versions
2021-05-22 22:49:57 +01:00
41fbe54638 minor change 2021-05-20 20:35:11 +01:00
d80271dcbf permissions sur le paquet 2021-05-20 20:24:03 +01:00
3a59b8304a [{"PkgName":"nuget-cli.1.0.0.nupkg","Executed":true,"OK":true,"AlreadyPresent":false,"Message":"{\"versionId\":\"nuget-host, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null\",\"files\":[\"nuget-cli-1.0.0.nupkg\"]}","StatusCode":"OK","StackTrace":null}] 2021-05-18 23:17:48 +01:00
f6a27fa919 don't use redirection 2021-05-18 02:58:52 +01:00
e51da7f359 TODO policy on existing zip from fs 2021-05-18 00:39:03 +01:00
e4511a8aaa owner id 2021-05-16 14:07:14 +01:00
9575dd2754 report.OK 2021-05-16 05:33:05 +01:00
54a900c361 Merge branch 'master' of gitlab.pschneider.fr:Paul/nuget-host 2021-05-16 02:51:20 +01:00
efb004ee08 Fixe l'envoi du fichier 2021-05-16 02:41:36 +01:00
e0a3ec0bd5 Ok 2021-05-16 02:13:58 +01:00
d7cabaad8b using web request 2021-05-16 01:31:12 +01:00
9adad9a327 refact 2021-05-15 18:38:11 +01:00
3d3a6cf017 refact 2021-05-15 18:36:42 +01:00
2f4ff1e774 return to canonical usage 2021-05-15 04:45:54 +01:00
9289b3af91 no more nuget 2021-05-14 21:48:01 +01:00
90cfc29492 cli to msbuild 2021-05-14 03:15:34 +01:00
c83ff84370 Don't merge. 2021-05-14 01:41:52 +01:00
d117f26c77 seeing some PUT 2021-05-14 01:41:16 +01:00
c2f38800aa ... 2021-05-13 23:05:19 +01:00
a8c9b7619f TODO cli output 2021-05-11 23:44:43 +01:00
97dec15153 push 2021-05-11 23:01:11 +01:00
512495d10b ci test 2021-05-11 20:52:39 +01:00
5bbcf9cb29 cli helped 2021-05-11 02:38:52 +01:00
b6098c28a6 refact 2021-05-10 23:03:59 +01:00
36e1137e50 sln 2021-05-10 21:36:08 +01:00
3086cc65c4 clean 2021-05-10 21:32:29 +01:00
4cec5d0229 launch 2021-05-09 18:07:48 +01:00
61dc82df5b artifacts 2021-05-09 16:28:20 +01:00
db6f514fb5 .... 2021-05-09 15:49:52 +01:00
cc675844b6 ... 2021-05-09 15:41:05 +01:00
f95765f541 not user-secret 2021-05-09 15:35:05 +01:00
e5d3ba36cc testing? 2021-05-09 15:33:14 +01:00
ffb7cad00a Réussi! - échec : 0, réussite : 2, ignorée(s) : 0, total : 2, durée : 444 ms 2021-05-09 14:56:32 +01:00
6a59f776d5 refact 2021-05-09 13:45:55 +01:00
93394b3e82 api key unprotected 2021-05-09 03:06:23 +01:00
d063f10da5 c'est pas ici! 2021-05-09 02:02:50 +01:00
bb02706773 apikey.creationdate 2021-05-09 01:52:55 +01:00
915736c4e2 migrate database 2021-05-08 23:51:40 +01:00
b550f05c4f typo 2021-05-08 22:01:37 +01:00
dd4dd9321b ci++ 2021-05-08 21:50:59 +01:00
a238bd8cbf arts2 2021-05-08 21:47:24 +01:00
fb822b6aaf yml 2021-05-08 21:43:28 +01:00
ffd1dca16e artfcts 2021-05-08 21:40:03 +01:00
198189ab09 fixes build 2021-05-08 21:27:22 +01:00
ccbdd155f3 ci 2021-05-08 21:18:43 +01:00
445ea24dd2 ngh 2021-05-08 20:44:40 +01:00
48df937b7f Add .gitlab-ci.yml 2021-05-08 15:02:19 +00:00
10b1fd0748 Add LICENSE 2021-05-08 14:59:27 +00:00
15fa91138d version 2021-05-08 15:36:56 +01:00
dd6d83cf06 ApiKey 2021-05-08 15:27:46 +01:00
749eb645d5 refactorisation de la configuration 2021-05-02 15:22:46 +01:00
838de379fd Removes IdentityServer4 usage 2021-05-01 16:43:57 +01:00
dc37c9a9f0 adds aspnet.identity 2021-04-25 12:12:50 +01:00
a2f26f1e8e base namespace to nuget_host 2021-04-17 14:19:00 +01:00
1b2d850522 refact 2021-04-11 22:39:26 +01:00
ec5bd7ca1f builds 2021-04-11 22:22:37 +01:00
cede04a33e more references. 2021-04-10 14:11:09 +01:00
5b6d74d8ee protecting api 2021-04-08 03:08:20 +01:00
1790 changed files with 10234 additions and 240974 deletions

2
.build
View File

@ -18,7 +18,7 @@
<target name="build" description="build all">
<exec program="dotnet" commandline="build" />
</target>
<target name="test" description="test all">
<target name="test" description="build all">
<exec program="dotnet" commandline="test" />
</target>
</project>

12
.gitignore vendored
View File

@ -6,16 +6,18 @@
/src/isn/.vscode/
/test/isnd.tests/obj/
/test/isnd.tests/bin/
/packages/
bower_components/
/test/isn.tests/bin
/test/isn.tests/obj/
appsettings.Testing.json
appsettings.Development.json
/wwwroot/.sass-cache/
/src/isnd/wwwroot/.sass-cache/
/src/isn.abst/bin
/src/isn.abst/obj
/src/isnd/packages/
/test/data/test-isn/bin/
/test/data/test-isn/obj
.fake
/artifacts/
/.vs/
/.vscode/
appsettings.Development.json
artifacts/

29
.vs/isn/xs/UserPrefs.xml Normal file
View File

@ -0,0 +1,29 @@
<Properties StartupConfiguration="{9D758F00-17FF-433D-B088-F9C2D97C9BD1}|Default">
<MonoDevelop.Ide.Workbench ActiveDocument="src/isnd/isnd.csproj">
<Files>
<File FileName="src/isn/Program.cs" Line="55" Column="48" />
<File FileName="src/isnd/isnd.csproj" Line="15" Column="56" />
</Files>
<Pads>
<Pad Id="ProjectPad">
<State name="__root__">
<Node name="isn" expanded="True">
<Node name="src" expanded="True">
<Node name="isnd" selected="True" />
</Node>
<Node name="test" expanded="True" />
</Node>
</State>
</Pad>
</Pads>
</MonoDevelop.Ide.Workbench>
<MonoDevelop.Ide.ItemProperties.src.isnd PreferredExecutionTarget="MonoDevelop.Default" />
<MonoDevelop.Ide.DebuggingService.PinnedWatches />
<MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" />
<MonoDevelop.Ide.ItemProperties.test.isnd.tests PreferredExecutionTarget="MonoDevelop.Default" />
<MonoDevelop.Ide.DebuggingService.Breakpoints>
<BreakpointStore />
</MonoDevelop.Ide.DebuggingService.Breakpoints>
<MultiItemStartupConfigurations />
<MonoDevelop.Ide.ItemProperties.src.isn PreferredExecutionTarget="MonoDevelop.Default" />
</Properties>

48
.vscode/launch.json vendored Normal file
View File

@ -0,0 +1,48 @@
{
// Utilisez IntelliSense pour en savoir plus sur les attributs possibles.
// Pointez pour afficher la description des attributs existants.
// Pour plus d'informations, visitez : https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach"
},
{
"name": "push",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/src/isn/bin/Debug/netcoreapp2.1/isn.dll",
"requireExactSource": false,
"args": [
"push", "/home/paul/Nupkgs/Yavsc.Abstract.1.0.8.nupkg"
],
"cwd": "${workspaceFolder}/src/isn",
"stopAtEntry": false,
"console": "internalConsole"
},
{
"name": "web",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/src/isnd/bin/Debug/netcoreapp2.1/isnd.dll",
"args": [],
"cwd": "${workspaceFolder}/src/isnd",
"stopAtEntry": false,
"requireExactSource": false,
"serverReadyAction": {
"action": "openExternally",
"pattern": "\\bNow listening on:\\s+(https?://\\S+)"
},
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"sourceFileMap": {
"/Views": "${workspaceFolder}/Views"
}
}
]
}

52
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,52 @@
{
"omnisharp.msbuild": true,
"dotnet-test-explorer.testProjectPath": "**/*tests.csproj",
"dotnet-test-explorer.runInParallel": false,
"dotnet-test-explorer.showCodeLens": true,
"dotnet-test-explorer.testArguments": "",
"nxunitExplorer.modules": [
"test/i*/bin/Debug/*/*.tests.dll"
],
"nxunitExplorer.skippattern": "",
"dotnetCoreExplorer.runEnvVars": {
"ASPNETCORE_ENVIRONMENT": "Testing"
},
"dotnetCoreExplorer.searchpatterns": "test/**/bin/**/*.tests.{dll,exe}",
"sqltools.connections": [
{
"previewLimit": 50,
"server": "localhost",
"port": 5432,
"driver": "PostgreSQL",
"name": "isndev",
"group": "isn",
"database": "dotnetmvc",
"username": "dotnetmvc",
"password": "RvJa=y#b/tfg"
},
{
"previewLimit": 50,
"server": "localhost",
"port": 5432,
"askForPassword": true,
"driver": "PostgreSQL",
"name": "isnd",
"group": "isn",
"database": "webid",
"username": "webid"
},
{
"previewLimit": 50,
"server": "localhost",
"port": 5432,
"askForPassword": true,
"driver": "PostgreSQL",
"name": "isnddev",
"group": "isn",
"database": "isnd",
"username": "paul"
}
],
"omnisharp.disableMSBuildDiagnosticWarning": true,
"omnisharp.enableRoslynAnalyzers": false
}

View File

@ -0,0 +1,8 @@
using System;
namespace {{namespace}}
{
public class {{name}}
{
}
}

View File

@ -0,0 +1,3 @@
export class {{name}} {
}

View File

@ -0,0 +1,9 @@
Imports System
Namespace {{namespace}}
Public Class {{name}}
End Class
End Namespace

View File

@ -0,0 +1,3 @@
export default {{name}} {
}

View File

@ -0,0 +1,8 @@
using System;
namespace {{namespace}}
{
public enum {{name}}
{
}
}

View File

@ -0,0 +1,8 @@
using System;
namespace {{namespace}}
{
public interface {{name}}
{
}
}

View File

@ -0,0 +1,3 @@
export interface {{name}} {
}

View File

@ -0,0 +1,46 @@
{
"templates": [
{
"name": "Class",
"extension": "cs",
"file": "./class.cs-template",
"parameters": "./template-parameters.js"
},
{
"name": "Interface",
"extension": "cs",
"file": "./interface.cs-template",
"parameters": "./template-parameters.js"
},
{
"name": "Enum",
"extension": "cs",
"file": "./enum.cs-template",
"parameters": "./template-parameters.js"
},
{
"name": "Class",
"extension": "ts",
"file": "./class.ts-template",
"parameters": "./template-parameters.js"
},
{
"name": "Interface",
"extension": "ts",
"file": "./interface.ts-template",
"parameters": "./template-parameters.js"
},
{
"name": "Default",
"extension": "ts",
"file": "./default.ts-template",
"parameters": "./template-parameters.js"
},
{
"name": "Class",
"extension": "vb",
"file": "./class.vb-template",
"parameters": "./template-parameters.js"
}
]
}

View File

@ -0,0 +1,17 @@
var path = require("path");
module.exports = function(filename, projectPath, folderPath) {
var namespace = "Unknown";
if (projectPath) {
namespace = path.basename(projectPath, path.extname(projectPath));
if (folderPath) {
namespace += "." + folderPath.replace(path.dirname(projectPath), "").substring(1).replace(/[\\\/]/g, ".");
}
namespace = namespace.replace(/[\\\-]/g, "_");
}
return {
namespace: namespace,
name: path.basename(filename, path.extname(filename))
}
};

66
.vscode/tasks.json vendored
View File

@ -1,6 +1,18 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "restore",
"command": "dotnet",
"type": "process",
"args": [
"restore",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary",
"--ignore-failed-sources"
],
"problemMatcher": "$msCompile"
},
{
"label": "build",
"command": "dotnet",
@ -9,10 +21,10 @@
"build",
"/p:Configuration=Debug",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
"/consoleloggerparameters:NoSummary",
"--ignore-failed-sources"
],
"problemMatcher": "$msCompile",
"group": "build"
"problemMatcher": "$msCompile"
},
{
"label": "db-upgrade",
@ -29,9 +41,23 @@
"env": {
"ASPNETCORE_ENV": "Development"
}
},
"dependsOn":["build"],
"group": "test"
}
},
{
"label": "buildcli",
"command": "msbuild",
"type": "process",
"args": [
"src/isn",
"/p:Configuration=Debug",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary",
"/restore"
],
"problemMatcher": "$msCompile"
},
{
"label": "publish",
@ -48,8 +74,24 @@
"problemMatcher": "$msCompile",
"options": {
"cwd": "${workspaceFolder}"
},
"group": "none"
}
},
{
"label": "monopublish",
"command": "msbuild",
"type": "process",
"args": [
"/t:publish",
"/p:TargetFramework=netcoreapp2.1;PublishDir=${workspaceFolder}/artiffacts;RuntimeIdentifier=linux-x64",
],
"problemMatcher": "$msCompile"
},
{
"label": "copyTestConfig",
"command": "dotnet",
"type": "process",
"args": [ "build", "/t:CopyTestConfig" ]
},
{
"label": "test",
@ -57,7 +99,7 @@
"type": "process",
"options": {
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
"ASPNETCORE_ENVIRONMENT": "Testing"
}
},
"args": [
@ -66,8 +108,7 @@
"--logger:xunit"
],
"problemMatcher": "$msCompile",
"dependsOn": [ "build"],
"group": "test"
"dependsOn": [ "build", "copyTestConfig"]
},
{
"label": "watch",
@ -83,8 +124,7 @@
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"problemMatcher": "$msCompile",
"group": "none"
"problemMatcher": "$msCompile"
}
]
}

View File

@ -1,10 +0,0 @@
<Project>
<PropertyGroup>
<Version>1.0.8</Version>
<Authors>paul</Authors>
<Copyright>WFPL</Copyright>
<ProjectUrl></ProjectUrl>
<RepositoryUrl></RepositoryUrl>
<RepositoryType>git</RepositoryType>
</PropertyGroup>
</Project>

5
GitVersion.yml Normal file
View File

@ -0,0 +1,5 @@
mode: Mainline
branches: {}
ignore:
sha: []
merge-message-formats: {}

View File

@ -1,49 +0,0 @@
CONFIGURATION=Debug
TARGETFV=net8.0
all: build-isn build-isnd
build-%: src/%
dotnet build -p:Configuration=$(CONFIGURATION) $^
pack-%: src/%
dotnet pack $^
watch:
dotnet watch --project=src/isnd
test-push:
isn push src/isn/bin/Debug/isn.*.nupkg
clean-src-%: src/%
rm -rf $^/bin $^/obj
clean-test-%: test/%
rm -rf $^/bin $^/obj
packs: pack-isn pack-isnd pack-isn.abst
clean: clean-src-isnd clean-src-isn clean-src-isn.abst clean-test-isnd.tests clean-test-isn.tests
TARGETFRAMEWORK=net9.0
server-update:
dotnet build -c Release src/isnd
dotnet publish -c Release -f $(TARGETFRAMEWORK) src/isnd
sudo systemctl stop isnd
sudo cp -a src/isnd/bin/Release/$(TARGETFRAMEWORK)/publish/* /srv/www/isnd
sudo systemctl start isnd
client-update:
dotnet build -c Release src/isn
# MAJ du client
sudo cp -a src/isn/bin/Release/$(TARGETFRAMEWORK)/* /usr/local/lib/isn
sudo chown -R root:root /usr/local/lib/isn
src/isn.abst/bin/Release/isn.abst.1.0.24.nupkg:
dotnet pack src/isn.abst -c Release
push-test: src/isn.abst/bin/Release/isn.abst.1.0.24.nupkg
isn push -s "http://localhost:3002/v3/index.json" src/isn.abst/bin/Release/isn.abst.1.0.24.nupkg

View File

@ -1,6 +1,6 @@
# ISN
Hébergement de paquets logiciels Nuget, fournissant une implémentation minimale de l'API Nuget V3
[![pipeline status](http://gitlab.pschneider.fr/Paul/nuget-host/badges/main/pipeline.svg)](http://gitlab.pschneider.fr/Paul/nuget-host/-/commits/main)
## Usage
@ -18,41 +18,26 @@ wget http://localhost:5000/package/index.json?q=your&prerelease=true&semVerLevel
## Installation
### Compilation
Dans le dossier de la solution, compiler la solution :
Depuis le dossier de la solution, compiler la solution :
````bash
dotnet build /restore -c Release
dotnet publish -c Release src/isnd
dotnet publish -c Release
````
### Déploiement du serveur
La livraison initiale, aujourd'hui :
### Déploiement
````bash
sudo mkdir -p /srv/www/isnd
sudo cp -a src/isnd/bin/Release/net9.0/publish/* /srv/www/isnd
sudo cp contrib/isnd.service /etc/systemd/system
chown -R isn:isn /srv/www/isnd/
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
````
Une base de donées Postgresql est requise, avec, pour faire simple,
son utilisateur, et le droit de créer des tables (ce dernier droit pourrait expirer, mais gare aux mises à jour).
Il faudra éditer la configuration pour indiquer :
* dans /etc/systemd/system/isnd.service , la connextion à une base de donnée Postresgql, sous la forme :
`"Server=<pgserver>;Port=<pgport>;Database=<dbname>;Username=<dbusername>;Password=<dbpass>;"`
* dans /srv/www/isnd/appsettings.Production.json, la connection au serveur de messagerie,
* l'URL externe du ou des sites à propulser, et à utiliser dans la description de service,
* et les autres détails.
Pour faire ceci, vous pourrez éditer une copie du fichier `appsettings.json` vers `appsettings.Production.json`,
pour renseigner toutes les valeurs spécifiées.
* Créer une base de donées Postgresql,
* ajuster un fichier de configuration `/srv/www/isnd/appsettings.Production.json`
* Démarrer le serveur :
````bash
@ -65,36 +50,76 @@ sudo systemctl start isnd
sudo systemctl enable isnd
````
### Installation du client
````bash
sudo mkdir /usr/local/lib/isn
sudo cp -a src/isn/bin/Release/net6.0/* /usr/local/lib/isn
sudo cp -a src/isn/bin/Release/netcoreapp2.1/* /usr/local/lib/isn
sudo chown -R root.root /usr/local/lib/isn
sudo ln -s /usr/local/lib/isn/isn /usr/local/bin/isn
````
### Mises à jour
Dans le détail, la séquence serait du style :
````bash
# compiler tout
dotnet build -c Release
dotnet publish -c Release -f net9.0 src/isnd
dotnet publish -c Release -f netcoreapp2.1 src/isnd
# MAJ du serveur
sudo systemctl stop isnd
sudo cp -a src/isnd/bin/Release/net9.0/publish/* /srv/www/isnd
sudo cp -a src/isnd/bin/Release/netcoreapp2.1/publish/* /srv/www/isnd
sudo systemctl start isnd
# MAJ du client
sudo cp -a src/isn/bin/Release/net9.0/* /usr/local/lib/isn
sudo chown -R root:root /usr/local/lib/isn
sudo cp -a src/isn/bin/Release/netcoreapp2.1/* /usr/local/lib/isn
sudo chown -R root.root /usr/local/lib/isn
````
On pourra cibler "client-update" ou "server-update", à la construction :
## TODO
```json
{
"@id": "https://api.nuget.org/v3/registration5-semver1/",
"@type": "RegistrationsBaseUrl",
"comment": "Base URL of Azure storage where NuGet package registration info is stored"
},
{
"@id": "https://api.nuget.org/v3-flatcontainer/",
"@type": "PackageBaseAddress/3.0.0",
"comment": "Base URL of where NuGet packages are stored, in the format https://api.nuget.org/v3-flatcontainer/{id-lower}/{version-lower}/{id-lower}.{version-lower}.nupkg"
},
{
"@id": "https://api.nuget.org/v3/registration5-semver1/",
"@type": "RegistrationsBaseUrl/3.0.0-rc",
"comment": "Base URL of Azure storage where NuGet package registration info is stored used by RC clients. This base URL does not include SemVer 2.0.0 packages."
},
{
"@id": "https://api.nuget.org/v3/registration5-semver1/",
"@type": "RegistrationsBaseUrl/3.0.0-beta",
"comment": "Base URL of Azure storage where NuGet package registration info is stored used by Beta clients. This base URL does not include SemVer 2.0.0 packages."
},
{
"@id": "https://www.nuget.org/packages/{id}/{version}?_src=template",
"@type": "PackageDetailsUriTemplate/5.1.0",
"comment": "URI template used by NuGet Client to construct details URL for packages"
},
{
"@id": "https://api.nuget.org/v3/registration5-gz-semver2/",
"@type": "RegistrationsBaseUrl/3.6.0",
"comment": "Base URL of Azure storage where NuGet package registration info is stored in GZIP format. This base URL includes SemVer 2.0.0 packages."
},
````bash
make server-update
make client-update
````

3
contrib/isn Executable file
View File

@ -0,0 +1,3 @@
#!/bin/bash
/usr/bin/mono /usr/local/lib/isn/isn.exe $*

110
contrib/isnd Normal file
View File

@ -0,0 +1,110 @@
#!/bin/bash
### BEGIN INIT INFO
# Provides: isnd
# Required-Start: $local_fs $network $named $time $syslog $postgresql
# Required-Stop: $local_fs $network $named $time $syslog $postgresql
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Description: Script to run asp.net 5 application in background
### END INIT INFO
# Author: Ivan Derevianko aka druss <drussilla7@gmail.com>
# Modified by: Paul Schneider <redienhcs.luap@gmail.com>
. /lib/init/vars.sh
. /lib/lsb/init-functions
NAME=isnd
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
TMP_SAVE_runlevel_VAR=$runlevel
unset runlevel
running() {
if [ -f $PIDFILE ]
then
PID=$(cat $PIDFILE)
if kill -0 $PID 2>/dev/null
then
return 0
fi
fi
return 1
}
export WWW_USER=www-data
export ROOT=/srv/www/${NAME}
export DESC="$NAME"
export PIDFILE=/var/run/kestrel-${NAME}.pid
export LOGDIR=/var/log
export DOTNET_CLI_HOME=$ROOT
export ASPDOTNETCORE_ENVIRONMENT=Production
export ASPDOTNETCORE_LOGLEVEL=Information
status() {
if running;
then
echo "Service running $DESC ($NAME; pid: $PID)"
else
echo "Service stopped $DESC ($NAME)"
fi
echo WWW_USER: $WWW_USER ROOT:$ROOT DESC: $DESC NAME: $NAME PIDFILE: $PIDFILE LOGDIR=$LOGDIR
}
start() {
if running; then
echo "Service already running $DESC" "$NAME"
log_end_msg 0
else
cd $ROOT
log_daemon_msg "Starting service $NAME for user $WWW_USER"
if ! start-stop-daemon -SbmCv -u $WWW_USER -p $PIDFILE -d $ROOT -g www-data -x /usr/bin/dotnet isnd.dll run > "${LOGDIR}/kestrel-${NAME}.log"
then
log_daemon_msg "Could not start $NAME : $?, see ${LOGDIR}/kestrel-${NAME}.log"
log_end_msg 2
else
log_daemon_msg "Service $DESC started ($NAME), logs: ${LOGDIR}/kestrel-${NAME}.log"
log_end_msg 0
fi
fi
}
stop() {
if running
then
log_daemon_msg "Stopping service $NAME"
start-stop-daemon -K -p "$PIDFILE"
log_daemon_msg "$DESC stopped"
log_end_msg 0
else
log_daemon_msg "$DESC Service not running"
log_end_msg 1
fi
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
status)
status
;;
*)
echo "Usage: $0 {start|stop|restart}"
esac
export runlevel=$TMP_SAVE_runlevel_VAR

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<apikeys>
</apikeys>
<packageSources>
<add key="myIsnDev" value="http://localhost:5000/index.json" protocolVersion="3" />
</packageSources>
</configuration>

View File

@ -0,0 +1,2 @@
nuget install -Verbosity detailed -Source http://localhost:5000/index.json -Prerelease Yavsc.Abstract
nuget locals all -clear

View File

@ -0,0 +1,4 @@
= URL's
<http://localhost:5000/v3.4.0/registration/yavsc.abstract/index.json>

13
contrib/upgrade-isn-isnd.sh Executable file
View File

@ -0,0 +1,13 @@
#!/bin/bash
set -e
# compiler tout
dotnet build -c Release
dotnet publish -c Release -f netcoreapp2.1 src/isnd
# MAJ du serveur
sudo systemctl stop isnd
sudo cp -a src/isnd/bin/Release/netcoreapp2.1/publish/* /srv/www/isnd
sudo systemctl start isnd
# MAJ du client
sudo cp -a src/isn/bin/Release/netcoreapp2.1/* /usr/local/lib/isn
sudo chown -R root.root /usr/local/lib/isn

View File

@ -1,8 +0,0 @@
yavsc for Debian
Please edit this to provide information specific to
this yavsc Debian package.
(Automatically generated by debmake Version 4.5.1)
-- Paul Schneider <paul@localhost> Sun, 08 Jun 2025 01:41:54 +0100

14
debian/README.source vendored
View File

@ -1,14 +0,0 @@
yavsc for Debian
See Debian policy manual section 4.14.
https://www.debian.org/doc/debian-policy/ch-source.html#source-package-handling-debian-readme-source
If running dpkg-source -x on a source package doesnt produce the source of the
package, ready for editing, and allow one to make changes and run
dpkg-buildpackage to produce a modified package without taking any additional
steps, creating this file explain how to do all of these is recommended.
Otherwise, remove this file.
(Automatically generated by debmake Version 4.5.1)
-- Paul Schneider <paul@localhost> Sun, 08 Jun 2025 01:41:54 +0100

6
debian/changelog vendored
View File

@ -1,6 +0,0 @@
yavsc (1.1.0-1) UNRELEASED; urgency=low
* Initial release. Closes: #nnnn
<nnnn is the bug number of your ITP>
-- Paul Schneider <paul@localhost> Sun, 08 Jun 2025 01:41:54 +0100

1
debian/clean vendored
View File

@ -1 +0,0 @@
# You must remove unused comment lines for the released package.

21
debian/control vendored
View File

@ -1,21 +0,0 @@
Source: yavsc
Section: unknown
Priority: optional
Maintainer: Paul Schneider <paul@localhost>
Build-Depends:
debhelper-compat (= 13),
Standards-Version: 4.7.0
Homepage: <insert the upstream URL, if relevant>
Rules-Requires-Root: no
#Vcs-Git: https://salsa.debian.org/debian/yavsc.git
#Vcs-Browser: https://salsa.debian.org/debian/yavsc
Package: yavsc
Architecture: any
Multi-Arch: foreign
Depends:
${misc:Depends},
${shlibs:Depends},
Description: auto-generated package by debmake
This Debian binary package was auto-generated by the
debmake(1) command provided by the debmake package.

2092
debian/copyright vendored

File diff suppressed because it is too large Load Diff

2
debian/dirs vendored
View File

@ -1,2 +0,0 @@
# You must remove unused comment lines for the released package.

2
debian/gbp.conf vendored
View File

@ -1,2 +0,0 @@
[DEFAULT]
upstream-tag=v%(version)s

2
debian/install vendored
View File

@ -1,2 +0,0 @@
# You must remove unused comment lines for the released package.

2
debian/links vendored
View File

@ -1,2 +0,0 @@
# You must remove unused comment lines for the released package.

View File

@ -1,7 +0,0 @@
# see: dh_installdeb(1), dpkg-maintscript-helper(1)
# For renaming a conffile, you are advised to uncomment and edit the following
#dpkg-maintscript-helper mv_conffile old-conffile new-conffile prior-version package
# For switching a symlink to directory, you are advised to uncomment and edit the following
#dpkg-maintscript-helper symlink_to_dir pathname old-target prior-version package
# For switching a directory to symlink, you are advised to uncomment and edit the following
#dpkg-maintscript-helper dir_to_symlink pathname new-target prior-version package

73
debian/manpage.1.ex vendored
View File

@ -1,73 +0,0 @@
.\" Hey, EMACS: -*- nroff -*-
.\" (C) Copyright 2025 Paul Schneider <paul@localhost>,
.\"
.\" See man(1), man(7) and man-pages(7), https://www.tldp.org/HOWTO/Man-Page/
.\" for the documentation about man-pages and man-page-formatting:
.\"
.\" 1. Use this as the template for the manpage for <commandname> after
.\" renaming this file to <commandname>.1 (if it is for section 1).
.\"
.\" 2. List the path to this file in debian/<packagename>.manpages to
.\" install this manpage to the target binary package.
.\"
.\" First parameter, YAVSC, should be all caps
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
.\" other parameters are allowed: see man(7), man(1)
.\"
.\" Easier way to make an initial manpage for commands is the use of help2man
.\" command provided by help2man package while using this file as an tutorial
.\" to understand what was created or to make touch-up edits.
.\"
.\" Other template files (manpage.*) created by debmake command are secondary
.\" helper files to create an initial manpage.
.\"
.TH YAVSC SECTION "08 Jun 2025"
.\" Please adjust this date whenever revising the manpage.
.\"
.\" Some roff macros, for reference:
.\" .nh disable hyphenation
.\" .hy enable hyphenation
.\" .ad l left justify
.\" .ad b justify to both left and right margins
.\" .nf disable filling
.\" .fi enable filling
.\" .br insert line break
.\" .sp <n> insert n+1 empty lines
.\" for manpage-specific macros, see man(7)
.SH NAME
yavsc \- program to do something
.SH SYNOPSIS
.B yavsc
.RI [ options ] " files" ...
.br
.B bar
.RI [ options ] " files" ...
.SH DESCRIPTION
This manual page documents briefly the
.B yavsc
and
.B bar
commands.
.PP
.\" TeX users may be more comfortable with the \fB<whatever>\fP and
.\" \fI<whatever>\fP escape sequences to invode bold face and italics,
.\" respectively.
\fByavsc\fP is a program that...
.SH OPTIONS
These programs follow the usual GNU command line syntax, with long
options starting with two dashes (`-').
A summary of options is included below.
For a complete description, see the Info files.
.TP
.B \-h, \-\-help
Show summary of options.
.TP
.B \-v, \-\-version
Show version of program.
.SH SEE ALSO
.BR bar (1),
.BR baz (1).
.br
The programs are documented fully by
.IR "The Rise and Fall of a Fooish Bar" ,
available via the Info system.

View File

@ -1,44 +0,0 @@
= @UPACKAGE@(1)
:man source: YAVSC
:man version: 1.1.0-1
:man manual: YAVSC Manual
// Secondary template file to make manpage.1
//
// See "AsciiDoc Syntax Quick Reference"
// https://docs.asciidoctor.org/asciidoc/latest/syntax-quick-reference/
// https://docs.asciidoctor.org/asciidoctor/latest/manpage-backend/
// convert by:
// $ asciidoctor --doctype manpage -b manpage -a 'newline=\n' yavsc.asciidoc
== NAME
yavsc - program to do something
== SYNOPSIS
*yavsc* [*-h*] ...
== DESCRIPTION
*yavsc* do something.
=== optional arguments:
*-h*, *--help*::
show this help message and exit.
== AUTHOR
Copyright © 2025 Paul Schneider <paul@localhost>
== LICENSE
MIT License
== SEE ALSO
See also ...

129
debian/manpage.md.ex vendored
View File

@ -1,129 +0,0 @@
% YAVSC(SECTION) | User Commands
%
% "08 Jun 2025"
[comment]: # Secondary template file to make manpage.1
[comment]: #
[comment]: # The lines above form a Pandoc metadata block. They must be
[comment]: # the first ones in the file.
[comment]: # See https://pandoc.org/MANUAL.html#metadata-blocks for details.
[comment]: # pandoc -s -f markdown -t man package.md -o package.1
[comment]: #
[comment]: # A manual page package.1 will be generated. You may view the
[comment]: # manual page with: nroff -man package.1 | less. A typical entry
[comment]: # in a Makefile or Makefile.am is:
[comment]: #
[comment]: # package.1: package.md
[comment]: # pandoc --standalone --from=markdown --to=man $< --output=$@
[comment]: #
[comment]: # The pandoc binary is found in the pandoc package. Please remember
[comment]: # that if you create the nroff version in one of the debian/rules
[comment]: # file targets, such as build, you will need to include pandoc in
[comment]: # your Build-Depends control field.
[comment]: # lowdown is a low dependency, lightweight alternative to
[comment]: # pandoc as a markdown to manpage translator. Use with:
[comment]: #
[comment]: # package.1: package.md
[comment]: # lowdown -s -Tman -o $@ $<
[comment]: #
[comment]: # And add lowdown to the Build-Depends control field.
[comment]: # Remove the lines starting with '[comment]:' in this file in order
[comment]: # to avoid warning messages.
# NAME
yavsc - short summary
# SYNOPSIS
**yavsc** **-e** _this_ [**\-\-example=that**] [{**-e** | **\-\-example**} _this_]
[{**-e** | **\-\-example**} {_this_ | _that_}]
**yavsc** [{**-h** | *\-\-help**} | {**-v** | **\-\-version**}]
# DESCRIPTION
**yavsc** is a program that...
# OPTIONS
The program follows the usual GNU command line syntax, with long options
starting with two dashes ('-'). A summary of options is included below.
**-e** _this_, **\-\-example=**_that_
: Does this and that.
**-h**, **\-\-help**
: Show summary of options.
**-v**, **\-\-version**
: Show version of program.
# FILES
/etc/foo.conf
: The system-wide configuration file to control the behaviour of
yavsc. See **foo.conf**(5) for further details.
${HOME}/.foo.conf
: The per-user configuration file to control the behaviour of
yavsc. See **foo.conf**(5) for further details.
# ENVIRONMENT
**FOO_CONF**
: If used, the defined file is used as configuration file (see also
the section called FILES).
# DIAGNOSTICS
The following diagnostics may be issued on stderr:
Bad configuration file. Exiting.
: The configuration file seems to contain a broken configuration
line. Use the **\-\-verbose** option, to get more info.
**yavsc** provides some return codes, that can be used in scripts:
Code Diagnostic
0 Program exited successfully.
1 The configuration file seems to be broken.
# BUGS
The program is currently limited to only work with the foobar library.
The upstream BTS can be found at https://bugzilla.foo.tld.
# SEE ALSO
**bar**(1), **baz**(1), **foo.conf**(5)
The programs are documented fully by The Rise and Fall of a Fooish Bar
available via the **info**(1) system.
# AUTHOR
Paul Schneider <paul@localhost>
: Wrote this manpage for the Debian system.
# COPYRIGHT
Copyright © 2025 Paul Schneider
This manual page was written for the Debian system (and may be used by
others).
Permission is granted to copy, distribute and/or modify this document under
the terms of the GNU General Public License, Version 2 or (at your option)
any later version published by the Free Software Foundation.
On Debian systems, the complete text of the GNU General Public License
can be found in /usr/share/common-licenses/GPL.
[comment]: # Local Variables:
[comment]: # mode: markdown
[comment]: # End:

144
debian/manpage.sgml.ex vendored
View File

@ -1,144 +0,0 @@
<!doctype refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN" [
<!--
Install docbook-to-man package and see docbook-to-man(1)
Secondary template file to make manpage.1
-->
<!-- Fill in your name for FIRSTNAME and SURNAME. -->
<!ENTITY dhfirstname "<firstname>FIRSTNAME</firstname>">
<!ENTITY dhsurname "<surname>SURNAME</surname>">
<!-- Please adjust the date whenever revising the manpage. -->
<!ENTITY dhdate "<date>08 Jun 2025</date>">
<!-- SECTION should be 1-8, maybe w/ subsection other parameters are
allowed: see man(7), man(1). -->
<!ENTITY dhsection "<manvolnum>SECTION</manvolnum>">
<!ENTITY dhemail "<email>paul@localhost</email>">
<!ENTITY dhusername "Paul Schneider">
<!ENTITY dhucpackage "<refentrytitle>YAVSC</refentrytitle>">
<!ENTITY dhpackage "yavsc">
<!ENTITY debian "<productname>Debian</productname>">
<!ENTITY gnu "<acronym>GNU</acronym>">
<!ENTITY gpl "&gnu; <acronym>GPL</acronym>">
]>
<refentry>
<refentryinfo>
<address>
&dhemail;
</address>
<author>
&dhfirstname;
&dhsurname;
</author>
<copyright>
<year>2003</year>
<holder>&dhusername;</holder>
</copyright>
&dhdate;
</refentryinfo>
<refmeta>
&dhucpackage;
&dhsection;
</refmeta>
<refnamediv>
<refname>&dhpackage;</refname>
<refpurpose>program to do something</refpurpose>
</refnamediv>
<refsynopsisdiv>
<cmdsynopsis>
<command>&dhpackage;</command>
<arg><option>-e <replaceable>this</replaceable></option></arg>
<arg><option>--example <replaceable>that</replaceable></option></arg>
</cmdsynopsis>
</refsynopsisdiv>
<refsect1>
<title>DESCRIPTION</title>
<para>This manual page documents briefly the
<command>&dhpackage;</command> and <command>bar</command>
commands.</para>
<para>This manual page was written for the &debian; distribution
because the original program does not have a manual page.
Instead, it has documentation in the &gnu;
<application>Info</application> format; see below.</para>
<para><command>&dhpackage;</command> is a program that...</para>
</refsect1>
<refsect1>
<title>OPTIONS</title>
<para>These programs follow the usual &gnu; command line syntax,
with long options starting with two dashes (`-'). A summary of
options is included below. For a complete description, see the
<application>Info</application> files.</para>
<variablelist>
<varlistentry>
<term><option>-h</option>
<option>--help</option>
</term>
<listitem>
<para>Show summary of options.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-v</option>
<option>--version</option>
</term>
<listitem>
<para>Show version of program.</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1>
<title>SEE ALSO</title>
<para>bar (1), baz (1).</para>
<para>The programs are documented fully by <citetitle>The Rise and
Fall of a Fooish Bar</citetitle> available via the
<application>Info</application> system.</para>
</refsect1>
<refsect1>
<title>AUTHOR</title>
<para>This manual page was written by &dhusername; &dhemail; for
the &debian; system (and may be used by others). Permission is
granted to copy, distribute and/or modify this document under
the terms of the &gnu; General Public License, Version 2 any
later version published by the Free Software Foundation.
</para>
<para>
On Debian systems, the complete text of the GNU General Public
License can be found in /usr/share/common-licenses/GPL.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:2
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:nil
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
-->

267
debian/manpage.xml.ex vendored
View File

@ -1,267 +0,0 @@
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!--
Secondary template file to make manpage.1
Install docbook-xsl and docbook-xsl-doc-html and see
/usr/share/doc/docbook-xsl/examples/foo.1.example_manpage.xml
/usr/share/doc/docbook-xsl-doc-html/doc/manpages/index.html
The xsltproc binary is found in the xsltproc package. The XSL files are in
docbook-xsl. A description of the parameters you can use can be found in the
docbook-xsl-doc-* packages.
Validation can be done using: `xmllint -''-noout -''-valid manpage.xml`
General documentation about man-pages and man-page-formatting:
man(1), man(7), man-pages(7), https://www.tldp.org/HOWTO/Man-Page/
-->
<!-- Fill in your name for FIRSTNAME and SURNAME. -->
<!ENTITY dhfirstname "FIRSTNAME">
<!ENTITY dhsurname "SURNAME">
<!-- dhusername could also be set to "&dhfirstname; &dhsurname;". -->
<!ENTITY dhusername "Paul Schneider">
<!ENTITY dhemail "paul@localhost">
<!-- SECTION should be 1-8, maybe w/ subsection other parameters are
allowed: see man(7), man(1) and
https://www.tldp.org/HOWTO/Man-Page/q2.html. -->
<!ENTITY dhsection "SECTION">
<!-- TITLE should be something like "User commands" or similar (see
https://www.tldp.org/HOWTO/Man-Page/q2.html). -->
<!ENTITY dhtitle "yavsc User Manual">
<!ENTITY dhucpackage "YAVSC">
<!ENTITY dhpackage "yavsc">
]>
<refentry>
<refentryinfo>
<title>&dhtitle;</title>
<productname>&dhpackage;</productname>
<authorgroup>
<author>
<firstname>&dhfirstname;</firstname>
<surname>&dhsurname;</surname>
<contrib>Wrote this manpage for the Debian system.</contrib>
<address>
<email>&dhemail;</email>
</address>
</author>
</authorgroup>
<copyright>
<year>2007</year>
<holder>&dhusername;</holder>
</copyright>
<legalnotice>
<para>This manual page was written for the Debian system
(and may be used by others).</para>
<para>Permission is granted to copy, distribute and/or modify this
document under the terms of the GNU General Public License,
Version 2 or (at your option) any later version published by
the Free Software Foundation.</para>
<para>On Debian systems, the complete text of the GNU General Public
License can be found in
<filename>/usr/share/common-licenses/GPL</filename>.</para>
</legalnotice>
</refentryinfo>
<refmeta>
<refentrytitle>&dhucpackage;</refentrytitle>
<manvolnum>&dhsection;</manvolnum>
</refmeta>
<refnamediv>
<refname>&dhpackage;</refname>
<refpurpose>program to do something</refpurpose>
</refnamediv>
<refsynopsisdiv>
<cmdsynopsis>
<command>&dhpackage;</command>
<!-- These are several examples, how syntaxes could look -->
<arg choice="plain"><option>-e <replaceable>this</replaceable></option></arg>
<arg choice="opt"><option>--example=<parameter>that</parameter></option></arg>
<arg choice="opt">
<group choice="req">
<arg choice="plain"><option>-e</option></arg>
<arg choice="plain"><option>--example</option></arg>
</group>
<replaceable class="option">this</replaceable>
</arg>
<arg choice="opt">
<group choice="req">
<arg choice="plain"><option>-e</option></arg>
<arg choice="plain"><option>--example</option></arg>
</group>
<group choice="req">
<arg choice="plain"><replaceable>this</replaceable></arg>
<arg choice="plain"><replaceable>that</replaceable></arg>
</group>
</arg>
</cmdsynopsis>
<cmdsynopsis>
<command>&dhpackage;</command>
<!-- Normally the help and version options make the programs stop
right after outputting the requested information. -->
<group choice="opt">
<arg choice="plain">
<group choice="req">
<arg choice="plain"><option>-h</option></arg>
<arg choice="plain"><option>--help</option></arg>
</group>
</arg>
<arg choice="plain">
<group choice="req">
<arg choice="plain"><option>-v</option></arg>
<arg choice="plain"><option>--version</option></arg>
</group>
</arg>
</group>
</cmdsynopsis>
</refsynopsisdiv>
<refsect1 id="description">
<title>DESCRIPTION</title>
<para>This manual page documents briefly the
<command>&dhpackage;</command> and <command>bar</command>
commands.</para>
<para>This manual page was written for the Debian distribution
because the original program does not have a manual page.
Instead, it has documentation in the GNU <citerefentry>
<refentrytitle>info</refentrytitle>
<manvolnum>1</manvolnum>
</citerefentry> format; see below.</para>
<para><command>&dhpackage;</command> is a program that...</para>
</refsect1>
<refsect1 id="options">
<title>OPTIONS</title>
<para>The program follows the usual GNU command line syntax,
with long options starting with two dashes (`-'). A summary of
options is included below. For a complete description, see the
<citerefentry>
<refentrytitle>info</refentrytitle>
<manvolnum>1</manvolnum>
</citerefentry> files.</para>
<variablelist>
<!-- Use the variablelist.term.separator and the
variablelist.term.break.after parameters to
control the term elements. -->
<varlistentry>
<term><option>-e <replaceable>this</replaceable></option></term>
<term><option>--example=<replaceable>that</replaceable></option></term>
<listitem>
<para>Does this and that.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-h</option></term>
<term><option>--help</option></term>
<listitem>
<para>Show summary of options.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-v</option></term>
<term><option>--version</option></term>
<listitem>
<para>Show version of program.</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 id="files">
<title>FILES</title>
<variablelist>
<varlistentry>
<term><filename>/etc/foo.conf</filename></term>
<listitem>
<para>The system-wide configuration file to control the
behaviour of <application>&dhpackage;</application>. See
<citerefentry>
<refentrytitle>foo.conf</refentrytitle>
<manvolnum>5</manvolnum>
</citerefentry> for further details.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><filename>${HOME}/.foo.conf</filename></term>
<listitem>
<para>The per-user configuration file to control the
behaviour of <application>&dhpackage;</application>. See
<citerefentry>
<refentrytitle>foo.conf</refentrytitle>
<manvolnum>5</manvolnum>
</citerefentry> for further details.</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 id="environment">
<title>ENVIRONMENT</title>
<variablelist>
<varlistentry>
<term><envar>FOO_CONF</envar></term>
<listitem>
<para>If used, the defined file is used as configuration
file (see also <xref linkend="files"/>).</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 id="diagnostics">
<title>DIAGNOSTICS</title>
<para>The following diagnostics may be issued
on <filename class="devicefile">stderr</filename>:</para>
<variablelist>
<varlistentry>
<term><errortext>Bad configuration file. Exiting.</errortext></term>
<listitem>
<para>The configuration file seems to contain a broken configuration
line. Use the <option>--verbose</option> option, to get more info.
</para>
</listitem>
</varlistentry>
</variablelist>
<para><command>&dhpackage;</command> provides some return codes, that can
be used in scripts:</para>
<segmentedlist>
<segtitle>Code</segtitle>
<segtitle>Diagnostic</segtitle>
<seglistitem>
<seg><errorcode>0</errorcode></seg>
<seg>Program exited successfully.</seg>
</seglistitem>
<seglistitem>
<seg><errorcode>1</errorcode></seg>
<seg>The configuration file seems to be broken.</seg>
</seglistitem>
</segmentedlist>
</refsect1>
<refsect1 id="bugs">
<!-- Or use this section to tell about upstream BTS. -->
<title>BUGS</title>
<para>The program is currently limited to only work
with the <package>foobar</package> library.</para>
<para>The upstreams <acronym>BTS</acronym> can be found
at <ulink url="https://bugzilla.foo.tld"/>.</para>
</refsect1>
<refsect1 id="see_also">
<title>SEE ALSO</title>
<!-- In alphabetical order. -->
<para><citerefentry>
<refentrytitle>bar</refentrytitle>
<manvolnum>1</manvolnum>
</citerefentry>, <citerefentry>
<refentrytitle>baz</refentrytitle>
<manvolnum>1</manvolnum>
</citerefentry>, <citerefentry>
<refentrytitle>foo.conf</refentrytitle>
<manvolnum>5</manvolnum>
</citerefentry></para>
<para>The programs are documented fully by <citetitle>The Rise and
Fall of a Fooish Bar</citetitle> available via the <citerefentry>
<refentrytitle>info</refentrytitle>
<manvolnum>1</manvolnum>
</citerefentry> system.</para>
</refsect1>
</refentry>

View File

@ -1 +0,0 @@
# You must remove unused comment lines for the released package.

7
debian/postinst.ex vendored
View File

@ -1,7 +0,0 @@
#!/bin/sh
# If no user provided script is activated in this file, you should remove this file.
set -e
#DEBHELPER#
exit 0

7
debian/postrm.ex vendored
View File

@ -1,7 +0,0 @@
#!/bin/sh
# If no user provided script is activated in this file, you should remove this file.
set -e
#DEBHELPER#
exit 0

7
debian/preinst.ex vendored
View File

@ -1,7 +0,0 @@
#!/bin/sh
# If no user provided script is activated in this file, you should remove this file.
set -e
#DEBHELPER#
exit 0

7
debian/prerm.ex vendored
View File

@ -1,7 +0,0 @@
#!/bin/sh
# If no user provided script is activated in this file, you should remove this file.
set -e
#DEBHELPER#
exit 0

15
debian/rules vendored
View File

@ -1,15 +0,0 @@
#!/usr/bin/make -f
# You must remove unused comment lines for the released package.
#export DH_VERBOSE = 1
#export DEB_BUILD_MAINT_OPTIONS = hardening=+all
#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic
#export DEB_LDFLAGS_MAINT_APPEND = -Wl,-O1
%:
dh $@
#override_dh_auto_install:
# dh_auto_install -- prefix=/usr
#override_dh_install:
# dh_install --list-missing -X.pyc -X.pyo

25
debian/salsa-ci.yml vendored
View File

@ -1,25 +0,0 @@
# For more information on what jobs are run see:
# https://salsa.debian.org/salsa-ci-team/pipeline
#
# To enable the jobs, go to your repository (at salsa.debian.org)
# and click over Settings > CI/CD > Expand (in General pipelines).
# In "CI/CD configuration file" write debian/salsa-ci.yml and click
# in "Save Changes". The CI tests will run after the next commit.
---
include:
- https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/recipes/debian.yml
# # This commented-out sample disables all default tests, only disable those
# # CI tests that is required to get the CI process to succeed.
#
# variables:
# SALSA_CI_DISABLE_APTLY: 1
# SALSA_CI_DISABLE_AUTOPKGTEST: 1
# SALSA_CI_DISABLE_BLHC: 1
# SALSA_CI_DISABLE_LINTIAN: 1
# SALSA_CI_DISABLE_PIUPARTS: 1
# SALSA_CI_DISABLE_REPROTEST: 1
# SALSA_CI_DISABLE_BUILD_PACKAGE_ALL: 1
# SALSA_CI_DISABLE_BUILD_PACKAGE_ANY: 1
# SALSA_CI_DISABLE_BUILD_PACKAGE_I386: 1
# SALSA_CI_DISABLE_CROSSBUILD_ARM64: 1

View File

@ -1 +0,0 @@
3.0 (quilt)

View File

@ -1,2 +0,0 @@
# See dh_lintian(1)
# cut and paste the lintian(1) outputs without leading "E: ", "W: ", ...

View File

@ -1,47 +0,0 @@
# Uncomment to active options. See dpkg-source(1)
#
# This file contains a list of long options that should be automatically
# prepended to the set of command line options of a dpkg-source --build call.
# This is normally for the non-native Debian packaging.
# Whenever possible, use this instead of debian/local-options to make
# dpkg-source long options applied for the team builds based on the VCS
# repository while NMU builds based on the Debian source package are not
# affected.
# == Patch unapplied strategy (dquilt, gbp, ...) ==
#
# The source outside of debian/ directory is unmodified from the upstream one:
# * Workflow using diff -u
# https://www.debian.org/doc/manuals/debmake-doc/ch04.en.html#diff-u
# * Workflow using dquilt
# https://www.debian.org/doc/manuals/debmake-doc/ch04.en.html#dquilt
# * Workflow using dpkg-source commit (commit only patch to VCS after dpkg-source commit)
# https://www.debian.org/doc/manuals/debmake-doc/ch04.en.html#dpkg-source-commit
# * Workflow to use gbp-buildpackage(1) with pristine-tar
# * Workflow described in dgit-maint-gbp(7)
#
# Uncomment following if you use this strategy
#abort-on-upstream-changes
#unapply-patches
# == Patch applied strategy (merge) ==
#
# The source outside of debian/ directory is modified by maintainer and
# different from the upstream one:
# * Workflow using dpkg-source commit (commit all to VCS after dpkg-source commit)
# https://www.debian.org/doc/manuals/debmake-doc/ch04.en.html#dpkg-source-commit
# * Workflow described in dgit-maint-merge(7)
#
# uncomment following if you use this strategy
#single-debian-patch
#auto-commit
# == Patch applied strategy (debrebase) ==
#
# The source outside of debian/ directory is modified by maintainer and
# different from the upstream one:
# * Workflow described in dgit-maint-debrebase(7)
#
# Remove this file if you use this strategy

View File

@ -1,26 +0,0 @@
The automatically generated patch by dpkg-source(1) puts this free form text on
top of it.
This is normally for the non-native Debian packaging.
Whenever possible, use this instead of debian/patch-header to make dpkg-source
long options applied for the team builds based on the VCS repository while NMU
builds based on the Debian source package are not affected.
== Patch applied strategy (merge) ==
The source outside of debian/ directory is modified by maintainer and
different from the upstream one:
* Workflow using dpkg-source commit (commit all to VCS after dpkg-source commit)
https://www.debian.org/doc/manuals/debmake-doc/ch04.en.html#dpkg-source-commit
* Workflow described in dgit-maint-merge(7)
Keep this file after updating its content if you use this strategy
== Other strategies ==
Remove this file if you use this strategy
===
A single combined diff, containing all the changes, follows.

View File

@ -1,10 +0,0 @@
# Uncomment to active options. See dpkg-source(1)
#
# This file contains a list of long options that should be automatically
# prepended to the set of command line options of a dpkg-source --build call.
# This is normally for the non-native Debian packaging.
# Whenever possible, use debian/local-options instead to make dpkg-source long
# options applied for the team builds based on the VCS repository while NMU
# builds based on the Debian source package are not affected.

View File

@ -1,12 +0,0 @@
The automatically generated patch by dpkg-source(1) puts this free form text on
top of it.
This is normally for the non-native Debian packaging.
Whenever possible, use debian/local-patch-header instead to make dpkg-source long
options applied for the team builds based on the VCS repository while NMU
builds based on the Debian source package are not affected.
A single combined diff, containing all the changes, follows.
===

View File

@ -1,9 +0,0 @@
#
# DEP-8: autopkgtest - automatic as-installed package testing
# Please check * https://dep-team.pages.debian.net/deps/dep8/
# * /usr/share/doc/autopkgtest
#
# !!! Please make sure to edit this to a valid test, otherwise build will fails
#
#Tests: testcode.sh
#Restrictions: allow-stderr, breaks-testbed, needs-internet, needs-root

View File

@ -1,16 +0,0 @@
#
# DEP-12: Per-package machine-readable metadata about Upstream
# Please check * https://dep-team.pages.debian.net/deps/dep12/
# * https://wiki.debian.org/UpstreamMetadata
Reference:
Author: <please use full names and separate multiple author by the keyword "and">
Title:
Journal:
Year:
Volume:
Number:
Pages:
DOI:
PMID:
URL:
eprint:

3
debian/watch vendored
View File

@ -1,3 +0,0 @@
# You must remove unused comment lines for the released package.
# Compulsory line, this is a version 4 file
version=4

View File

@ -1,3 +0,0 @@
# Installed as usr/share/bug/yavsc/control in yavsc
# See dh_bugfiles(1) and /usr/share/doc/reportbug/README.developers.gz
# It is the bug control file containing some directions for the bug reporting tool.

View File

@ -1,3 +0,0 @@
# Installed as usr/share/bug/yavsc/presubj in yavsc
# See dh_bugfiles(1) and /usr/share/doc/reportbug/README.developers.gz
# The contents of this file are displayed to the user by the bug reporting tool.

View File

@ -1,3 +0,0 @@
# Installed as usr/share/bug/yavsc or usr/share/bug/yavsc/script in yavsc
# See dh_bugfiles(1) and /usr/share/doc/reportbug/README.developers.gz
# This is the script to be run by the bug reporting program for generating a bug report template.

View File

@ -1,10 +0,0 @@
# See dh_installdeb(1).
# This file will be installed into the DEBIAN directory. The provided file will
# be enriched by debhelper to include all the conffiles auto-detected by
# debhelper (the maintainer should not list there as debhelper assumes it
# should handle that part).
#
# This file is primarily useful for using "special" entries such as the
# remove-on-upgrade feature from dpkg.
#
# For most packages, this file doesnt need to exist.

View File

@ -1,5 +0,0 @@
#
# Regular cron jobs for the yavsc package
# See dh_installcron(1) and crontab(5).
#
#0 4 * * * root [ -x /usr/bin/yavsc_maintenance ] && /usr/bin/yavsc_maintenance

View File

@ -1,3 +0,0 @@
#!/bin/sh
# Daily cron jobs shell script for the yavsc package
#true

View File

@ -1,3 +0,0 @@
#!/bin/sh
# Hourly cron jobs shell script for the yavsc package
#true

View File

@ -1,3 +0,0 @@
#!/bin/sh
# Monthly cron jobs shell script for the yavsc package
#true

View File

@ -1,3 +0,0 @@
#!/bin/sh
# Weekly cron jobs shell script for the yavsc package
#true

View File

@ -1,7 +0,0 @@
# Defaults for yavsc initscript
#
# This is a POSIX shell fragment
#
#DAEMON_OPTS=""

View File

@ -1,47 +0,0 @@
#! /bin/sh -e
# /usr/lib/emacsen-common/packages/install/yavsc
# Written by Jim Van Zandt <jrv@debian.org>, borrowing heavily
# from the install scripts for gettext by Santiago Vila
# <sanvila@ctv.es> and octave by Dirk Eddelbuettel <edd@debian.org>.
FLAVOR=$1
PACKAGE=yavsc
if [ ${FLAVOR} = emacs ]; then exit 0; fi
echo install/${PACKAGE}: Handling install for emacsen flavor ${FLAVOR}
#FLAVORTEST=`echo $FLAVOR | cut -c-6`
#if [ ${FLAVORTEST} = xemacs ] ; then
# SITEFLAG="-no-site-file"
#else
# SITEFLAG="--no-site-file"
#fi
FLAGS="${SITEFLAG} -q -batch -l path.el -f batch-byte-compile"
ELDIR=/usr/share/emacs/site-lisp/${PACKAGE}
ELCDIR=/usr/share/${FLAVOR}/site-lisp/${PACKAGE}
ELRELDIR=../../../emacs/site-lisp/${PACKAGE}
# Install-info-altdir does not actually exist.
# Maybe somebody will write it.
if test -x /usr/sbin/install-info-altdir; then
echo install/${PACKAGE}: install Info links for ${FLAVOR}
install-info-altdir --quiet --section "" "" --dirname=${FLAVOR} /usr/share/info/${PACKAGE}.info.gz
fi
install -m 755 -d ${ELCDIR}
cd ${ELDIR}
FILES=`echo *.el`
cd ${ELCDIR}
ln -sf ${ELRELDIR}/*.el .
cat << EOF > path.el
(debian-pkg-add-load-path-item ".")
(setq byte-compile-warnings nil)
EOF
${FLAVOR} ${FLAGS} ${FILES}
rm -f path.el
exit 0

View File

@ -1,15 +0,0 @@
#!/bin/sh -e
# /usr/lib/emacsen-common/packages/remove/yavsc
FLAVOR=$1
PACKAGE=yavsc
if [ ${FLAVOR} != emacs ]; then
if test -x /usr/sbin/install-info-altdir; then
echo remove/${PACKAGE}: removing Info links for ${FLAVOR}
install-info-altdir --quiet --remove --dirname=${FLAVOR} /usr/share/info/yavsc.info.gz
fi
echo remove/${PACKAGE}: purging byte-compiled files for ${FLAVOR}
rm -rf /usr/share/${FLAVOR}/site-lisp/${PACKAGE}
fi

View File

@ -1,26 +0,0 @@
;; -*-emacs-lisp-*-
;;
;; Emacs startup file, e.g. /etc/emacs/site-start.d/50yavsc.el
;; for the Debian yavsc package
;;
;; Originally contributed by Nils Naumann <naumann@unileoben.ac.at>
;; Modified by Dirk Eddelbuettel <edd@debian.org>
;; Adapted for dh-make by Jim Van Zandt <jrv@debian.org>
;; The yavsc package follows the Debian/GNU Linux 'emacsen' policy and
;; byte-compiles its elisp files for each 'emacs flavor' (emacs19,
;; xemacs19, emacs20, xemacs20...). The compiled code is then
;; installed in a subdirectory of the respective site-lisp directory.
;; We have to add this to the load-path:
(let ((package-dir (concat "/usr/share/"
(symbol-name debian-emacs-flavor)
"/site-lisp/yavsc")))
;; If package-dir does not exist, the yavsc package must have
;; removed but not purged, and we should skip the setup.
(when (file-directory-p package-dir)
(if (fboundp 'debian-pkg-add-load-path-item)
(debian-pkg-add-load-path-item package-dir)
(setq load-path (cons package-dir load-path)))
(autoload 'yavsc-mode "yavsc-mode"
"Major mode for editing yavsc files." t)
(add-to-list 'auto-mode-alist '("\\.yavsc$" . yavsc-mode))))

View File

@ -1,2 +0,0 @@
# See dh_lintian(1) and Lintian User Manual (/usr/share/doc/lintian/lintian.html)
# cut and paste the lintian(1) outputs without leading "E: ", "W: ", ...

View File

@ -1,2 +0,0 @@
# If this exists, it is installed into lib/systemd/system/yavsc.service in yavsc
# See dh_systemd_enable(1).

View File

@ -1,2 +0,0 @@
# If this exists, it is installed into usr/lib/tmpfiles.d/yavsc.conf in yavsc
# See dh_installtmpfiles(1).

View File

@ -1,27 +1,30 @@
{
"version": 1,
"isRoot": true,
"tools": {
"codecov.tool": {
"version": "1.13.0",
"commands": [
"codecov"
],
"rollForward": false
},
"gitreleasemanager.tool": {
"version": "0.20.0",
"commands": [
"dotnet-gitreleasemanager"
],
"rollForward": false
},
"Wyam2.Tool": {
"version": "3.0.0-rc3",
"commands": [
"wyam2"
],
"rollForward": false
"version": 1,
"isRoot": true,
"tools": {
"codecov.tool": {
"version": "1.13.0",
"commands": [
"codecov"
]
},
"gitversion.tool": {
"version": "5.10.1",
"commands": [
"dotnet-gitversion"
]
},
"gitreleasemanager.tool": {
"version": "0.13.0",
"commands": [
"dotnet-gitreleasemanager"
]
},
"Wyam2.Tool": {
"version": "3.0.0-rc3",
"commands": [
"wyam2"
]
}
}
}
}
}

View File

@ -1,27 +0,0 @@
{
"AssemblySemFileVer": "1.1.1.0",
"AssemblySemVer": "1.1.1.0",
"BranchName": "main",
"BuildMetaData": null,
"CommitDate": "2024-10-09",
"CommitsSinceVersionSource": 19,
"EscapedBranchName": "main",
"FullBuildMetaData": "Branch.main.Sha.2b45e421dda285b73bf7eb3387915030cd751b88",
"FullSemVer": "1.1.1-19",
"InformationalVersion": "1.1.1-19+Branch.main.Sha.2b45e421dda285b73bf7eb3387915030cd751b88",
"Major": 1,
"MajorMinorPatch": "1.1.1",
"Minor": 1,
"Patch": 1,
"PreReleaseLabel": "",
"PreReleaseLabelWithDash": "",
"PreReleaseNumber": 19,
"PreReleaseTag": "19",
"PreReleaseTagWithDash": "-19",
"SemVer": "1.1.1-19",
"Sha": "2b45e421dda285b73bf7eb3387915030cd751b88",
"ShortSha": "2b45e42",
"UncommittedChanges": 20,
"VersionSourceSha": "72839e8251297935a4ab138a99152733f07a23f2",
"WeightedPreReleaseNumber": 55019
}

22
omnisharp.json Normal file
View File

@ -0,0 +1,22 @@
{
"dotnet": {
"enabled": false
},
"msbuild": {
"enabled": true
},
"Dnx": {
"enabled": false
},
"Script": {
"enabled": false
},
"fileOptions": {
"systemExcludeSearchPatterns": [
"**/bin/**/*",
"**/obj/**/*",
"**/node_modules/**/*"
],
"userExcludeSearchPatterns": []
}
}

View File

@ -1,35 +0,0 @@
{
"version": "0.2.0",
"configurations": [
{
// Use IntelliSense to find out which attributes exist for C# debugging
// Use hover for the description of the existing attributes
// For further information visit https://github.com/dotnet/vscode-csharp/blob/main/debugger-launchjson.md.
"name": ".NET Core Launch (web)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/isnd/bin/Debug/net9.0/isnd.dll",
"args": [],
"cwd": "${workspaceFolder}/isnd",
"stopAtEntry": false,
// Enable launching a web browser when ASP.NET Core starts. For more information: https://aka.ms/VSCode-CS-LaunchJson-WebBrowser
"serverReadyAction": {
"action": "openExternally",
"pattern": "\\bNow listening on:\\s+(https?://\\S+)"
},
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"sourceFileMap": {
"/Views": "${workspaceFolder}/Views"
}
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach"
}
]
}

View File

@ -1,41 +0,0 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/isnd/isnd.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary;ForceNoAlign"
],
"problemMatcher": "$msCompile"
},
{
"label": "publish",
"command": "dotnet",
"type": "process",
"args": [
"publish",
"${workspaceFolder}/isnd/isnd.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary;ForceNoAlign"
],
"problemMatcher": "$msCompile"
},
{
"label": "watch",
"command": "dotnet",
"type": "process",
"args": [
"watch",
"run",
"--project",
"${workspaceFolder}/isnd/isnd.csproj"
],
"problemMatcher": "$msCompile"
}
]
}

View File

@ -1,11 +0,0 @@
using System.Collections.Generic;
namespace isn
{
public class APIKO
{
public string Context { get; set; }
public Dictionary<string, string[]> Errors { get; set; }
}
}

View File

@ -1,24 +1,21 @@
using System;
using isn.abst;
namespace isnd.Entities
{
public static class ApiConfig
{
public const string Index = "/index.json";
public const string Catalog = "/catalog";
public const string Package = "/package";
public const string Search = "/search";
public const string AutoComplete = "/autocomplete";
public const string Registration = "/registration";
public const string ContentBase = "/content";
public const string Nuget = "/nuget";
public const string PackageDetailUriTemplate = Package+"/{id}/{version}";
[Obsolete("use the V3 search")]
public const string V2Find = "/v2/FindPackagesById()"; // /FindPackagesById()??$filter=IsLatestVersion&$orderby=Version desc&$top=1&id='isn.abst'
public const string Publish = "put";
public const string Index = "index";
public const string IndexDotJson = Index + ".json";
public const string Catalog = "catalog";
public const string CatalogPage = "catalog-page";
public const string GetPackage = Constants.PaquetFileEstension;
public const string GetVersion = "version";
public const string Search = "search";
public const string AutoComplete = "autocomplete";
public const string CatalogLeaf = "catalog-leaf";
public const string Delete = "delete";
public const string Registration = "registration";
internal const string GetNuspec = Constants.SpecFileEstension;
}
}

View File

@ -1,14 +1,9 @@
using isnd.Data.Catalog;
using Newtonsoft.Json;
namespace isn.Abstract
{
public class ApiIndexViewModel : Permalink
public class ApiIndexViewModel
{
public ApiIndexViewModel(string id) : base(id, "ApiIndex")
{
}
[JsonProperty("version")]
public string Version { get; set; }

View File

@ -2,8 +2,8 @@ namespace isn.abst
{
public static class Constants
{
public const string PacketFileExtension = "nupkg";
public const string SpecFileExtension = "nuspec";
public const string ApiVersionPrefix = "/v3";
public const string PaquetFileEstension = "nupkg";
public const string SpecFileEstension = "nuspec";
public const string JsonFileEstension = "json";
}
}

View File

@ -1,48 +0,0 @@
using Newtonsoft.Json;
namespace isnd.Data.Catalog
{
public abstract class Permalink
{
public Permalink(string id)
{
Type = GetType().Name;
this.id = id;
}
public Permalink(string id, string type)
{
Type = type;
this.id = id;
}
[JsonProperty("@type")]
public virtual string Type { get; set; }
[JsonProperty("@id")]
public string Id { get => id; }
protected string id;
public string GetId() { return id; }
public override bool Equals(object obj)
{
if (obj!=null)
{
if (GetType().IsAssignableFrom(obj.GetType()))
{
var rpobj = (Permalink) obj;
return this.id == rpobj.id;
}
}
return base.Equals(obj);
}
public override int GetHashCode()
{
return id.GetHashCode();
}
}
}

View File

@ -1,15 +1,14 @@
using isnd.Data.Catalog;
using Newtonsoft.Json;
namespace isn.Abstract
{
public class Resource : Permalink
public class Resource
{
public Resource(string id, string typename) : base(id)
{
Type = typename;
}
[JsonProperty("@id")]
public string Id {get; set; }
[JsonProperty("@type")]
public string Type {get; set; }
[JsonProperty("comment")]
public string Comment {get; set; }

View File

@ -1,8 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net7.0;net8.0;net9.0</TargetFrameworks>
</PropertyGroup>
<PackageVersion>1.0.1</PackageVersion>
<Version>1.0.5</Version>
<TargetFrameworks>netcoreapp2.1</TargetFrameworks>
<NoWarn>NETSDK1138</NoWarn>
<AssemblyVersion>1.0.5.0</AssemblyVersion>
<FileVersion>1.0.5.0</FileVersion>
<InformationalVersion>1.0.5+Branch.main.Sha.14206ac477d0f07566d5e8125dc52cbd7f474ca2</InformationalVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Newtonsoft.Json" Version="11.0.1" />
</ItemGroup>
</Project>

46
src/isn/IDataProtector.cs Normal file
View File

@ -0,0 +1,46 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace isn
{
public interface IDataProtector
{
string Protect(string data);
string UnProtect(string data);
}
public class DefaultDataProtector : IDataProtector
{
private byte delta = 145;
public DefaultDataProtector()
{
}
public string Protect(string data)
{
List<Byte> protd = new List<byte>();
StringBuilder sb = new StringBuilder();
foreach (byte c in Encoding.UTF8.GetBytes(data))
{
protd.Add((byte) (c ^ delta));
}
return System.Convert.ToBase64String(protd.ToArray());
}
public string UnProtect(string data)
{
StringBuilder sb = new StringBuilder();
List<byte> unps = new List<byte>();
foreach (byte c in System.Convert.FromBase64CharArray(data.ToCharArray(),0,data.Length))
{
unps.Add((byte) (c ^ delta));
}
return Encoding.UTF8.GetString(unps.ToArray());
}
}
}

View File

@ -0,0 +1,9 @@
namespace isn
{
public class IsnSourceSettings
{
internal string Source { get; set; }
internal string[] Keys { get; set; }
}
}

View File

@ -2,8 +2,6 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using Mono.Options;
using Newtonsoft.Json;
@ -18,20 +16,14 @@ namespace isn
if (cfgSettingIf.Exists)
{
var json = File.ReadAllText(cfgSettingIf.FullName);
Settings = JsonConvert.DeserializeObject<Settings>(json);
CurrentSource = Settings.DefaultSourceKey;
}
if (Settings==null)
{
Settings= Settings.Create();
settings = JsonConvert.DeserializeObject<Settings>(json);
currentSource = settings.DefaultSource;
}
}
static readonly OptionSet storeoptions = new OptionSet {
{ "s|source=", "use source", val => Settings.CurrentSourceKey ??= val },
{ "s|source=", "use source", val => currentSource = currentSource ?? val },
{ "h|help", "show this message and exit", h => shouldShowPushHelp = h != null },
};
private static readonly string _configFileName =
Path.Combine(
Path.Combine(Environment.GetFolderPath(
@ -42,12 +34,12 @@ namespace isn
public const string push = "push";
static readonly OptionSet options = new OptionSet {
{ "h|help", "show this message and exit", h => shouldShowHelp = h != null },
{ "v|version", "show soft version info and exit", h => shouldShowVersion = h != null }
};
static readonly OptionSet pushoptions = new OptionSet {
{ "k|api-key=", "use api key", val => Settings.CurrentSource.SetApiKey(val)},
{ "s|source=", "use source", val => Settings.CurrentSourceKey = val },
{ "k|api-key=", "use api key", val => apiKey = apiKey ?? val },
{ "p|store-api-key", "store used api key (=<true|false>)", val => storApiKey = val != null },
{ "s|source=", "use source", val => currentSource = currentSource ?? val },
{ "h|help", "show this message and exit", h => shouldShowPushHelp = h != null },
};
static readonly OptionSet sourceoptions = new OptionSet {
@ -59,23 +51,35 @@ namespace isn
};
private static bool shouldShowHelp;
private static bool shouldShowVersion;
private static bool shouldShowSourceHelp;
private static bool shouldShowPushHelp;
private static string apiKey = null;
private static string currentSource = null;
private static int pushKO = 0;
private static bool storApiKey = false;
public static IDataProtector Protector { get; set; } = new DefaultDataProtector();
static Settings settings = null;
public static Settings Settings
{
get; set;
get
{
if (settings == null)
LoadConfig();
if (settings == null)
settings = new Settings
{
DataProtectionTitle = "isn",
Sources = new Dictionary<string, SourceSettings>()
};
return settings;
}
}
public static string CurrentSource { get => Settings.CurrentSourceKey; set => Settings.CurrentSourceKey = value; }
static int Main(string[] args)
{
LoadConfig();
var commandSet = new CommandSet("isn");
var srclst = new Command("list")
{
@ -146,7 +150,6 @@ namespace isn
{
Run = sargs => Add(sargs)
};
commandSet.Add(add);
var pushCmd = new Command(push)
@ -154,7 +157,6 @@ namespace isn
Run = sargs =>
{
var pargs = pushoptions.Parse(sargs);
if (args.Count()==0) shouldShowPushHelp=true;
if (shouldShowPushHelp)
{
// output the options
@ -163,19 +165,17 @@ namespace isn
return;
}
List<PushReport> reports = PushPkg(pargs);
Console.WriteLine(JsonConvert.SerializeObject(reports));
pushKO = reports.Count(r => !r.OK && !r.AlreadyPresent);
}
};
var setapikey = new Command("store-api-key", "Store this API key")
var setapikey = new Command("set-api-key")
{
Run = sargs => StoreApiKey(sargs)
};
setapikey.Options = pushoptions;
commandSet.Add(setapikey);
commandSet.Add(pushCmd);
commandSet.Add(setapikey);
commandSet.Add(srcCmd);
commandSet.Add(showCommand);
@ -202,11 +202,9 @@ namespace isn
return 1;
}
if (shouldShowVersion)
{
Console.WriteLine("isn version " + GitVersionInformation.AssemblySemFileVer);
}
return commandSet.Run(args);
int runCode = commandSet.Run(args);
return (runCode == 0 && pushKO > 0) ? 500 : runCode;
}
}
}

View File

@ -1,90 +1,19 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Security.Cryptography;
using System.Text;
using Newtonsoft.Json;
namespace isn
{
public class SourceSettings
{
/// <summary>
/// Protected API Key
/// </summary>
/// <value></value>
public string ApiKey { get; set; }
/// <summary>
/// Key alias
/// </summary>
/// <value></value>
public string Url { get; set; }
public SourceSettings()
{
}
public string GetClearApiKey()
{
return ApiKey;
}
public void SetApiKey(string key)
{
ApiKey = key;
}
public string ApiKey { get; set; }
public string Alias { get; set; }
}
public class Settings
{
private Settings()
{
}
public static Settings Create()
{
return new Settings {
Sources = new Dictionary<string, SourceSettings>()
};
}
public string DataProtectionTitle {get; set; }
public Dictionary<string, SourceSettings> Sources { get; set; }
private string defSourceKey;
/// <summary>
/// Default source by its alias
/// </summary>
/// <value></value>
public string DefaultSourceKey
{
get => defSourceKey;
set
{
defSourceKey = value;
}
}
[JsonIgnore, NotMapped]
public string CurrentSourceKey {get; set;}
[JsonIgnore, NotMapped]
public SourceSettings CurrentSource
{
get
{
if (CurrentSourceKey==null) return null;
if (!Sources.ContainsKey(CurrentSourceKey))
{
Sources.Add(CurrentSourceKey, new SourceSettings());
}
return Sources[CurrentSourceKey];
}
}
public bool AutoUpdateApiKey { get; set; } = false;
public string DefaultSource { get; set; }
}
}
}

View File

@ -17,21 +17,8 @@ namespace isn
// var json = await client.GetStringAsync(new System.Uri(url));
Task.Run(async ()=> {
try {
var response = await client.GetStringAsync(url);
result = JsonConvert.DeserializeObject<ApiIndexViewModel>(response);
} catch (HttpRequestException ex)
{
if (ex.StatusCode==HttpStatusCode.NotFound)
{
Console.Error.WriteLine("Not found ... server's down ?");
}
else
{
Console.Error.WriteLine($"{ex.StatusCode} : {ex.Message}");
}
}
}).Wait();
return result;

View File

@ -4,7 +4,6 @@ using System.IO;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
using Newtonsoft.Json;
namespace isn
{
@ -25,19 +24,35 @@ namespace isn
using (var multipartFormDataContent = new MultipartFormDataContent())
{
/* var values = new[]
{
new KeyValuePair<string, string>("Id", Guid.NewGuid().ToString()),
new KeyValuePair<string, string>("Key", "awesome"),
new KeyValuePair<string, string>("From", "khalid@home.com")
//other values
};foreach (var keyValuePair in values)
{
multipartFormDataContent.Add(new StringContent(keyValuePair.Value),
String.Format("\"{0}\"", keyValuePair.Key));
} */
multipartFormDataContent.Add(new ByteArrayContent(File.ReadAllBytes(fi.FullName)),
'"' + "File" + '"',
'"' + fi.Name + '"');
var result = await client.PutAsync(uri, multipartFormDataContent);
if (result.IsSuccessStatusCode) return
new PushReport() {
KO = JsonConvert.DeserializeObject<APIKO>(await result.Content.ReadAsStringAsync())
};
if (result.IsSuccessStatusCode)
{
string report = await result.Content.ReadAsStringAsync();
Console.WriteLine(report);
}
else
return new PushReport() {
OK = true
};
{
string ereport = await result.Content.ReadAsStringAsync();
Console.WriteLine(ereport);
}
return new PushReport();
}
}
}

View File

@ -0,0 +1,195 @@
using System;
using System.IO;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
namespace isn
{
public class UploadFilesToServerUsingWebRequest
{
public void UploadFilesToServer(PushReport report, Uri uri, FileInfo fi,
string apikey)
{
// string formdataTemplate = "Content-Disposition: form-data; name=\"{0}\"\r\n\r\n{1}";
const int TXLEN = 0x1000;
/// the form-data file upload, properly formatted
string fileheaderTemplate = "Content-Disposition: form-data; name=\"{0}\"; filename=\"{1}\";\r\nContent-Type: {2}\r\n\r\n";
ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };
// "X-NuGet-ApiKey
string boundary = "----------" + DateTime.Now.Ticks.ToString("x");
string fileheader = string.Format(fileheaderTemplate, "file", fi.Name, "application/octet-stream");
byte[] fileheaderbytes = Encoding.ASCII.GetBytes(fileheader);
var boundarybytes = System.Text.Encoding.ASCII.GetBytes("\r\n--" + boundary + "\r\n");
var endBoundaryBytes = System.Text.Encoding.ASCII.GetBytes("\r\n--" + boundary + "--");
HttpWebRequest httpWebRequest = (HttpWebRequest) WebRequest.Create(uri);
httpWebRequest.Method = "PUT";
httpWebRequest.ContentType = "multipart/form-data; boundary=" + boundary;
httpWebRequest.AllowAutoRedirect = false;
httpWebRequest.Headers.Add("X-NuGet-Client-Version", Constants.ClientVersion);
httpWebRequest.Headers.Add("X-NuGet-ApiKey", apikey);
httpWebRequest.ContentLength = boundarybytes.Length +
fileheaderbytes.Length + fi.Length + endBoundaryBytes.Length;
httpWebRequest.BeginGetRequestStream(async (result) =>
{
try
{
HttpWebRequest request = (HttpWebRequest)result.AsyncState;
using (Stream requestStream = request.EndGetRequestStream(result))
{
await WriteToStream(requestStream, boundarybytes, boundarybytes.Length);
await WriteToStream(requestStream, fileheaderbytes, fileheaderbytes.Length);
using (var fss = fi.OpenRead())
{
byte[] buffer = new byte[TXLEN];
var form_bytes_read = fss.Read(buffer, 0, TXLEN);
while (form_bytes_read > 0)
{
await WriteToStream(requestStream, buffer, form_bytes_read);
form_bytes_read = fss.Read(buffer, 0, TXLEN);
}
}
requestStream.Write(endBoundaryBytes, 0, endBoundaryBytes.Length);
requestStream.Close();
}
}
catch (Exception rex)
{
report.Executed = false;
report.StackTrace = rex.StackTrace;
report.Message = rex.Message;
Console.Error.WriteLine("Stack trace:");
Console.Error.WriteLine(rex.StackTrace);
WebResponse eresp = httpWebRequest.GetResponse();
if (!CheckResponse(eresp, report))
throw new Exception("Invalid server response type");
}
}, httpWebRequest);
WebResponse resp = httpWebRequest.GetResponse();
if (!CheckResponse(resp, report)) throw new Exception("Invalid server response type");
if (Program.Settings.AutoUpdateApiKey)
Program.EnsureKeyStored();
}
static bool CheckResponse(WebResponse resp, PushReport report)
{
Stream stream = resp.GetResponseStream();
StreamReader re = new StreamReader(stream);
if (resp is HttpWebResponse)
{
if (resp.ContentType == "text/json")
{
String json = re.ReadToEnd();
report.Message = json;
var hrep = resp as HttpWebResponse;
report.StatusCode = hrep.StatusCode.ToString();
report.OK = hrep.StatusCode == HttpStatusCode.Accepted
|| hrep.StatusCode == HttpStatusCode.OK;
return true;
}
}
return false;
}
/// <summary>
/// Creates HTTP POST request &amp; uploads database to server. Author : Farhan Ghumra
/// </summary>
internal async Task UploadFilesToServerAsync(PushReport report, Uri uri, FileInfo fi,
string apikey)
{
// string formdataTemplate = "Content-Disposition: form-data; name=\"{0}\"\r\n\r\n{1}";
const int TXLEN = 0x1000;
/// the form-data file upload, properly formatted
string fileheaderTemplate = "Content-Disposition: form-data; name=\"{0}\"; filename=\"{1}\";\r\nContent-Type: {2}\r\n\r\n";
ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };
// "X-NuGet-ApiKey
string boundary = "----------" + DateTime.Now.Ticks.ToString("x");
string fileheader = string.Format(fileheaderTemplate, "file", fi.Name, "application/octet-stream");
byte[] fileheaderbytes = Encoding.ASCII.GetBytes(fileheader);
var boundarybytes = System.Text.Encoding.ASCII.GetBytes("\r\n--" + boundary + "\r\n");
var endBoundaryBytes = System.Text.Encoding.ASCII.GetBytes("\r\n--" + boundary + "--");
HttpWebRequest httpWebRequest = (HttpWebRequest)WebRequest.Create(uri);
httpWebRequest.Method = "PUT";
httpWebRequest.ContentType = "multipart/form-data; boundary=" + boundary;
httpWebRequest.AllowAutoRedirect = false;
httpWebRequest.Headers.Add("X-NuGet-Client-Version", Constants.ClientVersion);
httpWebRequest.Headers.Add("X-NuGet-ApiKey", apikey);
httpWebRequest.ContentLength = boundarybytes.Length +
fileheaderbytes.Length + fi.Length + endBoundaryBytes.Length;
httpWebRequest.BeginGetRequestStream(async (result) =>
{
try
{
HttpWebRequest request = (HttpWebRequest)result.AsyncState;
using (Stream requestStream = request.EndGetRequestStream(result))
{
await WriteToStream(requestStream, boundarybytes, boundarybytes.Length);
await WriteToStream(requestStream, fileheaderbytes, fileheaderbytes.Length);
using (var fss = fi.OpenRead())
{
byte[] buffer = new byte[TXLEN];
var form_bytes_read = fss.Read(buffer, 0, TXLEN);
while (form_bytes_read > 0)
{
await WriteToStream(requestStream, buffer, form_bytes_read);
form_bytes_read = fss.Read(buffer, 0, TXLEN);
}
}
requestStream.Write(endBoundaryBytes, 0, endBoundaryBytes.Length);
requestStream.Close();
}
}
catch (Exception rex)
{
report.Message = rex.Message;
Console.Error.WriteLine(rex.Message);
Console.Error.WriteLine("Stack trace:");
Console.Error.WriteLine(rex.StackTrace);
throw;
}
}, httpWebRequest);
WebResponse resp = await httpWebRequest.GetResponseAsync();
Stream stream = resp.GetResponseStream();
StreamReader re = new StreamReader(stream);
if (resp is HttpWebResponse)
{
String json = await re.ReadToEndAsync();
report.Message = json;
var hrep = resp as HttpWebResponse;
report.StatusCode = hrep.StatusCode.ToString();
report.OK = hrep.StatusCode == HttpStatusCode.Accepted
|| hrep.StatusCode == HttpStatusCode.OK;
}
else throw new Exception("Invalid server response type");
}
/// <summary>
/// Writes byte array to stream. Author : Farhan Ghumra
/// </summary>
private static async Task WriteToStream(Stream s, byte[] bytes, int len)
{
await s.WriteAsync(bytes, 0, len);
}
}
}

View File

@ -10,18 +10,12 @@ namespace isn
{
public class PushCommand
{
Settings settings;
public PushCommand(Settings settings)
static public PushReport Run(string pkg, string source)
{
this.settings = settings;
}
public PushReport Run(string pkg, string source, string apiKey)
{
if (source == null) source = Program.Settings.DefaultSource;
if (source == null) throw new InvalidOperationException("source is null");
string apikey = Program.Protector.UnProtect(Program.Settings.Sources[source].ApiKey);
var resources = SourceHelpers.GetServerResources(source);
if (resources == null) return null;
if (resources.Resources == null)
throw new InvalidOperationException("source gave no resource");
if (!resources.Resources.Any(res => res.Type == "PackagePublish/2.0.0"))
@ -33,30 +27,26 @@ namespace isn
var report = new PushReport
{
PkgName = fi.Name,
Message = "The package does not exist : " + fi.FullName
Message = "Le fichier n'existe pas"
};
return report;
}
using (var client = new HttpClient(
new HttpClientHandler
{
AllowAutoRedirect = false
}
))
using (var client = new HttpClient())
try
{
return client.UploadFilesToServer(new Uri(pubRes.Id), fi, settings.Sources[source].ApiKey);
Console.WriteLine("Connecting to "+ pubRes.Id);
return client.UploadFilesToServer(new Uri(pubRes.Id), fi, apikey);
}
catch (HttpRequestException httpEx)
catch (HttpRequestException hrex)
{
var report = new PushReport
{
PkgName = fi.Name,
Message = "HttpRequest: " + httpEx.Message,
StackTrace = httpEx.StackTrace,
StatusCode = httpEx.HResult.ToString()
Message = "HttpRequest: " + hrex.Message,
StackTrace = hrex.StackTrace,
StatusCode = hrex.HResult.ToString()
};
Console.Error.WriteLine(httpEx.Message);
Console.Error.WriteLine(hrex.Message);
return report;
}
catch (Exception ex)

View File

@ -12,15 +12,17 @@ namespace isn
public static List<PushReport> PushPkg(IEnumerable<string> pkgs)
{
List<PushReport> pushReports = new List<PushReport>();
var cmd = new PushCommand(Settings);
if (Settings.CurrentSource == null) throw new InvalidOperationException("source is null");
var source = Settings.CurrentSource;
foreach (string pkg in pkgs)
{
var report = cmd.Run(pkg, source.Url, source.ApiKey);
var report = PushCommand.Run(pkg, currentSource);
pushReports.Add(report);
}
if (storApiKey)
{
EnsureKeyStored();
}
return pushReports;
}

View File

@ -0,0 +1,75 @@
using System;
using System.Collections.Generic;
using System.IO;
using Newtonsoft.Json;
namespace isn
{
partial class Program
{
private static void StoreApiKey(IEnumerable<string> storeArgs)
{
var args = storeoptions.Parse(storeArgs);
if (shouldShowPushHelp)
{
// output the options
Console.Error.WriteLine("Push Options:");
storeoptions.WriteOptionDescriptions(Console.Out);
}
else
{
apiKey = args[0];
EnsureKeyStored();
}
}
public static void EnsureKeyStored()
{
if (currentSource == null)
{
if (Settings.DefaultSource == null)
return;
currentSource = Settings.DefaultSource;
}
if (Settings.Sources.ContainsKey(currentSource))
{
if (apiKey == null)
{
// Une suppression
Settings.Sources.Remove(currentSource);
if (Settings.DefaultSource == currentSource) Settings.DefaultSource = null;
}
else
{
// Une mise À jour
string ptd = Protector.Protect(apiKey);
Settings.Sources[currentSource].ApiKey = ptd;
if (Settings.DefaultSource == null) Settings.DefaultSource = currentSource;
}
}
else if (apiKey != null)
{
// une addition
string ptd = Protector.Protect(apiKey);
Settings.Sources.Add(currentSource, new SourceSettings { ApiKey = ptd });
}
SaveConfig();
}
public static void SaveConfig()
{
FileInfo cfgSettingIf = new FileInfo(_configFileName);
if (!cfgSettingIf.Directory.Exists) cfgSettingIf.Directory.Create();
File.WriteAllText(
cfgSettingIf.FullName,
JsonConvert.SerializeObject(
Settings,
Formatting.Indented
));
}
}
}

View File

@ -16,7 +16,7 @@ namespace isn
{
SourceSettings setting = Settings.Sources[arg];
throw new InvalidOperationException
(setting.Url);
(setting.Alias);
}
throw new NotImplementedException();
}

View File

@ -11,9 +11,9 @@ namespace isn
SourceSettings settings =
Settings.Sources.ContainsKey(arg) ?
Settings.Sources[arg] :
Settings.Sources.Values.FirstOrDefault((s)=> s.Url == arg) ;
Settings.Sources.Values.FirstOrDefault((s)=> s.Alias == arg) ;
if (settings==null) throw new InvalidOperationException(arg);
Settings.DefaultSourceKey = arg;
Settings.DefaultSource = arg;
SaveConfig();
}

View File

@ -1,46 +0,0 @@
using System;
using System.Collections.Generic;
using System.IO;
using Newtonsoft.Json;
namespace isn
{
partial class Program
{
private static void StoreApiKey(IEnumerable<string> storeArgs)
{
var args = storeoptions.Parse(storeArgs);
if (args.Count != 1)
{
Console.Error.WriteLine("StoreApiKey command takes only one argument, the key.");
shouldShowPushHelp=true;
}
if (shouldShowPushHelp)
{
// output the options
Console.Error.WriteLine("StoreApiKey Options:");
storeoptions.WriteOptionDescriptions(Console.Out);
}
else
{
Settings.CurrentSource.SetApiKey(args[0]);
SaveConfig();
}
}
public static void SaveConfig()
{
FileInfo cfgSettingIf = new FileInfo(_configFileName);
if (!cfgSettingIf.Directory.Exists) cfgSettingIf.Directory.Create();
File.WriteAllText(
cfgSettingIf.FullName,
JsonConvert.SerializeObject(
Settings,
Formatting.Indented
));
Console.WriteLine("config saved .");
}
}
}

View File

@ -1,22 +1,27 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net9.0</TargetFrameworks>
<TargetFrameworks>netcoreapp2.1</TargetFrameworks>
<RootNamespace>nuget_cli</RootNamespace>
<UserSecretsId>45b74c62-05bc-4603-95b4-3e80ae2fdf50</UserSecretsId>
<Version>1.0.5</Version>
<PackageVersion>1.0.1</PackageVersion>
<IsPackable>true</IsPackable>
<PackageLicenseExpression>WTFPL</PackageLicenseExpression>
<IsTool>true</IsTool>
<NoWarn>NETSDK1138</NoWarn>
<InformationalVersion>1.0.7+Branch.main.Sha.3695c1742965d93eba0ad851656cfaa3e44ba327</InformationalVersion>
<AssemblyVersion>1.0.5.0</AssemblyVersion>
<FileVersion>1.0.5.0</FileVersion>
<InformationalVersion>1.0.5+Branch.main.Sha.14206ac477d0f07566d5e8125dc52cbd7f474ca2</InformationalVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.Security.Cryptography.Pkcs" Version="9.0.6" />
<PackageReference Include="Mono.Options" Version="6.12.0.148" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="unleash.client" Version="5.2.1" />
<PackageReference Include="GitVersion.MsBuild" Version="6.3.0" />
<PackageReference Include="Mono.Options" Version="5.3.0" />
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
<PackageReference Include="unleash.client" Version="1.6.1" />
<Reference Include="System.Net.Http" Version="4.0.0" />
<PackageReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="../isn.abst/isn.abst.csproj" />
</ItemGroup>
</Project>

View File

@ -1,42 +1,15 @@
using System.Threading.Tasks.Dataflow;
using System.Net;
using System.Text;
using Newtonsoft.Json;
namespace isn
{
public class PushReport
{
public PushReport()
{
}
public string PkgName { get; set; }
public bool Executed { get; set; }
public bool OK { get; set; }
public bool AlreadyPresent { get; set; }
public string Message { get; set; }
public string StatusCode { get; set; }
public string StackTrace { get; set; }
public APIKO KO { get; set; }
public string ToDoc()
{
StringBuilder sb = new StringBuilder($"= push {PkgName}\n\n");
if (Executed) sb.AppendLine("* Executed");
if (OK) sb.AppendLine("* OK");
if (!string.IsNullOrWhiteSpace(Message))
sb.AppendLine("* Message :" + Message);
if (!string.IsNullOrWhiteSpace(StatusCode))
sb.AppendLine($"* Status Code : ");
if (!string.IsNullOrWhiteSpace(StackTrace))
sb.AppendLine($"* StackTrace : " + StackTrace);
if (KO!=null)
sb.AppendLine($"* KO : " + KO.Context);
return sb.ToString();
}
public bool Executed { get; internal set; }
public bool OK { get; internal set; }
public bool AlreadyPresent { get; internal set; }
public string Message { get; internal set; }
public string StatusCode { get; internal set; }
public string StackTrace { get; internal set; }
}
}

Some files were not shown because too many files have changed in this diff Show More