2024年1月28日 星期日

perfSONAR 5.0.7 on Ubuntu 22.04

Failed to install perfSONAR on Ubuntu 22.04 because pscheduler depends on python3-pyjq which is not installable.

$sudo apt install perfsonar-toolkit

Reading package lists... Done

Building dependency tree... Done

Reading state information... Done

Some packages could not be installed. This may mean that you have

requested an impossible situation or if you are using the unstable

distribution that some required packages have not yet been created

or been moved out of Incoming.

The following information may help to resolve the situation:


The following packages have unmet dependencies:

 pscheduler-server : Depends: postgresql-12 but it is not installable or

                              postgresql-11 but it is not installable or

                              postgresql-10 but it is not installable or

                              postgresql-9.6 but it is not installable or

                              postgresql-9.5 but it is not installable

                     Depends: postgresql-plpython3-12 but it is not installable or

                              postgresql-plpython3-11 but it is not installable or

                              postgresql-plpython3-10 but it is not installable or

                              postgresql-plpython3-9.6 but it is not installable or

                              postgresql-plpython3-9.5 but it is not installable

 python3-pscheduler : Depends: python3-pyjq

E: Unable to correct problems, you have held broken packages.

$sudo apt install python3-pyjq

Reading package lists... Done

Building dependency tree... Done

Reading state information... Done

Package python3-pyjq is a virtual package provided by:

  python3-pyjq-u20 2.4.0-3~bpo10+1

  python3-pyjq-u18 2.4.0-3~bpo10+1

  python3-pyjq-d10 2.4.0-3~bpo10+1

You should explicitly select one to install.


E: Package 'python3-pyjq' has no installation candidate

$sudo apt install python3-pyjq-u20

Reading package lists... Done

Building dependency tree... Done

Reading state information... Done

Some packages could not be installed. This may mean that you have

requested an impossible situation or if you are using the unstable

distribution that some required packages have not yet been created

or been moved out of Incoming.

The following information may help to resolve the situation:


The following packages have unmet dependencies:

 python3-pyjq-u20 : Depends: python3 (< 3.9) but 3.10.6-1~22.04 is to be installed

E: Unable to correct problems, you have held broken packages.

2024年1月13日 星期六

Private Softether VPN Azure

 A. Build private VPN azure

1. Download and build vpnauzure-go

git clone https://github.com/domosekai/vpnazure-go.git 
cd vpnazure-go 
go mod tidy 
go build

2. Modify auth.txt and suffix.txt

auth.txt (seprated by TAB):

vpn* .domain.my password Password_Of_VPNazure_Server

suffix.txt (seperated by TAB):

.domain.my    cloud.domain.my  fullchain.pem   privkey.pem

3. Start vpnazure-go

./vpnazure-go -b 0.0.0.0:443 -auth auth.txt -suffix suffix.txt -log vpnazure.log &

4. Modify DNS record

  • Add A record for VPNazure host: 
cloud.domain.my ip_address_of_cloud.domain.my

  • Add A record for each of VPN server (host to be relayed), for example:
vpn123.domain.my ip_address_of_cloud.domain.my

5. Setup VPN server for vpn123

After completion of setup, VPN client can connect to server by SSTP to vpn123.domain.my


B. Setup VPN server 

1. Download and build Softether VPN server

sudo apt -y install cmake gcc g++ make pkgconf libncurses5-dev libssl-dev libsodium-dev libreadline-dev zlib1g-dev
git clone https://github.com/SoftEtherVPN/SoftEtherVPN.git
cd SoftEtherVPN
git submodule init && git submodule update
./configure
make -C build
sudo make -C build install

2. Modify codes to prevent connecting to softether-related hosts

  • Modify src/Cedar/DDNS.c:
Add instant return for void DCThread()

  • Modify src/Mayaqua/Network.c:
Add instant return for void RUDPGetRegisterHostNameByIP()

  • Rebuild source code:
make -C build
sudo make -C build install


3. Setup VPN server

  • Add auto start system service:
sudo vi /etc/systemd/system/vpnserver.service
------
[Unit]
Description=SoftEther VPN Server
After=network.target

[Service]
Type=forking
ExecStart=/usr/local/bin/vpnserver start
ExecStop=/usr/local/bin/vpnserver stop

[Install]
WantedBy=multi-user.target
------

  • Start vpnserver service:

sudo systemctl start vpnserver
sudo systemctl enable vpnserver
sudo vpncmd

Select 1, 2 or 3: 1
Hostname of IP Address of Destination: [Enter]
Specify Virtual Hub Name: [Enter]
VPN Server>ServerPasswordSet
Password: [Enter password]
Confirm input: [Enter password]
VPN Server>Hub DEFAULT
VPN Server/DEFAULT>UserCreate username
VPN Server/DEFAULT>UserPasswordSet username
Password: [Enter password]
Confirm input: [Enter password]
VPN Server/DEFAULT>SecureNatEnable
VPN Server/DEFAULT>VpnAzureSetCustom
Server address: cloud.domain.my:443
Hostname: vpn123.domain.my
Password: Password_of_VPNazure_Server
VPN Server/DEFAULT>VpnAzureSetEnable yes
exit

2024年1月7日 星期日

Fix Ubuntu meta-release-lts check fail problem

 After login, the following message is found in MOTD:

"Failed to connect to https://changelogs.ubuntu.com/meta-release-lts. Check your Internet connection or proxy settings"

It is caused by incorrect system certificate setting, it can be checked by issuing the following command:

python3 -c 'import ssl; print(ssl.get_default_verify_paths().openssl_cafile)'
And the result shows:
/usr/local/ssl/cert.pem
However, thers is no cert.pem found on /usr/local/ssl. 
Fix this by add a cert.pm symbolic link to /etc/ssl/certs/ca-certificates.crt
sudo ln -s /etc/ssl/certs/ca-certificates.crt /usr/local/ssl/cert.pem
Then, remove old motd check by:
sudo rm /var/lib/ubuntu-release-upgrader/release-upgrade-available
Update the motd message by:
sudo /usr/lib/ubuntu-release-upgrader/release-upgrade-motd
Now, it's done! Problem fixed.
I think this is a better solution then modify MetaRelease.py to ignore the certificates.