mirror of
				https://github.com/aclindsa/moneygo.git
				synced 2025-10-30 17:33:26 -04:00 
			
		
		
		
	Add tests for reading config files
This commit is contained in:
		
							
								
								
									
										42
									
								
								internal/config/testdata/generate_certs_config.ini
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										42
									
								
								internal/config/testdata/generate_certs_config.ini
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,42 @@ | ||||
| [moneygo] | ||||
|  | ||||
| # Whether to serve as FastCGI (default is false, for HTTPS) | ||||
| fcgi = false | ||||
|  | ||||
| # Port on which to serve HTTPS or FCGI | ||||
| port = 8443 | ||||
|  | ||||
| # Base directory for serving files out of. This should point to the root of the | ||||
| # moneygo source directory | ||||
| base-directory = src/github.com/aclindsa/moneygo/ | ||||
|  | ||||
| # Type of database being used (sqlite3, mysql, postgres) | ||||
| db-type = sqlite3 | ||||
|  | ||||
| # 'Data Source Name' for the database being used. This is driver-specific. See | ||||
| # the following examples and external resources for more information about | ||||
| # configuring this for your particular database configuration: | ||||
| # | ||||
| #     Sqlite example DSN: "file:moneygo.sqlite?cache=shared&mode=rwc" | ||||
| #    MySQL documentation: https://github.com/go-sql-driver/mysql/#dsn-data-source-name | ||||
| #            example DSN: "user:password@tcp(localhost)/dbname&parseTime=true" | ||||
| #                         (Note: MySQL DSN's *must* include the | ||||
| #                          "parseTime=true" parameter) | ||||
| # Postgres documentation: https://godoc.org/github.com/lib/pq | ||||
| #            example DSN: "postgres://user:password@localhost/dbname" | ||||
| db-dsn = file:moneygo.sqlite?cache=shared&mode=rwc | ||||
|  | ||||
|  | ||||
| [https] | ||||
| # If 'fcgi = false', the following paths to a SSL certificate and the paired | ||||
| # private key are used when serving HTTPS | ||||
| cert-file = ./local_cert.pem | ||||
| key-file = ./local_key.pem | ||||
|  | ||||
| # Attempt to generate self-signed certificates if the certificate files | ||||
| # specified above are missing or invalid. This should *never* be set to 'true' | ||||
| # for any environment where security is important (including but not limited to | ||||
| # production systems) | ||||
| generate-certs-if-absent = true | ||||
| # A CSV list of hostnames to generate the above certs for | ||||
| generate-certs-hosts = example.com | ||||
							
								
								
									
										42
									
								
								internal/config/testdata/postgres_fcgi_config.ini
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										42
									
								
								internal/config/testdata/postgres_fcgi_config.ini
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,42 @@ | ||||
| [moneygo] | ||||
|  | ||||
| # Whether to serve as FastCGI (default is false, for HTTPS) | ||||
| fcgi = true | ||||
|  | ||||
| # Port on which to serve HTTPS or FCGI | ||||
| port = 9001 | ||||
|  | ||||
| # Base directory for serving files out of. This should point to the root of the | ||||
| # moneygo source directory | ||||
| base-directory = src/github.com/aclindsa/moneygo/ | ||||
|  | ||||
| # Type of database being used (sqlite3, mysql, postgres) | ||||
| db-type = postgres | ||||
|  | ||||
| # 'Data Source Name' for the database being used. This is driver-specific. See | ||||
| # the following examples and external resources for more information about | ||||
| # configuring this for your particular database configuration: | ||||
| # | ||||
| #     Sqlite example DSN: "file:moneygo.sqlite?cache=shared&mode=rwc" | ||||
| #    MySQL documentation: https://github.com/go-sql-driver/mysql/#dsn-data-source-name | ||||
| #            example DSN: "user:password@tcp(localhost)/dbname&parseTime=true" | ||||
| #                         (Note: MySQL DSN's *must* include the | ||||
| #                          "parseTime=true" parameter) | ||||
| # Postgres documentation: https://godoc.org/github.com/lib/pq | ||||
| #            example DSN: "postgres://user:password@localhost/dbname" | ||||
| db-dsn = postgres://moneygo_test@localhost/moneygo_test?sslmode=disable | ||||
|  | ||||
|  | ||||
| [https] | ||||
| # If 'fcgi = false', the following paths to a SSL certificate and the paired | ||||
| # private key are used when serving HTTPS | ||||
| cert-file = ./cert.pem | ||||
| key-file = ./key.pem | ||||
|  | ||||
| # Attempt to generate self-signed certificates if the certificate files | ||||
| # specified above are missing or invalid. This should *never* be set to 'true' | ||||
| # for any environment where security is important (including but not limited to | ||||
| # production systems) | ||||
| generate-certs-if-absent = false | ||||
| # A CSV list of hostnames to generate the above certs for | ||||
| generate-certs-hosts = localhost,127.0.0.1 | ||||
							
								
								
									
										42
									
								
								internal/config/testdata/sqlite_https_config.ini
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										42
									
								
								internal/config/testdata/sqlite_https_config.ini
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,42 @@ | ||||
| [moneygo] | ||||
|  | ||||
| # Whether to serve as FastCGI (default is false, for HTTPS) | ||||
| fcgi = false | ||||
|  | ||||
| # Port on which to serve HTTPS or FCGI | ||||
| port = 8443 | ||||
|  | ||||
| # Base directory for serving files out of. This should point to the root of the | ||||
| # moneygo source directory | ||||
| base-directory = src/github.com/aclindsa/moneygo/ | ||||
|  | ||||
| # Type of database being used (sqlite3, mysql, postgres) | ||||
| db-type = sqlite3 | ||||
|  | ||||
| # 'Data Source Name' for the database being used. This is driver-specific. See | ||||
| # the following examples and external resources for more information about | ||||
| # configuring this for your particular database configuration: | ||||
| # | ||||
| #     Sqlite example DSN: "file:moneygo.sqlite?cache=shared&mode=rwc" | ||||
| #    MySQL documentation: https://github.com/go-sql-driver/mysql/#dsn-data-source-name | ||||
| #            example DSN: "user:password@tcp(localhost)/dbname&parseTime=true" | ||||
| #                         (Note: MySQL DSN's *must* include the | ||||
| #                          "parseTime=true" parameter) | ||||
| # Postgres documentation: https://godoc.org/github.com/lib/pq | ||||
| #            example DSN: "postgres://user:password@localhost/dbname" | ||||
| db-dsn = file:moneygo.sqlite?cache=shared&mode=rwc | ||||
|  | ||||
|  | ||||
| [https] | ||||
| # If 'fcgi = false', the following paths to a SSL certificate and the paired | ||||
| # private key are used when serving HTTPS | ||||
| cert-file = ./cert.pem | ||||
| key-file = ./key.pem | ||||
|  | ||||
| # Attempt to generate self-signed certificates if the certificate files | ||||
| # specified above are missing or invalid. This should *never* be set to 'true' | ||||
| # for any environment where security is important (including but not limited to | ||||
| # production systems) | ||||
| generate-certs-if-absent = false | ||||
| # A CSV list of hostnames to generate the above certs for | ||||
| generate-certs-hosts = localhost,127.0.0.1 | ||||
		Reference in New Issue
	
	Block a user