Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit 24fac82
Author: vnugent <public@vaughnnugent.com>
Date:   Tue Apr 2 14:54:20 2024 -0400

    ci: Configure manual dep versions

commit d2ae31e
Author: vnugent <public@vaughnnugent.com>
Date:   Sun Mar 31 22:19:53 2024 -0400

    ci: Native compression support for win

commit fa7fdef
Merge: 308092d a01220a
Author: vnugent <public@vaughnnugent.com>
Date:   Wed Mar 13 21:26:55 2024 -0400

    Merge branch 'master' into develop

commit 308092d
Merge: 48637a8 9134093
Author: vnugent <public@vaughnnugent.com>
Date:   Wed Mar 13 21:01:02 2024 -0400

    Merge branch 'master' into develop

commit 48637a8
Merge: 1e08c6d e326736
Author: vnugent <public@vaughnnugent.com>
Date:   Wed Mar 13 16:20:35 2024 -0400

    Merge branch 'master' into develop

commit 1e08c6d
Author: vnugent <public@vaughnnugent.com>
Date:   Wed Mar 13 16:17:58 2024 -0400

    ci: verified container build ready for next release

commit 85a1e5b
Author: vnugent <public@vaughnnugent.com>
Date:   Tue Mar 12 22:05:16 2024 -0400

    ci: exciting bare-metal build process, os support, smaller packages

commit 748cdbf
Author: vnugent <public@vaughnnugent.com>
Date:   Mon Mar 11 21:21:18 2024 -0400

    feat(app): #1 update libs & add curl support
  • Loading branch information
