]> git.lizzy.rs Git - cheatdb.git/blobdiff - setup.py
Fix moderators being able to change emails of admins
[cheatdb.git] / setup.py
index 49cd002de360837ddd17b433a4a55fcf5ff9f637..901bbc86ae98ecf9cd68ff8e80ef851de993100b 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -1,5 +1,8 @@
 import os, sys, datetime
 
+if not "FLASK_CONFIG" in os.environ:
+       os.environ["FLASK_CONFIG"] = "../config.cfg"
+
 delete_db = len(sys.argv) >= 2 and sys.argv[1].strip() == "-d"
 
 if delete_db and os.path.isfile("db.sqlite"):
@@ -14,21 +17,82 @@ if not os.path.isfile("db.sqlite"):
 
        ruben = User("rubenwardy")
        ruben.github_username = "rubenwardy"
-       ruben.rank = UserRank.EDITOR
+       ruben.forums_username = "rubenwardy"
+       ruben.rank = UserRank.ADMIN
        db.session.add(ruben)
 
+
+       ez = User("Shara")
+       ez.github_username = "Ezhh"
+       ez.forums_username = "Shara"
+       ez.rank = UserRank.EDITOR
+       db.session.add(ez)
+
+       not1 = Notification(ruben, ez, "Awards approved", "/packages/rubenwardy/awards/")
+       db.session.add(not1)
+
        jeija = User("Jeija")
        jeija.github_username = "Jeija"
        db.session.add(jeija)
 
+       sam = User("fillthisinlater")
+       sam.github_username = "fillthisinlater"
+       sam.rank = UserRank.EDITOR
+       db.session.add(sam)
+
+       tags = {}
+       for tag in ["Inventory", "Mapgen", "Building", \
+                       "Mobs and NPCs", "Tools", "Player effects", \
+                       "Environment", "Transport", "Maintenance", "Plants and farming", \
+                       "PvP", "PvE", "Survival", "Creative", "Puzzle", "Multiplayer", "Singleplayer"]:
+               row = Tag(tag)
+               tags[row.name] = row
+               db.session.add(row)
+
+
+       licenses = {}
+       for license in ["GPLv2.1", "GPLv3", "LGPLv2.1", "LGPLv3", "AGPLv2.1", "AGPLv3",
+                                       "Apache", "BSD 3-Clause", "BSD 2-Clause", "CC0", "CC-BY-SA",
+                                       "CC-BY", "CC-BY-NC-SA", "MIT", "ZLib"]:
+               row = License(license)
+               licenses[row.name] = row
+               db.session.add(row)
+
+
+       mod = Package()
+       mod.approved = True
+       mod.name = "alpha"
+       mod.title = "Alpha Test"
+       mod.license = licenses["MIT"]
+       mod.type = PackageType.MOD
+       mod.author = ruben
+       mod.tags.append(tags["mapgen"])
+       mod.tags.append(tags["environment"])
+       mod.repo = "https://github.com/ezhh/other_worlds"
+       mod.issueTracker = "https://github.com/ezhh/other_worlds/issues"
+       mod.forums = 16015
+       mod.shortDesc = "The content library should not be used yet as it is still in alpha"
+       mod.desc = "This is the long desc"
+       db.session.add(mod)
+
+       rel = PackageRelease()
+       rel.package = mod
+       rel.title = "v1.0.0"
+       rel.url = "https://github.com/ezhh/handholds/archive/master.zip"
+       rel.approved = True
+       db.session.add(rel)
+
        mod1 = Package()
+       mod1.approved = True
        mod1.name = "awards"
        mod1.title = "Awards"
+       mod1.license = licenses["LGPLv2.1"]
        mod1.type = PackageType.MOD
        mod1.author = ruben
+       mod1.tags.append(tags["player_effects"])
        mod1.repo = "https://github.com/rubenwardy/awards"
        mod1.issueTracker = "https://github.com/rubenwardy/awards/issues"
-       mod1.forums = "https://forum.minetest.net/viewtopic.php?t=4870"
+       mod1.forums = 4870
        mod1.shortDesc = "Adds achievements and an API to register new ones."
        mod1.desc = """
 Majority of awards are back ported from Calinou's old fork in Carbone, under same license.
@@ -50,16 +114,20 @@ awards.register_achievement("award_mesefind",{
        rel.package = mod1
        rel.title = "v1.0.0"
        rel.url = "https://github.com/rubenwardy/awards/archive/master.zip"
+       rel.approved = True
        db.session.add(rel)
 
        mod2 = Package()
+       mod2.approved = True
        mod2.name = "mesecons"
        mod2.title = "Mesecons"
+       mod2.tags.append(tags["tools"])
        mod2.type = PackageType.MOD
+       mod2.license = licenses["LGPLv3"]
        mod2.author = jeija
        mod2.repo = "https://github.com/minetest-mods/mesecons/"
        mod2.issueTracker = "https://github.com/minetest-mods/mesecons/issues"
-       mod2.forums = "https://forum.minetest.net/viewtopic.php?t=628"
+       mod2.forums = 628
        mod2.shortDesc = "Mesecons adds everything digital, from all kinds of sensors, switches, solar panels, detectors, pistons, lamps, sound blocks to advanced digital circuitry like logic gates and programmable blocks."
        mod2.desc = """
     ########################################################################
