Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update 2024 #10

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
run:
cd site && cargo run
31 changes: 18 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Pure rust. Built with actix, diesel, tera, serde and sqlite3.

## Run instructions using docker

**TODO REWRITE, OUTDATED**

1. Clone the repository
```bash
git clone https://github.com/mtrx1337/crablog
Expand All @@ -23,23 +25,22 @@ docker-compose up -d

## Configuration environment file

All configuration options are defined in crablog.env, an example configuration is provided.
When not using Docker you may have to add crablog.env to your startup script or define the variables there.
All configuration options are defined in .env which should be placed in the path where crablog is run. An example configuration is provided:

`crablog.env`
`.env`
```
USERNAME=yourusername
EMAIL=me@mydomain.tld
BIND_PORT=8000
SUBMIT_TOKEN=Submit!123 # token needed for submitting
GITHUB_ACCOUNT=usernam3
TWITTER_ACCOUNT=usernam3
MASTODON_ACCOUNT=usernam3@mastodon.social
REDDIT_ACCOUNT=usernam3
DISCORD_ACCOUNT=usernam3
CL_USERNAME=yourusername
CL_EMAIL=me@mydomain.tld # optional
CL_BIND_PORT=8000 # optional
CL_SUBMIT_TOKEN=Submit!123 # required, token needed for submitting
CL_GITHUB_ACCOUNT=yourusername # optional
CL_TWITTER_ACCOUNT=yourusername # optional
CL_MASTODON_ACCOUNT=yourusername@mastodon.social # optional
CL_REDDIT_ACCOUNT=yourusername # optional
CL_DISCORD_ACCOUNT=yourusername # optional

# only needed when not using a docker container
ROOT_PATH=/path/to/template/directory/and/sqliteDB
CL_ROOT_PATH=/path/to/template/directory/and/sqliteDB
```

## Routes
Expand All @@ -58,3 +59,7 @@ ROOT_PATH=/path/to/template/directory/and/sqliteDB
| Route | Description |
| ---------------- | ------------------------- |
| `api/blog/posts` | returns all posts as json |

## Regenerate Migrations from Schema:

`diesel migration generate --diff-schema=./src/db/schema.rs create_posts`
24 changes: 0 additions & 24 deletions content/static/css/index.css

This file was deleted.

35 changes: 0 additions & 35 deletions content/static/js/blog.js

This file was deleted.

43 changes: 0 additions & 43 deletions content/templates/about.html

This file was deleted.

35 changes: 0 additions & 35 deletions content/templates/blog-all-posts.html

This file was deleted.

35 changes: 0 additions & 35 deletions content/templates/blog-by-id.html

This file was deleted.

35 changes: 0 additions & 35 deletions content/templates/blog.html

This file was deleted.

42 changes: 0 additions & 42 deletions content/templates/edit-form.html

This file was deleted.

22 changes: 0 additions & 22 deletions content/templates/edit.html

This file was deleted.

33 changes: 0 additions & 33 deletions content/templates/submit.html

This file was deleted.

9 changes: 0 additions & 9 deletions crablog.env

This file was deleted.

Loading