From 7d8d10a948c7f566d75b029f06b80e46e4858e99 Mon Sep 17 00:00:00 2001 From: Juan Carlos Date: Tue, 14 Jul 2020 12:58:36 -0300 Subject: [PATCH 001/203] Update for Nim 1.2.4+ --- nimwc.nimble | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nimwc.nimble b/nimwc.nimble index 102ef7283..5818e0e48 100644 --- a/nimwc.nimble +++ b/nimwc.nimble @@ -1,5 +1,5 @@ # Package -version = "6.0.5" +version = "6.0.6" author = "Thomas T. Jarløv (https://github.com/ThomasTJdev) & Juan Carlos (https://github.com/juancarlospaco)" description = "Generate and host a website. Run the package and access your new webpage." license = "PPL" @@ -10,7 +10,7 @@ installDirs = @["config", "nimwcpkg", "plugins", "public"] # Dependencies -requires "nim >= 1.0.0" +requires "nim >= 1.2.4" requires "jester >= 0.4.3" requires "bcrypt >= 0.2.1" requires "contra >= 0.2.5" From 75db3a27ec1b8b4dc4f82e9ee960401b10d824e8 Mon Sep 17 00:00:00 2001 From: Juan Carlos Date: Tue, 14 Jul 2020 12:58:41 -0300 Subject: [PATCH 002/203] Update for Nim 1.2.4+ --- nimwcpkg/constants/_htmls.nim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nimwcpkg/constants/_htmls.nim b/nimwcpkg/constants/_htmls.nim index f2d39c1a3..996634d3e 100644 --- a/nimwcpkg/constants/_htmls.nim +++ b/nimwcpkg/constants/_htmls.nim @@ -1063,6 +1063,6 @@ main {padding-top: 40px;}""" officialJs* = """!function(){ const $wel = document.querySelector("#welcome"); -if ($wel != null) { +if ($wel != null) { const t=window,e=document.documentElement;if(e.classList.remove("no-js"),e.classList.add("js"),document.body.classList.contains("has-animations")){const t=window.sr=ScrollReveal();t.reveal(".feature",{duration:600,distance:"20px",easing:"cubic-bezier(0.5, -0.01, 0, 1.005)",origin:"right",interval:100}),t.reveal(".media-canvas",{duration:600,scale:".95",easing:"cubic-bezier(0.5, -0.01, 0, 1.005)",viewFactor:.5})}const n=document.querySelector(".device-mockup");function i(){n.classList.add("has-loaded")}n.complete?i():n.addEventListener("load",i);const s=document.querySelector(".features"),a=s.querySelector(".section-title"),o=document.querySelector(".feature-inner");function r(){let t=s.querySelector(".features-inner").getBoundingClientRect().left,e=o.getBoundingClientRect().left,n=parseInt(e-t);a.style.marginLeft=e>t?`${n}px`:0}r(),t.addEventListener("resize",r);const c=document.querySelectorAll(".is-moving-object");let l=0,d=0,u=0,g=0,f=0,m=e.clientWidth,p=e.clientHeight;c&&t.addEventListener("mousemove",function(t,e){let n=null,i=e;return(...e)=>{let s=Date.now();(!n||s-n>=i)&&(n=s,t.apply(this,e))}}(function(e){!function(e,n){l=e.pageX,d=e.pageY,u=t.scrollY,g=m/2-l,f=p/2-(d-u);for(let t=0;t Date: Tue, 14 Jul 2020 12:58:45 -0300 Subject: [PATCH 003/203] Update for Nim 1.2.4+ --- nimwcpkg/constants/_strings.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nimwcpkg/constants/_strings.nim b/nimwcpkg/constants/_strings.nim index cc2d079d3..f8764fb30 100644 --- a/nimwcpkg/constants/_strings.nim +++ b/nimwcpkg/constants/_strings.nim @@ -4,7 +4,7 @@ const - NimblePkgVersion* {.strdefine.} = "6.0.3" ## NimWC Version (SemVer) + NimblePkgVersion* {.strdefine.} = "6.0.6" ## NimWC Version (SemVer) commitHash* = staticExec"git rev-parse --short HEAD" & "" ## NimWC Version (Git Hash) From 3006c60642cdcc87da0338e7dcda20dba58808b7 Mon Sep 17 00:00:00 2001 From: Juan Carlos Date: Tue, 14 Jul 2020 12:58:51 -0300 Subject: [PATCH 004/203] Update for Nim 1.2.4+ --- nimwcpkg/databases/databases.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nimwcpkg/databases/databases.nim b/nimwcpkg/databases/databases.nim index 5ae3f552e..617983cc5 100644 --- a/nimwcpkg/databases/databases.nim +++ b/nimwcpkg/databases/databases.nim @@ -10,7 +10,7 @@ else: import db_sqlite let nimwcpkgDir = getAppDir().replace("/nimwcpkg", "") -assert existsDir(nimwcpkgDir), "nimwcpkg directory not found" +assert dirExists(nimwcpkgDir), "nimwcpkg directory not found" template vacuumDb*(db: DbConn): bool = db.tryExec(sqlVacuum) From 6ccd0224011f83ab3c1a80a86cd01c0e9e19a258 Mon Sep 17 00:00:00 2001 From: Juan Carlos Date: Tue, 14 Jul 2020 12:58:56 -0300 Subject: [PATCH 005/203] Update for Nim 1.2.4+ --- nimwcpkg/files/_walkers.nim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nimwcpkg/files/_walkers.nim b/nimwcpkg/files/_walkers.nim index 814858ca3..3619deb33 100644 --- a/nimwcpkg/files/_walkers.nim +++ b/nimwcpkg/files/_walkers.nim @@ -1,20 +1,20 @@ proc filesListPrivate*(): seq[string] {.inline.} = ## Get all filenames for project files - preconditions existsDir(storageEFS / "files/private/") + preconditions dirExists(storageEFS / "files/private/") for file in walkFiles(storageEFS / "files/private/*.*"): result.add(file) proc filesListPublic*(): seq[string] {.inline.} = ## Get all filenames for project files - preconditions existsDir(storageEFS / "files/public/") + preconditions dirExists(storageEFS / "files/public/") for file in walkFiles(storageEFS / "files/public/*.*"): result.add(file) proc filesListPublicFolderFiles*(): seq[string] {.inline.} = ## Get all filenames for project files - preconditions existsDir("public/images/") + preconditions dirExists("public/images/") for file in walkFiles("public/images/*.*"): result.add(file) From 2af26ce1624a62e23396c9f410ef88530aab4f4f Mon Sep 17 00:00:00 2001 From: Juan Carlos Date: Tue, 14 Jul 2020 12:59:01 -0300 Subject: [PATCH 006/203] Update for Nim 1.2.4+ --- nimwcpkg/utils/configs.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nimwcpkg/utils/configs.nim b/nimwcpkg/utils/configs.nim index 40f114139..7a632fc27 100644 --- a/nimwcpkg/utils/configs.nim +++ b/nimwcpkg/utils/configs.nim @@ -5,7 +5,7 @@ proc getConfig*(configPath: string, section: ConfigSections): Table[string, stri ## Take file path & section, return Table of config, to access using cfg["key"] assert configPath.len > 0, "configPath must not be empty string" assert configPath[^4..^1] == ".cfg", "configPath must be .cfg file extension" - assert existsFile(configPath), "configPath file not found" + assert fileExists(configPath), "configPath file not found" let dict = loadConfig(configPath) case section of cfgDatabase: From 43dd3336397f3605bbfe2e0baeca262efe349862 Mon Sep 17 00:00:00 2001 From: Juan Carlos Date: Tue, 14 Jul 2020 12:59:07 -0300 Subject: [PATCH 007/203] Update for Nim 1.2.4+ --- nimwcpkg/utils/loggers.nim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nimwcpkg/utils/loggers.nim b/nimwcpkg/utils/loggers.nim index a5b88cbf1..02b2ed800 100644 --- a/nimwcpkg/utils/loggers.nim +++ b/nimwcpkg/utils/loggers.nim @@ -4,8 +4,8 @@ import ../constants/constants, ../emails/emails let nimwcpkgDir = getAppDir().replace("/nimwcpkg", "") let configFile = nimwcpkgDir / "config/config.cfg" -assert existsDir(nimwcpkgDir), "nimwcpkg directory not found: " & nimwcpkgDir -assert existsFile(configFile), "config/config.cfg file not found" +assert dirExists(nimwcpkgDir), "nimwcpkg directory not found: " & nimwcpkgDir +assert fileExists(configFile), "config/config.cfg file not found" setCurrentDir(nimwcpkgDir) once: discard existsOrCreateDir("log") @@ -27,7 +27,7 @@ template log2admin*(msg: string) = proc backupOldLogs*(logFilePath: string): tuple[output: TaintedString, exitCode: int] = ## Compress all old rotated Logs. - assert existsDir(logFilePath), "logFilePath File not found" + assert dirExists(logFilePath), "logFilePath File not found" assert findExe("tar").len > 0, "Tar not found" var files2tar: seq[string] for logfile in walkFiles(logFilePath / "*.log"): files2tar.add logfile From 8750a8ea07f10e823049762da2b2a6e221823985 Mon Sep 17 00:00:00 2001 From: Juan Carlos Date: Tue, 14 Jul 2020 12:59:16 -0300 Subject: [PATCH 008/203] Update for Nim 1.2.4+ --- nimwc.nim | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/nimwc.nim b/nimwc.nim index 8bc397e99..f716136bc 100644 --- a/nimwc.nim +++ b/nimwc.nim @@ -37,9 +37,9 @@ configExists() proc updateNimwc() = ## GIT hard update - preconditions(existsDir"plugins/", existsDir"public/css/", existsDir"public/js/", - existsFile"plugins/plugin_import.txt", existsFile"public/css/style_custom.css", - existsFile"public/js/js_custom.js", findExe"git".len > 0) + preconditions(dirExists"plugins/", dirExists"public/css/", dirExists"public/js/", + fileExists"plugins/plugin_import.txt", fileExists"public/css/style_custom.css", + fileExists"public/js/js_custom.js", findExe"git".len > 0) # No postconditions because we directly quit anyways. const cmd = "git fetch --all ; git reset --hard origin/master" let @@ -142,7 +142,7 @@ proc launcherActivated(cfg: Config) = dnsz = [cfg.getSectionValue("firejail", "dns0").strip, cfg.getSectionValue("firejail", "dns1").strip, cfg.getSectionValue("firejail", "dns2").strip, cfg.getSectionValue("firejail", "dns3").strip] assert countProcessors() > cpuCores, "Dedicated CPU Cores must be less or equal to the actual CPU Cores: " & $cpuCores - assert hostz.existsFile, "Hosts file not found: " & hostz + assert hostz.fileExists, "Hosts file not found: " & hostz let myjail = Firejail( noDvd: cfg.getSectionValue("firejail", "noDvd").parseBool, noSound: cfg.getSectionValue("firejail", "noSound").parseBool, @@ -217,14 +217,14 @@ proc startupCheck(cfg: Config) = ## Checking if the main-program file exists. If not it will ## be compiled with args and compiler options (compiler ## options should be specified in the *.nim.pkg) - preconditions compileOptions.len > 0, storageEFS.len > 0, existsFile(getAppDir() & "/nimwcpkg/nimwc_main.nim") + preconditions compileOptions.len > 0, storageEFS.len > 0, fileExists(getAppDir() & "/nimwcpkg/nimwc_main.nim") # Storage location. Folders are created in the module files.nim let args = replace(commandLineParams().join(" "), "-", "") userArgs = if args == "": "" else: " " & args appPath = getAppDir() / "nimwcpkg" / cfg.getSectionValue("Server", "appname") when not defined(ignoreefs): - if not existsDir(storageEFS): # Check access to EFS file system. + if not dirExists(storageEFS): # Check access to EFS file system. quit("No access to storage in release mode. Critical.") # Ensure that the tables are present in the DB From c4c8d1ad505debbcebd5a870180baa03ac31c96f Mon Sep 17 00:00:00 2001 From: Juan Carlos Date: Tue, 14 Jul 2020 13:02:28 -0300 Subject: [PATCH 009/203] Update for Nim 1.2.4+ --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1df33ac37..a95d25ebd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## v6.0.6 +## Changes +- Fixes and updates for Nim >= 1.2.4 + ## v6.0.3 ## Changes - Fix #121, #122 and #123 From f180414db46566a737af9e7afd644e27a750f201 Mon Sep 17 00:00:00 2001 From: Juan Carlos Date: Tue, 14 Jul 2020 13:09:15 -0300 Subject: [PATCH 010/203] Update for Nim 1.2.4+ --- .gitattributes | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitattributes b/.gitattributes index 5b221be79..45f37b485 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,3 +1,3 @@ *.nims linguist-language=Nim *.nim linguist-language=Nim -*.* linguist-language=Nim +# *.* linguist-language=Nim From 32ed8f2a7f6fdf66db783d2342773c1eacfcbc5c Mon Sep 17 00:00:00 2001 From: Juan Carlos Date: Tue, 14 Jul 2020 13:11:08 -0300 Subject: [PATCH 011/203] Update for Nim 1.2.4+ --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 94b77d10e..b79d13835 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -44,4 +44,4 @@ jobs: run: nimble build -d:release - name: Nimble install - run: nimble install \ No newline at end of file + run: nimble install From f17e824a72de3b393d7966875e83dfa8fa15425e Mon Sep 17 00:00:00 2001 From: Juan Carlos Date: Tue, 14 Jul 2020 13:41:39 -0300 Subject: [PATCH 012/203] Deprecate Bootstrap as supported theme --- nimwcpkg/nimwc_main.nim | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/nimwcpkg/nimwc_main.nim b/nimwcpkg/nimwc_main.nim index 620079872..12b063049 100644 --- a/nimwcpkg/nimwc_main.nim +++ b/nimwcpkg/nimwc_main.nim @@ -392,8 +392,7 @@ when isMainModule: # Insert standard data if "insertdata" in commandLineParams() and readLineFromStdin( "Insert standard data?\nThis will override existing data! (y/n):").normalize == "y": - if "bootstrap" in commandLineParams(): createStandardData(db, cssBootstrap) - elif "water" in commandLineParams(): createStandardData(db, cssWater) + if "water" in commandLineParams(): createStandardData(db, cssWater) elif "official" in commandLineParams(): createStandardData(db, cssOfficial) else: createStandardData(db, cssBulma) From 619b342750462da7600fbc449ac476d710ac17e0 Mon Sep 17 00:00:00 2001 From: Juan Carlos Date: Tue, 14 Jul 2020 13:41:45 -0300 Subject: [PATCH 013/203] Deprecate Bootstrap as supported theme --- nimwcpkg/enums/enums.nim | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/nimwcpkg/enums/enums.nim b/nimwcpkg/enums/enums.nim index c6e203bcc..44f45e58f 100644 --- a/nimwcpkg/enums/enums.nim +++ b/nimwcpkg/enums/enums.nim @@ -8,7 +8,6 @@ type CSSFramework* = enum ## CSS Frameworks enumeration. cssBulma = "bulma" - cssBootstrap = "bootstrap" cssWater = "water" cssOfficial = "official" @@ -20,4 +19,4 @@ type cfgProxy = "Proxy" cfgRecaptcha = "reCAPTCHA" cfgSmtp = "SMTP" - cfgFirejail = "firejail" \ No newline at end of file + cfgFirejail = "firejail" From 994c8cbcd4dd227e1b3bea7c8e8ef192ef87bcbf Mon Sep 17 00:00:00 2001 From: Juan Carlos Date: Tue, 14 Jul 2020 13:41:50 -0300 Subject: [PATCH 014/203] Deprecate Bootstrap as supported theme --- nimwcpkg/databases/_standarddatas.nim | 2 -- 1 file changed, 2 deletions(-) diff --git a/nimwcpkg/databases/_standarddatas.nim b/nimwcpkg/databases/_standarddatas.nim index 75ca8fed4..bc5e793ba 100644 --- a/nimwcpkg/databases/_standarddatas.nim +++ b/nimwcpkg/databases/_standarddatas.nim @@ -6,8 +6,6 @@ proc standardDataSettings*(db: DbConn, dataStyle = cssBulma) = exec(db, sql"DELETE FROM settings") const sqlDataSettings = sql"INSERT INTO settings (title, head, navbar, footer) VALUES (?, ?, ?, ?)" case dataStyle - of cssBootstrap: - discard insertID(db, sqlDataSettings, title, headBootstrap, navbarBootstrap, footer) of cssWater: discard insertID(db, sqlDataSettings, title, headClean, navbarClean, footerClean) of cssOfficial: From 3e135ded91bee83d7d19ab86ddbbd98ffe981754 Mon Sep 17 00:00:00 2001 From: Juan Carlos Date: Tue, 14 Jul 2020 13:41:55 -0300 Subject: [PATCH 015/203] Deprecate Bootstrap as supported theme --- nimwcpkg/constants/_strings.nim | 1 - 1 file changed, 1 deletion(-) diff --git a/nimwcpkg/constants/_strings.nim b/nimwcpkg/constants/_strings.nim index f8764fb30..f6705a084 100644 --- a/nimwcpkg/constants/_strings.nim +++ b/nimwcpkg/constants/_strings.nim @@ -192,7 +192,6 @@ Options: --backupdb-gpg Compressed signed full backup of database (GPG+SHA512+TarGz). --backuplogs Compressed full backup of all old unused rotated Logs (TarGz). --insertdata bulma Insert https://bulma.io data to database (No JS, Default, overrides data) - --insertdata bootstrap Insert https://getbootstrap.com data to database (jQuery, overrides data) --insertdata water Insert Water CSS data to database (No JS, HTML Classless, overrides data) --insertdata official Insert official nimwc.org data to database (overrides data, CSS, JS) --newdb Generates a database with standard tables (Wont override data). From f9dc168f6d2c54db01b940ce6fa359fe5628d99c Mon Sep 17 00:00:00 2001 From: Juan Carlos Date: Tue, 14 Jul 2020 13:42:00 -0300 Subject: [PATCH 016/203] Deprecate Bootstrap as supported theme --- nimwcpkg/constants/_htmls.nim | 66 ----------------------------------- 1 file changed, 66 deletions(-) diff --git a/nimwcpkg/constants/_htmls.nim b/nimwcpkg/constants/_htmls.nim index 996634d3e..ff1cf2cf6 100644 --- a/nimwcpkg/constants/_htmls.nim +++ b/nimwcpkg/constants/_htmls.nim @@ -70,23 +70,6 @@ const """ - headBootstrap* = """ - - - - - - - - - - - - - -""" - - navbar* = """""" - - navbarOfficial* = """