IR_SFARA_beta_backend_for_chapar

IP address is

192.168.16.171

password is

faRa!1401#D@1

user is

fara

service directory

pscp command to transfer

pscp -r IR_SFARA_beta_backend_for_chapar fara@192.168.16.171:/home/fara/srv
faRa!1401#D@1

time problem solving

timedatectl list-timezones

![[Pasted image 20220712201746.png]]

sudo timedatectl set-timezone  Asia/Tehran
sudo timedatectl set-timezone  Etc/UTC

command

 timedatectl set-time '09:55:00'

error

Failed to set time: Automatic time synchronization is enabled

solve

sudo timedatectl set-ntp 0

then use the set time command again

and use set time command

this command will also work

 date --set="14 SEP 2022 07:56:00"

but use sudo

creating a database for the project

is the next step

getting core count for task execution

int cores = Runtime.getRuntime().availableProcessors();

no database is configured and it just downloads the file



for not having the Internet on the servers of the v refah I use a new way of deployment of the server

I upload jar file and use java command to run that file for ever as a service in system d

نکته ی بسیار مهم

1. سرور چاپار وثبت احوال و شاهکار اینترنت ندارد برای نصب لایبری های آن باید

2. نکته ی دوم همه ی پورت های آن نیاز به دستور برای باز شدن دارند و چند پورت آن نمیتواند باز باشد

3. همیشه ساعت های این سرور ها اشتباه است

4. یک راه حل این است که تایم رو از کلاینت بگیریم

Pasted image 20220913152538 creating a ref id which is webservice type 1 for send 2 for inquiry

identifier_id which is a unique number for v refah

1011

current_unix_time_stamp

15:31:37.1575

but only time numbers just connected

there is an error in the spring boot when using h2 with foreign key

curl for the chapar request

Pasted image 20220913194803

changing linux server time by hand change time zone in linux

{"status_code":"125","message_fa":".تولید شده، که شامل 10 کاراکتر عددی می باشد، خارج از بازه ی زمانی مجاز-اختلاف ده دقیقه ای- می باشد RefID استفاده شده در timestamp برچسب زمانی"}

server status

server ip

192.168.16.171

server user name

fara

server password

faRa!1401#D@1

file directory is

/home/fara/Chapar_4558

service runner shell project file directory

/home/fara/Chapar_4558/

service runner shell file includings

cd /home/fara/Chapar_4558
java -jar chapar-0.0.1-SNAPSHOT.jar

*hint dont use source for running like *

source java -jar

use

java -jar

shell file directory creating

/usr/bin/chapar_runner.sh

permission granting for shell filefor the shell file to be able to run

 sudo chmod +x /usr/bin/chapar_runner.sh

it is runnable

running the test file once step

sh /usr/bin/chapar_runner.sh

test is ok

creating a service to activat the shell

*service file path will be *

/lib/systemd/system/chapar.service

command to craete service file

sudo nano /lib/systemd/system/chapar.service
faRa!1401#D@1

internals of the file

[Unit]
Description= service runner for chapar port 4558

[Service]
ExecStart=sh /usr/bin/chapar_runner.sh
Restart=always

[Install]
WantedBy=multi-user.target

reloading the service now

sudo systemctl daemon-reload
sudo systemctl enable chapar.service
sudo systemctl start chapar.service
sudo systemctl status chapar.service
sudo systemctl restart chapar.service
sudo systemctl stop chapar.service
sudo journalctl -f -u chapar
faRa!1401#D@1
journalctl --since "2022-04-04 00:00:00" --until "2022-04-05 16:12:00" -f -u fwd_srv_runner
faRa!1401#D@1

source on github is

mxm5/IR_SFARA_beta_backend_for_chapar (github.com)

opened endpoints new update on chapar but not pushed on the server // now the server is running