|
|
@ -2,20 +2,73 @@ |
|
|
|
|
|
|
|
|
|
|
|
Association software by [Özgür Yazılım Derneği](https://oyd.org.tr) |
|
|
|
Association software by [Özgür Yazılım Derneği](https://oyd.org.tr) |
|
|
|
|
|
|
|
|
|
|
|
### Dev install |
|
|
|
## Dev install |
|
|
|
|
|
|
|
|
|
|
|
```bash |
|
|
|
```bash |
|
|
|
# clone the repository and get submodules |
|
|
|
# clone the repository and get submodules |
|
|
|
git clone https://git.oyd.org.tr/oyd/Adunatio.git |
|
|
|
git clone --recurse-submodules git@git.oyd.org.tr:oyd/Adunatio.git Adunatio |
|
|
|
cd Adunatio |
|
|
|
|
|
|
|
git submodule init |
|
|
|
# Go to project directory |
|
|
|
git submodule update |
|
|
|
cd Adunatio |
|
|
|
docker-compose -f docker-compose-dev.yaml up |
|
|
|
|
|
|
|
|
|
|
|
# Create a encrytion key |
|
|
|
|
|
|
|
ssh-keygen -t rsa -b 4096 -f ./privkey.pem |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Run all system with docker |
|
|
|
|
|
|
|
docker-compose -f docker-compose-dev.yaml up --build -d |
|
|
|
|
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
You can access Adunatio from <http://localhost:5000/admin> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## How to use |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- First, You must create a union from here <http://localhost:5000/admin/union/> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- Check your union password in logs. With this command, you should see this kind of line in logs |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```sh |
|
|
|
|
|
|
|
docker-compose -f docker-compose-dev.yaml logs web |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
... |
|
|
|
|
|
|
|
... |
|
|
|
|
|
|
|
[2021-02-04 20:39:16,685] INFO in Union: New union password : <PASSWORD> |
|
|
|
|
|
|
|
... |
|
|
|
``` |
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
You can access Adunatio from <http://localhost:5000> |
|
|
|
- login with your union and get your Berear token. Your username is combination of your `Legal Registration Number` and `@root` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```sh |
|
|
|
|
|
|
|
# Example Request with curl |
|
|
|
|
|
|
|
curl --request POST \ |
|
|
|
|
|
|
|
--url http://localhost:5000/auth/login \ |
|
|
|
|
|
|
|
--header 'Content-Type: application/json' \ |
|
|
|
|
|
|
|
--data '{ |
|
|
|
|
|
|
|
"username":"<Legal Registration Number>@root", |
|
|
|
|
|
|
|
"password":"<PASSWORD>" |
|
|
|
|
|
|
|
}' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Response |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
"access_token": "<Your Access Token>", |
|
|
|
|
|
|
|
"status": true |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- Test avaliable endpoints with your Berear token. Note that, header title must be `Adunation_Session_Token` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```sh |
|
|
|
|
|
|
|
export ACCESS="<Your Access Token>" |
|
|
|
|
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```sh |
|
|
|
|
|
|
|
curl -H "Adunation_Session_Token: Bearer $ACCESS" http://localhost:5000/api/user/ |
|
|
|
|
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```sh |
|
|
|
|
|
|
|
curl -H "Adunation_Session_Token: Bearer $ACCESS" http://localhost:5000/api/union/ |
|
|
|
|
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
### License |
|
|
|
## License |
|
|
|
|
|
|
|
|
|
|
|
Copyright (C) 2021 Özgür Yazılım Derneği |
|
|
|
Copyright (C) 2021 Özgür Yazılım Derneği |
|
|
|
|
|
|
|
|
|
|
|