Skip to content

pastemyst/pastemyst-v3

Repository files navigation


a powerful website for storing and sharing text and code snippets. completely free and open source.

licenselegaldonationschangelogapipastry-cli


this is a complete rewrite, with more functionality and a better ui.

if you want to see the source code of v2 go to codemyst/pastemyst.

building

this is a guide on how to set the project up, build it and get it running.

api

the api is written in c# with asp.net core, so you need the dotnet sdk (and the asp.net targeting pack). check the dotnet download page for a guide on how to install it.

you also need a mongodb database.

set the db connection string as a dotnet secret:

dotnet user-secrets set ConnectionStrings:DefaultDb "mongodb://127.0.0.1:27017"

now you can build and run the api with:

dotnet run

to test that everything is fine, you can open https://localhost:5000/swagger or get /ping.

authentification

to enable auth (login), you need to set secrets for github and gitlab oauth applications, you also need to add the secret used for jwt keys.

dotnet user-secrets set GitHub:ClientId "..."
dotnet user-secrets set GitHub:ClientSecret "..."
dotnet user-secrets set GitLab:ClientId "..."
dotnet user-secrets set GitLab:ClientSecret "..."

dotnet user-secrets set JwtSecret "..."

language autodetection

to enable language autodetection, you need to install the guesslang-bun executable. if you're using docker you don't need to do this.

client

the client is written with sveltekit, so install node and npm (or yarn).

install all dependencies:

npm i

copy the .env.example file to .env in the /client directory and change the variables.

run the client with:

npm run dev

docker

you can also run the entire project (db, api and client) using docker.

copy the .env.example file to .env and change the variables.

finally run docker-compose up.