VnUgE committed Apr 2, 2024
1 parent a01220a commit 3c15d54
Show file tree
Hide file tree
Showing 13 changed files with 334 additions and 285 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,27 +32,27 @@ A <a href="https://github.com/sissbruecker/linkding">linkding</a> inspired, self
## Intro
Simple Bookmark (name pending) is a fast, portable, and secure, self-hosted bookmark manager that was inspired by the [Linkding](https://github.com/sissbruecker/linkding) project.

Simple Bookmark was built using my [Essentials](https://github.com/VnUgE/vnlib.core) web framework which enables high performance web applications and back-end extensibility in a small package. While it comes preconfigured with SQLite by default, I have 1st party support for MySQL and SQLServer, through add-on packages. It supports memory, Redis, or VNCache session for data caching.
I built Simple-Bookmark mostly because I didn't want the container lock-in. I also wanted more extensibility for caching, databases, authentication methods, modern security defaults, 2FA, and a performance oriented [server framework](https://github.com/VnUgE/VNLib.Core). Finally, while I enjoy linkding's UI, I felt like it could use some modernization and a little more reactivity.

### Features
- Light/Dark theme
- TOTP and public-key authentication
- 2FA and public-key JWT authentication
- HTML bookmark file import from Linkding and others
- HTML, JSON, and CSV bookmark export
- Bookmark quick-add for web browsers
- Invite users with share links
- Supports (and tested) SQLite, SQLServer, MySQL/MariaDB databases
- It's quick <300ms load time & under 150kB with compression
- It's small, 139mb Docker image
- It's small, 142mb Docker image
- Argon2Id password hashing with secure defaults
- Supports downstream proxy servers
- Supports enterprise services: HashiCorp Vault, SQLServer, Auth0, and Redis
- Built-in TLS (TLS is required)

## Deployment overview
__You need to read the [quick-start guide](https://www.vaughnnugent.com/resources/software/articles/ed9285b63922fd17b5126051e3a2e592cacecf33) to fully configure Simple-Bookmark but here are the basic steps.__

>[!NOTE]
> Simple-bookmark was built without Docker as the primary target, this is because I believe users should have the support to deploy open source apps easily outside of a container. So while a Docker deployment is an option, the container is actually built from the Linux-x64 package during CI build time.
> Simple-bookmark was built bare-metal as the primary target, this is because I believe users should have the support to deploy open source apps easily outside of a container. So while a container deployment is an option, the container is actually built from the Linux-x64 package during CI build time.
### Container install
Download the latest alpine build package: [sb-alpine3.19-oci.tgz](https://www.vaughnnugent.com/resources/software/modules/Simple-Bookmark?p=Simple-Bookmark)
Expand Down
12 changes: 6 additions & 6 deletions back-end/src/SimpleBookmark.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="MemoryPack" Version="1.10.0" />
<PackageReference Include="VNLib.Plugins.Extensions.Data" Version="0.1.0-ci0052" />
<PackageReference Include="VNLib.Plugins.Extensions.Loading" Version="0.1.0-ci0052" />
<PackageReference Include="VNLib.Plugins.Extensions.Loading.Sql" Version="0.1.0-ci0052" />
<PackageReference Include="VNLib.Plugins.Extensions.Validation" Version="0.1.0-ci0052" />
<PackageReference Include="VNLib.Plugins.Extensions.VNCache" Version="0.1.0-ci0053" />
<PackageReference Include="MemoryPack" Version="1.21.0" />
<PackageReference Include="VNLib.Plugins.Extensions.Data" Version="0.1.0-ci0053" />
<PackageReference Include="VNLib.Plugins.Extensions.Loading" Version="0.1.0-ci0053" />
<PackageReference Include="VNLib.Plugins.Extensions.Loading.Sql" Version="0.1.0-ci0053" />
<PackageReference Include="VNLib.Plugins.Extensions.Validation" Version="0.1.0-ci0053" />
<PackageReference Include="VNLib.Plugins.Extensions.VNCache" Version="0.1.0-ci0054" />
</ItemGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions ci/container/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ ENV MAX_LOGIN_ATTEMPS=10
#HC Vault
ENV HC_VAULT_ADDR=""
ENV HC_VAULT_TOKEN=""
ENV HC_VAULT_TRUST_CERT=false

#VNCACHE (default to memory only)
ENV CACHE_ASM_PATH=VNLib.Data.Caching.Providers.VNCache.dll
Expand Down
14 changes: 0 additions & 14 deletions ci/container/Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,6 @@ tasks:

- task: prune-sql-runtimes

#install rpmalloc
- task: install-rpmalloc-lib

postbuild_success:
cmds:
#tar up the build directory and move it to the output bin directory
Expand All @@ -66,17 +63,6 @@ tasks:
cmds:
- cmd: powershell -Command "rm -Recurse -Force ./build"

install-rpmalloc-lib:
internal: true
cmds:
#install compressor plugin
- task: install:install
vars:
PROJECT_NAME: 'vnlib_rpmalloc'
MODULE_NAME: "VNLib.Core"
FILE_NAME: "src.tgz"
DIR: './build/app/lib/vnlib_rpmalloc'

setup-container-image:
internal: true
cmds:
Expand Down
3 changes: 2 additions & 1 deletion ci/container/config-templates/config-template.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@
//HASHICORP VAULT
"hashicorp_vault": {
"url": "${HC_VAULT_ADDR}",
"token": "${HC_VAULT_TOKEN}"
"token": "${HC_VAULT_TOKEN}",
"trust_certificate": ${HC_VAULT_TRUST_CERT},
},

//SQL CONFIG
Expand Down
1 change: 1 addition & 0 deletions ci/container/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ services:
#HC Vault
HC_VAULT_ADDR: ""
HC_VAULT_TOKEN: ""
HC_VAULT_TRUST_CERT: "false"
#VNCACHE (default to memory only)
CACHE_ASM_PATH: "VNLib.Data.Caching.Providers.VNCache.dll"
MEMCACHE_ONLY: "true"
Expand Down
11 changes: 4 additions & 7 deletions ci/install.ps1
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
param([String] $BaseUrl, [String] $ModuleName, [String] $ProjectName, [String]$FileName)
param([String] $BaseUrl, [String] $ModuleName, [String] $ProjectName, [String]$FileName, [String]$Version)

#get the latest file
Invoke-WebRequest "$BaseUrl/$ModuleName/@latest" -OutFile latest.txt
#read the file into a variable
$latest = Get-Content latest.txt
$_src = "$BaseUrl/$ModuleName/$Version/$ProjectName/$FileName"

#download the latest version
Invoke-WebRequest "$BaseUrl/$ModuleName/$latest/$ProjectName/$FileName" -OutFile $FileName
Invoke-WebRequest "$_src" -OutFile $FileName

#download latest sha256
Invoke-WebRequest "$BaseUrl/$ModuleName/$latest/$ProjectName/$FileName.sha256" -OutFile "$FileName.sha256"
Invoke-WebRequest "$_src.sha256" -OutFile "$FileName.sha256"

#verify the file
$hash = (Get-FileHash $FileName -Algorithm SHA256).Hash
Expand Down
2 changes: 1 addition & 1 deletion ci/install.taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ tasks:
#make the plugin directory
- cmd: powershell -Command "mkdir {{.DIR}} -Force"
ignore_error: true
- cd {{.DIR}} && powershell "{{ .PROJECT_DIR }}/install.ps1" -BaseUrl {{.BUILDS_URL}} -ModuleName {{.MODULE_NAME}} -ProjectName {{.PROJECT_NAME}} -FileName {{.FILE_NAME}}
- cd {{.DIR}} && powershell "{{ .PROJECT_DIR }}/install.ps1" -BaseUrl {{.BUILDS_URL}} -ModuleName {{.MODULE_NAME}} -ProjectName {{.PROJECT_NAME}} -FileName {{.FILE_NAME}} -Version {{.VERSION}}
- cd {{.DIR}} && tar -xzf {{.FILE_NAME}}
#remove the archive file
- cd {{.DIR}} && powershell -Command "rm {{.FILE_NAME}}"
58 changes: 44 additions & 14 deletions ci/plugins.taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,20 @@ includes:
taskfile: install.taskfile.yaml

vars:
CORE_VERSION: 'e07537a3dde8e16100ef1bcc2a54f9ade8ae856f'
ESSENTIALS_VERSION: '27b487b6d0befdb2197a58ceadb1f1ac2b337786'
CACHE_VERSION: '49c3641def5ae1b7557ed61ed7bb28bbf425ccc9'
USERS_VERSION: '884ed18f900b59be30a6e51c2ec7b714ac860bfd'
SESSION_VERSION: '9c8da6ea8fabe1d752bb28fd5eaeeb0b1d06d94d'
EXTENSIONS_VERSION: '6da9d3b34fb0dd61cf8a81290e573e54851fcd07'

tasks:

all:
deps:
- install-rpmalloc
- install-compressor-lib
- install-argon2-lib
- install-compressor-lib
- install-argon2-lib
- install-compression
- install-sqlite
cmds:
Expand Down Expand Up @@ -52,6 +58,7 @@ tasks:
MODULE_NAME: "Plugins.Essentials"
FILE_NAME: "release.tgz"
DIR: './plugins/Essentials.Accounts'
VERSION: '{{.ESSENTIALS_VERSION}}'

install-router:
cmds:
Expand All @@ -62,6 +69,7 @@ tasks:
MODULE_NAME: "Plugins.Essentials"
FILE_NAME: "release.tgz"
DIR: './plugins/PageRouter'
VERSION: '{{.ESSENTIALS_VERSION}}'

install-sessions:
cmds:
Expand All @@ -72,6 +80,18 @@ tasks:
MODULE_NAME: "VNLib.Plugins.Sessions"
FILE_NAME: "release.tgz"
DIR: './plugins/SessionProvider'
VERSION: '{{.SESSION_VERSION}}'

install-vncache-sessions:
cmds:
#install vncache-web-sessions plugin
- task: install:install
vars:
PROJECT_NAME: 'VNLib.Plugins.Sessions.VNCache'
MODULE_NAME: "VNLib.Plugins.Sessions"
FILE_NAME: "release.tgz"
DIR: './plugins/assets/VNLib.Plugins.Sessions.VNCache'
VERSION: '{{.SESSION_VERSION}}'

install-users:
cmds:
Expand All @@ -82,6 +102,7 @@ tasks:
MODULE_NAME: "VNLib.Plugins.Essentials.Users"
FILE_NAME: "release.tgz"
DIR: './plugins/assets/VNLib.Plugins.Essentials.Users'
VERSION: '{{.USERS_VERSION}}'

install-vncache:
cmds:
Expand All @@ -92,16 +113,7 @@ tasks:
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:install
vars:
PROJECT_NAME: 'VNLib.Plugins.Sessions.VNCache'
MODULE_NAME: "VNLib.Plugins.Sessions"
FILE_NAME: "release.tgz"
DIR: './plugins/assets/VNLib.Plugins.Sessions.VNCache'
VERSION: '{{.CACHE_VERSION}}'

install-sqlite:
cmds:
Expand All @@ -112,6 +124,7 @@ tasks:
MODULE_NAME: "VNLib.Plugins.Extensions"
FILE_NAME: "release.tgz"
DIR: './plugins/assets/VNLib.Plugins.Extensions.Loading.Sql.SQLite'
VERSION: '{{.EXTENSIONS_VERSION}}'

install-compression:
cmds:
Expand All @@ -122,16 +135,29 @@ tasks:
MODULE_NAME: "VNLib.Core"
FILE_NAME: "release.tgz"
DIR: './lib/vnlib.net.compression'
VERSION: '{{.CORE_VERSION}}'

install-compressor-lib:
cmds:
#install the compressor binary for Windows
- task: install:install
vars:
PROJECT_NAME: 'vnlib_compress'
MODULE_NAME: "VNLib.Core"
FILE_NAME: "msvc-x64-release-vnlib_compress.tgz"
DIR: './lib/vnlib_compress'
VERSION: '{{.CORE_VERSION}}'

#install compressor plugin
- task: install:install
vars:
PROJECT_NAME: 'vnlib_compress'
MODULE_NAME: "VNLib.Core"
FILE_NAME: "src.tgz"
DIR: './lib/vnlib_compress'
VERSION: '{{.CORE_VERSION}}'

- cd 'lib/vnlib_compress' && powershell rm package.json

install-argon2-lib:
cmds:
Expand All @@ -140,8 +166,9 @@ tasks:
vars:
PROJECT_NAME: 'phc-winner-argon2'
MODULE_NAME: "VNLib.Core"
FILE_NAME: "win-x64-release-Argon2.tgz"
FILE_NAME: "msvc-x64-release-Argon2.tgz"
DIR: './lib/argon2'
VERSION: '{{.CORE_VERSION}}'

#install the argon2 source code package for Linux and Mac
- task: install:install
Expand All @@ -150,6 +177,7 @@ tasks:
MODULE_NAME: "VNLib.Core"
FILE_NAME: "src.tgz"
DIR: './lib/argon2'
VERSION: '{{.CORE_VERSION}}'

#remove unneeded files
- for: [ man, latex, kats, argon2-specs.pdf, package.json ]
Expand All @@ -165,11 +193,13 @@ tasks:
MODULE_NAME: "VNLib.Core"
FILE_NAME: "src.tgz"
DIR: './lib/vnlib_rpmalloc'
VERSION: '{{.CORE_VERSION}}'

#install the rpmalloc binary for Windows
- task: install:install
vars:
PROJECT_NAME: 'vnlib_rpmalloc'
MODULE_NAME: "VNLib.Core"
FILE_NAME: "win-x64-release-vnlib_rpmalloc.tgz"
FILE_NAME: "msvc-x64-release-vnlib_rpmalloc.tgz"
DIR: './lib/vnlib_rpmalloc'
VERSION: '{{.CORE_VERSION}}'
6 changes: 3 additions & 3 deletions ci/release.taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,10 @@ tasks:
internal: true
dir: 'lib/'
cmds:
- cd vnlib_compress/ && task
#build the native compressor library for linux/mac
- cmd: cd vnlib_compress/ && cp build/libvn_compress{{if eq OS "darwin"}}.dylib{{else}}.so{{end}} ../vnlib_compress.dll
- cmd: cd vnlib_compress/ && task && cp build/libvn_compress{{if eq OS "darwin"}}.dylib{{else}}.so{{end}} ../vnlib_compress.dll
platforms: [ linux, darwin ]

- cmd: powershell -Command "cp vnlib_compress/build/Release/vnlib_compress.dll vnlib_compress.dll"
#windows now supports pre-compiled libs
- cmd: powershell cp vnlib_compress/vnlib_compress.dll vnlib_compress.dll
platforms: [ windows/amd64 ]
6 changes: 4 additions & 2 deletions ci/taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ version: "3"
vars:
BUILDS_URL: https://www.vaughnnugent.com/public/resources/software/builds
SQLITE_OUT_DIR: "plugins/assets/VNLib.Plugins.Extensions.Loading.Sql.SQLite"
WEBSERVER_VERSION: 'ed0c71876ec04528e24e612ce723d3aed8971262'

includes:
install:
Expand Down Expand Up @@ -46,13 +47,14 @@ tasks:
- cmd : powershell -Command "mkdir webserver -Force"
ignore_error: true

#clone the webserver (it's cross platform when using dotnet command)
#clone the webserver (it's cross platform when using dotnet command so just grab the linux version)
- task: install:install
vars:
PROJECT_NAME: 'VNLib.Webserver'
MODULE_NAME: "VNLib.Webserver"
FILE_NAME: "linux-x64-release.tgz"
DIR: 'webserver/'
VERSION: '{{.WEBSERVER_VERSION}}'

#remove the executable since its not needed
- cmd: cd webserver/ && powershell -Command "rm VNlib.WebServer"
Expand All @@ -73,7 +75,7 @@ tasks:
TARGET_OS: '{{.ITEM}}'

#cleanup unnecessary build files that clog up the pipeline
- for: [ build, plugins, dist, lib ]
- for: [ build, plugins, dist, lib, webserver ]
cmd: powershell -Command "rm -Recurse '{{.ITEM}}'"
ignore_error: true

Expand Down
Loading

0 comments on commit 3c15d54

Please sign in to comment.