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

Release 0.0.1-alpha #2

Merged
merged 126 commits into from
Jan 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
126 commits
Select commit Hold shift + click to select a range
f9ba1c8
small file structure update
sk-m Aug 5, 2023
33dde79
add login page
sk-m Aug 5, 2023
6c733fa
add solid-query
sk-m Aug 6, 2023
9368853
update button styles
sk-m Aug 12, 2023
9e545ea
update vite & solid-router
sk-m Aug 12, 2023
c2aa40e
add `no-warning-comments` eslint rule
sk-m Aug 12, 2023
52f1cd5
add api request methods
sk-m Aug 12, 2023
653032c
initial y-server commit & authentication api
sk-m Aug 12, 2023
f278eeb
add vite server proxy
sk-m Aug 12, 2023
ac1853b
autorun database migrations
sk-m Aug 12, 2023
630d5ea
add authentication api methods
sk-m Aug 12, 2023
f6cee8d
allow logging in from the login page
sk-m Aug 12, 2023
23a0794
add `/auth/me` route
sk-m Aug 12, 2023
a220459
add `useAuth` & block app if not authenticated
sk-m Aug 12, 2023
675b45c
add `zod` & update default query config
sk-m Aug 12, 2023
0177ac6
add `/auth/me` codecs
sk-m Aug 12, 2023
f7d8b62
add `UserIsland`
sk-m Aug 12, 2023
7a87132
add popup component
sk-m Aug 13, 2023
4598722
use more generic default error code
sk-m Aug 13, 2023
ac63565
add `auth/logout`
sk-m Aug 13, 2023
6c6fd63
add log out button
sk-m Aug 13, 2023
d898fb5
add domain selector
sk-m Aug 13, 2023
ee467b7
update popup styles
sk-m Aug 13, 2023
f9b327a
update domain switcher
sk-m Aug 19, 2023
700fe05
add admin domain & aside entries & update layout
sk-m Aug 19, 2023
7d1a3ca
add login `return`
sk-m Aug 19, 2023
f6937af
update aside menu width
sk-m Aug 19, 2023
b762f9d
add `dependabot.yml`
sk-m Aug 19, 2023
5236bc8
add login button loading state
sk-m Aug 22, 2023
439cdc0
fix popup & button styles
sk-m Aug 22, 2023
e3907b3
add `/admin/users` endpoint
sk-m Aug 22, 2023
a8bdc44
add some basic components
sk-m Aug 22, 2023
3859ee5
update app content styles
sk-m Aug 22, 2023
51b2ef6
add `users` codecs & service
sk-m Aug 22, 2023
2b1d188
add `DATABASE_URL` env var
sk-m Aug 22, 2023
c56cc78
add `serde_with`
sk-m Aug 22, 2023
026c35a
add user `created_at`
sk-m Aug 22, 2023
7b5c3bc
add `date-fns`
sk-m Aug 22, 2023
31b9cca
add table utils
sk-m Aug 22, 2023
9f23226
add inor component styles & io updates
sk-m Aug 22, 2023
a8ecc4c
add `ExpandButton` component
sk-m Aug 22, 2023
9e0ec88
add `List` component
sk-m Aug 22, 2023
3833366
update list styles
sk-m Aug 27, 2023
0913b40
add users list page
sk-m Aug 27, 2023
bc05fb0
update overall UI & users page layout
sk-m Oct 5, 2023
f3566b1
add `Stack` component
sk-m Oct 5, 2023
9f8737f
add modals
sk-m Oct 5, 2023
5acc2a7
add update password endpoint
sk-m Oct 7, 2023
6650124
add user password update feature
sk-m Oct 7, 2023
b0be8d7
add `use-form` `disabled` prop
sk-m Oct 7, 2023
d837fea
use `sqlx` instead of `diesel`
sk-m Oct 17, 2023
3e60308
add user group endpoints
sk-m Dec 2, 2023
6f924f7
add i18n
sk-m Dec 3, 2023
bcd1ec0
add `Checkbox` component
sk-m Dec 3, 2023
dab1a7e
update styles
sk-m Dec 3, 2023
de44bc3
add support for checkboxes: use-form
sk-m Dec 3, 2023
d5b7029
add `ListEntryLink` component
sk-m Dec 3, 2023
610e6e5
add user rights & groups services
sk-m Dec 3, 2023
b6a4292
add user group management pages
sk-m Dec 3, 2023
156e645
fix user group saving bug
sk-m Dec 6, 2023
c4c35e9
add general UI updates
sk-m Dec 6, 2023
3635f11
allow wildcard `watch` field names
sk-m Dec 7, 2023
dab779b
add user's groups endpoints
sk-m Dec 8, 2023
ff825f3
allow `Checkbox` to be controlled
sk-m Dec 8, 2023
409c2d1
add `Tab` component
sk-m Dec 8, 2023
42c0e36
add `user` services
sk-m Dec 8, 2023
d5fc700
add user page
sk-m Dec 8, 2023
62fb7b1
fix cookie path bug
sk-m Dec 8, 2023
0072a1e
add `get_user_rights`
sk-m Dec 8, 2023
885ebc5
add right checks for admin actions
sk-m Dec 10, 2023
7c70b62
update user group page
sk-m Dec 10, 2023
23897c5
fix `get_user_group` "not found" bug
sk-m Dec 10, 2023
ecc127a
add an ability to delete user groups
sk-m Dec 10, 2023
6330929
fix right search bug
sk-m Dec 10, 2023
8fd9687
add `Pill` component
sk-m Dec 10, 2023
cc4fbd2
add system user groups
sk-m Dec 11, 2023
13d9fb9
inherit system groups when checking user rights
sk-m Dec 11, 2023
fba141a
get rights for unauthenticated clients
sk-m Dec 15, 2023
3c120e3
add `user_rights` to `/me` response
sk-m Dec 18, 2023
5daba10
fix controlled field default value setting
sk-m Dec 18, 2023
301408a
add `value_source` to group right definitions
sk-m Dec 18, 2023
0b4307b
add a simple select input field
sk-m Dec 21, 2023
e0d8f91
add user group select field
sk-m Dec 21, 2023
ed1938e
check for blacklisted groups on password change
sk-m Dec 21, 2023
72b7160
hide system groups when updating user's membership
sk-m Dec 31, 2023
544d1f6
add `assignable_user_groups` option check
sk-m Dec 31, 2023
97ccbe6
fix session cookie path
sk-m Dec 31, 2023
895415b
add create user endpoint
sk-m Jan 1, 2024
e65320d
add "create user" page
sk-m Jan 1, 2024
841e181
check for removed groups when updating membership
sk-m Jan 1, 2024
0925093
add a disabled state for checkboxes
sk-m Jan 1, 2024
2b6feee
disable disallowed actions on the frontend
sk-m Jan 1, 2024
c7a2993
update `less` and `vite`
sk-m Jan 1, 2024
dea552d
add delete user endpoint
sk-m Jan 2, 2024
c79f88c
add delete user actions
sk-m Jan 2, 2024
a9d465c
don't refetch `/me` all the time
sk-m Jan 2, 2024
4c93bce
update `solid-js`
sk-m Jan 2, 2024
87eff9b
add toasts
sk-m Jan 2, 2024
0f7c4e1
add toast notifications
sk-m Jan 2, 2024
86aea58
add server error translations
sk-m Jan 2, 2024
de41720
add users & groups "not found" toasts
sk-m Jan 2, 2024
deb8104
add auth messages
sk-m Jan 3, 2024
f2ddbb9
add a "logged in" state to the auth page
sk-m Jan 3, 2024
fdfd3b8
add a key-value component
sk-m Jan 5, 2024
96a3542
allow updating user group names
sk-m Jan 5, 2024
829fc52
fix user group membership update bug
sk-m Jan 6, 2024
a4b4f2b
add user group page key-values
sk-m Jan 6, 2024
15a1ac0
add aside sub-entries
sk-m Jan 6, 2024
56e8130
add breadcrumbs
sk-m Jan 6, 2024
7f231cc
user group page minor ui fix
sk-m Jan 6, 2024
49d8e8d
update disabled checkbox styles
sk-m Jan 6, 2024
476be19
add disabled select field styles
sk-m Jan 6, 2024
0f97045
add more permission checks for group management
sk-m Jan 6, 2024
7b88ce6
update eslint rules
sk-m Jan 6, 2024
1ef85ba
Merge branch 'master' of skm.github.com:sk-m/y into development
sk-m Jan 6, 2024
328fc9d
fix `app.tsx` filename
sk-m Jan 6, 2024
802c212
add default user migration
sk-m Jan 6, 2024
330393e
update "create admin" script
sk-m Jan 6, 2024
189084d
fix create user right check
sk-m Jan 6, 2024
3a2381e
add automatic database migrations
sk-m Jan 6, 2024
6ab7621
add vscode workspace
sk-m Jan 6, 2024
05b05be
fix vscode config paths
sk-m Jan 6, 2024
f56a9cf
Merge branch 'master' of github.com:sk-m/y into development
sk-m Jan 7, 2024
5412d33
add LICENSE
sk-m Jan 7, 2024
4e0eceb
add an install script for the server
sk-m Jan 7, 2024
de74e9d
add README
sk-m Jan 7, 2024
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
3 changes: 0 additions & 3 deletions .vscode/settings.json

