This commit is contained in:
@@ -69,7 +69,8 @@
|
|||||||
- I guess this way it's reversible if there is an issue but I don't see code to handle any issues
|
- I guess this way it's reversible if there is an issue but I don't see code to handle any issues
|
||||||
- https://github.com/discourse/discourse/tree/master/lib/backup_restore
|
- https://github.com/discourse/discourse/tree/master/lib/backup_restore
|
||||||
- Also seems to have some capacity to send it to an AWS bitbucket or some thing, maybe an online integration with dropbox or other would be nice
|
- Also seems to have some capacity to send it to an AWS bitbucket or some thing, maybe an online integration with dropbox or other would be nice
|
||||||
|
MORE DOCKER AND DISCOURSE STUFF
|
||||||
|
https://github.com/discourse/discourse_docker
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -6,17 +6,57 @@
|
|||||||
|
|
||||||
TODO: post to server and test
|
TODO: post to server and test
|
||||||
|
|
||||||
TODO: restrict server so randos can't login since the client now has all the logins helpfully pre-loaded on it
|
|
||||||
not sure how to do that and still support phone via cellular network or other people's wifi from logging in
|
|
||||||
Firewall settings I guess of some kind or maybe require a manual edit to the password, like add a 1 to the end of all of them or something?
|
|
||||||
|
|
||||||
todo: add backup turn off setting
|
Backup testing on linux:
|
||||||
environment variable
|
|
||||||
|
Result of the backup now button:
|
||||||
|
2020-06-06 18:06:22.4172|ERROR|CoreJobBackup|RunProgram error running command:pg_dump --dbname=postgresql://postgres:letmein@postgresserver:5432/AyaNova -Fc > /var/lib/ayanova/files/backup/manual-db-20200606180622413.backup=>System.ComponentModel.Win32Exception (2): No such file or directory
|
||||||
|
at System.Diagnostics.Process.ForkAndExecProcess(String filename, String[] argv, String[] envp, String cwd, Boolean redirectStdin, Boolean redirectStdout, Boolean redirectStderr, Boolean setCredentials, UInt32 userId, UInt32 groupId, UInt32[] groups, Int32& stdinFd, Int32& stdoutFd, Int32& stderrFd, Boolean usesTerminal, Boolean throwOnNoExec)
|
||||||
|
at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
|
||||||
|
at System.Diagnostics.Process.Start()
|
||||||
|
at AyaNova.Util.RunProgram.RunLinuxBash(String cmd, String arguments, Int32 waitForExitTimeOut) in C:\data\code\raven\server\AyaNova\util\RunProgram.cs:line 96
|
||||||
|
at AyaNova.Util.RunProgram.Run(String cmd, String arguments, ILogger log, Int32 waitForExitTimeOut) in C:\data\code\raven\server\AyaNova\util\RunProgram.cs:line 28
|
||||||
|
2020-06-06 18:06:22.4365|ERROR|CoreJobBackup|Backup failed=>System.ComponentModel.Win32Exception (2): No such file or directory
|
||||||
|
at AyaNova.Util.RunProgram.Run(String cmd, String arguments, ILogger log, Int32 waitForExitTimeOut) in C:\data\code\raven\server\AyaNova\util\RunProgram.cs:line 37
|
||||||
|
at AyaNova.Biz.CoreJobBackup.DoWorkAsync(Boolean OnDemand) in C:\data\code\raven\server\AyaNova\generator\CoreJobBackup.cs:line 112
|
||||||
|
2020-06-06 18:06:22.4399|ERROR|JobsBiz|ProcessJobs::Exclusive -> job Backup (on demand) failed with exception=>System.ComponentModel.Win32Exception (2): No such file or directory
|
||||||
|
at AyaNova.Biz.CoreJobBackup.DoWorkAsync(Boolean OnDemand) in C:\data\code\raven\server\AyaNova\generator\CoreJobBackup.cs:line 112
|
||||||
|
at AyaNova.Biz.CoreJobBackup.DoWorkAsync(Boolean OnDemand) in C:\data\code\raven\server\AyaNova\generator\CoreJobBackup.cs:line 112
|
||||||
|
at AyaNova.Biz.JobsBiz.ProcessJobAsync(OpsJob job) in C:\data\code\raven\server\AyaNova\biz\JobsBiz.cs:line 268
|
||||||
|
at AyaNova.Biz.JobsBiz.ProcessJobsAsync() in C:\data\code\raven\server\AyaNova\biz\JobsBiz.cs:line 173
|
||||||
|
|
||||||
|
todo: backup
|
||||||
|
Change pg_dump stuff to just generic command to call for backup
|
||||||
|
add switch somewhere to "automatic backup" so can turn off in event of externally done backup
|
||||||
|
this will take backup processing out of the generator loop
|
||||||
|
but keep the backup ui so even if external, can download the backup files
|
||||||
|
|
||||||
|
Include pg_dump into AyaNova container so it can call it directly?
|
||||||
|
https://docs.docker.com/engine/examples/postgresql_service/
|
||||||
|
https://docs.docker.com/engine/examples/dotnetcore/
|
||||||
|
sudo apt install postgresql-client
|
||||||
|
Alpine linux install postgres client:
|
||||||
|
apk add postgresql-client
|
||||||
|
Alpine linux enter container and run shell from docker:
|
||||||
|
docker run -it [container_id] /bin/ash
|
||||||
|
Manual backup command as it's run by AyaNova:
|
||||||
|
pg_dump --dbname=postgresql://postgres:letmein@postgresserver:5432/AyaNova -Fc > /var/lib/ayanova/files/backup/manual-db-20200606184524472.backup
|
||||||
|
|
||||||
|
|
||||||
|
todo: make docker cheat sheet
|
||||||
|
|
||||||
todo: add backup master time out setting
|
todo: add backup master time out setting
|
||||||
environment variable
|
environment variable
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
TODO: restrict server so randos can't login since the client now has all the logins helpfully pre-loaded on it
|
||||||
|
not sure how to do that and still support phone via cellular network or other people's wifi from logging in
|
||||||
|
Firewall settings I guess of some kind or maybe require a manual edit to the password, like add a 1 to the end of all of them or something?
|
||||||
|
|
||||||
todo: it would be very handy to say the least to be able to run raven locally in linux for testing here
|
todo: it would be very handy to say the least to be able to run raven locally in linux for testing here
|
||||||
maybe virtual box, but I sure don't want to fuck up things, maybe need another computer, some cheap shitbox can test on?
|
maybe virtual box, but I sure don't want to fuck up things, maybe need another computer, some cheap shitbox can test on?
|
||||||
is it slowing down development is really the only question I guess
|
is it slowing down development is really the only question I guess
|
||||||
|
|||||||
9
dist/docker/linux-x64/docker-compose.yml
vendored
9
dist/docker/linux-x64/docker-compose.yml
vendored
@@ -2,15 +2,6 @@ version: '2'
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
|
|
||||||
metrics:
|
|
||||||
image: philhawthorne/docker-influxdb-grafana:latest
|
|
||||||
restart: always
|
|
||||||
ports:
|
|
||||||
- "3003:3003"
|
|
||||||
- "3004:8083"
|
|
||||||
- "8086:8086"
|
|
||||||
- "22022:22"
|
|
||||||
|
|
||||||
postgresserver:
|
postgresserver:
|
||||||
image: postgres:alpine
|
image: postgres:alpine
|
||||||
restart: always
|
restart: always
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ namespace AyaNova.Util
|
|||||||
}
|
}
|
||||||
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
|
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
|
||||||
{
|
{
|
||||||
return RunLinuxBash(cmd, arguments, waitForExitTimeOut);
|
return RunLinuxShell(cmd, arguments, waitForExitTimeOut);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
@@ -77,7 +77,7 @@ namespace AyaNova.Util
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string RunLinuxBash(string cmd, string arguments, int waitForExitTimeOut = int.MaxValue)
|
private static string RunLinuxShell(string cmd, string arguments, int waitForExitTimeOut = int.MaxValue)
|
||||||
{
|
{
|
||||||
var escapedArgs = $"{cmd} {arguments}".Replace("\"", "\\\"");
|
var escapedArgs = $"{cmd} {arguments}".Replace("\"", "\\\"");
|
||||||
|
|
||||||
@@ -85,7 +85,7 @@ namespace AyaNova.Util
|
|||||||
{
|
{
|
||||||
process.StartInfo = new ProcessStartInfo
|
process.StartInfo = new ProcessStartInfo
|
||||||
{
|
{
|
||||||
FileName = "/bin/bash",
|
FileName = "/bin/sh",
|
||||||
Arguments = $"-c \"{escapedArgs}\"",
|
Arguments = $"-c \"{escapedArgs}\"",
|
||||||
RedirectStandardOutput = true,
|
RedirectStandardOutput = true,
|
||||||
UseShellExecute = false,
|
UseShellExecute = false,
|
||||||
|
|||||||
Reference in New Issue
Block a user