Compare commits

..

2 Commits

Author SHA1 Message Date
Michael Green
3366d926f4 Unraid compatible single container docker image (#390)
See https://github.com/gaseous-project/unraid-template for an Unraid XML
template.
2024-07-12 15:43:02 +10:00
Michael Green
6d7f6f63c6 Resolved an error in the new logging cleanup (#389) 2024-07-10 11:53:37 +10:00
6 changed files with 41 additions and 18 deletions

View File

@@ -27,10 +27,19 @@ jobs:
with: with:
username: ${{ secrets.DOCKERHUB_USERNAME }} username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }} password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push - name: Build and push standard image
uses: docker/build-push-action@v5 uses: docker/build-push-action@v6
with: with:
context: . context: .
file: ./build/Dockerfile
platforms: linux/amd64,linux/arm64 platforms: linux/amd64,linux/arm64
push: true push: true
tags: gaseousgames/test:latest tags: gaseousgames/test:latest
- name: Build and push image with embedded mariadb
uses: docker/build-push-action@v6
with:
context: .
file: ./build/Dockerfile-EmbeddedDB
platforms: linux/amd64,linux/arm64
push: true
tags: gaseousgames/test:latest-embeddeddb

View File

@@ -3,10 +3,11 @@
# create the user # create the user
echo "Creating user gaseous with UID ${PUID} and GID ${PGID}" echo "Creating user gaseous with UID ${PUID} and GID ${PGID}"
groupadd -g ${PGID} gaseous groupadd -g ${PGID} gaseous
useradd -u ${PUID} -g ${PGID} -m gaseous -G sudo useradd -u ${PUID} -g ${PGID} -m gaseous -d /home/gaseous -G sudo
usermod -p "*" gaseous usermod -p "*" gaseous
mkdir -p /home/gaseous/.gaseous-server /var/lib/mysql mkdir -p /home/gaseous/.gaseous-server /var/lib/mysql /var/log/mariadb /run/mysqld
chown -R ${PUID}:${PGID} /App /home/gaseous/.gaseous-server /var/lib/mysql /run/mysqld chown -R ${PUID} /App /home/gaseous/.gaseous-server /var/lib/mysql /var/log/mariadb /run/mysqld
chgrp -R ${PGID} /App /home/gaseous/.gaseous-server /var/lib/mysql /var/log/mariadb /run/mysqld
# Start supervisord and services # Start supervisord and services
/usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf

View File

@@ -1,5 +1,8 @@
#!/bin/sh #!/bin/sh
# install the database
/usr/bin/mariadb-install-db --datadir=/var/lib/mysql --user=gaseous
# start the database server without network or grant tables # start the database server without network or grant tables
/usr/sbin/mariadbd --datadir=/var/lib/mysql --skip-grant-tables --skip-networking & /usr/sbin/mariadbd --datadir=/var/lib/mysql --skip-grant-tables --skip-networking &
@@ -7,7 +10,7 @@
sleep 5 sleep 5
# change the root password # change the root password
mariadb -u root -e "FLUSH PRIVILEGES; ALTER USER 'root'@'localhost' IDENTIFIED BY '$MARIADB_ROOT_PASSWORD'; FLUSH PRIVILEGES;" mariadb -u root -e "FLUSH PRIVILEGES; ALTER USER 'root'@'localhost' IDENTIFIED BY '$MARIADB_ROOT_PASSWORD'; ALTER USER 'gaseous'@'localhost' IDENTIFIED BY '$MARIADB_ROOT_PASSWORD'; FLUSH PRIVILEGES; SHUTDOWN;"
# stop the server # stop the server
sleep 5 sleep 5

View File

@@ -1,4 +1,5 @@
[supervisord] [supervisord]
user=root
nodaemon=true nodaemon=true
logfile=/var/log/supervisord/supervisord.log logfile=/var/log/supervisord/supervisord.log
logfile_maxbytes=50 logfile_maxbytes=50
@@ -28,6 +29,7 @@ stdout_logfile_maxbytes=0
[program:gaseous-server] [program:gaseous-server]
user=gaseous user=gaseous
command=dotnet /App/gaseous-server.dll command=dotnet /App/gaseous-server.dll
environment=HOME="/home/gaseous",USER="gaseous"
autostart=true autostart=true
autorestart=true autorestart=true
redirect_stderr=true redirect_stderr=true

View File

