]> git.proxmox.com Git - proxmox-offline-mirror.git/commitdiff
add docs
authorFabian Grünbichler <f.gruenbichler@proxmox.com>
Thu, 21 Jul 2022 13:56:38 +0000 (15:56 +0200)
committerFabian Grünbichler <f.gruenbichler@proxmox.com>
Tue, 6 Sep 2022 10:06:13 +0000 (12:06 +0200)
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
30 files changed:
Makefile
README [deleted file]
debian/rules [new file with mode: 0644]
defines.mk [new file with mode: 0644]
docs/GFDL.rst [new file with mode: 0644]
docs/Makefile [new file with mode: 0644]
docs/_ext/__pycache__/proxmox-scanrefs.cpython-39.pyc [new file with mode: 0644]
docs/_ext/proxmox-scanrefs.py [new file with mode: 0644]
docs/_templates/index-sidebar.html [new file with mode: 0644]
docs/_templates/sidebar-header.html [new file with mode: 0644]
docs/command-syntax.rst [new file with mode: 0644]
docs/conf.py [new file with mode: 0644]
docs/config/mirror/man5.rst [new file with mode: 0644]
docs/configuration-files.rst [new file with mode: 0644]
docs/custom.css [new file with mode: 0644]
docs/custom.js [new file with mode: 0644]
docs/epilog.rst [new file with mode: 0644]
docs/images/favicon.ico [new file with mode: 0755]
docs/images/proxmox-logo.png [new file with mode: 0644]
docs/images/proxmox-logo.svg [new file with mode: 0644]
docs/index.rst [new file with mode: 0644]
docs/introduction.rst [new file with mode: 0644]
docs/pom-copyright.rst [new file with mode: 0644]
docs/proxmox-apt-repo/description.rst [new file with mode: 0644]
docs/proxmox-apt-repo/man1.rst [new file with mode: 0644]
docs/proxmox-offline-mirror/description.rst [new file with mode: 0644]
docs/proxmox-offline-mirror/man1.rst [new file with mode: 0644]
docs/todos.rst [new file with mode: 0644]
src/bin/docgen.rs [new file with mode: 0644]
src/config.rs

index 5344d66fce23d98aa44e52cfbdcf5d669fb85106..200c19614b0e2d2b1bd91a3bd2c62dbdccd88783 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,10 +1,13 @@
 include /usr/share/dpkg/pkg-info.mk
 include /usr/share/dpkg/architecture.mk
+include defines.mk
 
 PACKAGE=proxmox-offline-mirror
 BUILDDIR ?= $(PACKAGE)-$(DEB_VERSION_UPSTREAM)
 BUILDDIR_TMP ?= $(BUILDDIR).tmp
 
+SUBDIRS := docs
+
 DEB=$(PACKAGE)_$(DEB_VERSION_UPSTREAM_REVISION)_$(DEB_BUILD_ARCH).deb
 LIB_DEB=librust-$(PACKAGE)-dev_$(DEB_VERSION_UPSTREAM_REVISION)_$(DEB_BUILD_ARCH).deb
 DBG_DEB=$(PACKAGE)-dbgsym_$(DEB_VERSION_UPSTREAM_REVISION)_$(DEB_BUILD_ARCH).deb
@@ -23,6 +26,10 @@ all: cargo-build $(SUBDIRS)
 cargo-build:
        cargo build $(CARGO_BUILD_ARGS)
 
+.PHONY: $(SUBDIRS)
+$(SUBDIRS):
+       $(MAKE) -C $@
+
 .PHONY: build
 build:
        rm -rf $(BUILDDIR) $(BUILDDIR_TMP); mkdir $(BUILDDIR_TMP)
diff --git a/README b/README
deleted file mode 100644 (file)
index 7702ae4..0000000
--- a/README
+++ /dev/null
@@ -1,85 +0,0 @@
-proxmox-apt-mirror tool
-=======================
-
-This tool consists of two binaries, `proxmox-apt-mirror` (mirror tool to create
-and manage mirrors and media containing repositories) and `proxmox-apt-repo`
-(helper to use media on offline systems).
-
-There are two basic entity types available for configuration:
-- mirrors, consisting of upstream repository metadata and a local path where snapshots are stored
--- configured with `proxmox-apt-mirror config mirror ...`
--- used with `proxmox-apt-mirror mirror ...`
-- media, consisting of local mirrors and a path where mirrors are synced to
--- configured with `proxmox-apt-mirror config medium ...`
--- used with `proxmox-apt-mirror medium ...`
-
-and one internal one, a `pool` consisting of
-- a pool directory containing checksum files (e.g., `sha256/3dc7bc5f82cdcc4ea0f69dd30d5f6bb19e0ccc36f4a79c865eed0e7a370cd5e4`)
-- a base directory containing directories and hardlinks to checksum files inside the pool directory
-
-Adding a file consists of first adding the checksum file(s), then linking them
-under one or more paths. a garbage collect operation will iterate over all
-files in the base directory and remove those which are not (or no longer) a
-hardlink to any checksum files, and remove any checksum files which have no
-hardlinks outside of the pool checksum file directories.
-
-A default config path of `/etc/proxmox-apt-mirror.cfg` is used, but is
-overridable on a per command basis (for example, to allow operation as non-root
-user).
-
-Setting up a mirror
-===================
-
-First either run the `setup` wizard (`proxmox-apt-mirror setup`), or the
-`config mirror add` command. For example, to add a mirror entry for the Debian
-Bullseye security repository, the following command can be used:
-
- proxmox-apt-mirror config mirror add \
-  --id debian-bullseye-security \
-  --architectures amd64 \
-  --architectures all \
-  --repository 'deb http://deb.debian.org/debian-security bullseye-security main contrib non-free' \
-  --key-path /etc/apt/trusted.gpg.d/debian-archive-bullseye-security-automatic.gpg \
-  --sync true \
-  --verify true \
-  --base-dir /path/to/mirror/dir/debian-bullseye-security \
-  --pool-dir /path/to/mirror/dir/debian-bullseye-security/.pool
-
-Syncing a mirror
-================
-
-To create the first (and subsequent) snapshots, the following command can be used:
-
- proxmox-apt-mirror mirror snapshot create --id debian-bullseye-security
-
-Setting up a medium
-===================
-
-Either run the `setup` wizard again, or use the `config medium add` command.
-For example, to define a new medium containing the
-`proxmox-ve-bullseye-no-subscription` and `debian-bullseye` mirrors, run the
-following command:
-
- proxmox-apt-mirror config medium add \
-  --id pve-bullseye \
-  --mirrors proxmox-ve-bullseye-no-subscription \
-  --mirrors debian-bullseye \
-  --sync true \
-  --verify true \
-  --mountpoint /path/where/medium/is/mounted
-
-Syncing a medium
-================
-
-To sync the local mirrors to a medium, the following command can be used:
-
- proxmox-apt-mirror medium sync --id pve-bullseye
-
-Using a medium
-==============
-
-After syncing a medium, unmount it and make it accessible on the (offline)
-target system. You can now either manually point apt at the synced snapshots,
-or run `proxmox-apt-repo setup` to generate a sources.list.d snippet referecing
-selected mirrors and snapshots. Don't forget to remove the snippet again after
-the upgrade is done.
diff --git a/debian/rules b/debian/rules
new file mode 100644 (file)
index 0000000..879a659
--- /dev/null
@@ -0,0 +1,13 @@
+#!/usr/bin/make -f
+
+export BUILD_MODE=release-deb
+%:
+       dh $@ --buildsystem cargo
+
+override_dh_auto_test:
+       # skip for now to avoid additional debug builds - no tests anyway
+       # dh_auto_test -- test --all
+
+override_dh_auto_install:
+       dh_auto_install
+       DESTDIR=../debian/proxmox-offline-mirror make -C docs install
diff --git a/defines.mk b/defines.mk
new file mode 100644 (file)
index 0000000..ebccd2b
--- /dev/null
@@ -0,0 +1,14 @@
+PREFIX = /usr
+BINDIR = $(PREFIX)/bin
+SBINDIR = $(PREFIX)/sbin
+LIBDIR = $(PREFIX)/lib
+LIBEXECDIR = $(LIBDIR)
+DATAROOTDIR = $(PREFIX)/share
+MAN1DIR = $(PREFIX)/share/man/man1
+MAN5DIR = $(PREFIX)/share/man/man5
+DOCDIR = $(PREFIX)/share/doc/proxmox-offline-mirror
+SYSCONFDIR = /etc
+ZSH_COMPL_DEST = $(PREFIX)/share/zsh/vendor-completions
+
+# For local overrides
+-include local.mak
diff --git a/docs/GFDL.rst b/docs/GFDL.rst
new file mode 100644 (file)
index 0000000..67a6d11
--- /dev/null
@@ -0,0 +1,422 @@
+GNU Free Documentation License
+==============================
+
+Version 1.3, 3 November 2008
+
+
+Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc. <https://fsf.org/>
+
+Everyone is permitted to copy and distribute verbatim copies of this
+ license document, but changing it is not allowed.
+
+0. PREAMBLE
+
+The purpose of this License is to make a manual, textbook, or other
+functional and useful document "free" in the sense of freedom: to
+assure everyone the effective freedom to copy and redistribute it,
+with or without modifying it, either commercially or noncommercially.
+Secondarily, this License preserves for the author and publisher a way
+to get credit for their work, while not being considered responsible
+for modifications made by others.
+
+This License is a kind of "copyleft", which means that derivative
+works of the document must themselves be free in the same sense.  It
+complements the GNU General Public License, which is a copyleft
+license designed for free software.
+
+We have designed this License in order to use it for manuals for free
+software, because free software needs free documentation: a free
+program should come with manuals providing the same freedoms that the
+software does.  But this License is not limited to software manuals;
+it can be used for any textual work, regardless of subject matter or
+whether it is published as a printed book.  We recommend this License
+principally for works whose purpose is instruction or reference.
+
+
+1. APPLICABILITY AND DEFINITIONS
+
+This License applies to any manual or other work, in any medium, that
+contains a notice placed by the copyright holder saying it can be
+distributed under the terms of this License.  Such a notice grants a
+world-wide, royalty-free license, unlimited in duration, to use that
+work under the conditions stated herein.  The "Document", below,
+refers to any such manual or work.  Any member of the public is a
+licensee, and is addressed as "you".  You accept the license if you
+copy, modify or distribute the work in a way requiring permission
+under copyright law.
+
+A "Modified Version" of the Document means any work containing the
+Document or a portion of it, either copied verbatim, or with
+modifications and/or translated into another language.
+
+A "Secondary Section" is a named appendix or a front-matter section of
+the Document that deals exclusively with the relationship of the
+publishers or authors of the Document to the Document's overall
+subject (or to related matters) and contains nothing that could fall
+directly within that overall subject.  (Thus, if the Document is in
+part a textbook of mathematics, a Secondary Section may not explain
+any mathematics.)  The relationship could be a matter of historical
+connection with the subject or with related matters, or of legal,
+commercial, philosophical, ethical or political position regarding
+them.
+
+The "Invariant Sections" are certain Secondary Sections whose titles
+are designated, as being those of Invariant Sections, in the notice
+that says that the Document is released under this License.  If a
+section does not fit the above definition of Secondary then it is not
+allowed to be designated as Invariant.  The Document may contain zero
+Invariant Sections.  If the Document does not identify any Invariant
+Sections then there are none.
+
+The "Cover Texts" are certain short passages of text that are listed,
+as Front-Cover Texts or Back-Cover Texts, in the notice that says that
+the Document is released under this License.  A Front-Cover Text may
+be at most 5 words, and a Back-Cover Text may be at most 25 words.
+
+A "Transparent" copy of the Document means a machine-readable copy,
+represented in a format whose specification is available to the
+general public, that is suitable for revising the document
+straightforwardly with generic text editors or (for images composed of
+pixels) generic paint programs or (for drawings) some widely available
+drawing editor, and that is suitable for input to text formatters or
+for automatic translation to a variety of formats suitable for input
+to text formatters.  A copy made in an otherwise Transparent file
+format whose markup, or absence of markup, has been arranged to thwart
+or discourage subsequent modification by readers is not Transparent.
+An image format is not Transparent if used for any substantial amount
+of text.  A copy that is not "Transparent" is called "Opaque".
+
+Examples of suitable formats for Transparent copies include plain
+ASCII without markup, Texinfo input format, LaTeX input format, SGML
+or XML using a publicly available DTD, and standard-conforming simple
+HTML, PostScript or PDF designed for human modification.  Examples of
+transparent image formats include PNG, XCF and JPG.  Opaque formats
+include proprietary formats that can be read and edited only by
+proprietary word processors, SGML or XML for which the DTD and/or
+processing tools are not generally available, and the
+machine-generated HTML, PostScript or PDF produced by some word
+processors for output purposes only.
+
+The "Title Page" means, for a printed book, the title page itself,
+plus such following pages as are needed to hold, legibly, the material
+this License requires to appear in the title page.  For works in
+formats which do not have any title page as such, "Title Page" means
+the text near the most prominent appearance of the work's title,
+preceding the beginning of the body of the text.
+
+The "publisher" means any person or entity that distributes copies of
+the Document to the public.
+
+A section "Entitled XYZ" means a named subunit of the Document whose
+title either is precisely XYZ or contains XYZ in parentheses following
+text that translates XYZ in another language.  (Here XYZ stands for a
+specific section name mentioned below, such as "Acknowledgements",
+"Dedications", "Endorsements", or "History".)  To "Preserve the Title"
+of such a section when you modify the Document means that it remains a
+section "Entitled XYZ" according to this definition.
+
+The Document may include Warranty Disclaimers next to the notice which
+states that this License applies to the Document.  These Warranty
+Disclaimers are considered to be included by reference in this
+License, but only as regards disclaiming warranties: any other
+implication that these Warranty Disclaimers may have is void and has
+no effect on the meaning of this License.
+
+2. VERBATIM COPYING
+
+You may copy and distribute the Document in any medium, either
+commercially or noncommercially, provided that this License, the
+copyright notices, and the license notice saying this License applies
+to the Document are reproduced in all copies, and that you add no
+other conditions whatsoever to those of this License.  You may not use
+technical measures to obstruct or control the reading or further
+copying of the copies you make or distribute.  However, you may accept
+compensation in exchange for copies.  If you distribute a large enough
+number of copies you must also follow the conditions in section 3.
+
+You may also lend copies, under the same conditions stated above, and
+you may publicly display copies.
+
+
+3. COPYING IN QUANTITY
+
+If you publish printed copies (or copies in media that commonly have
+printed covers) of the Document, numbering more than 100, and the
+Document's license notice requires Cover Texts, you must enclose the
+copies in covers that carry, clearly and legibly, all these Cover
+Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
+the back cover.  Both covers must also clearly and legibly identify
+you as the publisher of these copies.  The front cover must present
+the full title with all words of the title equally prominent and
+visible.  You may add other material on the covers in addition.
+Copying with changes limited to the covers, as long as they preserve
+the title of the Document and satisfy these conditions, can be treated
+as verbatim copying in other respects.
+
+If the required texts for either cover are too voluminous to fit
+legibly, you should put the first ones listed (as many as fit
+reasonably) on the actual cover, and continue the rest onto adjacent
+pages.
+
+If you publish or distribute Opaque copies of the Document numbering
+more than 100, you must either include a machine-readable Transparent
+copy along with each Opaque copy, or state in or with each Opaque copy
+a computer-network location from which the general network-using
+public has access to download using public-standard network protocols
+a complete Transparent copy of the Document, free of added material.
+If you use the latter option, you must take reasonably prudent steps,
+when you begin distribution of Opaque copies in quantity, to ensure
+that this Transparent copy will remain thus accessible at the stated
+location until at least one year after the last time you distribute an
+Opaque copy (directly or through your agents or retailers) of that
+edition to the public.
+
+It is requested, but not required, that you contact the authors of the
+Document well before redistributing any large number of copies, to
+give them a chance to provide you with an updated version of the
+Document.
+
+
+4. MODIFICATIONS
+
+You may copy and distribute a Modified Version of the Document under
+the conditions of sections 2 and 3 above, provided that you release
+the Modified Version under precisely this License, with the Modified
+Version filling the role of the Document, thus licensing distribution
+and modification of the Modified Version to whoever possesses a copy
+of it.  In addition, you must do these things in the Modified Version:
+
+A. Use in the Title Page (and on the covers, if any) a title distinct
+   from that of the Document, and from those of previous versions
+   (which should, if there were any, be listed in the History section
+   of the Document).  You may use the same title as a previous version
+   if the original publisher of that version gives permission.
+B. List on the Title Page, as authors, one or more persons or entities
+   responsible for authorship of the modifications in the Modified
+   Version, together with at least five of the principal authors of the
+   Document (all of its principal authors, if it has fewer than five),
+   unless they release you from this requirement.
+C. State on the Title page the name of the publisher of the
+   Modified Version, as the publisher.
+D. Preserve all the copyright notices of the Document.
+E. Add an appropriate copyright notice for your modifications
+   adjacent to the other copyright notices.
+F. Include, immediately after the copyright notices, a license notice
+   giving the public permission to use the Modified Version under the
+   terms of this License, in the form shown in the Addendum below.
+G. Preserve in that license notice the full lists of Invariant Sections
+   and required Cover Texts given in the Document's license notice.
+H. Include an unaltered copy of this License.
+I. Preserve the section Entitled "History", Preserve its Title, and add
+   to it an item stating at least the title, year, new authors, and
+   publisher of the Modified Version as given on the Title Page.  If
+   there is no section Entitled "History" in the Document, create one
+   stating the title, year, authors, and publisher of the Document as
+   given on its Title Page, then add an item describing the Modified
+   Version as stated in the previous sentence.
+J. Preserve the network location, if any, given in the Document for
+   public access to a Transparent copy of the Document, and likewise
+   the network locations given in the Document for previous versions
+   it was based on.  These may be placed in the "History" section.
+   You may omit a network location for a work that was published at
+   least four years before the Document itself, or if the original
+   publisher of the version it refers to gives permission.
+K. For any section Entitled "Acknowledgements" or "Dedications",
+   Preserve the Title of the section, and preserve in the section all
+   the substance and tone of each of the contributor acknowledgements
+   and/or dedications given therein.
+L. Preserve all the Invariant Sections of the Document,
+   unaltered in their text and in their titles.  Section numbers
+   or the equivalent are not considered part of the section titles.
+M. Delete any section Entitled "Endorsements".  Such a section
+   may not be included in the Modified Version.
+N. Do not retitle any existing section to be Entitled "Endorsements"
+   or to conflict in title with any Invariant Section.
+O. Preserve any Warranty Disclaimers.
+
+If the Modified Version includes new front-matter sections or
+appendices that qualify as Secondary Sections and contain no material
+copied from the Document, you may at your option designate some or all
+of these sections as invariant.  To do this, add their titles to the
+list of Invariant Sections in the Modified Version's license notice.
+These titles must be distinct from any other section titles.
+
+You may add a section Entitled "Endorsements", provided it contains
+nothing but endorsements of your Modified Version by various
+parties--for example, statements of peer review or that the text has
+been approved by an organization as the authoritative definition of a
+standard.
+
+You may add a passage of up to five words as a Front-Cover Text, and a
+passage of up to 25 words as a Back-Cover Text, to the end of the list
+of Cover Texts in the Modified Version.  Only one passage of
+Front-Cover Text and one of Back-Cover Text may be added by (or
+through arrangements made by) any one entity.  If the Document already
+includes a cover text for the same cover, previously added by you or
+by arrangement made by the same entity you are acting on behalf of,
+you may not add another; but you may replace the old one, on explicit
+permission from the previous publisher that added the old one.
+
+The author(s) and publisher(s) of the Document do not by this License
+give permission to use their names for publicity for or to assert or
+imply endorsement of any Modified Version.
+
+
+5. COMBINING DOCUMENTS
+
+You may combine the Document with other documents released under this
+License, under the terms defined in section 4 above for modified
+versions, provided that you include in the combination all of the
+Invariant Sections of all of the original documents, unmodified, and
+list them all as Invariant Sections of your combined work in its
+license notice, and that you preserve all their Warranty Disclaimers.
+
+The combined work need only contain one copy of this License, and
+multiple identical Invariant Sections may be replaced with a single
+copy.  If there are multiple Invariant Sections with the same name but
+different contents, make the title of each such section unique by
+adding at the end of it, in parentheses, the name of the original
+author or publisher of that section if known, or else a unique number.
+Make the same adjustment to the section titles in the list of
+Invariant Sections in the license notice of the combined work.
+
+In the combination, you must combine any sections Entitled "History"
+in the various original documents, forming one section Entitled
+"History"; likewise combine any sections Entitled "Acknowledgements",
+and any sections Entitled "Dedications".  You must delete all sections
+Entitled "Endorsements".
+
+
+6. COLLECTIONS OF DOCUMENTS
+
+You may make a collection consisting of the Document and other
+documents released under this License, and replace the individual
+copies of this License in the various documents with a single copy
+that is included in the collection, provided that you follow the rules
+of this License for verbatim copying of each of the documents in all
+other respects.
+
+You may extract a single document from such a collection, and
+distribute it individually under this License, provided you insert a
+copy of this License into the extracted document, and follow this
+License in all other respects regarding verbatim copying of that
+document.
+
+
+7. AGGREGATION WITH INDEPENDENT WORKS
+
+A compilation of the Document or its derivatives with other separate
+and independent documents or works, in or on a volume of a storage or
+distribution medium, is called an "aggregate" if the copyright
+resulting from the compilation is not used to limit the legal rights
+of the compilation's users beyond what the individual works permit.
+When the Document is included in an aggregate, this License does not
+apply to the other works in the aggregate which are not themselves
+derivative works of the Document.
+
+If the Cover Text requirement of section 3 is applicable to these
+copies of the Document, then if the Document is less than one half of
+the entire aggregate, the Document's Cover Texts may be placed on
+covers that bracket the Document within the aggregate, or the
+electronic equivalent of covers if the Document is in electronic form.
+Otherwise they must appear on printed covers that bracket the whole
+aggregate.
+
+
+8. TRANSLATION
+
+Translation is considered a kind of modification, so you may
+distribute translations of the Document under the terms of section 4.
+Replacing Invariant Sections with translations requires special
+permission from their copyright holders, but you may include
+translations of some or all Invariant Sections in addition to the
+original versions of these Invariant Sections.  You may include a
+translation of this License, and all the license notices in the
+Document, and any Warranty Disclaimers, provided that you also include
+the original English version of this License and the original versions
+of those notices and disclaimers.  In case of a disagreement between
+the translation and the original version of this License or a notice
+or disclaimer, the original version will prevail.
+
+If a section in the Document is Entitled "Acknowledgements",
+"Dedications", or "History", the requirement (section 4) to Preserve
+its Title (section 1) will typically require changing the actual
+title.
+
+
+9. TERMINATION
+
+You may not copy, modify, sublicense, or distribute the Document
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense, or distribute it is void, and
+will automatically terminate your rights under this License.
+
+However, if you cease all violation of this License, then your license
+from a particular copyright holder is reinstated (a) provisionally,
+unless and until the copyright holder explicitly and finally
+terminates your license, and (b) permanently, if the copyright holder
+fails to notify you of the violation by some reasonable means prior to
+60 days after the cessation.
+
+Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License.  If your rights have been terminated and not permanently
+reinstated, receipt of a copy of some or all of the same material does
+not give you any rights to use it.
+
+
+10. FUTURE REVISIONS OF THIS LICENSE
+
+The Free Software Foundation may publish new, revised versions of the
+GNU Free Documentation License from time to time.  Such new versions
+will be similar in spirit to the present version, but may differ in
+detail to address new problems or concerns.  See
+https://www.gnu.org/licenses/.
+
+Each version of the License is given a distinguishing version number.
+If the Document specifies that a particular numbered version of this
+License "or any later version" applies to it, you have the option of
+following the terms and conditions either of that specified version or
+of any later version that has been published (not as a draft) by the
+Free Software Foundation.  If the Document does not specify a version
+number of this License, you may choose any version ever published (not
+as a draft) by the Free Software Foundation.  If the Document
+specifies that a proxy can decide which future versions of this
+License can be used, that proxy's public statement of acceptance of a
+version permanently authorizes you to choose that version for the
+Document.
+
+11. RELICENSING
+
+"Massive Multiauthor Collaboration Site" (or "MMC Site") means any
+World Wide Web server that publishes copyrightable works and also
+provides prominent facilities for anybody to edit those works.  A
+public wiki that anybody can edit is an example of such a server.  A
+"Massive Multiauthor Collaboration" (or "MMC") contained in the site
+means any set of copyrightable works thus published on the MMC site.
+
+"CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0 
+license published by Creative Commons Corporation, a not-for-profit 
+corporation with a principal place of business in San Francisco, 
+California, as well as future copyleft versions of that license 
+published by that same organization.
+
+"Incorporate" means to publish or republish a Document, in whole or in 
+part, as part of another Document.
+
+An MMC is "eligible for relicensing" if it is licensed under this 
+License, and if all works that were first published under this License 
+somewhere other than this MMC, and subsequently incorporated in whole or 
+in part into the MMC, (1) had no cover texts or invariant sections, and 
+(2) were thus incorporated prior to November 1, 2008.
+
+The operator of an MMC Site may republish an MMC contained in the site
+under CC-BY-SA on the same site at any time before August 1, 2009,
+provided the MMC is eligible for relicensing.
diff --git a/docs/Makefile b/docs/Makefile
new file mode 100644 (file)
index 0000000..05b9067
--- /dev/null
@@ -0,0 +1,94 @@
+include ../defines.mk
+
+GENERATED_SYNOPSIS :=                                          \
+       proxmox-offline-mirror/synopsis.rst                     \
+       proxmox-apt-repo/synopsis.rst                   \
+       config/mirror/config.rst
+
+MAN1_PAGES :=                          \
+       proxmox-offline-mirror.1        \
+       proxmox-apt-repo.1
+
+MAN5_PAGES :=                          \
+       mirror.cfg.5
+
+# Sphinx documentation setup
+SPHINXOPTS    =
+SPHINXBUILD   = sphinx-build
+BUILDDIR      = output
+
+ifeq ($(BUILD_MODE), release)
+COMPILEDIR := ../target/release
+SPHINXOPTS    += -t release
+else ifeq ($(BUILD_MODE), release-deb)
+COMPILEDIR := ../target/$(DEB_TARGET_GNU_CPU)-unknown-$(DEB_TARGET_GNU_SYSTEM)/release
+SPHINXOPTS    += -t release
+else
+COMPILEDIR := ../target/debug
+SPHINXOPTS    += -t devbuild
+endif
+
+# Sphinx internal variables.
+ALLSPHINXOPTS   = -d $(BUILDDIR)/doctrees $(SPHINXOPTS) .
+
+all: ${MAN1_PAGES} ${MAN5_PAGES}
+
+config/%/config.rst: ${COMPILEDIR}/docgen
+       ${COMPILEDIR}/docgen $*.cfg >$@
+
+%/synopsis.rst: ${COMPILEDIR}/%
+       $< printdoc > $@
+
+${MAN1_PAGES} ${MAN5_PAGES}: man-pages
+
+.PHONY: man-pages
+man-pages: ${GENERATED_SYNOPSIS}
+       ${SPHINXBUILD} ${SPHINXOPTS} -b man ./ ${BUILDDIR}/man
+
+.PHONY: html
+html: ${GENERATED_SYNOPSIS} images/proxmox-logo.svg custom.css conf.py ${PRUNE_SIMULATOR_FILES} ${LTO_BARCODE_FILES} ${API_VIEWER_SOURCES}
+       $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
+       install -m 0644 custom.js custom.css images/proxmox-logo.svg $(BUILDDIR)/html/_static/
+       @echo
+       @echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
+
+.PHONY: latexpdf
+latexpdf: ${GENERATED_SYNOPSIS}
+       @echo "Requires python3-sphinx, texlive-xetex, xindy and texlive-fonts-extra"
+       $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+       @echo "Running LaTeX files through xelatex..."
+       $(MAKE) -C $(BUILDDIR)/latex all-pdf
+       @echo "xelatex finished; the PDF files are in $(BUILDDIR)/latex."
+
+.PHONY: epub3
+epub3: ${GENERATED_SYNOPSIS}
+       $(SPHINXBUILD) -b epub3 $(ALLSPHINXOPTS) $(BUILDDIR)/epub3
+       @echo
+       @echo "Build finished. The epub3 file is in $(BUILDDIR)/epub3."
+
+clean:
+       rm -r -f *~ *.1 ${BUILDDIR} ${GENERATED_SYNOPSIS}
+
+install_manual_pages: man-pages
+       install -dm755 $(DESTDIR)$(MAN1DIR)
+       for i in ${MAN1_PAGES}; do install -m755 ${BUILDDIR}/man/$$i $(DESTDIR)$(MAN1DIR)/ ; done
+       install -dm755 $(DESTDIR)$(MAN5DIR)
+       for i in ${MAN5_PAGES}; do install -m755 ${BUILDDIR}/man/$$i $(DESTDIR)$(MAN5DIR)/ ; done
+
+install_html: html
+       install -dm755 $(DESTDIR)$(DOCDIR)
+       rsync -a ${BUILDDIR}/html $(DESTDIR)$(DOCDIR)
+
+install_pdf: latexpdf
+       install -dm755 $(DESTDIR)$(DOCDIR)
+       install -m 0644 output/latex/ProxmoxOfflineMirror.pdf $(DESTDIR)$(DOCDIR)/proxmox-offline-mirror.pdf
+
+ifneq ($(filter nodoc,$(DEB_BUILD_PROFILES)),)
+
+install: install_manual_pages
+
+else
+
+install: install_manual_pages install_html install_pdf
+
+endif
\ No newline at end of file
diff --git a/docs/_ext/__pycache__/proxmox-scanrefs.cpython-39.pyc b/docs/_ext/__pycache__/proxmox-scanrefs.cpython-39.pyc
new file mode 100644 (file)
index 0000000..d6ccc52
Binary files /dev/null and b/docs/_ext/__pycache__/proxmox-scanrefs.cpython-39.pyc differ
diff --git a/docs/_ext/proxmox-scanrefs.py b/docs/_ext/proxmox-scanrefs.py
new file mode 100644 (file)
index 0000000..0d62656
--- /dev/null
@@ -0,0 +1,153 @@
+#!/usr/bin/env python3
+
+# debugging stuff
+from pprint import pprint
+
+from typing import cast
+
+import json
+import re
+
+import os
+import io
+from docutils import nodes
+
+from sphinx.builders import Builder
+from sphinx.util import logging
+
+logger = logging.getLogger(__name__)
+
+# refs are added in the following manner before the title of a section (note underscore and newline before title):
+# .. _my-label:
+#
+# Section to ref
+# --------------
+#
+#
+# then referred to like (note missing underscore):
+# "see :ref:`my-label`"
+#
+# the benefit of using this is if a label is explicitly set for a section,
+# we can refer to it with this anchor #my-label in the html,
+# even if the section name changes.
+#
+# see https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html#role-ref
+
+def scan_extjs_files(wwwdir="../www"): # a bit rough i know, but we can optimize later
+    js_files = []
+    used_anchors = []
+    logger.info("scanning extjs files for onlineHelp definitions")
+    for root, dirs, files in os.walk("{}".format(wwwdir)):
+        #print(root, dirs, files)
+        for filename in files:
+            if filename.endswith('.js'):
+                js_files.append(os.path.join(root, filename))
+    for js_file in js_files:
+        fd = open(js_file).read()
+        allmatch = re.findall("(?:onlineHelp:|get_help_tool\s*\()\s*[\'\"](.*?)[\'\"]", fd, re.M)
+        for match in allmatch:
+            anchor = match
+            anchor = re.sub('_', '-', anchor) # normalize labels
+            logger.info("found onlineHelp: {} in {}".format(anchor, js_file))
+            used_anchors.append(anchor)
+
+    return used_anchors
+
+
+def setup(app):
+    logger.info('Mapping reference labels...')
+    app.add_builder(ReflabelMapper)
+    return {
+        'version': '0.1',
+        'parallel_read_safe': True,
+        'parallel_write_safe': True,
+    }
+
+class ReflabelMapper(Builder):
+    name = 'proxmox-scanrefs'
+
+    def init(self):
+        self.docnames = []
+        self.env.online_help = {}
+        self.env.online_help['pbs_documentation_index'] = {
+            'link': '/docs/index.html',
+            'title': 'Proxmox Backup Server Documentation Index',
+        }
+        # Disabled until we find a sensible way to scan proxmox-widget-toolkit
+        # as well
+        #self.env.used_anchors = scan_extjs_files()
+
+        if not os.path.isdir(self.outdir):
+            os.mkdir(self.outdir)
+
+        self.output_filename = os.path.join(self.outdir, 'OnlineHelpInfo.js')
+        self.output = io.open(self.output_filename, 'w', encoding='UTF-8')
+
+    def write_doc(self, docname, doctree):
+            for node in doctree.traverse(nodes.section):
+                #pprint(vars(node))
+
+                if hasattr(node, 'expect_referenced_by_id') and len(node['ids']) > 1: # explicit labels
+                    filename = self.env.doc2path(docname)
+                    filename_html = re.sub('.rst', '.html', filename)
+
+                    # node['ids'][0] contains a normalized version of the
+                    # headline.  If the ref and headline are the same
+                    # (normalized) sphinx will set the node['ids'][1] to a
+                    # generic id in the format `idX` where X is numeric. If the
+                    # ref and headline are not the same, the ref name will be
+                    # stored in node['ids'][1]
+                    if re.match('^id[0-9]*$', node['ids'][1]):
+                        labelid = node['ids'][0]
+                    else:
+                        labelid = node['ids'][1]
+
+                    title = cast(nodes.title, node[0])
+                    logger.info('traversing section {}'.format(title.astext()))
+                    ref_name = getattr(title, 'rawsource', title.astext())
+
+                    if (ref_name[:7] == ':term:`'):
+                        ref_name = ref_name[7:-1]
+
+                    self.env.online_help[labelid] = {'link': '', 'title': ''}
+                    self.env.online_help[labelid]['link'] = "/docs/" + os.path.basename(filename_html) + "#{}".format(labelid)
+                    self.env.online_help[labelid]['title'] = ref_name
+
+            return
+
+
+    def get_outdated_docs(self):
+        return 'all documents'
+
+    def prepare_writing(self, docnames):
+        return
+
+    def get_target_uri(self, docname, typ=None):
+        return ''
+
+    def validate_anchors(self):
+        #pprint(self.env.online_help)
+        to_remove = []
+
+        # Disabled until we find a sensible way to scan proxmox-widget-toolkit
+        # as well
+        #for anchor in self.env.used_anchors:
+        #    if anchor not in self.env.online_help:
+        #        logger.info("[-] anchor {} is missing from onlinehelp!".format(anchor))
+        #for anchor in self.env.online_help:
+        #    if anchor not in self.env.used_anchors and anchor != 'pbs_documentation_index':
+        #        logger.info("[*] anchor {} not used! deleting...".format(anchor))
+        #        to_remove.append(anchor)
+        #for anchor in to_remove:
+        #   self.env.online_help.pop(anchor, None)
+        return
+
+    def finish(self):
+        # generate OnlineHelpInfo.js output
+        self.validate_anchors()
+
+        self.output.write("const proxmoxOnlineHelpInfo = ")
+        self.output.write(json.dumps(self.env.online_help, indent=2))
+        self.output.write(";\n")
+        self.output.close()
+        return
diff --git a/docs/_templates/index-sidebar.html b/docs/_templates/index-sidebar.html
new file mode 100644 (file)
index 0000000..45e0635
--- /dev/null
@@ -0,0 +1,11 @@
+<h3>Navigation</h3>
+{{ toctree(includehidden=theme_sidebar_includehidden, collapse=True, titles_only=True) }}
+{% if theme_extra_nav_links %}
+<hr />
+<h3>Links</h3>
+<ul>
+    {% for text, uri in theme_extra_nav_links.items() %}
+    <li class="toctree-l1"><a href="{{ uri }}">{{ text }}</a></li>
+    {% endfor %}
+</ul>
+{% endif %}
diff --git a/docs/_templates/sidebar-header.html b/docs/_templates/sidebar-header.html
new file mode 100644 (file)
index 0000000..3e07913
--- /dev/null
@@ -0,0 +1,7 @@
+ <p class="logo">
+    <a href="index.html">
+        <img class="logo" src="_static/proxmox-logo.svg" alt="Logo">
+    </a>
+</p>
+<h1 class="logo logo-name"><a href="index.html">Proxmox Offline Mirror</a></h1>
+<hr style="width:100%;">
diff --git a/docs/command-syntax.rst b/docs/command-syntax.rst
new file mode 100644 (file)
index 0000000..7fefc0b
--- /dev/null
@@ -0,0 +1,13 @@
+Command Syntax
+==============
+
+``proxmox-offline-mirror``
+--------------------------
+
+.. include:: proxmox-offline-mirror/synopsis.rst
+
+
+``proxmox-apt-repo``
+--------------------
+
+.. include:: proxmox-apt-repo/synopsis.rst
diff --git a/docs/conf.py b/docs/conf.py
new file mode 100644 (file)
index 0000000..e1d9f3c
--- /dev/null
@@ -0,0 +1,475 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+#
+# Proxmox Backup documentation build configuration file, originally
+# created by sphinx-quickstart on Tue Feb 26 16:54:35 2019.
+#
+# This file is execfile()d with the current directory set to its
+# containing dir.
+#
+# Note that not all possible configuration values are present in this
+# autogenerated file.
+#
+# All configuration values have a default; values that are commented out
+# serve to show the default.
+
+# If extensions (or modules to document with autodoc) are in another directory,
+# add these directories to sys.path here. If the directory is relative to the
+# documentation root, use os.path.abspath to make it absolute, like shown here.
+#
+import os
+import sys
+# sys.path.insert(0, os.path.abspath('.'))
+
+# custom extensions
+sys.path.append(os.path.abspath("./_ext"))
+
+# -- Implement custom formatter for code-blocks ---------------------------
+#
+# * use smaller font
+# * avoid space between lines to nicely format utf8 tables
+
+from sphinx.highlighting import PygmentsBridge
+from pygments.formatters.latex import LatexFormatter
+
+class CustomLatexFormatter(LatexFormatter):
+    def __init__(self, **options):
+        super(CustomLatexFormatter, self).__init__(**options)
+        self.verboptions = r"formatcom=\footnotesize\relax\let\strut\empty"
+
+PygmentsBridge.latex_formatter = CustomLatexFormatter
+
+# -- General configuration ------------------------------------------------
+
+# If your documentation needs a minimal Sphinx version, state it here.
+#
+# needs_sphinx = '1.0'
+
+# Add any Sphinx extension module names here, as strings. They can be
+# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
+# ones.
+
+extensions = ["sphinx.ext.graphviz", 'sphinx.ext.mathjax', "sphinx.ext.todo", "proxmox-scanrefs"]
+
+todo_link_only = True
+
+# Add any paths that contain templates here, relative to this directory.
+templates_path = ['_templates']
+
+# The suffix(es) of source filenames.
+# You can specify multiple suffix as a list of string:
+#
+# source_suffix = ['.rst', '.md']
+source_suffix = '.rst'
+
+# The encoding of source files.
+#
+# source_encoding = 'utf-8-sig'
+
+# The master toctree document.
+master_doc = 'index'
+
+# General information about the project.
+project = 'Proxmox Offline Mirror'
+copyright = '2022, Proxmox Server Solutions GmbH'
+author = 'Proxmox Support Team'
+
+# The version info for the project you're documenting, acts as a replacement for
+# |version| and |release|, also used in various other places throughout the
+# built documents.
+#
+# The short X.Y version.
+vstr = lambda s: '<devbuild>' if s is None else str(s)
+
+version = vstr(os.getenv('DEB_VERSION_UPSTREAM'))
+# The full version, including alpha/beta/rc tags.
+release = vstr(os.getenv('DEB_VERSION'))
+
+epilog_file = open('epilog.rst', 'r')
+rst_epilog = epilog_file.read()
+rst_epilog += f"\n..  |VERSION| replace:: {version}"
+rst_epilog += f"\n..  |pom-copyright| replace:: Copyright (C) {copyright}"
+
+man_pages = [
+    # CLI
+    ('proxmox-offline-mirror/man1', 'proxmox-offline-mirror', 'Command line tool for Backup and Restore', [author], 1),
+    ('proxmox-apt-repo/man1', 'proxmox-apt-repo', 'Command line tool to manage and configure the backup server.', [author], 1),
+    # configs
+    ('config/mirror/man5', 'mirror.cfg', 'Mirror Configuration', [author], 5),
+]
+
+
+# The language for content autogenerated by Sphinx. Refer to documentation
+# for a list of supported languages.
+#
+# This is also used if you do content translation via gettext catalogs.
+# Usually you set "language" from the command line for these cases.
+language = None
+
+# There are two options for replacing |today|: either, you set today to some
+# non-false value, then it is used:
+# today = ''
+#
+# Else, today_fmt is used as the format for a strftime call.
+today_fmt = '%A, %d %B %Y'
+
+suppress_warnings = [ 'toc.excluded' ]
+
+# List of patterns, relative to source directory, that match files and
+# directories to ignore when looking for source files.
+# This patterns also effect to html_static_path and html_extra_path
+exclude_patterns = [
+    '_build', 'Thumbs.db', '.DS_Store',
+    'epilog.rst',
+    'pbs-copyright.rst',
+]
+
+# The reST default role (used for this markup: `text`) to use for all
+# documents.
+#
+# default_role = None
+
+# If true, '()' will be appended to :func: etc. cross-reference text.
+#
+# add_function_parentheses = True
+
+# If true, the current module name will be prepended to all description
+# unit titles (such as .. function::).
+#
+# add_module_names = True
+
+# If true, sectionauthor and moduleauthor directives will be shown in the
+# output. They are ignored by default.
+#
+# show_authors = False
+
+# The name of the Pygments (syntax highlighting) style to use.
+pygments_style = 'sphinx'
+
+# A list of ignored prefixes for module index sorting.
+# modindex_common_prefix = []
+
+# If true, keep warnings as "system message" paragraphs in the built documents.
+# keep_warnings = False
+
+# If true, `todo` and `todoList` produce output, else they produce nothing.
+todo_include_todos = not tags.has('release')
+
+
+# -- Options for HTML output ----------------------------------------------
+
+# The theme to use for HTML and HTML Help pages.  See the documentation for
+# a list of builtin themes.
+#
+html_theme = 'alabaster'
+
+# Theme options are theme-specific and customize the look and feel of a theme
+# further.  For a list of options available for each theme, see the
+# documentation.
+#
+html_theme_options = {
+    'fixed_sidebar': True,
+    'sidebar_includehidden': False,
+    'sidebar_collapse': False,
+    'globaltoc_collapse': False,
+    'show_relbar_bottom': True,
+    'show_powered_by': False,
+
+    'extra_nav_links': {
+        'Proxmox Homepage': 'https://proxmox.com',
+        'PDF': 'proxmox-offline-mirror.pdf',
+    },
+
+    'sidebar_width': '320px',
+    'page_width': '1320px',
+    # font styles
+    'head_font_family': 'Lato, sans-serif',
+    'caption_font_family': 'Lato, sans-serif',
+    'caption_font_size': '20px',
+    'font_family': 'Open Sans, sans-serif',
+}
+
+# Alabaster theme recommends setting this fixed.
+# If you switch theme this needs to removed, probably.
+html_sidebars = {
+    '**': [
+        'sidebar-header.html',
+        'searchbox.html',
+        'navigation.html',
+        'relations.html',
+    ],
+
+    'index': [
+        'sidebar-header.html',
+        'searchbox.html',
+        'index-sidebar.html',
+    ]
+}
+
+
+# Add any paths that contain custom themes here, relative to this directory.
+# html_theme_path = []
+
+# The name for this set of Sphinx documents.
+# "<project> v<release> documentation" by default.
+#
+# html_title = 'Proxmox Backup v1.0-1'
+
+# A shorter title for the navigation bar.  Default is the same as html_title.
+#
+# html_short_title = None
+
+# The name of an image file (relative to this directory) to place at the top
+# of the sidebar.
+#
+#html_logo = 'images/proxmox-logo.svg' # replaced by html_theme_options.logo
+
+# The name of an image file (relative to this directory) to use as a favicon of
+# the docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
+# pixels large.
+#
+html_favicon = 'images/favicon.ico'
+
+# Add any paths that contain custom static files (such as style sheets) here,
+# relative to this directory. They are copied after the builtin static files,
+# so a file named "default.css" will overwrite the builtin "default.css".
+html_static_path = ['_static']
+
+html_js_files = [
+    'custom.js',
+]
+
+# Add any extra paths that contain custom files (such as robots.txt or
+# .htaccess) here, relative to this directory. These files are copied
+# directly to the root of the documentation.
+#
+# html_extra_path = []
+
+# If not None, a 'Last updated on:' timestamp is inserted at every page
+# bottom, using the given strftime format.
+# The empty string is equivalent to '%b %d, %Y'.
+#
+# html_last_updated_fmt = None
+
+# We need to disable smatquotes, else Option Lists do not display long options
+smartquotes = False
+
+# Additional templates that should be rendered to pages, maps page names to
+# template names.
+#
+# html_additional_pages = {}
+
+# If false, no module index is generated.
+#
+# html_domain_indices = True
+
+# If false, no index is generated.
+#
+# html_use_index = True
+
+# If true, the index is split into individual pages for each letter.
+#
+# html_split_index = False
+
+# If true, links to the reST sources are added to the pages.
+#
+html_show_sourcelink = False
+
+# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
+#
+# html_show_sphinx = True
+
+# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
+#
+# html_show_copyright = True
+
+# If true, an OpenSearch description file will be output, and all pages will
+# contain a <link> tag referring to it.  The value of this option must be the
+# base URL from which the finished HTML is served.
+#
+# html_use_opensearch = ''
+
+# This is the file name suffix for HTML files (e.g. ".xhtml").
+# html_file_suffix = None
+
+# Language to be used for generating the HTML full-text search index.
+# Sphinx supports the following languages:
+#   'da', 'de', 'en', 'es', 'fi', 'fr', 'h', 'it', 'ja'
+#   'nl', 'no', 'pt', 'ro', 'r', 'sv', 'tr', 'zh'
+#
+# html_search_language = 'en'
+
+# A dictionary with options for the search language support, empty by default.
+# 'ja' uses this config value.
+# 'zh' user can custom change `jieba` dictionary path.
+#
+# html_search_options = {'type': 'default'}
+
+# The name of a javascript file (relative to the configuration directory) that
+# implements a search results scorer. If empty, the default will be used.
+#
+# html_search_scorer = 'scorer.js'
+
+# Output file base name for HTML help builder.
+htmlhelp_basename = 'ProxmoxOfflineMirrordoc'
+
+# use local mathjax package, symlink comes from debian/proxmox-backup-docs.links
+mathjax_path = "mathjax/MathJax.js?config=TeX-AMS-MML_HTMLorMML"
+
+# -- Options for LaTeX output ---------------------------------------------
+
+latex_engine = 'xelatex'
+
+latex_elements = {
+    'fontenc': '\\usepackage{fontspec}',
+
+     # The paper size ('letterpaper' or 'a4paper').
+     #
+     'papersize': 'a4paper',
+
+     # The font size ('10pt', '11pt' or '12pt').
+     #
+     'pointsize': '10pt',
+
+    'fontpkg': r'''
+\setmainfont{Open Sans}
+\setsansfont{Lato}
+\setmonofont{DejaVu Sans Mono}
+''',
+
+     # Additional stuff for the LaTeX preamble.
+     #
+     # 'preamble': '',
+
+     # Latex figure (float) alignment
+     #
+     # 'figure_align': 'htbp',
+}
+
+# Grouping the document tree into LaTeX files. List of tuples
+# (source start file, target name, title,
+#  author, documentclass [howto, manual, or own class]).
+latex_documents = [
+    (master_doc, 'ProxmoxOfflineMirror.tex', 'Proxmox Offline Mirror Documentation',
+     'Proxmox Support Team', 'manual'),
+]
+
+# The name of an image file (relative to this directory) to place at the top of
+# the title page.
+#
+#
+# Note: newer sphinx 1.6 should be able to convert .svg to .png
+# automatically using sphinx.ext.imgconverter
+latex_logo = "images/proxmox-logo.png"
+
+# For "manual" documents, if this is true, then toplevel headings are parts,
+# not chapters.
+#
+# latex_use_parts = False
+
+# If true, show page references after internal links.
+#
+# latex_show_pagerefs = False
+
+# If true, show URL addresses after external links.
+#
+# latex_show_urls = False
+
+# Documents to append as an appendix to all manuals.
+#
+# latex_appendices = []
+
+# It false, will not define \strong, \code,    itleref, \crossref ... but only
+# \sphinxstrong, ..., \sphinxtitleref, ... To help avoid clash with user added
+# packages.
+#
+# latex_keep_old_macro_names = True
+
+# If false, no module index is generated.
+#
+# latex_domain_indices = True
+
+
+# -- Options for Epub output ----------------------------------------------
+
+# Bibliographic Dublin Core info.
+epub_title = project
+epub_author = author
+epub_publisher = author
+epub_copyright = copyright
+
+# The basename for the epub file. It defaults to the project name.
+# epub_basename = project
+
+# The HTML theme for the epub output. Since the default themes are not
+# optimized for small screen space, using the same theme for HTML and epub
+# output is usually not wise. This defaults to 'epub', a theme designed to save
+# visual space.
+#
+# epub_theme = 'epub'
+
+# The language of the text. It defaults to the language option
+# or 'en' if the language is not set.
+#
+# epub_language = ''
+
+# The scheme of the identifier. Typical schemes are ISBN or URL.
+# epub_scheme = ''
+
+# The unique identifier of the text. This can be a ISBN number
+# or the project homepage.
+#
+# epub_identifier = ''
+
+# A unique identification for the text.
+#
+# epub_uid = ''
+
+# A tuple containing the cover image and cover page html template filenames.
+#
+# epub_cover = ()
+
+# A sequence of (type, uri, title) tuples for the guide element of content.opf.
+#
+# epub_guide = ()
+
+# HTML files that should be inserted before the pages created by sphinx.
+# The format is a list of tuples containing the path and title.
+#
+# epub_pre_files = []
+
+# HTML files that should be inserted after the pages created by sphinx.
+# The format is a list of tuples containing the path and title.
+#
+# epub_post_files = []
+
+# A list of files that should not be packed into the epub file.
+epub_exclude_files = ['search.html']
+
+# The depth of the table of contents in toc.ncx.
+#
+# epub_tocdepth = 3
+
+# Allow duplicate toc entries.
+#
+# epub_tocdup = True
+
+# Choose between 'default' and 'includehidden'.
+#
+# epub_tocscope = 'default'
+
+# Fix unsupported image types using the Pillow.
+#
+# epub_fix_images = False
+
+# Scale large images.
+#
+# epub_max_image_width = 0
+
+# How to display URL addresses: 'footnote', 'no', or 'inline'.
+#
+# epub_show_urls = 'inline'
+
+# If false, no index is generated.
+#
+# epub_use_index = True
diff --git a/docs/config/mirror/man5.rst b/docs/config/mirror/man5.rst
new file mode 100644 (file)
index 0000000..913b40c
--- /dev/null
@@ -0,0 +1,16 @@
+==========
+mirror.cfg
+==========
+
+Description
+===========
+
+The file /etc/proxmox-offline-mirror.cfg is a configuration file for Proxmox
+Offline Mirror. It contains definitions for mirrors, media and subscription keys.
+
+Options
+=======
+
+.. include:: config.rst
+
+.. include:: ../../pom-copyright.rst
diff --git a/docs/configuration-files.rst b/docs/configuration-files.rst
new file mode 100644 (file)
index 0000000..fe8cfb4
--- /dev/null
@@ -0,0 +1,14 @@
+Configuration Files
+===================
+
+The Proxmox Offline Mirror configuration file is stored at ``/etc/proxmox-offline-mirror.cfg`` by default. Its location can be overriden for any given command using the `--config` parameter.
+
+
+``mirror.cfg``
+~~~~~~~~~~~~~~
+
+
+Options
+^^^^^^^
+
+.. include:: config/mirror/config.rst
diff --git a/docs/custom.css b/docs/custom.css
new file mode 100644 (file)
index 0000000..fe8b795
--- /dev/null
@@ -0,0 +1,88 @@
+div.sphinxsidebar {
+    height: calc(100% - 20px);
+    overflow: auto;
+}
+
+h1.logo-name {
+    font-size: 24px;
+}
+
+div.body img {
+    width: 250px;
+}
+pre {
+    padding: 5px 10px;
+}
+
+div.topic {
+    background-color: #FAFAFA;
+}
+
+li a.current {
+    font-weight: bold;
+    border-bottom: 1px solid #000;
+}
+ul li.toctree-l1 {
+    margin-top: 0.5em;
+}
+ul li.toctree-l1 > a {
+    color: #000;
+}
+
+div.sphinxsidebar ul {
+    color: #444;
+}
+div.sphinxsidebar ul ul {
+    list-style: circle;
+}
+div.sphinxsidebar ul ul ul {
+    list-style: square;
+}
+
+div.sphinxsidebar ul a code {
+    font-weight: normal;
+}
+div.sphinxsidebar ul ul a {
+    border-bottom: 1px dotted #CCC;
+}
+
+div.sphinxsidebar form.search {
+    margin-bottom: 5px;
+}
+
+div.sphinxsidebar h3 {
+    width: 100%;
+}
+
+div.sphinxsidebar h1.logo-name {
+    display: none;
+}
+
+div.document, div.footer {
+    width: min(100%, 1320px);
+}
+
+@media screen and (max-width: 875px) {
+    div.sphinxsidebar p.logo {
+        display: initial;
+    }
+    div.sphinxsidebar h1.logo-name {
+        display: block;
+    }
+    div.sphinxsidebar span {
+        color: #EEE;
+    }
+    .sphinxsidebar ul li.toctree-l1 > a, div.sphinxsidebar a {
+        color: #FFF;
+    }
+    div.sphinxsidebar {
+        background-color: #555;
+    }
+    div.body {
+        min-width: 300px;
+    }
+    div.footer {
+        display: block;
+        margin: 15px auto 0px auto;
+    }
+}
diff --git a/docs/custom.js b/docs/custom.js
new file mode 100644 (file)
index 0000000..7964b2c
--- /dev/null
@@ -0,0 +1,7 @@
+window.addEventListener('DOMContentLoaded', (event) => {
+    let activeSection = document.querySelector("a.current");
+    if (activeSection) {
+        // https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView
+        activeSection.scrollIntoView({ block: 'center' });
+    }
+});
diff --git a/docs/epilog.rst b/docs/epilog.rst
new file mode 100644 (file)
index 0000000..b5da481
--- /dev/null
@@ -0,0 +1,19 @@
+.. Epilog (included at top of each file)
+
+   We use this file to define external links and common replacement
+   patterns.
+
+.. |WEBSITE| replace:: https://www.proxmox.com
+.. |DOWNLOADS| replace:: https://www.proxmox.com/downloads
+
+.. _Proxmox: https://www.proxmox.com
+.. _Proxmox Community Forum: https://forum.proxmox.com
+.. _Proxmox Virtual Environment: https://www.proxmox.com/proxmox-ve
+.. _Proxmox Backup: https://pbs.proxmox.com/wiki/index.php/Main_Page
+.. _PVE Development List: https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
+.. _reStructuredText: https://www.sphinx-doc.org/en/master/usage/restructuredtext/index.html
+.. _Rust: https://www.rust-lang.org/
+.. _SHA-256: https://en.wikipedia.org/wiki/SHA-2
+
+.. _AGPL3: https://www.gnu.org/licenses/agpl-3.0.en.html
+.. _Debian: https://www.debian.org
diff --git a/docs/images/favicon.ico b/docs/images/favicon.ico
new file mode 100755 (executable)
index 0000000..ba0c9af
Binary files /dev/null and b/docs/images/favicon.ico differ
diff --git a/docs/images/proxmox-logo.png b/docs/images/proxmox-logo.png
new file mode 100644 (file)
index 0000000..659793a
Binary files /dev/null and b/docs/images/proxmox-logo.png differ
diff --git a/docs/images/proxmox-logo.svg b/docs/images/proxmox-logo.svg
new file mode 100644 (file)
index 0000000..bc5d22a
--- /dev/null
@@ -0,0 +1,243 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="800"
+   height="129.03929"
+   id="svg3018"
+   version="1.1"
+   inkscape:version="0.48.3.1 r9886"
+   sodipodi:docname="Proxmox_logo_standard_hex.svg"
+   inkscape:export-filename="S:\Proxmox-Logo-NEW\Standard-Logo\PNG\Proxmox_logo_standard_hex_800px.png"
+   inkscape:export-xdpi="90"
+   inkscape:export-ydpi="90">
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="2.8"
+     inkscape:cx="349.01602"
+     inkscape:cy="64.505265"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     showgrid="false"
+     inkscape:window-width="2560"
+     inkscape:window-height="1377"
+     inkscape:window-x="-8"
+     inkscape:window-y="-8"
+     inkscape:window-maximized="1"
+     showguides="true"
+     inkscape:guide-bbox="true"
+     objecttolerance="4"
+     gridtolerance="2"
+     guidetolerance="1"
+     fit-margin-top="5"
+     fit-margin-left="5"
+     fit-margin-right="5"
+     fit-margin-bottom="5"
+     inkscape:showpageshadow="false" />
+  <defs
+     id="defs3020">
+    <clipPath
+       clipPathUnits="userSpaceOnUse"
+       id="clipPath3102-1">
+      <rect
+         style="fill:#e57000;fill-opacity:1;fill-rule:evenodd;stroke:none"
+         id="rect3104-7"
+         width="436.40189"
+         height="326.40991"
+         x="-82.999916"
+         y="-347.71387"
+         transform="matrix(0.73449161,0.67861776,-0.78497193,0.61953133,0,0)" />
+    </clipPath>
+    <clipPath
+       clipPathUnits="userSpaceOnUse"
+       id="clipPath4746">
+      <rect
+         style="fill:#e57000;fill-opacity:1;fill-rule:evenodd;stroke:none"
+         id="rect4748"
+         width="436.40189"
+         height="326.40991"
+         x="-82.999916"
+         y="-347.71387"
+         transform="matrix(0.73449161,0.67861776,-0.78497193,0.61953133,0,0)" />
+    </clipPath>
+    <clipPath
+       id="clipPath2999-2-3-4-1"
+       clipPathUnits="userSpaceOnUse">
+      <path
+         inkscape:connector-curvature="0"
+         id="path3001-8-8-6-0"
+         d="m 0,14400 14400,0 L 14400,0 0,0 0,14400 z" />
+    </clipPath>
+    <clipPath
+       clipPathUnits="userSpaceOnUse"
+       id="clipPath3102-4">
+      <rect
+         style="fill:#e57000;fill-opacity:1;fill-rule:evenodd;stroke:none"
+         id="rect3104-1"
+         width="436.40189"
+         height="326.40991"
+         x="-82.999916"
+         y="-347.71387"
+         transform="matrix(0.73449161,0.67861776,-0.78497193,0.61953133,0,0)" />
+    </clipPath>
+    <clipPath
+       clipPathUnits="userSpaceOnUse"
+       id="clipPath3008">
+      <rect
+         style="fill:#e57000;fill-opacity:1;fill-rule:evenodd;stroke:none"
+         id="rect3010"
+         width="436.40189"
+         height="326.40991"
+         x="-82.999916"
+         y="-347.71387"
+         transform="matrix(0.73449161,0.67861776,-0.78497193,0.61953133,0,0)" />
+    </clipPath>
+    <clipPath
+       clipPathUnits="userSpaceOnUse"
+       id="clipPath3102">
+      <rect
+         style="fill:#e57000;fill-opacity:1;fill-rule:evenodd;stroke:none"
+         id="rect3104"
+         width="436.40189"
+         height="326.40991"
+         x="-82.999916"
+         y="-347.71387"
+         transform="matrix(0.73449161,0.67861776,-0.78497193,0.61953133,0,0)" />
+    </clipPath>
+    <clipPath
+       clipPathUnits="userSpaceOnUse"
+       id="clipPath4814">
+      <rect
+         style="fill:#e57000;fill-opacity:1;fill-rule:evenodd;stroke:none"
+         id="rect4816"
+         width="436.40189"
+         height="326.40991"
+         x="-82.999916"
+         y="-347.71387"
+         transform="matrix(0.73449161,0.67861776,-0.78497193,0.61953133,0,0)" />
+    </clipPath>
+    <clipPath
+       id="clipPath2999-2-3-4"
+       clipPathUnits="userSpaceOnUse">
+      <path
+         inkscape:connector-curvature="0"
+         id="path3001-8-8-6"
+         d="m 0,14400 14400,0 L 14400,0 0,0 0,14400 z" />
+    </clipPath>
+  </defs>
+  <metadata
+     id="metadata3023">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title></dc:title>
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     transform="translate(1451.1374,38.932293)"
+     id="layer1"
+     inkscape:groupmode="layer"
+     inkscape:label="Layer 1">
+    <g
+       id="g3378"
+       transform="matrix(0.28026719,0,0,0.28026719,-1040.8325,61.254294)"
+       inkscape:export-filename="S:\lucia\New-Logo-Symbol\Standard-Logo\PNG\Proxmox_logo_standard_hex_300px.png"
+       inkscape:export-xdpi="90"
+       inkscape:export-ydpi="90">
+      <g
+         id="g3016-9"
+         style="fill:#000000"
+         transform="matrix(0.85286594,0,0,0.85286594,-2204.7964,-970.06495)">
+        <g
+           style="font-size:144px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Helion;-inkscape-font-specification:Helion"
+           id="text3093-5"
+           clip-path="url(#clipPath3102-4)"
+           transform="matrix(-0.99791979,0,0,0.99791979,1452.3586,746.04784)">
+          <path
+             d="M 276.30443,226.6231 466.89227,17.020605 C 459.49903,9.6280871 450.88762,3.8194321 441.05796,-0.40537695 431.22756,-4.6295171 420.6664,-6.7823721 409.37437,-6.8639479 397.38099,-6.7722031 386.39328,-4.3959326 376.41123,0.26487096 366.4286,4.9263417 357.75623,11.32398 350.39413,19.457805 L 276.30327,100.37282 202.69985,19.457805 C 195.07335,11.32397 186.19787,4.9263248 176.07344,0.2648493 165.94881,-4.395959 155.00175,-6.7722224 143.2322,-6.8639479 131.93978,-6.7823616 121.3786,-4.629505 111.5486,-0.40536951 101.71855,3.8194345 93.107122,9.6280871 85.714287,17.020605 L 276.30769,226.61752"
+             id="path3098-5"
+             inkscape:connector-curvature="0"
+             sodipodi:nodetypes="ccccccccccccc"
+             style="fill:#000000;fill-opacity:1" />
+        </g>
+        <g
+           transform="matrix(0.99791979,0,0,-0.99791979,900.89604,1230.3576)"
+           clip-path="url(#clipPath3102-4)"
+           id="g3196-9"
+           style="font-size:144px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Helion;-inkscape-font-specification:Helion">
+          <path
+             style="fill:#000000;fill-opacity:1"
+             sodipodi:nodetypes="ccccccccccccc"
+             inkscape:connector-curvature="0"
+             id="path3198-1"
+             d="M 276.30443,226.6231 466.89227,17.020605 C 459.49903,9.6280871 450.88762,3.8194321 441.05796,-0.40537695 431.22756,-4.6295171 420.6664,-6.7823721 409.37437,-6.8639479 397.38099,-6.7722031 386.39328,-4.3959326 376.41123,0.26487096 366.4286,4.9263417 357.75623,11.32398 350.39413,19.457805 L 276.30327,100.37282 202.69985,19.457805 C 195.07335,11.32397 186.19787,4.9263248 176.07344,0.2648493 165.94881,-4.395959 155.00175,-6.7722224 143.2322,-6.8639479 131.93978,-6.7823616 121.3786,-4.629505 111.5486,-0.40536951 101.71855,3.8194345 93.107122,9.6280871 85.714287,17.020605 L 276.30769,226.61752" />
+        </g>
+        <path
+           style="font-size:1059.61279297px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#e57000;fill-opacity:1;stroke:none;font-family:Helion;-inkscape-font-specification:Helion"
+           d="m 1160.6292,988.20538 0,0 -143.2665,-157.11232 c -8.333,-8.88721 -18.03061,-15.87754 -29.09279,-20.97078 -11.06252,-5.09255 -23.02366,-7.68889 -35.88343,-7.78914 -12.33843,0.0892 -23.87792,2.44147 -34.61849,7.05685 -10.74062,4.61613 -20.14972,10.96284 -28.22736,19.04016 L 1034.9383,988.20777 889.54063,1147.9854 c 8.07762,8.3329 17.48674,14.8349 28.22736,19.5062 10.74057,4.6712 22.28006,7.0457 34.61849,7.1234 12.89308,-0.1 24.92073,-2.6962 36.08307,-7.7891 11.16223,-5.0929 20.79325,-12.0833 28.89315,-20.9708 l 143.2662,-157.64917"
+           id="path3278-4"
+           inkscape:connector-curvature="0"
+           sodipodi:nodetypes="cccccccccscscc" />
+        <path
+           sodipodi:nodetypes="cccccccccscscc"
+           inkscape:connector-curvature="0"
+           id="path3280-5"
+           d="m 1192.6208,988.20538 0,0 143.2665,-157.11232 c 8.333,-8.88721 18.0306,-15.87754 29.0928,-20.97078 11.0625,-5.09255 23.0237,-7.68889 35.8834,-7.78914 12.3385,0.0892 23.878,2.44147 34.6185,7.05685 10.7407,4.61613 20.1498,10.96284 28.2274,19.04016 l -145.3977,159.77762 145.3977,159.77763 c -8.0776,8.3329 -17.4867,14.8349 -28.2274,19.5062 -10.7405,4.6712 -22.28,7.0457 -34.6184,7.1234 -12.8931,-0.1 -24.9208,-2.6962 -36.0831,-7.7891 -11.1623,-5.0929 -20.7933,-12.0833 -28.8932,-20.9708 L 1192.6211,988.20593"
+           style="font-size:1059.61279297px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#e57000;fill-opacity:1;stroke:none;font-family:Helion;-inkscape-font-specification:Helion" />
+      </g>
+      <g
+         id="g3368">
+        <g
+           id="text3223"
+           style="font-size:387.52206421px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Helion;-inkscape-font-specification:Helion">
+          <path
+             inkscape:connector-curvature="0"
+             id="path3354"
+             d="m -686.1811,-262.38737 -177.87034,0 c -6.9834,0.19403 -12.87689,2.71288 -17.68048,7.55658 -4.8036,4.84422 -7.30631,10.85073 -7.50813,18.01955 l 0,245.6858223 c 19.0852,-0.4763289 34.97338,-7.080262 47.6646,-19.8118193 12.69112,-12.731517 19.2789,-28.732724 19.76337,-48.003669 l 135.63098,0 c 19.28682,-0.476261 35.35261,-7.080194 48.19742,-19.811819 12.84432,-12.73145 19.51284,-28.732655 20.00558,-48.003665 l 0,-67.42798 c -0.49274,-19.28682 -7.16125,-35.35262 -20.00557,-48.19744 -12.84482,-12.84432 -28.91061,-19.51283 -48.19743,-20.00556 z m -135.63098,144.15635 0,-75.95335 118.96774,0 c 0.69411,-0.34694 3.47131,0.34736 8.33161,2.08291 4.85991,1.73595 7.63712,6.59605 8.33163,14.58033 l 0,42.23936 c 0.34694,0.7106 -0.34736,3.55238 -2.08291,8.52538 -1.73595,4.97326 -6.59606,7.81505 -14.58033,8.52537 z" />
+          <path
+             inkscape:connector-curvature="0"
+             id="path3356"
+             d="m -308.04521,-143.41963 0,-50.76474 c -0.4766,-19.28682 -7.08053,-35.35262 -19.81182,-48.19744 -12.73179,-12.84432 -28.733,-19.51283 -48.00367,-20.00556 l -177.87034,0 c -7.15293,0.19403 -13.09485,2.71288 -17.82578,7.55658 -4.73095,4.84422 -7.18522,10.85073 -7.36283,18.01955 l 0,245.6858223 c 19.10135,-0.4763289 35.05412,-7.080262 47.85836,-19.8118193 12.80414,-12.731517 19.45651,-28.732724 19.95713,-48.003669 l 0,-17.050751 77.1159,0 39.13922,55.802459 c 6.28082,9.009794 14.16033,16.0819732 23.63854,21.2165595 9.47781,5.1346021 20.06993,7.7503397 31.77641,7.8472208 5.64296,-0.00808 11.11663,-0.6700872 16.42102,-1.9860337 5.30388,-1.3159425 10.29316,-3.2373765 14.96786,-5.7643078 l -54.63991,-77.8909318 c 15.83952,-3.431052 28.82133,-11.197535 38.94546,-23.299469 10.12362,-12.10172 15.3551,-26.55286 15.69445,-43.35347 z m -203.05895,8.13786 0,-58.9026 118.19271,0 c 0.71026,-0.34694 3.55205,0.34736 8.52537,2.08291 4.97294,1.73595 7.81473,6.59605 8.52538,14.58033 l 0,25.57613 c 0.35502,0.69445 -0.35543,3.47166 -2.13135,8.33161 -1.77632,4.86025 -6.74945,7.63746 -14.9194,8.33162 z" />
+          <path
+             inkscape:connector-curvature="0"
+             id="path3358"
+             d="m -66.297193,-262.38737 -135.243457,0 c -19.27095,0.49275 -35.27217,7.16126 -48.00368,20.00558 -12.73156,12.84481 -19.33549,28.91061 -19.81181,48.19742 l 0,135.243464 c 0.47632,19.270945 7.08025,35.272154 19.81181,48.003675 12.73152,12.731561 28.73273,19.3354921 48.00368,19.8118133 l 135.243457,0 C -47.026519,8.3982534 -31.02531,1.7943203 -18.293518,-10.937237 -5.5622279,-23.668754 1.0417033,-39.669961 1.5182953,-58.940906 l 0,-135.243464 c -0.4765997,-19.28682 -7.0805328,-35.35262 -19.8118193,-48.19744 -12.731788,-12.84432 -28.732995,-19.51283 -48.003669,-20.00556 z m 0,186.395713 c 0.355023,0.710536 -0.355427,3.552325 -2.13135,8.525376 -1.776324,4.973203 -6.749453,7.814992 -14.919401,8.525375 l -101.141956,0 c -0.71053,0.355294 -3.55232,-0.355156 -8.52538,-2.13135 -4.97321,-1.776054 -7.815,-6.749182 -8.52537,-14.919401 l 0,-101.529473 c -0.3553,-0.69411 0.35515,-3.47132 2.13134,-8.33162 1.77604,-4.85992 6.74918,-7.63712 14.91941,-8.33162 l 101.141956,0 c 0.710265,-0.34694 3.552054,0.34736 8.525376,2.08291 4.972932,1.73595 7.814721,6.59605 8.525375,14.58033 z" />
+          <path
+             inkscape:connector-curvature="0"
+             id="path3360"
+             style="fill:#e57000;fill-opacity:1"
+             d="m 343.24581,-243.01152 c -5.87764,-5.87708 -12.72377,-10.49499 -20.5384,-13.85374 -7.8152,-3.35821 -16.2114,-5.06974 -25.18861,-5.13459 -9.55093,0.0729 -18.35079,1.96208 -26.3996,5.66744 -8.04928,3.70589 -15.00843,8.79205 -20.87749,15.25848 l -58.51508,64.32783 -58.90259,-64.32783 c -6.02275,-6.63598 -12.96576,-11.77058 -20.82905,-15.40381 -7.86343,-3.6327 -16.550262,-5.47341 -26.060517,-5.52211 -8.977519,0.0649 -17.373714,1.77639 -25.18861,5.1346 -7.814936,3.35874 -14.661064,7.97665 -20.538405,13.85373 L 145.99962,-126.75639 40.207458,-10.501271 c 5.877333,6.0630371 12.723461,10.79396706 20.538405,14.1928038 7.814904,3.398847 16.211099,5.1265285 25.18861,5.1830495 9.381091,-0.072659 18.132507,-1.9618037 26.254287,-5.6674401 8.12163,-3.70562508 15.12923,-8.7917806 21.0228,-15.2584822 l 58.51507,-64.327834 58.51508,64.327834 c 5.86906,6.4667016 12.82821,11.55285519 20.87749,15.2584764 8.04881,3.7056326 16.84867,5.5947793 26.3996,5.6674459 8.97721,-0.056513 17.3734,-1.7841929 25.18861,-5.1830438 7.81464,-3.39884052 14.66077,-8.1297724 20.5384,-14.1928095 L 237.45365,-126.75639 z" />
+          <path
+             inkscape:connector-curvature="0"
+             id="path3362"
+             d="m 695.81803,-262.38737 -42.62688,0 c -13.94281,0.19403 -26.35949,3.97232 -37.25008,11.33487 -10.89107,7.36308 -19.14194,17.14787 -24.75266,29.35442 l 0.38752,-0.77503 -39.91426,87.57886 -39.52674,-87.57886 0,0.77503 c -5.44152,-12.20655 -13.64395,-21.99134 -24.60734,-29.35442 -10.96359,-7.36256 -23.42871,-11.14084 -37.39539,-11.33487 l -42.23936,0 c -7.33862,0.19403 -13.39357,2.71288 -18.16487,7.55658 -4.77131,4.84422 -7.24173,10.85073 -7.41126,18.01955 l 0,245.6858223 c 19.10135,-0.4763289 35.05411,-7.080262 47.85835,-19.8118193 12.80415,-12.731517 19.45652,-28.732724 19.95714,-48.003669 l 0,-129.818224 c 0.0241,-1.76784 0.55699,-3.17259 1.59851,-4.21425 1.04138,-1.04125 2.44613,-1.57408 4.21425,-1.5985 1.00908,0.0325 1.99402,0.35542 2.95482,0.96878 0.96064,0.61377 1.65494,1.32422 2.0829,2.13135 l 75.17831,165.857313 c 1.42074,2.962919 3.51979,5.368749 6.29715,7.217496 2.77705,1.848803 5.84489,2.801451 9.20353,2.857948 3.33409,-0.04034 6.35349,-0.928394 9.05821,-2.664177 2.70436,-1.73573 4.85185,-4.076977 6.44248,-7.02375 l 75.17831,-166.24483 c 0.58909,-0.80712 1.34797,-1.51757 2.27666,-2.13135 0.92817,-0.61337 1.97769,-0.9363 3.14858,-0.96878 1.5821,0.0244 2.87382,0.55726 3.87517,1.59851 1.00081,1.04165 1.5175,2.4464 1.55007,4.21424 l 0,129.818224 c 0.50027,19.270945 7.15264,35.272154 19.95712,48.003675 12.8039,12.731561 28.75667,19.3354921 47.85836,19.8118133 l 0,-245.6858223 c -0.17794,-7.16882 -2.63221,-13.17533 -7.36282,-18.01955 -4.73127,-4.8437 -10.67319,-7.36255 -17.82578,-7.55658 z" />
+          <path
+             inkscape:connector-curvature="0"
+             id="path3364"
+             d="m 963.0584,-262.38737 -135.24346,0 c -19.27095,0.49275 -35.27216,7.16126 -48.00368,20.00558 -12.73156,12.84481 -19.33549,28.91061 -19.81181,48.19742 l 0,135.243464 c 0.47632,19.270945 7.08025,35.272154 19.81181,48.003675 12.73153,12.731561 28.73273,19.3354921 48.00368,19.8118133 l 135.24346,0 c 19.27067,-0.4763289 35.27188,-7.080262 48.0037,-19.8118193 12.7313,-12.731517 19.3352,-28.732724 19.8118,-48.003669 l 0,-135.243464 c -0.4766,-19.28682 -7.0805,-35.35262 -19.8118,-48.19744 -12.73182,-12.84432 -28.73303,-19.51283 -48.0037,-20.00556 z m 0,186.395713 c 0.35502,0.710536 -0.35543,3.552325 -2.13135,8.525376 -1.77633,4.973203 -6.74946,7.814992 -14.9194,8.525375 l -101.14196,0 c -0.71053,0.355294 -3.55232,-0.355156 -8.52538,-2.13135 -4.97321,-1.776054 -7.815,-6.749182 -8.52537,-14.919401 l 0,-101.529473 c -0.35529,-0.69411 0.35515,-3.47132 2.13134,-8.33162 1.77604,-4.85992 6.74918,-7.63712 14.91941,-8.33162 l 101.14196,0 c 0.71026,-0.34694 3.55205,0.34736 8.52537,2.08291 4.97293,1.73595 7.81472,6.59605 8.52538,14.58033 z" />
+          <path
+             inkscape:connector-curvature="0"
+             id="path3366"
+             style="fill:#e57000;fill-opacity:1"
+             d="m 1372.6013,-243.01152 c -5.8777,-5.87708 -12.7238,-10.49499 -20.5384,-13.85374 -7.8152,-3.35821 -16.2114,-5.06974 -25.1886,-5.13459 -9.551,0.0729 -18.3508,1.96208 -26.3996,5.66744 -8.0493,3.70589 -15.0085,8.79205 -20.8775,15.25848 l -58.5151,64.32783 -58.9026,-64.32783 c -6.0227,-6.63598 -12.9658,-11.77058 -20.829,-15.40381 -7.8635,-3.6327 -16.5503,-5.47341 -26.0606,-5.52211 -8.9775,0.0649 -17.3737,1.77639 -25.1886,5.1346 -7.8149,3.35874 -14.661,7.97665 -20.5384,13.85373 l 105.7922,116.25513 -105.7922,116.255119 c 5.8774,6.0630371 12.7235,10.79396706 20.5384,14.1928038 7.8149,3.398847 16.2111,5.1265285 25.1886,5.1830495 9.3811,-0.072659 18.1326,-1.9618037 26.2543,-5.6674401 8.1217,-3.70562508 15.1293,-8.7917806 21.0228,-15.2584822 l 58.5151,-64.327834 58.5151,64.327834 c 5.869,6.4667016 12.8282,11.55285519 20.8775,15.2584764 8.0488,3.7056326 16.8486,5.5947793 26.3996,5.6674459 8.9772,-0.056513 17.3734,-1.7841929 25.1886,-5.1830438 7.8146,-3.39884052 14.6607,-8.1297724 20.5384,-14.1928095 L 1266.8091,-126.75639 z" />
+        </g>
+      </g>
+    </g>
+  </g>
+</svg>
diff --git a/docs/index.rst b/docs/index.rst
new file mode 100644 (file)
index 0000000..9284f8b
--- /dev/null
@@ -0,0 +1,47 @@
+.. Proxmox Backup documentation master file
+
+Welcome to the Proxmox Offline Mirror documentation!
+====================================================
+| |pom-copyright|
+| Version |version| -- |today|
+
+Permission is granted to copy, distribute and/or modify this document under the
+terms of the GNU Free Documentation License, Version 1.3 or any later version
+published by the Free Software Foundation; with no Invariant Sections, no
+Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included
+in the section entitled "GNU Free Documentation License".
+
+
+.. only:: html
+
+ A `PDF` version of the documentation is `also available here <./proxmox-offline-mirror.pdf>`_
+
+.. toctree::
+   :maxdepth: 3
+   :caption: Table of Contents
+
+   introduction.rst
+
+.. raw:: latex
+
+   \appendix
+
+.. toctree::
+   :maxdepth: 2
+   :caption: Appendix
+
+   command-syntax.rst
+   configuration-files.rst
+   GFDL.rst
+
+.. only:: html and devbuild
+
+    .. toctree::
+       :maxdepth: 2
+       :hidden:
+       :caption: Developer Appendix
+
+       todos.rst
+
+
+.. # * :ref:`genindex`
diff --git a/docs/introduction.rst b/docs/introduction.rst
new file mode 100644 (file)
index 0000000..8472ed9
--- /dev/null
@@ -0,0 +1,149 @@
+Introduction
+============
+
+What is Proxmox Offline Mirror?
+-------------------------------
+
+This tool consists of two binaries, `proxmox-offline-mirror` (mirror tool to create
+and manage mirrors and media containing repositories) and `proxmox-apt-repo`
+(helper to use media on offline systems).
+
+There are two basic entity types available for configuration:
+- mirrors, consisting of upstream repository metadata and a local path where snapshots are stored
+-- configured with `proxmox-offline-mirror config mirror ...`
+-- used with `proxmox-offline-mirror mirror ...`
+- media, consisting of local mirrors and a path where mirrors are synced to
+-- configured with `proxmox-offline-mirror config medium ...`
+-- used with `proxmox-offline-mirror medium ...`
+
+and one internal one, a `pool` consisting of
+- a pool directory containing checksum files (e.g., `sha256/3dc7bc5f82cdcc4ea0f69dd30d5f6bb19e0ccc36f4a79c865eed0e7a370cd5e4`)
+- a base directory containing directories and hardlinks to checksum files inside the pool directory
+
+Adding a file consists of first adding the checksum file(s), then linking them
+under one or more paths. a garbage collect operation will iterate over all
+files in the base directory and remove those which are not (or no longer) a
+hardlink to any checksum files, and remove any checksum files which have no
+hardlinks outside of the pool checksum file directories.
+
+A default config path of `/etc/proxmox-offline-mirror.cfg` is used, but is
+overridable on a per command basis (for example, to allow operation as non-root
+user).
+
+Setting up a mirror
+-------------------
+
+First either run the `setup` wizard (`proxmox-offline-mirror setup`), or the
+`config mirror add` command. For example, to add a mirror entry for the Debian
+Bullseye security repository, the following command can be used:
+
+ proxmox-offline-mirror config mirror add \
+  --id debian-bullseye-security \
+  --architectures amd64 \
+  --architectures all \
+  --repository 'deb http://deb.debian.org/debian-security bullseye-security main contrib non-free' \
+  --key-path /etc/apt/trusted.gpg.d/debian-archive-bullseye-security-automatic.gpg \
+  --sync true \
+  --verify true \
+  --base-dir /path/to/mirror/dir/debian-bullseye-security \
+  --pool-dir /path/to/mirror/dir/debian-bullseye-security/.pool
+
+Syncing a mirror
+----------------
+
+To create the first (and subsequent) snapshots, the following command can be used:
+
+ proxmox-offline-mirror mirror snapshot create --id debian-bullseye-security
+
+Setting up a medium
+-------------------
+
+Either run the `setup` wizard again, or use the `config medium add` command.
+For example, to define a new medium containing the
+`proxmox-ve-bullseye-no-subscription` and `debian-bullseye` mirrors, run the
+following command:
+
+ proxmox-offline-mirror config medium add \
+  --id pve-bullseye \
+  --mirrors proxmox-ve-bullseye-no-subscription \
+  --mirrors debian-bullseye \
+  --sync true \
+  --verify true \
+  --mountpoint /path/where/medium/is/mounted
+
+Syncing a medium
+----------------
+
+To sync the local mirrors to a medium, the following command can be used:
+
+ proxmox-offline-mirror medium sync --id pve-bullseye
+
+Using a medium
+--------------
+
+After syncing a medium, unmount it and make it accessible on the (offline)
+target system. You can now either manually point apt at the synced snapshots,
+or run `proxmox-apt-repo setup` to generate a sources.list.d snippet referecing
+selected mirrors and snapshots. Don't forget to remove the snippet again after
+the upgrade is done.
+
+
+.. _get_help:
+
+Getting Help
+------------
+
+.. _get_help_enterprise_support:
+
+Enterprise Support
+~~~~~~~~~~~~~~~~~~
+
+Users with a `Proxmox Offline Mirror Basic, Standard or Premium Subscription Plan
+<https://www.proxmox.com/en/proxmox-offline-mirror/pricing>`_ have access to the
+`Proxmox Customer Portal <https://my.proxmox.com>`_. The customer portal
+provides support with guaranteed response times from the Proxmox developers.
+For more information or for volume discounts, please contact office@proxmox.com.
+
+Community Support Forum
+~~~~~~~~~~~~~~~~~~~~~~~
+
+We always encourage our users to discuss and share their knowledge using the
+`Proxmox Community Forum`_. The forum is moderated by the Proxmox support team.
+The large user base is spread out all over the world. Needless to say that such
+a large forum is a great place to get information.
+
+Mailing Lists
+~~~~~~~~~~~~~
+
+Proxmox Offline Mirror is fully open-source and contributions are welcome! Here
+is the primary communication channel for developers:
+
+:Mailing list for developers: `PVE Development List`_
+
+Bug Tracker
+~~~~~~~~~~~
+
+Proxmox runs a public bug tracker at `<https://bugzilla.proxmox.com>`_. If an
+issue appears, file your report there. An issue can be a bug, as well as a
+request for a new feature or enhancement. The bug tracker helps to keep track
+of the issue and will send a notification once it has been solved.
+
+License
+-------
+
+|pom-copyright|
+
+This software is written by Proxmox Server Solutions GmbH <support@proxmox.com>
+
+Proxmox Backup Server is free and open source software: you can use it,
+redistribute it, and/or modify it under the terms of the GNU Affero General
+Public License as published by the Free Software Foundation, either version 3
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful, but
+``WITHOUT ANY WARRANTY``; without even the implied warranty of
+``MERCHANTABILITY`` or ``FITNESS FOR A PARTICULAR PURPOSE``.  See the GNU
+Affero General Public License for more details.
+
+You should have received a copy of the GNU Affero General Public License
+along with this program.  If not, see AGPL3_.
\ No newline at end of file
diff --git a/docs/pom-copyright.rst b/docs/pom-copyright.rst
new file mode 100644 (file)
index 0000000..86e9434
--- /dev/null
@@ -0,0 +1,18 @@
+Copyright and Disclaimer
+========================
+
+|pom-copyright|
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU Affero General Public License as
+published by the Free Software Foundation, either version 3 of the
+License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Affero General Public License for more details.
+
+You should have received a copy of the GNU Affero General Public
+License along with this program.  If not, see
+http://www.gnu.org/licenses/
diff --git a/docs/proxmox-apt-repo/description.rst b/docs/proxmox-apt-repo/description.rst
new file mode 100644 (file)
index 0000000..f0c7185
--- /dev/null
@@ -0,0 +1,2 @@
+This tool serves as a helper to streamline usage of a mirrored offline APT
+repository and offline subscription keys.
\ No newline at end of file
diff --git a/docs/proxmox-apt-repo/man1.rst b/docs/proxmox-apt-repo/man1.rst
new file mode 100644 (file)
index 0000000..e68a584
--- /dev/null
@@ -0,0 +1,16 @@
+================
+proxmox-apt-repo
+================
+
+Synopsis
+==========
+
+.. include:: synopsis.rst
+
+Description
+============
+
+.. include:: description.rst
+
+
+.. include:: ../pom-copyright.rst
diff --git a/docs/proxmox-offline-mirror/description.rst b/docs/proxmox-offline-mirror/description.rst
new file mode 100644 (file)
index 0000000..69c4b29
--- /dev/null
@@ -0,0 +1,2 @@
+This tool allows registering and updating offline subscription keys, and
+configuring and managing offline APT repository mirrors and media.
\ No newline at end of file
diff --git a/docs/proxmox-offline-mirror/man1.rst b/docs/proxmox-offline-mirror/man1.rst
new file mode 100644 (file)
index 0000000..2127b40
--- /dev/null
@@ -0,0 +1,16 @@
+======================
+proxmox-offline-mirror
+======================
+
+Synopsis
+==========
+
+.. include:: synopsis.rst
+
+Description
+============
+
+.. include:: description.rst
+
+
+.. include:: ../pom-copyright.rst
diff --git a/docs/todos.rst b/docs/todos.rst
new file mode 100644 (file)
index 0000000..07f44ab
--- /dev/null
@@ -0,0 +1,6 @@
+Documentation Todo List
+=======================
+
+This is an auto-generated list of the todo references in the documentation.
+
+.. todolist::
diff --git a/src/bin/docgen.rs b/src/bin/docgen.rs
new file mode 100644 (file)
index 0000000..876222d
--- /dev/null
@@ -0,0 +1,31 @@
+use anyhow::{bail, Error};
+use proxmox_offline_mirror::config;
+
+use proxmox_section_config::dump_section_config;
+
+fn get_args() -> (String, Vec<String>) {
+    let mut args = std::env::args();
+    let prefix = args.next().unwrap();
+    let prefix = prefix.rsplit('/').next().unwrap().to_string(); // without path
+    let args: Vec<String> = args.collect();
+
+    (prefix, args)
+}
+
+fn main() -> Result<(), Error> {
+    let (_prefix, args) = get_args();
+
+    if args.is_empty() {
+        bail!("missing arguments");
+    }
+
+    for arg in args.iter() {
+        let text = match arg.as_ref() {
+            "mirror.cfg" => dump_section_config(&config::CONFIG),
+            _ => bail!("docgen: got unknown type"),
+        };
+        println!("{}", text);
+    }
+
+    Ok(())
+}
\ No newline at end of file
index 42705a802c213321a8949429ac656180820ff237..44c4ca10fb8be28a2778083607db395570473e77 100644 (file)
@@ -176,7 +176,7 @@ impl SubscriptionKey {
 }
 
 lazy_static! {
-    static ref CONFIG: SectionConfig = init();
+    pub static ref CONFIG: SectionConfig = init();
 }
 
 fn init() -> SectionConfig {