minor tweaks
This commit is contained in:
parent
f9e148f9ee
commit
281043f96f
@ -1,6 +1,6 @@
|
||||
FROM alpine:latest AS build
|
||||
RUN apk add jq curl tar xz git vim
|
||||
RUN curl --output /zig.tar.xz "$(curl -s 'https://ziglang.org/download/index.json' | jq -r '.master."x86_64-linux".tarball')"
|
||||
RUN curl --output /zig.tar.xz "$(curl -s 'https://ziglang.org/download/index.json' | jq -r '.master."aarch64-linux".tarball')"
|
||||
|
||||
RUN mkdir /zig
|
||||
WORKDIR /zig
|
||||
@ -13,7 +13,7 @@ RUN /zig/zig-*/zig build -Denvironment=production install
|
||||
|
||||
run mkdir /jetzig
|
||||
WORKDIR /jetzig
|
||||
RUN git clone https://github.com/jetzig-framework/jetzig .
|
||||
RUN git clone https://github.com/yuzudev/jetzig .
|
||||
WORKDIR ./cli
|
||||
RUN /zig/zig-*/zig build install
|
||||
|
||||
|
12
build.zig
12
build.zig
@ -3,17 +3,21 @@ const jetzig = @import("jetzig");
|
||||
|
||||
pub fn build(b: *std.Build) !void {
|
||||
const target = b.standardTargetOptions(.{});
|
||||
const optimize = b.standardOptimizeOption(.{});
|
||||
const optimize = .ReleaseSafe;
|
||||
|
||||
const exe = b.addExecutable(.{
|
||||
.name = "yuzucchiidotxyz",
|
||||
.root_source_file = b.path("src/main.zig"),
|
||||
.target = target,
|
||||
.optimize = optimize,
|
||||
.use_llvm = true // fix for my arm machine
|
||||
});
|
||||
|
||||
const options = b.addOptions();
|
||||
options.addOption([]const u8, "BLOGS_PASSWORD", "admin");
|
||||
|
||||
options.addOption([]const u8, "BLOGS_PASSWORD", std.posix.getenv("BLOGS_PASSWORD") orelse "admin");
|
||||
|
||||
options.addOption([]const u8, "DOMAIN", std.posix.getenv("DOMAIN") orelse "localhost");
|
||||
|
||||
exe.root_module.addOptions("dev", options);
|
||||
|
||||
@ -26,7 +30,9 @@ pub fn build(b: *std.Build) !void {
|
||||
exe.root_module.addImport("uuid", uuid.module("uuid"));
|
||||
// ^ Add all dependencies before `jetzig.jetzigInit()` ^
|
||||
|
||||
try jetzig.jetzigInit(b, exe, .{});
|
||||
try jetzig.jetzigInit(b, exe, .{
|
||||
.zmpl_version = .v2
|
||||
});
|
||||
|
||||
b.installArtifact(exe);
|
||||
|
||||
|
@ -42,6 +42,7 @@ pub fn post(request: *jetzig.Request) !jetzig.View {
|
||||
.name = "session",
|
||||
.value = uuid,
|
||||
.path = "/",
|
||||
.domain = @import("dev").DOMAIN,
|
||||
.http_only = true,
|
||||
.secure = false,
|
||||
.max_age = 60 * 60 * 24 * 7, // 1 week
|
||||
|
Loading…
x
Reference in New Issue
Block a user