diff options
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | LICENSE (renamed from LICENSE.txt) | 0 | ||||
-rw-r--r-- | back-end/src/Model/SimpleBookmarkContext.cs | 5 | ||||
-rw-r--r-- | ci/config/Essentials.Accounts.json | 76 | ||||
-rw-r--r-- | ci/config/PageRouter.json | 6 | ||||
-rw-r--r-- | ci/config/SessionProvider.json | 21 | ||||
-rw-r--r-- | ci/config/SimpleBookmark.json | 16 | ||||
-rw-r--r-- | ci/config/config.json | 183 | ||||
-rw-r--r-- | ci/config/routes.xml | 46 | ||||
-rw-r--r-- | ci/install.ps1 | 26 | ||||
-rw-r--r-- | ci/package.json | 10 | ||||
-rw-r--r-- | ci/plugins.taskfile.yaml | 157 | ||||
-rw-r--r-- | ci/setup.sh | 50 | ||||
-rw-r--r-- | ci/taskfile.yaml | 131 | ||||
-rw-r--r-- | front-end/package-lock.json | 6 | ||||
-rw-r--r-- | front-end/package.json | 2 | ||||
-rw-r--r-- | front-end/src/components/Bookmarks.vue | 6 | ||||
-rw-r--r-- | front-end/src/components/Settings/TotpSettings.vue | 5 | ||||
-rw-r--r-- | simple-bookmark.build.sln | 25 |
19 files changed, 765 insertions, 8 deletions
@@ -386,3 +386,5 @@ dist-ssr *.njsproj *.sln *.sw? + +!*.build.sln diff --git a/back-end/src/Model/SimpleBookmarkContext.cs b/back-end/src/Model/SimpleBookmarkContext.cs index ed734b3..2470695 100644 --- a/back-end/src/Model/SimpleBookmarkContext.cs +++ b/back-end/src/Model/SimpleBookmarkContext.cs @@ -59,6 +59,11 @@ namespace SimpleBookmark.Model .MaxLength(100) .Next() + .WithColumn(p => p.Version) + .TimeStamp() + .AllowNull(true) + .Next() + .WithColumn(p => p.Url) .AllowNull(true) .Next() diff --git a/ci/config/Essentials.Accounts.json b/ci/config/Essentials.Accounts.json new file mode 100644 index 0000000..680f92a --- /dev/null +++ b/ci/config/Essentials.Accounts.json @@ -0,0 +1,76 @@ +{ + "debug": false, + + //endpoints + + "login_endpoint": { + "path": "/api/account/login", + "max_login_attempts": 10, //10 failed attempts in 10 minutes + "failed_attempt_timeout_sec": 600 //10 minutes + }, + + "keepalive_endpoint": { + "path": "/api/account/keepalive", + //Regen token every 10 mins along with cookies + "token_refresh_sec": 600 //10 minutes + }, + + "profile_endpoint": { + "path": "/api/account/profile" + }, + + "password_endpoint": { + "path": "/api/account/reset" + }, + + "mfa_endpoint": { + "path": "/api/account/mfa" + }, + + "logout_endpoint": { + "path": "/api/account/logout" + }, + + "pki_auth_endpoint": { + "path": "/api/account/pki", + "jwt_time_dif_sec": 30, + "max_login_attempts": 10, + "failed_attempt_timeout_sec": 600, + //Configures the PATCH and DELETE methods to update the user's stored key when logged in + "enable_key_update": true + }, + + //If mfa is defined, configures mfa enpoints and enables mfa logins + "mfa": { + "upgrade_expires_secs": 180, + "nonce_size": 64, + + //Defines totp specific arguments + "totp": { + "digits": 6, + "issuer": "Simple-Bookmark", + "period_secs": 30, + "algorithm": "sha1", + "secret_size": 32, + "window_size": 2 + } + }, + + //Defines the included account provider + "account_security": { + //Time in seconds before a session is considered expired + "session_valid_for_sec": 3600, + //Path/domain for all security cookies + "cookie_domain": "", + "cookie_path": "/", + "status_cookie_name": "li", //front-end cookie name must match to detect login status + "otp_header_name": "X-Web-Token", //Front-end header name must match + "otp_time_diff_sec": 30, + "otp_key_size": 64, + "pubkey_cookie_name": "client-id", + "pubkey_signing_key_size": 32, + "strict_origin": false, + "strict_path": true, //Can be enabled if front-end is running on the same server + //"allowed_origins": [""] + } +}
\ No newline at end of file diff --git a/ci/config/PageRouter.json b/ci/config/PageRouter.json new file mode 100644 index 0000000..7d24da8 --- /dev/null +++ b/ci/config/PageRouter.json @@ -0,0 +1,6 @@ +{ + "debug": false, + "store": { + "route_file": "config/routes.xml" + } +}
\ No newline at end of file diff --git a/ci/config/SessionProvider.json b/ci/config/SessionProvider.json new file mode 100644 index 0000000..e281edf --- /dev/null +++ b/ci/config/SessionProvider.json @@ -0,0 +1,21 @@ +{ + + "debug": false, + + //Provider assemblies to load + "provider_assemblies": [ "VNLib.Plugins.Sessions.VNCache.dll" ], + + //Web session provider, valid format for VNCache and also memory sessions + "web": { + //Cache system key prefix + "cache_prefix": "websessions", + //The session cookie name + "cookie_name": "sb-session", + //Size in bytes for generated session ids + "cookie_size": 40, + //time (in seconds) a session is valid for + "valid_for_sec": 3600, + //The maxium number of connections waiting for the cache server responses + "max_waiting_connections": 100 + } +}
\ No newline at end of file diff --git a/ci/config/SimpleBookmark.json b/ci/config/SimpleBookmark.json new file mode 100644 index 0000000..f097602 --- /dev/null +++ b/ci/config/SimpleBookmark.json @@ -0,0 +1,16 @@ +{ + + //Comments are allowed + "debug": false, + + "bm_endpoint": { + + "path": "/api/bookmarks", //Path for the bookmarks endpoint + + "config": { + "max_limit": 100, //Max results per page + "default_limit": 20, //Default results per page + "user_quota": 5000 //Max bookmarks per user + } + } +}
\ No newline at end of file diff --git a/ci/config/config.json b/ci/config/config.json new file mode 100644 index 0000000..c012728 --- /dev/null +++ b/ci/config/config.json @@ -0,0 +1,183 @@ +{ + + //Host application config, config is loaded as a read-only DOM that is available + //to the host and loaded child plugins, all elements are available to plugins via the 'HostConfig' property + + "http": { + //The defaut HTTP version to being requests with (does not support http/2 yet) + "default_version": "HTTP/1.1", + //The maxium size (in bytes) of response messges that will be compressed + "compression_limit": 2048000, + //Minium response size (in bytes) to compress + "compression_minimum": 2048, + //The size of the buffer to use when parsing multipart/form data uploads + "multipart_max_buf_size": 20480, + //The maxium ammount of data (in bytes) allows for mulitpart/form data file uploads + "multipart_max_size": 80240, + //Absolute maximum size (in bytes) of the request entity body (exludes headers) + "max_entity_size": 51200, + //Keepalive ms for HTTP1.1 keepalive connections + "keepalive_ms": 1000000, + //The buffer size to use when parsing headers (also the maxium request header size allowed) + "header_buf_size": 8128, + //The maxium number of headers allowed in an HTTP request message + "max_request_header_count": 50, + //The maxium number of allowed network connections, before 503s will be issued automatically and connections closed + "max_connections": 5000, + //The size in bytes of the buffer to use when writing response messages + "response_buf_size": 65535, + //time (in ms) to wait for a response from an active connection in recv mode, before dropping it + "recv_timeout_ms": 5000, + //Time in ms to wait for the client to accept transport data before terminating the connection + "send_timeout_ms": 60000, + //The size (in bytes) of the buffer used to store all response header data + "response_header_buf_size": 16384, + //Max number of file uploads allowed per request + "max_uploads_per_request": 10 + }, + + //Path to managed compressor library + "compression_lib": "lib/vnlib.net.compression/VNLib.Net.Compression.dll", + + //Setup the native lib + "vnlib.net.compression": { + "lib_path": "lib/vnlib_compress/build/<os-dependent-lib-path>", + "level": 1 + }, + + //Maximum ammount of time a request is allowed to be processed (includes loading or waiting for sessions) before operations will be cancelled and a 503 returned + "max_execution_time_ms": 20000, + + //Collection of objects to define hosts+interfaces to build server listeners from + "virtual_hosts": [ + { + //The interface to bind to, you may not mix TLS and non-TLS connections on the same interface + "interface": { + "address": "0.0.0.0", + "port": 8080 + }, + + //The directory path for files served by this endpoint + "path": "dist", + + //The hostname to listen for, "*" as wildcard, and "[system]" as the default hostname for the current machine + //"hostname": "*", + + //Or specify an array of hostnames instead, the hostnames array property takes priority over the single hostname property, each must be unique + "hostnames": [ "*" ], + + //Collection of "trusted" servers to allow proxy header support from + "downstream_servers": [], + + //Specify a list of ip addresses that are allowed to connect to the server, 403 will be returned if connections are not on this list + //whitelist works behind a trusted downstream server that supports X-Forwared-For headers + //"whitelist": [ "127.0.0.1" ], + + //A list of file extensions to deny access to, if a resource is requested and has one of the following extensions, a 404 is returned + "deny_extensions": [ ".env", ".yaml", ".cs" ], + + //The default file extensions to append to a resource that does not have a file extension + "default_files": [ "index.html" ], + + //Key-value headers object, some headers are special and are controlled by the vh processor + "headers": { + "X-Content-Type-Options": "nosniff", + "X-Xss-Protection": "1; mode=block", + "X-Frame-Options": "DENY", + "Content-Security-Policy": "default-src 'self' 'unsafe-inline'; img-src 'self' blob: data:; frame-src 'none'; object-src 'none'; referrer no-referrer-when-downgrade; upgrade-insecure-requests; block-all-mixed-content;" + }, + + //Enables cors support for all endpoints and header controls, if false, all endpoints that are send CORS request headers will be forbidden + //"enable_cors": true, + + //Allowed cors authoriy domains + //"cors_allowed_authority": [ "localhost:8080" ], + + //Define a TLS certificate (enables TLS on the interface) + "disabled ssl": { + + //Cert may be pem or pfx (include private key in pfx, or include private key in a pem file) + "cert": "/path/to/cert.pfx|pem", + + //A pem encoded private key, REQUIRED if using a PEM certificate, may be encrypted with a password + "privkey": "/path/to/private_key.pem", + + //An optional password for the ssl private key + "password": "plain-text-password", + + //requires that any client connecting to this host present a valid certificate + "client_cert_required": false + }, + + //A list of error file objects, files are loaded into memory (and watched for changes) and returned when the specified error code occurs + "error_files": [], + + //The default + "cache_default_sec": 864000 + } + ], + + + //Defines the directory where plugin's are to be loaded from + "plugins": { + //Hot-reload creates collectable assemblies that allow full re-load support in the host application, should only be used for development purposes! + "hot_reload": false, + "reload_delay_sec": 2, + "path": "plugins", + "config_dir": "config" + }, + + "disabled sys_log": { + //"path": "path/to/syslog/file", + //"template": "serilog template for writing to file", + //"flush_sec": 5, + //"retained_files": 31, + //"file_size_limit": 10485760, + //"interval": "infinite" + }, + + "disabled app_log": { + //"path": "path/to/applog/file", + //"template": "serilog template for writing to file", + //"flush_sec": 5, + //"retained_files": 31, + //"file_size_limit": 10485760, + //"interval": "infinite" + }, + + //Sql for the users database + "sql": { + "db_type": "sqlite", //mysql, mssql(default), sqlite + "source": "simple-bookmark.db" //For sqlite only + + //"hostname": "example.com", + //"username": "simple-bookmark", + //"catalog": "simple-bookmark", + //"min_pool_size": 5, + //"ms_security": false + //"trust_cert": false + }, + + //caching should be setup globally after VNCache #78a47dd + "cache": { + //Load the vncache dll + "assembly_name": "VNLib.Data.Caching.Providers.VNCache.dll", + //Defaulting to memory only for now + "memory_only": true, + //enable memory cache + "memory_cache": { + "buckets": 20, + "bucket_size": 5000, + "max_age_sec": 600, + "refresh_interval_sec": 60, + "zero_all": false, + "max_object_size": 8128 + } + }, + + //Global secrets object, used by the host and pluings for a specialized secrets + "secrets": { + //"db_password": "" + "passwords": "yourbase64passwordsecret" + } +} diff --git a/ci/config/routes.xml b/ci/config/routes.xml new file mode 100644 index 0000000..85f9830 --- /dev/null +++ b/ci/config/routes.xml @@ -0,0 +1,46 @@ +<?xml version="1.0" encoding="utf-8" ?> + +<!--Routes container element holds a collection of route elements--> +<routes> + <!-- + Example route configuration for a single page app + where the tree looks like this: + / (index.html) + /assets (assets directory) (css and js files) + + Wildcard hosts match all hosts that do not have rules with more specific hosts + --> + + <!-- + Allow assets directory to pass through for all requests, using the Continue routine (1) + + Because this route has a more specific path than the catch all route + it will be processed first + --> + <route routine="1" privilege="0"> + + <!--Wildcard host--> + <hostname>*</hostname> + + <!--All paths that start with /assets/ will be matched--> + <path>/assets/*</path> + </route> + + <!--Show the index file when navigating to /--> + <route routine="4" privilege="0"> + <hostname>*</hostname> + <path>/</path> + <alternate>index.html</alternate> + </route> + + <!--Redirect all other pages back to the app (homepage)--> + <route routine="2" privilege="0"> + <hostname>*</hostname> + <path>/*</path> + <alternate>/</alternate> + </route> + + + <!--All routes that do not match will be allowed, this is only / since it does not have a matching rule--> + +</routes>
\ No newline at end of file diff --git a/ci/install.ps1 b/ci/install.ps1 new file mode 100644 index 0000000..4c42c18 --- /dev/null +++ b/ci/install.ps1 @@ -0,0 +1,26 @@ +param([String] $BaseUrl, [String] $ModuleName, [String] $ProjectName, [String]$FileName) + +#get the latest file +Invoke-WebRequest "$BaseUrl/$ModuleName/@latest" -OutFile latest.txt +#read the file into a variable +$latest = Get-Content latest.txt + +#download the latest version +Invoke-WebRequest "$BaseUrl/$ModuleName/$latest/$ProjectName/$FileName" -OutFile $FileName + +#download latest sha256 +Invoke-WebRequest "$BaseUrl/$ModuleName/$latest/$ProjectName/$FileName.sha256" -OutFile "$FileName.sha256" + +#verify the file +$hash = (Get-FileHash $FileName -Algorithm SHA256).Hash + +#read the sha256 file +$sha256 = Get-Content "$FileName.sha256" + +#compare the hashes +if ($hash -eq $sha256) { + Write-Host "Hashes match, file is valid" -ForegroundColor Blue +} else { + throw "Hashes do not match, file is invalid" +} + diff --git a/ci/package.json b/ci/package.json new file mode 100644 index 0000000..088536e --- /dev/null +++ b/ci/package.json @@ -0,0 +1,10 @@ +{ + "name": "Simple-Bookmark", + "version": "0.1.0", + "type": "module", + "copyright": "Copyright \u00A9 2024 Vaughn Nugent", + "author": "Vaughn Nugent", + "description": "The project contains a ready-to-run, SimpleBookmark web server installation for Windows, Linux, and MacOS for .NET/8.0 Runtime.", + "repository": "https://github.com/VnUgE/Simple-Bookmark/tree/master/ci", + "output_dir": "bin" +}
\ No newline at end of file diff --git a/ci/plugins.taskfile.yaml b/ci/plugins.taskfile.yaml new file mode 100644 index 0000000..66641ab --- /dev/null +++ b/ci/plugins.taskfile.yaml @@ -0,0 +1,157 @@ +# https://taskfile.dev + +#Called by the vnbuild system to produce builds for my website +#https://www.vaughnnugent.com/resources/software + +version: "3" + +vars: + +tasks: + + all: + cmds: + - echo "Installing and configuring plugins and UI" + - task: install-accounts + - task: install-router + - task: install-sessions + - task: install-vncache + - task: install-vncache-sessions + - task: install-users + - task: install-argon2-lib + - task: install-compression + - task: install-compressor-lib + - task: build-bookmarks + + build-bookmarks: + cmds: + #build front-end + - cd ../front-end && npm install && npm run build + #move dist files to web root + - cmd: powershell -Command "cp -Recurse -Force ../front-end/dist {{.USER_WORKING_DIR}}" + + #build the plugin + - cmd: cd ../back-end/src && task build + - powershell -Command "mkdir plugins/SimpleBookmark -Force" + #copy the plugin output + - powershell -Command "cp -Recurse -Force ../back-end/src/bin/release/net8.0/publish/* plugins/SimpleBookmark/" + + install-accounts: + cmds: + #install accounts plugin + - task: install-plugin + vars: + PROJECT_NAME: 'VNLib.Plugins.Essentials.Accounts' + MODULE_NAME: "Plugins.Essentials" + FILE_NAME: "release.tgz" + DIR: './plugins/Essentials.Accounts' + + install-router: + cmds: + #install router plugin + - task: install-plugin + vars: + PROJECT_NAME: 'VNLib.Plugins.Essentials.Content.Routing' + MODULE_NAME: "Plugins.Essentials" + FILE_NAME: "release.tgz" + DIR: './plugins/PageRouter' + + install-sessions: + cmds: + #install sessions plugin + - task: install-plugin + vars: + PROJECT_NAME: 'SessionProvider' + MODULE_NAME: "VNLib.Plugins.Sessions" + FILE_NAME: "release.tgz" + DIR: './plugins/SessionProvider' + + install-users: + cmds: + #install users plugin + - task: install-plugin + vars: + PROJECT_NAME: 'VNLib.Plugins.Essentials.Users' + MODULE_NAME: "VNLib.Plugins.Essentials.Users" + FILE_NAME: "release.tgz" + DIR: './plugins/assets/VNLib.Plugins.Essentials.Users' + + install-vncache: + cmds: + #install vncache global cache provider plugin + - task: install-plugin + vars: + PROJECT_NAME: 'VNLib.Data.Caching.Providers.VNCache' + MODULE_NAME: "VNLib.Data.Caching" + FILE_NAME: "release.tgz" + DIR: './plugins/assets/VNLib.Data.Caching.Providers.VNCache' + + install-vncache-sessions: + cmds: + #install vncache-web-sessions plugin + - task: install-plugin + vars: + PROJECT_NAME: 'VNLib.Plugins.Sessions.VNCache' + MODULE_NAME: "VNLib.Plugins.Sessions" + FILE_NAME: "release.tgz" + DIR: './plugins/assets/VNLib.Plugins.Sessions.VNCache' + + install-compression: + cmds: + #install compression plugin + - task: install-plugin + vars: + PROJECT_NAME: 'VNLib.Net.Compression' + MODULE_NAME: "VNLib.Core" + FILE_NAME: "release.tgz" + DIR: './lib/vnlib.net.compression' + + install-compressor-lib: + cmds: + #install compressor plugin + - task: install-plugin + vars: + PROJECT_NAME: 'vnlib_compress' + MODULE_NAME: "VNLib.Core" + FILE_NAME: "src.tgz" + DIR: './lib/vnlib_compress' + + install-argon2-lib: + cmds: + #install the argon2 binary for Windows + - task: install-plugin + vars: + PROJECT_NAME: 'phc-winner-argon2' + MODULE_NAME: "VNLib.Core" + FILE_NAME: "win-x64-release-Argon2.tgz" + DIR: './lib/argon2' + + #install the argon2 source code package for Linux and Mac + - task: install-plugin + vars: + PROJECT_NAME: 'phc-winner-argon2' + MODULE_NAME: "VNLib.Core" + FILE_NAME: "src.tgz" + DIR: './lib/argon2' + + #remove unneeded files + - cmd: powershell -Command "rm ./lib/argon2/man -Recurse" + ignore_error: true + - cmd: powershell -Command "rm ./lib/argon2/latex -Recurse" + ignore_error: true + - cmd: powershell -Command "rm ./lib/argon2/kats -Recurse" + ignore_error: true + - cmd: powershell -Command "rm ./lib/argon2/argon2-specs.pdf" + ignore_error: true + - cmd: powershell -Command "rm ./lib/argon2/package.json" + ignore_error: true + + install-plugin: + cmds: + #make the plugin directory + - cmd: powershell -Command "mkdir {{.DIR}} -Force" + ignore_error: true + - cd {{.DIR}} && powershell "{{.USER_WORKING_DIR}}/install.ps1" -BaseUrl {{.BUILDS_URL}} -ModuleName {{.MODULE_NAME}} -ProjectName {{.PROJECT_NAME}} -FileName {{.FILE_NAME}} + - cd {{.DIR}} && tar -xzf {{.FILE_NAME}} + #remove the archive file + - cd {{.DIR}} && powershell -Command "rm {{.FILE_NAME}}"
\ No newline at end of file diff --git a/ci/setup.sh b/ci/setup.sh new file mode 100644 index 0000000..0cc153b --- /dev/null +++ b/ci/setup.sh @@ -0,0 +1,50 @@ +#! /bin/bash + +echo "Testing for go-task" +#test for platform tools +if ! command -v task &> /dev/null +then + echo "You must install go-task: from https://taskfile.dev/installation/" + exit 1 +fi + +echo "Testing for cmake" +#test for cmake +if ! command -v cmake &> /dev/null +then + echo "You must have cmake installed globally" + exit 1 +fi + +echo "Testing for GNUMake" +#test for make +if ! command -v make &> /dev/null +then + echo "You must have GNUMake installed globally" + exit 1 +fi + +echo "Testing for git" +#test for git +if ! command -v git &> /dev/null +then + echo "You must have git installed globally" + exit 1 +fi + +#build the argon2 native library +pushd argon2 > /dev/null +echo "Building Argon2 native library" +make +argon2_path=$(find "$(pwd)" -iname "libargon2.so.*") + +echo "Add the following environment variable" +echo VNLIB_ARGON2_DLL_PATH=$argon2_path +popd > /dev/null + +#build the vnlib_compress native library +pushd vnlib_compress > /dev/null +echo "Building vnlib_compress native library" +task +echo "Finished building vnlib_compress" +popd > /dev/null
\ No newline at end of file diff --git a/ci/taskfile.yaml b/ci/taskfile.yaml new file mode 100644 index 0000000..7f67fec --- /dev/null +++ b/ci/taskfile.yaml @@ -0,0 +1,131 @@ +# https://taskfile.dev + +#Called by the vnbuild system to produce builds for my website +#https://www.vaughnnugent.com/resources/software + +version: "3" + +vars: + BUILDS_URL: https://www.vaughnnugent.com/public/resources/software/builds + +includes: + plugins: + taskfile: plugins.taskfile.yaml + +tasks: + + build: + cmds: + #clean out dist dir before building + - cmd: powershell -Command "rm -Recurse -Force ./dist" + ignore_error: true + #copy setup script for linux + - cmd: powershell -Command "cp setup.sh lib/ -Force" + + - task: install-plugins + - task: install-webserver + + install-webserver: + cmds: + #setup env + - task: create-env + vars: + TARGET_OS: win-x64 + + - task: create-env + vars: + TARGET_OS: linux-x64 + + - task: create-env + vars: + TARGET_OS: osx-x64 + + + postbuild_success: + cmds: + #make bin dir + - cmd: powershell -Command "mkdir bin -Force" + ignore_error: true + + - task: pack + vars: + TARGET_OS: win-x64 + - task: pack + vars: + TARGET_OS: linux-x64 + - task: pack + vars: + TARGET_OS: osx-x64 + + + install-plugins: + cmds: + #add plugins + - task: plugins:all + + create-env: + vars: + BUILD_DIR: './build/{{.TARGET_OS}}' + cmds: + #create dir for env + - cmd: powershell -Command "mkdir {{.BUILD_DIR}} -Force" + ignore_error: true + + #copy plugins + - cmd: powershell -Command "cp -Recurse -Force plugins {{.BUILD_DIR}}" + + #copy wwwroot + - cmd: powershell -Command "cp -Recurse -Force dist {{.BUILD_DIR}}" + + #copy libraries + - cmd: powershell -Command "cp -Recurse -Force lib {{.BUILD_DIR}}" + + #copy config + - cmd: powershell -Command "cp -Recurse -Force config {{.BUILD_DIR}}" + + - task: get-webserver + vars: + TARGET_OS: '{{.TARGET_OS}}' + BUILD_DIR: '{{.BUILD_DIR}}' + + get-webserver: + internal: true + cmds: + - task: install + vars: + PROJECT_NAME: 'VNLib.Webserver' + MODULE_NAME: "VNLib.Webserver" + FILE_NAME: "{{.TARGET_OS}}-release.tgz" + BUILD_DIR: '{{.BUILD_DIR}}/webserver' + + - cmd: powershell -Command "cp -Force ./config/config.json {{.BUILD_DIR}}/config.json" + + install: + internal: true + vars: + DIR: '"{{.BUILD_DIR}}"' + cmds: + #make the plugin directory + - cmd: powershell -Command "mkdir {{.DIR}} -Force" + ignore_error: true + - cd {{.DIR}} && powershell "{{.USER_WORKING_DIR}}/install.ps1" -BaseUrl {{.BUILDS_URL}} -ModuleName {{.MODULE_NAME}} -ProjectName {{.PROJECT_NAME}} -FileName {{.FILE_NAME}} + - cd {{.DIR}} && tar -xzf {{.FILE_NAME}} + #remove the tar file + - cd {{.DIR}} && powershell -Command "rm {{.FILE_NAME}}" + + pack: + internal: true + cmds: + - cmd: powershell -Command "mkdir build/{{.TARGET_OS}}/ -Force" + ignore_error: true + - cd build/{{.TARGET_OS}} && tar -czf ../../bin/{{.TARGET_OS}}-release.tgz . + + + clean: + ignore_error: true + cmds: + - cmd: powershell -Command "rm -Recurse -Force ./build" + - cmd: powershell -Command "rm -Recurse -Force ./bin" + - cmd: powershell -Command "rm -Recurse -Force ./dist" + - cmd: powershell -Command "rm -Recurse -Force ./plugins" + - cmd: powershell -Command "rm -Recurse -Force ./lib"
\ No newline at end of file diff --git a/front-end/package-lock.json b/front-end/package-lock.json index 16bbb88..2752969 100644 --- a/front-end/package-lock.json +++ b/front-end/package-lock.json @@ -10,7 +10,7 @@ "license": "agpl3", "dependencies": { "@headlessui/vue": "^1.7.17", - "@vnuge/vnlib.browser": "https://www.vaughnnugent.com/public/resources/software/builds/Plugins.Essentials/335659f2a3d412aa040fd77d871366dc4d4f8501/@vnuge-vnlib.browser/release.tgz", + "@vnuge/vnlib.browser": "https://www.vaughnnugent.com/public/resources/software/builds/Plugins.Essentials/df7dc615532d3441f527374d18664c1a5a336de6/@vnuge-vnlib.browser/release.tgz", "@vuelidate/core": "^2.0.2", "@vuelidate/validators": "^2.0.2", "@vueuse/core": "^10.3.x", @@ -930,8 +930,8 @@ }, "node_modules/@vnuge/vnlib.browser": { "version": "0.1.13", - "resolved": "https://www.vaughnnugent.com/public/resources/software/builds/Plugins.Essentials/335659f2a3d412aa040fd77d871366dc4d4f8501/@vnuge-vnlib.browser/release.tgz", - "integrity": "sha512-oAbkMolkbc8J2cbNhouDanKpRXG8cyI05weaED0nfk4LEyOByT02AXoe9CjqdSStYj+Lvh6DvFKhSV0QzvjQng==", + "resolved": "https://www.vaughnnugent.com/public/resources/software/builds/Plugins.Essentials/df7dc615532d3441f527374d18664c1a5a336de6/@vnuge-vnlib.browser/release.tgz", + "integrity": "sha512-Ddm0cVV4GeNaO5Dd8ycMklswnXBY4L+7gOSu2W1vOOabc8YDaP2XsTaA+xImFVLXj86hQbBTRUUKF9Ebacx+WQ==", "license": "MIT", "peerDependencies": { "@vueuse/core": "^10.x", diff --git a/front-end/package.json b/front-end/package.json index 0ae32f1..fabf4ff 100644 --- a/front-end/package.json +++ b/front-end/package.json @@ -18,7 +18,7 @@ }, "dependencies": { "@headlessui/vue": "^1.7.17", - "@vnuge/vnlib.browser": "https://www.vaughnnugent.com/public/resources/software/builds/Plugins.Essentials/335659f2a3d412aa040fd77d871366dc4d4f8501/@vnuge-vnlib.browser/release.tgz", + "@vnuge/vnlib.browser": "https://www.vaughnnugent.com/public/resources/software/builds/Plugins.Essentials/df7dc615532d3441f527374d18664c1a5a336de6/@vnuge-vnlib.browser/release.tgz", "@vuelidate/core": "^2.0.2", "@vuelidate/validators": "^2.0.2", "@vueuse/core": "^10.3.x", diff --git a/front-end/src/components/Bookmarks.vue b/front-end/src/components/Bookmarks.vue index 7aa3eb0..2a5a6d3 100644 --- a/front-end/src/components/Bookmarks.vue +++ b/front-end/src/components/Bookmarks.vue @@ -286,12 +286,12 @@ const upload = (() => { //update the progress bar progressPercent.value = Math.round((i+1) / chunks.length * 100); - - //refresh the bookmarks - store.bookmarks.refresh(); } }) + //refresh the bookmarks + store.bookmarks.refresh(); + //Force set progress once complete regardless of errors progressPercent.value = 100; progress.value.push('Upload complete'); diff --git a/front-end/src/components/Settings/TotpSettings.vue b/front-end/src/components/Settings/TotpSettings.vue index cc8642f..1d79914 100644 --- a/front-end/src/components/Settings/TotpSettings.vue +++ b/front-end/src/components/Settings/TotpSettings.vue @@ -71,6 +71,9 @@ const addOrUpdate = async () => { newConfig.secret = base32Encode(decSecret, 'RFC3548', { padding: false }) set(newTotpConfig, newConfig); + + //refresh config + store.mfaRefreshMethods(); }) } @@ -110,7 +113,7 @@ const onVerifyOtp = async (code: string) => { > </span> </div> - <div v-if="totpEnabled" class="flex" @click="addOrUpdate()"> + <div v-if="totpEnabled" class="flex"> <button class="btn light"> Regenerate </button> diff --git a/simple-bookmark.build.sln b/simple-bookmark.build.sln new file mode 100644 index 0000000..b5a044d --- /dev/null +++ b/simple-bookmark.build.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.31903.59 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SimpleBookmark", "back-end\src\SimpleBookmark.csproj", "{519070C3-D710-4ACA-9755-A17191BBD51F}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {519070C3-D710-4ACA-9755-A17191BBD51F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {519070C3-D710-4ACA-9755-A17191BBD51F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {519070C3-D710-4ACA-9755-A17191BBD51F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {519070C3-D710-4ACA-9755-A17191BBD51F}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {0B914AF3-8F4F-4FA3-B1F8-5015C19BD182} + EndGlobalSection +EndGlobal |