@@ -147,15 +215,87 @@ No warranty is provided, express or implied, for any part of the project.
        db.session.add(mod1)
        db.session.add(mod2)
 
+       mod = Package()
+       mod.approved = True
+       mod.name = "handholds"
+       mod.title = "Mountain Climbing"
+       mod.license = licenses["MIT"]
+       mod.type = PackageType.MOD
+       mod.author = ez
+       mod.tags.append(tags["player_effects"])
+       mod.repo = "https://github.com/ezhh/handholds"
+       mod.issueTracker = "https://github.com/ezhh/handholds/issues"
+       mod.forums = 17069
+       mod.shortDesc = "Adds hand holds and climbing thingies"
+       mod.desc = "This is the long desc"
+       db.session.add(mod)
+
+       rel = PackageRelease()
+       rel.package = mod
+       rel.title = "v1.0.0"
+       rel.url = "https://github.com/ezhh/handholds/archive/master.zip"
+       rel.approved = True
+       db.session.add(rel)
+
+       mod = Package()
+       mod.approved = True
+       mod.name = "other_worlds"
+       mod.title = "Other Worlds"
+       mod.license = licenses["MIT"]
+       mod.type = PackageType.MOD
+       mod.author = ez
+       mod.tags.append(tags["mapgen"])
+       mod.tags.append(tags["environment"])
+       mod.repo = "https://github.com/ezhh/other_worlds"
+       mod.issueTracker = "https://github.com/ezhh/other_worlds/issues"
+       mod.forums = 16015
+       mod.shortDesc = "Adds space with asteroids and comets"
+       mod.desc = "This is the long desc"
+       db.session.add(mod)
+
+       mod = Package()
+       mod.approved = True
+       mod.name = "food"
+       mod.title = "Food"
+       mod.license = licenses["LGPLv2.1"]
+       mod.type = PackageType.MOD
+       mod.author = ruben
+       mod.tags.append(tags["player_effects"])
+       mod.repo = "https://github.com/rubenwardy/food/"
+       mod.issueTracker = "https://github.com/rubenwardy/food/issues/"
+       mod.forums = 2960
+       mod.shortDesc = "Adds lots of food and an API to manage ingredients"
+       mod.desc = "This is the long desc"
+       db.session.add(mod)
+
+       mod = Package()
+       mod.approved = True
+       mod.name = "food_sweet"
+       mod.title = "Sweet Foods"
+       mod.license = licenses["CC0"]
+       mod.type = PackageType.MOD
+       mod.author = ruben
+       mod.tags.append(tags["player_effects"])
+       mod.repo = "https://github.com/rubenwardy/food_sweet/"
+       mod.issueTracker = "https://github.com/rubenwardy/food_sweet/issues/"
+       mod.forums = 9039
+       mod.shortDesc = "Adds sweet food"
+       mod.desc = "This is the long desc"
+       db.session.add(mod)
 
        game1 = Package()
+       game1.approved = True
        game1.name = "capturetheflag"
        game1.title = "Capture The Flag"
        game1.type = PackageType.GAME
+       game1.license = licenses["LGPLv2.1"]
        game1.author = ruben
+       game1.tags.append(tags["pvp"])
+       game1.tags.append(tags["survival"])
+       game1.tags.append(tags["multiplayer"])
        game1.repo = "https://github.com/rubenwardy/capturetheflag"
        game1.issueTracker = "https://github.com/rubenwardy/capturetheflag/issues"
-       game1.forums = "https://forum.minetest.net/viewtopic.php?t=12835"
+       game1.forums = 12835
        game1.shortDesc = "Two teams battle to snatch and return the enemy's flag, before the enemy takes their own!"
        game1.desc = """
 As seen on the Capture the Flag server (minetest.rubenwardy.com:30000)
@@ -165,8 +305,33 @@ Uses the CTF PvP Engine.
 
        db.session.add(game1)
 
+       rel = PackageRelease()
+       rel.package = game1
+       rel.title = "v1.0.0"
+       rel.url = "https://github.com/rubenwardy/capturetheflag/archive/master.zip"
+       rel.approved = True
+       db.session.add(rel)
 
 
+       mod = Package()
+       mod.approved = True
+       mod.name = "pixelbox"
+       mod.title = "PixelBOX Reloaded"
+       mod.license = licenses["CC0"]
+       mod.type = PackageType.TXP
+       mod.author = ruben
+       mod.forums = 14132
+       mod.shortDesc = "This is an update of the original PixelBOX texture pack by the brillant artist Gambit"
+       mod.desc = "This is the long desc"
+       db.session.add(mod)
+
+       rel = PackageRelease()
+       rel.package = mod
+       rel.title = "v1.0.0"
+       rel.url = "http://mamadou3.free.fr/Minetest/PixelBOX.zip"
+       rel.approved = True
+       db.session.add(rel)
+
        db.session.commit()
 else:
        print("Database already exists")