Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit bbe3b9b
Author: vnugent <public@vaughnnugent.com>
Date:   Tue Jun 4 15:54:42 2024 -0400

    ignore npm version bump errors for build

commit 4581692
Author: vnugent <public@vaughnnugent.com>
Date:   Tue Jun 4 15:30:35 2024 -0400

    project version in ui

commit 03357c9
Author: vnugent <public@vaughnnugent.com>
Date:   Tue Jun 4 12:59:30 2024 -0400

    chore: Essentials upstream update

commit b6d2920
Author: vnugent <public@vaughnnugent.com>
Date:   Thu May 23 19:09:28 2024 -0400

    docs: Update readme instructions

commit 5b6b4c0
Author: vnugent <public@vaughnnugent.com>
Date:   Thu May 23 18:17:56 2024 -0400

    build(server): Update Docker config to support new vars

commit c7c9e8a
Author: vnugent <public@vaughnnugent.com>
Date:   Thu May 23 17:40:09 2024 -0400

    update backend deps

commit 06eb12d
Author: vnugent <public@vaughnnugent.com>
Date:   Thu May 23 17:38:22 2024 -0400

    chore: package updates and verify

commit c8e3ca8
Author: vnugent <public@vaughnnugent.com>
Date:   Thu May 16 17:10:27 2024 -0400

    chore: Remove unused cache stuff

commit ba2ee10
Merge: e6b4e60 28e67e5
Author: vnugent <public@vaughnnugent.com>
Date:   Wed May 15 18:08:48 2024 -0400

    Merge branch 'master' into develop

commit e6b4e60
Author: vnugent <public@vaughnnugent.com>
Date:   Wed May 15 16:35:06 2024 -0400

    build: Fix ssl container dir, and certificate automation

commit a710553
Author: vnugent <public@vaughnnugent.com>
Date:   Wed May 15 15:37:53 2024 -0400

    ci: Admin form clear, polish build and release taskfiels

commit 372eb6a
Author: vnugent <public@vaughnnugent.com>
Date:   Tue May 14 22:27:10 2024 -0400

    default read secret pepper from file for bare-metal builds

commit 1b7270b
Author: vnugent <public@vaughnnugent.com>
Date:   Tue May 14 21:52:03 2024 -0400

    chore: make container slightly easier to setup

commit 2deda50
Merge: 28f0f77 96ae7b0
Author: vnugent <public@vaughnnugent.com>
Date:   Sun Apr 28 10:54:09 2024 -0400

    Merge branch 'master' into develop

commit 28f0f77
Author: vnugent <public@vaughnnugent.com>
Date:   Sat Apr 27 23:11:48 2024 -0400

    Add --no-cache arg to build image args

commit 22a1f5d
Author: vnugent <public@vaughnnugent.com>
Date:   Sat Apr 27 18:47:25 2024 -0400

    fix: Upstream patch missing ! in middlware

commit f40ca2d
Author: vnugent <public@vaughnnugent.com>
Date:   Sat Apr 27 18:36:01 2024 -0400

    chore: package updates

commit d7a3c95
Author: vnugent <public@vaughnnugent.com>
Date:   Sun Apr 21 12:02:57 2024 -0400

    chore: Package updates and minor QOL patches

commit 97a5bde
Merge: 56e0a38 5877c86
Author: vnugent <public@vaughnnugent.com>
Date:   Tue Apr 9 17:38:02 2024 -0400

    Merge branch 'master' into develop

commit 56e0a38
Author: vnugent <public@vaughnnugent.com>
Date:   Tue Apr 9 17:35:13 2024 -0400

    chore(app): Update deps, login spinner, curl msg, view prep

commit 0945210
Merge: 24fac82 3c15d54
Author: vnugent <public@vaughnnugent.com>
Date:   Tue Apr 2 14:58:59 2024 -0400

    Merge branch 'master' into develop

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 Jun 4, 2024
1 parent 28e67e5 commit 71b581e
Show file tree
Hide file tree
Showing 20 changed files with 321 additions and 451 deletions.
5 changes: 4 additions & 1 deletion Module.Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,17 @@ tasks:
#update project source code
update:
cmds:
- git remote update
- git reset --hard
- git remote update
- git pull origin {{.BRANCH_NAME}} --verify-signatures
#re-write semver for back-end after hard reset
- dotnet-gitversion.exe /updateprojectfiles

build:
cmds:
#overwrite front-end version, this must be run on build hook because update can cause the version to change
- cmd: cd front-end/ && npm version {{ .BUILD_VERSION }}
ignore_error: true #error if run when version is not updated