This file was deleted.

12 changes: 12 additions & 0 deletions .vscode/y.code-workspace
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"folders": [
{
"path": ".."
}
],
"settings": {
"typescript.tsdk": "./y-web/node_modules/typescript/lib",
"rust-analyzer.linkedProjects": ["./y-server/Cargo.toml"],
"rust-analyzer.showUnlinkedFileNotification": false
}
}
13 changes: 13 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Copyright 2024 Maksym (sk-m) Kurysh

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
99 changes: 99 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# y

## Installing y (production environment)

y comes in two parts: a _server_ and _web distribution_.

You can download the latest version of y on the [releases](https://github.com/sk-m/y/releases) page.

### 1. Prerequisites

In order to set up y on your server, you first will need:

1. A linux machine.
2. PostgreSQL.
3. A web server (nginx/apache/etc.).

### 2. Setting up PostgreSQL

After installing postgresql and initializing your database cluster (see postgresql documentation), do the following:

1. Launch `psql` (you might need to log in as the `postgres` user first - `sudo su - postgres`)
2. Create a database for y: `CREATE DATABASE y;`
3. Create a user: `CREATE USER y_user WITH PASSWORD 'passw0rd!';`
4. Grant required privileges to that user: `GRANT ALL PRIVILEGES ON DATABASE "y" to y_user;`
5. Set that user as the owner of the database: `ALTER DATABASE y OWNER TO y_user;`

### 3. Installing y server

_y server_ is, for the most part, just one binary file. You can either run it from a cli, if you want to test it out first, or set up a service for it, which is a more long-term soultion.

Before starting the server, edit the `.env` file and update it according to your setup. You mainly want to make sure that the `DATABASE_URL` variable is correct, everything else should be fine by default. Then,

- to start the server from a cli, just run `./y-server`, or
- to set up y-server as a service, run the `./install.sh` script.

### 4. Serving web files

_y server_ does **not** serve y's web files, so you will have to use a web server for that.

The next section is written for **nginx**, but you can use any web server you like.

1. Install **nginx**.
2. Copy y's `www` folder anywhere you like, those files will be hosted by **nginx**.
3. Add the following configuration to your `/etc/nginx/nginx.conf`:

```text
server {
# Example server config:
server_name localhost;
listen 80;

# Replace with the path to your www folder:
root /usr/share/nginx/y/www;

index index.html;

location / {
try_files $uri $uri/ /index.html;
}

location /api/ {
proxy_pass http://localhost:8080;
proxy_set_header Host $host;
}
}
```

Don't forget to restart **nginx** after updating `ninx.conf`.

### 5. Logging in

If you've done everything correctly, you should be able to open y in your browser and log into a default admin user:

- username: `admin`
- password: `admin`

## Trying out y (development environment)

Setting up a development environment should be very straightforward.

1. Install PostgreSQL and set it up using a tutorial in the "**Installing y (production environment)**" section.
2. Install **NodeJS**, **pnpm** and **Rust**.
3. Clone the repo: `git clone https://github.com/sk-m/y.git`
4. Start the server:

1. `cd y/y-server`
2. `cp .env.example .env`
3. update `.env` according to your setup
4. `cargo run`

5. Start up the frontend:

1. `cd y/y-web`
2. `pnpm install`
3. `pnpm run dev`

## Footnotes

[Support Ukraine](https://u24.gov.ua/)
4 changes: 4 additions & 0 deletions y-server/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
SERVER_ADDRESS=127.0.0.1
SERVER_PORT=8080

DATABASE_URL=postgres://y_user:[email protected]:5432/y
2 changes: 2 additions & 0 deletions y-server/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
target
.env
Loading