Compare commits
No commits in common. 'b87a54ef9994efbb7b663e90317e1cfcd689f201' and '281f606a419ae2c88c5c9294a3bbce2fa0e2ab72' have entirely different histories.
b87a54ef99
...
281f606a41
@ -1,24 +0,0 @@
|
|||||||
<?xml version="1.0"?>
|
|
||||||
<project name="Isn" default="clean" basedir=".">
|
|
||||||
<description>The Hello World of build files.</description>
|
|
||||||
<property name="debug" value="true" overwrite="false" />
|
|
||||||
|
|
||||||
<target name="clean" description="remove all generated files">
|
|
||||||
<delete dir="src/isn.abst/bin/" failonerror="false" />
|
|
||||||
<delete dir="src/isn.abst/obj/" failonerror="false" />
|
|
||||||
<delete dir="src/isn/bin/" failonerror="false" />
|
|
||||||
<delete dir="src/isn/obj/" failonerror="false" />
|
|
||||||
<delete dir="src/isnd/bin/" failonerror="false" />
|
|
||||||
<delete dir="src/isnd/obj/" failonerror="false" />
|
|
||||||
<delete dir="test/isn.tests/bin/" failonerror="false" />
|
|
||||||
<delete dir="test/isn.tests/obj/" failonerror="false" />
|
|
||||||
<delete dir="test/isnd.tests/bin/" failonerror="false" />
|
|
||||||
<delete dir="test/isnd.tests/obj/" failonerror="false" />
|
|
||||||
</target>
|
|
||||||
<target name="build" description="build all">
|
|
||||||
<exec program="dotnet" commandline="build" />
|
|
||||||
</target>
|
|
||||||
<target name="test" description="test all">
|
|
||||||
<exec program="dotnet" commandline="test" />
|
|
||||||
</target>
|
|
||||||
</project>
|
|
||||||
@ -1,21 +0,0 @@
|
|||||||
.sass-cache/
|
|
||||||
/src/isnd/bin/
|
|
||||||
/src/isnd/obj/
|
|
||||||
/src/isn/obj
|
|
||||||
/src/isn/bin
|
|
||||||
/src/isn/.vscode/
|
|
||||||
/test/isnd.tests/obj/
|
|
||||||
/test/isnd.tests/bin/
|
|
||||||
/test/isn.tests/bin
|
|
||||||
/test/isn.tests/obj/
|
|
||||||
/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
|
|
||||||
|
|
||||||
@ -1,66 +0,0 @@
|
|||||||
# You can override the included template(s) by including variable overrides
|
|
||||||
# See https://docs.gitlab.com/ee/user/application_security/sast/#customizing-the-sast-settings
|
|
||||||
# Note that environment variables can be set in several places
|
|
||||||
# See https://docs.gitlab.com/ee/ci/variables/#priority-of-environment-variables
|
|
||||||
image: busybox:latest
|
|
||||||
before_script:
|
|
||||||
- dotnet restore
|
|
||||||
- dotnet nuget remove source gitlab || true
|
|
||||||
nonreg:
|
|
||||||
tags:
|
|
||||||
- dotnet
|
|
||||||
stage: test
|
|
||||||
environment: Development
|
|
||||||
script:
|
|
||||||
- |
|
|
||||||
echo "setting : $ISND_TESTING_SETTINGS"
|
|
||||||
dotnet build
|
|
||||||
cat $ISND_TESTING_SETTINGS > test/isnd.tests/appsettings.json
|
|
||||||
dotnet test
|
|
||||||
publish:
|
|
||||||
tags:
|
|
||||||
- dotnet
|
|
||||||
stage: deploy
|
|
||||||
dependencies:
|
|
||||||
- nonreg
|
|
||||||
artifacts:
|
|
||||||
paths:
|
|
||||||
- src/isnd/bin/Release/netcoreapp2.1/publish/
|
|
||||||
when: always
|
|
||||||
script:
|
|
||||||
- dotnet publish --configuration Release
|
|
||||||
deploy-to-gitlab:
|
|
||||||
tags:
|
|
||||||
- dotnet
|
|
||||||
stage: deploy
|
|
||||||
dependencies:
|
|
||||||
- nonreg
|
|
||||||
artifacts:
|
|
||||||
paths:
|
|
||||||
- src/*/bin/Release/*.nupkg
|
|
||||||
when: always
|
|
||||||
script:
|
|
||||||
- dotnet pack -c Release
|
|
||||||
- dotnet nuget add source --name gitlab --username gitlab+deploy-token-2 --password
|
|
||||||
$CI_JOB_TOKEN --store-password-in-clear-text "$CI_SERVER_URL/api/v4/projects/$CI_PROJECT_ID/packages/nuget/index.json"
|
|
||||||
- dotnet nuget push src/*/bin/Release/*.nupkg -s gitlab
|
|
||||||
deploy-to-isn:
|
|
||||||
stage: deploy
|
|
||||||
tags:
|
|
||||||
- dotnet
|
|
||||||
artifacts:
|
|
||||||
paths:
|
|
||||||
- src/*/bin/Release/*.nupkg
|
|
||||||
when: always
|
|
||||||
script:
|
|
||||||
- dotnet pack --configuration Release --no-restore
|
|
||||||
- cd src/isn
|
|
||||||
- find -name "*.nupkg" -exec dotnet run push -s $ISNSOURCE -k $ISNAPIKEY {} \;
|
|
||||||
environment:
|
|
||||||
name: production
|
|
||||||
url: $ISNSOURCE
|
|
||||||
dependencies:
|
|
||||||
- nonreg
|
|
||||||
stages:
|
|
||||||
- test
|
|
||||||
- deploy
|
|
||||||
@ -1,90 +0,0 @@
|
|||||||
{
|
|
||||||
"version": "2.0.0",
|
|
||||||
"tasks": [
|
|
||||||
{
|
|
||||||
"label": "build",
|
|
||||||
"command": "dotnet",
|
|
||||||
"type": "process",
|
|
||||||
"args": [
|
|
||||||
"build",
|
|
||||||
"/p:Configuration=Debug",
|
|
||||||
"/property:GenerateFullPaths=true",
|
|
||||||
"/consoleloggerparameters:NoSummary"
|
|
||||||
],
|
|
||||||
"problemMatcher": "$msCompile",
|
|
||||||
"group": "build"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "db-upgrade",
|
|
||||||
"command": "dotnet",
|
|
||||||
"type": "process",
|
|
||||||
"args": [
|
|
||||||
"ef",
|
|
||||||
"database",
|
|
||||||
"update"
|
|
||||||
],
|
|
||||||
"problemMatcher": "$msCompile",
|
|
||||||
"options": {
|
|
||||||
"cwd": "${workspaceFolder}/src/isnd",
|
|
||||||
"env": {
|
|
||||||
"ASPNETCORE_ENV": "Development"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"dependsOn":["build"],
|
|
||||||
"group": "test"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "publish",
|
|
||||||
"command": "dotnet",
|
|
||||||
"type": "process",
|
|
||||||
"args": [
|
|
||||||
"publish",
|
|
||||||
"/p:GenerateFullPaths=true",
|
|
||||||
"/consoleloggerparameters:NoSummary",
|
|
||||||
"/p:TargetFramework=netcoreapp2.1",
|
|
||||||
"/p:RuntimeIdentifier=linux-x64",
|
|
||||||
"/p:PublishDir=${workspaceFolder}/artifacts"
|
|
||||||
],
|
|
||||||
"problemMatcher": "$msCompile",
|
|
||||||
"options": {
|
|
||||||
"cwd": "${workspaceFolder}"
|
|
||||||
},
|
|
||||||
"group": "none"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "test",
|
|
||||||
"command": "dotnet",
|
|
||||||
"type": "process",
|
|
||||||
"options": {
|
|
||||||
"env": {
|
|
||||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"args": [
|
|
||||||
"test",
|
|
||||||
"/property:GenerateFullPaths=true",
|
|
||||||
"--logger:xunit"
|
|
||||||
],
|
|
||||||
"problemMatcher": "$msCompile",
|
|
||||||
"dependsOn": [ "build"],
|
|
||||||
"group": "test"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "watch",
|
|
||||||
"command": "dotnet",
|
|
||||||
"type": "process",
|
|
||||||
"args": [
|
|
||||||
"bin/Debug/netcoreapp2.1/isnd.dll",
|
|
||||||
"/property:GenerateFullPaths=true",
|
|
||||||
"/restore"
|
|
||||||
],
|
|
||||||
"options": {
|
|
||||||
"env": {
|
|
||||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"problemMatcher": "$msCompile",
|
|
||||||
"group": "none"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@ -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>
|
|
||||||
@ -1,14 +1,11 @@
|
|||||||
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
||||||
Version 2, December 2004
|
Version 2, December 2004
|
||||||
|
|
||||||
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
|
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
|
||||||
|
|
||||||
Everyone is permitted to copy and distribute verbatim or modified
|
Everyone is permitted to copy and distribute verbatim or modified copies of this license document, and changing it is allowed as long as the name is changed.
|
||||||
copies of this license document, and changing it is allowed as long
|
|
||||||
as the name is changed.
|
|
||||||
|
|
||||||
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
||||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||||
|
|
||||||
0. You just DO WHAT THE FUCK YOU WANT TO.
|
0. You just DO WHAT THE FUCK YOU WANT TO.
|
||||||
|
|
||||||
|
|||||||
@ -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
|
|
||||||
|
|
||||||
@ -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
|
|
||||||
@ -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 +0,0 @@
|
|||||||
# You must remove unused comment lines for the released package.
|
|
||||||
@ -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.
|
|
||||||
File diff suppressed because it is too large
Load Diff
@ -1,2 +0,0 @@
|
|||||||
|
|
||||||
# You must remove unused comment lines for the released package.
|
|
||||||
@ -1,2 +0,0 @@
|
|||||||
[DEFAULT]
|
|
||||||
upstream-tag=v%(version)s
|
|
||||||
@ -1,2 +0,0 @@
|
|||||||
|
|
||||||
# You must remove unused comment lines for the released package.
|
|
||||||
@ -1,2 +0,0 @@
|
|||||||
|
|
||||||
# You must remove unused comment lines for the released package.
|
|
||||||
@ -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
|
|
||||||
@ -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.
|
|
||||||
@ -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 ...
|
|
||||||
@ -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:
|
|
||||||
@ -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:
|
|
||||||
-->
|
|
||||||
@ -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>
|
|
||||||
@ -1 +0,0 @@
|
|||||||
# You must remove unused comment lines for the released package.
|
|
||||||
@ -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
|
|
||||||
@ -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
|
|
||||||
@ -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
|
|
||||||
@ -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
|
|
||||||
@ -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
|
|
||||||
@ -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
|
|
||||||
@ -1 +0,0 @@
|
|||||||
3.0 (quilt)
|
|
||||||
@ -1,2 +0,0 @@
|
|||||||
# See dh_lintian(1)
|
|
||||||
# cut and paste the lintian(1) outputs without leading "E: ", "W: ", ...
|
|
||||||
@ -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
|
|
||||||
@ -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.
|
|
||||||
@ -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.
|
|
||||||
@ -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.
|
|
||||||
|
|
||||||
===
|
|
||||||
@ -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
|
|
||||||
@ -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:
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
# You must remove unused comment lines for the released package.
|
|
||||||
# Compulsory line, this is a version 4 file
|
|
||||||
version=4
|
|
||||||
@ -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.
|
|
||||||
@ -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.
|
|
||||||
@ -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.
|
|
||||||
@ -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
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
# Daily cron jobs shell script for the yavsc package
|
|
||||||
#true
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
# Hourly cron jobs shell script for the yavsc package
|
|
||||||
#true
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
# Monthly cron jobs shell script for the yavsc package
|
|
||||||
#true
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
# Weekly cron jobs shell script for the yavsc package
|
|
||||||
#true
|
|
||||||
@ -1,7 +0,0 @@
|
|||||||
# Defaults for yavsc initscript
|
|
||||||
|
|
||||||
#
|
|
||||||
# This is a POSIX shell fragment
|
|
||||||
#
|
|
||||||
|
|
||||||
#DAEMON_OPTS=""
|
|
||||||
@ -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
|
|
||||||
@ -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
|
|
||||||
@ -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))))
|
|
||||||
@ -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: ", ...
|
|
||||||
@ -1,2 +0,0 @@
|
|||||||
# If this exists, it is installed into lib/systemd/system/yavsc.service in yavsc
|
|
||||||
# See dh_systemd_enable(1).
|
|
||||||
@ -1,2 +0,0 @@
|
|||||||
# If this exists, it is installed into usr/lib/tmpfiles.d/yavsc.conf in yavsc
|
|
||||||
# See dh_installtmpfiles(1).
|
|
||||||
@ -1,27 +0,0 @@
|
|||||||
{
|
|
||||||
"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
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -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"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@ -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"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@ -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; }
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,24 +0,0 @@
|
|||||||
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'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,18 +0,0 @@
|
|||||||
using isnd.Data.Catalog;
|
|
||||||
using Newtonsoft.Json;
|
|
||||||
|
|
||||||
namespace isn.Abstract
|
|
||||||
{
|
|
||||||
public class ApiIndexViewModel : Permalink
|
|
||||||
{
|
|
||||||
public ApiIndexViewModel(string id) : base(id, "ApiIndex")
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
[JsonProperty("version")]
|
|
||||||
public string Version { get; set; }
|
|
||||||
|
|
||||||
[JsonProperty("resources")]
|
|
||||||
public Resource[] Resources { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,9 +0,0 @@
|
|||||||
namespace isn.abst
|
|
||||||
{
|
|
||||||
public static class Constants
|
|
||||||
{
|
|
||||||
public const string PacketFileExtension = "nupkg";
|
|
||||||
public const string SpecFileExtension = "nuspec";
|
|
||||||
public const string ApiVersionPrefix = "/v3";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -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();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,18 +0,0 @@
|
|||||||
using isnd.Data.Catalog;
|
|
||||||
using Newtonsoft.Json;
|
|
||||||
|
|
||||||
namespace isn.Abstract
|
|
||||||
{
|
|
||||||
public class Resource : Permalink
|
|
||||||
{
|
|
||||||
public Resource(string id, string typename) : base(id)
|
|
||||||
{
|
|
||||||
Type = typename;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
[JsonProperty("comment")]
|
|
||||||
public string Comment {get; set; }
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,20 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.ComponentModel.DataAnnotations;
|
|
||||||
using System.Linq;
|
|
||||||
|
|
||||||
namespace isnd.Attributes
|
|
||||||
{
|
|
||||||
public class SafeNameAttribute : ValidationAttribute
|
|
||||||
{
|
|
||||||
public override bool IsValid(object value)
|
|
||||||
{
|
|
||||||
if (!(value is string))
|
|
||||||
return false;
|
|
||||||
string str = value as string;
|
|
||||||
if (str.Length>126) return false;
|
|
||||||
if (str.Any(c => !char.IsLetterOrDigit(c)
|
|
||||||
&& !"-_.".Contains(c))) return false;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,7 +0,0 @@
|
|||||||
namespace isn
|
|
||||||
{
|
|
||||||
internal static class Constants
|
|
||||||
{
|
|
||||||
internal const string ClientVersion = "isn v1.0";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
namespace isn
|
|
||||||
{
|
|
||||||
public class IsndErrorMessage
|
|
||||||
{
|
|
||||||
public int ecode { get; set; }
|
|
||||||
public string msg { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,90 +0,0 @@
|
|||||||
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 class Settings
|
|
||||||
{
|
|
||||||
private Settings()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Settings Create()
|
|
||||||
{
|
|
||||||
return new Settings {
|
|
||||||
Sources = new Dictionary<string, SourceSettings>()
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
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];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,40 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.IO;
|
|
||||||
using System.Net;
|
|
||||||
using System.Net.Http;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Newtonsoft.Json;
|
|
||||||
using isn.Abstract;
|
|
||||||
|
|
||||||
namespace isn
|
|
||||||
{
|
|
||||||
public static class SourceHelpers
|
|
||||||
{
|
|
||||||
public static ApiIndexViewModel GetServerResources(string url)
|
|
||||||
{
|
|
||||||
HttpClient client = new HttpClient();
|
|
||||||
ApiIndexViewModel result = null;
|
|
||||||
// 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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,44 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.IO;
|
|
||||||
using System.Net;
|
|
||||||
using System.Net.Http;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Newtonsoft.Json;
|
|
||||||
|
|
||||||
namespace isn
|
|
||||||
{
|
|
||||||
public static class UploadFilesToServerUsingHttpClient
|
|
||||||
{
|
|
||||||
public static PushReport UploadFilesToServer(this HttpClient client, Uri uri, FileInfo fi,
|
|
||||||
string apikey)
|
|
||||||
{
|
|
||||||
return UploadFilesToServerAsync(client, uri, fi, apikey).Result;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static async Task<PushReport> UploadFilesToServerAsync(this HttpClient client, Uri uri, FileInfo fi,
|
|
||||||
string apikey)
|
|
||||||
{
|
|
||||||
|
|
||||||
client.DefaultRequestHeaders.Add("X-NuGet-Client-Version", Constants.ClientVersion);
|
|
||||||
client.DefaultRequestHeaders.Add("X-NuGet-ApiKey", apikey);
|
|
||||||
|
|
||||||
using (var multipartFormDataContent = new MultipartFormDataContent())
|
|
||||||
{
|
|
||||||
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())
|
|
||||||
};
|
|
||||||
else
|
|
||||||
return new PushReport() {
|
|
||||||
OK = true
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,75 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.IO;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Net;
|
|
||||||
using System.Net.Http;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Newtonsoft.Json;
|
|
||||||
|
|
||||||
namespace isn
|
|
||||||
{
|
|
||||||
public class PushCommand
|
|
||||||
{
|
|
||||||
Settings settings;
|
|
||||||
|
|
||||||
public PushCommand(Settings settings)
|
|
||||||
{
|
|
||||||
this.settings = settings;
|
|
||||||
}
|
|
||||||
|
|
||||||
public PushReport Run(string pkg, string source, string 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"))
|
|
||||||
throw new InvalidOperationException("Source won't serve the expected push command");
|
|
||||||
var pubRes = resources.Resources.First(res => res.Type == "PackagePublish/2.0.0");
|
|
||||||
FileInfo fi = new FileInfo(pkg);
|
|
||||||
if (!fi.Exists)
|
|
||||||
{
|
|
||||||
var report = new PushReport
|
|
||||||
{
|
|
||||||
PkgName = fi.Name,
|
|
||||||
Message = "The package does not exist : " + fi.FullName
|
|
||||||
};
|
|
||||||
return report;
|
|
||||||
}
|
|
||||||
using (var client = new HttpClient(
|
|
||||||
new HttpClientHandler
|
|
||||||
{
|
|
||||||
AllowAutoRedirect = false
|
|
||||||
}
|
|
||||||
))
|
|
||||||
try
|
|
||||||
{
|
|
||||||
return client.UploadFilesToServer(new Uri(pubRes.Id), fi, settings.Sources[source].ApiKey);
|
|
||||||
}
|
|
||||||
catch (HttpRequestException httpEx)
|
|
||||||
{
|
|
||||||
var report = new PushReport
|
|
||||||
{
|
|
||||||
PkgName = fi.Name,
|
|
||||||
Message = "HttpRequest: " + httpEx.Message,
|
|
||||||
StackTrace = httpEx.StackTrace,
|
|
||||||
StatusCode = httpEx.HResult.ToString()
|
|
||||||
};
|
|
||||||
Console.Error.WriteLine(httpEx.Message);
|
|
||||||
return report;
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
var report = new PushReport
|
|
||||||
{
|
|
||||||
PkgName = fi.Name,
|
|
||||||
Message = ex.Message,
|
|
||||||
StackTrace = ex.StackTrace
|
|
||||||
};
|
|
||||||
Console.Error.WriteLine(ex.Message);
|
|
||||||
return report;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,33 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Newtonsoft.Json;
|
|
||||||
|
|
||||||
|
|
||||||
namespace isn
|
|
||||||
{
|
|
||||||
|
|
||||||
partial class Program
|
|
||||||
{
|
|
||||||
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);
|
|
||||||
pushReports.Add(report);
|
|
||||||
}
|
|
||||||
return pushReports;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static object Add(IEnumerable<string> str)
|
|
||||||
{
|
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,19 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using Newtonsoft.Json;
|
|
||||||
|
|
||||||
|
|
||||||
namespace isn
|
|
||||||
{
|
|
||||||
|
|
||||||
partial class Program
|
|
||||||
{
|
|
||||||
|
|
||||||
private static void ShowConfig()
|
|
||||||
{
|
|
||||||
Console.WriteLine(JsonConvert.SerializeObject(Settings, Formatting.Indented));
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,25 +0,0 @@
|
|||||||
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using Newtonsoft.Json;
|
|
||||||
|
|
||||||
namespace isn
|
|
||||||
{
|
|
||||||
|
|
||||||
partial class Program
|
|
||||||
{
|
|
||||||
private static void SourceAdd(IEnumerable<string> str)
|
|
||||||
{
|
|
||||||
foreach (string arg in str)
|
|
||||||
{
|
|
||||||
if (Settings.Sources.ContainsKey(arg))
|
|
||||||
{
|
|
||||||
SourceSettings setting = Settings.Sources[arg];
|
|
||||||
throw new InvalidOperationException
|
|
||||||
(setting.Url);
|
|
||||||
}
|
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,20 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using Newtonsoft.Json;
|
|
||||||
|
|
||||||
namespace isn
|
|
||||||
{
|
|
||||||
partial class Program
|
|
||||||
{
|
|
||||||
private static void SourceList(IEnumerable<string> sargs)
|
|
||||||
{
|
|
||||||
IEnumerable<string> spec = sargs.Count()>0 ? sargs : Settings.Sources.Keys;
|
|
||||||
foreach (string arg in spec)
|
|
||||||
{
|
|
||||||
SourceSettings setting = Settings.Sources[arg];
|
|
||||||
Console.WriteLine(JsonConvert.SerializeObject(setting));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,21 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Linq;
|
|
||||||
|
|
||||||
namespace isn
|
|
||||||
{
|
|
||||||
|
|
||||||
partial class Program
|
|
||||||
{
|
|
||||||
private static void SetDefaultSource(string arg)
|
|
||||||
{
|
|
||||||
SourceSettings settings =
|
|
||||||
Settings.Sources.ContainsKey(arg) ?
|
|
||||||
Settings.Sources[arg] :
|
|
||||||
Settings.Sources.Values.FirstOrDefault((s)=> s.Url == arg) ;
|
|
||||||
if (settings==null) throw new InvalidOperationException(arg);
|
|
||||||
Settings.DefaultSourceKey = arg;
|
|
||||||
SaveConfig();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -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 .");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,42 +0,0 @@
|
|||||||
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();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
using Microsoft.AspNetCore.Authorization;
|
|
||||||
|
|
||||||
namespace isnd.Authorization
|
|
||||||
{
|
|
||||||
internal class ValidApiKeyRequirement : IAuthorizationRequirement
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,13 +0,0 @@
|
|||||||
using System.Threading.Tasks;
|
|
||||||
using Microsoft.AspNetCore.Authorization;
|
|
||||||
|
|
||||||
namespace isnd.Authorization
|
|
||||||
{
|
|
||||||
internal class ValidApiKeyRequirementHandler : AuthorizationHandler<ValidApiKeyRequirement>
|
|
||||||
{
|
|
||||||
protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, ValidApiKeyRequirement requirement)
|
|
||||||
{
|
|
||||||
throw new System.NotImplementedException();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,9 +0,0 @@
|
|||||||
namespace isnd
|
|
||||||
{
|
|
||||||
public static class IsndConstants
|
|
||||||
{
|
|
||||||
public const string AdministratorRoleName = "Admin";
|
|
||||||
public const string RequireAdminPolicyName = "RequireAdministratorRole";
|
|
||||||
public const string RequireValidApiKey = "RequireValideApiKey";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,257 +0,0 @@
|
|||||||
// Copyright (c) Brock Allen & Dominick Baier. All rights reserved.
|
|
||||||
// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.
|
|
||||||
|
|
||||||
using Microsoft.AspNetCore.Authentication;
|
|
||||||
using Microsoft.AspNetCore.Authorization;
|
|
||||||
using Microsoft.AspNetCore.Http;
|
|
||||||
using Microsoft.AspNetCore.Identity;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
using Microsoft.Extensions.Options;
|
|
||||||
using isnd.Data;
|
|
||||||
using isnd.Data.Roles;
|
|
||||||
using System;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Security.Claims;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace isnd.Controllers
|
|
||||||
{
|
|
||||||
public class AccountController : Controller
|
|
||||||
{
|
|
||||||
private readonly IAuthenticationSchemeProvider _schemeProvider;
|
|
||||||
|
|
||||||
private readonly SignInManager<ApplicationUser> _signInManager;
|
|
||||||
private readonly UserManager<ApplicationUser> _userManager;
|
|
||||||
private readonly AdminStartupList _startupAdminList;
|
|
||||||
|
|
||||||
public AccountController(
|
|
||||||
IAuthenticationSchemeProvider schemeProvider,
|
|
||||||
SignInManager<ApplicationUser> signInManager,
|
|
||||||
UserManager<ApplicationUser> userManager,
|
|
||||||
IOptions<AdminStartupList> startupAdminListConfig )
|
|
||||||
{
|
|
||||||
_schemeProvider = schemeProvider;
|
|
||||||
_signInManager = signInManager;
|
|
||||||
_userManager = userManager;
|
|
||||||
_startupAdminList = startupAdminListConfig.Value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Entry point into the login workflow
|
|
||||||
/// </summary>
|
|
||||||
[HttpGet,AllowAnonymous]
|
|
||||||
public async Task<IActionResult> Login(string returnUrl)
|
|
||||||
{
|
|
||||||
// build a model so we know what to show on the login page
|
|
||||||
var vm = await BuildLoginViewModelAsync(returnUrl);
|
|
||||||
|
|
||||||
if (vm.IsExternalLoginOnly)
|
|
||||||
{
|
|
||||||
// we only have one option for logging in and it's an external provider
|
|
||||||
return RedirectToAction("Challenge", "External", new { scheme = vm.ExternalLoginScheme, returnUrl });
|
|
||||||
}
|
|
||||||
|
|
||||||
return View(vm);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Handle postback from username/password login
|
|
||||||
/// </summary>
|
|
||||||
[HttpPost]
|
|
||||||
[ValidateAntiForgeryToken, AllowAnonymous]
|
|
||||||
public async Task<IActionResult> Login(LoginInputModel model, string button)
|
|
||||||
{
|
|
||||||
|
|
||||||
// the user clicked the "cancel" button
|
|
||||||
if (button != "login")
|
|
||||||
{
|
|
||||||
|
|
||||||
// since we don't have a valid context, then we just go back to the home page
|
|
||||||
return Redirect("~/");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ModelState.IsValid)
|
|
||||||
{
|
|
||||||
// validate username/password
|
|
||||||
var user = await _userManager.FindByNameAsync(model.Username);
|
|
||||||
var signResult = await _signInManager.CheckPasswordSignInAsync(user, model.Password, true);
|
|
||||||
|
|
||||||
if (signResult.Succeeded)
|
|
||||||
{
|
|
||||||
|
|
||||||
// only set explicit expiration here if user chooses "remember me".
|
|
||||||
// otherwise we rely upon expiration configured in cookie middleware.
|
|
||||||
AuthenticationProperties props = null;
|
|
||||||
if (AccountOptions.AllowRememberLogin && model.RememberLogin)
|
|
||||||
{
|
|
||||||
props = new AuthenticationProperties
|
|
||||||
{
|
|
||||||
IsPersistent = true,
|
|
||||||
ExpiresUtc = DateTimeOffset.UtcNow.Add(AccountOptions.RememberMeLoginDuration)
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
await _signInManager.SignInAsync(user, model.RememberLogin && AccountOptions.AllowRememberLogin);
|
|
||||||
if (Url.IsLocalUrl(model.ReturnUrl))
|
|
||||||
{
|
|
||||||
return Redirect(model.ReturnUrl);
|
|
||||||
}
|
|
||||||
else if (string.IsNullOrEmpty(model.ReturnUrl))
|
|
||||||
{
|
|
||||||
return Redirect("~/");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// user might have clicked on a malicious link - should be logged
|
|
||||||
throw new Exception("invalid return URL");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ModelState.AddModelError(string.Empty, AccountOptions.InvalidCredentialsErrorMessage);
|
|
||||||
}
|
|
||||||
|
|
||||||
// something went wrong, show form with error
|
|
||||||
var vm = await BuildLoginViewModelAsync(model);
|
|
||||||
return View(vm);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Show logout page
|
|
||||||
/// </summary>
|
|
||||||
[HttpGet]
|
|
||||||
public async Task<IActionResult> Logout(string logoutId)
|
|
||||||
{
|
|
||||||
// build a model so the logout page knows what to display
|
|
||||||
var vm = BuildLogoutViewModel(logoutId);
|
|
||||||
|
|
||||||
if (vm.ShowLogoutPrompt == false)
|
|
||||||
{
|
|
||||||
// if the request for logout was properly authenticated from IdentityServer, then
|
|
||||||
// we don't need to show the prompt and can just log the user out directly.
|
|
||||||
return await Logout(vm);
|
|
||||||
}
|
|
||||||
|
|
||||||
return View(vm);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Handle logout page postback
|
|
||||||
/// </summary>
|
|
||||||
[HttpPost]
|
|
||||||
[ValidateAntiForgeryToken]
|
|
||||||
public async Task<IActionResult> Logout(LogoutInputModel model)
|
|
||||||
{
|
|
||||||
// build a model so the logged out page knows what to display
|
|
||||||
var vm = BuildLoggedOutViewModel(model.LogoutId);
|
|
||||||
|
|
||||||
if (User?.Identity.IsAuthenticated == true)
|
|
||||||
{
|
|
||||||
// delete local authentication cookie
|
|
||||||
await HttpContext.SignOutAsync();
|
|
||||||
}
|
|
||||||
|
|
||||||
// check if we need to trigger sign-out at an upstream identity provider
|
|
||||||
if (vm.TriggerExternalSignout)
|
|
||||||
{
|
|
||||||
// build a return URL so the upstream provider will redirect back
|
|
||||||
// to us after the user has logged out. this allows us to then
|
|
||||||
// complete our single sign-out processing.
|
|
||||||
string url = Url.Action("Logout", new { logoutId = vm.LogoutId });
|
|
||||||
|
|
||||||
// this triggers a redirect to the external provider for sign-out
|
|
||||||
return SignOut(new AuthenticationProperties { RedirectUri = url }, vm.ExternalAuthenticationScheme);
|
|
||||||
}
|
|
||||||
|
|
||||||
return View("LoggedOut", vm);
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpGet,AllowAnonymous]
|
|
||||||
public IActionResult AccessDenied()
|
|
||||||
{
|
|
||||||
return new BadRequestObjectResult(403);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*****************************************/
|
|
||||||
/* helper APIs for the AccountController */
|
|
||||||
/*****************************************/
|
|
||||||
private async Task<LoginViewModel> BuildLoginViewModelAsync(string returnUrl)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
var schemes = await _schemeProvider.GetAllSchemesAsync();
|
|
||||||
|
|
||||||
var providers = schemes
|
|
||||||
.Where(x => x.DisplayName != null)
|
|
||||||
.Select(x => new ExternalProvider
|
|
||||||
{
|
|
||||||
DisplayName = x.DisplayName ?? x.Name,
|
|
||||||
AuthenticationScheme = x.Name
|
|
||||||
}).ToList();
|
|
||||||
|
|
||||||
var allowLocal = true;
|
|
||||||
|
|
||||||
|
|
||||||
return new LoginViewModel
|
|
||||||
{
|
|
||||||
AllowRememberLogin = AccountOptions.AllowRememberLogin,
|
|
||||||
EnableLocalLogin = allowLocal && AccountOptions.AllowLocalLogin,
|
|
||||||
ReturnUrl = returnUrl,
|
|
||||||
ExternalProviders = providers.ToArray()
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
private async Task<LoginViewModel> BuildLoginViewModelAsync(LoginInputModel model)
|
|
||||||
{
|
|
||||||
var vm = await BuildLoginViewModelAsync(model.ReturnUrl);
|
|
||||||
vm.Username = model.Username;
|
|
||||||
vm.RememberLogin = model.RememberLogin;
|
|
||||||
return vm;
|
|
||||||
}
|
|
||||||
|
|
||||||
private LogoutViewModel BuildLogoutViewModel(string logoutId)
|
|
||||||
{
|
|
||||||
var vm = new LogoutViewModel { LogoutId = logoutId, ShowLogoutPrompt = AccountOptions.ShowLogoutPrompt };
|
|
||||||
|
|
||||||
if (User?.Identity.IsAuthenticated != true)
|
|
||||||
{
|
|
||||||
// if the user is not authenticated, then just show logged out page
|
|
||||||
vm.ShowLogoutPrompt = false;
|
|
||||||
return vm;
|
|
||||||
}
|
|
||||||
|
|
||||||
// show the logout prompt. this prevents attacks where the user
|
|
||||||
// is automatically signed out by another malicious web page.
|
|
||||||
return vm;
|
|
||||||
}
|
|
||||||
|
|
||||||
private LoggedOutViewModel BuildLoggedOutViewModel(string logoutId)
|
|
||||||
{
|
|
||||||
var vm = new LoggedOutViewModel
|
|
||||||
{
|
|
||||||
AutomaticRedirectAfterSignOut = AccountOptions.AutomaticRedirectAfterSignOut,
|
|
||||||
LogoutId = logoutId
|
|
||||||
};
|
|
||||||
return vm;
|
|
||||||
}
|
|
||||||
|
|
||||||
[Authorize]
|
|
||||||
public async Task<IActionResult> GetAdminrole()
|
|
||||||
{
|
|
||||||
string username = User.FindFirstValue(ClaimTypes.NameIdentifier);
|
|
||||||
if (_startupAdminList.Users.Contains(username))
|
|
||||||
{
|
|
||||||
var user = await _userManager.FindByNameAsync(username);
|
|
||||||
var roles = await _userManager.GetRolesAsync(user);
|
|
||||||
if (!roles.Contains(IsndConstants.AdministratorRoleName))
|
|
||||||
{
|
|
||||||
await _userManager.AddToRoleAsync(user, IsndConstants.AdministratorRoleName);
|
|
||||||
|
|
||||||
}
|
|
||||||
return Ok();
|
|
||||||
}
|
|
||||||
return BadRequest();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,148 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Security.Claims;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Microsoft.AspNetCore.Authorization;
|
|
||||||
using Microsoft.AspNetCore.DataProtection;
|
|
||||||
using Microsoft.AspNetCore.Identity;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
using Microsoft.AspNetCore.Mvc.Rendering;
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
using Microsoft.Extensions.Options;
|
|
||||||
using isnd.Data;
|
|
||||||
using isnd.Entities;
|
|
||||||
using isnd.Data.ApiKeys;
|
|
||||||
using isnd.Interfaces;
|
|
||||||
|
|
||||||
|
|
||||||
namespace isnd.Controllers
|
|
||||||
{
|
|
||||||
[Authorize]
|
|
||||||
public class ApiKeysController : Controller
|
|
||||||
{
|
|
||||||
private readonly ApplicationDbContext dbContext;
|
|
||||||
private readonly IsndSettings isndSettings;
|
|
||||||
private readonly UserManager<ApplicationUser> _userManager;
|
|
||||||
private readonly IApiKeyProvider apiKeyProvider;
|
|
||||||
private readonly IDataProtector protector;
|
|
||||||
public ApiKeysController(ApplicationDbContext dbContext,
|
|
||||||
IOptions<IsndSettings> isndSettingsOptions,
|
|
||||||
IDataProtectionProvider provider,
|
|
||||||
UserManager<ApplicationUser> userManager,
|
|
||||||
IApiKeyProvider apiKeyProvider
|
|
||||||
)
|
|
||||||
{
|
|
||||||
this.dbContext = dbContext;
|
|
||||||
this.isndSettings = isndSettingsOptions.Value;
|
|
||||||
protector = provider.CreateProtector(isndSettings.ProtectionTitle);
|
|
||||||
_userManager = userManager;
|
|
||||||
this.apiKeyProvider = apiKeyProvider;
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpGet]
|
|
||||||
public async Task<ActionResult> Index()
|
|
||||||
{
|
|
||||||
List<ApiKey> index = await GetUserKeys().ToListAsync();
|
|
||||||
IndexModel model = new IndexModel { ApiKey = index };
|
|
||||||
ViewData["Title"] = "Index";
|
|
||||||
return View("Index", model);
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpGet]
|
|
||||||
public async Task<ActionResult> Create()
|
|
||||||
{
|
|
||||||
var userId = User.FindFirstValue(ClaimTypes.NameIdentifier);
|
|
||||||
var user = await _userManager.FindByIdAsync(userId);
|
|
||||||
ViewBag.UserId = new SelectList(new List<ApplicationUser> { user });
|
|
||||||
return View(new CreateModel{ });
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpPost]
|
|
||||||
public async Task<ActionResult> Create(CreateModel model)
|
|
||||||
{
|
|
||||||
string userId = User.FindFirstValue(ClaimTypes.NameIdentifier);
|
|
||||||
IQueryable<ApiKey> userKeys = apiKeyProvider.GetUserKeys(User.Identity.Name);
|
|
||||||
if (userKeys.Count() >= isndSettings.MaxUserKeyCount)
|
|
||||||
{
|
|
||||||
ModelState.AddModelError(null, "Maximum key count reached");
|
|
||||||
return View();
|
|
||||||
}
|
|
||||||
model.UserId = userId;
|
|
||||||
|
|
||||||
ApiKey newKey = await apiKeyProvider.CreateApiKeyAsync(model);
|
|
||||||
|
|
||||||
return View("Details", new DetailModel { Name = newKey.Name,
|
|
||||||
ProtectedValue = protector.Protect(newKey.Id),
|
|
||||||
ApiKey = newKey });
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpGet]
|
|
||||||
public async Task<ActionResult> Delete(string id)
|
|
||||||
{
|
|
||||||
string userid = User.FindFirstValue(ClaimTypes.NameIdentifier);
|
|
||||||
ApiKey key = await dbContext.ApiKey.FirstOrDefaultAsync(k => k.Id == id && k.UserId == userid);
|
|
||||||
return View(new DeleteModel { ApiKey = key });
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpPost]
|
|
||||||
public async Task<ActionResult> Delete(DeleteModel model)
|
|
||||||
{
|
|
||||||
string userid = User.FindFirstValue(ClaimTypes.NameIdentifier);
|
|
||||||
ApiKey key = dbContext.ApiKey.FirstOrDefault(k => k.Id == model.ApiKey.Id && k.UserId == userid);
|
|
||||||
if (key == null)
|
|
||||||
{
|
|
||||||
ModelState.AddModelError(null, "Key not found");
|
|
||||||
return View();
|
|
||||||
}
|
|
||||||
_ = dbContext.ApiKey.Remove(key);
|
|
||||||
_ = await dbContext.SaveChangesAsync();
|
|
||||||
return View("Index", new IndexModel { ApiKey = GetUserKeys().ToList() } );
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<ActionResult> Details(string id)
|
|
||||||
{
|
|
||||||
string userid = User.FindFirstValue(ClaimTypes.NameIdentifier);
|
|
||||||
ApiKey key = await dbContext.ApiKey.FirstOrDefaultAsync(k => k.Id == id && k.UserId == userid);
|
|
||||||
if (key == null)
|
|
||||||
{
|
|
||||||
ModelState.AddModelError("id", "Key not found");
|
|
||||||
return View();
|
|
||||||
}
|
|
||||||
return View("Details", new DetailModel { ApiKey = key, Name = key.Name, ProtectedValue = protector.Protect(key.Id)});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<ActionResult> Edit(string id)
|
|
||||||
{
|
|
||||||
|
|
||||||
EditModel edit = new EditModel();
|
|
||||||
string userId = User.FindFirstValue(ClaimTypes.NameIdentifier);
|
|
||||||
|
|
||||||
var user = await _userManager.FindByIdAsync(userId);
|
|
||||||
|
|
||||||
edit.ApiKey = await GetUserKeys().SingleOrDefaultAsync(k =>
|
|
||||||
k.UserId == userId && k.Id == id);
|
|
||||||
ViewBag.UserId = new SelectList(new List<ApplicationUser> { user });
|
|
||||||
|
|
||||||
return View(edit);
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpPost]
|
|
||||||
public async Task<ActionResult> Edit(EditModel model)
|
|
||||||
{
|
|
||||||
string userId = User.FindFirstValue(ClaimTypes.NameIdentifier);
|
|
||||||
|
|
||||||
var apiKey = await dbContext.ApiKey.SingleOrDefaultAsync(k => k.UserId == userId && k.Id == model.ApiKey.Id);
|
|
||||||
apiKey.Name = model.ApiKey.Name;
|
|
||||||
apiKey.ValidityPeriodInDays = model.ApiKey.ValidityPeriodInDays;
|
|
||||||
await dbContext.SaveChangesAsync();
|
|
||||||
return View("Details", new DetailModel { ApiKey = apiKey });
|
|
||||||
}
|
|
||||||
|
|
||||||
public IQueryable<ApiKey> GetUserKeys()
|
|
||||||
{
|
|
||||||
return dbContext.ApiKey.Include(k => k.User).Where(k => k.User.UserName == User.Identity.Name);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,18 +0,0 @@
|
|||||||
using System;
|
|
||||||
using Microsoft.AspNetCore.Authorization;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
using isnd.Data;
|
|
||||||
|
|
||||||
namespace isnd.Controllers
|
|
||||||
{
|
|
||||||
|
|
||||||
// TODO Web hook CI
|
|
||||||
public class NewUpdateController : Controller
|
|
||||||
{
|
|
||||||
[Authorize(Policy = IsndConstants.RequireAdminPolicyName)]
|
|
||||||
public IActionResult NewRelease(NewReleaseInfo release)
|
|
||||||
{
|
|
||||||
throw new NotImplementedException("web hook");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,54 +0,0 @@
|
|||||||
using System.Linq;
|
|
||||||
using System.Security.Claims;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Microsoft.AspNetCore.Authorization;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
using isnd.Data;
|
|
||||||
using isnd.ViewModels;
|
|
||||||
using isnd.Helpers;
|
|
||||||
using isnd.Interfaces;
|
|
||||||
|
|
||||||
namespace isnd
|
|
||||||
{
|
|
||||||
[AllowAnonymous]
|
|
||||||
public class PackageVersionController : Controller
|
|
||||||
{
|
|
||||||
private readonly ApplicationDbContext _context;
|
|
||||||
private readonly IPackageManager _pm;
|
|
||||||
|
|
||||||
public PackageVersionController(ApplicationDbContext context,
|
|
||||||
IPackageManager pm)
|
|
||||||
{
|
|
||||||
_context = context;
|
|
||||||
_pm = pm;
|
|
||||||
}
|
|
||||||
|
|
||||||
// GET: PackageVersion
|
|
||||||
public async Task<IActionResult> Index(PackageVersionIndexViewModel model)
|
|
||||||
{
|
|
||||||
var applicationDbContext = _context.PackageVersion.Include(p => p.Package)
|
|
||||||
.Include(p => p.Package.Owner)
|
|
||||||
.Include(p => p.Package.Versions)
|
|
||||||
.Where(
|
|
||||||
p => (model.Prerelease || !p.IsPrerelease)
|
|
||||||
&& ((model.PackageId == null) || p.PackageId.StartsWith(model.PackageId)));
|
|
||||||
model.Versions = await applicationDbContext.ToArrayAsync();
|
|
||||||
return View(model);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Authorize]
|
|
||||||
public async Task<IActionResult> Mines(PackageVersionIndexViewModel model)
|
|
||||||
{
|
|
||||||
var userId = User.FindFirstValue(ClaimTypes.NameIdentifier);
|
|
||||||
var applicationDbContext = _context.PackageVersion
|
|
||||||
.Include(p => p.Package).Where(
|
|
||||||
p => (string.IsNullOrEmpty(model.PackageId) || p.PackageId.StartsWith(model.PackageId))
|
|
||||||
&& p.Package.OwnerId == userId);
|
|
||||||
|
|
||||||
model.Versions = await applicationDbContext.ToArrayAsync();
|
|
||||||
|
|
||||||
return View("Index", model);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,40 +0,0 @@
|
|||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
using isnd.Services;
|
|
||||||
using isn.Abstract;
|
|
||||||
using isn.abst;
|
|
||||||
using isnd.Interfaces;
|
|
||||||
using System.Linq;
|
|
||||||
using isnd.Entities;
|
|
||||||
|
|
||||||
namespace isnd.Controllers
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Api Controller
|
|
||||||
/// </summary>
|
|
||||||
public class ApiController : Controller
|
|
||||||
{
|
|
||||||
private readonly IPackageManager packageManager;
|
|
||||||
private readonly Resource[] resources;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Api Controller Constructor
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="pm"></param>
|
|
||||||
public ApiController(IPackageManager pm)
|
|
||||||
{
|
|
||||||
packageManager = pm;
|
|
||||||
resources = packageManager.GetResources().ToArray();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// API index
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
[HttpGet("~" + Constants.ApiVersionPrefix + ApiConfig.Index)]
|
|
||||||
public IActionResult ApiIndex()
|
|
||||||
{
|
|
||||||
return Ok(new ApiIndexViewModel(packageManager.CatalogBaseUrl + ApiConfig.Index){ Version = PackageManager.BASE_API_LEVEL, Resources = resources });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,18 +0,0 @@
|
|||||||
using System.Threading.Tasks;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
using isnd.Entities;
|
|
||||||
using isn.abst;
|
|
||||||
|
|
||||||
namespace isnd.Controllers
|
|
||||||
{
|
|
||||||
public partial class PackagesController
|
|
||||||
{
|
|
||||||
[HttpGet("~" + Constants.ApiVersionPrefix + ApiConfig.PackageDetailUriTemplate)]
|
|
||||||
public async Task<IActionResult> Details(string id, string version)
|
|
||||||
{
|
|
||||||
var result = await packageManager.GetPackageDetailsAsync(id, version);
|
|
||||||
if (result==null) return NotFound();
|
|
||||||
return Ok(result);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,34 +0,0 @@
|
|||||||
using isnd.Services;
|
|
||||||
using isnd.Entities;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
using isn.abst;
|
|
||||||
|
|
||||||
namespace isnd.Controllers
|
|
||||||
{
|
|
||||||
public partial class PackagesController
|
|
||||||
{
|
|
||||||
|
|
||||||
// GET /autocomplete?id=isn.protocol&prerelease=true
|
|
||||||
[HttpGet("~" + Constants.ApiVersionPrefix + ApiConfig.AutoComplete)]
|
|
||||||
public IActionResult AutoComplete(
|
|
||||||
string id,
|
|
||||||
string semVerLevel,
|
|
||||||
bool prerelease = false,
|
|
||||||
string packageType = null,
|
|
||||||
int skip = 0,
|
|
||||||
int take = 25)
|
|
||||||
{
|
|
||||||
if (take > maxTake)
|
|
||||||
{
|
|
||||||
ModelState.AddModelError("take", "Maximum exceeded");
|
|
||||||
}
|
|
||||||
if (semVerLevel != PackageManager.BASE_API_LEVEL)
|
|
||||||
{
|
|
||||||
ModelState.AddModelError("semVerLevel", PackageManager.BASE_API_LEVEL + " expected");
|
|
||||||
}
|
|
||||||
if (ModelState.ErrorCount > 0) return BadRequest(ModelState);
|
|
||||||
|
|
||||||
return Ok(packageManager.AutoComplete(id,skip,take,prerelease,packageType));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,43 +0,0 @@
|
|||||||
using System.Threading.Tasks;
|
|
||||||
using isnd.Entities;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
using isn.abst;
|
|
||||||
|
|
||||||
namespace isnd.Controllers
|
|
||||||
{
|
|
||||||
public partial class PackagesController
|
|
||||||
{
|
|
||||||
|
|
||||||
// https://docs.microsoft.com/en-us/nuget/api/catalog-resource#versioning
|
|
||||||
[HttpGet("~" + Constants.ApiVersionPrefix + ApiConfig.Catalog)]
|
|
||||||
public async Task<IActionResult> CatalogIndex()
|
|
||||||
{
|
|
||||||
return Ok(await packageManager.GetCatalogIndexAsync());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[HttpGet("~" + Constants.ApiVersionPrefix + ApiConfig.Registration + "/{id}/{version}.json")]
|
|
||||||
public async Task<IActionResult> CatalogRegistration(string id, string version)
|
|
||||||
{
|
|
||||||
if ("index" == version)
|
|
||||||
{
|
|
||||||
var query = new Data.Catalog.PackageRegistrationQuery
|
|
||||||
{
|
|
||||||
Query = id,
|
|
||||||
Prerelease = true
|
|
||||||
};
|
|
||||||
var index = await packageManager.GetPackageRegistrationIndexAsync(query);
|
|
||||||
if (index == null) return NotFound();
|
|
||||||
|
|
||||||
return Ok(index);
|
|
||||||
}
|
|
||||||
// return Package details
|
|
||||||
var leaf = await packageManager.GetPackageDetailsAsync(id, version, null);
|
|
||||||
|
|
||||||
if (null == leaf) return NotFound(new { id, version });
|
|
||||||
return Ok(leaf);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,25 +0,0 @@
|
|||||||
using System.Threading.Tasks;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
using isnd.Helpers;
|
|
||||||
using isnd.Entities;
|
|
||||||
using System.ComponentModel.DataAnnotations;
|
|
||||||
using isnd.Attributes;
|
|
||||||
using System.Security.Claims;
|
|
||||||
using isn.abst;
|
|
||||||
|
|
||||||
namespace isnd.Controllers
|
|
||||||
{
|
|
||||||
public partial class PackagesController
|
|
||||||
{
|
|
||||||
[HttpDelete("~" + Constants.ApiVersionPrefix + ApiConfig.Package + "/{id}/{lower?}/{type?}")]
|
|
||||||
public async Task<IActionResult> ApiDelete(
|
|
||||||
[FromRoute][SafeName][Required] string id,
|
|
||||||
[FromRoute][SafeName][Required] string lower,
|
|
||||||
[FromRoute] string type)
|
|
||||||
{
|
|
||||||
var uid = User.FindFirstValue(ClaimTypes.NameIdentifier);
|
|
||||||
var report = await packageManager.UserAskForPackageDeletionAsync(uid, id, lower, type);
|
|
||||||
return Ok(report);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,47 +0,0 @@
|
|||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
using NuGet.Versioning;
|
|
||||||
using isnd.Entities;
|
|
||||||
using isn.abst;
|
|
||||||
|
|
||||||
namespace isnd.Controllers
|
|
||||||
{
|
|
||||||
public partial class PackagesController
|
|
||||||
{
|
|
||||||
[HttpGet("~" + Constants.ApiVersionPrefix + ApiConfig.ContentBase + "/{id}/{version}.json")]
|
|
||||||
|
|
||||||
public IActionResult GetVersions(
|
|
||||||
string id,
|
|
||||||
string version,
|
|
||||||
bool prerelease = true,
|
|
||||||
string packageType = null,
|
|
||||||
int skip = 0,
|
|
||||||
int take = 50)
|
|
||||||
{
|
|
||||||
NuGetVersion parsedVersion=null;
|
|
||||||
if (take > maxTake)
|
|
||||||
{
|
|
||||||
ModelState.AddModelError("take", "Maximum exceeded");
|
|
||||||
}
|
|
||||||
if ("index"==version)
|
|
||||||
{
|
|
||||||
version=null;
|
|
||||||
}
|
|
||||||
if (version!=null)
|
|
||||||
{
|
|
||||||
if (!NuGetVersion.TryParse(version, out parsedVersion))
|
|
||||||
{
|
|
||||||
ModelState.AddModelError("version", "invalid version string");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!ModelState.IsValid)
|
|
||||||
{
|
|
||||||
return BadRequest(ModelState);
|
|
||||||
}
|
|
||||||
return Ok(new
|
|
||||||
{
|
|
||||||
versions = packageManager.GetVersions(
|
|
||||||
id, parsedVersion, prerelease, packageType, skip, take)
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,71 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Microsoft.AspNetCore.DataProtection;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
using Microsoft.Extensions.Logging;
|
|
||||||
using isnd.Entities;
|
|
||||||
using Microsoft.AspNetCore.Http;
|
|
||||||
using isn.abst;
|
|
||||||
using System.IO;
|
|
||||||
|
|
||||||
namespace isnd.Controllers
|
|
||||||
{
|
|
||||||
|
|
||||||
public partial class PackagesController
|
|
||||||
{
|
|
||||||
// TODO [Authorize(Policy = IsndConstants.RequireValidApiKey)]
|
|
||||||
[HttpPut("~" + Constants.ApiVersionPrefix + ApiConfig.Package)]
|
|
||||||
public async Task<IActionResult> Put()
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
var clientVersionId = Request.Headers["X-NuGet-Client-Version"];
|
|
||||||
string apiKey = Request.Headers["X-NuGet-ApiKey"][0];
|
|
||||||
ViewData["versionId"] = typeof(PackagesController).Assembly.FullName;
|
|
||||||
var files = new List<string>();
|
|
||||||
ViewData["files"] = files;
|
|
||||||
|
|
||||||
var clearKey = protector.Unprotect(apiKey);
|
|
||||||
var dbApiKey = dbContext.ApiKey.SingleOrDefault(k => k.Id == clearKey);
|
|
||||||
if (dbApiKey == null)
|
|
||||||
{
|
|
||||||
logger.LogError("403 : no api-key");
|
|
||||||
return Unauthorized();
|
|
||||||
}
|
|
||||||
bool foundPackage = false;
|
|
||||||
|
|
||||||
foreach (IFormFile file in Request.Form.Files)
|
|
||||||
{
|
|
||||||
FileInfo inputFileInfo = new FileInfo(file.FileName);
|
|
||||||
switch (inputFileInfo.Extension)
|
|
||||||
{
|
|
||||||
case ".nupkg":
|
|
||||||
case ".nupkgs":
|
|
||||||
var libVersion = await packageManager.PutPackageAsync(inputFileInfo.Extension, file.OpenReadStream(), dbApiKey.UserId);
|
|
||||||
logger.LogInformation($"new package : {libVersion.PackageId} {libVersion.NugetLink}");
|
|
||||||
foundPackage = true;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
logger.LogInformation($"file extension is not supported : {inputFileInfo.Extension}");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
if (foundPackage)
|
|
||||||
return Ok();
|
|
||||||
return BadRequest("no package");
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
var message = $"PUT exception : {ex.Message} ({ex.GetType().Name})";
|
|
||||||
logger.LogError(message);
|
|
||||||
logger.LogError("Stack Trace : " + ex.StackTrace);
|
|
||||||
return new ObjectResult(new { ViewData, message })
|
|
||||||
{ StatusCode = 500 };
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue