diff --git a/handler/app/app.go b/handler/app/app.go index c6d95a60..755dd15d 100644 --- a/handler/app/app.go +++ b/handler/app/app.go @@ -61,11 +61,14 @@ func errVal(name string) template.HTML { } const ( - attr = " attributions" - br = "
" - ul0 = "" - fzip = ".zip" + attr = " attributions" + br = "
" + div1 = "" + sect0 = "
" + sect1 = "
" + ul0 = "" + fzip = ".zip" ) // Caching are values that are used throughout the app or layouts. @@ -795,7 +798,7 @@ func recordsSub1(uri string) string { //nolint:cyclop // released the artifact. The content should be a list of files contained // in the artifact. // -// This is a port of the CFML function, variables.findTextfile found in File.cfc +// This is a port of the CFML function, variables.findTextfile found in File.cfc. func ReadmeSuggest(filename, group string, content ...string) string { finds := readmeFinds(content...) if len(finds) == 1 { @@ -816,9 +819,9 @@ func ReadmeSuggest(filename, group string, content ...string) string { } } } - const matchFileId = "file_id.diz" + const matchFileID = "file_id.diz" for _, name := range finds { - if strings.EqualFold(matchFileId, name) { + if strings.EqualFold(matchFileID, name) { return name } } diff --git a/handler/app/milestone.go b/handler/app/milestone.go index 580ae7f2..9b84906c 100644 --- a/handler/app/milestone.go +++ b/handler/app/milestone.go @@ -1,107 +1,5 @@ package app -// What ever happened to real bulletin-board systems? -// http://www.textfiles.com/100/bbsdeath.pro -// http://www.textfiles.com/100/copyprot.pro -// http://www.textfiles.com/100/krckwczt.app - -// *----------------------------------* -// / APPLESOURCE BBS LIST \ -// \ *-*-*-*-*-*-*-*-*-*- / -// *----------------------------------* -// = = -// = Applesource............ 722-4871 = -// = The Board of 'ED'.......369-5972 = -// = RCP/M of Somerville.....526-5988 = -// = Stargazer...............369-5450 = -// = Holiday Inn Cambodia....722-2711 = -// = Easy Access.............526-6044 = -// = C.I.E.E. ...............725-5028 = -// = Pirate's Paradise.......231-1655 = -// = The Two Towers..........463-7941 = -// = ??? BBS.................229-5180 = -// = Board at the Edge of Reality = -// = ^^^.....................766-9643 = -// = The Mourge..............376-4462 = -// = The Bank BBS............376-1587 = -// = Camelot BBS.............341-7817 = -// = The Rain Forest.........721-7914 = -// = RCP/M of Rutgers Univ...932-3879 = -// = Rutgers PMS.............932-3887 = -// = Colorama................572-0617 = -// = The Spectrum............494-8209 = -// = Castle Westerburg.......238-9118 = -// = = -// *----------------------------------* -// _ -// http://www.textfiles.com/bbs/BBSLISTS/bbslist.txt.txt - -// The Mall.....................526-0420 -// Curcuit Board................369-8319 -// The Two Towers...............463-7941 -// The Time Machine.............572-5546 -// Zeplin BBS...................526-2524 -// Paradox......................725-0354 -// Stargazer....................369-5450 -// Colorama.....................572-0617 -// 64 Depot.....................563-1867 -// THE ZOO......................722-4871 -// http://www.textfiles.com/bbs/BBSLISTS/bbss.txt - -// *DAMIEN THE DREADED* -// *=-THE UNTOUCHABLES-=* -// http://www.textfiles.com/messages/compcond.txt - -// http://www.textfiles.com/messages/compconna.txt -// 1982 -// -------------------------- -// - BULLETIN BOARD SYSTEMS - -// -------------------------- - -// PIRATE SYSTEMS -// ------ ------- - -// PIRATES COVE...............516-698-4008 -// PIRATES TREK...............914-634-1268 -// PIRATES BAY................415-775-2384 -// PIRATES SHIP...............312-935-2933 -// PIRATES LODGE..............516-627-9048 -// PIRATES CHEST..............617-891-1349 -// HARPOS BAR & GRILL.........618-254-6074 -// GALAXY ONE.................215-244-0864 -// SEVEN SEAS HOTEL...........516-487-1212 -// TREASURE ISLAND............617-444-6821 -// TREND NET..................313-775-1649 -// TRADERS INN................618-656-3321 -// PIRATES PARADISE...........512-477-2672 -// GPI CENTRAL ONLINE.........213-556-0433 -// --> UNKNOWN OPERATING PIRATE BOARDS <-- -// 212-580-9688 -// 313-663-0333 -// 907-344-8558 -// 313-547-7903 - -// PHREAK SYSTEMS -// ------ ------- -// OHIO SCIENTIFIC-OSUNY......914-725-4060 -// R A C S I.................516-482-8491 -// R A C S III...............914-942-2638 -// R A C S IV................212-767-9881 -// FANTASY FORUM..............213-827-9175 - -// BBSs -// ~~~ -// Sherwood Forest II and III, OSUNY -- I just thought they were the greatest -// systems ever. -// Pirate's Bay -- Run by Mr. KRACK-MAN, who considered himself the greatest Apple -// pirate that ever lived. It's still up, for all I know. -// The 2600 Magazine BBS -- Run on a piece of Apple BBS software called -// TBBS. It is there that I met David Flory. -// The Police Station -- Remember THAT one? -// The Matrix, IDI, Lunatic Labs -- Three great Bay Area Forum-PC boards. -// Catch-22 -- 25 Users, No Waiting! -// http://phrack.org/issues/33/2.html - const notable = "Notable group foundings," // Milestone is an accomplishment for a year and optional month. @@ -296,9 +194,9 @@ func Collection() Milestones { "It dominated the remainder of the 1970s and is the default platform for most computers running an Intel 8080, 8085 or its compatible competitor, the Zilog Z-80.

" + "

IBM and Microsoft's later PC-DOS / MS-DOS took a lot of inspiration[1] from CP/M and supplanted " + "it as the dominant, open hardware, microcomputing operating system.

" + - "
" + + sect0 + "
[1] Many argue the design and even source code was stolen.
" + - "
", + sect1, }, { Year: 1977, Title: "The trinity of microcomputers", @@ -308,10 +206,10 @@ func Collection() Milestones { "By the end of the year, a potential customer in the USA could walk into a mall or retail shop and walk out with a complete personal computer, ready to use.

" + "

The MOS 6502 CPU 1975 is found in the Commodore PET[1] and the Apple II.
" + "While Zilog Z-80 1976 is in use with the TRS-80[2].

" + - "
" + + sect0 + "
[1] Personal Electronic Transactor.
" + "
[2] Tandy RadioShack.
" + - "
", + sect1, }, { Year: 1978, Month: 2, Title: "The first Bulletin Board System", @@ -391,11 +289,11 @@ func Collection() Milestones { // 8BBS "

There is also the renowned 8BBS out of San Jose, CA, which ran on a PDP-8 minicomputer " + "in 1980-82 and has a separate article.

" + - "
" + + sect0 + "
[1] See page 3 under MODEMania in the Washington Apple Journal.
" + "
[2] In the Innovative Bulletin Boards list, InfoWorld mislabels 8BBS as BBBS.
" + "
[3] In a 1987 interview, TUC states the first Sherwood Forest was in New Jersey, but other sources suggest it was in Manhattan, NY.
" + - "
", + sect1, }, { Title: "The first crackers ?", Year: 1979, Highlight: true, @@ -422,10 +320,10 @@ func Collection() Milestones { "Dave Alpert, the head of Omega Software Inc. and president of the Northern Illinois Apple Users Group[2], " + "is interviewed, and he says Lock Smith took over a year to develop. " + "On page 10 of the issue, there is a review section of disk copying programs, including Locksmith, Copy II Plus, Back-It-Up, Quick and Dirty, and Old Faithful.

" + - "
" + + sect0 + "
[1] See message number 4342.
" + "
[2] Northern Illinois Apple Users Group Paper Library Index 1981.
" + - "
", + sect1, }, { Title: "The birth of warez ?", Year: 1980, Highlight: true, @@ -452,7 +350,7 @@ func Collection() Milestones { "TRS-80 from Radio Shack had a modem peripheral available at the end of 1978. " + "Yet, there needs to be evidence of an underground culture first developing on this platform. Modem peripherals didn't exist on the " + "Atari 400/800 until 1981. And the Commodore 64 was years away.

" + - "
" + + sect0 + "
[1] Warez was originally spelt with an s after the dictionary spelling.
" + "
[2] The first killer app for the Apple II, VisiCalc," + " the first spreadsheet for microcomputers, was only released in the last few months of 1979.
" + @@ -462,7 +360,7 @@ func Collection() Milestones { "2, " + "3, " + "4." + - "
", + sect1, }, { Title: "The first group", Year: 1980, Highlight: true, @@ -498,23 +396,23 @@ func Collection() Milestones { // midwest guild "

There is anecdotal evidence suggesting the Super Pirates was involved in the first-ever BBS bust, and the members left formed or joined the Midwest Pirate's Guild. " + "A group strongly associated with the cracker Apple Bandit and his Minneapolis-based board, The Safehouse (+612-724-7066).

" + - "
" + + sect0 + "
[1] The Untouchables crack screen examples, " + "1, 2, 3, 4." + - "
" + + div1 + "
[2] The Apple Mafia crack screen examples, " + "1, 2, 3, 4, 5." + - "
" + + div1 + "
[3] The Dirty Dozen crack screen examples, " + "1, 2, 3, 4." + - "
" + + div1 + "
[4] TAP was formerly named as " + "The Youth International Party Line (YIPL).
" + "
[5] The first AppleFest was held on the weekend of June 6-7, 1981, in Boston.
" + "
[6] Super Pirates of Minneapolis crack screen examples, " + "1, 2, 3." + - "
" + - "
", + div1 + + sect1, }, { Title: "8BBS", Year: 1980, Highlight: true, @@ -533,7 +431,7 @@ func Collection() Milestones { "" + - "
" + + sect0 + "
[1] Publications and phreaker personalities mentioning 8BBS, " + "Captain Crunch, " + "The Hacker Crackdown, " + @@ -541,8 +439,8 @@ func Collection() Milestones { "Lord Digital, " + "Dave Starr, " + "Susan Headley. " + - "
" + - "
", + div1 + + sect1, }, { Title: "The first operating system for x86", Year: 1980, Month: 8, @@ -706,13 +604,13 @@ func Collection() Milestones { "
  • We were primarily cracking games from 1982 until late 1987. [12]
  • " + "
  • Copying games wasn't really illegal in most countries back in 1982 or 1983. [13] ... Most early releases weren't cracked, they were just released or spread.
  • " + ul1 + - "
    " + + sect0 + "
    [1] Conversations on the Berlin Bear, " + "Interview in Vandalism News #46, " + "conversation on CSDb, " + "conversation on Pouët, and " + "conversation on intros.c64.org." + - "
    " + + div1 + "
    [2] Jazzcat writes the image was created in an paint application that first came out in 1983.
    " + "
    [3] Commodore priced the $199 VIC-20 for home users. It is the Business Machines department of Commodore that advertises the $595 Commodore 64, ad source.
    " + "
    [4] Commodore: a company on the edge.
    " + @@ -726,7 +624,7 @@ func Collection() Milestones { "
    [11] This quote suggests multiple Berlin cracking groups existed on the Commodore 64 in 1982 despite this and other sources stating the machine was unavailable in Germany.
    " + "
    [12] Cracking games in this era means removing disk copy protection. Yet the German manual for the VC-1541 floppy disk drive is dated June 1983, which suggests it didn't sell in Germany until the latter half of 1983. The other early significant titles on the Commodore 64 came on cartridges.
    " + "
    [13] Copying and sharing software wasn't criminal in the USA until the NET Act was signed in December 1997. Other countries passed similar laws in the 2000s.
    " + - "
    ", + sect1, }, { Title: "Third-party PC games", Year: 1982, @@ -924,9 +822,9 @@ func Collection() Milestones { Content: "

    Razor 1911, the oldest and most famed brand in the Scene, was founded in Norway and has three members. " + "The group released demos and later cracked exclusively for the Commodore 64 and then the Amiga. Co-founder Sector 9 took the brand to the PC in late 1990.

    " + "

    The distinctive number suffix was a fad with groups of the Commodore 64 era[1].
    1911 denotes the decimal value of hexadecimal $777.

    " + - "
    " + + sect0 + "
    [1] Other named examples include, 1001 Crew, 1701 Crackware, The Gamebusters 1541, The Professionals 2010.
    " + - "
    ", + sect1, Picture: Picture{ Title: "Amazing Demo I", Alt: "Amazing Demo I by Razor 1911 screenshot", @@ -1573,9 +1471,9 @@ func Collection() Milestones { "

    Years later, competitor Pirates With Attitudes would release the Windows 98 media five weeks and Windows 2000 two months before the official launches! " + "However, a global, coordinated law enforcement effort would take down both groups in the following decade.[1]

    " + "

    The other Microsoft-sourced releases from DOD during these two weeks were the Windows 95 floppy edition, upgrade edition, Plus Pack, Microsoft BOB, and Word.

    " + - "
    " + + sect0 + "
    [1] In Operation Cyberstrike and Operation Buccaneer.
    " + - "
    ", + sect1, }, { Title: "Windows 95", Year: 1995, Month: 8, Day: 24, @@ -1805,11 +1703,11 @@ func Collection() Milestones { "│ Sentinel ·········· │ World HQ ·················· │ Xxxxxxx ············ │
    " + "│ The Rock ····· │ US HQ ····················· │ Xxxxxxx ············ │
    " + "│ Major Malfunction · │ EURO HQ ··················· │ Xxxxxxx ············ │
    " + - "│ MidNite Resistence· │ World Courier HQ ·········· │ Xxxxxxx ············ │
    " + + "│ MidNite Resistence· │ World Courier HQ ·········· │ Xxxxxxx ············ │
    " + //nolint:misspell "" + - "
    " + + sect0 + "
    [1] PWA were advertising sites in 1999.
    " + - "
    ", + sect1, // }, { diff --git a/handler/app/web.go b/handler/app/web.go index 36493d4c..eb74c3d7 100644 --- a/handler/app/web.go +++ b/handler/app/web.go @@ -148,7 +148,7 @@ func (web Web) Screenshot(uuid, desc string) template.HTML { elm += img(srcP, alt, class, "") } elm += "" - return template.HTML(elm) + return elm } if sizeJ > 0 { return img(srcJ, alt, class, "") @@ -439,14 +439,13 @@ func (web Web) Thumb(uuid, desc string, bottom bool) template.HTML { "" return template.HTML(elm) } - elm := "" if w { return img(webp, alt, class, style) } if p { return img(png, alt, class, style) } - return template.HTML(elm) + return "" } // ThumbSample returns a HTML image tag for the given uuid. diff --git a/handler/html3/router.go b/handler/html3/router.go index f993b7c3..2e6d08b9 100644 --- a/handler/html3/router.go +++ b/handler/html3/router.go @@ -56,7 +56,8 @@ func getTags(s Sugared, g *echo.Group) *echo.Group { return g } -// custom404 is a custom 404 error handler for the website, "The page cannot be found." +// custom404 is a custom 404 error handler for the website, +// "The page cannot be found.". func custom404(g *echo.Group) *echo.Group { g.GET("/:uri", func(x echo.Context) error { return echo.NewHTTPError(http.StatusNotFound, diff --git a/handler/htmx/demozoo.go b/handler/htmx/demozoo.go index 5b142925..d0ea0d88 100644 --- a/handler/htmx/demozoo.go +++ b/handler/htmx/demozoo.go @@ -77,7 +77,8 @@ func DemozooProd(c echo.Context) error { } html := `
    ` html += fmt.Sprintf(``, id, id) html += `
    ` html += fmt.Sprintf(`

    %s

    `, strings.Join(info, " ")) diff --git a/handler/htmx/htmx.go b/handler/htmx/htmx.go index 46a0b3c9..dbf5ed43 100644 --- a/handler/htmx/htmx.go +++ b/handler/htmx/htmx.go @@ -34,6 +34,8 @@ var ( ErrRoutes = errors.New("echo instance is nil") ) +const rateLimit = 2 + // Routes for the /htmx sub-route group that returns HTML fragments // using the htmx library for AJAX responses. func Routes(e *echo.Echo, logger *zap.SugaredLogger) *echo.Echo { @@ -41,16 +43,12 @@ func Routes(e *echo.Echo, logger *zap.SugaredLogger) *echo.Echo { panic(ErrRoutes) } submit := e.Group("", - middleware.RateLimiter(middleware.NewRateLimiterMemoryStore(2))) - submit.POST("/demozoo/production", func(c echo.Context) error { - return DemozooProd(c) - }) + middleware.RateLimiter(middleware.NewRateLimiterMemoryStore(rateLimit))) + submit.POST("/demozoo/production", DemozooProd) submit.POST("/demozoo/production/submit/:id", func(c echo.Context) error { return DemozooSubmit(logger, c) }) - submit.POST("/pouet/production", func(c echo.Context) error { - return PouetProd(c) - }) + submit.POST("/pouet/production", PouetProd) submit.POST("/pouet/production/submit/:id", func(c echo.Context) error { return PouetSubmit(logger, c) }) @@ -100,8 +98,8 @@ func holder(c echo.Context, name string) error { if exist, err := model.ExistsHash(ctx, db, sum); err != nil { return err } else if exist { - return c.HTML(http.StatusOK, fmt.Sprintf("

    Thanks, but the chosen file already exists on Defacto2.

    %s", - html.EscapeString(input.Filename))) + return c.HTML(http.StatusOK, "

    Thanks, but the chosen file already exists on Defacto2.

    "+ + html.EscapeString(input.Filename)) } // reopen the file @@ -187,7 +185,7 @@ func TemplateFuncMap() template.FuncMap { func Suggestion(name, initialism string, count any) string { s := name if initialism != "" { - s += fmt.Sprintf(", %s", initialism) + s += ", " + initialism } switch val := count.(type) { case int, int8, int16, int32, int64, @@ -200,7 +198,7 @@ func Suggestion(name, initialism string, count any) string { } s += ")" default: - s += fmt.Sprintf("suggestion type error: %s", reflect.TypeOf(count).String()) + s += "suggestion type error: " + reflect.TypeOf(count).String() return s } return s diff --git a/handler/htmx/pouet.go b/handler/htmx/pouet.go index d781d8d4..dc16e725 100644 --- a/handler/htmx/pouet.go +++ b/handler/htmx/pouet.go @@ -126,8 +126,13 @@ func PouetValid(c echo.Context, id int) (pouet.Response, error) { if link.Link == "" { continue } - switch strings.ToLower(link.Type) { - case "youtube": + if strings.Contains(link.Link, "youtube") { + continue + } + if strings.Contains(link.Link, "sourceforge") { + continue + } + if strings.Contains(link.Link, "github") { continue } valid = link.Link