Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.package
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Arnaud Véron
slapos.package
Commits
7c62a50d
Commit
7c62a50d
authored
Jul 01, 2013
by
Jondy Zhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update user-guide document for windows
User need press any key to quit the configure script
parent
5ddfea4e
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
150 additions
and
219 deletions
+150
-219
windows/docs/using-slapos-in-windows.xml
windows/docs/using-slapos-in-windows.xml
+23
-147
windows/scripts/build-slapos.sh
windows/scripts/build-slapos.sh
+9
-3
windows/scripts/post-install.sh
windows/scripts/post-install.sh
+3
-1
windows/scripts/pre-uninstall.sh
windows/scripts/pre-uninstall.sh
+2
-0
windows/scripts/slapos-all-in-one.iss
windows/scripts/slapos-all-in-one.iss
+6
-6
windows/scripts/slapos-configure.sh
windows/scripts/slapos-configure.sh
+76
-38
windows/scripts/slapos-node.sh
windows/scripts/slapos-node.sh
+24
-18
windows/scripts/slapos.iss
windows/scripts/slapos.iss
+6
-6
windows/scripts/useradd
windows/scripts/useradd
+1
-0
No files found.
windows/docs/using-slapos-in-windows.xml
View file @
7c62a50d
This diff is collapsed.
Click to expand it.
windows/scripts/build-slapos.sh
View file @
7c62a50d
...
@@ -40,7 +40,13 @@ bin/buildout -v -N
...
@@ -40,7 +40,13 @@ bin/buildout -v -N
patch_file
=
/etc/slapos/patches/slapos-core-format.patch
patch_file
=
/etc/slapos/patches/slapos-core-format.patch
if
[[
-f
$patch_file
]]
;
then
if
[[
-f
$patch_file
]]
;
then
echo
"Apply patch:
$patch_file
"
echo
"Apply patch:
$patch_file
"
(
cd
`
ls
-d
$slapos_home
/eggs/slapos.core-
*
-py2
.7.egg
`
;
\
for
x
in
$(
find
$slapos_home
/eggs
-name
slapos.core-
*
.egg
;
do
patch
-p1
<
$patch_file
)
echo
Patching
$x
...
(
cd
/etc/slapos/patches
;
mv
$patch_file
{
,.done
})
cd
$x
patch
--dry-run
-p1
<
$patch_file
&&
patch
-p1
<
$patch_file
&&
echo
Patch
$x
OK.
done
fi
fi
echo
Build SlapOS successfully.
read
-n
1
-p
"Press any key to exit..."
exit
0
windows/scripts/post-install.sh
View file @
7c62a50d
...
@@ -73,7 +73,7 @@ fi
...
@@ -73,7 +73,7 @@ fi
# Copy rebaseall.bat to /
# Copy rebaseall.bat to /
if
[[
!
-f
/autorebase.bat
]]
;
then
if
[[
!
-f
/autorebase.bat
]]
;
then
echo
Create /autorebase.bat
echo
Create /autorebase.bat
c
opy
<<
EOF
> /autorebase.bat
c
at
<<
EOF
> /autorebase.bat
@echo off
@echo off
rem Postinstall scripts are always started from the Cygwin root dir
rem Postinstall scripts are always started from the Cygwin root dir
rem so we can just call dash from here
rem so we can just call dash from here
...
@@ -99,5 +99,7 @@ for x in $(cygrunsrv --list) ; do
...
@@ -99,5 +99,7 @@ for x in $(cygrunsrv --list) ; do
cygrunsrv
-R
$x
cygrunsrv
-R
$x
done
done
echo
Run post-install script successfully.
read
-n
1
-p
"Press any key to exit..."
exit
0
exit
0
windows/scripts/pre-uninstall.sh
View file @
7c62a50d
...
@@ -30,5 +30,7 @@ for x in $(cygrunsrv --list) ; do
...
@@ -30,5 +30,7 @@ for x in $(cygrunsrv --list) ; do
cygrunsrv
-R
$x
cygrunsrv
-R
$x
done
done
echo
Run pre-uninstall script successfully.
read
-n
1
-p
"Press any key to exit..."
exit
0
exit
0
windows/scripts/slapos-all-in-one.iss
View file @
7c62a50d
...
@@ -3,10 +3,10 @@
...
@@ -3,10 +3,10 @@
[Setup]
[Setup]
AppName=SlapOS
AppName=SlapOS
AppVersion=0.158
AppVersion=0.158
AppVerName=SlapOS Windows 0.158.
4
AppVerName=SlapOS Windows 0.158.
5
DefaultDirName=C:\slapos
DefaultDirName=C:\slapos
DefaultGroupName=SlapOS
DefaultGroupName=SlapOS
OutputBaseFilename=slapos-0.158.
4-windows-x
86-all-in-one
OutputBaseFilename=slapos-0.158.
5-windows-i3
86-all-in-one
OutputDir=D:\slapos\publish\Output
OutputDir=D:\slapos\publish\Output
SourceDir=D:\slapos
SourceDir=D:\slapos
Uninstallable=yes
Uninstallable=yes
...
@@ -55,7 +55,7 @@ Source: "opt\git\slapos.package\windows\scripts\cyg_wscript"; DestDir: "{app}\cy
...
@@ -55,7 +55,7 @@ Source: "opt\git\slapos.package\windows\scripts\cyg_wscript"; DestDir: "{app}\cy
Source: "opt\git\slapos.package\windows\babeld\babeld.exe"; DestDir: "{app}\cygwin\usr\local\bin";
Source: "opt\git\slapos.package\windows\babeld\babeld.exe"; DestDir: "{app}\cygwin\usr\local\bin";
Source: "opt\git\slapos.package\windows\openvpn\src\openvpn\.libs\openvpn.exe"; DestDir: "{app}\cygwin\usr\local\bin";
Source: "opt\git\slapos.package\windows\openvpn\src\openvpn\.libs\openvpn.exe"; DestDir: "{app}\cygwin\usr\local\bin";
Source: "opt\openvpn\bin\
devcon.exe
"; DestDir: "{app}\cygwin\usr\local\bin";
Source: "opt\openvpn\bin\
*
"; DestDir: "{app}\cygwin\usr\local\bin";
Source: "opt\openvpn\driver\*"; DestDir: "{app}\cygwin\etc\slapos\driver";
Source: "opt\openvpn\driver\*"; DestDir: "{app}\cygwin\etc\slapos\driver";
Source: "opt\git\slapos.package\windows\scripts\init-slapos-node.sh"; DestDir: "{app}\cygwin\etc\slapos\scripts";
Source: "opt\git\slapos.package\windows\scripts\init-slapos-node.sh"; DestDir: "{app}\cygwin\etc\slapos\scripts";
...
@@ -73,8 +73,8 @@ Source: "opt\git\slapos.package\windows\docs\README.cygwin"; DestDir: "{app}"; D
...
@@ -73,8 +73,8 @@ Source: "opt\git\slapos.package\windows\docs\README.cygwin"; DestDir: "{app}"; D
[Icons]
[Icons]
Name: "{commondesktop}\SlapOS Desktop"; Filename: "https://www.slapos.org/"; IconFilename: "{app}\cygwin\etc\slapos\images\slapos.ico";
Name: "{commondesktop}\SlapOS Desktop"; Filename: "https://www.slapos.org/"; IconFilename: "{app}\cygwin\etc\slapos\images\slapos.ico";
Name: "{group}\Command Console"; Filename: "{app}\cygwin\cygtty.bat"; WorkingDir: "{app}\cygwin\opt\slapos"; IconFilename: "{app}\cygwin\etc\slapos\images\terminal.ico";
Name: "{group}\Command Console"; Filename: "{app}\cygwin\cygtty.bat"; WorkingDir: "{app}\cygwin\opt\slapos"; IconFilename: "{app}\cygwin\etc\slapos\images\terminal.ico";
Name: "{group}\Configure SlapOS"; Filename: "{app}\cygwin\bin\mintty.exe"; Parameters: "-c ~/.minttyrc -h never -t ""Configure SlapOS Node"" /etc/slapos/scripts/slapos-c
lient-config
.sh"; WorkingDir: "{app}\cygwin\bin"; IconFilename: "{app}\cygwin\etc\slapos\images\configure.ico";
Name: "{group}\Configure SlapOS"; Filename: "{app}\cygwin\bin\mintty.exe"; Parameters: "-c ~/.minttyrc -h never -t ""Configure SlapOS Node"" /etc/slapos/scripts/slapos-c
onfigure
.sh"; WorkingDir: "{app}\cygwin\bin"; IconFilename: "{app}\cygwin\etc\slapos\images\configure.ico";
Name: "{group}\Node Runner"; Filename: "
http://
{app}\cygwin\etc\slapos\scripts\slap-runner.html"; IconFilename: "{app}\cygwin\etc\slapos\images\manager.ico";
Name: "{group}\Node Runner"; Filename: "{app}\cygwin\etc\slapos\scripts\slap-runner.html"; IconFilename: "{app}\cygwin\etc\slapos\images\manager.ico";
Name: "{group}\SlapOS Desktop"; Filename: "https://www.slapos.org/"; IconFilename: "{app}\cygwin\etc\slapos\images\slapos.ico";
Name: "{group}\SlapOS Desktop"; Filename: "https://www.slapos.org/"; IconFilename: "{app}\cygwin\etc\slapos\images\slapos.ico";
Name: "{group}\SlapOS Node"; Filename: "{app}\cygwin\bin\bash.exe"; Parameters: "--login -i /etc/slapos/scripts/slapos-node.sh"; WorkingDir: "{app}\cygwin\bin"; IconFilename: "{app}\cygwin\etc\slapos\images\node.ico";
Name: "{group}\SlapOS Node"; Filename: "{app}\cygwin\bin\bash.exe"; Parameters: "--login -i /etc/slapos/scripts/slapos-node.sh"; WorkingDir: "{app}\cygwin\bin"; IconFilename: "{app}\cygwin\etc\slapos\images\node.ico";
Name: "{group}\Uninstall SlapOS"; Filename: "{uninstallexe}";
Name: "{group}\Uninstall SlapOS"; Filename: "{uninstallexe}";
...
@@ -86,7 +86,7 @@ Filename: "{app}\cygwin\bin\bash.exe"; Parameters: "--login -i /etc/slapos/scrip
...
@@ -86,7 +86,7 @@ Filename: "{app}\cygwin\bin\bash.exe"; Parameters: "--login -i /etc/slapos/scrip
Filename: "{app}\cygwin\autorebase.bat"; WorkingDir: "{app}\cygwin"; Flags: skipifdoesntexist;
Filename: "{app}\cygwin\autorebase.bat"; WorkingDir: "{app}\cygwin"; Flags: skipifdoesntexist;
[UninstallRun]
[UninstallRun]
Filename: "{app}\cygwin\bin\bash.exe"; Parameters: "--login -i /etc/slapos/scripts/pre-uninstall.sh"; WorkingDir: "{app}\cygwin\bin"; Flags: skipifdoesntexist
runhidden
;
Filename: "{app}\cygwin\bin\bash.exe"; Parameters: "--login -i /etc/slapos/scripts/pre-uninstall.sh"; WorkingDir: "{app}\cygwin\bin"; Flags: skipifdoesntexist;
[UninstallDelete]
[UninstallDelete]
Type: filesandordirs; Name: "{app}\cygwin" ;
Type: filesandordirs; Name: "{app}\cygwin" ;
...
...
windows/scripts/slapos-configure.sh
View file @
7c62a50d
...
@@ -24,8 +24,9 @@
...
@@ -24,8 +24,9 @@
#
#
export
PATH
=
/usr/local/bin:/usr/bin:
$PATH
export
PATH
=
/usr/local/bin:/usr/bin:
$PATH
grep
-q
"export CYGWIN=server"
~/.bash_profie
||
echo
"export CYGWIN=server"
>>
~/.bash_profile
for
myprofile
in
~/.bash_profile ~/.profile
;
do
grep
-q
"export CYGWIN=server"
~/.profie
||
echo
"export CYGWIN=server"
>>
~/.profile
grep
-q
"export CYGWIN=server"
$myprofile
||
echo
"export CYGWIN=server"
>>
$myprofile
done
#-------------------------------------------------
#-------------------------------------------------
# Common functions
# Common functions
...
@@ -153,7 +154,8 @@ slapos_ifname=re6stnet-lo
...
@@ -153,7 +154,8 @@ slapos_ifname=re6stnet-lo
ipv4_local_network
=
10.201.67.0/24
ipv4_local_network
=
10.201.67.0/24
slapos_runner_file
=
/etc/slapos/scripts/slap-runner.html
slapos_runner_file
=
/etc/slapos/scripts/slap-runner.html
slaprunner_cfg
=
http://git.erp5.org/gitweb/slapos.git/blob_plain/refs/heads/cygwin-0:/software/slaprunner/software.cfg
slaprunner_cfg
=
'http://git.erp5.org/gitweb/slapos.git/blob_plain/refs/heads/cygwin-0:/software/slaprunner/software.cfg'
# slaprunner_title="SlapOS-Node-Runner-In-Windows"
slaprunner_title
=
"Node Runner"
slaprunner_title
=
"Node Runner"
#-------------------------------------------------
#-------------------------------------------------
...
@@ -168,37 +170,35 @@ mkdir -p $slapos_client_home
...
@@ -168,37 +170,35 @@ mkdir -p $slapos_client_home
#-------------------------------------------------
#-------------------------------------------------
echo
Checking cygserver service ...
echo
Checking cygserver service ...
cygrunsrv
--query
cygserver
>
/dev/null
cygrunsrv
--query
cygserver
>
/dev/null
2>&1
if
((
$?
))
;
then
if
((
$?
))
;
then
echo
Run cygserver-config ...
echo
Run cygserver-config ...
/usr/bin/cygserver-config
--yes
||
\
/usr/bin/cygserver-config
--yes
||
\
show_error_exit
"Failed to run cygserver-config"
show_error_exit
"Failed to run cygserver-config"
echo
OK.
else
else
echo
The cygserver service has been installed.
echo
The cygserver service has been installed.
fi
fi
echo
Checking syslog-ng service ...
echo
Checking syslog-ng service ...
cygrunsrv
--query
syslog-ng
>
/dev/null
cygrunsrv
--query
syslog-ng
>
/dev/null
2>&1
if
((
$?
))
;
then
if
((
$?
))
;
then
echo
Run syslog-ng-config ...
echo
Run syslog-ng-config ...
/usr/bin/syslog-ng-config
--yes
||
\
/usr/bin/syslog-ng-config
--yes
||
\
show_error_exit
"Failed to run syslog-ng-config"
show_error_exit
"Failed to run syslog-ng-config"
echo
OK.
else
else
echo
The syslog-ng service has been installed.
echo
The syslog-ng service has been installed.
fi
fi
echo
Checking cron service ...
#
echo Checking cron service ...
cygrunsrv
--query
cron
>
/dev/null
#
cygrunsrv --query cron > /dev/null
if
((
$?
))
;
then
#
if (( $? )) ; then
echo
Run cron-config ...
#
echo Run cron-config ...
/usr/bin/cron-config
--yes
||
\
#
/usr/bin/cron-config --yes || \
show_error_exit
"Failed to run cron-config"
#
show_error_exit "Failed to run cron-config"
echo
OK.
#
echo OK.
else
#
else
echo
The cron service has been installed.
#
echo The cron service has been installed.
fi
#
fi
#-------------------------------------------------
#-------------------------------------------------
# Configure slapos network
# Configure slapos network
...
@@ -280,10 +280,10 @@ interface_guid=$(connection2guid $slapos_ifname) || \
...
@@ -280,10 +280,10 @@ interface_guid=$(connection2guid $slapos_ifname) || \
show_error_exit
"Failed to get guid of interface:
$slapos_ifname
."
show_error_exit
"Failed to get guid of interface:
$slapos_ifname
."
echo
Computer configuration information:
echo
Computer configuration information:
echo
interface name:
$slapos_ifname
echo
\t\t
interface name:
$slapos_ifname
echo
GUID:
$interface_guid
echo
\t\t
GUID:
$interface_guid
echo
ipv4_local_network:
$ipv4_local_network
echo
\t\t
ipv4_local_network:
$ipv4_local_network
echo
computer_id:
$computer_id
echo
\t\t
computer_id:
$computer_id
# generate /etc/slapos/slapos.cfg
# generate /etc/slapos/slapos.cfg
sed
-i
-e
"s%^
\\
s*interface_name.*
$%
interface_name =
$interface_guid
%"
\
sed
-i
-e
"s%^
\\
s*interface_name.*
$%
interface_name =
$interface_guid
%"
\
-e
"s%^#
\?\\
s*ipv6_interface.*
$%
# ipv6_interface =%g"
\
-e
"s%^#
\?\\
s*ipv6_interface.*
$%
# ipv6_interface =%g"
\
...
@@ -427,21 +427,57 @@ grep -q "^table " re6stnet.conf || \
...
@@ -427,21 +427,57 @@ grep -q "^table " re6stnet.conf || \
grep
-q
"^# Your subnet: "
re6stnet.conf
||
\
grep
-q
"^# Your subnet: "
re6stnet.conf
||
\
show_error_exit
"Error: no subnet found in the /etc/re6stnet/re6stnet.conf"
show_error_exit
"Error: no subnet found in the /etc/re6stnet/re6stnet.conf"
echo
Check re6stnet configuration OK.
echo
Check re6stnet configuration OK.
echo
#-------------------------------------------------
# Create openvpn tap-windows drivers used by re6stnet
#-------------------------------------------------
# Adding tap-windows driver will break others, so we add all drivers
# here. Get re6stnet client count, then remove extra drivers and add
# required drivers.
#
echo
echo
Installing OpenVPN Tap-Windows Driver ...
echo
original_connections
=
$(
echo
$(
get_all_connections
))
client_count
=
$(
sed
-n
-e
"s/^client-count *//p"
/etc/re6stnet/re6stnet.conf
)
[[
-z
$client_count
]]
&&
client_count
=
10
echo
Re6stnet client count
=
$client_count
re6stnet_name_list
=
"re6stnet-tcp re6stnet-udp"
for
((
i
=
1
;
i<
=
client_count
;
i
=
i+1
))
;
do
re6stnet_name_list
=
"
$re6stnet_name_list
re6stnet
$i
"
done
for
re6stnet_ifname
in
$re6stnet_name_list
;
do
echo
Checking interface
$re6stnet_ifname
...
if
[[
!
"
$original_connections
"
==
*
[
\
]
$re6stnet_ifname
[
\
]
*
]]
;
then
echo
Installing interface
$re6stnet_ifname
...
ip vpntap add dev
$re6stnet_ifname
||
show_error_exit
"Failed to install openvpn tap-windows driver."
echo
Interface
$re6stnet_ifname
installed.
else
echo
$re6stnet_ifname
has been installed.
fi
done
#
# Remove OpenVPN Tap-Windows Driver
#
# ip vpntap del dev re6stnet-x
#
#-------------------------------------------------
#-------------------------------------------------
# Create instance of Web Runner
# Create instance of Web Runner
#-------------------------------------------------
#-------------------------------------------------
grep
-q
"
location.reload
"
$slapos_runner_file
grep
-q
"
window.location.href
"
$slapos_runner_file
if
((
$?
))
;
then
if
((
$?
))
;
then
echo
echo
echo
Installing Web Runner ...
echo
Installing Web Runner ...
echo
echo
re6stnet_ipv6
=
$(
cat
/etc/re6stnet/re6stnet.conf |
grep
"Your subnet"
|
\
re6stnet_ipv6
=
$(
cat
/etc/re6stnet/re6stnet.conf |
grep
"Your subnet"
|
\
sed
-e
"s/^.*subnet: //g"
-e
"s/
(CN.*
\$
//g"
)
1
sed
-e
"s/^.*subnet: //g"
-e
"s/
\/
80 (CN.*
\$
/1/g"
)
echo
"Re6stnet address in this computer:
$re6stnet_ipv6
"
echo
"Re6stnet address in this computer:
$re6stnet_ipv6
"
netsh interface ipv6 show addr
$slapos_ifname
|
grep
-q
$re6stnet_ipv6
||
\
netsh interface ipv6 show addr
$slapos_ifname
level
=
normal
|
grep
-q
$re6stnet_ipv6
||
\
netsh interface ipv6 add addr
$slapos_ifname
re6stnet_ipv6
netsh interface ipv6 add addr
$slapos_ifname
$
re6stnet_ipv6
echo
Run slapformat ...
echo
Run slapformat ...
/opt/slapos/bin/slapos node format
-cv
--now
||
/opt/slapos/bin/slapos node format
-cv
--now
||
show_error_exit
"Failed to run slapos format."
show_error_exit
"Failed to run slapos format."
...
@@ -451,29 +487,30 @@ if (( $? )) ; then
...
@@ -451,29 +487,30 @@ if (( $? )) ; then
/opt/slapos/bin/slapos supply
$slaprunner_cfg
$computer_id
/opt/slapos/bin/slapos supply
$slaprunner_cfg
$computer_id
echo
"Request an instance 'Node Runner' ..."
echo
"Request an instance 'Node Runner' ..."
while
true
;
do
while
true
;
do
/opt/slapos/bin/slapos node software
/opt/slapos/bin/slapos node software
--verbose
/opt/slapos/bin/slapos node instance
/opt/slapos/bin/slapos node instance
--verbose
/opt/slapos/bin/slapos request
$slaprunner_title
$slaprunner_cfg
--node
computer_guid
=
$computer_id
&&
break
/opt/slapos/bin/slapos node report
--verbose
/opt/slapos/bin/slapos request
$client_config_file
"Node Runner"
$slaprunner_cfg
--node
computer_guid
=
$computer_id
&&
break
sleep
5
done
done
# Connection parameters of instance are:
# Connection parameters of instance are:
# {'backend_url': 'http://[2001:67c:1254:45::c5d5]:50000',
# {'backend_url': 'http://[2001:67c:1254:45::c5d5]:50000',
# 'cloud9-url': 'http://localhost:9999',
# 'cloud9-url': 'http://localhost:9999',
# 'password_recovery_code': 'e2d01c14',
# 'password_recovery_code': 'e2d01c14',
# 'ssh_command': 'ssh 2001:67c:1254:45::c5d5 -p 2222',
# 'ssh_command': 'ssh 2001:67c:1254:45::c5d5 -p 2222',
# 'url': 'http://softinst39090.host.vifib.net/'}
# 'url': 'http://softinst39090.host.vifib.net/'}
slaprunner_url
=
$(
/opt/slapos/bin/slapos request
$slaprunner_title
\
slaprunner_url
=
$(
/opt/slapos/bin/slapos request
$client_config_file
"Node Runner"
$slaprunner_cfg
--node
computer_guid
=
$computer_id
|
\
$slaprunner_cfg
--node
computer_guid
=
$computer_id
\
grep
backend_url |
sed
-e
"s/^.*': '//g"
-e
"s/',.*
$/
/g"
)
|
grep
backend_url |
sed
-e
"s/^.*': '//g"
-e
"s/',.*
$/
/g"
)
echo
Got node runner url:
$slaprunner_url
echo
Got node runner url:
$slaprunner_url
[[
-z
$slaprunner_url
]]
&&
show_error_exit
"Failed to create instance of SlapOS Web Runner."
echo
<<
EOF
>
$slapos_runner_file
cat
<<
EOF
>
$slapos_runner_file
<html>
<html>
<head><title>SlapOS Web Runner</title>
<head><title>SlapOS Web Runner</title>
<script LANGUAGE="JavaScript">
<script LANGUAGE="JavaScript">
<!--
<!--
function openwin() {
function openwin() {
location.reload("
$slaprunner_url
")
window.location.href = "
$slaprunner_url
"
}
}
//-->
//-->
</script>
</script>
...
@@ -490,7 +527,7 @@ EOF
...
@@ -490,7 +527,7 @@ EOF
for
x
in
$(
find /opt/slapgrid/
-name
slapos.cookbook-
*
.egg
)
;
do
for
x
in
$(
find /opt/slapgrid/
-name
slapos.cookbook-
*
.egg
)
;
do
echo
Apply to
$x
echo
Apply to
$x
cd
$x
cd
$x
patch
-p1
<
$patch_file
patch
-
-dry-run
-p1
<
$patch_file
&&
patch
-
p1
<
$patch_file
done
done
fi
fi
echo
echo
...
@@ -501,9 +538,9 @@ fi
...
@@ -501,9 +538,9 @@ fi
#-------------------------------------------------
#-------------------------------------------------
# Configure crontab
# Configure crontab
#-------------------------------------------------
#-------------------------------------------------
cron_file
=
/var/cron/tabs/
$(
whoami
)
cron
tab
_file
=
/var/cron/tabs/
$(
whoami
)
if
[[
!
-f
$cron_file
]]
;
then
if
[[
!
-f
$cron
tab
_file
]]
;
then
cat
<<
EOF
>
$cron_file
cat
<<
EOF
>
$cron
tab
_file
SHELL=/bin/sh
SHELL=/bin/sh
PATH=/usr/bin:/usr/sbin:/sbin:/bin
PATH=/usr/bin:/usr/sbin:/sbin:/bin
MAILTO=""
MAILTO=""
...
@@ -522,6 +559,7 @@ MAILTO=""
...
@@ -522,6 +559,7 @@ MAILTO=""
# Make sure we have only good network routes if we use VPN
# Make sure we have only good network routes if we use VPN
# * * * * * root if [ -f /etc/opt/slapos/openvpn-needed ]; then ifconfig tapVPN | grep "Scope:Global" > /dev/null ;if [
$?
= 0 ]; then ROUTES=
$(
ip
-6
r l |
grep
default |
awk
'{print $5}'
)
; for GW in
$ROUTES
; do if [ !
$GW
= tapVPN ]; then /sbin/ip -6 route del default dev
$GW
> /dev/null 2>&1;fi ;done ;fi ;fi
# * * * * * root if [ -f /etc/opt/slapos/openvpn-needed ]; then ifconfig tapVPN | grep "Scope:Global" > /dev/null ;if [
$?
= 0 ]; then ROUTES=
$(
ip
-6
r l |
grep
default |
awk
'{print $5}'
)
; for GW in
$ROUTES
; do if [ !
$GW
= tapVPN ]; then /sbin/ip -6 route del default dev
$GW
> /dev/null 2>&1;fi ;done ;fi ;fi
EOF
EOF
echo
Cron file
$crontab_file
created.
fi
fi
echo
SlapOS Node configure successfully.
echo
SlapOS Node configure successfully.
...
...
windows/scripts/slapos-node.sh
View file @
7c62a50d
...
@@ -23,11 +23,14 @@ function check_cygwin_service()
...
@@ -23,11 +23,14 @@ function check_cygwin_service()
service_account
=
"
$(
cygrunsrv
-VQ
$service_name
|
sed
-n
-e
's/^Account[ :]*//p'
)
"
||
\
service_account
=
"
$(
cygrunsrv
-VQ
$service_name
|
sed
-n
-e
's/^Account[ :]*//p'
)
"
||
\
show_error_exit
"No
$1
service install, please run Configure SlapOS to install it."
show_error_exit
"No
$1
service install, please run Configure SlapOS to install it."
service_state
=
$(
cygrunsrv
--query
$service_name
|
sed
-n
-e
's/^Current State[ :]*//p'
)
service_state
=
$(
cygrunsrv
--query
$service_name
|
sed
-n
-e
's/^Current State[ :]*//p'
)
if
[[
!
x
$service_state
==
"xRunning"
]]
;
then
if
[[
!
x
$service_state
==
"xRunning"
]]
;
then
echo
Warning: Cygwin service
$1
currnt state is
$service_state
, Running is expeted
echo
Cygwin service
$1
currnt state is
$service_state
, try to use
echo
Try to use cygrunsrv
--start
$1
to start this service
echo
\t\t
cygrunsrv
--start
$1
echo
to start this service
cygrunsrv
--start
$1
||
show_error_exit
"Failed to start service
$1
"
echo
Cygwin
$1
service is running.
fi
fi
echo
Check
$1
service OVER.
echo
Check
$1
service OVER.
}
}
...
@@ -48,6 +51,12 @@ function show_error_exit()
...
@@ -48,6 +51,12 @@ function show_error_exit()
#-------------------------------------------------
#-------------------------------------------------
slapos_ifname
=
re6stnet-lo
slapos_ifname
=
re6stnet-lo
#-------------------------------------------------
# Check cygserver, syslog-ng
#-------------------------------------------------
check_cygwin_service cygserver
check_cygwin_service syslog-ng
#-------------------------------------------------
#-------------------------------------------------
# IPv6 Connection
# IPv6 Connection
#-------------------------------------------------
#-------------------------------------------------
...
@@ -58,15 +67,19 @@ check_ipv6_connection
...
@@ -58,15 +67,19 @@ check_ipv6_connection
if
((
$?
))
;
then
if
((
$?
))
;
then
echo
"No native IPv6."
echo
"No native IPv6."
echo
Check re6stnet network ...
echo
Check re6stnet network ...
which re6stnet
>
/dev/null
||
show_error_exit
"Error: no re6stnet installed, please run Configure SlapOS first."
which re6stnet
>
/dev/null
2>&1
||
show_error_exit
"Error: no re6stnet installed, please run Configure SlapOS first."
# re6st-conf --is-needed --registry http://re6stnet.nexedi.com/
# re6st-conf --is-needed --registry http://re6stnet.nexedi.com/
# Check if babeld is running, so we guess whether re6stnet is running or not
ps
-ef
|
grep
-q
babeld.exe
ps
-ef
|
grep
-q
babeld.exe
if
((
$?
))
;
then
if
((
$?
))
;
then
echo
"Start re6stnet ..."
echo
"Start re6stnet ..."
# It need root rights to install tap-driver
# It need root rights to install tap-driver
(
cd
/etc/re6stnet
;
re6stnet @re6stnet.conf
--ovpnlog
-I
$slapos_ifname
-i
$slapos_ifname
&
)
cd
/etc/re6stnet
echo
"Start re6stent in the background OK. You can check log files in the /var/log/re6stnet"
re6stnet @re6stnet.conf
--ovpnlog
-I
$slapos_ifname
-i
$slapos_ifname
>>
/var/log/re6stnet/slapos-node.log 2>&1 &
echo
$!
>
/var/run/slapos-node-re6stnet.pid
echo
"Start re6stent (pid=
$!
) in the background OK."
echo
"You can check log files in the /var/log/slapos-node-re6stnet.log and /var/log/re6stnet."
echo
echo
"Waiting re6stent network work ..."
echo
"Waiting re6stent network work ..."
while
true
;
do
while
true
;
do
check_ipv6_connection
&&
break
check_ipv6_connection
&&
break
...
@@ -77,35 +90,28 @@ else
...
@@ -77,35 +90,28 @@ else
echo
"Native IPv6 Found."
echo
"Native IPv6 Found."
fi
fi
#-------------------------------------------------
# Check cygserver, syslog-ng
#-------------------------------------------------
check_cygwin_service cygserver
check_cygwin_service syslog-ng
#-------------------------------------------------
#-------------------------------------------------
# Format slapos node, need root right
# Format slapos node, need root right
#-------------------------------------------------
#-------------------------------------------------
[[
-f
/etc/opt/slapos/slapos.cfg
]]
||
\
[[
-f
/etc/opt/slapos/slapos.cfg
]]
||
\
show_error_exit
"Error: no node configure file found, please run Configure SlapOS first."
show_error_exit
"Error: no node configure file found, please run Configure SlapOS first."
echo
"
Run Slapos format
..."
echo
"
Formating SlapOS Node
..."
/opt/slapos/bin/slapos node format
-cv
--now
||
\
/opt/slapos/bin/slapos node format
-cv
--now
||
\
show_error_exit
"Failed to run slapos format."
show_error_exit
"Failed to run slapos format."
echo
"Format slapos node OK."
#-------------------------------------------------
#-------------------------------------------------
# Release software
# Release software
#-------------------------------------------------
#-------------------------------------------------
echo
"Releasing software ..."
echo
"Releasing software ..."
/opt/slapos/bin/slapos node software
--verbose
/opt/slapos/bin/slapos node software
--verbose
#-------------------------------------------------
#-------------------------------------------------
# Instance software
# Instance software
#-------------------------------------------------
#-------------------------------------------------
echo
"Creating instance ..."
echo
"Creating instance ..."
/opt/slapos/bin/slapos node instance
--verbose
/opt/slapos/bin/slapos node instance
--verbose
#-------------------------------------------------
#-------------------------------------------------
# Send report
# Send report
...
...
windows/scripts/slapos.iss
View file @
7c62a50d
...
@@ -3,11 +3,11 @@
...
@@ -3,11 +3,11 @@
[Setup]
[Setup]
AppName=SlapOS
AppName=SlapOS
AppVersion=0.158
AppVersion=0.158
AppVerName=SlapOS Windows 0.158.
4
AppVerName=SlapOS Windows 0.158.
5
DefaultDirName=C:\slapos
DefaultDirName=C:\slapos
DefaultGroupName=SlapOS
DefaultGroupName=SlapOS
OutputDir=D:\slapos\publish\Output
OutputDir=D:\slapos\publish\Output
OutputBaseFilename=slapos-0.158.
4-windows-x
86
OutputBaseFilename=slapos-0.158.
5-windows-i3
86
SourceDir=D:\slapos
SourceDir=D:\slapos
Uninstallable=yes
Uninstallable=yes
...
@@ -49,7 +49,7 @@ Source: "opt\git\slapos.package\windows\scripts\cyg_wscript"; DestDir: "{app}\cy
...
@@ -49,7 +49,7 @@ Source: "opt\git\slapos.package\windows\scripts\cyg_wscript"; DestDir: "{app}\cy
Source: "opt\git\slapos.package\windows\babeld\babeld.exe"; DestDir: "{app}\cygwin\usr\local\bin";
Source: "opt\git\slapos.package\windows\babeld\babeld.exe"; DestDir: "{app}\cygwin\usr\local\bin";
Source: "opt\git\slapos.package\windows\openvpn\src\openvpn\.libs\openvpn.exe"; DestDir: "{app}\cygwin\usr\local\bin";
Source: "opt\git\slapos.package\windows\openvpn\src\openvpn\.libs\openvpn.exe"; DestDir: "{app}\cygwin\usr\local\bin";
Source: "opt\openvpn\bin\
devcon.exe
"; DestDir: "{app}\cygwin\usr\local\bin";
Source: "opt\openvpn\bin\
*
"; DestDir: "{app}\cygwin\usr\local\bin";
Source: "opt\openvpn\driver\*"; DestDir: "{app}\cygwin\etc\slapos\driver";
Source: "opt\openvpn\driver\*"; DestDir: "{app}\cygwin\etc\slapos\driver";
Source: "opt\git\slapos.package\windows\scripts\init-slapos-node.sh"; DestDir: "{app}\cygwin\etc\slapos\scripts";
Source: "opt\git\slapos.package\windows\scripts\init-slapos-node.sh"; DestDir: "{app}\cygwin\etc\slapos\scripts";
...
@@ -67,8 +67,8 @@ Source: "opt\git\slapos.package\windows\docs\README.cygwin"; DestDir: "{app}"; D
...
@@ -67,8 +67,8 @@ Source: "opt\git\slapos.package\windows\docs\README.cygwin"; DestDir: "{app}"; D
[Icons]
[Icons]
Name: "{commondesktop}\SlapOS Desktop"; Filename: "https://www.slapos.org/"; IconFilename: "{app}\cygwin\etc\slapos\images\slapos.ico";
Name: "{commondesktop}\SlapOS Desktop"; Filename: "https://www.slapos.org/"; IconFilename: "{app}\cygwin\etc\slapos\images\slapos.ico";
Name: "{group}\Command Console"; Filename: "{app}\cygwin\cygtty.bat"; WorkingDir: "{app}\cygwin\opt\slapos"; IconFilename: "{app}\cygwin\etc\slapos\images\terminal.ico";
Name: "{group}\Command Console"; Filename: "{app}\cygwin\cygtty.bat"; WorkingDir: "{app}\cygwin\opt\slapos"; IconFilename: "{app}\cygwin\etc\slapos\images\terminal.ico";
Name: "{group}\Configure SlapOS"; Filename: "{app}\cygwin\bin\mintty.exe"; Parameters: "-c ~/.minttyrc -h never -t ""Configure SlapOS Node"" /etc/slapos/scripts/slapos-c
lient-config
.sh"; WorkingDir: "{app}\cygwin\bin"; IconFilename: "{app}\cygwin\etc\slapos\images\configure.ico";
Name: "{group}\Configure SlapOS"; Filename: "{app}\cygwin\bin\mintty.exe"; Parameters: "-c ~/.minttyrc -h never -t ""Configure SlapOS Node"" /etc/slapos/scripts/slapos-c
onfigure
.sh"; WorkingDir: "{app}\cygwin\bin"; IconFilename: "{app}\cygwin\etc\slapos\images\configure.ico";
Name: "{group}\Node Runner"; Filename: "
http://
{app}\cygwin\etc\slapos\scripts\slap-runner.html"; IconFilename: "{app}\cygwin\etc\slapos\images\manager.ico";
Name: "{group}\Node Runner"; Filename: "{app}\cygwin\etc\slapos\scripts\slap-runner.html"; IconFilename: "{app}\cygwin\etc\slapos\images\manager.ico";
Name: "{group}\SlapOS Desktop"; Filename: "https://www.slapos.org/"; IconFilename: "{app}\cygwin\etc\slapos\images\slapos.ico";
Name: "{group}\SlapOS Desktop"; Filename: "https://www.slapos.org/"; IconFilename: "{app}\cygwin\etc\slapos\images\slapos.ico";
Name: "{group}\SlapOS Node"; Filename: "{app}\cygwin\bin\bash.exe"; Parameters: "--login -i /etc/slapos/scripts/slapos-node.sh"; WorkingDir: "{app}\cygwin\bin"; IconFilename: "{app}\cygwin\etc\slapos\images\node.ico";
Name: "{group}\SlapOS Node"; Filename: "{app}\cygwin\bin\bash.exe"; Parameters: "--login -i /etc/slapos/scripts/slapos-node.sh"; WorkingDir: "{app}\cygwin\bin"; IconFilename: "{app}\cygwin\etc\slapos\images\node.ico";
Name: "{group}\Uninstall SlapOS"; Filename: "{uninstallexe}";
Name: "{group}\Uninstall SlapOS"; Filename: "{uninstallexe}";
...
@@ -81,7 +81,7 @@ Filename: "{app}\cygwin\bin\bash.exe"; Parameters: "--login -i /etc/slapos/scrip
...
@@ -81,7 +81,7 @@ Filename: "{app}\cygwin\bin\bash.exe"; Parameters: "--login -i /etc/slapos/scrip
Filename: "{app}\cygwin\autorebase.bat"; WorkingDir: "{app}\cygwin"; Flags: skipifdoesntexist;
Filename: "{app}\cygwin\autorebase.bat"; WorkingDir: "{app}\cygwin"; Flags: skipifdoesntexist;
[UninstallRun]
[UninstallRun]
Filename: "{app}\cygwin\bin\bash.exe"; Parameters: "--login -i /etc/slapos/scripts/pre-uninstall.sh"; WorkingDir: "{app}\cygwin\bin"; Flags: skipifdoesntexist
runhidden
;
Filename: "{app}\cygwin\bin\bash.exe"; Parameters: "--login -i /etc/slapos/scripts/pre-uninstall.sh"; WorkingDir: "{app}\cygwin\bin"; Flags: skipifdoesntexist;
[UninstallDelete]
[UninstallDelete]
Type: filesandordirs; Name: "{app}\cygwin" ;
Type: filesandordirs; Name: "{app}\cygwin" ;
...
...
windows/scripts/useradd
View file @
7c62a50d
...
@@ -55,6 +55,7 @@ while getopts "Dd:g:G:p:s:r" opt ; do
...
@@ -55,6 +55,7 @@ while getopts "Dd:g:G:p:s:r" opt ; do
USER_PASSWORD
=
$OPTARG
USER_PASSWORD
=
$OPTARG
;;
;;
s
)
s
)
USER_SHELL
=
$OPTARG
;;
;;
r
)
r
)
;;
;;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment