-
-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* temporary dvctr * start of work * fix: timeouts in windows * fish? * feat: better, working stuff * refactor: rename database-seeds to seeds/ * better * fdsaf * feat: don't let our container get owned by root * fix: better user handling * feat: falling asleep at my desk i yield to you what i have done * feat: autoadminify * docs: denote trickshot * feat: open in browser on launch * better seeds workings... * fix: dont kill shell * docs: mention dev/debs * fix: whoops * fix: make seeds load within the century * feat: rest of the containerisation * feat: new alias * style: fix linter errors * fix: bad call * fix: better justfile
- Loading branch information
Showing
305 changed files
with
6,019 additions
and
703 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"name": "Tachi", | ||
"dockerComposeFile": [ | ||
"../docker-compose-dev.yml" | ||
], | ||
"service": "tachi-dev", | ||
"workspaceFolder": "/tachi", | ||
"postAttachCommand": "./dev/bootstrap.sh", | ||
"updateRemoteUserUID": true, | ||
"containerUser": "tachi", | ||
"customizations": { | ||
"vscode": { | ||
"settings": { | ||
"typescript.tsdk": "node_modules/typescript/lib", | ||
"[typescriptreact]": { | ||
"editor.formatOnSave": true, | ||
"editor.defaultFormatter": "dbaeumer.vscode-eslint" | ||
}, | ||
"[typescript]": { | ||
"editor.formatOnSave": true, | ||
"editor.defaultFormatter": "dbaeumer.vscode-eslint" | ||
} | ||
}, | ||
"extensions": [ | ||
"dbaeumer.vscode-eslint" | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"recommendations": [ | ||
"ms-vscode-remote.remote-containers" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,5 @@ | |
}, | ||
"[typescript]": { | ||
"editor.defaultFormatter": "dbaeumer.vscode-eslint" | ||
} | ||
} | ||
}, | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# For use via `devcontainer.json`. The docker-compose-dev file sets some other | ||
# important variables. | ||
|
||
# we use ubuntu because 'just' isn't available on debian 13 | ||
# haha.. haha... | ||
FROM ubuntu:24.10 | ||
|
||
WORKDIR /tachi | ||
|
||
RUN apt update | ||
|
||
# essentials | ||
RUN apt install -y git npm locales sudo | ||
|
||
# setup locales | ||
# https://stackoverflow.com/questions/28405902/how-to-set-the-locale-inside-a-debian-ubuntu-docker-container | ||
RUN echo 'en_US.UTF-8' > /etc/locale.gen && locale-gen | ||
ENV LANG en_US.UTF-8 | ||
ENV LANGUAGE en_US:en | ||
ENV LC_ALL en_US.UTF-8 | ||
|
||
# nodeisms | ||
RUN npm install --silent -g [email protected] | ||
|
||
# docs pythonisms | ||
RUN apt install -y python-is-python3 pip mkdocs mkdocs-material | ||
|
||
# https://github.com/python-babel/babel/issues/990 | ||
# it wouldn't be python without needing absurd global state manipulation to fix | ||
# an incoherent error message | ||
RUN rm -f /etc/localtime && ln -s /usr/share/zoneinfo/Etc/UTC /etc/localtime | ||
|
||
# Fix locale issue perl repeatedly complains about | ||
RUN echo "LC_ALL=en_US.UTF-8\nLANG=en_US.UTF-8" > /etc/default/locale | ||
|
||
# nice to haves | ||
RUN apt install -y gh fish just fzf curl wget parallel neovim fd-find bat | ||
|
||
# `fd` is called `find-fd` on ubuntu. Awesome. | ||
RUN ln -s $(which fdfind) /usr/bin/fd | ||
|
||
# rename ubuntu user to tachi and give them sudo | ||
RUN usermod -l tachi ubuntu && \ | ||
usermod -d /home/tachi -m tachi && \ | ||
echo "tachi ALL = NOPASSWD : ALL" >> /etc/sudoers | ||
|
||
# Docker volumes are mounted as root UNLESS the folder already exists inside the host | ||
# and has non-root ownership. This is the only way to declare a volume in docker has | ||
# non-root ownership. Unbelievably obscure. | ||
RUN mkdir node_modules && \ | ||
mkdir .pnpm-store && \ | ||
chown tachi:1000 node_modules .pnpm-store | ||
|
||
# keep container alive indefinitely | ||
CMD ["/bin/fish"] |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
mod seeds | ||
mod server | ||
mod client | ||
mod docs | ||
|
||
[private] | ||
interactive: | ||
-@just --choose | ||
|
||
# Run the frontend and backend for Tachi. | ||
# | ||
# This is the main command you want to use to start up tachi. Go for it! | ||
start: | ||
parallel --lb ::: 'FORCE_COLOR=1 just server start' 'FORCE_COLOR=1 just client start' | ||
|
||
# test everything | ||
test: | ||
just server test | ||
just client test | ||
just seeds test | ||
|
||
latest_dataset := "2024-05" | ||
# Load the latest Kamaitachi dataset. This is put in the "anon-kamai" database. | ||
load-kamai-dataset: | ||
wget -O- https://cdn-kamai.tachi.ac/datasets/{{latest_dataset}}.dump | mongorestore --uri='mongodb://mongo' --gzip --archive | ||
|
||
echo "Successfully loaded. You should change 'server/conf.json5' to use anon-kamai as the database." | ||
|
||
# Load the latest Bokutachi dataset. This is put in the "anon-boku" database. | ||
load-boku-dataset: | ||
wget -O- https://cdn-boku.tachi.ac/datasets/{{latest_dataset}}.dump | mongorestore --uri='mongodb://mongo' --gzip --archive | ||
|
||
echo "Successfully loaded. You should change 'server/conf.json5' to use anon-boku as the database." | ||
|
||
# Check that the data in MongoDB makes any sense. | ||
validate-db: | ||
cd server/ && pnpm validate-database | ||
|
||
# reload the shell setup | ||
setup-fish: | ||
@fish dev/setup.fish | ||
|
||
@exec fish | ||
|
||
# force a re-bootstrap | ||
bootstrap: | ||
-@rm I_HAVE_BOOTSTRAPPED_OK | ||
./dev/bootstrap.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[private] | ||
interactive: | ||
-@cd ../ && just | ||
|
||
# Run the client interactively. Changes made to files will trigger reloads. | ||
start: | ||
pnpm dev | ||
|
||
# Test that the client passes typechecking and linting. | ||
test: | ||
pnpm typecheck | ||
pnpm lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.