Skip to content

Commit

Permalink
Fix endpoint API paths
Browse files Browse the repository at this point in the history
  • Loading branch information
tarkah committed Nov 15, 2024
1 parent 1e66aeb commit bdd8f27
Show file tree
Hide file tree
Showing 16 changed files with 77 additions and 23 deletions.
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
crates/**/.privkey
*.db

test/summit-legacy/cache
test/summit-legacy/db
test/avalanche-legacy/cache
test/avalanche-legacy/db
test/**/state/cache
test/**/state/db
test/**/state/public
test/**/state/staging
18 changes: 17 additions & 1 deletion Dockerfile-legacy
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,18 @@ RUN ~/dlang/install.sh install ldc-1.32.2
RUN git clone https://github.com/serpent-os/libmoss.git
RUN git clone https://github.com/serpent-os/moss-service.git
RUN git clone https://github.com/serpent-os/summit.git
RUN git clone https://github.com/serpent-os/vessel.git
RUN git clone https://github.com/serpent-os/avalanche.git
RUN --mount=type=cache,target=/root/.dub <<"EOT" /bin/bash
source ~/dlang/ldc-1.32.2/activate
cd summit
dub build --parallel
EOT
RUN --mount=type=cache,target=/root/.dub <<"EOT" /bin/bash
source ~/dlang/ldc-1.32.2/activate
cd vessel
dub build --parallel
EOT
RUN --mount=type=cache,target=/root/.dub <<"EOT" /bin/bash
source ~/dlang/ldc-1.32.2/activate
cd avalanche
Expand All @@ -36,6 +42,7 @@ FROM debian:bookworm-slim AS base
RUN apt update
RUN apt install -y \
git \
sudo \
libcurl4 \
libdbus-1-3 \
liblmdb0 \
Expand All @@ -49,14 +56,23 @@ RUN rm -rf /var/cache/apt/archives /var/lib/apt/lists/*

FROM base as summit
COPY --from=builder /summit /app
RUN rm /app/seed.json
VOLUME /app/state
VOLUME /app/seed.json
EXPOSE 5000
WORKDIR /app
CMD ["/app/summit", "-a", "0.0.0.0", "-p", "5000"]

FROM base as vessel
COPY --from=builder /vessel /app
VOLUME /app/state
EXPOSE 5001
WORKDIR /app
CMD ["/app/vessel", "-a", "0.0.0.0", "-p", "5001"]

FROM base as avalanche
COPY --from=builder /avalanche /app
RUN mkdir -p /app/public
RUN mkdir -p /app/public && chmod 777 /app/public
RUN mkdir -p /var/cache/boulder
VOLUME /app/state
EXPOSE 5002
Expand Down
4 changes: 2 additions & 2 deletions crates/service-types/src/api/v1/services.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ operation!(
operation!(
RefreshToken,
GET,
"services/refreshToken",
"services/refresh_token",
NOT_EXPIRED | BEARER_TOKEN | SERVICE_ACCOUNT,
resp: String
);

operation!(
RefreshIssueToken,
GET,
"services/refreshIssueToken",
"services/refresh_issue_token",
BEARER_TOKEN | SERVICE_ACCOUNT,
resp: String
);
Expand Down
2 changes: 1 addition & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ docker-build-legacy target:
@docker build . -t serpentos/{{target}}-legacy --target {{target}} -f Dockerfile-legacy

# Build docker containers
build: (docker-build-legacy "summit") (docker-build-legacy "avalanche") (docker-build "vessel")
build: (docker-build-legacy "summit") (docker-build-legacy "avalanche") (docker-build-legacy "vessel")

# Bring up docker containers
up: build
Expand Down
4 changes: 4 additions & 0 deletions test/Caddyfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
caddy:80, localhost:80 {
root * /static/
file_server browse
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
36 changes: 21 additions & 15 deletions test/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,33 +1,39 @@
services:
# summit:
# image: serpentos/summit
# ports:
# - "5000:5000"
# volumes:
# - ./summit:/state
# user: ${MY_UID}:${MY_GID}
# depends_on:
# vessel:
# condition: service_started
# restart: true
# Legacy
summit:
image: serpentos/summit-legacy
ports:
- "5000:5000"
volumes:
- ./summit-legacy:/app/state
- ./summit-legacy/state:/app/state
- ./summit-legacy/seed.json:/app/seed.json
user: ${MY_UID}:${MY_GID}
vessel:
image: serpentos/vessel
image: serpentos/vessel-legacy
ports:
- "5001:5001"
volumes:
- ./vessel:/state
- ./vessel-legacy/state:/app/state
user: ${MY_UID}:${MY_GID}
avalanche:
image: serpentos/avalanche-legacy
ports:
- "5002:5002"
volumes:
- ./avalanche-legacy:/app/state
- ./avalanche-legacy/state:/app/state
user: ${MY_UID}:${MY_GID}
caddy:
image: caddy:2
ports:
- "5003:80"
volumes:
- ./vessel-legacy/state/public:/static
- ./Caddyfile:/etc/caddy/Caddyfile
# Rust
# vessel:
# image: serpentos/vessel
# ports:
# - "5001:5001"
# volumes:
# - ./vessel:/state
# user: ${MY_UID}:${MY_GID}
27 changes: 27 additions & 0 deletions test/summit-legacy/seed.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"projects":
[
{
"name": "Test",
"slug": "test",
"description": "Test recipes",
"profiles":
[
{
"name": "test-x86_64",
"arch": "x86_64",
"indexURI": "http://caddy/volatile/x86_64/stone.index",
"remotes": []
}
],
"repos":
[
{
"name": "recipes",
"summary": "Test recipes",
"uri": "https://github.com/tarkah/recipes.git"
},
]
}
]
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file added test/vessel-legacy/state/.privkey
Binary file not shown.
1 change: 1 addition & 0 deletions test/vessel-legacy/state/.pubkey
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
��Qm��Fϝ0ʛ~��չ�}•GH��4*
Binary file added test/vessel-legacy/state/.seed
Binary file not shown.

0 comments on commit bdd8f27

Please sign in to comment.