#copy artifacts to temp directory
postbuild_success:
Expand Down
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ I built Simple-Bookmark mostly because I didn't want the container lock-in. I al
- 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, 142mb Docker image
- It's small, 127mb Docker image
- Argon2Id password hashing with secure defaults
- Supports enterprise services: HashiCorp Vault, SQLServer, Auth0, and Redis
- Built-in TLS (TLS is required)
Expand All @@ -64,8 +64,9 @@ docker build . -t vnuge/simple-bookmark
docker-compose up -d
```
_Of course there is more setup involved, so take a look at the docs for more info_
_This container does not need root permissions to run_

The image should be about 139mb when built! I'm also hoping to get it down even smaller in the future. You may also use Podman in the same format, simply substitute the word `docker` with `podman` in the previous commands.
The image should be about 127mb when built! I'm also hoping to get it down even smaller in the future. You may also use Podman in the same format, simply substitute the word `docker` with `podman` in the previous commands.

### Bare-metal install
>[!NOTE]
Expand All @@ -86,6 +87,10 @@ Optionally create a self-signed TLS certificate using openssl and exports it to
``` shell
sudo task create-cert #runs an openssl command
```
Optionally generate a password pepper file
``` shell
task create-pepper #creates a pepper file in the secrets directory
```
Optionally set file permissions
```shell
chmod -R 0750 . && chmod -R 0770 data/ #only data dir needs write permissions
Expand All @@ -95,7 +100,7 @@ chmod -R 0750 . && chmod -R 0770 data/ #only data dir needs write permissions
task setup #runs all setup rules
```
> [!IMPORTANT]
> This command attempts to move or compile native libraries on your system. Windows users will have to manually adjust their config file, or install VisualStudio build tools, otherwise you'll see a bunch of errors.
> By default this copies pre-compiled C libraries, you must be using Windows version 1904 or later. Quick start guide has more info, if you need to build the libraries yourself.
#### First start
Starting the server for the first time you'll want to enable setup mode to allow admin registration for the first time. This is operation insecure, please read the quick-start guide.
Expand Down
34 changes: 0 additions & 34 deletions back-end/src/Cache/MemPackCacheSerializer.cs

This file was deleted.

44 changes: 0 additions & 44 deletions back-end/src/Cache/ResultCacheEntry.cs

This file was deleted.

111 changes: 0 additions & 111 deletions back-end/src/Cache/SearchResultCache.cs

This file was deleted.

31 changes: 21 additions & 10 deletions back-end/src/Endpoints/BookmarkEndpoint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,13 @@ protected override async ValueTask<VfReturnType> GetAsync(HttpEntity entity)
{
//Get the collection of bookmarks
List<BookmarkEntry> list = Bookmarks.ListRental.Rent();
await Bookmarks.GetUserPageAsync(list, entity.Session.UserID, 0, (int)BmConfig.PerPersonQuota);

await Bookmarks.GetUserPageAsync(
collection: list,
userId: entity.Session.UserID,
page: 0,
limit: (int)BmConfig.PerPersonQuota
);

//Alloc memory stream for output
VnMemoryStream output = new(MemoryUtil.Shared, 16 * 1024, false);
Expand Down Expand Up @@ -205,13 +211,13 @@ protected override async ValueTask<VfReturnType> GetAsync(HttpEntity entity)

//Get bookmarks
BookmarkEntry[] bookmarks = await Bookmarks.SearchBookmarksAsync(
entity.Session.UserID,
userId : entity.Session.UserID,
query,
tags,
(int)limit,
(int)offset,
entity.EventCancellation
);
cancellation: entity.EventCancellation
);

//Return result
return VirtualOkJson(entity, bookmarks);
Expand Down Expand Up @@ -248,11 +254,11 @@ protected override async ValueTask<VfReturnType> PostAsync(HttpEntity entity)
* and the entry does not already exist by the desired url.
*/
int result = await Bookmarks.AddSingleIfNotExists(
entity.Session.UserID,
newBookmark,
entity.RequestedTimeUtc.DateTime,
BmConfig.PerPersonQuota,
entity.EventCancellation
userId: entity.Session.UserID,
entry: newBookmark,
now: entity.RequestedTimeUtc.DateTime,
maxRecords: BmConfig.PerPersonQuota,
cancellation: entity.EventCancellation
);

if (webm.Assert(result > -1, "You have reached your bookmark quota"))
Expand Down Expand Up @@ -386,7 +392,12 @@ protected override async ValueTask<VfReturnType> PutAsync(HttpEntity entity)
try
{
//Try to update the records
ERRNO result = await Bookmarks.AddBulkAsync(sanitized, entity.Session.UserID, entity.RequestedTimeUtc, entity.EventCancellation);
ERRNO result = await Bookmarks.AddBulkAsync(
bookmarks: sanitized,
userId: entity.Session.UserID,
now: entity.RequestedTimeUtc,
cancellation: entity.EventCancellation
);

webm.Result = $"Successfully added {result} of {batch.Length} bookmarks";
webm.Success = true;
Expand Down
11 changes: 5 additions & 6 deletions back-end/src/SimpleBookmark.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,11 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="MemoryPack" Version="1.21.1" />
<PackageReference Include="VNLib.Plugins.Extensions.Data" Version="0.1.0-ci0063" />
<PackageReference Include="VNLib.Plugins.Extensions.Loading" Version="0.1.0-ci0063" />
<PackageReference Include="VNLib.Plugins.Extensions.Loading.Sql" Version="0.1.0-ci0063" />
<PackageReference Include="VNLib.Plugins.Extensions.Validation" Version="0.1.0-ci0063" />
<PackageReference Include="VNLib.Plugins.Extensions.VNCache" Version="0.1.0-ci0056" />
<PackageReference Include="VNLib.Plugins.Extensions.Data" Version="0.1.0-ci0064" />
<PackageReference Include="VNLib.Plugins.Extensions.Loading" Version="0.1.0-ci0064" />
<PackageReference Include="VNLib.Plugins.Extensions.Loading.Sql" Version="0.1.0-ci0064" />
<PackageReference Include="VNLib.Plugins.Extensions.Validation" Version="0.1.0-ci0064" />
<PackageReference Include="VNLib.Plugins.Extensions.VNCache" Version="0.1.0-ci0057" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion ci/config/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
"interval": "infinite"
},

"disabled app_log": {
"app_log": {
"path": "data/logs/applog.txt",
//"template": "serilog template for writing to file",
"flush_sec": 5,
Expand Down
Loading

0 comments on commit 71b581e

Please sign in to comment.