Make installation functional for upcoming code release
@@ -79,32 +79,7 @@ group (here as example 'yms'). The user which runs the local gui (here
|
||||
chgrp yms /var/local/yms/thumb
|
||||
chmod -R 770 /var/local/yms
|
||||
|
||||
5. Install webgui
|
||||
|
||||
5.1 Upload webgui files
|
||||
|
||||
Upload all files and directories (except the install directory) to your
|
||||
webserver.
|
||||
Disallow access to include files (.inc). There is an example _htaccess
|
||||
file.
|
||||
|
||||
5.2. Create and edit webgui config file
|
||||
|
||||
Rename sample configfile config.inc-sample:
|
||||
|
||||
mv config.inc-sample config.inc
|
||||
|
||||
Open config.inc in a text editor and fill in your database details.
|
||||
If you want to use local unix socket connection set host = socket.
|
||||
|
||||
5.3. Check file access rights for security
|
||||
|
||||
Configfile should be readable by webserver but not writeable.
|
||||
|
||||
chmod 640 config.inc
|
||||
chgrp www-data config.inc
|
||||
|
||||
6. Setup local GUI
|
||||
4. Setup local GUI
|
||||
|
||||
Create a local database user with same name as your computer user and allow
|
||||
database access with current unix credentials. E.g if your current unix user
|
||||
@@ -113,8 +88,32 @@ is "ymsgui":
|
||||
mysql> GRANT SELECT, INSERT, UPDATE, DELETE ON yms.* TO 'ymsgui'@'localhost';
|
||||
|
||||
Execute "install.sh" to install the software to your local operating system.
|
||||
This has to be done as user "root" or with "sudo".
|
||||
|
||||
Start "yms", default configuration file is automatically created
|
||||
6. Install webgui
|
||||
|
||||
6.1 Upload webgui files
|
||||
|
||||
Upload all files and directories (except the install directory) to your
|
||||
webserver.
|
||||
Disallow access to include files (.inc). There is an example _htaccess
|
||||
file.
|
||||
|
||||
6.2. Create and edit webgui config file
|
||||
|
||||
Rename sample configfile config.inc-sample:
|
||||
|
||||
mv config.inc-sample config.inc
|
||||
|
||||
Open config.inc in a text editor and fill in your database details.
|
||||
If you want to use local unix socket connection set host = socket.
|
||||
|
||||
6.3. Check file access rights for security
|
||||
|
||||
Configfile should be readable by webserver but not writeable.
|
||||
|
||||
chmod 640 config.inc
|
||||
chgrp www-data config.inc
|
||||
|
||||
7. Start using YMS
|
||||
|
||||
@@ -123,6 +122,7 @@ Start your browser and login to YMS with the initial username/password:
|
||||
captain/captain
|
||||
|
||||
Use local client:
|
||||
Start ymsgui.py
|
||||
Change the password using the local GUI before normal use.
|
||||
Start "yms", the default configuration file is automatically created
|
||||
|
||||
Change the password for the main web user using the local GUI before
|
||||
normal use.
|
||||
|
||||
@@ -11,3 +11,6 @@ To set your own passwords via console there is a helper script
|
||||
ymspass.py
|
||||
|
||||
Use it to get an SQL-statement for changing passwords.
|
||||
|
||||
For further information go to https://computerclub.hoogi.de/yms
|
||||
(currently german only)
|
||||
|
||||
@@ -11,6 +11,24 @@ LOCALEDIR="${PREFIX}/share/locale"
|
||||
|
||||
SOURCEDIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
|
||||
|
||||
if [ "$1" = "uninstall" ]; then
|
||||
echo "Uninstalling YMS..."
|
||||
|
||||
rm -rf "${LIBDIR}"
|
||||
rm -rf "${SHAREDIR}"
|
||||
rm -f "${BINDIR}/yms"
|
||||
rm -f "${DESKTOPDIR}/yms.desktop"
|
||||
rm -rf "${DOCDIR}"
|
||||
rm -f "${LOCALEDIR}/de/LC_MESSAGES/ymsgui.mo"
|
||||
|
||||
rm -f "${ICONDIR}/scalable/apps/yms.svg"
|
||||
rm -f "${ICONDIR}/48x48/apps/yms.png"
|
||||
rm -f "${ICONDIR}/64x64/apps/yms.png"
|
||||
|
||||
echo "YMS has been uninstalled successfully."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "Installing YMS..."
|
||||
echo "Source: ${SOURCEDIR}"
|
||||
echo "Prefix: ${PREFIX}"
|
||||
@@ -43,7 +61,7 @@ install -m 0644 \
|
||||
"${SOURCEDIR}/yms/ui/main.ui" \
|
||||
"${SHAREDIR}/ui/main.ui"
|
||||
cp -a \
|
||||
"${SOURCEDIR}/webgui/shapes/." \
|
||||
"${SOURCEDIR}/shapes/." \
|
||||
"${SHAREDIR}/shapes/"
|
||||
|
||||
# Documentation
|
||||
@@ -72,7 +90,7 @@ install -d "${ICONDIR}/48x48/apps"
|
||||
install -d "${ICONDIR}/64x64/apps"
|
||||
install -m 0644 \
|
||||
"${SOURCEDIR}/icons/yms.svg" \
|
||||
"${ICONDIR}/yms.svg"
|
||||
"${ICONDIR}/scalable/apps/yms.svg"
|
||||
install -m 0644 \
|
||||
"${SOURCEDIR}/icons/yms48.png" \
|
||||
"${ICONDIR}/48x48/apps/yms.png"
|
||||
|
||||
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 9.2 KiB After Width: | Height: | Size: 9.2 KiB |
|
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 8.7 KiB After Width: | Height: | Size: 8.7 KiB |
|
Before Width: | Height: | Size: 949 B After Width: | Height: | Size: 949 B |
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 6.8 KiB |
@@ -32,7 +32,7 @@ $g_timezone = 'Europe/Berlin';
|
||||
$g_locale = 'de_DE.UTF-8';
|
||||
|
||||
// vessel base shapes directory
|
||||
$g_shapedir = 'shapes';
|
||||
$g_shapedir = '/usr/local/share/yms/shapes';
|
||||
|
||||
// documents and images
|
||||
$g_doc_basepath = '/var/local/yms';
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
[Desktop Entry]
|
||||
Version=1.0
|
||||
Name=YMS
|
||||
GenericName=Yacht Management
|
||||
GenericName[de]=Yacht-Verwaltungssoftware
|
||||
Comment=Yacht Management Software
|
||||
Comment[de]=Verwaltung von Yachten, Dokumenten und technischen Daten
|
||||
Exec=/usr/local/bin/yms
|
||||
Icon=yms
|
||||
StartupNotify=true
|
||||
Terminal=false
|
||||
Type=Application
|
||||
Categories=Office;
|
||||
Keywords=Database;Documentation
|
||||
Keywords=Yacht;Boat;Management;Documentation;Database;
|
||||
Keywords[de]=Yacht;Boot;verwaltung;Dokumentation;Datenbank;
|
||||
|
||||
@@ -39,26 +39,22 @@ cfg = {
|
||||
'db': 'yms',
|
||||
'user': 'yms',
|
||||
'docpath': '/var/local/yms',
|
||||
'shapedir': 'webgui/shapes'
|
||||
'shapedir': '/usr/local/bin/yms/shapes'
|
||||
}
|
||||
|
||||
def get_share_dir():
|
||||
program_dir = os.path.dirname(os.path.abspath(__file__))
|
||||
source_ui = os.path.join(program_dir, "yms", "ui", "main.ui")
|
||||
if os.path.isfile(source_ui):
|
||||
return program_dir
|
||||
return os.path.join(
|
||||
os.path.dirname(os.path.dirname(program_dir)),
|
||||
"share",
|
||||
"yms"
|
||||
)
|
||||
def get_uiprefix():
|
||||
path = os.path.realpath(__file__)
|
||||
if path.startswith("/usr/local/"):
|
||||
return "/usr/local/share"
|
||||
if path.startswith("/usr/"):
|
||||
return "/usr/share"
|
||||
return ""
|
||||
|
||||
class Frontend():
|
||||
|
||||
def __init__(self):
|
||||
self.uipath = os.path.join(get_share_dir(), "ui")
|
||||
builder = Gtk.Builder()
|
||||
builder.add_from_file(os.path.join(self.uipath, "main.ui"))
|
||||
builder.add_from_file(os.path.join(get_uiprefix(), "yms", "ui", "main.ui"))
|
||||
builder.connect_signals(self)
|
||||
self.window = builder.get_object("wnd_main")
|
||||
gtkutils.init_named_controls(self, builder)
|
||||
@@ -89,15 +85,18 @@ class Frontend():
|
||||
combobox.load_from_dict(self.combo['vessel'], vessel, self.vid)
|
||||
|
||||
# load shape of vessel if available
|
||||
handle = Rsvg.Handle()
|
||||
self._svg = handle.new_from_file(os.path.join(get_share_dir(), "shapes", "elizabethan29.svg"))
|
||||
#self._svg = handle.new_from_file(os.path.join(sys.path[0], cfg['shapedir'], "elizabethan29.svg"))
|
||||
#viewport = Rsvg.Rectangle()
|
||||
#viewport.x = 0
|
||||
#viewport.y = 0
|
||||
#viewport.width = 320
|
||||
#viewport.height = 240
|
||||
#self._svg.render_document(ctx, viewport)
|
||||
if self.vid > 0:
|
||||
db.cur.execute("SELECT shapefile FROM vessel WHERE vid=%s", (self.vid, ))
|
||||
filename = db.cur.fetchone()[0]
|
||||
handle = Rsvg.Handle()
|
||||
self._svg = handle.new_from_file(os.path.join(cfg['shapedir'], filename))
|
||||
#self._svg = handle.new_from_file(os.path.join(sys.path[0], cfg['shapedir'], "elizabethan29.svg"))
|
||||
#viewport = Rsvg.Rectangle()
|
||||
#viewport.x = 0
|
||||
#viewport.y = 0
|
||||
#viewport.width = 320
|
||||
#viewport.height = 240
|
||||
#self._svg.render_document(ctx, viewport)
|
||||
|
||||
# combos
|
||||
roles = {'captain': 'Captain', 'helmsman': 'Helmsman', 'sailor': 'Sailor'}
|
||||
|
||||