diff --git a/.gitea/workflows/manual-pdf.yml b/.gitea/workflows/manual-pdf.yml new file mode 100644 index 0000000..a7b67c1 --- /dev/null +++ b/.gitea/workflows/manual-pdf.yml @@ -0,0 +1,34 @@ +name: Assignment 5 manual PDF +on: + push: + branches: [main, manual-build-validation] +jobs: + manual: + runs-on: manual-latex + timeout-minutes: 30 + permissions: + contents: read + steps: + - uses: https://github.com/actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 + with: + ref: ${{ github.sha }} + persist-credentials: false + - name: Compile the complete manual with visible build identity + env: + GITEA_SHA: ${{ github.sha }} + GITEA_RUN_NUMBER: ${{ github.run_number }} + GITEA_RUN_ID: ${{ github.run_id }} + GITEA_RUN_ATTEMPT: ${{ github.run_attempt }} + run: | + python3 documentation/ci/build_manual.py + test -s documentation/build/main.pdf + test -s documentation/build/build-manifest.json + - name: Publish verified PDF and traceability manifest + uses: https://github.com/actions/upload-artifact@c6a366c94c3e0affe28c06c8df20a878f24da3cf + with: + name: assignment5-1.7.1-run-${{ github.run_number }}-${{ github.sha }} + path: | + documentation/build/main.pdf + documentation/build/build-manifest.json + if-no-files-found: error + retention-days: 14 diff --git a/documentation/.gitignore b/documentation/.gitignore new file mode 100644 index 0000000..f27a0bc --- /dev/null +++ b/documentation/.gitignore @@ -0,0 +1,32 @@ +# Generated build files and local credentials are never source artifacts. +build/ +build-metadata.tex +_minted*/ +__pycache__/ +*.aux +*.log +*.out +*.toc +*.lof +*.lot +*.bbl +*.blg +*.idx +*.ilg +*.ind +*.acn +*.acr +*.alg +*.glo +*.gls +*.glg +*.ist +*.fls +*.fdb_latexmk +*.synctex.gz +main.pdf +devopsAssignment.pdf +.env +.runner +*.key +*.pem diff --git a/documentation/IEEEtran.bst b/documentation/IEEEtran.bst new file mode 100644 index 0000000..b9c3b93 --- /dev/null +++ b/documentation/IEEEtran.bst @@ -0,0 +1,2365 @@ +%% +%% IEEEtran.bst +%% BibTeX Bibliography Style file for IEEE Journals and Conferences (unsorted) +%% Version 1.10 (2002/09/27) +%% +%% Copyright (c) 2002 Michael Shell +%% +%% Original starting code base and algorithms obtained from the output of +%% Patrick W. Daly's makebst package as well as from prior versions of +%% IEEE BibTeX styles: +%% +%% 1. Howard Trickey and Oren Patashnik's ieeetr.bst (1985/1988) +%% 2. Silvano Balemi and Richard H. Roy's IEEEbib.bst (1993) +%% +%% +%% See: +%% http://www.ctan.org/tex-archive/macros/latex/contrib/supported/IEEEtran/ +%% for latest version and current contact information. +%% +%% For use with BibTeX version 0.99a or later +%% +%% This is a numerical citation style. +%% +%%********************************************************************** +%% Legal Notice: +%% This code is offered as-is without any warranty either expressed or +%% implied; without even the implied warranty of MERCHANTABILITY or +%% FITNESS FOR A PARTICULAR PURPOSE! +%% User assumes all risk. +%% In no event shall IEEE or any contributor to this code be liable for +%% any damages or losses, including, but not limited to, incidental, +%% consequential, or any other damages, resulting from the use or misuse +%% of any information contained here. +%% +%% This code is distributed under the Perl Artistic License +%% ( http://language.perl.com/misc/Artistic.html ) +%% and may be freely used, distributed and modified - subject to the +%% constraints therein. +%% Retain all contribution notices, credits and disclaimers. +%% +%% All comments are the opinions of their respective authors and are not +%% necessarily endorsed by the IEEE. +%%********************************************************************** +% +% +% Changelog: +% +% 1.00 (2002/08/13) Initial release +% +% 1.10 (2002/09/27) +% 1. Corrected minor bug for improperly formed warning message when a +% book was not given a title. Thanks to Ming Kin Lai for reporting this. +% 2. Added support for CTLname_format_string and CTLname_latex_cmd fields +% in the BST control entry type. + + + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% DEFAULTS FOR THE CONTROLS OF THE BST STYLE %% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% These are the defaults for the user adjustable controls. The values used +% here can be overridden by the user via IEEEtranBSTCTL entry type. + +% NOTE: The recommended LaTeX command to invoke a control entry type is: +% +%\makeatletter +%\def\bstctlcite#1{\@bsphack +% \@for\@citeb:=#1\do{% +% \edef\@citeb{\expandafter\@firstofone\@citeb}% +% \if@filesw\immediate\write\@auxout{\string\citation{\@citeb}}\fi}% +% \@esphack} +%\makeatother +% +% It is called at the start of the document, before the first \cite, like: +% \bstctlcite{IEEEexample:BSTcontrol} +% +% IEEEtran.cls V1.6 and later does provide this command. + + + +% #0 turns off the display of the number for articles. +% #1 enables +FUNCTION {default.is.use.number.for.article} { #1 } + + +% #0 turns off the display of the paper and type fields in @inproceedings. +% #1 enables +FUNCTION {default.is.use.paper} { #1 } + + +% #0 turns off the forced use of "et al." +% #1 enables +FUNCTION {default.is.forced.et.al} { #0 } + +% The maximum number of names that can be present beyond which an "et al." +% usage is forced. Be sure that num.names.shown.with.forced.et.al (below) +% is not greater than this value! +% Note: There are many instances of references in IEEE journals which have +% a very large number of authors as well as instances in which "et al." is +% used profusely. +FUNCTION {default.max.num.names.before.forced.et.al} { #10 } + +% The number of names that will be shown with a forced "et al.". +% Must be less than or equal to max.num.names.before.forced.et.al +FUNCTION {default.num.names.shown.with.forced.et.al} { #1 } + + +% #0 turns off the alternate interword spacing for entries with URLs. +% #1 enables +FUNCTION {default.is.use.alt.interword.spacing} { #1 } + +% If alternate interword spacing for entries with URLs is enabled, this is +% the interword spacing stretch factor that will be used. For example, the +% default "4" here means that the interword spacing in entries with URLs can +% stretch to four times normal. Does not have to be an integer. Note that +% the value specified here can be overridden by the user in their LaTeX +% code via a command such as: +% "\providecommand\BIBentryALTinterwordstretchfactor{1.5}" in addition to +% that via the IEEEtranBSTCTL entry type. +FUNCTION {default.ALTinterwordstretchfactor} { "4" } + + +% #0 turns off the "dashification" of repeated (i.e., identical to those +% of the previous entry) names. IEEE normally does this. +% #1 enables +FUNCTION {default.is.dash.repeated.names} { #1 } + + +% The default name format control string. +FUNCTION {default.name.format.string}{ "{f.~}{vv~}{ll}{, jj}" } + + +% The default LaTeX font command for the names. +FUNCTION {default.name.latex.cmd}{ "" } + + +% Other controls that cannot be accessed via IEEEtranBSTCTL entry type. + +% #0 turns off the terminal startup banner/completed message so as to +% operate more quietly. +% #1 enables +FUNCTION {is.print.banners.to.terminal} { #1 } + + + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% FILE VERSION AND BANNER %% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION{bst.file.version} { "1.10" } +FUNCTION{bst.file.date} { "2002/09/27" } +FUNCTION{bst.file.website} { "http://www.ctan.org/tex-archive/macros/latex/contrib/supported/IEEEtran/" } + +FUNCTION {banner.message} +{ is.print.banners.to.terminal + { "-- IEEEtran.bst version" " " * bst.file.version * + " (" * bst.file.date * ") " * "by Michael Shell." * + top$ + "-- " bst.file.website * + top$ + "-- See the " quote$ * "IEEEtran_bst_HOWTO.pdf" * quote$ * " manual for usage information." * + top$ + } + { skip$ } + if$ +} + +FUNCTION {completed.message} +{ is.print.banners.to.terminal + { "" + top$ + "Done." + top$ + } + { skip$ } + if$ +} + + + + +%%%%%%%%%%%%%%%%%%%%%% +%% STRING CONSTANTS %% +%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {bbl.and}{ "and" } +FUNCTION {bbl.etal}{ "et~al." } +FUNCTION {bbl.editors}{ "eds." } +FUNCTION {bbl.editor}{ "ed." } +FUNCTION {bbl.edition}{ "ed." } +FUNCTION {bbl.volume}{ "vol." } +FUNCTION {bbl.of}{ "of" } +FUNCTION {bbl.number}{ "no." } +FUNCTION {bbl.in}{ "in" } +FUNCTION {bbl.pages}{ "pp." } +FUNCTION {bbl.page}{ "p." } +FUNCTION {bbl.chapter}{ "ch." } +FUNCTION {bbl.paper}{ "paper" } +FUNCTION {bbl.part}{ "pt." } +FUNCTION {bbl.patent}{ "Patent" } +FUNCTION {bbl.patentUS}{ "U.S." } +FUNCTION {bbl.revision}{ "Rev." } +FUNCTION {bbl.series}{ "ser." } +FUNCTION {bbl.standard}{ "Std." } +FUNCTION {bbl.techrep}{ "Tech. Rep." } +FUNCTION {bbl.mthesis}{ "Master's thesis" } +FUNCTION {bbl.phdthesis}{ "Ph.D. dissertation" } +FUNCTION {bbl.urlprefix}{ "[Online]. Available:" } +FUNCTION {bbl.st}{ "st" } +FUNCTION {bbl.nd}{ "nd" } +FUNCTION {bbl.rd}{ "rd" } +FUNCTION {bbl.th}{ "th" } + + +% This is the LaTeX spacer that is used when a larger than normal space +% is called for (such as just before the address:publisher). +FUNCTION {large.space} { "\hskip 1em plus 0.5em minus 0.4em\relax " } + +% The LaTeX code for dashes that are used to represent repeated names. +% Note: Some older IEEE journals used something like +% "\rule{0.275in}{0.5pt}\," which is fairly thick and runs right along +% the baseline. However, IEEE now uses a thinner, above baseline, +% six dash long sequence. +FUNCTION {repeated.name.dashes} { "------" } + + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% PREDEFINED STRING MACROS %% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +MACRO {jan} {"Jan."} +MACRO {feb} {"Feb."} +MACRO {mar} {"Mar."} +MACRO {apr} {"Apr."} +MACRO {may} {"May"} +MACRO {jun} {"June"} +MACRO {jul} {"July"} +MACRO {aug} {"Aug."} +MACRO {sep} {"Sept."} +MACRO {oct} {"Oct."} +MACRO {nov} {"Nov."} +MACRO {dec} {"Dec."} + + + +%%%%%%%%%%%%%%%%%% +%% ENTRY FIELDS %% +%%%%%%%%%%%%%%%%%% + +ENTRY + { address + assignee + author + booktitle + chapter + day + dayfiled + edition + editor + howpublished + institution + intype + journal + key + language + month + monthfiled + nationality + note + number + organization + pages + paper + publisher + school + series + revision + title + type + url + volume + year + yearfiled + CTLuse_article_number + CTLuse_paper + CTLuse_forced_etal + CTLmax_names_forced_etal + CTLnames_show_etal + CTLuse_alt_spacing + CTLalt_stretch_factor + CTLdash_repeated_names + CTLname_format_string + CTLname_latex_cmd + } + {} + { label } + + + + +%%%%%%%%%%%%%%%%%%%%%%% +%% INTEGER VARIABLES %% +%%%%%%%%%%%%%%%%%%%%%%% + +INTEGERS { prev.status.punct this.status.punct punct.std + punct.no punct.comma punct.period + prev.status.space this.status.space space.std + space.no space.normal space.large + prev.status.quote this.status.quote quote.std + quote.no quote.close + prev.status.nline this.status.nline nline.std + nline.no nline.newblock + status.cap cap.std + cap.no cap.yes} + +INTEGERS { longest.label.width multiresult nameptr namesleft number.label numnames } + +INTEGERS { is.use.number.for.article + is.use.paper + is.forced.et.al + max.num.names.before.forced.et.al + num.names.shown.with.forced.et.al + is.use.alt.interword.spacing + is.dash.repeated.names} + + +%%%%%%%%%%%%%%%%%%%%%% +%% STRING VARIABLES %% +%%%%%%%%%%%%%%%%%%%%%% + +STRINGS { bibinfo + longest.label + oldname + s + t + ALTinterwordstretchfactor + name.format.string + name.latex.cmd} + + + + +%%%%%%%%%%%%%%%%%%%%%%%%% +%% LOW LEVEL FUNCTIONS %% +%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {initialize.controls} +{ default.is.use.number.for.article 'is.use.number.for.article := + default.is.use.paper 'is.use.paper := + default.is.forced.et.al 'is.forced.et.al := + default.max.num.names.before.forced.et.al 'max.num.names.before.forced.et.al := + default.num.names.shown.with.forced.et.al 'num.names.shown.with.forced.et.al := + default.is.use.alt.interword.spacing 'is.use.alt.interword.spacing := + default.is.dash.repeated.names 'is.dash.repeated.names := + default.ALTinterwordstretchfactor 'ALTinterwordstretchfactor := + default.name.format.string 'name.format.string := + default.name.latex.cmd 'name.latex.cmd := +} + + +% This IEEEtran.bst features a very powerful and flexible mechanism for +% controlling the capitalization, punctuation, spacing, quotation, and +% newlines of the formatted entry fields. (Note: IEEEtran.bst does not need +% or use the newline/newblock feature, but it has been implemented for +% possible future use.) The output states of IEEEtran.bst consist of +% multiple independent attributes and, as such, can be thought of as being +% vectors, rather than the simple scalar values ("before.all", +% "mid.sentence", etc.) used in most other .bst files. +% +% The more flexible and complex design used here was motivated in part by +% IEEE's rather unusual bibliography style. For example, IEEE ends the +% previous field item with a period and large space prior to the publisher +% address; the @electronic entry types use periods as inter-item punctuation +% rather than the commas used by the other entry types; and URLs are never +% followed by periods even though they are the last item in the entry. +% Although it is possible to accommodate these features with the conventional +% output state system, the seemingly endless exceptions make for convoluted, +% unreliable and difficult to maintain code. +% +% IEEEtran.bst's output state system can be easily understood via a simple +% illustration of two most recently formatted entry fields (on the stack): +% +% CURRENT_ITEM +% "PREVIOUS_ITEM +% +% which, in this example, is to eventually appear in the bibliography as: +% +% "PREVIOUS_ITEM," CURRENT_ITEM +% +% It is the job of the output routine to take the previous item off of the +% stack (while leaving the current item at the top of the stack), apply its +% trailing punctuation (including closing quote marks) and spacing, and then +% to write the result to BibTeX's output buffer: +% +% "PREVIOUS_ITEM," +% +% Punctuation (and spacing) between items is often determined by both of the +% items rather than just the first one. The presence of quotation marks +% further complicates the situation because, in standard English, trailing +% punctuation marks are supposed to be contained within the quotes. +% +% IEEEtran.bst maintains two output state (aka "status") vectors which +% correspond to the previous and current (aka "this") items. Each vector +% consists of several independent attributes which track punctuation, +% spacing, quotation, and newlines. Capitalization status is handled by a +% separate scalar because the format routines, not the output routine, +% handle capitalization and, therefore, there is no need to maintain the +% capitalization attribute for both the "previous" and "this" items. +% +% When a format routine adds a new item, it copies the current output status +% vector to the previous output status vector and (usually) resets the +% current (this) output status vector to a "standard status" vector. Using a +% "standard status" vector in this way allows us to redefine what we mean by +% "standard status" at the start of each entry handler and reuse the same +% format routines under the various inter-item separation schemes. For +% example, the standard status vector for the @book entry type may use +% commas for item separators, while the @electronic type may use periods, +% yet both entry handlers exploit many of the exact same format routines. +% +% Because format routines have write access to the output status vector of +% the previous item, they can override the punctuation choices of the +% previous format routine! Therefore, it becomes trivial to implement rules +% such as "Always use a period and a large space before the publisher." By +% pushing the generation of the closing quote mark to the output routine, we +% avoid all the problems caused by having to close a quote before having all +% the information required to determine what the punctuation should be. +% +% The IEEEtran.bst output state system can easily be expanded if needed. +% For instance, it is easy to add a "space.tie" attribute value if the +% bibliography rules mandate that two items have to be joined with an +% unbreakable space. + +FUNCTION {initialize.status.constants} +{ #0 'punct.no := + #1 'punct.comma := + #2 'punct.period := + #0 'space.no := + #1 'space.normal := + #2 'space.large := + #0 'quote.no := + #1 'quote.close := + #0 'cap.no := + #1 'cap.yes := + #0 'nline.no := + #1 'nline.newblock := +} + +FUNCTION {std.status.using.comma} +{ punct.comma 'punct.std := + space.normal 'space.std := + quote.no 'quote.std := + nline.no 'nline.std := + cap.no 'cap.std := +} + +FUNCTION {std.status.using.period} +{ punct.period 'punct.std := + space.normal 'space.std := + quote.no 'quote.std := + nline.no 'nline.std := + cap.yes 'cap.std := +} + +FUNCTION {initialize.prev.this.status} +{ punct.no 'prev.status.punct := + space.no 'prev.status.space := + quote.no 'prev.status.quote := + nline.no 'prev.status.nline := + punct.no 'this.status.punct := + space.no 'this.status.space := + quote.no 'this.status.quote := + nline.no 'this.status.nline := + cap.yes 'status.cap := +} + +FUNCTION {this.status.std} +{ punct.std 'this.status.punct := + space.std 'this.status.space := + quote.std 'this.status.quote := + nline.std 'this.status.nline := +} + +FUNCTION {cap.status.std}{ cap.std 'status.cap := } + +FUNCTION {this.to.prev.status} +{ this.status.punct 'prev.status.punct := + this.status.space 'prev.status.space := + this.status.quote 'prev.status.quote := + this.status.nline 'prev.status.nline := +} + + +FUNCTION {not} +{ { #0 } + { #1 } + if$ +} + +FUNCTION {and} +{ { skip$ } + { pop$ #0 } + if$ +} + +FUNCTION {or} +{ { pop$ #1 } + { skip$ } + if$ +} + + +% convert the strings "yes" or "no" to #1 or #0 respectively +FUNCTION {yes.no.to.int} +{ "l" change.case$ duplicate$ + "yes" = + { pop$ #1 } + { duplicate$ "no" = + { pop$ #0 } + { "unknown boolean " quote$ * swap$ * quote$ * + " in " * cite$ * warning$ + #0 + } + if$ + } + if$ +} + + +% pushes true if the single char string on the stack is in the +% range of "0" to "9" +FUNCTION {is.num} +{ chr.to.int$ + duplicate$ "0" chr.to.int$ < not + swap$ "9" chr.to.int$ > not and +} + +% multiplies the integer on the stack by a factor of 10 +FUNCTION {bump.int.mag} +{ #0 'multiresult := + { duplicate$ #0 > } + { #1 - + multiresult #10 + + 'multiresult := + } + while$ +pop$ +multiresult +} + +% converts a single character string on the stack to an integer +FUNCTION {char.to.integer} +{ duplicate$ + is.num + { chr.to.int$ "0" chr.to.int$ - } + {"noninteger character " quote$ * swap$ * quote$ * + " in integer field of " * cite$ * warning$ + #0 + } + if$ +} + +% converts a string on the stack to an integer +FUNCTION {string.to.integer} +{ duplicate$ text.length$ 'namesleft := + #1 'nameptr := + #0 'numnames := + { nameptr namesleft > not } + { duplicate$ nameptr #1 substring$ + char.to.integer numnames bump.int.mag + + 'numnames := + nameptr #1 + + 'nameptr := + } + while$ +pop$ +numnames +} + + + + +% The output routines write out the *next* to the top (previous) item on the +% stack, adding punctuation and such as needed. Since IEEEtran.bst maintains +% the output status for the top two items on the stack, these output +% routines have to consider the previous output status (which corresponds to +% the item that is being output). Full independent control of punctuation, +% closing quote marks, spacing, and newblock is provided. +% +% "output.nonnull" does not check for the presence of a previous empty +% item. +% +% "output" does check for the presence of a previous empty item and will +% remove an empty item rather than outputing it. +% +% "output.warn" is like "output", but will issue a warning if it detects +% an empty item. + +FUNCTION {output.nonnull} +{ swap$ + prev.status.punct punct.comma = + { "," * } + { skip$ } + if$ + prev.status.punct punct.period = + { add.period$ } + { skip$ } + if$ + prev.status.quote quote.close = + { "''" * } + { skip$ } + if$ + prev.status.space space.normal = + { " " * } + { skip$ } + if$ + prev.status.space space.large = + { large.space * } + { skip$ } + if$ + write$ + prev.status.nline nline.newblock = + { newline$ "\newblock " write$ } + { skip$ } + if$ +} + +FUNCTION {output} +{ duplicate$ empty$ + 'pop$ + 'output.nonnull + if$ +} + +FUNCTION {output.warn} +{ 't := + duplicate$ empty$ + { pop$ "empty " t * " in " * cite$ * warning$ } + 'output.nonnull + if$ +} + +% "fin.entry" is the output routine that handles the last item of the entry +% (which will be on the top of the stack when "fin.entry" is called). + +FUNCTION {fin.entry} +{ this.status.punct punct.no = + { skip$ } + { add.period$ } + if$ + this.status.quote quote.close = + { "''" * } + { skip$ } + if$ +write$ +newline$ +} + + +FUNCTION {is.last.char.not.punct} +{ duplicate$ + "}" * add.period$ + #-1 #1 substring$ "." = +} + +FUNCTION {is.multiple.pages} +{ 't := + #0 'multiresult := + { multiresult not + t empty$ not + and + } + { t #1 #1 substring$ + duplicate$ "-" = + swap$ duplicate$ "," = + swap$ "+" = + or or + { #1 'multiresult := } + { t #2 global.max$ substring$ 't := } + if$ + } + while$ + multiresult +} + +FUNCTION {capitalize}{ "u" change.case$ "t" change.case$ } + +FUNCTION {emphasize} +{ duplicate$ empty$ + { pop$ "" } + { "\emph{" swap$ * "}" * } + if$ +} + +FUNCTION {do.name.latex.cmd} +{ name.latex.cmd + empty$ + { skip$ } + { name.latex.cmd "{" * swap$ * "}" * } + if$ +} + +% IEEEtran.bst uses its own \BIBforeignlanguage command which directly +% invokes the TeX hyphenation patterns without the need of the Babel +% package. Babel does a lot more than switch hyphenation patterns and +% its loading can cause unintended effects in many class files (such as +% IEEEtran.cls). +FUNCTION {select.language} +{ duplicate$ empty$ 'pop$ + { language empty$ 'skip$ + { "\BIBforeignlanguage{" language * "}{" * swap$ * "}" * } + if$ + } + if$ +} + +FUNCTION {tie.or.space.prefix} +{ duplicate$ text.length$ #3 < + { "~" } + { " " } + if$ + swap$ +} + +FUNCTION {get.bbl.editor} +{ editor num.names$ #1 > 'bbl.editors 'bbl.editor if$ } + +FUNCTION {space.word}{ " " swap$ * " " * } + + +% Field Conditioners, Converters, Checkers and External Interfaces + +FUNCTION {empty.field.to.null.string} +{ duplicate$ empty$ + { pop$ "" } + { skip$ } + if$ +} + +FUNCTION {either.or.check} +{ empty$ + { pop$ } + { "can't use both " swap$ * " fields in " * cite$ * warning$ } + if$ +} + +FUNCTION {empty.entry.warn} +{ author empty$ title empty$ howpublished empty$ + month empty$ year empty$ note empty$ url empty$ + and and and and and and + { "all relevant fields are empty in " cite$ * warning$ } + 'skip$ + if$ +} + + +% The bibinfo system provides a way for the electronic parsing/acquisition +% of a bibliography's contents as is done by ReVTeX. For example, a field +% could be entered into the bibliography as: +% \bibinfo{volume}{2} +% Only the "2" would show up in the document, but the LaTeX \bibinfo command +% could do additional things with the information. IEEEtran.bst does provide +% a \bibinfo command via "\providecommand{\bibinfo}[2]{#2}". However, it is +% currently not used as the bogus bibinfo functions defined here output the +% entry values directly without the \bibinfo wrapper. The bibinfo functions +% themselves (and the calls to them) are retained for possible future use. +% +% bibinfo.check avoids acting on missing fields while bibinfo.warn will +% issue a warning message if a missing field is detected. Prior to calling +% the bibinfo functions, the user should push the field value and then its +% name string, in that order. + +FUNCTION {bibinfo.check} +{ swap$ duplicate$ missing$ + { pop$ pop$ "" } + { duplicate$ empty$ + { swap$ pop$ } + { swap$ pop$ } + if$ + } + if$ +} + +FUNCTION {bibinfo.warn} +{ swap$ duplicate$ missing$ + { swap$ "missing " swap$ * " in " * cite$ * warning$ pop$ "" } + { duplicate$ empty$ + { swap$ "empty " swap$ * " in " * cite$ * warning$ } + { swap$ pop$ } + if$ + } + if$ +} + + +% IEEE separates large numbers with more than 4 digits into groups of +% three. IEEE uses a small space to separate these number groups. +% Typical applications include patent and page numbers. + +% number of consecutive digits required to trigger the group separation. +FUNCTION {large.number.trigger}{ #5 } + +% For numbers longer than the trigger, this is the blocksize of the groups. +% The blocksize must be less than the trigger threshold, and 2 * blocksize +% must be greater than the trigger threshold (can't do more than one +% separation on the initial trigger). +FUNCTION {large.number.blocksize}{ #3 } + +% What is actually inserted between the number groups. +FUNCTION {large.number.separator}{ "\," } + +% So as to save on integer variables by reusing existing ones, numnames +% holds the current number of consecutive digits read and nameptr holds +% the number that will trigger an inserted space. +FUNCTION {large.number.separate} +{ 't := + "" + #0 'numnames := + large.number.trigger 'nameptr := + { t empty$ not } + { t #-1 #1 substring$ is.num + { numnames #1 + 'numnames := } + { #0 'numnames := + large.number.trigger 'nameptr := + } + if$ + t #-1 #1 substring$ swap$ * + t #-2 global.max$ substring$ 't := + numnames nameptr = + { duplicate$ #1 nameptr large.number.blocksize - substring$ swap$ + nameptr large.number.blocksize - #1 + global.max$ substring$ + large.number.separator swap$ * * + nameptr large.number.blocksize - 'numnames := + large.number.blocksize #1 + 'nameptr := + } + { skip$ } + if$ + } + while$ +} + +% Converts all single dashes "-" to double dashes "--". +FUNCTION {n.dashify} +{ large.number.separate + 't := + "" + { t empty$ not } + { t #1 #1 substring$ "-" = + { t #1 #2 substring$ "--" = not + { "--" * + t #2 global.max$ substring$ 't := + } + { { t #1 #1 substring$ "-" = } + { "-" * + t #2 global.max$ substring$ 't := + } + while$ + } + if$ + } + { t #1 #1 substring$ * + t #2 global.max$ substring$ 't := + } + if$ + } + while$ +} + + +% This function detects entries with names that are identical to that of +% the previous entry and replaces the repeated names with dashes (if the +% "is.dash.repeated.names" user control is nonzero). +FUNCTION {name.or.dash} +{ 's := + oldname empty$ + { s 'oldname := s } + { s oldname = + { is.dash.repeated.names + { repeated.name.dashes } + { s 'oldname := s } + if$ + } + { s 'oldname := s } + if$ + } + if$ +} + +% Converts the number string on the top of the stack to +% "numerical ordinal form" (e.g., "7" to "7th"). There is +% no artificial limit to the upper bound of the numbers as the +% least significant digit always determines the ordinal form. +FUNCTION {num.to.ordinal} +{ duplicate$ #-1 #1 substring$ "1" = + { bbl.st * } + { duplicate$ #-1 #1 substring$ "2" = + { bbl.nd * } + { duplicate$ #-1 #1 substring$ "3" = + { bbl.rd * } + { bbl.th * } + if$ + } + if$ + } + if$ +} + +% If the string on the top of the stack begins with a number, +% (e.g., 11th) then replace the string with the leading number +% it contains. Otherwise retain the string as-is. s holds the +% extracted number, t holds the part of the string that remains +% to be scanned. +FUNCTION {extract.num} +{ duplicate$ 't := + "" 's := + { t empty$ not } + { t #1 #1 substring$ + t #2 global.max$ substring$ 't := + duplicate$ is.num + { s swap$ * 's := } + { pop$ "" 't := } + if$ + } + while$ + s empty$ + 'skip$ + { pop$ s } + if$ +} + +% Converts the word number string on the top of the stack to +% Arabic string form. Will be successful up to "tenth". +FUNCTION {word.to.num} +{ duplicate$ "l" change.case$ 's := + s "first" = + { pop$ "1" } + { skip$ } + if$ + s "second" = + { pop$ "2" } + { skip$ } + if$ + s "third" = + { pop$ "3" } + { skip$ } + if$ + s "fourth" = + { pop$ "4" } + { skip$ } + if$ + s "fifth" = + { pop$ "5" } + { skip$ } + if$ + s "sixth" = + { pop$ "6" } + { skip$ } + if$ + s "seventh" = + { pop$ "7" } + { skip$ } + if$ + s "eighth" = + { pop$ "8" } + { skip$ } + if$ + s "ninth" = + { pop$ "9" } + { skip$ } + if$ + s "tenth" = + { pop$ "10" } + { skip$ } + if$ +} + + +% Converts the string on the top of the stack to numerical +% ordinal (e.g., "11th") form. +FUNCTION {convert.edition} +{ duplicate$ empty$ 'skip$ + { duplicate$ #1 #1 substring$ is.num + { extract.num + num.to.ordinal + } + { word.to.num + duplicate$ #1 #1 substring$ is.num + { num.to.ordinal } + { "edition ordinal word " quote$ * edition * quote$ * + " may be too high (or improper) for conversion" * " in " * cite$ * warning$ + } + if$ + } + if$ + } + if$ +} + + + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% LATEX BIBLIOGRAPHY CODE %% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {start.entry} +{ newline$ + "\bibitem{" write$ + cite$ write$ + "}" write$ + newline$ + "" + initialize.prev.this.status +} + +% Here we write out all the LaTeX code that we will need. The most involved +% code sequences are those that control the alternate interword spacing and +% foreign language hyphenation patterns. The heavy use of \providecommand +% gives users a way to override the defaults. Special thanks to Javier Bezos, +% Johannes Braams, Robin Fairburns, Heiko Oberdiek, Donald Arseneau and all +% the other gurus on comp.text.tex for their help and advice on the topic of +% \selectlanguage, Babel and BibTeX. +FUNCTION {begin.bib} +{ preamble$ empty$ 'skip$ + { preamble$ write$ newline$ } + if$ + "\begin{thebibliography}{" longest.label * "}" * + write$ newline$ + "\providecommand{\url}[1]{#1}" + write$ newline$ + "\def\UrlFont{\rmfamily}" + write$ newline$ + "\providecommand{\newblock}{\relax}" + write$ newline$ + "\providecommand{\bibinfo}[2]{#2}" + write$ newline$ + "\providecommand\BIBentrySTDinterwordspacing{\spaceskip=0pt\relax}" + write$ newline$ + "\providecommand\BIBentryALTinterwordstretchfactor{" + ALTinterwordstretchfactor * "}" * + write$ newline$ + "\providecommand\BIBentryALTinterwordspacing{\spaceskip=\fontdimen2\font plus " + write$ newline$ + "\BIBentryALTinterwordstretchfactor\fontdimen3\font minus \fontdimen4\font\relax}" + write$ newline$ + "\providecommand\BIBforeignlanguage[2]{{%" + write$ newline$ + "\expandafter\ifx\csname l@#1\endcsname\relax" + write$ newline$ + "\typeout{** WARNING: IEEEtran.bst: No hyphenation pattern has been}%" + write$ newline$ + "\typeout{** loaded for the language `#1'. Using the pattern for}%" + write$ newline$ + "\typeout{** the default language instead.}%" + write$ newline$ + "\else" + write$ newline$ + "\language=\csname l@#1\endcsname" + write$ newline$ + "\fi" + write$ newline$ + "#2}}" + write$ newline$ +} + +FUNCTION {end.bib} +{ newline$ "\end{thebibliography}" write$ newline$ } + +FUNCTION {if.url.alt.interword.spacing} +{ is.use.alt.interword.spacing + {url empty$ 'skip$ {"\BIBentryALTinterwordspacing" write$ newline$} if$} + { skip$ } + if$ +} + +FUNCTION {if.url.std.interword.spacing} +{ is.use.alt.interword.spacing + {url empty$ 'skip$ {"\BIBentrySTDinterwordspacing" write$ newline$} if$} + { skip$ } + if$ +} + + + + +%%%%%%%%%%%%%%%%%%%%%%%% +%% LONGEST LABEL PASS %% +%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {initialize.longest.label} +{ "" 'longest.label := + #1 'number.label := + #0 'longest.label.width := +} + +FUNCTION {longest.label.pass} +{ number.label int.to.str$ 'label := + number.label #1 + 'number.label := + label width$ longest.label.width > + { label 'longest.label := + label width$ 'longest.label.width := + } + 'skip$ + if$ +} + + + + +%%%%%%%%%%%%%%%%%%%%% +%% FORMAT HANDLERS %% +%%%%%%%%%%%%%%%%%%%%% + +%% Lower Level Formats (used by higher level formats) + +FUNCTION {format.address.org.or.pub.date} +{ 't := + "" + year empty$ + { "empty year in " cite$ * warning$ } + { skip$ } + if$ + address empty$ t empty$ and + year empty$ and month empty$ and + { skip$ } + { this.to.prev.status + this.status.std + cap.status.std + address "address" bibinfo.check * + t empty$ + { skip$ } + { punct.period 'prev.status.punct := + space.large 'prev.status.space := + address empty$ + { skip$ } + { ": " * } + if$ + t * + } + if$ + year empty$ month empty$ and + { skip$ } + { t empty$ address empty$ and + { skip$ } + { ", " * } + if$ + month empty$ + { year empty$ + { skip$ } + { year "year" bibinfo.check * } + if$ + } + { month "month" bibinfo.check * + year empty$ + { skip$ } + { " " * year "year" bibinfo.check * } + if$ + } + if$ + } + if$ + } + if$ +} + + +FUNCTION {format.names} +{ 'bibinfo := + duplicate$ empty$ 'skip$ { + this.to.prev.status + this.status.std + 's := + "" 't := + #1 'nameptr := + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { s nameptr + name.format.string + format.name$ + bibinfo bibinfo.check + 't := + nameptr #1 > + { nameptr num.names.shown.with.forced.et.al #1 + = + numnames max.num.names.before.forced.et.al > + is.forced.et.al and and + { "others" 't := + #1 'namesleft := + } + { skip$ } + if$ + namesleft #1 > + { ", " * t do.name.latex.cmd * } + { + numnames #2 > + { "," * } + 'skip$ + if$ + s nameptr "{ll}" format.name$ duplicate$ "others" = + { 't := } + { pop$ } + if$ + t "others" = + { + " " * bbl.etal emphasize * + } + { + bbl.and + space.word * t do.name.latex.cmd * + } + if$ + } + if$ + } + { t do.name.latex.cmd } + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ + cap.status.std + } if$ +} + + + + +%% Higher Level Formats + +%% addresses/locations + +FUNCTION {format.address} +{ address duplicate$ empty$ 'skip$ + { this.to.prev.status + this.status.std + cap.status.std + } + if$ +} + + + +%% author/editor names + +FUNCTION {format.authors}{ author "author" format.names } + +FUNCTION {format.editors} +{ editor "editor" format.names duplicate$ empty$ 'skip$ + { ", " * + get.bbl.editor + capitalize + * + } + if$ +} + + + +%% date + +FUNCTION {format.date} +{ + month "month" bibinfo.check duplicate$ empty$ + year "year" bibinfo.check duplicate$ empty$ + { swap$ 'skip$ + { this.to.prev.status + this.status.std + cap.status.std + "there's a month but no year in " cite$ * warning$ } + if$ + * + } + { this.to.prev.status + this.status.std + cap.status.std + swap$ 'skip$ + { + swap$ + " " * swap$ + } + if$ + * + } + if$ +} + +FUNCTION {format.date.electronic} +{ month "month" bibinfo.check duplicate$ empty$ + year "year" bibinfo.check duplicate$ empty$ + { swap$ + { pop$ } + { "there's a month but no year in " cite$ * warning$ + pop$ ")" * "(" swap$ * + this.to.prev.status + punct.no 'this.status.punct := + space.normal 'this.status.space := + quote.no 'this.status.quote := + cap.yes 'status.cap := + } + if$ + } + { swap$ + { swap$ pop$ ")" * "(" swap$ * } + { "(" swap$ * ", " * swap$ * ")" * } + if$ + this.to.prev.status + punct.no 'this.status.punct := + space.normal 'this.status.space := + quote.no 'this.status.quote := + cap.yes 'status.cap := + } + if$ +} + + + +%% edition/title + +% Note: IEEE considers the edition to be closely associated with +% the title of a book. So, in IEEEtran.bst the edition is normally handled +% within the formatting of the title. The format.edition function is +% retained here for possible future use. +FUNCTION {format.edition} +{ edition duplicate$ empty$ 'skip$ + { this.to.prev.status + this.status.std + convert.edition + status.cap + { "t" } + { "l" } + if$ change.case$ + "edition" bibinfo.check + "~" * bbl.edition * + cap.status.std + } + if$ +} + +% This is used to format the booktitle of a conference proceedings. +% Here we use the "intype" field to provide the user a way to +% override the word "in" (e.g., with things like "presented at") +% Use of intype stops the emphasis of the booktitle to indicate that +% we no longer mean the written conference proceedings, but the +% conference itself. +FUNCTION {format.in.booktitle} +{ booktitle "booktitle" bibinfo.check duplicate$ empty$ 'skip$ + { this.to.prev.status + this.status.std + select.language + intype missing$ + { emphasize + bbl.in " " * + } + { intype " " * } + if$ + swap$ * + cap.status.std + } + if$ +} + +% This is used to format the booktitle of collection. +% Here the "intype" field is not supported, but "edition" is. +FUNCTION {format.in.booktitle.edition} +{ booktitle "booktitle" bibinfo.check duplicate$ empty$ 'skip$ + { this.to.prev.status + this.status.std + select.language + emphasize + edition empty$ 'skip$ + { ", " * + edition + convert.edition + "l" change.case$ + * "~" * bbl.edition * + } + if$ + bbl.in " " * swap$ * + cap.status.std + } + if$ +} + +FUNCTION {format.article.title} +{ title duplicate$ empty$ 'skip$ + { this.to.prev.status + this.status.std + "t" change.case$ + } + if$ + "title" bibinfo.check + duplicate$ empty$ 'skip$ + { quote.close 'this.status.quote := + is.last.char.not.punct + { punct.std 'this.status.punct := } + { punct.no 'this.status.punct := } + if$ + select.language + "``" swap$ * + cap.status.std + } + if$ +} + +FUNCTION {format.article.title.electronic} +{ title duplicate$ empty$ 'skip$ + { this.to.prev.status + this.status.std + cap.status.std + "t" change.case$ + } + if$ + "title" bibinfo.check + duplicate$ empty$ + { skip$ } + { select.language } + if$ +} + +FUNCTION {format.book.title.edition} +{ title "title" bibinfo.check + duplicate$ empty$ + { "empty title in " cite$ * warning$ } + { this.to.prev.status + this.status.std + select.language + emphasize + edition empty$ 'skip$ + { ", " * + edition + convert.edition + status.cap + { "t" } + { "l" } + if$ + change.case$ + * "~" * bbl.edition * + } + if$ + cap.status.std + } + if$ +} + +FUNCTION {format.book.title} +{ title "title" bibinfo.check + duplicate$ empty$ 'skip$ + { this.to.prev.status + this.status.std + cap.status.std + select.language + emphasize + } + if$ +} + + + +%% journal + +FUNCTION {format.journal} +{ journal duplicate$ empty$ 'skip$ + { this.to.prev.status + this.status.std + cap.status.std + select.language + emphasize + } + if$ +} + + + +%% how published + +FUNCTION {format.howpublished} +{ howpublished duplicate$ empty$ 'skip$ + { this.to.prev.status + this.status.std + cap.status.std + } + if$ +} + + + +%% institutions/organization/publishers/school + +FUNCTION {format.institution} +{ institution duplicate$ empty$ 'skip$ + { this.to.prev.status + this.status.std + cap.status.std + } + if$ +} + +FUNCTION {format.organization} +{ organization duplicate$ empty$ 'skip$ + { this.to.prev.status + this.status.std + cap.status.std + } + if$ +} + +FUNCTION {format.address.publisher.date} +{ publisher "publisher" bibinfo.warn format.address.org.or.pub.date } + +FUNCTION {format.address.publisher.date.nowarn} +{ publisher "publisher" bibinfo.check format.address.org.or.pub.date } + +FUNCTION {format.address.organization.date} +{ organization "organization" bibinfo.check format.address.org.or.pub.date } + +FUNCTION {format.school} +{ school duplicate$ empty$ 'skip$ + { this.to.prev.status + this.status.std + cap.status.std + } + if$ +} + + + +%% volume/number/series/chapter/pages + +FUNCTION {format.volume} +{ volume empty.field.to.null.string + duplicate$ empty$ 'skip$ + { this.to.prev.status + this.status.std + bbl.volume + status.cap + { capitalize } + { skip$ } + if$ + swap$ tie.or.space.prefix + "volume" bibinfo.check + * * + cap.status.std + } + if$ +} + +FUNCTION {format.number} +{ number empty.field.to.null.string + duplicate$ empty$ 'skip$ + { this.to.prev.status + this.status.std + status.cap + { bbl.number capitalize } + { bbl.number } + if$ + swap$ tie.or.space.prefix + "number" bibinfo.check + * * + cap.status.std + } + if$ +} + +FUNCTION {format.number.if.use.for.article} +{ is.use.number.for.article + { format.number } + { "" } + if$ +} + +% IEEE does not seem to tie the series so closely with the volume +% and number as is done in other bibliography styles. Instead the +% series is treated somewhat like an extension of the title. +FUNCTION {format.series} +{ series empty$ + { "" } + { this.to.prev.status + this.status.std + bbl.series " " * + series "series" bibinfo.check * + cap.status.std + } + if$ +} + + +FUNCTION {format.chapter} +{ chapter empty$ + { "" } + { this.to.prev.status + this.status.std + type empty$ + { bbl.chapter } + { type "l" change.case$ + "type" bibinfo.check + } + if$ + chapter tie.or.space.prefix + "chapter" bibinfo.check + * * + cap.status.std + } + if$ +} + + +% The intended use of format.paper is for paper numbers of inproceedings. +% The paper type can be overridden via the type field. +% We allow the type to be displayed even if the paper number is absent +% for things like "postdeadline paper" +FUNCTION {format.paper} +{ is.use.paper + { paper empty$ + { type empty$ + { "" } + { this.to.prev.status + this.status.std + type "type" bibinfo.check + cap.status.std + } + if$ + } + { this.to.prev.status + this.status.std + type empty$ + { bbl.paper } + { type "type" bibinfo.check } + if$ + " " * paper + "paper" bibinfo.check + * + cap.status.std + } + if$ + } + { "" } + if$ +} + + +FUNCTION {format.pages} +{ pages duplicate$ empty$ 'skip$ + { this.to.prev.status + this.status.std + duplicate$ is.multiple.pages + { + bbl.pages swap$ + n.dashify + } + { + bbl.page swap$ + } + if$ + tie.or.space.prefix + "pages" bibinfo.check + * * + cap.status.std + } + if$ +} + + + +%% technical report number + +FUNCTION {format.tech.report.number} +{ number "number" bibinfo.check + type duplicate$ empty$ + { pop$ + this.to.prev.status + this.status.std + cap.status.std + bbl.techrep + } + { skip$ } + if$ + "type" bibinfo.check + swap$ duplicate$ empty$ + { pop$ } + { this.to.prev.status + this.status.std + cap.status.std + tie.or.space.prefix * * } + if$ +} + + + +%% note + +FUNCTION {format.note} +{ note empty$ + { "" } + { this.to.prev.status + this.status.std + punct.period 'this.status.punct := + note #1 #1 substring$ + duplicate$ "{" = + { skip$ } + { status.cap + { "u" } + { "l" } + if$ + change.case$ + } + if$ + note #2 global.max$ substring$ * "note" bibinfo.check + cap.yes 'status.cap := + } + if$ +} + + + +%% patent + +FUNCTION {format.patent.date} +{ this.to.prev.status + this.status.std + year empty$ + { monthfiled duplicate$ empty$ + { "monthfiled" bibinfo.check pop$ "" } + { "monthfiled" bibinfo.check } + if$ + dayfiled duplicate$ empty$ + { "dayfiled" bibinfo.check pop$ "" * } + { "dayfiled" bibinfo.check + monthfiled empty$ + { "dayfiled without a monthfiled in " cite$ * warning$ + * + } + { " " swap$ * * } + if$ + } + if$ + yearfiled empty$ + { "no year or yearfiled in " cite$ * warning$ } + { yearfiled "yearfiled" bibinfo.check + swap$ + duplicate$ empty$ + { pop$ } + { ", " * swap$ * } + if$ + } + if$ + } + { month duplicate$ empty$ + { "month" bibinfo.check pop$ "" } + { "month" bibinfo.check } + if$ + day duplicate$ empty$ + { "day" bibinfo.check pop$ "" * } + { "day" bibinfo.check + month empty$ + { "day without a month in " cite$ * warning$ + * + } + { " " swap$ * * } + if$ + } + if$ + year "year" bibinfo.check + swap$ + duplicate$ empty$ + { pop$ } + { ", " * swap$ * } + if$ + } + if$ + cap.status.std +} + +FUNCTION {format.patent.nationality.type.number} +{ this.to.prev.status + this.status.std + nationality duplicate$ empty$ + { "nationality" bibinfo.warn pop$ "" } + { "nationality" bibinfo.check + duplicate$ "l" change.case$ "united states" = + { pop$ bbl.patentUS } + { skip$ } + if$ + " " * + } + if$ + type empty$ + { bbl.patent "type" bibinfo.check } + { type "type" bibinfo.check } + if$ + * + number duplicate$ empty$ + { "number" bibinfo.warn pop$ } + { "number" bibinfo.check + large.number.separate + swap$ " " * swap$ * + } + if$ + cap.status.std +} + + + +%% standard + +FUNCTION {format.organization.institution.standard.type.number} +{ this.to.prev.status + this.status.std + organization duplicate$ empty$ + { pop$ + institution duplicate$ empty$ + { "institution" bibinfo.warn } + { "institution" bibinfo.warn " " * } + if$ + } + { "organization" bibinfo.warn " " * } + if$ + type empty$ + { bbl.standard "type" bibinfo.check } + { type "type" bibinfo.check } + if$ + * + number duplicate$ empty$ + { "number" bibinfo.check pop$ } + { "number" bibinfo.check + large.number.separate + swap$ " " * swap$ * + } + if$ + cap.status.std +} + +FUNCTION {format.revision} +{ revision empty$ + { "" } + { this.to.prev.status + this.status.std + bbl.revision + revision tie.or.space.prefix + "revision" bibinfo.check + * * + cap.status.std + } + if$ +} + + +%% thesis + +FUNCTION {format.master.thesis.type} +{ this.to.prev.status + this.status.std + type empty$ + { + bbl.mthesis + } + { + type "type" bibinfo.check + } + if$ +cap.status.std +} + +FUNCTION {format.phd.thesis.type} +{ this.to.prev.status + this.status.std + type empty$ + { + bbl.phdthesis + } + { + type "type" bibinfo.check + } + if$ +cap.status.std +} + + + +%% URL + +FUNCTION {format.url} +{ url empty$ + { "" } + { this.to.prev.status + this.status.std + cap.yes 'status.cap := + bbl.urlprefix " " * + "\url{" * url * "}" * + punct.no 'this.status.punct := + punct.period 'prev.status.punct := + space.normal 'this.status.space := + space.normal 'prev.status.space := + quote.no 'this.status.quote := + } + if$ +} + + + + +%%%%%%%%%%%%%%%%%%%% +%% ENTRY HANDLERS %% +%%%%%%%%%%%%%%%%%%%% + + +% Note: In many journals, IEEE (or the authors) tend not to show the number +% for articles, so the display of the number is controlled here by the +% switch "is.use.number.for.article" +FUNCTION {article} +{ std.status.using.comma + start.entry + if.url.alt.interword.spacing + format.authors "author" output.warn + name.or.dash + format.article.title "title" output.warn + format.journal "journal" bibinfo.check "journal" output.warn + format.volume output + format.number.if.use.for.article output + format.pages output + format.date "year" output.warn + format.note output + format.url output + fin.entry + if.url.std.interword.spacing +} + +FUNCTION {book} +{ std.status.using.comma + start.entry + if.url.alt.interword.spacing + author empty$ + { format.editors "author and editor" output.warn } + { format.authors output.nonnull } + if$ + name.or.dash + format.book.title.edition output + format.series output + author empty$ + { skip$ } + { format.editors output } + if$ + format.address.publisher.date output + format.volume output + format.number output + format.note output + format.url output + fin.entry + if.url.std.interword.spacing +} + +FUNCTION {booklet} +{ std.status.using.comma + start.entry + if.url.alt.interword.spacing + format.authors output + name.or.dash + format.article.title "title" output.warn + format.howpublished "howpublished" bibinfo.check output + format.organization "organization" bibinfo.check output + format.address "address" bibinfo.check output + format.date output + format.note output + format.url output + fin.entry + if.url.std.interword.spacing +} + +FUNCTION {electronic} +{ std.status.using.period + start.entry + if.url.alt.interword.spacing + format.authors output + name.or.dash + format.date.electronic output + format.article.title.electronic output + format.howpublished "howpublished" bibinfo.check output + format.organization "organization" bibinfo.check output + format.address "address" bibinfo.check output + format.note output + format.url output + fin.entry + empty.entry.warn + if.url.std.interword.spacing +} + +FUNCTION {inbook} +{ std.status.using.comma + start.entry + if.url.alt.interword.spacing + author empty$ + { format.editors "author and editor" output.warn } + { format.authors output.nonnull } + if$ + name.or.dash + format.book.title.edition output + format.series output + format.address.publisher.date output + format.volume output + format.number output + format.chapter output + format.pages output + format.note output + format.url output + fin.entry + if.url.std.interword.spacing +} + +FUNCTION {incollection} +{ std.status.using.comma + start.entry + if.url.alt.interword.spacing + format.authors "author" output.warn + name.or.dash + format.article.title "title" output.warn + format.in.booktitle.edition "booktitle" output.warn + format.series output + format.editors output + format.address.publisher.date.nowarn output + format.volume output + format.number output + format.chapter output + format.pages output + format.note output + format.url output + fin.entry + if.url.std.interword.spacing +} + +FUNCTION {inproceedings} +{ std.status.using.comma + start.entry + if.url.alt.interword.spacing + format.authors "author" output.warn + name.or.dash + format.article.title "title" output.warn + format.in.booktitle "booktitle" output.warn + format.series output + format.editors output + format.volume output + format.number output + publisher empty$ + { format.address.organization.date output } + { format.organization "organization" bibinfo.check output + format.address.publisher.date output + } + if$ + format.paper output + format.pages output + format.note output + format.url output + fin.entry + if.url.std.interword.spacing +} + +FUNCTION {manual} +{ std.status.using.comma + start.entry + if.url.alt.interword.spacing + format.authors output + name.or.dash + format.book.title.edition "title" output.warn + format.howpublished "howpublished" bibinfo.check output + format.organization "organization" bibinfo.check output + format.address "address" bibinfo.check output + format.date output + format.note output + format.url output + fin.entry + if.url.std.interword.spacing +} + +FUNCTION {mastersthesis} +{ std.status.using.comma + start.entry + if.url.alt.interword.spacing + format.authors "author" output.warn + name.or.dash + format.article.title "title" output.warn + format.master.thesis.type output.nonnull + format.school "school" bibinfo.warn output + format.address "address" bibinfo.check output + format.date "year" output.warn + format.note output + format.url output + fin.entry + if.url.std.interword.spacing +} + +FUNCTION {misc} +{ std.status.using.comma + start.entry + if.url.alt.interword.spacing + format.authors output + name.or.dash + format.article.title output + format.howpublished "howpublished" bibinfo.check output + format.organization "organization" bibinfo.check output + format.address "address" bibinfo.check output + format.pages output + format.date output + format.note output + format.url output + fin.entry + empty.entry.warn + if.url.std.interword.spacing +} + +FUNCTION {patent} +{ std.status.using.comma + start.entry + if.url.alt.interword.spacing + format.authors output + name.or.dash + format.article.title output + format.patent.nationality.type.number output + format.patent.date output + format.note output + format.url output + fin.entry + empty.entry.warn + if.url.std.interword.spacing +} + +FUNCTION {periodical} +{ std.status.using.comma + start.entry + if.url.alt.interword.spacing + format.editors output + name.or.dash + format.book.title "title" output.warn + format.series output + format.volume output + format.number output + format.organization "organization" bibinfo.check output + format.date "year" output.warn + format.note output + format.url output + fin.entry + if.url.std.interword.spacing +} + +FUNCTION {phdthesis} +{ std.status.using.comma + start.entry + if.url.alt.interword.spacing + format.authors "author" output.warn + name.or.dash + format.article.title "title" output.warn + format.phd.thesis.type output.nonnull + format.school "school" bibinfo.warn output + format.address "address" bibinfo.check output + format.date "year" output.warn + format.note output + format.url output + fin.entry + if.url.std.interword.spacing +} + +FUNCTION {proceedings} +{ std.status.using.comma + start.entry + if.url.alt.interword.spacing + format.editors output + name.or.dash + format.book.title "title" output.warn + format.series output + format.volume output + format.number output + publisher empty$ + { format.address.organization.date output } + { format.organization "organization" bibinfo.check output + format.address.publisher.date output + } + if$ + format.note output + format.url output + fin.entry + if.url.std.interword.spacing +} + +FUNCTION {standard} +{ std.status.using.comma + start.entry + if.url.alt.interword.spacing + format.authors output + name.or.dash + format.book.title "title" output.warn + format.howpublished "howpublished" bibinfo.check output + format.organization.institution.standard.type.number output + format.revision output + format.date output + format.note output + format.url output + fin.entry + if.url.std.interword.spacing +} + +FUNCTION {techreport} +{ std.status.using.comma + start.entry + if.url.alt.interword.spacing + format.authors "author" output.warn + name.or.dash + format.article.title "title" output.warn + format.howpublished "howpublished" bibinfo.check output + format.institution "institution" bibinfo.warn output + format.address "address" bibinfo.check output + format.tech.report.number output.nonnull + format.date "year" output.warn + format.note output + format.url output + fin.entry + if.url.std.interword.spacing +} + +FUNCTION {unpublished} +{ std.status.using.comma + start.entry + if.url.alt.interword.spacing + format.authors "author" output.warn + name.or.dash + format.article.title "title" output.warn + format.date output + format.note "note" output.warn + format.url output + fin.entry + if.url.std.interword.spacing +} + + +% The special entry type which provides the user interface to the +% BST controls +FUNCTION {IEEEtranBSTCTL} +{ is.print.banners.to.terminal + { "** IEEEtran BST control entry " quote$ * cite$ * quote$ * " detected." * + top$ + } + { skip$ } + if$ + CTLuse_article_number + empty$ + { skip$ } + { CTLuse_article_number + yes.no.to.int + 'is.use.number.for.article := + } + if$ + CTLuse_paper + empty$ + { skip$ } + { CTLuse_paper + yes.no.to.int + 'is.use.paper := + } + if$ + CTLuse_forced_etal + empty$ + { skip$ } + { CTLuse_forced_etal + yes.no.to.int + 'is.forced.et.al := + } + if$ + CTLmax_names_forced_etal + empty$ + { skip$ } + { CTLmax_names_forced_etal + string.to.integer + 'max.num.names.before.forced.et.al := + } + if$ + CTLnames_show_etal + empty$ + { skip$ } + { CTLnames_show_etal + string.to.integer + 'num.names.shown.with.forced.et.al := + } + if$ + CTLuse_alt_spacing + empty$ + { skip$ } + { CTLuse_alt_spacing + yes.no.to.int + 'is.use.alt.interword.spacing := + } + if$ + CTLalt_stretch_factor + empty$ + { skip$ } + { CTLalt_stretch_factor + 'ALTinterwordstretchfactor := + "\renewcommand\BIBentryALTinterwordstretchfactor{" + ALTinterwordstretchfactor * "}" * + write$ newline$ + } + if$ + CTLdash_repeated_names + empty$ + { skip$ } + { CTLdash_repeated_names + yes.no.to.int + 'is.dash.repeated.names := + } + if$ + CTLname_format_string + empty$ + { skip$ } + { CTLname_format_string + 'name.format.string := + } + if$ + CTLname_latex_cmd + empty$ + { skip$ } + { CTLname_latex_cmd + 'name.latex.cmd := + } + if$ + + + num.names.shown.with.forced.et.al max.num.names.before.forced.et.al > + { "CTLnames_show_etal cannot be greater than CTLmax_names_forced_etal in " cite$ * warning$ + max.num.names.before.forced.et.al 'num.names.shown.with.forced.et.al := + } + { skip$ } + if$ +} + + +%%%%%%%%%%%%%%%%%%% +%% ENTRY ALIASES %% +%%%%%%%%%%%%%%%%%%% +FUNCTION {conference}{inproceedings} +FUNCTION {online}{electronic} +FUNCTION {internet}{electronic} +FUNCTION {webpage}{electronic} +FUNCTION {default.type}{misc} + + + +%%%%%%%%%%%%%%%%%% +%% MAIN PROGRAM %% +%%%%%%%%%%%%%%%%%% + +READ + +EXECUTE {initialize.controls} +EXECUTE {initialize.status.constants} +EXECUTE {banner.message} + +EXECUTE {initialize.longest.label} +ITERATE {longest.label.pass} + +EXECUTE {begin.bib} +ITERATE {call.type$} +EXECUTE {end.bib} + +EXECUTE{completed.message} + + +%% That's all folks, mds. diff --git a/documentation/OVERLEAF_IMPORT.txt b/documentation/OVERLEAF_IMPORT.txt new file mode 100644 index 0000000..f4bb05a --- /dev/null +++ b/documentation/OVERLEAF_IMPORT.txt @@ -0,0 +1,11 @@ +OVERLEAF IMPORT INSTRUCTIONS + +1. Upload the complete ZIP as a new Overleaf project. +2. Open Menu -> Settings -> Main document. +3. Select the top-level file main.tex. +4. Select the pdfLaTeX compiler and click Recompile. + +Do not select devopsLatexDocker.tex as the Main document. It is Chapter 7 and +is included automatically by the complete report. The Docker demonstration +source is latex-docker/sample-source.txt, so main.tex is the only .tex file +that declares a document class and is the authoritative report entry point. diff --git a/documentation/abstract.tex b/documentation/abstract.tex new file mode 100644 index 0000000..069fda4 --- /dev/null +++ b/documentation/abstract.tex @@ -0,0 +1,14 @@ +This group report documents the team's SSW 590 DevOps work in an Ubuntu +environment hosted on DigitalOcean. It records the Linux command-line exercises +and the creation of a DigitalOcean Droplet, installation of Docker Engine, and +deployment workflow for two containerized Node.js websites. Commands, evidence, +and deployment links are included. The report also presents a class-based +JavaScript redesign with a UML class diagram and a separate TeX Live container +that compiles a simple LaTeX document. It concludes with the MyFileAgent Pipeline +proposal, which emphasizes a one-click DevSecOps workflow for installation, +configuration, building, testing, deployment, security checks, and Grafana +monitoring. A limited LLM file-replacement task serves only as the sample +workload. Credentials, private keys, and other secrets are intentionally +excluded. The report also records the completed MyFileAgent Gitea startup +foundation: SQLite persistence, team workflow, the \texttt{myfileagent.tech} +domain, Caddy-managed HTTPS, and verified firewall boundaries. diff --git a/documentation/ci/build_manual.py b/documentation/ci/build_manual.py new file mode 100644 index 0000000..084b3c4 --- /dev/null +++ b/documentation/ci/build_manual.py @@ -0,0 +1,123 @@ +#!/usr/bin/env python3 +"""Build the manual in a fresh workspace; publish a PDF only after success. + +Requires the recorded CI image to supply latexmk, TeX Live, minted support, +BibTeX, makeindex, and pypdf. Run from a checked-out repository. +""" +import argparse +import hashlib +import json +import os +from pathlib import Path +import re +import shutil +import subprocess +import tempfile + + +def build_metadata(sha, run_number, run_id, attempt): + if not re.fullmatch(r"[0-9a-f]{40}|[0-9a-f]{64}", sha): + raise ValueError("A full lowercase Git commit hash is required") + for name, value in (("run number", run_number), ("run ID", run_id), ("attempt", attempt)): + if not re.fullmatch(r"[1-9][0-9]*", value): + raise ValueError(f"Invalid {name}: a positive integer is required") + short = sha[:7] + suffix = f"+build.{run_number}.{short}.attempt.{attempt}" + url = f"https://myfileagent.tech/myfileagent/myfileagent-pipeline/actions/runs/{run_id}" + return { + "commit": sha, "run_number": run_number, "run_id": run_id, + "attempt": attempt, "suffix": suffix, "run_url": url, + } + + +def latex_metadata(metadata): + # All interpolated fields were validated above or use a fixed trusted URL. + fields = { + "BuildSuffix": metadata["suffix"], + "BuildCommit": metadata["commit"], + "BuildRun": metadata["run_number"], + "BuildRunURL": metadata["run_url"], + } + return "% Generated in the build workspace. Do not commit.\n" + "".join( + f"\\renewcommand{{\\{key}}}{{{value}}}\n" for key, value in fields.items() + ) + + +def copy_sources(source, destination): + extensions = {".tex", ".cls", ".sty", ".bst", ".bib", ".png", ".jpg", ".jpeg", ".svg", ".txt"} + excluded = {".git", "_minted", "build", "output", "outputs", "__pycache__", "node_modules"} + for path in source.rglob("*"): + relative = path.relative_to(source) + if any(part in excluded or part.startswith("_minted-") for part in relative.parts): + continue + if path.is_symlink(): + raise ValueError(f"Unexpected source symlink: {relative}") + if path.is_file() and path.suffix.lower() in extensions and path.name != "build-metadata.tex": + target = destination / relative + target.parent.mkdir(parents=True, exist_ok=True) + shutil.copy2(path, target) + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--sha", default=os.environ.get("GITEA_SHA", "")) + parser.add_argument("--run-number", default=os.environ.get("GITEA_RUN_NUMBER", "")) + parser.add_argument("--run-id", default=os.environ.get("GITEA_RUN_ID", "")) + parser.add_argument("--attempt", default=os.environ.get("GITEA_RUN_ATTEMPT", "1")) + args = parser.parse_args() + metadata = build_metadata(args.sha, args.run_number, args.run_id, args.attempt) + source = Path(__file__).resolve().parents[1] + revision = subprocess.check_output(["git", "-C", str(source), "rev-parse", "HEAD"], text=True).strip() + if revision != metadata["commit"]: + raise ValueError("Checked-out HEAD differs from the triggering commit") + version_match = re.search(r"\\newcommand\{\\DocumentVersion\}\{([^}]+)\}", (source / "main.tex").read_text()) + if not version_match: + raise ValueError("Human-maintained document version is missing") + metadata["document_version"] = version_match.group(1) + output = source / "build" + output.mkdir(exist_ok=True) + # Remove only this build's known publish targets, so a failed rebuild cannot + # leave an older PDF available for upload. + for name in ("main.pdf", "build-manifest.json"): + (output / name).unlink(missing_ok=True) + with tempfile.TemporaryDirectory(prefix="manual-ci-") as temp: + workspace = Path(temp) + copy_sources(source, workspace) + (workspace / "build-metadata.tex").write_text(latex_metadata(metadata), encoding="utf-8") + # Shell escape is needed by the current minted source. Run only trusted + # team source in the isolated job, with no host/Docker socket mounts. + command = ["latexmk", "-pdf", "-shell-escape", "-interaction=nonstopmode", "-halt-on-error", "-file-line-error", "main.tex"] + try: + result = subprocess.run(command, cwd=workspace, check=False) + log_path = workspace / "main.log" + if log_path.exists(): + shutil.copy2(log_path, output / "main.log") + if result.returncode: + raise RuntimeError(f"LaTeX compilation failed (exit {result.returncode})") + pdf = workspace / "main.pdf" + if not pdf.is_file() or pdf.stat().st_size == 0: + raise RuntimeError("Compilation did not create a nonempty main.pdf") + from pypdf import PdfReader + reader = PdfReader(pdf) + if not reader.pages: + raise RuntimeError("Generated PDF has no pages") + text = "\n".join(page.extract_text() or "" for page in reader.pages[:5]) + for expected in (metadata["suffix"], metadata["commit"]): + if expected not in text: + raise RuntimeError(f"Visible PDF build identity is missing: {expected}") + if log_path.exists(): + log = log_path.read_text(errors="replace") + if re.search(r"There were undefined (references|citations)|There were multiply-defined labels", log): + raise RuntimeError("Unresolved references/citations or duplicate labels in PDF") + metadata["pdf_sha256"] = hashlib.sha256(pdf.read_bytes()).hexdigest() + metadata["pages"] = len(reader.pages) + shutil.copy2(pdf, output / "main.pdf") + (output / "build-manifest.json").write_text(json.dumps(metadata, indent=2) + "\n", encoding="utf-8") + finally: + # A compiler failure must never be hidden by artifact publication. + pass + print(json.dumps(metadata, indent=2)) + + +if __name__ == "__main__": + main() diff --git a/documentation/color-buttons-app/Dockerfile b/documentation/color-buttons-app/Dockerfile new file mode 100644 index 0000000..2bb2ad5 --- /dev/null +++ b/documentation/color-buttons-app/Dockerfile @@ -0,0 +1,12 @@ +FROM node:20-alpine + +WORKDIR /app + +COPY package*.json ./ +RUN npm install --omit=dev + +COPY . . + +EXPOSE 3000 + +CMD ["npm", "start"] diff --git a/documentation/color-buttons-app/package.json b/documentation/color-buttons-app/package.json new file mode 100644 index 0000000..a639e6b --- /dev/null +++ b/documentation/color-buttons-app/package.json @@ -0,0 +1,12 @@ +{ + "name": "color-buttons-app", + "version": "1.0.0", + "type": "module", + "main": "server.js", + "scripts": { + "start": "node server.js" + }, + "dependencies": { + "express": "^4.18.2" + } +} diff --git a/documentation/color-buttons-app/public/index.html b/documentation/color-buttons-app/public/index.html new file mode 100644 index 0000000..20f232b --- /dev/null +++ b/documentation/color-buttons-app/public/index.html @@ -0,0 +1,28 @@ + + + + + + Color Buttons App + + + +

Click a Button to Change Background

+ + + + + diff --git a/documentation/color-buttons-app/public/script.js b/documentation/color-buttons-app/public/script.js new file mode 100644 index 0000000..761af79 --- /dev/null +++ b/documentation/color-buttons-app/public/script.js @@ -0,0 +1,20 @@ +class ColorButtonController { + constructor(buttonId, color) { + this.button = document.getElementById(buttonId); + this.color = color; + } + + changeBackground() { + document.body.style.backgroundColor = this.color; + } + + bind() { + this.button.addEventListener("click", () => this.changeBackground()); + } +} + +const blueButton = new ColorButtonController("blueBtn", "blue"); +const redButton = new ColorButtonController("redBtn", "red"); + +blueButton.bind(); +redButton.bind(); diff --git a/documentation/color-buttons-app/server.js b/documentation/color-buttons-app/server.js new file mode 100644 index 0000000..3c9e46e --- /dev/null +++ b/documentation/color-buttons-app/server.js @@ -0,0 +1,14 @@ +import express from "express"; +import path from "path"; +import { fileURLToPath } from "url"; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); +const app = express(); +const PORT = process.env.PORT || 3000; + +app.use(express.static(path.join(__dirname, "public"))); + +app.listen(PORT, "0.0.0.0", () => { + console.log(`Server running at http://0.0.0.0:${PORT}`); +}); diff --git a/documentation/cornell.cls b/documentation/cornell.cls new file mode 100644 index 0000000..79b37eb --- /dev/null +++ b/documentation/cornell.cls @@ -0,0 +1,367 @@ +%% +%% This is file `cornell.cls', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% cornell.dtx (with options: `class') +%% +%% IMPORTANT NOTICE: +%% +%% For the copyright see the source file. +%% +%% Any modified versions of this file must be renamed +%% with new filenames distinct from cornell.cls. +%% +%% For distribution of the original source see the terms +%% for copying and modification in the file cornell.dtx. +%% +%% This generated file may be distributed as long as the +%% original source files, as listed above, are part of the +%% same distribution. (The sources need not necessarily be +%% in the same archive or directory.) +%% Document class `cornell' to use with LaTeX 2e. +%% Based on `crnlphd' class. The following is from the file `crnlphd.dtx': +%% Based loosely on old cuphdthesis style file. +%% Found to give good results, according to the thesis secretary. +%% File: crnlphd.dtx Copyright (C) 1994 Sergio Gelato +%% Made available without any warranty, express or implied. +%% Modifications +%% 03/26/98 Mike Heisler +%% Conform to Eric's final version. Margins are subject to +%% The whim of the printer. +%% 10/10/97 Mike Heisler and Eric Dahl +%% Altered footnotesize and changed the Acknowledgement and +%% Biographical titles per thesis secretary guideline that +%% they must match the rest of the document, i.e. flush left +%% and capitalized rather than all caps +%% 05/21/97 Mike Heisler +%% Added a 'papers' option to handle bibliographis as sections +%% at the end of each chapter. Reduced top margin. +%% +%% $Id$ +%% \CharacterTable +%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z +%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z +%% Digits \0\1\2\3\4\5\6\7\8\9 +%% Exclamation \! Double quote \" Hash (number) \# +%% Dollar \$ Percent \% Ampersand \& +%% Acute accent \' Left paren \( Right paren \) +%% Asterisk \* Plus \+ Comma \, +%% Minus \- Point \. Solidus \/ +%% Colon \: Semicolon \; Less than \< +%% Equals \= Greater than \> Question mark \? +%% Commercial at \@ Left bracket \[ Backslash \\ +%% Right bracket \] Circumflex \^ Underscore \_ +%% Grave accent \` Left brace \{ Vertical bar \| +%% Right brace \} Tilde \~} +%% +\NeedsTeXFormat{LaTeX2e}[1995/12/01] +\ProvidesClass{cornell} +[1998/03/26 v2.0 + Cornell University thesis class] +\newif\ifphd +\DeclareOption{phd}{\phdtrue} +\DeclareOption{master}{\phdfalse} +\ExecuteOptions{phd} +\newif\ifpapers +\DeclareOption{papers}{\paperstrue} +\DeclareOption{10pt}{% + \OptionNotUsed% + \ClassWarningNoLine{cornell}{Font size 10pt not allowed; using 12pt}% +} +\DeclareOption{11pt}{% + \OptionNotUsed% + \ClassWarningNoLine{cornell}{Font size 11pt not allowed; using 12pt}% +} +\newcommand{\prelim@contents}[1]{} +\DeclareOption{tocprelim}{% + \renewcommand{\prelim@contents}[1]{\addcontentsline{toc}{section}{#1}} +} +\DeclareOption*{% + \PassOptionsToClass{\CurrentOption}{report}% +} +\ProcessOptions + +\LoadClass[12pt]{report}[1994/06/01] +\renewcommand{\defaultscriptratio}{.75} +\renewcommand{\defaultscriptscriptratio}{.6} +\setlength\headsep{25\p@} +\if@twocolumn +\else + \setlength\oddsidemargin{0in} + \setlength\evensidemargin{0in} + \setlength\textwidth{6.5in} + \setlength\topmargin{-0.5in} + \setlength\headheight{0.2in} + \setlength\headsep{0.35in} + \setlength\textheight{8.85in} + \setlength\footskip{0.5in} + \setlength\marginparwidth{0.85in} + \setlength\marginparsep{0.125in} +\fi +\if@compatibility + \setlength\topmargin{0\p@} +\else +\fi +\newcommand{\ps@cornell}{% +\def\@oddhead{{\slshape\rightmark}\hfil\thepage}% +\def\@oddfoot{}% +\def\@evenhead{\thepage\hfil{\slshape\leftmark}}% +\def\@evenfoot{}% +\def\chaptermark##1{}% +\def\sectionmark##1{}% +} +\newcommand{\ps@cornellc}{% +\def\@oddhead{\hfil\thepage\hfil}% +\def\@oddfoot{}% +\def\@evenhead{\@oddhead}% +\def\@evenfoot{}% +\def\chaptermark##1{}% +\def\sectionmark##1{}% +} +\raggedbottom +\newcommand{\@prolformat}[1]{{\begin{flushleft} \Huge #1 \end{flushleft}} } +\newcommand{\ackname}{\@prolformat{Acknowledgements}} +\newcommand{\bioname}{\@prolformat{Biographical Sketch}} +\renewcommand{\contentsname}{\@prolformat{Table of Contents}} +\renewcommand{\listtablename}{\@prolformat{List of Tables}} +\renewcommand{\listfigurename}{\@prolformat{List of Figures}} +\renewcommand{\l@figure}{\@dottedtocline{1}{1.5em}{2.6em}} +\let\l@table\l@figure + +\renewenvironment{thebibliography}[1] + {\ifpapers \clearpage \section*{\bibname% + \@mkboth{\uppercase{\bibname}}{\uppercase{\bibname}}}% + \else% + \chapter*{\bibname% + \@mkboth{\uppercase{\bibname}}{\uppercase{\bibname}}}% + \fi% + \list{\@biblabel{\arabic{enumiv}}}% + {\settowidth\labelwidth{\@biblabel{#1}}% + \leftmargin\labelwidth + \advance\leftmargin\labelsep + \@openbib@code + \usecounter{enumiv}% + \let\p@enumiv\@empty + \renewcommand\theenumiv{\arabic{enumiv}}}% + \sloppy\clubpenalty4000\widowpenalty4000% + \sfcode`\.\@m\relax + \ifpapers% + \addcontentsline{toc}{section}{\bibname}% + \else% + \addcontentsline{toc}{chapter}{\bibname}% + \fi + \singlespacing} + {\def\@noitemerr + {\@latex@warning{Empty `thebibliography' environment}}% + \normalspacing + \endlist} + +\newcommand{\@titlesize}{\Large} +\newcommand{\@subtitlesize}{\large} +\newcommand{\@authorsize}{\normalsize} % No Pharaoh he. +\newcommand{\@conferralmonth}{January} +\newcommand{\@conferralyear}{} + +\newcommand{\titlesize}[1]{\renewcommand{\@titlesize}{#1}} +\newcommand{\subtitlesize}[1]{\renewcommand{\@subtitlesize}{#1}} +\newcommand{\authorsize}[1]{\renewcommand{\@authorsize}{#1}} +\newcommand{\conferraldate}[2]{% + \renewcommand{\@conferralmonth}{#1} + \renewcommand{\@conferralyear}{#2} +} +\newcommand{\@degreefield}{Master of Science} %CHANGED +\newcommand{\degreefield}[1]{\renewcommand{\@degreefield}{#1}} %CHANGED + +\renewcommand{\maketitle}{% + \begin{titlepage}% + \vspace*{-0.24in} + \begin{center}% + \@titlesize \@title + \end{center} + \vfill + %\begin{center} + %\@subtitlesize + %A \ifphd Dissertation \else Thesis \fi \\ %CHANGED + %Presented to the Faculty of the Graduate School \\ + %of Cornell University \\ + %in Partial Fulfillment of the Requirements for the Degree of \\ + %\ifphd Doctor of Philosophy \else \@degreefield \fi %CHANGED + %\end{center} + \vfill + \begin{center} + \@authorsize + by \\ + \@author \\ + \@conferralmonth\ \@conferralyear + \end{center} + \vspace*{0.26in} + \end{titlepage} +} + +\renewenvironment{titlepage}{% + \typeout{Title page} + \pagestyle{empty} + \doublespacing +}{% + \normalspacing\clearpage +} + + +\newenvironment{copyrightpage}{% + \typeout{Copyleft page} + \pagestyle{empty} + \null\vfil + \begin{center} +}{% + \end{center} + \vfil\null + \clearpage +} + +\newcommand{\makecopyright}{% + \begin{copyrightpage} + \copyright\ \@copyrightholder\ \@copyrightyear \\ + ALL RIGHTS RESERVED \\[.5in] + \end{copyrightpage} +} +\newcommand{\@copyrightholder}{\@author} +\newcommand{\@copyrightyear}{\@conferralyear} + +\newcommand{\copyrightholder}[1]{\renewcommand{\@copyrightholder}{#1}} +\newcommand{\copyrightyear}[1]{\renewcommand{\@copyrightyear}{#1}} + + +\newlength{\@abhdskip} +\renewenvironment{abstract}{% + \typeout{Abstract} + \singlespacing + \ifphd %CHANGED + \setlength{\@abhdskip}{.25in} + \addtolength{\@abhdskip}{-\topmargin} + \vspace*{\@abhdskip} + \begin{center} + \@abstracttitle \\ + \ \\ + \@author \\ + \@conferralyear + \end{center} + \vspace{.25in} + \else %CHANGED + \chapter*{% + \begin{center} + \normalsize + ABSTRACT + \end{center} + } + \par + \fi %CHANGED + \pagestyle{empty} + \thispagestyle{empty} +}{% + \clearpage +} + +\newcommand{\@abstracttitle}{\@title} +\newcommand{\abstracttitle}[1]{\renewcommand{\@abstracttitle}{#1}} + + +\newenvironment{biosketch}{% + \typeout{Vita} + \pagestyle{plain} + \pagenumbering{roman} + \setcounter{page}{3} + \prelim@contents{Biographical Sketch} + \chapter*{% +\bioname + } + \par +}{% + \clearpage +} + +\newenvironment{dedication}{% + \prelim@contents{Dedication} + \null\vfil + \begin{center} +}{ + \end{center} + \vfil\null + \clearpage +} + +\newenvironment{acknowledgements}{% + \prelim@contents{Acknowledgments} + \chapter*{% +\ackname + } + \par +}{% + \cleardoublepage +} + +\newcommand{\contentspage}{% + \singlespacing + \label{toc} + \prelim@contents{\contentsname} + \tableofcontents + \normalspacing + \clearpage +} + +\newcommand{\tablelistpage}{% + \singlespacing + \label{lot} + \prelim@contents{\listtablename} + \listoftables + \normalspacing + \clearpage +} + +\newcommand{\figurelistpage}{% + \singlespacing + \label{lof} + \prelim@contents{\listfigurename} + \listoffigures + \normalspacing + \clearpage +} +\newcommand{\abbrlist}{% + \singlespacing + \prelim@contents{List of Abbreviations} + \chapter*{List of Abbreviations} +} + +\newcommand{\symlist}{% + \singlespacing + \prelim@contents{List of Symbols} + \chapter*{List of Symbols} +} + +\newcommand{\preface}{% + \singlespacing + \prelim@contents{Preface} + \chapter*{Preface} +} + +\newcommand{\singlespacing}{% + \let\CS=\@currsize\renewcommand{\baselinestretch}{1.0}\tiny\CS} +\newcommand{\singlespacingplus}{% + \let\CS=\@currsize\renewcommand{\baselinestretch}{1.25}\tiny\CS} +\newcommand{\doublespacing}{% + \let\CS=\@currsize\renewcommand{\baselinestretch}{1.75}\tiny\CS} +\newcommand{\realdoublespacing}{% + \let\CS=\@currsize\renewcommand{\baselinestretch}{2}\tiny\CS} +\newcommand{\normalspacing}{\doublespacing} +\newcommand{\footnotespacing}{\singlespacing} +\newcommand{\changespacing}[2]{% + \renewcommand{#1}{% + \let\CS=\@currsize\renewcommand{\baselinestretch}{#2}\tiny\CS}% +} +\newcommand{\changenormalspacing}[1]{\renewcommand{\normalspacing}{#1}} +\normalspacing + +\endinput +%% +%% End of file `cornell.cls'. diff --git a/documentation/devopsAIAgentGuide.tex b/documentation/devopsAIAgentGuide.tex new file mode 100644 index 0000000..608fffe --- /dev/null +++ b/documentation/devopsAIAgentGuide.tex @@ -0,0 +1,107 @@ +\chapter{AI Agent Usage Guide} +\ChapterLabel{AIAgentGuide} +\index{AI agent} +\index{AI agent!DevOps workflow} +\index{Appendix!AI Agent Usage Guide} + +\section{How to Use This Appendix} +An AI agent that creates, reviews, or maintains an assignment shall read this +file first. It shall identify the task in the routing table, read the minimum +authoritative sources, and expand context only for a discovered dependency or +inconsistency. This guide is maintained in LaTeX so it is visible, versioned, +and reviewable with the assignment. + +\section{Governing Principles} +The authored LaTeX files, versioned automation, and approved assignment +materials are authoritative. The PDF is a review artifact and shall not be +edited directly. AI may draft, explain, analyze, check consistency, and assist +with builds. It shall not invent completion, evidence, access, costs, grades, +approvals, command output, security posture, or operational results. + +\section{Chapter File Convention} +\index{AI agent!chapter file convention} +Every assignment chapter shall be stored in exactly one file named with the +\texttt{devops} prefix, a PascalCase chapter name, and the \texttt{.tex} +suffix. For example, Chapter~2 is fully contained in +\path{devopsExampleAssignment.tex}. A chapter file shall begin with its +\texttt{\string\chapter\{...\}} command and contain all of that chapter's +sections and subsections. Do not split one chapter across files, create +section-only \texttt{.tex} files, or use \texttt{\string\input} or +\texttt{\string\include} to assemble a chapter from smaller fragments. + +Supporting non-chapter files may use a different name only when they are not +chapter content: \texttt{prologue.tex}, \texttt{abstract.tex}, +\texttt{devopsGlossary.tex}, and \texttt{devopsReferences.bib} are examples. +Appendix chapters follow the same chapter-file convention. + +\section{AI Quick Start} +\begin{enumerate} +\item Read this guide and identify the requested outcome. +\item Select the closest task below and load only its listed sources. +\item Inspect supplied facts and report consequential gaps or assumptions. +\item Make narrowly scoped changes; preserve stable IDs, glossary terms, and history. +\item Never request, print, store, or commit credentials, tokens, personal data, or production data. +\item Build the complete PDF, inspect the log, visually inspect affected pages, and record material AI use in \ChapterRef{AIPromptLog}. +\end{enumerate} + +\section{Task Routing} +\small +\begin{tabularx}{\linewidth}{L{4.0cm}Y} +\caption{AI Task-Routing Table\label{Table:AITaskRouting}}\\ +\toprule \textbf{Task} & \textbf{Minimum authoritative sources}\\ \midrule +Initialize an assignment & \texttt{devopsAssignment.tex}, \texttt{prologue.tex}, \texttt{devopsIntroduction.tex}, \texttt{devopsExampleAssignment.tex}, and the instructor's assignment facts.\\ +Develop a workflow & \texttt{devopsExampleAssignment.tex}, source repository materials, and authorized environment constraints.\\ +Define evidence & \texttt{devopsExampleAssignment.tex} and controlled execution outputs.\\ +Review a retrospective & \texttt{devopsExampleAssignment.tex} and the submitted workflow or runbook.\\ +Edit AI guidance & \texttt{devopsAIAgentGuide.tex}, \texttt{devopsAIPromptLog.tex}, \texttt{devopsDocumentGuide.tex}, and \texttt{devopsAssignment.tex}.\\ +Compile or troubleshoot & \texttt{devopsAssignment.tex}, \texttt{devopsDocumentGuide.tex}, the affected chapter, and the build log.\\ \bottomrule +\end{tabularx} +\normalsize + +\section{DevOps-Specific Rules} +\begin{enumerate} +\item Prefer versioned, repeatable automation over undocumented manual steps. +\item Treat deployment output, monitoring data, and screenshots as evidence only when they reflect an actual execution. +\item Design failure exercises to be isolated, reversible, and authorized. +\item Apply least privilege and never place secrets in LaTeX, source control, prompts, screenshots, or logs. +\item State expected cloud cost, cleanup action, and resource ownership for each remote-environment activity. +\item Identify whether a recommendation is a proposal, an instructor directive, or demonstrated evidence. +\end{enumerate} + +\section{Example AI Requests} +\subsection{Create an Assignment Brief} +\begin{verbatim} +Read devopsAIAgentGuide.tex and use the Initialize an Assignment context. +From the supplied SSW 590 objective and constraints, fill only supported +placeholders in the introduction and activity brief. Propose clear, observable +completion criteria, a safe cleanup action, and a rubric. Do not invent cloud +access, due dates, policy, costs, or approved tools. Update history, compile, +and report instructor decisions still needed. +\end{verbatim} + +\subsection{Review a Student Workflow} +\begin{verbatim} +Read devopsAIAgentGuide.tex and the workflow, evidence, and retrospective +chapters. Review the supplied repository and sanitized evidence for +reproducibility, least privilege, observability, rollback, and cleanup. +Separate verified facts from gaps and recommendations. Do not claim that an +unexecuted command passed, and do not request credentials or operate resources. +\end{verbatim} + +\section{Human Decisions and Information Boundaries} +The instructor retains authority over assignment scope, grading, due dates, +approved tooling, access, budgets, security posture, exceptions, and policy. +An AI agent shall surface alternatives and evidence, not represent a decision +as approved. Record material prompts, assumptions, corrections, and unresolved +issues in \ChapterRef{AIPromptLog}. + +\section{Completion Checklist} +\begin{itemize} +\item Scope, deliverables, environment, constraints, and cleanup are clear. +\item Activity identifiers and evidence references are valid and unique. +\item Examples contain no secrets, personal data, or unsafe production actions. +\item New controlled terms are added to the glossary and indexed. +\item The newest approved change is recorded in document history. +\item The complete build succeeds with no unresolved references or missing files. +\item A human reviews all decisions requiring instructional or operational authority. +\end{itemize} diff --git a/documentation/devopsAIPromptLog.tex b/documentation/devopsAIPromptLog.tex new file mode 100644 index 0000000..db73b90 --- /dev/null +++ b/documentation/devopsAIPromptLog.tex @@ -0,0 +1,39 @@ +\chapter{AI Prompt Log} +\ChapterLabel{AIPromptLog} +\markboth{AI Prompt Log}{AI Prompt Log} +\fancyhead[C]{\small AI Prompt Log} +\index{AI prompt log} + +\section{Recorded Assistance} +\footnotesize +\begin{longtable}{L{2.8cm}L{5.0cm}L{7.0cm}} +\caption{AI assistance record}\label{Table:AIPromptLog}\\ +\toprule +\textbf{Date / Version / Initials} & \textbf{Task} & \textbf{Human Review and Use} \\ +\midrule +\endfirsthead +\toprule +\textbf{Date / Version / Initials} & \textbf{Task} & \textbf{Human Review and Use} \\ +\midrule +\endhead +\bottomrule +\endlastfoot +October 6, 2026\\ 1.7.1\\ GDL, CDX & Continue the user-authorized remote implementation using the supplied source ZIP. & AI performed the live preflight, registered the runner, built the pinned compiler image, diagnosed the initial runner memory limit, and downloaded the successful compatibility artifact. The user supplied the original manual and images. Manual source builds and failure/repair evidence follow separately; final human submission review remains with the team. \\ +October 6, 2026\\ 1.7.1\\ GDL, CDX & Read the instruction PDF and existing manual; prepare the approved Chapter 3 Gitea Actions implementation. & The user clarified Chapter 3, approved implementation, selected Assignment 5/version 1.7.1/October 6, and identified \texttt{hw4\_images}. AI corrected source paths and metadata and prepared build identity and documentation. The original local SSH access is blocked; the user approved a separate remote implementation chat. Build-helper metadata and clean-copy checks passed locally; no runner, remote workflow, successful build, or failure/repair evidence is claimed. \\ +September 29, 2026\\ 1.6.1\\ NK, GDL, CDX & Complete and review the public-domain, HTTPS, evidence, recovery, and reference material for Assignment 4. & The team supplied the domain and renewal facts, verified DNS, HTTPS, certificate automation and external ports, and approved the backup/restore exercise. AI assisted with diagnostics, isolated recovery evidence, requirement auditing, live links, security explanations, concise credential and reference updates, figure-flow improvements, compilation, and visual review. \\ +September 26, 2026\\ 1.6.0\\ NK, GDL, CDX & Implement and document the MyFileAgent Gitea startup foundation while preserving the earlier grading services. & The team selected the accounts, approved changes, completed the repository workflow, ran verification commands, and supplied evidence. With permission, AI assisted with pinned Gitea/SQLite, persistent volumes, key-only SSH, and the Cloud Firewall while preserving ports 5050 and 8080 and documenting the instructor-cleared SSH exception. \\ +September 18, 2026\\ 1.5.1\\ NK, GDL, CDX & Develop and integrate Chapter 8, the Project Proposal, for the MyFileAgent one-click DevSecOps pipeline. & The team supplied the project direction and selected tools. AI assisted with organizing the proposal, defining a limited demonstration task, and presenting the planned installation, build, configuration, testing, deployment, security, and Grafana monitoring workflow. The team reviews and approves the final proposal. \\ +September 18, 2026\\ 1.5.0\\ NK, GDL, CDX & Document the DigitalOcean Droplet and Docker installation, website deployment, class-based JavaScript button design and UML diagram in Chapter 6, and the TeX Live Docker build, run, and verification workflow in Chapter 7. & The team supplied the requirements, deployment evidence, commands, and project files. AI assisted with LaTeX organization, code presentation, UML preparation, compilation, and layout review. The team reviews the material and verifies all commands and live deployment results. \\ \pagebreak +September 12, 2026\\ 1.4.1\\ NK, GDL, CDX & Update Section 3.2 with the human-run command outputs, include Hosts and Passwords, reduce and link the glossary, and verify index links. & AI suggested Linux commands to run and assisted with document organization and LaTeX editing. The team verified the commands before running them, made changes as needed, ran the commands, and gathered the outputs. AI did not execute the commands or produce the recorded terminal outputs. \\ +September 11, 2026\\ 1.4.0\\ NK, GDL, CDX & Organize the Assignment 2 LaTeX report, integrate the supplied Linux-command chapter and problem-set chapter, and verify document layout and navigation. & The team supplied the assignment materials and terminal record, reviewed the generated text, and entered each problem set command into the terminal and manually verified the results. \\ +\end{longtable} +\normalsize + +\section{Evidence Boundary} +AI assistance was used for document organization, LaTeX authoring, code and +diagram presentation, proposal drafting, and layout review. Earlier Linux and website exercise outputs retain their original human-gathered +attribution. Later infrastructure assistance is identified in the dated entries +above. Assignment 5 remote execution is AI-assisted and recorded in the dated entries. Earlier preparation entries describe the state at that time, not the final implementation. + +\clearpage +\fancyhead[C]{\small\nouppercase{\leftmark}} diff --git a/documentation/devopsAcronyms.tex b/documentation/devopsAcronyms.tex new file mode 100644 index 0000000..3884f62 --- /dev/null +++ b/documentation/devopsAcronyms.tex @@ -0,0 +1,18 @@ +% Acronyms occurring in the assignment document. +\chapter*{Acronyms} +\markboth{Acronyms}{Acronyms} +\index{acronyms} + +The following acronyms occur in the assignment document. + +\begin{description}[style=nextline,leftmargin=2.2cm,labelindent=0pt] +\item[\textbf{ACME}] Automated Certificate Management Environment. \hfill Reference: \hyperref[AcronymRef:ACME]{p.~\pageref*{AcronymRef:ACME}} +\item[\textbf{AI}] Artificial Intelligence. \hfill Reference: \hyperref[AcronymRef:AI]{p.~\pageref*{AcronymRef:AI}} +\item[\textbf{API}] Application Programming Interface. \hfill Reference: \hyperref[AcronymRef:API]{p.~\pageref*{AcronymRef:API}} +\item[\textbf{DNS}] Domain Name System. \hfill Reference: \hyperref[AcronymRef:DNS]{p.~\pageref*{AcronymRef:DNS}} +\item[\textbf{HTTP}] Hypertext Transfer Protocol. \hfill Reference: \hyperref[AcronymRef:HTTP]{p.~\pageref*{AcronymRef:HTTP}} +\item[\textbf{HTTPS}] Hypertext Transfer Protocol Secure. \hfill Reference: \hyperref[AcronymRef:HTTPS]{p.~\pageref*{AcronymRef:HTTPS}} +\item[\textbf{SSH}] Secure Shell. \hfill Reference: \hyperref[AcronymRef:SSH]{p.~\pageref*{AcronymRef:SSH}} +\item[\textbf{TCP}] Transmission Control Protocol. \hfill Reference: \hyperref[AcronymRef:TCPAssignment4]{p.~\pageref*{AcronymRef:TCPAssignment4}} +\item[\textbf{TLS}] Transport Layer Security. \hfill Reference: \hyperref[AcronymRef:TLS]{p.~\pageref*{AcronymRef:TLS}} +\end{description} diff --git a/documentation/devopsAssignment.tex b/documentation/devopsAssignment.tex new file mode 100644 index 0000000..390e23e --- /dev/null +++ b/documentation/devopsAssignment.tex @@ -0,0 +1,3 @@ +% Compatibility entry point. +% The authoritative Overleaf main document is the top-level main.tex file. +\input{main.tex} diff --git a/documentation/devopsAutomatedManualBuild.tex b/documentation/devopsAutomatedManualBuild.tex new file mode 100644 index 0000000..7af7038 --- /dev/null +++ b/documentation/devopsAutomatedManualBuild.tex @@ -0,0 +1,196 @@ +\chapter{Automated Manual Build} +\ChapterLabel{AutomatedManualBuild} +\index{Gitea Actions}\index{LaTeX!automated build}\index{build artifact} + +\begin{devopsNote}[Assignment 5 implementation record] +Human version \texttt{1.7.1}; document date October 6, 2026. The team authorized +Chapter 3 implementation on its existing Droplet. Jenkins (instruction Chapter 4) +is outside this activity. Infrastructure checks below are observed results; +the manual build sequence is recorded separately as it completes. +\end{devopsNote} + +\section{Source and trigger} +The source of truth is the existing +\href{https://myfileagent.tech/myfileagent/myfileagent-pipeline}{MyFileAgent repository}. +The entry point is +\href{https://myfileagent.tech/myfileagent/myfileagent-pipeline/src/branch/main/documentation/main.tex}{\path{documentation/main.tex}}; +chapter sources, \texttt{cornell.cls}, bibliography, formatting files and all +historical figures are included. The transferred source archive had SHA-256 +\path{ad93f9f2e71bc66a2b882b57510cbb7f51827637047073d6a6f78c0170e6205e}. +Its 12 \path{hw4_images} files preserve earlier evidence. Generated PDFs, +metadata, caches and secrets are excluded from source control. + +\href{https://myfileagent.tech/myfileagent/myfileagent-pipeline/src/branch/main/.gitea/workflows/manual-pdf.yml}{The manual workflow} +accepts \texttt{push} events on \texttt{main} and +\texttt{manual-build-validation}. It explicitly checks out the triggering SHA +and disables persisted checkout credentials. Pushes use Git over HTTPS to +\texttt{myfileagent.tech:443}. Caddy 2.11.4 terminates TLS and forwards to Gitea +1.27.3 on private container port 3000. The host mapping remains +\texttt{127.0.0.1:3000}. No Gitea SSH port, runner submission listener or +compiler port was published. The existing grading apps on 5050/8080 and the +instructor-approved key-only SSH exception were preserved. + +\begin{figure}[htbp] +\centering +\begin{tikzpicture}[node distance=10mm, every node/.style={draw,rounded corners,align=center,font=\small,text width=3.7cm},>=Stealth] +\node (team) {Team source push\\HTTPS 443}; +\node[right=of team] (gitea) {Caddy $\rightarrow$ Gitea\\private backend 3000}; +\node[below=of gitea] (runner) {Repository runner\\one job; Docker socket}; +\node[left=of runner] (job) {Temporary TeX container\\checkout, compile, upload}; +\node[below=of job] (pdf) {Named PDF artifact\\download for submission}; +\draw[->] (team)--(gitea); +\draw[<->] (gitea)--node[right,draw=none,text width=1.8cm]{HTTPS work requests}(runner); +\draw[->] (runner)--(job); +\draw[->] (job)--(pdf); +\draw[->,dashed] (job)--node[above,sloped,draw=none,text width=3.2cm]{HTTPS source and artifact}(gitea); +\end{tikzpicture} +\caption{Actual single-Droplet manual-build path. Only the runner mounts the +Docker socket; Gitea and the compiler do not share a source filesystem.} +\label{Fig:ManualBuildArchitecture} +\end{figure} + +\section{Runner setup} +\phantomsection\label{GlossaryRef:actionsrunner}\index{runner!registration} +Runner ID 1, \texttt{assignment5-manual}, is registered only to +\texttt{myfileagent/myfileagent-pipeline}. The self-managed +\texttt{act\_runner} version is 0.6.1. Its image digest is +\path{sha256:b5c35d6bdbb9bb25e531230bfc7cc663cb751406cbec90a2a891b85fea54de86}. +The live files are under \path{/home/codex/myfileagent-gitea/runner}; +\href{https://myfileagent.tech/myfileagent/myfileagent-pipeline/src/branch/main/ops/manual-build}{versioned non-secret configuration} +records the deployment. The \texttt{manual-latex} label uses +\texttt{docker://} execution with the exact local compiler image ID below. +Capacity is one job. The runner has a 192 MiB hard memory limit and 128 MiB Go +memory target; jobs have a 256 MiB limit, no swap, 0.65 CPU and a 256-process +limit. The initial 96 MiB runner limit caused an out-of-memory restart while +cloning an action in run 1; its temporary container and volumes were removed. +Increasing the bounded limit allowed run 2 to pass without another restart. + +\EvidenceID{MAN-RUNNER-01}: October 6, 2026, America/New\_York +(UTC log timestamps may be October 7). Expected: registered online worker, +HTTPS reachability and an assigned job. Actual: the repository runner API +reported ID 1 online; \href{https://myfileagent.tech/myfileagent/myfileagent-pipeline/actions/runs/2}{preflight run 2} +was assigned to this worker and succeeded. Its downloaded text artifact +verified HTTPS certificate validation and blocked direct connections from the +job to private backend \texttt{172.20.0.2:3000} and gateway +\texttt{172.20.0.1:3000}. The job had no Docker socket, runner-state mount or +published ports. This is a measured bridge boundary, not a claim that every +outbound destination is blocked. Runner registration and execution follow +Gitea's documented model~\cite{GiteaActRunnerManual}. + +\section{Reproducible compilation} +TeX is installed in the temporary job image, not the Gitea application +container. \path{ops/manual-build/Dockerfile} pins Debian by digest and its +packages to the October 1, 2026 Debian snapshot. The built local image is +\path{sha256:579106aaffa81dc2436a72a5dbfc51d3590f1a97646321fd38c694aae6d7cba1} +(1.32 GB); \texttt{force\_pull: false} selects this stored immutable image ID. +A replacement host must rebuild from the recorded definition and update the +recorded image ID after verification. Dependencies include TeX Live 2022, +latexmk 4.79, BibTeX, makeindex/makeglossaries, Latin Modern and recommended +fonts, Pygments 2.14.0 for minted, Node 18.20.4 and pypdf 3.4.1. + +The job runs \path{python3 documentation/ci/build_manual.py}. The helper copies +sources into a fresh temporary directory and invokes: +\begin{lstlisting}[language=bash] +latexmk -pdf -shell-escape -interaction=nonstopmode \ + -halt-on-error -file-line-error main.tex +\end{lstlisting} +latexmk coordinates repeated PDF, bibliography and index passes. This report +uses authored, linked glossary/acronym lists; their label references are +resolved by repeated LaTeX passes rather than a generated glossary printout. +Shell escape is required by minted and is restricted to trusted source in the +job container. The helper verifies that checkout HEAD equals the triggering +SHA, removes prior publish targets, propagates a compiler failure, rejects +missing/empty/unreadable PDFs, verifies visible metadata, and rejects unresolved +references/citations or duplicate labels. Only success copies +\path{documentation/build/main.pdf} and \path{build-manifest.json} for upload. +The original manual was precompiled in a separate temporary container before +relying on Actions. The successful Actions records below are the authoritative +publication evidence. See the retained job logs and the +\href{https://myfileagent.tech/myfileagent/myfileagent-pipeline/src/branch/main/documentation/ci/build_manual.py}{build helper}. + +\section{PDF version traceability} +\phantomsection\label{GlossaryRef:buildidentity}\index{build identity} +The human-maintained version stays \texttt{1.7.1}. The helper writes an +uncommitted \path{build-metadata.tex} with a suffix +\texttt{+build.RUN.SHORTSHA.attempt.ATTEMPT}, full Git commit, run number and +clickable run URL. The title and \hyperref[Build:Identity]{Build Identity page} +show the values of this PDF. Metadata is produced in the temporary workspace; +no workflow step commits or pushes generated version changes. This avoids a +push/build loop. A local compile instead says \texttt{+local.unverified} and +must not be presented as an Actions artifact. The manifest correlates full +commit, run/attempt, PDF checksum and page count. The checkout and artifact +actions are pinned to tested commits, not floating tags~\cite{GiteaActionsComparisonManual}. + +\section{Downloadable artifact} +\phantomsection\label{GlossaryRef:buildartifact}\index{artifact!retention} +On success, the artifact name is +\texttt{assignment5-1.7.1-run-RUN-FULLSHA}; it contains the PDF and JSON +manifest. Open the matching \href{\BuildRunURL}{Actions run}, select that named +artifact, download its ZIP and extract \texttt{main.pdf}. Retention is +explicitly requested as 14 days, rather than relying on the server default; +expiration enforcement has not yet been observed. Keep the submitted PDF +outside this temporary retention window~\cite{GiteaActionsConfigManual}. + +Checkout v4.2.2 is pinned to +\path{11bd71901bbe5b1630ceea73d27597364c9af683}; upload-artifact v3.2.2 to +\path{c6a366c94c3e0affe28c06c8df20a878f24da3cf}. The latter's legacy artifacts +are available from the run's named download link even though the newer REST +artifact-list endpoint returned no entries in the preflight. The direct +preflight artifact download was verified, including ZIP checksum and contents. +Manual artifact downloads and visible PDF checks are recorded below. + +\section{Change, failure, and repair evidence} +% BEGIN BUILD EVIDENCE +The two source-change builds and the isolated LaTeX failure/repair sequence +are pending at this first source-import stage. The infrastructure preflight +is not counted as a manual build. No manual result is inferred from it. +% END BUILD EVIDENCE + +\section{Runner and secret boundary} +\index{runner!security}\index{Docker socket} +The repository's Owners team may change workflows; preflight found no direct +collaborators and no branch-protection rules. Peer review is a team procedure, +not an enforced gate for this assignment. Only trusted team pushes to the +selected branches execute. Untrusted pull-request triggers are not enabled. +The runner controls the host Docker socket and therefore has powerful host +access; containers are not a security boundary against a malicious trusted +workflow author or Docker administrator. Jobs receive no socket or runner-state +mount; \texttt{valid\_volumes: []}, \texttt{docker\_host: '-'}, nonprivileged +execution and the separate bridge reduce accidental exposure. + +Registration state is stored outside Git in a mode-700 directory, with its +\texttt{.runner} file mode 600. Registration tokens were passed without logging +their values. A temporary implementation token has \texttt{write:repository} +scope and resides in restricted storage outside Git; that scope covers the +account's accessible repositories and is not a per-repository credential. +It is not passed to build jobs. Checkout uses the Actions job credential with +read-only workflow permissions and removes persisted Git credentials. +The \hyperref[Table:CredentialRegistry]{Passwords table} contains hints only. + +\section{Manual quality and controls} +The \hyperref[Table:HostRegistry]{Hosts table} now identifies the runner, +compiler execution and ports. The \hyperref[Table:CredentialRegistry]{Passwords +table} now identifies protected runner state and the temporary implementation +credential without values. \ChapterRef{DocumentHistory} and +\AppendixRef{AIPromptLog} record the work and retain earlier attribution. +Figure~\ref{Fig:ManualBuildArchitecture}, linked glossary/index terms and +citations connect the operational record to its configuration and evidence. + +The MyFileAgent team owns this single-Droplet runner. Preflight measured one +CPU, 961 MiB RAM, about 292 MiB available memory, no swap and 18 GiB free disk; +after the compiler image build about 17 GiB remained. No paid resize or new +machine was purchased. Existing cloud/domain charges and transfer allowances +were not re-audited; do not assume perpetual free service. Historical domain, +firewall, backup and instructor-exception evidence remains in +\ChapterRef{GiteaStartupFoundation}. + +For a queued job, inspect branch trigger, Actions enablement, runner online +state and label. For a compile failure, read the first LaTeX error in the +matching job log, repair the source and push again. For absent artifacts, +confirm PDF existence, upload success and the legacy run download link before +assuming the REST listing is complete. Check memory/disk before retrying. +Stop only the added runner using its separate Compose project for recovery; +this leaves Gitea and the grading apps running. On retirement, remove runner +ID 1 through repository settings, revoke temporary credentials, and remove +only identified runner/job storage after preserving submission evidence. +Do not prune all Docker storage on this shared host. diff --git a/documentation/devopsDigitalOceanDockerDeployment.tex b/documentation/devopsDigitalOceanDockerDeployment.tex new file mode 100644 index 0000000..9194a54 --- /dev/null +++ b/documentation/devopsDigitalOceanDockerDeployment.tex @@ -0,0 +1,190 @@ +\chapter{DigitalOcean Docker Deployment} +\ChapterLabel{DigitalOceanDockerDeployment} +\index{DigitalOcean!Docker deployment} +\index{Docker!Ubuntu installation} + +\section{Overview} + +The team created an Ubuntu Droplet in the DigitalOcean project named +\textit{SSW 590 DevOps}. The Droplet is currently named +\texttt{ssw590-group7-droplet} and has one virtual CPU, 1 GB of RAM, 25 GB of +disk space, and the public IP address +\href{http://142.93.193.110}{142.93.193.110}. Docker Engine was then installed +on the Droplet by following Docker's official Ubuntu installation instructions +\cite{DockerUbuntuInstall}. Figure~\ref{fig:digitalocean-droplet} preserves the +original pre-upgrade cloud-console view; the text and host registry record the +current name and capacity. + +\begin{figure}[htbp] + \centering + \includegraphics[width=\textwidth]{digitalocean-droplet.png} + \caption{Original pre-upgrade view of the Ubuntu Droplet in the SSW 590 + DevOps project; the current resource is named + \texttt{ssw590-group7-droplet} with 1 GB RAM and 25 GB storage.} + \label{fig:digitalocean-droplet} +\end{figure} + +\FloatBarrier + +\section{Installing Docker Engine on Ubuntu} + +The package index was updated, the required certificate and download utilities +were installed, and Docker's official GPG key was saved in the APT keyring. + +\begin{minted}{bash} +sudo apt update +sudo apt install ca-certificates curl +sudo install -m 0755 -d /etc/apt/keyrings +sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg \ + -o /etc/apt/keyrings/docker.asc +sudo chmod a+r /etc/apt/keyrings/docker.asc +\end{minted} + +The Docker repository was then added to the Ubuntu APT sources. The suite and +architecture values were determined automatically from the operating system. + +\begin{minted}{bash} +sudo tee /etc/apt/sources.list.d/docker.sources < this.changeBackground()); + } +} + +const blueButton = new ColorButtonController("blueBtn", "blue"); +const redButton = new ColorButtonController("redBtn", "red"); + +blueButton.bind(); +redButton.bind(); +\end{minted} + +The HTML loads the class-based script after defining both buttons. + +\begin{minted}{html} + + + +\end{minted} + +\subsection{UML Class Diagram} + +Figure~\ref{fig:color-button-uml} shows the updated object-oriented design. +The minus sign indicates private implementation data and the plus sign indicates +public operations. The same class is instantiated once for the Blue button and +once for the Red button. + +\begin{figure}[htbp] + \centering + \begin{tikzpicture}[ + uml/.style={draw=black, rounded corners=1pt, align=left, + inner sep=0pt, text width=10.5cm, font=\small} + ] + \node[uml] (class) {% + \begin{minipage}{10.5cm} + \centering\textbf{ColorButtonController}\\[-2pt] + \rule{\linewidth}{0.4pt} + \raggedright $-$ button: HTMLButtonElement\\ + $-$ color: string\\[-2pt] + \rule{\linewidth}{0.4pt} + $+$ ColorButtonController(buttonId: string, color: string)\\ + $+$ bind(): void\\ + $+$ changeBackground(): void + \end{minipage} + }; + \end{tikzpicture} + \caption{UML class diagram for the class-based two-button website.} + \label{fig:color-button-uml} +\end{figure} + +\FloatBarrier + +\subsection{Build and Deployment} + +The image was rebuilt as \texttt{color-buttons-app}; container port 3000 was +published through host port 8080. The existing container must be stopped and +removed before the revised image is deployed with the same container name. + +\begin{minted}{bash} +cd color-buttons-app +sudo docker build -t color-buttons-app . +sudo docker stop color-buttons-app +sudo docker rm color-buttons-app +sudo docker run -d --name color-buttons-app -p 8080:3000 color-buttons-app +sudo docker ps +\end{minted} + +The deployed two-button website is +\href{http://142.93.193.110:8080}{http://142.93.193.110:8080}. Clicking either +button calls its controller instance and changes the page background to the +corresponding color. + +\section{Deployment Summary} + +The completed work for Steps 1 through 3 establishes a repeatable cloud deployment +workflow: provision the Ubuntu Droplet, install Docker from its official APT +repository, build each application image, run the containers with published +ports, implement reusable class-based client behavior, and confirm container +status with \texttt{docker ps}. diff --git a/documentation/devopsDocumentGuide.tex b/documentation/devopsDocumentGuide.tex new file mode 100644 index 0000000..328c3be --- /dev/null +++ b/documentation/devopsDocumentGuide.tex @@ -0,0 +1,142 @@ +\chapter{Document Authoring Guide} +\ChapterLabel{DocumentGuide} +\index{LaTeX} +\index{document conventions} +\index{Appendix!Document Authoring Guide} + +\section{How to Use This Appendix} +Use this appendix to maintain the template's file conventions, build process, +and review rules. Update it when the document structure or toolchain changes. + +\section{Template Provenance} +This template was developed by \textbf{Darian Muresan, Ph.D.}, in conjunction +with \textbf{OpenAI Codex} and \textbf{Anthropic Claude Code}. Keep this +attribution distinct from the assignment-specific instructor metadata. + +\section{File Naming and Responsibilities} +Every chapter file shall use the \texttt{devops} prefix, a PascalCase chapter +name, and the \texttt{.tex} suffix. Each such file shall contain one complete +chapter, beginning with \texttt{\string\chapter\{...\}}, and all of its +sections and subsections. Do not split one chapter into section-level +\texttt{.tex} files. For example, all of Chapter~2 is contained in +\path{devopsExampleAssignment.tex}. Do not add requirements or +architecture-design chapters; this template records a DevOps learning activity +and its operational evidence. + +\section{Synonyms and Controlled Terms} +\index{synonyms} +Use one preferred term for each important concept. If an assignment uses +equivalent terms, record them here before release. For example, state whether +``continuous delivery'' refers to \gls{cd} generally or specifically excludes +automatic production deployment. Add important terms to +\texttt{devopsGlossary.tex} and index them where used. + +\section{Building the PDF} +The template requires a LaTeX distribution with \texttt{pdflatex}, +\texttt{bibtex}, \texttt{makeglossaries}, and \texttt{makeindex}. +Install the tools using the platform instructions below, then run one of the +following platform builds. + +\subsection{macOS and Linux Build} +\begin{verbatim} +make -f makefileMacLinux pdf +\end{verbatim} + +\subsection{Windows PowerShell Build} +\begin{verbatim} +.\makefilePowerShell.ps1 -Action pdf +\end{verbatim} +The completed build regenerates references, bibliography, glossary, and index. +Review the log and visually inspect affected PDF pages. Do not edit generated +auxiliary files or the PDF directly. + +\section{Install LaTeX Tools on macOS} +\index{macOS} +\index{MacTeX} +\subsection{Recommended Installation} +Install the current full \href{https://www.tug.org/mactex/}{MacTeX} +distribution. It includes TeX Live, \texttt{pdflatex}, \texttt{bibtex}, +\texttt{latexmk}, \texttt{makeglossaries}, \texttt{makeindex}, and useful +applications such as TeXShop and TeX Live Utility. The full distribution is the +least troublesome choice for this template because it includes the packages +used by the glossary, table, listing, color, and hyperlink features. + +Either download the signed installer from the MacTeX web site and complete the +macOS installation dialog, or, if Homebrew is already installed, run: +\begin{verbatim} +brew install --cask mactex +\end{verbatim} +Close and reopen Terminal after installation. If the TeX commands are not +found, add the MacTeX binary directory to the current shell session: +\begin{verbatim} +export PATH="/Library/TeX/texbin:$PATH" +\end{verbatim} +Do not place this command in a shell profile until it has been verified on the +local computer. + +\subsection{Verification and Compilation} +From the template directory, verify the tools: +\begin{verbatim} +command -v pdflatex bibtex latexmk makeglossaries makeindex +\end{verbatim} +Each command should print a path. Then create the PDF: +\begin{verbatim} +make -f makefileMacLinux pdf +\end{verbatim} +To remove generated intermediate files while keeping the PDF, run: +\begin{verbatim} +make -f makefileMacLinux clean +\end{verbatim} + +\section{Install LaTeX Tools on Windows} +\index{Windows} +\index{MiKTeX} +\subsection{Recommended Installation} +Install the current Basic MiKTeX distribution using the official +\href{https://miktex.org/howto/install-miktex}{MiKTeX Windows installation +guide}. During installation, choose a per-user installation when appropriate +and set missing-package installation to \emph{Ask me first} or \emph{Yes}. +The latter is convenient for a student machine with Internet access; the former +makes each package installation explicit. + +Open MiKTeX Console after installation, apply available updates, and install +the \texttt{latexmk} package if the verification command below cannot find it. +On an organization-managed computer, obtain approval before installing software +or changing execution policy. + +\subsection{Verification and Compilation} +Open a new PowerShell window in the template directory and verify: +\begin{verbatim} +Get-Command pdflatex,bibtex,latexmk,makeglossaries,makeindex +\end{verbatim} +Each command should display a command record. Build the PDF with: +\begin{verbatim} +.\makefilePowerShell.ps1 -Action pdf +\end{verbatim} +If PowerShell blocks the script under a managed execution policy, ask the +system administrator for the approved procedure. Do not bypass institutional +security policy. To remove intermediate build files, run: +\begin{verbatim} +.\makefilePowerShell.ps1 -Action clean +\end{verbatim} + +\section{Common Build Problems} +\begin{tabularx}{\linewidth}{L{3.0cm}Y} +\toprule \textbf{Symptom} & \textbf{Resolution}\\ \midrule +Command not found & Close and reopen the terminal. On macOS, verify the TeX +binary path; on Windows, verify MiKTeX completed installation and is on the user PATH.\\ +Missing LaTeX package & Use MiKTeX Console or its approved on-the-fly package +installation prompt on Windows. On macOS, install the full MacTeX distribution +or use TeX Live Utility to add the missing package.\\ +References or glossary incomplete & Run the supplied platform build instead of +a single \texttt{pdflatex} command; it runs BibTeX, the glossary tool, and the +index tool in the required order.\\ +Script is blocked & Follow the institution's approved PowerShell policy or run +the documented build commands with an approved administrator.\\ \bottomrule +\end{tabularx} + +\section{Authoring and Review Rules} +Replace bracketed placeholders with assignment facts. Keep operational examples +safe, bounded, and free of credentials. Link activities to evidence, retain +history, and state unknowns or instructor decisions explicitly. Rebuild after +structural, cross-reference, table, glossary, or index changes. diff --git a/documentation/devopsDocumentHistory.tex b/documentation/devopsDocumentHistory.tex new file mode 100644 index 0000000..1556e02 --- /dev/null +++ b/documentation/devopsDocumentHistory.tex @@ -0,0 +1,32 @@ +\chapter*{Document History} +\phantomsection +\ChapterLabel{DocumentHistory} +\addcontentsline{toc}{chapter}{Document History} +\markboth{Document History}{Document History} +\index{document history} + +\footnotesize +\begin{longtable}{L{2.8cm}L{1.7cm}L{6.1cm}L{2.3cm}} +\caption{Document Update History}\label{Table:DocumentHistory}\\ +\toprule +\textbf{Date / Version} & \textbf{Author Initials} & \textbf{Change} & \textbf{Changed At} \\ +\midrule +\endfirsthead +\multicolumn{4}{l}{\footnotesize\itshape Document Update History (continued)}\\ +\toprule +\textbf{Date / Version} & \textbf{Author Initials} & \textbf{Change} & \textbf{Changed At} \\ +\midrule +\endhead +\bottomrule +\endlastfoot +October 6, 2026 / 1.7.1 & GDL, CDX & Imported the actual source bundle; deployed repository runner and pinned compiler image, verified checkout/artifact preflight, and prepared push-triggered manual compilation. Hosts changed to include runner/jobs; Passwords changed to include credential-storage hints. Manual build evidence is pending this first push. & \ChapterRef{AutomatedManualBuild}, \ChapterRef{Hosts}, \ChapterRef{Passwords} \\ +October 6, 2026 / 1.7.1 & GDL, CDX & Began approved Assignment 5 Chapter 3 implementation; updated metadata, corrected historical image paths to \texttt{hw4\_images}, added build-identity support and the automated-build chapter. Prepared and locally checked the clean-build helper; remote setup and evidence remain pending execution on the connected project. Hosts and Passwords tables are unchanged at this preparation stage; add verified runner details after registration. & \ChapterRef{AutomatedManualBuild}, \ChapterRef{Hosts}, \ChapterRef{Passwords}, \AppendixRef{AIPromptLog} \\ +September 29, 2026 / 1.6.1 & NK, GDL, CDX & Activated \texttt{myfileagent.tech} with DNS, Caddy HTTPS, certificate and ACME evidence; documented the isolated backup/restore test, live links and temporary ports; refined the firewall, extra-credit, credential, figure-layout, and reference material; compiled and visually reviewed the manual. & \ChapterRef{GiteaStartupFoundation}, \ChapterRef{Passwords}, \AppendixRef{AIPromptLog} \\ +September 26, 2026 / 1.6.0 & NK, GDL, CDX & Established the pinned Gitea/SQLite foundation, persistence test, two-member workflow, Cloud Firewall, key-only SSH, architecture and operations; updated Hosts and Passwords and documented the instructor-cleared SSH exception. & \ChapterRef{Hosts}, \ChapterRef{Passwords}, \ChapterRef{GiteaStartupFoundation}, \AppendixRef{AIPromptLog} \\ +September 18, 2026 / 1.5.1 & NK, GDL, CDX & Added Chapter 8, the Project Proposal, describing the MyFileAgent one-click DevSecOps installation, build, configuration, testing, deployment, security, and Grafana monitoring pipeline. & \ChapterRef{ProjectProposal}, \AppendixRef{AIPromptLog} \\ +September 18, 2026 / 1.5.0 & NK, GDL, CDX & Added Chapter 6 documenting the DigitalOcean Droplet, Docker installation, website deployment, class-based JavaScript button design, and UML diagram. Added Chapter 7 documenting the TeX Live Docker image, sample LaTeX source, build and run commands, and PDF verification. Updated the supporting report sections and project files. & \ChapterRef{DigitalOceanDockerDeployment}, \ChapterRef{LatexDocker}, \AppendixRef{AIPromptLog} \\ +September 12, 2026 / 1.4.1 & NK, GDL, CDX & Added the complete Section 3 problem-set record with human-run outputs; organized the problem set as Section 3.2; included the Hosts and Passwords chapters; reduced and linked the assignment glossary; and verified the index links. & \ChapterRef{LinuxProblemSet}, \ChapterRef{Hosts}, \ChapterRef{Passwords}, \AppendixRef{AIPromptLog} \\ +September 11, 2026 / 1.4.0 & NK, GDL, CDX & Customized the group report for Assignment 2; documented the Linux setup activity; added the Linux problem-set chapter & \ChapterRef{Introduction}, \ChapterRef{LinuxCommands}, \ChapterRef{LinuxProblemSet}, \AppendixRef{AIPromptLog} \\ +September 2, 2026 / 1.3 & DDM, CDX & Provided the reusable \phantomsection\label{AcronymRef:SSW}SSW 590 DevOps assignment template and its one-file-per-chapter convention. & \hyperref[Chapter:TemplateAttribution]{Template baseline} \\ +\end{longtable} +\normalsize diff --git a/documentation/devopsExampleAssignment.tex b/documentation/devopsExampleAssignment.tex new file mode 100644 index 0000000..1180e2f --- /dev/null +++ b/documentation/devopsExampleAssignment.tex @@ -0,0 +1,126 @@ +\chapter{Example Assignment} +\ChapterLabel{ExampleAssignment} +\index{activity brief} +\index{workflow} +\index{automation} +\index{infrastructure as code} +\index{evidence} +\index{observability} +\index{rollback} +\index{retrospective} +\index{continuous improvement} +\index{submission} +\index{cleanup} + +\section{Activity Brief} +\subsection{Scenario} +Describe the operational scenario and why it matters. Use a bounded, +non-production system. \textit{Example: A team must deploy a small service +reliably to a remote Linux host and recover from a failed release.} + +\subsection{Activities} +Assign stable IDs to each assessed activity. Add rows as needed. +\begin{tabularx}{\linewidth}{L{2.1cm}L{3.1cm}Y} +\caption{Activity Register\label{Table:ActivityRegister}}\\ +\toprule \textbf{ID} & \textbf{Activity} & \textbf{Completion criterion}\\ \midrule +\ActivityID{ACT-01} & \textit{[Prepare environment]} & \textit{[repeatable environment baseline is present]}\\ +\ActivityID{ACT-02} & \textit{[Automate workflow]} & \textit{[workflow runs from documented inputs]}\\ +\ActivityID{ACT-03} & \textit{[Observe and recover]} & \textit{[evidence shows monitoring and recovery]}\\ \bottomrule +\end{tabularx} + +\subsection{Success Criteria} +State observable outcomes, not implementation prescriptions. Include security, +cost, cleanup, and reproducibility criteria where applicable. + +\subsection{Assessment Rubric} +\begin{tabularx}{\linewidth}{L{3.2cm}L{2.0cm}Y} +\toprule \textbf{Criterion} & \textbf{Weight} & \textbf{Evidence expected}\\ \midrule +Reproducible workflow & \textit{[points]} & \textit{[automation and clean-run proof]}\\ +Operational quality & \textit{[points]} & \textit{[observability, rollback, security]}\\ +Evidence and explanation & \textit{[points]} & \textit{[commands, outputs, rationale]}\\ +Reflection & \textit{[points]} & \textit{[failure analysis and improvement]}\\ \bottomrule +\end{tabularx} + +\section{Workflow and Implementation} +\subsection{Environment Baseline} +Specify the authorized environment, prerequisites, access model, versioned +inputs, and teardown procedure. Record commands in a repository script or +infrastructure-as-code definition; do not rely on a sequence of undocumented +console clicks. + +\subsection{Procedure} +For each activity, state the goal, input, command or automation entry point, +expected result, and rollback or cleanup action. Link the corresponding +activity identifier and evidence identifier. + +\begin{lstlisting}[language=bash,caption={Replace with a safe, repeatable workflow entry point.}] +# ./scripts/provision.sh --environment sandbox +# ./scripts/deploy.sh --version +# ./scripts/destroy.sh --environment sandbox +\end{lstlisting} + +\subsection{Operational Controls} +Describe least-privilege access, secret handling, logging, monitoring, change +control, budget guardrails, backup or rollback, and resource cleanup. A secret +shall be referenced by its approved storage location, never pasted into this +document or committed to the repository. + +\subsection{Failure Exercise} +Define one safe failure or degradation scenario. State the trigger, expected +signal, diagnosis path, recovery action, and evidence required. Never direct +students to disrupt shared or production infrastructure. + +\section{Evidence Register} +\subsection{How to Use This Section} +Evidence demonstrates an actual execution; an expected result is not evidence. +Use sanitized command output, logs, screenshots, links to versioned files, or +recorded metrics. Redact secrets and personal information. + +\begin{tabularx}{\linewidth}{L{1.7cm}L{2.2cm}L{2.6cm}Y} +\caption{Evidence Register\label{Table:EvidenceRegister}}\\ +\toprule \textbf{ID} & \textbf{Activity} & \textbf{Evidence type} & \textbf{Location and interpretation}\\ \midrule +\EvidenceID{EVD-01} & \ActivityRef{ACT-01} & \textit{[log / script / image]} & \textit{[repository path or sanitized URL; what it demonstrates]}\\ +\EvidenceID{EVD-02} & \ActivityRef{ACT-02} & \textit{[pipeline output]} & \textit{[location; result and relevant timestamp]}\\ +\EvidenceID{EVD-03} & \ActivityRef{ACT-03} & \textit{[monitoring / recovery output]} & \textit{[location; failure signal and recovery result]}\\ \bottomrule +\end{tabularx} + +\subsection{Evidence Quality Checks} +Evidence should identify the executed version, environment, time, command or +automation entry point, outcome, and any deviation from the expected result. +State failures plainly; they are valuable inputs to the retrospective. + +\section{Retrospective} +\subsection{Outcome} +Summarize what happened, including completed work, gaps, and unexpected +behavior. Distinguish facts from interpretation. + +\subsection{Flow and Feedback} +Identify queues, handoffs, manual steps, slow feedback, and sources of rework. +Explain which changes improved delivery flow or made failures visible sooner. +This emphasis on flow, feedback, and continual learning is consistent with the +DevOps framing introduced in \cite{PhoenixProject}. + +\subsection{Improvement Experiments} +Propose one or more small, testable improvements. State the hypothesis, change, +measurement, expected result, and risk. Do not represent a proposal as an +approved production change. + +\subsection{Team Contributions} +For team assignments, concisely identify each member's meaningful contribution +and any collaboration constraints. + +\section{Submission and Cleanup} +\subsection{Submission Checklist} +\begin{itemize} +\item Versioned automation, configuration, and runbook are committed. +\item Evidence links resolve and contain no secrets or personal data. +\item The retrospective is complete and distinguishes results from proposals. +\item Remote resources have been destroyed or explicitly transferred as directed. +\item The repository identifies the final commit or release tag. +\end{itemize} + +\subsection{Academic Integrity and Responsible Use} +Follow the course policy for collaboration and AI assistance. Cite external +code, tutorials, and AI-generated material as required by the instructor. +Students remain responsible for understanding, testing, and explaining all +submitted work. diff --git a/documentation/devopsGiteaStartupFoundation.tex b/documentation/devopsGiteaStartupFoundation.tex new file mode 100644 index 0000000..604e97e --- /dev/null +++ b/documentation/devopsGiteaStartupFoundation.tex @@ -0,0 +1,719 @@ +\chapter{Startup Foundation with Gitea} +\ChapterLabel{GiteaStartupFoundation} +\index{Gitea} +\index{Docker!Gitea deployment} +\index{SQLite} +\index{persistent storage} +\index{DNS} +\index{HTTPS} +\index{ACME} +\index{Caddy} +\index{certificate renewal} +\index{Cloud Firewall} +\index{Docker volume} +\index{GitHub Student Developer Pack} +\index{pull request} +\index{SSH} +\index{TLS} + +\section{Student Pack Domain and DNS} +On September 29, 2026, the team secured +\href{https://myfileagent.tech}{\texttt{myfileagent.tech}} through +\texttt{.TECH domains} using the +\href{https://education.github.com/pack}{GitHub Student Developer Pack}. The +team confirmed its eligible Pack account; the published offer provides one +standard \texttt{.TECH} domain free for one year. The registrar listed renewal +at \$29.99 per year. Nick owns the renewal task, disabled automatic renewal, +and recorded the September 29, 2027 expiration date. These non-secret terms +are recorded here without reproducing registrar account details. + +The public \phantomsection\label{AcronymRef:DNS}DNS A record maps +\texttt{myfileagent.tech} to the Droplet IPv4 +address \texttt{142.93.193.110}. An independently timed Windows lookup returned +that address, plain \phantomsection\label{AcronymRef:HTTP}HTTP returned +\texttt{308 Permanent Redirect} to the same hostname over +\phantomsection\label{AcronymRef:HTTPS}HTTPS, and HTTPS returned +\texttt{200 OK} through Caddy. + +\begin{figure}[H] + \centering + \includegraphics[width=0.68\textwidth]{hw4_images/domain_http_evidence.png} + \caption{Dated independent DNS and HTTP evidence showing the public A record, + Caddy's HTTP-to-HTTPS redirect, and a successful HTTPS response.} + \label{fig:domain-http-evidence} +\end{figure} + +\FloatBarrier + +\section{Pinned Gitea Deployment} +On September 26, 2026, the team established a deployment of +\phantomsection\label{GlossaryRef:gitea}Gitea. It runs on +\texttt{ssw590-group7-droplet}. The deployment uses the official rootless +Gitea image following the official container guidance +\cite{GiteaDockerRootless}, and the official Caddy image from Docker Hub +\cite{CaddyDockerImage}. The exact pinned images and recorded digests are: + +\begin{minted}{text} +gitea_image=docker.gitea.com/gitea:1.27.3-rootless +gitea_digest=sha256:1c17ecaead42eb3b5391553d8708103a4beb0e86edf5b9ebc1eb269c318845f2 +caddy_image=caddy:2.11.4-alpine +caddy_digest=sha256:6aeddd44c3078b0f9a35206472a11420648a79c184603ef95957d0a20044cb2b +\end{minted} + +The minimal definition consists of a versioned \texttt{compose.yaml} +and \texttt{Caddyfile}. The Gitea and Caddy services use +\texttt{restart: unless-stopped}; Git-over-\phantomsection\label{AcronymRef:SSH}SSH +is disabled. + +The non-secret deployment files are versioned in the MyFileAgent repository as +\href{https://myfileagent.tech/myfileagent/myfileagent-pipeline/src/branch/main/ops/gitea/compose.yaml}{\texttt{ops/gitea/}\allowbreak\texttt{compose.yaml}} +and +\href{https://myfileagent.tech/myfileagent/myfileagent-pipeline/src/branch/main/ops/gitea/Caddyfile}{\texttt{ops/gitea/}\allowbreak\texttt{Caddyfile}}. +The team verified the current public files after activation. The initial +Compose definition and Caddyfile were recorded by these commits, with later +commits preserving their version history: + +\begin{minted}{text} +compose_commit=533ddfb38aaefaa36fbd130695b2e1adf566e822 +caddyfile_commit=11ac824a326d40fdce71642cd37e2543b9eea12c +\end{minted} + +The +following sanitized excerpt records the reproducible service, mount, port, and +network choices without credentials: + +\begin{minted}{yaml} +name: myfileagent-gitea + +services: + caddy: + image: caddy:2.11.4-alpine + container_name: myfileagent-caddy + restart: unless-stopped + profiles: [https] + ports: ["80:80", "443:443"] + volumes: + - ./Caddyfile:/etc/caddy/Caddyfile:ro + - caddy-data:/data + - caddy-config:/config + networks: [edge, gitea-private] + + gitea: + image: docker.gitea.com/gitea:1.27.3-rootless + container_name: myfileagent-gitea + restart: unless-stopped + environment: + GITEA__database__DB_TYPE: sqlite3 + GITEA__database__PATH: /var/lib/gitea/data/gitea.db + GITEA__server__DOMAIN: "${GITEA_DOMAIN:-myfileagent.tech}" + GITEA__server__ROOT_URL: "${GITEA_ROOT_URL:-https://myfileagent.tech/}" + GITEA__server__DISABLE_SSH: "true" + GITEA__service__DISABLE_REGISTRATION: "true" + ports: ["127.0.0.1:3000:3000"] + volumes: + - gitea-data:/var/lib/gitea + - gitea-config:/etc/gitea + networks: [gitea-private] +\end{minted} + +From a directory containing those two files, another authorized operator can +reproduce the current deployment with: + +\begin{minted}{bash} +docker compose pull +docker compose --profile https up -d +docker compose ps +\end{minted} + +Host port 3000 remains bound only to the +\phantomsection\label{GlossaryRef:loopback}loopback interface as +\texttt{127.0.0.1:3000}. An external connection attempt to public port 3000 +failed as expected, while a request from the Droplet to +\texttt{http://127.0.0.1:3000/} returned HTTP 200. Public requests now terminate +at Caddy on ports 80 and 443 and traverse the private Compose network to +\texttt{gitea:3000}; the backend itself is never published publicly. + +\section{Database and Persistence} +The team selected \phantomsection\label{GlossaryRef:sqlite}SQLite because this +is a small two-person course deployment and it avoids an unnecessary database +service and network port. Gitea stores its database at +\path{/var/lib/gitea/data/gitea.db}. The Docker-managed +\phantomsection\label{GlossaryRef:dockervolume}volumes +\texttt{myfileagent-gitea\_gitea-data} and +\texttt{myfileagent-gitea\_gitea-config} persist application data and +configuration outside the disposable container layer. + +The team completed that replacement test on September 26, 2026 from +19:52:28 to 19:53:44 UTC. The exact before and after identifiers were: + +\begin{minted}{text} +before_id=b0b377f252218b9495028307532d3529cd10c153dc18d3187470795b542618a8 +after_id=186dbfeaf4d21609d8fa0b98741945844c69fc4a2d35d074935508ea0b008b48 +\end{minted} + +Before replacement, the first container served the MyFileAgent product +repository and open Issue~\#2, +``Implement validation that permits file operations only within the configured +demonstration directory and rejects traversal or out-of-scope paths.'' The +team then ran: + +\begin{minted}{bash} +docker compose up -d --force-recreate --no-deps gitea +\end{minted} + +The replacement container had the distinct after identifier shown above. The +same repository and open issue remained available, and the command record +reported \texttt{container\_replaced=PASS}. Both named volumes remained +mounted at \texttt{/var/lib/gitea} and \texttt{/etc/gitea}. Therefore the +repository, issue metadata, and configuration survived because their state was +stored in persistent volumes rather than the replaced container layer. + +\begin{figure}[htbp] + \centering + \includegraphics[width=0.9\textwidth]{gitea_persistence_evidence.png} + \caption{Dated container-replacement evidence showing distinct before and + after container identifiers, the surviving MyFileAgent repository and Issue + \#2, a PASS result, and both persistent volume mounts.} + \label{fig:gitea-persistence-evidence} +\end{figure} + +\FloatBarrier + +This test verifies container-replacement persistence only; it is not a backup +or restore test. + +\section{HTTPS and Certificate Renewal} +The team selected Caddy as the \phantomsection\label{GlossaryRef:reverseproxy} +reverse proxy and public \phantomsection\label{GlossaryRef:tls} +\phantomsection\label{AcronymRef:TLS}TLS termination +point. Caddy accepts public HTTPS and forwards private HTTP to +\texttt{gitea:3000} by Compose service name on the private +\texttt{gitea-private} network. Gitea never needs to publish its backend port +to the public interface. Caddy publishes ports 80 and 443 through the enabled +\texttt{https} profile. Its certificate and runtime state persist in the +\texttt{caddy-data} and \texttt{caddy-config} volumes. + +The team compared Let's Encrypt and ZeroSSL, two publicly trusted ACME +certificate authorities supported by automated clients. Let's Encrypt was +selected because it provides free automated certificates without requiring a +paid plan and is the option recommended by the assignment. The Caddyfile pins +the Let's Encrypt production ACME directory. Caddy's +\phantomsection\label{GlossaryRef:acme}\phantomsection\label{AcronymRef:ACME}ACME +automation obtained the production +certificate, manages renewal, and adds the HTTP-to-HTTPS redirect +\cite{CaddyAutomaticHTTPS}. + +The production proxy configuration selects the Let's Encrypt production ACME +directory and routes by Compose service name over the private network: + +\begin{minted}{text} +{ + acme_ca https://acme-v02.api.letsencrypt.org/directory +} + +{$GITEA_HOSTNAME} { + reverse_proxy gitea:3000 +} +\end{minted} + +The Compose file defaults Gitea's \texttt{DOMAIN} to +\texttt{myfileagent.tech} and \texttt{ROOT\_URL} to +\texttt{https://myfileagent.tech/}. The live public repository is +available through the +\href{https://myfileagent.tech/myfileagent/myfileagent-pipeline}{MyFileAgent product-repository link}. + +\paragraph{Activation and rollback.} +After the team confirmed the A record and firewall rules, it activated the +versioned deployment with the \texttt{https} profile: + +\begin{minted}{bash} +cd /home/codex/myfileagent-gitea +docker compose --profile https config --quiet +docker compose --profile https up -d +\end{minted} + +The activation preserved all four named volumes. If public access fails, the +bounded recovery path preserves data and stops only the proxy while operators +test the loopback service: + +\begin{minted}{bash} +cd /home/codex/myfileagent-gitea +docker compose --profile https stop caddy +docker compose up -d gitea +curl -fsS -o /dev/null -w 'loopback_http=%{http_code}\n' \ + http://127.0.0.1:3000/ +\end{minted} + +\paragraph{Validation and observed production result.} +The team validated the merged Compose model and Caddyfile before activation, +then verified the live endpoint after activation \cite{CaddyCommandLine}: + +\begin{minted}{bash} +cd /home/codex/myfileagent-gitea +docker compose --profile https config --quiet +docker exec myfileagent-caddy caddy validate \ + --config /etc/caddy/Caddyfile --adapter caddyfile +\end{minted} + +The production certificate has subject \texttt{CN=myfileagent.tech}, issuer +\texttt{Let's Encrypt E1}, a September 29, 2026 start date, and a December 28, +2026 expiration date. Figure~\ref{fig:domain-certificate-evidence} records +those fields and its thumbprint; Figure~\ref{fig:domain-http-evidence} records +the redirect and successful HTTPS response. + +\begin{figure}[htbp] + \centering + \includegraphics[width=\textwidth]{hw4_images/domain_evidence.png} + \caption{Production certificate evidence showing the MyFileAgent hostname, + Let's Encrypt issuer, validity interval, and certificate thumbprint.} + \label{fig:domain-certificate-evidence} +\end{figure} + +Caddy automatically obtains, stores, and renews managed certificates and +creates the HTTP redirect \cite{CaddyAutomaticHTTPS}. Caddy does not document +a Certbot-style \texttt{renew --dry-run} command. The team therefore tested +the same automation path with a temporary \texttt{acme-test.myfileagent.tech} +A record and Let's Encrypt staging directory. The first attempts occurred +before public DNS propagation and reported that no record existed. The team +confirmed the A record through the \texttt{1.1.1.1} and \texttt{8.8.8.8} +resolvers, retried, and observed multiple external HTTP-01 requests, a valid +authorization, and \texttt{certificate obtained successfully}. It then removed +the temporary Caddy block and DNS record and reconfirmed production HTTPS 200. +This is recorded as a successful staging automation exercise, not as a claim +that the production certificate was forcibly renewed. + +\begin{figure}[htbp] + \centering + \includegraphics[width=\textwidth]{hw4_images/caddy_renewal_test_evidence.png} + \caption{Dated Caddy ACME staging evidence showing renewal information, + successful certificate acquisition for the temporary test hostname, and a + subsequent successful production HTTPS response.} + \label{fig:caddy-renewal-test-evidence} +\end{figure} + +\FloatBarrier + +\section{Firewall and External Exposure} +\phantomsection\label{GlossaryRef:cloudfirewall} +\paragraph{Exposure policy and temporary exceptions.} +The host currently publishes the earlier Assignment 3 applications on ports +5050 and 8080 while that work is graded; both returned HTTP 200 during the +September 26 check and were not altered. At Nick's direction, these two ports +will remain open only until Group Assignment~\#3 is graded; afterward, the team +will remove their inbound firewall rules when the earlier services are no +longer needed. The new Gitea backend is not public: +the host listener is \texttt{127.0.0.1:3000}, and an external port-3000 check +could not connect. The DigitalOcean Cloud Firewall +\texttt{ssw590-group7-gitea-firewall} was created and attached to the +\texttt{ssw590-group7-droplet}. The control panel reports eight total rules, +five inbound and three outbound. It permits +\phantomsection\label{AcronymRef:TCPAssignment4}80/TCP, +443/TCP, and---at the team's direction---administrative SSH on 22/TCP from all +IPv4 and IPv6 sources, and temporarily permits 5050/TCP and 8080/TCP for +Assignment 3 grading. Because the team requires SSH access from changing +locations, restricting SSH to a stable list of source addresses is not +operationally feasible. The instructor cleared this exception. SSH therefore +remains reachable from all IPv4 and IPv6 sources while the separately verified +key-only controls prohibit password and keyboard-interactive authentication. + +\paragraph{Defense in depth.} +The Droplet has public IPv4 but no public IPv6 address. Outbound +traffic remains allowed for DNS, time synchronization, image retrieval, and +certificate services. This control must be implemented at the DigitalOcean +boundary rather than relying only on host UFW because Docker-published ports +can bypass expected UFW paths \cite{DigitalOceanCloudFirewalls}. The firewall +remains necessary even with HTTPS: HTTPS authenticates and encrypts web traffic, +but it does not close unrelated ports, restrict which services are reachable, +or prevent an accidentally published container port from accepting connections. +The firewall +is attached to one Droplet, shown by the control panel as +\texttt{ssw590-group7-droplet}, with the expected 1~GB / 25~GB / NYC1 facts. +Its three outbound rules allow ICMP, all TCP, and all UDP to IPv4 and IPv6 +destinations. The control panel listed no overlapping firewall. + +\paragraph{External verification.} +From an +external Windows client, the team obtained the final expected results on +September 29: 22/TCP, 80/TCP, 443/TCP, 5050/TCP, and 8080/TCP were reachable; +the Gitea backend on 3000/TCP and database port 5432/TCP were not reachable. A +fresh key-authenticated SSH connection also succeeded after firewall creation. +The team additionally opened an authenticated SSH local-forwarding session +from the same external workstation and loaded +\path{http://localhost:3000/myfileagent/myfileagent-pipeline}. This confirms that +the private Gitea administration path remains functional even though direct +public access to 3000/TCP is blocked. +Figure~\ref{fig:firewall-configuration-evidence} records the applied IPv4 and +IPv6 rule set, and Figure~\ref{fig:firewall-external-test-evidence} records the +external port-test results. + +\begin{table}[H] +\centering +\caption{Host and container port mappings after firewall creation} +\label{tab:gitea-port-mappings} +\small +\begin{tabularx}{\textwidth}{L{1.9cm}L{3.4cm}Y Y} +\toprule +\textbf{Port} & \textbf{Listener or mapping} & \textbf{Current exposure} & \textbf{Purpose} \\ +\midrule +22/TCP & Host OpenSSH & Public IPv4/IPv6; keys only & Administration and the verified Gitea tunnel \\ +80/TCP & Caddy \texttt{80:80} & Public through firewall & HTTP redirect and ACME validation \\ +443/TCP & Caddy \texttt{443:443} & Public through firewall & MyFileAgent HTTPS \\ +3000/TCP & \path{127.0.0.1:3000:3000} & Loopback only & Private Gitea backend and SSH tunnel \\ +5050/TCP & Earlier assignment service & Temporarily public & Assignment 3 grading \\ +5432/TCP & No listener or mapping & Not public & Unused because SQLite was selected \\ +8080/TCP & Earlier assignment service & Temporarily public & Assignment 3 grading \\ +\bottomrule +\end{tabularx} +\end{table} + +\begin{figure}[htbp] + \centering + \includegraphics[width=\textwidth]{hw4_images/firewall_configuration_evidence.png} + \caption{Sanitized DigitalOcean Cloud Firewall evidence showing inbound + allowances for SSH, HTTP, HTTPS, and the two temporarily preserved grading + services, plus outbound ICMP, TCP, and UDP rules for IPv4 and IPv6.} + \label{fig:firewall-configuration-evidence} +\end{figure} + +\begin{figure}[htbp] + \centering + \includegraphics[width=0.62\textwidth]{hw4_images/firewall_external_test_evidence.png} + \caption{Dated external Windows-client evidence showing public ports 22, 80, + 443, 5050, and 8080 reachable while the loopback-only Gitea backend on 3000 + and the unused database port 5432 remain unreachable.} + \label{fig:firewall-external-test-evidence} +\end{figure} + +\paragraph{SSH hardening and firewall attachment.} +An initial attempt in the SSW590 team context was blocked by an account +permissions warning related to the payment method. Switching to the authorized My Team +context resolved that blocker and made the correct Droplet available for +attachment. Before permitting public SSH from arbitrary locations, the team +installed \path{/etc/ssh/sshd_config.d/00-ssw590-ssh-hardening.conf}. It +disables password and keyboard-interactive authentication, permits root only +with a key, and explicitly enables public-key authentication. The file passed +\texttt{sshd -t}, and SSH was reloaded without terminating the active session. +The team then confirmed a new key-authenticated session, confirmed that a +password-only session was rejected, and recorded the following effective +configuration at 23:27:51 UTC: + +\begin{minted}{text} +2026-09-26T23:27:51+00:00 +permitrootlogin without-password +pubkeyauthentication yes +passwordauthentication no +kbdinteractiveauthentication no +\end{minted} + +OpenSSH reports \texttt{without-password} as the effective equivalent of the +configured \texttt{prohibit-password} policy. These human-run checks established +key-only SSH before Cloud Firewall attachment, and the final external test +reconfirmed port 22. These controls support the instructor-cleared exception +for administration from changing locations. + +\clearpage +\section{Startup Team Workflow} +The team created the +\href{https://myfileagent.tech/myfileagent}{\texttt{myfileagent} organization} +and public +\href{https://myfileagent.tech/myfileagent/myfileagent-pipeline}{\texttt{myfileagent-pipeline} product repository} +with an initialized +\href{https://myfileagent.tech/myfileagent/myfileagent-pipeline/src/branch/main/README.md}{\texttt{README.md}}. +The organization contains \texttt{nkogut} and \texttt{glovely} in the Owners +team. The supplied configuration evidence confirms that both accounts are +active and have the team's intended site-administrator role. Both accounts +also participate in the organization's Owners team so that either team member +can administer the shared startup workspace. + +The repository contains five actionable product and operations issues. Issue +\#1 traces the MyFileAgent product-scope documentation through branch +\texttt{issue-1-product-scope} and Pull Request~\#6: \texttt{nkogut} authored +the merged change and the linked issue closed. Issue~\#4 traces the versioned Gitea deployment +through branch \texttt{issue-4-gitea-deployment} and Pull Request~\#7: +\texttt{glovely} authored the merged change and the linked issue closed. The +remaining issues retain the product and operations backlog. + +The team then completed reciprocal approval on two additional merged changes: +\texttt{nkogut} authored Pull Request~\#8 and \texttt{glovely} submitted an +\texttt{APPROVED} review; \texttt{glovely} authored Pull Request~\#9 and +\texttt{nkogut} submitted an \texttt{APPROVED} review. The dated evidence also +shows both intended administrator accounts. Pull Request~\#8 references closed +operations Issue~\#4, while Pull Request~\#9 references closed product Issue~\#1. +Figure~\ref{fig:gitea-configuration-evidence} therefore records two complete +issue-linked, reciprocally reviewed, merged, and closed workflow traces while +leaving unfinished Issues~\#2, \#3, and \#5 open. + +\noindent\textit{Evidence note.} This image was captured on September 26, +2026, before the organization and repository received their current names. +The displayed \texttt{filepilot/filepilot-pipeline} repository is the same +repository now available as +\texttt{myfileagent/myfileagent-pipeline}; its issues, pull requests, reviews, +and history were preserved. + +\begin{figure}[H] + \centering + \includegraphics[width=0.72\textwidth]{hw4_images/gitea_configuration_evidence.png} + \caption{Dated Gitea configuration and workflow evidence showing both + administrator accounts, the public MyFileAgent repository, five actionable + issues, merged Pull Requests~\#8 and \#9 linked to closed Issues~\#4 and + \#1, and reciprocal approved reviews.} + \label{fig:gitea-configuration-evidence} +\end{figure} + +\FloatBarrier + +\section{Architecture and Operation} +The production request path is browser to DigitalOcean Cloud Firewall to Caddy +on 443, then Caddy to +\texttt{gitea:3000} over the private Compose bridge network. Gitea reads its SQLite +file and repository data from persistent Docker volumes. There is no public +Gitea application or database port. Caddy is configured for both the edge and +private networks; Gitea is attached only to the private network. Public +isolation is enforced by the loopback host binding and firewall rather than +Docker's \texttt{internal} network flag. An initial attempt using that flag +left the requested loopback publication unprogrammed, causing an empty browser +response; the team corrected the network definition while preserving the +named data volumes. An authenticated SSH local-forward remains available as an +administrative fallback and was verified before public activation. + +Figure~\ref{fig:gitea-architecture} adapts the assignment reference to the +team's actual SQLite deployment. Solid arrows show the active public HTTPS +request path, the dashed arrow shows the verified SSH-tunnel fallback, +and the data arrow terminates in Docker-managed persistent storage rather than +the disposable Gitea container layer. + +\begin{figure}[htbp] + \centering + \begin{tikzpicture}[ + node distance=9mm and 12mm, + component/.style={draw, rounded corners, align=center, minimum height=12mm, + text width=2.45cm, fill=devopsLightBlue}, + private/.style={draw, rounded corners, align=center, minimum height=12mm, + text width=2.45cm, fill=green!10}, + data/.style={draw, cylinder, shape border rotate=90, aspect=0.28, + align=center, minimum height=15mm, text width=2.55cm, fill=gray!12}, + flow/.style={-{Latex[length=2.5mm]}, thick}, + tunnel/.style={-{Latex[length=2.5mm]}, thick, dashed} + ] + \node[component] (browser) {Public browser\\HTTPS}; + \node[component, right=of browser] (firewall) {DigitalOcean\\Cloud Firewall}; + \node[component, right=of firewall] (caddy) {Caddy proxy\\\texttt{https} profile}; + \node[private, right=of caddy] (gitea) {Gitea\\\texttt{gitea:3000}}; + \node[data, below=of gitea] (storage) {\texttt{gitea-data}\\repositories +\\SQLite file}; + \node[component, below=of browser] (admin) {Team admin\\SSH client}; + \node[component, below=of firewall] (sshd) {Host OpenSSH\\key-only}; + + \draw[flow] (browser) -- node[above, font=\tiny]{443 / optional 80} (firewall); + \draw[flow] (firewall) -- node[above, font=\tiny]{80, 443} (caddy); + \draw[flow] (caddy) -- node[above, font=\tiny]{private} (gitea); + \draw[flow] (gitea) -- node[right, font=\scriptsize]{mounted path} (storage); + \draw[tunnel] (admin) -- node[above, font=\scriptsize]{22/TCP} (sshd); + \draw[tunnel] (sshd) -| node[pos=0.72, below, font=\scriptsize]{\texttt{127.0.0.1:3000}} (gitea); + \end{tikzpicture} + \caption{MyFileAgent Gitea request, administration, and persistence paths. + Caddy alone publishes the web edge; Gitea and its SQLite data remain private.} + \label{fig:gitea-architecture} +\end{figure} + +\FloatBarrier + +The service is operated from \path{/home/codex/myfileagent-gitea} with +\texttt{docker compose}. Container status, recent logs, loopback HTTP response, +volume presence, and memory availability were checked after startup. This +startup check is not the required persistence-replacement test and is not a +backup or restore test. + +Routine restart and first-line troubleshooting use the versioned Compose +project and do not delete named volumes: + +\begin{minted}{bash} +cd /home/codex/myfileagent-gitea +docker compose restart gitea +docker compose ps +docker compose logs --tail=100 gitea +curl -fsS -o /dev/null -w 'loopback_http=%{http_code}\n' \ + http://127.0.0.1:3000/ +docker inspect myfileagent-gitea \ + --format '{{range .Mounts}}{{println .Name "->" .Destination}}{{end}}' +\end{minted} + +Operators first check container state and recent logs, then the loopback HTTP +response and expected volume mounts. If public HTTPS fails while the +loopback check succeeds, the fault domain moves outward to the private proxy +network, Caddy logs, certificate state, DNS, and Cloud Firewall. A routine +restart reuses the existing volumes; the completed container-replacement test +proved persistence across replacement. Neither operation proves recoverability +from deletion or corruption, so neither is described as a backup/restore test. + +\section{Manual Quality and Controls} +This chapter distinguishes observed results from planned or optional work. The +Hosts table records the current Droplet name, capacity, address, and non-root +administrative account, the private SSH-forwarded fallback, and the active +public hostname \texttt{myfileagent.tech}. The Passwords table +records only the Bitwarden entry names \texttt{Gitea - Nick}, +\texttt{Gitea - Gowri}, and \texttt{.tech Domain} for the individual +\texttt{nkogut} and \texttt{glovely} accounts and registrar access; it contains +no passwords or derivation information. This Assignment 4 work uses one +consolidated history entry and one consolidated AI-assistance entry. The +required implementation and evidence are complete, with an instructor-cleared +SSH source-policy exception documented above. The optional backup/restore test +is recorded separately below and is not counted among the eight required +rubric items. Version~1.6.1 was compiled and visually inspected after the final +content and layout updates. + +\clearpage +\section{Optional Extra Credit: Verified Backup and Restore} +\index{backup and restore} +\index{Gitea!backup and restore} + +\paragraph{Completion status.} +The team completed and documented every part of the optional extra credit: +\begin{enumerate}[label=\arabic*.,leftmargin=*,nosep] + \item a dated backup method with its scope and temporary storage location; + \item a sanitized archive listing and a consistent cold-backup procedure; and + \item a pre-backup repository and issue, isolated restore, repository and + issue usability checks, labeled original/restored screenshots, and a + dated PASS outcome with cleanup evidence. +\end{enumerate} + +On September 29, 2026, the team created the public +\href{https://myfileagent.tech/nkogut/backup-restore-proof}{\texttt{nkogut/backup-restore-proof}} +repository with an initialized \texttt{main} branch and open Issue~\#1, +``Verify repository and issue survive isolated restore.'' Both records existed +before the backup and served as recovery acceptance criteria. + +\paragraph{Backup method and consistency.} +The team used a \phantomsection\label{GlossaryRef:coldbackup}cold backup so the +SQLite database, repositories, +attachments, and application files belonged to one recoverable point in time. +It stopped only the production Gitea container, archived the +\texttt{myfileagent-gitea\_gitea-data} and +\texttt{myfileagent-gitea\_gitea-config} volumes, then immediately restarted +Gitea. Caddy, the firewall, and the earlier grading services were unchanged. +Production was stopped at 20:19:13 UTC and healthy again at 20:19:17 UTC. + +The archive was stored temporarily at +\path{/home/codex/myfileagent-gitea/backups/} +\path{myfileagent-gitea-backup-20260929T201913Z.tar.gz}. It was 117~KiB and +had SHA-256 digest +\texttt{b58b378bf1fca318160c0df370552e80ebfe967351daf3b88256c37e59bbe716}. +The backup command used read-only source mounts: + +\begin{minted}{bash} +docker compose stop gitea +docker run --rm -u "$(id -u):$(id -g)" \ + -v myfileagent-gitea_gitea-data:/source/data:ro \ + -v myfileagent-gitea_gitea-config:/source/config:ro \ + -v /home/codex/myfileagent-gitea/backups:/backup \ + caddy:2.11.4-alpine \ + sh -c 'tar -czf /backup/myfileagent-gitea-backup-20260929T201913Z.tar.gz \ + -C /source data config' +docker compose up -d gitea +\end{minted} + +The sanitized listing showed both the SQLite database and repository objects +inside the same archive: + +\begin{minted}{text} +data/data/gitea.db +data/git/repositories/nkogut/backup-restore-proof.git/HEAD +data/git/repositories/nkogut/backup-restore-proof.git/refs/heads/main +production_after=nkogut/backup-restore-proof state=available +production_issue_after=#1 state=open +backup_phase=PASS +\end{minted} + +\paragraph{Isolated restore and verification.} +The archive was extracted into new volumes +\texttt{myfileagent-restore-gitea-data} and +\texttt{myfileagent-restore-gitea-config}. A separate container named +\texttt{myfileagent-gitea-restore-test} used the same pinned Gitea image and +published only \texttt{127.0.0.1:3300}; it was never added to Caddy or the +Cloud Firewall. The production volumes were not mounted into the restore +container. + +\begin{minted}{bash} +docker volume create myfileagent-restore-gitea-data +docker volume create myfileagent-restore-gitea-config +docker run --rm -u 0 \ + -v myfileagent-restore-gitea-data:/restore/data \ + -v myfileagent-restore-gitea-config:/restore/config \ + -v /home/codex/myfileagent-gitea/backups:/backup:ro \ + caddy:2.11.4-alpine \ + sh -c 'tar -xzf /backup/myfileagent-gitea-backup-20260929T201913Z.tar.gz \ + -C /restore && chown -R 1000:1000 /restore/data /restore/config' + +docker run -d --name myfileagent-gitea-restore-test --restart no \ + -p 127.0.0.1:3300:3000 \ + -e GITEA__server__ROOT_URL=http://127.0.0.1:3300/ \ + -e GITEA__server__DISABLE_SSH=true \ + -v myfileagent-restore-gitea-data:/var/lib/gitea \ + -v myfileagent-restore-gitea-config:/etc/gitea \ + docker.gitea.com/gitea:1.27.3-rootless +\end{minted} + +The restored \phantomsection\label{AcronymRef:API}API returned the same public +repository, default branch, and open +issue. A Git smart-HTTP \texttt{ls-remote} request returned two refs, showing +that the repository was usable rather than merely listed. Production remained +healthy throughout the isolated restore test. + +\begin{minted}{text} +restore_ready=1 +restored_repo=nkogut/backup-restore-proof default_branch=main private=false +restored_issue=#1 Verify repository and issue survive isolated restore state=open +restored_git_refs=2 +restore_port=127.0.0.1:3300 +production_status=1.27.3 +restore_phase=PASS +\end{minted} + +\begin{figure}[htbp] + \centering + \begin{minipage}[t]{0.49\textwidth} + \centering + \textbf{Production repository}\par\smallskip + \includegraphics[width=\linewidth,trim=0 450 0 0,clip]{hw4_images/backup_original_repository.png} + \end{minipage}\hfill + \begin{minipage}[t]{0.49\textwidth} + \centering + \textbf{Isolated restored repository}\par\smallskip + \includegraphics[width=\linewidth,trim=0 450 0 0,clip]{hw4_images/backup_restored_repository.png} + \end{minipage} + \caption{The initialized proof repository in production and in the separate + loopback-only restored Gitea instance.} + \label{fig:gitea-backup-repository-evidence} +\end{figure} + +\begin{figure}[htbp] + \centering + \begin{minipage}[t]{0.49\textwidth} + \centering + \textbf{Production Issue \#1}\par\smallskip + \includegraphics[width=\linewidth,trim=0 130 0 0,clip]{hw4_images/backup_original_issue.png} + \end{minipage}\hfill + \begin{minipage}[t]{0.49\textwidth} + \centering + \textbf{Restored Issue \#1}\par\smallskip + \includegraphics[width=\linewidth,trim=0 130 0 0,clip]{hw4_images/backup_restored_issue.png} + \end{minipage} + \caption{The same open issue and pre-backup description in production and + in the isolated restored instance.} + \label{fig:gitea-backup-issue-evidence} +\end{figure} + +The full sanitized command record is retained as +\path{backup_restore_evidence.txt} in the Assignment 4 working directory. It +contains no archive contents, credentials, private keys, or access tokens. The +backup archive itself is not part of the submitted manual. After evidence +capture, the team removed the temporary restore container, both restore +volumes, and the sensitive archive at 20:25:38 UTC. Each cleanup check reported +\texttt{PASS}, and the production proof repository remained available. + +\begin{minted}{text} +restore_container_removed=PASS +restore_volumes_removed=PASS +backup_archive_removed=PASS +production_repo=nkogut/backup-restore-proof available +cleanup_completed=2026-09-29T20:25:38+00:00 +\end{minted} diff --git a/documentation/devopsGlossary.tex b/documentation/devopsGlossary.tex new file mode 100644 index 0000000..d92e1f2 --- /dev/null +++ b/documentation/devopsGlossary.tex @@ -0,0 +1,20 @@ +% Assignment 2 glossary: only terms directly used in the assignment. +% Each page number is an explicit hyperlink to the corresponding occurrence. +\chapter*{Glossary} +\markboth{Glossary}{Glossary} +\index{glossary} + +\begin{description}[style=nextline,leftmargin=3.1cm,labelindent=0pt] +\item[\textbf{ACME}] The automated protocol Caddy uses to obtain and renew the MyFileAgent TLS certificate. \hfill Reference: \hyperref[GlossaryRef:acme]{p.~\pageref*{GlossaryRef:acme}} +\item[\textbf{Cloud Firewall}] A DigitalOcean network-boundary control that permits only selected inbound traffic before it reaches the Droplet. \hfill Reference: \hyperref[GlossaryRef:cloudfirewall]{p.~\pageref*{GlossaryRef:cloudfirewall}} +\item[\textbf{cold backup}] A consistent backup taken while the application writing the data is stopped. \hfill Reference: \hyperref[GlossaryRef:coldbackup]{p.~\pageref*{GlossaryRef:coldbackup}} +\item[\textbf{Docker volume}] Docker-managed persistent storage whose contents survive replacement of the container that mounts it. \hfill Reference: \hyperref[GlossaryRef:dockervolume]{p.~\pageref*{GlossaryRef:dockervolume}} +\item[\textbf{Gitea}] A self-hosted software-development service providing Git repositories, issues, organizations, and pull requests. \hfill Reference: \hyperref[GlossaryRef:gitea]{p.~\pageref*{GlossaryRef:gitea}} +\item[\textbf{loopback interface}] A host-local interface; binding Gitea to \texttt{127.0.0.1} prevents direct access through the Droplet's public interface. \hfill Reference: \hyperref[GlossaryRef:loopback]{p.~\pageref*{GlossaryRef:loopback}} +\item[\textbf{reverse proxy}] A service that accepts public requests and forwards them to a private backend; Caddy performs this role for Gitea. \hfill Reference: \hyperref[GlossaryRef:reverseproxy]{p.~\pageref*{GlossaryRef:reverseproxy}} +\item[\textbf{SQLite}] An embedded database stored in a local file rather than a separately exposed database service. \hfill Reference: \hyperref[GlossaryRef:sqlite]{p.~\pageref*{GlossaryRef:sqlite}} +\item[\textbf{TLS}] The protocol that authenticates the HTTPS endpoint and encrypts browser traffic. \hfill Reference: \hyperref[GlossaryRef:tls]{p.~\pageref*{GlossaryRef:tls}} +\item[\textbf{build artifact}] A file produced by a workflow and retained with its run for download. \hfill Reference: \hyperref[GlossaryRef:buildartifact]{p.~\pageref*{GlossaryRef:buildartifact}} +\item[\textbf{build identity}] The manual version combined with the triggering Git revision and workflow run identifier. \hfill Reference: \hyperref[GlossaryRef:buildidentity]{p.~\pageref*{GlossaryRef:buildidentity}} +\item[\textbf{Actions runner}] A registered worker that requests Gitea workflow jobs and executes them in its configured environment. \hfill Reference: \hyperref[GlossaryRef:actionsrunner]{p.~\pageref*{GlossaryRef:actionsrunner}} +\end{description} diff --git a/documentation/devopsHosts.tex b/documentation/devopsHosts.tex new file mode 100644 index 0000000..9317cb0 --- /dev/null +++ b/documentation/devopsHosts.tex @@ -0,0 +1,20 @@ +\chapter{Hosts} +\ChapterLabel{Hosts} +\index{hosts} +\index{DigitalOcean} + +\section{Overview} +This chapter lists the hosts used in the development environment for this +assignment and any that will be configured in future assignments. + +\section{Host Registry} +\begin{tabularx}{\linewidth}{L{3.4cm}L{2.6cm}Y} +\caption{Host Registry\label{Table:HostRegistry}}\\ +\toprule \textbf{Host Name} & \textbf{Provider} & \textbf{Purpose / Notes}\\ \midrule +\endfirsthead +\multicolumn{3}{l}{\small\itshape Host Registry (continued)}\\ +\toprule \textbf{Host Name} & \textbf{Provider} & \textbf{Purpose / Notes}\\ \midrule +\endhead \bottomrule \endlastfoot +\texttt{ssw590-group7-}\newline\texttt{droplet} & DigitalOcean & Ubuntu Linux development environment at \texttt{142.93.193.110}; 1 virtual CPU, 1 GB memory, and 25 GB storage; administered through the non-root \texttt{codex} account. Hosts the MyFileAgent Gitea service at \href{https://myfileagent.tech}{\texttt{myfileagent.tech}} through Caddy-managed HTTPS. Gitea remains bound to \texttt{127.0.0.1:3000}; an authenticated SSH local forward is retained as an administrative fallback.\\ +\texttt{assignment5-manual} & Existing Droplet & Repository-scoped Actions runner ID 1; temporary TeX jobs on the same host. Team-owned, capacity one, no public runner/compiler ports; runner 192 MiB and jobs 256 MiB. HTTPS to \href{https://myfileagent.tech}{Gitea}; separate Docker bridges. Runner state is outside Git; service health was checked during setup. See \ChapterRef{AutomatedManualBuild}.\\ +\end{tabularx} diff --git a/documentation/devopsIntroduction.tex b/documentation/devopsIntroduction.tex new file mode 100644 index 0000000..e3a9aac --- /dev/null +++ b/documentation/devopsIntroduction.tex @@ -0,0 +1,86 @@ +\chapter{Introduction} +\ChapterLabel{Introduction} +\index{introduction} +\index{Linux} +\index{Docker} +\index{DigitalOcean} +\index{LaTeX} + +\section{Assignment Purpose} +This report records the team's developing DevOps environment and the work +completed through Assignment 4, together with the Assignment 5 automated +manual-build work described in \ChapterRef{AutomatedManualBuild}. The earlier chapters establish Linux +\phantomsection\label{GlossaryRef:bash}Bash command-line skills, the Ubuntu working environment, host configuration, and +password-management concepts. The current assignment extends that foundation +by deploying Docker Engine on a DigitalOcean Droplet, containerizing two Node.js +websites, redesigning the two-button website with class-based JavaScript, and +using a TeX Live container to compile a simple LaTeX document. The report also +proposes the MyFileAgent Pipeline, a Python-based DevSecOps project centered on a +one-click workflow that installs dependencies, configures the environment, +builds containers, runs tests and security checks, deploys to DigitalOcean, and +verifies and monitors the result. A deliberately limited LLM file-replacement +task serves only as the pipeline's working demonstration. Assignment 4 adds a +version-pinned Gitea service with SQLite persistence, a Student Pack domain, +Caddy-managed HTTPS, a DigitalOcean Cloud Firewall, and a verified two-member +repository workflow. + +\section{Team and Environment} +The work was completed by Nicholas Kogut and Gowri Das Lovely. The execution +environment is an Ubuntu Linux Droplet hosted on DigitalOcean, accessed remotely +with PuTTY. Docker provides the repeatable application environments used for +the Node.js and LaTeX workflows. Assignment 5 moves the complete report source into the team Gitea repository +and targets Gitea Actions for the submission PDF; operational verification is +recorded in \ChapterRef{AutomatedManualBuild}. +Authentication secrets, passwords, and private keys are not included in this +report. + +\section{Assignment Requirements} +The retained earlier assignments required the team to: +\begin{enumerate}[label=\arabic*.] + \item create a DigitalOcean Droplet, install Docker Engine on Ubuntu, and + document the deployment commands and website links using minted LaTeX; + \item deploy the Hello World and two-button Node.js websites in Docker + containers; + \item replace the two-button page's direct JavaScript handlers with a reusable + class-based design and present its UML class diagram; + \item create and document a TeX Live Docker container that compiles a simple + LaTeX document into a \phantomsection\label{AcronymRef:PDF}PDF; and + \item propose a one-click DevSecOps pipeline, a minimal working demonstration, + its DigitalOcean environment, Python toolchain, Grafana monitoring, + comparison plan, testing strategy, and security controls. + \item establish the MyFileAgent startup foundation with pinned Gitea, + persistent SQLite storage, a two-member issue and pull-request + workflow, a Student Pack domain, HTTPS, and controlled external + exposure. +\end{enumerate} + +\paragraph{Assignment 5 scope.} +Implement Chapter 3 of the instruction PDF, \texttt{dosManual-V1.18.pdf}: +version the full manual source, configure a self-managed Gitea runner, build +on source pushes, embed commit/run identity, publish a PDF artifact, and +record two successful source changes plus a controlled compile failure and +repair. Chapter 4 of the instruction PDF is outside the current scope. + +\section{Report Organization} +\ChapterRef{LinuxCommands} and \ChapterRef{LinuxProblemSet} retain the Linux +environment setup, command record, questions, solutions, and observed outputs. +\ChapterRef{Hosts} and \ChapterRef{Passwords} document the related host and +credential-management exercises. \ChapterRef{DigitalOceanDockerDeployment} +records the Droplet, Docker installation, Node.js deployments, class-based +JavaScript, and UML class diagram. \ChapterRef{LatexDocker} presents the TeX Live +container, sample source, build commands, and verification procedure. +\ChapterRef{ProjectProposal} describes the MyFileAgent Pipeline, its one-click +workflow, Python demonstration, tests, security gates, deployment, +Grafana-based observability, comparison strategy, and delivery plan. +\ChapterRef{GiteaStartupFoundation} records the verified Gitea foundation and +its domain, HTTPS, persistence, firewall, workflow, architecture, and operating +evidence. +\AppendixRef{AIPromptLog} records material \phantomsection\label{AcronymRef:AI}AI +assistance used to organize, author, and review the report. + +\section{Submission and Verification} +Assignment 4 evidence is retained as a historical record. Assignment 5 is +complete only after the runner, workflow, versioned artifacts, and failure/repair +exercise are verified. Submit only the PDF downloaded from the final successful +Gitea Actions run after visual and navigation checks; a local draft is not the +final submission. Current status appears in \ChapterRef{AutomatedManualBuild}. diff --git a/documentation/devopsLatexDocker.tex b/documentation/devopsLatexDocker.tex new file mode 100644 index 0000000..b7d60c9 --- /dev/null +++ b/documentation/devopsLatexDocker.tex @@ -0,0 +1,105 @@ +% !TeX root = main.tex +% This is an included chapter. Compile the top-level main.tex for the full report. +\chapter{LaTeX Docker} +\ChapterLabel{LatexDocker} +\index{Docker!LaTeX container} +\index{LaTeX!Docker compilation} +\index{TeX Live} + +\section{Purpose and Design} + +Assignment 3 Step 4 requires a Docker container that compiles a simple LaTeX +document with TeX Live, which is the TeX distribution used by Overleaf. The +project separates the build environment from the host computer: the Docker +image installs the required TeX Live package, copies the source document into +the image, and runs \texttt{pdflatex}. A bind mount returns the generated PDF +and supporting files to an \texttt{output} directory on the host. + +The project has the following structure: + +\begin{minted}{text} +latex-docker/ +|-- Dockerfile +|-- .dockerignore +|-- sample-source.txt +`-- output/ +\end{minted} + +\section{Sample LaTeX Document} + +The container compiles the following small source document. It uses only the +base LaTeX packages installed in the image. + +\inputminted{latex}{latex-docker/sample-source.txt} + +\section{Dockerfile} + +The image uses a small Debian base and installs +\texttt{texlive-latex-base} together with the recommended fonts needed by the +sample document. Removing the APT package lists keeps the resulting image +smaller. + +\begin{minted}{dockerfile} +FROM debian:bookworm-slim + +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + texlive-latex-base \ + lmodern \ + && rm -rf /var/lib/apt/lists/* + +WORKDIR /workspace +COPY sample-source.txt . + +CMD ["pdflatex", "-interaction=nonstopmode", \ + "-halt-on-error", "sample-source.txt"] +\end{minted} + +The Docker build context excludes generated and editor-specific files. + +\begin{minted}{text} +output/ +*.aux +*.log +*.pdf +.git +.DS_Store +\end{minted} + +\section{Build and Run Procedure} + +From the \texttt{latex-docker} directory, the output directory is created and +the Docker image is built with the tag \texttt{latex-compiler}. + +\begin{minted}{bash} +cd latex-docker +mkdir -p output +sudo docker build -t latex-compiler . +\end{minted} + +The container is then run with the host output directory mounted at +\texttt{/workspace/output}. The command overrides the default container command +so that all generated files are written to the mounted location. The container +is removed automatically after compilation. + +\begin{minted}{bash} +sudo docker run --rm \ + -v "$(pwd)/output:/workspace/output" \ + latex-compiler \ + pdflatex -interaction=nonstopmode -halt-on-error \ + -output-directory=/workspace/output sample-source.txt +\end{minted} + +\section{Verification} + +The following commands verify that the container exited successfully and that +the expected PDF was written to the host. + +\begin{minted}{bash} +ls -lh output/sample-source.pdf +file output/sample-source.pdf +\end{minted} + +The expected result is a valid PDF named \texttt{sample-source.pdf}. Because the build +environment is encoded in the Dockerfile, the same source and image definition +can be used on another Docker host to obtain a consistent compilation workflow. diff --git a/documentation/devopsLinuxCommands.tex b/documentation/devopsLinuxCommands.tex new file mode 100644 index 0000000..00f245e --- /dev/null +++ b/documentation/devopsLinuxCommands.tex @@ -0,0 +1,148 @@ +\chapter{Linux Commands} +\ChapterLabel{LinuxCommands} +\index{Linux} +\index{Linux!commands} +\index{DigitalOcean} +\index{PuTTY} + +\section{Purpose} +This chapter documents the Linux command-line activities completed for +Assignment 2. The commands were executed on an Ubuntu Linux Droplet hosted +on DigitalOcean. PuTTY was used to establish a secure remote terminal +connection to the Droplet. + +The activity created a controlled working directory containing text, \phantomsection\label{AcronymRef:CSV}CSV, +log, binary, directory, symbolic-link, and timestamped test artifacts. These +artifacts will be used to complete the Linux problem set. + +\section{Execution Environment} +Table~\ref{Table:LinuxEnvironment} summarizes the environment used for this +activity. Passwords, private keys, and complete authentication credentials +are not included. + +\begin{table}[htbp] +\centering +\caption{Linux command execution environment} +\label{Table:LinuxEnvironment} +\begin{tabularx}{\linewidth}{L{0.28\linewidth}Y} +\toprule +\textbf{Environment Item} & \textbf{Configuration} \\ +\midrule +Cloud platform & DigitalOcean \\ +Virtual host & Ubuntu Droplet \\ +Droplet name & \texttt{ssw590-group7-droplet} \\ +Droplet configuration & 1 virtual CPU, 1 GB memory, and 25 GB storage \\ +Remote-access tool & PuTTY \\ +Operating system & Ubuntu Linux \\ +Remote user & \texttt{root} \\ +Working directory & \texttt{/root/lx-test} \\ +Activity status & Initial test environment successfully created \\ +\bottomrule +\end{tabularx} +\end{table} + +\section{Test Environment Setup} +The following instructor-provided commands were executed in the DigitalOcean +Ubuntu terminal. \phantomsection\label{AcronymRef:EE}\phantomsection\label{AcronymRef:CS} to perform the setup steps required for the problem set. These commands normally produce no terminal output when they +complete successfully. + +\begin{lstlisting}[language=bash,caption={Initial DigitalOcean terminal record},label={Listing:InitialTerminalRecord}] +root@ubuntu-s-1vcpu-512mb-10gb-nyc1:~# +mkdir -p ~/lx-test && cd ~/lx-test + +root@ubuntu-s-1vcpu-512mb-10gb-nyc1:~/lx-test# +printf "alpha\nbeta\nGamma\ngamma\nbeta\n" > words.txt + +root@ubuntu-s-1vcpu-512mb-10gb-nyc1:~/lx-test# +printf "id,name,dept\n1,Ada,EE\n2,Linus,CS\n3,Grace,EE\n4,Dennis,CS\n" > people.csv + +root@ubuntu-s-1vcpu-512mb-10gb-nyc1:~/lx-test# +printf "INFO boot ok\nWARN disk low\nERROR fan fail\nINFO shutdown\n" > sys.log + +root@ubuntu-s-1vcpu-512mb-10gb-nyc1:~/lx-test# +dd if=/dev/zero of=blob.bin bs=1K count=48 status=none + +root@ubuntu-s-1vcpu-512mb-10gb-nyc1:~/lx-test# +mkdir -p src/lib tmp archive + +root@ubuntu-s-1vcpu-512mb-10gb-nyc1:~/lx-test# +printf "one two three four\n" > src/file1.txt + +root@ubuntu-s-1vcpu-512mb-10gb-nyc1:~/lx-test# +printf "two three four five\n" > src/file2.txt + +root@ubuntu-s-1vcpu-512mb-10gb-nyc1:~/lx-test# +ln -s src/file1.txt link-to-file1 + +root@ubuntu-s-1vcpu-512mb-10gb-nyc1:~/lx-test# +touch -t 202401020304 old.txt +root@ubuntu-s-1vcpu-512mb-10gb-nyc1:~/lx-test# +\end{lstlisting} + +\begin{comment} +\section{Created Artifacts} +The setup commands created the artifacts summarized in +Table~\ref{Table:LinuxArtifacts}. + +\footnotesize +\begin{longtable}{L{0.25\linewidth}L{0.22\linewidth}L{0.42\linewidth}} +\caption{Artifacts created by the Linux setup commands}\label{Table:LinuxArtifacts}\\ +\toprule +\textbf{Artifact} & \textbf{Type} & \textbf{Purpose or Contents} \\ +\midrule +\endfirsthead +\multicolumn{3}{l}{\footnotesize\itshape Created Linux artifacts (continued)}\\ +\toprule +\textbf{Artifact} & \textbf{Type} & \textbf{Purpose or Contents} \\ +\midrule +\endhead +\bottomrule +\endlastfoot +\texttt{words.txt} & Text file & Contains mixed-case and repeated words for sorting and filtering.\\ +\texttt{people.csv} & CSV file & Contains a header and four EE and CS personnel records.\\ +\texttt{sys.log} & Log file & Contains INFO, WARN, and ERROR entries for searching and filtering.\\ +\texttt{blob.bin} & Binary file & Contains 48 KiB of zero-valued data from \texttt{/dev/zero}.\\ +\texttt{src/} & Directory & Contains two text files and the nested \texttt{lib/} directory.\\ +\texttt{tmp/} & Directory & Temporary working location for later commands.\\ +\texttt{archive/} & Directory & Destination for later archive operations.\\ +\texttt{src/file1.txt} & Text file & Contains \texttt{one two three four}.\\ +\texttt{src/file2.txt} & Text file & Contains \texttt{two three four five}.\\ +\texttt{link-to-file1} & Symbolic link & Points to \texttt{src/file1.txt}.\\ +\texttt{old.txt} & Timestamped file & Modification time set to January 2, 2024 at 03:04.\\ +\end{longtable} +\normalsize + +\section{Initial Terminal Record} +The following record reproduces the observed terminal interaction. The return +of the shell prompt without an error indicates that each silent setup command +was accepted. + + + +\section{Verification Procedure} +The following commands will verify the working directory, created files, +directory hierarchy, symbolic link, file contents, binary size, and timestamp. + +\begin{lstlisting}[language=bash,caption={Linux test-environment verification commands},label={Listing:LinuxVerificationCommands}] +pwd +ls -lah +find . -maxdepth 3 -type d | sort +cat words.txt +cat people.csv +cat sys.log +cat src/file1.txt +cat src/file2.txt +ls -l link-to-file1 +cat link-to-file1 +stat -c "%n: %s bytes" blob.bin +stat -c "%n: %y" old.txt +\end{lstlisting} + +The observed output will be added after the team executes these verification +commands on the shared Droplet. + +\section{Linux Problem Set} +The solutions to \texttt{linuxProblemSet.pdf} will be added to this section +after the problem set is reviewed. Each solution will include the executed +command, relevant output, and a concise explanation. +\end{comment} diff --git a/documentation/devopsLinuxProblemSet.tex b/documentation/devopsLinuxProblemSet.tex new file mode 100644 index 0000000..81ef50d --- /dev/null +++ b/documentation/devopsLinuxProblemSet.tex @@ -0,0 +1,607 @@ +\chapter{Linux Command Problem Set} +\ChapterLabel{LinuxProblemSet} +\index{Linux!problem set} + +\section{Execution Guidance} +The following answers are written for the test environment created in \ChapterRef{LinuxCommands}. Commands were suggested by AI for the team to run, then verified by the team before execution; the team made changes as needed, ran the commands, and gathered the outputs. All problem-set commands and recorded outputs were executed and collected by humans, not by AI. Commands were executed from \texttt{/root/lx-test}. + +\section{Problem Set} + +\subsection*{A) Navigation \& File Ops} +\begin{enumerate}[label=\textbf{\arabic*.},leftmargin=*,start=1] +\item \textbf{Show your present working directory path only.} +\index{Linux command!pwd} +\begin{lstlisting}[language=bash] +pwd +\end{lstlisting} +\textbf{Observed output:} +\begin{lstlisting} +/root/lx-test +\end{lstlisting} +The command reports the current working directory used for the problem set. +\item \textbf{List all entries in the current directory, one per line, including dotfiles.} +\index{Linux command!ls} +\begin{lstlisting}[language=bash] +ls -a1 +\end{lstlisting} +\textbf{Observed output:} +\begin{lstlisting} +. +.. +archive +blob.bin +link-to-file1 +old.txt +people.csv +src +sys.log +tmp +words.txt +\end{lstlisting} +The `-a` option includes dotfiles and the `-1` option displays one entry per line. +\item \textbf{Copy `src/file1.txt` to `tmp/` only if `tmp` exists; do it verbosely.} +\index{Linux command!cp} +\begin{lstlisting}[language=bash] +[ -d tmp ] && cp -v src/file1.txt tmp/ +\end{lstlisting} +\textbf{Observed output:} +\begin{lstlisting} +'src/file1.txt' -> 'tmp/file1.txt' +\end{lstlisting} +The conditional copy runs only when `tmp` exists, and verbose mode reports the copy operation. +\item \textbf{Move `old.txt` into `archive/` and keep its original timestamp.} +\index{Linux command!mv} +\begin{lstlisting}[language=bash] +mv -v old.txt archive/ +\end{lstlisting} +\textbf{Observed output:} +\begin{lstlisting} +renamed 'old.txt' -> 'archive/old.txt' +\end{lstlisting} +The move is performed as a rename within the same filesystem, so the file's modification timestamp is retained. +\item \textbf{Create a new empty file `notes.md` only if it does not already exist.} +\index{Linux command!touch} +\begin{lstlisting}[language=bash] +[ -e notes.md ] || touch notes.md +\end{lstlisting} +\textbf{Observed output:} +\begin{lstlisting} +(no terminal output) +\end{lstlisting} +The existence test prevents `touch` from changing an existing file's timestamp. +\item \textbf{Show human-readable disk usage for the `src` directory only.} +\index{Linux command!du} +\begin{lstlisting}[language=bash] +du -sh src +\end{lstlisting} +\textbf{Observed output:} +\begin{lstlisting} +16K src +\end{lstlisting} +The command reports the allocated disk usage for `src` in human-readable form. +\end{enumerate} + +\subsection*{B) Viewing \& Searching} +\begin{enumerate}[label=\textbf{\arabic*.},leftmargin=*,start=7] +\item \textbf{Print line numbers while displaying `sys.log`.} +\index{Linux command!nl} +\begin{lstlisting}[language=bash] +nl -ba sys.log +\end{lstlisting} +\textbf{Observed output:} +\begin{lstlisting} + 1 INFO boot ok + 2 WARN disk low + 3 ERROR fan fail + 4 INFO shutdown +\end{lstlisting} +The `-b` option numbers all lines, including blank lines if present. +\item \textbf{Show only lines in `sys.log` containing `ERROR`, case-sensitively.} +\index{Linux command!grep} +\begin{lstlisting}[language=bash] +grep 'ERROR' sys.log +\end{lstlisting} +\textbf{Observed output:} +\begin{lstlisting} +ERROR fan fail +\end{lstlisting} +The pattern is matched with case sensitivity, so only matching lines are returned. +\item \textbf{Count the distinct words in `words.txt`, case-insensitively.} +\index{Linux command!sort} +\begin{lstlisting}[language=bash] +sort -fu words.txt | wc -l +\end{lstlisting} +\textbf{Observed output:} +\begin{lstlisting} +3 +\end{lstlisting} +Sorting with `-f` and `-u` provides a case-insensitive unique count. +\item \textbf{Show lines in `words.txt` that start with `g` or `G`.} +\index{Linux command!grep} +\begin{lstlisting}[language=bash] +grep -i '^g' words.txt +\end{lstlisting} +\textbf{Observed output:} +\begin{lstlisting} +Gamma +gamma +\end{lstlisting} +The case-insensitive anchored pattern selects lines beginning with the letter `g`. +\item \textbf{Display the first two lines of `people.csv` without an editor.} +\index{Linux command!head} +\begin{lstlisting}[language=bash] +head -n 2 people.csv +\end{lstlisting} +\textbf{Observed output:} +\begin{lstlisting} +id,name,dept +1,Ada,EE +\end{lstlisting} +The command returns the first two lines of the CSV. +\item \textbf{Show the last three lines of `sys.log` and keep following if it grows.} +\index{Linux command!tail} +\begin{lstlisting}[language=bash] +tail -n 3 -f sys.log +\end{lstlisting} +\textbf{Observed output:} +\begin{lstlisting} +WARN disk low +ERROR fan fail +INFO shutdown +^C +\end{lstlisting} +The command displays the current final three lines and then waits for additional lines until interrupted. +\end{enumerate} + +\subsection*{C) Text Processing} +\begin{enumerate}[label=\textbf{\arabic*.},leftmargin=*,start=13] +\item \textbf{Print only the second, name column from `people.csv`, excluding the header.} +\index{Linux command!awk} +\begin{lstlisting}[language=bash] +awk -F, 'NR > 1 {print $2}' people.csv +\end{lstlisting} +\textbf{Observed output:} +\begin{lstlisting} +Ada +Linus +Grace +Dennis +\end{lstlisting} +The `awk` field separator is a comma, and records after the header print field 2. +\item \textbf{Sort `words.txt` case-insensitively and remove duplicates.} +\index{Linux command!tr} +\begin{lstlisting}[language=bash] +tr '[:upper:]' '[:lower:]' < words.txt | sort -u +\end{lstlisting} +\textbf{Observed output:} +\begin{lstlisting} +alpha +beta +gamma +\end{lstlisting} +The pipeline lowercases the input before sorting uniquely. +\item \textbf{Replace every `three` with `3` in all files under `src/` in place, creating `.bak` backups.} +\index{Linux command!sed} +\begin{lstlisting}[language=bash] +find src -type f ! -name '*.bak' -exec sed -i.bak 's/three/3/g' {} + +\end{lstlisting} +\textbf{Observed output:} +\begin{lstlisting} +(no terminal output) +\end{lstlisting} +The command edits matching files in place while excluding existing backup files and creating `.bak` copies. +\textbf{Verification step:} +\begin{lstlisting} +$ cat src/file1.txt +one two 3 four +\end{lstlisting} +The verification command is included as evidence of the resulting file state and is not part of the solution command. +\item \textbf{Print the line, word, and byte counts for every `*.txt` file in `src/`.} +\index{Linux command!wc} +\begin{lstlisting}[language=bash] +find src -type f -name '*.txt' -exec wc -l -w -c {} + +\end{lstlisting} +\textbf{Observed output:} +\begin{lstlisting} + 1 4 15 src/file1.txt + 1 4 16 src/file2.txt + 2 8 31 total +\end{lstlisting} +The command reports line, word, and byte counts for the matching text files and a total. +\end{enumerate} + +\subsection*{D) Permissions \& Ownership} +\begin{enumerate}[label=\textbf{\arabic*.},leftmargin=*,start=17] +\item \textbf{Make `tmp/` readable, writable, and searchable only by its owner.} +\index{Linux command!chmod} +\begin{lstlisting}[language=bash] +chmod 700 tmp +\end{lstlisting} +\textbf{Observed output:} +\begin{lstlisting} +(no terminal output) +\end{lstlisting} +Mode `700` grants the owner read, write, and execute \phantomsection\label{GlossaryRef:permissions}\gls{permissions} while granting none to group or others. +\item \textbf{Give group execute permission to `src/lib` recursively without changing owner or other bits.} +\index{Linux command!chmod} +\begin{lstlisting}[language=bash] +chmod -R g+x src/lib +\end{lstlisting} +\textbf{Observed output:} +\begin{lstlisting} +(no terminal output) +\end{lstlisting} +The recursive `g+x` operation adds group execute permission without changing the other \gls{permissions}. +\item \textbf{Show the numeric octal permissions of `src/file2.txt`.} +\index{Linux command!stat} +\begin{lstlisting}[language=bash] +stat -c '%a' src/file2.txt +\end{lstlisting} +\textbf{Observed output:} +\begin{lstlisting} +644 +\end{lstlisting} +The command prints the file's numeric \gls{permissions} mode. +\item \textbf{Make `notes.md` append-only via file attributes, if supported.} +\index{Linux command!chattr} +\begin{lstlisting}[language=bash] +chattr +a notes.md && lsattr notes.md +\end{lstlisting} +\textbf{Observed output:} +\begin{lstlisting} +-----a--------e------- notes.md +\end{lstlisting} +The command sets the append-only attribute and then displays the file attributes to verify it. +\end{enumerate} + +\section*{E) Links and Find} +\begin{enumerate}[label=\textbf{\arabic*.},leftmargin=*,start=21] +\item \textbf{Verify that `link-to-file1` is a symbolic link and show its target.} +\index{Linux command!symbolic links} +\begin{lstlisting}[language=bash] +[ -L link-to-file1 ] && readlink link-to-file1 +\end{lstlisting} +\textbf{Observed output:} +\begin{lstlisting} +src/file1.txt +\end{lstlisting} +The test succeeds only for a \phantomsection\label{GlossaryRef:symboliclink}\gls{symboliclink}, after which `readlink` prints its target. +\item \textbf{Find all regular files under the current tree larger than 40 KiB.} +\index{Linux command!find} +\begin{lstlisting}[language=bash] +find . -type f -size +40k -print +\end{lstlisting} +\textbf{Observed output:} +\begin{lstlisting} +./blob.bin +\end{lstlisting} +The search restricts results to regular files whose size exceeds 40 KiB. +\item \textbf{Find files modified in the last ten minutes under `tmp/` and print their sizes.} +\index{Linux command!find} +\begin{lstlisting}[language=bash] +find tmp -type f -mmin -10 -printf '%s %p\n' +\end{lstlisting} +\textbf{Observed output:} +\begin{lstlisting} +19 tmp/file1.txt +\end{lstlisting} +The search filters by modification time and prints each matching size followed by its path. +\end{enumerate} + +\section*{F) Processes \& Job Control} +\begin{enumerate}[label=\textbf{\arabic*.},leftmargin=*,start=24] +\item \textbf{Show your processes in a tree view.}\phantomsection\label{AcronymRef:PPID} +\index{Linux command!processes} +\begin{lstlisting}[language=bash] +ps -u "$USER" --forest -o pid,ppid,stat,cmd +\end{lstlisting} +\textbf{Observed output:} +\begin{lstlisting} + PID PPID STAT CMD + 2 0 S [kthreadd] + 3 2 S \_ [pool_workqueue_release] + 4 2 I< \_ [kworker/R-rcu_g] + 5 2 I< \_ [kworker/R-rcu_p] + 6 2 I< \_ [kworker/R-slub_] + 7 2 I< \_ [kworker/R-netns] + 9 2 I< \_ [kworker/0:0H-kblockd] + 12 2 I< \_ [kworker/R-mm_pe] + 13 2 I \_ [rcu_tasks_kthread] + 14 2 I \_ [rcu_tasks_rude_kthread] + 15 2 I \_ [rcu_tasks_trace_kthread] + 16 2 S \_ [ksoftirqd/0] + 17 2 I \_ [rcu_preempt] + 18 2 S \_ [migration/0] + 19 2 S \_ [idle_inject/0] + 20 2 S \_ [cpuhp/0] + 21 2 S \_ [kdevtmpfs] + 22 2 I< \_ [kworker/R-inet_] + 23 2 S \_ [kauditd] + 24 2 S \_ [khungtaskd] + 26 2 S \_ [oom_reaper] + 28 2 I< \_ [kworker/R-write] + 29 2 S \_ [kcompactd0] + 30 2 SN \_ [ksmd] + 31 2 I< \_ [kworker/R-kinte] + 32 2 I< \_ [kworker/R-kbloc] + 33 2 I< \_ [kworker/R-blkcg] + 34 2 S \_ [irq/9-acpi] + 35 2 I< \_ [kworker/R-tpm_d] + 36 2 I< \_ [kworker/R-ata_s] + 37 2 I< \_ [kworker/R-md] + 38 2 I< \_ [kworker/R-md_bi] + 39 2 I< \_ [kworker/R-edac-] + 40 2 I< \_ [kworker/R-devfr] + 41 2 S \_ [watchdogd] + 42 2 I< \_ [kworker/R-quota] + 43 2 I< \_ [kworker/0:1H-kblockd] + 44 2 S \_ [kswapd0] + 45 2 S \_ [ecryptfs-kthread] + 46 2 I< \_ [kworker/R-kthro] + 47 2 I< \_ [kworker/R-acpi_] + 48 2 S \_ [scsi_eh_0] + 49 2 I< \_ [kworker/R-scsi_] + 50 2 S \_ [scsi_eh_1] + 51 2 I< \_ [kworker/R-scsi_] + 52 2 S \_ [scsi_eh_2] + 53 2 I< \_ [kworker/R-scsi_] + 56 2 I< \_ [kworker/R-mld] + 57 2 I< \_ [kworker/R-ipv6_] + 64 2 I< \_ [kworker/R-kstrp] + 66 2 I< \_ [kworker/u3:0] + 71 2 I< \_ [kworker/R-crypt] + 81 2 I< \_ [kworker/R-charg] + 163 2 I< \_ [kworker/R-raid5] + 200 2 S \_ [jbd2/vda1-8] + 201 2 I< \_ [kworker/R-ext4-] + 293 2 I< \_ [kworker/R-kmpat] + 294 2 I< \_ [kworker/R-kmpat] + 398 2 S \_ [jbd2/vda16-8] + 399 2 I< \_ [kworker/R-ext4-] + 1163 2 I< \_ [kworker/R-tls-s] + 34191 2 S \_ [psimon] + 52833 2 I \_ [kworker/u2:0-events_power_efficient] + 53308 2 I \_ [kworker/u2:2-events_power_efficient] + 53346 2 I \_ [kworker/u2:3-events_power_efficient] + 53379 2 I \_ [kworker/0:1-cgroup_free] + 53425 2 S \_ [psimon] + 53433 2 S \_ [psimon] + 53615 2 I \_ [kworker/0:2-events] + 53633 2 I \_ [kworker/u2:4-events_unbound] + 1 0 Ss /usr/lib/systemd/systemd --system --deserialize=75 + 837 1 Ss /usr/lib/systemd/systemd-logind + 914 1 Ss+ /sbin/agetty -o -p -- \u --keep-baud 115200,57600,38400,9600 - vt220 + 920 1 Ssl /usr/bin/python3 /usr/share/unattended-upgrades/unattended-upgrade-shutdown --wait-for-signal + 960 1 Ss+ /sbin/agetty -o -p -- \u --noclear - linux + 8058 1 Ssl /opt/digitalocean/bin/droplet-agent + 20679 1 SLsl /sbin/multipathd -d -s + 32446 1 Ss /usr/sbin/cron -f -P + 34152 1 S 1 && $3 == "CS"' people.csv > cs.txt +\end{lstlisting} +\textbf{Observed output:} +\begin{lstlisting} +(no terminal output) +\end{lstlisting} +The `awk` condition selects records after the header whose third field equals `CS`. +\textbf{Verification step:} +\begin{lstlisting} +$ cat cs.txt +2,Linus,CS +4,Dennis,CS +\end{lstlisting} +The verification command is included as evidence of the resulting file state and is not part of the solution command. +\item \textbf{Create an environment variable `X` with value `42`, print it, and remove it from the environment.} +\index{Linux command!environment variables} +\begin{lstlisting}[language=bash] +export X=42; printf '%s\n' "$X"; unset X +\end{lstlisting} +\textbf{Observed output:} +\begin{lstlisting} +42 +\end{lstlisting} +The \phantomsection\label{GlossaryRef:environmentvariable}\gls{environmentvariable} is exported, printed, and then unset in the current shell. +\end{enumerate} diff --git a/documentation/devopsPasswords.tex b/documentation/devopsPasswords.tex new file mode 100644 index 0000000..902594a --- /dev/null +++ b/documentation/devopsPasswords.tex @@ -0,0 +1,23 @@ +\chapter{Passwords} +\ChapterLabel{Passwords} +\index{passwords} +\index{credentials} + +\section{Overview} +For security reasons, passwords in this document are stored only as links to another password store (shared BitWarden cloud account), never as the credential itself. When a new credential is created, add a row naming the user and server, add the corresponding entry to the password manager, and record only the password manager's entry name here. + +\section{Credential Registry} +\begin{tabularx}{\linewidth}{L{1.8cm}L{2.6cm}L{3.4cm}Y} +\caption{Credential Registry\label{Table:CredentialRegistry}}\\ +\toprule \textbf{User} & \textbf{Server} & \textbf{Credential Reference} & \textbf{Rotation / Notes}\\ \midrule +\endfirsthead +\multicolumn{4}{l}{\small\itshape Credential Registry (continued)}\\ +\toprule \textbf{User} & \textbf{Server} & \textbf{Credential Reference} & \textbf{Rotation / Notes}\\ \midrule +\endhead \bottomrule \endlastfoot +Group 7 & Droplet (DigitalOcean) & Password manager entry: \texttt{DigitalOcean Droplet} & Credentials for droplet resource management web interface; rotate every 90 days\\ +\texttt{nkogut} & MyFileAgent Gitea & Password manager entry: \texttt{Gitea - Nick} & Individual Gitea administrator account; keep distinct from other service credentials\\ +\texttt{glovely} & MyFileAgent Gitea & Password manager entry: \texttt{Gitea - Gowri} & Individual Gitea administrator account; keep distinct from other service credentials\\ +Group 7 & \texttt{.TECH domains} & Password manager entry: \texttt{.tech Domain} & Registrar access for \texttt{myfileagent.tech}\\ +Group 7 & Actions runner & Restricted runner-state directory; \texttt{.runner} file & Repository registration; mode-700 directory and mode-600 state. No value stored here. Re-register/revoke on compromise or retirement.\\ +\texttt{glovely} & Implementation access & Restricted temporary token file outside Git & \texttt{write:repository} scope; used by authorized setup, never injected into jobs. Revoke when implementation ends.\\ +\end{tabularx} diff --git a/documentation/devopsProjectProposal.tex b/documentation/devopsProjectProposal.tex new file mode 100644 index 0000000..e8f95a1 --- /dev/null +++ b/documentation/devopsProjectProposal.tex @@ -0,0 +1,161 @@ +\chapter{Project Proposal} +\ChapterLabel{ProjectProposal} +\index{project proposal} +\index{DevSecOps pipeline} +\index{agentic LLM} +\index{Python} +\index{Grafana} + +\section{Project Title} + +\begin{center} + \Large\textbf{MyFileAgent Pipeline: One-Click DevSecOps Deployment for an Agentic LLM} +\end{center} + +\section{Project Description and Primary Focus} + +The primary product of this project is an automated, repeatable DevSecOps +pipeline that will install, configure, and demonstrate file-interaction tasks with an LLM. The pipeline will install required +packages, download a pinned small language model from the Hugging Face Hub, +build the containers, create the configuration, run security and functional +tests, deploy the services to a DigitalOcean Ubuntu Droplet, and perform +post-deployment health checks. A user will start the complete workflow through +one manual GitHub Actions button or one documented local command. + +Once automatically configured for the specific environment it is deployed to, the LLM can be given a file name or expected text which it will use to locate a file on the system. It will also be given the new contents for that file and will perform a controlled text replacement. It will call a tool using Python libraries to perform the deterministic +file validation, backup, diff display, and write operation. The project +does not promise general desktop control, autonomous file discovery, open-ended +planning, or unrestricted shell access, and will focus on the installation and setup pipeline rather than the extending the LLM's capabilities. + +The model will be downloaded from the Hugging Face Hub using its supported +download workflow \cite{HuggingFaceHubDownload}. A small quantized GGUF model +will run locally through \texttt{llama.cpp} \cite{LlamaCpp}. Pinning the model +revision and checksum will make repeated pipeline runs reproducible. + +\section{Demonstration Task} + +The pipeline's end-to-end acceptance test will demonstrate installation, configuration, deployment, and usage of the LLM model. Each step of this process will be clearly displayed using visual metrics from GitHub actions, DigitalOcean droplet system resource monitoring, and Grafana. Finally, the following task (implemented as a test case) will demonstrate that this process was successful: + +\begin{quote} +``In the approved demonstration folder, open the file about \texttt{project status}, verify +that it contains \texttt{Status: Draft}, and replace that line with +\texttt{Status: Reviewed}.'' +\end{quote} + +The application will receive a description of the target file's name (not necessarily an exact path) and replacement values, confirm +that the file exists inside the allowed folder, create a backup, show a diff, +perform the replacement, verify the saved result, and append a JSON Lines audit +record. If validation fails, it will stop without modifying the file. + +\section{One-Click Pipeline} + +The pipeline will perform the following stages in order: + +\begin{enumerate}[label=\arabic*.] + \item validate required secrets, variables, model identifiers, and target + Droplet information; + \item install or verify Docker, Docker Compose, Python dependencies, and + required monitoring components; + \item download the pinned model and verify its checksum; + \item lint and statically analyze the Python source; + \item run unit, integration, security, and minimal end-to-end tests; + \item build and scan versioned container images; + \item generate deployment configuration from protected variables; + \item deploy the application, inference, Prometheus, and Grafana services; + \item run health checks and the fixed file-replacement acceptance test; and + \item publish test (e.g., via the task outlined above), scan, deployment, and monitoring results. +\end{enumerate} + +The workflow will fail immediately when a required stage fails. Deployment +will use pinned versions, health checks, restart policies, resource limits, and +a rollback target. Re-running the same workflow should be idempotent and should +not duplicate configuration or damage an existing deployment. + +\section{Proposed Architecture and Tools} + +\begin{longtable}{L{2.7cm}L{4.2cm}L{7.3cm}} +\caption{Proposed MyFileAgent pipeline}\label{Table:MyFileAgentPipeline}\\ +\toprule +\textbf{Stage} & \textbf{Planned Tools} & \textbf{Purpose} \\ +\midrule +\endfirsthead +\toprule +\textbf{Stage} & \textbf{Planned Tools} & \textbf{Purpose} \\ +\midrule +\endhead +\bottomrule +\endlastfoot +Source control & Git and GitHub & Store pipeline definitions, Python source, tests, Docker files, configuration templates, issues, and version history. \\ +One-click orchestration & GitHub Actions \texttt{workflow\_dispatch}, Bash, and a Makefile & Provide one manual action that validates, builds, tests, scans, deploys, and verifies the complete system \cite{GitHubActions}. \\ +File operations & Python \texttt{pathlib}, \texttt{shutil}, \texttt{difflib}, and atomic replacement & Provide a tool the LLM Agent will call to enforce the approved folder, create a backup, generate a diff, perform the single text replacement, and verify the result \cite{PythonPathlib}. \\ +Model acquisition & Hugging Face Hub & Download a selected small model and pin its revision and checksum. \\ +Inference & \texttt{llama.cpp} with a quantized GGUF model & Run a resource-conscious local model for the demonstration. \\ +Testing & \texttt{pytest}, mocks, and temporary directories & Test configuration, file safeguards, backup and replacement behavior, failure handling, and the deployed acceptance case \cite{PytestDocs}. \\ +Security & Ruff & Check Python quality, static-analysis rules. \\ +Packaging and deployment & Docker Compose and DigitalOcean & Build and deploy versioned application, inference, and monitoring services on the Ubuntu Droplet. \\ +Application monitoring & Prometheus and Grafana & Collect pipeline and application metrics and display build, test, deployment, health, latency, token, and failure information in a dashboard \cite{PrometheusOverview,GrafanaPrometheus}. \\ +Host monitoring & DigitalOcean Monitoring & Supplement Grafana with Droplet-level CPU, memory, disk, and availability graphs and alerts \cite{DigitalOceanMonitoring}. \\ +Audit storage & JSON Lines files and retained CI artifacts & Preserve pipeline results and a small append-only record of demonstration runs without requiring a separate database service. \\ +\end{longtable} + +\section{DevSecOps and Testing Strategy} + +Security and verification are pipeline gates rather than later manual tasks. +Pull requests will run formatting, linting, unit tests, dependency checks, +static analysis, and container scanning. Only an approved main-branch revision +may start deployment. The containers will run as non-root users, secrets will +come from protected variables, and the demonstration workspace will be the +only writable application mount. + +The automated test suite will emphasize the delivery system: + +\begin{itemize} + \item pipeline configuration tests for required variables, pinned versions, + repeatable installation, failure handling, and rollback information; + \item Python tool to be called by the LLM; unit tests for path boundaries, backups, diffs, atomic writes, + audit records, and rejection of invalid input; + \item integration tests using temporary folders and a mocked inference + response; + \item security gates for source, dependencies, secrets, and images; and + \item a post-deployment acceptance test that performs only the fixed sample + replacement and confirms the backup, result, audit entry, and health + status. +\end{itemize} + +\section{Monitoring Dashboard} + +Grafana will be the main operational dashboard. Prometheus will supply metrics +for pipeline duration, test pass or failure counts, deployment status, +container health, inference latency, limited token estimates, acceptance-test +results, and application errors. These measures show whether the automated +delivery pipeline is reliable and repeatable; token information is a supporting +metric rather than the project's main goal. DigitalOcean Monitoring may be used +in addition for host-level CPU, memory, disk, and availability information. + +\section{Planned Deliverables and Milestones} + +\begin{enumerate}[label=\arabic*.] + \item define the one-click pipeline stages, configuration contract, success + criteria, and rollback approach; + \item create the GitHub repository, Python demonstration service and LLM-callable tool, and automated tests; + \item Choose a small model, pin and download it, and confirm the single demonstration + task locally; + \item create the Docker Compose deployment and security gates; + \item automate installation, configuration, build, test, scan, deployment, + health checking, and acceptance testing through one trigger; + \item configure Prometheus and Grafana, with DigitalOcean host monitoring as + an optional additional source; + and + \item demonstrate a clean one-click run and document timing, test, security, + monitoring, failure, and rollback results. +\end{enumerate} + +\section{Success Criteria and Unique Contribution} + +The project succeeds when one authorized action can take a documented target +from prerequisites to a healthy, tested, monitored deployment. The run must +install or validate dependencies, retrieve the pinned model, build containers, +pass automated tests and security gates, deploy the services, complete health +checks, execute the fixed file-replacement acceptance test, and expose results +in Grafana. A repeated run must be safe and produce consistent results, while a +failed gate must prevent or stop deployment and provide useful logs. diff --git a/documentation/devopsReferences.bib b/documentation/devopsReferences.bib new file mode 100644 index 0000000..6551a45 --- /dev/null +++ b/documentation/devopsReferences.bib @@ -0,0 +1,130 @@ +@book{PhoenixProject, + author = {Kim, Gene and Behr, Kevin and Spafford, George}, + title = {The Phoenix Project: A Novel about IT, DevOps, and Helping Your Business Win}, + publisher = {IT Revolution Press}, + year = {2018} +} + +@misc{HuggingFaceHubDownload, + author = {{Hugging Face}}, + title = {Download Files from the Hub}, + year = {2026}, + howpublished = {\url{https://huggingface.co/docs/huggingface_hub/guides/download}}, + note = {Accessed: September 18, 2026} +} + +@misc{LlamaCpp, + author = {{llama.cpp contributors}}, + title = {llama.cpp: LLM Inference in C/C++}, + year = {2026}, + howpublished = {\url{https://github.com/ggml-org/llama.cpp}}, + note = {Accessed: September 18, 2026} +} + +@misc{PythonPathlib, + author = {{Python Software Foundation}}, + title = {pathlib---Object-Oriented Filesystem Paths}, + year = {2026}, + howpublished = {\url{https://docs.python.org/3/library/pathlib.html}}, + note = {Accessed: September 18, 2026} +} + +@misc{PytestDocs, + author = {{pytest contributors}}, + title = {pytest Documentation}, + year = {2026}, + howpublished = {\url{https://docs.pytest.org/}}, + note = {Accessed: September 18, 2026} +} + +@misc{PrometheusOverview, + author = {{Prometheus Authors}}, + title = {Prometheus Overview}, + year = {2026}, + howpublished = {\url{https://prometheus.io/docs/introduction/overview/}}, + note = {Accessed: September 18, 2026} +} + +@misc{GrafanaPrometheus, + author = {{Grafana Labs}}, + title = {Prometheus Monitoring and Grafana Dashboards}, + year = {2026}, + howpublished = {\url{https://grafana.com/oss/prometheus/}}, + note = {Accessed: September 18, 2026} +} + +@misc{DigitalOceanMonitoring, + author = {{DigitalOcean}}, + title = {Monitoring Documentation}, + year = {2026}, + howpublished = {\url{https://docs.digitalocean.com/products/monitoring/}}, + note = {Accessed: September 18, 2026} +} + +@misc{GitHubActions, + author = {{GitHub}}, + title = {GitHub Actions Documentation}, + year = {2026}, + howpublished = {\url{https://docs.github.com/actions}}, + note = {Accessed: September 18, 2026} +} + +@misc{DockerUbuntuInstall, + author = {{Docker, Inc.}}, + title = {Install Docker Engine on Ubuntu}, + year = {2026}, + howpublished = {\url{https://docs.docker.com/engine/install/ubuntu/}}, + note = {Accessed: September 18, 2026} +} + +@misc{GiteaDockerRootless, + author = {{Gitea Limited}}, + title = {Installation with Docker (rootless)}, + year = {2026}, + howpublished = {\url{https://docs.gitea.com/installation/install-with-docker-rootless/}}, + note = {Accessed: September 26, 2026} +} + +@misc{CaddyDockerImage, + author = {{Docker, Inc.}}, + title = {Caddy Official Image}, + year = {2026}, + howpublished = {\url{https://hub.docker.com/_/caddy}}, + note = {Accessed: September 26, 2026} +} + +@misc{CaddyAutomaticHTTPS, + author = {{Caddy Project}}, + title = {Automatic HTTPS}, + year = {2026}, + howpublished = {\url{https://caddyserver.com/docs/automatic-https}}, + note = {Accessed: September 26, 2026} +} + +@misc{CaddyCommandLine, + author = {{Caddy Documentation}}, + title = {Command Line}, + howpublished = {\url{https://caddyserver.com/docs/command-line}}, + note = {Accessed September 26, 2026} +} + +@misc{DigitalOceanCloudFirewalls, + author = {{DigitalOcean}}, + title = {Cloud Firewalls Documentation}, + year = {2026}, + howpublished = {\url{https://docs.digitalocean.com/products/networking/firewalls/}}, + note = {Accessed: September 26, 2026} +} + +@misc{GiteaActRunnerManual, + author={{Gitea}}, title={Act Runner}, + howpublished={\url{https://docs.gitea.com/1.26/usage/actions/act-runner/}}, + note={Accessed October 6, 2026}} +@misc{GiteaActionsComparisonManual, + author={{Gitea}}, title={Compared to GitHub Actions}, + howpublished={\url{https://docs.gitea.com/1.27/usage/actions/comparison/}}, + note={Accessed October 6, 2026}} +@misc{GiteaActionsConfigManual, + author={{Gitea}}, title={Configuration Cheat Sheet: Actions}, + howpublished={\url{https://docs.gitea.com/1.27/administration/config-cheat-sheet/}}, + note={Accessed October 6, 2026}} diff --git a/documentation/digitalocean-droplet.png b/documentation/digitalocean-droplet.png new file mode 100644 index 0000000..800ab94 Binary files /dev/null and b/documentation/digitalocean-droplet.png differ diff --git a/documentation/gitea_persistence_evidence.png b/documentation/gitea_persistence_evidence.png new file mode 100644 index 0000000..1b0036b Binary files /dev/null and b/documentation/gitea_persistence_evidence.png differ diff --git a/documentation/hw4_images/backup_original_issue.png b/documentation/hw4_images/backup_original_issue.png new file mode 100644 index 0000000..d5929ab Binary files /dev/null and b/documentation/hw4_images/backup_original_issue.png differ diff --git a/documentation/hw4_images/backup_original_repository.png b/documentation/hw4_images/backup_original_repository.png new file mode 100644 index 0000000..81144eb Binary files /dev/null and b/documentation/hw4_images/backup_original_repository.png differ diff --git a/documentation/hw4_images/backup_restored_issue.png b/documentation/hw4_images/backup_restored_issue.png new file mode 100644 index 0000000..8845f43 Binary files /dev/null and b/documentation/hw4_images/backup_restored_issue.png differ diff --git a/documentation/hw4_images/backup_restored_repository.png b/documentation/hw4_images/backup_restored_repository.png new file mode 100644 index 0000000..9245aba Binary files /dev/null and b/documentation/hw4_images/backup_restored_repository.png differ diff --git a/documentation/hw4_images/caddy_renewal_test_evidence.png b/documentation/hw4_images/caddy_renewal_test_evidence.png new file mode 100644 index 0000000..2cdcca9 Binary files /dev/null and b/documentation/hw4_images/caddy_renewal_test_evidence.png differ diff --git a/documentation/hw4_images/domain_evidence.png b/documentation/hw4_images/domain_evidence.png new file mode 100644 index 0000000..80b5e38 Binary files /dev/null and b/documentation/hw4_images/domain_evidence.png differ diff --git a/documentation/hw4_images/domain_http_evidence.png b/documentation/hw4_images/domain_http_evidence.png new file mode 100644 index 0000000..93c61f8 Binary files /dev/null and b/documentation/hw4_images/domain_http_evidence.png differ diff --git a/documentation/hw4_images/firewall_configuration_evidence.png b/documentation/hw4_images/firewall_configuration_evidence.png new file mode 100644 index 0000000..9d97004 Binary files /dev/null and b/documentation/hw4_images/firewall_configuration_evidence.png differ diff --git a/documentation/hw4_images/firewall_external_test_evidence.png b/documentation/hw4_images/firewall_external_test_evidence.png new file mode 100644 index 0000000..6d6bd5f Binary files /dev/null and b/documentation/hw4_images/firewall_external_test_evidence.png differ diff --git a/documentation/hw4_images/gitea_configuration_evidence.png b/documentation/hw4_images/gitea_configuration_evidence.png new file mode 100644 index 0000000..1a5161a Binary files /dev/null and b/documentation/hw4_images/gitea_configuration_evidence.png differ diff --git a/documentation/hw4_images/gitea_persistence_evidence.png b/documentation/hw4_images/gitea_persistence_evidence.png new file mode 100644 index 0000000..1b0036b Binary files /dev/null and b/documentation/hw4_images/gitea_persistence_evidence.png differ diff --git a/documentation/hw4_images/redirect_evidence.png b/documentation/hw4_images/redirect_evidence.png new file mode 100644 index 0000000..57a284a Binary files /dev/null and b/documentation/hw4_images/redirect_evidence.png differ diff --git a/documentation/latex-docker/Dockerfile b/documentation/latex-docker/Dockerfile new file mode 100644 index 0000000..caea3c0 --- /dev/null +++ b/documentation/latex-docker/Dockerfile @@ -0,0 +1,12 @@ +FROM debian:bookworm-slim + +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + texlive-latex-base \ + lmodern \ + && rm -rf /var/lib/apt/lists/* + +WORKDIR /workspace +COPY sample-source.txt . + +CMD ["pdflatex", "-interaction=nonstopmode", "-halt-on-error", "sample-source.txt"] diff --git a/documentation/latex-docker/sample-source.txt b/documentation/latex-docker/sample-source.txt new file mode 100644 index 0000000..9e492e7 --- /dev/null +++ b/documentation/latex-docker/sample-source.txt @@ -0,0 +1,21 @@ +\documentclass{article} +\usepackage[T1]{fontenc} +\usepackage{lmodern} +\usepackage{hyperref} + +\title{LaTeX Compiled Inside Docker} +\author{Nicholas Kogut and Gowri Das Lovely} +\date{September 18, 2026} + +\begin{document} +\maketitle + +\section{Purpose} +This document verifies that a Docker container with TeX Live can compile +LaTeX source into a PDF without requiring a local LaTeX installation. + +\section{Result} +The source was processed with \texttt{pdflatex} inside the container. The +generated PDF was written to a host-mounted output directory. + +\end{document} diff --git a/documentation/main.tex b/documentation/main.tex new file mode 100644 index 0000000..b9c1bd6 --- /dev/null +++ b/documentation/main.tex @@ -0,0 +1,181 @@ +% !TeX program = pdflatex +% Authoritative top-level Overleaf document. Select main.tex as Main document. +% SSW 590 DevOps Assignment Template +% Developed by Darian Muresan, Ph.D., with OpenAI Codex and Anthropic Claude Code. +% AI agents: read devopsAIAgentGuide.tex before editing this template. +\documentclass[12pt]{cornell} + +\usepackage[T1]{fontenc} +\usepackage{lmodern} +\usepackage{xspace} +\usepackage{xcolor} +\usepackage{graphicx} +\usepackage{fancyhdr} +\usepackage{amsmath,amssymb} +\usepackage{array} +\usepackage{booktabs} +\usepackage{longtable} +\usepackage{tabularx} +\usepackage{ltablex} +\usepackage{float} +\usepackage{placeins} +\keepXColumns +\usepackage{enumitem} +\usepackage{listings} +\usepackage[newfloat]{minted} +\usepackage{tcolorbox} +\usepackage{tikz} +\usetikzlibrary{arrows.meta,positioning,shapes.geometric} +\usepackage{makeidx} +\usepackage[acronym]{glossaries} +\usepackage{titlesec} +\usepackage[colorlinks=true,citecolor=blue,linkcolor=blue,urlcolor=blue]{hyperref} + +\makeindex +\makeglossaries + +\newglossaryentry{bash}{name={Bash},description={The shell used to execute the problem-set commands and shell scripts}} +\newglossaryentry{permissions}{name={file permissions},description={Access settings that control whether users may read, write, or execute a file or directory}} +\newglossaryentry{symboliclink}{name={symbolic link},description={A filesystem entry that points to another pathname}} +\newglossaryentry{process}{name={process},description={A running instance of a program identified by a process ID}} +\newglossaryentry{archive}{name={archive},description={A file containing stored filesystem entries; this assignment uses a gzipped tar archive}} +\newglossaryentry{environmentvariable}{name={environment variable},description={A named value maintained by the shell and inherited by processes it starts}} + +\definecolor{devopsBlue}{RGB}{31,78,121} +\definecolor{devopsGreen}{RGB}{46,125,50} +\definecolor{devopsRed}{RGB}{183,28,28} +\definecolor{devopsGray}{RGB}{90,90,90} +\definecolor{devopsLightBlue}{RGB}{232,240,247} + +% Replace these values for each assignment. +\newcommand{\AssignmentTitle}{Automated LaTeX Manual Builds with Gitea Actions} +\newcommand{\AssignmentNumber}{5} +\newcommand{\DocumentVersion}{1.7.1} +\newcommand{\DocumentStatus}{Group Assignment Report -- Work in Progress} +\newcommand{\CourseNumber}{SSW 590} +\newcommand{\CourseName}{DevOps Principles and Practices} +\newcommand{\Instructor}{Darian Muresan} +\newcommand{\StudentNames}{Nicholas Kogut\\Gowri Das Lovely} +\newcommand{\PDFAuthors}{Nicholas Kogut and Gowri Das Lovely} +\newcommand{\Organization}{Stevens Institute of Technology} +\newcommand{\DocumentDate}{October 6, 2026} +\newcommand{\DueDate}{Not specified} +% Generated only in the build workspace; never committed by the workflow. +\newcommand{\BuildSuffix}{+local.unverified} +\newcommand{\BuildCommit}{Not built by Gitea Actions} +\newcommand{\BuildRun}{Not assigned} +\newcommand{\BuildRunURL}{https://myfileagent.tech/myfileagent/myfileagent-pipeline/actions} +\InputIfFileExists{build-metadata.tex}{}{} +\newcommand{\VERSION}{Version \DocumentVersion\BuildSuffix} + +\hypersetup{ + pdftitle={\CourseNumber\ --- Assignment \AssignmentNumber: \AssignmentTitle}, + pdfauthor={\PDFAuthors}, + pdfcreator={Darian Muresan, Ph.D., with OpenAI Codex and Anthropic Claude Code}, + pdfsubject={SSW 590 Assignment 5 automated LaTeX manual builds with Gitea Actions}, + pdfkeywords={DevOps, DigitalOcean, Docker, Gitea Actions, LaTeX, runner, build artifact, traceability} +} + +\newcolumntype{Y}{>{\raggedright\arraybackslash}X} +\newcolumntype{L}[1]{>{\raggedright\arraybackslash}p{#1}} +\setlength{\tabcolsep}{4pt} +\renewcommand{\arraystretch}{1.12} +\setlength{\LTpre}{6pt} +\setlength{\LTpost}{6pt} + +% Stable IDs make activity, evidence, and artifact references durable. +\newcommand{\ArtifactLabel}[2]{\phantomsection\label{#1:#2}} +\newcommand{\ArtifactID}[2]{\texttt{#2}\ArtifactLabel{#1}{#2}\index{#1!#2}} +\newcommand{\ArtifactRef}[2]{\hyperref[#1:#2]{\texttt{#2}}} +\newcommand{\ActivityID}[1]{\ArtifactID{Activity}{#1}} +\newcommand{\ActivityRef}[1]{\ArtifactRef{Activity}{#1}} +\newcommand{\EvidenceID}[1]{\ArtifactID{Evidence}{#1}} +\newcommand{\EvidenceRef}[1]{\ArtifactRef{Evidence}{#1}} +\newcommand{\ChapterLabel}[1]{\label{Chapter:#1}} +\newcommand{\ChapterRef}[1]{\hyperref[Chapter:#1]{Chapter~\ref*{Chapter:#1}}} +\newcommand{\AppendixRef}[1]{\hyperref[Chapter:#1]{Appendix~\ref*{Chapter:#1}}} +\newcommand{\StatusPass}{\textbf{\footnotesize\textcolor{devopsGreen}{PASS}}} +\newcommand{\StatusPending}{\textbf{\footnotesize\textcolor{devopsGray}{PENDING}}} +\newcommand{\StatusFail}{\textbf{\footnotesize\textcolor{devopsRed}{FAIL}}} + +\newtcolorbox{devopsNote}[1][]{ + colback=devopsLightBlue, colframe=devopsBlue, boxrule=0.6pt, arc=1mm, title=#1 +} + +\lstset{ + backgroundcolor=\color{white}, basicstyle=\ttfamily\footnotesize, + breaklines=true, frame=single, keywordstyle=\color{blue}, + commentstyle=\color{devopsGreen}, numbers=left, numbersep=6pt, + numberstyle=\tiny\color{devopsGray}, showstringspaces=false, + stringstyle=\color{devopsRed}, tabsize=2 +} + +\setminted{ + fontsize=\footnotesize, + breaklines=true, + frame=single, + framesep=2mm, + linenos=true, + numbersep=6pt, + tabsize=2 +} + +\titleformat{\chapter}[display] + {\normalfont\huge\bfseries}{\chaptertitlename\ \thechapter}{8pt}{\Huge} +\titlespacing*{\chapter}{0pt}{-20pt}{24pt} +\setlength{\emergencystretch}{2em} + +\changenormalspacing{\singlespacing} +\begin{document} +\pagenumbering{roman} +\singlespacing +\include{prologue} + +\setcounter{page}{1} +\pagenumbering{arabic} +\pagestyle{fancy} +\fancyhf{} +\renewcommand{\chaptermark}[1]{\markboth{#1}{}} +\lhead{\small Assignment \AssignmentNumber} +\chead{\small\nouppercase{\leftmark}} +\rhead{\small\thepage} +\lfoot{\small\CourseNumber} +\cfoot{\small\copyright\ \Organization} +\rfoot{\scriptsize Version \DocumentVersion\\Run \BuildRun} +\renewcommand{\headrulewidth}{0.4pt} +\renewcommand{\footrulewidth}{0.4pt} + +\include{devopsIntroduction} +\include{devopsLinuxCommands} +\include{devopsLinuxProblemSet} +\include{devopsHosts} +\include{devopsPasswords} +\include{devopsDigitalOceanDockerDeployment} +\include{devopsLatexDocker} +\include{devopsProjectProposal} +\include{devopsGiteaStartupFoundation} +\include{devopsAutomatedManualBuild} + +\bibliographystyle{IEEEtran} +\bibliography{devopsReferences} + +\appendix +\include{devopsAIPromptLog} + +\cleardoublepage +\phantomsection +\addcontentsline{toc}{chapter}{Glossary} +\input{devopsGlossary.tex} + +\cleardoublepage +\phantomsection +\addcontentsline{toc}{chapter}{Acronyms} +\input{devopsAcronyms.tex} + +\cleardoublepage +\phantomsection +\addcontentsline{toc}{chapter}{Index} +\small +\printindex +\normalsize +\end{document} diff --git a/documentation/prologue.tex b/documentation/prologue.tex new file mode 100644 index 0000000..a9429db --- /dev/null +++ b/documentation/prologue.tex @@ -0,0 +1,42 @@ +\title{\CourseNumber\ --- \CourseName\\[0.5em]\large Assignment \AssignmentNumber: \AssignmentTitle\\[1.5em]\normalsize\VERSION\\\DocumentStatus} +\author{\StudentNames\\[0.75em]\Organization\\[0.75em]Instructor: \Instructor} +\conferraldate{}{\DocumentDate} +\copyrightholder{\Organization} +\copyrightyear{2026} +\maketitle +\makecopyright + +\cleardoublepage +\chapter*{Build Identity} +\phantomsection\label{Build:Identity} +\addcontentsline{toc}{chapter}{Build Identity} +\markboth{Build Identity}{Build Identity} +\index{build identity} +Human-maintained version: \texttt{\DocumentVersion}.\\ +Build suffix: \texttt{\BuildSuffix}.\\ +Source commit: \texttt{\BuildCommit}.\\ +Workflow run: \texttt{\BuildRun}.\\ +\href{\BuildRunURL}{Gitea Actions run or workflow overview}. + +The workflow generates these fields from its triggering revision and run. +The local fallback explicitly identifies an unverified build and must not be +presented as a successful Actions artifact. + +\cleardoublepage +\phantomsection +\chapter*{Template Attribution} +\ChapterLabel{TemplateAttribution} +\addcontentsline{toc}{chapter}{Template Attribution} +\markboth{Template Attribution}{Template Attribution} +\index{template attribution} +\index{Muresan, Darian} +This DevOps assignment template was developed by \textbf{Darian Muresan, Ph.D.}, +in conjunction with \textbf{OpenAI Codex} and \textbf{Anthropic Claude Code}. + +% A separate abstract page is omitted because this short assignment report +% begins with a purpose-focused introduction. +\input{devopsDocumentHistory.tex} +\contentspage +\tablelistpage +\figurelistpage +