Make installation functional for upcoming code release

This commit is contained in:
2026-08-18 09:04:08 +02:00
parent 28a4b2d8d3
commit fb5705ada0
14 changed files with 79 additions and 55 deletions
+29 -29
View File
@@ -79,32 +79,7 @@ group (here as example 'yms'). The user which runs the local gui (here
chgrp yms /var/local/yms/thumb chgrp yms /var/local/yms/thumb
chmod -R 770 /var/local/yms chmod -R 770 /var/local/yms
5. Install webgui 4. Setup local GUI
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
Create a local database user with same name as your computer user and allow 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 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'; mysql> GRANT SELECT, INSERT, UPDATE, DELETE ON yms.* TO 'ymsgui'@'localhost';
Execute "install.sh" to install the software to your local operating system. 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 7. Start using YMS
@@ -123,6 +122,7 @@ Start your browser and login to YMS with the initial username/password:
captain/captain captain/captain
Use local client: Use local client:
Start ymsgui.py Start "yms", the default configuration file is automatically created
Change the password using the local GUI before normal use.
Change the password for the main web user using the local GUI before
normal use.
+3
View File
@@ -11,3 +11,6 @@ To set your own passwords via console there is a helper script
ymspass.py ymspass.py
Use it to get an SQL-statement for changing passwords. Use it to get an SQL-statement for changing passwords.
For further information go to https://computerclub.hoogi.de/yms
(currently german only)
+20 -2
View File
@@ -11,6 +11,24 @@ LOCALEDIR="${PREFIX}/share/locale"
SOURCEDIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) 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 "Installing YMS..."
echo "Source: ${SOURCEDIR}" echo "Source: ${SOURCEDIR}"
echo "Prefix: ${PREFIX}" echo "Prefix: ${PREFIX}"
@@ -43,7 +61,7 @@ install -m 0644 \
"${SOURCEDIR}/yms/ui/main.ui" \ "${SOURCEDIR}/yms/ui/main.ui" \
"${SHAREDIR}/ui/main.ui" "${SHAREDIR}/ui/main.ui"
cp -a \ cp -a \
"${SOURCEDIR}/webgui/shapes/." \ "${SOURCEDIR}/shapes/." \
"${SHAREDIR}/shapes/" "${SHAREDIR}/shapes/"
# Documentation # Documentation
@@ -72,7 +90,7 @@ install -d "${ICONDIR}/48x48/apps"
install -d "${ICONDIR}/64x64/apps" install -d "${ICONDIR}/64x64/apps"
install -m 0644 \ install -m 0644 \
"${SOURCEDIR}/icons/yms.svg" \ "${SOURCEDIR}/icons/yms.svg" \
"${ICONDIR}/yms.svg" "${ICONDIR}/scalable/apps/yms.svg"
install -m 0644 \ install -m 0644 \
"${SOURCEDIR}/icons/yms48.png" \ "${SOURCEDIR}/icons/yms48.png" \
"${ICONDIR}/48x48/apps/yms.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

+1 -1
View File
@@ -32,7 +32,7 @@ $g_timezone = 'Europe/Berlin';
$g_locale = 'de_DE.UTF-8'; $g_locale = 'de_DE.UTF-8';
// vessel base shapes directory // vessel base shapes directory
$g_shapedir = 'shapes'; $g_shapedir = '/usr/local/share/yms/shapes';
// documents and images // documents and images
$g_doc_basepath = '/var/local/yms'; $g_doc_basepath = '/var/local/yms';
+5 -1
View File
@@ -1,11 +1,15 @@
[Desktop Entry] [Desktop Entry]
Version=1.0 Version=1.0
Name=YMS Name=YMS
GenericName=Yacht Management
GenericName[de]=Yacht-Verwaltungssoftware
Comment=Yacht Management Software Comment=Yacht Management Software
Comment[de]=Verwaltung von Yachten, Dokumenten und technischen Daten
Exec=/usr/local/bin/yms Exec=/usr/local/bin/yms
Icon=yms Icon=yms
StartupNotify=true StartupNotify=true
Terminal=false Terminal=false
Type=Application Type=Application
Categories=Office; Categories=Office;
Keywords=Database;Documentation Keywords=Yacht;Boat;Management;Documentation;Database;
Keywords[de]=Yacht;Boot;verwaltung;Dokumentation;Datenbank;
+13 -14
View File
@@ -39,26 +39,22 @@ cfg = {
'db': 'yms', 'db': 'yms',
'user': 'yms', 'user': 'yms',
'docpath': '/var/local/yms', 'docpath': '/var/local/yms',
'shapedir': 'webgui/shapes' 'shapedir': '/usr/local/bin/yms/shapes'
} }
def get_share_dir(): def get_uiprefix():
program_dir = os.path.dirname(os.path.abspath(__file__)) path = os.path.realpath(__file__)
source_ui = os.path.join(program_dir, "yms", "ui", "main.ui") if path.startswith("/usr/local/"):
if os.path.isfile(source_ui): return "/usr/local/share"
return program_dir if path.startswith("/usr/"):
return os.path.join( return "/usr/share"
os.path.dirname(os.path.dirname(program_dir)), return ""
"share",
"yms"
)
class Frontend(): class Frontend():
def __init__(self): def __init__(self):
self.uipath = os.path.join(get_share_dir(), "ui")
builder = Gtk.Builder() 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) builder.connect_signals(self)
self.window = builder.get_object("wnd_main") self.window = builder.get_object("wnd_main")
gtkutils.init_named_controls(self, builder) gtkutils.init_named_controls(self, builder)
@@ -89,8 +85,11 @@ class Frontend():
combobox.load_from_dict(self.combo['vessel'], vessel, self.vid) combobox.load_from_dict(self.combo['vessel'], vessel, self.vid)
# load shape of vessel if available # load shape of vessel if available
if self.vid > 0:
db.cur.execute("SELECT shapefile FROM vessel WHERE vid=%s", (self.vid, ))
filename = db.cur.fetchone()[0]
handle = Rsvg.Handle() 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(cfg['shapedir'], filename))
#self._svg = handle.new_from_file(os.path.join(sys.path[0], cfg['shapedir'], "elizabethan29.svg")) #self._svg = handle.new_from_file(os.path.join(sys.path[0], cfg['shapedir'], "elizabethan29.svg"))
#viewport = Rsvg.Rectangle() #viewport = Rsvg.Rectangle()
#viewport.x = 0 #viewport.x = 0