@@ -38,10 +38,10 @@ namespace gaseous_server.Classes
long deletedCount = 1; long deletedCount = 1;
long deletedEventCount = 0; long deletedEventCount = 0;
long maxLoops = 1000; long maxLoops = 1000;
sql = "DELETE FROM ServerLogs WHERE EventTime < @EventRetentionDate LIMIT 1000; SELECT ROW_COUNT() AS Count;";
dbDict.Add("EventRetentionDate", DateTime.UtcNow.AddDays(Config.LoggingConfiguration.LogRetention * -1));
while (deletedCount > 0) while (deletedCount > 0)
{ {
sql = "DELETE FROM ServerLogs WHERE EventTime < @EventRetentionDate LIMIT 1000; SELECT ROW_COUNT() AS Count;";
dbDict.Add("EventRetentionDate", DateTime.UtcNow.AddDays(Config.LoggingConfiguration.LogRetention * -1));
DataTable deletedCountTable = db.ExecuteCMD(sql, dbDict); DataTable deletedCountTable = db.ExecuteCMD(sql, dbDict);
deletedCount = (long)deletedCountTable.Rows[0][0]; deletedCount = (long)deletedCountTable.Rows[0][0];
deletedEventCount += deletedCount; deletedEventCount += deletedCount;

View File

@@ -5,15 +5,17 @@
<table style="width: 100%;"> <table style="width: 100%;">
<tr> <tr>
<th style="width: 20%;">Home Page</th> <th style="width: 20%;">Home Page</th>
<td><a href="https://github.com/gaseous-project/gaseous-server" class="romlink">https://github.com/gaseous-project/gaseous-server</a></td> <td><a href="https://github.com/gaseous-project/gaseous-server"
class="romlink">https://github.com/gaseous-project/gaseous-server</a></td>
<td rowspan="5" style="text-align: center; width: 128px;"> <td rowspan="5" style="text-align: center; width: 128px;">
<img src="/images/logo.png" style="display: block; margin: 20px auto; width: 100px;" /> <img src="/images/logo.png" style="display: block; margin: 20px auto; width: 100px;" />
<span style="display: block;">The Gaseous logo was designed by Tom2.0</span> <span style="display: block;">The Gaseous logo was designed by Tom1243</span>
</td> </td>
</tr> </tr>
<tr> <tr>
<th>Bugs and Feature Requests</th> <th>Bugs and Feature Requests</th>
<td><a href="https://github.com/gaseous-project/gaseous-server/issues" class="romlink">https://github.com/gaseous-project/gaseous-server/issues</a></td> <td><a href="https://github.com/gaseous-project/gaseous-server/issues"
class="romlink">https://github.com/gaseous-project/gaseous-server/issues</a></td>
</tr> </tr>
<tr> <tr>
<th>Join our Discord</th> <th>Join our Discord</th>
@@ -33,21 +35,24 @@
</td> </td>
</tr> </tr>
<tr> <tr>
<td style="text-align: center;"><a href="https://github.com/EmulatorJS/EmulatorJS" target="_blank"><img src="/images/EmulatorJS.png" style="height: 36px;" /></a></td> <td style="text-align: center;"><a href="https://github.com/EmulatorJS/EmulatorJS" target="_blank"><img
src="/images/EmulatorJS.png" style="height: 36px;" /></a></td>
<td colspan="3"> <td colspan="3">
The EmulatorJS Project<br /> The EmulatorJS Project<br />
<a href="https://github.com/EmulatorJS/EmulatorJS" target="_blank" class="romlink">https://github.com/EmulatorJS/EmulatorJS</a> <a href="https://github.com/EmulatorJS/EmulatorJS" target="_blank"
class="romlink">https://github.com/EmulatorJS/EmulatorJS</a>
</td> </td>
</tr> </tr>
<tr> <tr>
<td colspan="3"> <td colspan="3">
<h3>Data Sources</h2> <h3>Data Sources</h2>
<h4>Game data</h4> <h4>Game data</h4>
</td> </td>
</tr> </tr>
<tr> <tr>
<td style="text-align: center;"> <td style="text-align: center;">
<a href="https://www.igdb.com/" target="_blank"><img src="/images/IGDB_logo.svg" style="filter: invert(100%); height: 36px;" /></a> <a href="https://www.igdb.com/" target="_blank"><img src="/images/IGDB_logo.svg"
style="filter: invert(100%); height: 36px;" /></a>
</td> </td>
<td colspan="2"> <td colspan="2">
The Internet Game Database<br /> The Internet Game Database<br />
@@ -61,7 +66,8 @@
</tr> </tr>
<tr> <tr>
<td style="text-align: center;"> <td style="text-align: center;">
<a href="https://www.tosecdev.org/" target="_blank"><img src="/images/TOSEC_logo.gif" style="height: 36px;" /></a> <a href="https://www.tosecdev.org/" target="_blank"><img src="/images/TOSEC_logo.gif"
style="height: 36px;" /></a>
</td> </td>
<td colspan="2"> <td colspan="2">
The Old School Emulation Center<br /> The Old School Emulation Center<br />
@@ -70,11 +76,13 @@
</tr> </tr>
<tr> <tr>
<td style="text-align: center;"> <td style="text-align: center;">
<a href="https://www.progettosnaps.net/index.php" target="_blank"><img src="/images/ProgettoSnaps.gif" style="height: 36px;" /></a> <a href="https://www.progettosnaps.net/index.php" target="_blank"><img src="/images/ProgettoSnaps.gif"
style="height: 36px;" /></a>
</td> </td>
<td colspan="2"> <td colspan="2">
Progetto-Snaps<br /> Progetto-Snaps<br />
<a href="https://www.progettosnaps.net/index.php" target="_blank" class="romlink">https://www.progettosnaps.net/index.php</a> <a href="https://www.progettosnaps.net/index.php" target="_blank"
class="romlink">https://www.progettosnaps.net/index.php</a>
</td> </td>
</tr> </tr>
</table> </table>